Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F132151276
D6170.id16914.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
D6170.id16914.diff
View Options
Index: head/sys/dev/usb/wlan/if_ural.c
===================================================================
--- head/sys/dev/usb/wlan/if_ural.c
+++ head/sys/dev/usb/wlan/if_ural.c
@@ -166,6 +166,8 @@
static void ural_rf_write(struct ural_softc *, uint8_t, uint32_t);
static void ural_scan_start(struct ieee80211com *);
static void ural_scan_end(struct ieee80211com *);
+static void ural_getradiocaps(struct ieee80211com *, int, int *,
+ struct ieee80211_channel[]);
static void ural_set_channel(struct ieee80211com *);
static void ural_set_chan(struct ural_softc *,
struct ieee80211_channel *);
@@ -357,6 +359,14 @@
{ 161, 0x08808, 0x0242f, 0x00281 }
};
+static const uint8_t ural_chan_2ghz[] =
+ { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 };
+
+static const uint8_t ural_chan_5ghz[] =
+ { 36, 40, 44, 48, 52, 56, 60, 64,
+ 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140,
+ 149, 153, 157, 161 };
+
static const struct usb_config ural_config[URAL_N_TRANSFER] = {
[URAL_BULK_WR] = {
.type = UE_BULK,
@@ -424,7 +434,6 @@
struct usb_attach_arg *uaa = device_get_ivars(self);
struct ural_softc *sc = device_get_softc(self);
struct ieee80211com *ic = &sc->sc_ic;
- uint8_t bands[IEEE80211_MODE_BYTES];
uint8_t iface_index;
int error;
@@ -474,18 +483,15 @@
| IEEE80211_C_WPA /* 802.11i */
;
- memset(bands, 0, sizeof(bands));
- setbit(bands, IEEE80211_MODE_11B);
- setbit(bands, IEEE80211_MODE_11G);
- if (sc->rf_rev == RAL_RF_5222)
- setbit(bands, IEEE80211_MODE_11A);
- ieee80211_init_channels(ic, NULL, bands);
+ ural_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans,
+ ic->ic_channels);
ieee80211_ifattach(ic);
ic->ic_update_promisc = ural_update_promisc;
ic->ic_raw_xmit = ural_raw_xmit;
ic->ic_scan_start = ural_scan_start;
ic->ic_scan_end = ural_scan_end;
+ ic->ic_getradiocaps = ural_getradiocaps;
ic->ic_set_channel = ural_set_channel;
ic->ic_parent = ural_parent;
ic->ic_transmit = ural_transmit;
@@ -1588,6 +1594,26 @@
}
static void
+ural_getradiocaps(struct ieee80211com *ic,
+ int maxchans, int *nchans, struct ieee80211_channel chans[])
+{
+ struct ural_softc *sc = ic->ic_softc;
+ 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,
+ ural_chan_2ghz, nitems(ural_chan_2ghz), bands, 0);
+
+ if (sc->rf_rev == RAL_RF_5222) {
+ setbit(bands, IEEE80211_MODE_11A);
+ ieee80211_add_channel_list_5ghz(chans, maxchans, nchans,
+ ural_chan_5ghz, nitems(ural_chan_5ghz), bands, 0);
+ }
+}
+
+static void
ural_set_channel(struct ieee80211com *ic)
{
struct ural_softc *sc = ic->ic_softc;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 15, 5:43 AM (9 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23744608
Default Alt Text
D6170.id16914.diff (2 KB)
Attached To
Mode
D6170: ural: switch to ieee80211_add_channel_list_*()
Attached
Detach File
Event Timeline
Log In to Comment