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/iwn/if_iwnvar.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/iwn/if_iwnvar.h 192468 2009-05-20 20:00:40Z sam $  */
    2 /*-
    3  * Copyright (c) 2007
    4  *      Damien Bergamini <damien.bergamini@free.fr>
    5  * Copyright (c) 2008 Sam Leffler, Errno Consulting
    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 iwn_rx_radiotap_header {
   21         struct ieee80211_radiotap_header wr_ihdr;
   22         uint64_t        wr_tsft;
   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_dbm_antsignal;
   28         int8_t          wr_dbm_antnoise;
   29 } __packed;
   30 
   31 #define IWN_RX_RADIOTAP_PRESENT                                         \
   32         ((1 << IEEE80211_RADIOTAP_TSFT) |                               \
   33          (1 << IEEE80211_RADIOTAP_FLAGS) |                              \
   34          (1 << IEEE80211_RADIOTAP_RATE) |                               \
   35          (1 << IEEE80211_RADIOTAP_CHANNEL) |                            \
   36          (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |                      \
   37          (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE))
   38 
   39 struct iwn_tx_radiotap_header {
   40         struct ieee80211_radiotap_header wt_ihdr;
   41         uint8_t         wt_flags;
   42         uint8_t         wt_rate;
   43         uint16_t        wt_chan_freq;
   44         uint16_t        wt_chan_flags;
   45 } __packed;
   46 
   47 #define IWN_TX_RADIOTAP_PRESENT                                         \
   48         ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \
   49          (1 << IEEE80211_RADIOTAP_RATE) |                               \
   50          (1 << IEEE80211_RADIOTAP_CHANNEL))
   51 
   52 struct iwn_dma_info {
   53         bus_dma_tag_t           tag;
   54         bus_dmamap_t            map;
   55         bus_dma_segment_t       seg;
   56         bus_addr_t              paddr;
   57         caddr_t                 vaddr;
   58         bus_size_t              size;
   59 };
   60 
   61 struct iwn_tx_data {
   62         bus_dmamap_t            map;
   63         struct mbuf             *m;
   64         struct ieee80211_node   *ni;
   65 };
   66 
   67 struct iwn_tx_ring {
   68         struct iwn_dma_info     desc_dma;
   69         struct iwn_dma_info     cmd_dma;
   70         struct iwn_tx_desc      *desc;
   71         struct iwn_tx_cmd       *cmd;
   72         struct iwn_tx_data      data[IWN_TX_RING_COUNT];
   73         bus_dma_tag_t           data_dmat;
   74         int                     qid;
   75         int                     queued;
   76         int                     cur;
   77 };
   78 
   79 struct iwn_rx_data {
   80         bus_dmamap_t            map;
   81         struct mbuf             *m;
   82 };
   83 
   84 struct iwn_rx_ring {
   85         struct iwn_dma_info     desc_dma;
   86         uint32_t                *desc;
   87         struct iwn_rx_data      data[IWN_RX_RING_COUNT];
   88         bus_dma_tag_t           data_dmat;
   89         int                     cur;
   90 };
   91 
   92 struct iwn_node {
   93         struct  ieee80211_node          ni;     /* must be the first */
   94         struct  ieee80211_amrr_node     amn;
   95 };
   96 #define IWN_NODE(_ni)   ((struct iwn_node *)(_ni))
   97 
   98 struct iwn_calib_state {
   99         uint8_t         state;
  100 #define IWN_CALIB_STATE_INIT    0
  101 #define IWN_CALIB_STATE_ASSOC   1
  102 #define IWN_CALIB_STATE_RUN     2
  103         u_int           nbeacons;
  104         uint32_t        noise[3];
  105         uint32_t        rssi[3];
  106         uint32_t        corr_ofdm_x1;
  107         uint32_t        corr_ofdm_mrc_x1;
  108         uint32_t        corr_ofdm_x4;
  109         uint32_t        corr_ofdm_mrc_x4;
  110         uint32_t        corr_cck_x4;
  111         uint32_t        corr_cck_mrc_x4;
  112         uint32_t        bad_plcp_ofdm;
  113         uint32_t        fa_ofdm;
  114         uint32_t        bad_plcp_cck;
  115         uint32_t        fa_cck;
  116         uint32_t        low_fa;
  117         uint8_t         cck_state;
  118 #define IWN_CCK_STATE_INIT      0
  119 #define IWN_CCK_STATE_LOFA      1
  120 #define IWN_CCK_STATE_HIFA      2
  121         uint8_t         noise_samples[20];
  122         u_int           cur_noise_sample;
  123         uint8_t         noise_ref;
  124         uint32_t        energy_samples[10];
  125         u_int           cur_energy_sample;
  126         uint32_t        energy_cck;
  127 };
  128 
  129 struct iwn_vap {
  130         struct ieee80211vap     iv_vap;
  131         struct ieee80211_amrr   iv_amrr;
  132         struct callout          iv_amrr_to;
  133 
  134         int                     (*iv_newstate)(struct ieee80211vap *,
  135                                     enum ieee80211_state, int);
  136 };
  137 #define IWN_VAP(_vap)   ((struct iwn_vap *)(_vap))
  138 
  139 struct iwn_softc {
  140         struct ifnet            *sc_ifp;
  141         int                     sc_debug;
  142         struct callout          sc_timer_to;    /* calib+watchdog timer */
  143         int                     sc_tx_timer;    /* tx watchdog timer/counter */
  144         const struct ieee80211_channel *sc_curchan;
  145 
  146         struct iwn_rx_radiotap_header sc_rxtap;
  147         struct iwn_tx_radiotap_header sc_txtap;
  148 
  149         /* locks */
  150         struct mtx              sc_mtx;
  151 
  152         /* bus */
  153         device_t                sc_dev;
  154         int                     mem_rid;
  155         int                     irq_rid;
  156         struct resource         *mem;
  157         struct resource         *irq;
  158 
  159         /* shared area */
  160         struct iwn_dma_info     shared_dma;
  161         struct iwn_shared       *shared;
  162 
  163         /* "keep warm" page */
  164         struct iwn_dma_info     kw_dma;
  165 
  166         /* firmware image */
  167         const struct firmware   *fw_fp;
  168 
  169         /* firmware DMA transfer */
  170         struct iwn_dma_info     fw_dma;
  171 
  172         /* rings */
  173         struct iwn_tx_ring      txq[IWN_NTXQUEUES];
  174         struct iwn_rx_ring      rxq;
  175 
  176         bus_space_tag_t         sc_st;
  177         bus_space_handle_t      sc_sh;
  178         void                    *sc_ih;
  179         bus_size_t              sc_sz;
  180 
  181         /* Tasks used by the driver */
  182         struct task             sc_reinit_task;
  183         struct task             sc_radioon_task;
  184         struct task             sc_radiooff_task;
  185 
  186         /* Thermal calibration */
  187         int                     calib_cnt;
  188         struct iwn_calib_state  calib;
  189 
  190         struct iwn_rx_stat      last_rx_stat;
  191         int                     last_rx_valid;
  192         struct iwn_ucode_info   ucode_info;
  193         struct iwn_config       config;
  194         uint32_t                rawtemp;
  195         int                     temp;
  196         int                     noise;
  197         uint8_t                 antmsk;
  198 
  199         struct iwn_eeprom_band  bands[IWN_NBANDS];
  200         int16_t                 eeprom_voltage;
  201         int8_t                  maxpwr2GHz;
  202         int8_t                  maxpwr5GHz;
  203 };
  204 
  205 #define IWN_LOCK_INIT(_sc) \
  206         mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->sc_dev), \
  207              MTX_NETWORK_LOCK, MTX_DEF)
  208 #define IWN_LOCK(_sc)                   mtx_lock(&(_sc)->sc_mtx)
  209 #define IWN_LOCK_ASSERT(_sc)            mtx_assert(&(_sc)->sc_mtx, MA_OWNED)
  210 #define IWN_UNLOCK(_sc)                 mtx_unlock(&(_sc)->sc_mtx)
  211 #define IWN_LOCK_DESTROY(_sc)           mtx_destroy(&(_sc)->sc_mtx)

Cache object: f353adcb2b779fc6ffe352f52b4c7575


[ 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.