diff options
author | sam <sam@FreeBSD.org> | 2009-01-27 23:42:14 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-01-27 23:42:14 +0000 |
commit | da982ab4bb3c46e8f7b79505af22ab81c14111a1 (patch) | |
tree | 1b17c29fdd54d05da1600cf8e10ab2600e8205fe /sys/net80211/ieee80211_ioctl.h | |
parent | b9b96b31bdf0b1f51b5f5c6a85490deee9187597 (diff) | |
download | FreeBSD-src-da982ab4bb3c46e8f7b79505af22ab81c14111a1.zip FreeBSD-src-da982ab4bb3c46e8f7b79505af22ab81c14111a1.tar.gz |
Remove assumptions about the max # channels in ioctl's:
o change ioctl's that pass channel lists in/out to handle variable-size
arrays instead of a fixed (compile-time) value; we do this in a way
that maintains binary compatibility
o change ifconfig so all channel list data structures are now allocated
to hold MAXCHAN entries (1536); this, for example, allows the kernel
to return > IEEE80211_CHAN_MAX entries for calls like IEEE80211_IOC_DEVCAPS
Diffstat (limited to 'sys/net80211/ieee80211_ioctl.h')
-rw-r--r-- | sys/net80211/ieee80211_ioctl.h | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/sys/net80211/ieee80211_ioctl.h b/sys/net80211/ieee80211_ioctl.h index 19c94b4..367f505 100644 --- a/sys/net80211/ieee80211_ioctl.h +++ b/sys/net80211/ieee80211_ioctl.h @@ -299,13 +299,13 @@ struct ieee80211req_maclist { }; /* - * Set the active channel list. Note this list is - * intersected with the available channel list in - * calculating the set of channels actually used in - * scanning. + * Set the active channel list by IEEE channel #: each channel + * to be marked active is set in a bit vector. Note this list is + * intersected with the available channel list in calculating + * the set of channels actually used in scanning. */ struct ieee80211req_chanlist { - uint8_t ic_channels[IEEE80211_CHAN_BYTES]; + uint8_t ic_channels[32]; /* NB: can be variable length */ }; /* @@ -313,8 +313,13 @@ struct ieee80211req_chanlist { */ struct ieee80211req_chaninfo { u_int ic_nchans; - struct ieee80211_channel ic_chans[IEEE80211_CHAN_MAX]; + struct ieee80211_channel ic_chans[1]; /* NB: variable length */ }; +#define IEEE80211_CHANINFO_SIZE(_nchan) \ + (sizeof(struct ieee80211req_chaninfo) + \ + (((_nchan)-1) * sizeof(struct ieee80211_channel))) +#define IEEE80211_CHANINFO_SPACE(_ci) \ + IEEE80211_CHANINFO_SIZE((_ci)->ic_nchans) /* * Retrieve the WPA/RSN information element for an associated station. @@ -463,6 +468,11 @@ struct ieee80211_regdomain_req { struct ieee80211_regdomain rd; struct ieee80211req_chaninfo chaninfo; }; +#define IEEE80211_REGDOMAIN_SIZE(_nchan) \ + (sizeof(struct ieee80211_regdomain_req) + \ + (((_nchan)-1) * sizeof(struct ieee80211_channel))) +#define IEEE80211_REGDOMAIN_SPACE(_req) \ + IEEE80211_REGDOMAIN_SIZE((_req)->chaninfo.ic_nchans) /* * Get driver capabilities. Driver, hardware crypto, and @@ -475,6 +485,11 @@ struct ieee80211_devcaps_req { uint32_t dc_htcaps; /* HT/802.11n support */ struct ieee80211req_chaninfo dc_chaninfo; }; +#define IEEE80211_DEVCAPS_SIZE(_nchan) \ + (sizeof(struct ieee80211_devcaps_req) + \ + (((_nchan)-1) * sizeof(struct ieee80211_channel))) +#define IEEE80211_DEVCAPS_SPACE(_dc) \ + IEEE80211_DEVCAPS_SIZE((_dc)->dc_chaninfo.ic_nchans) struct ieee80211_chanswitch_req { struct ieee80211_channel csa_chan; /* new channel */ |