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_DEFAULT_WATCHDOG_TIMEOUT (5 * HZ)
64 #define MWIFIEX_TIMER_10S 10000
65 #define MWIFIEX_TIMER_1S 1000
67 #define MAX_TX_PENDING 100
68 #define LOW_TX_PENDING 80
70 #define HIGH_RX_PENDING 50
71 #define LOW_RX_PENDING 20
73 #define MWIFIEX_UPLD_SIZE (2312)
75 #define MAX_EVENT_SIZE 2048
77 #define ARP_FILTER_MAX_BUF_SIZE 68
79 #define MWIFIEX_KEY_BUFFER_SIZE 16
80 #define MWIFIEX_DEFAULT_LISTEN_INTERVAL 10
81 #define MWIFIEX_MAX_REGION_CODE 7
83 #define DEFAULT_BCN_AVG_FACTOR 8
84 #define DEFAULT_DATA_AVG_FACTOR 8
86 #define FIRST_VALID_CHANNEL 0xff
87 #define DEFAULT_AD_HOC_CHANNEL 6
88 #define DEFAULT_AD_HOC_CHANNEL_A 36
90 #define DEFAULT_BCN_MISS_TIMEOUT 5
92 #define MAX_SCAN_BEACON_BUFFER 8000
94 #define SCAN_BEACON_ENTRY_PAD 6
96 #define MWIFIEX_PASSIVE_SCAN_CHAN_TIME 110
97 #define MWIFIEX_ACTIVE_SCAN_CHAN_TIME 30
98 #define MWIFIEX_SPECIFIC_SCAN_CHAN_TIME 30
99 #define MWIFIEX_DEF_SCAN_CHAN_GAP_TIME 50
101 #define SCAN_RSSI(RSSI) (0x100 - ((u8)(RSSI)))
103 #define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S)
105 #define RSN_GTK_OUI_OFFSET 2
107 #define MWIFIEX_OUI_NOT_PRESENT 0
108 #define MWIFIEX_OUI_PRESENT 1
110 #define PKT_TYPE_MGMT 0xE5
113 * Do not check for data_received for USB, as data_received
114 * is handled in mwifiex_usb_recv for USB
116 #define IS_CARD_RX_RCVD(adapter) (adapter->cmd_resp_received || \
117 adapter->event_received || \
118 adapter->data_received)
120 #define MWIFIEX_TYPE_CMD 1
121 #define MWIFIEX_TYPE_DATA 0
122 #define MWIFIEX_TYPE_EVENT 3
124 #define MAX_BITMAP_RATES_SIZE 18
126 #define MAX_CHANNEL_BAND_BG 14
127 #define MAX_CHANNEL_BAND_A 165
129 #define MAX_FREQUENCY_BAND_BG 2484
131 #define MWIFIEX_EVENT_HEADER_LEN 4
132 #define MWIFIEX_UAP_EVENT_EXTRA_HEADER 2
134 #define MWIFIEX_TYPE_LEN 4
135 #define MWIFIEX_USB_TYPE_CMD 0xF00DFACE
136 #define MWIFIEX_USB_TYPE_DATA 0xBEADC0DE
137 #define MWIFIEX_USB_TYPE_EVENT 0xBEEFFACE
139 /* Threshold for tx_timeout_cnt before we trigger a card reset */
140 #define TX_TIMEOUT_THRESHOLD 6
142 #define MWIFIEX_DRV_INFO_SIZE_MAX 0x40000
144 /* Address alignment */
145 #define MWIFIEX_ALIGN_ADDR(p, a) (((long)(p) + (a) - 1) & ~((a) - 1))
148 u32 num_cmd_host_to_card_failure
;
149 u32 num_cmd_sleep_cfm_host_to_card_failure
;
150 u32 num_tx_host_to_card_failure
;
151 u32 num_event_deauth
;
152 u32 num_event_disassoc
;
153 u32 num_event_link_lost
;
155 u32 num_cmd_assoc_success
;
156 u32 num_cmd_assoc_failure
;
160 u16 last_cmd_id
[DBG_CMD_NUM
];
161 u16 last_cmd_act
[DBG_CMD_NUM
];
163 u16 last_cmd_resp_id
[DBG_CMD_NUM
];
164 u16 last_cmd_resp_index
;
165 u16 last_event
[DBG_CMD_NUM
];
166 u16 last_event_index
;
169 enum MWIFIEX_HARDWARE_STATUS
{
170 MWIFIEX_HW_STATUS_READY
,
171 MWIFIEX_HW_STATUS_INITIALIZING
,
172 MWIFIEX_HW_STATUS_INIT_DONE
,
173 MWIFIEX_HW_STATUS_RESET
,
174 MWIFIEX_HW_STATUS_CLOSING
,
175 MWIFIEX_HW_STATUS_NOT_READY
178 enum MWIFIEX_802_11_POWER_MODE
{
179 MWIFIEX_802_11_POWER_MODE_CAM
,
180 MWIFIEX_802_11_POWER_MODE_PSP
183 struct mwifiex_tx_param
{
187 enum MWIFIEX_PS_STATE
{
194 enum mwifiex_iface_type
{
200 struct mwifiex_add_ba_param
{
208 struct mwifiex_tx_aggr
{
214 struct mwifiex_ra_list_tbl
{
215 struct list_head list
;
216 struct sk_buff_head skb_head
;
226 struct mwifiex_tid_tbl
{
227 struct list_head ra_list
;
230 #define WMM_HIGHEST_PRIORITY 7
231 #define HIGH_PRIO_TID 7
232 #define LOW_PRIO_TID 0
234 struct mwifiex_wmm_desc
{
235 struct mwifiex_tid_tbl tid_tbl_ptr
[MAX_NUM_TID
];
236 u32 packets_out
[MAX_NUM_TID
];
237 /* spin lock to protect ra_list */
238 spinlock_t ra_list_spinlock
;
239 struct mwifiex_wmm_ac_status ac_status
[IEEE80211_NUM_ACS
];
240 enum mwifiex_wmm_ac_e ac_down_graded_vals
[IEEE80211_NUM_ACS
];
241 u32 drv_pkt_delay_max
;
242 u8 queue_priority
[IEEE80211_NUM_ACS
];
243 u32 user_pri_pkt_tx_ctrl
[WMM_HIGHEST_PRIORITY
+ 1]; /* UP: 0 to 7 */
244 /* Number of transmit packets queued */
245 atomic_t tx_pkts_queued
;
246 /* Tracks highest priority with a packet queued */
247 atomic_t highest_queued_prio
;
250 struct mwifiex_802_11_security
{
256 u32 authentication_mode
;
261 struct ieee_types_header
{
266 struct ieee_types_vendor_specific
{
267 struct ieee_types_vendor_header vend_hdr
;
268 u8 data
[IEEE_MAX_IE_SIZE
- sizeof(struct ieee_types_vendor_header
)];
271 struct ieee_types_generic
{
272 struct ieee_types_header ieee_hdr
;
273 u8 data
[IEEE_MAX_IE_SIZE
- sizeof(struct ieee_types_header
)];
276 struct ieee_types_bss_co_2040
{
277 struct ieee_types_header ieee_hdr
;
281 struct ieee_types_extcap
{
282 struct ieee_types_header ieee_hdr
;
286 struct ieee_types_vht_cap
{
287 struct ieee_types_header ieee_hdr
;
288 struct ieee80211_vht_cap vhtcap
;
291 struct ieee_types_vht_oper
{
292 struct ieee_types_header ieee_hdr
;
293 struct ieee80211_vht_operation vhtoper
;
296 struct ieee_types_aid
{
297 struct ieee_types_header ieee_hdr
;
301 struct mwifiex_bssdescriptor
{
302 u8 mac_address
[ETH_ALEN
];
303 struct cfg80211_ssid ssid
;
311 u8 supported_rates
[MWIFIEX_SUPPORTED_RATES
];
312 u8 data_rates
[MWIFIEX_SUPPORTED_RATES
];
314 * BAND_B(0x01): 'b' band
315 * BAND_G(0x02): 'g' band
316 * BAND_A(0X04): 'a' band
321 union ieee_types_phy_param_set phy_param_set
;
322 union ieee_types_ss_param_set ss_param_set
;
324 struct ieee_types_wmm_parameter wmm_ie
;
326 struct ieee80211_ht_cap
*bcn_ht_cap
;
328 struct ieee80211_ht_operation
*bcn_ht_oper
;
331 u16 bss_co_2040_offset
;
334 struct ieee80211_vht_cap
*bcn_vht_cap
;
336 struct ieee80211_vht_operation
*bcn_vht_oper
;
338 struct ieee_types_oper_mode_ntf
*oper_mode
;
339 u16 oper_mode_offset
;
341 struct ieee_types_vendor_specific
*bcn_wpa_ie
;
343 struct ieee_types_generic
*bcn_rsn_ie
;
345 struct ieee_types_generic
*bcn_wapi_ie
;
351 u8 chan_sw_ie_present
;
354 struct mwifiex_current_bss_params
{
355 struct mwifiex_bssdescriptor bss_descriptor
;
357 u8 wmm_uapsd_enabled
;
360 u8 data_rates
[MWIFIEX_SUPPORTED_RATES
];
363 struct mwifiex_sleep_params
{
372 struct mwifiex_sleep_period
{
377 struct mwifiex_wep_key
{
381 u8 key_material
[MWIFIEX_KEY_BUFFER_SIZE
];
384 #define MAX_REGION_CHANNEL_NUM 2
386 struct mwifiex_chan_freq_power
{
398 #define MWIFIEX_MAX_TRIPLET_802_11D 83
400 struct mwifiex_802_11d_domain_reg
{
401 u8 country_code
[IEEE80211_COUNTRY_STRING_LEN
];
403 struct ieee80211_country_ie_triplet
404 triplet
[MWIFIEX_MAX_TRIPLET_802_11D
];
407 struct mwifiex_vendor_spec_cfg_ie
{
410 u8 ie
[MWIFIEX_MAX_VSIE_LEN
];
417 struct mwifiex_roc_cfg
{
419 struct ieee80211_channel chan
;
422 #define MWIFIEX_FW_DUMP_IDX 0xff
423 #define MWIFIEX_DRV_INFO_IDX 20
424 #define FW_DUMP_MAX_NAME_LEN 8
425 #define FW_DUMP_HOST_READY 0xEE
426 #define FW_DUMP_DONE 0xFF
427 #define FW_DUMP_READ_DONE 0xFE
429 struct memory_type_mapping
{
430 u8 mem_name
[FW_DUMP_MAX_NAME_LEN
];
437 RDWR_STATUS_SUCCESS
= 0,
438 RDWR_STATUS_FAILURE
= 1,
442 enum mwifiex_iface_work_flags
{
443 MWIFIEX_IFACE_WORK_FW_DUMP
,
444 MWIFIEX_IFACE_WORK_CARD_RESET
,
447 struct mwifiex_adapter
;
448 struct mwifiex_private
;
450 struct mwifiex_private
{
451 struct mwifiex_adapter
*adapter
;
458 u8 curr_addr
[ETH_ALEN
];
461 /* track consecutive timeout */
463 struct net_device
*netdev
;
464 struct net_device_stats stats
;
469 u8 max_tx_power_level
;
470 u8 min_tx_power_level
;
476 u16 bitmap_rates
[MAX_BITMAP_RATES_SIZE
];
478 u8 is_data_rate_auto
;
489 struct mwifiex_bssdescriptor
*attempted_bss_desc
;
490 struct cfg80211_ssid prev_ssid
;
491 u8 prev_bssid
[ETH_ALEN
];
492 struct mwifiex_current_bss_params curr_bss_params
;
498 u8 adhoc_is_link_sensed
;
500 struct mwifiex_802_11_security sec_info
;
501 struct mwifiex_wep_key wep_key
[NUM_WEP_KEYS
];
502 u16 wep_key_curr_index
;
506 struct host_cmd_ds_802_11_key_material aes_key
;
507 struct host_cmd_ds_802_11_key_material_v2 aes_key_v2
;
515 struct mwifiex_wmm_desc wmm
;
516 atomic_t wmm_tx_pending
[IEEE80211_NUM_ACS
];
517 struct list_head sta_list
;
518 /* spin lock for associated station/TDLS peers list */
519 spinlock_t sta_list_spinlock
;
520 struct list_head auto_tdls_list
;
521 /* spin lock for auto TDLS peer list */
522 spinlock_t auto_tdls_lock
;
523 struct list_head tx_ba_stream_tbl_ptr
;
524 /* spin lock for tx_ba_stream_tbl_ptr queue */
525 spinlock_t tx_ba_stream_tbl_lock
;
526 struct mwifiex_tx_aggr aggr_prio_tbl
[MAX_NUM_TID
];
527 struct mwifiex_add_ba_param add_ba_param
;
528 u16 rx_seq
[MAX_NUM_TID
];
529 u8 tos_to_tid_inv
[MAX_NUM_TID
];
530 struct list_head rx_reorder_tbl_ptr
;
531 /* spin lock for rx_reorder_tbl_ptr queue */
532 spinlock_t rx_reorder_tbl_lock
;
533 /* spin lock for Rx packets */
534 spinlock_t rx_pkt_lock
;
536 #define MWIFIEX_ASSOC_RSP_BUF_SIZE 500
537 u8 assoc_rsp_buf
[MWIFIEX_ASSOC_RSP_BUF_SIZE
];
540 #define MWIFIEX_GENIE_BUF_SIZE 256
541 u8 gen_ie_buf
[MWIFIEX_GENIE_BUF_SIZE
];
544 struct mwifiex_vendor_spec_cfg_ie vs_ie
[MWIFIEX_MAX_VSIE_NUM
];
546 #define MWIFIEX_ASSOC_TLV_BUF_SIZE 256
547 u8 assoc_tlv_buf
[MWIFIEX_ASSOC_TLV_BUF_SIZE
];
548 u8 assoc_tlv_buf_len
;
552 /* spin lock for beacon buffer */
553 spinlock_t curr_bcn_buf_lock
;
554 struct wireless_dev wdev
;
555 struct mwifiex_chan_freq_power cfp
;
556 char version_str
[128];
557 #ifdef CONFIG_DEBUG_FS
558 struct dentry
*dfs_dev_dir
;
560 u16 current_key_index
;
561 struct semaphore async_sem
;
562 struct cfg80211_scan_request
*scan_request
;
568 u8 subsc_evt_rssi_state
;
569 struct mwifiex_ds_misc_subsc_evt async_subsc_evt_storage
;
570 struct mwifiex_ie mgmt_ie
[MAX_MGMT_IE_INDEX
];
578 struct mwifiex_roc_cfg roc_cfg
;
581 unsigned long csa_expire_time
;
584 struct mwifiex_uap_bss_param bss_cfg
;
585 struct station_parameters
*sta_params
;
586 struct sk_buff_head tdls_txq
;
588 struct timer_list auto_tdls_timer
;
589 bool auto_tdls_timer_active
;
590 struct idr ack_status_frames
;
591 /* spin lock for ack status */
592 spinlock_t ack_status_lock
;
593 /** rx histogram data */
594 struct mwifiex_histogram_data
*hist_data
;
595 struct cfg80211_chan_def dfs_chandef
;
596 struct workqueue_struct
*dfs_cac_workqueue
;
597 struct delayed_work dfs_cac_work
;
598 struct timer_list dfs_chan_switch_timer
;
599 struct workqueue_struct
*dfs_chan_sw_workqueue
;
600 struct delayed_work dfs_chan_sw_work
;
601 struct cfg80211_beacon_data beacon_after
;
602 struct mwifiex_11h_intf_state state_11h
;
605 enum mwifiex_ba_status
{
611 struct mwifiex_tx_ba_stream_tbl
{
612 struct list_head list
;
615 enum mwifiex_ba_status ba_status
;
619 struct mwifiex_rx_reorder_tbl
;
621 struct reorder_tmr_cnxt
{
622 struct timer_list timer
;
623 struct mwifiex_rx_reorder_tbl
*ptr
;
624 struct mwifiex_private
*priv
;
628 struct mwifiex_rx_reorder_tbl
{
629 struct list_head list
;
635 void **rx_reorder_ptr
;
636 struct reorder_tmr_cnxt timer_context
;
641 struct mwifiex_bss_prio_node
{
642 struct list_head list
;
643 struct mwifiex_private
*priv
;
646 struct mwifiex_bss_prio_tbl
{
647 struct list_head bss_prio_head
;
648 /* spin lock for bss priority */
649 spinlock_t bss_prio_lock
;
650 struct mwifiex_bss_prio_node
*bss_prio_cur
;
653 struct cmd_ctrl_node
{
654 struct list_head list
;
655 struct mwifiex_private
*priv
;
658 struct sk_buff
*cmd_skb
;
659 struct sk_buff
*resp_skb
;
667 struct mwifiex_bss_priv
{
672 struct mwifiex_tdls_capab
{
679 struct ieee80211_ht_cap ht_capb
;
680 struct ieee80211_ht_operation ht_oper
;
681 struct ieee_types_extcap extcap
;
682 struct ieee_types_generic rsn_ie
;
683 struct ieee80211_vht_cap vhtcap
;
684 struct ieee80211_vht_operation vhtoper
;
687 /* This is AP/TDLS specific structure which stores information
688 * about associated/peer STA
690 struct mwifiex_sta_node
{
691 struct list_head list
;
692 u8 mac_addr
[ETH_ALEN
];
696 u8 ampdu_sta
[MAX_NUM_TID
];
697 u16 rx_seq
[MAX_NUM_TID
];
700 struct mwifiex_tdls_capab tdls_cap
;
703 struct mwifiex_auto_tdls_peer
{
704 struct list_head list
;
705 u8 mac_addr
[ETH_ALEN
];
714 struct mwifiex_if_ops
{
715 int (*init_if
) (struct mwifiex_adapter
*);
716 void (*cleanup_if
) (struct mwifiex_adapter
*);
717 int (*check_fw_status
) (struct mwifiex_adapter
*, u32
);
718 int (*prog_fw
) (struct mwifiex_adapter
*, struct mwifiex_fw_image
*);
719 int (*register_dev
) (struct mwifiex_adapter
*);
720 void (*unregister_dev
) (struct mwifiex_adapter
*);
721 int (*enable_int
) (struct mwifiex_adapter
*);
722 void (*disable_int
) (struct mwifiex_adapter
*);
723 int (*process_int_status
) (struct mwifiex_adapter
*);
724 int (*host_to_card
) (struct mwifiex_adapter
*, u8
, struct sk_buff
*,
725 struct mwifiex_tx_param
*);
726 int (*wakeup
) (struct mwifiex_adapter
*);
727 int (*wakeup_complete
) (struct mwifiex_adapter
*);
729 /* Interface specific functions */
730 void (*update_mp_end_port
) (struct mwifiex_adapter
*, u16
);
731 void (*cleanup_mpa_buf
) (struct mwifiex_adapter
*);
732 int (*cmdrsp_complete
) (struct mwifiex_adapter
*, struct sk_buff
*);
733 int (*event_complete
) (struct mwifiex_adapter
*, struct sk_buff
*);
734 int (*init_fw_port
) (struct mwifiex_adapter
*);
735 int (*dnld_fw
) (struct mwifiex_adapter
*, struct mwifiex_fw_image
*);
736 void (*card_reset
) (struct mwifiex_adapter
*);
737 void (*fw_dump
)(struct mwifiex_adapter
*);
738 int (*reg_dump
)(struct mwifiex_adapter
*, char *);
739 int (*clean_pcie_ring
) (struct mwifiex_adapter
*adapter
);
740 void (*iface_work
)(struct work_struct
*work
);
741 void (*submit_rem_rx_urbs
)(struct mwifiex_adapter
*adapter
);
744 struct mwifiex_adapter
{
746 struct mwifiex_iface_comb iface_limit
;
747 struct mwifiex_iface_comb curr_iface_comb
;
748 struct mwifiex_private
*priv
[MWIFIEX_MAX_BSS_NUM
];
750 const struct firmware
*firmware
;
755 u8 perm_addr
[ETH_ALEN
];
756 bool surprise_removed
;
757 u32 fw_release_number
;
758 u16 init_wait_q_woken
;
759 wait_queue_head_t init_wait_q
;
761 struct mwifiex_if_ops if_ops
;
764 atomic_t cmd_pending
;
765 struct workqueue_struct
*workqueue
;
766 struct work_struct main_work
;
767 struct workqueue_struct
*rx_workqueue
;
768 struct work_struct rx_work
;
769 struct workqueue_struct
*dfs_workqueue
;
770 struct work_struct dfs_work
;
771 bool rx_work_enabled
;
773 bool delay_main_work
;
776 struct mwifiex_bss_prio_tbl bss_prio_tbl
[MWIFIEX_MAX_BSS_NUM
];
777 /* spin lock for init/shutdown */
778 spinlock_t mwifiex_lock
;
779 /* spin lock for main process */
780 spinlock_t main_proc_lock
;
781 u32 mwifiex_processing
;
784 u16 curr_tx_buf_size
;
786 enum MWIFIEX_HARDWARE_STATUS hw_status
;
787 u16 number_of_antenna
;
789 /* spin lock for interrupt handling */
793 struct sk_buff
*event_skb
;
794 u8 upld_buf
[MWIFIEX_UPLD_SIZE
];
797 u8 cmd_resp_received
;
801 struct cmd_ctrl_node
*cmd_pool
;
802 struct cmd_ctrl_node
*curr_cmd
;
803 /* spin lock for command */
804 spinlock_t mwifiex_cmd_lock
;
807 struct timer_list cmd_timer
;
808 struct list_head cmd_free_q
;
809 /* spin lock for cmd_free_q */
810 spinlock_t cmd_free_q_lock
;
811 struct list_head cmd_pending_q
;
812 /* spin lock for cmd_pending_q */
813 spinlock_t cmd_pending_q_lock
;
814 struct list_head scan_pending_q
;
815 /* spin lock for scan_pending_q */
816 spinlock_t scan_pending_q_lock
;
817 /* spin lock for RX processing routine */
818 spinlock_t rx_proc_lock
;
821 struct mwifiex_802_11d_domain_reg domain_reg
;
824 u16 specific_scan_time
;
825 u16 active_scan_time
;
826 u16 passive_scan_time
;
827 u16 scan_chan_gap_time
;
831 struct mwifiex_chan_scan_param_set
*scan_channels
;
833 struct mwifiex_sleep_params sleep_params
;
834 struct mwifiex_sleep_period sleep_period
;
839 u16 local_listen_interval
;
840 u16 null_pkt_interval
;
841 struct sk_buff
*sleep_cfm
;
842 u16 bcn_miss_time_out
;
843 u16 adhoc_awake_period
;
847 u16 enhanced_ps_mode
;
848 u8 pm_wakeup_card_req
;
851 u32 pm_wakeup_fw_try
;
852 struct timer_list wakeup_timer
;
854 struct mwifiex_hs_config_param hs_cfg
;
856 u16 hs_activate_wait_q_woken
;
857 wait_queue_head_t hs_activate_wait_q
;
860 u8 event_body
[MAX_EVENT_SIZE
];
861 u32 hw_dot_11n_dev_cap
;
862 u8 hw_dev_mcs_support
;
863 u8 user_dev_mcs_support
;
864 u8 adhoc_11n_enabled
;
866 struct mwifiex_dbg dbg
;
867 u8 arp_filter
[ARP_FILTER_MAX_BUF_SIZE
];
869 struct mwifiex_wait_queue cmd_wait_q
;
870 u8 scan_wait_q_woken
;
871 spinlock_t queue_lock
; /* lock for tx queues */
872 u8 country_code
[IEEE80211_COUNTRY_STRING_LEN
];
873 u16 max_mgmt_ie_index
;
874 const struct firmware
*cal_data
;
875 struct device_node
*dt_node
;
878 u32 is_hw_11ac_capable
;
879 u32 hw_dot_11ac_dev_cap
;
880 u32 hw_dot_11ac_mcs_support
;
881 u32 usr_dot_11ac_dev_cap_bg
;
882 u32 usr_dot_11ac_dev_cap_a
;
883 u32 usr_dot_11ac_mcs_support
;
885 atomic_t pending_bridged_pkts
;
886 struct semaphore
*card_sem
;
889 u8 key_api_major_ver
, key_api_minor_ver
;
890 struct work_struct iface_work
;
891 unsigned long iface_work_flags
;
892 struct memory_type_mapping
*mem_type_mapping_tbl
;
897 bool scan_chan_gap_enabled
;
898 struct sk_buff_head rx_data_q
;
899 struct mwifiex_chan_stats
*chan_stats
;
900 u32 num_in_chan_stats
;
905 int mwifiex_init_lock_list(struct mwifiex_adapter
*adapter
);
907 void mwifiex_set_trans_start(struct net_device
*dev
);
909 void mwifiex_stop_net_dev_queue(struct net_device
*netdev
,
910 struct mwifiex_adapter
*adapter
);
912 void mwifiex_wake_up_net_dev_queue(struct net_device
*netdev
,
913 struct mwifiex_adapter
*adapter
);
915 int mwifiex_init_priv(struct mwifiex_private
*priv
);
916 void mwifiex_free_priv(struct mwifiex_private
*priv
);
918 int mwifiex_init_fw(struct mwifiex_adapter
*adapter
);
920 int mwifiex_init_fw_complete(struct mwifiex_adapter
*adapter
);
922 int mwifiex_shutdown_drv(struct mwifiex_adapter
*adapter
);
924 int mwifiex_shutdown_fw_complete(struct mwifiex_adapter
*adapter
);
926 int mwifiex_dnld_fw(struct mwifiex_adapter
*, struct mwifiex_fw_image
*);
928 int mwifiex_recv_packet(struct mwifiex_private
*priv
, struct sk_buff
*skb
);
930 int mwifiex_process_mgmt_packet(struct mwifiex_private
*priv
,
931 struct sk_buff
*skb
);
933 int mwifiex_process_event(struct mwifiex_adapter
*adapter
);
935 int mwifiex_complete_cmd(struct mwifiex_adapter
*adapter
,
936 struct cmd_ctrl_node
*cmd_node
);
938 int mwifiex_send_cmd(struct mwifiex_private
*priv
, u16 cmd_no
,
939 u16 cmd_action
, u32 cmd_oid
, void *data_buf
, bool sync
);
941 void mwifiex_cmd_timeout_func(unsigned long function_context
);
943 int mwifiex_get_debug_info(struct mwifiex_private
*,
944 struct mwifiex_debug_info
*);
946 int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter
*adapter
);
947 int mwifiex_free_cmd_buffer(struct mwifiex_adapter
*adapter
);
948 void mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter
*adapter
);
949 void mwifiex_cancel_pending_ioctl(struct mwifiex_adapter
*adapter
);
951 void mwifiex_insert_cmd_to_free_q(struct mwifiex_adapter
*adapter
,
952 struct cmd_ctrl_node
*cmd_node
);
953 void mwifiex_recycle_cmd_node(struct mwifiex_adapter
*adapter
,
954 struct cmd_ctrl_node
*cmd_node
);
956 void mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter
*adapter
,
957 struct cmd_ctrl_node
*cmd_node
,
960 int mwifiex_exec_next_cmd(struct mwifiex_adapter
*adapter
);
961 int mwifiex_process_cmdresp(struct mwifiex_adapter
*adapter
);
962 int mwifiex_handle_rx_packet(struct mwifiex_adapter
*adapter
,
963 struct sk_buff
*skb
);
964 int mwifiex_process_tx(struct mwifiex_private
*priv
, struct sk_buff
*skb
,
965 struct mwifiex_tx_param
*tx_param
);
966 int mwifiex_send_null_packet(struct mwifiex_private
*priv
, u8 flags
);
967 int mwifiex_write_data_complete(struct mwifiex_adapter
*adapter
,
968 struct sk_buff
*skb
, int aggr
, int status
);
969 void mwifiex_clean_txrx(struct mwifiex_private
*priv
);
970 u8
mwifiex_check_last_packet_indication(struct mwifiex_private
*priv
);
971 void mwifiex_check_ps_cond(struct mwifiex_adapter
*adapter
);
972 void mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter
*, u8
*,
974 int mwifiex_cmd_enh_power_mode(struct mwifiex_private
*priv
,
975 struct host_cmd_ds_command
*cmd
,
976 u16 cmd_action
, uint16_t ps_bitmap
,
977 struct mwifiex_ds_auto_ds
*auto_ds
);
978 int mwifiex_ret_enh_power_mode(struct mwifiex_private
*priv
,
979 struct host_cmd_ds_command
*resp
,
980 struct mwifiex_ds_pm_cfg
*pm_cfg
);
981 void mwifiex_process_hs_config(struct mwifiex_adapter
*adapter
);
982 void mwifiex_hs_activated_event(struct mwifiex_private
*priv
,
984 int mwifiex_set_hs_params(struct mwifiex_private
*priv
, u16 action
,
985 int cmd_type
, struct mwifiex_ds_hs_cfg
*hs_cfg
);
986 int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private
*priv
,
987 struct host_cmd_ds_command
*resp
);
988 int mwifiex_process_rx_packet(struct mwifiex_private
*priv
,
989 struct sk_buff
*skb
);
990 int mwifiex_sta_prepare_cmd(struct mwifiex_private
*, uint16_t cmd_no
,
991 u16 cmd_action
, u32 cmd_oid
,
992 void *data_buf
, void *cmd_buf
);
993 int mwifiex_uap_prepare_cmd(struct mwifiex_private
*priv
, uint16_t cmd_no
,
994 u16 cmd_action
, u32 cmd_oid
,
995 void *data_buf
, void *cmd_buf
);
996 int mwifiex_process_sta_cmdresp(struct mwifiex_private
*, u16 cmdresp_no
,
997 struct host_cmd_ds_command
*resp
);
998 int mwifiex_process_sta_rx_packet(struct mwifiex_private
*,
999 struct sk_buff
*skb
);
1000 int mwifiex_process_uap_rx_packet(struct mwifiex_private
*priv
,
1001 struct sk_buff
*skb
);
1002 int mwifiex_handle_uap_rx_forward(struct mwifiex_private
*priv
,
1003 struct sk_buff
*skb
);
1004 int mwifiex_process_sta_event(struct mwifiex_private
*);
1005 int mwifiex_process_uap_event(struct mwifiex_private
*);
1006 void mwifiex_delete_all_station_list(struct mwifiex_private
*priv
);
1007 void mwifiex_wmm_del_peer_ra_list(struct mwifiex_private
*priv
,
1009 void *mwifiex_process_sta_txpd(struct mwifiex_private
*, struct sk_buff
*skb
);
1010 void *mwifiex_process_uap_txpd(struct mwifiex_private
*, struct sk_buff
*skb
);
1011 int mwifiex_sta_init_cmd(struct mwifiex_private
*, u8 first_sta
, bool init
);
1012 int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command
*cmd
,
1013 struct mwifiex_scan_cmd_config
*scan_cfg
);
1014 void mwifiex_queue_scan_cmd(struct mwifiex_private
*priv
,
1015 struct cmd_ctrl_node
*cmd_node
);
1016 int mwifiex_ret_802_11_scan(struct mwifiex_private
*priv
,
1017 struct host_cmd_ds_command
*resp
);
1018 s32
mwifiex_ssid_cmp(struct cfg80211_ssid
*ssid1
, struct cfg80211_ssid
*ssid2
);
1019 int mwifiex_associate(struct mwifiex_private
*priv
,
1020 struct mwifiex_bssdescriptor
*bss_desc
);
1021 int mwifiex_cmd_802_11_associate(struct mwifiex_private
*priv
,
1022 struct host_cmd_ds_command
*cmd
,
1023 struct mwifiex_bssdescriptor
*bss_desc
);
1024 int mwifiex_ret_802_11_associate(struct mwifiex_private
*priv
,
1025 struct host_cmd_ds_command
*resp
);
1026 void mwifiex_reset_connect_state(struct mwifiex_private
*priv
, u16 reason
);
1027 u8
mwifiex_band_to_radio_type(u8 band
);
1028 int mwifiex_deauthenticate(struct mwifiex_private
*priv
, u8
*mac
);
1029 void mwifiex_deauthenticate_all(struct mwifiex_adapter
*adapter
);
1030 int mwifiex_adhoc_start(struct mwifiex_private
*priv
,
1031 struct cfg80211_ssid
*adhoc_ssid
);
1032 int mwifiex_adhoc_join(struct mwifiex_private
*priv
,
1033 struct mwifiex_bssdescriptor
*bss_desc
);
1034 int mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private
*priv
,
1035 struct host_cmd_ds_command
*cmd
,
1036 struct cfg80211_ssid
*req_ssid
);
1037 int mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private
*priv
,
1038 struct host_cmd_ds_command
*cmd
,
1039 struct mwifiex_bssdescriptor
*bss_desc
);
1040 int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private
*priv
,
1041 struct host_cmd_ds_command
*resp
);
1042 int mwifiex_cmd_802_11_bg_scan_query(struct host_cmd_ds_command
*cmd
);
1043 struct mwifiex_chan_freq_power
*mwifiex_get_cfp(struct mwifiex_private
*priv
,
1044 u8 band
, u16 channel
, u32 freq
);
1045 u32
mwifiex_index_to_data_rate(struct mwifiex_private
*priv
,
1046 u8 index
, u8 ht_info
);
1047 u32
mwifiex_index_to_acs_data_rate(struct mwifiex_private
*priv
,
1048 u8 index
, u8 ht_info
);
1049 u32
mwifiex_find_freq_from_band_chan(u8
, u8
);
1050 int mwifiex_cmd_append_vsie_tlv(struct mwifiex_private
*priv
, u16 vsie_mask
,
1052 u32
mwifiex_get_active_data_rates(struct mwifiex_private
*priv
,
1054 u32
mwifiex_get_supported_rates(struct mwifiex_private
*priv
, u8
*rates
);
1055 u32
mwifiex_get_rates_from_cfg80211(struct mwifiex_private
*priv
,
1056 u8
*rates
, u8 radio_type
);
1057 u8
mwifiex_is_rate_auto(struct mwifiex_private
*priv
);
1058 extern u16 region_code_index
[MWIFIEX_MAX_REGION_CODE
];
1059 void mwifiex_save_curr_bcn(struct mwifiex_private
*priv
);
1060 void mwifiex_free_curr_bcn(struct mwifiex_private
*priv
);
1061 int mwifiex_cmd_get_hw_spec(struct mwifiex_private
*priv
,
1062 struct host_cmd_ds_command
*cmd
);
1063 int mwifiex_ret_get_hw_spec(struct mwifiex_private
*priv
,
1064 struct host_cmd_ds_command
*resp
);
1065 int is_command_pending(struct mwifiex_adapter
*adapter
);
1066 void mwifiex_init_priv_params(struct mwifiex_private
*priv
,
1067 struct net_device
*dev
);
1068 int mwifiex_set_secure_params(struct mwifiex_private
*priv
,
1069 struct mwifiex_uap_bss_param
*bss_config
,
1070 struct cfg80211_ap_settings
*params
);
1071 void mwifiex_set_ht_params(struct mwifiex_private
*priv
,
1072 struct mwifiex_uap_bss_param
*bss_cfg
,
1073 struct cfg80211_ap_settings
*params
);
1074 void mwifiex_set_vht_params(struct mwifiex_private
*priv
,
1075 struct mwifiex_uap_bss_param
*bss_cfg
,
1076 struct cfg80211_ap_settings
*params
);
1077 void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param
*bss_cfg
,
1078 struct cfg80211_ap_settings
*params
);
1079 void mwifiex_set_vht_width(struct mwifiex_private
*priv
,
1080 enum nl80211_chan_width width
,
1081 bool ap_11ac_disable
);
1083 mwifiex_set_wmm_params(struct mwifiex_private
*priv
,
1084 struct mwifiex_uap_bss_param
*bss_cfg
,
1085 struct cfg80211_ap_settings
*params
);
1086 void mwifiex_set_ba_params(struct mwifiex_private
*priv
);
1087 void mwifiex_set_11ac_ba_params(struct mwifiex_private
*priv
);
1088 int mwifiex_cmd_802_11_scan_ext(struct mwifiex_private
*priv
,
1089 struct host_cmd_ds_command
*cmd
,
1091 int mwifiex_ret_802_11_scan_ext(struct mwifiex_private
*priv
,
1092 struct host_cmd_ds_command
*resp
);
1093 int mwifiex_handle_event_ext_scan_report(struct mwifiex_private
*priv
,
1097 * This function checks if the queuing is RA based or not.
1100 mwifiex_queuing_ra_based(struct mwifiex_private
*priv
)
1103 * Currently we assume if we are in Infra, then DA=RA. This might not be
1104 * true in the future
1106 if ((priv
->bss_mode
== NL80211_IFTYPE_STATION
) &&
1107 (GET_BSS_ROLE(priv
) == MWIFIEX_BSS_ROLE_STA
))
1114 * This function copies rates.
1117 mwifiex_copy_rates(u8
*dest
, u32 pos
, u8
*src
, int len
)
1121 for (i
= 0; i
< len
&& src
[i
]; i
++, pos
++) {
1122 if (pos
>= MWIFIEX_SUPPORTED_RATES
)
1131 * This function returns the correct private structure pointer based
1132 * upon the BSS type and BSS number.
1134 static inline struct mwifiex_private
*
1135 mwifiex_get_priv_by_id(struct mwifiex_adapter
*adapter
,
1136 u8 bss_num
, u8 bss_type
)
1140 for (i
= 0; i
< adapter
->priv_num
; i
++) {
1141 if (adapter
->priv
[i
]) {
1142 if ((adapter
->priv
[i
]->bss_num
== bss_num
) &&
1143 (adapter
->priv
[i
]->bss_type
== bss_type
))
1147 return ((i
< adapter
->priv_num
) ? adapter
->priv
[i
] : NULL
);
1151 * This function returns the first available private structure pointer
1152 * based upon the BSS role.
1154 static inline struct mwifiex_private
*
1155 mwifiex_get_priv(struct mwifiex_adapter
*adapter
,
1156 enum mwifiex_bss_role bss_role
)
1160 for (i
= 0; i
< adapter
->priv_num
; i
++) {
1161 if (adapter
->priv
[i
]) {
1162 if (bss_role
== MWIFIEX_BSS_ROLE_ANY
||
1163 GET_BSS_ROLE(adapter
->priv
[i
]) == bss_role
)
1168 return ((i
< adapter
->priv_num
) ? adapter
->priv
[i
] : NULL
);
1172 * This function returns the first available unused private structure pointer.
1174 static inline struct mwifiex_private
*
1175 mwifiex_get_unused_priv(struct mwifiex_adapter
*adapter
)
1179 for (i
= 0; i
< adapter
->priv_num
; i
++) {
1180 if (adapter
->priv
[i
]) {
1181 if (adapter
->priv
[i
]->bss_mode
==
1182 NL80211_IFTYPE_UNSPECIFIED
)
1187 return ((i
< adapter
->priv_num
) ? adapter
->priv
[i
] : NULL
);
1191 * This function returns the driver private structure of a network device.
1193 static inline struct mwifiex_private
*
1194 mwifiex_netdev_get_priv(struct net_device
*dev
)
1196 return (struct mwifiex_private
*) (*(unsigned long *) netdev_priv(dev
));
1200 * This function checks if a skb holds a management frame.
1202 static inline bool mwifiex_is_skb_mgmt_frame(struct sk_buff
*skb
)
1204 return (le32_to_cpu(*(__le32
*)skb
->data
) == PKT_TYPE_MGMT
);
1207 /* This function retrieves channel closed for operation by Channel
1208 * Switch Announcement.
1211 mwifiex_11h_get_csa_closed_channel(struct mwifiex_private
*priv
)
1213 if (!priv
->csa_chan
)
1216 /* Clear csa channel, if DFS channel move time has passed */
1217 if (time_after(jiffies
, priv
->csa_expire_time
)) {
1219 priv
->csa_expire_time
= 0;
1222 return priv
->csa_chan
;
1225 static inline u8
mwifiex_is_any_intf_active(struct mwifiex_private
*priv
)
1227 struct mwifiex_private
*priv_num
;
1230 for (i
= 0; i
< priv
->adapter
->priv_num
; i
++) {
1231 priv_num
= priv
->adapter
->priv
[i
];
1233 if ((GET_BSS_ROLE(priv_num
) == MWIFIEX_BSS_ROLE_UAP
&&
1234 priv_num
->bss_started
) ||
1235 (GET_BSS_ROLE(priv_num
) == MWIFIEX_BSS_ROLE_STA
&&
1236 priv_num
->media_connected
))
1244 int mwifiex_init_shutdown_fw(struct mwifiex_private
*priv
,
1245 u32 func_init_shutdown
);
1246 int mwifiex_add_card(void *, struct semaphore
*, struct mwifiex_if_ops
*, u8
);
1247 int mwifiex_remove_card(struct mwifiex_adapter
*, struct semaphore
*);
1249 void mwifiex_get_version(struct mwifiex_adapter
*adapter
, char *version
,
1251 int mwifiex_request_set_multicast_list(struct mwifiex_private
*priv
,
1252 struct mwifiex_multicast_list
*mcast_list
);
1253 int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list
*mlist
,
1254 struct net_device
*dev
);
1255 int mwifiex_wait_queue_complete(struct mwifiex_adapter
*adapter
,
1256 struct cmd_ctrl_node
*cmd_queued
);
1257 int mwifiex_bss_start(struct mwifiex_private
*priv
, struct cfg80211_bss
*bss
,
1258 struct cfg80211_ssid
*req_ssid
);
1259 int mwifiex_cancel_hs(struct mwifiex_private
*priv
, int cmd_type
);
1260 int mwifiex_enable_hs(struct mwifiex_adapter
*adapter
);
1261 int mwifiex_disable_auto_ds(struct mwifiex_private
*priv
);
1262 int mwifiex_drv_get_data_rate(struct mwifiex_private
*priv
, u32
*rate
);
1263 int mwifiex_request_scan(struct mwifiex_private
*priv
,
1264 struct cfg80211_ssid
*req_ssid
);
1265 int mwifiex_scan_networks(struct mwifiex_private
*priv
,
1266 const struct mwifiex_user_scan_cfg
*user_scan_in
);
1267 int mwifiex_set_radio(struct mwifiex_private
*priv
, u8 option
);
1269 int mwifiex_set_encode(struct mwifiex_private
*priv
, struct key_params
*kp
,
1270 const u8
*key
, int key_len
, u8 key_index
,
1271 const u8
*mac_addr
, int disable
);
1273 int mwifiex_set_gen_ie(struct mwifiex_private
*priv
, const u8
*ie
, int ie_len
);
1275 int mwifiex_get_ver_ext(struct mwifiex_private
*priv
);
1277 int mwifiex_remain_on_chan_cfg(struct mwifiex_private
*priv
, u16 action
,
1278 struct ieee80211_channel
*chan
,
1279 unsigned int duration
);
1281 int mwifiex_get_stats_info(struct mwifiex_private
*priv
,
1282 struct mwifiex_ds_get_stats
*log
);
1284 int mwifiex_reg_write(struct mwifiex_private
*priv
, u32 reg_type
,
1285 u32 reg_offset
, u32 reg_value
);
1287 int mwifiex_reg_read(struct mwifiex_private
*priv
, u32 reg_type
,
1288 u32 reg_offset
, u32
*value
);
1290 int mwifiex_eeprom_read(struct mwifiex_private
*priv
, u16 offset
, u16 bytes
,
1293 int mwifiex_set_11n_httx_cfg(struct mwifiex_private
*priv
, int data
);
1295 int mwifiex_get_11n_httx_cfg(struct mwifiex_private
*priv
, int *data
);
1297 int mwifiex_set_tx_rate_cfg(struct mwifiex_private
*priv
, int tx_rate_index
);
1299 int mwifiex_get_tx_rate_cfg(struct mwifiex_private
*priv
, int *tx_rate_index
);
1301 int mwifiex_drv_set_power(struct mwifiex_private
*priv
, u32
*ps_mode
);
1303 int mwifiex_drv_get_driver_version(struct mwifiex_adapter
*adapter
,
1304 char *version
, int max_len
);
1306 int mwifiex_set_tx_power(struct mwifiex_private
*priv
,
1307 struct mwifiex_power_cfg
*power_cfg
);
1309 int mwifiex_main_process(struct mwifiex_adapter
*);
1311 int mwifiex_queue_tx_pkt(struct mwifiex_private
*priv
, struct sk_buff
*skb
);
1313 int mwifiex_get_bss_info(struct mwifiex_private
*,
1314 struct mwifiex_bss_info
*);
1315 int mwifiex_fill_new_bss_desc(struct mwifiex_private
*priv
,
1316 struct cfg80211_bss
*bss
,
1317 struct mwifiex_bssdescriptor
*bss_desc
);
1318 int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter
*adapter
,
1319 struct mwifiex_bssdescriptor
*bss_entry
);
1320 int mwifiex_check_network_compatibility(struct mwifiex_private
*priv
,
1321 struct mwifiex_bssdescriptor
*bss_desc
);
1323 u8
mwifiex_chan_type_to_sec_chan_offset(enum nl80211_channel_type chan_type
);
1325 struct wireless_dev
*mwifiex_add_virtual_intf(struct wiphy
*wiphy
,
1327 enum nl80211_iftype type
,
1329 struct vif_params
*params
);
1330 int mwifiex_del_virtual_intf(struct wiphy
*wiphy
, struct wireless_dev
*wdev
);
1332 void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param
*config
);
1334 int mwifiex_add_wowlan_magic_pkt_filter(struct mwifiex_adapter
*adapter
);
1336 int mwifiex_set_mgmt_ies(struct mwifiex_private
*priv
,
1337 struct cfg80211_beacon_data
*data
);
1338 int mwifiex_del_mgmt_ies(struct mwifiex_private
*priv
);
1339 u8
*mwifiex_11d_code_2_region(u8 code
);
1340 void mwifiex_uap_set_channel(struct mwifiex_uap_bss_param
*bss_cfg
,
1341 struct cfg80211_chan_def chandef
);
1342 int mwifiex_config_start_uap(struct mwifiex_private
*priv
,
1343 struct mwifiex_uap_bss_param
*bss_cfg
);
1344 void mwifiex_uap_del_sta_data(struct mwifiex_private
*priv
,
1345 struct mwifiex_sta_node
*node
);
1347 void mwifiex_init_11h_params(struct mwifiex_private
*priv
);
1348 int mwifiex_is_11h_active(struct mwifiex_private
*priv
);
1349 int mwifiex_11h_activate(struct mwifiex_private
*priv
, bool flag
);
1351 void mwifiex_11h_process_join(struct mwifiex_private
*priv
, u8
**buffer
,
1352 struct mwifiex_bssdescriptor
*bss_desc
);
1353 int mwifiex_11h_handle_event_chanswann(struct mwifiex_private
*priv
);
1354 int mwifiex_dnld_dt_cfgdata(struct mwifiex_private
*priv
,
1355 struct device_node
*node
, const char *prefix
);
1356 void mwifiex_dnld_txpwr_table(struct mwifiex_private
*priv
);
1358 extern const struct ethtool_ops mwifiex_ethtool_ops
;
1360 void mwifiex_del_all_sta_list(struct mwifiex_private
*priv
);
1361 void mwifiex_del_sta_entry(struct mwifiex_private
*priv
, const u8
*mac
);
1363 mwifiex_set_sta_ht_cap(struct mwifiex_private
*priv
, const u8
*ies
,
1364 int ies_len
, struct mwifiex_sta_node
*node
);
1365 struct mwifiex_sta_node
*
1366 mwifiex_add_sta_entry(struct mwifiex_private
*priv
, const u8
*mac
);
1367 struct mwifiex_sta_node
*
1368 mwifiex_get_sta_entry(struct mwifiex_private
*priv
, const u8
*mac
);
1369 int mwifiex_send_tdls_data_frame(struct mwifiex_private
*priv
, const u8
*peer
,
1370 u8 action_code
, u8 dialog_token
,
1371 u16 status_code
, const u8
*extra_ies
,
1372 size_t extra_ies_len
);
1373 int mwifiex_send_tdls_action_frame(struct mwifiex_private
*priv
, const u8
*peer
,
1374 u8 action_code
, u8 dialog_token
,
1375 u16 status_code
, const u8
*extra_ies
,
1376 size_t extra_ies_len
);
1377 void mwifiex_process_tdls_action_frame(struct mwifiex_private
*priv
,
1379 int mwifiex_tdls_oper(struct mwifiex_private
*priv
, const u8
*peer
, u8 action
);
1380 int mwifiex_get_tdls_link_status(struct mwifiex_private
*priv
, const u8
*mac
);
1381 int mwifiex_get_tdls_list(struct mwifiex_private
*priv
,
1382 struct tdls_peer_info
*buf
);
1383 void mwifiex_disable_all_tdls_links(struct mwifiex_private
*priv
);
1384 bool mwifiex_is_bss_in_11ac_mode(struct mwifiex_private
*priv
);
1385 u8
mwifiex_get_center_freq_index(struct mwifiex_private
*priv
, u8 band
,
1386 u32 pri_chan
, u8 chan_bw
);
1387 int mwifiex_init_channel_scan_gap(struct mwifiex_adapter
*adapter
);
1389 int mwifiex_tdls_check_tx(struct mwifiex_private
*priv
, struct sk_buff
*skb
);
1390 void mwifiex_flush_auto_tdls_list(struct mwifiex_private
*priv
);
1391 void mwifiex_auto_tdls_update_peer_status(struct mwifiex_private
*priv
,
1392 const u8
*mac
, u8 link_status
);
1393 void mwifiex_auto_tdls_update_peer_signal(struct mwifiex_private
*priv
,
1394 u8
*mac
, s8 snr
, s8 nflr
);
1395 void mwifiex_check_auto_tdls(unsigned long context
);
1396 void mwifiex_add_auto_tdls_peer(struct mwifiex_private
*priv
, const u8
*mac
);
1397 void mwifiex_setup_auto_tdls_timer(struct mwifiex_private
*priv
);
1398 void mwifiex_clean_auto_tdls(struct mwifiex_private
*priv
);
1399 int mwifiex_cmd_issue_chan_report_request(struct mwifiex_private
*priv
,
1400 struct host_cmd_ds_command
*cmd
,
1402 int mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private
*priv
,
1403 struct sk_buff
*skb
);
1405 void mwifiex_parse_tx_status_event(struct mwifiex_private
*priv
,
1409 mwifiex_clone_skb_for_tx_status(struct mwifiex_private
*priv
,
1410 struct sk_buff
*skb
, u8 flag
, u64
*cookie
);
1411 void mwifiex_dfs_cac_work_queue(struct work_struct
*work
);
1412 void mwifiex_dfs_chan_sw_work_queue(struct work_struct
*work
);
1413 void mwifiex_abort_cac(struct mwifiex_private
*priv
);
1414 int mwifiex_11h_handle_radar_detected(struct mwifiex_private
*priv
,
1415 struct sk_buff
*skb
);
1417 void mwifiex_hist_data_set(struct mwifiex_private
*priv
, u8 rx_rate
, s8 snr
,
1419 void mwifiex_hist_data_reset(struct mwifiex_private
*priv
);
1420 void mwifiex_hist_data_add(struct mwifiex_private
*priv
,
1421 u8 rx_rate
, s8 snr
, s8 nflr
);
1422 u8
mwifiex_adjust_data_rate(struct mwifiex_private
*priv
,
1423 u8 rx_rate
, u8 ht_info
);
1425 void mwifiex_dump_drv_info(struct mwifiex_adapter
*adapter
);
1426 void *mwifiex_alloc_rx_buf(int rx_len
, gfp_t flags
);
1428 #ifdef CONFIG_DEBUG_FS
1429 void mwifiex_debugfs_init(void);
1430 void mwifiex_debugfs_remove(void);
1432 void mwifiex_dev_debugfs_init(struct mwifiex_private
*priv
);
1433 void mwifiex_dev_debugfs_remove(struct mwifiex_private
*priv
);
1435 #endif /* !_MWIFIEX_MAIN_H_ */