qcacld-3.0: Add Random MAC addr Action Frame Tx
1. Report NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA to cfg80211. 2. Indicate Random MAC addr frame to source adapter. Change-Id: Ica66fb43636fc1609febd87b6e6398dac3af25f3 CRs-Fixed: 2322077
This commit is contained in:
@@ -2150,6 +2150,20 @@ struct hdd_adapter *hdd_get_adapter_by_vdev(struct hdd_context *hdd_ctx,
|
|||||||
struct hdd_adapter *hdd_get_adapter_by_macaddr(struct hdd_context *hdd_ctx,
|
struct hdd_adapter *hdd_get_adapter_by_macaddr(struct hdd_context *hdd_ctx,
|
||||||
tSirMacAddr macAddr);
|
tSirMacAddr macAddr);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* hdd_get_adapter_by_rand_macaddr() - find Random mac adapter
|
||||||
|
* @hdd_ctx: hdd context
|
||||||
|
* @mac_addr: random mac addr
|
||||||
|
*
|
||||||
|
* Find the Adapter based on random mac addr. Adapter's vdev
|
||||||
|
* have active random mac list.
|
||||||
|
*
|
||||||
|
* Return: adapter ptr or null
|
||||||
|
*/
|
||||||
|
struct hdd_adapter *
|
||||||
|
hdd_get_adapter_by_rand_macaddr(struct hdd_context *hdd_ctx,
|
||||||
|
tSirMacAddr mac_addr);
|
||||||
|
|
||||||
int hdd_vdev_create(struct hdd_adapter *adapter,
|
int hdd_vdev_create(struct hdd_adapter *adapter,
|
||||||
csr_roam_complete_cb callback, void *ctx);
|
csr_roam_complete_cb callback, void *ctx);
|
||||||
int hdd_vdev_destroy(struct hdd_adapter *adapter);
|
int hdd_vdev_destroy(struct hdd_adapter *adapter);
|
||||||
|
@@ -11986,6 +11986,30 @@ static void wlan_hdd_cfg80211_scan_randomization_init(struct wiphy *wiphy)
|
|||||||
|
|
||||||
#define WLAN_HDD_MAX_NUM_CSA_COUNTERS 2
|
#define WLAN_HDD_MAX_NUM_CSA_COUNTERS 2
|
||||||
|
|
||||||
|
#if defined(CFG80211_RAND_TA_FOR_PUBLIC_ACTION_FRAME) || \
|
||||||
|
(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0))
|
||||||
|
/**
|
||||||
|
* wlan_hdd_cfg80211_action_frame_randomization_init() - Randomize SA of MA
|
||||||
|
* frames
|
||||||
|
* @wiphy: Pointer to wiphy
|
||||||
|
*
|
||||||
|
* This function is used to indicate the support of source mac address
|
||||||
|
* randomization of management action frames
|
||||||
|
*
|
||||||
|
* Return: None
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
wlan_hdd_cfg80211_action_frame_randomization_init(struct wiphy *wiphy)
|
||||||
|
{
|
||||||
|
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static void
|
||||||
|
wlan_hdd_cfg80211_action_frame_randomization_init(struct wiphy *wiphy)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(WLAN_FEATURE_FILS_SK) && \
|
#if defined(WLAN_FEATURE_FILS_SK) && \
|
||||||
(defined(CFG80211_FILS_SK_OFFLOAD_SUPPORT) || \
|
(defined(CFG80211_FILS_SK_OFFLOAD_SUPPORT) || \
|
||||||
(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)))
|
(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)))
|
||||||
@@ -12338,6 +12362,7 @@ int wlan_hdd_cfg80211_init(struct device *dev,
|
|||||||
wiphy->max_num_csa_counters = WLAN_HDD_MAX_NUM_CSA_COUNTERS;
|
wiphy->max_num_csa_counters = WLAN_HDD_MAX_NUM_CSA_COUNTERS;
|
||||||
if (pCfg->enable_mac_spoofing)
|
if (pCfg->enable_mac_spoofing)
|
||||||
wlan_hdd_cfg80211_scan_randomization_init(wiphy);
|
wlan_hdd_cfg80211_scan_randomization_init(wiphy);
|
||||||
|
wlan_hdd_cfg80211_action_frame_randomization_init(wiphy);
|
||||||
|
|
||||||
hdd_exit();
|
hdd_exit();
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -155,6 +155,8 @@
|
|||||||
#include "wlan_ocb_ucfg_api.h"
|
#include "wlan_ocb_ucfg_api.h"
|
||||||
#include <wlan_hdd_spectralscan.h>
|
#include <wlan_hdd_spectralscan.h>
|
||||||
#include "wlan_green_ap_ucfg_api.h"
|
#include "wlan_green_ap_ucfg_api.h"
|
||||||
|
#include <wlan_p2p_ucfg_api.h>
|
||||||
|
|
||||||
#ifdef MODULE
|
#ifdef MODULE
|
||||||
#define WLAN_MODULE_NAME module_name(THIS_MODULE)
|
#define WLAN_MODULE_NAME module_name(THIS_MODULE)
|
||||||
#else
|
#else
|
||||||
@@ -6294,6 +6296,23 @@ QDF_STATUS hdd_add_adapter_front(struct hdd_context *hdd_ctx,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct hdd_adapter *hdd_get_adapter_by_rand_macaddr(
|
||||||
|
struct hdd_context *hdd_ctx, tSirMacAddr mac_addr)
|
||||||
|
{
|
||||||
|
struct hdd_adapter *adapter;
|
||||||
|
|
||||||
|
hdd_for_each_adapter(hdd_ctx, adapter) {
|
||||||
|
if ((adapter->device_mode == QDF_STA_MODE ||
|
||||||
|
adapter->device_mode == QDF_P2P_CLIENT_MODE ||
|
||||||
|
adapter->device_mode == QDF_P2P_DEVICE_MODE) &&
|
||||||
|
ucfg_p2p_check_random_mac(hdd_ctx->psoc,
|
||||||
|
adapter->session_id, mac_addr))
|
||||||
|
return adapter;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
struct hdd_adapter *hdd_get_adapter_by_macaddr(struct hdd_context *hdd_ctx,
|
struct hdd_adapter *hdd_get_adapter_by_macaddr(struct hdd_context *hdd_ctx,
|
||||||
tSirMacAddr macAddr)
|
tSirMacAddr macAddr)
|
||||||
{
|
{
|
||||||
|
@@ -902,6 +902,7 @@ void __hdd_indicate_mgmt_frame(struct hdd_adapter *adapter,
|
|||||||
uint8_t type = 0;
|
uint8_t type = 0;
|
||||||
uint8_t subType = 0;
|
uint8_t subType = 0;
|
||||||
struct hdd_context *hdd_ctx;
|
struct hdd_context *hdd_ctx;
|
||||||
|
uint8_t *dest_addr;
|
||||||
|
|
||||||
hdd_debug("Frame Type = %d Frame Length = %d",
|
hdd_debug("Frame Type = %d Frame Length = %d",
|
||||||
frameType, frm_len);
|
frameType, frm_len);
|
||||||
@@ -930,10 +931,11 @@ void __hdd_indicate_mgmt_frame(struct hdd_adapter *adapter,
|
|||||||
(subType != SIR_MAC_MGMT_PROBE_REQ) &&
|
(subType != SIR_MAC_MGMT_PROBE_REQ) &&
|
||||||
!qdf_is_macaddr_broadcast(
|
!qdf_is_macaddr_broadcast(
|
||||||
(struct qdf_mac_addr *)&pb_frames[WLAN_HDD_80211_FRM_DA_OFFSET])) {
|
(struct qdf_mac_addr *)&pb_frames[WLAN_HDD_80211_FRM_DA_OFFSET])) {
|
||||||
adapter =
|
dest_addr = &pb_frames[WLAN_HDD_80211_FRM_DA_OFFSET];
|
||||||
hdd_get_adapter_by_macaddr(hdd_ctx,
|
adapter = hdd_get_adapter_by_macaddr(hdd_ctx, dest_addr);
|
||||||
&pb_frames
|
if (!adapter)
|
||||||
[WLAN_HDD_80211_FRM_DA_OFFSET]);
|
adapter = hdd_get_adapter_by_rand_macaddr(hdd_ctx,
|
||||||
|
dest_addr);
|
||||||
if (NULL == adapter) {
|
if (NULL == adapter) {
|
||||||
/*
|
/*
|
||||||
* Under assumtion that we don't receive any action
|
* Under assumtion that we don't receive any action
|
||||||
@@ -941,19 +943,16 @@ void __hdd_indicate_mgmt_frame(struct hdd_adapter *adapter,
|
|||||||
* we are dropping action frame
|
* we are dropping action frame
|
||||||
*/
|
*/
|
||||||
hdd_err("adapter for action frame is NULL Macaddr = "
|
hdd_err("adapter for action frame is NULL Macaddr = "
|
||||||
MAC_ADDRESS_STR,
|
MAC_ADDRESS_STR, MAC_ADDR_ARRAY(dest_addr));
|
||||||
MAC_ADDR_ARRAY(&pb_frames
|
|
||||||
[WLAN_HDD_80211_FRM_DA_OFFSET]));
|
|
||||||
hdd_debug("Frame Type = %d Frame Length = %d subType = %d",
|
hdd_debug("Frame Type = %d Frame Length = %d subType = %d",
|
||||||
frameType, frm_len, subType);
|
frameType, frm_len, subType);
|
||||||
/*
|
/*
|
||||||
* We will receive broadcast management frames
|
* We will receive broadcast management frames
|
||||||
* in OCB mode
|
* in OCB mode
|
||||||
*/
|
*/
|
||||||
adapter = hdd_get_adapter(hdd_ctx, QDF_OCB_MODE);
|
adapter = hdd_get_adapter(hdd_ctx, QDF_OCB_MODE);
|
||||||
if (NULL == adapter || !qdf_is_macaddr_broadcast(
|
if (NULL == adapter || !qdf_is_macaddr_broadcast(
|
||||||
(struct qdf_mac_addr *)&pb_frames
|
(struct qdf_mac_addr *)dest_addr)) {
|
||||||
[WLAN_HDD_80211_FRM_DA_OFFSET])) {
|
|
||||||
/*
|
/*
|
||||||
* Under assumtion that we don't
|
* Under assumtion that we don't
|
||||||
* receive any action frame with BCST
|
* receive any action frame with BCST
|
||||||
|
Reference in New Issue
Block a user