1
linux/drivers/net/wireless/mediatek/mt76/testmode.h
Jakub Kicinski f2b551fad8 wireless-drivers-next patches for v5.17
Third set of patches for v5.17, and the final one if all goes well. We
 have Specific Absorption Rate (SAR) support for both mt76 and rtw88.
 Also iwlwifi should be now W=1 warning free. But otherwise nothing
 really special this time, business as usual.
 
 Major changes:
 
 mt76
 
 * Specific Absorption Rate (SAR) support
 
 * mt7921: new PCI ids
 
 * mt7921: 160 MHz channel support
 
 iwlwifi
 
 * fix W=1 and sparse warnings
 
 * BNJ hardware support
 
 * add new killer device ids
 
 * support for Time-Aware-SAR (TAS) from the BIOS
 
 * Optimized Connectivity Experience (OCE) scan support
 
 rtw88
 
 * hardware scan
 
 * Specific Absorption Rate (SAR) support
 
 ath11k
 
 * qca6390/wcn6855: report signal and tx bitrate
 
 * qca6390: rfkill support
 
 * qca6390/wcn6855: regdb.bin support
 
 ath5k
 
 * switch to rate table based lookup
 
 wilc1000
 
 * spi: reset/enable GPIO support
 -----BEGIN PGP SIGNATURE-----
 
 iQFFBAABCgAvFiEEiBjanGPFTz4PRfLobhckVSbrbZsFAmHEgv4RHGt2YWxvQGtl
 cm5lbC5vcmcACgkQbhckVSbrbZt7jQf/W1J8lkaMw6mYnr+inmwKaP11VIk765Sf
 4FXZl4xks5rs5zJOs61c/zInNIbu7QVsJzQLmM/bhTB1zoZMRo6ugXXrZ/LPMT1u
 X0mul1rC+NLZLlgaimNXRZUXJ2tGUsYYhGoZLHbcILx7XF7/9WtE4h7tLviLdMYk
 l42yjjP6s/I/zQHrLQdA9/puGl7g8CItbwaNZg6+PjgbS9NPGATrw9UZdOWjPcl4
 JLMRHVgKtdlYL/U/IvsYg6o3Vbo0r+KEI2IMg5fOSpNwqbeQRIN4cZG4TDeRDqD/
 k4/ZiFYlNdfVeWmZxHyqX6D3sroIquKglyah34fjzsJ2TbJC1zMvjw==
 =VHFz
 -----END PGP SIGNATURE-----

Merge tag 'wireless-drivers-next-2021-12-23' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valo says:

====================
wireless-drivers-next patches for v5.17

Third set of patches for v5.17, and the final one if all goes well. We
have Specific Absorption Rate (SAR) support for both mt76 and rtw88.
Also iwlwifi should be now W=1 warning free. But otherwise nothing
really special this time, business as usual.

Major changes:

mt76
 * Specific Absorption Rate (SAR) support
 * mt7921: new PCI ids
 * mt7921: 160 MHz channel support

iwlwifi
 * fix W=1 and sparse warnings
 * BNJ hardware support
 * add new killer device ids
 * support for Time-Aware-SAR (TAS) from the BIOS
 * Optimized Connectivity Experience (OCE) scan support

rtw88
 * hardware scan
 * Specific Absorption Rate (SAR) support

ath11k
 * qca6390/wcn6855: report signal and tx bitrate
 * qca6390: rfkill support
 * qca6390/wcn6855: regdb.bin support

ath5k
 * switch to rate table based lookup

wilc1000
 * spi: reset/enable GPIO support

* tag 'wireless-drivers-next-2021-12-23' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next: (148 commits)
  mt76: mt7921: fix a possible race enabling/disabling runtime-pm
  wilc1000: Document enable-gpios and reset-gpios properties
  wilc1000: Add reset/enable GPIO support to SPI driver
  wilc1000: Convert static "chipid" variable to device-local variable
  rtw89: 8852a: correct bit definition of dfs_en
  rtw88: don't consider deep PS mode when transmitting packet
  ath11k: Fix unexpected return buffer manager error for QCA6390
  ath11k: add support of firmware logging for WCN6855
  ath11k: Fix napi related hang
  ath10k: replace strlcpy with strscpy
  rtw88: support SAR via kernel common API
  rtw88: 8822c: add ieee80211_ops::hw_scan
  iwlwifi: mei: wait before mapping the shared area
  iwlwifi: mei: clear the ownership when the driver goes down
  iwlwifi: yoyo: fix issue with new DBGI_SRAM region read.
  iwlwifi: fw: fix some scan kernel-doc
  iwlwifi: pcie: make sure prph_info is set when treating wakeup IRQ
  iwlwifi: mvm: remove card state notification code
  iwlwifi: mvm: drop too short packets silently
  iwlwifi: mvm: fix AUX ROC removal
  ...
====================

Link: https://lore.kernel.org/r/20211223141108.78808C36AE9@smtp.kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-12-23 09:12:37 -08:00

