FreeBSD kernel MWL device code
mwlhal.c File Reference
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysctl.h>
#include <sys/malloc.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/kernel.h>
#include <sys/errno.h>
#include <sys/bus.h>
#include <sys/endian.h>
#include <sys/linker.h>
#include <sys/firmware.h>
#include <machine/bus.h>
#include <dev/mwl/mwlhal.h>
#include <dev/mwl/mwlreg.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <net/if.h>
#include <dev/mwl/mwldiag.h>
Include dependency graph for mwlhal.c:

Go to the source code of this file.

Data Structures

struct  mwl_hal_bastream
 
struct  mwl_hal_vap
 
struct  mwl_hal_priv
 

Macros

#define MWLHAL_DEBUG   /* debug msgs */
 
#define MWL_CMDBUF_SIZE   0x4000 /* size of f/w command buffer */
 
#define MWL_BASTREAMS_MAX   7 /* max BA streams (NB: fw >3.3.5.9) */
 
#define MWL_BAQID_MAX   8 /* max BA Q id's (NB: fw >3.3.5.9) */
 
#define MWL_MBSS_AP_MAX   8 /* max ap vap's */
 
#define MWL_MBSS_STA_MAX   24 /* max station/client vap's */
 
#define MWL_MBSS_MAX   (MWL_MBSS_AP_MAX+MWL_MBSS_STA_MAX)
 
#define IEEE80211_ADDR_LEN   6 /* XXX */
 
#define IEEE80211_ADDR_COPY(_dst, _src)    memcpy(_dst, _src, IEEE80211_ADDR_LEN)
 
#define IEEE80211_ADDR_EQ(_dst, _src)    (memcmp(_dst, _src, IEEE80211_ADDR_LEN) == 0)
 
#define _CMD_SETUP(pCmd, type, cmd)
 
#define _VCMD_SETUP(vap, pCmd, type, cmd)
 
#define PWTAGETRATETABLE20M   14*4
 
#define PWTAGETRATETABLE40M   9*4
 
#define PWTAGETRATETABLE20M_5G   35*4
 
#define PWTAGETRATETABLE40M_5G   16*4
 
#define MVF_RUNNING   0x01 /* BSS_START issued */
 
#define MVF_STATION   0x02 /* sta db entry created */
 
#define MWLVAP(_vap)   ((_vap)->mh)
 
#define MHF_CALDATA   0x0001 /* cal data retrieved */
 
#define MHF_FWHANG   0x0002 /* fw appears hung */
 
#define MHF_MBSS   0x0004 /* mbss enabled */
 
#define MWLPRIV(_mh)   ((struct mwl_hal_priv *)(_mh))
 
#define RATEVAL(r)   ((r) &~ RATE_MCS)
 
#define RATETYPE(r)   (((r) & RATE_MCS) ? HT_RATE_TYPE : LEGACY_RATE_TYPE)
 
#define __DECONST(type, var)   ((type)(uintptr_t)(const void *)(var))
 
#define MAX_WAIT_FW_COMPLETE_ITERATIONS   10000
 
#define FW_DOWNLOAD_BLOCK_SIZE   256
 
#define FW_CHECK_USECS   (5*1000) /* 5ms */
 
#define FW_MAX_NUM_CHECKS   200
 
#define CMD(x)   case HostCmd_CMD_##x: return #x
 

Enumerations

enum  wlantennamode_e { WL_ANTENNAMODE_RX = 0xffff , WL_ANTENNAMODE_TX = 2 }
 
enum  wltxpowerlevel_e { WL_TX_POWERLEVEL_LOW = 5 , WL_TX_POWERLEVEL_MEDIUM = 10 , WL_TX_POWERLEVEL_HIGH = 15 }
 

Functions

static int mwl_hal_setmac_locked (struct mwl_hal_vap *, const uint8_t addr[IEEE80211_ADDR_LEN])
 
static int mwlExecuteCmd (struct mwl_hal_priv *, unsigned short cmd)
 
static int mwlGetPwrCalTable (struct mwl_hal_priv *)
 
static const char * mwlcmdname (int cmd)
 
static void dumpresult (struct mwl_hal_priv *, int showresult)
 
 SYSCTL_DECL (_hw_mwl)
 
static SYSCTL_NODE (_hw_mwl, OID_AUTO, hal, CTLFLAG_RD|CTLFLAG_MPSAFE, 0, "Marvell HAL parameters")
 
static __inline void MWL_HAL_LOCK (struct mwl_hal_priv *mh)
 
static __inline void MWL_HAL_LOCK_ASSERT (struct mwl_hal_priv *mh)
 
static __inline void MWL_HAL_UNLOCK (struct mwl_hal_priv *mh)
 
static __inline uint32_t RD4 (struct mwl_hal_priv *mh, bus_size_t off)
 
static __inline void WR4 (struct mwl_hal_priv *mh, bus_size_t off, uint32_t val)
 
static void mwl_hal_load_cb (void *arg, bus_dma_segment_t *segs, int nsegs, int error)
 
struct mwl_halmwl_hal_attach (device_t dev, uint16_t devid, bus_space_handle_t ioh, bus_space_tag_t iot, bus_dma_tag_t tag)
 
void mwl_hal_detach (struct mwl_hal *mh0)
 
static int mwlResetHalState (struct mwl_hal_priv *mh)
 
struct mwl_hal_vapmwl_hal_newvap (struct mwl_hal *mh0, MWL_HAL_BSSTYPE type, const uint8_t mac[IEEE80211_ADDR_LEN])
 
void mwl_hal_delvap (struct mwl_hal_vap *vap)
 
void mwl_hal_setdebug (struct mwl_hal *mh, int debug)
 
int mwl_hal_getdebug (struct mwl_hal *mh)
 
void mwl_hal_setbastreams (struct mwl_hal *mh, int mask)
 
int mwl_hal_getbastreams (struct mwl_hal *mh)
 
int mwl_hal_ismbsscapable (struct mwl_hal *mh)
 
void mwl_hal_intrset (struct mwl_hal *mh0, uint32_t mask)
 
void mwl_hal_cmddone (struct mwl_hal *mh0)
 
int mwl_hal_gethwspecs (struct mwl_hal *mh0, struct mwl_hal_hwspec *hw)
 
int mwl_hal_sethwdma (struct mwl_hal *mh0, const struct mwl_hal_txrxdma *dma)
 
int mwl_hal_gethwstats (struct mwl_hal *mh0, struct mwl_hal_hwstats *stats)
 
int mwl_hal_sethtgi (struct mwl_hal_vap *vap, int GIType)
 
int mwl_hal_setradio (struct mwl_hal *mh0, int onoff, MWL_HAL_PREAMBLE preamble)
 
int mwl_hal_setantenna (struct mwl_hal *mh0, MWL_HAL_ANTENNA dirSet, int ant)
 
int mwl_hal_setrtsthreshold (struct mwl_hal_vap *vap, int threshold)
 
int mwl_hal_setinframode (struct mwl_hal_vap *vap)
 
int mwl_hal_setradardetection (struct mwl_hal *mh0, MWL_HAL_RADAR action)
 
static uint32_t cvtChannelFlags (const MWL_HAL_CHANNEL *chan)
 
