PERFORCE change 118776 for review
Sepherosa Ziehau
sephe at FreeBSD.org
Wed Apr 25 12:02:44 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=118776
Change 118776 by sephe at sephe_zealot:sam_wifi on 2007/04/25 12:02:05
- Nuke unnecessary header inclusion.
- Use ieee80211_init_channels().
Affected files ...
.. //depot/projects/wifi/sys/dev/usb/if_ural.c#21 edit
Differences ...
==== //depot/projects/wifi/sys/dev/usb/if_ural.c#21 (text+ko) ====
@@ -51,12 +51,7 @@
#include <net80211/ieee80211_var.h>
#include <net80211/ieee80211_radiotap.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#include <netinet/if_ether.h>
+#include <net80211/ieee80211_regdomain.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
@@ -361,12 +356,11 @@
USB_ATTACH_START(ural, sc, uaa);
struct ifnet *ifp;
struct ieee80211com *ic = &sc->sc_ic;
- struct ieee80211_channel *c;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
usbd_status error;
char devinfo[1024];
- int i;
+ int i, bands;
sc->sc_udev = uaa->device;
@@ -466,39 +460,12 @@
| IEEE80211_C_WPA /* 802.11i */
;
- if (sc->rf_rev == RAL_RF_5222) {
- /* set supported .11a channels */
- for (i = 36; i <= 64; i += 4) {
- c = &ic->ic_channels[ic->ic_nchans++];
- c->ic_freq = ieee80211_ieee2mhz(i, IEEE80211_CHAN_5GHZ);
- c->ic_flags = IEEE80211_CHAN_A;
- c->ic_ieee = i;
- }
- for (i = 100; i <= 140; i += 4) {
- c = &ic->ic_channels[ic->ic_nchans++];
- c->ic_freq = ieee80211_ieee2mhz(i, IEEE80211_CHAN_5GHZ);
- c->ic_flags = IEEE80211_CHAN_A;
- c->ic_ieee = i;
- }
- for (i = 149; i <= 161; i += 4) {
- c = &ic->ic_channels[ic->ic_nchans++];
- c->ic_freq = ieee80211_ieee2mhz(i, IEEE80211_CHAN_5GHZ);
- c->ic_flags = IEEE80211_CHAN_A;
- c->ic_ieee = i;
- }
- }
-
- /* set supported .11b and .11g channels (1 through 14) */
- for (i = 1; i <= 14; i++) {
- c = &ic->ic_channels[ic->ic_nchans++];
- c->ic_freq = ieee80211_ieee2mhz(i, IEEE80211_CHAN_2GHZ);
- c->ic_flags = IEEE80211_CHAN_B;
- c->ic_ieee = i;
- c = &ic->ic_channels[ic->ic_nchans++];
- c->ic_freq = ieee80211_ieee2mhz(i, IEEE80211_CHAN_2GHZ);
- c->ic_flags = IEEE80211_CHAN_G;
- c->ic_ieee = i;
- }
+ bands = 0;
+ 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, 0, CTRY_DEFAULT, bands, 0, 1);
ieee80211_ifattach(ic);
ic->ic_reset = ural_reset;
More information about the p4-projects
mailing list