diff options
author | Xin Li <delphij@google.com> | 2019-09-05 16:53:34 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-09-05 16:53:34 +0000 |
commit | 180ce9e724d5a2097da24af214b2d4dc12a34f51 (patch) | |
tree | 540bf2e4e54cde24cdf554524bed4293990dea54 | |
parent | 80441c10e00eb4b73d53558aae124b27cf2e3660 (diff) | |
parent | 465ba7cca53e94a44a216d0ee75b7d22f7e93f37 (diff) | |
download | wlan-180ce9e724d5a2097da24af214b2d4dc12a34f51.tar.gz |
Merge "DO NOT MERGE - Merge Android 10 into master"ndk-sysroot-r21
32 files changed, 3789 insertions, 651 deletions
@@ -1,2 +1,3 @@ etancohen@google.com +kumaranand@google.com rpius@google.com diff --git a/qcwcn/wcnss-service/wcnss_service.c b/qcwcn/wcnss-service/wcnss_service.c index f3eacb9..f0c82ea 100644 --- a/qcwcn/wcnss-service/wcnss_service.c +++ b/qcwcn/wcnss-service/wcnss_service.c @@ -61,11 +61,11 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define WCNSS_CAL_CHUNK (3*1024) -#define WCNSS_CAL_FILE "/data/misc/wifi/WCNSS_qcom_wlan_cal.bin" -#define WCNSS_FACT_FILE "/data/misc/wifi/WCN_FACTORY" +#define WCNSS_CAL_FILE "/data/vendor/wifi/WCNSS_qcom_wlan_cal.bin" +#define WCNSS_FACT_FILE "/data/vendor/wifi/WCN_FACTORY" #define WCNSS_DEVICE "/dev/wcnss_wlan" #define WCNSS_CTRL "/dev/wcnss_ctrl" -#define WLAN_INI_FILE_DEST "/data/misc/wifi/WCNSS_qcom_cfg.ini" +#define WLAN_INI_FILE_DEST "/data/vendor/wifi/WCNSS_qcom_cfg.ini" #define WLAN_INI_FILE_SOURCE "/vendor/etc/wifi/WCNSS_qcom_cfg.ini" #define WCNSS_HAS_CAL_DATA\ "/sys/module/wcnsscore/parameters/has_calibrated_data" diff --git a/qcwcn/wifi_hal/common.h b/qcwcn/wifi_hal/common.h index a67ef83..759ae01 100644 --- a/qcwcn/wifi_hal/common.h +++ b/qcwcn/wifi_hal/common.h @@ -46,6 +46,7 @@ #include "rb_wrapper.h" #include "pkt_stats.h" #include "wifihal_internal.h" +#include "qca-vendor_copy.h" #define SOCKET_BUFFER_SIZE (32768U) #define RECV_BUF_SIZE (4096) @@ -88,6 +89,18 @@ typedef struct { wifi_roaming_capabilities roaming_capa; } wifi_capa; +typedef struct { + u8 *flags; + size_t flags_len; +} features_info; + +enum pkt_log_version { + PKT_LOG_V0 = 0, // UNSPECIFIED Target + PKT_LOG_V1 = 1, // ROME Base Target + PKT_LOG_V2 = 2, // HELIUM Base Target + PKT_LOG_V3 = 3, // LETHIUM Base target +}; + struct gscan_event_handlers_s; struct rssi_monitor_event_handler_s; struct cld80211_ctx; @@ -114,9 +127,13 @@ typedef struct hal_info_s { int num_interfaces; // number of interfaces feature_set supported_feature_set; + /* driver supported features defined by enum qca_wlan_vendor_features that + can be queried by vendor command QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES */ + features_info driver_supported_features; u32 supported_logger_feature_set; // add other details int user_sock_arg; + int event_sock_arg; struct rb_info rb_infos[NUM_RING_BUFS]; void (*on_ring_buffer_data) (char *ring_name, char *buffer, int buffer_size, wifi_ring_buffer_status *status); @@ -145,6 +162,7 @@ typedef struct hal_info_s { wifi_capa capa; struct cld80211_ctx *cldctx; bool apf_enabled; + pkt_log_version pkt_log_ver; } hal_info; wifi_error wifi_register_handler(wifi_handle handle, int cmd, nl_recvmsg_msg_cb_t func, void *arg); @@ -168,8 +186,8 @@ wifi_error cleanupRSSIMonitorHandler(hal_info *info); lowi_cb_table_t *getLowiCallbackTable(u32 requested_lowi_capabilities); wifi_error wifi_start_sending_offloaded_packet(wifi_request_id id, - wifi_interface_handle iface, u8 *ip_packet, u16 ip_packet_len, - u8 *src_mac_addr, u8 *dst_mac_addr, u32 period_msec); + wifi_interface_handle iface, u16 ether_type, u8 *ip_packet, + u16 ip_packet_len, u8 *src_mac_addr, u8 *dst_mac_addr, u32 period_msec); wifi_error wifi_stop_sending_offloaded_packet(wifi_request_id id, wifi_interface_handle iface); wifi_error wifi_start_rssi_monitoring(wifi_request_id id, wifi_interface_handle diff --git a/qcwcn/wifi_hal/gscan.cpp b/qcwcn/wifi_hal/gscan.cpp index 46e0f89..22910dc 100644 --- a/qcwcn/wifi_hal/gscan.cpp +++ b/qcwcn/wifi_hal/gscan.cpp @@ -25,8 +25,11 @@ #include "cpp_bindings.h" #include "gscancommand.h" #include "gscan_event_handler.h" +#include "vendor_definitions.h" #define GSCAN_EVENT_WAIT_TIME_SECONDS 4 +#define WIFI_SCANNING_MAC_OUI_LENGTH 3 +#define EPNO_NO_NETWORKS 0 /* BSSID blacklist */ typedef struct { diff --git a/qcwcn/wifi_hal/gscan_event_handler.cpp b/qcwcn/wifi_hal/gscan_event_handler.cpp index 7475a32..05f8a80 100644 --- a/qcwcn/wifi_hal/gscan_event_handler.cpp +++ b/qcwcn/wifi_hal/gscan_event_handler.cpp @@ -18,7 +18,6 @@ #include <utils/Log.h> #include "gscan_event_handler.h" -#include "vendor_definitions.h" /* This function implements creation of Vendor command event handler. */ wifi_error GScanCommandEventHandler::create() { diff --git a/qcwcn/wifi_hal/gscancommand.h b/qcwcn/wifi_hal/gscancommand.h index 6fb488d..dc48ef6 100644 --- a/qcwcn/wifi_hal/gscancommand.h +++ b/qcwcn/wifi_hal/gscancommand.h @@ -26,7 +26,6 @@ #define PRINTF_FORMAT(a,b) #define STRUCT_PACKED #endif -#include "vendor_definitions.h" #include "gscan.h" #ifdef __cplusplus diff --git a/qcwcn/wifi_hal/ifaceeventhandler.cpp b/qcwcn/wifi_hal/ifaceeventhandler.cpp index 54845c0..8750999 100644 --- a/qcwcn/wifi_hal/ifaceeventhandler.cpp +++ b/qcwcn/wifi_hal/ifaceeventhandler.cpp @@ -205,11 +205,16 @@ WifihalGeneric::WifihalGeneric(wifi_handle handle, int id, u32 vendor_id, mCapa = &(info->capa); mfilter_packet_read_buffer = NULL; mfilter_packet_length = 0; + memset(&mDriverFeatures, 0, sizeof(mDriverFeatures)); } WifihalGeneric::~WifihalGeneric() { mCapa = NULL; + if (mDriverFeatures.flags != NULL) { + free(mDriverFeatures.flags); + mDriverFeatures.flags = NULL; + } } wifi_error WifihalGeneric::requestResponse() @@ -243,6 +248,23 @@ int WifihalGeneric::handleResponse(WifiEvent &reply) break; } + case QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES: + { + struct nlattr *attr; + struct nlattr *tb_vendor[QCA_WLAN_VENDOR_ATTR_MAX + 1]; + nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_MAX, + (struct nlattr *)mVendorData, mDataLen, NULL); + attr = tb_vendor[QCA_WLAN_VENDOR_ATTR_FEATURE_FLAGS]; + if (attr) { + int len = nla_len(attr); + mDriverFeatures.flags = (u8 *)malloc(len); + if (mDriverFeatures.flags != NULL) { + memcpy(mDriverFeatures.flags, nla_data(attr), len); + mDriverFeatures.flags_len = len; + } + } + break; + } case QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX: { struct nlattr *tb_vendor[ @@ -303,11 +325,11 @@ int WifihalGeneric::handleResponse(WifiEvent &reply) } else { /* * The older drivers may not send PACKET_FILTER_SUB_CMD as - * they support QCA_WLAN_GET_PACKET_FILTER_SIZE only. + * they support QCA_WLAN_GET_PACKET_FILTER only. */ - subCmd = QCA_WLAN_GET_PACKET_FILTER_SIZE; + subCmd = QCA_WLAN_GET_PACKET_FILTER; } - if (subCmd == QCA_WLAN_GET_PACKET_FILTER_SIZE) { + if (subCmd == QCA_WLAN_GET_PACKET_FILTER) { if (!tb_vendor[QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_VERSION]) { ALOGE("%s: QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_VERSION" @@ -318,14 +340,14 @@ int WifihalGeneric::handleResponse(WifiEvent &reply) tb_vendor[QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_VERSION]); ALOGV("Current version : %u", filterVersion); - if (!tb_vendor[QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_TOTAL_LENGTH]) + if (!tb_vendor[QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_SIZE]) { - ALOGE("%s: QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_TOTAL_LENGTH" + ALOGE("%s: QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_SIZE" " not found", __FUNCTION__); return -EINVAL; } filterLength = nla_get_u32( - tb_vendor[QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_TOTAL_LENGTH]); + tb_vendor[QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_SIZE]); ALOGV("Max filter length Supported : %u", filterLength); } else if (subCmd == QCA_WLAN_READ_PACKET_FILTER) { @@ -543,6 +565,25 @@ void WifihalGeneric::getResponseparams(feature_set *pset) *pset = mSet; } +void WifihalGeneric::getDriverFeatures(features_info *pfeatures) +{ + if (!pfeatures) + return; + + if (mDriverFeatures.flags != NULL) { + pfeatures->flags = (u8 *)malloc(mDriverFeatures.flags_len); + if (pfeatures->flags) { + memcpy(pfeatures->flags, mDriverFeatures.flags, + mDriverFeatures.flags_len); + pfeatures->flags_len = mDriverFeatures.flags_len; + return; + } + } + + pfeatures->flags_len = 0; + pfeatures->flags = NULL; +} + void WifihalGeneric::setMaxSetSize(int set_size_max) { mSetSizeMax = set_size_max; } diff --git a/qcwcn/wifi_hal/ifaceeventhandler.h b/qcwcn/wifi_hal/ifaceeventhandler.h index cdbd59d..c993a7e 100644 --- a/qcwcn/wifi_hal/ifaceeventhandler.h +++ b/qcwcn/wifi_hal/ifaceeventhandler.h @@ -83,6 +83,7 @@ class WifihalGeneric: public WifiVendorCommand { private: feature_set mSet; + features_info mDriverFeatures; int mSetSizeMax; int *mSetSizePtr; feature_set *mConcurrencySet; @@ -101,6 +102,7 @@ public: virtual wifi_error requestResponse(); virtual int handleResponse(WifiEvent &reply); virtual void getResponseparams(feature_set *pset); + virtual void getDriverFeatures(features_info *pfeatures); virtual void setMaxSetSize(int set_size_max); virtual void setSizePtr(int *set_size); virtual void setPacketBufferParams(u8 *host_packet_buffer, int packet_length); diff --git a/qcwcn/wifi_hal/llstats.cpp b/qcwcn/wifi_hal/llstats.cpp index 578b7a8..e12b61f 100644 --- a/qcwcn/wifi_hal/llstats.cpp +++ b/qcwcn/wifi_hal/llstats.cpp @@ -24,7 +24,6 @@ #include "common.h" #include "cpp_bindings.h" #include "llstatscommand.h" -#include "vendor_definitions.h" //Singleton Static Instance LLStatsCommand* LLStatsCommand::mLLStatsCommandInstance = NULL; diff --git a/qcwcn/wifi_hal/nan.cpp b/qcwcn/wifi_hal/nan.cpp index fb0e2d3..549b381 100644 --- a/qcwcn/wifi_hal/nan.cpp +++ b/qcwcn/wifi_hal/nan.cpp @@ -1219,8 +1219,8 @@ int NanCommand::handleEvent(WifiEvent &event) } else if (mSubcmd == QCA_NL80211_VENDOR_SUBCMD_NDP) { // Parse the vendordata and get the NAN attribute u32 ndpCmdType; - struct nlattr *tb_vendor[QCA_WLAN_VENDOR_ATTR_NDP_AFTER_LAST + 1]; - nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_NDP_MAX, + struct nlattr *tb_vendor[QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX + 1]; + nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX, (struct nlattr *)mVendorData, mDataLen, NULL); @@ -1245,7 +1245,7 @@ int NanCommand::handleEvent(WifiEvent &event) case QCA_WLAN_VENDOR_ATTR_NDP_END_RESPONSE: handleNdpResponse(NAN_DP_END, tb_vendor); break; - case QCA_WLAN_VENDOR_ATTR_NDP_DATA_REQUEST_IND: + case QCA_WLAN_VENDOR_ATTR_NDP_REQUEST_IND: case QCA_WLAN_VENDOR_ATTR_NDP_CONFIRM_IND: case QCA_WLAN_VENDOR_ATTR_NDP_END_IND: case QCA_WLAN_VENDOR_ATTR_NDP_SCHEDULE_UPDATE_IND: diff --git a/qcwcn/wifi_hal/nan_cert.h b/qcwcn/wifi_hal/nan_cert.h index 040471a..85b7073 100644 --- a/qcwcn/wifi_hal/nan_cert.h +++ b/qcwcn/wifi_hal/nan_cert.h @@ -36,7 +36,10 @@ extern "C" { #endif /* __cplusplus */ -#define NAN_CERT_VERSION 4 +#ifndef PACKED +#define PACKED __attribute__((packed)) +#endif +#define NAN_CERT_VERSION 5 #define NAN_MAX_DEBUG_MESSAGE_DATA_LEN 100 #define NAN_MAX_ALLOWED_DW_AWAKE_INTERVAL 16 @@ -97,6 +100,18 @@ typedef enum { NAN_DEVICE_TYPE_DUT = 2 } NanDeviceType; +/* NAN NDPE absent or present */ +typedef enum { + NAN_NDPE_ATTR_PRESENT = 0, + NAN_NDPE_ATTR_ABSENT = 1 +} NanNdpeAttrType; + +/* NAN NDP absent or present */ +typedef enum { + NAN_NDP_ATTR_ABSENT = 0, + NAN_NDP_ATTR_PRESENT = 1 +} NanNdpAttrType; + /* * Definitions of debug subcommand type for the * generic debug command. @@ -115,7 +130,9 @@ typedef enum { NAN_TEST_MODE_CMD_NAN_SCHED_UPDATE_NDL_NOTIFY = 11, NAN_TEST_MODE_CMD_NAN_AVAILABILITY_MAP_ORDER = 12, NAN_TEST_MODE_CMD_CONFIG_QOS = 13, - NAN_TEST_MODE_CMD_DEVICE_TYPE = 14 + NAN_TEST_MODE_CMD_DEVICE_TYPE = 14, + NAN_TEST_MODE_CMD_DISABLE_NDPE = 15, + NAN_TEST_MODE_CMD_ENABLE_NDP = 16, } NanDebugModeCmd; /* diff --git a/qcwcn/wifi_hal/nan_i.h b/qcwcn/wifi_hal/nan_i.h index 8cfd8b1..78cdb1a 100644 --- a/qcwcn/wifi_hal/nan_i.h +++ b/qcwcn/wifi_hal/nan_i.h @@ -169,6 +169,7 @@ typedef enum NAN_TLV_TYPE_NAN20_RANGING_REQUEST_RECEIVED = 26, NAN_TLV_TYPE_NAN_PASSPHRASE = 27, NAN_TLV_TYPE_SDEA_SERVICE_SPECIFIC_INFO = 28, + NAN_TLV_TYPE_DEV_CAP_ATTR_CAPABILITY = 29, NAN_TLV_TYPE_SDF_LAST = 4095, /* Configuration types */ @@ -432,6 +433,16 @@ typedef struct PACKED u8 ptlv[]; } NanPublishRepliedIndMsg, *pNanPublishRepliedIndMsg; +/* NAN Device Capability Attribute */ +typedef struct PACKED +{ + u32 dfs_master:1; + u32 ext_key_id:1; + u32 simu_ndp_data_recept:1; + u32 ndpe_attr_supp:1; + u32 reserved:28; +} NanDevCapAttrCap, *pNanDevCapAttrCap; + /* NAN Subscribe Service Req */ typedef struct PACKED { @@ -1048,7 +1059,10 @@ typedef struct PACKED u32 max_scid_len; u32 is_ndp_security_supported:1; u32 max_sdea_service_specific_info_len:16; - u32 reserved:15; + u32 reserved1:5; + u32 reserved2:5; + u32 ndpe_attr_supported:1; + u32 reserved:4; u32 max_subscribe_address; } NanCapabilitiesRspMsg, *pNanCapabilitiesRspMsg; diff --git a/qcwcn/wifi_hal/nan_ind.cpp b/qcwcn/wifi_hal/nan_ind.cpp index 00e3410..f661ed3 100644 --- a/qcwcn/wifi_hal/nan_ind.cpp +++ b/qcwcn/wifi_hal/nan_ind.cpp @@ -968,7 +968,7 @@ int NanCommand::handleNdpIndication(u32 ndpCmdType, struct nlattr **tb_vendor) ALOGI("handleNdpIndication msg_id:%u", ndpCmdType); switch (ndpCmdType) { - case QCA_WLAN_VENDOR_ATTR_NDP_DATA_REQUEST_IND: + case QCA_WLAN_VENDOR_ATTR_NDP_REQUEST_IND: NanDataPathRequestInd ndpRequestInd; memset(&ndpRequestInd, 0, sizeof(ndpRequestInd)); @@ -1177,11 +1177,11 @@ int NanCommand::getNdpConfirm(struct nlattr **tb_vendor, rem = nla_len(tb_vendor[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_INFO]); (i < NAN_MAX_CHANNEL_INFO_SUPPORTED && nla_ok(chInfo, rem)); chInfo = nla_next(chInfo, &(rem))) { - struct nlattr *tb2[QCA_WLAN_VENDOR_ATTR_NDP_MAX + 1]; + struct nlattr *tb2[QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX + 1]; pChInfo = (NanChannelInfo *) ((u8 *)event->channel_info + (i++ * (sizeof(NanChannelInfo)))); - nla_parse(tb2, QCA_WLAN_VENDOR_ATTR_NDP_MAX, + nla_parse(tb2, QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX, (struct nlattr *) nla_data(chInfo), nla_len(chInfo), NULL); if (!tb2[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL]) { @@ -1231,11 +1231,11 @@ int NanCommand::getNdpScheduleUpdate(struct nlattr **tb_vendor, rem = nla_len(tb_vendor[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_INFO]); (i < NAN_MAX_CHANNEL_INFO_SUPPORTED && nla_ok(chInfo, rem)); chInfo = nla_next(chInfo, &(rem))) { - struct nlattr *tb2[QCA_WLAN_VENDOR_ATTR_NDP_MAX + 1]; + struct nlattr *tb2[QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX + 1]; pChInfo = (NanChannelInfo *) ((u8 *)event->channel_info + (i++ * (sizeof(NanChannelInfo)))); - nla_parse(tb2, QCA_WLAN_VENDOR_ATTR_NDP_MAX, + nla_parse(tb2, QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX, (struct nlattr *) nla_data(chInfo), nla_len(chInfo), NULL); if (!tb2[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL]) { diff --git a/qcwcn/wifi_hal/nan_req.cpp b/qcwcn/wifi_hal/nan_req.cpp index 8ab3a51..fd8516f 100644 --- a/qcwcn/wifi_hal/nan_req.cpp +++ b/qcwcn/wifi_hal/nan_req.cpp @@ -159,6 +159,10 @@ wifi_error NanCommand::putNanEnable(transaction_id id, const NanEnableRequest *p ( pReq->config_dw_early_termination ? (SIZEOF_TLV_HDR + \ sizeof(u32)) : 0 \ + ) + \ + ( + pReq->config_ndpe_attr? (SIZEOF_TLV_HDR + \ + sizeof(NanDevCapAttrCap)) : 0 \ ); pNanEnableReqMsg pFwReq = (pNanEnableReqMsg)malloc(message_len); @@ -337,7 +341,14 @@ wifi_error NanCommand::putNanEnable(transaction_id id, const NanEnableRequest *p tlvs = addTlv(NAN_TLV_TYPE_DW_EARLY_TERMINATION, sizeof(u32), (const u8*)&pReq->enable_dw_termination, tlvs); } - + if (pReq->config_ndpe_attr) { + NanDevCapAttrCap nanDevCapAttr; + memset(&nanDevCapAttr, 0, sizeof(nanDevCapAttr)); + nanDevCapAttr.ndpe_attr_supp = pReq->use_ndpe_attr; + tlvs = addTlv(NAN_TLV_TYPE_DEV_CAP_ATTR_CAPABILITY, + sizeof(NanDevCapAttrCap), + (const u8*)&nanDevCapAttr, tlvs); + } mVendorData = (char*)pFwReq; mDataLen = message_len; @@ -475,6 +486,10 @@ wifi_error NanCommand::putNanConfig(transaction_id id, const NanConfigRequest *p ( pReq->config_dw_early_termination ? (SIZEOF_TLV_HDR + \ sizeof(u32)) : 0 \ + ) + \ + ( + pReq->config_ndpe_attr? (SIZEOF_TLV_HDR + \ + sizeof(NanDevCapAttrCap)) : 0 \ ); if (pReq->num_config_discovery_attr) { @@ -606,7 +621,6 @@ wifi_error NanCommand::putNanConfig(transaction_id id, const NanConfigRequest *p tlvs = addTlv(NAN_TLV_TYPE_CONFIG_DISCOVERY_INDICATIONS, sizeof(u32), (const u8*)&config_discovery_indications, tlvs); - if (pReq->config_nss) { tlvs = addTlv(NAN_TLV_TYPE_TX_RX_CHAINS, sizeof(u32), (const u8*)&pReq->nss, tlvs); @@ -619,6 +633,14 @@ wifi_error NanCommand::putNanConfig(transaction_id id, const NanConfigRequest *p tlvs = addTlv(NAN_TLV_TYPE_DW_EARLY_TERMINATION, sizeof(u32), (const u8*)&pReq->enable_dw_termination, tlvs); } + if (pReq->config_ndpe_attr) { + NanDevCapAttrCap nanDevCapAttr; + memset(&nanDevCapAttr, 0, sizeof(nanDevCapAttr)); + nanDevCapAttr.ndpe_attr_supp = pReq->use_ndpe_attr; + tlvs = addTlv(NAN_TLV_TYPE_DEV_CAP_ATTR_CAPABILITY, + sizeof(NanDevCapAttrCap), + (const u8*)&nanDevCapAttr, tlvs); + } mVendorData = (char*)pFwReq; mDataLen = message_len; @@ -922,7 +944,6 @@ wifi_error NanCommand::putNanSubscribe(transaction_id id, message_len += \ (pReq->num_intf_addr_present * (SIZEOF_TLV_HDR + NAN_MAC_ADDR_LEN)); - if ((pReq->key_info.key_type == NAN_SECURITY_KEY_INPUT_PMK) && (pReq->key_info.body.pmk_info.pmk_len == NAN_PMK_INFO_LEN)) message_len += SIZEOF_TLV_HDR + NAN_PMK_INFO_LEN; @@ -934,7 +955,6 @@ wifi_error NanCommand::putNanSubscribe(transaction_id id, message_len += SIZEOF_TLV_HDR + pReq->key_info.body.passphrase_info.passphrase_len; - pNanSubscribeServiceReqMsg pFwReq = (pNanSubscribeServiceReqMsg)malloc(message_len); if (pFwReq == NULL) { cleanup(); diff --git a/qcwcn/wifi_hal/nan_rsp.cpp b/qcwcn/wifi_hal/nan_rsp.cpp index 4160ee1..721ab49 100644 --- a/qcwcn/wifi_hal/nan_rsp.cpp +++ b/qcwcn/wifi_hal/nan_rsp.cpp @@ -609,6 +609,8 @@ int NanCommand::getNanResponse(transaction_id *id, NanResponseMsg *pRsp) pFwRsp->max_sdea_service_specific_info_len; pRsp->body.nan_capabilities.max_subscribe_address = \ pFwRsp->max_subscribe_address; + pRsp->body.nan_capabilities.ndpe_attr_supported = \ + pFwRsp->ndpe_attr_supported; break; } default: @@ -760,6 +762,7 @@ void NanCommand::handleNanStatsResponse(NanStatsType stats_type, dw_stats.validActionFrames = pMacStats->validActionFrames; dw_stats.validBeaconFrames = pMacStats->validBeaconFrames; dw_stats.ignoredActionFrames = pMacStats->ignoredActionFrames; + dw_stats.ignoredBeaconFrames = pMacStats->ignoredBeaconFrames; dw_stats.invalidFrames = pMacStats->invalidFrames; dw_stats.invalidActionFrames = pMacStats->invalidActionFrames; dw_stats.invalidBeaconFrames = pMacStats->invalidBeaconFrames; @@ -789,6 +792,7 @@ void NanCommand::handleNanStatsResponse(NanStatsType stats_type, mac_stats.validActionFrames = pMacStats->validActionFrames; mac_stats.validBeaconFrames = pMacStats->validBeaconFrames; mac_stats.ignoredActionFrames = pMacStats->ignoredActionFrames; + mac_stats.ignoredBeaconFrames = pMacStats->ignoredBeaconFrames; mac_stats.invalidFrames = pMacStats->invalidFrames; mac_stats.invalidActionFrames = pMacStats->invalidActionFrames; mac_stats.invalidBeaconFrames = pMacStats->invalidBeaconFrames; diff --git a/qcwcn/wifi_hal/nancommand.h b/qcwcn/wifi_hal/nancommand.h index b25fec9..8a16248 100644 --- a/qcwcn/wifi_hal/nancommand.h +++ b/qcwcn/wifi_hal/nancommand.h @@ -20,7 +20,6 @@ #include "common.h" #include "cpp_bindings.h" #include "wifi_hal.h" -#include "vendor_definitions.h" #include "nan_cert.h" class NanCommand : public WifiVendorCommand diff --git a/qcwcn/wifi_hal/pkt_stats.h b/qcwcn/wifi_hal/pkt_stats.h index d1cc71a..7cc64b8 100644 --- a/qcwcn/wifi_hal/pkt_stats.h +++ b/qcwcn/wifi_hal/pkt_stats.h @@ -50,6 +50,9 @@ #define BW_OFFSET 8 #define INVALID_RSSI 255 +/* Based on pkt log V2, this type of event will triggered */ +#define PKTLOG_TYPE_PKT_SW_EVENT 10 + #define PKT_INFO_FLG_TX_LOCAL_S 0x1 #define PKT_INFO_FLG_RX_HOST_RXD 0x2 #define PKT_INFO_FLG_TX_REMOTE_S 0x4 @@ -63,6 +66,30 @@ #define PKT_INFO_FLG_UNKNOWN_S 0x400 #define PKT_INFO_FLG_PKT_DUMP_V2 0x8000 +/* Depend on packet log version V2 this + * offset are define, for more info need to + * check from firmware side. + */ +#define TX_SUCCESS_TMS_OFFSET 56 +#define LINK_LAYER_TX_SQN_OFFSET 66 +#define RATE_CODE_OFFSET 68 +#define TX_STATUS_OFFSET 70 +#define TX_RSSI_OFFSET 71 +#define NO_RETRIES_OFFSET 75 +#define EXT_FLAGS_OFFSET 76 +#define BMAP_FAILED_OFFSET 84 +#define BMAP_ENQUEUED_OFFSET 92 +#define FRAME_CTRL_OFFSET 216 +#define QOS_CTRL_OFFSET 218 + +/* MAX HT/VHT mcs index */ +#define MAX_VHT_MCS_IDX 10 +#define MAX_HT_MCS_IDX 8 + +/* MAX CCK/OFDM rate index */ +#define MAX_CCK_MCS_IDX 4 +#define MAX_OFDM_MCS_IDX 8 + /* MASK value of flags based on RX_STAT content. * These are the events that carry Rx decriptor */ @@ -86,7 +113,8 @@ typedef struct { typedef struct { u16 flags; u16 missed_cnt; - u16 log_type; + u16 log_type : 8; //[7:0] + u16 mac_id : 8; //[15:8] u16 size; u32 timestamp; u32 reserved; @@ -158,6 +186,24 @@ struct rx_mpdu_end { u32 fcs_err : 1; //[31] } __attribute__((packed)); +/* structure implemented w.r.t PKT_LOG_V2 Version */ +struct rx_msdu_start_v1 { + u32 reserved1[2]; + u32 reserved2 : 8; //[7:0] + u32 decap_format : 2; //[9:8] + u32 reserved3 : 22; //[31:10] + u32 reserved4[2]; +} __attribute__((packed)); + +struct rx_msdu_end_v1 { + u32 reserved1[4]; + u32 reserved2 : 15; //[14:0] + u32 last_msdu : 1; //[15] + u32 reserved3 : 16; //[31:16] + u32 reserved4[9]; +} __attribute__((packed)); +/************************************************************/ + #define PREAMBLE_L_SIG_RATE 0x04 #define PREAMBLE_VHT_SIG_A_1 0x08 #define PREAMBLE_VHT_SIG_A_2 0x0c @@ -195,9 +241,18 @@ struct rx_ppdu_end { u32 reserved2[5]; } __attribute__((packed)); +struct rx_ppdu_end_V1 { + u32 reserved1[18]; + u32 wb_timestamp_lower_32; + u32 reserved2[18]; +} __attribute__((packed)); + #define MAX_MSDUS_PER_MPDU 3 #define MAX_RXMPDUS_PER_AMPDU 64 #define RX_HTT_HDR_STATUS_LEN 64 +/* RX Data length is 256 for PKT_LOG_V2 Version */ +#define RX_HTT_HDR_STATUS_LEN_V1 256 + typedef struct { struct rx_attention attention; u32 reserved1; @@ -210,6 +265,20 @@ typedef struct { char rx_hdr_status[RX_HTT_HDR_STATUS_LEN]; }__attribute__((packed)) rb_pkt_stats_t; +/* structure implemented w.r.t PKT_LOG_V2 Version */ +typedef struct { + struct rx_attention attention; + u32 reserved1[2]; + struct rx_mpdu_start mpdu_start; + struct rx_msdu_start_v1 msdu_start; + struct rx_msdu_end_v1 msdu_end; + struct rx_mpdu_end mpdu_end; + struct rx_ppdu_start ppdu_start; + struct rx_ppdu_end_V1 ppdu_end; + char rx_hdr_status[RX_HTT_HDR_STATUS_LEN_V1]; +}__attribute__((packed)) rb_pkt_stats_t_v1; +/************************************************************/ + /*Tx stats specific structures. */ struct ppdu_status { u32 ba_start_seq_num : 12; //[11:0] @@ -323,6 +392,171 @@ typedef struct { * if any event is missed. */ +/* PKT_LOG_V2 Base strcuture used to parse buffer */ +typedef struct { + u16 frm_ctrl; + u8 tx_ok; + u16 qos_ctrl; + u64 bmap_failed; + u64 bmap_enqueued; +} __attribute__((packed)) node_pkt_stats; + +typedef u8 A_RATECODE; + +/* Rate Code as per PKT_LOG_V2 Version */ +typedef struct { + A_RATECODE rateCode; + u8 flags; +} RATE_CODE; + +/* bandwidht type*/ +typedef enum { + BW_20MHZ, + BW_40MHZ, + BW_80MHZ, + BW_160MHZ, +} bandwidth; + +/* Preamble type*/ +typedef enum { + WIFI_HW_RATECODE_PREAM_OFDM = 0, + WIFI_HW_RATECODE_PREAM_CCK = 1, + WIFI_HW_RATECODE_PREAM_HT = 2, + WIFI_HW_RATECODE_PREAM_VHT = 3, + WIFI_HW_RATECODE_PREAM_COUNT, +} WIFI_HW_RATECODE_PREAM_TYPE; + +/** + * struct index_data_rate_type - non vht data rate type + * @rate_index: cck rate index + * @cck_rate: CCK supported rate table + */ +struct index_data_rate_cck_type { + uint8_t rate_index; + uint16_t cck_rate[2]; +}; + +/** + * struct index_data_rate_type - non vht data rate type + * @rate_index: ofdm rate index + * @ofdm__rate: OFDM supported rate table + */ +struct index_data_rate_ofdm_type { + uint8_t rate_index; + uint16_t ofdm_rate[2]; +}; + +/*Below CCK/OFDM table refer from firmware Arch */ +/* Rate Table Based on CCK */ +static struct index_data_rate_cck_type cck_mcs_nss1[] = { + /*RC LKbps SKbps */ + {0x40, {11000, 11000} }, + {0x41, {5500, 5500} }, + {0x42, {2000, 2000} }, + {0x43, {1000, 1000} } +}; + +/* Rate Table Based on OFDM */ +static struct index_data_rate_ofdm_type ofdm_mcs_nss1[] = { + /*RC LKbps SKbps */ + {0x00, {48000, 48000} }, + {0x01, {34000, 24000} }, + {0x02, {12000, 12000} }, + {0x03, {6000, 6000} }, + {0x04, {54000, 54000} }, + {0x05, {36000, 36000} }, + {0x06, {18000, 18000} }, + {0x07, {9000, 9000} } +}; + +/** + * struct index_data_rate_type - non vht data rate type + * @mcs_index: mcs rate index + * @ht20_rate: HT20 supported rate table + * @ht40_rate: HT40 supported rate table + */ +struct index_data_rate_type { + uint8_t mcs_index; + uint16_t ht20_rate[2]; + uint16_t ht40_rate[2]; +}; + +/** + * struct index_vht_data_rate_type - vht data rate type + * @mcs_index: mcs rate index + * @ht20_rate: VHT20 supported rate table + * @ht40_rate: VHT40 supported rate table + * @ht80_rate: VHT80 supported rate table + */ +struct index_vht_data_rate_type { + uint8_t mcs_index; + uint16_t ht20_rate[2]; + uint16_t ht40_rate[2]; + uint16_t ht80_rate[2]; +}; + +/*Below HT/VHT table refer from Host Driver + * MCS Based rate table + * HT MCS parameters with Nss = 1 + */ +static struct index_data_rate_type mcs_nss1[] = { + /* MCS L20 S20 L40 S40 */ + {0, {65, 72}, {135, 150 } }, + {1, {130, 144}, {270, 300 } }, + {2, {195, 217}, {405, 450 } }, + {3, {260, 289}, {540, 600 } }, + {4, {390, 433}, {815, 900 } }, + {5, {520, 578}, {1080, 1200} }, + {6, {585, 650}, {1215, 1350} }, + {7, {650, 722}, {1350, 1500} } +}; + +/* HT MCS parameters with Nss = 2 */ +static struct index_data_rate_type mcs_nss2[] = { + /* MCS L20 S20 L40 S40 */ + {0, {130, 144}, {270, 300 } }, + {1, {260, 289}, {540, 600 } }, + {2, {390, 433}, {810, 900 } }, + {3, {520, 578}, {1080, 1200} }, + {4, {780, 867}, {1620, 1800} }, + {5, {1040, 1156}, {2160, 2400} }, + {6, {1170, 1300}, {2430, 2700} }, + {7, {1300, 1440}, {2700, 3000} } +}; + +/* MCS Based VHT rate table + * MCS parameters with Nss = 1 + */ +static struct index_vht_data_rate_type vht_mcs_nss1[] = { + /* MCS L20 S20 L40 S40 L80 S80 */ + {0, {65, 72 }, {135, 150}, {293, 325} }, + {1, {130, 144}, {270, 300}, {585, 650} }, + {2, {195, 217}, {405, 450}, {878, 975} }, + {3, {260, 289}, {540, 600}, {1170, 1300} }, + {4, {390, 433}, {810, 900}, {1755, 1950} }, + {5, {520, 578}, {1080, 1200}, {2340, 2600} }, + {6, {585, 650}, {1215, 1350}, {2633, 2925} }, + {7, {650, 722}, {1350, 1500}, {2925, 3250} }, + {8, {780, 867}, {1620, 1800}, {3510, 3900} }, + {9, {865, 960}, {1800, 2000}, {3900, 4333} } +}; + +/*MCS parameters with Nss = 2*/ +static struct index_vht_data_rate_type vht_mcs_nss2[] = { + /* MCS L20 S20 L40 S40 L80 S80 */ + {0, {130, 144}, {270, 300}, { 585, 650} }, + {1, {260, 289}, {540, 600}, {1170, 1300} }, + {2, {390, 433}, {810, 900}, {1755, 1950} }, + {3, {520, 578}, {1080, 1200}, {2340, 2600} }, + {4, {780, 867}, {1620, 1800}, {3510, 3900} }, + {5, {1040, 1156}, {2160, 2400}, {4680, 5200} }, + {6, {1170, 1300}, {2430, 2700}, {5265, 5850} }, + {7, {1300, 1444}, {2700, 3000}, {5850, 6500} }, + {8, {1560, 1733}, {3240, 3600}, {7020, 7800} }, + {9, {1730, 1920}, {3600, 4000}, {7800, 8667} } +}; +/*********************************************************/ + #define RING_BUF_ENTRY_SIZE 512 #define PKT_STATS_BUF_SIZE 128 struct pkt_stats_s { diff --git a/qcwcn/wifi_hal/qca-vendor_copy.h b/qcwcn/wifi_hal/qca-vendor_copy.h index 0a7a086..df36ec0 100644 --- a/qcwcn/wifi_hal/qca-vendor_copy.h +++ b/qcwcn/wifi_hal/qca-vendor_copy.h @@ -1,9 +1,7 @@ /* * Qualcomm Atheros OUI and vendor specific assignments - * Copyright (c) 2014-2015, Qualcomm Atheros, Inc. - * - * This software may be distributed under the terms of the BSD license. - * See README for more details. + * Copyright (c) 2014-2017, Qualcomm Atheros, Inc. + * Copyright (c) 2018, The Linux Foundation. All rights reserved. */ #ifndef QCA_VENDOR_H @@ -90,6 +88,70 @@ enum qca_radiotap_vendor_ids { * which supports DFS offloading, to indicate a radar pattern has been * detected. The channel is now unusable. * + * @QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET: Get the feature bitmap + * based on enum wifi_logger_supported_features. Attributes defined in + * enum qca_wlan_vendor_attr_get_logger_features. + * + * @QCA_NL80211_VENDOR_SUBCMD_GET_RING_DATA: Get the ring data from a particular + * logger ring, QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_RING_ID is passed as the + * attribute for this command. Attributes defined in + * enum qca_wlan_vendor_attr_wifi_logger_start. + * + * @QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_CAPABILITIES: Get the supported TDLS + * capabilities of the driver, parameters includes the attributes defined + * in enum qca_wlan_vendor_attr_tdls_get_capabilities. + * + * @QCA_NL80211_VENDOR_SUBCMD_OFFLOADED_PACKETS: Vendor command used to offload + * sending of certain periodic IP packet to firmware, attributes defined in + * enum qca_wlan_vendor_attr_offloaded_packets. + * + * @QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI: Command used to configure RSSI + * monitoring, defines min and max RSSI which are configured for RSSI + * monitoring. Also used to notify the RSSI breach and provides the BSSID + * and RSSI value that was breached. Attributes defined in + * enum qca_wlan_vendor_attr_rssi_monitoring. + * + * @QCA_NL80211_VENDOR_SUBCMD_NDP: Command used for performing various NAN + * Data Path (NDP) related operations, attributes defined in + * enum qca_wlan_vendor_attr_ndp_params. + * + * @QCA_NL80211_VENDOR_SUBCMD_ND_OFFLOAD: Command used to enable/disable + * Neighbour Discovery offload, attributes defined in + * enum qca_wlan_vendor_attr_nd_offload. + * + * @QCA_NL80211_VENDOR_SUBCMD_PACKET_FILTER: Used to set/get the various + * configuration parameter for BPF packet filter, attributes defined in + * enum qca_wlan_vendor_attr_packet_filter. + * + * @QCA_NL80211_VENDOR_SUBCMD_GET_BUS_SIZE: Gets the driver-firmware + * maximum supported size, attributes defined in + * enum qca_wlan_vendor_drv_info. + * + * @QCA_NL80211_VENDOR_SUBCMD_GET_WAKE_REASON_STATS: Command to get various + * data about wake reasons and datapath IP statistics, attributes defined + * in enum qca_wlan_vendor_attr_wake_stats. + * + * @QCA_NL80211_VENDOR_SUBCMD_OCB_SET_CONFIG: Command used to set configuration + * for IEEE 802.11 communicating outside the context of a basic service + * set, called OCB command. Uses the attributes defines in + * enum qca_wlan_vendor_attr_ocb_set_config. + * + * @QCA_NL80211_VENDOR_SUBCMD_OCB_SET_UTC_TIME: Command used to set OCB + * UTC time. Use the attributes defines in + * enum qca_wlan_vendor_attr_ocb_set_utc_time. + * + * @QCA_NL80211_VENDOR_SUBCMD_OCB_START_TIMING_ADVERT: Command used to start + * sending OCB timing advert frames. Uses the attributes defines in + * enum qca_wlan_vendor_attr_ocb_start_timing_advert. + * + * @QCA_NL80211_VENDOR_SUBCMD_OCB_STOP_TIMING_ADVERT: Command used to stop + * OCB timing advert. Uses the attributes defines in + * enum qca_wlan_vendor_attr_ocb_stop_timing_advert. + * + * @QCA_NL80211_VENDOR_SUBCMD_OCB_GET_TSF_TIMER: Command used to get TSF + * timer value. Uses the attributes defines in + * enum qca_wlan_vendor_attr_ocb_get_tsf_resp. + * * @QCA_NL80211_VENDOR_SUBCMD_P2P_LISTEN_OFFLOAD_START: Command used to * start the P2P Listen offload function in device and pass the listen * channel, period, interval, count, device types, and vendor specific @@ -233,6 +295,10 @@ enum qca_radiotap_vendor_ids { * in the host driver. The different TDLS configurations are defined * by the attributes in enum qca_wlan_vendor_attr_tdls_configuration. * + * @QCA_NL80211_VENDOR_SUBCMD_GET_HE_CAPABILITIES: Query device IEEE 802.11ax HE + * capabilities. The response uses the attributes defined in + * enum qca_wlan_vendor_attr_get_he_capabilities. + * * @QCA_NL80211_VENDOR_SUBCMD_ABORT_SCAN: Abort an ongoing vendor scan that was * started with QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN. This command * carries the scan cookie of the corresponding scan request. The scan @@ -243,6 +309,147 @@ enum qca_radiotap_vendor_ids { * FCC compliance, OEMs require methods to set SAR limits on TX * power of WLAN/WWAN. enum qca_vendor_attr_sar_limits * attributes are used with this command. + * + * @QCA_NL80211_VENDOR_SUBCMD_EXTERNAL_ACS: This command/event is used by the + * host driver for offloading the implementation of Auto Channel Selection + * (ACS) to an external user space entity. This interface is used as the + * event from the host driver to the user space entity and also as the + * request from the user space entity to the host driver. The event from + * the host driver is used by the user space entity as an indication to + * start the ACS functionality. The attributes used by this event are + * represented by the enum qca_wlan_vendor_attr_external_acs_event. + * User space entity uses the same interface to inform the host driver with + * selected channels after the ACS operation using the attributes defined + * by enum qca_wlan_vendor_attr_external_acs_channels. + * + * @QCA_NL80211_VENDOR_SUBCMD_CHIP_PWRSAVE_FAILURE: Vendor event carrying the + * requisite information leading to a power save failure. The information + * carried as part of this event is represented by the + * enum qca_attr_chip_power_save_failure attributes. + * + * @QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_SET: Start/Stop the NUD statistics + * collection. Uses attributes defined in enum qca_attr_nud_stats_set. + * + * @QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_GET: Get the NUD statistics. These + * statistics are represented by the enum qca_attr_nud_stats_get + * attributes. + * + * @QCA_NL80211_VENDOR_SUBCMD_FETCH_BSS_TRANSITION_STATUS: Sub-command to fetch + * the BSS transition status, whether accept or reject, for a list of + * candidate BSSIDs provided by the userspace. This uses the vendor + * attributes QCA_WLAN_VENDOR_ATTR_BTM_MBO_TRANSITION_REASON and + * QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO. The userspace shall specify + * the attributes QCA_WLAN_VENDOR_ATTR_BTM_MBO_TRANSITION_REASON and an + * array of QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO_BSSID nested in + * QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO in the request. In the response + * the driver shall specify array of + * QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO_BSSID and + * QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO_STATUS pairs nested in + * QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO. + * + * @QCA_NL80211_VENDOR_SUBCMD_SET_TRACE_LEVEL: Set the trace level for a + * specific QCA module. The trace levels are represented by + * enum qca_attr_trace_level attributes. + * + * @QCA_NL80211_VENDOR_SUBCMD_BRP_SET_ANT_LIMIT: Set the Beam Refinement + * Protocol antenna limit in different modes. See enum + * qca_wlan_vendor_attr_brp_ant_limit_mode. + * + * @QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_START: Start spectral scan. The scan + * parameters are specified by enum qca_wlan_vendor_attr_spectral_scan. + * This returns a cookie (%QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_COOKIE) + * identifying the operation in success case. + * + * @QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_STOP: Stop spectral scan. This uses + * a cookie (%QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_COOKIE) from + * @QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_START to identify the scan to + * be stopped. + * + * @QCA_NL80211_VENDOR_SUBCMD_ACTIVE_TOS: Set the active Type Of Service on the + * specific interface. This can be used to modify some of the low level + * scan parameters (off channel dwell time, home channel time) in the + * driver/firmware. These parameters are maintained within the host driver. + * This command is valid only when the interface is in the connected state. + * These scan parameters shall be reset by the driver/firmware once + * disconnected. The attributes used with this command are defined in + * enum qca_wlan_vendor_attr_active_tos. + * + * @QCA_NL80211_VENDOR_SUBCMD_HANG: Event indicating to the user space that the + * driver has detected an internal failure. This event carries the + * information indicating the reason that triggered this detection. The + * attributes for this command are defined in + * enum qca_wlan_vendor_attr_hang. + * + * @QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_CONFIG: Get the current values + * of spectral parameters used. The spectral scan parameters are specified + * by enum qca_wlan_vendor_attr_spectral_scan. + * + * @QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_DIAG_STATS: Get the debug stats + * for spectral scan functionality. The debug stats are specified by + * enum qca_wlan_vendor_attr_spectral_diag_stats. + * + * @QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_CAP_INFO: Get spectral + * scan system capabilities. The capabilities are specified + * by enum qca_wlan_vendor_attr_spectral_cap. + * + * @QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_STATUS: Get the current + * status of spectral scan. The status values are specified + * by enum qca_wlan_vendor_attr_spectral_scan_status. + * + * @QCA_NL80211_VENDOR_SUBCMD_PEER_FLUSH_PENDING: Sub-command to flush + * peer pending packets. Specify the peer MAC address in + * QCA_WLAN_VENDOR_ATTR_PEER_ADDR and the access category of the packets + * in QCA_WLAN_VENDOR_ATTR_AC. The attributes are listed + * in enum qca_wlan_vendor_attr_flush_pending. + * + * @QCA_NL80211_VENDOR_SUBCMD_GET_RROP_INFO: Get vendor specific Representative + * RF Operating Parameter (RROP) information. The attributes for this + * information are defined in enum qca_wlan_vendor_attr_rrop_info. This is + * intended for use by external Auto Channel Selection applications. + * + * @QCA_NL80211_VENDOR_SUBCMD_GET_SAR_LIMITS: Get the Specific Absorption Rate + * (SAR) power limits. This is a companion to the command + * @QCA_NL80211_VENDOR_SUBCMD_SET_SAR_LIMITS and is used to retrieve the + * settings currently in use. The attributes returned by this command are + * defined by enum qca_vendor_attr_sar_limits. + * + * @QCA_NL80211_VENDOR_SUBCMD_WLAN_MAC_INFO: Provides the current behavior of + * the WLAN hardware MAC. Also, provides the WLAN netdev interface + * information attached to the respective MAC. + * This works both as a query (user space asks the current mode) or event + * interface (driver advertising the current mode to the user space). + * Driver does not trigger this event for temporary hardware mode changes. + * Mode changes w.r.t Wi-Fi connection update (VIZ creation / deletion, + * channel change, etc.) are updated with this event. Attributes for this + * interface are defined in enum qca_wlan_vendor_attr_mac. + * + * @QCA_NL80211_VENDOR_SUBCMD_SET_QDEPTH_THRESH: Set MSDU queue depth threshold + * per peer per TID. Attributes for this command are define in + * enum qca_wlan_set_qdepth_thresh_attr. + * @QCA_NL80211_VENDOR_SUBCMD_THERMAL_CMD: Provides the thermal shutdown action + * guide for WLAN driver. Request to suspend of driver and FW if the + * temperature is higher than the suspend threshold; resume action is + * requested to driver if the temperature is lower than the resume + * threshold. In user poll mode, request temperature data by user. For test + * purpose, getting thermal shutdown configuration parameters is needed. + * Attributes for this interface are defined in + * enum qca_wlan_vendor_attr_thermal_cmd. + * @QCA_NL80211_VENDOR_SUBCMD_THERMAL_EVENT: Thermal events reported from + * driver. Thermal temperature and indication of resume completion are + * reported as thermal events. The attributes for this command are defined + * in enum qca_wlan_vendor_attr_thermal_event. + * + * @QCA_NL80211_VENDOR_SUBCMD_WIFI_TEST_CONFIGURATION: Sub command to set WiFi + * test configuration. Attributes for this command are defined in + * enum qca_wlan_vendor_attr_wifi_test_config. + * + * @QCA_NL80211_VENDOR_SUBCMD_BSS_FILTER: This command is used to configure an + * RX filter to receive frames from stations that are active on the + * operating channel, but not associated with the local device (e.g., STAs + * associated with other APs). Filtering is done based on a list of BSSIDs + * and STA MAC addresses added by the user. This command is also used to + * fetch the statistics of unassociated stations. The attributes used with + * this command are defined in enum qca_wlan_vendor_attr_bss_filter. */ enum qca_nl80211_vendor_subcmds { QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0, @@ -310,7 +517,17 @@ enum qca_nl80211_vendor_subcmds { /* Wi-Fi configuration subcommands */ QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION = 74, QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION = 75, - /* 76-90 - reserved for QCA */ + QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET = 76, + QCA_NL80211_VENDOR_SUBCMD_GET_RING_DATA = 77, + QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_CAPABILITIES = 78, + QCA_NL80211_VENDOR_SUBCMD_OFFLOADED_PACKETS = 79, + QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI = 80, + QCA_NL80211_VENDOR_SUBCMD_NDP = 81, + QCA_NL80211_VENDOR_SUBCMD_ND_OFFLOAD = 82, + QCA_NL80211_VENDOR_SUBCMD_PACKET_FILTER = 83, + QCA_NL80211_VENDOR_SUBCMD_GET_BUS_SIZE = 84, + QCA_NL80211_VENDOR_SUBCMD_GET_WAKE_REASON_STATS = 85, + /* 86-90 - reserved for QCA */ QCA_NL80211_VENDOR_SUBCMD_DATA_OFFLOAD = 91, QCA_NL80211_VENDOR_SUBCMD_OCB_SET_CONFIG = 92, QCA_NL80211_VENDOR_SUBCMD_OCB_SET_UTC_TIME = 93, @@ -361,21 +578,39 @@ enum qca_nl80211_vendor_subcmds { QCA_NL80211_VENDOR_SUBCMD_DMG_RF_GET_SELECTED_SECTOR = 141, QCA_NL80211_VENDOR_SUBCMD_DMG_RF_SET_SELECTED_SECTOR = 142, QCA_NL80211_VENDOR_SUBCMD_CONFIGURE_TDLS = 143, - /* 144 - reserved for QCA */ + QCA_NL80211_VENDOR_SUBCMD_GET_HE_CAPABILITIES = 144, QCA_NL80211_VENDOR_SUBCMD_ABORT_SCAN = 145, QCA_NL80211_VENDOR_SUBCMD_SET_SAR_LIMITS = 146, - /* @QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_SET: - * Start / Stop the NUD stats collection. - */ - QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_SET = 149, - /* @QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_GET: - * Get the NUD stats.These stats are represented - * by the enum qca_attr_nud_stats_get. - */ - QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_GET = 150 + QCA_NL80211_VENDOR_SUBCMD_EXTERNAL_ACS = 147, + QCA_NL80211_VENDOR_SUBCMD_CHIP_PWRSAVE_FAILURE = 148, + QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_SET = 149, + QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_GET = 150, + QCA_NL80211_VENDOR_SUBCMD_FETCH_BSS_TRANSITION_STATUS = 151, + QCA_NL80211_VENDOR_SUBCMD_SET_TRACE_LEVEL = 152, + QCA_NL80211_VENDOR_SUBCMD_BRP_SET_ANT_LIMIT = 153, + QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_START = 154, + QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_STOP = 155, + QCA_NL80211_VENDOR_SUBCMD_ACTIVE_TOS = 156, + QCA_NL80211_VENDOR_SUBCMD_HANG = 157, + QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_CONFIG = 158, + QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_DIAG_STATS = 159, + QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_CAP_INFO = 160, + QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_STATUS = 161, + /* Flush peer pending data */ + QCA_NL80211_VENDOR_SUBCMD_PEER_FLUSH_PENDING = 162, + QCA_NL80211_VENDOR_SUBCMD_GET_RROP_INFO = 163, + QCA_NL80211_VENDOR_SUBCMD_GET_SAR_LIMITS = 164, + QCA_NL80211_VENDOR_SUBCMD_WLAN_MAC_INFO = 165, + QCA_NL80211_VENDOR_SUBCMD_SET_QDEPTH_THRESH = 166, + /* Thermal shutdown commands to protect wifi chip */ + QCA_NL80211_VENDOR_SUBCMD_THERMAL_CMD = 167, + QCA_NL80211_VENDOR_SUBCMD_THERMAL_EVENT = 168, + /* Wi-Fi test configuration subcommand */ + QCA_NL80211_VENDOR_SUBCMD_WIFI_TEST_CONFIGURATION = 169, + /* Frame filter operations for other BSSs/unassociated STAs */ + QCA_NL80211_VENDOR_SUBCMD_BSS_FILTER = 170, }; - enum qca_wlan_vendor_attr { QCA_WLAN_VENDOR_ATTR_INVALID = 0, /* used by QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY */ @@ -387,7 +622,8 @@ enum qca_wlan_vendor_attr { /* used by QCA_NL80211_VENDOR_SUBCMD_STATS_EXT */ QCA_WLAN_VENDOR_ATTR_IFINDEX = 4, /* used by QCA_NL80211_VENDOR_SUBCMD_ROAMING, u32 with values defined - * by enum qca_roaming_policy. */ + * by enum qca_roaming_policy. + */ QCA_WLAN_VENDOR_ATTR_ROAMING_POLICY = 5, QCA_WLAN_VENDOR_ATTR_MAC_ADDR = 6, /* used by QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES */ @@ -475,10 +711,12 @@ enum qca_wlan_vendor_attr { QCA_WLAN_VENDOR_ATTR_AOA_MEAS_RESULT = 25, /* Used in QCA_NL80211_VENDOR_SUBCMD_GET_CHAIN_RSSI command * to specify the chain number (unsigned 32 bit value) to inquire - * the corresponding antenna RSSI value */ + * the corresponding antenna RSSI value + */ QCA_WLAN_VENDOR_ATTR_CHAIN_INDEX = 26, /* Used in QCA_NL80211_VENDOR_SUBCMD_GET_CHAIN_RSSI command - * to report the specific antenna RSSI value (unsigned 32 bit value) */ + * to report the specific antenna RSSI value (unsigned 32 bit value) + */ QCA_WLAN_VENDOR_ATTR_CHAIN_RSSI = 27, /* Frequency in MHz, various uses. Unsigned 32 bit value */ QCA_WLAN_VENDOR_ATTR_FREQ = 28, @@ -515,13 +753,45 @@ enum qca_wlan_vendor_attr { */ QCA_WLAN_VENDOR_ATTR_RX_AGGREGATION_STATS_HOLES_NUM = 34, QCA_WLAN_VENDOR_ATTR_RX_AGGREGATION_STATS_HOLES_INFO = 35, + /* Unsigned 8-bit value representing MBO transition reason code as + * provided by the AP used by subcommand + * QCA_NL80211_VENDOR_SUBCMD_FETCH_BSS_TRANSITION_STATUS. This is + * specified by the userspace in the request to the driver. + */ + QCA_WLAN_VENDOR_ATTR_BTM_MBO_TRANSITION_REASON = 36, + /* Array of nested attributes, BSSID and status code, used by subcommand + * QCA_NL80211_VENDOR_SUBCMD_FETCH_BSS_TRANSITION_STATUS, where each + * entry is taken from enum qca_wlan_vendor_attr_btm_candidate_info. + * The userspace space specifies the list/array of candidate BSSIDs in + * the order of preference in the request. The driver specifies the + * status code, for each BSSID in the list, in the response. The + * acceptable candidates are listed in the order preferred by the + * driver. + */ + QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO = 37, + /* Used in QCA_NL80211_VENDOR_SUBCMD_BRP_SET_ANT_LIMIT command + * See enum qca_wlan_vendor_attr_brp_ant_limit_mode. + */ + QCA_WLAN_VENDOR_ATTR_BRP_ANT_LIMIT_MODE = 38, + /* Used in QCA_NL80211_VENDOR_SUBCMD_BRP_SET_ANT_LIMIT command + * to define the number of antennas to use for BRP. + * different purpose in each ANT_LIMIT_MODE: + * DISABLE - ignored + * EFFECTIVE - upper limit to number of antennas to be used + * FORCE - exact number of antennas to be used + * unsigned 8 bit value + */ + QCA_WLAN_VENDOR_ATTR_BRP_ANT_NUM_LIMIT = 39, + /* Used in QCA_NL80211_VENDOR_SUBCMD_GET_CHAIN_RSSI command + * to report the corresponding antenna index to the chain RSSI value + */ + QCA_WLAN_VENDOR_ATTR_ANTENNA_INFO = 40, /* keep last */ QCA_WLAN_VENDOR_ATTR_AFTER_LAST, QCA_WLAN_VENDOR_ATTR_MAX = QCA_WLAN_VENDOR_ATTR_AFTER_LAST - 1, }; - enum qca_roaming_policy { QCA_ROAMING_NOT_ALLOWED, QCA_ROAMING_ALLOWED_WITHIN_ESS, @@ -537,6 +807,38 @@ enum qca_wlan_vendor_attr_roam_auth { QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PTK_KCK, QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PTK_KEK, QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_SUBNET_STATUS, + /* Indicates the status of re-association requested by user space for + * the BSSID specified by QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_BSSID. + * Type u16. + * Represents the status code from AP. Use + * %WLAN_STATUS_UNSPECIFIED_FAILURE if the device cannot give you the + * real status code for failures. + */ + QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_STATUS, + /* This attribute indicates that the old association was maintained when + * a re-association is requested by user space and that re-association + * attempt fails (i.e., cannot connect to the requested BSS, but can + * remain associated with the BSS with which the association was in + * place when being requested to roam). Used along with + * WLAN_VENDOR_ATTR_ROAM_AUTH_STATUS to indicate the current + * re-association status. Type flag. + * This attribute is applicable only for re-association failure cases. + */ + QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_RETAIN_CONNECTION, + /* This attribute specifies the PMK if one was newly generated during + * FILS roaming. This is added to the PMKSA cache and is used in + * subsequent connections with PMKSA caching. + */ + QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PMK = 11, + /* This attribute specifies the PMKID used/generated for the current + * FILS roam. This is used in subsequent connections with PMKSA caching. + */ + QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PMKID = 12, + /* A 16-bit unsigned value specifying the next sequence number to use + * in ERP message in the currently associated realm. This is used in + * doing subsequent ERP based connections in the same realm. + */ + QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_FILS_ERP_NEXT_SEQ_NUM = 13, /* keep last */ QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_AFTER_LAST, QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_MAX = @@ -617,13 +919,24 @@ enum qca_wlan_vendor_acs_hw_mode { * @QCA_WLAN_VENDOR_FEATURE_SUPPORT_HW_MODE_ANY: Device supports automatic * band selection based on channel selection results. * @QCA_WLAN_VENDOR_FEATURE_OFFCHANNEL_SIMULTANEOUS: Device supports - * simultaneous off-channel operations. + * simultaneous off-channel operations. * @QCA_WLAN_VENDOR_FEATURE_P2P_LISTEN_OFFLOAD: Device supports P2P * Listen offload; a mechanism where the station's firmware takes care of * responding to incoming Probe Request frames received from other P2P * Devices whilst in Listen state, rather than having the user space * wpa_supplicant do it. Information from received P2P requests are * forwarded from firmware to host whenever the host processor wakes up. + * @QCA_WLAN_VENDOR_FEATURE_OCE_STA: Device supports all OCE non-AP STA + * specific features. + * @QCA_WLAN_VENDOR_FEATURE_OCE_AP: Device supports all OCE AP specific + * features. + * @QCA_WLAN_VENDOR_FEATURE_OCE_STA_CFON: Device supports OCE STA-CFON + * specific features only. If a Device sets this bit but not the + * %QCA_WLAN_VENDOR_FEATURE_OCE_AP, the userspace shall assume that + * this Device may not support all OCE AP functionalities but can support + * only OCE STA-CFON functionalities. + * @QCA_WLAN_VENDOR_FEATURE_SELF_MANAGED_REGULATORY: Device supports self + * managed regulatory. * @NUM_QCA_WLAN_VENDOR_FEATURES: Number of assigned feature bits */ enum qca_wlan_vendor_features { @@ -631,6 +944,10 @@ enum qca_wlan_vendor_features { QCA_WLAN_VENDOR_FEATURE_SUPPORT_HW_MODE_ANY = 1, QCA_WLAN_VENDOR_FEATURE_OFFCHANNEL_SIMULTANEOUS = 2, QCA_WLAN_VENDOR_FEATURE_P2P_LISTEN_OFFLOAD = 3, + QCA_WLAN_VENDOR_FEATURE_OCE_STA = 4, + QCA_WLAN_VENDOR_FEATURE_OCE_AP = 5, + QCA_WLAN_VENDOR_FEATURE_OCE_STA_CFON = 6, + QCA_WLAN_VENDOR_FEATURE_SELF_MANAGED_REGULATORY = 7, NUM_QCA_WLAN_VENDOR_FEATURES /* keep last */ }; @@ -656,6 +973,112 @@ enum qca_wlan_vendor_attr_data_offload_ind { QCA_WLAN_VENDOR_ATTR_DATA_OFFLOAD_IND_AFTER_LAST - 1 }; +/** + * enum qca_wlan_vendor_attr_ocb_set_config - Vendor subcmd attributes to set + * OCB config + * + * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_COUNT: Number of channels in the + * configuration + * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_SCHEDULE_SIZE: Size of the schedule + * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_ARRAY: Array of channels + * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_SCHEDULE_ARRAY: Array of channels to be + * scheduled + * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_CHANNEL_ARRAY: Array of NDL channel + * information + * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_ACTIVE_STATE_ARRAY: Array of NDL + * active state configuration + * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_FLAGS: Configuration flags such as + * OCB_CONFIG_FLAG_80211_FRAME_MODE + * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_DEF_TX_PARAM: Default TX parameters to + * use in the case that a packet is sent without a TX control header + * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_TA_MAX_DURATION: Max duration after the + * last TA received that the local time set by TA is synchronous to other + * communicating OCB STAs. + */ +enum qca_wlan_vendor_attr_ocb_set_config { + QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_COUNT = 1, + QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_SCHEDULE_SIZE = 2, + QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_ARRAY = 3, + QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_SCHEDULE_ARRAY = 4, + QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_CHANNEL_ARRAY = 5, + QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_ACTIVE_STATE_ARRAY = 6, + QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_FLAGS = 7, + QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_DEF_TX_PARAM = 8, + QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_TA_MAX_DURATION = 9, + QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_MAX = + QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_AFTER_LAST - 1 +}; + +/** + * enum qca_wlan_vendor_attr_ocb_set_utc_time - Vendor subcmd attributes to set + * UTC time + * + * @QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_VALUE: The UTC time as an array of + * 10 bytes + * @QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_ERROR: The time error as an array of + * 5 bytes + */ +enum qca_wlan_vendor_attr_ocb_set_utc_time { + QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_VALUE = 1, + QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_ERROR = 2, + QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_MAX = + QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_AFTER_LAST - 1 +}; + +/** + * enum qca_wlan_vendor_attr_ocb_start_timing_advert - Vendor subcmd attributes + * to start sending timing advert frames + * + * @QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_CHANNEL_FREQ: Cannel frequency + * on which to send the frames + * @QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_REPEAT_RATE: Number of times + * the frame is sent in 5 seconds + */ +enum qca_wlan_vendor_attr_ocb_start_timing_advert { + QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_CHANNEL_FREQ = 1, + QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_REPEAT_RATE = 2, + QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_MAX = + QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_AFTER_LAST - 1 +}; + +/** + * enum qca_wlan_vendor_attr_ocb_stop_timing_advert - Vendor subcmd attributes + * to stop timing advert + * + * @QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_CHANNEL_FREQ: The channel + * frequency on which to stop the timing advert + */ +enum qca_wlan_vendor_attr_ocb_stop_timing_advert { + QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_CHANNEL_FREQ = 1, + QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_MAX = + QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_AFTER_LAST - 1 +}; + +/** + * enum qca_wlan_vendor_attr_ocb_get_tsf_response - Vendor subcmd attributes to + * get TSF timer value + * + * @QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_TIMER_HIGH: Higher 32 bits of the + * timer + * @QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_TIMER_LOW: Lower 32 bits of the timer + */ +enum qca_wlan_vendor_attr_ocb_get_tsf_resp { + QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_TIMER_HIGH = 1, + QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_TIMER_LOW = 2, + QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_MAX = + QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_AFTER_LAST - 1 +}; + enum qca_vendor_attr_get_preferred_freq_list { QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_INVALID, /* A 32-unsigned value; the interface type/mode for which the preferred @@ -668,6 +1091,12 @@ enum qca_vendor_attr_get_preferred_freq_list { * from kernel space to user space. */ QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST, + /* An array of nested values as per enum qca_wlan_vendor_attr_pcl + * attribute. Each element contains frequency (MHz), weight, and flag + * bit mask indicating how the frequency should be used in P2P + * negotiation; sent from kernel space to user space. + */ + QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_WEIGHED_PCL, /* keep last */ QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_AFTER_LAST, QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_MAX = @@ -803,11 +1232,39 @@ enum qca_vendor_attr_wisa_cmd { * vendor specific element is defined by the latest P802.11ax draft. * Please note that the draft is still work in progress and this element * payload is subject to change. + * + * @QCA_VENDOR_ELEM_RAPS: RAPS element (OFDMA-based Random Access Parameter Set + * element). + * This element can be used for pre-standard publication testing of HE + * before P802.11ax draft assigns the element ID extension. The payload of + * this vendor specific element is defined by the latest P802.11ax draft + * (not including the Element ID Extension field). Please note that the + * draft is still work in progress and this element payload is subject to + * change. + * + * @QCA_VENDOR_ELEM_MU_EDCA_PARAMS: MU EDCA Parameter Set element. + * This element can be used for pre-standard publication testing of HE + * before P802.11ax draft assigns the element ID extension. The payload of + * this vendor specific element is defined by the latest P802.11ax draft + * (not including the Element ID Extension field). Please note that the + * draft is still work in progress and this element payload is subject to + * change. + * + * @QCA_VENDOR_ELEM_BSS_COLOR_CHANGE: BSS Color Change Announcement element. + * This element can be used for pre-standard publication testing of HE + * before P802.11ax draft assigns the element ID extension. The payload of + * this vendor specific element is defined by the latest P802.11ax draft + * (not including the Element ID Extension field). Please note that the + * draft is still work in progress and this element payload is subject to + * change. */ enum qca_vendor_element_id { QCA_VENDOR_ELEM_P2P_PREF_CHAN_LIST = 0, QCA_VENDOR_ELEM_HE_CAPAB = 1, QCA_VENDOR_ELEM_HE_OPER = 2, + QCA_VENDOR_ELEM_RAPS = 3, + QCA_VENDOR_ELEM_MU_EDCA_PARAMS = 4, + QCA_VENDOR_ELEM_BSS_COLOR_CHANGE = 5, }; /** @@ -820,16 +1277,16 @@ enum qca_vendor_element_id { * @QCA_WLAN_VENDOR_ATTR_SCAN_SUPP_RATES: Nested array attribute of supported * rates to be included * @QCA_WLAN_VENDOR_ATTR_SCAN_TX_NO_CCK_RATE: flag used to send probe requests - * at non CCK rate in 2GHz band + * at non CCK rate in 2GHz band * @QCA_WLAN_VENDOR_ATTR_SCAN_FLAGS: Unsigned 32-bit scan flags * @QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE: Unsigned 64-bit cookie provided by the - * driver for the specific scan request + * driver for the specific scan request * @QCA_WLAN_VENDOR_ATTR_SCAN_STATUS: Unsigned 8-bit status of the scan - * request decoded as in enum scan_status + * request decoded as in enum scan_status * @QCA_WLAN_VENDOR_ATTR_SCAN_MAC: 6-byte MAC address to use when randomisation - * scan flag is set + * scan flag is set * @QCA_WLAN_VENDOR_ATTR_SCAN_MAC_MASK: 6-byte MAC address mask to be used with - * randomisation + * randomisation * @QCA_WLAN_VENDOR_ATTR_SCAN_BSSID: 6-byte MAC address representing the * specific BSSID to scan for. */ @@ -853,10 +1310,10 @@ enum qca_wlan_vendor_attr_scan { /** * enum scan_status - Specifies the valid values the vendor scan attribute - * QCA_WLAN_VENDOR_ATTR_SCAN_STATUS can take + * QCA_WLAN_VENDOR_ATTR_SCAN_STATUS can take * * @VENDOR_SCAN_STATUS_NEW_RESULTS: implies the vendor scan is successful with - * new scan results + * new scan results * @VENDOR_SCAN_STATUS_ABORTED: implies the vendor scan was aborted in-between */ enum scan_status { @@ -903,7 +1360,8 @@ enum qca_vendor_attr_txpower_scale { enum qca_vendor_attr_txpower_decr_db { QCA_WLAN_VENDOR_ATTR_TXPOWER_DECR_DB_INVALID, /* 8-bit unsigned value to indicate the reduction of TX power in dB for - * a virtual interface. */ + * a virtual interface. + */ QCA_WLAN_VENDOR_ATTR_TXPOWER_DECR_DB, /* keep last */ QCA_WLAN_VENDOR_ATTR_TXPOWER_DECR_DB_AFTER_LAST, @@ -953,29 +1411,37 @@ enum qca_wlan_vendor_attr_config { */ QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_AVOIDANCE_IND = 7, /* 8-bit unsigned value to configure the maximum TX MPDU for - * aggregation. */ + * aggregation. + */ QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION = 8, /* 8-bit unsigned value to configure the maximum RX MPDU for - * aggregation. */ + * aggregation. + */ QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION = 9, /* 8-bit unsigned value to configure the Non aggregrate/11g sw - * retry threshold (0 disable, 31 max). */ + * retry threshold (0 disable, 31 max). + */ QCA_WLAN_VENDOR_ATTR_CONFIG_NON_AGG_RETRY = 10, /* 8-bit unsigned value to configure the aggregrate sw - * retry threshold (0 disable, 31 max). */ + * retry threshold (0 disable, 31 max). + */ QCA_WLAN_VENDOR_ATTR_CONFIG_AGG_RETRY = 11, /* 8-bit unsigned value to configure the MGMT frame - * retry threshold (0 disable, 31 max). */ + * retry threshold (0 disable, 31 max). + */ QCA_WLAN_VENDOR_ATTR_CONFIG_MGMT_RETRY = 12, /* 8-bit unsigned value to configure the CTRL frame - * retry threshold (0 disable, 31 max). */ + * retry threshold (0 disable, 31 max). + */ QCA_WLAN_VENDOR_ATTR_CONFIG_CTRL_RETRY = 13, /* 8-bit unsigned value to configure the propagation delay for - * 2G/5G band (0~63, units in us) */ + * 2G/5G band (0~63, units in us) + */ QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_DELAY = 14, /* Unsigned 32-bit value to configure the number of unicast TX fail * packet count. The peer is disconnected once this threshold is - * reached. */ + * reached. + */ QCA_WLAN_VENDOR_ATTR_CONFIG_TX_FAIL_COUNT = 15, /* Attribute used to set scan default IEs to the driver. * @@ -986,7 +1452,8 @@ enum qca_wlan_vendor_attr_config { * merged with the IEs received along with scan request coming to the * driver. If a particular IE is present in the scan default IEs but not * present in the scan request, then that IE should be added to the IEs - * sent in the Probe Request frames for that scan request. */ + * sent in the Probe Request frames for that scan request. + */ QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_DEFAULT_IES = 16, /* Unsigned 32-bit attribute for generic commands */ QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_COMMAND = 17, @@ -995,41 +1462,50 @@ enum qca_wlan_vendor_attr_config { /* Unsigned 32-bit data attribute for generic command response */ QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_DATA = 19, /* Unsigned 32-bit length attribute for - * QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_DATA */ + * QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_DATA + */ QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_LENGTH = 20, /* Unsigned 32-bit flags attribute for - * QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_DATA */ + * QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_DATA + */ QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_FLAGS = 21, /* Unsigned 32-bit, defining the access policy. * See enum qca_access_policy. Used with - * QCA_WLAN_VENDOR_ATTR_CONFIG_ACCESS_POLICY_IE_LIST. */ + * QCA_WLAN_VENDOR_ATTR_CONFIG_ACCESS_POLICY_IE_LIST. + */ QCA_WLAN_VENDOR_ATTR_CONFIG_ACCESS_POLICY = 22, /* Sets the list of full set of IEs for which a specific access policy * has to be applied. Used along with * QCA_WLAN_VENDOR_ATTR_CONFIG_ACCESS_POLICY to control the access. - * Zero length payload can be used to clear this access constraint. */ + * Zero length payload can be used to clear this access constraint. + */ QCA_WLAN_VENDOR_ATTR_CONFIG_ACCESS_POLICY_IE_LIST = 23, /* Unsigned 32-bit, specifies the interface index (netdev) for which the * corresponding configurations are applied. If the interface index is * not specified, the configurations are attributed to the respective - * wiphy. */ + * wiphy. + */ QCA_WLAN_VENDOR_ATTR_CONFIG_IFINDEX = 24, /* 8-bit unsigned value to trigger QPower: 1-Enable, 0-Disable */ QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER = 25, /* 8-bit unsigned value to configure the driver and below layers to * ignore the assoc disallowed set by APs while connecting - * 1-Ignore, 0-Don't ignore */ + * 1-Ignore, 0-Don't ignore + */ QCA_WLAN_VENDOR_ATTR_CONFIG_IGNORE_ASSOC_DISALLOWED = 26, /* 32-bit unsigned value to trigger antenna diversity features: - * 1-Enable, 0-Disable */ + * 1-Enable, 0-Disable + */ QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_ENA = 27, /* 32-bit unsigned value to configure specific chain antenna */ QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_CHAIN = 28, /* 32-bit unsigned value to trigger cycle selftest - * 1-Enable, 0-Disable */ + * 1-Enable, 0-Disable + */ QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_SELFTEST = 29, /* 32-bit unsigned to configure the cycle time of selftest - * the unit is micro-second */ + * the unit is micro-second + */ QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_SELFTEST_INTVL = 30, /* 32-bit unsigned value to set reorder timeout for AC_VO */ QCA_WLAN_VENDOR_ATTR_CONFIG_RX_REORDER_TIMEOUT_VOICE = 31, @@ -1047,6 +1523,122 @@ enum qca_wlan_vendor_attr_config { QCA_WLAN_VENDOR_ATTR_CONFIG_BEACON_MISS_THRESHOLD_24 = 37, /* 8-bit unsigned value to set the beacon miss threshold in 5 GHz */ QCA_WLAN_VENDOR_ATTR_CONFIG_BEACON_MISS_THRESHOLD_5 = 38, + /* 32-bit unsigned value to configure 5 or 10 MHz channel width for + * station device while in disconnect state. The attribute use the + * value of enum nl80211_chan_width: NL80211_CHAN_WIDTH_5 means 5 MHz, + * NL80211_CHAN_WIDTH_10 means 10 MHz. If set, the device work in 5 or + * 10 MHz channel width, the station will not connect to a BSS using 20 + * MHz or higher bandwidth. Set to NL80211_CHAN_WIDTH_20_NOHT to + * clear this constraint. + */ + QCA_WLAN_VENDOR_ATTR_CONFIG_SUB20_CHAN_WIDTH = 39, + /* 32-bit unsigned value to configure the propagation absolute delay + * for 2G/5G band (units in us) + */ + QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_ABS_DELAY = 40, + /* 32-bit unsigned value to set probe period */ + QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_PROBE_PERIOD = 41, + /* 32-bit unsigned value to set stay period */ + QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_STAY_PERIOD = 42, + /* 32-bit unsigned value to set snr diff */ + QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_SNR_DIFF = 43, + /* 32-bit unsigned value to set probe dwell time */ + QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_PROBE_DWELL_TIME = 44, + /* 32-bit unsigned value to set mgmt snr weight */ + QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_MGMT_SNR_WEIGHT = 45, + /* 32-bit unsigned value to set data snr weight */ + QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_DATA_SNR_WEIGHT = 46, + /* 32-bit unsigned value to set ack snr weight */ + QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_ACK_SNR_WEIGHT = 47, + /* 32-bit unsigned value to configure the listen interval. + * This is in units of beacon intervals. This configuration alters + * the negotiated listen interval with the AP during the connection. + * It is highly recommended to configure a value less than or equal to + * the one negotiated during the association. Configuring any greater + * value can have adverse effects (frame loss, AP disassociating STA, + * etc.). + */ + QCA_WLAN_VENDOR_ATTR_CONFIG_LISTEN_INTERVAL = 48, + /* + * 8 bit unsigned value that is set on an AP/GO virtual interface to + * disable operations that would cause the AP/GO to leave its operating + * channel. + * + * This will restrict the scans to the AP/GO operating channel and the + * channels of the other band, if DBS is supported.A STA/CLI interface + * brought up after this setting is enabled, will be restricted to + * connecting to devices only on the AP/GO interface's operating channel + * or on the other band in DBS case. P2P supported channel list is + * modified, to only include AP interface's operating-channel and the + * channels of the other band if DBS is supported. + * + * These restrictions are only applicable as long as the AP/GO interface + * is alive. If the AP/GO interface is brought down then this + * setting/restriction is forgotten. + * + * If this variable is set on an AP/GO interface while a multi-channel + * concurrent session is active, it has no effect on the operation of + * the current interfaces, other than restricting the scan to the AP/GO + * operating channel and the other band channels if DBS is supported. + * However, if the STA is brought down and restarted then the new STA + * connection will either be formed on the AP/GO channel or on the + * other band in a DBS case. This is because of the scan being + * restricted on these channels as mentioned above. + * + * 1-Restrict / 0-Don't restrict offchannel operations. + */ + QCA_WLAN_VENDOR_ATTR_CONFIG_RESTRICT_OFFCHANNEL = 49, + /* + * 8 bit unsigned value to enable/disable LRO (Large Receive Offload) + * on an interface. + * 1 - Enable, 0 - Disable. + */ + QCA_WLAN_VENDOR_ATTR_CONFIG_LRO = 50, + + /* + * 8 bit unsigned value to globally enable/disable scan + * 1 - Enable, 0 - Disable. + */ + QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_ENABLE = 51, + + /* 8-bit unsigned value to set the total beacon miss count + * This parameter will set the total beacon miss count. + */ + QCA_WLAN_VENDOR_ATTR_CONFIG_TOTAL_BEACON_MISS_COUNT = 52, + + /* Unsigned 32-bit value to configure the number of continuous + * Beacon Miss which shall be used by the firmware to penalize + * the RSSI for BTC. + */ + QCA_WLAN_VENDOR_ATTR_CONFIG_PENALIZE_AFTER_NCONS_BEACON_MISS_BTC = 53, + + /* 8-bit unsigned value to configure the driver and below layers to + * enable/disable all FILS features. + * 0-enable, 1-disable + */ + QCA_WLAN_VENDOR_ATTR_CONFIG_DISABLE_FILS = 54, + + /* 16-bit unsigned value to configure the level of WLAN latency + * module. See enum qca_wlan_vendor_attr_config_latency_level. + */ + QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL = 55, + + /* 8-bit unsigned value indicating the driver to use the RSNE as-is from + * the connect interface. Exclusively used for the scenarios where the + * device is used as a test bed device with special functionality and + * not recommended for production. This helps driver to not validate the + * RSNE passed from user space and thus allow arbitrary IE data to be + * used for testing purposes. + * 1-enable, 0-disable. + * Applications set/reset this configuration. If not reset, this + * parameter remains in use until the driver is unloaded. + */ + QCA_WLAN_VENDOR_ATTR_CONFIG_RSN_IE = 56, + + /* 8-bit unsigned value to trigger green Tx power saving. + * 1-Enable, 0-Disable + */ + QCA_WLAN_VENDOR_ATTR_CONFIG_GTX = 57, /* keep last */ QCA_WLAN_VENDOR_ATTR_CONFIG_AFTER_LAST, @@ -1080,7 +1672,8 @@ enum qca_wlan_vendor_attr_sap_config { enum qca_wlan_vendor_attr_sap_conditional_chan_switch { QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_INVALID = 0, /* Priority based frequency list (an array of u32 values in host byte - * order) */ + * order) + */ QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_FREQ_LIST = 1, /* Status of the conditional switch (u32). * 0: Success, Non-zero: Failure @@ -1115,6 +1708,36 @@ enum qca_wlan_gpio_attr { }; /** + * qca_wlan_set_qdepth_thresh_attr - Parameters for setting + * MSDUQ depth threshold per peer per tid in the target + * + * Associated Vendor Command: + * QCA_NL80211_VENDOR_SUBCMD_SET_QDEPTH_THRESH + */ +enum qca_wlan_set_qdepth_thresh_attr { + QCA_WLAN_VENDOR_ATTR_QDEPTH_THRESH_INVALID = 0, + /* 6-byte MAC address */ + QCA_WLAN_VENDOR_ATTR_QDEPTH_THRESH_MAC_ADDR, + /* Unsigned 32-bit attribute for holding the TID */ + QCA_WLAN_VENDOR_ATTR_QDEPTH_THRESH_TID, + /* Unsigned 32-bit attribute for holding the update mask + * bit 0 - Update high priority msdu qdepth threshold + * bit 1 - Update low priority msdu qdepth threshold + * bit 2 - Update UDP msdu qdepth threshold + * bit 3 - Update Non UDP msdu qdepth threshold + * rest of bits are reserved + */ + QCA_WLAN_VENDOR_ATTR_QDEPTH_THRESH_UPDATE_MASK, + /* Unsigned 32-bit attribute for holding the threshold value */ + QCA_WLAN_VENDOR_ATTR_QDEPTH_THRESH_VALUE, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_QDEPTH_THRESH_LAST, + QCA_WLAN_VENDOR_ATTR_QDEPTH_THRESH_MAX = + QCA_WLAN_VENDOR_ATTR_QDEPTH_THRESH_LAST - 1, +}; + +/** * enum qca_wlan_vendor_attr_get_hw_capability - Wi-Fi hardware capability */ enum qca_wlan_vendor_attr_get_hw_capability { @@ -1286,6 +1909,12 @@ enum qca_wlan_vendor_attr_get_hw_capability { * @QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_ANT_NF: per antenna NF value * @QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_IFACE_RSSI_BEACON: RSSI of beacon * @QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_IFACE_SNR_BEACON: SNR of beacon + * @QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_REPORT_TIME: u64 + * Absolute timestamp from 1970/1/1, unit in ms. After receiving the + * message, user layer APP could call gettimeofday to get another + * timestamp and calculate transfer delay for the message. + * @QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_MEASUREMENT_TIME: u32 + * Real period for this measurement, unit in us. */ enum qca_wlan_vendor_attr_ll_stats_ext { QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_INVALID = 0, @@ -1379,6 +2008,9 @@ enum qca_wlan_vendor_attr_ll_stats_ext { QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_IFACE_RSSI_BEACON, QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_IFACE_SNR_BEACON, + QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_REPORT_TIME, + QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_MEASUREMENT_TIME, + QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_LAST, QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_MAX = QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_LAST - 1 @@ -1432,7 +2064,7 @@ enum qca_wlan_vendor_attr_loc_capa { * @QCA_WLAN_VENDOR_ATTR_LOC_CAPA_FLAG_FTM_INITIATOR: Set if driver * can run FTM sessions. QCA_NL80211_VENDOR_SUBCMD_FTM_START_SESSION * will be supported if set. -* @QCA_WLAN_VENDOR_ATTR_LOC_CAPA_FLAG_ASAP: Set if FTM responder + * @QCA_WLAN_VENDOR_ATTR_LOC_CAPA_FLAG_ASAP: Set if FTM responder * supports immediate (ASAP) response. * @QCA_WLAN_VENDOR_ATTR_LOC_CAPA_FLAG_AOA: Set if driver supports standalone * AOA measurement using QCA_NL80211_VENDOR_SUBCMD_AOA_MEAS. @@ -1749,6 +2381,24 @@ enum qca_wlan_vendor_attr_dmg_rf_sector_type { }; /** + * BRP antenna limit mode + * + * @QCA_WLAN_VENDOR_ATTR_BRP_ANT_LIMIT_MODE_DISABLE: Disable BRP force + * antenna limit, BRP will be performed as usual. + * @QCA_WLAN_VENDOR_ATTR_BRP_ANT_LIMIT_MODE_EFFECTIVE: Define maximal + * antennas limit. the hardware may use less antennas than the + * maximum limit. + * @QCA_WLAN_VENDOR_ATTR_BRP_ANT_LIMIT_MODE_FORCE: The hardware will + * use exactly the specified number of antennas for BRP. + */ +enum qca_wlan_vendor_attr_brp_ant_limit_mode { + QCA_WLAN_VENDOR_ATTR_BRP_ANT_LIMIT_MODE_DISABLE, + QCA_WLAN_VENDOR_ATTR_BRP_ANT_LIMIT_MODE_EFFECTIVE, + QCA_WLAN_VENDOR_ATTR_BRP_ANT_LIMIT_MODE_FORCE, + QCA_WLAN_VENDOR_ATTR_BRP_ANT_LIMIT_MODE_MAX +}; + +/** * enum qca_wlan_vendor_attr_dmg_rf_sector_cfg - Attributes for * DMG RF sector configuration for a single RF module. * The values are defined in a compact way which closely matches @@ -1977,13 +2627,13 @@ enum qca_wlan_vendor_attr_ll_stats_results { /* Unsigned int 8 bit value; 0:20 MHz, 1:40 MHz, 2:80 MHz, 3:160 MHz */ QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_BW = 40, /* Unsigned int 8 bit value; OFDM/CCK rate code would be as per IEEE Std - * in the units of 0.5 Mbps HT/VHT it would be MCS index */ + * in the units of 0.5 Mbps HT/VHT it would be MCS index + */ QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_MCS_INDEX = 41, /* Unsigned 32 bit value. Bit rate in units of 100 kbps */ QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_BIT_RATE = 42, - /* Attributes of type QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_STAT_* could be * nested within the peer info stats. */ @@ -2142,14 +2792,18 @@ enum qca_wlan_vendor_attr_ll_stats_results { /* Unsigned 32 bit value */ QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_PPDU_FAIL_CNT = 82, + /* Unsigned int 32 value. + * Pending MSDUs corresponding to respective AC. + */ + QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_PENDING_MSDU = 83, + /* keep last */ QCA_WLAN_VENDOR_ATTR_LL_STATS_AFTER_LAST, QCA_WLAN_VENDOR_ATTR_LL_STATS_MAX = QCA_WLAN_VENDOR_ATTR_LL_STATS_AFTER_LAST - 1, }; -enum qca_wlan_vendor_attr_ll_stats_type -{ +enum qca_wlan_vendor_attr_ll_stats_type { QCA_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_INVALID = 0, QCA_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_RADIO = 1, QCA_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_IFACE = 2, @@ -2266,10 +2920,14 @@ enum qca_wlan_vendor_tdls_trigger_mode { * limit feature. * @QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_USER: Select the SAR power * limits configured by %QCA_NL80211_VENDOR_SUBCMD_SET_SAR. + * @QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_V2_0: Select the SAR power + * limits version 2.0 configured by %QCA_NL80211_VENDOR_SUBCMD_SET_SAR. * * This enumerates the valid set of values that may be supplied for * attribute %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT in an instance of - * the %QCA_NL80211_VENDOR_SUBCMD_SET_SAR_LIMITS vendor command. + * the %QCA_NL80211_VENDOR_SUBCMD_SET_SAR_LIMITS vendor command or in + * the response to an instance of the + * %QCA_NL80211_VENDOR_SUBCMD_GET_SAR_LIMITS vendor command. */ enum qca_vendor_attr_sar_limits_selections { QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_BDF0 = 0, @@ -2279,6 +2937,7 @@ enum qca_vendor_attr_sar_limits_selections { QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_BDF4 = 4, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_NONE = 5, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_USER = 6, + QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_V2_0 = 7, }; /** @@ -2293,7 +2952,8 @@ enum qca_vendor_attr_sar_limits_selections { * attribute %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_MODULATION in an * instance of attribute %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC in an * instance of the %QCA_NL80211_VENDOR_SUBCMD_SET_SAR_LIMITS vendor - * command. + * command or in the response to an instance of the + * %QCA_NL80211_VENDOR_SUBCMD_GET_SAR_LIMITS vendor command. */ enum qca_vendor_attr_sar_limits_spec_modulations { QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_MODULATION_CCK = 0, @@ -2303,7 +2963,7 @@ enum qca_vendor_attr_sar_limits_spec_modulations { /** * enum qca_vendor_attr_sar_limits - Attributes for SAR power limits * - * @QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT: Optional (u32) value to + * @QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SAR_ENABLE: Optional (u32) value to * select which SAR power limit table should be used. Valid * values are enumerated in enum * %qca_vendor_attr_sar_limits_selections. The existing SAR @@ -2324,7 +2984,12 @@ enum qca_vendor_attr_sar_limits_spec_modulations { * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_CHAIN, and * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_MODULATION and always * contains as a payload the attribute - * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT. + * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT, + * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT_INDEX. + * Either %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT or + * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT_INDEX is + * needed based upon the value of + * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SAR_ENABLE. * * @QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_BAND: Optional (u32) value to * indicate for which band this specification applies. Valid @@ -2349,8 +3014,16 @@ enum qca_vendor_attr_sar_limits_spec_modulations { * @QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT: Required (u32) * value to specify the actual power limit value in units of 0.5 * dBm (i.e., a value of 11 represents 5.5 dBm). + * This is required, when %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT is + * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_USER. * - * These attributes are used with %QCA_NL80211_VENDOR_SUBCMD_SET_SAR_LIMITS. + * @QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT_INDEX: Required (u32) + * value to indicate SAR V2 indices (0 - 11) to select SAR V2 profiles. + * This is required, when %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT is + * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_V2_0. + * + * These attributes are used with %QCA_NL80211_VENDOR_SUBCMD_SET_SAR_LIMITS + * and %QCA_NL80211_VENDOR_SUBCMD_GET_SAR_LIMITS. */ enum qca_vendor_attr_sar_limits { QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_INVALID = 0, @@ -2361,6 +3034,7 @@ enum qca_vendor_attr_sar_limits { QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_CHAIN = 5, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_MODULATION = 6, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT = 7, + QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT_INDEX = 8, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_AFTER_LAST, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_MAX = @@ -2408,7 +3082,7 @@ enum qca_wlan_vendor_attr_logger_results { /* Unsigned 32-bit value; used to indicate the size of memory * dump to be allocated. - */ + */ QCA_WLAN_VENDOR_ATTR_LOGGER_RESULTS_MEMDUMP_SIZE = 2, /* keep last */ @@ -2838,6 +3512,7 @@ enum qca_wlan_vendor_attr_gscan_results { = 44, QCA_WLAN_VENDOR_ATTR_GSCAN_RESULTS_BUCKETS_SCANNED = 45, + /* Unsigned 32bit value; a GSCAN Capabilities attribute. */ QCA_WLAN_VENDOR_ATTR_CAPABILITIES_MAX_NUM_BLACKLISTED_BSSID = 46, @@ -2916,6 +3591,8 @@ enum qca_wlan_vendor_attr_pno_config_params { QCA_WLAN_VENDOR_ATTR_EPNO_SAME_NETWORK_BONUS = 20, QCA_WLAN_VENDOR_ATTR_EPNO_SECURE_BONUS = 21, QCA_WLAN_VENDOR_ATTR_EPNO_BAND5GHZ_BONUS = 22, + /* Unsigned 32-bit value, representing the PNO Request ID */ + QCA_WLAN_VENDOR_ATTR_PNO_CONFIG_REQUEST_ID = 23, /* keep last */ QCA_WLAN_VENDOR_ATTR_PNO_AFTER_LAST, @@ -2924,61 +3601,1967 @@ enum qca_wlan_vendor_attr_pno_config_params { }; /** - * qca_wlan_vendor_attr_nud_stats_set: attribute to vendor subcmd - * QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_SET. This carry the requisite - * information to start / stop the NUD stats collection. + * qca_wlan_vendor_acs_select_reason: This represents the different reasons why + * the ACS has to be triggered. These values are used by + * QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_REASON and + * QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_REASON + */ +enum qca_wlan_vendor_acs_select_reason { + /* Represents the reason that the ACS triggered during the AP start */ + QCA_WLAN_VENDOR_ACS_SELECT_REASON_INIT, + /* Represents the reason that DFS found with the current channel */ + QCA_WLAN_VENDOR_ACS_SELECT_REASON_DFS, + /* Represents the reason that LTE co-exist in the current band. */ + QCA_WLAN_VENDOR_ACS_SELECT_REASON_LTE_COEX, +}; + +/** + * qca_wlan_vendor_attr_external_acs_policy: Attribute values for + * QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_POLICY to the vendor subcmd + * QCA_NL80211_VENDOR_SUBCMD_EXTERNAL_ACS. This represents the + * external ACS policies to select the channels w.r.t. the PCL weights. + * (QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_PCL represents the channels and + * their PCL weights.) + * @QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_POLICY_PCL_MANDATORY: Mandatory to + * select a channel with non-zero PCL weight. + * @QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_POLICY_PCL_PREFERRED: Prefer a + * channel with non-zero PCL weight. + * + */ +enum qca_wlan_vendor_attr_external_acs_policy { + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_POLICY_PCL_PREFERRED, + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_POLICY_PCL_MANDATORY, +}; + +/** + * qca_wlan_vendor_channel_prop_flags: This represent the flags for a channel. + * This is used by QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_FLAGS. + */ +enum qca_wlan_vendor_channel_prop_flags { + /* Bits 0, 1, 2, and 3 are reserved */ + + /* Turbo channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_TURBO = 1 << 4, + /* CCK channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_CCK = 1 << 5, + /* OFDM channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_OFDM = 1 << 6, + /* 2.4 GHz spectrum channel. */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_2GHZ = 1 << 7, + /* 5 GHz spectrum channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_5GHZ = 1 << 8, + /* Only passive scan allowed */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_PASSIVE = 1 << 9, + /* Dynamic CCK-OFDM channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_DYN = 1 << 10, + /* GFSK channel (FHSS PHY) */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_GFSK = 1 << 11, + /* Radar found on channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_RADAR = 1 << 12, + /* 11a static turbo channel only */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_STURBO = 1 << 13, + /* Half rate channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HALF = 1 << 14, + /* Quarter rate channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_QUARTER = 1 << 15, + /* HT 20 channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HT20 = 1 << 16, + /* HT 40 with extension channel above */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HT40PLUS = 1 << 17, + /* HT 40 with extension channel below */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HT40MINUS = 1 << 18, + /* HT 40 intolerant */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HT40INTOL = 1 << 19, + /* VHT 20 channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_VHT20 = 1 << 20, + /* VHT 40 with extension channel above */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_VHT40PLUS = 1 << 21, + /* VHT 40 with extension channel below */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_VHT40MINUS = 1 << 22, + /* VHT 80 channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_VHT80 = 1 << 23, + /* HT 40 intolerant mark bit for ACS use */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HT40INTOLMARK = 1 << 24, + /* Channel temporarily blocked due to noise */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_BLOCKED = 1 << 25, + /* VHT 160 channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_VHT160 = 1 << 26, + /* VHT 80+80 channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_VHT80_80 = 1 << 27, + /* HE 20 channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HE20 = 1 << 28, + /* HE 40 with extension channel above */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HE40PLUS = 1 << 29, + /* HE 40 with extension channel below */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HE40MINUS = 1 << 30, + /* HE 40 intolerant */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HE40INTOL = 1 << 31, +}; + +/** + * qca_wlan_vendor_channel_prop_flags_2: This represents the flags for a + * channel, and is a continuation of qca_wlan_vendor_channel_prop_flags. This is + * used by QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_FLAGS_2. + */ +enum qca_wlan_vendor_channel_prop_flags_2 { + /* HE 40 intolerant mark bit for ACS use */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HE40INTOLMARK = 1 << 0, + /* HE 80 channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HE80 = 1 << 1, + /* HE 160 channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HE160 = 1 << 2, + /* HE 80+80 channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HE80_80 = 1 << 3, +}; + +/** + * qca_wlan_vendor_channel_prop_flags_ext: This represent the extended flags for + * each channel. This is used by + * QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_FLAG_EXT. + */ +enum qca_wlan_vendor_channel_prop_flags_ext { + /* Radar found on channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_EXT_RADAR_FOUND = 1 << 0, + /* DFS required on channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_EXT_DFS = 1 << 1, + /* DFS required on channel for 2nd band of 80+80 */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_EXT_DFS_CFREQ2 = 1 << 2, + /* If channel has been checked for DFS */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_EXT_DFS_CLEAR = 1 << 3, + /* Excluded in 802.11d */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_EXT_11D_EXCLUDED = 1 << 4, + /* Channel Switch Announcement received on this channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_EXT_CSA_RECEIVED = 1 << 5, + /* Ad-hoc is not allowed */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_EXT_DISALLOW_ADHOC = 1 << 6, + /* Station only channel */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_EXT_DISALLOW_HOSTAP = 1 << 7, + /* DFS radar history for slave device (STA mode) */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_EXT_HISTORY_RADAR = 1 << 8, + /* DFS CAC valid for slave device (STA mode) */ + QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_EXT_CAC_VALID = 1 << 9, +}; + +/** + * qca_wlan_vendor_external_acs_event_chan_info_attr: Represents per channel + * information. These attributes are sent as part of + * QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_CHAN_INFO. Each set of the following + * attributes correspond to a single channel. + */ +enum qca_wlan_vendor_external_acs_event_chan_info_attr { + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_INVALID = 0, + + /* A bitmask (u32) with flags specified in + * enum qca_wlan_vendor_channel_prop_flags. + */ + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_FLAGS = 1, + /* A bitmask (u32) with flags specified in + * enum qca_wlan_vendor_channel_prop_flags_ext. + */ + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_FLAG_EXT = 2, + /* frequency in MHz (u32) */ + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_FREQ = 3, + /* maximum regulatory transmission power (u32) */ + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_MAX_REG_POWER = 4, + /* maximum transmission power (u32) */ + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_MAX_POWER = 5, + /* minimum transmission power (u32) */ + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_MIN_POWER = 6, + /* regulatory class id (u8) */ + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_REG_CLASS_ID = 7, + /* maximum antenna gain in (u8) */ + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_ANTENNA_GAIN = 8, + /* VHT segment 0 (u8) */ + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_VHT_SEG_0 = 9, + /* VHT segment 1 (u8) */ + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_VHT_SEG_1 = 10, + /* A bitmask (u32) with flags specified in + * enum qca_wlan_vendor_channel_prop_flags_2. + */ + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_FLAGS_2 = 11, + + /* keep last */ + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_LAST, + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_MAX = + QCA_WLAN_VENDOR_EXTERNAL_ACS_EVENT_CHAN_INFO_ATTR_LAST - 1, +}; + +/** + * qca_wlan_vendor_attr_pcl: Represents attributes for + * preferred channel list (PCL). These attributes are sent as part of + * QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_PCL and + * QCA_NL80211_VENDOR_SUBCMD_GET_PREFERRED_FREQ_LIST. + */ +enum qca_wlan_vendor_attr_pcl { + QCA_WLAN_VENDOR_ATTR_PCL_INVALID = 0, + + /* Channel number (u8) */ + QCA_WLAN_VENDOR_ATTR_PCL_CHANNEL = 1, + /* Channel weightage (u8) */ + QCA_WLAN_VENDOR_ATTR_PCL_WEIGHT = 2, + /* Channel frequency (u32) in MHz */ + QCA_WLAN_VENDOR_ATTR_PCL_FREQ = 3, + /* Channel flags (u32) + * bit 0 set: channel to be used for GO role, + * bit 1 set: channel to be used on CLI role, + * bit 2 set: channel must be considered for operating channel + * selection & peer chosen operating channel should be + * one of the channels with this flag set, + * bit 3 set: channel should be excluded in GO negotiation + */ + QCA_WLAN_VENDOR_ATTR_PCL_FLAG = 4, +}; + +/** + * qca_wlan_vendor_attr_external_acs_event: Attribute to vendor sub-command + * QCA_NL80211_VENDOR_SUBCMD_EXTERNAL_ACS. This attribute will be sent by + * host driver. + */ +enum qca_wlan_vendor_attr_external_acs_event { + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_INVALID = 0, + + /* This reason (u8) refers to enum qca_wlan_vendor_acs_select_reason. + * This helps ACS module to understand why ACS needs to be started. + */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_REASON = 1, + /* Flag attribute to indicate if driver supports spectral scanning */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_IS_SPECTRAL_SUPPORTED = 2, + /* Flag attribute to indicate if 11ac is offloaded to firmware */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_IS_OFFLOAD_ENABLED = 3, + /* Flag attribute to indicate if driver provides additional channel + * capability as part of scan operation + */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_ADD_CHAN_STATS_SUPPORT = 4, + /* Flag attribute to indicate interface status is UP */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_AP_UP = 5, + /* Operating mode (u8) of interface. Takes one of enum nl80211_iftype + * values. + */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_SAP_MODE = 6, + /* Channel width (u8). It takes one of enum nl80211_chan_width values. + * This is the upper bound of channel width. ACS logic should try to get + * a channel with the specified width and if not found, look for lower + * values. + */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_CHAN_WIDTH = 7, + /* This (u8) will hold values of one of enum nl80211_bands */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_BAND = 8, + /* PHY/HW mode (u8). Takes one of enum qca_wlan_vendor_acs_hw_mode + * values + */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_PHY_MODE = 9, + /* Array of (u32) supported frequency list among which ACS should choose + * best frequency. + */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_FREQ_LIST = 10, + /* Preferred channel list by the driver which will have array of nested + * values as per enum qca_wlan_vendor_attr_pcl attribute. + */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_PCL = 11, + /* Array of nested attribute for each channel. It takes attr as defined + * in enum qca_wlan_vendor_external_acs_event_chan_info_attr. + */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_CHAN_INFO = 12, + /* External ACS policy such as PCL mandatory, PCL preferred, etc. + * It uses values defined in enum + * qca_wlan_vendor_attr_external_acs_policy. + */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_POLICY = 13, + /* Reference RF Operating Parameter (RROP) availability information + * (u16). It uses values defined in enum + * qca_wlan_vendor_attr_rropavail_info. + */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_RROPAVAIL_INFO = 14, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_LAST, + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_MAX = + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_EVENT_LAST - 1, +}; + +/** + * qca_wlan_vendor_attr_external_acs_channels: Attributes to vendor subcmd + * QCA_NL80211_VENDOR_SUBCMD_EXTERNAL_ACS. This carries a list of channels + * in priority order as decided after ACS operation in userspace. + */ +enum qca_wlan_vendor_attr_external_acs_channels { + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_INVALID = 0, + + /* One of reason code (u8) from enum qca_wlan_vendor_acs_select_reason + */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_REASON = 1, + + /* Array of nested values for each channel with following attributes: + * QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_BAND, + * QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_PRIMARY, + * QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_SECONDARY, + * QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_CENTER_SEG0, + * QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_CENTER_SEG1, + * QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_WIDTH + */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_LIST = 2, + /* This (u8) will hold values of one of enum nl80211_bands */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_BAND = 3, + /* Primary channel (u8) */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_PRIMARY = 4, + /* Secondary channel (u8) used for HT 40 MHz channels */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_SECONDARY = 5, + /* VHT seg0 channel (u8) */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_CENTER_SEG0 = 6, + /* VHT seg1 channel (u8) */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_CENTER_SEG1 = 7, + /* Channel width (u8). Takes one of enum nl80211_chan_width values. */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_WIDTH = 8, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_LAST, + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_MAX = + QCA_WLAN_VENDOR_ATTR_EXTERNAL_ACS_CHANNEL_LAST - 1 +}; + +enum qca_chip_power_save_failure_reason { + /* Indicates if the reason for the failure is due to a protocol + * layer/module. + */ + QCA_CHIP_POWER_SAVE_FAILURE_REASON_PROTOCOL = 0, + /* Indicates if the reason for the failure is due to a hardware issue. + */ + QCA_CHIP_POWER_SAVE_FAILURE_REASON_HARDWARE = 1, +}; + +/** + * qca_attr_chip_power_save_failure: Attributes to vendor subcmd + * QCA_NL80211_VENDOR_SUBCMD_CHIP_PWRSAVE_FAILURE. This carries the requisite + * information leading to the power save failure. + */ +enum qca_attr_chip_power_save_failure { + QCA_ATTR_CHIP_POWER_SAVE_FAILURE_INVALID = 0, + /* Reason to cause the power save failure. + * These reasons are represented by + * enum qca_chip_power_save_failure_reason. + */ + QCA_ATTR_CHIP_POWER_SAVE_FAILURE_REASON = 1, + + /* keep last */ + QCA_ATTR_CHIP_POWER_SAVE_FAILURE_LAST, + QCA_ATTR_CHIP_POWER_SAVE_FAILURE_MAX = + QCA_ATTR_CHIP_POWER_SAVE_FAILURE_LAST - 1, +}; + +/** + * qca_wlan_vendor_nud_stats_data_pkt_flags: Flag representing the various + * data types for which the stats have to get collected. + */ +enum qca_wlan_vendor_nud_stats_data_pkt_flags { + QCA_WLAN_VENDOR_NUD_STATS_DATA_ARP = 1 << 0, + QCA_WLAN_VENDOR_NUD_STATS_DATA_DNS = 1 << 1, + QCA_WLAN_VENDOR_NUD_STATS_DATA_TCP_HANDSHAKE = 1 << 2, + QCA_WLAN_VENDOR_NUD_STATS_DATA_ICMPV4 = 1 << 3, + QCA_WLAN_VENDOR_NUD_STATS_DATA_ICMPV6 = 1 << 4, + /* Used by QCA_ATTR_NUD_STATS_PKT_TYPE only in nud stats get + * to represent the stats of respective data type. + */ + QCA_WLAN_VENDOR_NUD_STATS_DATA_TCP_SYN = 1 << 5, + QCA_WLAN_VENDOR_NUD_STATS_DATA_TCP_SYN_ACK = 1 << 6, + QCA_WLAN_VENDOR_NUD_STATS_DATA_TCP_ACK = 1 << 7, +}; + +enum qca_wlan_vendor_nud_stats_set_data_pkt_info { + QCA_ATTR_NUD_STATS_DATA_PKT_INFO_INVALID = 0, + /* Represents the data packet type to be monitored (u32). + * Host driver tracks the stats corresponding to each data frame + * represented by these flags. + * These data packets are represented by + * enum qca_wlan_vendor_nud_stats_data_pkt_flags + */ + QCA_ATTR_NUD_STATS_DATA_PKT_INFO_TYPE = 1, + /* Name corresponding to the DNS frame for which the respective DNS + * stats have to get monitored (string). Max string length 255. + */ + QCA_ATTR_NUD_STATS_DATA_PKT_INFO_DNS_DOMAIN_NAME = 2, + /* source port on which the respective proto stats have to get + * collected (u32). + */ + QCA_ATTR_NUD_STATS_DATA_PKT_INFO_SRC_PORT = 3, + /* destination port on which the respective proto stats have to get + * collected (u32). + */ + QCA_ATTR_NUD_STATS_DATA_PKT_INFO_DEST_PORT = 4, + /* IPv4 address for which the destined data packets have to be + * monitored. (in network byte order), u32. + */ + QCA_ATTR_NUD_STATS_DATA_PKT_INFO_DEST_IPV4 = 5, + /* IPv6 address for which the destined data packets have to be + * monitored. (in network byte order), 16 bytes array. + */ + QCA_ATTR_NUD_STATS_DATA_PKT_INFO_DEST_IPV6 = 6, + + QCA_ATTR_NUD_STATS_DATA_PKT_INFO_LAST, + QCA_ATTR_NUD_STATS_DATA_PKT_INFO_MAX = + QCA_ATTR_NUD_STATS_DATA_PKT_INFO_LAST - 1, +}; + +/** + * qca_wlan_vendor_attr_nud_stats_set: Attributes to vendor subcmd + * QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_SET. This carries the requisite + * information to start/stop the NUD statistics collection. */ enum qca_attr_nud_stats_set { - QCA_ATTR_NUD_STATS_SET_INVALID = 0, + QCA_ATTR_NUD_STATS_SET_INVALID = 0, - /* Flag to Start / Stop the NUD stats collection - * Start - If included , Stop - If not included - */ - QCA_ATTR_NUD_STATS_SET_START = 1, - /* IPv4 address of Default Gateway (in network byte order) */ - QCA_ATTR_NUD_STATS_GW_IPV4 = 2, + /* Flag to start/stop the NUD statistics collection. + * Start - If included, Stop - If not included + */ + QCA_ATTR_NUD_STATS_SET_START = 1, + /* IPv4 address of the default gateway (in network byte order), u32 */ + QCA_ATTR_NUD_STATS_GW_IPV4 = 2, + /* Represents the list of data packet types to be monitored. + * Host driver tracks the stats corresponding to each data frame + * represented by these flags. + * These data packets are represented by + * enum qca_wlan_vendor_nud_stats_set_data_pkt_info + */ + QCA_ATTR_NUD_STATS_SET_DATA_PKT_INFO = 3, - /* keep last */ - QCA_ATTR_NUD_STATS_SET_LAST, - QCA_ATTR_NUD_STATS_SET_MAX = - QCA_ATTR_NUD_STATS_SET_LAST - 1, + /* keep last */ + QCA_ATTR_NUD_STATS_SET_LAST, + QCA_ATTR_NUD_STATS_SET_MAX = + QCA_ATTR_NUD_STATS_SET_LAST - 1, +}; + +enum qca_attr_nud_data_stats { + QCA_ATTR_NUD_DATA_STATS_INVALID = 0, + /* Data packet type for which the stats are collected (u32). + * Represented by enum qca_wlan_vendor_nud_stats_data_pkt_flags + */ + QCA_ATTR_NUD_STATS_PKT_TYPE = 1, + /* Name corresponding to the DNS frame for which the respective DNS + * stats are monitored (string). Max string length 255. + */ + QCA_ATTR_NUD_STATS_PKT_DNS_DOMAIN_NAME = 2, + /* source port on which the respective proto stats are collected (u32). + */ + QCA_ATTR_NUD_STATS_PKT_SRC_PORT = 3, + /* destination port on which the respective proto stats are collected + * (u32). + */ + QCA_ATTR_NUD_STATS_PKT_DEST_PORT = 4, + /* IPv4 address for which the destined data packets have to be + * monitored. (in network byte order), u32. + */ + QCA_ATTR_NUD_STATS_PKT_DEST_IPV4 = 5, + /* IPv6 address for which the destined data packets have to be + * monitored. (in network byte order), 16 bytes array. + */ + QCA_ATTR_NUD_STATS_PKT_DEST_IPV6 = 6, + /* Data packet Request count received from netdev (u32). */ + QCA_ATTR_NUD_STATS_PKT_REQ_COUNT_FROM_NETDEV = 7, + /* Data packet Request count sent to lower MAC from upper MAC (u32). */ + QCA_ATTR_NUD_STATS_PKT_REQ_COUNT_TO_LOWER_MAC = 8, + /* Data packet Request count received by lower MAC from upper MAC + * (u32) + */ + QCA_ATTR_NUD_STATS_PKT_REQ_RX_COUNT_BY_LOWER_MAC = 9, + /* Data packet Request count successfully transmitted by the device + * (u32) + */ + QCA_ATTR_NUD_STATS_PKT_REQ_COUNT_TX_SUCCESS = 10, + /* Data packet Response count received by lower MAC (u32) */ + QCA_ATTR_NUD_STATS_PKT_RSP_RX_COUNT_BY_LOWER_MAC = 11, + /* Data packet Response count received by upper MAC (u32) */ + QCA_ATTR_NUD_STATS_PKT_RSP_RX_COUNT_BY_UPPER_MAC = 12, + /* Data packet Response count delivered to netdev (u32) */ + QCA_ATTR_NUD_STATS_PKT_RSP_COUNT_TO_NETDEV = 13, + /* Data Packet Response count that are dropped out of order (u32) */ + QCA_ATTR_NUD_STATS_PKT_RSP_COUNT_OUT_OF_ORDER_DROP = 14, + + /* keep last */ + QCA_ATTR_NUD_DATA_STATS_LAST, + QCA_ATTR_NUD_DATA_STATS_MAX = + QCA_ATTR_NUD_DATA_STATS_LAST - 1, }; /** - * qca_attr_nud_stats_get: attribute to vendor subcmd - * QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_GET. This carry the requisite - * NUD stats collected when queried. + * qca_attr_nud_stats_get: Attributes to vendor subcmd + * QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_GET. This carries the requisite + * NUD statistics collected when queried. */ enum qca_attr_nud_stats_get { - QCA_ATTR_NUD_STATS_GET_INVALID = 0, - /* ARP Request Count from net dev */ - QCA_ATTR_NUD_STATS_ARP_REQ_COUNT_FROM_NETDEV = 1, - /* ARP Request Count sent to lower MAC from upper MAC */ - QCA_ATTR_NUD_STATS_ARP_REQ_COUNT_TO_LOWER_MAC = 2, - /* ARP Request Count received by lower MAC from upper MAC */ - QCA_ATTR_NUD_STATS_ARP_REQ_RX_COUNT_BY_LOWER_MAC = 3, - /* ARP Request Count successfully transmitted by the device */ - QCA_ATTR_NUD_STATS_ARP_REQ_COUNT_TX_SUCCESS = 4, - /* ARP Response Count received by lower MAC */ - QCA_ATTR_NUD_STATS_ARP_RSP_RX_COUNT_BY_LOWER_MAC = 5, - /* ARP Response Count received by upper MAC */ - QCA_ATTR_NUD_STATS_ARP_RSP_RX_COUNT_BY_UPPER_MAC = 6, - /* ARP Response Count delivered to netdev */ - QCA_ATTR_NUD_STATS_ARP_RSP_COUNT_TO_NETDEV = 7, - /* ARP Response Count delivered to netdev */ - QCA_ATTR_NUD_STATS_ARP_RSP_COUNT_OUT_OF_ORDER_DROP = 8, - /* Flag indicating if the Stations Link to AP is active. - * Active Link - If exists, Inactive link - If not included - */ - QCA_ATTR_NUD_STATS_AP_LINK_ACTIVE= 9, - /* Flag indicating if there is any Duplicate Address Detected(DAD). - * Yes - If Detected, No - If not detected. - */ - QCA_ATTR_NUD_STATS_IS_DAD = 10, - - /* keep last */ - QCA_ATTR_NUD_STATS_GET_LAST, - QCA_ATTR_NUD_STATS_GET_MAX = - QCA_ATTR_NUD_STATS_GET_LAST - 1, + QCA_ATTR_NUD_STATS_GET_INVALID = 0, + /* ARP Request count from netdev (u32) */ + QCA_ATTR_NUD_STATS_ARP_REQ_COUNT_FROM_NETDEV = 1, + /* ARP Request count sent to lower MAC from upper MAC (u32) */ + QCA_ATTR_NUD_STATS_ARP_REQ_COUNT_TO_LOWER_MAC = 2, + /* ARP Request count received by lower MAC from upper MAC (u32) */ + QCA_ATTR_NUD_STATS_ARP_REQ_RX_COUNT_BY_LOWER_MAC = 3, + /* ARP Request count successfully transmitted by the device (u32) */ + QCA_ATTR_NUD_STATS_ARP_REQ_COUNT_TX_SUCCESS = 4, + /* ARP Response count received by lower MAC (u32) */ + QCA_ATTR_NUD_STATS_ARP_RSP_RX_COUNT_BY_LOWER_MAC = 5, + /* ARP Response count received by upper MAC (u32) */ + QCA_ATTR_NUD_STATS_ARP_RSP_RX_COUNT_BY_UPPER_MAC = 6, + /* ARP Response count delivered to netdev (u32) */ + QCA_ATTR_NUD_STATS_ARP_RSP_COUNT_TO_NETDEV = 7, + /* ARP Response count dropped due to out of order reception (u32) */ + QCA_ATTR_NUD_STATS_ARP_RSP_COUNT_OUT_OF_ORDER_DROP = 8, + /* Flag indicating if the station's link to the AP is active. + * Active Link - If included, Inactive link - If not included + */ + QCA_ATTR_NUD_STATS_AP_LINK_ACTIVE = 9, + /* Flag indicating if there is any duplicate address detected (DAD). + * Yes - If detected, No - If not detected. + */ + QCA_ATTR_NUD_STATS_IS_DAD = 10, + /* List of Data packet types for which the stats are requested. + * This list does not carry ARP stats as they are done by the + * above attributes. Represented by enum qca_attr_nud_data_stats. + */ + QCA_ATTR_NUD_STATS_DATA_PKT_STATS = 11, + + /* keep last */ + QCA_ATTR_NUD_STATS_GET_LAST, + QCA_ATTR_NUD_STATS_GET_MAX = + QCA_ATTR_NUD_STATS_GET_LAST - 1, +}; + +enum qca_wlan_btm_candidate_status { + QCA_STATUS_ACCEPT = 0, + QCA_STATUS_REJECT_EXCESSIVE_FRAME_LOSS_EXPECTED = 1, + QCA_STATUS_REJECT_EXCESSIVE_DELAY_EXPECTED = 2, + QCA_STATUS_REJECT_INSUFFICIENT_QOS_CAPACITY = 3, + QCA_STATUS_REJECT_LOW_RSSI = 4, + QCA_STATUS_REJECT_HIGH_INTERFERENCE = 5, + QCA_STATUS_REJECT_UNKNOWN = 6, +}; + +enum qca_wlan_vendor_attr_btm_candidate_info { + QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO_INVALID = 0, + + /* 6-byte MAC address representing the BSSID of transition candidate */ + QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO_BSSID = 1, + /* Unsigned 32-bit value from enum qca_wlan_btm_candidate_status + * returned by the driver. It says whether the BSSID provided in + * QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO_BSSID is acceptable by + * the driver, if not it specifies the reason for rejection. + * Note that the user-space can overwrite the transition reject reason + * codes provided by driver based on more information. + */ + QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO_STATUS = 2, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO_MAX = + QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO_AFTER_LAST - 1, +}; + +enum qca_attr_trace_level { + QCA_ATTR_TRACE_LEVEL_INVALID = 0, + /* + * Nested array of the following attributes: + * QCA_ATTR_TRACE_LEVEL_MODULE, + * QCA_ATTR_TRACE_LEVEL_MASK. + */ + QCA_ATTR_TRACE_LEVEL_PARAM = 1, + /* + * Specific QCA host driver module. Please refer to the QCA host + * driver implementation to get the specific module ID. + */ + QCA_ATTR_TRACE_LEVEL_MODULE = 2, + /* Different trace level masks represented in the QCA host driver. */ + QCA_ATTR_TRACE_LEVEL_MASK = 3, + + /* keep last */ + QCA_ATTR_TRACE_LEVEL_AFTER_LAST, + QCA_ATTR_TRACE_LEVEL_MAX = + QCA_ATTR_TRACE_LEVEL_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_get_he_capabilities - IEEE 802.11ax HE capabilities + */ +enum qca_wlan_vendor_attr_get_he_capabilities { + QCA_WLAN_VENDOR_ATTR_HE_CAPABILITIES_INVALID = 0, + /* Whether HE capabilities is supported + * (u8 attribute: 0 = not supported, 1 = supported) + */ + QCA_WLAN_VENDOR_ATTR_HE_SUPPORTED = 1, + /* HE PHY capabilities, array of 3 u32 values */ + QCA_WLAN_VENDOR_ATTR_PHY_CAPAB = 2, + /* HE MAC capabilities (u32 attribute) */ + QCA_WLAN_VENDOR_ATTR_MAC_CAPAB = 3, + /* HE MCS map (u32 attribute) */ + QCA_WLAN_VENDOR_ATTR_HE_MCS = 4, + /* Number of SS (u32 attribute) */ + QCA_WLAN_VENDOR_ATTR_NUM_SS = 5, + /* RU count (u32 attribute) */ + QCA_WLAN_VENDOR_ATTR_RU_IDX_MASK = 6, + /* PPE threshold data, array of 8 u32 values */ + QCA_WLAN_VENDOR_ATTR_PPE_THRESHOLD = 7, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_HE_CAPABILITIES_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_HE_CAPABILITIES_MAX = + QCA_WLAN_VENDOR_ATTR_HE_CAPABILITIES_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_spectral_scan - Spectral scan config parameters + */ +enum qca_wlan_vendor_attr_spectral_scan { + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_INVALID = 0, + /* Number of times the chip enters spectral scan mode before + * deactivating spectral scans. When set to 0, chip will enter spectral + * scan mode continuously. u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_SCAN_COUNT = 1, + /* Spectral scan period. Period increment resolution is 256*Tclk, + * where Tclk = 1/44 MHz (Gmode), 1/40 MHz (Amode). u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_SCAN_PERIOD = 2, + /* Spectral scan priority. u32 attribute. */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_PRIORITY = 3, + /* Number of FFT data points to compute. u32 attribute. */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FFT_SIZE = 4, + /* Enable targeted gain change before starting the spectral scan FFT. + * u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_GC_ENA = 5, + /* Restart a queued spectral scan. u32 attribute. */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_RESTART_ENA = 6, + /* Noise floor reference number for the calculation of bin power. + * u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_NOISE_FLOOR_REF = 7, + /* Disallow spectral scan triggers after TX/RX packets by setting + * this delay value to roughly SIFS time period or greater. + * u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_INIT_DELAY = 8, + /* Number of strong bins (inclusive) per sub-channel, below + * which a signal is declared a narrow band tone. u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_NB_TONE_THR = 9, + /* Specify the threshold over which a bin is declared strong (for + * scan bandwidth analysis). u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_STR_BIN_THR = 10, + /* Spectral scan report mode. u32 attribute. */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_WB_RPT_MODE = 11, + /* RSSI report mode, if the ADC RSSI is below + * QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_RSSI_THR, + * then FFTs will not trigger, but timestamps and summaries get + * reported. u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_RSSI_RPT_MODE = 12, + /* ADC RSSI must be greater than or equal to this threshold (signed dB) + * to ensure spectral scan reporting with normal error code. + * u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_RSSI_THR = 13, + /* Format of frequency bin magnitude for spectral scan triggered FFTs: + * 0: linear magnitude, 1: log magnitude (20*log10(lin_mag)). + * u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_PWR_FORMAT = 14, + /* Format of FFT report to software for spectral scan triggered FFTs. + * 0: No FFT report (only spectral scan summary report) + * 1: 2-dword summary of metrics for each completed FFT + spectral scan + * report + * 2: 2-dword summary of metrics for each completed FFT + 1x-oversampled + * bins (in-band) per FFT + spectral scan summary report + * 3: 2-dword summary of metrics for each completed FFT + 2x-oversampled + * bins (all) per FFT + spectral scan summary report + * u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_RPT_MODE = 15, + /* Number of LSBs to shift out in order to scale the FFT bins. + * u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_BIN_SCALE = 16, + /* Set to 1 (with spectral_scan_pwr_format=1), to report bin magnitudes + * in dBm power. u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_DBM_ADJ = 17, + /* Per chain enable mask to select input ADC for search FFT. + * u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_CHN_MASK = 18, + /* An unsigned 64-bit integer provided by host driver to identify the + * spectral scan request. This attribute is included in the scan + * response message for @QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_START + * and used as an attribute in + * @QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_STOP to identify the + * specific scan to be stopped. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_COOKIE = 19, + /* Skip interval for FFT reports. u32 attribute */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FFT_PERIOD = 20, + /* Set to report only one set of FFT results. + * u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_SHORT_REPORT = 21, + /* Debug level for spectral module in driver. + * 0 : Verbosity level 0 + * 1 : Verbosity level 1 + * 2 : Verbosity level 2 + * 3 : Matched filterID display + * 4 : One time dump of FFT report + * u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_DEBUG_LEVEL = 22, + /* Type of spectral scan request. u32 attribute. + * It uses values defined in enum + * qca_wlan_vendor_attr_spectral_scan_request_type. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_REQUEST_TYPE = 23, + + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX = + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_spectral_diag_stats - Used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_DIAG_STATS. + */ +enum qca_wlan_vendor_attr_spectral_diag_stats { + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_DIAG_INVALID = 0, + /* Number of spectral TLV signature mismatches. + * u64 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_DIAG_SIG_MISMATCH = 1, + /* Number of spectral phyerror events with insufficient length when + * parsing for secondary 80 search FFT report. u64 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_DIAG_SEC80_SFFT_INSUFFLEN = 2, + /* Number of spectral phyerror events without secondary 80 + * search FFT report. u64 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_DIAG_NOSEC80_SFFT = 3, + /* Number of spectral phyerror events with vht operation segment 1 id + * mismatches in search fft report. u64 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_DIAG_VHTSEG1ID_MISMATCH = 4, + /* Number of spectral phyerror events with vht operation segment 2 id + * mismatches in search fft report. u64 attribute. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_DIAG_VHTSEG2ID_MISMATCH = 5, + + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_DIAG_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_DIAG_MAX = + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_DIAG_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_spectral_cap - Used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_CAP_INFO. + */ +enum qca_wlan_vendor_attr_spectral_cap { + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_INVALID = 0, + /* Flag attribute to indicate phydiag capability */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_PHYDIAG = 1, + /* Flag attribute to indicate radar detection capability */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_RADAR = 2, + /* Flag attribute to indicate spectral capability */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_SPECTRAL = 3, + /* Flag attribute to indicate advanced spectral capability */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_ADVANCED_SPECTRAL = 4, + /* Spectral hardware generation. u32 attribute. + * It uses values defined in enum + * qca_wlan_vendor_spectral_scan_cap_hw_gen. + */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_HW_GEN = 5, + + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_MAX = + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_spectral_scan_status - used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_STATUS. + */ +enum qca_wlan_vendor_attr_spectral_scan_status { + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_STATUS_INVALID = 0, + /* Flag attribute to indicate whether spectral scan is enabled */ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_STATUS_IS_ENABLED = 1, + /* Flag attribute to indicate whether spectral scan is in progress*/ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_STATUS_IS_ACTIVE = 2, + + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_STATUS_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_STATUS_MAX = + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_STATUS_AFTER_LAST - 1, }; + +/** + * qca_wlan_vendor_attr_spectral_scan_request_type: Attribute values for + * QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_REQUEST_TYPE to the vendor subcmd + * QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_START. This represents the + * spectral scan request types. + * @QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_REQUEST_TYPE_SCAN_AND_CONFIG: Request to + * set the spectral parameters and start scan. + * @QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_REQUEST_TYPE_SCAN: Request to + * only set the spectral parameters. + * @QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_REQUEST_TYPE_CONFIG: Request to + * only start the spectral scan. + */ +enum qca_wlan_vendor_attr_spectral_scan_request_type { + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_REQUEST_TYPE_SCAN_AND_CONFIG, + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_REQUEST_TYPE_SCAN, + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_REQUEST_TYPE_CONFIG, +}; + +/** + * qca_wlan_vendor_spectral_scan_cap_hw_gen: Attribute values for + * QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_HW_GEN to the vendor subcmd + * QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_CAP_INFO. This represents the + * spectral hardware generation. + * @QCA_WLAN_VENDOR_SPECTRAL_SCAN_CAP_HW_GEN_1: generation 1 + * @QCA_WLAN_VENDOR_SPECTRAL_SCAN_CAP_HW_GEN_2: generation 2 + * @QCA_WLAN_VENDOR_SPECTRAL_SCAN_CAP_HW_GEN_3: generation 3 + */ +enum qca_wlan_vendor_spectral_scan_cap_hw_gen { + QCA_WLAN_VENDOR_SPECTRAL_SCAN_CAP_HW_GEN_1 = 0, + QCA_WLAN_VENDOR_SPECTRAL_SCAN_CAP_HW_GEN_2 = 1, + QCA_WLAN_VENDOR_SPECTRAL_SCAN_CAP_HW_GEN_3 = 2, +}; + +enum qca_wlan_vendor_tos { + QCA_WLAN_VENDOR_TOS_BK = 0, + QCA_WLAN_VENDOR_TOS_BE = 1, + QCA_WLAN_VENDOR_TOS_VI = 2, + QCA_WLAN_VENDOR_TOS_VO = 3, +}; + +/** + * enum qca_wlan_vendor_attr_active_tos - Used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_ACTIVE_TOS. + */ +enum qca_wlan_vendor_attr_active_tos { + QCA_WLAN_VENDOR_ATTR_ACTIVE_TOS_INVALID = 0, + /* Type Of Service - Represented by qca_wlan_vendor_tos */ + QCA_WLAN_VENDOR_ATTR_ACTIVE_TOS = 1, + /* Flag attribute representing the start (attribute included) or stop + * (attribute not included) of the respective TOS. + */ + QCA_WLAN_VENDOR_ATTR_ACTIVE_TOS_START = 2, +}; + +enum qca_wlan_vendor_hang_reason { + /* Unspecified reason */ + QCA_WLAN_HANG_REASON_UNSPECIFIED = 0, + /* No Map for the MAC entry for the received frame */ + QCA_WLAN_HANG_RX_HASH_NO_ENTRY_FOUND = 1, + /* Peer deletion timeout happened */ + QCA_WLAN_HANG_PEER_DELETION_TIMEDOUT = 2, + /* Peer unmap timeout */ + QCA_WLAN_HANG_PEER_UNMAP_TIMEDOUT = 3, + /* Scan request timed out */ + QCA_WLAN_HANG_SCAN_REQ_EXPIRED = 4, + /* Consecutive Scan attempt failures */ + QCA_WLAN_HANG_SCAN_ATTEMPT_FAILURES = 5, + /* Unable to get the message buffer */ + QCA_WLAN_HANG_GET_MSG_BUFF_FAILURE = 6, + /* Current command processing is timedout */ + QCA_WLAN_HANG_ACTIVE_LIST_TIMEOUT = 7, + /* Timeout for an ACK from FW for suspend request */ + QCA_WLAN_HANG_SUSPEND_TIMEOUT = 8, + /* Timeout for an ACK from FW for resume request */ + QCA_WLAN_HANG_RESUME_TIMEOUT = 9, + /* Transmission timeout for consecutive data frames */ + QCA_WLAN_HANG_TRANSMISSIONS_TIMEOUT = 10, + /* Timeout for the TX completion status of data frame */ + QCA_WLAN_HANG_TX_COMPLETE_TIMEOUT = 11, + /* DXE failure for TX/RX, DXE resource unavailability */ + QCA_WLAN_HANG_DXE_FAILURE = 12, + /* WMI pending commands exceed the maximum count */ + QCA_WLAN_HANG_WMI_EXCEED_MAX_PENDING_CMDS = 13, +}; + +/** + * enum qca_wlan_vendor_attr_hang - Used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_HANG. + */ +enum qca_wlan_vendor_attr_hang { + QCA_WLAN_VENDOR_ATTR_HANG_INVALID = 0, + /* Reason for the hang - u32 attribute with a value from enum + * qca_wlan_vendor_hang_reason. + */ + QCA_WLAN_VENDOR_ATTR_HANG_REASON = 1, + + QCA_WLAN_VENDOR_ATTR_HANG_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_HANG_MAX = + QCA_WLAN_VENDOR_ATTR_HANG_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_flush_pending - Attributes for + * flushing pending traffic in firmware. + * + * @QCA_WLAN_VENDOR_ATTR_PEER_ADDR: Configure peer MAC address. + * @QCA_WLAN_VENDOR_ATTR_AC: Configure access category of the pending + * packets. It is u8 value with bit 0~3 represent AC_BE, AC_BK, + * AC_VI, AC_VO respectively. Set the corresponding bit to 1 to + * flush packets with access category. + */ +enum qca_wlan_vendor_attr_flush_pending { + QCA_WLAN_VENDOR_ATTR_FLUSH_PENDING_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_PEER_ADDR = 1, + QCA_WLAN_VENDOR_ATTR_AC = 2, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_FLUSH_PENDING_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_FLUSH_PENDING_MAX = + QCA_WLAN_VENDOR_ATTR_FLUSH_PENDING_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_rropavail_info - Specifies whether Representative + * RF Operating Parameter (RROP) information is available, and if so, at which + * point in the application-driver interaction sequence it can be retrieved by + * the application from the driver. This point may vary by architecture and + * other factors. This is a u16 value. + */ +enum qca_wlan_vendor_attr_rropavail_info { + /* RROP information is unavailable. */ + QCA_WLAN_VENDOR_ATTR_RROPAVAIL_INFO_UNAVAILABLE, + /* RROP information is available and the application can retrieve the + * information after receiving an QCA_NL80211_VENDOR_SUBCMD_EXTERNAL_ACS + * event from the driver. + */ + QCA_WLAN_VENDOR_ATTR_RROPAVAIL_INFO_EXTERNAL_ACS_START, + /* RROP information is available only after a vendor specific scan + * (requested using QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN) has + * successfully completed. The application can retrieve the information + * after receiving the QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE event from + * the driver. + */ + QCA_WLAN_VENDOR_ATTR_RROPAVAIL_INFO_VSCAN_END, +}; + +/** + * enum qca_wlan_vendor_attr_rrop_info - Specifies vendor specific + * Representative RF Operating Parameter (RROP) information. It is sent for the + * vendor command QCA_NL80211_VENDOR_SUBCMD_GET_RROP_INFO. This information is + * intended for use by external Auto Channel Selection applications. It provides + * guidance values for some RF parameters that are used by the system during + * operation. These values could vary by channel, band, radio, and so on. + */ +enum qca_wlan_vendor_attr_rrop_info { + QCA_WLAN_VENDOR_ATTR_RROP_INFO_INVALID = 0, + + /* Representative Tx Power List (RTPL) which has an array of nested + * values as per attributes in enum qca_wlan_vendor_attr_rtplinst. + */ + QCA_WLAN_VENDOR_ATTR_RROP_INFO_RTPL = 1, + + QCA_WLAN_VENDOR_ATTR_RROP_INFO_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_RROP_INFO_MAX = + QCA_WLAN_VENDOR_ATTR_RROP_INFO_AFTER_LAST - 1 +}; + +/** + * enum qca_wlan_vendor_attr_rtplinst - Specifies attributes for individual list + * entry instances in the Representative Tx Power List (RTPL). It provides + * simplified power values intended for helping external Auto channel Selection + * applications compare potential Tx power performance between channels, other + * operating conditions remaining identical. These values are not necessarily + * the actual Tx power values that will be used by the system. They are also not + * necessarily the max or average values that will be used. Instead, they are + * relative, summarized keys for algorithmic use computed by the driver or + * underlying firmware considering a number of vendor specific factors. + */ +enum qca_wlan_vendor_attr_rtplinst { + QCA_WLAN_VENDOR_ATTR_RTPLINST_INVALID = 0, + + /* Primary channel number (u8) */ + QCA_WLAN_VENDOR_ATTR_RTPLINST_PRIMARY = 1, + /* Representative Tx power in dBm (s32) with emphasis on throughput. */ + QCA_WLAN_VENDOR_ATTR_RTPLINST_TXPOWER_THROUGHPUT = 2, + /* Representative Tx power in dBm (s32) with emphasis on range. */ + QCA_WLAN_VENDOR_ATTR_RTPLINST_TXPOWER_RANGE = 3, + + QCA_WLAN_VENDOR_ATTR_RTPLINST_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_RTPLINST_MAX = + QCA_WLAN_VENDOR_ATTR_RTPLINST_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_config_latency_level - Level for + * wlan latency module. + * + * There will be various of Wi-Fi functionality like scan/roaming/adaptive + * power saving which would causing data exchange out of service, this + * would be a big impact on latency. For latency sensitive applications over + * Wi-Fi are intolerant to such operations and thus would configure them + * to meet their respective needs. It is well understood by such applications + * that altering the default behavior would degrade the Wi-Fi functionality + * w.r.t the above pointed WLAN operations. + * + * @QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_NORMAL: + * Default WLAN operation level which throughput orientated. + * @QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_MODERATE: + * Use moderate level to improve latency by limit scan duration. + * @QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_LOW: + * Use low latency level to benifit application like concurrent + * downloading or video streaming via constraint scan/adaptive PS. + * @QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_ULTRALOW: + * Use ultra low latency level to benefit for gaming/voice + * application via constraint scan/roaming/adaptive PS. + */ +enum qca_wlan_vendor_attr_config_latency_level { + QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_NORMAL = 1, + QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_MODERATE = 2, + QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_LOW = 3, + QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_ULTRALOW = 4, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_MAX = + QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_wlan_mac - Used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_WLAN_MAC_INFO. + */ +enum qca_wlan_vendor_attr_mac { + QCA_WLAN_VENDOR_ATTR_MAC_INVALID = 0, + + /* MAC mode info list which has an array of nested values as + * per attributes in enum qca_wlan_vendor_attr_mac_mode_info. + */ + QCA_WLAN_VENDOR_ATTR_MAC_INFO = 1, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_MAC_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_MAC_MAX = + QCA_WLAN_VENDOR_ATTR_MAC_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_mac_iface_info - Information of the connected + * Wi-Fi netdev interface on a respective MAC. + * Used by the attribute QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO. + */ +enum qca_wlan_vendor_attr_mac_iface_info { + QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_INVALID = 0, + /* Wi-Fi netdev's interface index (u32) */ + QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_IFINDEX = 1, + /* Associated frequency in MHz of the connected Wi-Fi interface (u32) */ + QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_FREQ = 2, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_MAX = + QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_mac_info - Points to MAC the information. + * Used by the attribute QCA_WLAN_VENDOR_ATTR_MAC_INFO of the + * vendor command QCA_NL80211_VENDOR_SUBCMD_WLAN_MAC_INFO. + */ +enum qca_wlan_vendor_attr_mac_info { + QCA_WLAN_VENDOR_ATTR_MAC_INFO_INVALID = 0, + /* Hardware MAC ID associated for the MAC (u32) */ + QCA_WLAN_VENDOR_ATTR_MAC_INFO_MAC_ID = 1, + /* Band supported by the MAC at a given point. + * This is a u32 bitmask of BIT(NL80211_BAND_*) as described in %enum + * nl80211_band. + */ + QCA_WLAN_VENDOR_ATTR_MAC_INFO_BAND = 2, + /* Refers to list of WLAN netdev interfaces associated with this MAC. + * Represented by enum qca_wlan_vendor_attr_mac_iface_info. + */ + QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO = 3, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_MAC_INFO_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_MAC_INFO_MAX = + QCA_WLAN_VENDOR_ATTR_MAC_INFO_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_get_logger_features - Used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET. + */ +enum qca_wlan_vendor_attr_get_logger_features { + QCA_WLAN_VENDOR_ATTR_LOGGER_INVALID = 0, + /* Unsigned 32-bit enum value of wifi_logger_supported_features */ + QCA_WLAN_VENDOR_ATTR_LOGGER_SUPPORTED = 1, + /* keep last */ + QCA_WLAN_VENDOR_ATTR_LOGGER_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_LOGGER_MAX = + QCA_WLAN_VENDOR_ATTR_LOGGER_AFTER_LAST - 1, +}; + +/** + * enum wifi_logger_supported_features - Values for supported logger features + */ +enum wifi_logger_supported_features { + WIFI_LOGGER_MEMORY_DUMP_FEATURE = (1 << (0)), + WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_FEATURE = (1 << (1)), + WIFI_LOGGER_CONNECT_EVENT_FEATURE = (1 << (2)), + WIFI_LOGGER_POWER_EVENT_FEATURE = (1 << (3)), + WIFI_LOGGER_WAKE_LOCK_FEATURE = (1 << (4)), + WIFI_LOGGER_VERBOSE_FEATURE = (1 << (5)), + WIFI_LOGGER_WATCHDOG_TIMER_FEATURE = (1 << (6)), + WIFI_LOGGER_DRIVER_DUMP_FEATURE = (1 << (7)), + WIFI_LOGGER_PACKET_FATE_FEATURE = (1 << (8)), +}; + +/** + * enum qca_wlan_tdls_caps_features_supported - Values for TDLS get + * capabilities features + */ +enum qca_wlan_tdls_caps_features_supported { + WIFI_TDLS_SUPPORT = (1 << (0)), + WIFI_TDLS_EXTERNAL_CONTROL_SUPPORT = (1 << (1)), + WIFI_TDLS_OFFCHANNEL_SUPPORT = (1 << (2)) +}; + +/** + * enum qca_wlan_vendor_attr_tdls_get_capabilities - Used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_CAPABILITIES. + */ +enum qca_wlan_vendor_attr_tdls_get_capabilities { + QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_INVALID = 0, + /* Indicates the max concurrent sessions */ + /* Unsigned 32-bit value */ + QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_MAX_CONC_SESSIONS, + /* Indicates the support for features */ + /* Unsigned 32-bit bitmap qca_wlan_tdls_caps_features_supported + */ + QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_FEATURES_SUPPORTED, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_MAX = + QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_offloaded_packets_sending_control - Offload packets control + * command used as value for the attribute + * QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_SENDING_CONTROL. + */ +enum qca_wlan_offloaded_packets_sending_control { + QCA_WLAN_OFFLOADED_PACKETS_SENDING_CONTROL_INVALID = 0, + QCA_WLAN_OFFLOADED_PACKETS_SENDING_START, + QCA_WLAN_OFFLOADED_PACKETS_SENDING_STOP +}; + +/** + * enum qca_wlan_vendor_attr_offloaded_packets - Used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_OFFLOADED_PACKETS. + */ +enum qca_wlan_vendor_attr_offloaded_packets { + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_INVALID = 0, + /* Takes valid value from the enum + * qca_wlan_offloaded_packets_sending_control + * Unsigned 32-bit value + */ + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_SENDING_CONTROL, + /* Unsigned 32-bit value */ + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_REQUEST_ID, + /* array of u8 len: Max packet size */ + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_IP_PACKET_DATA, + /* 6-byte MAC address used to represent source MAC address */ + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_SRC_MAC_ADDR, + /* 6-byte MAC address used to represent destination MAC address */ + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_DST_MAC_ADDR, + /* Unsigned 32-bit value, in milli seconds */ + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_PERIOD, + /* This optional unsigned 16-bit attribute is used for specifying + * ethernet protocol type. If not specified ethertype defaults to IPv4. + */ + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_ETHER_PROTO_TYPE, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_MAX = + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_rssi_monitoring_control - RSSI control commands used as values + * by the attribute QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CONTROL. + */ +enum qca_wlan_rssi_monitoring_control { + QCA_WLAN_RSSI_MONITORING_CONTROL_INVALID = 0, + QCA_WLAN_RSSI_MONITORING_START, + QCA_WLAN_RSSI_MONITORING_STOP, +}; + +/** + * enum qca_wlan_vendor_attr_rssi_monitoring - Used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI. + */ +enum qca_wlan_vendor_attr_rssi_monitoring { + QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_INVALID = 0, + /* Takes valid value from the enum + * qca_wlan_rssi_monitoring_control + * Unsigned 32-bit value enum qca_wlan_rssi_monitoring_control + */ + QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CONTROL, + /* Unsigned 32-bit value */ + QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_REQUEST_ID, + /* Signed 8-bit value in dBm */ + QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MAX_RSSI, + /* Signed 8-bit value in dBm */ + QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MIN_RSSI, + /* attributes to be used/received in callback */ + /* 6-byte MAC address used to represent current BSSID MAC address */ + QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CUR_BSSID, + /* Signed 8-bit value indicating the current RSSI */ + QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CUR_RSSI, + /* keep last */ + QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MAX = + QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_ndp_params - Used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_NDP. + */ +enum qca_wlan_vendor_attr_ndp_params { + QCA_WLAN_VENDOR_ATTR_NDP_PARAM_INVALID = 0, + /* Unsigned 32-bit value + * enum of sub commands values in qca_wlan_ndp_sub_cmd + */ + QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD, + /* Unsigned 16-bit value */ + QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID, + /* NL attributes for data used NDP SUB cmds */ + /* Unsigned 32-bit value indicating a service info */ + QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID, + /* Unsigned 32-bit value; channel frequency in MHz */ + QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL, + /* Interface Discovery MAC address. An array of 6 Unsigned int8 */ + QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR, + /* Interface name on which NDP is being created */ + QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR, + /* Unsigned 32-bit value for security */ + /* CONFIG_SECURITY is deprecated, use NCS_SK_TYPE/PMK/SCID instead */ + QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_SECURITY, + /* Unsigned 32-bit value for QoS */ + QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS, + /* Array of u8: len = QCA_WLAN_VENDOR_ATTR_NAN_DP_APP_INFO_LEN */ + QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO, + /* Unsigned 32-bit value for NDP instance Id */ + QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID, + /* Array of instance Ids */ + QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY, + /* Unsigned 32-bit value for initiator/responder NDP response code + * accept/reject + */ + QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE, + /* NDI MAC address. An array of 6 Unsigned int8 */ + QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR, + /* Unsigned 32-bit value errors types returned by driver + * The wifi_nan.h in AOSP project platform/hardware/libhardware_legacy + * NanStatusType includes these values. + */ + QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE, + /* Unsigned 32-bit value error values returned by driver + * The nan_i.h in AOSP project platform/hardware/qcom/wlan + * NanInternalStatusType includes these values. + */ + QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE, + /* Unsigned 32-bit value for Channel setup configuration + * The wifi_nan.h in AOSP project platform/hardware/libhardware_legacy + * NanDataPathChannelCfg includes these values. + */ + QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_CONFIG, + /* Unsigned 32-bit value for Cipher Suite Shared Key Type */ + QCA_WLAN_VENDOR_ATTR_NDP_CSID, + /* Array of u8: len = NAN_PMK_INFO_LEN 32 bytes */ + QCA_WLAN_VENDOR_ATTR_NDP_PMK, + /* Security Context Identifier that contains the PMKID + * Array of u8: len = NAN_SCID_BUF_LEN 1024 bytes + */ + QCA_WLAN_VENDOR_ATTR_NDP_SCID, + /* Array of u8: len = NAN_SECURITY_MAX_PASSPHRASE_LEN 63 bytes */ + QCA_WLAN_VENDOR_ATTR_NDP_PASSPHRASE, + /* Array of u8: len = NAN_MAX_SERVICE_NAME_LEN 255 bytes */ + QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_NAME, + /* Unsigned 32-bit bitmap indicating schedule update + * BIT_0: NSS Update + * BIT_1: Channel list update + */ + QCA_WLAN_VENDOR_ATTR_NDP_SCHEDULE_UPDATE_REASON, + /* Unsigned 32-bit value for NSS */ + QCA_WLAN_VENDOR_ATTR_NDP_NSS, + /* Unsigned 32-bit value for NUMBER NDP CHANNEL */ + QCA_WLAN_VENDOR_ATTR_NDP_NUM_CHANNELS, + /* Unsigned 32-bit value for CHANNEL BANDWIDTH + * 0:20 MHz, 1:40 MHz, 2:80 MHz, 3:160 MHz + */ + QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_WIDTH, + /* Array of channel/band width */ + QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_INFO, + /* IPv6 address used by NDP (in network byte order), 16 bytes array. + * This attribute is used and optional for ndp request, ndp response, + * ndp indication, and ndp confirm. + */ + QCA_WLAN_VENDOR_ATTR_NDP_IPV6_ADDR = 27, + /* Unsigned 16-bit value indicating transport port used by NDP. + * This attribute is used and optional for ndp response, ndp indication, + * and ndp confirm. + */ + QCA_WLAN_VENDOR_ATTR_NDP_TRANSPORT_PORT = 28, + /* Unsigned 8-bit value indicating protocol used by NDP and assigned by + * the Internet Assigned Numbers Authority (IANA) as per: + * https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml + * This attribute is used and optional for ndp response, ndp indication, + * and ndp confirm. + */ + QCA_WLAN_VENDOR_ATTR_NDP_TRANSPORT_PROTOCOL = 29, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX = + QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_AFTER_LAST - 1, +}; + +enum qca_wlan_ndp_sub_cmd { + QCA_WLAN_VENDOR_ATTR_NDP_INVALID = 0, + /* Command to create a NAN data path interface */ + QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_CREATE = 1, + /* Command to delete a NAN data path interface */ + QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_DELETE = 2, + /* Command to initiate a NAN data path session */ + QCA_WLAN_VENDOR_ATTR_NDP_INITIATOR_REQUEST = 3, + /* Command to notify if the NAN data path session was sent */ + QCA_WLAN_VENDOR_ATTR_NDP_INITIATOR_RESPONSE = 4, + /* Command to respond to NAN data path session */ + QCA_WLAN_VENDOR_ATTR_NDP_RESPONDER_REQUEST = 5, + /* Command to notify on the responder about the response */ + QCA_WLAN_VENDOR_ATTR_NDP_RESPONDER_RESPONSE = 6, + /* Command to initiate a NAN data path end */ + QCA_WLAN_VENDOR_ATTR_NDP_END_REQUEST = 7, + /* Command to notify the if end request was sent */ + QCA_WLAN_VENDOR_ATTR_NDP_END_RESPONSE = 8, + /* Command to notify the peer about the end request */ + QCA_WLAN_VENDOR_ATTR_NDP_REQUEST_IND = 9, + /* Command to confirm the NAN data path session is complete */ + QCA_WLAN_VENDOR_ATTR_NDP_CONFIRM_IND = 10, + /* Command to indicate the peer about the end request being received */ + QCA_WLAN_VENDOR_ATTR_NDP_END_IND = 11, + /* Command to indicate the peer of schedule update */ + QCA_WLAN_VENDOR_ATTR_NDP_SCHEDULE_UPDATE_IND = 12 +}; + +/** + * enum qca_wlan_vendor_attr_nd_offload - Used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_ND_OFFLOAD. + */ +enum qca_wlan_vendor_attr_nd_offload { + QCA_WLAN_VENDOR_ATTR_ND_OFFLOAD_INVALID = 0, + /* Flag to set Neighbour Discovery offload */ + QCA_WLAN_VENDOR_ATTR_ND_OFFLOAD_FLAG, + /* Keep last */ + QCA_WLAN_VENDOR_ATTR_ND_OFFLOAD_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_ND_OFFLOAD_MAX = + QCA_WLAN_VENDOR_ATTR_ND_OFFLOAD_AFTER_LAST - 1, +}; + +/** + * enum packet_filter_sub_cmd - Packet filter sub commands + */ +enum packet_filter_sub_cmd { + /** + * Write packet filter program and/or data. The driver/firmware should + * disable APF before writing into local buffer and re-enable APF after + * writing is done. + */ + QCA_WLAN_SET_PACKET_FILTER = 1, + /* Get packet filter feature capabilities from driver */ + QCA_WLAN_GET_PACKET_FILTER = 2, + /** + * Write packet filter program and/or data. User space will send the + * %QCA_WLAN_DISABLE_PACKET_FILTER command before issuing this command + * and will send the %QCA_WLAN_ENABLE_PACKET_FILTER afterwards. The key + * difference from that %QCA_WLAN_SET_PACKET_FILTER is the control over + * enable/disable is given to user space with this command. Also, + * user space sends the length of program portion in the buffer within + * %QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_PROG_LENGTH. + */ + QCA_WLAN_WRITE_PACKET_FILTER = 3, + /* Read packet filter program and/or data */ + QCA_WLAN_READ_PACKET_FILTER = 4, + /* Enable APF feature */ + QCA_WLAN_ENABLE_PACKET_FILTER = 5, + /* Disable APF feature */ + QCA_WLAN_DISABLE_PACKET_FILTER = 6, +}; + +/** + * enum qca_wlan_vendor_attr_packet_filter - BPF control commands used by + * vendor QCA_NL80211_VENDOR_SUBCMD_PACKET_FILTER. + */ +enum qca_wlan_vendor_attr_packet_filter { + QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_INVALID = 0, + /* Unsigned 32-bit enum passed using packet_filter_sub_cmd */ + QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_SUB_CMD, + /* Unsigned 32-bit value indicating the packet filter version */ + QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_VERSION, + /* Unsigned 32-bit value indicating the packet filter id */ + QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_ID, + /** + * Unsigned 32-bit value indicating the packet filter size including + * program + data. + */ + QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_SIZE, + /* Unsigned 32-bit value indicating the packet filter current offset */ + QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_CURRENT_OFFSET, + /* Program and/or data in bytes */ + QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_PROGRAM, + /* Unsigned 32-bit value of the length of the program section in packet + * filter buffer. + */ + QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_PROG_LENGTH = 7, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_MAX = + QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_drv_info - WLAN driver info used by vendor command + * QCA_NL80211_VENDOR_SUBCMD_GET_BUS_SIZE. + */ +enum qca_wlan_vendor_drv_info { + QCA_WLAN_VENDOR_ATTR_DRV_INFO_INVALID = 0, + /* Maximum Message size info between firmware & HOST + * Unsigned 32-bit value + */ + QCA_WLAN_VENDOR_ATTR_DRV_INFO_BUS_SIZE, + /* keep last */ + QCA_WLAN_VENDOR_ATTR_DRV_INFO_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_DRV_INFO_MAX = + QCA_WLAN_VENDOR_ATTR_DRV_INFO_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_wake_stats - Wake lock stats used by vendor + * command QCA_NL80211_VENDOR_SUBCMD_GET_WAKE_REASON_STATS. + */ +enum qca_wlan_vendor_attr_wake_stats { + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_INVALID = 0, + /* Unsigned 32-bit value indicating the total count of wake event */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_TOTAL_CMD_EVENT_WAKE, + /* Array of individual wake count, each index representing wake reason + */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_CMD_EVENT_WAKE_CNT_PTR, + /* Unsigned 32-bit value representing wake count array */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_CMD_EVENT_WAKE_CNT_SZ, + /* Unsigned 32-bit total wake count value of driver/fw */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_TOTAL_DRIVER_FW_LOCAL_WAKE, + /* Array of wake stats of driver/fw */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_DRIVER_FW_LOCAL_WAKE_CNT_PTR, + /* Unsigned 32-bit total wake count value of driver/fw */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_DRIVER_FW_LOCAL_WAKE_CNT_SZ, + /* Unsigned 32-bit total wake count value of packets received */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_TOTAL_RX_DATA_WAKE, + /* Unsigned 32-bit wake count value unicast packets received */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_RX_UNICAST_CNT, + /* Unsigned 32-bit wake count value multicast packets received */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_RX_MULTICAST_CNT, + /* Unsigned 32-bit wake count value broadcast packets received */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_RX_BROADCAST_CNT, + /* Unsigned 32-bit wake count value of ICMP packets */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_ICMP_PKT, + /* Unsigned 32-bit wake count value of ICMP6 packets */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_ICMP6_PKT, + /* Unsigned 32-bit value ICMP6 router advertisement */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_ICMP6_RA, + /* Unsigned 32-bit value ICMP6 neighbor advertisement */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_ICMP6_NA, + /* Unsigned 32-bit value ICMP6 neighbor solicitation */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_ICMP6_NS, + /* Unsigned 32-bit wake count value of receive side ICMP4 multicast */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_ICMP4_RX_MULTICAST_CNT, + /* Unsigned 32-bit wake count value of receive side ICMP6 multicast */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_ICMP6_RX_MULTICAST_CNT, + /* Unsigned 32-bit wake count value of receive side multicast */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_OTHER_RX_MULTICAST_CNT, + /* Unsigned 32-bit wake count value of a given RSSI breach */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_RSSI_BREACH_CNT, + /* Unsigned 32-bit wake count value of low RSSI */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_LOW_RSSI_CNT, + /* Unsigned 32-bit value GSCAN count */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_GSCAN_CNT, + /* Unsigned 32-bit value PNO complete count */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_PNO_COMPLETE_CNT, + /* Unsigned 32-bit value PNO match count */ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_PNO_MATCH_CNT, + /* keep last */ + QCA_WLAN_VENDOR_GET_WAKE_STATS_AFTER_LAST, + QCA_WLAN_VENDOR_GET_WAKE_STATS_MAX = + QCA_WLAN_VENDOR_GET_WAKE_STATS_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_thermal_cmd - Vendor subcmd attributes to set + * cmd value. Used for NL attributes for data used by + * QCA_NL80211_VENDOR_SUBCMD_THERMAL_CMD sub command. + */ +enum qca_wlan_vendor_attr_thermal_cmd { + QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_INVALID = 0, + /* The value of command, driver will implement different operations + * according to this value. It uses values defined in + * enum qca_wlan_vendor_attr_thermal_cmd_type. + * u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_VALUE = 1, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_MAX = + QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_AFTER_LAST - 1 +}; + +/** + * qca_wlan_vendor_attr_thermal_cmd_type: Attribute values for + * QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_VALUE to the vendor subcmd + * QCA_NL80211_VENDOR_SUBCMD_THERMAL_CMD. This represents the + * thermal command types sent to driver. + * @QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_GET_PARAMS: Request to + * get thermal shutdown configuration parameters for display. Parameters + * responded from driver are defined in + * enum qca_wlan_vendor_attr_get_thermal_params_rsp. + * @QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_GET_TEMPERATURE: Request to + * get temperature. Host should respond with a temperature data. It is defined + * in enum qca_wlan_vendor_attr_thermal_get_temperature. + * @QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_SUSPEND: Request to execute thermal + * suspend action. + * @QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_RESUME: Request to execute thermal + * resume action. + */ +enum qca_wlan_vendor_attr_thermal_cmd_type { + QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_GET_PARAMS, + QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_GET_TEMPERATURE, + QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_SUSPEND, + QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_RESUME, +}; + +/** + * enum qca_wlan_vendor_attr_thermal_get_temperature - vendor subcmd attributes + * to get chip temperature by user. + * enum values are used for NL attributes for data used by + * QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_GET_TEMPERATURE command for data used + * by QCA_NL80211_VENDOR_SUBCMD_THERMAL_CMD sub command. + */ +enum qca_wlan_vendor_attr_thermal_get_temperature { + QCA_WLAN_VENDOR_ATTR_THERMAL_GET_TEMPERATURE_INVALID = 0, + /* Temperature value (degree Celsius) from driver. + * u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_THERMAL_GET_TEMPERATURE_DATA, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_THERMAL_GET_TEMPERATURE_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_THERMAL_GET_TEMPERATURE_MAX = + QCA_WLAN_VENDOR_ATTR_THERMAL_GET_TEMPERATURE_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_get_thermal_params_rsp - vendor subcmd attributes + * to get configuration parameters of thermal shutdown feature. Enum values are + * used by QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_GET_PARAMS command for data + * used by QCA_NL80211_VENDOR_SUBCMD_THERMAL_CMD sub command. + */ +enum qca_wlan_vendor_attr_get_thermal_params_rsp { + QCA_WLAN_VENDOR_ATTR_GET_THERMAL_PARAMS_RSP_INVALID = 0, + /* Indicate if the thermal shutdown feature is enabled. + * NLA_FLAG attribute. + */ + QCA_WLAN_VENDOR_ATTR_GET_THERMAL_PARAMS_RSP_SHUTDOWN_EN, + /* Indicate if the auto mode is enabled. + * Enable: Driver triggers the suspend/resume action. + * Disable: User space triggers the suspend/resume action. + * NLA_FLAG attribute. + */ + QCA_WLAN_VENDOR_ATTR_GET_THERMAL_PARAMS_RSP_SHUTDOWN_AUTO_EN, + /* Thermal resume threshold (degree Celsius). Issue the resume command + * if the temperature value is lower than this threshold. + * u16 attribute. + */ + QCA_WLAN_VENDOR_ATTR_GET_THERMAL_PARAMS_RSP_RESUME_THRESH, + /* Thermal warning threshold (degree Celsius). FW reports temperature + * to driver if it's higher than this threshold. + * u16 attribute. + */ + QCA_WLAN_VENDOR_ATTR_GET_THERMAL_PARAMS_RSP_WARNING_THRESH, + /* Thermal suspend threshold (degree Celsius). Issue the suspend command + * if the temperature value is higher than this threshold. + * u16 attribute. + */ + QCA_WLAN_VENDOR_ATTR_GET_THERMAL_PARAMS_RSP_SUSPEND_THRESH, + /* FW reports temperature data periodically at this interval (ms). + * u16 attribute. + */ + QCA_WLAN_VENDOR_ATTR_GET_THERMAL_PARAMS_RSP_SAMPLE_RATE, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_GET_THERMAL_PARAMS_RSP_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_GET_THERMAL_PARAMS_RSP_MAX = + QCA_WLAN_VENDOR_ATTR_GET_THERMAL_PARAMS_RSP_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_thermal_event - vendor subcmd attributes to + * report thermal events from driver to user space. + * enum values are used for NL attributes for data used by + * QCA_NL80211_VENDOR_SUBCMD_THERMAL_EVENT sub command. + */ +enum qca_wlan_vendor_attr_thermal_event { + QCA_WLAN_VENDOR_ATTR_THERMAL_EVENT_INVALID = 0, + /* Temperature value (degree Celsius) from driver. + * u32 attribute. + */ + QCA_WLAN_VENDOR_ATTR_THERMAL_EVENT_TEMPERATURE, + /* Indication of resume completion from power save mode. + * NLA_FLAG attribute. + */ + QCA_WLAN_VENDOR_ATTR_THERMAL_EVENT_RESUME_COMPLETE, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_THERMAL_EVENT_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_THERMAL_EVENT_MAX = + QCA_WLAN_VENDOR_ATTR_THERMAL_EVENT_AFTER_LAST - 1, +}; + +/** + * enum he_fragmentation_val - HE fragmentation support values + * Indicates level of dynamic fragmentation that is supported by + * a STA as a recipient. + * HE fragmentation values are defined in IEEE P802.11ax/D2.0, 9.4.2.237.2 + * (HE MAC Capabilities Information field) and are used in HE Capabilities + * element to advertise the support. These values are validated in the driver + * to check the device capability and advertised in the HE Capabilities + * element. These values are used to configure testbed device to allow the + * advertised hardware capabilities to be downgraded for testing purposes. + * + * @HE_FRAG_DISABLE: no support for dynamic fragmentation + * @HE_FRAG_LEVEL1: support for dynamic fragments that are + * contained within an MPDU or S-MPDU, no support for dynamic fragments + * within an A-MPDU that is not an S-MPDU. + * @HE_FRAG_LEVEL2: support for dynamic fragments that are + * contained within an MPDU or S-MPDU and support for up to one dynamic + * fragment for each MSDU, each A-MSDU if supported by the recipient, and + * each MMPDU within an A-MPDU or multi-TID A-MPDU that is not an + * MPDU or S-MPDU. + * @HE_FRAG_LEVEL3: support for dynamic fragments that are + * contained within an MPDU or S-MPDU and support for multiple dynamic + * fragments for each MSDU and for each A-MSDU if supported by the + * recipient within an A-MPDU or multi-TID AMPDU and up to one dynamic + * fragment for each MMPDU in a multi-TID A-MPDU that is not an S-MPDU. + */ +enum he_fragmentation_val { + HE_FRAG_DISABLE, + HE_FRAG_LEVEL1, + HE_FRAG_LEVEL2, + HE_FRAG_LEVEL3, +}; + +/** + * enum he_mcs_config - HE MCS support configuration + * + * Configures the HE Tx/Rx MCS map in HE capability IE for given bandwidth. + * These values are used in driver to configure the HE MCS map to advertise + * Tx/Rx MCS map in HE capability and these values are applied for all the + * streams supported by the device. To configure MCS for different bandwidths, + * vendor command needs to be sent using this attribute with appropriate value. + * For example, to configure HE_80_MCS_0_7, send vendor command using HE MCS + * attribute with HE_80_MCS0_7. And to configure HE MCS for HE_160_MCS0_11 + * send this command using HE MCS config attribute with value HE_160_MCS0_11. + * These values are used to configure testbed device to allow the advertised + * hardware capabilities to be downgraded for testing purposes. The enum values + * are defined such that BIT[1:0] indicates the MCS map value. Values 3,7 and + * 11 are not used as BIT[1:0] value is 3 which is used to disable MCS map. + * These values are validated in the driver before setting the MCS map and + * driver returns error if the input is other than these enum values. + * + * @HE_80_MCS0_7: support for HE 80/40/20 MHz MCS 0 to 7 + * @HE_80_MCS0_9: support for HE 80/40/20 MHz MCS 0 to 9 + * @HE_80_MCS0_11: support for HE 80/40/20 MHz MCS 0 to 11 + * @HE_160_MCS0_7: support for HE 160 MHz MCS 0 to 7 + * @HE_160_MCS0_9: support for HE 160 MHz MCS 0 to 9 + * @HE_160_MCS0_11: support for HE 160 MHz MCS 0 to 11 + * @HE_80P80_MCS0_7: support for HE 80p80 MHz MCS 0 to 7 + * @HE_80P80_MCS0_9: support for HE 80p80 MHz MCS 0 to 9 + * @HE_80P80_MCS0_11: support for HE 80p80 MHz MCS 0 to 11 + */ +enum he_mcs_config { + HE_80_MCS0_7 = 0, + HE_80_MCS0_9 = 1, + HE_80_MCS0_11 = 2, + HE_160_MCS0_7 = 4, + HE_160_MCS0_9 = 5, + HE_160_MCS0_11 = 6, + HE_80P80_MCS0_7 = 8, + HE_80P80_MCS0_9 = 9, + HE_80P80_MCS0_11 = 10, +}; + +/** + * enum qca_wlan_ba_session_config - BA session configuration + * + * Indicates the configuration values for BA session configuration attribute. + * + * @QCA_WLAN_ADD_BA: Establish a new BA session with given configuration. + * @QCA_WLAN_DELETE_BA: Delete the existing BA session for given TID. + */ +enum qca_wlan_ba_session_config { + QCA_WLAN_ADD_BA = 1, + QCA_WLAN_DELETE_BA = 2, +}; + +/** + * enum qca_wlan_ac_type - Access category type + * + * Indicates the access category type value. + * + * @QCA_WLAN_AC_BE: BE access category + * @QCA_WLAN_AC_BK: BK access category + * @QCA_WLAN_AC_VI: VI access category + * @QCA_WLAN_AC_VO: VO access category + * @QCA_WLAN_AC_ALL: All ACs + */ +enum qca_wlan_ac_type { + QCA_WLAN_AC_BE = 0, + QCA_WLAN_AC_BK = 1, + QCA_WLAN_AC_VI = 2, + QCA_WLAN_AC_VO = 3, + QCA_WLAN_AC_ALL = 4, +}; + +/** + * enum qca_wlan_he_ltf_cfg - HE LTF configuration + * + * Indicates the HE LTF configuration value. + * + * @QCA_WLAN_HE_LTF_AUTO: HE-LTF is automatically set to the mandatory HE-LTF, + * based on the GI setting + * @QCA_WLAN_HE_LTF_1X: 1X HE LTF is 3.2us LTF + * @QCA_WLAN_HE_LTF_2X: 2X HE LTF is 6.4us LTF + * @QCA_WLAN_HE_LTF_4X: 4X HE LTF is 12.8us LTF + */ +enum qca_wlan_he_ltf_cfg { + QCA_WLAN_HE_LTF_AUTO = 0, + QCA_WLAN_HE_LTF_1X = 1, + QCA_WLAN_HE_LTF_2X = 2, + QCA_WLAN_HE_LTF_4X = 3, +}; + +/* Attributes for data used by + * QCA_NL80211_VENDOR_SUBCMD_WIFI_TEST_CONFIGURATION + */ +enum qca_wlan_vendor_attr_wifi_test_config { + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_INVALID = 0, + /* 8-bit unsigned value to configure the driver to enable/disable + * WMM feature. This attribute is used to configure testbed device. + * 1-enable, 0-disable + */ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_WMM_ENABLE = 1, + + /* 8-bit unsigned value to configure the driver to accept/reject + * the addba request from peer. This attribute is used to configure + * the testbed device. + * 1-accept addba, 0-reject addba + */ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_ACCEPT_ADDBA_REQ = 2, + + /* 8-bit unsigned value to configure the driver to send or not to + * send the addba request to peer. + * This attribute is used to configure the testbed device. + * 1-send addba, 0-do not send addba + */ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_SEND_ADDBA_REQ = 3, + + /* 8-bit unsigned value to indicate the HE fragmentation support. + * Uses enum he_fragmentation_val values. + * This attribute is used to configure the testbed device to + * allow the advertised hardware capabilities to be downgraded + * for testing purposes. + */ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_HE_FRAGMENTATION = 4, + + /* 8-bit unsigned value to indicate the HE MCS support. + * Uses enum he_mcs_config values. + * This attribute is used to configure the testbed device to + * allow the advertised hardware capabilities to be downgraded + * for testing purposes. + */ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_HE_MCS = 5, + + /* 8-bit unsigned value to configure the driver to allow or not to + * allow the connection with WEP/TKIP in HT/VHT/HE modes. + * This attribute is used to configure the testbed device. + * 1-allow WEP/TKIP in HT/VHT/HE, 0-do not allow WEP/TKIP. + */ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_WEP_TKIP_IN_HE = 6, + + /* 8-bit unsigned value to configure the driver to add a + * new BA session or delete the existing BA session for + * given TID. ADDBA command uses the buffer size and TID + * configuration if user specifies the values else default + * value for buffer size is used for all TIDs if the TID + * also not specified. For DEL_BA command TID value is + * required to process the command. + * Uses enum qca_wlan_ba_session_config values. + * This attribute is used to configure the testbed device. + */ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_ADD_DEL_BA_SESSION = 7, + + /* 8-bit unsigned value to configure the buffer size in addba + * request and response frames. + * This attribute is used to configure the testbed device. + * The range of the value is 0 to 255. + */ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_ADDBA_BUFF_SIZE = 8, + + /* 8-bit unsigned value to configure the buffer size in addba + * request and response frames. + * This attribute is used to configure the testbed device. + */ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_BA_TID = 9, + + /* 8-bit unsigned value to configure the no ack policy. + * To configure no ack policy, access category value is + * required to process the command. + * This attribute is used to configure the testbed device. + * 1 - enable no ack, 0 - disable no ack. + */ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_ENABLE_NO_ACK = 10, + + /* 8-bit unsigned value to configure the AC for no ack policy + * This attribute is used to configure the testbed device. + * Uses the enum qca_wlan_ac_type values. + */ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_NO_ACK_AC = 11, + + /* 8-bit unsigned value to configure the HE LTF + * This attribute is used to configure the testbed device. + * Uses the enum qca_wlan_he_ltf_cfg values. + */ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_HE_LTF = 12, + + /* 8-bit unsigned value to configure the tx beamformee. + * This attribute is used to configure the testbed device. + * 1-enable, 0-disable. + */ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_ENABLE_TX_BEAMFORMEE = 13, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_MAX = + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_attr_bss_filter - Used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_BSS_FILTER. + * The user can add/delete the filter by specifying the BSSID/STA MAC address in + * QCA_WLAN_VENDOR_ATTR_BSS_FILTER_MAC_ADDR, filter type in + * QCA_WLAN_VENDOR_ATTR_BSS_FILTER_TYPE, add/delete action in + * QCA_WLAN_VENDOR_ATTR_BSS_FILTER_ACTION in the request. The user can get the + * statistics of an unassociated station by specifying the MAC address in + * QCA_WLAN_VENDOR_ATTR_BSS_FILTER_MAC_ADDR, station type in + * QCA_WLAN_VENDOR_ATTR_BSS_FILTER_TYPE, GET action in + * QCA_WLAN_VENDOR_ATTR_BSS_FILTER_ACTION in the request. The user also can get + * the statistics of all unassociated stations by specifying the Broadcast MAC + * address (ff:ff:ff:ff:ff:ff) in QCA_WLAN_VENDOR_ATTR_BSS_FILTER_MAC_ADDR with + * above procedure. In the response, driver shall specify statistics + * information nested in QCA_WLAN_VENDOR_ATTR_BSS_FILTER_STA_STATS. + */ +enum qca_wlan_vendor_attr_bss_filter { + QCA_WLAN_VENDOR_ATTR_BSS_FILTER_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_BSS_FILTER_MAC_ADDR = 1, + /* Other BSS filter type, unsigned 8 bit value. One of the values + * in enum qca_wlan_vendor_bss_filter_type. + */ + QCA_WLAN_VENDOR_ATTR_BSS_FILTER_TYPE = 2, + /* Other BSS filter action, unsigned 8 bit value. One of the values + * in enum qca_wlan_vendor_bss_filter_action. + */ + QCA_WLAN_VENDOR_ATTR_BSS_FILTER_ACTION = 3, + /* Array of nested attributes where each entry is the statistics + * information of the specified station that belong to another BSS. + * Attributes for each entry are taken from enum + * qca_wlan_vendor_bss_filter_sta_stats. + * Other BSS station configured in + * QCA_NL80211_VENDOR_SUBCMD_BSS_FILTER with filter type + * QCA_WLAN_VENDOR_BSS_FILTER_TYPE_STA. + * Statistics returned by QCA_NL80211_VENDOR_SUBCMD_BSS_FILTER + * with filter action QCA_WLAN_VENDOR_BSS_FILTER_ACTION_GET. + */ + QCA_WLAN_VENDOR_ATTR_BSS_FILTER_STA_STATS = 4, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_BSS_FILTER_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_BSS_FILTER_MAX = + QCA_WLAN_VENDOR_ATTR_BSS_FILTER_AFTER_LAST - 1, +}; + +/** + * enum qca_wlan_vendor_bss_filter_type - Type of + * filter used in other BSS filter operations. Used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_BSS_FILTER. + * + * @QCA_WLAN_VENDOR_BSS_FILTER_TYPE_BSSID: BSSID filter + * @QCA_WLAN_VENDOR_BSS_FILTER_TYPE_STA: Station MAC address filter + */ +enum qca_wlan_vendor_bss_filter_type { + QCA_WLAN_VENDOR_BSS_FILTER_TYPE_BSSID, + QCA_WLAN_VENDOR_BSS_FILTER_TYPE_STA, +}; + +/** + * enum qca_wlan_vendor_bss_filter_action - Type of + * action in other BSS filter operations. Used by the vendor command + * QCA_NL80211_VENDOR_SUBCMD_BSS_FILTER. + * + * @QCA_WLAN_VENDOR_BSS_FILTER_ACTION_ADD: Add filter + * @QCA_WLAN_VENDOR_BSS_FILTER_ACTION_DEL: Delete filter + * @QCA_WLAN_VENDOR_BSS_FILTER_ACTION_GET: Get the statistics + */ +enum qca_wlan_vendor_bss_filter_action { + QCA_WLAN_VENDOR_BSS_FILTER_ACTION_ADD, + QCA_WLAN_VENDOR_BSS_FILTER_ACTION_DEL, + QCA_WLAN_VENDOR_BSS_FILTER_ACTION_GET, +}; + +/** + * enum qca_wlan_vendor_bss_filter_sta_stats - Attributes for + * the statistics of a specific unassociated station belonging to another BSS. + * The statistics provides information of the unassociated station + * filtered by other BSS operation - such as MAC, signal value. + * Used by the vendor command QCA_NL80211_VENDOR_SUBCMD_BSS_FILTER. + * + * @QCA_WLAN_VENDOR_BSS_FILTER_STA_STATS_MAC: MAC address of the station. + * @QCA_WLAN_VENDOR_BSS_FILTER_STA_STATS_RSSI: Last received signal strength + * of the station. Unsigned 8 bit number containing RSSI. + * @QCA_WLAN_VENDOR_BSS_FILTER_STA_STATS_RSSI_TS: Time stamp of the host + * driver for the last received RSSI. Unsigned 64 bit number containing + * nanoseconds from the boottime. + */ +enum qca_wlan_vendor_bss_filter_sta_stats { + QCA_WLAN_VENDOR_BSS_FILTER_STA_STATS_INVALID = 0, + QCA_WLAN_VENDOR_BSS_FILTER_STA_STATS_MAC = 1, + QCA_WLAN_VENDOR_BSS_FILTER_STA_STATS_RSSI = 2, + QCA_WLAN_VENDOR_BSS_FILTER_STA_STATS_RSSI_TS = 3, + + /* keep last */ + QCA_WLAN_VENDOR_BSS_FILTER_STA_STATS_AFTER_LAST, + QCA_WLAN_VENDOR_BSS_FILTER_STA_STATS_MAX = + QCA_WLAN_VENDOR_BSS_FILTER_STA_STATS_AFTER_LAST - 1 +}; + #endif /* QCA_VENDOR_H */ diff --git a/qcwcn/wifi_hal/radio_mode.cpp b/qcwcn/wifi_hal/radio_mode.cpp index 96a2176..9ed211f 100644 --- a/qcwcn/wifi_hal/radio_mode.cpp +++ b/qcwcn/wifi_hal/radio_mode.cpp @@ -84,7 +84,7 @@ RADIOModeCommand* RADIOModeCommand::instance(wifi_handle handle, } mRADIOModeCommandInstance = new RADIOModeCommand(handle, id, OUI_QCA, - QCA_NL80211_VENDOR_SUBCMD_WLAN_MAC_MODE); + QCA_NL80211_VENDOR_SUBCMD_WLAN_MAC_INFO); return mRADIOModeCommandInstance; } @@ -97,12 +97,13 @@ int RADIOModeCommand::handleEvent(WifiEvent &event) int num_of_mac = 0; wifi_mac_info mode_info; + memset(&mode_info, 0, sizeof(mode_info)); WifiVendorCommand::handleEvent(event); /* Parse the vendordata and get the attribute */ switch(mSubcmd) { - case QCA_NL80211_VENDOR_SUBCMD_WLAN_MAC_MODE: + case QCA_NL80211_VENDOR_SUBCMD_WLAN_MAC_INFO: { struct nlattr *mtb_vendor[QCA_WLAN_VENDOR_ATTR_MAC_MAX + 1]; struct nlattr *modeInfo; @@ -155,17 +156,17 @@ int RADIOModeCommand::handleEvent(WifiEvent &event) nla_parse(tb3, QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_MAX, (struct nlattr *) nla_data(tb_iface), nla_len(tb_iface), NULL); - if (!tb3[QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_ID]) + if (!tb3[QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_IFINDEX]) { - ALOGE("%s: QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_ID" + ALOGE("%s: QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_IFINDEX" " NOT FOUND", __FUNCTION__); return WIFI_ERROR_INVALID_ARGS; } - if (if_indextoname(nla_get_u32(tb3[QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_ID]), + if (if_indextoname(nla_get_u32(tb3[QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_IFINDEX]), miface_info.iface_name) == NULL) { ALOGE("%s: Failed to convert %d IFINDEX to IFNAME", __FUNCTION__, - nla_get_u32(tb3[QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_ID])); + nla_get_u32(tb3[QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_IFINDEX])); } ALOGV("ifname[%d]: %s ", num_of_iface, miface_info.iface_name); @@ -233,7 +234,7 @@ wifi_error wifi_set_radio_mode_change_handler(wifi_request_id id, RADIOModeCommand *radiomodeCommand; ret = initialize_vendor_cmd(iface, id, - QCA_NL80211_VENDOR_SUBCMD_WLAN_MAC_MODE, + QCA_NL80211_VENDOR_SUBCMD_WLAN_MAC_INFO, &vCommand); if (ret != WIFI_SUCCESS) { ALOGE("%s: Initialization failed", __FUNCTION__); diff --git a/qcwcn/wifi_hal/ring_buffer.cpp b/qcwcn/wifi_hal/ring_buffer.cpp index cac8f6c..d78bd62 100644 --- a/qcwcn/wifi_hal/ring_buffer.cpp +++ b/qcwcn/wifi_hal/ring_buffer.cpp @@ -442,7 +442,7 @@ u8 *rb_get_read_buf(void *ctx, size_t *length) u8 *buf; /* If no buffer is available for reading */ - if (rbc->bufs[rbc->rd_buf_no].data == NULL) { + if (!rbc || rbc->bufs[rbc->rd_buf_no].data == NULL) { *length = 0; return NULL; } diff --git a/qcwcn/wifi_hal/roam.cpp b/qcwcn/wifi_hal/roam.cpp index 53a26ef..2e3f214 100644 --- a/qcwcn/wifi_hal/roam.cpp +++ b/qcwcn/wifi_hal/roam.cpp @@ -18,7 +18,6 @@ #include "common.h" #include "roamcommand.h" -#include "vendor_definitions.h" RoamCommand::RoamCommand(wifi_handle handle, int id, u32 vendor_id, u32 subcmd) : WifiVendorCommand(handle, id, vendor_id, subcmd) diff --git a/qcwcn/wifi_hal/rssi_monitor.cpp b/qcwcn/wifi_hal/rssi_monitor.cpp index 20d5aa3..832bbc3 100644 --- a/qcwcn/wifi_hal/rssi_monitor.cpp +++ b/qcwcn/wifi_hal/rssi_monitor.cpp @@ -36,7 +36,6 @@ #include "common.h" #include "cpp_bindings.h" #include "rssi_monitor.h" -#include "vendor_definitions.h" /* Used to handle rssi command events from driver/firmware.*/ typedef struct rssi_monitor_event_handler_s { diff --git a/qcwcn/wifi_hal/vendor_definitions.h b/qcwcn/wifi_hal/vendor_definitions.h index 928a159..d542148 100644 --- a/qcwcn/wifi_hal/vendor_definitions.h +++ b/qcwcn/wifi_hal/vendor_definitions.h @@ -19,97 +19,6 @@ #include "qca-vendor_copy.h" -#define WIFI_SCANNING_MAC_OUI_LENGTH 3 -#define WIFI_MAC_ADDR_LENGTH 6 - -/*Internal to Android HAL component */ -/* subcommands for link layer statistics start here */ -#ifndef QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET -#define QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET 14 -#define QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET 15 -#define QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR 16 -/* subcommands for gscan start here */ -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_START 20 -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_STOP 21 -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_GET_VALID_CHANNELS 22 -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_GET_CAPABILITIES 23 -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_GET_CACHED_RESULTS 24 -/* Used when report_threshold is reached in scan cache. */ -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_SCAN_RESULTS_AVAILABLE 25 -/* Used to report scan results when each probe rsp. is received, - * if report_events enabled in wifi_scan_cmd_params. - */ -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_FULL_SCAN_RESULT 26 -/* Indicates progress of scanning state-machine. */ -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_SCAN_EVENT 27 -/* Indicates BSSID Hotlist. */ -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_HOTLIST_AP_FOUND 28 -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_SET_BSSID_HOTLIST 29 -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_RESET_BSSID_HOTLIST 30 -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_SIGNIFICANT_CHANGE 31 -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_SET_SIGNIFICANT_CHANGE 32 -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_RESET_SIGNIFICANT_CHANGE 33 -/* TDLS Commands. */ -#define QCA_NL80211_VENDOR_SUBCMD_TDLS_ENABLE 34 -#define QCA_NL80211_VENDOR_SUBCMD_TDLS_DISABLE 35 -#define QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_STATUS 36 -#define QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE 37 -/* Supported features. */ -#define QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_FEATURES 38 -/* set scanning_mac_oui */ -#define QCA_NL80211_VENDOR_SUBCMD_SCANNING_MAC_OUI 39 -/* Set nodfs_flag */ -#define QCA_NL80211_VENDOR_SUBCMD_NO_DFS_FLAG 40 -/* Indicates BSSID Hotlist AP lost. */ -#define QCA_NL80211_VENDOR_SUBCMD_GSCAN_HOTLIST_AP_LOST 41 -/* Get Concurrency Matrix */ -#define QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX 42 -/* Get Wifi Specific Info */ -#define QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_INFO 61 -/* Start Wifi Logger */ -#define QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_START 62 -/* Start Wifi Memory Dump */ -#define QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP 63 -/* Roaming */ -#define QCA_NL80211_VENDOR_SUBCMD_ROAM 64 - -/* APIs corresponding to the sub commands 65-68 are deprecated. - * These sub commands are reserved and not supposed to be used - * for any other purpose - */ -/* PNO */ -#define QCA_NL80211_VENDOR_SUBCMD_PNO_SET_LIST 69 -#define QCA_NL80211_VENDOR_SUBCMD_PNO_SET_PASSPOINT_LIST 70 -#define QCA_NL80211_VENDOR_SUBCMD_PNO_RESET_PASSPOINT_LIST 71 -#define QCA_NL80211_VENDOR_SUBCMD_PNO_NETWORK_FOUND 72 -#define QCA_NL80211_VENDOR_SUBCMD_PNO_PASSPOINT_NETWORK_FOUND 73 -/* Wi-Fi Configuration subcommands */ -#define QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION 74 -#define QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION 75 -/* WiFiLogger Support feature set */ -#define QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET 76 -/* WiFiLogger Get Ring Data */ -#define QCA_NL80211_VENDOR_SUBCMD_GET_RING_DATA 77 -/* Get tdls capabilities */ -#define QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_CAPABILITIES 78 -/* offloaded packets*/ -#define QCA_NL80211_VENDOR_SUBCMD_OFFLOADED_PACKETS 79 -/* RSSI monitoring*/ -#define QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI 80 -/* Nan Data Path */ -#define QCA_NL80211_VENDOR_SUBCMD_NDP 81 -/* Neighbour Discovery offload */ -#define QCA_NL80211_VENDOR_SUBCMD_ND_OFFLOAD 82 -/* Set packet filter for BPF*/ -#define QCA_NL80211_VENDOR_SUBCMD_PACKET_FILTER 83 -/* Get Driver-firmware interface maximum supported size*/ -#define QCA_NL80211_VENDOR_SUBCMD_GET_BUS_SIZE 84 -/* Get wake reason stats */ -#define QCA_NL80211_VENDOR_SUBCMD_GET_WAKE_REASON_STATS 85 -/* Radio Mode change */ -#define QCA_NL80211_VENDOR_SUBCMD_WLAN_MAC_MODE 165 -#endif - enum qca_wlan_vendor_attr_tdls_enable { QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_INVALID = 0, @@ -166,19 +75,6 @@ enum qca_wlan_vendor_attr_tdls_state QCA_WLAN_VENDOR_ATTR_TDLS_STATE_AFTER_LAST - 1, }; -enum qca_wlan_vendor_attr_tdls_get_capabilities -{ - QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_INVALID = 0, - - QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_MAX_CONC_SESSIONS, - QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_FEATURES_SUPPORTED, - - /* keep last */ - QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_AFTER_LAST, - QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_MAX = - QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_AFTER_LAST - 1, -}; - enum qca_wlan_vendor_attr_get_supported_features { QCA_WLAN_VENDOR_ATTR_FEATURE_SET_INVALID = 0, @@ -232,343 +128,17 @@ enum qca_wlan_vendor_attr_get_concurrency_matrix QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_AFTER_LAST - 1, }; -/* NL attributes for data used by - * QCA_NL80211_VENDOR_SUBCMD_SET|GET_WIFI_CONFIGURATION sub commands. - */ -enum qca_wlan_vendor_attr_wifi_config { - QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_INVALID = 0, - /* Unsigned 32-bit value */ - QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_DYNAMIC_DTIM = 1, - /* Unsigned 32-bit value */ - QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_STATS_AVG_FACTOR = 2, - /* Unsigned 32-bit value */ - QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_GUARD_TIME = 3, - /* Unsigned 32-bit value */ - QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_FINE_TIME_MEASUREMENT = 4, - /* Unsigned 32-bit value */ - QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_TX_RATE = 5, - /* Unsigned 32-bit value */ - QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_PENALIZE_AFTER_NCONS_BEACON_MISS = 6, - /* keep last */ - QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_AFTER_LAST, - QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_MAX = - QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_AFTER_LAST - 1, -}; - +/* These are not used currently but we might need these in future */ enum qca_wlan_epno_type { QCA_WLAN_EPNO, QCA_WLAN_PNO }; -#define EPNO_NO_NETWORKS 0 - -enum qca_wlan_offloaded_packets_sending_control -{ - QCA_WLAN_OFFLOADED_PACKETS_SENDING_CONTROL_INVALID = 0, - QCA_WLAN_OFFLOADED_PACKETS_SENDING_START, - QCA_WLAN_OFFLOADED_PACKETS_SENDING_STOP -}; - -enum qca_wlan_vendor_attr_offloaded_packets -{ - QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_INVALID = 0, - - /* Takes valid value from the enum - * qca_wlan_offloaded_packets_sending_control - */ - QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_SENDING_CONTROL, - - QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_REQUEST_ID, - - /* Packet in hex format */ - QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_IP_PACKET, - QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_SRC_MAC_ADDR, - QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_DST_MAC_ADDR, - QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_PERIOD, - - /* keep last */ - QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_AFTER_LAST, - QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_MAX = - QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_AFTER_LAST - 1, - -}; - -enum qca_wlan_rssi_monitoring_control -{ - QCA_WLAN_RSSI_MONITORING_CONTROL_INVALID = 0, - QCA_WLAN_RSSI_MONITORING_START, - QCA_WLAN_RSSI_MONITORING_STOP, -}; - -enum qca_wlan_vendor_attr_rssi_monitoring -{ - QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_INVALID = 0, - - /* Takes valid value from the enum - * qca_wlan_rssi_monitoring_control - */ - QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CONTROL, - - QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_REQUEST_ID, - - QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MAX_RSSI, - QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MIN_RSSI, - - /* attributes to be used/received in callback */ - QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CUR_BSSID, - QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CUR_RSSI, - - /* keep last */ - QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_AFTER_LAST, - QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MAX = - QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_AFTER_LAST - 1, - -}; - -enum qca_wlan_vendor_attr_ndp_params -{ - QCA_WLAN_VENDOR_ATTR_NDP_PARAM_INVALID = 0, - /* enum of sub commands */ - QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD, - /* Unsigned 16-bit value */ - QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID, - /* NL attributes for data used NDP SUB cmds */ - /* Unsigned 32-bit value indicating a service info */ - QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID, - /* Unsigned 32-bit value; channel frequency */ - QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL, - /* Interface Discovery MAC address. An array of 6 Unsigned int8 */ - QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR, - /* Interface name on which NDP is being created */ - QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR, - /* Unsigned 32-bit value for security */ - QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_SECURITY, - /* Unsigned 32-bit value for Qos */ - QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS, - /* Array of u8: len = QCA_WLAN_VENDOR_ATTR_NAN_DP_APP_INFO_LEN */ - QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO, - /* Unsigned 32-bit value for NDP instance Id */ - QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID, - /* Array of instance Ids */ - QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY, - /* Unsigned 32-bit value for initiator/responder ndp response code accept/reject */ - QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE, - /* NDI MAC address. An array of 6 Unsigned int8 */ - QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR, - /* Unsigned 32-bit value errors types returned by driver */ - QCA_WLAN_VENDOR_ATTR_NDP_DRV_RESPONSE_STATUS_TYPE, - /* Unsigned 32-bit value error values returned by driver */ - QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE, - /* Unsigned 32-bit value for Channel setup configuration */ - QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_CONFIG, - /* Unsigned 32-bit value for Cipher Suite Shared Key Type */ - QCA_WLAN_VENDOR_ATTR_NDP_CSID, - /* Array of u8: len = NAN_PMK_INFO_LEN */ - QCA_WLAN_VENDOR_ATTR_NDP_PMK, - QCA_WLAN_VENDOR_ATTR_NDP_SCID, - /* Array of u8: len = NAN_SECURITY_MAX_PASSPHRASE_LEN*/ - QCA_WLAN_VENDOR_ATTR_NDP_PASSPHRASE, - /* Array of u8: len = NAN_MAX_SERVICE_NAME_LEN */ - QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_NAME, - /* Unsigned 32-bit value indicating schedule update */ - QCA_WLAN_VENDOR_ATTR_NDP_SCHEDULE_UPDATE_REASON, - /* Unsigned 32-bit value for NSS */ - QCA_WLAN_VENDOR_ATTR_NDP_NSS, - /* Unsigned 32-bit value for NUMBER NDP CHANNEL */ - QCA_WLAN_VENDOR_ATTR_NDP_NUM_CHANNELS, - /* Unsigned 32-bit value for CHANNEL BANDWIDTH */ - QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_WIDTH, - - /* Array of channel/band width */ - QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_INFO, - - /* KEEP LAST */ - QCA_WLAN_VENDOR_ATTR_NDP_AFTER_LAST, - QCA_WLAN_VENDOR_ATTR_NDP_MAX = - QCA_WLAN_VENDOR_ATTR_NDP_AFTER_LAST - 1, -}; - enum qca_wlan_vendor_attr_ndp_cfg_security { /* Security info will be added when proposed in the specification */ QCA_WLAN_VENDOR_ATTR_NDP_SECURITY_TYPE = 1, }; - -enum qca_wlan_vendor_attr_ndp_qos -{ - /* Qos info will be added when proposed in the specification */ - QCA_WLAN_VENDOR_ATTR_NDP_QOS_CONFIG = 1, - -}; - -/* - * QCA_NL80211_VENDOR_SUBCMD_NDP sub commands. - */ -enum qca_wlan_vendor_attr_ndp_sub_cmd_value -{ - QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_CREATE = 1, - QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_DELETE = 2, - QCA_WLAN_VENDOR_ATTR_NDP_INITIATOR_REQUEST = 3, - QCA_WLAN_VENDOR_ATTR_NDP_INITIATOR_RESPONSE = 4, - QCA_WLAN_VENDOR_ATTR_NDP_RESPONDER_REQUEST = 5, - QCA_WLAN_VENDOR_ATTR_NDP_RESPONDER_RESPONSE = 6, - QCA_WLAN_VENDOR_ATTR_NDP_END_REQUEST = 7, - QCA_WLAN_VENDOR_ATTR_NDP_END_RESPONSE = 8, - QCA_WLAN_VENDOR_ATTR_NDP_DATA_REQUEST_IND = 9, - QCA_WLAN_VENDOR_ATTR_NDP_CONFIRM_IND = 10, - QCA_WLAN_VENDOR_ATTR_NDP_END_IND = 11, - QCA_WLAN_VENDOR_ATTR_NDP_SCHEDULE_UPDATE_IND = 12 -}; - -#define PACKET_FILTER_ID 0 - -enum packet_filter_sub_cmd -{ - QCA_WLAN_SET_PACKET_FILTER = 1, - QCA_WLAN_GET_PACKET_FILTER_SIZE = 2, - /* For writing packet filter program + data */ - QCA_WLAN_WRITE_PACKET_FILTER = 3, - /* For reading packet filter data */ - QCA_WLAN_READ_PACKET_FILTER = 4, - /* Enable APF faeature */ - QCA_WLAN_ENABLE_PACKET_FILTER = 5, - /* Disable APF faeature */ - QCA_WLAN_DISABLE_PACKET_FILTER = 6, -}; - -enum qca_wlan_vendor_attr_packet_filter -{ - QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_INVALID = 0, - - QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_SUB_CMD, - QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_VERSION, - QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_ID, - QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_TOTAL_LENGTH, - QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_CURRENT_OFFSET, - QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_PROGRAM, - /* The length of the program in the write buffer, - * the write buffer may have program+data - */ - QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_PROG_LENGTH, - - /* keep last */ - QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_AFTER_LAST, - QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_MAX = - QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_AFTER_LAST - 1, - -}; - -enum qca_wlan_vendor_attr_nd_offload -{ - QCA_WLAN_VENDOR_ATTR_ND_OFFLOAD_INVALID = 0, - - QCA_WLAN_VENDOR_ATTR_ND_OFFLOAD_FLAG, - - /* keep last */ - QCA_WLAN_VENDOR_ATTR_ND_OFFLOAD_AFTER_LAST, - QCA_WLAN_VENDOR_ATTR_ND_OFFLOAD_MAX = - QCA_WLAN_VENDOR_ATTR_ND_OFFLOAD_AFTER_LAST - 1, - -}; - -enum qca_wlan_vendor_drv_info -{ - QCA_WLAN_VENDOR_ATTR_DRV_INFO_INVALID = 0, - - QCA_WLAN_VENDOR_ATTR_DRV_INFO_BUS_SIZE, - - /* keep last */ - QCA_WLAN_VENDOR_ATTR_DRV_INFO_AFTER_LAST, - QCA_WLAN_VENDOR_ATTR_DRV_INFO_MAX = - QCA_WLAN_VENDOR_ATTR_DRV_INFO_AFTER_LAST - 1, - -}; - -/* NL attributes for data used by - * QCA_NL80211_VENDOR_SUBCMD_GET_WAKE_REASON_STATS sub command. - */ -enum qca_wlan_vendor_attr_wake_stats -{ - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_INVALID = 0, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_TOTAL_CMD_EVENT_WAKE, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_CMD_EVENT_WAKE_CNT_PTR, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_CMD_EVENT_WAKE_CNT_SZ, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_TOTAL_DRIVER_FW_LOCAL_WAKE, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_DRIVER_FW_LOCAL_WAKE_CNT_PTR, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_DRIVER_FW_LOCAL_WAKE_CNT_SZ, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_TOTAL_RX_DATA_WAKE, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_RX_UNICAST_CNT, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_RX_MULTICAST_CNT, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_RX_BROADCAST_CNT, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_ICMP_PKT, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_ICMP6_PKT, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_ICMP6_RA, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_ICMP6_NA, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_ICMP6_NS, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_ICMP4_RX_MULTICAST_CNT, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_ICMP6_RX_MULTICAST_CNT, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_OTHER_RX_MULTICAST_CNT, - /* keep last */ - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_AFTER_LAST, - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_MAX = - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_AFTER_LAST - 1, -}; - -/** - * enum qca_wlan_vendor_attr_mac - Used by the vendor command - * QCA_NL80211_VENDOR_SUBCMD_WLAN_MAC_INFO. - */ -enum qca_wlan_vendor_attr_mac { - QCA_WLAN_VENDOR_ATTR_MAC_INVALID = 0, - /* MAC mode info list which has an array of nested values as - * per attributes in enum qca_wlan_vendor_attr_mac_info. - */ - QCA_WLAN_VENDOR_ATTR_MAC_INFO = 1, - /* keep last */ - QCA_WLAN_VENDOR_ATTR_MAC_AFTER_LAST, - QCA_WLAN_VENDOR_ATTR_MAC_MAX = - QCA_WLAN_VENDOR_ATTR_MAC_AFTER_LAST - 1, -}; - -/** - * enum qca_wlan_vendor_attr_mac_iface_info - Information of the connected - * WiFi netdev interface on a respective MAC. - * Used by the attribute QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO. - */ -enum qca_wlan_vendor_attr_mac_iface_info { - QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_INVALID = 0, - /* Wi-Fi Netdev's interface id.u32. */ - QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_ID = 1, - /* Associated frequency in MHz of the connected Wi-Fi interface. u32 */ - QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_FREQ = 2, - /* keep last */ - QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_AFTER_LAST, - QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_MAX = - QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO_AFTER_LAST - 1, -}; - -/** - * enum qca_wlan_vendor_attr_mac_info - Points to MAC the information. - * Used by the attribute QCA_WLAN_VENDOR_ATTR_MAC_INFO of the - * vendor command QCA_NL80211_VENDOR_SUBCMD_WLAN_MAC_INFO. - */ -enum qca_wlan_vendor_attr_mac_info { - QCA_WLAN_VENDOR_ATTR_MAC_INFO_INVALID = 0, - /* Hardware MAC ID associated for the MAC (u32) */ - QCA_WLAN_VENDOR_ATTR_MAC_INFO_MAC_ID = 1, - /* Band supported by the respective MAC at a given point. - * Represented by enum qca_wlan_vendor_mac_info_band. - */ - QCA_WLAN_VENDOR_ATTR_MAC_INFO_BAND = 2, - /* Refers to list of WLAN net dev interfaces associated with this MAC. - * Represented by enum qca_wlan_vendor_attr_mac_iface_info. - */ - QCA_WLAN_VENDOR_ATTR_MAC_IFACE_INFO = 3, - /* keep last */ - QCA_WLAN_VENDOR_ATTR_MAC_INFO_AFTER_LAST, - QCA_WLAN_VENDOR_ATTR_MAC_INFO_MAX = - QCA_WLAN_VENDOR_ATTR_MAC_INFO_AFTER_LAST - 1, -}; #endif diff --git a/qcwcn/wifi_hal/wifi_hal.cpp b/qcwcn/wifi_hal/wifi_hal.cpp index 1a5811c..198ab01 100644 --- a/qcwcn/wifi_hal/wifi_hal.cpp +++ b/qcwcn/wifi_hal/wifi_hal.cpp @@ -52,7 +52,6 @@ #include "cpp_bindings.h" #include "ifaceeventhandler.h" #include "wifiloggercmd.h" -#include "vendor_definitions.h" /* BUGBUG: normally, libnl allocates ports for all connections it makes; but @@ -66,6 +65,7 @@ #define WIFI_HAL_CMD_SOCK_PORT 644 #define WIFI_HAL_EVENT_SOCK_PORT 645 +#define MAX_HW_VER_LENGTH 100 /* * Defines for wifi_wait_for_driver_ready() * Specify durations between polls and max wait time @@ -196,6 +196,38 @@ cleanup: return ret; } +static wifi_error acquire_driver_supported_features(wifi_interface_handle iface, + features_info *driver_features) +{ + wifi_error ret; + interface_info *iinfo = getIfaceInfo(iface); + wifi_handle handle = getWifiHandle(iface); + + WifihalGeneric driverFeatures(handle, 0, + OUI_QCA, + QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES); + + /* create the message */ + ret = driverFeatures.create(); + if (ret != WIFI_SUCCESS) + goto cleanup; + + ret = driverFeatures.set_iface_id(iinfo->name); + if (ret != WIFI_SUCCESS) + goto cleanup; + + ret = driverFeatures.requestResponse(); + if (ret != WIFI_SUCCESS) { + ALOGE("%s: requestResponse Error:%d",__func__, ret); + goto cleanup; + } + + driverFeatures.getDriverFeatures(driver_features); + +cleanup: + return mapKernelErrortoWifiHalError(ret); +} + static wifi_error wifi_get_capabilities(wifi_interface_handle handle) { wifi_error ret; @@ -425,6 +457,7 @@ wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn) { fn->wifi_select_tx_power_scenario = wifi_select_tx_power_scenario; fn->wifi_reset_tx_power_scenario = wifi_reset_tx_power_scenario; fn->wifi_set_radio_mode_change_handler = wifi_set_radio_mode_change_handler; + fn->wifi_set_latency_mode = wifi_set_latency_mode; return WIFI_SUCCESS; } @@ -454,7 +487,6 @@ static int wifi_get_iface_id(hal_info *info, const char *iface) wifi_error wifi_initialize(wifi_handle *handle) { - int err = 0; wifi_error ret = WIFI_SUCCESS; wifi_interface_handle iface_handle; struct nl_sock *cmd_sock = NULL; @@ -462,6 +494,8 @@ wifi_error wifi_initialize(wifi_handle *handle) struct nl_cb *cb = NULL; int status = 0; int index; + char hw_ver_type[MAX_HW_VER_LENGTH]; + char *hw_name = NULL; ALOGI("Initializing wifi"); hal_info *info = (hal_info *)malloc(sizeof(hal_info)); @@ -509,11 +543,11 @@ wifi_error wifi_initialize(wifi_handle *handle) goto unload; } - err = 1; + info->event_sock_arg = 1; nl_cb_set(cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM, no_seq_check, NULL); - nl_cb_err(cb, NL_CB_CUSTOM, error_handler, &err); - nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, finish_handler, &err); - nl_cb_set(cb, NL_CB_ACK, NL_CB_CUSTOM, ack_handler, &err); + nl_cb_err(cb, NL_CB_CUSTOM, error_handler, &info->event_sock_arg); + nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, finish_handler, &info->event_sock_arg); + nl_cb_set(cb, NL_CB_ACK, NL_CB_CUSTOM, ack_handler, &info->event_sock_arg); nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, internal_valid_message_handler, info); @@ -626,11 +660,36 @@ wifi_error wifi_initialize(wifi_handle *handle) ret = WIFI_SUCCESS; } + ret = acquire_driver_supported_features(iface_handle, + &info->driver_supported_features); + if (ret != WIFI_SUCCESS) { + ALOGI("Failed to get vendor feature set : %d", ret); + ret = WIFI_SUCCESS; + } + ret = wifi_get_logger_supported_feature_set(iface_handle, &info->supported_logger_feature_set); if (ret != WIFI_SUCCESS) ALOGE("Failed to get supported logger feature set: %d", ret); + ret = wifi_get_firmware_version(iface_handle, hw_ver_type, + MAX_HW_VER_LENGTH); + if (ret == WIFI_SUCCESS) { + hw_name = strstr(hw_ver_type, "HW:"); + if (hw_name) { + hw_name += strlen("HW:"); + if (strncmp(hw_name, "QCA6174", 7) == 0) + info->pkt_log_ver = PKT_LOG_V1; + else + info->pkt_log_ver = PKT_LOG_V2; + } else { + info->pkt_log_ver = PKT_LOG_V0; + } + ALOGV("%s: hardware version type %d", __func__, info->pkt_log_ver); + } else { + ALOGE("Failed to get supported logger feature set: %d", ret); + } + ret = get_firmware_bus_max_size_supported(iface_handle); if (ret != WIFI_SUCCESS) { ALOGE("Failed to get supported bus size, error : %d", ret); @@ -715,6 +774,10 @@ unload: cleanupGscanHandlers(info); cleanupRSSIMonitorHandler(info); free(info->event_cb); + if (info->driver_supported_features.flags) { + free(info->driver_supported_features.flags); + info->driver_supported_features.flags = NULL; + } free(info); } } @@ -812,6 +875,11 @@ static void internal_cleaned_up_handler(wifi_handle handle) info->pkt_fate_stats = NULL; } + if (info->driver_supported_features.flags) { + free(info->driver_supported_features.flags); + info->driver_supported_features.flags = NULL; + } + (*cleaned_up_handler)(handle); pthread_mutex_destroy(&info->cb_lock); pthread_mutex_destroy(&info->pkt_fate_stats_lock); @@ -1300,6 +1368,7 @@ cleanup: wifi_error wifi_start_sending_offloaded_packet(wifi_request_id id, wifi_interface_handle iface, + u16 ether_type, u8 *ip_packet, u16 ip_packet_len, u8 *src_mac_addr, @@ -1318,6 +1387,7 @@ wifi_error wifi_start_sending_offloaded_packet(wifi_request_id id, return ret; } + ALOGV("ether type 0x%04x\n", ether_type); ALOGV("ip packet length : %u\nIP Packet:", ip_packet_len); hexdump(ip_packet, ip_packet_len); ALOGV("Src Mac Address: " MAC_ADDR_STR "\nDst Mac Address: " MAC_ADDR_STR @@ -1341,8 +1411,14 @@ wifi_error wifi_start_sending_offloaded_packet(wifi_request_id id, if (ret != WIFI_SUCCESS) goto cleanup; + ret = vCommand->put_u16( + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_ETHER_PROTO_TYPE, + ether_type); + if (ret != WIFI_SUCCESS) + goto cleanup; + ret = vCommand->put_bytes( - QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_IP_PACKET, + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_IP_PACKET_DATA, (const char *)ip_packet, ip_packet_len); if (ret != WIFI_SUCCESS) goto cleanup; @@ -1419,6 +1495,8 @@ cleanup: return ret; } +#define PACKET_FILTER_ID 0 + static wifi_error wifi_set_packet_filter(wifi_interface_handle iface, const u8 *program, u32 len) { @@ -1458,7 +1536,7 @@ static wifi_error wifi_set_packet_filter(wifi_interface_handle iface, PACKET_FILTER_ID); if (ret != WIFI_SUCCESS) goto cleanup; - ret = vCommand->put_u32(QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_TOTAL_LENGTH, + ret = vCommand->put_u32(QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_SIZE, len); if (ret != WIFI_SUCCESS) goto cleanup; @@ -1541,7 +1619,7 @@ static wifi_error wifi_get_packet_filter_capabilities( goto cleanup; ret = vCommand->put_u32(QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_SUB_CMD, - QCA_WLAN_GET_PACKET_FILTER_SIZE); + QCA_WLAN_GET_PACKET_FILTER); if (ret != WIFI_SUCCESS) goto cleanup; @@ -1669,7 +1747,7 @@ wifi_error wifi_write_packet_filter(wifi_interface_handle iface, PACKET_FILTER_ID); if (ret != WIFI_SUCCESS) goto cleanup; - ret = vCommand->put_u32(QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_TOTAL_LENGTH, + ret = vCommand->put_u32(QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_SIZE, len); if (ret != WIFI_SUCCESS) goto cleanup; @@ -1784,13 +1862,19 @@ cleanup: static wifi_error wifi_read_packet_filter(wifi_interface_handle handle, u32 src_offset, u8 *host_dst, u32 length) { - wifi_error ret; + wifi_error ret = WIFI_SUCCESS; struct nlattr *nlData; WifihalGeneric *vCommand = NULL; interface_info *ifaceInfo = getIfaceInfo(handle); wifi_handle wifiHandle = getWifiHandle(handle); hal_info *info = getHalInfo(wifiHandle); + /* Length to be passed to this function should be non-zero + * Return invalid argument if length is passed as zero + */ + if (length == 0) + return WIFI_ERROR_INVALID_ARGS; + /*Temporary varibles to support the read complete length in chunks */ u8 *temp_host_dst; u32 remainingLengthToBeRead, currentLength; @@ -1844,7 +1928,7 @@ static wifi_error wifi_read_packet_filter(wifi_interface_handle handle, currentLength = min(remainingLengthToBeRead, info->firmware_bus_max_size); - ret = vCommand->put_u32(QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_TOTAL_LENGTH, + ret = vCommand->put_u32(QCA_WLAN_VENDOR_ATTR_PACKET_FILTER_SIZE, currentLength); if (ret != WIFI_SUCCESS) break; diff --git a/qcwcn/wifi_hal/wificonfig.cpp b/qcwcn/wifi_hal/wificonfig.cpp index 9d1fef2..a2f0fb3 100644 --- a/qcwcn/wifi_hal/wificonfig.cpp +++ b/qcwcn/wifi_hal/wificonfig.cpp @@ -84,7 +84,7 @@ wifi_error wifi_extended_dtim_config_set(wifi_request_id id, } ret = wifiConfigCommand->put_u32( - QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_DYNAMIC_DTIM, extended_dtim); + QCA_WLAN_VENDOR_ATTR_CONFIG_DYNAMIC_DTIM, extended_dtim); if (ret != WIFI_SUCCESS) { ALOGE("wifi_extended_dtim_config_set(): failed to put vendor data. " "Error:%d", ret); @@ -105,6 +105,14 @@ cleanup: return ret; } +int check_feature(enum qca_wlan_vendor_features feature, features_info *info) +{ + size_t idx = feature / 8; + + return (idx < info->flags_len) && + (info->flags[idx] & BIT(feature % 8)); +} + /* Set the country code to driver. */ wifi_error wifi_set_country_code(wifi_interface_handle iface, const char* country_code) @@ -113,6 +121,7 @@ wifi_error wifi_set_country_code(wifi_interface_handle iface, wifi_error ret; WiFiConfigCommand *wifiConfigCommand; wifi_handle wifiHandle = getWifiHandle(iface); + hal_info *info = getHalInfo(wifiHandle); ALOGV("%s: %s", __FUNCTION__, country_code); @@ -144,6 +153,18 @@ wifi_error wifi_set_country_code(wifi_interface_handle iface, goto cleanup; } + if (check_feature(QCA_WLAN_VENDOR_FEATURE_SELF_MANAGED_REGULATORY, + &info->driver_supported_features)) { + ret = wifiConfigCommand->put_u32(NL80211_ATTR_USER_REG_HINT_TYPE, + NL80211_USER_REG_HINT_CELL_BASE); + if (ret != WIFI_SUCCESS) { + ALOGE("wifi_set_country_code: put reg hint type failed. Error:%d", + ret); + goto cleanup; + } + } + + /* Send the NL msg. */ wifiConfigCommand->waitForRsp(false); ret = wifiConfigCommand->requestEvent(); @@ -205,7 +226,7 @@ wifi_error wifi_set_beacon_wifi_iface_stats_averaging_factor( } if (wifiConfigCommand->put_u32( - QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_STATS_AVG_FACTOR, factor)) { + QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR, factor)) { ALOGE("wifi_set_beacon_wifi_iface_stats_averaging_factor(): failed to " "put vendor data. Error:%d", ret); goto cleanup; @@ -271,7 +292,7 @@ wifi_error wifi_set_guard_time(wifi_request_id id, } if (wifiConfigCommand->put_u32( - QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_GUARD_TIME, guard_time)) { + QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME, guard_time)) { ALOGE("wifi_set_guard_time: failed to add vendor data."); goto cleanup; } @@ -337,6 +358,7 @@ wifi_error wifi_select_tx_power_scenario(wifi_interface_handle handle, switch (scenario) { case WIFI_POWER_SCENARIO_VOICE_CALL: case WIFI_POWER_SCENARIO_ON_HEAD_CELL_OFF: + case WIFI_POWER_SCENARIO_ON_BODY_BT: bdf_file = QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_BDF0; break; @@ -435,6 +457,95 @@ cleanup: return ret; } +wifi_error wifi_set_latency_mode(wifi_interface_handle handle, + wifi_latency_mode mode) { + wifi_error ret; + WiFiConfigCommand *wifiConfigCommand; + struct nlattr *nlData; + u32 latency_mode; + interface_info *ifaceInfo = getIfaceInfo(handle); + wifi_handle wifiHandle = getWifiHandle(handle); + hal_info *info = getHalInfo(wifiHandle); + + ALOGV("%s : latency mode:%d", __FUNCTION__, mode); + + /* Check Supported low-latency capability */ + if (!(info->supported_feature_set & WIFI_FEATURE_SET_LATENCY_MODE)) { + ALOGE("%s: Set latency mode feature not supported %x", __FUNCTION__, + info->supported_feature_set); + return WIFI_ERROR_NOT_SUPPORTED; + } + + wifiConfigCommand = new WiFiConfigCommand( + wifiHandle, + 1, + OUI_QCA, + QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION); + if (wifiConfigCommand == NULL) { + ALOGE("%s: Error wifiConfigCommand NULL", __FUNCTION__); + return WIFI_ERROR_UNKNOWN; + } + + /* Create the NL message. */ + ret = wifiConfigCommand->create(); + if (ret != WIFI_SUCCESS) { + ALOGE("wifi_set_latency_mode: failed to create NL msg. Error:%d", ret); + goto cleanup; + } + + /* Set the interface Id of the message. */ + ret = wifiConfigCommand->set_iface_id(ifaceInfo->name); + if (ret != WIFI_SUCCESS) { + ALOGE("wifi_set_latency_mode: failed to set iface id. Error:%d", ret); + goto cleanup; + } + + /* Add the vendor specific attributes for the NL command. */ + nlData = wifiConfigCommand->attr_start(NL80211_ATTR_VENDOR_DATA); + if (!nlData) { + ret = WIFI_ERROR_UNKNOWN; + ALOGE("wifi_set_latency_mode: failed attr_start for VENDOR_DATA. " + "Error:%d", ret); + goto cleanup; + } + + switch(mode) { + case WIFI_LATENCY_MODE_NORMAL: + latency_mode = QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_NORMAL; + break; + + case WIFI_LATENCY_MODE_LOW: + latency_mode = QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_LOW; + break; + + default: + ALOGE("wifi_set_latency_mode: Invalid mode: %d", mode); + ret = WIFI_ERROR_UNKNOWN; + goto cleanup; + } + + if (wifiConfigCommand->put_u32( + QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL, + latency_mode)) { + ALOGE("wifi_set_latency_mode: failed to put latency mode"); + ret = WIFI_ERROR_UNKNOWN; + goto cleanup; + } + wifiConfigCommand->attr_end(nlData); + + /* Send the NL msg. */ + wifiConfigCommand->waitForRsp(false); + ret = wifiConfigCommand->requestEvent(); + if (ret != WIFI_SUCCESS) { + ALOGE("wifi_set_latency_mode: requestEvent Error:%d", ret); + goto cleanup; + } + +cleanup: + delete wifiConfigCommand; + return ret; +} + WiFiConfigCommand::WiFiConfigCommand(wifi_handle handle, int id, u32 vendor_id, u32 subcmd) diff --git a/qcwcn/wifi_hal/wificonfigcommand.h b/qcwcn/wifi_hal/wificonfigcommand.h index 53bb288..bbe89a0 100644 --- a/qcwcn/wifi_hal/wificonfigcommand.h +++ b/qcwcn/wifi_hal/wificonfigcommand.h @@ -38,7 +38,6 @@ #define PRINTF_FORMAT(a,b) #define STRUCT_PACKED #endif -#include "vendor_definitions.h" #include "wifi_config.h" #ifdef __cplusplus diff --git a/qcwcn/wifi_hal/wifihal_vendor.cpp b/qcwcn/wifi_hal/wifihal_vendor.cpp index 33842f2..f408342 100644 --- a/qcwcn/wifi_hal/wifihal_vendor.cpp +++ b/qcwcn/wifi_hal/wifihal_vendor.cpp @@ -37,7 +37,6 @@ #include "common.h" #include "cpp_bindings.h" #include "wifihal_vendorcommand.h" -#include "vendor_definitions.h" //Singleton Static Instance NUDStatsCommand* NUDStatsCommand::mNUDStatsCommandInstance = NULL; diff --git a/qcwcn/wifi_hal/wifilogger.cpp b/qcwcn/wifi_hal/wifilogger.cpp index 11a6b6e..7e8efe6 100644 --- a/qcwcn/wifi_hal/wifilogger.cpp +++ b/qcwcn/wifi_hal/wifilogger.cpp @@ -147,7 +147,8 @@ wifi_error wifi_start_logging(wifi_interface_handle iface, if (ret != WIFI_SUCCESS) ALOGE("%s: Error %d happened. ", __FUNCTION__, ret); - ALOGV("%s: Logging Started for %s.", __FUNCTION__, buffer_name); + ALOGV("%s: Logging Started for %s. with verboselevel %d", + __FUNCTION__, buffer_name,verbose_level); rb_start_logging(&info->rb_infos[ring_id], verbose_level, flags, max_interval_sec, min_data_size); cleanup: @@ -257,7 +258,7 @@ wifi_error wifi_get_logger_supported_feature_set(wifi_interface_handle iface, if (!nlData) goto cleanup; - ret = wifiLoggerCommand->put_u32(QCA_WLAN_VENDOR_ATTR_FEATURE_SET, + ret = wifiLoggerCommand->put_u32(QCA_WLAN_VENDOR_ATTR_LOGGER_SUPPORTED, requestId); if (ret != WIFI_SUCCESS) goto cleanup; @@ -1051,14 +1052,14 @@ int WifiLoggerCommand::handleResponse(WifiEvent &reply) { break; case QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET: { - struct nlattr *tb_vendor[QCA_WLAN_VENDOR_ATTR_FEATURE_SET_MAX + 1]; + struct nlattr *tb_vendor[QCA_WLAN_VENDOR_ATTR_LOGGER_MAX + 1]; - nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_FEATURE_SET_MAX, + nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_LOGGER_MAX, (struct nlattr *)mVendorData, mDataLen, NULL); - if (tb_vendor[QCA_WLAN_VENDOR_ATTR_FEATURE_SET]) { + if (tb_vendor[QCA_WLAN_VENDOR_ATTR_LOGGER_SUPPORTED]) { *mSupportedSet = - nla_get_u32(tb_vendor[QCA_WLAN_VENDOR_ATTR_FEATURE_SET]); + nla_get_u32(tb_vendor[QCA_WLAN_VENDOR_ATTR_LOGGER_SUPPORTED]); #ifdef QC_HAL_DEBUG ALOGV("%s: Supported Feature Set : val 0x%x", __FUNCTION__, *mSupportedSet); @@ -1156,68 +1157,65 @@ int WifiLoggerCommand::handleResponse(WifiEvent &reply) { break; case QCA_NL80211_VENDOR_SUBCMD_GET_WAKE_REASON_STATS: { - struct nlattr *tbVendor[QCA_WLAN_VENDOR_ATTR_WAKE_STATS_MAX +1]; + struct nlattr *tbVendor[QCA_WLAN_VENDOR_GET_WAKE_STATS_MAX+1]; /* parse and extract wake reason stats */ - nla_parse(tbVendor, QCA_WLAN_VENDOR_ATTR_WAKE_STATS_MAX, + nla_parse(tbVendor, QCA_WLAN_VENDOR_GET_WAKE_STATS_MAX, (struct nlattr *)mVendorData, mDataLen, NULL); if (!tbVendor[ QCA_WLAN_VENDOR_ATTR_WAKE_STATS_TOTAL_CMD_EVENT_WAKE]) { - ALOGE("%s: TOTAL_CMD_EVENT_WAKE not found", __FUNCTION__); - break; + mGetWakeStats->total_cmd_event_wake = 0; + } else { + mGetWakeStats->total_cmd_event_wake = nla_get_u32( + tbVendor[QCA_WLAN_VENDOR_ATTR_WAKE_STATS_TOTAL_CMD_EVENT_WAKE]); } - mGetWakeStats->total_cmd_event_wake = nla_get_u32( - tbVendor[QCA_WLAN_VENDOR_ATTR_WAKE_STATS_TOTAL_CMD_EVENT_WAKE]); if (mGetWakeStats->total_cmd_event_wake && mGetWakeStats->cmd_event_wake_cnt) { if (!tbVendor[ QCA_WLAN_VENDOR_ATTR_WAKE_STATS_CMD_EVENT_WAKE_CNT_PTR]) { - ALOGE("%s: CMD_EVENT_WAKE_CNT_PTR not found", __FUNCTION__); - break; + mGetWakeStats->cmd_event_wake_cnt_used = 0; + } else { + len = nla_len(tbVendor[ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_CMD_EVENT_WAKE_CNT_PTR]); + mGetWakeStats->cmd_event_wake_cnt_used = + (len < mGetWakeStats->cmd_event_wake_cnt_sz) ? len : + mGetWakeStats->cmd_event_wake_cnt_sz; + memcpy(mGetWakeStats->cmd_event_wake_cnt, + nla_data(tbVendor[ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_CMD_EVENT_WAKE_CNT_PTR]), + (mGetWakeStats->cmd_event_wake_cnt_used * sizeof(int))); } - len = nla_len(tbVendor[ - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_CMD_EVENT_WAKE_CNT_PTR]); - mGetWakeStats->cmd_event_wake_cnt_used = - (len < mGetWakeStats->cmd_event_wake_cnt_sz) ? len : - mGetWakeStats->cmd_event_wake_cnt_sz; - memcpy(mGetWakeStats->cmd_event_wake_cnt, - nla_data(tbVendor[ - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_CMD_EVENT_WAKE_CNT_PTR]), - (mGetWakeStats->cmd_event_wake_cnt_used * sizeof(int))); } else mGetWakeStats->cmd_event_wake_cnt_used = 0; if (!tbVendor[ - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_TOTAL_DRIVER_FW_LOCAL_WAKE]) - { - ALOGE("%s: TOTAL_DRIVER_FW_LOCAL_WAKE not found", __FUNCTION__); - break; + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_TOTAL_DRIVER_FW_LOCAL_WAKE]) { + mGetWakeStats->total_driver_fw_local_wake = 0; + } else { + mGetWakeStats->total_driver_fw_local_wake = nla_get_u32(tbVendor[ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_TOTAL_DRIVER_FW_LOCAL_WAKE]); } - mGetWakeStats->total_driver_fw_local_wake = nla_get_u32(tbVendor[ - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_TOTAL_DRIVER_FW_LOCAL_WAKE]); if (mGetWakeStats->total_driver_fw_local_wake && mGetWakeStats->driver_fw_local_wake_cnt) { if (!tbVendor[ - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_DRIVER_FW_LOCAL_WAKE_CNT_PTR]) - { - ALOGE("%s: DRIVER_FW_LOCAL_WAKE_CNT_PTR not found", - __FUNCTION__); - break; + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_DRIVER_FW_LOCAL_WAKE_CNT_PTR]) { + mGetWakeStats->driver_fw_local_wake_cnt_used = 0; + } else { + len = nla_len(tbVendor[ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_DRIVER_FW_LOCAL_WAKE_CNT_PTR]); + mGetWakeStats->driver_fw_local_wake_cnt_used = + (len < mGetWakeStats->driver_fw_local_wake_cnt_sz) ? len : + mGetWakeStats->driver_fw_local_wake_cnt_sz; + + memcpy(mGetWakeStats->driver_fw_local_wake_cnt, + nla_data(tbVendor[ + QCA_WLAN_VENDOR_ATTR_WAKE_STATS_DRIVER_FW_LOCAL_WAKE_CNT_PTR]), + (mGetWakeStats->driver_fw_local_wake_cnt_used * sizeof(int))); } - len = nla_len(tbVendor[ - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_DRIVER_FW_LOCAL_WAKE_CNT_PTR]); - mGetWakeStats->driver_fw_local_wake_cnt_used = - (len < mGetWakeStats->driver_fw_local_wake_cnt_sz) ? len : - mGetWakeStats->driver_fw_local_wake_cnt_sz; - - memcpy(mGetWakeStats->driver_fw_local_wake_cnt, - nla_data(tbVendor[ - QCA_WLAN_VENDOR_ATTR_WAKE_STATS_DRIVER_FW_LOCAL_WAKE_CNT_PTR]), - (mGetWakeStats->driver_fw_local_wake_cnt_used * sizeof(int))); } else mGetWakeStats->driver_fw_local_wake_cnt_used = 0; diff --git a/qcwcn/wifi_hal/wifilogger_diag.cpp b/qcwcn/wifi_hal/wifilogger_diag.cpp index bbdeb7c..4dd9810 100644 --- a/qcwcn/wifi_hal/wifilogger_diag.cpp +++ b/qcwcn/wifi_hal/wifilogger_diag.cpp @@ -1238,6 +1238,17 @@ static void process_wlan_log_complete_event(hal_info *info, } } +static void process_wlan_data_stall_event(hal_info *info, + u8* buf, + int length) +{ + wlan_data_stall_event_t *event; + + ALOGV("Received Data Stall Event from Driver"); + event = (wlan_data_stall_event_t *)buf; + ALOGE("Received Data Stall event, sending alert %d", event->reason); + send_alert(info, DATA_STALL_OFFSET_REASON_CODE + event->reason); +} static void process_wlan_low_resource_failure(hal_info *info, u8* buf, @@ -1298,7 +1309,7 @@ static wifi_error update_stats_to_ring_buf(hal_info *info, pRingBufferEntry->timestamp = time.tv_usec + time.tv_sec * 1000 * 1000; // Write if verbose and handler is set - if ((info->rb_infos[PKT_STATS_RB_ID].verbose_level >= VERBOSE_DEBUG_PROBLEM) + if ((info->rb_infos[PKT_STATS_RB_ID].verbose_level >= VERBOSE_REPRO_PROBLEM) && info->on_ring_buffer_data) { ring_buffer_write(&info->rb_infos[PKT_STATS_RB_ID], (u8*)pRingBufferEntry, @@ -1310,6 +1321,117 @@ static wifi_error update_stats_to_ring_buf(hal_info *info, return WIFI_SUCCESS; } +static u8 cck_ratecode_mapping(u8 rate) +{ + u8 rate_code = 0; + + switch (rate) { + case 0x1: + rate_code = 0x3; + break; + case 0x2: + case 0x5: + rate_code = 0x2; + break; + case 0x3: + case 0x6: + rate_code = 0x1; + break; + case 0x4: + case 0x7: + rate_code = 0x0; + break; + } + return rate_code; +} + +static u8 ofdm_ratecode_mapping(u8 rate) +{ + u8 rate_code = 0; + + rate_code = rate - 8; + return rate_code; +} + +static u16 get_rate_v1(u16 mcs_r) +{ + MCS mcs; + int index = 0; + u16 tx_rate = 0; + u8 nss; + + mcs.mcs = mcs_r; + nss = mcs.mcs_s.nss + 1; + + switch (mcs.mcs_s.preamble) { + case WIFI_HW_RATECODE_PREAM_OFDM: + for (index = 0; index < MAX_OFDM_MCS_IDX; index++) { + if ((mcs.mcs_s.rate & 0xF) == index) + tx_rate = (u16) ofdm_mcs_nss1[index].ofdm_rate[mcs.mcs_s.short_gi] / 1000; + } + break; + case WIFI_HW_RATECODE_PREAM_CCK: + for (index = 0; index < MAX_CCK_MCS_IDX; index++) { + if ((mcs.mcs_s.rate & 0xF) == index) + tx_rate = (u16) cck_mcs_nss1[index].cck_rate[mcs.mcs_s.short_gi] / 1000; + } + break; + case WIFI_HW_RATECODE_PREAM_HT: + if (nss == 1) { + for (index = 0; index < MAX_HT_MCS_IDX; index++) { + if (mcs.mcs_s.rate == index) { + if (mcs.mcs_s.bw == BW_20MHZ) + tx_rate = (u16) mcs_nss1[index].ht20_rate[mcs.mcs_s.short_gi] / 10; + if (mcs.mcs_s.bw == BW_40MHZ) + tx_rate = (u16) mcs_nss1[index].ht40_rate[mcs.mcs_s.short_gi] / 10; + } + } + } else if (nss == 2) { + for (index = 0; index < MAX_HT_MCS_IDX; index++) { + if (mcs.mcs_s.rate == index) { + if (mcs.mcs_s.bw == BW_20MHZ) + tx_rate = (u16) mcs_nss2[index].ht20_rate[mcs.mcs_s.short_gi] / 10; + if (mcs.mcs_s.bw == BW_40MHZ) + tx_rate = (u16) mcs_nss2[index].ht40_rate[mcs.mcs_s.short_gi] / 10; + } + } + } else { + ALOGE("Unexpected nss %d", nss); + } + break; + case WIFI_HW_RATECODE_PREAM_VHT: + if (nss == 1) { + for (index = 0; index < MAX_VHT_MCS_IDX; index++) { + if (mcs.mcs_s.rate == index) { + if (mcs.mcs_s.bw == BW_20MHZ) + tx_rate = (u16) vht_mcs_nss1[index].ht20_rate[mcs.mcs_s.short_gi] / 10; + if (mcs.mcs_s.bw == BW_40MHZ) + tx_rate = (u16) vht_mcs_nss1[index].ht40_rate[mcs.mcs_s.short_gi] / 10; + if (mcs.mcs_s.bw == BW_80MHZ) + tx_rate = (u16) vht_mcs_nss1[index].ht40_rate[mcs.mcs_s.short_gi] / 10; + } + } + } else if (nss == 2) { + for (index = 0; index < MAX_VHT_MCS_IDX; index++) { + if (mcs.mcs_s.rate == index) { + if (mcs.mcs_s.bw == BW_20MHZ) + tx_rate = (u16) vht_mcs_nss2[index].ht20_rate[mcs.mcs_s.short_gi] / 10; + if (mcs.mcs_s.bw == BW_40MHZ) + tx_rate = (u16) vht_mcs_nss2[index].ht40_rate[mcs.mcs_s.short_gi] / 10; + if (mcs.mcs_s.bw == BW_80MHZ) + tx_rate = (u16) vht_mcs_nss2[index].ht40_rate[mcs.mcs_s.short_gi] / 10; + } + } + } else { + ALOGE("Unexpected nss %d", nss); + } + break; + default: + ALOGE("Unexpected preamble %d", mcs.mcs_s.preamble); + } + return tx_rate; +} + static u16 get_rate(u16 mcs_r) { u16 tx_rate = 0; @@ -1416,6 +1538,136 @@ static wifi_error populate_rx_aggr_stats(hal_info *info) return WIFI_SUCCESS; } +static wifi_error parse_rx_stats_v2(hal_info *info, u8 *buf, u16 size) +{ + wifi_error status = WIFI_SUCCESS; + rb_pkt_stats_t_v1 *rx_stats_rcvd = (rb_pkt_stats_t_v1 *)buf; + wifi_ring_buffer_entry *pRingBufferEntry; + u32 len_ring_buffer_entry = 0; + + if (size < sizeof(rb_pkt_stats_t)) { + ALOGE("%s Unexpected rx stats event length: %d", __FUNCTION__, size); + memset(info->rx_aggr_pkts, 0, info->rx_buf_size_occupied); + memset(&info->aggr_stats, 0, sizeof(rx_aggr_stats)); + info->rx_buf_size_occupied = 0; + return WIFI_ERROR_UNKNOWN; + } + + len_ring_buffer_entry = sizeof(wifi_ring_buffer_entry) + + sizeof(wifi_ring_per_packet_status_entry) + + RX_HTT_HDR_STATUS_LEN_V1; + + if (len_ring_buffer_entry + info->rx_buf_size_occupied + > info->rx_buf_size_allocated) { + wifi_ring_buffer_entry *temp; + temp = (wifi_ring_buffer_entry *)realloc(info->rx_aggr_pkts, + len_ring_buffer_entry + info->rx_buf_size_occupied); + if (temp == NULL) { + ALOGE("%s: Failed to reallocate memory", __FUNCTION__); + free(info->rx_aggr_pkts); + info->rx_aggr_pkts = NULL; + return WIFI_ERROR_OUT_OF_MEMORY; + } + info->rx_aggr_pkts = temp; + memset((u8 *)info->rx_aggr_pkts + info->rx_buf_size_allocated, 0, + len_ring_buffer_entry + info->rx_buf_size_occupied + - info->rx_buf_size_allocated); + info->rx_buf_size_allocated = + len_ring_buffer_entry + info->rx_buf_size_occupied; + } + + pRingBufferEntry = (wifi_ring_buffer_entry *)((u8 *)info->rx_aggr_pkts + + info->rx_buf_size_occupied); + + info->rx_buf_size_occupied += len_ring_buffer_entry; + + /* Fill size of the entry in rb entry which can be used while populating + * the data. Actual size that needs to be sent to ring buffer is only pps + * entry size + */ + pRingBufferEntry->entry_size = len_ring_buffer_entry; + wifi_ring_per_packet_status_entry *rb_pkt_stats = + (wifi_ring_per_packet_status_entry *)(pRingBufferEntry + 1); + + memset(rb_pkt_stats, 0, sizeof(wifi_ring_per_packet_status_entry)); + + /* Peer tx packet and it is an Rx packet for us */ + rb_pkt_stats->flags |= PER_PACKET_ENTRY_FLAGS_DIRECTION_TX; + + if (!((rx_stats_rcvd->mpdu_end.overflow_err) || + (rx_stats_rcvd->attention.fcs_err) || + (rx_stats_rcvd->attention.mpdu_length_err) || + (rx_stats_rcvd->attention.msdu_length_err) || + (rx_stats_rcvd->attention.tkip_mic_err) || + (rx_stats_rcvd->attention.decrypt_err))) + rb_pkt_stats->flags |= PER_PACKET_ENTRY_FLAGS_TX_SUCCESS; + + rb_pkt_stats->flags |= PER_PACKET_ENTRY_FLAGS_80211_HEADER; + + if (rx_stats_rcvd->mpdu_start.encrypted) + rb_pkt_stats->flags |= PER_PACKET_ENTRY_FLAGS_PROTECTED; + + if (rx_stats_rcvd->attention.first_mpdu) { + MCS *mcs = &info->aggr_stats.RxMCS; + u32 ht_vht_sig; + + /* Flush the cached stats as this is the first MPDU. */ + memset(&info->aggr_stats, 0, sizeof(rx_aggr_stats)); + if (rx_stats_rcvd->ppdu_start.preamble_type == PREAMBLE_L_SIG_RATE) { + if (rx_stats_rcvd->ppdu_start.l_sig_rate_select) { + mcs->mcs_s.preamble = WIFI_HW_RATECODE_PREAM_CCK; + mcs->mcs_s.rate = cck_ratecode_mapping(rx_stats_rcvd->ppdu_start.l_sig_rate); + } else { + mcs->mcs_s.preamble = WIFI_HW_RATECODE_PREAM_OFDM; + mcs->mcs_s.rate = ofdm_ratecode_mapping(rx_stats_rcvd->ppdu_start.l_sig_rate); + } + /*BW is 0 for legacy cases*/ + } else if (rx_stats_rcvd->ppdu_start.preamble_type == + PREAMBLE_VHT_SIG_A_1) { + ht_vht_sig = rx_stats_rcvd->ppdu_start.ht_sig_vht_sig_a_1; + mcs->mcs_s.nss = ((ht_vht_sig >> 3) & 0x3); + //mcs->mcs_s.nss = (ht_vht_sig & BITMASK(7)) >> 3; + mcs->mcs_s.preamble = WIFI_HW_RATECODE_PREAM_HT; + mcs->mcs_s.rate = ((ht_vht_sig & BITMASK(7)) % 8) & 0xF; + mcs->mcs_s.bw = ((ht_vht_sig >> 7) & 1); + mcs->mcs_s.short_gi = + ((rx_stats_rcvd->ppdu_start.ht_sig_vht_sig_a_2 >> 7) & 1); + } else if (rx_stats_rcvd->ppdu_start.preamble_type == + PREAMBLE_VHT_SIG_A_2) { + ht_vht_sig = rx_stats_rcvd->ppdu_start.ht_sig_vht_sig_a_1; + mcs->mcs_s.nss = ((ht_vht_sig >> 10) & 0x3); + mcs->mcs_s.preamble = WIFI_HW_RATECODE_PREAM_VHT; + mcs->mcs_s.rate = + (rx_stats_rcvd->ppdu_start.ht_sig_vht_sig_a_2 >> 4) & BITMASK(4); + mcs->mcs_s.bw = (ht_vht_sig & 3); + mcs->mcs_s.short_gi = + (rx_stats_rcvd->ppdu_start.ht_sig_vht_sig_a_2 & 1); + } + + info->aggr_stats.last_transmit_rate + = get_rate_v1(info->aggr_stats.RxMCS.mcs); + + info->aggr_stats.rssi = rx_stats_rcvd->ppdu_start.rssi_comb; + info->aggr_stats.tid = rx_stats_rcvd->mpdu_start.tid; + } + rb_pkt_stats->link_layer_transmit_sequence + = rx_stats_rcvd->mpdu_start.seq_num; + + memcpy(&rb_pkt_stats->data[0], &rx_stats_rcvd->rx_hdr_status[0], + RX_HTT_HDR_STATUS_LEN_V1); + + if ((rx_stats_rcvd->attention.last_mpdu + && rx_stats_rcvd->msdu_end.last_msdu) + || (rx_stats_rcvd->attention.first_mpdu + && rx_stats_rcvd->attention.last_mpdu)) { + info->aggr_stats.timestamp = rx_stats_rcvd->ppdu_end.wb_timestamp_lower_32; + + status = populate_rx_aggr_stats(info); + } + + return status; +} + static wifi_error parse_rx_stats(hal_info *info, u8 *buf, u16 size) { wifi_error status = WIFI_SUCCESS; @@ -1540,6 +1792,25 @@ static wifi_error parse_rx_stats(hal_info *info, u8 *buf, u16 size) return status; } +static u16 get_tx_mcs_v1(u8 *data) +{ + MCS mcs; + RATE_CODE rate_code; + u16 extended_flags; + mcs.mcs = 0; + + rate_code = *((RATE_CODE*)(data + RATE_CODE_OFFSET)); + extended_flags = *((u16*)(data + EXT_FLAGS_OFFSET)); + + mcs.mcs_s.rate = rate_code.rateCode & 0xF; + mcs.mcs_s.nss = (rate_code.rateCode >> 4) & 0x3; + mcs.mcs_s.preamble = (rate_code.rateCode >> 6) & 0x3; + mcs.mcs_s.short_gi = (((extended_flags >> 12) & 0x1) == 1) ? 1 : 0; + mcs.mcs_s.bw = (rate_code.flags >> 5) & 0x3; + + return mcs.mcs; +} + static u16 get_tx_mcs(u8 series, struct tx_ppdu_start *ppdu_start) { @@ -1839,7 +2110,7 @@ wifi_error write_per_packet_stats_to_rb(hal_info *info, u8 *buf, u16 length) rb_entry_hdr.timestamp = time.tv_usec + time.tv_sec * 1000 * 1000; /* Write if verbose and handler is set */ - if (info->rb_infos[PKT_STATS_RB_ID].verbose_level >= 3 && + if (info->rb_infos[PKT_STATS_RB_ID].verbose_level >= VERBOSE_REPRO_PROBLEM && info->on_ring_buffer_data) { /* Write header and payload separately to avoid * complete payload memcpy */ @@ -2001,8 +2272,155 @@ static wifi_error parse_pkt_fate_stats(hal_info *info, u8 *buf, u16 size) return WIFI_SUCCESS; } +/* + * --------------------------------------------------------------------------------- + * | pkt log | packet log data contain sub packet log info | + * | header |------------------------------------------------------------------| + * | | sub pkt log | sub pkt log | sub pkt log | sub pkt log | | + * | | header | data | header | data |..... | + * |-------------------------------------------------------------------------------- + */ +static wifi_error parse_stats_sw_event(hal_info *info, + wh_pktlog_hdr_v2_t *pkt_stats_header) +{ + u32 pkt_stats_len; + int num_of_node = 0; + u8 *data; + u8 *node_pkt_data; + wh_pktlog_hdr_v2_t *pkt_stats_node_header; + int node_pkt_type,pkt_sub_type,node_pkt_len,i; + wifi_error status = WIFI_SUCCESS; + node_pkt_stats node_pkt_t; + wifi_ring_buffer_entry *pRingBufferEntry = + (wifi_ring_buffer_entry *)info->pkt_stats->tx_stats; + + wifi_ring_per_packet_status_entry *rb_pkt_stats = + (wifi_ring_per_packet_status_entry *)(pRingBufferEntry + 1); + + pkt_stats_len = pkt_stats_header->size; + data = ((u8 *)pkt_stats_header + sizeof(wh_pktlog_hdr_v2_t)); + num_of_node = (pkt_stats_header->reserved >> 16) & 0xFFFF; + pkt_sub_type = pkt_stats_header->reserved & 0xFFFF; + + do { + if (pkt_stats_len < sizeof(wh_pktlog_hdr_v2_t)) { + status = WIFI_ERROR_INVALID_ARGS; + break; + } + if (pkt_sub_type == 1) { + pkt_stats_node_header = (wh_pktlog_hdr_v2_t *)data; + if (pkt_stats_node_header) { + node_pkt_type = pkt_stats_node_header->log_type; + node_pkt_len = pkt_stats_node_header->size; + node_pkt_data = ((u8 *)pkt_stats_node_header + sizeof(wh_pktlog_hdr_v2_t)); + switch (node_pkt_type) { + case PKTLOG_TYPE_TX_CTRL: + info->pkt_stats->tx_stats_events |= BIT(PKTLOG_TYPE_TX_CTRL); + break; + case PKTLOG_TYPE_TX_STAT: + { + memset(rb_pkt_stats, 0, sizeof(wifi_ring_per_packet_status_entry)); + memset(&node_pkt_t, 0, sizeof(node_pkt_stats)); + node_pkt_t.frm_ctrl = *((u16*)(node_pkt_data + FRAME_CTRL_OFFSET)); + if (node_pkt_t.frm_ctrl & BIT(DATA_PROTECTED)) + rb_pkt_stats->flags |= PER_PACKET_ENTRY_FLAGS_PROTECTED; + rb_pkt_stats->transmit_success_timestamp = + *((u64*)(node_pkt_data + TX_SUCCESS_TMS_OFFSET)); + rb_pkt_stats->link_layer_transmit_sequence = + *((u16*)(node_pkt_data + LINK_LAYER_TX_SQN_OFFSET)); + node_pkt_t.tx_ok = *((u8*)(node_pkt_data + TX_STATUS_OFFSET)); + if (node_pkt_t.tx_ok == 0) + rb_pkt_stats->flags |= PER_PACKET_ENTRY_FLAGS_TX_SUCCESS; + rb_pkt_stats->rssi = *((u8*)(node_pkt_data + TX_RSSI_OFFSET)); + rb_pkt_stats->num_retries = *((u8*)(node_pkt_data + NO_RETRIES_OFFSET)); + node_pkt_t.qos_ctrl = *((u8*)(node_pkt_data + QOS_CTRL_OFFSET)); + rb_pkt_stats->tid = node_pkt_t.qos_ctrl & 0xF; + rb_pkt_stats->MCS = get_tx_mcs_v1(node_pkt_data); + rb_pkt_stats->last_transmit_rate = get_rate_v1(rb_pkt_stats->MCS); + node_pkt_t.bmap_failed = *((u64*)(node_pkt_data + BMAP_FAILED_OFFSET)); + node_pkt_t.bmap_enqueued = *((u64*)(node_pkt_data + BMAP_ENQUEUED_OFFSET)); + + info->pkt_stats->tx_stats_events |= BIT(PKTLOG_TYPE_TX_STAT); + rb_pkt_stats->flags |= PER_PACKET_ENTRY_FLAGS_80211_HEADER; + } + break; + } + if (info->pkt_stats->tx_stats_events & BIT(PKTLOG_TYPE_TX_STAT)) { + /* if bmap_enqueued is 1 ,Handle non aggregated cases */ + if (node_pkt_t.bmap_enqueued == 1) { + status = update_stats_to_ring_buf(info, + (u8 *)pRingBufferEntry, + sizeof(wifi_ring_buffer_entry) + + sizeof(wifi_ring_per_packet_status_entry)); + if (status != WIFI_SUCCESS) { + ALOGE("Failed to write into the ring buffer : %d", node_pkt_type); + } + } else { + /* if bmap_enqueued is more than 1 ,Handle aggregated cases */ + for (i = 0; i < MAX_BA_WINDOW_SIZE; i++) { + if (((node_pkt_t.bmap_enqueued >> i) & 0x1) == 1) { + if (((node_pkt_t.bmap_failed >> i) & 0x1) == 1) { + rb_pkt_stats->flags &= ~PER_PACKET_ENTRY_FLAGS_TX_SUCCESS; + } else { + rb_pkt_stats->flags |= PER_PACKET_ENTRY_FLAGS_TX_SUCCESS; + } + status = update_stats_to_ring_buf(info, + (u8 *)pRingBufferEntry, + sizeof(wifi_ring_buffer_entry) + + sizeof(wifi_ring_per_packet_status_entry)); + if (status != WIFI_SUCCESS) { + ALOGE("Failed to write into the ring buffer : %d", node_pkt_type); + break; + } + rb_pkt_stats->link_layer_transmit_sequence += 1; + } + } + } + } + } + pkt_stats_len = (pkt_stats_len - (sizeof(wh_pktlog_hdr_v2_t) + node_pkt_len)); + data = (u8*) (data + sizeof(wh_pktlog_hdr_v2_t) + node_pkt_len); + info->pkt_stats->tx_stats_events = 0; + } + } while (pkt_stats_len > 0); + return status; +} + +/* Added This function to parse stats based on PKT_LOG_V2 Version */ +static wifi_error parse_stats_record_v2(hal_info *info, + wh_pktlog_hdr_v2_t *pkt_stats_header) +{ + wifi_error status = WIFI_SUCCESS; -static wifi_error parse_stats_record(hal_info *info, + if (pkt_stats_header->log_type == PKTLOG_TYPE_RX_STAT) { + /* Ignore the event if it doesn't carry RX descriptor */ + if (pkt_stats_header->flags & PKT_INFO_FLG_RX_RXDESC_MASK) + status = parse_rx_stats_v2(info, + (u8 *)(pkt_stats_header + 1), + pkt_stats_header->size); + else + status = WIFI_SUCCESS; + } else if (pkt_stats_header->log_type == PKTLOG_TYPE_PKT_DUMP_V2) { + pthread_mutex_lock(&info->pkt_fate_stats_lock); + if (info->fate_monitoring_enabled) { + if (pkt_stats_header->flags & PKT_INFO_FLG_PKT_DUMP_V2) + status = parse_pkt_fate_stats(info, + (u8 *)pkt_stats_header + sizeof(wh_pktlog_hdr_v2_t), + pkt_stats_header->size); + else + status = WIFI_SUCCESS; + } else + status = WIFI_SUCCESS; + pthread_mutex_unlock(&info->pkt_fate_stats_lock); + } else if (pkt_stats_header->log_type == PKTLOG_TYPE_PKT_SW_EVENT) { + status = parse_stats_sw_event(info, pkt_stats_header); + } else + ALOGE("%s: invalid log_type %d",__FUNCTION__, pkt_stats_header->log_type); + + return status; +} + +static wifi_error parse_stats_record_v1(hal_info *info, wh_pktlog_hdr_t *pkt_stats_header) { wifi_error status; @@ -2045,6 +2463,7 @@ static wifi_error parse_stats_record(hal_info *info, static wifi_error parse_stats(hal_info *info, u8 *data, u32 buflen) { wh_pktlog_hdr_t *pkt_stats_header; + wh_pktlog_hdr_v2_t *pkt_stats_header_t; wifi_error status = WIFI_SUCCESS; do { @@ -2059,18 +2478,36 @@ static wifi_error parse_stats(hal_info *info, u8 *data, u32 buflen) status = WIFI_ERROR_INVALID_ARGS; break; } - status = parse_stats_record(info, pkt_stats_header); - if (status != WIFI_SUCCESS) { - ALOGE("Failed to parse the stats type : %d", - pkt_stats_header->log_type); - return status; + /* Pkt_log_V2 based packet parsing */ + if (info->pkt_log_ver == PKT_LOG_V2) { + pkt_stats_header_t = (wh_pktlog_hdr_v2_t *)data; + status = parse_stats_record_v2(info, pkt_stats_header_t); + if (status != WIFI_SUCCESS) { + ALOGE("Failed to parse the stats type : %d", + pkt_stats_header_t->log_type); + return status; + } + /* Pkt_log_V1 based packet parsing */ + } else { + status = parse_stats_record_v1(info, pkt_stats_header); + if (status != WIFI_SUCCESS) { + ALOGE("Failed to parse the stats type : %d", + pkt_stats_header->log_type); + return status; + } } - if (pkt_stats_header->flags & PKT_INFO_FLG_PKT_DUMP_V2){ + + if (info->pkt_log_ver == PKT_LOG_V2) { data += (sizeof(wh_pktlog_hdr_v2_t) + pkt_stats_header->size); buflen -= (sizeof(wh_pktlog_hdr_v2_t) + pkt_stats_header->size); } else { - data += (sizeof(wh_pktlog_hdr_t) + pkt_stats_header->size); - buflen -= (sizeof(wh_pktlog_hdr_t) + pkt_stats_header->size); + if (pkt_stats_header->flags & PKT_INFO_FLG_PKT_DUMP_V2){ + data += (sizeof(wh_pktlog_hdr_v2_t) + pkt_stats_header->size); + buflen -= (sizeof(wh_pktlog_hdr_v2_t) + pkt_stats_header->size); + } else { + data += (sizeof(wh_pktlog_hdr_t) + pkt_stats_header->size); + buflen -= (sizeof(wh_pktlog_hdr_t) + pkt_stats_header->size); + } } } while (buflen > 0); @@ -2199,6 +2636,9 @@ wifi_error diag_message_handler(hal_info *info, nl_msg *msg) case EVENT_WLAN_LOW_RESOURCE_FAILURE: process_wlan_low_resource_failure(info, buf, event_hdr->length); break; + case EVENT_WLAN_STA_DATA_STALL: + process_wlan_data_stall_event(info, buf, event_hdr->length); + break; default: return WIFI_SUCCESS; } diff --git a/qcwcn/wifi_hal/wifilogger_diag.h b/qcwcn/wifi_hal/wifilogger_diag.h index b56ab1c..24ad1eb 100644 --- a/qcwcn/wifi_hal/wifilogger_diag.h +++ b/qcwcn/wifi_hal/wifilogger_diag.h @@ -48,6 +48,7 @@ #define WLAN_PKT_LOG_STATS 0x18E0 #define FEATURE_NOT_SUPPORTED 0xFF +#define DATA_STALL_OFFSET_REASON_CODE 256 /* * - verbose_level 0 corresponds to no collection * - verbose_level 1 correspond to normal log level, with minimal user impact. @@ -237,6 +238,10 @@ typedef struct { u32 reserved; } wlan_log_complete_event_t; +typedef struct { + u32 reason; +} wlan_data_stall_event_t; + wifi_error diag_message_handler(hal_info *info, nl_msg *msg); #endif /* __WIFI_HAL_WIFILOGGER_DIAG_H__ */ diff --git a/qcwcn/wifi_hal/wifilogger_event_defs.h b/qcwcn/wifi_hal/wifilogger_event_defs.h index 3f2d807..c49a3b6 100644 --- a/qcwcn/wifi_hal/wifilogger_event_defs.h +++ b/qcwcn/wifi_hal/wifilogger_event_defs.h @@ -64,6 +64,7 @@ typedef enum { EVENT_WLAN_BEACON_EVENT = 0xAA6, EVENT_WLAN_LOG_COMPLETE = 0xAA7, EVENT_WLAN_LOW_RESOURCE_FAILURE = 0xABB, + EVENT_WLAN_STA_DATA_STALL = 0xB3A, EVENT_MAX_ID = 0x0FFF } event_id_enum_type; diff --git a/qcwcn/wifi_hal/wifiloggercmd.h b/qcwcn/wifi_hal/wifiloggercmd.h index a5d3bbf..f9535ce 100644 --- a/qcwcn/wifi_hal/wifiloggercmd.h +++ b/qcwcn/wifi_hal/wifiloggercmd.h @@ -33,7 +33,6 @@ #include "cpp_bindings.h" #include "wifi_logger.h" #include "wifilogger_diag.h" -#include "vendor_definitions.h" #ifdef __cplusplus extern "C" |