int mwl_hal_setchannelswitchie (struct mwl_hal *mh0, const MWL_HAL_CHANNEL *nextchan, uint32_t mode, uint32_t count)
 
int mwl_hal_setregioncode (struct mwl_hal *mh0, int regionCode)
 
int mwl_hal_settxrate (struct mwl_hal_vap *vap, MWL_HAL_TXRATE_HANDLING handling, const MWL_HAL_TXRATE *rate)
 
int mwl_hal_settxrate_auto (struct mwl_hal *mh0, const MWL_HAL_TXRATE *rate)
 
int mwl_hal_setslottime (struct mwl_hal *mh0, int usecs)
 
int mwl_hal_adjusttxpower (struct mwl_hal *mh0, uint32_t level)
 
static const struct mwl_hal_channel * findchannel (const struct mwl_hal_priv *mh, const MWL_HAL_CHANNEL *c)
 
int mwl_hal_settxpower (struct mwl_hal *mh0, const MWL_HAL_CHANNEL *c, uint8_t maxtxpow)
 
int mwl_hal_getchannelinfo (struct mwl_hal *mh0, int band, int chw, const MWL_HAL_CHANNELINFO **ci)
 
int mwl_hal_setmcast (struct mwl_hal *mh0, int nmc, const uint8_t macs[])
 
int mwl_hal_keyset (struct mwl_hal_vap *vap, const MWL_HAL_KEYVAL *kv, const uint8_t mac[IEEE80211_ADDR_LEN])
 
int mwl_hal_keyreset (struct mwl_hal_vap *vap, const MWL_HAL_KEYVAL *kv, const uint8_t mac[IEEE80211_ADDR_LEN])
 
int mwl_hal_setmac (struct mwl_hal_vap *vap, const uint8_t addr[IEEE80211_ADDR_LEN])
 
int mwl_hal_setbeacon (struct mwl_hal_vap *vap, const void *frame, size_t frameLen)
 
int mwl_hal_setpowersave_bss (struct mwl_hal_vap *vap, uint8_t nsta)
 
int mwl_hal_setpowersave_sta (struct mwl_hal_vap *vap, uint16_t aid, int ena)
 
int mwl_hal_setassocid (struct mwl_hal_vap *vap, const uint8_t bssId[IEEE80211_ADDR_LEN], uint16_t assocId)
 
int mwl_hal_setchannel (struct mwl_hal *mh0, const MWL_HAL_CHANNEL *chan)
 
static int bastream_check_available (struct mwl_hal_vap *vap, int qid, const uint8_t Macaddr[IEEE80211_ADDR_LEN], uint8_t Tid, uint8_t ParamInfo)
 
const MWL_HAL_BASTREAMmwl_hal_bastream_alloc (struct mwl_hal_vap *vap, int ba_policy, const uint8_t Macaddr[IEEE80211_ADDR_LEN], uint8_t Tid, uint8_t ParamInfo, void *a1, void *a2)
 
const MWL_HAL_BASTREAMmwl_hal_bastream_lookup (struct mwl_hal *mh0, int s)
 
int mwl_hal_bastream_create (struct mwl_hal_vap *vap, const MWL_HAL_BASTREAM *s, int BarThrs, int WindowSize, uint16_t seqno)
 
int mwl_hal_bastream_destroy (struct mwl_hal *mh0, const MWL_HAL_BASTREAM *s)
 
int mwl_hal_bastream_get_seqno (struct mwl_hal *mh0, const MWL_HAL_BASTREAM *s, const uint8_t Macaddr[IEEE80211_ADDR_LEN], uint16_t *pseqno)
 
int mwl_hal_getwatchdogbitmap (struct mwl_hal *mh0, uint8_t bitmap[1])
 
int mwl_hal_setaggampduratemode (struct mwl_hal *mh0, int mode, int threshold)
 
int mwl_hal_getaggampduratemode (struct mwl_hal *mh0, int *mode, int *threshold)
 
int mwl_hal_setcfend (struct mwl_hal *mh0, int ena)
 
int mwl_hal_setdwds (struct mwl_hal *mh0, int ena)
 
static void cvtPeerInfo (PeerInfo_t *to, const MWL_HAL_PEERINFO *from)
 
int mwl_hal_newstation (struct mwl_hal_vap *vap, const uint8_t addr[IEEE80211_ADDR_LEN], uint16_t aid, uint16_t sid, const MWL_HAL_PEERINFO *peer, int isQosSta, int wmeInfo)
 
int mwl_hal_delstation (struct mwl_hal_vap *vap, const uint8_t addr[IEEE80211_ADDR_LEN])
 
int mwl_hal_setkeepalive (struct mwl_hal *mh0)
 
int mwl_hal_setapmode (struct mwl_hal_vap *vap, MWL_HAL_APMODE ApMode)
 
int mwl_hal_stop (struct mwl_hal_vap *vap)
 
int mwl_hal_start (struct mwl_hal_vap *vap)
 
int mwl_hal_setgprot (struct mwl_hal *mh0, int prot)
 
int mwl_hal_setwmm (struct mwl_hal *mh0, int onoff)
 
int mwl_hal_setedcaparams (struct mwl_hal *mh0, uint8_t qnum, uint32_t CWmin, uint32_t CWmax, uint8_t AIFSN, uint16_t TXOPLimit)
 
int mwl_hal_setrateadaptmode (struct mwl_hal *mh0, uint16_t mode)
 
int mwl_hal_setcsmode (struct mwl_hal *mh0, MWL_HAL_CSMODE csmode)
 
int mwl_hal_setnprot (struct mwl_hal_vap *vap, MWL_HAL_HTPROTECT mode)
 
int mwl_hal_setnprotmode (struct mwl_hal_vap *vap, uint8_t mode)
 
int mwl_hal_setoptimizationlevel (struct mwl_hal *mh0, int level)
 
int mwl_hal_setmimops (struct mwl_hal *mh0, const uint8_t addr[IEEE80211_ADDR_LEN], uint8_t enable, uint8_t mode)
 
static int mwlGetCalTable (struct mwl_hal_priv *mh, uint8_t annex, uint8_t index)
 
static void setmaxtxpow (struct mwl_hal_channel *hc, int i, int maxix)
 
static void get5Ghz (MWL_HAL_CHANNELINFO *ci, const uint8_t table[], int len)
 
static uint16_t ieee2mhz (int chan)
 
static void get2Ghz (MWL_HAL_CHANNELINFO *ci, const uint8_t table[], int len)
 
int mwl_hal_getregioncode (struct mwl_hal *mh0, uint8_t *countryCode)
 
int mwl_hal_setpromisc (struct mwl_hal *mh0, int ena)
 
int mwl_hal_getpromisc (struct mwl_hal *mh0)
 
int mwl_hal_GetBeacon (struct mwl_hal *mh0, uint8_t *pBcn, uint16_t *pLen)
 
int mwl_hal_SetRifs (struct mwl_hal *mh0, uint8_t QNum)
 
static int getRFReg (struct mwl_hal_priv *mh, int flag, uint32_t reg, uint32_t *val)
 
