Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F131703905
D6171.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D6171.diff
View Options
Index: head/sys/dev/usb/wlan/if_zyd.c
===================================================================
--- head/sys/dev/usb/wlan/if_zyd.c
+++ head/sys/dev/usb/wlan/if_zyd.c
@@ -164,6 +164,8 @@
static int zyd_loadfirmware(struct zyd_softc *);
static void zyd_scan_start(struct ieee80211com *);
static void zyd_scan_end(struct ieee80211com *);
+static void zyd_getradiocaps(struct ieee80211com *, int, int *,
+ struct ieee80211_channel[]);
static void zyd_set_channel(struct ieee80211com *);
static int zyd_rfmd_init(struct zyd_rf *);
static int zyd_rfmd_switch_radio(struct zyd_rf *, int);
@@ -334,7 +336,6 @@
struct usb_attach_arg *uaa = device_get_ivars(dev);
struct zyd_softc *sc = device_get_softc(dev);
struct ieee80211com *ic = &sc->sc_ic;
- uint8_t bands[IEEE80211_MODE_BYTES];
uint8_t iface_index;
int error;
@@ -388,15 +389,14 @@
| IEEE80211_C_WPA /* 802.11i */
;
- memset(bands, 0, sizeof(bands));
- setbit(bands, IEEE80211_MODE_11B);
- setbit(bands, IEEE80211_MODE_11G);
- ieee80211_init_channels(ic, NULL, bands);
+ zyd_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans,
+ ic->ic_channels);
ieee80211_ifattach(ic);
ic->ic_raw_xmit = zyd_raw_xmit;
ic->ic_scan_start = zyd_scan_start;
ic->ic_scan_end = zyd_scan_end;
+ ic->ic_getradiocaps = zyd_getradiocaps;
ic->ic_set_channel = zyd_set_channel;
ic->ic_vap_create = zyd_vap_create;
ic->ic_vap_delete = zyd_vap_delete;
@@ -2865,6 +2865,19 @@
}
static void
+zyd_getradiocaps(struct ieee80211com *ic,
+ int maxchans, int *nchans, struct ieee80211_channel chans[])
+{
+ uint8_t bands[IEEE80211_MODE_BYTES];
+
+ memset(bands, 0, sizeof(bands));
+ setbit(bands, IEEE80211_MODE_11B);
+ setbit(bands, IEEE80211_MODE_11G);
+ ieee80211_add_channel_list_2ghz(chans, maxchans, nchans,
+ zyd_chan_2ghz, nitems(zyd_chan_2ghz), bands, 0);
+}
+
+static void
zyd_set_channel(struct ieee80211com *ic)
{
struct zyd_softc *sc = ic->ic_softc;
Index: head/sys/dev/usb/wlan/if_zydreg.h
===================================================================
--- head/sys/dev/usb/wlan/if_zydreg.h
+++ head/sys/dev/usb/wlan/if_zydreg.h
@@ -421,6 +421,10 @@
#define ZYD_CR254 0x93f8
#define ZYD_CR255 0x93fc
+/* nitems(ZYD_*_CHANTABLE) */
+static const uint8_t zyd_chan_2ghz[] =
+ { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 };
+
/* copied nearly verbatim from the Linux driver rewrite */
#define ZYD_DEF_PHY \
{ \
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 11, 12:00 PM (19 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23576038
Default Alt Text
D6171.diff (2 KB)
Attached To
Mode
D6171: zyd: switch to ieee80211_add_channel_list_*()
Attached
Detach File
Event Timeline
Log In to Comment