summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Kiryanov <rkir@google.com>2020-02-21 16:46:05 -0800
committerRoman Kiryanov <rkir@google.com>2020-02-21 16:46:05 -0800
commit670ac8e437ce1f0194bb3d514047d5dc8f867986 (patch)
treebeef535adaec07fabc7836a6ca6ad3a7dc431b53
parentbb006b4a49966fe657715ab1db06189b1f53fa4a (diff)
downloadgoldfish-modules-670ac8e437ce1f0194bb3d514047d5dc8f867986.tar.gz
Add a patch with the workaround for common
In our 4.14 kernel mac80211_hwsim has a 'mac_prefix' module parameter to make MAC address unique between emulators. In the GKI approach we cannot have this change anymore and we need to provide mac80211_hwsim MAC address another way. For now we build our kernel with this local change. git apply ../goldfish-modules/common.patch Bug: 147493341 Test: emulator presubmit Change-Id: I38418d28f3fdb839cdecfff883e7df2b28c95443 Signed-off-by: Roman Kiryanov <rkir@google.com>
-rw-r--r--common.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/common.patch b/common.patch
new file mode 100644
index 0000000..c808f9f
--- /dev/null
+++ b/common.patch
@@ -0,0 +1,24 @@
+diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
+index 14f562cd7..aeb7cde19 100644
+--- a/drivers/net/wireless/mac80211_hwsim.c
++++ b/drivers/net/wireless/mac80211_hwsim.c
+@@ -62,6 +62,10 @@ static bool support_p2p_device = true;
+ module_param(support_p2p_device, bool, 0444);
+ MODULE_PARM_DESC(support_p2p_device, "Support P2P-Device interface type");
+
++static ushort mac_prefix;
++module_param(mac_prefix, ushort, 0444);
++MODULE_PARM_DESC(mac_prefix, "Second and third most significant octets in MAC");
++
+ /**
+ * enum hwsim_regtest - the type of regulatory tests we offer
+ *
+@@ -2788,6 +2792,8 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
+ if (!param->perm_addr) {
+ eth_zero_addr(addr);
+ addr[0] = 0x02;
++ addr[1] = (mac_prefix >> 8) & 0xFF;
++ addr[2] = mac_prefix & 0xFF;
+ addr[3] = idx >> 8;
+ addr[4] = idx;
+ memcpy(data->addresses[0].addr, addr, ETH_ALEN);