Path: blob/main/sys/contrib/dev/iwlwifi/fw/api/coex.h
48426 views
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */1/*2* Copyright (C) 2023-2024 Intel Corporation3* Copyright (C) 2013-2014, 2018-2019 Intel Corporation4* Copyright (C) 2013-2014 Intel Mobile Communications GmbH5* Copyright (C) 2017 Intel Deutschland GmbH6*/7#ifndef __iwl_fw_api_coex_h__8#define __iwl_fw_api_coex_h__910#include <linux/types.h>11#include <linux/bitops.h>1213#define BITS(nb) (BIT(nb) - 1)1415enum iwl_bt_coex_lut_type {16BT_COEX_TIGHT_LUT = 0,17BT_COEX_LOOSE_LUT,18BT_COEX_TX_DIS_LUT,1920BT_COEX_MAX_LUT,21BT_COEX_INVALID_LUT = 0xff,22}; /* BT_COEX_DECISION_LUT_INDEX_API_E_VER_1 */2324#define BT_REDUCED_TX_POWER_BIT BIT(7)2526enum iwl_bt_coex_mode {27BT_COEX_DISABLE = 0x0,28BT_COEX_NW = 0x1,29BT_COEX_BT = 0x2,30BT_COEX_WIFI = 0x3,31}; /* BT_COEX_MODES_E */3233enum iwl_bt_coex_enabled_modules {34BT_COEX_MPLUT_ENABLED = BIT(0),35BT_COEX_MPLUT_BOOST_ENABLED = BIT(1),36BT_COEX_SYNC2SCO_ENABLED = BIT(2),37BT_COEX_CORUN_ENABLED = BIT(3),38BT_COEX_HIGH_BAND_RET = BIT(4),39}; /* BT_COEX_MODULES_ENABLE_E_VER_1 */4041/**42* struct iwl_bt_coex_cmd - bt coex configuration command43* @mode: &enum iwl_bt_coex_mode44* @enabled_modules: &enum iwl_bt_coex_enabled_modules45*46* The structure is used for the BT_COEX command.47*/48struct iwl_bt_coex_cmd {49__le32 mode;50__le32 enabled_modules;51} __packed; /* BT_COEX_CMD_API_S_VER_6 */5253/**54* struct iwl_bt_coex_reduced_txp_update_cmd55* @reduced_txp: bit BT_REDUCED_TX_POWER_BIT to enable / disable, rest of the56* bits are the sta_id (value)57*/58struct iwl_bt_coex_reduced_txp_update_cmd {59__le32 reduced_txp;60} __packed; /* BT_COEX_UPDATE_REDUCED_TX_POWER_API_S_VER_1 */6162/**63* struct iwl_bt_coex_ci_cmd - bt coex channel inhibition command64* @bt_primary_ci: primary channel inhibition bitmap65* @primary_ch_phy_id: primary channel PHY ID66* @bt_secondary_ci: secondary channel inhibition bitmap67* @secondary_ch_phy_id: secondary channel PHY ID68*69* Used for BT_COEX_CI command70*/71struct iwl_bt_coex_ci_cmd {72__le64 bt_primary_ci;73__le32 primary_ch_phy_id;7475__le64 bt_secondary_ci;76__le32 secondary_ch_phy_id;77} __packed; /* BT_CI_MSG_API_S_VER_2 */7879enum iwl_bt_activity_grading {80BT_OFF = 0,81BT_ON_NO_CONNECTION = 1,82BT_LOW_TRAFFIC = 2,83BT_HIGH_TRAFFIC = 3,84BT_VERY_HIGH_TRAFFIC = 4,8586BT_MAX_AG,87}; /* BT_COEX_BT_ACTIVITY_GRADING_API_E_VER_1 */8889enum iwl_bt_ci_compliance {90BT_CI_COMPLIANCE_NONE = 0,91BT_CI_COMPLIANCE_PRIMARY = 1,92BT_CI_COMPLIANCE_SECONDARY = 2,93BT_CI_COMPLIANCE_BOTH = 3,94}; /* BT_COEX_CI_COMPLIENCE_E_VER_1 */9596/**97* struct iwl_bt_coex_prof_old_notif - notification about BT coex98* @mbox_msg: message from BT to WiFi99* @msg_idx: the index of the message100* @bt_ci_compliance: enum %iwl_bt_ci_compliance101* @primary_ch_lut: LUT used for primary channel &enum iwl_bt_coex_lut_type102* @secondary_ch_lut: LUT used for secondary channel &enum iwl_bt_coex_lut_type103* @bt_activity_grading: the activity of BT &enum iwl_bt_activity_grading104* @ttc_status: is TTC enabled - one bit per PHY105* @rrc_status: is RRC enabled - one bit per PHY106* The following fields are only for version 5, and are reserved in version 4:107* @wifi_loss_low_rssi: The predicted lost WiFi rate (% of air time that BT is108* utilizing) when the RSSI is low (<= -65 dBm)109* @wifi_loss_mid_high_rssi: The predicted lost WiFi rate (% of air time that110* BT is utilizing) when the RSSI is mid/high (>= -65 dBm)111*/112struct iwl_bt_coex_prof_old_notif {113__le32 mbox_msg[4];114__le32 msg_idx;115__le32 bt_ci_compliance;116117__le32 primary_ch_lut;118__le32 secondary_ch_lut;119__le32 bt_activity_grading;120u8 ttc_status;121u8 rrc_status;122u8 wifi_loss_low_rssi;123u8 wifi_loss_mid_high_rssi;124} __packed; /* BT_COEX_PROFILE_NTFY_API_S_VER_4125* BT_COEX_PROFILE_NTFY_API_S_VER_5126*/127128/**129* enum iwl_bt_coex_subcmd_ids - coex configuration command IDs130*/131enum iwl_bt_coex_subcmd_ids {132/**133*@PROFILE_NOTIF: &struct iwl_bt_coex_profile_notif134*/135PROFILE_NOTIF = 0xFF,136};137138#define COEX_NUM_BAND 3139#define COEX_NUM_CHAINS 2140141/**142* struct iwl_bt_coex_profile_notif - notification about BT coex143* @wifi_loss_low_rssi: The predicted lost WiFi rate (% of air time that BT is144* utilizing) when the RSSI is low (<= -65 dBm)145* @wifi_loss_mid_high_rssi: The predicted lost WiFi rate (% of air time that146* BT is utilizing) when the RSSI is mid/high (>= -65 dBm)147*/148struct iwl_bt_coex_profile_notif {149u8 wifi_loss_low_rssi[COEX_NUM_BAND][COEX_NUM_CHAINS];150u8 wifi_loss_mid_high_rssi[COEX_NUM_BAND][COEX_NUM_CHAINS];151} __packed; /* BT_COEX_BT_PROFILE_NTF_API_S_VER_1 */152153#endif /* __iwl_fw_api_coex_h__ */154155156