summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qdf/inc/qdf_util.h19
-rw-r--r--wmi/inc/wmi_unified_param.h23
-rw-r--r--wmi/src/wmi_unified_tlv.c29
3 files changed, 70 insertions, 1 deletions
diff --git a/qdf/inc/qdf_util.h b/qdf/inc/qdf_util.h
index e6b4a708598a..5356ba89b2cb 100644
--- a/qdf/inc/qdf_util.h
+++ b/qdf/inc/qdf_util.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -481,4 +481,21 @@ unsigned long qdf_rounddown_pow_of_two(unsigned long n)
return __qdf_rounddown_pow_of_two(n);
}
+/**
+ * qdf_is_group_addr() - checks whether addr is multi cast
+ * @mac_addr: address to be checked for multicast
+ *
+ * Check if the input mac addr is multicast addr
+ *
+ * Return: true if multicast addr else false
+ */
+static inline
+bool qdf_is_group_addr(uint8_t *mac_addr)
+{
+ if (mac_addr[0] & 0x01)
+ return true;
+ else
+ return false;
+}
+
#endif /*_QDF_UTIL_H*/
diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h
index 3102fc5687e5..ee7a5ba1582c 100644
--- a/wmi/inc/wmi_unified_param.h
+++ b/wmi/inc/wmi_unified_param.h
@@ -998,6 +998,11 @@ struct ap_ps_params {
* @bssid_list: Lisst of bssid to scan
* @ie_data: IE data buffer pointer
* @passive_flag: Is this passive scan
+ * @enable_scan_randomization: enable scan randomization feature
+ * @mac_addr: MAC address used with randomization
+ * @mac_addr_mask: MAC address mask used with randomization, bits that
+ * are 0 in the mask should be randomized, bits that are 1 should
+ * be taken from the @mac_addr
*/
struct scan_start_params {
uint32_t scan_id;
@@ -1040,6 +1045,10 @@ struct scan_start_params {
uint8_t *ie_data;
int passive_flag;
#endif
+ /* mac address randomization attributes */
+ bool enable_scan_randomization;
+ uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
+ uint8_t mac_addr_mask[QDF_MAC_ADDR_SIZE];
};
/**
@@ -1610,9 +1619,14 @@ struct rssi_monitor_param {
/**
* struct scan_mac_oui - oui paramters
* @oui: oui parameters
+ * @vdev_id: session id
+ * @enb_probe_req_sno_randomization: set to true for enabling
+ * seq number randomization of probe req frames
*/
struct scan_mac_oui {
uint8_t oui[WMI_WIFI_SCANNING_MAC_OUI_LENGTH];
+ uint32_t vdev_id;
+ bool enb_probe_req_sno_randomization;
};
#define WMI_PASSPOINT_REALM_LEN 256
@@ -2029,6 +2043,11 @@ struct pno_nw_type {
* @pnoscan_adaptive_dwell_mode: adaptive dwelltime mode for pno scan
* @channel_prediction_full_scan: periodic timer upon which a full scan needs
* to be triggered.
+ * @enable_pno_scan_randomization: enable pno scan randomization feature
+ * @mac_addr: MAC address used with randomization
+ * @mac_addr_mask: MAC address mask used with randomization, bits that
+ * are 0 in the mask should be randomized, bits that are 1 should
+ * be taken from the @mac_addr
*/
struct pno_scan_req_params {
uint8_t enable;
@@ -2055,6 +2074,10 @@ struct pno_scan_req_params {
enum wmi_dwelltime_adaptive_mode pnoscan_adaptive_dwell_mode;
uint32_t channel_prediction_full_scan;
#endif
+ /* mac address randomization attributes */
+ bool enable_pno_scan_randomization;
+ uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
+ uint8_t mac_addr_mask[QDF_MAC_ADDR_SIZE];
};
diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c
index bbc92c730844..d8c6f699f335 100644
--- a/wmi/src/wmi_unified_tlv.c
+++ b/wmi/src/wmi_unified_tlv.c
@@ -1496,6 +1496,18 @@ QDF_STATUS send_scan_start_cmd_tlv(wmi_unified_t wmi_handle,
cmd->num_ssids = params->num_ssids;
cmd->ie_len = params->ie_len;
cmd->n_probes = params->n_probes;
+
+ /* mac randomization attributes */
+ if (params->enable_scan_randomization) {
+ cmd->scan_ctrl_flags |= WMI_SCAN_ADD_SPOOFED_MAC_IN_PROBE_REQ |
+ WMI_SCAN_RANDOM_SEQ_NO_IN_PROBE_REQ;
+ WMI_CHAR_ARRAY_TO_MAC_ADDR(params->mac_addr, &cmd->mac_addr);
+ WMI_CHAR_ARRAY_TO_MAC_ADDR(params->mac_addr_mask,
+ &cmd->mac_mask);
+ }
+
+ WMI_LOGI("scan_ctrl_flags = %x", cmd->scan_ctrl_flags);
+
buf_ptr += sizeof(*cmd);
tmp_ptr = (uint32_t *) (buf_ptr + WMI_TLV_HDR_SIZE);
for (i = 0; i < params->num_chan; ++i)
@@ -4107,6 +4119,13 @@ QDF_STATUS send_scan_probe_setoui_cmd_tlv(wmi_unified_t wmi_handle,
WMI_LOGD("%s: wmi:oui received from hdd %08x", __func__,
cmd->prob_req_oui);
+ cmd->vdev_id = psetoui->vdev_id;
+ cmd->flags = WMI_SCAN_PROBE_OUI_SPOOFED_MAC_IN_PROBE_REQ;
+ if (psetoui->enb_probe_req_sno_randomization)
+ cmd->flags |= WMI_SCAN_PROBE_OUI_RANDOM_SEQ_NO_IN_PROBE_REQ;
+
+ WMI_LOGI(FL("vdev_id = %d, flags = %x"), cmd->vdev_id, cmd->flags);
+
if (wmi_unified_cmd_send(wmi_handle, wmi_buf, len,
WMI_SCAN_PROB_REQ_OUI_CMDID)) {
WMI_LOGE("%s: failed to send command", __func__);
@@ -6074,6 +6093,16 @@ QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle,
/** TODO: Discrete firmware doesn't have command/option to configure
* App IE which comes from wpa_supplicant as of part PNO start request.
*/
+
+ /* mac randomization attributes */
+ if (pno->enable_pno_scan_randomization) {
+ cmd->flags |= WMI_NLO_CONFIG_SPOOFED_MAC_IN_PROBE_REQ |
+ WMI_NLO_CONFIG_RANDOM_SEQ_NO_IN_PROBE_REQ;
+ WMI_CHAR_ARRAY_TO_MAC_ADDR(pno->mac_addr, &cmd->mac_addr);
+ WMI_CHAR_ARRAY_TO_MAC_ADDR(pno->mac_addr_mask, &cmd->mac_mask);
+ }
+ WMI_LOGI("pno flags = %x", cmd->flags);
+
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID);
if (ret) {