Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
main.h File Reference
#include <linux/etherdevice.h>
#include <brcmu_utils.h>
#include "types.h"
#include "d11.h"
#include "scb.h"

Go to the source code of this file.

Data Structures

struct  brcms_protection
 
struct  brcms_stf
 
struct  brcms_core
 
struct  brcms_band
 
struct  modulecb
 
struct  brcms_hw_band
 
struct  brcms_hardware
 
struct  brcms_txq_info
 
struct  brcms_c_info
 
struct  antsel_info
 
struct  brcms_bss_cfg
 

Macros

#define INVCHANNEL   255 /* invalid channel */
 
#define BRCMS_MAXMODULES   22
 
#define SEQNUM_SHIFT   4
 
#define SEQNUM_MAX   0x1000
 
#define NTXRATE   64 /* # tx MPDUs rate is reported for */
 
#define BRCMS_MAX_MAC_SUSPEND   83000
 
#define BRCMS_PRB_RESP_TIMEOUT   0 /* Disable probe response timeout */
 
#define TXOFF   (D11_TXH_LEN + D11_PHY_HDR_LEN)
 
#define BITFIELD_MASK(width)   (((unsigned)1 << (width)) - 1)
 
#define GFIELD(val, field)   (((val) >> field ## _S) & field ## _M)
 
#define SFIELD(val, field, bits)
 
#define SW_TIMER_MAC_STAT_UPD   30 /* periodic MAC stats update */
 
#define MAXCOREREV   28
 
#define BRCMS_SHORTSLOT_AUTO   -1 /* Driver will manage Shortslot setting */
 
#define BRCMS_SHORTSLOT_OFF   0 /* Turn off short slot */
 
#define BRCMS_SHORTSLOT_ON   1 /* Turn on short slot */
 
#define BRCMS_LONG_PREAMBLE   (0)
 
#define BRCMS_SHORT_PREAMBLE   (1 << 0)
 
#define BRCMS_GF_PREAMBLE   (1 << 1)
 
#define BRCMS_MM_PREAMBLE   (1 << 2)
 
#define BRCMS_IS_MIMO_PREAMBLE(_pre)
 
#define TXFID_QUEUE_MASK   0x0007 /* Bits 0-2 */
 
#define TXFID_SEQ_MASK   0x7FE0 /* Bits 5-15 */
 
#define TXFID_SEQ_SHIFT   5 /* Number of bit shifts */
 
#define TXFID_RATE_PROBE_MASK   0x8000 /* Bit 15 for rate probe */
 
#define TXFID_RATE_MASK   0x0018 /* Mask for bits 3 and 4 */
 
#define TXFID_RATE_SHIFT   3 /* Shift 3 bits for rate mask */
 
#define BOARDREV_PROMOTABLE   0xFF /* from */
 
#define BOARDREV_PROMOTED   1 /* to */
 
#define DATA_BLOCK_TX_SUPR   (1 << 4)
 
#define BRCMS_WAKE_OVERRIDE_CLKCTL   0x01
 
#define BRCMS_WAKE_OVERRIDE_PHYREG   0x02
 
#define BRCMS_WAKE_OVERRIDE_MACSUSPEND   0x04
 
#define BRCMS_WAKE_OVERRIDE_TXFIFO   0x08
 
#define BRCMS_WAKE_OVERRIDE_FORCEFAST   0x10
 
#define I_ERRORS   (I_PC | I_PD | I_DE | I_RO | I_XU)
 
#define DEF_RXINTMASK   (I_RI) /* enable rx int on rxfifo only */
 
#define DEF_MACINTMASK
 
#define MAXTXPKTS   6 /* max # pkts pending */
 
#define MAXTXFRAMEBURST   8 /* vanilla xpress mode: max frames/burst */
 
#define MAXFRAMEBURST_TXOP   10000 /* Frameburst TXOP in usec */
 
#define NFIFO   6 /* # tx/rx fifopairs */
 
#define BRCMS_PLLREQ_SHARED   0x1
 
#define BRCMS_PLLREQ_RADIO_MON   0x2
 
#define BRCMS_PLLREQ_FLIP   0x4
 
#define CHANNEL_BANDUNIT(wlc, ch)   (((ch) <= CH_MAX_2G_CHANNEL) ? BAND_2G_INDEX : BAND_5G_INDEX)
 
#define OTHERBANDUNIT(wlc)   ((uint)((wlc)->band->bandunit ? BAND_2G_INDEX : BAND_5G_INDEX))
 
#define BRCMS_STF_SS_STBC_TX(wlc, scb)
 
#define BRCMS_STBC_CAP_PHY(wlc)
 
