2 * Marvell Wireless LAN device driver: major data structures and prototypes
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.
20 #ifndef _MWIFIEX_MAIN_H_
21 #define _MWIFIEX_MAIN_H_
23 #include <linux/kernel.h>
24 #include <linux/module.h>
25 #include <linux/sched.h>
26 #include <linux/semaphore.h>
28 #include <linux/skbuff.h>
29 #include <linux/if_arp.h>
30 #include <linux/etherdevice.h>
32 #include <net/lib80211.h>
33 #include <linux/vmalloc.h>
34 #include <linux/firmware.h>
35 #include <linux/ctype.h>
37 #include <linux/idr.h>
38 #include <linux/inetdevice.h>
48 extern const char driver_version
[];
55 #define MWIFIEX_DRIVER_MODE_STA BIT(0)
56 #define MWIFIEX_DRIVER_MODE_UAP BIT(1)
57 #define MWIFIEX_DRIVER_MODE_P2P BIT(2)
58 #define MWIFIEX_DRIVER_MODE_BITMASK (BIT(0) | BIT(1) | BIT(2))
60 #define MWIFIEX_MAX_AP 64
62 #define MWIFIEX_MAX_PKTS_TXQ 16
64 #define MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT (5 * HZ)
66 #define MWIFIEX_TIMER_10S 10000
67 #define MWIFIEX_TIMER_1S 1000
69 #define MAX_TX_PENDING 100
70 #define LOW_TX_PENDING 80
72 #define HIGH_RX_PENDING 50
73 #define LOW_RX_PENDING 20
75 #define MWIFIEX_UPLD_SIZE (2312)
77 #define MAX_EVENT_SIZE 2048
79 #define ARP_FILTER_MAX_BUF_SIZE 68
81 #define MWIFIEX_KEY_BUFFER_SIZE 16
82 #define MWIFIEX_DEFAULT_LISTEN_INTERVAL 10
83 #define MWIFIEX_MAX_REGION_CODE 7
85 #define DEFAULT_BCN_AVG_FACTOR 8
86 #define DEFAULT_DATA_AVG_FACTOR 8
88 #define FIRST_VALID_CHANNEL 0xff
89 #define DEFAULT_AD_HOC_CHANNEL 6
90 #define DEFAULT_AD_HOC_CHANNEL_A 36
92 #define DEFAULT_BCN_MISS_TIMEOUT 5
94 #define MAX_SCAN_BEACON_BUFFER 8000
96 #define SCAN_BEACON_ENTRY_PAD 6
98 #define MWIFIEX_PASSIVE_SCAN_CHAN_TIME 110
99 #define MWIFIEX_ACTIVE_SCAN_CHAN_TIME 30
100 #define MWIFIEX_SPECIFIC_SCAN_CHAN_TIME 30
101 #define MWIFIEX_DEF_SCAN_CHAN_GAP_TIME 50
103 #define SCAN_RSSI(RSSI) (0x100 - ((u8)(RSSI)))
105 #define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S)
107 #define RSN_GTK_OUI_OFFSET 2
109 #define MWIFIEX_OUI_NOT_PRESENT 0
110 #define MWIFIEX_OUI_PRESENT 1
112 #define PKT_TYPE_MGMT 0xE5
115 * Do not check for data_received for USB, as data_received
116 * is handled in mwifiex_usb_recv for USB
118 #define IS_CARD_RX_RCVD(adapter) (adapter->cmd_resp_received || \
119 adapter->event_received || \
120 adapter->data_received)
122 #define MWIFIEX_TYPE_CMD 1
123 #define MWIFIEX_TYPE_DATA 0
124 #define MWIFIEX_TYPE_AGGR_DATA 10
125 #define MWIFIEX_TYPE_EVENT 3
127 #define MAX_BITMAP_RATES_SIZE 18
129 #define MAX_CHANNEL_BAND_BG 14
130 #define MAX_CHANNEL_BAND_A 165
132 #define MAX_FREQUENCY_BAND_BG 2484
134 #define MWIFIEX_EVENT_HEADER_LEN 4
135 #define MWIFIEX_UAP_EVENT_EXTRA_HEADER 2
137 #define MWIFIEX_TYPE_LEN 4
138 #define MWIFIEX_USB_TYPE_CMD 0xF00DFACE
139 #define MWIFIEX_USB_TYPE_DATA 0xBEADC0DE
140 #define MWIFIEX_USB_TYPE_EVENT 0xBEEFFACE
142 /* Threshold for tx_timeout_cnt before we trigger a card reset */
143 #define TX_TIMEOUT_THRESHOLD 6
145 #define MWIFIEX_DRV_INFO_SIZE_MAX 0x40000
147 /* Address alignment */
148 #define MWIFIEX_ALIGN_ADDR(p, a) (((long)(p) + (a) - 1) & ~((a) - 1))
151 u32 num_cmd_host_to_card_failure
;
152 u32 num_cmd_sleep_cfm_host_to_card_failure
;
153 u32 num_tx_host_to_card_failure
;
154 u32 num_event_deauth
;
155 u32 num_event_disassoc
;
156 u32 num_event_link_lost
;
158 u32 num_cmd_assoc_success
;
159 u32 num_cmd_assoc_failure
;
163 u16 last_cmd_id
[DBG_CMD_NUM
];
164 u16 last_cmd_act
[DBG_CMD_NUM
];
166 u16 last_cmd_resp_id
[DBG_CMD_NUM
];
167 u16 last_cmd_resp_index
;
168 u16 last_event
[DBG_CMD_NUM
];
169 u16 last_event_index
;
172 enum MWIFIEX_HARDWARE_STATUS
{
173 MWIFIEX_HW_STATUS_READY
,
174 MWIFIEX_HW_STATUS_INITIALIZING
,
175 MWIFIEX_HW_STATUS_INIT_DONE
,
176 MWIFIEX_HW_STATUS_RESET
,
177 MWIFIEX_HW_STATUS_CLOSING
,
178 MWIFIEX_HW_STATUS_NOT_READY
181 enum MWIFIEX_802_11_POWER_MODE
{
182 MWIFIEX_802_11_POWER_MODE_CAM
,
183 MWIFIEX_802_11_POWER_MODE_PSP
186 struct mwifiex_tx_param
{
190 enum MWIFIEX_PS_STATE
{
197 enum mwifiex_iface_type
{
203 struct mwifiex_add_ba_param
{
211 struct mwifiex_tx_aggr
{
217 enum mwifiex_ba_status
{
223 struct mwifiex_ra_list_tbl
{
224 struct list_head list
;
225 struct sk_buff_head skb_head
;
231 enum mwifiex_ba_status ba_status
;
237 struct mwifiex_tid_tbl
{
238 struct list_head ra_list
;
241 #define WMM_HIGHEST_PRIORITY 7
242 #define HIGH_PRIO_TID 7
243 #define LOW_PRIO_TID 0
245 struct mwifiex_wmm_desc
{
246 struct mwifiex_tid_tbl tid_tbl_ptr
[MAX_NUM_TID
];
247 u32 packets_out
[MAX_NUM_TID
];
248 /* spin lock to protect ra_list */
249 spinlock_t ra_list_spinlock
;
250 struct mwifiex_wmm_ac_status ac_status
[IEEE80211_NUM_ACS
];
251 enum mwifiex_wmm_ac_e ac_down_graded_vals
[IEEE80211_NUM_ACS
];
252 u32 drv_pkt_delay_max
;
253 u8 queue_priority
[IEEE80211_NUM_ACS
];
254 u32 user_pri_pkt_tx_ctrl
[WMM_HIGHEST_PRIORITY
+ 1]; /* UP: 0 to 7 */
255 /* Number of transmit packets queued */
256 atomic_t tx_pkts_queued
;
257 /* Tracks highest priority with a packet queued */
258 atomic_t highest_queued_prio
;
261 struct mwifiex_802_11_security
{
267 u32 authentication_mode
;
272 struct ieee_types_header
{
277 struct ieee_types_vendor_specific
{
278 struct ieee_types_vendor_header vend_hdr
;
279 u8 data
[IEEE_MAX_IE_SIZE
- sizeof(struct ieee_types_vendor_header
)];
282 struct ieee_types_generic
{
283 struct ieee_types_header ieee_hdr
;
284 u8 data
[IEEE_MAX_IE_SIZE
- sizeof(struct ieee_types_header
)];
287 struct ieee_types_bss_co_2040
{
288 struct ieee_types_header ieee_hdr
;
292 struct ieee_types_extcap
{
293 struct ieee_types_header ieee_hdr
;
297 struct ieee_types_vht_cap
{
298 struct ieee_types_header ieee_hdr
;
299 struct ieee80211_vht_cap vhtcap
;
302 struct ieee_types_vht_oper
{
303 struct ieee_types_header ieee_hdr
;
304 struct ieee80211_vht_operation vhtoper
;
307 struct ieee_types_aid
{
308 struct ieee_types_header ieee_hdr
;
312 struct mwifiex_bssdescriptor
{
313 u8 mac_address
[ETH_ALEN
];
314 struct cfg80211_ssid ssid
;
322 u8 supported_rates
[MWIFIEX_SUPPORTED_RATES
];
323 u8 data_rates
[MWIFIEX_SUPPORTED_RATES
];
325 * BAND_B(0x01): 'b' band
326 * BAND_G(0x02): 'g' band
327 * BAND_A(0X04): 'a' band
332 union ieee_types_phy_param_set phy_param_set
;
333 union ieee_types_ss_param_set ss_param_set
;
335 struct ieee_types_wmm_parameter wmm_ie
;
337 struct ieee80211_ht_cap
*bcn_ht_cap
;
339 struct ieee80211_ht_operation
*bcn_ht_oper
;
342 u16 bss_co_2040_offset
;
345 struct ieee80211_vht_cap
*bcn_vht_cap
;
347 struct ieee80211_vht_operation
*bcn_vht_oper
;
349 struct ieee_types_oper_mode_ntf
*oper_mode
;
350 u16 oper_mode_offset
;
352 struct ieee_types_vendor_specific
*bcn_wpa_ie
;
354 struct ieee_types_generic
*bcn_rsn_ie
;
356 struct ieee_types_generic
*bcn_wapi_ie
;
362 u8 chan_sw_ie_present
;
365 struct mwifiex_current_bss_params
{
366 struct mwifiex_bssdescriptor bss_descriptor
;
368 u8 wmm_uapsd_enabled
;
371 u8 data_rates
[MWIFIEX_SUPPORTED_RATES
];
374 struct mwifiex_sleep_params
{
383 struct mwifiex_sleep_period
{
388 struct mwifiex_wep_key
{
392 u8 key_material
[MWIFIEX_KEY_BUFFER_SIZE
];
395 #define MAX_REGION_CHANNEL_NUM 2
397 struct mwifiex_chan_freq_power
{
409 #define MWIFIEX_MAX_TRIPLET_802_11D 83
411 struct mwifiex_802_11d_domain_reg
{
412 u8 country_code
[IEEE80211_COUNTRY_STRING_LEN
];
414 struct ieee80211_country_ie_triplet
415 triplet
[MWIFIEX_MAX_TRIPLET_802_11D
];
418 struct mwifiex_vendor_spec_cfg_ie
{
421 u8 ie
[MWIFIEX_MAX_VSIE_LEN
];
428 struct mwifiex_roc_cfg
{
430 struct ieee80211_channel chan
;
433 #define MWIFIEX_FW_DUMP_IDX 0xff
434 #define MWIFIEX_DRV_INFO_IDX 20
435 #define FW_DUMP_MAX_NAME_LEN 8
436 #define FW_DUMP_HOST_READY 0xEE
437 #define FW_DUMP_DONE 0xFF
438 #define FW_DUMP_READ_DONE 0xFE
440 struct memory_type_mapping
{
441 u8 mem_name
[FW_DUMP_MAX_NAME_LEN
];
448 RDWR_STATUS_SUCCESS
= 0,
449 RDWR_STATUS_FAILURE
= 1,
453 enum mwifiex_iface_work_flags
{
454 MWIFIEX_IFACE_WORK_FW_DUMP
,
455 MWIFIEX_IFACE_WORK_CARD_RESET
,
458 struct mwifiex_adapter
;
459 struct mwifiex_private
;
461 struct mwifiex_private
{
462 struct mwifiex_adapter
*adapter
;
469 u8 curr_addr
[ETH_ALEN
];
472 /* track consecutive timeout */
474 struct net_device
*netdev
;
475 struct net_device_stats stats
;
480 u8 max_tx_power_level
;
481 u8 min_tx_power_level
;
487 u16 bitmap_rates
[MAX_BITMAP_RATES_SIZE
];
489 u8 is_data_rate_auto
;
500 struct mwifiex_bssdescriptor
*attempted_bss_desc
;
501 struct cfg80211_ssid prev_ssid
;
502 u8 prev_bssid
[ETH_ALEN
];
503 struct mwifiex_current_bss_params curr_bss_params
;
509 u8 adhoc_is_link_sensed
;
511 struct mwifiex_802_11_security sec_info
;
512 struct mwifiex_wep_key wep_key
[NUM_WEP_KEYS
];
513 u16 wep_key_curr_index
;
517 struct host_cmd_ds_802_11_key_material aes_key
;
518 struct host_cmd_ds_802_11_key_material_v2 aes_key_v2
;
526 struct mwifiex_wmm_desc wmm
;
527 atomic_t wmm_tx_pending
[IEEE80211_NUM_ACS
];
528 struct list_head sta_list
;
529 /* spin lock for associated station/TDLS peers list */
530 spinlock_t sta_list_spinlock
;
531 struct list_head auto_tdls_list
;
532 /* spin lock for auto TDLS peer list */
533 spinlock_t auto_tdls_lock
;
534 struct list_head tx_ba_stream_tbl_ptr
;
535 /* spin lock for tx_ba_stream_tbl_ptr queue */
536 spinlock_t tx_ba_stream_tbl_lock
;
537 struct mwifiex_tx_aggr aggr_prio_tbl
[MAX_NUM_TID
];
538 struct mwifiex_add_ba_param add_ba_param
;
539 u16 rx_seq
[MAX_NUM_TID
];
540 u8 tos_to_tid_inv
[MAX_NUM_TID
];
541 struct list_head rx_reorder_tbl_ptr
;
542 /* spin lock for rx_reorder_tbl_ptr queue */
543 spinlock_t rx_reorder_tbl_lock
;
544 /* spin lock for Rx packets */
545 spinlock_t rx_pkt_lock
;
547 #define MWIFIEX_ASSOC_RSP_BUF_SIZE 500
548 u8 assoc_rsp_buf
[MWIFIEX_ASSOC_RSP_BUF_SIZE
];
551 #define MWIFIEX_GENIE_BUF_SIZE 256
552 u8 gen_ie_buf
[MWIFIEX_GENIE_BUF_SIZE
];
555 struct mwifiex_vendor_spec_cfg_ie vs_ie
[MWIFIEX_MAX_VSIE_NUM
];
557 #define MWIFIEX_ASSOC_TLV_BUF_SIZE 256
558 u8 assoc_tlv_buf
[MWIFIEX_ASSOC_TLV_BUF_SIZE
];
559 u8 assoc_tlv_buf_len
;
563 /* spin lock for beacon buffer */
564 spinlock_t curr_bcn_buf_lock
;
565 struct wireless_dev wdev
;
566 struct mwifiex_chan_freq_power cfp
;
567 char version_str
[128];
568 #ifdef CONFIG_DEBUG_FS
569 struct dentry
*dfs_dev_dir
;
571 u16 current_key_index
;
572 struct semaphore async_sem
;
573 struct cfg80211_scan_request
*scan_request
;
579 u8 subsc_evt_rssi_state
;
580 struct mwifiex_ds_misc_subsc_evt async_subsc_evt_storage
;
581 struct mwifiex_ie mgmt_ie
[MAX_MGMT_IE_INDEX
];
589 struct mwifiex_roc_cfg roc_cfg
;
592 unsigned long csa_expire_time
;
595 struct mwifiex_uap_bss_param bss_cfg
;
596 struct station_parameters
*sta_params
;
597 struct sk_buff_head tdls_txq
;
599 struct timer_list auto_tdls_timer
;
600 bool auto_tdls_timer_active
;
601 struct idr ack_status_frames
;
602 /* spin lock for ack status */
603 spinlock_t ack_status_lock
;
604 /** rx histogram data */
605 struct mwifiex_histogram_data
*hist_data
;
606 struct cfg80211_chan_def dfs_chandef
;
607 struct workqueue_struct
*dfs_cac_workqueue
;
608 struct delayed_work dfs_cac_work
;
609 struct timer_list dfs_chan_switch_timer
;
610 struct workqueue_struct
*dfs_chan_sw_workqueue
;
611 struct delayed_work dfs_chan_sw_work
;
612 struct cfg80211_beacon_data beacon_after
;
613 struct mwifiex_11h_intf_state state_11h
;
617 struct mwifiex_tx_ba_stream_tbl
{
618 struct list_head list
;
621 enum mwifiex_ba_status ba_status
;
625 struct mwifiex_rx_reorder_tbl
;
627 struct reorder_tmr_cnxt
{
628 struct timer_list timer
;
629 struct mwifiex_rx_reorder_tbl
*ptr
;
630 struct mwifiex_private
*priv
;
634 struct mwifiex_rx_reorder_tbl
{
635 struct list_head list
;
641 void **rx_reorder_ptr
;
642 struct reorder_tmr_cnxt timer_context
;
647 struct mwifiex_bss_prio_node
{
648 struct list_head list
;
649 struct mwifiex_private
*priv
;
652 struct mwifiex_bss_prio_tbl
{
653 struct list_head bss_prio_head
;
654 /* spin lock for bss priority */
655 spinlock_t bss_prio_lock
;
656 struct mwifiex_bss_prio_node
*bss_prio_cur
;
659 struct cmd_ctrl_node
{
660 struct list_head list
;
661 struct mwifiex_private
*priv
;
664 struct sk_buff
*cmd_skb
;
665 struct sk_buff
*resp_skb
;
673 struct mwifiex_bss_priv
{
678 struct mwifiex_tdls_capab
{
685 struct ieee80211_ht_cap ht_capb
;
686 struct ieee80211_ht_operation ht_oper
;
687 struct ieee_types_extcap extcap
;
688 struct ieee_types_generic rsn_ie
;
689 struct ieee80211_vht_cap vhtcap
;
690 struct ieee80211_vht_operation vhtoper
;
693 /* This is AP/TDLS specific structure which stores information
694 * about associated/peer STA
696 struct mwifiex_sta_node
{
697 struct list_head list
;
698 u8 mac_addr
[ETH_ALEN
];
702 u8 ampdu_sta
[MAX_NUM_TID
];
703 u16 rx_seq
[MAX_NUM_TID
];
706 struct mwifiex_tdls_capab tdls_cap
;
709 struct mwifiex_auto_tdls_peer
{
710 struct list_head list
;
711 u8 mac_addr
[ETH_ALEN
];
720 struct mwifiex_if_ops
{
721 int (*init_if
) (struct mwifiex_adapter
*);
722 void (*cleanup_if
) (struct mwifiex_adapter
*);
723 int (*check_fw_status
) (struct mwifiex_adapter
*, u32
);
724 int (*prog_fw
) (struct mwifiex_adapter
*, struct mwifiex_fw_image
*);
725 int (*register_dev
) (struct mwifiex_adapter
*);
726 void (*unregister_dev
) (struct mwifiex_adapter
*);
727 int (*enable_int
) (struct mwifiex_adapter
*);
728 void (*disable_int
) (struct mwifiex_adapter
*);
729 int (*process_int_status
) (struct mwifiex_adapter
*);
730 int (*host_to_card
) (struct mwifiex_adapter
*, u8
, struct sk_buff
*,
731 struct mwifiex_tx_param
*);
732 int (*wakeup
) (struct mwifiex_adapter
*);
733 int (*wakeup_complete
) (struct mwifiex_adapter
*);
735 /* Interface specific functions */
736 void (*update_mp_end_port
) (struct mwifiex_adapter
*, u16
);
737 void (*cleanup_mpa_buf
) (struct mwifiex_adapter
*);
738 int (*cmdrsp_complete
) (struct mwifiex_adapter
*, struct sk_buff
*);
739 int (*event_complete
) (struct mwifiex_adapter
*, struct sk_buff
*);
740 int (*init_fw_port
) (struct mwifiex_adapter
*);
741 int (*dnld_fw
) (struct mwifiex_adapter
*, struct mwifiex_fw_image
*);
742 void (*card_reset
) (struct mwifiex_adapter
*);
743 void (*fw_dump
)(struct mwifiex_adapter
*);
744 int (*reg_dump
)(struct mwifiex_adapter
*, char *);
745 int (*clean_pcie_ring
) (struct mwifiex_adapter
*adapter
);
746 void (*iface_work
)(struct work_struct
*work
);
747 void (*submit_rem_rx_urbs
)(struct mwifiex_adapter
*adapter
);
748 void (*deaggr_pkt
)(struct mwifiex_adapter
*, struct sk_buff
*);
751 struct mwifiex_adapter
{
753 struct mwifiex_iface_comb iface_limit
;
754 struct mwifiex_iface_comb curr_iface_comb
;
755 struct mwifiex_private
*priv
[MWIFIEX_MAX_BSS_NUM
];
757 const struct firmware
*firmware
;
762 u8 perm_addr
[ETH_ALEN
];
763 bool surprise_removed
;
764 u32 fw_release_number
;
765 u16 init_wait_q_woken
;
766 wait_queue_head_t init_wait_q
;
768 struct mwifiex_if_ops if_ops
;
771 atomic_t cmd_pending
;
772 struct workqueue_struct
*workqueue
;
773 struct work_struct main_work
;
774 struct workqueue_struct
*rx_workqueue
;
775 struct work_struct rx_work
;
776 struct workqueue_struct
*dfs_workqueue
;
777 struct work_struct dfs_work
;
778 bool rx_work_enabled
;
780 bool delay_main_work
;
783 struct mwifiex_bss_prio_tbl bss_prio_tbl
[MWIFIEX_MAX_BSS_NUM
];
784 /* spin lock for init/shutdown */
785 spinlock_t mwifiex_lock
;
786 /* spin lock for main process */
787 spinlock_t main_proc_lock
;
788 u32 mwifiex_processing
;
791 u16 curr_tx_buf_size
;
792 bool sdio_rx_aggr_enable
;
793 u16 sdio_rx_block_size
;
795 enum MWIFIEX_HARDWARE_STATUS hw_status
;
796 u16 number_of_antenna
;
798 /* spin lock for interrupt handling */
802 struct sk_buff
*event_skb
;
803 u8 upld_buf
[MWIFIEX_UPLD_SIZE
];
806 u8 cmd_resp_received
;
810 struct cmd_ctrl_node
*cmd_pool
;
811 struct cmd_ctrl_node
*curr_cmd
;
812 /* spin lock for command */
813 spinlock_t mwifiex_cmd_lock
;
816 struct timer_list cmd_timer
;
817 struct list_head cmd_free_q
;
818 /* spin lock for cmd_free_q */
819 spinlock_t cmd_free_q_lock
;
820 struct list_head cmd_pending_q
;
821 /* spin lock for cmd_pending_q */
822 spinlock_t cmd_pending_q_lock
;
823 struct list_head scan_pending_q
;
824 /* spin lock for scan_pending_q */
825 spinlock_t scan_pending_q_lock
;
826 /* spin lock for RX processing routine */
827 spinlock_t rx_proc_lock
;
828 struct sk_buff_head tx_data_q
;
832 struct mwifiex_802_11d_domain_reg domain_reg
;
835 u16 specific_scan_time
;
836 u16 active_scan_time
;
837 u16 passive_scan_time
;
838 u16 scan_chan_gap_time
;
842 struct mwifiex_chan_scan_param_set
*scan_channels
;
844 struct mwifiex_sleep_params sleep_params
;
845 struct mwifiex_sleep_period sleep_period
;
850 u16 local_listen_interval
;
851 u16 null_pkt_interval
;
852 struct sk_buff
*sleep_cfm
;
853 u16 bcn_miss_time_out
;
854 u16 adhoc_awake_period
;
858 u16 enhanced_ps_mode
;
859 u8 pm_wakeup_card_req
;
862 u32 pm_wakeup_fw_try
;
863 struct timer_list wakeup_timer
;
865 struct mwifiex_hs_config_param hs_cfg
;
867 u16 hs_activate_wait_q_woken
;
868 wait_queue_head_t hs_activate_wait_q
;
871 u8 event_body
[MAX_EVENT_SIZE
];
872 u32 hw_dot_11n_dev_cap
;
873 u8 hw_dev_mcs_support
;
874 u8 user_dev_mcs_support
;
875 u8 adhoc_11n_enabled
;
877 struct mwifiex_dbg dbg
;
878 u8 arp_filter
[ARP_FILTER_MAX_BUF_SIZE
];
880 struct mwifiex_wait_queue cmd_wait_q
;
881 u8 scan_wait_q_woken
;
882 spinlock_t queue_lock
; /* lock for tx queues */
883 u8 country_code
[IEEE80211_COUNTRY_STRING_LEN
];
884 u16 max_mgmt_ie_index
;
885 const struct firmware
*cal_data
;
886 struct device_node
*dt_node
;
889 u32 is_hw_11ac_capable
;
890 u32 hw_dot_11ac_dev_cap
;
891 u32 hw_dot_11ac_mcs_support
;
892 u32 usr_dot_11ac_dev_cap_bg
;
893 u32 usr_dot_11ac_dev_cap_a
;
894 u32 usr_dot_11ac_mcs_support
;
896 atomic_t pending_bridged_pkts
;
897 struct semaphore
*card_sem
;
900 u8 key_api_major_ver
, key_api_minor_ver
;
901 struct work_struct iface_work
;
902 unsigned long iface_work_flags
;
903 struct memory_type_mapping
*mem_type_mapping_tbl
;
908 bool scan_chan_gap_enabled
;
909 struct sk_buff_head rx_data_q
;
910 struct mwifiex_chan_stats
*chan_stats
;
911 u32 num_in_chan_stats
;
916 void mwifiex_process_tx_queue(struct mwifiex_adapter
*adapter
);
918 int mwifiex_init_lock_list(struct mwifiex_adapter
*adapter
);
920 void mwifiex_set_trans_start(struct net_device
*dev
);
922 void mwifiex_stop_net_dev_queue(struct net_device
*netdev
,
923 struct mwifiex_adapter
*adapter
);
925 void mwifiex_wake_up_net_dev_queue(struct net_device
*netdev
,
926 struct mwifiex_adapter
*adapter
);
928 int mwifiex_init_priv(struct mwifiex_private
*priv
);
929 void mwifiex_free_priv(struct mwifiex_private
*priv
);
931 int mwifiex_init_fw(struct mwifiex_adapter
*adapter
);
933 int mwifiex_init_fw_complete(struct mwifiex_adapter
*adapter
);
935 int mwifiex_shutdown_drv(struct mwifiex_adapter
*adapter
);
937 int mwifiex_shutdown_fw_complete(struct mwifiex_adapter
*adapter
);
939 int mwifiex_dnld_fw(struct mwifiex_adapter
*, struct mwifiex_fw_image
*);
941 int mwifiex_recv_packet(struct mwifiex_private
*priv
, struct sk_buff
*skb
);
943 int mwifiex_process_mgmt_packet(struct mwifiex_private
*priv
,
944 struct sk_buff
*skb
);
946 int mwifiex_process_event(struct mwifiex_adapter
*adapter
);
948 int mwifiex_complete_cmd(struct mwifiex_adapter
*adapter
,
949 struct cmd_ctrl_node
*cmd_node
);
951 int mwifiex_send_cmd(struct mwifiex_private
*priv
, u16 cmd_no
,
952 u16 cmd_action
, u32 cmd_oid
, void *data_buf
, bool sync
);
954 void mwifiex_cmd_timeout_func(unsigned long function_context
);
956 int mwifiex_get_debug_info(struct mwifiex_private
*,
957 struct mwifiex_debug_info
*);
959 int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter
*adapter
);
960 int mwifiex_free_cmd_buffer(struct mwifiex_adapter
*adapter
);
961 void mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter
*adapter
);
962 void mwifiex_cancel_pending_ioctl(struct mwifiex_adapter
*adapter
);
964 void mwifiex_insert_cmd_to_free_q(struct mwifiex_adapter
*adapter
,
965 struct cmd_ctrl_node
*cmd_node
);
966 void mwifiex_recycle_cmd_node(struct mwifiex_adapter
*adapter
,
967 struct cmd_ctrl_node
*cmd_node
);
969 void mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter
*adapter
,
970 struct cmd_ctrl_node
*cmd_node
,
973 int mwifiex_exec_next_cmd(struct mwifiex_adapter
*adapter
);
974 int mwifiex_process_cmdresp(struct mwifiex_adapter
*adapter
);
975 int mwifiex_handle_rx_packet(struct mwifiex_adapter
*adapter
,
976 struct sk_buff
*skb
);
977 int mwifiex_process_tx(struct mwifiex_private
*priv
, struct sk_buff
*skb
,
978 struct mwifiex_tx_param
*tx_param
);
979 int mwifiex_send_null_packet(struct mwifiex_private
*priv
, u8 flags
);
980 int mwifiex_write_data_complete(struct mwifiex_adapter
*adapter
,
981 struct sk_buff
*skb
, int aggr
, int status
);
982 void mwifiex_clean_txrx(struct mwifiex_private
*priv
);
983 u8
mwifiex_check_last_packet_indication(struct mwifiex_private
*priv
);
984 void mwifiex_check_ps_cond(struct mwifiex_adapter
*adapter
);
985 void mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter
*, u8
*,
987 int mwifiex_cmd_enh_power_mode(struct mwifiex_private
*priv
,
988 struct host_cmd_ds_command
*cmd
,
989 u16 cmd_action
, uint16_t ps_bitmap
,
990 struct mwifiex_ds_auto_ds
*auto_ds
);
991 int mwifiex_ret_enh_power_mode(struct mwifiex_private
*priv
,
992 struct host_cmd_ds_command
*resp
,
993 struct mwifiex_ds_pm_cfg
*pm_cfg
);
994 void mwifiex_process_hs_config(struct mwifiex_adapter
*adapter
);
995 void mwifiex_hs_activated_event(struct mwifiex_private
*priv
,
997 int mwifiex_set_hs_params(struct mwifiex_private
*priv
, u16 action
,
998 int cmd_type
, struct mwifiex_ds_hs_cfg
*hs_cfg
);
999 int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private
*priv
,
1000 struct host_cmd_ds_command
*resp
);
1001 int mwifiex_process_rx_packet(struct mwifiex_private
*priv
,
1002 struct sk_buff
*skb
);
1003 int mwifiex_sta_prepare_cmd(struct mwifiex_private
*, uint16_t cmd_no
,
1004 u16 cmd_action
, u32 cmd_oid
,
1005 void *data_buf
, void *cmd_buf
);
1006 int mwifiex_uap_prepare_cmd(struct mwifiex_private
*priv
, uint16_t cmd_no
,
1007 u16 cmd_action
, u32 cmd_oid
,
1008 void *data_buf
, void *cmd_buf
);
1009 int mwifiex_process_sta_cmdresp(struct mwifiex_private
*, u16 cmdresp_no
,
1010 struct host_cmd_ds_command
*resp
);
1011 int mwifiex_process_sta_rx_packet(struct mwifiex_private
*,
1012 struct sk_buff
*skb
);
1013 int mwifiex_process_uap_rx_packet(struct mwifiex_private
*priv
,
1014 struct sk_buff
*skb
);
1015 int mwifiex_handle_uap_rx_forward(struct mwifiex_private
*priv
,
1016 struct sk_buff
*skb
);
1017 int mwifiex_process_sta_event(struct mwifiex_private
*);
1018 int mwifiex_process_uap_event(struct mwifiex_private
*);
1019 void mwifiex_delete_all_station_list(struct mwifiex_private
*priv
);
1020 void mwifiex_wmm_del_peer_ra_list(struct mwifiex_private
*priv
,
1022 void *mwifiex_process_sta_txpd(struct mwifiex_private
*, struct sk_buff
*skb
);
1023 void *mwifiex_process_uap_txpd(struct mwifiex_private
*, struct sk_buff
*skb
);
1024 int mwifiex_sta_init_cmd(struct mwifiex_private
*, u8 first_sta
, bool init
);
1025 int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command
*cmd
,
1026 struct mwifiex_scan_cmd_config
*scan_cfg
);
1027 void mwifiex_queue_scan_cmd(struct mwifiex_private
*priv
,
1028 struct cmd_ctrl_node
*cmd_node
);
1029 int mwifiex_ret_802_11_scan(struct mwifiex_private
*priv
,
1030 struct host_cmd_ds_command
*resp
);
1031 s32
mwifiex_ssid_cmp(struct cfg80211_ssid
*ssid1
, struct cfg80211_ssid
*ssid2
);
1032 int mwifiex_associate(struct mwifiex_private
*priv
,
1033 struct mwifiex_bssdescriptor
*bss_desc
);
1034 int mwifiex_cmd_802_11_associate(struct mwifiex_private
*priv
,
1035 struct host_cmd_ds_command
*cmd
,
1036 struct mwifiex_bssdescriptor
*bss_desc
);
1037 int mwifiex_ret_802_11_associate(struct mwifiex_private
*priv
,
1038 struct host_cmd_ds_command
*resp
);
1039 void mwifiex_reset_connect_state(struct mwifiex_private
*priv
, u16 reason
);
1040 u8
mwifiex_band_to_radio_type(u8 band
);
1041 int mwifiex_deauthenticate(struct mwifiex_private
*priv
, u8
*mac
);
1042 void mwifiex_deauthenticate_all(struct mwifiex_adapter
*adapter
);
1043 int mwifiex_adhoc_start(struct mwifiex_private
*priv
,
1044 struct cfg80211_ssid
*adhoc_ssid
);
1045 int mwifiex_adhoc_join(struct mwifiex_private
*priv
,
1046 struct mwifiex_bssdescriptor
*bss_desc
);
1047 int mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private
*priv
,
1048 struct host_cmd_ds_command
*cmd
,
1049 struct cfg80211_ssid
*req_ssid
);
1050 int mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private
*priv
,
1051 struct host_cmd_ds_command
*cmd
,
1052 struct mwifiex_bssdescriptor
*bss_desc
);
1053 int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private
*priv
,
1054 struct host_cmd_ds_command
*resp
);
1055 int mwifiex_cmd_802_11_bg_scan_query(struct host_cmd_ds_command
*cmd
);
1056 struct mwifiex_chan_freq_power
*mwifiex_get_cfp(struct mwifiex_private
*priv
,
1057 u8 band
, u16 channel
, u32 freq
);
1058 u32
mwifiex_index_to_data_rate(struct mwifiex_private
*priv
,
1059 u8 index
, u8 ht_info
);
1060 u32
mwifiex_index_to_acs_data_rate(struct mwifiex_private
*priv
,
1061 u8 index
, u8 ht_info
);
1062 u32
mwifiex_find_freq_from_band_chan(u8
, u8
);
1063 int mwifiex_cmd_append_vsie_tlv(struct mwifiex_private
*priv
, u16 vsie_mask
,
1065 u32
mwifiex_get_active_data_rates(struct mwifiex_private
*priv
,
1067 u32
mwifiex_get_supported_rates(struct mwifiex_private
*priv
, u8
*rates
);
1068 u32
mwifiex_get_rates_from_cfg80211(struct mwifiex_private
*priv
,
1069 u8
*rates
, u8 radio_type
);
1070 u8
mwifiex_is_rate_auto(struct mwifiex_private
*priv
);
1071 extern u16 region_code_index
[MWIFIEX_MAX_REGION_CODE
];
1072 void mwifiex_save_curr_bcn(struct mwifiex_private
*priv
);
1073 void mwifiex_free_curr_bcn(struct mwifiex_private
*priv
);
1074 int mwifiex_cmd_get_hw_spec(struct mwifiex_private
*priv
,
1075 struct host_cmd_ds_command
*cmd
);
1076 int mwifiex_ret_get_hw_spec(struct mwifiex_private
*priv
,
1077 struct host_cmd_ds_command
*resp
);
1078 int is_command_pending(struct mwifiex_adapter
*adapter
);
1079 void mwifiex_init_priv_params(struct mwifiex_private
*priv
,
1080 struct net_device
*dev
);
1081 int mwifiex_set_secure_params(struct mwifiex_private
*priv
,
1082 struct mwifiex_uap_bss_param
*bss_config
,
1083 struct cfg80211_ap_settings
*params
);
1084 void mwifiex_set_ht_params(struct mwifiex_private
*priv
,
1085 struct mwifiex_uap_bss_param
*bss_cfg
,
1086 struct cfg80211_ap_settings
*params
);
1087 void mwifiex_set_vht_params(struct mwifiex_private
*priv
,
1088 struct mwifiex_uap_bss_param
*bss_cfg
,
1089 struct cfg80211_ap_settings
*params
);
1090 void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param
*bss_cfg
,
1091 struct cfg80211_ap_settings
*params
);
1092 void mwifiex_set_vht_width(struct mwifiex_private
*priv
,
1093 enum nl80211_chan_width width
,
1094 bool ap_11ac_disable
);
1096 mwifiex_set_wmm_params(struct mwifiex_private
*priv
,
1097 struct mwifiex_uap_bss_param
*bss_cfg
,
1098 struct cfg80211_ap_settings
*params
);
1099 void mwifiex_set_ba_params(struct mwifiex_private
*priv
);
1100 void mwifiex_set_11ac_ba_params(struct mwifiex_private
*priv
);
1101 int mwifiex_cmd_802_11_scan_ext(struct mwifiex_private
*priv
,
1102 struct host_cmd_ds_command
*cmd
,
1104 int mwifiex_ret_802_11_scan_ext(struct mwifiex_private
*priv
,
1105 struct host_cmd_ds_command
*resp
);
1106 int mwifiex_handle_event_ext_scan_report(struct mwifiex_private
*priv
,
1110 * This function checks if the queuing is RA based or not.
1113 mwifiex_queuing_ra_based(struct mwifiex_private
*priv
)
1116 * Currently we assume if we are in Infra, then DA=RA. This might not be
1117 * true in the future
1119 if ((priv
->bss_mode
== NL80211_IFTYPE_STATION
) &&
1120 (GET_BSS_ROLE(priv
) == MWIFIEX_BSS_ROLE_STA
))
1127 * This function copies rates.
1130 mwifiex_copy_rates(u8
*dest
, u32 pos
, u8
*src
, int len
)
1134 for (i
= 0; i
< len
&& src
[i
]; i
++, pos
++) {
1135 if (pos
>= MWIFIEX_SUPPORTED_RATES
)
1144 * This function returns the correct private structure pointer based
1145 * upon the BSS type and BSS number.
1147 static inline struct mwifiex_private
*
1148 mwifiex_get_priv_by_id(struct mwifiex_adapter
*adapter
,
1149 u8 bss_num
, u8 bss_type
)
1153 for (i
= 0; i
< adapter
->priv_num
; i
++) {
1154 if (adapter
->priv
[i
]) {
1155 if ((adapter
->priv
[i
]->bss_num
== bss_num
) &&
1156 (adapter
->priv
[i
]->bss_type
== bss_type
))
1160 return ((i
< adapter
->priv_num
) ? adapter
->priv
[i
] : NULL
);
1164 * This function returns the first available private structure pointer
1165 * based upon the BSS role.
1167 static inline struct mwifiex_private
*
1168 mwifiex_get_priv(struct mwifiex_adapter
*adapter
,
1169 enum mwifiex_bss_role bss_role
)
1173 for (i
= 0; i
< adapter
->priv_num
; i
++) {
1174 if (adapter
->priv
[i
]) {
1175 if (bss_role
== MWIFIEX_BSS_ROLE_ANY
||
1176 GET_BSS_ROLE(adapter
->priv
[i
]) == bss_role
)
1181 return ((i
< adapter
->priv_num
) ? adapter
->priv
[i
] : NULL
);
1185 * This function returns the first available unused private structure pointer.
1187 static inline struct mwifiex_private
*
1188 mwifiex_get_unused_priv(struct mwifiex_adapter
*adapter
)
1192 for (i
= 0; i
< adapter
->priv_num
; i
++) {
1193 if (adapter
->priv
[i
]) {
1194 if (adapter
->priv
[i
]->bss_mode
==
1195 NL80211_IFTYPE_UNSPECIFIED
)
1200 return ((i
< adapter
->priv_num
) ? adapter
->priv
[i
] : NULL
);
1204 * This function returns the driver private structure of a network device.
1206 static inline struct mwifiex_private
*
1207 mwifiex_netdev_get_priv(struct net_device
*dev
)
1209 return (struct mwifiex_private
*) (*(unsigned long *) netdev_priv(dev
));
1213 * This function checks if a skb holds a management frame.
1215 static inline bool mwifiex_is_skb_mgmt_frame(struct sk_buff
*skb
)
1217 return (le32_to_cpu(*(__le32
*)skb
->data
) == PKT_TYPE_MGMT
);
1220 /* This function retrieves channel closed for operation by Channel
1221 * Switch Announcement.
1224 mwifiex_11h_get_csa_closed_channel(struct mwifiex_private
*priv
)
1226 if (!priv
->csa_chan
)
1229 /* Clear csa channel, if DFS channel move time has passed */
1230 if (time_after(jiffies
, priv
->csa_expire_time
)) {
1232 priv
->csa_expire_time
= 0;
1235 return priv
->csa_chan
;
1238 static inline u8
mwifiex_is_any_intf_active(struct mwifiex_private
*priv
)
1240 struct mwifiex_private
*priv_num
;
1243 for (i
= 0; i
< priv
->adapter
->priv_num
; i
++) {
1244 priv_num
= priv
->adapter
->priv
[i
];
1246 if ((GET_BSS_ROLE(priv_num
) == MWIFIEX_BSS_ROLE_UAP
&&
1247 priv_num
->bss_started
) ||
1248 (GET_BSS_ROLE(priv_num
) == MWIFIEX_BSS_ROLE_STA
&&
1249 priv_num
->media_connected
))
1257 int mwifiex_init_shutdown_fw(struct mwifiex_private
*priv
,
1258 u32 func_init_shutdown
);
1259 int mwifiex_add_card(void *, struct semaphore
*, struct mwifiex_if_ops
*, u8
);
1260 int mwifiex_remove_card(struct mwifiex_adapter
*, struct semaphore
*);
1262 void mwifiex_get_version(struct mwifiex_adapter
*adapter
, char *version
,
1264 int mwifiex_request_set_multicast_list(struct mwifiex_private
*priv
,
1265 struct mwifiex_multicast_list
*mcast_list
);
1266 int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list
*mlist
,
1267 struct net_device
*dev
);
1268 int mwifiex_wait_queue_complete(struct mwifiex_adapter
*adapter
,
1269 struct cmd_ctrl_node
*cmd_queued
);
1270 int mwifiex_bss_start(struct mwifiex_private
*priv
, struct cfg80211_bss
*bss
,
1271 struct cfg80211_ssid
*req_ssid
);
1272 int mwifiex_cancel_hs(struct mwifiex_private
*priv
, int cmd_type
);
1273 int mwifiex_enable_hs(struct mwifiex_adapter
*adapter
);
1274 int mwifiex_disable_auto_ds(struct mwifiex_private
*priv
);
1275 int mwifiex_drv_get_data_rate(struct mwifiex_private
*priv
, u32
*rate
);
1276 int mwifiex_request_scan(struct mwifiex_private
*priv
,
1277 struct cfg80211_ssid
*req_ssid
);
1278 int mwifiex_scan_networks(struct mwifiex_private
*priv
,
1279 const struct mwifiex_user_scan_cfg
*user_scan_in
);
1280 int mwifiex_set_radio(struct mwifiex_private
*priv
, u8 option
);
1282 int mwifiex_set_encode(struct mwifiex_private
*priv
, struct key_params
*kp
,
1283 const u8
*key
, int key_len
, u8 key_index
,
1284 const u8
*mac_addr
, int disable
);
1286 int mwifiex_set_gen_ie(struct mwifiex_private
*priv
, const u8
*ie
, int ie_len
);
1288 int mwifiex_get_ver_ext(struct mwifiex_private
*priv
);
1290 int mwifiex_remain_on_chan_cfg(struct mwifiex_private
*priv
, u16 action
,
1291 struct ieee80211_channel
*chan
,
1292 unsigned int duration
);
1294 int mwifiex_get_stats_info(struct mwifiex_private
*priv
,
1295 struct mwifiex_ds_get_stats
*log
);
1297 int mwifiex_reg_write(struct mwifiex_private
*priv
, u32 reg_type
,
1298 u32 reg_offset
, u32 reg_value
);
1300 int mwifiex_reg_read(struct mwifiex_private
*priv
, u32 reg_type
,
1301 u32 reg_offset
, u32
*value
);
1303 int mwifiex_eeprom_read(struct mwifiex_private
*priv
, u16 offset
, u16 bytes
,
1306 int mwifiex_set_11n_httx_cfg(struct mwifiex_private
*priv
, int data
);
1308 int mwifiex_get_11n_httx_cfg(struct mwifiex_private
*priv
, int *data
);
1310 int mwifiex_set_tx_rate_cfg(struct mwifiex_private
*priv
, int tx_rate_index
);
1312 int mwifiex_get_tx_rate_cfg(struct mwifiex_private
*priv
, int *tx_rate_index
);
1314 int mwifiex_drv_set_power(struct mwifiex_private
*priv
, u32
*ps_mode
);
1316 int mwifiex_drv_get_driver_version(struct mwifiex_adapter
*adapter
,
1317 char *version
, int max_len
);
1319 int mwifiex_set_tx_power(struct mwifiex_private
*priv
,
1320 struct mwifiex_power_cfg
*power_cfg
);
1322 int mwifiex_main_process(struct mwifiex_adapter
*);
1324 int mwifiex_queue_tx_pkt(struct mwifiex_private
*priv
, struct sk_buff
*skb
);
1326 int mwifiex_get_bss_info(struct mwifiex_private
*,
1327 struct mwifiex_bss_info
*);
1328 int mwifiex_fill_new_bss_desc(struct mwifiex_private
*priv
,
1329 struct cfg80211_bss
*bss
,
1330 struct mwifiex_bssdescriptor
*bss_desc
);
1331 int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter
*adapter
,
1332 struct mwifiex_bssdescriptor
*bss_entry
);
1333 int mwifiex_check_network_compatibility(struct mwifiex_private
*priv
,
1334 struct mwifiex_bssdescriptor
*bss_desc
);
1336 u8
mwifiex_chan_type_to_sec_chan_offset(enum nl80211_channel_type chan_type
);
1338 struct wireless_dev
*mwifiex_add_virtual_intf(struct wiphy
*wiphy
,
1340 enum nl80211_iftype type
,
1342 struct vif_params
*params
);
1343 int mwifiex_del_virtual_intf(struct wiphy
*wiphy
, struct wireless_dev
*wdev
);
1345 void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param
*config
);
1347 int mwifiex_add_wowlan_magic_pkt_filter(struct mwifiex_adapter
*adapter
);
1349 int mwifiex_set_mgmt_ies(struct mwifiex_private
*priv
,
1350 struct cfg80211_beacon_data
*data
);
1351 int mwifiex_del_mgmt_ies(struct mwifiex_private
*priv
);
1352 u8
*mwifiex_11d_code_2_region(u8 code
);
1353 void mwifiex_uap_set_channel(struct mwifiex_uap_bss_param
*bss_cfg
,
1354 struct cfg80211_chan_def chandef
);
1355 int mwifiex_config_start_uap(struct mwifiex_private
*priv
,
1356 struct mwifiex_uap_bss_param
*bss_cfg
);
1357 void mwifiex_uap_del_sta_data(struct mwifiex_private
*priv
,
1358 struct mwifiex_sta_node
*node
);
1360 void mwifiex_init_11h_params(struct mwifiex_private
*priv
);
1361 int mwifiex_is_11h_active(struct mwifiex_private
*priv
);
1362 int mwifiex_11h_activate(struct mwifiex_private
*priv
, bool flag
);
1364 void mwifiex_11h_process_join(struct mwifiex_private
*priv
, u8
**buffer
,
1365 struct mwifiex_bssdescriptor
*bss_desc
);
1366 int mwifiex_11h_handle_event_chanswann(struct mwifiex_private
*priv
);
1367 int mwifiex_dnld_dt_cfgdata(struct mwifiex_private
*priv
,
1368 struct device_node
*node
, const char *prefix
);
1369 void mwifiex_dnld_txpwr_table(struct mwifiex_private
*priv
);
1371 extern const struct ethtool_ops mwifiex_ethtool_ops
;
1373 void mwifiex_del_all_sta_list(struct mwifiex_private
*priv
);
1374 void mwifiex_del_sta_entry(struct mwifiex_private
*priv
, const u8
*mac
);
1376 mwifiex_set_sta_ht_cap(struct mwifiex_private
*priv
, const u8
*ies
,
1377 int ies_len
, struct mwifiex_sta_node
*node
);
1378 struct mwifiex_sta_node
*
1379 mwifiex_add_sta_entry(struct mwifiex_private
*priv
, const u8
*mac
);
1380 struct mwifiex_sta_node
*
1381 mwifiex_get_sta_entry(struct mwifiex_private
*priv
, const u8
*mac
);
1382 int mwifiex_send_tdls_data_frame(struct mwifiex_private
*priv
, const u8
*peer
,
1383 u8 action_code
, u8 dialog_token
,
1384 u16 status_code
, const u8
*extra_ies
,
1385 size_t extra_ies_len
);
1386 int mwifiex_send_tdls_action_frame(struct mwifiex_private
*priv
, const u8
*peer
,
1387 u8 action_code
, u8 dialog_token
,
1388 u16 status_code
, const u8
*extra_ies
,
1389 size_t extra_ies_len
);
1390 void mwifiex_process_tdls_action_frame(struct mwifiex_private
*priv
,
1392 int mwifiex_tdls_oper(struct mwifiex_private
*priv
, const u8
*peer
, u8 action
);
1393 int mwifiex_get_tdls_link_status(struct mwifiex_private
*priv
, const u8
*mac
);
1394 int mwifiex_get_tdls_list(struct mwifiex_private
*priv
,
1395 struct tdls_peer_info
*buf
);
1396 void mwifiex_disable_all_tdls_links(struct mwifiex_private
*priv
);
1397 bool mwifiex_is_bss_in_11ac_mode(struct mwifiex_private
*priv
);
1398 u8
mwifiex_get_center_freq_index(struct mwifiex_private
*priv
, u8 band
,
1399 u32 pri_chan
, u8 chan_bw
);
1400 int mwifiex_init_channel_scan_gap(struct mwifiex_adapter
*adapter
);
1402 int mwifiex_tdls_check_tx(struct mwifiex_private
*priv
, struct sk_buff
*skb
);
1403 void mwifiex_flush_auto_tdls_list(struct mwifiex_private
*priv
);
1404 void mwifiex_auto_tdls_update_peer_status(struct mwifiex_private
*priv
,
1405 const u8
*mac
, u8 link_status
);
1406 void mwifiex_auto_tdls_update_peer_signal(struct mwifiex_private
*priv
,
1407 u8
*mac
, s8 snr
, s8 nflr
);
1408 void mwifiex_check_auto_tdls(unsigned long context
);
1409 void mwifiex_add_auto_tdls_peer(struct mwifiex_private
*priv
, const u8
*mac
);
1410 void mwifiex_setup_auto_tdls_timer(struct mwifiex_private
*priv
);
1411 void mwifiex_clean_auto_tdls(struct mwifiex_private
*priv
);
1412 int mwifiex_cmd_issue_chan_report_request(struct mwifiex_private
*priv
,
1413 struct host_cmd_ds_command
*cmd
,
1415 int mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private
*priv
,
1416 struct sk_buff
*skb
);
1418 void mwifiex_parse_tx_status_event(struct mwifiex_private
*priv
,
1422 mwifiex_clone_skb_for_tx_status(struct mwifiex_private
*priv
,
1423 struct sk_buff
*skb
, u8 flag
, u64
*cookie
);
1424 void mwifiex_dfs_cac_work_queue(struct work_struct
*work
);
1425 void mwifiex_dfs_chan_sw_work_queue(struct work_struct
*work
);
1426 void mwifiex_abort_cac(struct mwifiex_private
*priv
);
1427 int mwifiex_11h_handle_radar_detected(struct mwifiex_private
*priv
,
1428 struct sk_buff
*skb
);
1430 void mwifiex_hist_data_set(struct mwifiex_private
*priv
, u8 rx_rate
, s8 snr
,
1432 void mwifiex_hist_data_reset(struct mwifiex_private
*priv
);
1433 void mwifiex_hist_data_add(struct mwifiex_private
*priv
,
1434 u8 rx_rate
, s8 snr
, s8 nflr
);
1435 u8
mwifiex_adjust_data_rate(struct mwifiex_private
*priv
,
1436 u8 rx_rate
, u8 ht_info
);
1438 void mwifiex_dump_drv_info(struct mwifiex_adapter
*adapter
);
1439 void *mwifiex_alloc_dma_align_buf(int rx_len
, gfp_t flags
);
1440 void mwifiex_queue_main_work(struct mwifiex_adapter
*adapter
);
1442 #ifdef CONFIG_DEBUG_FS
1443 void mwifiex_debugfs_init(void);
1444 void mwifiex_debugfs_remove(void);
1446 void mwifiex_dev_debugfs_init(struct mwifiex_private
*priv
);
1447 void mwifiex_dev_debugfs_remove(struct mwifiex_private
*priv
);
1449 #endif /* !_MWIFIEX_MAIN_H_ */