static int getBBReg (struct mwl_hal_priv *mh, int flag, uint32_t reg, uint32_t *val)
 
static u_int mwl_hal_getregdump (struct mwl_hal_priv *mh, const MWL_DIAG_REGRANGE *regs, void *dstbuf, int space)
 
int mwl_hal_getdiagstate (struct mwl_hal *mh0, int request, const void *args, uint32_t argsize, void **result, uint32_t *resultsize)
 
static void mwlSendCmd (struct mwl_hal_priv *mh)
 
static int mwlWaitForCmdComplete (struct mwl_hal_priv *mh, uint16_t cmdCode)
 
static void mwlFwReset (struct mwl_hal_priv *mh)
 
static void mwlTriggerPciCmd (struct mwl_hal_priv *mh)
 
static int mwlWaitFor (struct mwl_hal_priv *mh, uint32_t val)
 
static int mwlSendBlock (struct mwl_hal_priv *mh, int bsize, const void *data, size_t dsize)
 
static int mwlSendBlock2 (struct mwl_hal_priv *mh, const void *data, size_t dsize)
 
static void mwlPokeSdramController (struct mwl_hal_priv *mh, int SDRAMSIZE_Addr)
 
int mwl_hal_fwload (struct mwl_hal *mh0, void *fwargs)
 

Variables

static const int ba2qid [MWL_BASTREAMS_MAX]
 
static int qid2ba [MWL_BAQID_MAX]
 

Macro Definition Documentation

◆ __DECONST

#define __DECONST (   type,
  var 
)    ((type)(uintptr_t)(const void *)(var))

Definition at line 1461 of file mwlhal.c.

◆ _CMD_SETUP

#define _CMD_SETUP (   pCmd,
  type,
  cmd 
)
Value:
do { \
pCmd = (type *)&mh->mh_cmdbuf[0]; \
memset(pCmd, 0, sizeof(type)); \
pCmd->CmdHdr.Cmd = htole16(cmd); \
pCmd->CmdHdr.Length = htole16(sizeof(type)); \
} while (0)

Definition at line 99 of file mwlhal.c.

◆ _VCMD_SETUP

#define _VCMD_SETUP (   vap,
  pCmd,
  type,
  cmd 
)
Value:
do { \
_CMD_SETUP(pCmd, type, cmd); \
pCmd->CmdHdr.MacId = vap->macid; \
} while (0)

Definition at line 106 of file mwlhal.c.

◆ CMD

#define CMD (   x)    case HostCmd_CMD_##x: return #x

◆ FW_CHECK_USECS

#define FW_CHECK_USECS   (5*1000) /* 5ms */

Definition at line 2425 of file mwlhal.c.

◆ FW_DOWNLOAD_BLOCK_SIZE

#define FW_DOWNLOAD_BLOCK_SIZE   256

Definition at line 2424 of file mwlhal.c.

◆ FW_MAX_NUM_CHECKS

#define FW_MAX_NUM_CHECKS   200

Definition at line 2426 of file mwlhal.c.

◆ IEEE80211_ADDR_COPY

#define IEEE80211_ADDR_COPY (   _dst,
  _src 
)     memcpy(_dst, _src, IEEE80211_ADDR_LEN)

Definition at line 94 of file mwlhal.c.

◆ IEEE80211_ADDR_EQ

#define IEEE80211_ADDR_EQ (   _dst,
  _src 
)     (memcmp(_dst, _src, IEEE80211_ADDR_LEN) == 0)

Definition at line 96 of file mwlhal.c.

◆ IEEE80211_ADDR_LEN

#define IEEE80211_ADDR_LEN   6 /* XXX */

Definition at line 93 of file mwlhal.c.

◆ MAX_WAIT_FW_COMPLETE_ITERATIONS

#define MAX_WAIT_FW_COMPLETE_ITERATIONS   10000

◆ MHF_CALDATA

#define MHF_CALDATA   0x0001 /* cal data retrieved */

Definition at line 164 of file mwlhal.c.

◆ MHF_FWHANG

#define MHF_FWHANG   0x0002 /* fw appears hung */

Definition at line 165 of file mwlhal.c.

◆ MHF_MBSS

#define MHF_MBSS   0x0004 /* mbss enabled */

Definition at line 166 of file mwlhal.c.

◆ MVF_RUNNING

#define MVF_RUNNING   0x01 /* BSS_START issued */

Definition at line 134 of file mwlhal.c.

◆ MVF_STATION

#define MVF_STATION   0x02 /* sta db entry created */

Definition at line 135 of file mwlhal.c.

◆ MWL_BAQID_MAX

#define MWL_BAQID_MAX   8 /* max BA Q id's (NB: fw >3.3.5.9) */

Definition at line 74 of file mwlhal.c.

◆ MWL_BASTREAMS_MAX

#define MWL_BASTREAMS_MAX   7 /* max BA streams (NB: fw >3.3.5.9) */

Definition at line 73 of file mwlhal.c.

◆ MWL_CMDBUF_SIZE

#define MWL_CMDBUF_SIZE   0x4000 /* size of f/w command buffer */

Definition at line 72 of file mwlhal.c.

◆ MWL_MBSS_AP_MAX

#define MWL_MBSS_AP_MAX   8 /* max ap vap's */

Definition at line 75 of file mwlhal.c.

◆ MWL_MBSS_MAX

#define MWL_MBSS_MAX   (MWL_MBSS_AP_MAX+MWL_MBSS_STA_MAX)

Definition at line 77 of file mwlhal.c.

◆ MWL_MBSS_STA_MAX

#define MWL_MBSS_STA_MAX   24 /* max station/client vap's */

Definition at line 76 of file mwlhal.c.

◆ MWLHAL_DEBUG

#define MWLHAL_DEBUG   /* debug msgs */

Definition at line 59 of file mwlhal.c.

◆ MWLPRIV

#define MWLPRIV (   _mh)    ((struct mwl_hal_priv *)(_mh))

Definition at line 183 of file mwlhal.c.

◆ MWLVAP

#define MWLVAP (   _vap)    ((_vap)->mh)

Definition at line 138 of file mwlhal.c.

◆ PWTAGETRATETABLE20M

#define PWTAGETRATETABLE20M   14*4

Definition at line 111 of file mwlhal.c.

◆ PWTAGETRATETABLE20M_5G

#define PWTAGETRATETABLE20M_5G   35*4

Definition at line 113 of file mwlhal.c.

◆ PWTAGETRATETABLE40M

#define PWTAGETRATETABLE40M   9*4

Definition at line 112 of file mwlhal.c.

◆ PWTAGETRATETABLE40M_5G

#define PWTAGETRATETABLE40M_5G   16*4

Definition at line 114 of file mwlhal.c.

◆ RATETYPE

#define RATETYPE (   r)    (((r) & RATE_MCS) ? HT_RATE_TYPE : LEGACY_RATE_TYPE)

Definition at line 937 of file mwlhal.c.

◆ RATEVAL

#define RATEVAL (   r)    ((r) &~ RATE_MCS)

Definition at line 936 of file mwlhal.c.

Enumeration Type Documentation

◆ wlantennamode_e

Enumerator
WL_ANTENNAMODE_RX 
WL_ANTENNAMODE_TX 

