summaryrefslogtreecommitdiffstats
path: root/drivers/staging/ks7010/ks7010_sdio.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/ks7010/ks7010_sdio.h')
-rw-r--r--drivers/staging/ks7010/ks7010_sdio.h102
1 files changed, 59 insertions, 43 deletions
diff --git a/drivers/staging/ks7010/ks7010_sdio.h b/drivers/staging/ks7010/ks7010_sdio.h
index d7e1523..e4f56a1 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -22,10 +22,13 @@
/* Older sources suggest earlier versions were named 7910 or 79xx */
#define SDIO_DEVICE_ID_KS_7010 0x7910
-/* Read Status Register */
+/* Read/Write Status Register */
#define READ_STATUS 0x000000
-#define READ_STATUS_BUSY 0
-#define READ_STATUS_IDLE 1
+#define WRITE_STATUS 0x00000C
+enum reg_status_type {
+ REG_STATUS_BUSY,
+ REG_STATUS_IDLE
+};
/* Read Index Register */
#define READ_INDEX 0x000004
@@ -33,11 +36,6 @@
/* Read Data Size Register */
#define READ_DATA_SIZE 0x000008
-/* Write Status Register */
-#define WRITE_STATUS 0x00000C
-#define WRITE_STATUS_BUSY 0
-#define WRITE_STATUS_IDLE 1
-
/* Write Index Register */
#define WRITE_INDEX 0x000010
@@ -64,18 +62,20 @@
/* General Communication Register A */
#define GCR_A 0x000028
-#define GCR_A_INIT 0
-#define GCR_A_REMAP 1
-#define GCR_A_RUN 2
+enum gen_com_reg_a {
+ GCR_A_INIT,
+ GCR_A_REMAP,
+ GCR_A_RUN
+};
/* General Communication Register B */
#define GCR_B 0x00002C
-#define GCR_B_ACTIVE 0
-#define GCR_B_DOZE 1
+enum gen_com_reg_b {
+ GCR_B_ACTIVE,
+ GCR_B_DOZE
+};
/* Wakeup Register */
-/* #define WAKEUP 0x008104 */
-/* #define WAKEUP_REQ 0x00 */
#define WAKEUP 0x008018
#define WAKEUP_REQ 0x5a
@@ -85,62 +85,78 @@
#define KS7010_IRAM_ADDRESS 0x06000000
-/*
- * struct define
+/**
+ * struct ks_sdio_card - SDIO device data.
+ *
+ * Structure is used as the &struct sdio_func private data.
+ *
+ * @func: Pointer to the SDIO function device.
+ * @priv: Pointer to the &struct net_device private data.
*/
-struct hw_info_t {
- struct ks_sdio_card *sdio_card;
- struct completion ks7010_sdio_wait;
- struct workqueue_struct *ks7010sdio_wq;
- struct delayed_work rw_wq;
- unsigned char *read_buf;
- struct tasklet_struct rx_bh_task;
-};
-
-struct ks_sdio_packet {
- struct ks_sdio_packet *next;
- u16 nb;
- u8 buffer[0] __aligned(4);
-};
-
struct ks_sdio_card {
struct sdio_func *func;
struct ks_wlan_private *priv;
- spinlock_t lock;
};
/* Tx Device struct */
#define TX_DEVICE_BUFF_SIZE 1024
+/**
+ * struct tx_device_buffer - Queue item for the tx queue.
+ * @sendp: Pointer to the send request data.
+ * @size: Size of @sendp data.
+ * @complete_handler: Function called once data write to device is complete.
+ * @arg1: First argument to @complete_handler.
+ * @arg2: Second argument to @complete_handler.
+ */
struct tx_device_buffer {
- unsigned char *sendp; /* pointer of send req data */
+ unsigned char *sendp;
unsigned int size;
- void (*complete_handler) (void *arg1, void *arg2);
- void *arg1;
- void *arg2;
+ void (*complete_handler)(struct ks_wlan_private *priv,
+ struct sk_buff *skb);
+ struct sk_buff *skb;
};
+/**
+ * struct tx_device - Tx buffer queue.
+ * @tx_device_buffer: Queue buffer.
+ * @qhead: Head of tx queue.
+ * @qtail: Tail of tx queue.
+ * @tx_dev_lock: Queue lock.
+ */
struct tx_device {
struct tx_device_buffer tx_dev_buff[TX_DEVICE_BUFF_SIZE];
- unsigned int qhead; /* tx buffer queue first pointer */
- unsigned int qtail; /* tx buffer queue last pointer */
- spinlock_t tx_dev_lock;
+ unsigned int qhead;
+ unsigned int qtail;
+ spinlock_t tx_dev_lock; /* protect access to the queue */
};
/* Rx Device struct */
#define RX_DATA_SIZE (2 + 2 + 2347 + 1)
#define RX_DEVICE_BUFF_SIZE 32
+/**
+ * struct rx_device_buffer - Queue item for the rx queue.
+ * @data: rx data.
+ * @size: Size of @data.
+ */
struct rx_device_buffer {
unsigned char data[RX_DATA_SIZE];
unsigned int size;
};
+/**
+ * struct rx_device - Rx buffer queue.
+ * @rx_device_buffer: Queue buffer.
+ * @qhead: Head of rx queue.
+ * @qtail: Tail of rx queue.
+ * @rx_dev_lock: Queue lock.
+ */
struct rx_device {
struct rx_device_buffer rx_dev_buff[RX_DEVICE_BUFF_SIZE];
- unsigned int qhead; /* rx buffer queue first pointer */
- unsigned int qtail; /* rx buffer queue last pointer */
- spinlock_t rx_dev_lock;
+ unsigned int qhead;
+ unsigned int qtail;
+ spinlock_t rx_dev_lock; /* protect access to the queue */
};
#define ROM_FILE "ks7010sd.rom"
OpenPOWER on IntegriCloud