Merge to kernel-2.6.20-1.2949.fc6.vs2.2.0.1
[linux-2.6.git] / drivers / net / wireless / hermes.c
index 21c3d0d..29d3910 100644 (file)
  * under either the MPL or the GPL.
  */
 
-#include <linux/config.h>
-
 #include <linux/module.h>
-#include <linux/types.h>
-#include <linux/threads.h>
-#include <linux/smp.h>
-#include <asm/io.h>
-#include <linux/delay.h>
-#include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/net.h>
-#include <asm/errno.h>
+#include <linux/init.h>
+#include <linux/delay.h>
 
 #include "hermes.h"
 
@@ -128,12 +120,6 @@ void hermes_struct_init(hermes_t *hw, void __iomem *address, int reg_spacing)
        hw->iobase = address;
        hw->reg_spacing = reg_spacing;
        hw->inten = 0x0;
-
-#ifdef HERMES_DEBUG_BUFFER
-       hw->dbufp = 0;
-       memset(&hw->dbuf, 0xff, sizeof(hw->dbuf));
-       memset(&hw->profile, 0, sizeof(hw->profile));
-#endif
 }
 
 int hermes_init(hermes_t *hw)
@@ -354,19 +340,6 @@ static int hermes_bap_seek(hermes_t *hw, int bap, u16 id, u16 offset)
                reg = hermes_read_reg(hw, oreg);
        }
 
-#ifdef HERMES_DEBUG_BUFFER
-       hw->profile[HERMES_BAP_BUSY_TIMEOUT - k]++;
-
-       if (k < HERMES_BAP_BUSY_TIMEOUT) {
-               struct hermes_debug_entry *e = 
-                       &hw->dbuf[(hw->dbufp++) % HERMES_DEBUG_BUFSIZE];
-               e->bap = bap;
-               e->id = id;
-               e->offset = offset;
-               e->cycles = HERMES_BAP_BUSY_TIMEOUT - k;
-       }
-#endif
-
        if (reg & HERMES_OFFSET_BUSY)
                return -ETIMEDOUT;
 
@@ -405,7 +378,7 @@ static int hermes_bap_seek(hermes_t *hw, int bap, u16 id, u16 offset)
  *
  * Returns: < 0 on internal failure (errno), 0 on success, > 0 on error from firmware
  */
-int hermes_bap_pread(hermes_t *hw, int bap, void *buf, unsigned len,
+int hermes_bap_pread(hermes_t *hw, int bap, void *buf, int len,
                     u16 id, u16 offset)
 {
        int dreg = bap ? HERMES_DATA1 : HERMES_DATA0;
@@ -426,18 +399,17 @@ int hermes_bap_pread(hermes_t *hw, int bap, void *buf, unsigned len,
 }
 
 /* Write a block of data to the chip's buffer, via the
- * BAP. Synchronization/serialization is the caller's problem. len
- * must be even.
+ * BAP. Synchronization/serialization is the caller's problem.
  *
  * Returns: < 0 on internal failure (errno), 0 on success, > 0 on error from firmware
  */
-int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, unsigned len,
+int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, int len,
                      u16 id, u16 offset)
 {
        int dreg = bap ? HERMES_DATA1 : HERMES_DATA0;
        int err = 0;
 
-       if ( (len < 0) || (len % 2) )
+       if (len < 0)
                return -EINVAL;
 
        err = hermes_bap_seek(hw, bap, id, offset);
@@ -445,7 +417,7 @@ int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, unsigned len,
                goto out;
        
        /* Actually do the transfer */
-       hermes_write_words(hw, dreg, buf, len/2);
+       hermes_write_bytes(hw, dreg, buf, len);
 
  out:  
        return err;
@@ -523,7 +495,7 @@ int hermes_write_ltv(hermes_t *hw, int bap, u16 rid,
 
        count = length - 1;
 
-       hermes_write_words(hw, dreg, value, count);
+       hermes_write_bytes(hw, dreg, value, count << 1);
 
        err = hermes_docmd_wait(hw, HERMES_CMD_ACCESS | HERMES_CMD_WRITE, 
                                rid, NULL);