Definition at line 61 of file mwlhal.c.

◆ wltxpowerlevel_e

Enumerator
WL_TX_POWERLEVEL_LOW 
WL_TX_POWERLEVEL_MEDIUM 
WL_TX_POWERLEVEL_HIGH 

Definition at line 66 of file mwlhal.c.

Function Documentation

◆ bastream_check_available()

static int bastream_check_available ( struct mwl_hal_vap vap,
int  qid,
const uint8_t  Macaddr[IEEE80211_ADDR_LEN],
uint8_t  Tid,
uint8_t  ParamInfo 
)
static

Definition at line 1372 of file mwlhal.c.

References _VCMD_SETUP, BaCheckCreateStream, BASTREAM_FLAG_DIRECTION_UPSTREAM, BASTREAM_FLAG_IMMEDIATE_TYPE, HostCmd_CMD_BASTREAM, HostCmd_RESULT_OK, IEEE80211_ADDR_COPY, MWL_HAL_LOCK_ASSERT(), mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_hal_bastream_alloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cvtChannelFlags()

◆ cvtPeerInfo()

static void cvtPeerInfo ( PeerInfo_t *  to,
const MWL_HAL_PEERINFO *  from 
)
static

Definition at line 1670 of file mwlhal.c.

Referenced by mwl_hal_newstation().

Here is the caller graph for this function:

◆ dumpresult()

static void dumpresult ( struct mwl_hal_priv mh,
int  showresult 
)
static

Definition at line 2746 of file mwlhal.c.

References HostCmd_RESULT_PARTIAL_DATA, mwl_hal_priv::mh_cmdbuf, mwl_hal_priv::mh_dev, and mwlcmdname().

Referenced by mwl_hal_cmddone(), and mwlExecuteCmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findchannel()

◆ get2Ghz()

static void get2Ghz ( MWL_HAL_CHANNELINFO ci,
const uint8_t  table[],
int  len 
)
static

Definition at line 2068 of file mwlhal.c.

References MWL_HAL_CHANNELINFO::channels, MWL_HAL_CHANNELINFO::freqHigh, MWL_HAL_CHANNELINFO::freqLow, MWL_HAL_CHANNELINFO::mwl_hal_channel::ieee, ieee2mhz(), MWL_HAL_CHANNELINFO::nchannels, and setmaxtxpow().

Referenced by mwlGetPwrCalTable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get5Ghz()

static void get5Ghz ( MWL_HAL_CHANNELINFO ci,
const uint8_t  table[],
int  len 
)
static

Definition at line 2025 of file mwlhal.c.

References MWL_HAL_CHANNELINFO::channels, MWL_HAL_CHANNELINFO::mwl_hal_channel::freq, MWL_HAL_CHANNELINFO::freqHigh, MWL_HAL_CHANNELINFO::freqLow, MWL_HAL_CHANNELINFO::nchannels, and setmaxtxpow().

Referenced by mwlGetPwrCalTable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBBReg()

static int getBBReg ( struct mwl_hal_priv mh,
int  flag,
uint32_t  reg,
uint32_t *  val 
)
static

Definition at line 2254 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_BBP_REG_ACCESS, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), and mwlExecuteCmd().

Referenced by mwl_hal_getregdump().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRFReg()

static int getRFReg ( struct mwl_hal_priv mh,
int  flag,
uint32_t  reg,
uint32_t *  val 
)
static

Definition at line 2235 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_RF_REG_ACCESS, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), and mwlExecuteCmd().

Referenced by mwl_hal_getregdump().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ieee2mhz()

static uint16_t ieee2mhz ( int  chan)
static

Definition at line 2055 of file mwlhal.c.

Referenced by get2Ghz().

Here is the caller graph for this function:

◆ mwl_hal_adjusttxpower()

int mwl_hal_adjusttxpower ( struct mwl_hal mh0,
uint32_t  level 
)

◆ mwl_hal_attach()

◆ mwl_hal_bastream_alloc()

const MWL_HAL_BASTREAM * mwl_hal_bastream_alloc ( struct mwl_hal_vap vap,
int  ba_policy,
const uint8_t  Macaddr[IEEE80211_ADDR_LEN],
uint8_t  Tid,
uint8_t  ParamInfo,
void *  a1,
void *  a2 
)

◆ mwl_hal_bastream_create()

int mwl_hal_bastream_create ( struct mwl_hal_vap vap,
const MWL_HAL_BASTREAM s,
int  BarThrs,
int  WindowSize,
uint16_t  seqno 
)

◆ mwl_hal_bastream_destroy()

int mwl_hal_bastream_destroy ( struct mwl_hal mh0,
const MWL_HAL_BASTREAM s 
)

◆ mwl_hal_bastream_get_seqno()

int mwl_hal_bastream_get_seqno ( struct mwl_hal mh0,
const MWL_HAL_BASTREAM s,
const uint8_t  Macaddr[IEEE80211_ADDR_LEN],
uint16_t *  pseqno 
)

Definition at line 1550 of file mwlhal.c.

References __DECONST, _CMD_SETUP, HostCmd_CMD_GET_SEQNO, IEEE80211_ADDR_COPY, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), MWLPRIV, and mwl_hal_bastream::tid.

Referenced by mwl_addba_request().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_bastream_lookup()

const MWL_HAL_BASTREAM * mwl_hal_bastream_lookup ( struct mwl_hal mh0,
int  s 
)

Definition at line 1449 of file mwlhal.c.

References mwl_hal_priv::mh_bastreams, mwl_hal_priv::mh_streams, MWL_BASTREAMS_MAX, MWLPRIV, and mwl_hal_bastream::public.

Referenced by mwl_bawatchdog_proc().

Here is the caller graph for this function:

◆ mwl_hal_cmddone()

void mwl_hal_cmddone ( struct mwl_hal mh0)

Definition at line 541 of file mwlhal.c.

References dumpresult(), mwl_hal_priv::mh_debug, mwl_hal_priv::mh_dev, MWL_HAL_DEBUG_CMDDONE, and MWLPRIV.

Referenced by mwl_intr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_delstation()

int mwl_hal_delstation ( struct mwl_hal_vap vap,
const uint8_t  addr[IEEE80211_ADDR_LEN] 
)

Definition at line 1714 of file mwlhal.c.

References _VCMD_SETUP, mwl_hal_vap::flags, HostCmd_CMD_SET_NEW_STN, IEEE80211_ADDR_COPY, IEEE80211_ADDR_EQ, mwl_hal_vap::mac, MVF_STATION, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_node_cleanup(), and mwl_vap_delete().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_delvap()

void mwl_hal_delvap ( struct mwl_hal_vap vap)

Definition at line 433 of file mwlhal.c.

References mwl_hal_vap::mh.

Referenced by mwl_vap_delete().

Here is the caller graph for this function:

◆ mwl_hal_detach()

void mwl_hal_detach ( struct mwl_hal mh0)

Definition at line 371 of file mwlhal.c.

References mwl_hal_priv::mh_cmdbuf, mwl_hal_priv::mh_dmamap, mwl_hal_priv::mh_dmat, mwl_hal_priv::mh_mtx, and MWLPRIV.

