Commit aad97f5c authored by Mikhail Karpenko's avatar Mikhail Karpenko

Remove driver specific structure from ahci_cmd.h

parent d72b8ecc
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "ahci_elphel.h" #include "ahci_elphel.h"
#include "../elphel/exif393.h" #include "../elphel/exif393.h"
#include "../elphel/jpeghead.h" #include "../elphel/jpeghead.h"
#include "../elphel/circbuf.h"
#include "../elphel/x393_helpers.h" #include "../elphel/x393_helpers.h"
#define DRV_NAME "elphel-ahci" #define DRV_NAME "elphel-ahci"
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#include <uapi/elphel/ahci_cmd.h> #include <uapi/elphel/ahci_cmd.h>
#include "../elphel/circbuf.h"
#ifndef _AHCI_ELPHEL_EXT #ifndef _AHCI_ELPHEL_EXT
#define _AHCI_ELPHEL_EXT #define _AHCI_ELPHEL_EXT
......
...@@ -23,7 +23,12 @@ ...@@ -23,7 +23,12 @@
#define _CIRCBUF_H #define _CIRCBUF_H
#include <linux/poll.h> #include <linux/poll.h>
#include <uapi/elphel/ahci_cmd.h>
struct fvec {
void *iov_base; ///< pointer to allocated buffer
size_t iov_len; ///< the size (in bytes) of allocated buffer; set after allocation and is not modified during buffer lifetime
dma_addr_t iov_dma; ///< buffer physical address
};
/** @brief Circular buffer private data */ /** @brief Circular buffer private data */
struct circbuf_priv_t { struct circbuf_priv_t {
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#define DRV_CMD_FINISH (1 << 1) #define DRV_CMD_FINISH (1 << 1)
#define DRV_CMD_EXIF (1 << 2) #define DRV_CMD_EXIF (1 << 2)
#define NAME_TO_STR(NAME) #NAME
/** The path to Elphel AHCI driver sysfs entry. The trailing slash is mandatory. */ /** The path to Elphel AHCI driver sysfs entry. The trailing slash is mandatory. */
#define SYSFS_AHCI_ENTRY "/sys/devices/soc0/amba@0/80000000.elphel-ahci/" #define SYSFS_AHCI_ENTRY "/sys/devices/soc0/amba@0/80000000.elphel-ahci/"
/** sysfs entry name, no double quotes. This macro is used to populate <em>struct attribute</em> in #ahci_elphel.c */ /** sysfs entry name, no double quotes. This macro is used to populate <em>struct attribute</em> in #ahci_elphel.c */
...@@ -37,14 +38,14 @@ ...@@ -37,14 +38,14 @@
/** sysfs entry name, no double quotes. This macro is used to populate <em>struct attribute</em> in #ahci_elphel.c */ /** sysfs entry name, no double quotes. This macro is used to populate <em>struct attribute</em> in #ahci_elphel.c */
#define SYSFS_AHCI_FNAME_CURR lba_current #define SYSFS_AHCI_FNAME_CURR lba_current
/** This file is used to send commands to AHCI driver from user space applications (camogm as for now). */ /** This file is used to send commands to AHCI driver from user space applications (camogm as for now). */
#define SYSFS_AHCI_WRITE SYSFS_AHCI_ENTRY #SYSFS_AHCI_FNAME_WRITE #define SYSFS_AHCI_WRITE SYSFS_AHCI_ENTRY NAME_TO_STR(SYSFS_AHCI_FNAME_WRITE)
/** This file is used to control starting LBA of a disk buffer (R/W). */ /** This file is used to control starting LBA of a disk buffer (R/W). */
#define SYSFS_AHCI_LBA_START SYSFS_AHCI_ENTRY #SYSFS_AHCI_FNAME_START #define SYSFS_AHCI_LBA_START SYSFS_AHCI_ENTRY NAME_TO_STR(SYSFS_AHCI_FNAME_START)
/** This file is used to control ending LBA of a disk buffer (R/W). */ /** This file is used to control ending LBA of a disk buffer (R/W). */
#define SYSFS_AHCI_LBA_END SYSFS_AHCI_ENTRY #SYSFS_AHCI_FNAME_END #define SYSFS_AHCI_LBA_END SYSFS_AHCI_ENTRY NAME_TO_STR(SYSFS_AHCI_FNAME_END)
/** This file is used to control current LBA of a disk buffer (R/W). Use this file to set a pointer inside /** This file is used to control current LBA of a disk buffer (R/W). Use this file to set a pointer inside
* [lba_start..lba_end] area where next write operation will begin. */ * [lba_start..lba_end] area where next write operation will begin. */
#define SYSFS_AHCI_LBA_CURRENT SYSFS_AHCI_ENTRY #SYSFS_AHCI_FNAME_CURR #define SYSFS_AHCI_LBA_CURRENT SYSFS_AHCI_ENTRY NAME_TO_STR(SYSFS_AHCI_FNAME_CURR)
struct frame_data { struct frame_data {
unsigned int sensor_port; unsigned int sensor_port;
...@@ -54,10 +55,4 @@ struct frame_data { ...@@ -54,10 +55,4 @@ struct frame_data {
int cmd; int cmd;
}; };
struct fvec {
void *iov_base; ///< pointer to allocated buffer
size_t iov_len; ///< the size (in bytes) of allocated buffer; set after allocation and is not modified during buffer lifetime
dma_addr_t iov_dma; ///< buffer physical address
};
#endif /* _AHCI_CMD */ #endif /* _AHCI_CMD */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment