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)
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;
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)
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);
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 */
#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
__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;
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));
/* 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