[NEUS7920-133][9610][7885][7872][7570] wlbt: Ignore address(mac/mask) sent by CFG...
authorKavitha Velayutham <k.velayutham@samsung.com>
Wed, 13 Mar 2019 09:50:15 +0000 (15:20 +0530)
committerYoungmin Nam <youngmin.nam@samsung.com>
Tue, 21 May 2019 10:45:21 +0000 (19:45 +0900)
Ignore the Mac address sent by cfg when mac randomization is enabled in host and disabled in fw.
so that Fw has the control of enabling/disabling Mac randomization

Change-Id: If3dfd5925b0271fd93c9c4c0e462bd1ea9031ce3
SCSC-Bug-Id: SB-50533
Signed-off-by: Kavitha Velayutham <k.velayutham@samsung.com>
drivers/net/wireless/scsc/cfg80211_ops.c
drivers/net/wireless/scsc/dev.h
drivers/net/wireless/scsc/mgt.c

index cab34ef00256ab9ca7c5817abe73060b489a11c0..17e90344fc283ca112edb7f10806fa1a0131d361 100755 (executable)
@@ -579,10 +579,15 @@ int slsi_scan(struct wiphy *wiphy, struct net_device *dev,
 #ifdef CONFIG_SCSC_WLAN_ENABLE_MAC_RANDOMISATION
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
                if (request->flags & NL80211_SCAN_FLAG_RANDOM_ADDR) {
-                       memcpy(sdev->scan_mac_addr, request->mac_addr, ETH_ALEN);
-                       r = slsi_set_mac_randomisation_mask(sdev, request->mac_addr_mask);
-                       if (!r)
-                               sdev->scan_addr_set = 1;
+                       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);
+                               if (!r)
+                                       sdev->scan_addr_set = 1;
+                       } else {
+                               SLSI_NET_INFO(dev, "Mac Randomization is not enabled in Firmware\n");
+                               sdev->scan_addr_set = 0;
+                       }
                } else
 #endif
                if (sdev->scan_addr_set) {
index f4c5e0a0abe7ccd265896c3539a8a491026176bf..ad46ecf0b0da68010345c56fb1b10b6e055883f0 100755 (executable)
@@ -1106,6 +1106,9 @@ struct slsi_dev {
        u16                             rtt_vif[8];
        bool                            acs_channel_switched;
        int                        recovery_timeout; /* ms autorecovery completion timeout */
+#ifdef CONFIG_SCSC_WLAN_ENABLE_MAC_RANDOMISATION
+       bool                            fw_mac_randomization_enabled;
+#endif
 };
 
 /* Compact representation of channels a ESS has been seen on
index befb8164ae2acb6b97ffd603da39d2f1a76b6946..3d009a9e2506dceeba1fabe9a654feb2d3f5ac82 100755 (executable)
@@ -1259,7 +1259,10 @@ static int slsi_mib_initial_get(struct slsi_dev *sdev)
 #endif
 #ifdef CONFIG_SCSC_WLAN_AP_INFO_FILE
                                                               { SLSI_PSID_UNIFI_DUAL_BAND_CONCURRENCY, {0, 0} },
-                                                              { SLSI_PSID_UNIFI_MAX_CLIENT, {0, 0} }
+                                                              { SLSI_PSID_UNIFI_MAX_CLIENT, {0, 0} },
+#endif
+#ifdef CONFIG_SCSC_WLAN_ENABLE_MAC_RANDOMISATION
+                                                              { SLSI_PSID_UNIFI_MAC_ADDRESS_RANDOMISATION_ACTIVATED, {0, 0} }
 #endif
                                                              };/*Check the mibrsp.dataLength when a new mib is added*/
 
@@ -1271,7 +1274,7 @@ static int slsi_mib_initial_get(struct slsi_dev *sdev)
        if (r != SLSI_MIB_STATUS_SUCCESS)
                return -ENOMEM;
 
-       mibrsp.dataLength = 154;
+       mibrsp.dataLength = 164;
        mibrsp.data = kmalloc(mibrsp.dataLength, GFP_KERNEL);
        if (!mibrsp.data) {
                kfree(mibreq.data);
@@ -1412,7 +1415,12 @@ static int slsi_mib_initial_get(struct slsi_dev *sdev)
                else
                        SLSI_WARN(sdev, "Error reading SoftAP max client\n");
 #endif
-
+#ifdef CONFIG_SCSC_WLAN_ENABLE_MAC_RANDOMISATION
+               if (values[++mib_index].type != SLSI_MIB_TYPE_NONE)  /* Mac Randomization enable? */
+                       sdev->fw_mac_randomization_enabled = values[mib_index].u.boolValue;
+               else
+                       SLSI_WARN(sdev, "Error reading Mac Randomization Support\n");
+#endif
                kfree(values);
        }
        kfree(mibrsp.data);