]> err.no Git - linux-2.6/commitdiff
libertas: configurable beacon interval
authorBrajesh Dave <brajeshd@marvell.com>
Tue, 20 Nov 2007 22:44:28 +0000 (17:44 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:04:53 +0000 (15:04 -0800)
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>
drivers/net/wireless/libertas/cmd.c
drivers/net/wireless/libertas/cmdresp.c
drivers/net/wireless/libertas/dev.h
drivers/net/wireless/libertas/host.h
drivers/net/wireless/libertas/hostcmd.h
drivers/net/wireless/libertas/join.c

index b4d1b1485840bc443a82f99e05ffaa9be7c018e1..3702c5da1f6f8bcdf96127b7f6904a2a5a2139af 100644 (file)
@@ -901,6 +901,28 @@ static int lbs_cmd_mesh_access(lbs_private * priv,
        return 0;
 }
 
+static int lbs_cmd_bcn_ctrl(struct lbs_private * priv,
+                               struct cmd_ds_command *cmd,
+                               u16 cmd_action)
+{
+       struct cmd_ds_802_11_beacon_control
+               *bcn_ctrl = &cmd->params.bcn_ctrl;
+       struct lbs_adapter *adapter = priv->adapter;
+
+       lbs_deb_enter(LBS_DEB_CMD);
+       cmd->size =
+           cpu_to_le16(sizeof(struct cmd_ds_802_11_beacon_control)
+                            + S_DS_GEN);
+       cmd->command = cpu_to_le16(CMD_802_11_BEACON_CTRL);
+
+       bcn_ctrl->action = cpu_to_le16(cmd_action);
+       bcn_ctrl->beacon_enable = cpu_to_le16(adapter->beacon_enable);
+       bcn_ctrl->beacon_period = cpu_to_le16(adapter->beacon_period);
+
+       lbs_deb_leave(LBS_DEB_CMD);
+       return 0;
+}
+
 static int lbs_cmd_set_boot2_ver(lbs_private * priv,
                                struct cmd_ds_command *cmd,
                                u16 cmd_action, void *pdata_buf)
@@ -1400,6 +1422,9 @@ int lbs_prepare_and_send_command(lbs_private * priv,
                                           S_DS_GEN);
                ret = 0;
                break;
+       case CMD_802_11_BEACON_CTRL:
+               ret = lbs_cmd_bcn_ctrl(priv, cmdptr, cmd_action);
+               break;
        default:
                lbs_deb_host("PREP_CMD: unknown command 0x%04x\n", cmd_no);
                ret = -1;
index 11b93f2cde8882d0786f6bfc36255f427dccf158..1f74810a5e15f9d7e6b6c48772aee891ba2b2c03 100644 (file)
@@ -536,6 +536,24 @@ static int lbs_ret_802_11_enable_rsn(lbs_private * priv,
        return 0;
 }
 
+static int lbs_ret_802_11_bcn_ctrl(struct lbs_private * priv,
+                                       struct cmd_ds_command *resp)
+{
+       struct cmd_ds_802_11_beacon_control *bcn_ctrl =
+           &resp->params.bcn_ctrl;
+       struct lbs_adapter *adapter = priv->adapter;
+
+       lbs_deb_enter(LBS_DEB_CMD);
+
+       if (bcn_ctrl->action == CMD_ACT_GET) {
+               adapter->beacon_enable = (u8) le16_to_cpu(bcn_ctrl->beacon_enable);
+               adapter->beacon_period = le16_to_cpu(bcn_ctrl->beacon_period);
+       }
+
+       lbs_deb_enter(LBS_DEB_CMD);
+       return 0;
+}
+
 static inline int handle_cmd_response(u16 respcmd,
                                      struct cmd_ds_command *resp,
                                      lbs_private *priv)
@@ -704,6 +722,10 @@ static inline int handle_cmd_response(u16 respcmd,
                        memcpy(adapter->cur_cmd->pdata_buf, &resp->params.mesh,
                               sizeof(resp->params.mesh));
                break;
+       case CMD_RET(CMD_802_11_BEACON_CTRL):
+               ret = lbs_ret_802_11_bcn_ctrl(priv, resp);
+               break;
+
        default:
                lbs_deb_host("CMD_RESP: unknown cmd response 0x%04x\n",
                            resp->command);
index 433b9bdf80f72c8d3b23465271c56190388c534c..53776bca86f1fd00851c6fb106f9570c1368e1ad 100644 (file)
@@ -263,6 +263,8 @@ struct _lbs_adapter {
        struct list_head network_free_list;
        struct bss_descriptor *networks;
 
+       u16 beacon_period;
+       u8 beacon_enable;
        u8 adhoccreate;
 
        /** capability Info used in Association, start, join */
index 3746f702d980c22a78eafeac9ac0d72c77b9c741..256cac2050cc4be8bddd1eadef63bcd62c2fbd3b 100644 (file)
 
 #define CMD_SET_BOOT2_VER                 0x00a5
 
+#define CMD_802_11_BEACON_CTRL        0x00b0
+
 /* For the IEEE Power Save */
 #define CMD_SUBCMD_ENTER_PS               0x0030
 #define CMD_SUBCMD_EXIT_PS                0x0031
index 6477ce0839d7a72c10f1a4166ca9c80af8a8234d..f4a265daff2cd9427c873db8f0a15e74247b1cdd 100644 (file)
@@ -332,6 +332,12 @@ struct cmd_ds_802_11_radio_control {
        __le16 control;
 };
 
+struct cmd_ds_802_11_beacon_control {
+       __le16 action;
+       __le16 beacon_enable;
+       __le16 beacon_period;
+};
+
 struct cmd_ds_802_11_sleep_params {
        /* ACT_GET/ACT_SET */
        __le16 action;
@@ -668,6 +674,7 @@ struct cmd_ds_command {
                struct cmd_ds_set_boot2_ver boot2_ver;
                struct cmd_ds_get_tsf gettsf;
                struct cmd_ds_802_11_subscribe_event subscribe_event;
+               struct cmd_ds_802_11_beacon_control bcn_ctrl;
        } params;
 } __attribute__ ((packed));
 
index 3854d91c90e228ff965e92ac9c3d6f53cadd4a7f..ca67524ee8dda0bbc855ffd4bcd248d5fe9868c8 100644 (file)
@@ -510,7 +510,9 @@ int lbs_cmd_80211_ad_hoc_start(lbs_private *priv,
        /* set the BSS type */
        adhs->bsstype = CMD_BSS_TYPE_IBSS;
        adapter->mode = IW_MODE_ADHOC;
-       adhs->beaconperiod = cpu_to_le16(MRVDRV_BEACON_INTERVAL);
+       if (adapter->beacon_period == 0)
+               adapter->beacon_period = MRVDRV_BEACON_INTERVAL;
+       adhs->beaconperiod = cpu_to_le16(adapter->beacon_period);
 
        /* set Physical param set */
 #define DS_PARA_IE_ID   3