#define BRCMS_SGI_CAP_PHY(wlc)
 
#define BRCMS_CHAN_PHYTYPE(x)
 
#define BRCMS_CHAN_CHANNEL(x)
 

Functions

void brcms_c_txfifo (struct brcms_c_info *wlc, uint fifo, struct sk_buff *p, bool commit, s8 txpktpend)
 
void brcms_c_txfifo_complete (struct brcms_c_info *wlc, uint fifo, s8 txpktpend)
 
void brcms_c_txq_enq (struct brcms_c_info *wlc, struct scb *scb, struct sk_buff *sdu, uint prec)
 
void brcms_c_print_txstatus (struct tx_status *txs)
 
int brcms_b_xmtfifo_sz_get (struct brcms_hardware *wlc_hw, uint fifo, uint *blocks)
 
int brcms_c_set_gmode (struct brcms_c_info *wlc, u8 gmode, bool config)
 
void brcms_c_mac_promisc (struct brcms_c_info *wlc, uint filter_flags)
 
void brcms_c_send_q (struct brcms_c_info *wlc)
 
int brcms_c_prep_pdu (struct brcms_c_info *wlc, struct sk_buff *pdu, uint *fifo)
 
u16 brcms_c_calc_lsig_len (struct brcms_c_info *wlc, u32 ratespec, uint mac_len)
 
u32 brcms_c_rspec_to_rts_rspec (struct brcms_c_info *wlc, u32 rspec, bool use_rspec, u16 mimo_ctlchbw)
 
u16 brcms_c_compute_rtscts_dur (struct brcms_c_info *wlc, bool cts_only, u32 rts_rate, u32 frame_rate, u8 rts_preamble_type, u8 frame_preamble_type, uint frame_len, bool ba)
 
void brcms_c_inval_dma_pkts (struct brcms_hardware *hw, struct ieee80211_sta *sta, void(*dma_callback_fn))
 
void brcms_c_update_beacon (struct brcms_c_info *wlc)
 
void brcms_c_update_probe_resp (struct brcms_c_info *wlc, bool suspend)
 
int brcms_c_set_nmode (struct brcms_c_info *wlc)
 
void brcms_c_beacon_phytxctl_txant_upd (struct brcms_c_info *wlc, u32 bcn_rate)
 
void brcms_b_antsel_type_set (struct brcms_hardware *wlc_hw, u8 antsel_type)
 
void brcms_b_set_chanspec (struct brcms_hardware *wlc_hw, u16 chanspec, bool mute, struct txpwr_limits *txpwr)
 
void brcms_b_write_shm (struct brcms_hardware *wlc_hw, uint offset, u16 v)
 
u16 brcms_b_read_shm (struct brcms_hardware *wlc_hw, uint offset)
 
void brcms_b_mhf (struct brcms_hardware *wlc_hw, u8 idx, u16 mask, u16 val, int bands)
 
void brcms_b_corereset (struct brcms_hardware *wlc_hw, u32 flags)
 
void brcms_b_mctrl (struct brcms_hardware *wlc_hw, u32 mask, u32 val)
 
void brcms_b_phy_reset (struct brcms_hardware *wlc_hw)
 
void brcms_b_bw_set (struct brcms_hardware *wlc_hw, u16 bw)
 
void brcms_b_core_phypll_reset (struct brcms_hardware *wlc_hw)
 
void brcms_c_ucode_wake_override_set (struct brcms_hardware *wlc_hw, u32 override_bit)
 
void brcms_c_ucode_wake_override_clear (struct brcms_hardware *wlc_hw, u32 override_bit)
 
void brcms_b_write_template_ram (struct brcms_hardware *wlc_hw, int offset, int len, void *buf)
 
u16 brcms_b_rate_shm_offset (struct brcms_hardware *wlc_hw, u8 rate)
 
void brcms_b_copyto_objmem (struct brcms_hardware *wlc_hw, uint offset, const void *buf, int len, u32 sel)
 
void brcms_b_copyfrom_objmem (struct brcms_hardware *wlc_hw, uint offset, void *buf, int len, u32 sel)
 
void brcms_b_switch_macfreq (struct brcms_hardware *wlc_hw, u8 spurmode)
 
u16 brcms_b_get_txant (struct brcms_hardware *wlc_hw)
 
void brcms_b_phyclk_fgc (struct brcms_hardware *wlc_hw, bool clk)
 
void brcms_b_macphyclk_set (struct brcms_hardware *wlc_hw, bool clk)
 
void brcms_b_core_phypll_ctl (struct brcms_hardware *wlc_hw, bool on)
 