Referenced by mwl_attach(), and mwl_detach().

Here is the caller graph for this function:

◆ mwl_hal_fwload()

◆ mwl_hal_getaggampduratemode()

int mwl_hal_getaggampduratemode ( struct mwl_hal mh0,
int *  mode,
int *  threshold 
)

Definition at line 1616 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_AMPDU_RETRY_RATEDROP_MODE, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Here is the call graph for this function:

◆ mwl_hal_getbastreams()

int mwl_hal_getbastreams ( struct mwl_hal mh)

Definition at line 464 of file mwlhal.c.

References mwl_hal_vap::mh, and MWLPRIV.

◆ mwl_hal_GetBeacon()

int mwl_hal_GetBeacon ( struct mwl_hal mh0,
uint8_t *  pBcn,
uint16_t *  pLen 
)

Definition at line 2194 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_GET_BEACON, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Here is the call graph for this function:

◆ mwl_hal_getchannelinfo()

int mwl_hal_getchannelinfo ( struct mwl_hal mh0,
int  band,
int  chw,
const MWL_HAL_CHANNELINFO **  ci 
)

◆ mwl_hal_getdebug()

int mwl_hal_getdebug ( struct mwl_hal mh)

Definition at line 452 of file mwlhal.c.

References mwl_hal_vap::mh, and MWLPRIV.

◆ mwl_hal_getdiagstate()

int mwl_hal_getdiagstate ( struct mwl_hal mh0,
int  request,
const void *  args,
uint32_t  argsize,
void **  result,
uint32_t *  resultsize 
)

◆ mwl_hal_gethwspecs()

◆ mwl_hal_gethwstats()

◆ mwl_hal_getpromisc()

int mwl_hal_getpromisc ( struct mwl_hal mh0)

Definition at line 2182 of file mwlhal.c.

References MACREG_REG_PROMISCUOUS, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), MWLPRIV, and RD4().

Here is the call graph for this function:

◆ mwl_hal_getregdump()

static u_int mwl_hal_getregdump ( struct mwl_hal_priv mh,
const MWL_DIAG_REGRANGE regs,
void *  dstbuf,
int  space 
)
static

Definition at line 2273 of file mwlhal.c.

References MWL_DIAG_REGRANGE::end, getBBReg(), getRFReg(), HostCmd_ACT_GEN_READ, MACREG_REG_FW_PRESENT, MWL_DIAG_BASE_BB, MWL_DIAG_BASE_RF, MWL_DIAG_ISBB, MWL_DIAG_ISMAC, MWL_DIAG_ISRF, RD4(), and MWL_DIAG_REGRANGE::start.

Referenced by mwl_hal_getdiagstate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_getregioncode()

int mwl_hal_getregioncode ( struct mwl_hal mh0,
uint8_t *  countryCode 
)

Definition at line 2152 of file mwlhal.c.

References mwl_hal_priv::mh_cmdbuf, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlGetCalTable(), and MWLPRIV.

Here is the call graph for this function:

◆ mwl_hal_getwatchdogbitmap()

int mwl_hal_getwatchdogbitmap ( struct mwl_hal mh0,
uint8_t  bitmap[1] 
)

Definition at line 1572 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_GET_WATCHDOG_BITMAP, MWL_BAQID_MAX, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), MWLPRIV, and qid2ba.

Referenced by mwl_bawatchdog_proc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_intrset()

void mwl_hal_intrset ( struct mwl_hal mh0,
uint32_t  mask 
)

Definition at line 505 of file mwlhal.c.

References MACREG_REG_A2H_INTERRUPT_MASK, MACREG_REG_INT_CODE, mwl_hal::mh_imask, MWLPRIV, mwl_hal_priv::public, RD4(), and WR4().

Referenced by mwl_chan_set(), mwl_ext_free(), mwl_init(), mwl_reset(), mwl_rx_proc(), and mwl_vap_delete().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_ismbsscapable()

int mwl_hal_ismbsscapable ( struct mwl_hal mh)

Definition at line 470 of file mwlhal.c.

References mwl_hal_vap::mh, MHF_MBSS, and MWLPRIV.

Referenced by assign_address(), and mwl_announce().

Here is the caller graph for this function:

◆ mwl_hal_keyreset()

int mwl_hal_keyreset ( struct mwl_hal_vap vap,
const MWL_HAL_KEYVAL *  kv,
const uint8_t  mac[IEEE80211_ADDR_LEN] 
)

Definition at line 1229 of file mwlhal.c.

References _VCMD_SETUP, EncrActionTypeRemoveKey, HostCmd_CMD_UPDATE_ENCRYPTION, IEEE80211_ADDR_COPY, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_key_delete().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_keyset()

int mwl_hal_keyset ( struct mwl_hal_vap vap,
const MWL_HAL_KEYVAL *  kv,
const uint8_t  mac[IEEE80211_ADDR_LEN] 
)

◆ mwl_hal_load_cb()

static void mwl_hal_load_cb ( void *  arg,
bus_dma_segment_t *  segs,
int  nsegs,
int  error 
)
static

Definition at line 229 of file mwlhal.c.

Referenced by mwl_hal_attach().

Here is the caller graph for this function:

◆ MWL_HAL_LOCK()

static __inline void MWL_HAL_LOCK ( struct mwl_hal_priv mh)
static

◆ MWL_HAL_LOCK_ASSERT()

static __inline void MWL_HAL_LOCK_ASSERT ( struct mwl_hal_priv mh)
static

Definition at line 205 of file mwlhal.c.

References mwl_hal_priv::mh_mtx.

Referenced by bastream_check_available(), mwlExecuteCmd(), and mwlGetCalTable().

Here is the caller graph for this function:

◆ mwl_hal_newstation()

int mwl_hal_newstation ( struct mwl_hal_vap vap,
const uint8_t  addr[IEEE80211_ADDR_LEN],
uint16_t  aid,
uint16_t  sid,
const MWL_HAL_PEERINFO *  peer,
int  isQosSta,
int  wmeInfo 
)

Definition at line 1685 of file mwlhal.c.

References _VCMD_SETUP, cvtPeerInfo(), mwl_hal_vap::flags, HostCmd_CMD_SET_NEW_STN, IEEE80211_ADDR_COPY, IEEE80211_ADDR_EQ, mwl_hal_vap::mac, MVF_STATION, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_localstadb(), and mwl_peerstadb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_newvap()

struct mwl_hal_vap * mwl_hal_newvap ( struct mwl_hal mh0,
MWL_HAL_BSSTYPE  type,
const uint8_t  mac[IEEE80211_ADDR_LEN] 
)

Definition at line 411 of file mwlhal.c.

References mwl_hal_vap::mac, mwl_hal_vap::mh, mwl_hal_priv::mh_vaps, MWL_HAL_LOCK(), mwl_hal_setmac_locked(), MWL_HAL_UNLOCK(), MWL_MBSS_MAX, MWLPRIV, and mwl_hal_vap::vap_type.

Referenced by mwl_vap_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setaggampduratemode()

int mwl_hal_setaggampduratemode ( struct mwl_hal mh0,
int  mode,
int  threshold 
)

