diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2011-05-10 06:00:18 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-10 23:54:55 +0400 |
commit | 7cc5eb629cefa9a40295ff5ee4b1ec41ad855e8d (patch) | |
tree | 6ab4a0df7ac1e4b157791d539ce85f958e663675 /drivers/net/wireless/mwifiex/cmdevt.c | |
parent | 8369ae33b705222aa05ab53c7d6b4458f4ed161b (diff) | |
download | linux-7cc5eb629cefa9a40295ff5ee4b1ec41ad855e8d.tar.xz |
mwifiex: remove unnecessary struct mwifiex_opt_sleep_confirm_buffer
The structure definition is
struct mwifiex_opt_sleep_confirm_buffer {
u8 hdr[4];
struct mwifiex_opt_sleep_confirm ps_cfm_sleep;
} __packed;
For sleep_confirm command we already reserve 4 bytes (using skb_reserve())
for an interface header. It will be filled later by interface specific code.
We don't need "hdr[4]" element in above structure. So we can use
"struct mwifiex_opt_sleep_confirm" directly instead of
"struct mwifiex_opt_sleep_confirm_buffer".
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/cmdevt.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/cmdevt.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index 1c8b4f7cba47..5c7539932c27 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c @@ -223,24 +223,23 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv, static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter) { int ret; - u16 cmd_len; struct mwifiex_private *priv; - struct mwifiex_opt_sleep_confirm_buffer *sleep_cfm_buf = - (struct mwifiex_opt_sleep_confirm_buffer *) + struct mwifiex_opt_sleep_confirm *sleep_cfm_buf = + (struct mwifiex_opt_sleep_confirm *) adapter->sleep_cfm->data; - cmd_len = sizeof(struct mwifiex_opt_sleep_confirm); priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); - sleep_cfm_buf->ps_cfm_sleep.seq_num = + sleep_cfm_buf->seq_num = cpu_to_le16((HostCmd_SET_SEQ_NO_BSS_INFO (adapter->seq_num, priv->bss_num, priv->bss_type))); adapter->seq_num++; + skb_push(adapter->sleep_cfm, INTF_HEADER_LEN); ret = adapter->if_ops.host_to_card(adapter, MWIFIEX_TYPE_CMD, adapter->sleep_cfm->data, - adapter->sleep_cfm->len + - INTF_HEADER_LEN, NULL); + adapter->sleep_cfm->len, NULL); + skb_pull(adapter->sleep_cfm, INTF_HEADER_LEN); if (ret == -1) { dev_err(adapter->dev, "SLEEP_CFM: failed\n"); @@ -249,14 +248,14 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter) } if (GET_BSS_ROLE(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY)) == MWIFIEX_BSS_ROLE_STA) { - if (!sleep_cfm_buf->ps_cfm_sleep.resp_ctrl) + if (!sleep_cfm_buf->resp_ctrl) /* Response is not needed for sleep confirm command */ adapter->ps_state = PS_STATE_SLEEP; else adapter->ps_state = PS_STATE_SLEEP_CFM; - if (!sleep_cfm_buf->ps_cfm_sleep.resp_ctrl + if (!sleep_cfm_buf->resp_ctrl && (adapter->is_hs_configured && !adapter->sleep_period.period)) { adapter->pm_wakeup_card_req = true; |