Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79014
b: refs/heads/master
c: 96287ac
h: refs/heads/master
v: v3
  • Loading branch information
Brajesh Dave authored and David S. Miller committed Jan 28, 2008
1 parent b66c72d commit 7d03650
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 01d77d8d4747d73cfb6daf35cdc906a2db8ded9d
refs/heads/master: 96287ac4f7b387acbe17e24b5e1bcbf3bc0e75cd
25 changes: 25 additions & 0 deletions trunk/drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
22 changes: 22 additions & 0 deletions trunk/drivers/net/wireless/libertas/cmdresp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/libertas/dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/libertas/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@

#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
Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/net/wireless/libertas/hostcmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));

Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/net/wireless/libertas/join.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7d03650

Please sign in to comment.