Definition at line 1597 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_AMPDU_RETRY_RATEDROP_MODE, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_hal_reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setantenna()

int mwl_hal_setantenna ( struct mwl_hal mh0,
MWL_HAL_ANTENNA  dirSet,
int  ant 
)

Definition at line 750 of file mwlhal.c.

References _CMD_SETUP, _HostCmd_DS_802_11_RF_ANTENNA::Action, _HostCmd_DS_802_11_RF_ANTENNA::AntennaMode, HostCmd_CMD_802_11_RF_ANTENNA, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), MWLPRIV, WL_ANTENNATYPE_RX, and WL_ANTENNATYPE_TX.

Referenced by mwl_hal_reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setapmode()

int mwl_hal_setapmode ( struct mwl_hal_vap vap,
MWL_HAL_APMODE  ApMode 
)

Definition at line 1763 of file mwlhal.c.

References _VCMD_SETUP, HostCmd_CMD_SET_APMODE, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_setapmode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setassocid()

int mwl_hal_setassocid ( struct mwl_hal_vap vap,
const uint8_t  bssId[IEEE80211_ADDR_LEN],
uint16_t  assocId 
)

Definition at line 1336 of file mwlhal.c.

References _VCMD_SETUP, HostCmd_CMD_SET_AID, IEEE80211_ADDR_COPY, mwl_hal_priv::mh_cmdbuf, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_newstate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setbastreams()

void mwl_hal_setbastreams ( struct mwl_hal mh,
int  mask 
)

Definition at line 458 of file mwlhal.c.

References mwl_hal_vap::mh, MWL_BASTREAMS_MAX, and MWLPRIV.

◆ mwl_hal_setbeacon()

int mwl_hal_setbeacon ( struct mwl_hal_vap vap,
const void *  frame,
size_t  frameLen 
)

Definition at line 1282 of file mwlhal.c.

References _VCMD_SETUP, HostCmd_CMD_SET_BEACON, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_beacon_setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setcfend()

int mwl_hal_setcfend ( struct mwl_hal mh0,
int  ena 
)

Definition at line 1638 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_CFEND_ENABLE, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_hal_reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setchannel()

int mwl_hal_setchannel ( struct mwl_hal mh0,
const MWL_HAL_CHANNEL chan 
)

Definition at line 1354 of file mwlhal.c.

References _CMD_SETUP, MWL_HAL_CHANNEL::channel, cvtChannelFlags(), HostCmd_ACT_GEN_SET, HostCmd_CMD_SET_RF_CHANNEL, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_chan_set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setchannelswitchie()

int mwl_hal_setchannelswitchie ( struct mwl_hal mh0,
const MWL_HAL_CHANNEL nextchan,
uint32_t  mode,
uint32_t  count 
)

Definition at line 886 of file mwlhal.c.

References _CMD_SETUP, MWL_HAL_CHANNEL::channel, cvtChannelFlags(), HostCmd_CMD_SET_SWITCH_CHANNEL, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_startcsa().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setcsmode()

int mwl_hal_setcsmode ( struct mwl_hal mh0,
MWL_HAL_CSMODE  csmode 
)

Definition at line 1901 of file mwlhal.c.

References _CMD_SETUP, HostCmd_ACT_GEN_SET, HostCmd_CMD_SET_LINKADAPT_CS_MODE, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_newstate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setdebug()

void mwl_hal_setdebug ( struct mwl_hal mh,
int  debug 
)

Definition at line 446 of file mwlhal.c.

References mwl_hal_vap::mh, and MWLPRIV.

◆ mwl_hal_setdwds()

int mwl_hal_setdwds ( struct mwl_hal mh0,
int  ena 
)

Definition at line 1655 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_DWDS_ENABLE, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_newstate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setedcaparams()

int mwl_hal_setedcaparams ( struct mwl_hal mh0,
uint8_t  qnum,
uint32_t  CWmin,
uint32_t  CWmax,
uint8_t  AIFSN,
uint16_t  TXOPLimit 
)

Definition at line 1854 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_SET_EDCA_PARAMS, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_txq_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setgprot()

int mwl_hal_setgprot ( struct mwl_hal mh0,
int  prot 
)

Definition at line 1820 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_SET_G_PROTECT_FLAG, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_updateslot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_sethtgi()

int mwl_hal_sethtgi ( struct mwl_hal_vap vap,
int  GIType 
)

Definition at line 692 of file mwlhal.c.

References _VCMD_SETUP, GI_TYPE_LONG, GI_TYPE_SHORT, HostCmd_ACT_GEN_SET, HostCmd_CMD_HT_GUARD_INTERVAL, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_reset_vap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_sethwdma()

◆ mwl_hal_setinframode()

int mwl_hal_setinframode ( struct mwl_hal_vap vap)

Definition at line 799 of file mwlhal.c.

References _VCMD_SETUP, HostCmd_CMD_SET_INFRA_MODE, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_newstate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setkeepalive()

int mwl_hal_setkeepalive ( struct mwl_hal mh0)

Definition at line 1742 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_SET_KEEP_ALIVE, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_agestations(), and mwl_watchdog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setmac()

int mwl_hal_setmac ( struct mwl_hal_vap vap,
const uint8_t  addr[IEEE80211_ADDR_LEN] 
)

Definition at line 1270 of file mwlhal.c.

References MWL_HAL_LOCK(), mwl_hal_setmac_locked(), MWL_HAL_UNLOCK(), and MWLVAP.

Here is the call graph for this function:

◆ mwl_hal_setmac_locked()

static int mwl_hal_setmac_locked ( struct mwl_hal_vap vap,
const uint8_t  addr[IEEE80211_ADDR_LEN] 
)
static

Definition at line 1254 of file mwlhal.c.

References _VCMD_SETUP, mwl_hal_vap::bss_type, HostCmd_CMD_SET_MAC_ADDR, IEEE80211_ADDR_COPY, mwl_hal_vap::mac, mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_hal_newvap(), and mwl_hal_setmac().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setmcast()

int mwl_hal_setmcast ( struct mwl_hal mh0,
int  nmc,
const uint8_t  macs[] 
)

Definition at line 1157 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_MAC_MULTICAST_ADR, IEEE80211_ADDR_LEN, MWL_HAL_LOCK(), MWL_HAL_MCAST_MAX, MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_setmcastfilter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setmimops()

int mwl_hal_setmimops ( struct mwl_hal mh0,
const uint8_t  addr[IEEE80211_ADDR_LEN],
uint8_t  enable,
uint8_t  mode 
)

Definition at line 1971 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_SET_MIMOPSHT, IEEE80211_ADDR_COPY, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_recv_action().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setnprot()

int mwl_hal_setnprot ( struct mwl_hal_vap vap,
MWL_HAL_HTPROTECT  mode 
)

Definition at line 1919 of file mwlhal.c.

References _VCMD_SETUP, HostCmd_CMD_SET_N_PROTECT_FLAG, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_reset_vap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setnprotmode()

int mwl_hal_setnprotmode ( struct mwl_hal_vap vap,
uint8_t  mode 
)

Definition at line 1937 of file mwlhal.c.

References _VCMD_SETUP, HostCmd_CMD_SET_N_PROTECT_OPMODE, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_beacon_update(), and mwl_reset_vap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setoptimizationlevel()

