if_iwm - Add firmware API definitions for TX power commands.

* While there remove unused IWM_UCODE_TLV_CAPA_LMAC_UPLOAD definition,
which isn't defined in iwlwifi.

Taken-From: Linux iwlwifi

Submitted by:	Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from:	DragonFlyBSD (fd4f9de8bc72ea961e50829b45b59d0549040b7d)
This commit is contained in:
Kyle Evans 2019-01-24 03:45:24 +00:00
parent 9612bbf423
commit ef217a3417
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=343380
2 changed files with 51 additions and 3 deletions

View File

@ -80,6 +80,8 @@ enum iwm_device_family {
IWM_DEVICE_FAMILY_8000,
};
#define IWM_DEFAULT_MAX_TX_POWER 22
/* Antenna presence definitions */
#define IWM_ANT_NONE 0x0
#define IWM_ANT_A (1 << 0)

View File

@ -702,8 +702,9 @@ enum iwm_ucode_tlv_api {
* @IWM_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG: support getting more shared
* memory addresses from the firmware.
* @IWM_UCODE_TLV_CAPA_LQM_SUPPORT: supports Link Quality Measurement
* @IWM_UCODE_TLV_CAPA_LMAC_UPLOAD: supports upload mode in lmac (1=supported,
* 0=no support)
* @IWM_UCODE_TLV_CAPA_TX_POWER_ACK: reduced TX power API has larger
* command size (command version 4) that supports toggling ACK TX
* power reduction.
*
* @IWM_NUM_UCODE_TLV_CAPA: number of bits used
*/
@ -744,9 +745,9 @@ enum iwm_ucode_tlv_capa {
IWM_UCODE_TLV_CAPA_TEMP_THS_REPORT_SUPPORT = 75,
IWM_UCODE_TLV_CAPA_CTDP_SUPPORT = 76,
IWM_UCODE_TLV_CAPA_USNIFFER_UNIFIED = 77,
IWM_UCODE_TLV_CAPA_LMAC_UPLOAD = 79,
IWM_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG = 80,
IWM_UCODE_TLV_CAPA_LQM_SUPPORT = 81,
IWM_UCODE_TLV_CAPA_TX_POWER_ACK = 84,
IWM_NUM_UCODE_TLV_CAPA = 128
};
@ -1917,6 +1918,51 @@ struct iwm_reduce_tx_power_cmd {
uint16_t pwr_restriction;
} __packed; /* IWM_TX_REDUCED_POWER_API_S_VER_1 */
enum iwm_dev_tx_power_cmd_mode {
IWM_TX_POWER_MODE_SET_MAC = 0,
IWM_TX_POWER_MODE_SET_DEVICE = 1,
IWM_TX_POWER_MODE_SET_CHAINS = 2,
IWM_TX_POWER_MODE_SET_ACK = 3,
}; /* TX_POWER_REDUCED_FLAGS_TYPE_API_E_VER_4 */;
#define IWM_NUM_CHAIN_LIMITS 2
#define IWM_NUM_SUB_BANDS 5
/**
* struct iwm_dev_tx_power_cmd - TX power reduction command
* @set_mode: see &enum iwl_dev_tx_power_cmd_mode
* @mac_context_id: id of the mac ctx for which we are reducing TX power.
* @pwr_restriction: TX power restriction in 1/8 dBms.
* @dev_24: device TX power restriction in 1/8 dBms
* @dev_52_low: device TX power restriction upper band - low
* @dev_52_high: device TX power restriction upper band - high
* @per_chain_restriction: per chain restrictions
*/
struct iwm_dev_tx_power_cmd_v3 {
uint32_t set_mode;
uint32_t mac_context_id;
uint16_t pwr_restriction;
uint16_t dev_24;
uint16_t dev_52_low;
uint16_t dev_52_high;
uint16_t per_chain_restriction[IWM_NUM_CHAIN_LIMITS][IWM_NUM_SUB_BANDS];
} __packed; /* TX_REDUCED_POWER_API_S_VER_3 */
#define IWM_DEV_MAX_TX_POWER 0x7FFF
/**
* struct iwm_dev_tx_power_cmd - TX power reduction command
* @v3: version 3 of the command, embedded here for easier software handling
* @enable_ack_reduction: enable or disable close range ack TX power
* reduction.
*/
struct iwm_dev_tx_power_cmd {
/* v4 is just an extension of v3 - keep this here */
struct iwm_dev_tx_power_cmd_v3 v3;
uint8_t enable_ack_reduction;
uint8_t reserved[3];
} __packed; /* TX_REDUCED_POWER_API_S_VER_4 */
/*
* Calibration control struct.
* Sent as part of the phy configuration command.