201 lines
5.7 KiB
C

/* SPDX-License-Identifier: ISC */
/*
* Copyright (C) 2020 Felix Fietkau <nbd@nbd.name>
*/
#ifndef __MT76_TESTMODE_H
#define __MT76_TESTMODE_H
#define MT76_TM_TIMEOUT 10
#include <net/netlink.h>
/**
* enum mt76_testmode_attr - testmode attributes inside NL80211_ATTR_TESTDATA
*
* @MT76_TM_ATTR_UNSPEC: (invalid attribute)
*
* @MT76_TM_ATTR_RESET: reset parameters to default (flag)
* @MT76_TM_ATTR_STATE: test state (u32), see &enum mt76_testmode_state
*
* @MT76_TM_ATTR_MTD_PART: mtd partition used for eeprom data (string)
* @MT76_TM_ATTR_MTD_OFFSET: offset of eeprom data within the partition (u32)
*
* @MT76_TM_ATTR_TX_COUNT: configured number of frames to send when setting
* state to MT76_TM_STATE_TX_FRAMES (u32)
* @MT76_TM_ATTR_TX_PENDING: pending frames during MT76_TM_STATE_TX_FRAMES (u32)
* @MT76_TM_ATTR_TX_LENGTH: packet tx mpdu length (u32)
* @MT76_TM_ATTR_TX_RATE_MODE: packet tx mode (u8, see &enum mt76_testmode_tx_mode)
* @MT76_TM_ATTR_TX_RATE_NSS: packet tx number of spatial streams (u8)
* @MT76_TM_ATTR_TX_RATE_IDX: packet tx rate/MCS index (u8)
* @MT76_TM_ATTR_TX_RATE_SGI: packet tx use short guard interval (u8)
* @MT76_TM_ATTR_TX_RATE_LDPC: packet tx enable LDPC (u8)
* @MT76_TM_ATTR_TX_RATE_STBC: packet tx enable STBC (u8)
* @MT76_TM_ATTR_TX_LTF: packet tx LTF, set 0 to 2 for 1x, 2x, and 4x LTF (u8)
*
* @MT76_TM_ATTR_TX_ANTENNA: tx antenna mask (u8)
* @MT76_TM_ATTR_TX_POWER_CONTROL: enable tx power control (u8)
* @MT76_TM_ATTR_TX_POWER: per-antenna tx power array (nested, u8 attrs)
*
* @MT76_TM_ATTR_FREQ_OFFSET: RF frequency offset (u32)
*
* @MT76_TM_ATTR_STATS: statistics (nested, see &enum mt76_testmode_stats_attr)
*
* @MT76_TM_ATTR_TX_SPE_IDX: tx spatial extension index (u8)
*
* @MT76_TM_ATTR_TX_DUTY_CYCLE: packet tx duty cycle (u8)
* @MT76_TM_ATTR_TX_IPG: tx inter-packet gap, in unit of us (u32)
* @MT76_TM_ATTR_TX_TIME: packet transmission time, in unit of us (u32)
*
* @MT76_TM_ATTR_DRV_DATA: driver specific netlink attrs (nested)
*
* @MT76_TM_ATTR_MAC_ADDRS: array of nested MAC addresses (nested)
*/
enum mt76_testmode_attr {
MT76_TM_ATTR_UNSPEC,
MT76_TM_ATTR_RESET,
MT76_TM_ATTR_STATE,
MT76_TM_ATTR_MTD_PART,
MT76_TM_ATTR_MTD_OFFSET,
MT76_TM_ATTR_TX_COUNT,
MT76_TM_ATTR_TX_LENGTH,
MT76_TM_ATTR_TX_RATE_MODE,
MT76_TM_ATTR_TX_RATE_NSS,
MT76_TM_ATTR_TX_RATE_IDX,
MT76_TM_ATTR_TX_RATE_SGI,
MT76_TM_ATTR_TX_RATE_LDPC,
MT76_TM_ATTR_TX_RATE_STBC,
MT76_TM_ATTR_TX_LTF,
MT76_TM_ATTR_TX_ANTENNA,
MT76_TM_ATTR_TX_POWER_CONTROL,
MT76_TM_ATTR_TX_POWER,
MT76_TM_ATTR_FREQ_OFFSET,
MT76_TM_ATTR_STATS,
MT76_TM_ATTR_TX_SPE_IDX,
MT76_TM_ATTR_TX_DUTY_CYCLE,
MT76_TM_ATTR_TX_IPG,
MT76_TM_ATTR_TX_TIME,
MT76_TM_ATTR_DRV_DATA,
MT76_TM_ATTR_MAC_ADDRS,
/* keep last */
NUM_MT76_TM_ATTRS,
MT76_TM_ATTR_MAX = NUM_MT76_TM_ATTRS - 1,
};
/**
* enum mt76_testmode_state - statistics attributes
*
* @MT76_TM_STATS_ATTR_TX_PENDING: pending tx frames (u32)
* @MT76_TM_STATS_ATTR_TX_QUEUED: queued tx frames (u32)
* @MT76_TM_STATS_ATTR_TX_QUEUED: completed tx frames (u32)
*
* @MT76_TM_STATS_ATTR_RX_PACKETS: number of rx packets (u64)
* @MT76_TM_STATS_ATTR_RX_FCS_ERROR: number of rx packets with FCS error (u64)
* @MT76_TM_STATS_ATTR_LAST_RX: information about the last received packet
* see &enum mt76_testmode_rx_attr
*/
enum mt76_testmode_stats_attr {
MT76_TM_STATS_ATTR_UNSPEC,
MT76_TM_STATS_ATTR_PAD,
MT76_TM_STATS_ATTR_TX_PENDING,
MT76_TM_STATS_ATTR_TX_QUEUED,
MT76_TM_STATS_ATTR_TX_DONE,
MT76_TM_STATS_ATTR_RX_PACKETS,
MT76_TM_STATS_ATTR_RX_FCS_ERROR,
MT76_TM_STATS_ATTR_LAST_RX,
/* keep last */
NUM_MT76_TM_STATS_ATTRS,
MT76_TM_STATS_ATTR_MAX = NUM_MT76_TM_STATS_ATTRS - 1,
};
/**
* enum mt76_testmode_rx_attr - packet rx information
*
* @MT76_TM_RX_ATTR_FREQ_OFFSET: frequency offset (s32)
* @MT76_TM_RX_ATTR_RCPI: received channel power indicator (array, u8)
* @MT76_TM_RX_ATTR_IB_RSSI: internal inband RSSI (array, s8)
* @MT76_TM_RX_ATTR_WB_RSSI: internal wideband RSSI (array, s8)
* @MT76_TM_RX_ATTR_SNR: signal-to-noise ratio (u8)
*/
enum mt76_testmode_rx_attr {
MT76_TM_RX_ATTR_UNSPEC,
MT76_TM_RX_ATTR_FREQ_OFFSET,
MT76_TM_RX_ATTR_RCPI,
MT76_TM_RX_ATTR_IB_RSSI,
MT76_TM_RX_ATTR_WB_RSSI,
MT76_TM_RX_ATTR_SNR,
/* keep last */
NUM_MT76_TM_RX_ATTRS,
MT76_TM_RX_ATTR_MAX = NUM_MT76_TM_RX_ATTRS - 1,
};
/**
* enum mt76_testmode_state - phy test state
*
* @MT76_TM_STATE_OFF: test mode disabled (normal operation)
* @MT76_TM_STATE_IDLE: test mode enabled, but idle
* @MT76_TM_STATE_TX_FRAMES: send a fixed number of test frames
* @MT76_TM_STATE_RX_FRAMES: receive packets and keep statistics
* @MT76_TM_STATE_TX_CONT: waveform tx without time gap
* @MT76_TM_STATE_ON: test mode enabled used in offload firmware
*/
enum mt76_testmode_state {
MT76_TM_STATE_OFF,
MT76_TM_STATE_IDLE,
MT76_TM_STATE_TX_FRAMES,
MT76_TM_STATE_RX_FRAMES,
MT76_TM_STATE_TX_CONT,
MT76_TM_STATE_ON,
/* keep last */
NUM_MT76_TM_STATES,
MT76_TM_STATE_MAX = NUM_MT76_TM_STATES - 1,
};
/**
* enum mt76_testmode_tx_mode - packet tx phy mode
*
* @MT76_TM_TX_MODE_CCK: legacy CCK mode
* @MT76_TM_TX_MODE_OFDM: legacy OFDM mode
* @MT76_TM_TX_MODE_HT: 802.11n MCS
* @MT76_TM_TX_MODE_VHT: 802.11ac MCS
* @MT76_TM_TX_MODE_HE_SU: 802.11ax single-user MIMO
* @MT76_TM_TX_MODE_HE_EXT_SU: 802.11ax extended-range SU
* @MT76_TM_TX_MODE_HE_TB: 802.11ax trigger-based
* @MT76_TM_TX_MODE_HE_MU: 802.11ax multi-user MIMO
*/
enum mt76_testmode_tx_mode {
MT76_TM_TX_MODE_CCK,
MT76_TM_TX_MODE_OFDM,
MT76_TM_TX_MODE_HT,
MT76_TM_TX_MODE_VHT,
MT76_TM_TX_MODE_HE_SU,
MT76_TM_TX_MODE_HE_EXT_SU,
MT76_TM_TX_MODE_HE_TB,
MT76_TM_TX_MODE_HE_MU,
/* keep last */
NUM_MT76_TM_TX_MODES,
MT76_TM_TX_MODE_MAX = NUM_MT76_TM_TX_MODES - 1,
};
extern const struct nla_policy mt76_tm_policy[NUM_MT76_TM_ATTRS];
#endif