int mwl_hal_setoptimizationlevel ( struct mwl_hal mh0,
int  level 
)

Definition at line 1954 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_SET_OPTIMIZATION_LEVEL, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_hal_reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setpowersave_bss()

int mwl_hal_setpowersave_bss ( struct mwl_hal_vap vap,
uint8_t  nsta 
)

Definition at line 1302 of file mwlhal.c.

References _VCMD_SETUP, HostCmd_CMD_SET_POWERSAVESTATION, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Here is the call graph for this function:

◆ mwl_hal_setpowersave_sta()

int mwl_hal_setpowersave_sta ( struct mwl_hal_vap vap,
uint16_t  aid,
int  ena 
)

Definition at line 1319 of file mwlhal.c.

References _VCMD_SETUP, HostCmd_CMD_SET_TIM, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Here is the call graph for this function:

◆ mwl_hal_setpromisc()

int mwl_hal_setpromisc ( struct mwl_hal mh0,
int  ena 
)

Definition at line 2169 of file mwlhal.c.

References MACREG_REG_PROMISCUOUS, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), MWLPRIV, RD4(), and WR4().

Referenced by mwl_mode_init(), and mwl_update_promisc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setradardetection()

int mwl_hal_setradardetection ( struct mwl_hal mh0,
MWL_HAL_RADAR  action 
)

Definition at line 818 of file mwlhal.c.

References _CMD_SETUP, DOMAIN_CODE_ETSI_131, HostCmd_CMD_802_11H_DETECT_RADAR, mwl_hal_priv::mh_regioncode, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_newstate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setradio()

int mwl_hal_setradio ( struct mwl_hal mh0,
int  onoff,
MWL_HAL_PREAMBLE  preamble 
)

Definition at line 722 of file mwlhal.c.

References _CMD_SETUP, HostCmd_ACT_GEN_SET, HostCmd_CMD_802_11_RADIO_CONTROL, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_hal_reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setrateadaptmode()

int mwl_hal_setrateadaptmode ( struct mwl_hal mh0,
uint16_t  mode 
)

Definition at line 1883 of file mwlhal.c.

References _CMD_SETUP, HostCmd_ACT_GEN_SET, HostCmd_CMD_SET_RATE_ADAPT_MODE, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_hal_reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setregioncode()

int mwl_hal_setregioncode ( struct mwl_hal mh0,
int  regionCode 
)

Definition at line 910 of file mwlhal.c.

References _CMD_SETUP, DOMAIN_CODE_ETSI, DOMAIN_CODE_ETSI_131, HostCmd_CMD_SET_REGION_CODE, mwl_hal_priv::mh_regioncode, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_hal_reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_SetRifs()

int mwl_hal_SetRifs ( struct mwl_hal mh0,
uint8_t  QNum 
)

Definition at line 2215 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_SET_RIFS, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Here is the call graph for this function:

◆ mwl_hal_setrtsthreshold()

int mwl_hal_setrtsthreshold ( struct mwl_hal_vap vap,
int  threshold 
)

Definition at line 778 of file mwlhal.c.

References _VCMD_SETUP, HostCmd_ACT_GEN_SET, HostCmd_CMD_802_11_RTS_THSD, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_newstate(), and mwl_reset_vap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setslottime()

int mwl_hal_setslottime ( struct mwl_hal mh0,
int  usecs 
)

Definition at line 1020 of file mwlhal.c.

References _CMD_SETUP, HostCmd_ACT_GEN_SET, HostCmd_CMD_802_11_SET_SLOT, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Here is the call graph for this function:

◆ mwl_hal_settxpower()

int mwl_hal_settxpower ( struct mwl_hal mh0,
const MWL_HAL_CHANNEL c,
uint8_t  maxtxpow 
)

◆ mwl_hal_settxrate()

◆ mwl_hal_settxrate_auto()

int mwl_hal_settxrate_auto ( struct mwl_hal mh0,
const MWL_HAL_TXRATE rate 
)

Definition at line 994 of file mwlhal.c.

References _CMD_SETUP, HostCmd_ACT_NOT_USE_FIXED_RATE, HostCmd_CMD_SET_FIXED_RATE, MWL_HAL_TXRATE::McastRate, MWL_HAL_TXRATE::MgtRate, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), MWLPRIV, RATETYPE, and RATEVAL.

Referenced by mwl_setcurchanrates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_setwmm()

int mwl_hal_setwmm ( struct mwl_hal mh0,
int  onoff 
)

Definition at line 1837 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_SET_WMM_MODE, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLPRIV.

Referenced by mwl_hal_reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_start()

int mwl_hal_start ( struct mwl_hal_vap vap)

Definition at line 1802 of file mwlhal.c.

References _VCMD_SETUP, mwl_hal_vap::flags, HostCmd_ACT_GEN_ON, HostCmd_CMD_BSS_START, MVF_RUNNING, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_newstate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwl_hal_stop()

int mwl_hal_stop ( struct mwl_hal_vap vap)

Definition at line 1781 of file mwlhal.c.

References _VCMD_SETUP, mwl_hal_vap::flags, HostCmd_ACT_GEN_OFF, HostCmd_CMD_BSS_START, MVF_RUNNING, MWL_HAL_LOCK(), MWL_HAL_UNLOCK(), mwlExecuteCmd(), and MWLVAP.

Referenced by mwl_newstate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MWL_HAL_UNLOCK()

static __inline void MWL_HAL_UNLOCK ( struct mwl_hal_priv mh)
static

◆ mwlcmdname()

static const char * mwlcmdname ( int  cmd)
static

Definition at line 2686 of file mwlhal.c.

References CMD.

Referenced by dumpresult(), and mwlExecuteCmd().

Here is the caller graph for this function:

◆ mwlExecuteCmd()

static int mwlExecuteCmd ( struct mwl_hal_priv mh,
unsigned short  cmd 
)
static

Definition at line 2375 of file mwlhal.c.

References dumpresult(), MACREG_REG_INT_CODE, mwl_hal_priv::mh_debug, mwl_hal_priv::mh_dev, mwl_hal_priv::mh_dmamap, mwl_hal_priv::mh_dmat, mwl_hal_priv::mh_flags, MHF_FWHANG, MWL_HAL_DEBUG_CMDDONE, MWL_HAL_DEBUG_IGNHANG, MWL_HAL_DEBUG_SENDCMD, MWL_HAL_LOCK_ASSERT(), mwlcmdname(), mwlSendCmd(), mwlWaitForCmdComplete(), and RD4().

