We need disable MAC randomisation for some test and debug
This change is to add a module parameter mac_randomisation_disabled
to enable/disable MAC randomisation.
Change-Id: I84a2f625ecb2f5c3a38b8041e909af1f8dfd8c18
Signed-off-by: sunyue5 <sunyue5@motorola.com>
Reviewed-on: https://gerrit.mot.com/
1300264
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Hua Tan <tanhua1@motorola.com>
Submit-Approved: Jira Key
* mac radomization for scan should be disbaled to avoid WPS overlap.
* Firmware also disables Mac Randomization for WPS Scan.
*/
- if (request->flags & NL80211_SCAN_FLAG_RANDOM_ADDR && !wps_sta) {
+ //BEGIN IKSAMP-1972
+ if (!slsi_dev_mac_randomisation_support()) {
+ SLSI_ERR(sdev, "mac randomisation is disabled by module parameters");
+ } else if (request->flags & NL80211_SCAN_FLAG_RANDOM_ADDR && !wps_sta) {
+ //END IKSAMP-1972
if (sdev->fw_mac_randomization_enabled) {
memcpy(sdev->scan_mac_addr, request->mac_addr, ETH_ALEN);
r = slsi_set_mac_randomisation_mask(sdev, request->mac_addr_mask);
MODULE_PARM_DESC(nan_max_ndi_ifaces, "max ndi interface");
#endif
+//BEGIN IKSAMP-1972
+#ifdef CONFIG_SCSC_WLAN_ENABLE_MAC_RANDOMISATION
+static bool mac_randomisation_disabled;
+module_param(mac_randomisation_disabled, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(mac_randomisation_disabled, "Disable MAC Randomisation: to disable MAC randomisation set 1.");
+#endif
+//END IKSAMP-1972
+
bool slsi_dev_gscan_supported(void)
{
return !gscan_disabled;
}
#endif
+//BEGIN IKSAMP-1972
+#ifdef CONFIG_SCSC_WLAN_ENABLE_MAC_RANDOMISATION
+bool slsi_dev_mac_randomisation_support(void)
+{
+ return !mac_randomisation_disabled;
+}
+#endif
+//END IKSAMP-1972
+
static int slsi_dev_inetaddr_changed(struct notifier_block *nb, unsigned long data, void *arg)
{
struct slsi_dev *sdev = container_of(nb, struct slsi_dev, inetaddr_notifier);
#endif
bool slsi_dev_rtt_supported(void);
+//BEGIN IKSAMP-1972
+#ifdef CONFIG_SCSC_WLAN_ENABLE_MAC_RANDOMISATION
+bool slsi_dev_mac_randomisation_support(void);
+#endif
+//END IKSAMP-1972
+
static inline u16 slsi_tx_host_tag(struct slsi_dev *sdev, enum slsi_traffic_q tq)
{
u16 host_tag = 0;
#ifdef CONFIG_SCSC_WLAN_ENABLE_MAC_RANDOMISATION
- if (sdev->scan_addr_set)
+ if (sdev->scan_addr_set && slsi_dev_mac_randomisation_support()) //IKSAMP-1972
fapi_set_memcpy(req, u.mlme_add_scan_req.device_address, sdev->scan_mac_addr);
else
#endif
const struct nlattr *attr;
u8 scan_oui[6];
+ //BEGIN IKSAMP-1972
+ if (!slsi_dev_mac_randomisation_support()) {
+ SLSI_ERR(sdev, "mac randomisation is disabled by module parameters");
+ return -EINVAL;
+ }
+ //END IKSAMP-1972
+
memset(&scan_oui, 0, 6);
if (!dev) {