if_bwnvar.h (204257) | if_bwnvar.h (204922) |
---|---|
1/*- 2 * Copyright (c) 2009-2010 Weongyo Jeong <weongyo@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, 22 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGES. 28 * | 1/*- 2 * Copyright (c) 2009-2010 Weongyo Jeong <weongyo@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, 22 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGES. 28 * |
29 * $FreeBSD: head/sys/dev/bwn/if_bwnvar.h 204257 2010-02-23 19:55:54Z weongyo $ | 29 * $FreeBSD: head/sys/dev/bwn/if_bwnvar.h 204922 2010-03-09 19:58:00Z weongyo $ |
30 */ 31 32#ifndef _IF_BWNVAR_H 33#define _IF_BWNVAR_H 34 35struct siba_dev_softc; 36struct bwn_softc; 37struct bwn_mac; --- 22 unchanged lines hidden (view full) --- 60 ((int32_t)((num < 0) ? num / den : (num + den / 2) / den)) 61#define BWN_HDRSIZE(mac) \ 62 ((BWN_ISOLDFMT(mac)) ? (100 + sizeof(struct bwn_plcp6)) : \ 63 (104 + sizeof(struct bwn_plcp6))) 64#define BWN_PIO_COOKIE(tq, tp) \ 65 ((uint16_t)((((uint16_t)tq->tq_index + 1) << 12) | tp->tp_index)) 66#define BWN_DMA_COOKIE(dr, slot) \ 67 ((uint16_t)(((uint16_t)dr->dr_index + 1) << 12) | (uint16_t)slot) | 30 */ 31 32#ifndef _IF_BWNVAR_H 33#define _IF_BWNVAR_H 34 35struct siba_dev_softc; 36struct bwn_softc; 37struct bwn_mac; --- 22 unchanged lines hidden (view full) --- 60 ((int32_t)((num < 0) ? num / den : (num + den / 2) / den)) 61#define BWN_HDRSIZE(mac) \ 62 ((BWN_ISOLDFMT(mac)) ? (100 + sizeof(struct bwn_plcp6)) : \ 63 (104 + sizeof(struct bwn_plcp6))) 64#define BWN_PIO_COOKIE(tq, tp) \ 65 ((uint16_t)((((uint16_t)tq->tq_index + 1) << 12) | tp->tp_index)) 66#define BWN_DMA_COOKIE(dr, slot) \ 67 ((uint16_t)(((uint16_t)dr->dr_index + 1) << 12) | (uint16_t)slot) |
68#define BWN_READ_2(mac, o) (siba_read_2(mac->mac_sd, o)) 69#define BWN_READ_4(mac, o) (siba_read_4(mac->mac_sd, o)) 70#define BWN_WRITE_2(mac, o, v) (siba_write_2(mac->mac_sd, o, v)) 71#define BWN_WRITE_4(mac, o, v) (siba_write_4(mac->mac_sd, o, v)) | 68#define BWN_READ_2(mac, o) (siba_read_2(mac->mac_sc->sc_dev, o)) 69#define BWN_READ_4(mac, o) (siba_read_4(mac->mac_sc->sc_dev, o)) 70#define BWN_WRITE_2(mac, o, v) \ 71 (siba_write_2(mac->mac_sc->sc_dev, o, v)) 72#define BWN_WRITE_4(mac, o, v) \ 73 (siba_write_4(mac->mac_sc->sc_dev, o, v)) |
72#define BWN_PIO_TXQOFFSET(mac) \ | 74#define BWN_PIO_TXQOFFSET(mac) \ |
73 ((mac->mac_sd->sd_id.sd_rev >= 11) ? 0x18 : 0) | 75 ((siba_get_revid(mac->mac_sc->sc_dev) >= 11) ? 0x18 : 0) |
74#define BWN_PIO_RXQOFFSET(mac) \ | 76#define BWN_PIO_RXQOFFSET(mac) \ |
75 ((mac->mac_sd->sd_id.sd_rev >= 11) ? 0x38 : 8) | 77 ((siba_get_revid(mac->mac_sc->sc_dev) >= 11) ? 0x38 : 8) |
76#define BWN_SEC_NEWAPI(mac) (mac->mac_fw.rev >= 351) 77#define BWN_SEC_KEY2FW(mac, idx) \ 78 (BWN_SEC_NEWAPI(mac) ? idx : ((idx >= 4) ? idx - 4 : idx)) 79#define BWN_RF_READ(mac, r) (mac->mac_phy.rf_read(mac, r)) 80#define BWN_RF_WRITE(mac, r, v) (mac->mac_phy.rf_write(mac, r, v)) 81#define BWN_RF_MASK(mac, o, m) \ 82 BWN_RF_WRITE(mac, o, BWN_RF_READ(mac, o) & m) 83#define BWN_RF_SETMASK(mac, offset, mask, set) \ --- 52 unchanged lines hidden (view full) --- 136#define BWN_PIO_WRITE_2(mac, tq, offset, value) \ 137 BWN_WRITE_2(mac, (tq)->tq_base + offset, value) 138#define BWN_PIO_READ_4(mac, tq, offset) \ 139 BWN_READ_4(mac, tq->tq_base + offset) 140#define BWN_ISCCKRATE(rate) \ 141 (rate == BWN_CCK_RATE_1MB || rate == BWN_CCK_RATE_2MB || \ 142 rate == BWN_CCK_RATE_5MB || rate == BWN_CCK_RATE_11MB) 143#define BWN_ISOFDMRATE(rate) (!BWN_ISCCKRATE(rate)) | 78#define BWN_SEC_NEWAPI(mac) (mac->mac_fw.rev >= 351) 79#define BWN_SEC_KEY2FW(mac, idx) \ 80 (BWN_SEC_NEWAPI(mac) ? idx : ((idx >= 4) ? idx - 4 : idx)) 81#define BWN_RF_READ(mac, r) (mac->mac_phy.rf_read(mac, r)) 82#define BWN_RF_WRITE(mac, r, v) (mac->mac_phy.rf_write(mac, r, v)) 83#define BWN_RF_MASK(mac, o, m) \ 84 BWN_RF_WRITE(mac, o, BWN_RF_READ(mac, o) & m) 85#define BWN_RF_SETMASK(mac, offset, mask, set) \ --- 52 unchanged lines hidden (view full) --- 138#define BWN_PIO_WRITE_2(mac, tq, offset, value) \ 139 BWN_WRITE_2(mac, (tq)->tq_base + offset, value) 140#define BWN_PIO_READ_4(mac, tq, offset) \ 141 BWN_READ_4(mac, tq->tq_base + offset) 142#define BWN_ISCCKRATE(rate) \ 143 (rate == BWN_CCK_RATE_1MB || rate == BWN_CCK_RATE_2MB || \ 144 rate == BWN_CCK_RATE_5MB || rate == BWN_CCK_RATE_11MB) 145#define BWN_ISOFDMRATE(rate) (!BWN_ISCCKRATE(rate)) |
144#define BWN_BARRIER(mac, flags) siba_barrier(mac->mac_sd, flags) | 146#define BWN_BARRIER(mac, flags) siba_barrier(mac->mac_sc->sc_dev, flags) |
145#define BWN_DMA_READ(dr, offset) \ 146 (BWN_READ_4(dr->dr_mac, dr->dr_base + offset)) 147#define BWN_DMA_WRITE(dr, offset, value) \ 148 (BWN_WRITE_4(dr->dr_mac, dr->dr_base + offset, value)) 149 150struct bwn_rate { 151 uint16_t rateid; 152 uint32_t flags; --- 677 unchanged lines hidden (view full) --- 830 831#define BWN_LED_F_ACTLOW 0x1 832#define BWN_LED_F_BLINK 0x2 833#define BWN_LED_F_POLLABLE 0x4 834#define BWN_LED_F_SLOW 0x8 835 836struct bwn_mac { 837 struct bwn_softc *mac_sc; | 147#define BWN_DMA_READ(dr, offset) \ 148 (BWN_READ_4(dr->dr_mac, dr->dr_base + offset)) 149#define BWN_DMA_WRITE(dr, offset, value) \ 150 (BWN_WRITE_4(dr->dr_mac, dr->dr_base + offset, value)) 151 152struct bwn_rate { 153 uint16_t rateid; 154 uint32_t flags; --- 677 unchanged lines hidden (view full) --- 832 833#define BWN_LED_F_ACTLOW 0x1 834#define BWN_LED_F_BLINK 0x2 835#define BWN_LED_F_POLLABLE 0x4 836#define BWN_LED_F_SLOW 0x8 837 838struct bwn_mac { 839 struct bwn_softc *mac_sc; |
838 struct siba_dev_softc *mac_sd; | |
839 unsigned mac_status; 840#define BWN_MAC_STATUS_UNINIT 0 841#define BWN_MAC_STATUS_INITED 1 842#define BWN_MAC_STATUS_STARTED 2 843 unsigned mac_flags; 844 /* use "Bad Frames Preemption" */ 845#define BWN_MAC_FLAG_BADFRAME_PREEMP (1 << 0) 846#define BWN_MAC_FLAG_DFQVALID (1 << 1) --- 50 unchanged lines hidden (view full) --- 897 int (*bv_newstate)(struct ieee80211vap *, 898 enum ieee80211_state, int); 899}; 900#define BWN_VAP(vap) ((struct bwn_vap *)(vap)) 901#define BWN_VAP_CONST(vap) ((const struct mwl_vap *)(vap)) 902 903struct bwn_softc { 904 device_t sc_dev; | 840 unsigned mac_status; 841#define BWN_MAC_STATUS_UNINIT 0 842#define BWN_MAC_STATUS_INITED 1 843#define BWN_MAC_STATUS_STARTED 2 844 unsigned mac_flags; 845 /* use "Bad Frames Preemption" */ 846#define BWN_MAC_FLAG_BADFRAME_PREEMP (1 << 0) 847#define BWN_MAC_FLAG_DFQVALID (1 << 1) --- 50 unchanged lines hidden (view full) --- 898 int (*bv_newstate)(struct ieee80211vap *, 899 enum ieee80211_state, int); 900}; 901#define BWN_VAP(vap) ((struct bwn_vap *)(vap)) 902#define BWN_VAP_CONST(vap) ((const struct mwl_vap *)(vap)) 903 904struct bwn_softc { 905 device_t sc_dev; |
905 struct siba_dev_softc *sc_sd; | |
906 struct mtx sc_mtx; 907 struct ifnet *sc_ifp; 908 unsigned sc_flags; 909#define BWN_FLAG_ATTACHED (1 << 0) 910#define BWN_FLAG_INVALID (1 << 1) 911#define BWN_FLAG_NEED_BEACON_TP (1 << 2) 912 unsigned sc_debug; 913 --- 46 unchanged lines hidden --- | 906 struct mtx sc_mtx; 907 struct ifnet *sc_ifp; 908 unsigned sc_flags; 909#define BWN_FLAG_ATTACHED (1 << 0) 910#define BWN_FLAG_INVALID (1 << 1) 911#define BWN_FLAG_NEED_BEACON_TP (1 << 2) 912 unsigned sc_debug; 913 --- 46 unchanged lines hidden --- |