Referenced by bastream_check_available(), getBBReg(), getRFReg(), mwl_hal_adjusttxpower(), mwl_hal_bastream_create(), mwl_hal_bastream_destroy(), mwl_hal_bastream_get_seqno(), mwl_hal_delstation(), mwl_hal_getaggampduratemode(), mwl_hal_GetBeacon(), mwl_hal_getdiagstate(), mwl_hal_gethwspecs(), mwl_hal_gethwstats(), mwl_hal_getwatchdogbitmap(), mwl_hal_keyreset(), mwl_hal_keyset(), mwl_hal_newstation(), mwl_hal_setaggampduratemode(), mwl_hal_setantenna(), mwl_hal_setapmode(), mwl_hal_setassocid(), mwl_hal_setbeacon(), mwl_hal_setcfend(), mwl_hal_setchannel(), mwl_hal_setchannelswitchie(), mwl_hal_setcsmode(), mwl_hal_setdwds(), mwl_hal_setedcaparams(), mwl_hal_setgprot(), mwl_hal_sethtgi(), mwl_hal_sethwdma(), mwl_hal_setinframode(), mwl_hal_setkeepalive(), mwl_hal_setmac_locked(), mwl_hal_setmcast(), mwl_hal_setmimops(), mwl_hal_setnprot(), mwl_hal_setnprotmode(), mwl_hal_setoptimizationlevel(), mwl_hal_setpowersave_bss(), mwl_hal_setpowersave_sta(), mwl_hal_setradardetection(), mwl_hal_setradio(), mwl_hal_setrateadaptmode(), mwl_hal_setregioncode(), mwl_hal_SetRifs(), mwl_hal_setrtsthreshold(), mwl_hal_setslottime(), mwl_hal_settxpower(), mwl_hal_settxrate(), mwl_hal_settxrate_auto(), mwl_hal_setwmm(), mwl_hal_start(), mwl_hal_stop(), and mwlGetCalTable().

Here is the call graph for this function:

◆ mwlFwReset()

static void mwlFwReset ( struct mwl_hal_priv mh)
static

Definition at line 2435 of file mwlhal.c.

References ISR_RESET, MACREG_REG_H2A_INTERRUPT_EVENTS, MACREG_REG_INT_CODE, mwl_hal_priv::mh_dev, mwl_hal_priv::mh_flags, RD4(), and WR4().

Referenced by mwl_hal_fwload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwlGetCalTable()

static int mwlGetCalTable ( struct mwl_hal_priv mh,
uint8_t  annex,
uint8_t  index 
)
static

Definition at line 1990 of file mwlhal.c.

References _CMD_SETUP, HostCmd_CMD_GET_CALTABLE, MWL_HAL_LOCK_ASSERT(), and mwlExecuteCmd().

Referenced by mwl_hal_getregioncode(), and mwlGetPwrCalTable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwlGetPwrCalTable()

static int mwlGetPwrCalTable ( struct mwl_hal_priv mh)
static

◆ mwlPokeSdramController()

static void mwlPokeSdramController ( struct mwl_hal_priv mh,
int  SDRAMSIZE_Addr 
)
static

Set up sdram controller for superflyv2

Definition at line 2516 of file mwlhal.c.

References WR4().

Referenced by mwl_hal_fwload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwlResetHalState()

static int mwlResetHalState ( struct mwl_hal_priv mh)
static

◆ mwlSendBlock()

static int mwlSendBlock ( struct mwl_hal_priv mh,
int  bsize,
const void *  data,
size_t  dsize 
)
static

Definition at line 2480 of file mwlhal.c.

References HostCmd_CMD_CODE_DNLD, MACREG_INT_CODE_CMD_FINISHED, MACREG_REG_INT_CODE, mwl_hal_priv::mh_cmdbuf, mwl_hal_priv::mh_dev, mwlTriggerPciCmd(), mwlWaitFor(), RD4(), and WR4().

Referenced by mwl_hal_fwload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwlSendBlock2()

static int mwlSendBlock2 ( struct mwl_hal_priv mh,
const void *  data,
size_t  dsize 
)
static

Definition at line 2501 of file mwlhal.c.

References MACREG_INT_CODE_CMD_FINISHED, MACREG_REG_INT_CODE, mwl_hal_priv::mh_cmdbuf, mwl_hal_priv::mh_dev, mwlTriggerPciCmd(), mwlWaitFor(), RD4(), and WR4().

Referenced by mwl_hal_fwload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwlSendCmd()

static void mwlSendCmd ( struct mwl_hal_priv mh)
static

Definition at line 2346 of file mwlhal.c.

References MACREG_H2ARIC_BIT_DOOR_BELL, MACREG_REG_GEN_PTR, MACREG_REG_H2A_INTERRUPT_EVENTS, MACREG_REG_INT_CODE, mwl_hal_priv::mh_cmdaddr, mwl_hal_priv::mh_dmamap, mwl_hal_priv::mh_dmat, RD4(), and WR4().

Referenced by mwlExecuteCmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwlTriggerPciCmd()

static void mwlTriggerPciCmd ( struct mwl_hal_priv mh)
static

Definition at line 2447 of file mwlhal.c.

References MACREG_H2ARIC_BIT_DOOR_BELL, MACREG_REG_GEN_PTR, MACREG_REG_H2A_INTERRUPT_EVENTS, MACREG_REG_INT_CODE, mwl_hal_priv::mh_cmdaddr, mwl_hal_priv::mh_dmamap, mwl_hal_priv::mh_dmat, RD4(), and WR4().

Referenced by mwl_hal_fwload(), mwlSendBlock(), and mwlSendBlock2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwlWaitFor()

static int mwlWaitFor ( struct mwl_hal_priv mh,
uint32_t  val 
)
static

Definition at line 2464 of file mwlhal.c.

References FW_CHECK_USECS, FW_MAX_NUM_CHECKS, MACREG_REG_INT_CODE, and RD4().

Referenced by mwlSendBlock(), and mwlSendBlock2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mwlWaitForCmdComplete()

static int mwlWaitForCmdComplete ( struct mwl_hal_priv mh,
uint16_t  cmdCode 
)
static

Definition at line 2360 of file mwlhal.c.

References MAX_WAIT_FW_COMPLETE_ITERATIONS, and mwl_hal_priv::mh_cmdbuf.

Referenced by mwlExecuteCmd().

Here is the caller graph for this function:

◆ RD4()

static __inline uint32_t RD4 ( struct mwl_hal_priv mh,
bus_size_t  off 
)
static

◆ setmaxtxpow()

static void setmaxtxpow ( struct mwl_hal_channel *  hc,
int  i,
int  maxix 
)
static

Definition at line 2013 of file mwlhal.c.

Referenced by get2Ghz(), and get5Ghz().

Here is the caller graph for this function:

◆ SYSCTL_DECL()

SYSCTL_DECL ( _hw_mwl  )

◆ SYSCTL_NODE()

static SYSCTL_NODE ( _hw_mwl  ,
OID_AUTO  ,
hal  ,
CTLFLAG_RD|  CTLFLAG_MPSAFE,
,
"Marvell HAL parameters"   
)
static

◆ WR4()

static __inline void WR4 ( struct mwl_hal_priv mh,
bus_size_t  off,
uint32_t  val 
)
static

Variable Documentation

◆ ba2qid

const int ba2qid[MWL_BASTREAMS_MAX]
static
Initial value:
= {
5, 6
, 7, 0, 1, 2, 3
}

Definition at line 85 of file mwlhal.c.

Referenced by mwl_hal_attach().

◆ qid2ba

int qid2ba[MWL_BAQID_MAX]
static

Definition at line 91 of file mwlhal.c.

Referenced by mwl_hal_attach(), and mwl_hal_getwatchdogbitmap().