rt2661.c (158651) | rt2661.c (159180) |
---|---|
1/* $FreeBSD: head/sys/dev/ral/rt2661.c 158651 2006-05-16 14:37:58Z phk $ */ | 1/* $FreeBSD: head/sys/dev/ral/rt2661.c 159180 2006-06-02 19:59:33Z csjp $ */ |
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 158651 2006-05-16 14:37:58Z phk $"); | 21__FBSDID("$FreeBSD: head/sys/dev/ral/rt2661.c 159180 2006-06-02 19:59:33Z csjp $"); |
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> --- 1097 unchanged lines hidden (view full) --- 1127 data->m = mnew; 1128 desc->physaddr = htole32(physaddr); 1129 1130 /* finalize mbuf */ 1131 m->m_pkthdr.rcvif = ifp; 1132 m->m_pkthdr.len = m->m_len = 1133 (le32toh(desc->flags) >> 16) & 0xfff; 1134 | 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> --- 1097 unchanged lines hidden (view full) --- 1127 data->m = mnew; 1128 desc->physaddr = htole32(physaddr); 1129 1130 /* finalize mbuf */ 1131 m->m_pkthdr.rcvif = ifp; 1132 m->m_pkthdr.len = m->m_len = 1133 (le32toh(desc->flags) >> 16) & 0xfff; 1134 |
1135 if (sc->sc_drvbpf != NULL) { | 1135 if (bpf_peers_present(sc->sc_drvbpf)) { |
1136 struct rt2661_rx_radiotap_header *tap = &sc->sc_rxtap; 1137 uint32_t tsf_lo, tsf_hi; 1138 1139 /* get timestamp (low and high 32 bits) */ 1140 tsf_hi = RAL_READ(sc, RT2661_TXRX_CSR13); 1141 tsf_lo = RAL_READ(sc, RT2661_TXRX_CSR12); 1142 1143 tap->wr_tsf = --- 331 unchanged lines hidden (view full) --- 1475 segs, &nsegs, 0); 1476 if (error != 0) { 1477 device_printf(sc->sc_dev, "could not map mbuf (error %d)\n", 1478 error); 1479 m_freem(m0); 1480 return error; 1481 } 1482 | 1136 struct rt2661_rx_radiotap_header *tap = &sc->sc_rxtap; 1137 uint32_t tsf_lo, tsf_hi; 1138 1139 /* get timestamp (low and high 32 bits) */ 1140 tsf_hi = RAL_READ(sc, RT2661_TXRX_CSR13); 1141 tsf_lo = RAL_READ(sc, RT2661_TXRX_CSR12); 1142 1143 tap->wr_tsf = --- 331 unchanged lines hidden (view full) --- 1475 segs, &nsegs, 0); 1476 if (error != 0) { 1477 device_printf(sc->sc_dev, "could not map mbuf (error %d)\n", 1478 error); 1479 m_freem(m0); 1480 return error; 1481 } 1482 |
1483 if (sc->sc_drvbpf != NULL) { | 1483 if (bpf_peers_present(sc->sc_drvbpf)) { |
1484 struct rt2661_tx_radiotap_header *tap = &sc->sc_txtap; 1485 1486 tap->wt_flags = 0; 1487 tap->wt_rate = rate; 1488 tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq); 1489 tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags); 1490 1491 bpf_mtap2(sc->sc_drvbpf, tap, sc->sc_txtap_len, m0); --- 207 unchanged lines hidden (view full) --- 1699 m_freem(m0); 1700 return error; 1701 } 1702 1703 /* packet header have moved, reset our local pointer */ 1704 wh = mtod(m0, struct ieee80211_frame *); 1705 } 1706 | 1484 struct rt2661_tx_radiotap_header *tap = &sc->sc_txtap; 1485 1486 tap->wt_flags = 0; 1487 tap->wt_rate = rate; 1488 tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq); 1489 tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags); 1490 1491 bpf_mtap2(sc->sc_drvbpf, tap, sc->sc_txtap_len, m0); --- 207 unchanged lines hidden (view full) --- 1699 m_freem(m0); 1700 return error; 1701 } 1702 1703 /* packet header have moved, reset our local pointer */ 1704 wh = mtod(m0, struct ieee80211_frame *); 1705 } 1706 |
1707 if (sc->sc_drvbpf != NULL) { | 1707 if (bpf_peers_present(sc->sc_drvbpf)) { |
1708 struct rt2661_tx_radiotap_header *tap = &sc->sc_txtap; 1709 1710 tap->wt_flags = 0; 1711 tap->wt_rate = rate; 1712 tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq); 1713 tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags); 1714 1715 bpf_mtap2(sc->sc_drvbpf, tap, sc->sc_txtap_len, m0); --- 1187 unchanged lines hidden --- | 1708 struct rt2661_tx_radiotap_header *tap = &sc->sc_txtap; 1709 1710 tap->wt_flags = 0; 1711 tap->wt_rate = rate; 1712 tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq); 1713 tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags); 1714 1715 bpf_mtap2(sc->sc_drvbpf, tap, sc->sc_txtap_len, m0); --- 1187 unchanged lines hidden --- |