Deleted Added
full compact
rt2661.c (214894) rt2661.c (217511)
1/* $FreeBSD: head/sys/dev/ral/rt2661.c 214894 2010-11-06 18:17:20Z bschmidt $ */
1/* $FreeBSD: head/sys/dev/ral/rt2661.c 217511 2011-01-17 20:15:15Z bschmidt $ */
2
3/*-
4 * Copyright (c) 2006
5 * Damien Bergamini <damien.bergamini@free.fr>
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20#include <sys/cdefs.h>
2
3/*-
4 * Copyright (c) 2006
5 * Damien Bergamini <damien.bergamini@free.fr>
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20#include <sys/cdefs.h>
21__FBSDID("$FreeBSD: head/sys/dev/ral/rt2661.c 214894 2010-11-06 18:17:20Z bschmidt $");
21__FBSDID("$FreeBSD: head/sys/dev/ral/rt2661.c 217511 2011-01-17 20:15:15Z bschmidt $");
22
23/*-
24 * Ralink Technology RT2561, RT2561S and RT2661 chipset driver
25 * http://www.ralinktech.com/
26 */
27
28#include <sys/param.h>
29#include <sys/sysctl.h>

--- 65 unchanged lines hidden (view full) ---

95static void rt2661_free_tx_ring(struct rt2661_softc *,
96 struct rt2661_tx_ring *);
97static int rt2661_alloc_rx_ring(struct rt2661_softc *,
98 struct rt2661_rx_ring *, int);
99static void rt2661_reset_rx_ring(struct rt2661_softc *,
100 struct rt2661_rx_ring *);
101static void rt2661_free_rx_ring(struct rt2661_softc *,
102 struct rt2661_rx_ring *);
22
23/*-
24 * Ralink Technology RT2561, RT2561S and RT2661 chipset driver
25 * http://www.ralinktech.com/
26 */
27
28#include <sys/param.h>
29#include <sys/sysctl.h>

--- 65 unchanged lines hidden (view full) ---

95static void rt2661_free_tx_ring(struct rt2661_softc *,
96 struct rt2661_tx_ring *);
97static int rt2661_alloc_rx_ring(struct rt2661_softc *,
98 struct rt2661_rx_ring *, int);
99static void rt2661_reset_rx_ring(struct rt2661_softc *,
100 struct rt2661_rx_ring *);
101static void rt2661_free_rx_ring(struct rt2661_softc *,
102 struct rt2661_rx_ring *);
103static void rt2661_newassoc(struct ieee80211_node *, int);
104static int rt2661_newstate(struct ieee80211vap *,
105 enum ieee80211_state, int);
106static uint16_t rt2661_eeprom_read(struct rt2661_softc *, uint8_t);
107static void rt2661_rx_intr(struct rt2661_softc *);
108static void rt2661_tx_intr(struct rt2661_softc *);
109static void rt2661_tx_dma_intr(struct rt2661_softc *,
110 struct rt2661_tx_ring *);
111static void rt2661_mcu_beacon_expire(struct rt2661_softc *);

--- 187 unchanged lines hidden (view full) ---

299 bands = 0;
300 setbit(&bands, IEEE80211_MODE_11B);
301 setbit(&bands, IEEE80211_MODE_11G);
302 if (sc->rf_rev == RT2661_RF_5225 || sc->rf_rev == RT2661_RF_5325)
303 setbit(&bands, IEEE80211_MODE_11A);
304 ieee80211_init_channels(ic, NULL, &bands);
305
306 ieee80211_ifattach(ic, macaddr);
103static int rt2661_newstate(struct ieee80211vap *,
104 enum ieee80211_state, int);
105static uint16_t rt2661_eeprom_read(struct rt2661_softc *, uint8_t);
106static void rt2661_rx_intr(struct rt2661_softc *);
107static void rt2661_tx_intr(struct rt2661_softc *);
108static void rt2661_tx_dma_intr(struct rt2661_softc *,
109 struct rt2661_tx_ring *);
110static void rt2661_mcu_beacon_expire(struct rt2661_softc *);

--- 187 unchanged lines hidden (view full) ---

298 bands = 0;
299 setbit(&bands, IEEE80211_MODE_11B);
300 setbit(&bands, IEEE80211_MODE_11G);
301 if (sc->rf_rev == RT2661_RF_5225 || sc->rf_rev == RT2661_RF_5325)
302 setbit(&bands, IEEE80211_MODE_11A);
303 ieee80211_init_channels(ic, NULL, &bands);
304
305 ieee80211_ifattach(ic, macaddr);
307 ic->ic_newassoc = rt2661_newassoc;
308#if 0
309 ic->ic_wme.wme_update = rt2661_wme_update;
310#endif
311 ic->ic_scan_start = rt2661_scan_start;
312 ic->ic_scan_end = rt2661_scan_end;
313 ic->ic_set_channel = rt2661_set_channel;
314 ic->ic_updateslot = rt2661_update_slot;
315 ic->ic_update_promisc = rt2661_update_promisc;

--- 443 unchanged lines hidden (view full) ---

759
760 free(ring->data, M_DEVBUF);
761 }
762
763 if (ring->data_dmat != NULL)
764 bus_dma_tag_destroy(ring->data_dmat);
765}
766
306#if 0
307 ic->ic_wme.wme_update = rt2661_wme_update;
308#endif
309 ic->ic_scan_start = rt2661_scan_start;
310 ic->ic_scan_end = rt2661_scan_end;
311 ic->ic_set_channel = rt2661_set_channel;
312 ic->ic_updateslot = rt2661_update_slot;
313 ic->ic_update_promisc = rt2661_update_promisc;

--- 443 unchanged lines hidden (view full) ---

757
758 free(ring->data, M_DEVBUF);
759 }
760
761 if (ring->data_dmat != NULL)
762 bus_dma_tag_destroy(ring->data_dmat);
763}
764
767static void
768rt2661_newassoc(struct ieee80211_node *ni, int isnew)
769{
770 /* XXX move */
771 ieee80211_ratectl_node_init(ni);
772}
773
774static int
775rt2661_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
776{
777 struct rt2661_vap *rvp = RT2661_VAP(vap);
778 struct ieee80211com *ic = vap->iv_ic;
779 struct rt2661_softc *sc = ic->ic_ifp->if_softc;
780 int error;
781

--- 2078 unchanged lines hidden ---
765static int
766rt2661_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
767{
768 struct rt2661_vap *rvp = RT2661_VAP(vap);
769 struct ieee80211com *ic = vap->iv_ic;
770 struct rt2661_softc *sc = ic->ic_ifp->if_softc;
771 int error;
772

--- 2078 unchanged lines hidden ---