]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
[PATCH] libertas: pass boot2 version to firmware
authorLuis Carlos Cobo <luisca@cozybit.com>
Thu, 2 Aug 2007 17:19:24 +0000 (13:19 -0400)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:50:15 +0000 (16:50 -0700)
Boot2 version used to be hardcoded in the uploaded firmware,
this patch preserves the boot2 version before uploading firmware
and sends it to the firmware again on resume.

Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/cmd.c
drivers/net/wireless/libertas/dev.h
drivers/net/wireless/libertas/host.h
drivers/net/wireless/libertas/hostcmd.h
drivers/net/wireless/libertas/if_usb.c
drivers/net/wireless/libertas/main.c

index 72e8e27a6fb79fdb20ba325cbf8686c11c7e20e5..98092b99535216e9174d097613ad66a5457c3807 100644 (file)
@@ -901,6 +901,17 @@ static int wlan_cmd_mesh_access(wlan_private * priv,
        return 0;
 }
 
+static int wlan_cmd_set_boot2_ver(wlan_private * priv,
+                               struct cmd_ds_command *cmd,
+                               u16 cmd_action, void *pdata_buf)
+{
+       struct cmd_ds_set_boot2_ver *boot2_ver = &cmd->params.boot2_ver;
+       cmd->command = cpu_to_le16(CMD_SET_BOOT2_VER);
+       cmd->size = cpu_to_le16(sizeof(struct cmd_ds_set_boot2_ver) + S_DS_GEN);
+       boot2_ver->version = priv->boot2_version;
+       return 0;
+}
+
 void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail)
 {
        unsigned long flags;
@@ -1372,6 +1383,10 @@ int libertas_prepare_and_send_command(wlan_private * priv,
                ret = wlan_cmd_mesh_access(priv, cmdptr, cmd_action, pdata_buf);
                break;
 
+       case CMD_SET_BOOT2_VER:
+               ret = wlan_cmd_set_boot2_ver(priv, cmdptr, cmd_action, pdata_buf);
+               break;
+
        case CMD_GET_TSF:
                cmdptr->command = cpu_to_le16(CMD_GET_TSF);
                cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_get_tsf) +
index 762c4792774c0efb0f2ed052714bddaa41426228..a3c94d7388ab0d68f2406d46d8337fa2aeba44db 100644 (file)
@@ -104,6 +104,7 @@ struct _wlan_private {
        int mesh_open;
        int infra_open;
        int mesh_autostart_enabled;
+       __le16 boot2_version;
 
        char name[DEV_NAME_LEN];
 
index 4ccdbf9c473a725eebd417dbfd95a937ac872df2..68fa11b3a2dc84d492e51e16376651faef137cc5 100644 (file)
 
 #define CMD_MESH_ACCESS               0x009b
 
+#define CMD_SET_BOOT2_VER                 0x00a5
+
 /* For the IEEE Power Save */
 #define CMD_SUBCMD_ENTER_PS               0x0030
 #define CMD_SUBCMD_EXIT_PS                0x0031
index 52884eaf2eddfa432fcae10f00f3c5f2e99e6114..e1045dc02cce26ca18736bfba0568d591d4e17b9 100644 (file)
@@ -410,6 +410,11 @@ struct cmd_ds_802_11_monitor_mode {
        u16 mode;
 };
 
+struct cmd_ds_set_boot2_ver {
+       u16 action;
+       u16 version;
+};
+
 struct cmd_ds_802_11_ps_mode {
        __le16 action;
        __le16 nullpktinterval;
@@ -660,6 +665,7 @@ struct cmd_ds_command {
                struct cmd_ds_bt_access bt;
                struct cmd_ds_fwt_access fwt;
                struct cmd_ds_mesh_access mesh;
+               struct cmd_ds_set_boot2_ver boot2_ver;
                struct cmd_ds_get_tsf gettsf;
                struct cmd_ds_802_11_subscribe_event subscribe_event;
        } params;
index d28802fb244b2dadd010fff4cea2fcac7074652a..53d479688ff9f2dd73e594adc3c15754a1491fa0 100644 (file)
@@ -219,6 +219,7 @@ static int if_usb_probe(struct usb_interface *intf,
        priv->hw_host_to_card = if_usb_host_to_card;
        priv->hw_get_int_status = if_usb_get_int_status;
        priv->hw_read_event_cause = if_usb_read_event_cause;
+       priv->boot2_version = udev->descriptor.bcdDevice;
 
        if (libertas_activate_card(priv))
                goto err_activate_card;
index bcd845060d4a5654a8201338ba3d5936ac733594..e20cd4e9ffc18c4e65b1fa7daaf49b283a09aff0 100644 (file)
@@ -981,6 +981,10 @@ static int wlan_setup_station_hw(wlan_private * priv)
                priv->mesh_autostart_enabled = 0;
        }
 
+       /* Set the boot2 version in firmware */
+       ret = libertas_prepare_and_send_command(priv, CMD_SET_BOOT2_VER,
+                                   0, CMD_OPTION_WAITFORRSP, 0, NULL);
+
        ret = 0;
 done:
        lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret);