diff options
| author | Srinivas Girigowda <sgirigow@qca.qualcomm.com> | 2014-09-22 13:53:55 -0700 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2014-09-26 16:39:19 +0530 |
| commit | 7fb7c5841323210cb1e775ea2d59835d03ee69c2 (patch) | |
| tree | 96c775a765bffbb4fbb5d3269327f984cc6f7278 | |
| parent | 2a13ebd1f815b672bcad583404da771c88a8df30 (diff) | |
qcacld: HDD_UMAC: Support for set_scanning_mac_oui
Provide the support to pass 3 bytes of MAC OUI received
from the android framework via the NL vendor command to wma.
Change-Id: Iaeea78ad9c031a34569c932a29230250814fb6f1
CRs-Fixed: 729811
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg80211.h | 13 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 59 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 7 | ||||
| -rw-r--r-- | CORE/MAC/src/include/sirParams.h | 1 | ||||
| -rw-r--r-- | CORE/SME/inc/sme_Api.h | 10 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 30 | ||||
| -rw-r--r-- | CORE/WDA/inc/wlan_qct_wda.h | 2 |
7 files changed, 122 insertions, 0 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h index e32ca03a5666..3500f087efa7 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg80211.h +++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h @@ -166,6 +166,9 @@ enum qca_nl80211_vendor_subcmds { QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE = 37, /* Get supported features */ QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_FEATURES = 38, + + /* Set scanning_mac_oui */ + QCA_NL80211_VENDOR_SUBCMD_SCANNING_MAC_OUI = 39, }; enum qca_nl80211_vendor_subcmds_index { @@ -801,6 +804,16 @@ enum qca_wlan_vendor_attr_get_supported_features { QCA_WLAN_VENDOR_ATTR_FEATURE_SET_AFTER_LAST - 1, }; +enum qca_wlan_vendor_attr_set_scanning_mac_oui { + QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_INVALID = 0, + /* An array of 3 x Unsigned 8-bit value */ + QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI = 1, + /* keep last */ + QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_MAX = + QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_AFTER_LAST - 1, +}; + /* Feature defines */ #define WIFI_FEATURE_INFRA 0x0001 /* Basic infrastructure mode */ #define WIFI_FEATURE_INFRA_5G 0x0002 /* Support for 5 GHz Band */ diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 6f91b78ef81f..5b602f9a7b05 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -1197,6 +1197,58 @@ nla_put_failure: return -EINVAL; } +static int +wlan_hdd_cfg80211_set_scanning_mac_oui(struct wiphy *wiphy, + struct wireless_dev *wdev, + void *data, int data_len) +{ + tpSirScanMacOui pReqMsg = NULL; + hdd_context_t *pHddCtx = wiphy_priv(wiphy); + struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_MAX + 1]; + eHalStatus status; + + ENTER(); + + if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_MAX, + data, data_len, + NULL)) { + hddLog(LOGE, FL("Invalid ATTR")); + return -EINVAL; + } + + pReqMsg = vos_mem_malloc(sizeof(*pReqMsg)); + if (!pReqMsg) { + hddLog(LOGE, FL("vos_mem_malloc failed")); + return -ENOMEM; + } + + /* Parse and fetch oui */ + if (!tb[QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI]) { + hddLog(LOGE, FL("attr mac oui failed")); + goto fail; + } + + nla_memcpy(&pReqMsg->oui[0], + tb[QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI], + sizeof(pReqMsg->oui)); + + hddLog(LOG1, FL("Oui (%02x:%02x:%02x)"), pReqMsg->oui[0], pReqMsg->oui[1], + pReqMsg->oui[2]); + + status = sme_SetScanningMacOui(pHddCtx->hHal, pReqMsg); + if (!HAL_STATUS_SUCCESS(status)) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("sme_SetScanningMacOui failed(err=%d)"), status); + goto fail; + } + + return 0; + +fail: + vos_mem_free(pReqMsg); + return -EINVAL; +} + #ifdef WLAN_FEATURE_STATS_EXT static int wlan_hdd_cfg80211_stats_ext_request(struct wiphy *wiphy, struct wireless_dev *wdev, @@ -3932,6 +3984,13 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = WIPHY_VENDOR_CMD_NEED_NETDEV, .doit = wlan_hdd_cfg80211_get_supported_features }, + { + .info.vendor_id = QCA_NL80211_VENDOR_ID, + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SCANNING_MAC_OUI, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wlan_hdd_cfg80211_set_scanning_mac_oui + }, }; diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index 2224d8e5ca2d..f33811e01a92 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -104,6 +104,8 @@ typedef tANI_U8 tSirVersionString[SIR_VERSION_STRING_LEN]; #define PERIODIC_TX_PTRN_MAX_SIZE 1536 #define MAXNUM_PERIODIC_TX_PTRNS 6 +#define WIFI_SCANNING_MAC_OUI_LENGTH 3 + #ifdef FEATURE_WLAN_EXTSCAN @@ -5234,6 +5236,11 @@ typedef struct tANI_U8 stopReq; } tSirLLStatsClearReq, *tpSirLLStatsClearReq; +typedef struct +{ + tANI_U8 oui[WIFI_SCANNING_MAC_OUI_LENGTH]; +} tSirScanMacOui, *tpSirScanMacOui; + /*--------------------------------------------------------------------------- WLAN_HAL_LL_NOTIFY_STATS ---------------------------------------------------------------------------*/ diff --git a/CORE/MAC/src/include/sirParams.h b/CORE/MAC/src/include/sirParams.h index 9c784237833c..3bbfefc591cd 100644 --- a/CORE/MAC/src/include/sirParams.h +++ b/CORE/MAC/src/include/sirParams.h @@ -657,6 +657,7 @@ typedef struct sSirMbMsgP2p #endif #define SIR_HAL_GET_TEMPERATURE_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 290) +#define SIR_HAL_SET_SCAN_MAC_OUI_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 291) #define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF) diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index 74a667328465..aa3c494e540c 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -4059,4 +4059,14 @@ eHalStatus sme_getLinkStatus(tHalHandle hHal, eHalStatus sme_GetTemperature(tHalHandle hHal, void *tempContext, void (*pCallbackfn)(int temperature, void *pContext)); + +/* --------------------------------------------------------------------------- + \fn sme_SetScanningMacOui + \brief SME API to set scanning mac oui + \param hHal + \param pScanMacOui: Scanning Mac Oui (input 3 bytes) + \- return eHalStatus + -------------------------------------------------------------------------*/ +eHalStatus sme_SetScanningMacOui(tHalHandle hHal, tSirScanMacOui *pScanMacOui); + #endif //#if !defined( __SME_API_H ) diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index ec30c1fd517e..943bd470d013 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -14046,4 +14046,34 @@ eHalStatus sme_GetTemperature(tHalHandle hHal, } return(status); } + +/* --------------------------------------------------------------------------- + \fn sme_SetScanningMacOui + \brief SME API to set scanning mac oui + \param hHal + \param pScanMacOui: Scanning Mac Oui (input 3 bytes) + \- return eHalStatus + -------------------------------------------------------------------------*/ +eHalStatus sme_SetScanningMacOui(tHalHandle hHal, tSirScanMacOui *pScanMacOui) +{ + eHalStatus status = eHAL_STATUS_SUCCESS; + VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + vos_msg_t vosMessage; + + if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { + /* Serialize the req through MC thread */ + vosMessage.bodyptr = pScanMacOui; + vosMessage.type = WDA_SET_SCAN_MAC_OUI_REQ; + vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("Msg post Set Scan Mac OUI failed")); + status = eHAL_STATUS_FAILURE; + } + sme_ReleaseGlobalLock(&pMac->sme); + } + return status; +} + #endif diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h index 37c3a0f5ef9b..1391cd004064 100644 --- a/CORE/WDA/inc/wlan_qct_wda.h +++ b/CORE/WDA/inc/wlan_qct_wda.h @@ -981,6 +981,8 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); #define WDA_WLAN_SET_APP_TYPE2_PARAMS SIR_HAL_CONFIG_APP_TYPE2_PARAMS #endif +#define WDA_SET_SCAN_MAC_OUI_REQ SIR_HAL_SET_SCAN_MAC_OUI_REQ + tSirRetStatus wdaPostCtrlMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg); #define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 // Bit 6 will be used to control BD rate for Management frames |