void brcms_b_txant_set (struct brcms_hardware *wlc_hw, u16 phytxant)
 
void brcms_b_band_stf_ss_set (struct brcms_hardware *wlc_hw, u8 stf_mode)
 
void brcms_c_init_scb (struct scb *scb)
 

Variables

const u8 prio2fifo []
 

Macro Definition Documentation

#define BITFIELD_MASK (   width)    (((unsigned)1 << (width)) - 1)

Definition at line 57 of file main.h.

#define BOARDREV_PROMOTABLE   0xFF /* from */

Definition at line 99 of file main.h.

#define BOARDREV_PROMOTED   1 /* to */

Definition at line 100 of file main.h.

#define BRCMS_CHAN_CHANNEL (   x)
Value:

Definition at line 234 of file main.h.

#define BRCMS_CHAN_PHYTYPE (   x)
Value:

Definition at line 232 of file main.h.

#define BRCMS_GF_PREAMBLE   (1 << 1)

Definition at line 83 of file main.h.

#define BRCMS_IS_MIMO_PREAMBLE (   _pre)
Value:
(((_pre) == BRCMS_GF_PREAMBLE) || \
((_pre) == BRCMS_MM_PREAMBLE))

Definition at line 85 of file main.h.

#define BRCMS_LONG_PREAMBLE   (0)

Definition at line 81 of file main.h.

#define BRCMS_MAX_MAC_SUSPEND   83000

Definition at line 39 of file main.h.

#define BRCMS_MAXMODULES   22

Definition at line 30 of file main.h.

#define BRCMS_MM_PREAMBLE   (1 << 2)

Definition at line 84 of file main.h.

#define BRCMS_PLLREQ_FLIP   0x4

Definition at line 142 of file main.h.

#define BRCMS_PLLREQ_RADIO_MON   0x2

Definition at line 140 of file main.h.

#define BRCMS_PLLREQ_SHARED   0x1

Definition at line 138 of file main.h.

#define BRCMS_PRB_RESP_TIMEOUT   0 /* Disable probe response timeout */

Definition at line 42 of file main.h.

#define BRCMS_SGI_CAP_PHY (   wlc)
Value:
((BRCMS_ISNPHY(wlc->band) && \
NREV_GE(wlc->band->phyrev, 3)) || \
BRCMS_ISLCNPHY(wlc->band))

Definition at line 228 of file main.h.

#define BRCMS_SHORT_PREAMBLE   (1 << 0)

Definition at line 82 of file main.h.

#define BRCMS_SHORTSLOT_AUTO   -1 /* Driver will manage Shortslot setting */

Definition at line 76 of file main.h.

#define BRCMS_SHORTSLOT_OFF   0 /* Turn off short slot */

Definition at line 77 of file main.h.

#define BRCMS_SHORTSLOT_ON   1 /* Turn on short slot */

Definition at line 78 of file main.h.

#define BRCMS_STBC_CAP_PHY (   wlc)
Value:
(BRCMS_ISNPHY(wlc->band) && \
NREV_GE(wlc->band->phyrev, 3))

Definition at line 225 of file main.h.

#define BRCMS_STF_SS_STBC_TX (   wlc,
  scb 
)
Value:
(((wlc)->stf->txstreams > 1) && (((wlc)->band->band_stf_stbc_tx == ON) \
|| (((scb)->flags & SCB_STBCCAP) && \
(wlc)->band->band_stf_stbc_tx == AUTO && \
isset(&((wlc)->stf->ss_algo_channel), PHY_TXC1_MODE_STBC))))

Definition at line 219 of file main.h.

#define BRCMS_WAKE_OVERRIDE_CLKCTL   0x01

Definition at line 108 of file main.h.

#define BRCMS_WAKE_OVERRIDE_FORCEFAST   0x10

Definition at line 112 of file main.h.

#define BRCMS_WAKE_OVERRIDE_MACSUSPEND   0x04

Definition at line 110 of file main.h.

#define BRCMS_WAKE_OVERRIDE_PHYREG   0x02

Definition at line 109 of file main.h.

#define BRCMS_WAKE_OVERRIDE_TXFIFO   0x08

Definition at line 111 of file main.h.

#define CHANNEL_BANDUNIT (   wlc,
  ch 
)    (((ch) <= CH_MAX_2G_CHANNEL) ? BAND_2G_INDEX : BAND_5G_INDEX)

Definition at line 144 of file main.h.

#define DATA_BLOCK_TX_SUPR   (1 << 4)

Definition at line 102 of file main.h.

#define DEF_MACINTMASK
Value:

Definition at line 123 of file main.h.

#define DEF_RXINTMASK   (I_RI) /* enable rx int on rxfifo only */

