aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorBrajesh Dave <brajeshd@marvell.com>2007-11-20 17:44:28 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:04:53 -0500
commit96287ac4f7b387acbe17e24b5e1bcbf3bc0e75cd (patch)
treef2dff3b7889ff430c66b1331cde0de8c5f6acafb /drivers/net
parent01d77d8d4747d73cfb6daf35cdc906a2db8ded9d (diff)
libertas: configurable beacon interval
Requires firmware version 5.110.19.p0 or newer, available here: http://dev.laptop.org/pub/firmware/libertas/ Signed-off-by: Ashish Shukla <ashishs@marvell.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/libertas/cmd.c25
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c22
-rw-r--r--drivers/net/wireless/libertas/dev.h2
-rw-r--r--drivers/net/wireless/libertas/host.h2
-rw-r--r--drivers/net/wireless/libertas/hostcmd.h7
-rw-r--r--drivers/net/wireless/libertas/join.c4
6 files changed, 61 insertions, 1 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index b4d1b1485840..3702c5da1f6f 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -901,6 +901,28 @@ static int lbs_cmd_mesh_access(lbs_private * priv,
901 return 0; 901 return 0;
902} 902}
903 903
904static int lbs_cmd_bcn_ctrl(struct lbs_private * priv,
905 struct cmd_ds_command *cmd,
906 u16 cmd_action)
907{
908 struct cmd_ds_802_11_beacon_control
909 *bcn_ctrl = &cmd->params.bcn_ctrl;
910 struct lbs_adapter *adapter = priv->adapter;
911
912 lbs_deb_enter(LBS_DEB_CMD);
913 cmd->size =
914 cpu_to_le16(sizeof(struct cmd_ds_802_11_beacon_control)
915 + S_DS_GEN);
916 cmd->command = cpu_to_le16(CMD_802_11_BEACON_CTRL);
917
918 bcn_ctrl->action = cpu_to_le16(cmd_action);
919 bcn_ctrl->beacon_enable = cpu_to_le16(adapter->beacon_enable);
920 bcn_ctrl->beacon_period = cpu_to_le16(adapter->beacon_period);
921
922 lbs_deb_leave(LBS_DEB_CMD);
923 return 0;
924}
925
904static int lbs_cmd_set_boot2_ver(lbs_private * priv, 926static int lbs_cmd_set_boot2_ver(lbs_private * priv,
905 struct cmd_ds_command *cmd, 927 struct cmd_ds_command *cmd,
906 u16 cmd_action, void *pdata_buf) 928 u16 cmd_action, void *pdata_buf)
@@ -1400,6 +1422,9 @@ int lbs_prepare_and_send_command(lbs_private * priv,
1400 S_DS_GEN); 1422 S_DS_GEN);
1401 ret = 0; 1423 ret = 0;
1402 break; 1424 break;
1425 case CMD_802_11_BEACON_CTRL:
1426 ret = lbs_cmd_bcn_ctrl(priv, cmdptr, cmd_action);
1427 break;
1403 default: 1428 default:
1404 lbs_deb_host("PREP_CMD: unknown command 0x%04x\n", cmd_no); 1429 lbs_deb_host("PREP_CMD: unknown command 0x%04x\n", cmd_no);
1405 ret = -1; 1430 ret = -1;
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 11b93f2cde88..1f74810a5e15 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -536,6 +536,24 @@ static int lbs_ret_802_11_enable_rsn(lbs_private * priv,
536 return 0; 536 return 0;
537} 537}
538 538
539static int lbs_ret_802_11_bcn_ctrl(struct lbs_private * priv,
540 struct cmd_ds_command *resp)
541{
542 struct cmd_ds_802_11_beacon_control *bcn_ctrl =
543 &resp->params.bcn_ctrl;
544 struct lbs_adapter *adapter = priv->adapter;
545
546 lbs_deb_enter(LBS_DEB_CMD);
547
548 if (bcn_ctrl->action == CMD_ACT_GET) {
549 adapter->beacon_enable = (u8) le16_to_cpu(bcn_ctrl->beacon_enable);
550 adapter->beacon_period = le16_to_cpu(bcn_ctrl->beacon_period);
551 }
552
553 lbs_deb_enter(LBS_DEB_CMD);
554 return 0;
555}
556
539static inline int handle_cmd_response(u16 respcmd, 557static inline int handle_cmd_response(u16 respcmd,
540 struct cmd_ds_command *resp, 558 struct cmd_ds_command *resp,
541 lbs_private *priv) 559 lbs_private *priv)
@@ -704,6 +722,10 @@ static inline int handle_cmd_response(u16 respcmd,
704 memcpy(adapter->cur_cmd->pdata_buf, &resp->params.mesh, 722 memcpy(adapter->cur_cmd->pdata_buf, &resp->params.mesh,
705 sizeof(resp->params.mesh)); 723 sizeof(resp->params.mesh));
706 break; 724 break;
725 case CMD_RET(CMD_802_11_BEACON_CTRL):
726 ret = lbs_ret_802_11_bcn_ctrl(priv, resp);
727 break;
728
707 default: 729 default:
708 lbs_deb_host("CMD_RESP: unknown cmd response 0x%04x\n", 730 lbs_deb_host("CMD_RESP: unknown cmd response 0x%04x\n",
709 resp->command); 731 resp->command);
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index 433b9bdf80f7..53776bca86f1 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -263,6 +263,8 @@ struct _lbs_adapter {
263 struct list_head network_free_list; 263 struct list_head network_free_list;
264 struct bss_descriptor *networks; 264 struct bss_descriptor *networks;
265 265
266 u16 beacon_period;
267 u8 beacon_enable;
266 u8 adhoccreate; 268 u8 adhoccreate;
267 269
268 /** capability Info used in Association, start, join */ 270 /** capability Info used in Association, start, join */
diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h
index 3746f702d980..256cac2050cc 100644
--- a/drivers/net/wireless/libertas/host.h
+++ b/drivers/net/wireless/libertas/host.h
@@ -116,6 +116,8 @@
116 116
117#define CMD_SET_BOOT2_VER 0x00a5 117#define CMD_SET_BOOT2_VER 0x00a5
118 118
119#define CMD_802_11_BEACON_CTRL 0x00b0
120
119/* For the IEEE Power Save */ 121/* For the IEEE Power Save */
120#define CMD_SUBCMD_ENTER_PS 0x0030 122#define CMD_SUBCMD_ENTER_PS 0x0030
121#define CMD_SUBCMD_EXIT_PS 0x0031 123#define CMD_SUBCMD_EXIT_PS 0x0031
diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h
index 6477ce0839d7..f4a265daff2c 100644
--- a/drivers/net/wireless/libertas/hostcmd.h
+++ b/drivers/net/wireless/libertas/hostcmd.h
@@ -332,6 +332,12 @@ struct cmd_ds_802_11_radio_control {
332 __le16 control; 332 __le16 control;
333}; 333};
334 334
335struct cmd_ds_802_11_beacon_control {
336 __le16 action;
337 __le16 beacon_enable;
338 __le16 beacon_period;
339};
340
335struct cmd_ds_802_11_sleep_params { 341struct cmd_ds_802_11_sleep_params {
336 /* ACT_GET/ACT_SET */ 342 /* ACT_GET/ACT_SET */
337 __le16 action; 343 __le16 action;
@@ -668,6 +674,7 @@ struct cmd_ds_command {
668 struct cmd_ds_set_boot2_ver boot2_ver; 674 struct cmd_ds_set_boot2_ver boot2_ver;
669 struct cmd_ds_get_tsf gettsf; 675 struct cmd_ds_get_tsf gettsf;
670 struct cmd_ds_802_11_subscribe_event subscribe_event; 676 struct cmd_ds_802_11_subscribe_event subscribe_event;
677 struct cmd_ds_802_11_beacon_control bcn_ctrl;
671 } params; 678 } params;
672} __attribute__ ((packed)); 679} __attribute__ ((packed));
673 680
diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c
index 3854d91c90e2..ca67524ee8dd 100644
--- a/drivers/net/wireless/libertas/join.c
+++ b/drivers/net/wireless/libertas/join.c
@@ -510,7 +510,9 @@ int lbs_cmd_80211_ad_hoc_start(lbs_private *priv,
510 /* set the BSS type */ 510 /* set the BSS type */
511 adhs->bsstype = CMD_BSS_TYPE_IBSS; 511 adhs->bsstype = CMD_BSS_TYPE_IBSS;
512 adapter->mode = IW_MODE_ADHOC; 512 adapter->mode = IW_MODE_ADHOC;
513 adhs->beaconperiod = cpu_to_le16(MRVDRV_BEACON_INTERVAL); 513 if (adapter->beacon_period == 0)
514 adapter->beacon_period = MRVDRV_BEACON_INTERVAL;
515 adhs->beaconperiod = cpu_to_le16(adapter->beacon_period);
514 516
515 /* set Physical param set */ 517 /* set Physical param set */
516#define DS_PARA_IE_ID 3 518#define DS_PARA_IE_ID 3