wl12xx: moved firmware version reading routine to chip-specific functions
authorLuciano Coelho <luciano.coelho@nokia.com>
Fri, 12 Jun 2009 11:15:27 +0000 (14:15 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 10 Jul 2009 18:57:45 +0000 (14:57 -0400)
With WL1271, the firmware version can only be read right after booting the
chip.  To keep WL1251 aligned with this procedure, the code that reads the
firmware version initially has been moved to a common place where it can be
read from both chipsets.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/wl12xx/boot.c
drivers/net/wireless/wl12xx/wl1251.c
drivers/net/wireless/wl12xx/wl12xx.h

index 48ac08c429bd4264b0ffa25334fc4d1450b2f645..a6a26497dc13c3ff20c1410a024f91e890a32123 100644 (file)
@@ -269,6 +269,8 @@ int wl12xx_boot_run_firmware(struct wl12xx *wl)
        wl12xx_debug(DEBUG_MAILBOX, "cmd_box_addr 0x%x event_box_addr 0x%x",
                     wl->cmd_box_addr, wl->event_box_addr);
 
+       wl->chip.op_fw_version(wl);
+
        /*
         * in case of full asynchronous mode the firmware event must be
         * ready to receive event from the command mailbox
index e484a231e6e56046439215b46285427210e3c678..b793325d619eb493ae4d8e758d3002f51e7a4d52 100644 (file)
@@ -288,9 +288,6 @@ static int wl1251_boot(struct wl12xx *wl)
        if (ret < 0)
                goto out;
 
-       /* Get and save the firmware version */
-       wl12xx_acx_fw_version(wl, wl->chip.fw_ver, sizeof(wl->chip.fw_ver));
-
 out:
        return ret;
 }
@@ -394,6 +391,11 @@ static void wl1251_target_enable_interrupts(struct wl12xx *wl)
        wl12xx_boot_target_enable_interrupts(wl);
 }
 
+static void wl1251_fw_version(struct wl12xx *wl)
+{
+       wl12xx_acx_fw_version(wl, wl->chip.fw_ver, sizeof(wl->chip.fw_ver));
+}
+
 static void wl1251_irq_work(struct work_struct *work)
 {
        u32 intr;
@@ -709,6 +711,7 @@ void wl1251_setup(struct wl12xx *wl)
        wl->chip.op_target_enable_interrupts = wl1251_target_enable_interrupts;
        wl->chip.op_hw_init = wl1251_hw_init;
        wl->chip.op_plt_init = wl1251_plt_init;
+       wl->chip.op_fw_version = wl1251_fw_version;
 
        wl->chip.p_table = wl1251_part_table;
        wl->chip.acx_reg_table = wl1251_acx_reg_table;
index b87421461a7db6342a4eaaddb3193a51eb06b974..32f62a699b2a901d17d1a4e370ab8c8585f14ea7 100644 (file)
@@ -163,6 +163,7 @@ struct wl12xx_chip {
        void (*op_target_enable_interrupts)(struct wl12xx *wl);
        int (*op_hw_init)(struct wl12xx *wl);
        int (*op_plt_init)(struct wl12xx *wl);
+       void (*op_fw_version)(struct wl12xx *wl);
 
        struct wl12xx_partition_set *p_table;
        enum wl12xx_acx_int_reg *acx_reg_table;