Path: blob/main/sys/contrib/dev/iwlwifi/fw/api/phy-ctxt.h
48426 views
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */1/*2* Copyright (C) 2012-2014, 2018, 2020-2025 Intel Corporation3* Copyright (C) 2013-2015 Intel Mobile Communications GmbH4* Copyright (C) 2016-2017 Intel Deutschland GmbH5*/6#ifndef __iwl_fw_api_phy_ctxt_h__7#define __iwl_fw_api_phy_ctxt_h__89/* Supported bands */10#define PHY_BAND_5 (0)11#define PHY_BAND_24 (1)12#define PHY_BAND_6 (2)1314/* Supported channel width, vary if there is VHT support */15#define IWL_PHY_CHANNEL_MODE20 0x016#define IWL_PHY_CHANNEL_MODE40 0x117#define IWL_PHY_CHANNEL_MODE80 0x218#define IWL_PHY_CHANNEL_MODE160 0x319/* and 320 MHz for EHT */20#define IWL_PHY_CHANNEL_MODE320 0x42122/*23* Control channel position:24* For legacy set bit means upper channel, otherwise lower.25* For VHT - bit-2 marks if the control is lower/upper relative to center-freq26* bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.27* For EHT - bit-3 is used for extended distance28* center_freq29* |30* 40Mhz |____|____|31* 80Mhz |____|____|____|____|32* 160Mhz |____|____|____|____|____|____|____|____|33* 320MHz |____|____|____|____|____|____|____|____|____|____|____|____|____|____|____|____|34* code 1011 1010 1001 1000 0011 0010 0001 0000 0100 0101 0110 0111 1100 1101 1110 111135*/36#define IWL_PHY_CTRL_POS_ABOVE 0x437#define IWL_PHY_CTRL_POS_OFFS_EXT 0x838#define IWL_PHY_CTRL_POS_OFFS_MSK 0x33940/*41* struct iwl_fw_channel_info_v1 - channel information42*43* @band: PHY_BAND_*44* @channel: channel number45* @width: PHY_[VHT|LEGACY]_CHANNEL_*46* @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*47*/48struct iwl_fw_channel_info_v1 {49u8 band;50u8 channel;51u8 width;52u8 ctrl_pos;53} __packed; /* CHANNEL_CONFIG_API_S_VER_1 */5455/*56* struct iwl_fw_channel_info - channel information57*58* @channel: channel number59* @band: PHY_BAND_*60* @width: PHY_[VHT|LEGACY]_CHANNEL_*61* @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*62* @reserved: for future use and alignment63*/64struct iwl_fw_channel_info {65__le32 channel;66u8 band;67u8 width;68u8 ctrl_pos;69u8 reserved;70} __packed; /*CHANNEL_CONFIG_API_S_VER_2 */7172#define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)73#define PHY_RX_CHAIN_DRIVER_FORCE_MSK \74(0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)75#define PHY_RX_CHAIN_VALID_POS (1)76#define PHY_RX_CHAIN_VALID_MSK \77(0x7 << PHY_RX_CHAIN_VALID_POS)78#define PHY_RX_CHAIN_FORCE_SEL_POS (4)79#define PHY_RX_CHAIN_FORCE_SEL_MSK \80(0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)81#define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)82#define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \83(0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)84#define PHY_RX_CHAIN_CNT_POS (10)85#define PHY_RX_CHAIN_CNT_MSK \86(0x3 << PHY_RX_CHAIN_CNT_POS)87#define PHY_RX_CHAIN_MIMO_CNT_POS (12)88#define PHY_RX_CHAIN_MIMO_CNT_MSK \89(0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)90#define PHY_RX_CHAIN_MIMO_FORCE_POS (14)91#define PHY_RX_CHAIN_MIMO_FORCE_MSK \92(0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)9394/* TODO: fix the value, make it depend on firmware at runtime? */95#define NUM_PHY_CTX 39697/* TODO: complete missing documentation */98/**99* struct iwl_phy_context_cmd_tail - tail of iwl_phy_ctx_cmd for alignment with100* various channel structures.101*102* @txchain_info: ???103* @rxchain_info: ???104* @acquisition_data: ???105* @dsp_cfg_flags: set to 0106*/107struct iwl_phy_context_cmd_tail {108__le32 txchain_info;109__le32 rxchain_info;110__le32 acquisition_data;111__le32 dsp_cfg_flags;112} __packed;113114/**115* struct iwl_phy_context_cmd_v1 - config of the PHY context116* ( PHY_CONTEXT_CMD = 0x8 )117* @id_and_color: ID and color of the relevant Binding118* @action: action to perform, see &enum iwl_ctxt_action119* @apply_time: 0 means immediate apply and context switch.120* other value means apply new params after X usecs121* @tx_param_color: ???122* @ci: channel info123* @tail: command tail124*/125struct iwl_phy_context_cmd_v1 {126/* COMMON_INDEX_HDR_API_S_VER_1 */127__le32 id_and_color;128__le32 action;129/* PHY_CONTEXT_DATA_API_S_VER_3 */130__le32 apply_time;131__le32 tx_param_color;132struct iwl_fw_channel_info ci;133struct iwl_phy_context_cmd_tail tail;134} __packed; /* PHY_CONTEXT_CMD_API_VER_1 */135136/**137* struct iwl_phy_context_cmd - config of the PHY context138* ( PHY_CONTEXT_CMD = 0x8 )139* @id_and_color: ID and color of the relevant Binding140* @action: action to perform, see &enum iwl_ctxt_action141* @lmac_id: the lmac id the phy context belongs to142* @ci: channel info143* @rxchain_info: ???144* @sbb_bandwidth: 0 disabled, 1 - 40Mhz ... 4 - 320MHz145* @sbb_ctrl_channel_loc: location of the control channel146* @puncture_mask: bitmap of punctured subchannels147* @dsp_cfg_flags: set to 0148* @secondary_ctrl_chnl_loc: location of secondary control channel149* @reserved: reserved to align to 64 bit150*/151struct iwl_phy_context_cmd {152/* COMMON_INDEX_HDR_API_S_VER_1 */153__le32 id_and_color;154__le32 action;155/* PHY_CONTEXT_DATA_API_S_VER_3, PHY_CONTEXT_DATA_API_S_VER_4 */156struct iwl_fw_channel_info ci;157__le32 lmac_id;158union {159__le32 rxchain_info; /* reserved in _VER_4 */160struct { /* used for _VER_5/_VER_6 */161u8 sbb_bandwidth;162u8 sbb_ctrl_channel_loc;163__le16 puncture_mask; /* added in VER_6 */164};165};166__le32 dsp_cfg_flags;167u8 secondary_ctrl_chnl_loc;168u8 reserved[3];169} __packed; /* PHY_CONTEXT_CMD_API_VER_3,170* PHY_CONTEXT_CMD_API_VER_4,171* PHY_CONTEXT_CMD_API_VER_5,172* PHY_CONTEXT_CMD_API_VER_6,173* PHY_CONTEXT_CMD_API_S_VER_7174*/175176#endif /* __iwl_fw_api_phy_ctxt_h__ */177178179