aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/cfg80211.h
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 /include/net/cfg80211.h
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 'include/net/cfg80211.h')
-rw-r--r--include/net/cfg80211.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 2af52704e670..c5d16f299d6f 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1195,6 +1195,10 @@ enum wiphy_flags {
1195 WIPHY_FLAG_4ADDR_STATION = BIT(6), 1195 WIPHY_FLAG_4ADDR_STATION = BIT(6),
1196}; 1196};
1197 1197
1198struct mac_address {
1199 u8 addr[ETH_ALEN];
1200};
1201
1198/** 1202/**
1199 * struct wiphy - wireless hardware description 1203 * struct wiphy - wireless hardware description
1200 * @idx: the wiphy index assigned to this item 1204 * @idx: the wiphy index assigned to this item
@@ -1213,12 +1217,28 @@ enum wiphy_flags {
1213 * -1 = fragmentation disabled, only odd values >= 256 used 1217 * -1 = fragmentation disabled, only odd values >= 256 used
1214 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled 1218 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled
1215 * @net: the network namespace this wiphy currently lives in 1219 * @net: the network namespace this wiphy currently lives in
1220 * @perm_addr: permanent MAC address of this device
1221 * @addr_mask: If the device supports multiple MAC addresses by masking,
1222 * set this to a mask with variable bits set to 1, e.g. if the last
1223 * four bits are variable then set it to 00:...:00:0f. The actual
1224 * variable bits shall be determined by the interfaces added, with
1225 * interfaces not matching the mask being rejected to be brought up.
1226 * @n_addresses: number of addresses in @addresses.
1227 * @addresses: If the device has more than one address, set this pointer
1228 * to a list of addresses (6 bytes each). The first one will be used
1229 * by default for perm_addr. In this case, the mask should be set to
1230 * all-zeroes. In this case it is assumed that the device can handle
1231 * the same number of arbitrary MAC addresses.
1216 */ 1232 */
1217struct wiphy { 1233struct wiphy {
1218 /* assign these fields before you register the wiphy */ 1234 /* assign these fields before you register the wiphy */
1219 1235
1220 /* permanent MAC address */ 1236 /* permanent MAC address(es) */
1221 u8 perm_addr[ETH_ALEN]; 1237 u8 perm_addr[ETH_ALEN];
1238 u8 addr_mask[ETH_ALEN];
1239
1240 u16 n_addresses;
1241 struct mac_address *addresses;
1222 1242
1223 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 1243 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
1224 u16 interface_modes; 1244 u16 interface_modes;