diff options
author | sam <sam@FreeBSD.org> | 2009-01-27 23:19:36 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-01-27 23:19:36 +0000 |
commit | b9b96b31bdf0b1f51b5f5c6a85490deee9187597 (patch) | |
tree | 48ffdc3bc41f006bee6d795caca1658a25967de0 /sys/net80211/ieee80211_regdomain.c | |
parent | 5d3fffbba859a38a26b58d4557b58a3398a176f2 (diff) | |
download | FreeBSD-src-b9b96b31bdf0b1f51b5f5c6a85490deee9187597.zip FreeBSD-src-b9b96b31bdf0b1f51b5f5c6a85490deee9187597.tar.gz |
change ic_getradiocaps driver callback to include the max # channels
so callers know the size of the array passed down
Diffstat (limited to 'sys/net80211/ieee80211_regdomain.c')
-rw-r--r-- | sys/net80211/ieee80211_regdomain.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_regdomain.c b/sys/net80211/ieee80211_regdomain.c index 042f9bb..c4000dd 100644 --- a/sys/net80211/ieee80211_regdomain.c +++ b/sys/net80211/ieee80211_regdomain.c @@ -44,12 +44,14 @@ __FBSDID("$FreeBSD$"); #include <net80211/ieee80211_regdomain.h> static void -null_getradiocaps(struct ieee80211com *ic, int *n, struct ieee80211_channel *c) +null_getradiocaps(struct ieee80211com *ic, int maxchan, + int *n, struct ieee80211_channel *c) { /* just feed back the current channel list */ - *n = ic->ic_nchans; - memcpy(c, ic->ic_channels, - ic->ic_nchans*sizeof(struct ieee80211_channel)); + *n = ic->ic_nchans; /* XXX return count copied? */ + if (maxchan > ic->ic_nchans) + maxchan = ic->ic_nchans; + memcpy(c, ic->ic_channels, maxchan*sizeof(struct ieee80211_channel)); } static int |