aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2010-01-20 06:02:33 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-22 16:11:16 -0500
commitef15aac6073b27fd4f70007784d2d52ed394bf43 (patch)
tree80eeb99e74263e255d4e8af582550a6363ad7884 /drivers
parentb3fbdcf49f940d0703c356441e0daf045e64e076 (diff)
cfg80211: export multiple MAC addresses in sysfs
If a device has multiple MAC addresses, userspace will need to know about that. Similarly, if it allows the MAC addresses to vary by a bitmask. If a driver exports multiple addresses, it is assumed that it will be able to deal with that many different addresses, which need not necessarily match the ones programmed into the device; if a mask is set then the device should deal addresses within that mask based on an arbitrary "base address". To test it all and show how it is used, add support to hwsim even though it can't actually deal with addresses different from the default. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 84df3fcf37b3..0dbda8dfbd99 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -281,6 +281,8 @@ struct mac80211_hwsim_data {
281 struct ieee80211_channel channels_5ghz[ARRAY_SIZE(hwsim_channels_5ghz)]; 281 struct ieee80211_channel channels_5ghz[ARRAY_SIZE(hwsim_channels_5ghz)];
282 struct ieee80211_rate rates[ARRAY_SIZE(hwsim_rates)]; 282 struct ieee80211_rate rates[ARRAY_SIZE(hwsim_rates)];
283 283
284 struct mac_address addresses[2];
285
284 struct ieee80211_channel *channel; 286 struct ieee80211_channel *channel;
285 unsigned long beacon_int; /* in jiffies unit */ 287 unsigned long beacon_int; /* in jiffies unit */
286 unsigned int rx_filter; 288 unsigned int rx_filter;
@@ -1154,7 +1156,11 @@ static int __init init_mac80211_hwsim(void)
1154 SET_IEEE80211_DEV(hw, data->dev); 1156 SET_IEEE80211_DEV(hw, data->dev);
1155 addr[3] = i >> 8; 1157 addr[3] = i >> 8;
1156 addr[4] = i; 1158 addr[4] = i;
1157 SET_IEEE80211_PERM_ADDR(hw, addr); 1159 memcpy(data->addresses[0].addr, addr, ETH_ALEN);
1160 memcpy(data->addresses[1].addr, addr, ETH_ALEN);
1161 data->addresses[1].addr[0] |= 0x40;
1162 hw->wiphy->n_addresses = 2;
1163 hw->wiphy->addresses = data->addresses;
1158 1164
1159 hw->channel_change_time = 1; 1165 hw->channel_change_time = 1;
1160 hw->queues = 4; 1166 hw->queues = 4;