/* A TimeUnit is 1024 microsecond */ #define MSEC_TO_TU(_msec) (_msec*1000/1024)
/* For GO, this value represents the number of TUs before CSA "beacon * 0" TBTT when the CSA time-event needs to be scheduled to start. It * must be big enough to ensure that we switch in time.
*/ #define IWL_MVM_CHANNEL_SWITCH_TIME_GO 40
/* For client, this value represents the number of TUs before CSA * "beacon 1" TBTT, instead. This is because we don't know when the * GO/AP will be in the new channel, so we switch early enough.
*/ #define IWL_MVM_CHANNEL_SWITCH_TIME_CLIENT 10
/* * This value (in TUs) is used to fine tune the CSA NoA end time which should * be just before "beacon 0" TBTT.
*/ #define IWL_MVM_CHANNEL_SWITCH_MARGIN 4
/* * Number of beacons to transmit on a new channel until we unblock tx to * the stations, even if we didn't identify them on a new channel
*/ #define IWL_MVM_CS_UNBLOCK_TX_TIMEOUT 3
/* offchannel queue towards mac80211 */ #define IWL_MVM_OFFCHANNEL_QUEUE 0
/* invalid value for FW link id */ #define IWL_MVM_FW_LINK_ID_INVALID 0xff
/* * The access to the 'id' field must be done when the * mvm->time_event_lock is held, as it value is used to indicate * if the te is in the time event list or not (when id == TE_MAX)
*/
u32 id;
s8 link_id;
};
/* Power management */
/** * enum iwl_power_scheme - iwl power schemes * @IWL_POWER_SCHEME_CAM: Continuously Active Mode * @IWL_POWER_SCHEME_BPS: Balanced Power Save (default) * @IWL_POWER_SCHEME_LP: Low Power
*/ enum iwl_power_scheme {
IWL_POWER_SCHEME_CAM = 1,
IWL_POWER_SCHEME_BPS,
IWL_POWER_SCHEME_LP
};
/** * enum iwl_mvm_low_latency_force - low latency force mode set by debugfs * @LOW_LATENCY_FORCE_UNSET: unset force mode * @LOW_LATENCY_FORCE_ON: for low latency on * @LOW_LATENCY_FORCE_OFF: for low latency off * @NUM_LOW_LATENCY_FORCE: max num of modes
*/ enum iwl_mvm_low_latency_force {
LOW_LATENCY_FORCE_UNSET,
LOW_LATENCY_FORCE_ON,
LOW_LATENCY_FORCE_OFF,
NUM_LOW_LATENCY_FORCE
};
/** * enum iwl_mvm_low_latency_cause - low latency set causes * @LOW_LATENCY_TRAFFIC: indicates low latency traffic was detected * @LOW_LATENCY_DEBUGFS: low latency mode set from debugfs * @LOW_LATENCY_VCMD: low latency mode set from vendor command * @LOW_LATENCY_VIF_TYPE: low latency mode set because of vif type (ap) * @LOW_LATENCY_DEBUGFS_FORCE_ENABLE: indicate that force mode is enabled * the actual set/unset is done with LOW_LATENCY_DEBUGFS_FORCE * @LOW_LATENCY_DEBUGFS_FORCE: low latency force mode from debugfs * set this with LOW_LATENCY_DEBUGFS_FORCE_ENABLE flag * in low_latency.
*/ enum iwl_mvm_low_latency_cause {
LOW_LATENCY_TRAFFIC = BIT(0),
LOW_LATENCY_DEBUGFS = BIT(1),
LOW_LATENCY_VCMD = BIT(2),
LOW_LATENCY_VIF_TYPE = BIT(3),
LOW_LATENCY_DEBUGFS_FORCE_ENABLE = BIT(4),
LOW_LATENCY_DEBUGFS_FORCE = BIT(5),
};
/** * struct iwl_mvm_link_bf_data - beacon filtering related data * @ave_beacon_signal: average beacon signal * @last_cqm_event: rssi of the last cqm event * @bt_coex_min_thold: minimum threshold for BT coex * @bt_coex_max_thold: maximum threshold for BT coex * @last_bt_coex_event: rssi of the last BT coex event
*/ struct iwl_mvm_link_bf_data { int ave_beacon_signal; int last_cqm_event; int bt_coex_min_thold; int bt_coex_max_thold; int last_bt_coex_event;
};
/** * struct iwl_probe_resp_data - data for NoA/CSA updates * @rcu_head: used for freeing the data on update * @notif: notification data * @noa_len: length of NoA attribute, calculated from the notification
*/ struct iwl_probe_resp_data { struct rcu_head rcu_head; struct iwl_probe_resp_data_notif notif; int noa_len;
};
/** * struct iwl_mvm_vif_link_info - per link data in Virtual Interface * @ap_sta_id: the sta_id of the AP - valid only if VIF type is STA * @fw_link_id: the id of the link according to the FW API * @bssid: BSSID for this (client) interface * @bcast_sta: station used for broadcast packets. Used by the following * vifs: P2P_DEVICE, GO and AP. * @beacon_stats: beacon statistics, containing the # of received beacons, * # of received beacons accumulated over FW restart, and the current * average signal of beacons retrieved from the firmware * @smps_requests: the SMPS requests of different parts of the driver, * combined on update to yield the overall request to mac80211. * @probe_resp_data: data from FW notification to store NOA and CSA related * data to be inserted into probe response. * @he_ru_2mhz_block: 26-tone RU OFDMA transmissions should be blocked * @queue_params: QoS params for this MAC * @mgmt_queue: queue number for unbufferable management frames * @igtk: the current IGTK programmed into the firmware * @active: indicates the link is active in FW (for sanity checking) * @cab_queue: content-after-beacon (multicast) queue * @listen_lmac: indicates this link is allocated to the listen LMAC * @csa_block_tx: we got CSA with mode=1 * @mcast_sta: multicast station * @phy_ctxt: phy context allocated to this link, if any * @bf_data: beacon filtering data * @average_beacon_energy: average beacon energy for beacons received during * client connections
*/ struct iwl_mvm_vif_link_info {
u8 bssid[ETH_ALEN];
u8 ap_sta_id;
u8 fw_link_id;
u16 cab_queue; /* Assigned while mac80211 has the link in a channel context, * or, for P2P Device, while it exists.
*/ struct iwl_mvm_phy_ctxt *phy_ctxt; /* QoS data from mac80211, need to store this here * as mac80211 has a separate callback but we need * to have the data for the MAC context
*/ struct ieee80211_tx_queue_params queue_params[IEEE80211_NUM_ACS];
/** * enum iwl_mvm_esr_state - defines reasons for which the EMLSR is exited or * blocked. * The low 16 bits are used for blocking reasons, and the 16 higher bits * are used for exit reasons. * For the blocking reasons - use iwl_mvm_(un)block_esr(), and for the exit * reasons - use iwl_mvm_exit_esr(). * * Note: new reasons shall be added to HANDLE_ESR_REASONS as well (for logs) * * @IWL_MVM_ESR_BLOCKED_PREVENTION: Prevent EMLSR to avoid entering and exiting * in a loop. * @IWL_MVM_ESR_BLOCKED_WOWLAN: WOWLAN is preventing the enablement of EMLSR * @IWL_MVM_ESR_BLOCKED_TPT: block EMLSR when there is not enough traffic * @IWL_MVM_ESR_BLOCKED_FW: FW didn't recommended/forced exit from EMLSR * @IWL_MVM_ESR_BLOCKED_NON_BSS: An active non-BSS interface's link is * preventing EMLSR * @IWL_MVM_ESR_BLOCKED_ROC: remain-on-channel is preventing EMLSR * @IWL_MVM_ESR_BLOCKED_TMP_NON_BSS: An expected active non-BSS interface's link * is preventing EMLSR. This is a temporary blocking that is set when there * is an indication that a non-BSS interface is to be added. * @IWL_MVM_ESR_EXIT_MISSED_BEACON: exited EMLSR due to missed beacons * @IWL_MVM_ESR_EXIT_LOW_RSSI: link is deactivated/not allowed for EMLSR * due to low RSSI. * @IWL_MVM_ESR_EXIT_COEX: link is deactivated/not allowed for EMLSR * due to BT Coex. * @IWL_MVM_ESR_EXIT_BANDWIDTH: Bandwidths of primary and secondry links * preventing the enablement of EMLSR * @IWL_MVM_ESR_EXIT_CSA: CSA happened, so exit EMLSR * @IWL_MVM_ESR_EXIT_LINK_USAGE: Exit EMLSR due to low tpt on secondary link
*/ enum iwl_mvm_esr_state {
IWL_MVM_ESR_BLOCKED_PREVENTION = 0x1,
IWL_MVM_ESR_BLOCKED_WOWLAN = 0x2,
IWL_MVM_ESR_BLOCKED_TPT = 0x4,
IWL_MVM_ESR_BLOCKED_FW = 0x8,
IWL_MVM_ESR_BLOCKED_NON_BSS = 0x10,
IWL_MVM_ESR_BLOCKED_ROC = 0x20,
IWL_MVM_ESR_BLOCKED_TMP_NON_BSS = 0x40,
IWL_MVM_ESR_EXIT_MISSED_BEACON = 0x10000,
IWL_MVM_ESR_EXIT_LOW_RSSI = 0x20000,
IWL_MVM_ESR_EXIT_COEX = 0x40000,
IWL_MVM_ESR_EXIT_BANDWIDTH = 0x80000,
IWL_MVM_ESR_EXIT_CSA = 0x100000,
IWL_MVM_ESR_EXIT_LINK_USAGE = 0x200000,
};
/** * struct iwl_mvm_esr_exit - details of the last exit from EMLSR mode. * @reason: The reason for the last exit from EMLSR. * &iwl_mvm_prevent_esr_reasons. Will be 0 before exiting EMLSR. * @ts: the time stamp of the last time we existed EMLSR.
*/ struct iwl_mvm_esr_exit { unsignedlong ts; enum iwl_mvm_esr_state reason;
};
/** * struct iwl_mvm_vif - data per Virtual Interface, it is a MAC context * @mvm: pointer back to the mvm struct * @id: between 0 and 3 * @color: to solve races upon MAC addition and removal * @associated: indicates that we're currently associated, used only for * managing the firmware state in iwl_mvm_bss_info_changed_station() * @ap_assoc_sta_count: count of stations associated to us - valid only * if VIF type is AP * @uploaded: indicates the MAC context has been added to the device * @ap_ibss_active: indicates that AP/IBSS is configured and that the interface * should get quota etc. * @pm_enabled - indicate if MAC power management is allowed * @monitor_active: indicates that monitor context is configured, and that the * interface should get quota etc. * @low_latency: bit flags for low latency * see enum &iwl_mvm_low_latency_cause for causes. * @low_latency_actual: boolean, indicates low latency is set, * as a result from low_latency bit flags and takes force into account. * @authorized: indicates the AP station was set to authorized * @ps_disabled: indicates that this interface requires PS to be disabled * @csa_countdown: indicates that CSA countdown may be started * @csa_failed: CSA failed to schedule time event, report an error later * @csa_bcn_pending: indicates that we are waiting for a beacon on a new channel * @csa_blocks_tx: CSA is blocking TX * @features: hw features active for this vif * @max_tx_op: max TXOP in usecs for all ACs, zero for no limit. * @ap_beacon_time: AP beacon time for synchronisation (on older FW) * @bf_enabled: indicates if beacon filtering is enabled * @ba_enabled: indicated if beacon abort is enabled * @bcn_prot: beacon protection data (keys; FIXME: needs to be per link) * @deflink: default link data for use in non-MLO * @link: link data for each link in MLO * @esr_active: indicates eSR mode is active * @esr_disable_reason: a bitmap of &enum iwl_mvm_esr_state * @pm_enabled: indicates powersave is enabled * @link_selection_res: bitmap of active links as it was decided in the last * link selection. Valid only for a MLO vif after assoc. 0 if there wasn't * any link selection yet. * @link_selection_primary: primary link selected by link selection * @primary_link: primary link in eSR. Valid only for an associated MLD vif, * and in eSR mode. Valid only for a STA. * @last_esr_exit: Details of the last exit from EMLSR. * @exit_same_reason_count: The number of times we exited due to the specified * @last_esr_exit::reason, only counting exits due to * &IWL_MVM_ESR_PREVENT_REASONS. * @prevent_esr_done_wk: work that should be done when esr prevention ends. * @mlo_int_scan_wk: work for the internal MLO scan. * @unblock_esr_tpt_wk: work for unblocking EMLSR when tpt is high enough. * @unblock_esr_tmp_non_bss_wk: work for removing the * IWL_MVM_ESR_BLOCKED_TMP_NON_BSS blocking for EMLSR. * @roc_activity: currently running ROC activity for this vif (or * ROC_NUM_ACTIVITIES if no activity is running). * @session_prot_connection_loss: the connection was lost due to session * protection ending without receiving a beacon, so we need to now * protect the deauth separately * @ap_early_keys: The firmware cannot install keys before stations etc., * but higher layers work differently, so we store the keys here for * later installation. * @ap_sta: pointer to the AP STA data structure * @csa_count: CSA counter (old CSA implementation w/o firmware) * @csa_misbehave: CSA AP misbehaviour flag (old implementation) * @csa_target_freq: CSA target channel frequency (old implementation) * @csa_work: CSA work (old implementation) * @dbgfs_bf: beamforming debugfs data * @dbgfs_dir: debugfs directory for this vif * @dbgfs_pm: power management debugfs data * @dbgfs_quota_min: debugfs value for minimal quota * @dbgfs_slink: debugfs symlink for this interface * @ftm_unprotected: unprotected FTM debugfs override * @hs_time_event_data: hotspot/AUX ROC time event data * @mac_pwr_cmd: debugfs override for MAC power command * @target_ipv6_addrs: IPv6 addresses on this interface for offload * @num_target_ipv6_addrs: number of @target_ipv6_addrs * @tentative_addrs: bitmap of tentative IPv6 addresses in @target_ipv6_addrs * @rekey_data: rekeying data for WoWLAN GTK rekey offload * @seqno: storage for seqno for older firmware D0/D3 transition * @seqno_valid: indicates @seqno is valid * @time_event_data: session protection time event data * @tsf_id: the TSF resource ID assigned in firmware (for firmware needing that) * @tx_key_idx: WEP transmit key index for D3 * @uapsd_misbehaving_ap_addr: MLD address/BSSID of U-APSD misbehaving AP, to * not use U-APSD on reconnection * @uapsd_nonagg_detected_wk: worker for handling detection of no aggregation * in U-APSD
*/ struct iwl_mvm_vif { struct iwl_mvm *mvm;
u16 id;
u16 color;
/** * struct iwl_mvm_tt_mgmt - Thermal Throttling Management structure * @ct_kill_exit: worker to exit thermal kill * @dynamic_smps: Is thermal throttling enabled dynamic_smps? * @tx_backoff: The current thremal throttling tx backoff in uSec. * @min_backoff: The minimal tx backoff due to power restrictions * @params: Parameters to configure the thermal throttling algorithm. * @throttle: Is thermal throttling is active? * @power_budget_mw: maximum cTDP power budget as defined for this system and * device
*/ struct iwl_mvm_tt_mgmt { struct delayed_work ct_kill_exit; bool dynamic_smps;
u32 tx_backoff;
u32 min_backoff; struct iwl_tt_params params; bool throttle;
u32 power_budget_mw;
};
#ifdef CONFIG_THERMAL /** * struct iwl_mvm_thermal_device - thermal zone related data * @trips: temperature thresholds for report * @tzone: thermal zone device data
*/ struct iwl_mvm_thermal_device { struct thermal_trip trips[IWL_MAX_DTS_TRIPS]; struct thermal_zone_device *tzone;
};
struct iwl_mvm_tcm { struct delayed_work work;
spinlock_t lock; /* used when time elapsed */ unsignedlong ts; /* timestamp when period ends */ unsignedlong ll_ts; unsignedlong uapsd_nonagg_ts; bool paused; struct iwl_mvm_tcm_mac data[NUM_MAC_INDEX_DRIVER]; struct {
u32 elapsed; /* milliseconds for this TCM period */
u32 airtime[NUM_MAC_INDEX_DRIVER]; enum iwl_mvm_traffic_load load[NUM_MAC_INDEX_DRIVER]; enum iwl_mvm_traffic_load band_load[NUM_NL80211_BANDS]; enum iwl_mvm_traffic_load global_load; bool low_latency[NUM_MAC_INDEX_DRIVER]; bool change[NUM_MAC_INDEX_DRIVER];
} result;
};
/** * struct iwl_mvm_reorder_buffer - per ra/tid/queue reorder buffer * @head_sn: reorder window head sn * @num_stored: number of mpdus stored in the buffer * @queue: queue of this reorder buffer * @valid: reordering is valid for this queue * @lock: protect reorder buffer internal state
*/ struct iwl_mvm_reorder_buffer {
u16 head_sn;
u16 num_stored; int queue; bool valid;
spinlock_t lock;
} ____cacheline_aligned_in_smp;
/** * struct iwl_mvm_reorder_buf_entry - reorder buffer entry per-queue/per-seqno * @frames: list of skbs stored
*/ struct iwl_mvm_reorder_buf_entry { struct sk_buff_head frames;
} #ifndef __CHECKER__ /* sparse doesn't like this construct: "bad integer constant expression" */
__aligned(roundup_pow_of_two(sizeof(struct sk_buff_head))) #endif
;
/** * struct iwl_mvm_baid_data - BA session data * @sta_mask: current station mask for the BAID * @tid: tid of the session * @baid: baid of the session * @timeout: the timeout set in the addba request * @buf_size: the reorder buffer size as set by the last addba request * @entries_per_queue: # of buffers per queue, this actually gets * aligned up to avoid cache line sharing between queues * @last_rx: last rx jiffies, updated only if timeout passed from last update * @session_timer: timer to check if BA session expired, runs at 2 * timeout * @rcu_ptr: BA data RCU protected access * @rcu_head: RCU head for freeing this data * @mvm: mvm pointer, needed for timer context * @reorder_buf: reorder buffer, allocated per queue * @entries: data
*/ struct iwl_mvm_baid_data { struct rcu_head rcu_head;
u32 sta_mask;
u8 tid;
u8 baid;
u16 timeout;
u16 buf_size;
u16 entries_per_queue; unsignedlong last_rx; struct timer_list session_timer; struct iwl_mvm_baid_data __rcu **rcu_ptr; struct iwl_mvm *mvm; struct iwl_mvm_reorder_buffer reorder_buf[IWL_MAX_RX_HW_QUEUES]; struct iwl_mvm_reorder_buf_entry entries[] ____cacheline_aligned_in_smp;
};
/* * enum iwl_mvm_queue_status - queue status * @IWL_MVM_QUEUE_FREE: the queue is not allocated nor reserved * Basically, this means that this queue can be used for any purpose * @IWL_MVM_QUEUE_RESERVED: queue is reserved but not yet in use * This is the state of a queue that has been dedicated for some RATID * (agg'd or not), but that hasn't yet gone through the actual enablement * of iwl_mvm_enable_txq(), and therefore no traffic can go through it yet. * Note that in this state there is no requirement to already know what TID * should be used with this queue, it is just marked as a queue that will * be used, and shouldn't be allocated to anyone else. * @IWL_MVM_QUEUE_READY: queue is ready to be used * This is the state of a queue that has been fully configured (including * SCD pointers, etc), has a specific RA/TID assigned to it, and can be * used to send traffic. * @IWL_MVM_QUEUE_SHARED: queue is shared, or in a process of becoming shared * This is a state in which a single queue serves more than one TID, all of * which are not aggregated. Note that the queue is only associated to one * RA.
*/ enum iwl_mvm_queue_status {
IWL_MVM_QUEUE_FREE,
IWL_MVM_QUEUE_RESERVED,
IWL_MVM_QUEUE_READY,
IWL_MVM_QUEUE_SHARED,
};
staticinlinestruct iwl_mvm_txq *
iwl_mvm_txq_from_tid(struct ieee80211_sta *sta, u8 tid)
{ if (tid == IWL_MAX_TID_COUNT)
tid = IEEE80211_NUM_TIDS;
return (void *)sta->txq[tid]->drv_priv;
}
/** * struct iwl_mvm_tvqm_txq_info - maps TVQM hw queue to tid * * @sta_id: sta id * @txq_tid: txq tid
*/ struct iwl_mvm_tvqm_txq_info {
u8 sta_id;
u8 txq_tid;
};
struct iwl_mvm_dqa_txq_info {
u8 ra_sta_id; /* The RA this queue is mapped to, if exists */ bool reserved; /* Is this the TXQ reserved for a STA */
u8 mac80211_ac; /* The mac80211 AC this queue is mapped to */
u8 txq_tid; /* The TID "owner" of this queue*/
u16 tid_bitmap; /* Bitmap of the TIDs mapped to this queue */ /* Timestamp for inactivation per TID of this queue */ unsignedlong last_frame_time[IWL_MAX_TID_COUNT + 1]; enum iwl_mvm_queue_status status;
};
/** * struct iwl_mvm_acs_survey_channel - per-channel survey information * * Stripped down version of &struct survey_info. * * @time: time in ms the radio was on the channel * @time_busy: time in ms the channel was sensed busy * @time_tx: time in ms spent transmitting data * @time_rx: time in ms spent receiving data * @noise: channel noise in dBm
*/ struct iwl_mvm_acs_survey_channel {
u32 time;
u32 time_busy;
u32 time_tx;
u32 time_rx;
s8 noise;
};
/* for protecting access to iwl_mvm */ struct mutex mutex; struct list_head async_handlers_list;
spinlock_t async_handlers_lock; struct work_struct async_handlers_wk;
/* For async rx handlers that require the wiphy lock */ struct wiphy_work async_handlers_wiphy_wk;
struct wiphy_work trig_link_selection_wk;
struct work_struct roc_done_wk;
unsignedlong init_status;
unsignedlong status;
u32 queue_sync_cookie; unsignedlong queue_sync_state; /* * for beacon filtering - * currently only one interface can be supported
*/ struct iwl_mvm_vif *bf_allowed_vif;
bool hw_registered; bool rfkill_safe_init_done;
u8 cca_40mhz_workaround;
u8 fw_rates_ver;
u32 ampdu_ref; bool ampdu_toggle;
struct iwl_notif_wait_data notif_wait;
union { struct mvm_statistics_rx_v3 rx_stats_v3; struct mvm_statistics_rx rx_stats;
};
/* * NVM built based on the SAP data but that we can't free even after * we get ownership because it contains the cfg80211's channel.
*/ struct iwl_nvm_data *temp_nvm_data;
/* EEPROM MAC addresses */ struct mac_address addresses[IWL_MVM_MAX_ADDRESSES];
/* data related to data path */ struct iwl_rx_phy_info last_phy_info; struct ieee80211_sta __rcu *fw_id_to_mac_id[IWL_STATION_COUNT_MAX]; /* note: fw_id_to_link_sta must be protected by wiphy and mvm mutexes */ struct ieee80211_link_sta __rcu *fw_id_to_link_sta[IWL_STATION_COUNT_MAX];
u8 rx_ba_sessions;
/* configured by mac80211 */
u32 rts_threshold;
/* Scan status, cmd (pre-allocated) and auxiliary station */ unsignedint scan_status;
size_t scan_cmd_size; void *scan_cmd; struct iwl_mcast_filter_cmd *mcast_filter_cmd; /* For CDB this is low band scan type, for non-CDB - type. */ enum iwl_mvm_scan_type scan_type; enum iwl_mvm_scan_type hb_scan_type;
/* start time of last scan in TSF of the mac that requested the scan */
u64 scan_start;
/* the vif that requested the current scan */ struct iwl_mvm_vif *scan_vif;
u8 scan_link_id;
/* rx chain antennas set through debugfs for the scan command */
u8 scan_rx_ant;
/* Internal station */ struct iwl_mvm_int_sta aux_sta; struct iwl_mvm_int_sta snif_sta;
bool last_ebs_successful;
u8 scan_last_antenna_idx; /* to toggle TX between antennas */
u8 mgmt_last_antenna_idx;
u8 set_tx_ant;
u8 set_rx_ant;
/* last smart fifo state that was successfully sent to firmware */ enum iwl_sf_state sf_state;
/* * Leave this pointer outside the ifdef below so that it can be * assigned without ifdef in the source code.
*/ struct dentry *debugfs_dir; #ifdef CONFIG_IWLWIFI_DEBUGFS
u32 dbgfs_sram_offset, dbgfs_sram_len;
u32 dbgfs_prph_reg_addr; bool disable_power_off; bool disable_power_off_d3; bool beacon_inject_active;
/* * A bitmap indicating the index of the key in use. The firmware * can hold 16 keys at most. Reflect this fact.
*/ unsignedlong fw_key_table[BITS_TO_LONGS(STA_KEY_MAX_NUM)];
u8 fw_key_deleted[STA_KEY_MAX_NUM];
#ifdef CONFIG_PM_SLEEP struct wiphy_wowlan_support wowlan; int gtk_ivlen, gtk_icvlen, ptk_ivlen, ptk_icvlen;
/* sched scan settings for net detect */ struct ieee80211_scan_ies nd_ies; struct cfg80211_match_set *nd_match_sets; int n_nd_match_sets; struct ieee80211_channel **nd_channels; int n_nd_channels; bool net_detect; bool fast_resume;
u8 offload_tid; #ifdef CONFIG_IWLWIFI_DEBUGFS bool d3_wake_sysassert; bool d3_test_active;
u32 d3_test_pme_ptr; struct ieee80211_vif *keep_vif;
u32 last_netdetect_scans; /* no. of scans in the last net-detect wake */ #endif #endif
wait_queue_head_t rx_sync_waitq;
/* BT-Coex - only one of those will be used */ union { struct iwl_bt_coex_prof_old_notif last_bt_notif; struct iwl_bt_coex_profile_notif last_bt_wifi_loss;
}; struct iwl_bt_coex_ci_cmd last_bt_ci_cmd;
s32 temperature; /* Celsius */ /* * Debug option to set the NIC temperature. This option makes the * driver think this is the actual NIC temperature, and ignore the * real temperature that is received from the fw
*/ bool temperature_test; /* Debug test temperature is enabled */
/* Indicate if device power save is allowed */
u8 ps_disabled; /* u8 instead of bool to ease debugfs_create_* usage */ /* Indicate if 32Khz external clock is valid */
u32 ext_clock_valid;
/* This vif used by CSME to send / receive traffic */ struct ieee80211_vif *csme_vif; struct ieee80211_vif __rcu *csa_vif; struct ieee80211_vif __rcu *csa_tx_blocked_vif;
u8 csa_tx_block_bcn_timeout;
/* system time of last beacon (for AP/GO interface) */
u32 ap_last_beacon_gp2;
/* indicates that we transmitted the last beacon */ bool ibss_manager;
/* * Drop beacons from other APs in AP mode when there are no connected * clients.
*/ bool drop_bcn_ap_mode;
struct delayed_work cs_tx_unblock_dwork;
/* does a monitor vif exist (only one can exist hence bool) */ bool monitor_on; /* * primary channel position relative to he whole bandwidth, * in steps of 80 MHz
*/
u8 monitor_p80;
/* sniffer data to include in radiotap */
__le16 cur_aid;
u8 cur_bssid[ETH_ALEN];
/* report rx timestamp in ptp clock time */ bool rx_ts_ptp;
/* * Indicates that firmware will do a product reset (and then * therefore fail to load) when we start it (due to OTP burn), * if so don't dump errors etc. since this is expected.
*/ bool fw_product_reset;
struct iwl_time_sync_data time_sync;
struct iwl_mei_scan_filter mei_scan_filter;
struct iwl_mvm_acs_survey *acs_survey;
bool statistics_clear;
};
/* Extract MVM priv from op_mode and _hw */ #define IWL_OP_MODE_GET_MVM(_iwl_op_mode) \
((struct iwl_mvm *)(_iwl_op_mode)->op_mode_specific)
/** * enum iwl_mvm_status - MVM status bits * @IWL_MVM_STATUS_HW_RFKILL: HW RF-kill is asserted * @IWL_MVM_STATUS_HW_CTKILL: CT-kill is active * @IWL_MVM_STATUS_ROC_P2P_RUNNING: remain-on-channel on P2P is running (when * P2P is not over AUX) * @IWL_MVM_STATUS_HW_RESTART_REQUESTED: HW restart was requested * @IWL_MVM_STATUS_IN_HW_RESTART: HW restart is active * @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running * @IWL_MVM_STATUS_FIRMWARE_RUNNING: firmware is running * @IWL_MVM_STATUS_IN_D3: in D3 (or at least about to go into it) * @IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE: suppress one error log * if this is set, when intentionally triggered
*/ enum iwl_mvm_status {
IWL_MVM_STATUS_HW_RFKILL,
IWL_MVM_STATUS_HW_CTKILL,
IWL_MVM_STATUS_ROC_P2P_RUNNING,
IWL_MVM_STATUS_HW_RESTART_REQUESTED,
IWL_MVM_STATUS_IN_HW_RESTART,
IWL_MVM_STATUS_ROC_AUX_RUNNING,
IWL_MVM_STATUS_FIRMWARE_RUNNING,
IWL_MVM_STATUS_IN_D3,
IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE,
};
/* Must be called with rcu_read_lock() held and it can only be * released when mvmsta is not needed anymore.
*/ staticinlinestruct iwl_mvm_sta *
iwl_mvm_sta_from_staid_rcu(struct iwl_mvm *mvm, u8 sta_id)
{ struct ieee80211_sta *sta;
if (sta_id >= mvm->fw->ucode_capa.num_stations) return NULL;
sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]);
/* This can happen if the station has been removed right now */ if (IS_ERR_OR_NULL(sta)) return NULL;
staticinlinebool iwl_mvm_is_oce_supported(struct iwl_mvm *mvm)
{ /* OCE should never be enabled for LMAC scan FWs */ return fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_OCE);
}
/* * Enable LAR only if it is supported by the FW (TLV) && * enabled in the NVM
*/ if (mvm->trans->cfg->nvm_type == IWL_NVM_EXT) return nvm_lar && tlv_lar; else return tlv_lar;
}
staticinlinebool iwl_mvm_has_new_tx_api(struct iwl_mvm *mvm)
{ /* TODO - replace with TLV once defined */ return mvm->trans->mac_cfg->gen2;
}
staticinlinebool iwl_mvm_has_unified_ucode(struct iwl_mvm *mvm)
{ /* TODO - better define this */ return mvm->trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_22000;
}
staticinlinebool iwl_mvm_is_cdb_supported(struct iwl_mvm *mvm)
{ /* * TODO: * The issue of how to determine CDB APIs and usage is still not fully * defined. * There is a compilation for CDB and non-CDB FW, but there may * be also runtime check. * For now there is a TLV for checking compilation mode, but a * runtime check will also have to be here - once defined.
*/ return fw_has_capa(&mvm->fw->ucode_capa,
IWL_UCODE_TLV_CAPA_CDB_SUPPORT);
}
staticinlinebool iwl_mvm_cdb_scan_api(struct iwl_mvm *mvm)
{ /* * TODO: should this be the same as iwl_mvm_is_cdb_supported()? * but then there's a little bit of code in scan that won't make * any sense...
*/ return mvm->trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_22000;
}
staticinlinebool iwl_mvm_is_tt_in_fw(struct iwl_mvm *mvm)
{ /* these two TLV are redundant since the responsibility to CT-kill by * FW happens only after we send at least one command of * temperature THs report.
*/ return fw_has_capa(&mvm->fw->ucode_capa,
IWL_UCODE_TLV_CAPA_CT_KILL_BY_FW) &&
fw_has_capa(&mvm->fw->ucode_capa,
IWL_UCODE_TLV_CAPA_TEMP_THS_REPORT_SUPPORT);
}
staticinlinebool iwl_mvm_is_esr_supported(struct iwl_trans *trans)
{ if (CSR_HW_RFID_IS_CDB(trans->info.hw_rf_id)) returnfalse;
switch (CSR_HW_RFID_TYPE(trans->info.hw_rf_id)) { case IWL_CFG_RF_TYPE_FM: /* Step A doesn't support eSR */ return CSR_HW_RFID_STEP(trans->info.hw_rf_id); case IWL_CFG_RF_TYPE_WH: case IWL_CFG_RF_TYPE_PE: returntrue; default: returnfalse;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.