aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorLuis Carlos Cobo <luisca@cozybit.com>2007-08-02 13:19:24 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:50:15 -0400
commit63f0023bc34073bea8452a4770540c954f98208f (patch)
treea38556a66eb9ca81a2bac770ba32e3c6fe5f234a /drivers/net/wireless
parent2afc0c5d71a3dec6d35f3a234ed986d635ef41ad (diff)
[PATCH] libertas: pass boot2 version to firmware
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>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/libertas/cmd.c15
-rw-r--r--drivers/net/wireless/libertas/dev.h1
-rw-r--r--drivers/net/wireless/libertas/host.h2
-rw-r--r--drivers/net/wireless/libertas/hostcmd.h6
-rw-r--r--drivers/net/wireless/libertas/if_usb.c1
-rw-r--r--drivers/net/wireless/libertas/main.c4
6 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 72e8e27a6fb7..98092b995352 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -901,6 +901,17 @@ static int wlan_cmd_mesh_access(wlan_private * priv,
901 return 0; 901 return 0;
902} 902}
903 903
904static int wlan_cmd_set_boot2_ver(wlan_private * priv,
905 struct cmd_ds_command *cmd,
906 u16 cmd_action, void *pdata_buf)
907{
908 struct cmd_ds_set_boot2_ver *boot2_ver = &cmd->params.boot2_ver;
909 cmd->command = cpu_to_le16(CMD_SET_BOOT2_VER);
910 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_set_boot2_ver) + S_DS_GEN);
911 boot2_ver->version = priv->boot2_version;
912 return 0;
913}
914
904void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail) 915void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail)
905{ 916{
906 unsigned long flags; 917 unsigned long flags;
@@ -1372,6 +1383,10 @@ int libertas_prepare_and_send_command(wlan_private * priv,
1372 ret = wlan_cmd_mesh_access(priv, cmdptr, cmd_action, pdata_buf); 1383 ret = wlan_cmd_mesh_access(priv, cmdptr, cmd_action, pdata_buf);
1373 break; 1384 break;
1374 1385
1386 case CMD_SET_BOOT2_VER:
1387 ret = wlan_cmd_set_boot2_ver(priv, cmdptr, cmd_action, pdata_buf);
1388 break;
1389
1375 case CMD_GET_TSF: 1390 case CMD_GET_TSF:
1376 cmdptr->command = cpu_to_le16(CMD_GET_TSF); 1391 cmdptr->command = cpu_to_le16(CMD_GET_TSF);
1377 cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_get_tsf) + 1392 cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_get_tsf) +
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index 762c4792774c..a3c94d7388ab 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -104,6 +104,7 @@ struct _wlan_private {
104 int mesh_open; 104 int mesh_open;
105 int infra_open; 105 int infra_open;
106 int mesh_autostart_enabled; 106 int mesh_autostart_enabled;
107 __le16 boot2_version;
107 108
108 char name[DEV_NAME_LEN]; 109 char name[DEV_NAME_LEN];
109 110
diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h
index 4ccdbf9c473a..68fa11b3a2dc 100644
--- a/drivers/net/wireless/libertas/host.h
+++ b/drivers/net/wireless/libertas/host.h
@@ -114,6 +114,8 @@
114 114
115#define CMD_MESH_ACCESS 0x009b 115#define CMD_MESH_ACCESS 0x009b
116 116
117#define CMD_SET_BOOT2_VER 0x00a5
118
117/* For the IEEE Power Save */ 119/* For the IEEE Power Save */
118#define CMD_SUBCMD_ENTER_PS 0x0030 120#define CMD_SUBCMD_ENTER_PS 0x0030
119#define CMD_SUBCMD_EXIT_PS 0x0031 121#define CMD_SUBCMD_EXIT_PS 0x0031
diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h
index 52884eaf2edd..e1045dc02cce 100644
--- a/drivers/net/wireless/libertas/hostcmd.h
+++ b/drivers/net/wireless/libertas/hostcmd.h
@@ -410,6 +410,11 @@ struct cmd_ds_802_11_monitor_mode {
410 u16 mode; 410 u16 mode;
411}; 411};
412 412
413struct cmd_ds_set_boot2_ver {
414 u16 action;
415 u16 version;
416};
417
413struct cmd_ds_802_11_ps_mode { 418struct cmd_ds_802_11_ps_mode {
414 __le16 action; 419 __le16 action;
415 __le16 nullpktinterval; 420 __le16 nullpktinterval;
@@ -660,6 +665,7 @@ struct cmd_ds_command {
660 struct cmd_ds_bt_access bt; 665 struct cmd_ds_bt_access bt;
661 struct cmd_ds_fwt_access fwt; 666 struct cmd_ds_fwt_access fwt;
662 struct cmd_ds_mesh_access mesh; 667 struct cmd_ds_mesh_access mesh;
668 struct cmd_ds_set_boot2_ver boot2_ver;
663 struct cmd_ds_get_tsf gettsf; 669 struct cmd_ds_get_tsf gettsf;
664 struct cmd_ds_802_11_subscribe_event subscribe_event; 670 struct cmd_ds_802_11_subscribe_event subscribe_event;
665 } params; 671 } params;
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index d28802fb244b..53d479688ff9 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -219,6 +219,7 @@ static int if_usb_probe(struct usb_interface *intf,
219 priv->hw_host_to_card = if_usb_host_to_card; 219 priv->hw_host_to_card = if_usb_host_to_card;
220 priv->hw_get_int_status = if_usb_get_int_status; 220 priv->hw_get_int_status = if_usb_get_int_status;
221 priv->hw_read_event_cause = if_usb_read_event_cause; 221 priv->hw_read_event_cause = if_usb_read_event_cause;
222 priv->boot2_version = udev->descriptor.bcdDevice;
222 223
223 if (libertas_activate_card(priv)) 224 if (libertas_activate_card(priv))
224 goto err_activate_card; 225 goto err_activate_card;
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index bcd845060d4a..e20cd4e9ffc1 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -981,6 +981,10 @@ static int wlan_setup_station_hw(wlan_private * priv)
981 priv->mesh_autostart_enabled = 0; 981 priv->mesh_autostart_enabled = 0;
982 } 982 }
983 983
984 /* Set the boot2 version in firmware */
985 ret = libertas_prepare_and_send_command(priv, CMD_SET_BOOT2_VER,
986 0, CMD_OPTION_WAITFORRSP, 0, NULL);
987
984 ret = 0; 988 ret = 0;
985done: 989done:
986 lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret); 990 lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret);