Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / net / wireless / prism54 / isl_38xx.c
index 3ee3102..23deee6 100644 (file)
@@ -18,7 +18,6 @@
  *
  */
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/delay.h>
@@ -44,7 +43,7 @@
  *  register located at offset %ISL38XX_INT_IDENT_REG.
  */
 void
-isl38xx_disable_interrupts(void *device)
+isl38xx_disable_interrupts(void __iomem *device)
 {
        isl38xx_w32_flush(device, 0x00000000, ISL38XX_INT_EN_REG);
        udelay(ISL38XX_WRITEIO_DELAY);
@@ -52,7 +51,7 @@ isl38xx_disable_interrupts(void *device)
 
 void
 isl38xx_handle_sleep_request(isl38xx_control_block *control_block,
-                            int *powerstate, void *device_base)
+                            int *powerstate, void __iomem *device_base)
 {
        /* device requests to go into sleep mode
         * check whether the transmit queues for data and management are empty */
@@ -88,7 +87,7 @@ isl38xx_handle_sleep_request(isl38xx_control_block *control_block,
 
 void
 isl38xx_handle_wakeup(isl38xx_control_block *control_block,
-                     int *powerstate, void *device_base)
+                     int *powerstate, void __iomem *device_base)
 {
        /* device is in active state, update the powerstate flag */
        *powerstate = ISL38XX_PSM_ACTIVE_STATE;
@@ -110,12 +109,13 @@ isl38xx_handle_wakeup(isl38xx_control_block *control_block,
 }
 
 void
-isl38xx_trigger_device(int asleep, void *device_base)
+isl38xx_trigger_device(int asleep, void __iomem *device_base)
 {
-       struct timeval current_time;
-       u32 reg, counter = 0;
+       u32 reg;
 
 #if VERBOSE > SHOW_ERROR_MESSAGES
+       u32 counter = 0;
+       struct timeval current_time;
        DEBUG(SHOW_FUNCTION_CALLS, "isl38xx trigger device\n");
 #endif
 
@@ -125,56 +125,54 @@ isl38xx_trigger_device(int asleep, void *device_base)
 #if VERBOSE > SHOW_ERROR_MESSAGES
                do_gettimeofday(&current_time);
                DEBUG(SHOW_TRACING, "%08li.%08li Device wakeup triggered\n",
-                     current_time.tv_sec, current_time.tv_usec);
-#endif
+                     current_time.tv_sec, (long)current_time.tv_usec);
 
                DEBUG(SHOW_TRACING, "%08li.%08li Device register read %08x\n",
-                     current_time.tv_sec, current_time.tv_usec,
+                     current_time.tv_sec, (long)current_time.tv_usec,
                      readl(device_base + ISL38XX_CTRL_STAT_REG));
-               udelay(ISL38XX_WRITEIO_DELAY);
+#endif
 
-               if (reg = readl(device_base + ISL38XX_INT_IDENT_REG),
-                   reg == 0xabadface) {
+               reg = readl(device_base + ISL38XX_INT_IDENT_REG);
+               if (reg == 0xabadface) {
 #if VERBOSE > SHOW_ERROR_MESSAGES
                        do_gettimeofday(&current_time);
                        DEBUG(SHOW_TRACING,
                              "%08li.%08li Device register abadface\n",
-                             current_time.tv_sec, current_time.tv_usec);
+                             current_time.tv_sec, (long)current_time.tv_usec);
 #endif
                        /* read the Device Status Register until Sleepmode bit is set */
                        while (reg = readl(device_base + ISL38XX_CTRL_STAT_REG),
                               (reg & ISL38XX_CTRL_STAT_SLEEPMODE) == 0) {
                                udelay(ISL38XX_WRITEIO_DELAY);
+#if VERBOSE > SHOW_ERROR_MESSAGES
                                counter++;
+#endif
                        }
 
+#if VERBOSE > SHOW_ERROR_MESSAGES
                        DEBUG(SHOW_TRACING,
                              "%08li.%08li Device register read %08x\n",
-                             current_time.tv_sec, current_time.tv_usec,
+                             current_time.tv_sec, (long)current_time.tv_usec,
                              readl(device_base + ISL38XX_CTRL_STAT_REG));
-                       udelay(ISL38XX_WRITEIO_DELAY);
-
-#if VERBOSE > SHOW_ERROR_MESSAGES
                        do_gettimeofday(&current_time);
                        DEBUG(SHOW_TRACING,
                              "%08li.%08li Device asleep counter %i\n",
-                             current_time.tv_sec, current_time.tv_usec,
+                             current_time.tv_sec, (long)current_time.tv_usec,
                              counter);
 #endif
                }
                /* assert the Wakeup interrupt in the Device Interrupt Register */
                isl38xx_w32_flush(device_base, ISL38XX_DEV_INT_WAKEUP,
                                  ISL38XX_DEV_INT_REG);
+
+#if VERBOSE > SHOW_ERROR_MESSAGES
                udelay(ISL38XX_WRITEIO_DELAY);
 
                /* perform another read on the Device Status Register */
                reg = readl(device_base + ISL38XX_CTRL_STAT_REG);
-               udelay(ISL38XX_WRITEIO_DELAY);
-
-#if VERBOSE > SHOW_ERROR_MESSAGES
                do_gettimeofday(&current_time);
                DEBUG(SHOW_TRACING, "%08li.%08li Device register read %08x\n",
-                     current_time.tv_sec, current_time.tv_usec, reg);
+                     current_time.tv_sec, (long)current_time.tv_usec, reg);
 #endif
        } else {
                /* device is (still) awake  */
@@ -185,17 +183,14 @@ isl38xx_trigger_device(int asleep, void *device_base)
 
                isl38xx_w32_flush(device_base, ISL38XX_DEV_INT_UPDATE,
                                  ISL38XX_DEV_INT_REG);
-               udelay(ISL38XX_WRITEIO_DELAY);
        }
 }
 
 void
-isl38xx_interface_reset(void *device_base, dma_addr_t host_address)
+isl38xx_interface_reset(void __iomem *device_base, dma_addr_t host_address)
 {
-       u32 reg;
-
 #if VERBOSE > SHOW_ERROR_MESSAGES
-       DEBUG(SHOW_FUNCTION_CALLS, "isl38xx_interface_reset \n");
+       DEBUG(SHOW_FUNCTION_CALLS, "isl38xx_interface_reset\n");
 #endif
 
        /* load the address of the control block in the device */
@@ -203,8 +198,7 @@ isl38xx_interface_reset(void *device_base, dma_addr_t host_address)
        udelay(ISL38XX_WRITEIO_DELAY);
 
        /* set the reset bit in the Device Interrupt Register */
-       isl38xx_w32_flush(device_base, ISL38XX_DEV_INT_RESET,
-                         ISL38XX_DEV_INT_REG);
+       isl38xx_w32_flush(device_base, ISL38XX_DEV_INT_RESET, ISL38XX_DEV_INT_REG);
        udelay(ISL38XX_WRITEIO_DELAY);
 
        /* enable the interrupt for detecting initialization */
@@ -212,14 +206,12 @@ isl38xx_interface_reset(void *device_base, dma_addr_t host_address)
        /* Note: Do not enable other interrupts here. We want the
         * device to have come up first 100% before allowing any other 
         * interrupts. */
-       reg = ISL38XX_INT_IDENT_INIT;
-
-       isl38xx_w32_flush(device_base, reg, ISL38XX_INT_EN_REG);
+       isl38xx_w32_flush(device_base, ISL38XX_INT_IDENT_INIT, ISL38XX_INT_EN_REG);
        udelay(ISL38XX_WRITEIO_DELAY);  /* allow complete full reset */
 }
 
 void
-isl38xx_enable_common_interrupts(void *device_base) {
+isl38xx_enable_common_interrupts(void __iomem *device_base) {
        u32 reg;
        reg = ( ISL38XX_INT_IDENT_UPDATE | 
                        ISL38XX_INT_IDENT_SLEEP | ISL38XX_INT_IDENT_WAKEUP);