Definition at line 122 of file main.h.

#define GFIELD (   val,
  field 
)    (((val) >> field ## _S) & field ## _M)

Definition at line 59 of file main.h.

#define I_ERRORS   (I_PC | I_PD | I_DE | I_RO | I_XU)

Definition at line 120 of file main.h.

#define INVCHANNEL   255 /* invalid channel */

Definition at line 27 of file main.h.

#define MAXCOREREV   28

Definition at line 68 of file main.h.

#define MAXFRAMEBURST_TXOP   10000 /* Frameburst TXOP in usec */

Definition at line 131 of file main.h.

#define MAXTXFRAMEBURST   8 /* vanilla xpress mode: max frames/burst */

Definition at line 130 of file main.h.

#define MAXTXPKTS   6 /* max # pkts pending */

Definition at line 127 of file main.h.

#define NFIFO   6 /* # tx/rx fifopairs */

Definition at line 133 of file main.h.

#define NTXRATE   64 /* # tx MPDUs rate is reported for */

Definition at line 35 of file main.h.

#define OTHERBANDUNIT (   wlc)    ((uint)((wlc)->band->bandunit ? BAND_2G_INDEX : BAND_5G_INDEX))

Definition at line 147 of file main.h.

#define SEQNUM_MAX   0x1000

Definition at line 33 of file main.h.

#define SEQNUM_SHIFT   4

Definition at line 32 of file main.h.

#define SFIELD (   val,
  field,
  bits 
)
Value:
(((val) & (~(field ## _M << field ## _S))) | \
((unsigned)(bits) << field ## _S))

Definition at line 61 of file main.h.

#define SW_TIMER_MAC_STAT_UPD   30 /* periodic MAC stats update */

Definition at line 65 of file main.h.

#define TXFID_QUEUE_MASK   0x0007 /* Bits 0-2 */

Definition at line 91 of file main.h.

#define TXFID_RATE_MASK   0x0018 /* Mask for bits 3 and 4 */

Definition at line 95 of file main.h.

#define TXFID_RATE_PROBE_MASK   0x8000 /* Bit 15 for rate probe */

Definition at line 94 of file main.h.

#define TXFID_RATE_SHIFT   3 /* Shift 3 bits for rate mask */

Definition at line 96 of file main.h.

#define TXFID_SEQ_MASK   0x7FE0 /* Bits 5-15 */

Definition at line 92 of file main.h.

#define TXFID_SEQ_SHIFT   5 /* Number of bit shifts */

Definition at line 93 of file main.h.

#define TXOFF   (D11_TXH_LEN + D11_PHY_HDR_LEN)

Definition at line 45 of file main.h.

Function Documentation

void brcms_b_antsel_type_set ( struct brcms_hardware wlc_hw,
u8  antsel_type 
)

Definition at line 2299 of file main.c.

void brcms_b_band_stf_ss_set ( struct brcms_hardware wlc_hw,
u8  stf_mode 
)

Definition at line 2729 of file main.c.

void brcms_b_bw_set ( struct brcms_hardware wlc_hw,
u16  bw 
)

Definition at line 1578 of file main.c.

void brcms_b_copyfrom_objmem ( struct brcms_hardware wlc_hw,
uint  offset,
void buf,
int  len,
u32  sel 
)

Definition at line 2975 of file main.c.

void brcms_b_copyto_objmem ( struct brcms_hardware wlc_hw,
uint  offset,
const void buf,
int  len,
u32  sel 
)

Definition at line 2952 of file main.c.

void brcms_b_core_phypll_ctl ( struct brcms_hardware wlc_hw,
bool  on 
)

Definition at line 2800 of file main.c.

void brcms_b_core_phypll_reset ( struct brcms_hardware wlc_hw)

Definition at line 1737 of file main.c.

void brcms_b_corereset ( struct brcms_hardware wlc_hw,
u32  flags 
)

Definition at line 2000 of file main.c.

u16 brcms_b_get_txant ( struct brcms_hardware wlc_hw)

Definition at line 2294 of file main.c.

void brcms_b_macphyclk_set ( struct brcms_hardware wlc_hw,
bool  clk 
)

Definition at line 1771 of file main.c.

void brcms_b_mctrl ( struct brcms_hardware wlc_hw,
u32  mask,
u32  val 
)

Definition at line 1411 of file main.c.

void brcms_b_mhf ( struct brcms_hardware wlc_hw,
u8  idx,
u16  mask,
u16  val,
int  bands 
)

Definition at line 1323 of file main.c.

void brcms_b_phy_reset ( struct brcms_hardware wlc_hw)

Definition at line 1779 of file main.c.

void brcms_b_phyclk_fgc ( struct brcms_hardware wlc_hw,
bool  clk 
)

Definition at line 1758 of file main.c.

u16 brcms_b_rate_shm_offset ( struct brcms_hardware wlc_hw,
u8  rate 
)

Definition at line 6013 of file main.c.

u16 brcms_b_read_shm ( struct brcms_hardware wlc_hw,
uint  offset 
)

Definition at line 2931 of file main.c.

void brcms_b_set_chanspec ( struct brcms_hardware wlc_hw,
u16  chanspec,
bool  mute,
struct txpwr_limits txpwr 
)

Definition at line 3879 of file main.c.

void brcms_b_switch_macfreq ( struct brcms_hardware wlc_hw,
u8  spurmode 
)

Definition at line 2141 of file main.c.

void brcms_b_txant_set ( struct brcms_hardware wlc_hw,
u16  phytxant 
)

Definition at line 2282 of file main.c.

void brcms_b_write_shm ( struct brcms_hardware wlc_hw,
uint  offset,
u16  v 
)

Definition at line 2940 of file main.c.

void brcms_b_write_template_ram ( struct brcms_hardware wlc_hw,
int  offset,
int  len,
void buf 
)

Definition at line 1522 of file main.c.

int brcms_b_xmtfifo_sz_get ( struct brcms_hardware wlc_hw,
uint  fifo,
uint blocks 
)

Definition at line 7915 of file main.c.

void brcms_c_beacon_phytxctl_txant_upd ( struct brcms_c_info wlc,
u32  bcn_rate 
)

Definition at line 3998 of file main.c.

u16 brcms_c_calc_lsig_len ( struct brcms_c_info wlc,
u32  ratespec,
uint  mac_len 
)

Definition at line 7647 of file main.c.

u16 brcms_c_compute_rtscts_dur ( struct brcms_c_info wlc,
bool  cts_only,
u32  rts_rate,
u32  frame_rate,
u8  rts_preamble_type,
u8  frame_preamble_type,
uint  frame_len,
bool  ba 
)

Definition at line 6540 of file main.c.

void brcms_c_init_scb ( struct scb scb)

Definition at line 3159 of file main.c.

void brcms_c_inval_dma_pkts ( struct brcms_hardware hw,
struct ieee80211_sta sta,
void dma_callback_fn 
)

Definition at line 7959 of file main.c.

void brcms_c_mac_promisc ( struct brcms_c_info wlc,
uint  filter_flags 
)

Definition at line 3575 of file main.c.

int brcms_c_prep_pdu ( struct brcms_c_info wlc,
struct sk_buff pdu,
uint fifo 
)

Definition at line 7887 of file main.c.

void brcms_c_print_txstatus ( struct tx_status txs)

Definition at line 5748 of file main.c.

u32 brcms_c_rspec_to_rts_rspec ( struct brcms_c_info wlc,
u32  rspec,
bool  use_rspec,
u16  mimo_ctlchbw 
)

Definition at line 7380 of file main.c.

void brcms_c_send_q ( struct brcms_c_info wlc)

Definition at line 7297 of file main.c.

int brcms_c_set_gmode ( struct brcms_c_info wlc,
u8  gmode,
bool  config 
)

Definition at line 5373 of file main.c.

int brcms_c_set_nmode ( struct brcms_c_info wlc)

Definition at line 5474 of file main.c.

void brcms_c_txfifo ( struct brcms_c_info wlc,
uint  fifo,
struct sk_buff p,
bool  commit,
s8  txpktpend 
)

Definition at line 7342 of file main.c.

void brcms_c_txfifo_complete ( struct brcms_c_info wlc,
uint  fifo,
s8  txpktpend 
)

Definition at line 7427 of file main.c.

void brcms_c_txq_enq ( struct brcms_c_info wlc,
struct scb scb,
struct sk_buff sdu,
uint  prec 
)

Definition at line 6098 of file main.c.

void brcms_c_ucode_wake_override_clear ( struct brcms_hardware wlc_hw,
u32  override_bit 
)

Definition at line 1446 of file main.c.

void brcms_c_ucode_wake_override_set ( struct brcms_hardware wlc_hw,
u32  override_bit 
)

Definition at line 1432 of file main.c.

void brcms_c_update_beacon ( struct brcms_c_info wlc)

Definition at line 7809 of file main.c.

void brcms_c_update_probe_resp ( struct brcms_c_info wlc,
bool  suspend 
)

Definition at line 7877 of file main.c.

Variable Documentation

const u8 prio2fifo[]

Definition at line 286 of file main.c.