The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/ral/rt2560var.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $FreeBSD: releng/8.0/sys/dev/ral/rt2560var.h 192468 2009-05-20 20:00:40Z sam $  */
    2 
    3 /*-
    4  * Copyright (c) 2005, 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 struct rt2560_rx_radiotap_header {
   21         struct ieee80211_radiotap_header wr_ihdr;
   22         uint64_t        wr_tsf;
   23         uint8_t         wr_flags;
   24         uint8_t         wr_rate;
   25         uint16_t        wr_chan_freq;
   26         uint16_t        wr_chan_flags;
   27         int8_t          wr_antsignal;
   28         int8_t          wr_antnoise;
   29         uint8_t         wr_antenna;
   30 };
   31 
   32 #define RT2560_RX_RADIOTAP_PRESENT                                      \
   33         ((1 << IEEE80211_RADIOTAP_TSFT) |                               \
   34          (1 << IEEE80211_RADIOTAP_FLAGS) |                              \
   35          (1 << IEEE80211_RADIOTAP_RATE) |                               \
   36          (1 << IEEE80211_RADIOTAP_CHANNEL) |                            \
   37          (1 << IEEE80211_RADIOTAP_ANTENNA) |                            \
   38          (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |                      \
   39          (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE))
   40 
   41 struct rt2560_tx_radiotap_header {
   42         struct ieee80211_radiotap_header wt_ihdr;
   43         uint8_t         wt_flags;
   44         uint8_t         wt_rate;
   45         uint16_t        wt_chan_freq;
   46         uint16_t        wt_chan_flags;
   47         uint8_t         wt_antenna;
   48 };
   49 
   50 #define RT2560_TX_RADIOTAP_PRESENT                                      \
   51         ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \
   52          (1 << IEEE80211_RADIOTAP_RATE) |                               \
   53          (1 << IEEE80211_RADIOTAP_CHANNEL) |                            \
   54          (1 << IEEE80211_RADIOTAP_ANTENNA))
   55 
   56 struct rt2560_tx_data {
   57         bus_dmamap_t                    map;
   58         struct mbuf                     *m;
   59         struct ieee80211_node           *ni;
   60         uint8_t                         rix;
   61         int8_t                          rssi;
   62 };
   63 
   64 struct rt2560_tx_ring {
   65         bus_dma_tag_t           desc_dmat;
   66         bus_dma_tag_t           data_dmat;
   67         bus_dmamap_t            desc_map;
   68         bus_addr_t              physaddr;
   69         struct rt2560_tx_desc   *desc;
   70         struct rt2560_tx_data   *data;
   71         int                     count;
   72         int                     queued;
   73         int                     cur;
   74         int                     next;
   75         int                     cur_encrypt;
   76         int                     next_encrypt;
   77 };
   78 
   79 struct rt2560_rx_data {
   80         bus_dmamap_t    map;
   81         struct mbuf     *m;
   82         int             drop;
   83 };
   84 
   85 struct rt2560_rx_ring {
   86         bus_dma_tag_t           desc_dmat;
   87         bus_dma_tag_t           data_dmat;
   88         bus_dmamap_t            desc_map;
   89         bus_addr_t              physaddr;
   90         struct rt2560_rx_desc   *desc;
   91         struct rt2560_rx_data   *data;
   92         int                     count;
   93         int                     cur;
   94         int                     next;
   95         int                     cur_decrypt;
   96 };
   97 
   98 struct rt2560_node {
   99         struct ieee80211_node   ni;
  100         struct ieee80211_amrr_node amrr;
  101 };
  102 #define RT2560_NODE(ni)         ((struct rt2560_node *)(ni))
  103 
  104 struct rt2560_vap {
  105         struct ieee80211vap     ral_vap;
  106         struct ieee80211_beacon_offsets ral_bo;
  107         struct ieee80211_amrr   amrr;
  108 
  109         int                     (*ral_newstate)(struct ieee80211vap *,
  110                                     enum ieee80211_state, int);
  111 };
  112 #define RT2560_VAP(vap)         ((struct rt2560_vap *)(vap))
  113 
  114 struct rt2560_softc {
  115         struct ifnet            *sc_ifp;
  116         device_t                sc_dev;
  117         bus_space_tag_t         sc_st;
  118         bus_space_handle_t      sc_sh;
  119 
  120         struct mtx              sc_mtx;
  121 
  122         struct callout          watchdog_ch;
  123 
  124         int                     sc_tx_timer;
  125         int                     sc_invalid;
  126         int                     sc_debug;
  127 /*
  128  * The same in both up to here
  129  * ------------------------------------------------
  130  */
  131         uint32_t                asic_rev;
  132         uint32_t                eeprom_rev;
  133         uint8_t                 rf_rev;
  134         uint8_t                 rssi_corr;
  135 
  136         struct rt2560_tx_ring   txq;
  137         struct rt2560_tx_ring   prioq;
  138         struct rt2560_tx_ring   atimq;
  139         struct rt2560_tx_ring   bcnq;
  140         struct rt2560_rx_ring   rxq;
  141 
  142         uint32_t                rf_regs[4];
  143         uint8_t                 txpow[14];
  144 
  145         struct {
  146                 uint8_t reg;
  147                 uint8_t val;
  148         }                       bbp_prom[16];
  149 
  150         int                     led_mode;
  151         int                     hw_radio;
  152         int                     rx_ant;
  153         int                     tx_ant;
  154         int                     nb_ant;
  155 
  156         struct rt2560_rx_radiotap_header sc_rxtap;
  157         int                     sc_rxtap_len;
  158 
  159         struct rt2560_tx_radiotap_header sc_txtap;
  160         int                     sc_txtap_len;
  161 #define RT2560_F_INPUT_RUNNING  0x1
  162 #define RT2560_F_PRIO_OACTIVE   0x2
  163 #define RT2560_F_DATA_OACTIVE   0x4
  164         int                     sc_flags;
  165 };
  166 
  167 int     rt2560_attach(device_t, int);
  168 int     rt2560_detach(void *);
  169 void    rt2560_stop(void *);
  170 void    rt2560_resume(void *);
  171 void    rt2560_intr(void *);
  172 
  173 #define RAL_LOCK(sc)            mtx_lock(&(sc)->sc_mtx)
  174 #define RAL_LOCK_ASSERT(sc)     mtx_assert(&(sc)->sc_mtx, MA_OWNED)
  175 #define RAL_UNLOCK(sc)          mtx_unlock(&(sc)->sc_mtx)

Cache object: d4412828e87acc72999cdd978c2e869d


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.