2 * Marvell Wireless LAN device driver: functions for station ioctl
4 * Copyright (C) 2011-2014, Marvell International Ltd.
6 * This software file (the "File") is distributed by Marvell International
7 * Ltd. under the terms of the GNU General Public License Version 2, June 1991
8 * (the "License"). You may use, redistribute and/or modify this File in
9 * accordance with the terms and conditions of the License, a copy of which
10 * is available by writing to the Free Software Foundation, Inc.,
11 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
12 * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
14 * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
16 * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
17 * this warranty disclaimer.
29 static int disconnect_on_suspend
;
30 module_param(disconnect_on_suspend
, int, 0644);
33 * Copies the multicast address list from device to driver.
35 * This function does not validate the destination memory for
36 * size, and the calling function must ensure enough memory is
39 int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list
*mlist
,
40 struct net_device
*dev
)
43 struct netdev_hw_addr
*ha
;
45 netdev_for_each_mc_addr(ha
, dev
)
46 memcpy(&mlist
->mac_list
[i
++], ha
->addr
, ETH_ALEN
);
52 * Wait queue completion handler.
54 * This function waits on a cmd wait queue. It also cancels the pending
55 * request after waking up, in case of errors.
57 int mwifiex_wait_queue_complete(struct mwifiex_adapter
*adapter
,
58 struct cmd_ctrl_node
*cmd_queued
)
62 /* Wait for completion */
63 status
= wait_event_interruptible_timeout(adapter
->cmd_wait_q
.wait
,
64 *(cmd_queued
->condition
),
69 dev_err(adapter
->dev
, "cmd_wait_q terminated: %d\n", status
);
70 mwifiex_cancel_all_pending_cmd(adapter
);
74 status
= adapter
->cmd_wait_q
.status
;
75 adapter
->cmd_wait_q
.status
= 0;
81 * This function prepares the correct firmware command and
82 * issues it to set the multicast list.
84 * This function can be used to enable promiscuous mode, or enable all
85 * multicast packets, or to enable selective multicast.
87 int mwifiex_request_set_multicast_list(struct mwifiex_private
*priv
,
88 struct mwifiex_multicast_list
*mcast_list
)
93 old_pkt_filter
= priv
->curr_pkt_filter
;
95 if (mcast_list
->mode
== MWIFIEX_PROMISC_MODE
) {
96 dev_dbg(priv
->adapter
->dev
, "info: Enable Promiscuous mode\n");
97 priv
->curr_pkt_filter
|= HostCmd_ACT_MAC_PROMISCUOUS_ENABLE
;
98 priv
->curr_pkt_filter
&=
99 ~HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE
;
102 priv
->curr_pkt_filter
&= ~HostCmd_ACT_MAC_PROMISCUOUS_ENABLE
;
103 if (mcast_list
->mode
== MWIFIEX_ALL_MULTI_MODE
) {
104 dev_dbg(priv
->adapter
->dev
,
105 "info: Enabling All Multicast!\n");
106 priv
->curr_pkt_filter
|=
107 HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE
;
109 priv
->curr_pkt_filter
&=
110 ~HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE
;
111 dev_dbg(priv
->adapter
->dev
,
112 "info: Set multicast list=%d\n",
113 mcast_list
->num_multicast_addr
);
114 /* Send multicast addresses to firmware */
115 ret
= mwifiex_send_cmd(priv
,
116 HostCmd_CMD_MAC_MULTICAST_ADR
,
117 HostCmd_ACT_GEN_SET
, 0,
121 dev_dbg(priv
->adapter
->dev
,
122 "info: old_pkt_filter=%#x, curr_pkt_filter=%#x\n",
123 old_pkt_filter
, priv
->curr_pkt_filter
);
124 if (old_pkt_filter
!= priv
->curr_pkt_filter
) {
125 ret
= mwifiex_send_cmd(priv
, HostCmd_CMD_MAC_CONTROL
,
127 0, &priv
->curr_pkt_filter
, false);
134 * This function fills bss descriptor structure using provided
136 * beacon_ie buffer is allocated in this function. It is caller's
137 * responsibility to free the memory.
139 int mwifiex_fill_new_bss_desc(struct mwifiex_private
*priv
,
140 struct cfg80211_bss
*bss
,
141 struct mwifiex_bssdescriptor
*bss_desc
)
144 size_t beacon_ie_len
;
145 struct mwifiex_bss_priv
*bss_priv
= (void *)bss
->priv
;
146 const struct cfg80211_bss_ies
*ies
;
149 ies
= rcu_dereference(bss
->ies
);
150 beacon_ie
= kmemdup(ies
->data
, ies
->len
, GFP_ATOMIC
);
151 beacon_ie_len
= ies
->len
;
152 bss_desc
->timestamp
= ies
->tsf
;
156 dev_err(priv
->adapter
->dev
, " failed to alloc beacon_ie\n");
160 memcpy(bss_desc
->mac_address
, bss
->bssid
, ETH_ALEN
);
161 bss_desc
->rssi
= bss
->signal
;
162 /* The caller of this function will free beacon_ie */
163 bss_desc
->beacon_buf
= beacon_ie
;
164 bss_desc
->beacon_buf_size
= beacon_ie_len
;
165 bss_desc
->beacon_period
= bss
->beacon_interval
;
166 bss_desc
->cap_info_bitmap
= bss
->capability
;
167 bss_desc
->bss_band
= bss_priv
->band
;
168 bss_desc
->fw_tsf
= bss_priv
->fw_tsf
;
169 if (bss_desc
->cap_info_bitmap
& WLAN_CAPABILITY_PRIVACY
) {
170 dev_dbg(priv
->adapter
->dev
, "info: InterpretIE: AP WEP enabled\n");
171 bss_desc
->privacy
= MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
;
173 bss_desc
->privacy
= MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL
;
175 if (bss_desc
->cap_info_bitmap
& WLAN_CAPABILITY_IBSS
)
176 bss_desc
->bss_mode
= NL80211_IFTYPE_ADHOC
;
178 bss_desc
->bss_mode
= NL80211_IFTYPE_STATION
;
180 /* Disable 11ac by default. Enable it only where there
181 * exist VHT_CAP IE in AP beacon
183 bss_desc
->disable_11ac
= true;
185 if (bss_desc
->cap_info_bitmap
& WLAN_CAPABILITY_SPECTRUM_MGMT
)
186 bss_desc
->sensed_11h
= true;
188 return mwifiex_update_bss_desc_with_ie(priv
->adapter
, bss_desc
);
191 void mwifiex_dnld_txpwr_table(struct mwifiex_private
*priv
)
193 if (priv
->adapter
->dt_node
) {
194 char txpwr
[] = {"marvell,00_txpwrlimit"};
196 memcpy(&txpwr
[8], priv
->adapter
->country_code
, 2);
197 mwifiex_dnld_dt_cfgdata(priv
, priv
->adapter
->dt_node
, txpwr
);
201 static int mwifiex_process_country_ie(struct mwifiex_private
*priv
,
202 struct cfg80211_bss
*bss
)
204 const u8
*country_ie
;
206 struct mwifiex_802_11d_domain_reg
*domain_info
=
207 &priv
->adapter
->domain_reg
;
210 country_ie
= ieee80211_bss_get_ie(bss
, WLAN_EID_COUNTRY
);
216 country_ie_len
= country_ie
[1];
217 if (country_ie_len
< IEEE80211_COUNTRY_IE_MIN_LEN
) {
222 if (!strncmp(priv
->adapter
->country_code
, &country_ie
[2], 2)) {
224 wiphy_dbg(priv
->wdev
.wiphy
,
225 "11D: skip setting domain info in FW\n");
228 memcpy(priv
->adapter
->country_code
, &country_ie
[2], 2);
230 domain_info
->country_code
[0] = country_ie
[2];
231 domain_info
->country_code
[1] = country_ie
[3];
232 domain_info
->country_code
[2] = ' ';
234 country_ie_len
-= IEEE80211_COUNTRY_STRING_LEN
;
236 domain_info
->no_of_triplet
=
237 country_ie_len
/ sizeof(struct ieee80211_country_ie_triplet
);
239 memcpy((u8
*)domain_info
->triplet
,
240 &country_ie
[2] + IEEE80211_COUNTRY_STRING_LEN
, country_ie_len
);
244 if (mwifiex_send_cmd(priv
, HostCmd_CMD_802_11D_DOMAIN_INFO
,
245 HostCmd_ACT_GEN_SET
, 0, NULL
, false)) {
246 wiphy_err(priv
->adapter
->wiphy
,
247 "11D: setting domain info in FW\n");
251 mwifiex_dnld_txpwr_table(priv
);
257 * In Ad-Hoc mode, the IBSS is created if not found in scan list.
258 * In both Ad-Hoc and infra mode, an deauthentication is performed
261 int mwifiex_bss_start(struct mwifiex_private
*priv
, struct cfg80211_bss
*bss
,
262 struct cfg80211_ssid
*req_ssid
)
265 struct mwifiex_adapter
*adapter
= priv
->adapter
;
266 struct mwifiex_bssdescriptor
*bss_desc
= NULL
;
268 priv
->scan_block
= false;
271 mwifiex_process_country_ie(priv
, bss
);
273 /* Allocate and fill new bss descriptor */
274 bss_desc
= kzalloc(sizeof(struct mwifiex_bssdescriptor
),
279 ret
= mwifiex_fill_new_bss_desc(priv
, bss
, bss_desc
);
284 if (priv
->bss_mode
== NL80211_IFTYPE_STATION
||
285 priv
->bss_mode
== NL80211_IFTYPE_P2P_CLIENT
) {
291 if (mwifiex_band_to_radio_type(bss_desc
->bss_band
) ==
292 HostCmd_SCAN_RADIO_TYPE_BG
) {
293 config_bands
= BAND_B
| BAND_G
| BAND_GN
;
295 config_bands
= BAND_A
| BAND_AN
;
296 if (adapter
->fw_bands
& BAND_AAC
)
297 config_bands
|= BAND_AAC
;
300 if (!((config_bands
| adapter
->fw_bands
) & ~adapter
->fw_bands
))
301 adapter
->config_bands
= config_bands
;
303 ret
= mwifiex_check_network_compatibility(priv
, bss_desc
);
307 if (mwifiex_11h_get_csa_closed_channel(priv
) ==
308 (u8
)bss_desc
->channel
) {
309 dev_err(adapter
->dev
,
310 "Attempt to reconnect on csa closed chan(%d)\n",
315 dev_dbg(adapter
->dev
, "info: SSID found in scan list ... "
318 mwifiex_stop_net_dev_queue(priv
->netdev
, adapter
);
319 if (netif_carrier_ok(priv
->netdev
))
320 netif_carrier_off(priv
->netdev
);
322 /* Clear any past association response stored for
323 * application retrieval */
324 priv
->assoc_rsp_size
= 0;
325 ret
= mwifiex_associate(priv
, bss_desc
);
327 /* If auth type is auto and association fails using open mode,
328 * try to connect using shared mode */
329 if (ret
== WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG
&&
330 priv
->sec_info
.is_authtype_auto
&&
331 priv
->sec_info
.wep_enabled
) {
332 priv
->sec_info
.authentication_mode
=
333 NL80211_AUTHTYPE_SHARED_KEY
;
334 ret
= mwifiex_associate(priv
, bss_desc
);
338 cfg80211_put_bss(priv
->adapter
->wiphy
, bss
);
341 /* If the requested SSID matches current SSID, return */
342 if (bss_desc
&& bss_desc
->ssid
.ssid_len
&&
343 (!mwifiex_ssid_cmp(&priv
->curr_bss_params
.bss_descriptor
.
344 ssid
, &bss_desc
->ssid
))) {
349 priv
->adhoc_is_link_sensed
= false;
351 ret
= mwifiex_check_network_compatibility(priv
, bss_desc
);
353 mwifiex_stop_net_dev_queue(priv
->netdev
, adapter
);
354 if (netif_carrier_ok(priv
->netdev
))
355 netif_carrier_off(priv
->netdev
);
358 dev_dbg(adapter
->dev
, "info: network found in scan"
359 " list. Joining...\n");
360 ret
= mwifiex_adhoc_join(priv
, bss_desc
);
362 cfg80211_put_bss(priv
->adapter
->wiphy
, bss
);
364 dev_dbg(adapter
->dev
, "info: Network not found in "
365 "the list, creating adhoc with ssid = %s\n",
367 ret
= mwifiex_adhoc_start(priv
, req_ssid
);
372 /* beacon_ie buffer was allocated in function
373 * mwifiex_fill_new_bss_desc(). Free it now.
376 kfree(bss_desc
->beacon_buf
);
382 * IOCTL request handler to set host sleep configuration.
384 * This function prepares the correct firmware command and
387 int mwifiex_set_hs_params(struct mwifiex_private
*priv
, u16 action
,
388 int cmd_type
, struct mwifiex_ds_hs_cfg
*hs_cfg
)
391 struct mwifiex_adapter
*adapter
= priv
->adapter
;
399 case HostCmd_ACT_GEN_SET
:
400 if (adapter
->pps_uapsd_mode
) {
401 dev_dbg(adapter
->dev
, "info: Host Sleep IOCTL"
402 " is blocked in UAPSD/PPS mode\n");
406 if (hs_cfg
->is_invoke_hostcmd
) {
407 if (hs_cfg
->conditions
== HS_CFG_CANCEL
) {
408 if (!adapter
->is_hs_configured
)
409 /* Already cancelled */
411 /* Save previous condition */
412 prev_cond
= le32_to_cpu(adapter
->hs_cfg
414 adapter
->hs_cfg
.conditions
=
415 cpu_to_le32(hs_cfg
->conditions
);
416 } else if (hs_cfg
->conditions
) {
417 adapter
->hs_cfg
.conditions
=
418 cpu_to_le32(hs_cfg
->conditions
);
419 adapter
->hs_cfg
.gpio
= (u8
)hs_cfg
->gpio
;
421 adapter
->hs_cfg
.gap
= (u8
)hs_cfg
->gap
;
422 } else if (adapter
->hs_cfg
.conditions
==
423 cpu_to_le32(HS_CFG_CANCEL
)) {
424 /* Return failure if no parameters for HS
430 status
= mwifiex_send_cmd(priv
,
431 HostCmd_CMD_802_11_HS_CFG_ENH
,
432 HostCmd_ACT_GEN_SET
, 0,
434 cmd_type
== MWIFIEX_SYNC_CMD
);
436 if (hs_cfg
->conditions
== HS_CFG_CANCEL
)
437 /* Restore previous condition */
438 adapter
->hs_cfg
.conditions
=
439 cpu_to_le32(prev_cond
);
441 adapter
->hs_cfg
.conditions
=
442 cpu_to_le32(hs_cfg
->conditions
);
443 adapter
->hs_cfg
.gpio
= (u8
)hs_cfg
->gpio
;
444 adapter
->hs_cfg
.gap
= (u8
)hs_cfg
->gap
;
447 case HostCmd_ACT_GEN_GET
:
448 hs_cfg
->conditions
= le32_to_cpu(adapter
->hs_cfg
.conditions
);
449 hs_cfg
->gpio
= adapter
->hs_cfg
.gpio
;
450 hs_cfg
->gap
= adapter
->hs_cfg
.gap
;
461 * Sends IOCTL request to cancel the existing Host Sleep configuration.
463 * This function allocates the IOCTL request buffer, fills it
464 * with requisite parameters and calls the IOCTL handler.
466 int mwifiex_cancel_hs(struct mwifiex_private
*priv
, int cmd_type
)
468 struct mwifiex_ds_hs_cfg hscfg
;
470 hscfg
.conditions
= HS_CFG_CANCEL
;
471 hscfg
.is_invoke_hostcmd
= true;
473 return mwifiex_set_hs_params(priv
, HostCmd_ACT_GEN_SET
,
476 EXPORT_SYMBOL_GPL(mwifiex_cancel_hs
);
479 * Sends IOCTL request to cancel the existing Host Sleep configuration.
481 * This function allocates the IOCTL request buffer, fills it
482 * with requisite parameters and calls the IOCTL handler.
484 int mwifiex_enable_hs(struct mwifiex_adapter
*adapter
)
486 struct mwifiex_ds_hs_cfg hscfg
;
487 struct mwifiex_private
*priv
;
490 if (disconnect_on_suspend
) {
491 for (i
= 0; i
< adapter
->priv_num
; i
++) {
492 priv
= adapter
->priv
[i
];
494 mwifiex_deauthenticate(priv
, NULL
);
498 if (adapter
->hs_activated
) {
499 dev_dbg(adapter
->dev
, "cmd: HS Already activated\n");
503 adapter
->hs_activate_wait_q_woken
= false;
505 memset(&hscfg
, 0, sizeof(struct mwifiex_ds_hs_cfg
));
506 hscfg
.is_invoke_hostcmd
= true;
508 adapter
->hs_enabling
= true;
509 mwifiex_cancel_all_pending_cmd(adapter
);
511 if (mwifiex_set_hs_params(mwifiex_get_priv(adapter
,
512 MWIFIEX_BSS_ROLE_STA
),
513 HostCmd_ACT_GEN_SET
, MWIFIEX_SYNC_CMD
,
515 dev_err(adapter
->dev
, "IOCTL request HS enable failed\n");
519 if (wait_event_interruptible_timeout(adapter
->hs_activate_wait_q
,
520 adapter
->hs_activate_wait_q_woken
,
522 dev_err(adapter
->dev
, "hs_activate_wait_q terminated\n");
528 EXPORT_SYMBOL_GPL(mwifiex_enable_hs
);
531 * IOCTL request handler to get BSS information.
533 * This function collates the information from different driver structures
534 * to send to the user.
536 int mwifiex_get_bss_info(struct mwifiex_private
*priv
,
537 struct mwifiex_bss_info
*info
)
539 struct mwifiex_adapter
*adapter
= priv
->adapter
;
540 struct mwifiex_bssdescriptor
*bss_desc
;
545 bss_desc
= &priv
->curr_bss_params
.bss_descriptor
;
547 info
->bss_mode
= priv
->bss_mode
;
549 memcpy(&info
->ssid
, &bss_desc
->ssid
, sizeof(struct cfg80211_ssid
));
551 memcpy(&info
->bssid
, &bss_desc
->mac_address
, ETH_ALEN
);
553 info
->bss_chan
= bss_desc
->channel
;
555 memcpy(info
->country_code
, adapter
->country_code
,
556 IEEE80211_COUNTRY_STRING_LEN
);
558 info
->media_connected
= priv
->media_connected
;
560 info
->max_power_level
= priv
->max_tx_power_level
;
561 info
->min_power_level
= priv
->min_tx_power_level
;
563 info
->adhoc_state
= priv
->adhoc_state
;
565 info
->bcn_nf_last
= priv
->bcn_nf_last
;
567 if (priv
->sec_info
.wep_enabled
)
568 info
->wep_status
= true;
570 info
->wep_status
= false;
572 info
->is_hs_configured
= adapter
->is_hs_configured
;
573 info
->is_deep_sleep
= adapter
->is_deep_sleep
;
579 * The function disables auto deep sleep mode.
581 int mwifiex_disable_auto_ds(struct mwifiex_private
*priv
)
583 struct mwifiex_ds_auto_ds auto_ds
;
585 auto_ds
.auto_ds
= DEEP_SLEEP_OFF
;
587 return mwifiex_send_cmd(priv
, HostCmd_CMD_802_11_PS_MODE_ENH
,
588 DIS_AUTO_PS
, BITMAP_AUTO_DS
, &auto_ds
, true);
590 EXPORT_SYMBOL_GPL(mwifiex_disable_auto_ds
);
593 * Sends IOCTL request to get the data rate.
595 * This function allocates the IOCTL request buffer, fills it
596 * with requisite parameters and calls the IOCTL handler.
598 int mwifiex_drv_get_data_rate(struct mwifiex_private
*priv
, u32
*rate
)
602 ret
= mwifiex_send_cmd(priv
, HostCmd_CMD_802_11_TX_RATE_QUERY
,
603 HostCmd_ACT_GEN_GET
, 0, NULL
, true);
606 if (priv
->is_data_rate_auto
)
607 *rate
= mwifiex_index_to_data_rate(priv
, priv
->tx_rate
,
610 *rate
= priv
->data_rate
;
617 * IOCTL request handler to set tx power configuration.
619 * This function prepares the correct firmware command and
622 * For non-auto power mode, all the following power groups are set -
623 * - Modulation class HR/DSSS
624 * - Modulation class OFDM
625 * - Modulation class HTBW20
626 * - Modulation class HTBW40
628 int mwifiex_set_tx_power(struct mwifiex_private
*priv
,
629 struct mwifiex_power_cfg
*power_cfg
)
632 struct host_cmd_ds_txpwr_cfg
*txp_cfg
;
633 struct mwifiex_types_power_group
*pg_tlv
;
634 struct mwifiex_power_group
*pg
;
638 if (!power_cfg
->is_power_auto
) {
639 dbm
= (u16
) power_cfg
->power_level
;
640 if ((dbm
< priv
->min_tx_power_level
) ||
641 (dbm
> priv
->max_tx_power_level
)) {
642 dev_err(priv
->adapter
->dev
, "txpower value %d dBm"
643 " is out of range (%d dBm-%d dBm)\n",
644 dbm
, priv
->min_tx_power_level
,
645 priv
->max_tx_power_level
);
649 buf
= kzalloc(MWIFIEX_SIZE_OF_CMD_BUFFER
, GFP_KERNEL
);
653 txp_cfg
= (struct host_cmd_ds_txpwr_cfg
*) buf
;
654 txp_cfg
->action
= cpu_to_le16(HostCmd_ACT_GEN_SET
);
655 if (!power_cfg
->is_power_auto
) {
656 txp_cfg
->mode
= cpu_to_le32(1);
657 pg_tlv
= (struct mwifiex_types_power_group
*)
658 (buf
+ sizeof(struct host_cmd_ds_txpwr_cfg
));
659 pg_tlv
->type
= cpu_to_le16(TLV_TYPE_POWER_GROUP
);
661 cpu_to_le16(4 * sizeof(struct mwifiex_power_group
));
662 pg
= (struct mwifiex_power_group
*)
663 (buf
+ sizeof(struct host_cmd_ds_txpwr_cfg
)
664 + sizeof(struct mwifiex_types_power_group
));
665 /* Power group for modulation class HR/DSSS */
666 pg
->first_rate_code
= 0x00;
667 pg
->last_rate_code
= 0x03;
668 pg
->modulation_class
= MOD_CLASS_HR_DSSS
;
670 pg
->power_min
= (s8
) dbm
;
671 pg
->power_max
= (s8
) dbm
;
673 /* Power group for modulation class OFDM */
674 pg
->first_rate_code
= 0x00;
675 pg
->last_rate_code
= 0x07;
676 pg
->modulation_class
= MOD_CLASS_OFDM
;
678 pg
->power_min
= (s8
) dbm
;
679 pg
->power_max
= (s8
) dbm
;
681 /* Power group for modulation class HTBW20 */
682 pg
->first_rate_code
= 0x00;
683 pg
->last_rate_code
= 0x20;
684 pg
->modulation_class
= MOD_CLASS_HT
;
686 pg
->power_min
= (s8
) dbm
;
687 pg
->power_max
= (s8
) dbm
;
688 pg
->ht_bandwidth
= HT_BW_20
;
690 /* Power group for modulation class HTBW40 */
691 pg
->first_rate_code
= 0x00;
692 pg
->last_rate_code
= 0x20;
693 pg
->modulation_class
= MOD_CLASS_HT
;
695 pg
->power_min
= (s8
) dbm
;
696 pg
->power_max
= (s8
) dbm
;
697 pg
->ht_bandwidth
= HT_BW_40
;
699 ret
= mwifiex_send_cmd(priv
, HostCmd_CMD_TXPWR_CFG
,
700 HostCmd_ACT_GEN_SET
, 0, buf
, true);
707 * IOCTL request handler to get power save mode.
709 * This function prepares the correct firmware command and
712 int mwifiex_drv_set_power(struct mwifiex_private
*priv
, u32
*ps_mode
)
715 struct mwifiex_adapter
*adapter
= priv
->adapter
;
719 adapter
->ps_mode
= MWIFIEX_802_11_POWER_MODE_PSP
;
721 adapter
->ps_mode
= MWIFIEX_802_11_POWER_MODE_CAM
;
722 sub_cmd
= (*ps_mode
) ? EN_AUTO_PS
: DIS_AUTO_PS
;
723 ret
= mwifiex_send_cmd(priv
, HostCmd_CMD_802_11_PS_MODE_ENH
,
724 sub_cmd
, BITMAP_STA_PS
, NULL
, true);
725 if ((!ret
) && (sub_cmd
== DIS_AUTO_PS
))
726 ret
= mwifiex_send_cmd(priv
, HostCmd_CMD_802_11_PS_MODE_ENH
,
727 GET_PS
, 0, NULL
, false);
733 * IOCTL request handler to set/reset WPA IE.
735 * The supplied WPA IE is treated as a opaque buffer. Only the first field
736 * is checked to determine WPA version. If buffer length is zero, the existing
739 static int mwifiex_set_wpa_ie_helper(struct mwifiex_private
*priv
,
740 u8
*ie_data_ptr
, u16 ie_len
)
743 if (ie_len
> sizeof(priv
->wpa_ie
)) {
744 dev_err(priv
->adapter
->dev
,
745 "failed to copy WPA IE, too big\n");
748 memcpy(priv
->wpa_ie
, ie_data_ptr
, ie_len
);
749 priv
->wpa_ie_len
= (u8
) ie_len
;
750 dev_dbg(priv
->adapter
->dev
, "cmd: Set Wpa_ie_len=%d IE=%#x\n",
751 priv
->wpa_ie_len
, priv
->wpa_ie
[0]);
753 if (priv
->wpa_ie
[0] == WLAN_EID_VENDOR_SPECIFIC
) {
754 priv
->sec_info
.wpa_enabled
= true;
755 } else if (priv
->wpa_ie
[0] == WLAN_EID_RSN
) {
756 priv
->sec_info
.wpa2_enabled
= true;
758 priv
->sec_info
.wpa_enabled
= false;
759 priv
->sec_info
.wpa2_enabled
= false;
762 memset(priv
->wpa_ie
, 0, sizeof(priv
->wpa_ie
));
763 priv
->wpa_ie_len
= 0;
764 dev_dbg(priv
->adapter
->dev
, "info: reset wpa_ie_len=%d IE=%#x\n",
765 priv
->wpa_ie_len
, priv
->wpa_ie
[0]);
766 priv
->sec_info
.wpa_enabled
= false;
767 priv
->sec_info
.wpa2_enabled
= false;
774 * IOCTL request handler to set/reset WAPI IE.
776 * The supplied WAPI IE is treated as a opaque buffer. Only the first field
777 * is checked to internally enable WAPI. If buffer length is zero, the existing
780 static int mwifiex_set_wapi_ie(struct mwifiex_private
*priv
,
781 u8
*ie_data_ptr
, u16 ie_len
)
784 if (ie_len
> sizeof(priv
->wapi_ie
)) {
785 dev_dbg(priv
->adapter
->dev
,
786 "info: failed to copy WAPI IE, too big\n");
789 memcpy(priv
->wapi_ie
, ie_data_ptr
, ie_len
);
790 priv
->wapi_ie_len
= ie_len
;
791 dev_dbg(priv
->adapter
->dev
, "cmd: Set wapi_ie_len=%d IE=%#x\n",
792 priv
->wapi_ie_len
, priv
->wapi_ie
[0]);
794 if (priv
->wapi_ie
[0] == WLAN_EID_BSS_AC_ACCESS_DELAY
)
795 priv
->sec_info
.wapi_enabled
= true;
797 memset(priv
->wapi_ie
, 0, sizeof(priv
->wapi_ie
));
798 priv
->wapi_ie_len
= ie_len
;
799 dev_dbg(priv
->adapter
->dev
,
800 "info: Reset wapi_ie_len=%d IE=%#x\n",
801 priv
->wapi_ie_len
, priv
->wapi_ie
[0]);
802 priv
->sec_info
.wapi_enabled
= false;
808 * IOCTL request handler to set/reset WPS IE.
810 * The supplied WPS IE is treated as a opaque buffer. Only the first field
811 * is checked to internally enable WPS. If buffer length is zero, the existing
814 static int mwifiex_set_wps_ie(struct mwifiex_private
*priv
,
815 u8
*ie_data_ptr
, u16 ie_len
)
818 if (ie_len
> MWIFIEX_MAX_VSIE_LEN
) {
819 dev_dbg(priv
->adapter
->dev
,
820 "info: failed to copy WPS IE, too big\n");
824 priv
->wps_ie
= kzalloc(MWIFIEX_MAX_VSIE_LEN
, GFP_KERNEL
);
828 memcpy(priv
->wps_ie
, ie_data_ptr
, ie_len
);
829 priv
->wps_ie_len
= ie_len
;
830 dev_dbg(priv
->adapter
->dev
, "cmd: Set wps_ie_len=%d IE=%#x\n",
831 priv
->wps_ie_len
, priv
->wps_ie
[0]);
834 priv
->wps_ie_len
= ie_len
;
835 dev_dbg(priv
->adapter
->dev
,
836 "info: Reset wps_ie_len=%d\n", priv
->wps_ie_len
);
842 * IOCTL request handler to set WAPI key.
844 * This function prepares the correct firmware command and
847 static int mwifiex_sec_ioctl_set_wapi_key(struct mwifiex_private
*priv
,
848 struct mwifiex_ds_encrypt_key
*encrypt_key
)
851 return mwifiex_send_cmd(priv
, HostCmd_CMD_802_11_KEY_MATERIAL
,
852 HostCmd_ACT_GEN_SET
, KEY_INFO_ENABLED
,
857 * IOCTL request handler to set WEP network key.
859 * This function prepares the correct firmware command and
860 * issues it, after validation checks.
862 static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_private
*priv
,
863 struct mwifiex_ds_encrypt_key
*encrypt_key
)
865 struct mwifiex_adapter
*adapter
= priv
->adapter
;
867 struct mwifiex_wep_key
*wep_key
;
870 if (priv
->wep_key_curr_index
>= NUM_WEP_KEYS
)
871 priv
->wep_key_curr_index
= 0;
872 wep_key
= &priv
->wep_key
[priv
->wep_key_curr_index
];
873 index
= encrypt_key
->key_index
;
874 if (encrypt_key
->key_disable
) {
875 priv
->sec_info
.wep_enabled
= 0;
876 } else if (!encrypt_key
->key_len
) {
877 /* Copy the required key as the current key */
878 wep_key
= &priv
->wep_key
[index
];
879 if (!wep_key
->key_length
) {
880 dev_err(adapter
->dev
,
881 "key not set, so cannot enable it\n");
885 if (adapter
->key_api_major_ver
== KEY_API_VER_MAJOR_V2
) {
886 memcpy(encrypt_key
->key_material
,
887 wep_key
->key_material
, wep_key
->key_length
);
888 encrypt_key
->key_len
= wep_key
->key_length
;
891 priv
->wep_key_curr_index
= (u16
) index
;
892 priv
->sec_info
.wep_enabled
= 1;
894 wep_key
= &priv
->wep_key
[index
];
895 memset(wep_key
, 0, sizeof(struct mwifiex_wep_key
));
896 /* Copy the key in the driver */
897 memcpy(wep_key
->key_material
,
898 encrypt_key
->key_material
,
899 encrypt_key
->key_len
);
900 wep_key
->key_index
= index
;
901 wep_key
->key_length
= encrypt_key
->key_len
;
902 priv
->sec_info
.wep_enabled
= 1;
904 if (wep_key
->key_length
) {
907 if (encrypt_key
->key_disable
) {
908 memset(&priv
->wep_key
[index
], 0,
909 sizeof(struct mwifiex_wep_key
));
910 if (wep_key
->key_length
)
914 if (adapter
->key_api_major_ver
== KEY_API_VER_MAJOR_V2
)
915 enc_key
= encrypt_key
;
919 /* Send request to firmware */
920 ret
= mwifiex_send_cmd(priv
, HostCmd_CMD_802_11_KEY_MATERIAL
,
921 HostCmd_ACT_GEN_SET
, 0, enc_key
, false);
927 if (priv
->sec_info
.wep_enabled
)
928 priv
->curr_pkt_filter
|= HostCmd_ACT_MAC_WEP_ENABLE
;
930 priv
->curr_pkt_filter
&= ~HostCmd_ACT_MAC_WEP_ENABLE
;
932 ret
= mwifiex_send_cmd(priv
, HostCmd_CMD_MAC_CONTROL
,
933 HostCmd_ACT_GEN_SET
, 0,
934 &priv
->curr_pkt_filter
, true);
940 * IOCTL request handler to set WPA key.
942 * This function prepares the correct firmware command and
943 * issues it, after validation checks.
945 * Current driver only supports key length of up to 32 bytes.
947 * This function can also be used to disable a currently set key.
949 static int mwifiex_sec_ioctl_set_wpa_key(struct mwifiex_private
*priv
,
950 struct mwifiex_ds_encrypt_key
*encrypt_key
)
953 u8 remove_key
= false;
954 struct host_cmd_ds_802_11_key_material
*ibss_key
;
956 /* Current driver only supports key length of up to 32 bytes */
957 if (encrypt_key
->key_len
> WLAN_MAX_KEY_LEN
) {
958 dev_err(priv
->adapter
->dev
, "key length too long\n");
962 if (priv
->bss_mode
== NL80211_IFTYPE_ADHOC
) {
964 * IBSS/WPA-None uses only one key (Group) for both receiving
965 * and sending unicast and multicast packets.
967 /* Send the key as PTK to firmware */
968 encrypt_key
->key_index
= MWIFIEX_KEY_INDEX_UNICAST
;
969 ret
= mwifiex_send_cmd(priv
, HostCmd_CMD_802_11_KEY_MATERIAL
,
971 KEY_INFO_ENABLED
, encrypt_key
, false);
975 ibss_key
= &priv
->aes_key
;
977 sizeof(struct host_cmd_ds_802_11_key_material
));
978 /* Copy the key in the driver */
979 memcpy(ibss_key
->key_param_set
.key
, encrypt_key
->key_material
,
980 encrypt_key
->key_len
);
981 memcpy(&ibss_key
->key_param_set
.key_len
, &encrypt_key
->key_len
,
982 sizeof(ibss_key
->key_param_set
.key_len
));
983 ibss_key
->key_param_set
.key_type_id
984 = cpu_to_le16(KEY_TYPE_ID_TKIP
);
985 ibss_key
->key_param_set
.key_info
= cpu_to_le16(KEY_ENABLED
);
987 /* Send the key as GTK to firmware */
988 encrypt_key
->key_index
= ~MWIFIEX_KEY_INDEX_UNICAST
;
991 if (!encrypt_key
->key_index
)
992 encrypt_key
->key_index
= MWIFIEX_KEY_INDEX_UNICAST
;
995 ret
= mwifiex_send_cmd(priv
, HostCmd_CMD_802_11_KEY_MATERIAL
,
997 !KEY_INFO_ENABLED
, encrypt_key
, true);
999 ret
= mwifiex_send_cmd(priv
, HostCmd_CMD_802_11_KEY_MATERIAL
,
1000 HostCmd_ACT_GEN_SET
,
1001 KEY_INFO_ENABLED
, encrypt_key
, true);
1007 * IOCTL request handler to set/get network keys.
1009 * This is a generic key handling function which supports WEP, WPA
1013 mwifiex_sec_ioctl_encrypt_key(struct mwifiex_private
*priv
,
1014 struct mwifiex_ds_encrypt_key
*encrypt_key
)
1018 if (encrypt_key
->is_wapi_key
)
1019 status
= mwifiex_sec_ioctl_set_wapi_key(priv
, encrypt_key
);
1020 else if (encrypt_key
->key_len
> WLAN_KEY_LEN_WEP104
)
1021 status
= mwifiex_sec_ioctl_set_wpa_key(priv
, encrypt_key
);
1023 status
= mwifiex_sec_ioctl_set_wep_key(priv
, encrypt_key
);
1028 * This function returns the driver version.
1031 mwifiex_drv_get_driver_version(struct mwifiex_adapter
*adapter
, char *version
,
1040 ver
.l
= cpu_to_le32(adapter
->fw_release_number
);
1041 sprintf(fw_ver
, "%u.%u.%u.p%u", ver
.c
[2], ver
.c
[1], ver
.c
[0], ver
.c
[3]);
1043 snprintf(version
, max_len
, driver_version
, fw_ver
);
1045 dev_dbg(adapter
->dev
, "info: MWIFIEX VERSION: %s\n", version
);
1051 * Sends IOCTL request to set encoding parameters.
1053 * This function allocates the IOCTL request buffer, fills it
1054 * with requisite parameters and calls the IOCTL handler.
1056 int mwifiex_set_encode(struct mwifiex_private
*priv
, struct key_params
*kp
,
1057 const u8
*key
, int key_len
, u8 key_index
,
1058 const u8
*mac_addr
, int disable
)
1060 struct mwifiex_ds_encrypt_key encrypt_key
;
1062 memset(&encrypt_key
, 0, sizeof(struct mwifiex_ds_encrypt_key
));
1063 encrypt_key
.key_len
= key_len
;
1064 encrypt_key
.key_index
= key_index
;
1066 if (kp
&& kp
->cipher
== WLAN_CIPHER_SUITE_AES_CMAC
)
1067 encrypt_key
.is_igtk_key
= true;
1071 memcpy(encrypt_key
.key_material
, key
, key_len
);
1073 encrypt_key
.is_current_wep_key
= true;
1076 memcpy(encrypt_key
.mac_addr
, mac_addr
, ETH_ALEN
);
1077 if (kp
&& kp
->seq
&& kp
->seq_len
) {
1078 memcpy(encrypt_key
.pn
, kp
->seq
, kp
->seq_len
);
1079 encrypt_key
.pn_len
= kp
->seq_len
;
1080 encrypt_key
.is_rx_seq_valid
= true;
1083 if (GET_BSS_ROLE(priv
) == MWIFIEX_BSS_ROLE_UAP
)
1085 encrypt_key
.key_disable
= true;
1087 memcpy(encrypt_key
.mac_addr
, mac_addr
, ETH_ALEN
);
1090 return mwifiex_sec_ioctl_encrypt_key(priv
, &encrypt_key
);
1094 * Sends IOCTL request to get extended version.
1096 * This function allocates the IOCTL request buffer, fills it
1097 * with requisite parameters and calls the IOCTL handler.
1100 mwifiex_get_ver_ext(struct mwifiex_private
*priv
)
1102 struct mwifiex_ver_ext ver_ext
;
1104 memset(&ver_ext
, 0, sizeof(struct host_cmd_ds_version_ext
));
1105 if (mwifiex_send_cmd(priv
, HostCmd_CMD_VERSION_EXT
,
1106 HostCmd_ACT_GEN_GET
, 0, &ver_ext
, true))
1113 mwifiex_remain_on_chan_cfg(struct mwifiex_private
*priv
, u16 action
,
1114 struct ieee80211_channel
*chan
,
1115 unsigned int duration
)
1117 struct host_cmd_ds_remain_on_chan roc_cfg
;
1120 memset(&roc_cfg
, 0, sizeof(roc_cfg
));
1121 roc_cfg
.action
= cpu_to_le16(action
);
1122 if (action
== HostCmd_ACT_GEN_SET
) {
1123 roc_cfg
.band_cfg
= chan
->band
;
1124 sc
= mwifiex_chan_type_to_sec_chan_offset(NL80211_CHAN_NO_HT
);
1125 roc_cfg
.band_cfg
|= (sc
<< 2);
1128 ieee80211_frequency_to_channel(chan
->center_freq
);
1129 roc_cfg
.duration
= cpu_to_le32(duration
);
1131 if (mwifiex_send_cmd(priv
, HostCmd_CMD_REMAIN_ON_CHAN
,
1132 action
, 0, &roc_cfg
, true)) {
1133 dev_err(priv
->adapter
->dev
, "failed to remain on channel\n");
1137 return roc_cfg
.status
;
1141 * Sends IOCTL request to get statistics information.
1143 * This function allocates the IOCTL request buffer, fills it
1144 * with requisite parameters and calls the IOCTL handler.
1147 mwifiex_get_stats_info(struct mwifiex_private
*priv
,
1148 struct mwifiex_ds_get_stats
*log
)
1150 return mwifiex_send_cmd(priv
, HostCmd_CMD_802_11_GET_LOG
,
1151 HostCmd_ACT_GEN_GET
, 0, log
, true);
1155 * IOCTL request handler to read/write register.
1157 * This function prepares the correct firmware command and
1160 * Access to the following registers are supported -
1167 static int mwifiex_reg_mem_ioctl_reg_rw(struct mwifiex_private
*priv
,
1168 struct mwifiex_ds_reg_rw
*reg_rw
,
1173 switch (le32_to_cpu(reg_rw
->type
)) {
1174 case MWIFIEX_REG_MAC
:
1175 cmd_no
= HostCmd_CMD_MAC_REG_ACCESS
;
1177 case MWIFIEX_REG_BBP
:
1178 cmd_no
= HostCmd_CMD_BBP_REG_ACCESS
;
1180 case MWIFIEX_REG_RF
:
1181 cmd_no
= HostCmd_CMD_RF_REG_ACCESS
;
1183 case MWIFIEX_REG_PMIC
:
1184 cmd_no
= HostCmd_CMD_PMIC_REG_ACCESS
;
1186 case MWIFIEX_REG_CAU
:
1187 cmd_no
= HostCmd_CMD_CAU_REG_ACCESS
;
1193 return mwifiex_send_cmd(priv
, cmd_no
, action
, 0, reg_rw
, true);
1197 * Sends IOCTL request to write to a register.
1199 * This function allocates the IOCTL request buffer, fills it
1200 * with requisite parameters and calls the IOCTL handler.
1203 mwifiex_reg_write(struct mwifiex_private
*priv
, u32 reg_type
,
1204 u32 reg_offset
, u32 reg_value
)
1206 struct mwifiex_ds_reg_rw reg_rw
;
1208 reg_rw
.type
= cpu_to_le32(reg_type
);
1209 reg_rw
.offset
= cpu_to_le32(reg_offset
);
1210 reg_rw
.value
= cpu_to_le32(reg_value
);
1212 return mwifiex_reg_mem_ioctl_reg_rw(priv
, ®_rw
, HostCmd_ACT_GEN_SET
);
1216 * Sends IOCTL request to read from a register.
1218 * This function allocates the IOCTL request buffer, fills it
1219 * with requisite parameters and calls the IOCTL handler.
1222 mwifiex_reg_read(struct mwifiex_private
*priv
, u32 reg_type
,
1223 u32 reg_offset
, u32
*value
)
1226 struct mwifiex_ds_reg_rw reg_rw
;
1228 reg_rw
.type
= cpu_to_le32(reg_type
);
1229 reg_rw
.offset
= cpu_to_le32(reg_offset
);
1230 ret
= mwifiex_reg_mem_ioctl_reg_rw(priv
, ®_rw
, HostCmd_ACT_GEN_GET
);
1235 *value
= le32_to_cpu(reg_rw
.value
);
1242 * Sends IOCTL request to read from EEPROM.
1244 * This function allocates the IOCTL request buffer, fills it
1245 * with requisite parameters and calls the IOCTL handler.
1248 mwifiex_eeprom_read(struct mwifiex_private
*priv
, u16 offset
, u16 bytes
,
1252 struct mwifiex_ds_read_eeprom rd_eeprom
;
1254 rd_eeprom
.offset
= cpu_to_le16((u16
) offset
);
1255 rd_eeprom
.byte_count
= cpu_to_le16((u16
) bytes
);
1257 /* Send request to firmware */
1258 ret
= mwifiex_send_cmd(priv
, HostCmd_CMD_802_11_EEPROM_ACCESS
,
1259 HostCmd_ACT_GEN_GET
, 0, &rd_eeprom
, true);
1262 memcpy(value
, rd_eeprom
.value
, MAX_EEPROM_DATA
);
1267 * This function sets a generic IE. In addition to generic IE, it can
1268 * also handle WPA, WPA2 and WAPI IEs.
1271 mwifiex_set_gen_ie_helper(struct mwifiex_private
*priv
, u8
*ie_data_ptr
,
1275 struct ieee_types_vendor_header
*pvendor_ie
;
1276 const u8 wpa_oui
[] = { 0x00, 0x50, 0xf2, 0x01 };
1277 const u8 wps_oui
[] = { 0x00, 0x50, 0xf2, 0x04 };
1279 /* If the passed length is zero, reset the buffer */
1281 priv
->gen_ie_buf_len
= 0;
1282 priv
->wps
.session_enable
= false;
1285 } else if (!ie_data_ptr
) {
1288 pvendor_ie
= (struct ieee_types_vendor_header
*) ie_data_ptr
;
1289 /* Test to see if it is a WPA IE, if not, then it is a gen IE */
1290 if (((pvendor_ie
->element_id
== WLAN_EID_VENDOR_SPECIFIC
) &&
1291 (!memcmp(pvendor_ie
->oui
, wpa_oui
, sizeof(wpa_oui
)))) ||
1292 (pvendor_ie
->element_id
== WLAN_EID_RSN
)) {
1294 /* IE is a WPA/WPA2 IE so call set_wpa function */
1295 ret
= mwifiex_set_wpa_ie_helper(priv
, ie_data_ptr
, ie_len
);
1296 priv
->wps
.session_enable
= false;
1299 } else if (pvendor_ie
->element_id
== WLAN_EID_BSS_AC_ACCESS_DELAY
) {
1300 /* IE is a WAPI IE so call set_wapi function */
1301 ret
= mwifiex_set_wapi_ie(priv
, ie_data_ptr
, ie_len
);
1306 * Verify that the passed length is not larger than the
1307 * available space remaining in the buffer
1309 if (ie_len
< (sizeof(priv
->gen_ie_buf
) - priv
->gen_ie_buf_len
)) {
1311 /* Test to see if it is a WPS IE, if so, enable
1314 pvendor_ie
= (struct ieee_types_vendor_header
*) ie_data_ptr
;
1315 if ((pvendor_ie
->element_id
== WLAN_EID_VENDOR_SPECIFIC
) &&
1316 (!memcmp(pvendor_ie
->oui
, wps_oui
, sizeof(wps_oui
)))) {
1317 priv
->wps
.session_enable
= true;
1318 dev_dbg(priv
->adapter
->dev
,
1319 "info: WPS Session Enabled.\n");
1320 ret
= mwifiex_set_wps_ie(priv
, ie_data_ptr
, ie_len
);
1323 /* Append the passed data to the end of the
1325 memcpy(priv
->gen_ie_buf
+ priv
->gen_ie_buf_len
, ie_data_ptr
,
1327 /* Increment the stored buffer length by the
1329 priv
->gen_ie_buf_len
+= ie_len
;
1331 /* Passed data does not fit in the remaining
1336 /* Return 0, or -1 for error case */
1341 * IOCTL request handler to set/get generic IE.
1343 * In addition to various generic IEs, this function can also be
1344 * used to set the ARP filter.
1346 static int mwifiex_misc_ioctl_gen_ie(struct mwifiex_private
*priv
,
1347 struct mwifiex_ds_misc_gen_ie
*gen_ie
,
1350 struct mwifiex_adapter
*adapter
= priv
->adapter
;
1352 switch (gen_ie
->type
) {
1353 case MWIFIEX_IE_TYPE_GEN_IE
:
1354 if (action
== HostCmd_ACT_GEN_GET
) {
1355 gen_ie
->len
= priv
->wpa_ie_len
;
1356 memcpy(gen_ie
->ie_data
, priv
->wpa_ie
, gen_ie
->len
);
1358 mwifiex_set_gen_ie_helper(priv
, gen_ie
->ie_data
,
1362 case MWIFIEX_IE_TYPE_ARP_FILTER
:
1363 memset(adapter
->arp_filter
, 0, sizeof(adapter
->arp_filter
));
1364 if (gen_ie
->len
> ARP_FILTER_MAX_BUF_SIZE
) {
1365 adapter
->arp_filter_size
= 0;
1366 dev_err(adapter
->dev
, "invalid ARP filter size\n");
1369 memcpy(adapter
->arp_filter
, gen_ie
->ie_data
,
1371 adapter
->arp_filter_size
= gen_ie
->len
;
1375 dev_err(adapter
->dev
, "invalid IE type\n");
1382 * Sends IOCTL request to set a generic IE.
1384 * This function allocates the IOCTL request buffer, fills it
1385 * with requisite parameters and calls the IOCTL handler.
1388 mwifiex_set_gen_ie(struct mwifiex_private
*priv
, const u8
*ie
, int ie_len
)
1390 struct mwifiex_ds_misc_gen_ie gen_ie
;
1392 if (ie_len
> IEEE_MAX_IE_SIZE
)
1395 gen_ie
.type
= MWIFIEX_IE_TYPE_GEN_IE
;
1396 gen_ie
.len
= ie_len
;
1397 memcpy(gen_ie
.ie_data
, ie
, ie_len
);
1398 if (mwifiex_misc_ioctl_gen_ie(priv
, &gen_ie
, HostCmd_ACT_GEN_SET
))