aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2011-05-09 22:00:18 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-05-10 15:54:55 -0400
commit7cc5eb629cefa9a40295ff5ee4b1ec41ad855e8d (patch)
tree6ab4a0df7ac1e4b157791d539ce85f958e663675
parent8369ae33b705222aa05ab53c7d6b4458f4ed161b (diff)
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>
-rw-r--r--drivers/net/wireless/mwifiex/cmdevt.c17
-rw-r--r--drivers/net/wireless/mwifiex/fw.h5
-rw-r--r--drivers/net/wireless/mwifiex/init.c26
3 files changed, 20 insertions, 28 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,
223static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter) 223static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
224{ 224{
225 int ret; 225 int ret;
226 u16 cmd_len;
227 struct mwifiex_private *priv; 226 struct mwifiex_private *priv;
228 struct mwifiex_opt_sleep_confirm_buffer *sleep_cfm_buf = 227 struct mwifiex_opt_sleep_confirm *sleep_cfm_buf =
229 (struct mwifiex_opt_sleep_confirm_buffer *) 228 (struct mwifiex_opt_sleep_confirm *)
230 adapter->sleep_cfm->data; 229 adapter->sleep_cfm->data;
231 cmd_len = sizeof(struct mwifiex_opt_sleep_confirm);
232 priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); 230 priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
233 231
234 sleep_cfm_buf->ps_cfm_sleep.seq_num = 232 sleep_cfm_buf->seq_num =
235 cpu_to_le16((HostCmd_SET_SEQ_NO_BSS_INFO 233 cpu_to_le16((HostCmd_SET_SEQ_NO_BSS_INFO
236 (adapter->seq_num, priv->bss_num, 234 (adapter->seq_num, priv->bss_num,
237 priv->bss_type))); 235 priv->bss_type)));
238 adapter->seq_num++; 236 adapter->seq_num++;
239 237
238 skb_push(adapter->sleep_cfm, INTF_HEADER_LEN);
240 ret = adapter->if_ops.host_to_card(adapter, MWIFIEX_TYPE_CMD, 239 ret = adapter->if_ops.host_to_card(adapter, MWIFIEX_TYPE_CMD,
241 adapter->sleep_cfm->data, 240 adapter->sleep_cfm->data,
242 adapter->sleep_cfm->len + 241 adapter->sleep_cfm->len, NULL);
243 INTF_HEADER_LEN, NULL); 242 skb_pull(adapter->sleep_cfm, INTF_HEADER_LEN);
244 243
245 if (ret == -1) { 244 if (ret == -1) {
246 dev_err(adapter->dev, "SLEEP_CFM: failed\n"); 245 dev_err(adapter->dev, "SLEEP_CFM: failed\n");
@@ -249,14 +248,14 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
249 } 248 }
250 if (GET_BSS_ROLE(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY)) 249 if (GET_BSS_ROLE(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY))
251 == MWIFIEX_BSS_ROLE_STA) { 250 == MWIFIEX_BSS_ROLE_STA) {
252 if (!sleep_cfm_buf->ps_cfm_sleep.resp_ctrl) 251 if (!sleep_cfm_buf->resp_ctrl)
253 /* Response is not needed for sleep 252 /* Response is not needed for sleep
254 confirm command */ 253 confirm command */
255 adapter->ps_state = PS_STATE_SLEEP; 254 adapter->ps_state = PS_STATE_SLEEP;
256 else 255 else
257 adapter->ps_state = PS_STATE_SLEEP_CFM; 256 adapter->ps_state = PS_STATE_SLEEP_CFM;
258 257
259 if (!sleep_cfm_buf->ps_cfm_sleep.resp_ctrl 258 if (!sleep_cfm_buf->resp_ctrl
260 && (adapter->is_hs_configured 259 && (adapter->is_hs_configured
261 && !adapter->sleep_period.period)) { 260 && !adapter->sleep_period.period)) {
262 adapter->pm_wakeup_card_req = true; 261 adapter->pm_wakeup_card_req = true;
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index 6d1c4545eda6..c6b26819cd38 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -1198,9 +1198,4 @@ struct mwifiex_opt_sleep_confirm {
1198 __le16 action; 1198 __le16 action;
1199 __le16 resp_ctrl; 1199 __le16 resp_ctrl;
1200} __packed; 1200} __packed;
1201
1202struct mwifiex_opt_sleep_confirm_buffer {
1203 u8 hdr[4];
1204 struct mwifiex_opt_sleep_confirm ps_cfm_sleep;
1205} __packed;
1206#endif /* !_MWIFIEX_FW_H_ */ 1201#endif /* !_MWIFIEX_FW_H_ */
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index 6a8fd9989a23..3f1559e61320 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)
175 } 175 }
176 176
177 adapter->sleep_cfm = 177 adapter->sleep_cfm =
178 dev_alloc_skb(sizeof(struct mwifiex_opt_sleep_confirm_buffer) 178 dev_alloc_skb(sizeof(struct mwifiex_opt_sleep_confirm)
179 + INTF_HEADER_LEN); 179 + INTF_HEADER_LEN);
180 180
181 if (!adapter->sleep_cfm) { 181 if (!adapter->sleep_cfm) {
@@ -197,10 +197,10 @@ static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter)
197 */ 197 */
198static void mwifiex_init_adapter(struct mwifiex_adapter *adapter) 198static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
199{ 199{
200 struct mwifiex_opt_sleep_confirm_buffer *sleep_cfm_buf = NULL; 200 struct mwifiex_opt_sleep_confirm *sleep_cfm_buf = NULL;
201 201
202 skb_put(adapter->sleep_cfm, sizeof(sleep_cfm_buf->ps_cfm_sleep)); 202 skb_put(adapter->sleep_cfm, sizeof(struct mwifiex_opt_sleep_confirm));
203 sleep_cfm_buf = (struct mwifiex_opt_sleep_confirm_buffer *) 203 sleep_cfm_buf = (struct mwifiex_opt_sleep_confirm *)
204 (adapter->sleep_cfm->data); 204 (adapter->sleep_cfm->data);
205 205
206 adapter->cmd_sent = false; 206 adapter->cmd_sent = false;
@@ -268,16 +268,14 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
268 mwifiex_wmm_init(adapter); 268 mwifiex_wmm_init(adapter);
269 269
270 if (adapter->sleep_cfm) { 270 if (adapter->sleep_cfm) {
271 memset(&sleep_cfm_buf->ps_cfm_sleep, 0, 271 memset(sleep_cfm_buf, 0, adapter->sleep_cfm->len);
272 adapter->sleep_cfm->len); 272 sleep_cfm_buf->command =
273 sleep_cfm_buf->ps_cfm_sleep.command = 273 cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH);
274 cpu_to_le16(HostCmd_CMD_802_11_PS_MODE_ENH); 274 sleep_cfm_buf->size =
275 sleep_cfm_buf->ps_cfm_sleep.size = 275 cpu_to_le16(adapter->sleep_cfm->len);
276 cpu_to_le16(adapter->sleep_cfm->len); 276 sleep_cfm_buf->result = 0;
277 sleep_cfm_buf->ps_cfm_sleep.result = 0; 277 sleep_cfm_buf->action = cpu_to_le16(SLEEP_CONFIRM);
278 sleep_cfm_buf->ps_cfm_sleep.action = cpu_to_le16(SLEEP_CONFIRM); 278 sleep_cfm_buf->resp_ctrl = cpu_to_le16(RESP_NEEDED);
279 sleep_cfm_buf->ps_cfm_sleep.resp_ctrl =
280 cpu_to_le16(RESP_NEEDED);
281 } 279 }
282 memset(&adapter->sleep_params, 0, sizeof(adapter->sleep_params)); 280 memset(&adapter->sleep_params, 0, sizeof(adapter->sleep_params));
283 memset(&adapter->sleep_period, 0, sizeof(adapter->sleep_period)); 281 memset(&adapter->sleep_period, 0, sizeof(adapter->sleep_period));