From owner-p4-projects@FreeBSD.ORG Tue Jan 2 18:55:09 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0854F16A417; Tue, 2 Jan 2007 18:55:09 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DABA716A40F for ; Tue, 2 Jan 2007 18:55:08 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id BD7C213C458 for ; Tue, 2 Jan 2007 18:55:08 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l02It8eB029855 for ; Tue, 2 Jan 2007 18:55:08 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l02It8k9029851 for perforce@freebsd.org; Tue, 2 Jan 2007 18:55:08 GMT (envelope-from sam@freebsd.org) Date: Tue, 2 Jan 2007 18:55:08 GMT Message-Id: <200701021855.l02It8k9029851@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 112431 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jan 2007 18:55:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=112431 Change 112431 by sam@sam_ebb on 2007/01/02 18:54:40 convert 2560 support to use net80211 channel setup code and default rate set setup to net80211; the channel stuff is just an example and needs mucho work Affected files ... .. //depot/projects/wifi/sys/dev/ral/rt2560.c#6 edit Differences ... ==== //depot/projects/wifi/sys/dev/ral/rt2560.c#6 (text) ==== @@ -53,6 +53,7 @@ #include #include +#include #include #include @@ -154,18 +155,6 @@ static int rt2560_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); -/* - * Supported rates for 802.11a/b/g modes (in 500Kbps unit). - */ -static const struct ieee80211_rateset rt2560_rateset_11a = - { 8, { 12, 18, 24, 36, 48, 72, 96, 108 } }; - -static const struct ieee80211_rateset rt2560_rateset_11b = - { 4, { 2, 4, 11, 22 } }; - -static const struct ieee80211_rateset rt2560_rateset_11g = - { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; - static const struct { uint32_t reg; uint32_t val; @@ -202,7 +191,7 @@ struct rt2560_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; struct ifnet *ifp; - int error, i, j; + int error, bands; sc->sc_dev = dev; @@ -288,50 +277,13 @@ IEEE80211_C_SHSLOT | /* short slot time supported */ IEEE80211_C_WPA; /* 802.11i */ - /* set supported .11b and .11g channels (1 through 14) */ - for (j = 0, i = 1; i <= 14; i++) { - ic->ic_channels[j].ic_freq = - ieee80211_ieee2mhz(i, IEEE80211_CHAN_2GHZ); - ic->ic_channels[j].ic_flags = IEEE80211_CHAN_B; - ic->ic_channels[j].ic_ieee = i; - j++; - - ic->ic_channels[j].ic_freq = - ieee80211_ieee2mhz(i, IEEE80211_CHAN_2GHZ); - ic->ic_channels[j].ic_flags = IEEE80211_CHAN_G; - ic->ic_channels[j].ic_ieee = i; - j++; - } - - if (sc->rf_rev == RT2560_RF_5222) { - /* set supported .11a rates */ - ic->ic_sup_rates[IEEE80211_MODE_11A] = rt2560_rateset_11a; - - /* set supported .11a channels */ - for (i = 36; i <= 64; i += 4, j++) { - ic->ic_channels[j].ic_freq = - ieee80211_ieee2mhz(i, IEEE80211_CHAN_5GHZ); - ic->ic_channels[j].ic_flags = IEEE80211_CHAN_A; - ic->ic_channels[j].ic_ieee = i; - } - for (i = 100; i <= 140; i += 4, j++) { - ic->ic_channels[j].ic_freq = - ieee80211_ieee2mhz(i, IEEE80211_CHAN_5GHZ); - ic->ic_channels[j].ic_flags = IEEE80211_CHAN_A; - ic->ic_channels[j].ic_ieee = i; - } - for (i = 149; i <= 161; i += 4, j++) { - ic->ic_channels[j].ic_freq = - ieee80211_ieee2mhz(i, IEEE80211_CHAN_5GHZ); - ic->ic_channels[j].ic_flags = IEEE80211_CHAN_A; - ic->ic_channels[j].ic_ieee = i; - } - } + bands = 0; + 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, 0, CTRY_DEFAULT, bands, 0, 1); - /* set supported .11b and .11g rates */ - ic->ic_sup_rates[IEEE80211_MODE_11B] = rt2560_rateset_11b; - ic->ic_sup_rates[IEEE80211_MODE_11G] = rt2560_rateset_11g; - ic->ic_nchans = j; ieee80211_ifattach(ic); ic->ic_scan_start = rt2560_scan_start; ic->ic_scan_end = rt2560_scan_end;