wl1271: Removed wl1271_spi.h and made some functions static
[safe/jmp/linux-2.6] / drivers / net / wireless / wl12xx / wl1271_spi.c
index f89e1b3..51171d7 100644 (file)
 
 #include "wl1271.h"
 #include "wl12xx_80211.h"
-#include "wl1271_spi.h"
 #include "wl1271_io.h"
 
+#include "wl1271_reg.h"
+
+#define WSPI_CMD_READ                 0x40000000
+#define WSPI_CMD_WRITE                0x00000000
+#define WSPI_CMD_FIXED                0x20000000
+#define WSPI_CMD_BYTE_LENGTH          0x1FFE0000
+#define WSPI_CMD_BYTE_LENGTH_OFFSET   17
+#define WSPI_CMD_BYTE_ADDR            0x0001FFFF
+
+#define WSPI_INIT_CMD_CRC_LEN       5
+
+#define WSPI_INIT_CMD_START         0x00
+#define WSPI_INIT_CMD_TX            0x40
+/* the extra bypass bit is sampled by the TNET as '1' */
+#define WSPI_INIT_CMD_BYPASS_BIT    0x80
+#define WSPI_INIT_CMD_FIXEDBUSY_LEN 0x07
+#define WSPI_INIT_CMD_EN_FIXEDBUSY  0x80
+#define WSPI_INIT_CMD_DIS_FIXEDBUSY 0x00
+#define WSPI_INIT_CMD_IOD           0x40
+#define WSPI_INIT_CMD_IP            0x20
+#define WSPI_INIT_CMD_CS            0x10
+#define WSPI_INIT_CMD_WS            0x08
+#define WSPI_INIT_CMD_WSPI          0x01
+#define WSPI_INIT_CMD_END           0x01
+
+#define WSPI_INIT_CMD_LEN           8
+
+#define HW_ACCESS_WSPI_FIXED_BUSY_LEN \
+               ((WL1271_BUSY_WORD_LEN - 4) / sizeof(u32))
+#define HW_ACCESS_WSPI_INIT_CMD_MASK  0
+
 static inline struct spi_device *wl_to_spi(struct wl1271 *wl)
 {
        return wl->if_priv;
@@ -43,17 +73,17 @@ static struct device *wl1271_spi_wl_to_dev(struct wl1271 *wl)
        return &(wl_to_spi(wl)->dev);
 }
 
-void wl1271_spi_disable_interrupts(struct wl1271 *wl)
+static void wl1271_spi_disable_interrupts(struct wl1271 *wl)
 {
        disable_irq(wl->irq);
 }
 
-void wl1271_spi_enable_interrupts(struct wl1271 *wl)
+static void wl1271_spi_enable_interrupts(struct wl1271 *wl)
 {
        enable_irq(wl->irq);
 }
 
-void wl1271_spi_reset(struct wl1271 *wl)
+static void wl1271_spi_reset(struct wl1271 *wl)
 {
        u8 *cmd;
        struct spi_transfer t;
@@ -79,7 +109,7 @@ void wl1271_spi_reset(struct wl1271 *wl)
        wl1271_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN);
 }
 
-void wl1271_spi_init(struct wl1271 *wl)
+static void wl1271_spi_init(struct wl1271 *wl)
 {
        u8 crc[WSPI_INIT_CMD_CRC_LEN], *cmd;
        struct spi_transfer t;
@@ -199,7 +229,7 @@ static void wl1271_spi_read_busy(struct wl1271 *wl, void *buf, size_t len)
 }
 #endif
 
-void wl1271_spi_raw_read(struct wl1271 *wl, int addr, void *buf,
+static void wl1271_spi_raw_read(struct wl1271 *wl, int addr, void *buf,
                         size_t len, bool fixed)
 {
        struct spi_transfer t[3];
@@ -244,7 +274,7 @@ void wl1271_spi_raw_read(struct wl1271 *wl, int addr, void *buf,
        wl1271_dump(DEBUG_SPI, "spi_read buf <- ", buf, len);
 }
 
-void wl1271_spi_raw_write(struct wl1271 *wl, int addr, void *buf,
+static void wl1271_spi_raw_write(struct wl1271 *wl, int addr, void *buf,
                          size_t len, bool fixed)
 {
        struct spi_transfer t[2];