summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mwifiex/init.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2011-05-10 02:00:18 (GMT)
committerJohn W. Linville <linville@tuxdriver.com>2011-05-10 19:54:55 (GMT)
commit7cc5eb629cefa9a40295ff5ee4b1ec41ad855e8d (patch)
tree6ab4a0df7ac1e4b157791d539ce85f958e663675 /drivers/net/wireless/mwifiex/init.c
parent8369ae33b705222aa05ab53c7d6b4458f4ed161b (diff)
downloadlinux-fsl-qoriq-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/init.c')
-rw-r--r--drivers/net/wireless/mwifiex/init.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index 6a8fd99..3f1559e 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -175,7 +175,7 @@ static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter)
}
adapter->sleep_cfm =
- dev_alloc_skb(sizeof(struct mwifiex_opt_sleep_confirm_buffer)
+ dev_alloc_skb(sizeof(struct mwifiex_opt_sleep_confirm)
+ INTF_HEADER_LEN);
if (!adapter->sleep_cfm) {
@@ -197,10 +197,10 @@ static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter)
*/
static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
{
- struct mwifiex_opt_sleep_confirm_buffer *sleep_cfm_buf = NULL;
+ struct mwifiex_opt_sleep_confirm *sleep_cfm_buf = NULL;
- skb_put(adapter->sleep_cfm, sizeof(sleep_cfm_buf->ps_cfm_sleep));
- sleep_cfm_buf = (struct mwifiex_opt_sleep_confirm_buffer *)
+ skb_put(adapter->sleep_cfm, sizeof(struct mwifiex_opt_sleep_confirm));
+ sleep_cfm_buf = (struct mwifiex_opt_sleep_confirm *)
(adapter->sleep_cfm->data);
adapter->cmd_sent = false;
@@ -268,16 +268,14 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
mwifiex_wmm_init(adapter);
if (adapter->sleep_cfm) {
- memset(&sleep_cfm_buf->ps_cfm_sleep, 0,
- adapter->sleep_cfm->len);
- sleep_cfm_buf->ps_cfm_sleep.command =
- cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH);
- sleep_cfm_buf->ps_cfm_sleep.size =
- cpu_to_le16(adapter->sleep_cfm->len);
- sleep_cfm_buf->ps_cfm_sleep.result = 0;
- sleep_cfm_buf->ps_cfm_sleep.action = cpu_to_le16(SLEEP_CONFIRM);
- sleep_cfm_buf->ps_cfm_sleep.resp_ctrl =
- cpu_to_le16(RESP_NEEDED);
+ memset(sleep_cfm_buf, 0, adapter->sleep_cfm->len);
+ sleep_cfm_buf->command =
+ cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH);
+ sleep_cfm_buf->size =
+ cpu_to_le16(adapter->sleep_cfm->len);
+ sleep_cfm_buf->result = 0;
+ sleep_cfm_buf->action = cpu_to_le16(SLEEP_CONFIRM);
+ sleep_cfm_buf->resp_ctrl = cpu_to_le16(RESP_NEEDED);
}
memset(&adapter->sleep_params, 0, sizeof(adapter->sleep_params));
memset(&adapter->sleep_period, 0, sizeof(adapter->sleep_period));