2 ******************************************************************************
6 * @brief Main driver structure declarations for fullmac driver
8 * Copyright (C) ESWIN 2015-2020
10 ******************************************************************************
13 #ifndef _ECRNX_DEFS_H_
14 #define _ECRNX_DEFS_H_
16 #include <linux/interrupt.h>
17 #include <linux/device.h>
18 #include <linux/dmapool.h>
19 #include <linux/skbuff.h>
20 #include <net/cfg80211.h>
21 #include <linux/slab.h>
22 #include <linux/sched.h>
23 #include <linux/version.h>
24 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0))
25 #include <linux/vmalloc.h>
26 #include <linux/module.h>
28 #include "ecrnx_mod_params.h"
29 #include "ecrnx_debugfs.h"
32 #include "ecrnx_radar.h"
33 #include "ecrnx_utils.h"
34 #include "ecrnx_mu_group.h"
35 #include "ecrnx_platform.h"
36 #include "ecrnx_cmds.h"
38 #include "ecrnx_p2p.h"
39 #include "ecrnx_debug.h"
40 #include "ecrnx_cfgfile.h"
43 #define WPI_HDR_LEN 18
46 #define WPI_MIC_LEN 16
47 #define WPI_KEY_LEN 32
48 #define WPI_SUBKEY_LEN 16 // WPI key is actually two 16bytes key
50 #define LEGACY_PS_ID 0
53 #define PS_SP_INTERRUPTED 255
54 #define ECRNX_RXSIZE 1024
56 #define CONFIG_ESWIN_RX_REORDER 1
58 #if defined(CONFIG_ECRNX_HE)
59 extern struct ieee80211_sta_he_cap ecrnx_he_cap;
63 * struct ecrnx_bcn - Information of the beacon in used (AP mode)
65 * @head: head portion of beacon (before TIM IE)
66 * @tail: tail portion of beacon (after TIM IE)
67 * @ies: extra IEs (not used ?)
68 * @head_len: length of head data
69 * @tail_len: length of tail data
70 * @ies_len: length of extra IEs data
71 * @tim_len: length of TIM IE
72 * @len: Total beacon len (head + tim + tail + extra)
88 * struct ecrnx_key - Key information
90 * @hw_idx: Idx of the key from hardware point of view
97 * Structure containing information about a Mesh Path
99 struct ecrnx_mesh_path {
100 struct list_head list; /* For ecrnx_vif.mesh_paths */
101 u8 path_idx; /* Path Index */
102 struct mac_addr tgt_mac_addr; /* Target MAC Address */
103 struct ecrnx_sta *nhop_sta; /* Pointer to the Next Hop STA */
106 struct ecrnx_mesh_proxy {
107 struct list_head list; /* For ecrnx_vif.mesh_proxy */
108 struct mac_addr ext_sta_addr; /* Address of the External STA */
109 struct mac_addr proxy_addr; /* Proxy MAC Address */
110 bool local; /* Indicate if interface is a proxy for the device */
114 * struct ecrnx_csa - Information for CSA (Channel Switch Announcement)
116 * @vif: Pointer to the vif doing the CSA
117 * @bcn: Beacon to use after CSA
118 * @elem: IPC buffer to send the new beacon to the fw
119 * @chandef: defines the channel to use after the switch
120 * @count: Current csa counter
121 * @status: Status of the CSA at fw level
122 * @ch_idx: Index of the new channel context
123 * @work: work scheduled at the end of CSA
126 struct ecrnx_vif *vif;
127 struct ecrnx_bcn bcn;
128 struct ecrnx_ipc_elem_var elem;
129 struct cfg80211_chan_def chandef;
133 struct work_struct work;
136 /// Possible States of the TDLS link.
137 enum tdls_status_tag {
138 /// TDLS link is not active (no TDLS peer connected)
140 /// TDLS Setup Request transmitted
142 /// TDLS Setup Response transmitted
144 /// TDLS link is active (TDLS peer connected)
146 /// TDLS Max Number of states.
151 * Structure used to save information relative to the TDLS peer.
152 * This is also linked within the ecrnx_hw vifs list.
156 bool active; /* Indicate if TDLS link is active */
157 bool initiator; /* Indicate if TDLS peer is the TDLS initiator */
158 bool chsw_en; /* Indicate if channel switch is enabled */
159 u8 last_tid; /* TID of the latest MPDU transmitted over the
160 TDLS direct link to the TDLS STA */
161 u16 last_sn; /* Sequence number of the latest MPDU transmitted
162 over the TDLS direct link to the TDLS STA */
163 bool ps_on; /* Indicate if the power save is enabled on the
165 bool chsw_allowed; /* Indicate if TDLS channel switch is allowed */
170 * enum ecrnx_ap_flags - AP flags
172 * @ECRNX_AP_ISOLATE Isolate clients (i.e. Don't brige packets transmitted by
173 * one client for another one)
175 enum ecrnx_ap_flags {
176 ECRNX_AP_ISOLATE = BIT(0),
177 ECRNX_AP_USER_MESH_PM = BIT(1),
178 ECRNX_AP_CREATE_MESH_PATH = BIT(2),
182 * enum ecrnx_sta_flags - STATION flags
184 * @ECRNX_STA_EXT_AUTH: External authentication is in progress
186 enum ecrnx_sta_flags {
187 ECRNX_STA_EXT_AUTH = BIT(0),
188 ECRNX_STA_FT_OVER_DS = BIT(1),
189 ECRNX_STA_FT_OVER_AIR = BIT(2),
192 #ifdef CONFIG_ECRNX_WIFO_CAIL
194 * struct ecrnx_iwpriv_amt_vif - iwpriv amt VIF information
196 * @ndev: Pointer to the associated net device
198 struct ecrnx_iwpriv_amt_vif {
199 struct net_device *ndev;
201 unsigned char rxdata[ECRNX_RXSIZE];
203 wait_queue_head_t rxdataq;
208 #define ECRNX_REORD_RX_MSDU_CNT (256)
209 #define ECRNX_REORD_TIMEOUT (50)
210 #define ECRNX_REORD_WINSIZE (64)
211 #define SN_LESS(a, b) (((a-b)&0x800)!=0)
212 #define SN_EQUAL(a, b) (a == b)
220 struct ecrnx_hw *ecrnx_hw;
221 struct ecrnx_vif *ecrnx_vif;
222 spinlock_t reord_list_lock;
223 struct list_head reord_list;
224 struct timer_list reord_timer;
225 struct work_struct reord_timer_work;
228 struct reord_msdu_info {
234 struct hw_rxhdr *hw_rxhdr;
235 struct list_head reord_pending_list;
236 struct list_head rx_msdu_list;
237 struct reord_cntrl *preorder_ctrl;
241 * struct ecrnx_vif - VIF information
243 * @list: List element for ecrnx_hw->vifs
244 * @ecrnx_hw: Pointer to driver main data
245 * @wdev: Wireless device
246 * @ndev: Pointer to the associated net device
247 * @net_stats: Stats structure for the net device
248 * @key: Conversion table between protocol key index and MACHW key index
249 * @drv_vif_index: VIF index at driver level (only use to identify active
250 * vifs in ecrnx_hw->avail_idx_map)
251 * @vif_index: VIF index at fw level (used to index ecrnx_hw->vif_table, and
252 * ecrnx_sta->vif_idx)
253 * @ch_index: Channel context index (within ecrnx_hw->chanctx_table)
254 * @up: Indicate if associated netdev is up (i.e. Interface is created at fw level)
255 * @use_4addr: Whether 4address mode should be use or not
256 * @is_resending: Whether a frame is being resent on this interface
257 * @roc_tdls: Indicate if the ROC has been called by a TDLS station
258 * @tdls_status: Status of the TDLS link
259 * @tdls_chsw_prohibited: Whether TDLS Channel Switch is prohibited or not
260 * @generation: Generation ID. Increased each time a sta is added/removed
262 * STA / P2P_CLIENT interfaces
263 * @flags: see ecrnx_sta_flags
264 * @ap: Pointer to the peer STA entry allocated for the AP
265 * @tdls_sta: Pointer to the TDLS station
266 * @ft_assoc_ies: Association Request Elements (only allocated for FT connection)
267 * @ft_assoc_ies_len: Size, in bytes, of the Association request elements.
268 * @ft_target_ap: Target AP for a BSS transition for FT over DS
270 * AP/P2P GO/ MESH POINT interfaces
271 * @flags: see ecrnx_ap_flags
272 * @sta_list: List of station connected to the interface
274 * @bcn_interval: beacon interval in TU
275 * @bcmc_index: Index of the BroadCast/MultiCast station
276 * @csa: Information about current Channel Switch Announcement (NULL if no CSA)
277 * @mpath_list: List of Mesh Paths (MESH Point only)
278 * @proxy_list: List of Proxies Information (MESH Point only)
279 * @mesh_pm: Mesh power save mode currently set in firmware
280 * @next_mesh_pm: Mesh power save mode for next peer
283 * @mater: Pointer to the master interface
284 * @sta_4a: When AP_VLAN interface are used for WDS (i.e. wireless connection
285 * between several APs) this is the 'gateway' sta to 'master' AP
288 struct list_head list;
289 struct ecrnx_hw *ecrnx_hw;
290 struct wireless_dev wdev;
291 struct net_device *ndev;
292 struct net_device_stats net_stats;
293 struct ecrnx_key key[6];
294 u8 drv_vif_index; /* Identifier of the VIF in driver */
295 u8 vif_index; /* Identifier of the station in FW */
296 u8 ch_index; /* Channel context identifier */
297 bool up; /* Indicate if associated netdev is up
298 (i.e. Interface is created at fw level) */
299 bool use_4addr; /* Should we use 4addresses mode */
300 bool is_resending; /* Indicate if a frame is being resent on this interface */
301 bool roc_tdls; /* Indicate if the ROC has been called by a
303 u8 tdls_status; /* Status of the TDLS link */
304 bool tdls_chsw_prohibited; /* Indicate if TDLS Channel Switch is prohibited */
307 unsigned char rxdata[ECRNX_RXSIZE];
309 wait_queue_head_t rxdataq;
312 u32 mgmt_reg_stypes; //GavinGao
319 struct ecrnx_sta *ap; /* Pointer to the peer STA entry allocated for
321 struct ecrnx_sta *tdls_sta; /* Pointer to the TDLS station */
323 int ft_assoc_ies_len;
324 u8 ft_target_ap[ETH_ALEN];
329 struct list_head sta_list; /* List of STA connected to the AP */
330 struct ecrnx_bcn bcn; /* beacon */
332 u8 bcmc_index; /* Index of the BCMC sta to use */
333 struct ecrnx_csa *csa;
335 struct list_head mpath_list; /* List of Mesh Paths used on this interface */
336 struct list_head proxy_list; /* List of Proxies Information used on this interface */
338 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
339 enum nl80211_mesh_power_mode mesh_pm; /* mesh power save mode currently set in firmware */
340 enum nl80211_mesh_power_mode next_mesh_pm; /* mesh power save mode for next peer */
345 struct ecrnx_vif *master; /* pointer on master interface */
346 struct ecrnx_sta *sta_4a;
349 uint64_t rx_pn[TID_MAX];
352 #define ECRNX_INVALID_VIF 0xFF
353 #define ECRNX_VIF_TYPE(vif) (vif->wdev.iftype)
356 * Structure used to store information relative to PS mode.
358 * @active: True when the sta is in PS mode.
359 * If false, other values should be ignored
360 * @pkt_ready: Number of packets buffered for the sta in drv's txq
361 * (1 counter for Legacy PS and 1 for U-APSD)
362 * @sp_cnt: Number of packets that remain to be pushed in the service period.
363 * 0 means that no service period is in progress
364 * (1 counter for Legacy PS and 1 for U-APSD)
366 struct ecrnx_sta_ps {
373 * struct ecrnx_rx_rate_stats - Store statistics for RX rates
375 * @table: Table indicating how many frame has been receive which each
376 * rate index. Rate index is the same as the one used by RC algo for TX
377 * @size: Size of the table array
378 * @cpt: number of frames received
380 struct ecrnx_rx_rate_stats {
388 * struct ecrnx_sta_stats - Structure Used to store statistics specific to a STA
390 * @last_rx: Hardware vector of the last received frame
391 * @rx_rate: Statistics of the received rates
393 struct ecrnx_sta_stats {
398 unsigned long last_act;
399 struct hw_vect last_rx;
400 #ifdef CONFIG_ECRNX_DEBUGFS
401 struct ecrnx_rx_rate_stats rx_rate;
406 * Structure used to save information relative to the managed stations.
409 struct list_head list;
411 u8 mac_addr[ETH_ALEN];
412 u16 aid; /* association ID */
413 u8 sta_idx; /* Identifier of the station */
414 u8 vif_idx; /* Identifier of the VIF (fw id) the station
416 u8 vlan_idx; /* Identifier of the VLAN VIF (fw id) the station
417 belongs to (= vif_idx if no vlan in used) */
418 enum nl80211_band band; /* Band */
419 enum nl80211_chan_width width; /* Channel width */
420 u16 center_freq; /* Center frequency */
421 u32 center_freq1; /* Center frequency 1 */
422 u32 center_freq2; /* Center frequency 2 */
423 u8 ch_idx; /* Identifier of the channel
424 context the station belongs to */
425 bool qos; /* Flag indicating if the station
427 u8 acm; /* Bitfield indicating which queues
429 u16 uapsd_tids; /* Bitfield indicating which tids are subject to
431 struct ecrnx_key key;
432 struct ecrnx_sta_ps ps; /* Information when STA is in PS (AP only) */
433 #ifdef CONFIG_ECRNX_BFMER
434 struct ecrnx_bfmer_report *bfm_report; /* Beamforming report to be used for
435 VHT TX Beamforming */
436 #ifdef CONFIG_ECRNX_MUMIMO_TX
437 struct ecrnx_sta_group_info group_info; /* MU grouping information for the STA */
438 #endif /* CONFIG_ECRNX_MUMIMO_TX */
439 #endif /* CONFIG_ECRNX_BFMER */
441 bool ht; /* Flag indicating if the station
443 bool vht; /* Flag indicating if the station
445 u32 ac_param[AC_MAX]; /* EDCA parameters */
446 struct ecrnx_tdls tdls; /* TDLS station information */
447 struct ecrnx_sta_stats stats;
448 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
449 enum nl80211_mesh_power_mode mesh_pm; /* link-specific mesh power save mode */
452 struct twt_setup_ind twt_ind; /*TWT Setup indication*/
453 uint64_t rx_pn[TID_MAX];
454 struct reord_cntrl reord_cntrl[TID_MAX];
457 #define ECRNX_INVALID_STA 0xFF
458 static inline const u8 *ecrnx_sta_addr(struct ecrnx_sta *sta) {
459 return sta->mac_addr;
462 #ifdef CONFIG_ECRNX_SPLIT_TX_BUF
463 struct ecrnx_amsdu_stats {
470 int cfm_balance[NX_TXQ_CNT];
471 unsigned long last_rx, last_tx; /* jiffies */
472 int ampdus_tx[IEEE80211_MAX_AMPDU_BUF];
473 int ampdus_rx[IEEE80211_MAX_AMPDU_BUF];
474 int ampdus_rx_map[4];
477 #ifdef CONFIG_ECRNX_SPLIT_TX_BUF
478 struct ecrnx_amsdu_stats amsdus[NX_TX_PAYLOAD_MAX];
484 * struct ecrnx_roc - Remain On Channel information
487 Structure that will contains all RoC information received from cfg80211 */
489 struct ecrnx_vif *vif;
490 struct ieee80211_channel *chan;
491 unsigned int duration;
492 /* Used to avoid call of CFG80211 callback upon expiration of RoC */
494 /* Indicate if we have switch on the RoC channel */
498 /* Structure containing channel survey information received from MAC */
499 struct ecrnx_survey_info {
502 // Amount of time in ms the radio spent on the channel
504 // Amount of time the primary channel was sensed busy
505 u32 chan_time_busy_ms;
511 /* Structure containing channel context information */
512 struct ecrnx_chanctx {
513 struct cfg80211_chan_def chan_def; /* channel description */
514 u8 count; /* number of vif using this ctxt */
517 #define ECRNX_CH_NOT_SET 0xFF
519 * ecrnx_phy_info - Phy information
521 * @phy_cnt: Number of phy interface
522 * @cfg: Configuration send to firmware
523 * @sec_chan: Channel configuration of the second phy interface (if phy_cnt > 1)
524 * @limit_bw: Set to true to limit BW on requested channel. Only set to use
525 * VHT with old radio that don't support 80MHz (deprecated)
527 struct ecrnx_phy_info {
529 struct phy_cfg_tag cfg;
530 struct mac_chan_op sec_chan;
538 #ifdef CONFIG_ECRNX_ESWIN
541 struct ecrnx_plat *plat;
544 struct ecrnx_phy_info phy;
545 struct mm_version_cfm version_cfm;
547 struct ecrnx_mod_params *mod_params;
551 struct list_head vifs;
552 struct ecrnx_vif *vif_table[NX_VIRT_DEV_MAX + NX_REMOTE_STA_MAX]; /* indexed with fw id */
556 struct ecrnx_sta sta_table[NX_REMOTE_STA_MAX + NX_VIRT_DEV_MAX];
559 struct ecrnx_chanctx chanctx_table[NX_CHAN_CTXT_CNT];
561 struct ecrnx_survey_info survey[SCAN_CHANNEL_MAX];
564 struct ecrnx_roc *roc;
566 struct cfg80211_scan_request *scan_request;
567 spinlock_t scan_req_lock;
568 spinlock_t connect_req_lock;
569 struct ecrnx_radar radar;
571 #ifdef CONFIG_ECRNX_P2P
572 struct ecrnx_p2p_listen p2p_listen;
577 struct ecrnx_txq txq[NX_NB_TXQ];
578 struct ecrnx_hwq hwq[NX_TXQ_CNT];
579 struct timer_list txq_cleanup;
580 struct kmem_cache *sw_txhdr_cache;
581 u32 tcp_pacing_shift;
582 #ifdef CONFIG_ECRNX_MUMIMO_TX
583 struct ecrnx_mu_info mu;
587 struct ecrnx_defer_rx defer_rx;
590 struct tasklet_struct task;
594 struct ipc_host_env_tag *ipc_env;
595 struct ecrnx_cmd_mgr cmd_mgr;
597 struct ecrnx_ipc_elem_pool e2amsgs_pool;
598 struct ecrnx_ipc_elem_pool dbgmsgs_pool;
599 struct ecrnx_ipc_elem_pool e2aradars_pool;
600 struct ecrnx_ipc_elem_var pattern_elem;
601 struct ecrnx_ipc_dbgdump_elem dbgdump_elem;
602 struct ecrnx_ipc_elem_pool e2arxdesc_pool;
603 struct ecrnx_ipc_skb_elem *e2aunsuprxvec_elems;
604 struct ecrnx_ipc_rxbuf_elems rxbuf_elems;
605 struct ecrnx_ipc_elem_var scan_ie;
607 #ifdef CONFIG_ECRNX_DEBUGFS
608 struct ecrnx_debugfs debugfs;
611 struct ecrnx_stats stats;
612 struct ecrnx_conf_file conf_param;
614 #ifdef CONFIG_ECRNX_ESWIN
615 struct list_head agg_rx_list;
616 struct list_head defrag_rx_list;
618 #ifdef CONFIG_ESWIN_RX_REORDER
619 spinlock_t rx_msdu_free_lock;
620 struct list_head rx_msdu_free_list;
621 struct list_head rx_reord_list;
622 spinlock_t rx_reord_lock;
623 struct reord_msdu_info * rx_reord_buf;
626 /* extended capabilities supported */
627 #if defined(CONFIG_ECRNX_DEBUGFS_CUSTOM)
628 struct list_head debugfs_survey_info_tbl_ptr;
639 u8 *ecrnx_build_bcn(struct ecrnx_bcn *bcn, struct cfg80211_beacon_data *new);
641 void ecrnx_chanctx_link(struct ecrnx_vif *vif, u8 idx,
642 struct cfg80211_chan_def *chandef);
643 void ecrnx_chanctx_unlink(struct ecrnx_vif *vif);
644 int ecrnx_chanctx_valid(struct ecrnx_hw *ecrnx_hw, u8 idx);
646 static inline bool is_multicast_sta(int sta_idx)
648 return (sta_idx >= NX_REMOTE_STA_MAX);
650 struct ecrnx_sta *ecrnx_get_sta(struct ecrnx_hw *ecrnx_hw, const u8 *mac_addr);
652 static inline uint8_t master_vif_idx(struct ecrnx_vif *vif)
654 if (unlikely(vif->wdev.iftype == NL80211_IFTYPE_AP_VLAN)) {
655 return vif->ap_vlan.master->vif_index;
657 return vif->vif_index;
661 static inline void *ecrnx_get_shared_trace_buf(struct ecrnx_hw *ecrnx_hw)
663 #ifdef CONFIG_ECRNX_DEBUGFS
664 return (void *)&(ecrnx_hw->debugfs.fw_trace.buf);
670 void ecrnx_external_auth_enable(struct ecrnx_vif *vif);
671 void ecrnx_external_auth_disable(struct ecrnx_vif *vif);
674 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
675 /* 802.11ax HE MAC capabilities */
676 #define IEEE80211_HE_MAC_CAP0_HTC_HE 0x01
677 #define IEEE80211_HE_MAC_CAP0_TWT_REQ 0x02
678 #define IEEE80211_HE_MAC_CAP0_TWT_RES 0x04
679 #define IEEE80211_HE_MAC_CAP0_DYNAMIC_FRAG_NOT_SUPP 0x00
680 #define IEEE80211_HE_MAC_CAP0_DYNAMIC_FRAG_LEVEL_1 0x08
681 #define IEEE80211_HE_MAC_CAP0_DYNAMIC_FRAG_LEVEL_2 0x10
682 #define IEEE80211_HE_MAC_CAP0_DYNAMIC_FRAG_LEVEL_3 0x18
683 #define IEEE80211_HE_MAC_CAP0_DYNAMIC_FRAG_MASK 0x18
684 #define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_1 0x00
685 #define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_2 0x20
686 #define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_4 0x40
687 #define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_8 0x60
688 #define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_16 0x80
689 #define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_32 0xa0
690 #define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_64 0xc0
691 #define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_UNLIMITED 0xe0
692 #define IEEE80211_HE_MAC_CAP0_MAX_NUM_FRAG_MSDU_MASK 0xe0
694 #define IEEE80211_HE_MAC_CAP1_MIN_FRAG_SIZE_UNLIMITED 0x00
695 #define IEEE80211_HE_MAC_CAP1_MIN_FRAG_SIZE_128 0x01
696 #define IEEE80211_HE_MAC_CAP1_MIN_FRAG_SIZE_256 0x02
697 #define IEEE80211_HE_MAC_CAP1_MIN_FRAG_SIZE_512 0x03
698 #define IEEE80211_HE_MAC_CAP1_MIN_FRAG_SIZE_MASK 0x03
699 #define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_0US 0x00
700 #define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_8US 0x04
701 #define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US 0x08
702 #define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_MASK 0x0c
703 #define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_1 0x00
704 #define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_2 0x10
705 #define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_3 0x20
706 #define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_4 0x30
707 #define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_5 0x40
708 #define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_6 0x50
709 #define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_7 0x60
710 #define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8 0x70
711 #define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_MASK 0x70
713 /* Link adaptation is split between byte HE_MAC_CAP1 and
714 * HE_MAC_CAP2. It should be set only if IEEE80211_HE_MAC_CAP0_HTC_HE
715 * in which case the following values apply:
718 * 2 = Unsolicited feedback.
721 #define IEEE80211_HE_MAC_CAP1_LINK_ADAPTATION 0x80
723 #define IEEE80211_HE_MAC_CAP2_LINK_ADAPTATION 0x01
724 #define IEEE80211_HE_MAC_CAP2_ALL_ACK 0x02
725 #define IEEE80211_HE_MAC_CAP2_TRS 0x04
726 #define IEEE80211_HE_MAC_CAP2_BSR 0x08
727 #define IEEE80211_HE_MAC_CAP2_BCAST_TWT 0x10
728 #define IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP 0x20
729 #define IEEE80211_HE_MAC_CAP2_MU_CASCADING 0x40
730 #define IEEE80211_HE_MAC_CAP2_ACK_EN 0x80
732 #define IEEE80211_HE_MAC_CAP3_OMI_CONTROL 0x02
733 #define IEEE80211_HE_MAC_CAP3_OFDMA_RA 0x04
735 /* The maximum length of an A-MDPU is defined by the combination of the Maximum
736 * A-MDPU Length Exponent field in the HT capabilities, VHT capabilities and the
737 * same field in the HE capabilities.
739 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_USE_VHT 0x00
740 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_1 0x08
741 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2 0x10
742 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_RESERVED 0x18
743 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK 0x18
744 #define IEEE80211_HE_MAC_CAP3_AMSDU_FRAG 0x20
745 #define IEEE80211_HE_MAC_CAP3_FLEX_TWT_SCHED 0x40
746 #define IEEE80211_HE_MAC_CAP3_RX_CTRL_FRAME_TO_MULTIBSS 0x80
748 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_SHIFT 3
750 #define IEEE80211_HE_MAC_CAP4_BSRP_BQRP_A_MPDU_AGG 0x01
751 #define IEEE80211_HE_MAC_CAP4_QTP 0x02
752 #define IEEE80211_HE_MAC_CAP4_BQR 0x04
753 #define IEEE80211_HE_MAC_CAP4_SRP_RESP 0x08
754 #define IEEE80211_HE_MAC_CAP4_NDP_FB_REP 0x10
755 #define IEEE80211_HE_MAC_CAP4_OPS 0x20
756 #define IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU 0x40
757 /* Multi TID agg TX is split between byte #4 and #5
758 * The value is a combination of B39,B40,B41
760 #define IEEE80211_HE_MAC_CAP4_MULTI_TID_AGG_TX_QOS_B39 0x80
762 #define IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B40 0x01
763 #define IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B41 0x02
764 #define IEEE80211_HE_MAC_CAP5_SUBCHAN_SELECVITE_TRANSMISSION 0x04
765 #define IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU 0x08
766 #define IEEE80211_HE_MAC_CAP5_OM_CTRL_UL_MU_DATA_DIS_RX 0x10
767 #define IEEE80211_HE_MAC_CAP5_HE_DYNAMIC_SM_PS 0x20
768 #define IEEE80211_HE_MAC_CAP5_PUNCTURED_SOUNDING 0x40
769 #define IEEE80211_HE_MAC_CAP5_HT_VHT_TRIG_FRAME_RX 0x80
771 #define IEEE80211_HE_VHT_MAX_AMPDU_FACTOR 20
772 #define IEEE80211_HE_HT_MAX_AMPDU_FACTOR 16
774 /* 802.11ax HE PHY capabilities */
775 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G 0x02
776 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G 0x04
777 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G 0x08
778 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G 0x10
779 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_2G 0x20
780 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_5G 0x40
781 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_MASK 0xfe
783 #define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_80MHZ_ONLY_SECOND_20MHZ 0x01
784 #define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_80MHZ_ONLY_SECOND_40MHZ 0x02
785 #define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_160MHZ_ONLY_SECOND_20MHZ 0x04
786 #define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_160MHZ_ONLY_SECOND_40MHZ 0x08
787 #define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK 0x0f
788 #define IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A 0x10
789 #define IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD 0x20
790 #define IEEE80211_HE_PHY_CAP1_HE_LTF_AND_GI_FOR_HE_PPDUS_0_8US 0x40
791 /* Midamble RX/TX Max NSTS is split between byte #2 and byte #3 */
792 #define IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS 0x80
794 #define IEEE80211_HE_PHY_CAP2_MIDAMBLE_RX_TX_MAX_NSTS 0x01
795 #define IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US 0x02
796 #define IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ 0x04
797 #define IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ 0x08
798 #define IEEE80211_HE_PHY_CAP2_DOPPLER_TX 0x10
799 #define IEEE80211_HE_PHY_CAP2_DOPPLER_RX 0x20
801 /* Note that the meaning of UL MU below is different between an AP and a non-AP
802 * sta, where in the AP case it indicates support for Rx and in the non-AP sta
803 * case it indicates support for Tx.
805 #define IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO 0x40
806 #define IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO 0x80
808 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_NO_DCM 0x00
809 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK 0x01
810 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_QPSK 0x02
811 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_16_QAM 0x03
812 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_MASK 0x03
813 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1 0x00
814 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_2 0x04
815 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_NO_DCM 0x00
816 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_BPSK 0x08
817 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_QPSK 0x10
818 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_16_QAM 0x18
819 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_MASK 0x18
820 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1 0x00
821 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_2 0x20
822 #define IEEE80211_HE_PHY_CAP3_RX_HE_MU_PPDU_FROM_NON_AP_STA 0x40
823 #define IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER 0x80
825 #define IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE 0x01
826 #define IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER 0x02
828 /* Minimal allowed value of Max STS under 80MHz is 3 */
829 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 0x0c
830 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_5 0x10
831 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_6 0x14
832 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_7 0x18
833 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8 0x1c
834 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_MASK 0x1c
836 /* Minimal allowed value of Max STS above 80MHz is 3 */
837 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4 0x60
838 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_5 0x80
839 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_6 0xa0
840 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_7 0xc0
841 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_8 0xe0
842 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_MASK 0xe0
844 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_1 0x00
845 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 0x01
846 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_3 0x02
847 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_4 0x03
848 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_5 0x04
849 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_6 0x05
850 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_7 0x06
851 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_8 0x07
852 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK 0x07
854 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_1 0x00
855 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2 0x08
856 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_3 0x10
857 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_4 0x18
858 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_5 0x20
859 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_6 0x28
860 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_7 0x30
861 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_8 0x38
862 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK 0x38
864 #define IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK 0x40
865 #define IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK 0x80
867 #define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU 0x01
868 #define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU 0x02
869 #define IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB 0x04
870 #define IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB 0x08
871 #define IEEE80211_HE_PHY_CAP6_TRIG_CQI_FB 0x10
872 #define IEEE80211_HE_PHY_CAP6_PARTIAL_BW_EXT_RANGE 0x20
873 #define IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO 0x40
874 #define IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT 0x80
876 #define IEEE80211_HE_PHY_CAP7_SRP_BASED_SR 0x01
877 #define IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_AR 0x02
878 #define IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI 0x04
879 #define IEEE80211_HE_PHY_CAP7_MAX_NC_1 0x08
880 #define IEEE80211_HE_PHY_CAP7_MAX_NC_2 0x10
881 #define IEEE80211_HE_PHY_CAP7_MAX_NC_3 0x18
882 #define IEEE80211_HE_PHY_CAP7_MAX_NC_4 0x20
883 #define IEEE80211_HE_PHY_CAP7_MAX_NC_5 0x28
884 #define IEEE80211_HE_PHY_CAP7_MAX_NC_6 0x30
885 #define IEEE80211_HE_PHY_CAP7_MAX_NC_7 0x38
886 #define IEEE80211_HE_PHY_CAP7_MAX_NC_MASK 0x38
887 #define IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ 0x40
888 #define IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ 0x80
890 #define IEEE80211_HE_PHY_CAP8_HE_ER_SU_PPDU_4XLTF_AND_08_US_GI 0x01
891 #define IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G 0x02
892 #define IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU 0x04
893 #define IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU 0x08
894 #define IEEE80211_HE_PHY_CAP8_HE_ER_SU_1XLTF_AND_08_US_GI 0x10
895 #define IEEE80211_HE_PHY_CAP8_MIDAMBLE_RX_TX_2X_AND_1XLTF 0x20
896 #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_242 0x00
897 #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_484 0x40
898 #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_996 0x80
899 #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_2x996 0xc0
900 #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_MASK 0xc0
902 #define IEEE80211_HE_PHY_CAP9_LONGER_THAN_16_SIGB_OFDM_SYM 0x01
903 #define IEEE80211_HE_PHY_CAP9_NON_TRIGGERED_CQI_FEEDBACK 0x02
904 #define IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU 0x04
905 #define IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_THAN_242_TONE_RU 0x08
907 /* 802.11ax HE TX/RX MCS NSS Support */
908 #define IEEE80211_TX_RX_MCS_NSS_SUPP_HIGHEST_MCS_POS (3)
909 #define IEEE80211_TX_RX_MCS_NSS_SUPP_TX_BITMAP_POS (6)
910 #define IEEE80211_TX_RX_MCS_NSS_SUPP_RX_BITMAP_POS (11)
911 #define IEEE80211_TX_RX_MCS_NSS_SUPP_TX_BITMAP_MASK 0x07c0
912 #define IEEE80211_TX_RX_MCS_NSS_SUPP_RX_BITMAP_MASK 0xf800
915 /* TX/RX HE MCS Support field Highest MCS subfield encoding */
916 enum ieee80211_he_highest_mcs_supported_subfield_enc {
917 HIGHEST_MCS_SUPPORTED_MCS7 = 0,
918 HIGHEST_MCS_SUPPORTED_MCS8,
919 HIGHEST_MCS_SUPPORTED_MCS9,
920 HIGHEST_MCS_SUPPORTED_MCS10,
921 HIGHEST_MCS_SUPPORTED_MCS11,
924 #define IEEE80211_HE_PPE_THRES_MAX_LEN 25
927 * struct ieee80211_he_mcs_nss_supp - HE Tx/Rx HE MCS NSS Support Field
929 * This structure holds the data required for the Tx/Rx HE MCS NSS Support Field
930 * described in P802.11ax_D2.0 section 9.4.2.237.4
932 * @rx_mcs_80: Rx MCS map 2 bits for each stream, total 8 streams, for channel
933 * widths less than 80MHz.
934 * @tx_mcs_80: Tx MCS map 2 bits for each stream, total 8 streams, for channel
935 * widths less than 80MHz.
936 * @rx_mcs_160: Rx MCS map 2 bits for each stream, total 8 streams, for channel
938 * @tx_mcs_160: Tx MCS map 2 bits for each stream, total 8 streams, for channel
940 * @rx_mcs_80p80: Rx MCS map 2 bits for each stream, total 8 streams, for
941 * channel width 80p80MHz.
942 * @tx_mcs_80p80: Tx MCS map 2 bits for each stream, total 8 streams, for
943 * channel width 80p80MHz.
945 struct ieee80211_he_mcs_nss_supp {
955 * struct ieee80211_he_cap_elem - HE capabilities element
957 * This structure is the "HE capabilities element" fixed fields as
958 * described in P802.11ax_D2.0 section 9.4.2.237.2 and 9.4.2.237.3
960 struct ieee80211_he_cap_elem {
966 * struct ieee80211_sta_he_cap - STA's HE capabilities
968 * This structure describes most essential parameters needed
969 * to describe 802.11ax HE capabilities for a STA.
971 * @has_he: true iff HE data is valid.
972 * @he_cap_elem: Fixed portion of the HE capabilities element.
973 * @he_mcs_nss_supp: The supported NSS/MCS combinations.
974 * @ppe_thres: Holds the PPE Thresholds data.
976 struct ieee80211_sta_he_cap {
978 struct ieee80211_he_cap_elem he_cap_elem;
979 struct ieee80211_he_mcs_nss_supp he_mcs_nss_supp;
980 u8 ppe_thres[IEEE80211_HE_PPE_THRES_MAX_LEN];
985 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
986 #define IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB 0x10
987 #define IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB 0x20
988 #define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_0US 0x00
989 #define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_8US 0x40
990 #define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US 0x80
991 #define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_RESERVED 0xc0
992 #define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_MASK 0xc0
996 #if defined(CONFIG_ECRNX_HE)
997 extern struct ieee80211_sta_he_cap ecrnx_he_cap;
1000 #define RW_DRV_DESCRIPTION "ESWIN 11nac driver for Linux cfg80211"
1001 #define RW_DRV_COPYRIGHT "Copyright(c) 2015-2017 ESWIN"
1002 #define RW_DRV_AUTHOR "ESWIN S.A.S"
1004 #define ECRNX_PRINT_CFM_ERR(req) \
1005 printk(KERN_CRIT "%s: Status Error(%d)\n", #req, (&req##_cfm)->status)
1007 #define ECRNX_HT_CAPABILITIES \
1009 .ht_supported = true, \
1011 .ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K, \
1012 .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16, \
1014 .rx_mask = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \
1015 .rx_highest = cpu_to_le16(65), \
1016 .tx_params = IEEE80211_HT_MCS_TX_DEFINED, \
1020 #define ECRNX_VHT_CAPABILITIES \
1022 .vht_supported = false, \
1024 (7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT),\
1026 .rx_mcs_map = cpu_to_le16( \
1027 IEEE80211_VHT_MCS_SUPPORT_0_9 << 0 | \
1028 IEEE80211_VHT_MCS_NOT_SUPPORTED << 2 | \
1029 IEEE80211_VHT_MCS_NOT_SUPPORTED << 4 | \
1030 IEEE80211_VHT_MCS_NOT_SUPPORTED << 6 | \
1031 IEEE80211_VHT_MCS_NOT_SUPPORTED << 8 | \
1032 IEEE80211_VHT_MCS_NOT_SUPPORTED << 10 | \
1033 IEEE80211_VHT_MCS_NOT_SUPPORTED << 12 | \
1034 IEEE80211_VHT_MCS_NOT_SUPPORTED << 14), \
1035 .tx_mcs_map = cpu_to_le16( \
1036 IEEE80211_VHT_MCS_SUPPORT_0_9 << 0 | \
1037 IEEE80211_VHT_MCS_NOT_SUPPORTED << 2 | \
1038 IEEE80211_VHT_MCS_NOT_SUPPORTED << 4 | \
1039 IEEE80211_VHT_MCS_NOT_SUPPORTED << 6 | \
1040 IEEE80211_VHT_MCS_NOT_SUPPORTED << 8 | \
1041 IEEE80211_VHT_MCS_NOT_SUPPORTED << 10 | \
1042 IEEE80211_VHT_MCS_NOT_SUPPORTED << 12 | \
1043 IEEE80211_VHT_MCS_NOT_SUPPORTED << 14), \
1048 #define ECRNX_HE_CAPABILITIES \
1052 .mac_cap_info[0] = 0, \
1053 .mac_cap_info[1] = 0, \
1054 .mac_cap_info[2] = 0, \
1055 .mac_cap_info[3] = 0, \
1056 .mac_cap_info[4] = 0, \
1057 .mac_cap_info[5] = 0, \
1058 .phy_cap_info[0] = 0, \
1059 .phy_cap_info[1] = 0, \
1060 .phy_cap_info[2] = 0, \
1061 .phy_cap_info[3] = 0, \
1062 .phy_cap_info[4] = 0, \
1063 .phy_cap_info[5] = 0, \
1064 .phy_cap_info[6] = 0, \
1065 .phy_cap_info[7] = 0, \
1066 .phy_cap_info[8] = 0, \
1067 .phy_cap_info[9] = 0, \
1068 .phy_cap_info[10] = 0, \
1070 .he_mcs_nss_supp = { \
1071 .rx_mcs_80 = cpu_to_le16(0xfffa), \
1072 .tx_mcs_80 = cpu_to_le16(0xfffa), \
1073 .rx_mcs_160 = cpu_to_le16(0xffff), \
1074 .tx_mcs_160 = cpu_to_le16(0xffff), \
1075 .rx_mcs_80p80 = cpu_to_le16(0xffff), \
1076 .tx_mcs_80p80 = cpu_to_le16(0xffff), \
1078 .ppe_thres = {0x00}, \
1082 #define RATE(_bitrate, _hw_rate, _flags) { \
1083 .bitrate = (_bitrate), \
1084 .flags = (_flags), \
1085 .hw_value = (_hw_rate), \
1088 #define CHAN(_freq) { \
1089 .center_freq = (_freq), \
1090 .max_power = 30, /* FIXME */ \
1093 #endif /* _ECRNX_DEFS_H_*/