blob: 42d325b583b2d1885d3aacdbbd8ee92cc0a41271 [file] [log] [blame]
/* SPDX-License-Identifier: ISC */
/*
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
*/
#ifndef ATH11K_VENDOR_H
#define ATH11K_VENDOR_H
#define QCA_NL80211_VENDOR_ID 0x001374
#define QCA_NL80211_VENDOR_SUBCMD_AFC_EVENT_INDEX 100
#define QCA_NL80211_AFC_REQ_RESP_BUF_MAX_SIZE 5000
#define QCA_WLAN_AFC_RESP_DESC_FIELD_START_OCTET 14
#define QCA_WLAN_AFC_RESP_DESC_FIELD_END_OCTET 30
enum qca_nl80211_vendor_subcmds {
/* Wi-Fi configuration subcommand */
QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION = 74,
/* QCA_NL80211_VENDOR_SUBCMD_BTCOEX_CONFIG: This command is used to
* enable/disable BTCOEX and set priority for different type of WLAN
* traffic over BT low priority traffic. This uses attributes in
* enum qca-vendor_attr_btcoex_config.
*/
QCA_NL80211_VENDOR_SUBCMD_BTCOEX_CONFIG = 182,
/* AFC event id subcommand */
QCA_NL80211_VENDOR_SUBCMD_AFC_EVENT = 400,
QCA_NL80211_VENDOR_SUBCMD_AFC_RESPONSE = 401,
};
/*
* enum qca_wlan_priority_type - priority mask
* This enum defines priority mask that user can configure
* over BT traffic type which can be passed through
* QCA_WLAN_VENDOR_ATTR_BTCOEX_CONFIG_WLAN_PRIORITY attribute.
*
* @QCA_WLAN_PRIORITY_BE: Bit mask for WLAN Best effort traffic
* @QCA_WLAN_PRIORITY_BK: Bit mask for WLAN Background traffic
* @QCA_WLAN_PRIORITY_VI: Bit mask for WLAN Video traffic
* @QCA_WLAN_PRIORITY_VO: Bit mask for WLAN Voice traffic
* @QCA_WLAN_PRIORITY_BEACON: Bit mask for WLAN BEACON frame
* @QCA_WLAN_PRIORITY_MGMT: Bit mask for WLAN Management frame
*/
enum qca_wlan_priority_type {
QCA_WLAN_PRIORITY_BE = BIT(0),
QCA_WLAN_PRIORITY_BK = BIT(1),
QCA_WLAN_PRIORITY_VI = BIT(2),
QCA_WLAN_PRIORITY_VO = BIT(3),
QCA_WLAN_PRIORITY_BEACON = BIT(4),
QCA_WLAN_PRIORITY_MGMT = BIT(5),
};
/**
* enum qca_wlan_vendor_attr_wlan_prio - Used to configure
* WLAN priority mask and its respective weight value.
* @QCA_WLAN_VENDOR_ATTR_WLAN_PRIO_MASK - This is u8 attribute
* used to pass traffic type mask value see %qca_wlan_priority_type
* @QCA_WLAN_VENDOR_ATTR_WLAN_PRIO_WEIGHT - This is u8 attribute
* accepts value between 0 and 255 and used to configure weight for
* traffic type mentioned in %QCA_WLAN_VENDOR_ATTR_WLAN_PRIO_MASK.
*/
enum qca_wlan_vendor_attr_wlan_prio {
QCA_WLAN_VENDOR_ATTR_WLAN_PRIO_INVALID = 0,
QCA_WLAN_VENDOR_ATTR_WLAN_PRIO_MASK = 1,
QCA_WLAN_VENDOR_ATTR_WLAN_PRIO_WEIGHT = 2,
QCA_WLAN_VENDOR_ATTR_WLAN_PRIO_LAST,
QCA_WLAN_VENDOR_ATTR_WLAN_PRIO_MAX =
QCA_WLAN_VENDOR_ATTR_WLAN_PRIO_LAST - 1,
};
/* Attributes for data used by
* QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION
*/
enum qca_wlan_vendor_attr_config {
QCA_WLAN_VENDOR_ATTR_CONFIG_GTX = 57,
/* keep last */
QCA_WLAN_VENDOR_ATTR_CONFIG_AFTER_LAST,
QCA_WLAN_VENDOR_ATTR_CONFIG_MAX =
QCA_WLAN_VENDOR_ATTR_CONFIG_AFTER_LAST - 1,
};
/**
* enum qca_wlan_vendor_attr_btcoex_config - Used by the vendor command
* The use can enable/disable BTCOEX and configure WLAN priority for
* different traffic type over BT.
* QCA_WLAN_VENDOR_ATTR_BTCOEX_CONFIG_ENABLE, enable/disable BTCOEX
* QCA_WLAN_VENDOR_ATTR_BTCOEX_CONFIG_WLAN_PRIORITY, This is a nested
* attribute pass the attributes in %qca_wlan_vendor_attr_wlan_prio.
*/
enum qca_wlan_vendor_attr_btcoex_config {
QCA_WLAN_VENDOR_ATTR_BTCOEX_CONFIG_INVALID = 0,
QCA_WLAN_VENDOR_ATTR_BTCOEX_CONFIG_ENABLE = 1,
QCA_WLAN_VENDOR_ATTR_BTCOEX_CONFIG_WLAN_PRIORITY = 2,
/* keep last */
QCA_WLAN_VENDOR_ATTR_BTCOEX_CONFIG_LAST,
QCA_WLAN_VENDOR_ATTR_BTCOEX_CONFIG_MAX =
QCA_WLAN_VENDOR_ATTR_BTCOEX_CONFIG_LAST - 1
};
struct ath11k_afc_host_resp {
u32 header;
u32 status;
u32 time_to_live;
u32 length;
u32 resp_format;
u8 afc_resp[0];
};
/* enum qca_nl_afc_resp_type: Defines the format in which user space
* application will send over the AFC response to driver.
*/
enum ath11k_nl_afc_resp_type {
QCA_WLAN_VENDOR_ATTR_AFC_JSON_RESP,
QCA_WLAN_VENDOR_ATTR_AFC_BIN_RESP,
};
enum qca_wlan_vendor_afc_event_attr {
QCA_WLAN_VENDOR_ATTR_AFC_EVENT_TYPE = 1,
QCA_WLAN_VENDOR_ATTR_AFC_EVENT_DATA,
QCA_WLAN_VENDOR_ATTR_AFC_EVENT_MAX,
};
enum qca_wlan_vendor_afc_response_attr {
QCA_WLAN_VENDOR_ATTR_AFC_RESPONSE_DATA_TYPE = 1,
QCA_WLAN_VENDOR_ATTR_AFC_RESPONSE_DATA,
QCA_WLAN_VENDOR_ATTR_AFC_RESPONSE_MAX,
};
enum qca_nl_afc_event_type {
QCA_WLAN_VENDOR_AFC_EXPIRY_EVENT,
QCA_WLAN_VENDOR_AFC_POWER_UPDATE_COMPLETE_EVENT,
};
int ath11k_vendor_register(struct ath11k *ar);
int ath11k_send_afc_start(struct ath11k *ar, struct ath11k_afc_req_fixed_params *afc_data);
int ath11k_send_power_update_complete(struct ath11k *ar);
#endif /* QCA_VENDOR_H */