aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2014-10-22 15:23:06 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-10-27 03:48:34 -0400
commitb5dfae020b3539feaa014d3b6152f48660c2d75b (patch)
tree1d9195c1d0c2e35f8560e10ae626ffe9f8734941 /net
parente8f479b11268af3f206d1580f6b0d572d6ecb4f7 (diff)
mac80211: support creating vifs with specified mac address
This is useful when creating virtual interfaces. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/iface.c5
-rw-r--r--net/mac80211/main.c1
2 files changed, 5 insertions, 1 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index e469b3390f2a..1ffcc0701244 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1671,7 +1671,10 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
1671 } 1671 }
1672 1672
1673 ieee80211_assign_perm_addr(local, ndev->perm_addr, type); 1673 ieee80211_assign_perm_addr(local, ndev->perm_addr, type);
1674 memcpy(ndev->dev_addr, ndev->perm_addr, ETH_ALEN); 1674 if (params && is_valid_ether_addr(params->macaddr))
1675 memcpy(ndev->dev_addr, params->macaddr, ETH_ALEN);
1676 else
1677 memcpy(ndev->dev_addr, ndev->perm_addr, ETH_ALEN);
1675 SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy)); 1678 SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy));
1676 1679
1677 /* don't use IEEE80211_DEV_TO_SUB_IF -- it checks too much */ 1680 /* don't use IEEE80211_DEV_TO_SUB_IF -- it checks too much */
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 7d40e3f0a77b..282a4f36eb92 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -542,6 +542,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
542 NL80211_FEATURE_SAE | 542 NL80211_FEATURE_SAE |
543 NL80211_FEATURE_HT_IBSS | 543 NL80211_FEATURE_HT_IBSS |
544 NL80211_FEATURE_VIF_TXPOWER | 544 NL80211_FEATURE_VIF_TXPOWER |
545 NL80211_FEATURE_MAC_ON_CREATE |
545 NL80211_FEATURE_USERSPACE_MPM; 546 NL80211_FEATURE_USERSPACE_MPM;
546 547
547 if (!ops->hw_scan) 548 if (!ops->hw_scan)