Page MenuHomeFreeBSD

D6182.diff
No OneTemporary

D6182.diff

Index: head/sys/dev/ral/rt2560.c
===================================================================
--- head/sys/dev/ral/rt2560.c
+++ head/sys/dev/ral/rt2560.c
@@ -117,6 +117,8 @@
static void rt2560_wakeup_expire(struct rt2560_softc *);
static void rt2560_scan_start(struct ieee80211com *);
static void rt2560_scan_end(struct ieee80211com *);
+static void rt2560_getradiocaps(struct ieee80211com *, int, int *,
+ struct ieee80211_channel[]);
static void rt2560_set_channel(struct ieee80211com *);
static void rt2560_setup_tx_desc(struct rt2560_softc *,
struct rt2560_tx_desc *, uint32_t, int, int, int,
@@ -187,6 +189,14 @@
static const uint32_t rt2560_rf2526_r2[] = RT2560_RF2526_R2;
static const uint32_t rt2560_rf2526_hi_r2[] = RT2560_RF2526_HI_R2;
+static const uint8_t rt2560_chan_2ghz[] =
+ { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 };
+
+static const uint8_t rt2560_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 {
uint8_t chan;
uint32_t r1, r2, r4;
@@ -199,7 +209,6 @@
{
struct rt2560_softc *sc = device_get_softc(dev);
struct ieee80211com *ic = &sc->sc_ic;
- uint8_t bands[IEEE80211_MODE_BYTES];
int error;
sc->sc_dev = dev;
@@ -278,12 +287,8 @@
#endif
;
- memset(bands, 0, sizeof(bands));
- setbit(bands, IEEE80211_MODE_11B);
- setbit(bands, IEEE80211_MODE_11G);
- if (sc->rf_rev == RT2560_RF_5222)
- setbit(bands, IEEE80211_MODE_11A);
- ieee80211_init_channels(ic, NULL, bands);
+ rt2560_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans,
+ ic->ic_channels);
ieee80211_ifattach(ic);
ic->ic_raw_xmit = rt2560_raw_xmit;
@@ -291,6 +296,7 @@
ic->ic_update_promisc = rt2560_update_promisc;
ic->ic_scan_start = rt2560_scan_start;
ic->ic_scan_end = rt2560_scan_end;
+ ic->ic_getradiocaps = rt2560_getradiocaps;
ic->ic_set_channel = rt2560_set_channel;
ic->ic_vap_create = rt2560_vap_create;
@@ -2141,6 +2147,26 @@
}
static void
+rt2560_getradiocaps(struct ieee80211com *ic,
+ int maxchans, int *nchans, struct ieee80211_channel chans[])
+{
+ struct rt2560_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,
+ rt2560_chan_2ghz, nitems(rt2560_chan_2ghz), bands, 0);
+
+ if (sc->rf_rev == RT2560_RF_5222) {
+ setbit(bands, IEEE80211_MODE_11A);
+ ieee80211_add_channel_list_5ghz(chans, maxchans, nchans,
+ rt2560_chan_5ghz, nitems(rt2560_chan_5ghz), bands, 0);
+ }
+}
+
+static void
rt2560_set_channel(struct ieee80211com *ic)
{
struct rt2560_softc *sc = ic->ic_softc;
Index: head/sys/dev/ral/rt2661.c
===================================================================
--- head/sys/dev/ral/rt2661.c
+++ head/sys/dev/ral/rt2661.c
@@ -113,6 +113,8 @@
static void rt2661_mcu_cmd_intr(struct rt2661_softc *);
static void rt2661_scan_start(struct ieee80211com *);
static void rt2661_scan_end(struct ieee80211com *);
+static void rt2661_getradiocaps(struct ieee80211com *, int, int *,
+ struct ieee80211_channel[]);
static void rt2661_set_channel(struct ieee80211com *);
static void rt2661_setup_tx_desc(struct rt2661_softc *,
struct rt2661_tx_desc *, uint32_t, uint16_t, int,
@@ -193,13 +195,19 @@
RT2661_RF5225_2
};
+static const uint8_t rt2661_chan_2ghz[] =
+ { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 };
+static const uint8_t rt2661_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, 165 };
+
int
rt2661_attach(device_t dev, int id)
{
struct rt2661_softc *sc = device_get_softc(dev);
struct ieee80211com *ic = &sc->sc_ic;
uint32_t val;
- uint8_t bands[IEEE80211_MODE_BYTES];
int error, ac, ntries;
sc->sc_id = id;
@@ -279,12 +287,8 @@
#endif
;
- memset(bands, 0, sizeof(bands));
- setbit(bands, IEEE80211_MODE_11B);
- setbit(bands, IEEE80211_MODE_11G);
- if (sc->rf_rev == RT2661_RF_5225 || sc->rf_rev == RT2661_RF_5325)
- setbit(bands, IEEE80211_MODE_11A);
- ieee80211_init_channels(ic, NULL, bands);
+ rt2661_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans,
+ ic->ic_channels);
ieee80211_ifattach(ic);
#if 0
@@ -2762,6 +2766,26 @@
}
static void
+rt2661_getradiocaps(struct ieee80211com *ic,
+ int maxchans, int *nchans, struct ieee80211_channel chans[])
+{
+ struct rt2661_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,
+ rt2661_chan_2ghz, nitems(rt2661_chan_2ghz), bands, 0);
+
+ if (sc->rf_rev == RT2661_RF_5225 || sc->rf_rev == RT2661_RF_5325) {
+ setbit(bands, IEEE80211_MODE_11A);
+ ieee80211_add_channel_list_5ghz(chans, maxchans, nchans,
+ rt2661_chan_5ghz, nitems(rt2661_chan_5ghz), bands, 0);
+ }
+}
+
+static void
rt2661_set_channel(struct ieee80211com *ic)
{
struct rt2661_softc *sc = ic->ic_softc;
Index: head/sys/dev/ral/rt2860.c
===================================================================
--- head/sys/dev/ral/rt2860.c
+++ head/sys/dev/ral/rt2860.c
@@ -138,6 +138,8 @@
const struct ieee80211_rateset *);
static void rt2860_scan_start(struct ieee80211com *);
static void rt2860_scan_end(struct ieee80211com *);
+static void rt2860_getradiocaps(struct ieee80211com *, int, int *,
+ struct ieee80211_channel[]);
static void rt2860_set_channel(struct ieee80211com *);
static void rt2860_select_chan_group(struct rt2860_softc *, int);
static void rt2860_set_chan(struct rt2860_softc *, u_int);
@@ -226,13 +228,19 @@
RT5392_DEF_RF
};
+static const uint8_t rt2860_chan_2ghz[] =
+ { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 };
+static const uint8_t rt2860_chan_5ghz[] =
+ { 36, 38, 40, 44, 46, 48, 52, 54, 56, 60, 62, 64, 100, 102, 104,
+ 108, 110, 112, 116, 118, 120, 124, 126, 128, 132, 134, 136, 140,
+ 149, 151, 153, 157, 159, 161, 165, 167, 169, 171, 173 };
+
int
rt2860_attach(device_t dev, int id)
{
struct rt2860_softc *sc = device_get_softc(dev);
struct ieee80211com *ic = &sc->sc_ic;
uint32_t tmp;
- uint8_t bands[IEEE80211_MODE_BYTES];
int error, ntries, qid;
sc->sc_dev = dev;
@@ -319,18 +327,15 @@
| IEEE80211_C_WME /* 802.11e */
;
- memset(bands, 0, sizeof(bands));
- setbit(bands, IEEE80211_MODE_11B);
- setbit(bands, IEEE80211_MODE_11G);
- if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850)
- setbit(bands, IEEE80211_MODE_11A);
- ieee80211_init_channels(ic, NULL, bands);
+ rt2860_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans,
+ ic->ic_channels);
ieee80211_ifattach(ic);
ic->ic_wme.wme_update = rt2860_updateedca;
ic->ic_scan_start = rt2860_scan_start;
ic->ic_scan_end = rt2860_scan_end;
+ ic->ic_getradiocaps = rt2860_getradiocaps;
ic->ic_set_channel = rt2860_set_channel;
ic->ic_updateslot = rt2860_updateslot;
ic->ic_update_promisc = rt2860_update_promisc;
@@ -2299,6 +2304,26 @@
}
static void
+rt2860_getradiocaps(struct ieee80211com *ic, int maxchans, int *nchans,
+ struct ieee80211_channel chans[])
+{
+ struct rt2860_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,
+ rt2860_chan_2ghz, nitems(rt2860_chan_2ghz), bands, 0);
+
+ if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850) {
+ setbit(bands, IEEE80211_MODE_11A);
+ ieee80211_add_channel_list_5ghz(chans, maxchans, nchans,
+ rt2860_chan_5ghz, nitems(rt2860_chan_5ghz), bands, 0);
+ }
+}
+
+static void
rt2860_set_channel(struct ieee80211com *ic)
{
struct rt2860_softc *sc = ic->ic_softc;

File Metadata

Mime Type
text/plain
Expires
Sat, Jul 25, 9:13 PM (3 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35497652
Default Alt Text
D6182.diff (7 KB)

Event Timeline