FreeBSD kernel usb device Code
if_run.c File Reference
#include <sys/cdefs.h>
#include "opt_wlan.h"
#include <sys/param.h>
#include <sys/eventhandler.h>
#include <sys/sockio.h>
#include <sys/sysctl.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/mbuf.h>
#include <sys/kernel.h>
#include <sys/socket.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/endian.h>
#include <sys/linker.h>
#include <sys/firmware.h>
#include <sys/kdb.h>
#include <net/bpf.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_arp.h>
#include <net/ethernet.h>
#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_types.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/in_var.h>
#include <netinet/if_ether.h>
#include <netinet/ip.h>
#include <net80211/ieee80211_var.h>
#include <net80211/ieee80211_regdomain.h>
#include <net80211/ieee80211_radiotap.h>
#include <net80211/ieee80211_ratectl.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include "usbdevs.h"
#include <dev/usb/usb_debug.h>
#include <dev/usb/usb_msctest.h>
#include <dev/usb/wlan/if_runreg.h>
#include <dev/usb/wlan/if_runvar.h>
Include dependency graph for if_run.c:

Go to the source code of this file.

Data Structures

struct  rt2860_rate
 
struct  rfprog
 
struct  rt5592_freqs
 

Macros

#define USB_DEBUG_VAR   run_debug
 
#define RUN_DPRINTF(_sc, _m, ...)   do { (void) _sc; } while (0)
 
#define IEEE80211_HAS_ADDR4(wh)   IEEE80211_IS_DSTODS(wh)
 
#define RUN_CMDQ_GET(c)   (atomic_fetchadd_32((c), 1) & RUN_CMDQ_MASQ)
 
#define RUN_DEV(v, p)   { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) }
 
#define RUN_DEV_EJECT(v, p)    { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, RUN_EJECT) }
 
#define RUN_EJECT   1
 
#define RT2860_RIDX_CCK1   0
 
#define RT2860_RIDX_CCK11   3
 
#define RT2860_RIDX_OFDM6   4
 
#define RT2860_RIDX_MCS0   12
 
#define RT2860_RIDX_MAX   36
 
#define CCK(mcs)   (mcs)
 
#define OFDM(mcs)   (1 << 3 | (mcs))
 

Functions

 __FBSDID ("$FreeBSD$")
 
static void run_autoinst (void *, struct usb_device *, struct usb_attach_arg *)
 
static int run_driver_loaded (struct module *, int, void *)
 
static void run_bulk_tx_callbackN (struct usb_xfer *xfer, usb_error_t error, u_int index)
 
static struct ieee80211vap * run_vap_create (struct ieee80211com *, const char[IFNAMSIZ], int, enum ieee80211_opmode, int, const uint8_t[IEEE80211_ADDR_LEN], const uint8_t[IEEE80211_ADDR_LEN])
 
static void run_vap_delete (struct ieee80211vap *)
 
static void run_cmdq_cb (void *, int)
 
static void run_setup_tx_list (struct run_softc *, struct run_endpoint_queue *)
 
static void run_unsetup_tx_list (struct run_softc *, struct run_endpoint_queue *)
 
static int run_load_microcode (struct run_softc *)
 
static int run_reset (struct run_softc *)
 
static usb_error_t run_do_request (struct run_softc *, struct usb_device_request *, void *)
 
static int run_read (struct run_softc *, uint16_t, uint32_t *)
 
static int run_read_region_1 (struct run_softc *, uint16_t, uint8_t *, int)
 
static int run_write_2 (struct run_softc *, uint16_t, uint16_t)
 
static int run_write (struct run_softc *, uint16_t, uint32_t)
 
static int run_write_region_1 (struct run_softc *, uint16_t, const uint8_t *, int)
 
static int run_set_region_4 (struct run_softc *, uint16_t, uint32_t, int)
 
static int run_efuse_read (struct run_softc *, uint16_t, uint16_t *, int)
 
static int run_efuse_read_2 (struct run_softc *, uint16_t, uint16_t *)
 
static int run_eeprom_read_2 (struct run_softc *, uint16_t, uint16_t *)
 
static int run_rt2870_rf_write (struct run_softc *, uint32_t)
 
static int run_rt3070_rf_read (struct run_softc *, uint8_t, uint8_t *)
 
static int run_rt3070_rf_write (struct run_softc *, uint8_t, uint8_t)
 
static int run_bbp_read (struct run_softc *, uint8_t, uint8_t *)
 
static int run_bbp_write (struct run_softc *, uint8_t, uint8_t)
 
static int run_mcu_cmd (struct run_softc *, uint8_t, uint16_t)
 
static const char * run_get_rf (uint16_t)
 
static void run_rt3593_get_txpower (struct run_softc *)
 
static void run_get_txpower (struct run_softc *)
 
static int run_read_eeprom (struct run_softc *)
 
static struct ieee80211_node * run_node_alloc (struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN])
 
static int run_media_change (struct ifnet *)
 
static int run_newstate (struct ieee80211vap *, enum ieee80211_state, int)
 
static int run_wme_update (struct ieee80211com *)
 
static void run_key_set_cb (void *)
 
static int run_key_set (struct ieee80211vap *, struct ieee80211_key *)
 
static void run_key_delete_cb (void *)
 
static int run_key_delete (struct ieee80211vap *, struct ieee80211_key *)
 
static void run_ratectl_to (void *)
 
static void run_ratectl_cb (void *, int)
 
static void run_drain_fifo (void *)
 
static void run_iter_func (void *, struct ieee80211_node *)
 
static void run_newassoc_cb (void *)
 
static void run_newassoc (struct ieee80211_node *, int)
 
static void run_recv_mgmt (struct ieee80211_node *, struct mbuf *, int, const struct ieee80211_rx_stats *, int, int)
 
static void run_rx_frame (struct run_softc *, struct mbuf *, uint32_t)
 
static void run_tx_free (struct run_endpoint_queue *pq, struct run_tx_data *, int)
 
static void run_set_tx_desc (struct run_softc *, struct run_tx_data *)
 
static int run_tx (struct run_softc *, struct mbuf *, struct ieee80211_node *)
 
static int run_tx_mgt (struct run_softc *, struct mbuf *, struct ieee80211_node *)
 
static int run_sendprot (struct run_softc *, const struct mbuf *, struct ieee80211_node *, int, int)
 
static int run_tx_param (struct run_softc *, struct mbuf *, struct ieee80211_node *, const struct ieee80211_bpf_params *)
 
static int run_raw_xmit (struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *)
 
static int run_transmit (struct ieee80211com *, struct mbuf *)
 
static void run_start (struct run_softc *)
 
static void run_parent (struct ieee80211com *)
 
static void run_iq_calib (struct run_softc *, u_int)
 
static void run_set_agc (struct run_softc *, uint8_t)
 
static void run_select_chan_group (struct run_softc *, int)
 
static void run_set_rx_antenna (struct run_softc *, int)
 
static void run_rt2870_set_chan (struct run_softc *, u_int)
 
static void run_rt3070_set_chan (struct run_softc *, u_int)
 
static void run_rt3572_set_chan (struct run_softc *, u_int)
 
static void run_rt3593_set_chan (struct run_softc *, u_int)
 
static void run_rt5390_set_chan (struct run_softc *, u_int)
 
static void run_rt5592_set_chan (struct run_softc *, u_int)
 
static int run_set_chan (struct run_softc *, struct ieee80211_channel *)
 
static void run_set_channel (struct ieee80211com *)
 
static void run_getradiocaps (struct ieee80211com *, int, int *, struct ieee80211_channel[])
 
static void run_scan_start (struct ieee80211com *)
 
static void run_scan_end (struct ieee80211com *)
 
static void run_update_beacon (struct ieee80211vap *, int)
 
static void run_update_beacon_cb (void *)
 
static void run_updateprot (struct ieee80211com *)
 
static void run_updateprot_cb (void *)
 
static void run_usb_timeout_cb (void *)
 
static void run_reset_livelock (struct run_softc *)
 
static void run_enable_tsf_sync (struct run_softc *)
 
static void run_enable_tsf (struct run_softc *)
 
static void run_disable_tsf (struct run_softc *)
 
static void run_get_tsf (struct run_softc *, uint64_t *)
 
static void run_enable_mrr (struct run_softc *)
 
static void run_set_txpreamble (struct run_softc *)
 
static void run_set_basicrates (struct run_softc *)
 
static void run_set_leds (struct run_softc *, uint16_t)
 
static void run_set_bssid (struct run_softc *, const uint8_t *)
 
static void run_set_macaddr (struct run_softc *, const uint8_t *)
 
static void run_updateslot (struct ieee80211com *)
 
static void run_updateslot_cb (void *)
 
static void run_update_mcast (struct ieee80211com *)
 
static int8_t run_rssi2dbm (struct run_softc *, uint8_t, uint8_t)
 
static void run_update_promisc_locked (struct run_softc *)
 
static void run_update_promisc (struct ieee80211com *)
 
static void run_rt5390_bbp_init (struct run_softc *)
 
static int run_bbp_init (struct run_softc *)
 
static int run_rt3070_rf_init (struct run_softc *)
 
static void run_rt3593_rf_init (struct run_softc *)
 
static void run_rt5390_rf_init (struct run_softc *)
 
static int run_rt3070_filter_calib (struct run_softc *, uint8_t, uint8_t, uint8_t *)
 
static void run_rt3070_rf_setup (struct run_softc *)
 
static void run_rt3593_rf_setup (struct run_softc *)
 
static void run_rt5390_rf_setup (struct run_softc *)
 
static int run_txrx_enable (struct run_softc *)
 
static void run_adjust_freq_offset (struct run_softc *)
 
static void run_init_locked (struct run_softc *)
 
static void run_stop (void *)
 
static void run_delay (struct run_softc *, u_int)
 
static void run_update_chw (struct ieee80211com *ic)
 
static int run_ampdu_enable (struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
 
static int run_match (device_t self)
 
static int run_attach (device_t self)
 
static void run_drain_mbufq (struct run_softc *sc)
 
static int run_detach (device_t self)
 
static __inline int run_srom_read (struct run_softc *sc, uint16_t addr, uint16_t *val)
 
static __inline uint32_t b4inc (uint32_t b32, int8_t delta)
 
static __inline uint8_t run_maxrssi_chain (struct run_softc *sc, const struct rt2860_rxwi *rxwi)
 
static void run_bulk_rx_callback (struct usb_xfer *xfer, usb_error_t error)
 
static void run_bulk_tx_callback0 (struct usb_xfer *xfer, usb_error_t error)
 
static void run_bulk_tx_callback1 (struct usb_xfer *xfer, usb_error_t error)
 
static void run_bulk_tx_callback2 (struct usb_xfer *xfer, usb_error_t error)
 
static void run_bulk_tx_callback3 (struct usb_xfer *xfer, usb_error_t error)
 
static void run_bulk_tx_callback4 (struct usb_xfer *xfer, usb_error_t error)
 
static void run_bulk_tx_callback5 (struct usb_xfer *xfer, usb_error_t error)
 
 DRIVER_MODULE (run, uhub, run_driver, run_devclass, run_driver_loaded, NULL)
 
 MODULE_DEPEND (run, wlan, 1, 1, 1)
 
 MODULE_DEPEND (run, usb, 1, 1, 1)
 
 MODULE_DEPEND (run, firmware, 1, 1, 1)
 
 MODULE_VERSION (run, 1)
 
 USB_PNP_HOST_INFO (run_devs)
 

Variables

static const STRUCT_USB_HOST_ID run_devs []
 
static device_probe_t run_match
 
static device_attach_t run_attach
 
static device_detach_t run_detach
 
static usb_callback_t run_bulk_rx_callback
 
static usb_callback_t run_bulk_tx_callback0
 
static usb_callback_t run_bulk_tx_callback1
 
static usb_callback_t run_bulk_tx_callback2
 
static usb_callback_t run_bulk_tx_callback3
 
static usb_callback_t run_bulk_tx_callback4
 
static usb_callback_t run_bulk_tx_callback5
 
static eventhandler_tag run_etag
 
static const struct rt2860_rate rt2860_rates []
 
struct {
   uint16_t   reg
 
   uint32_t   val
 
rt2870_def_mac []
 
struct {
   uint8_t   reg
 
   uint8_t   val
 
rt2860_def_bbp []
 
struct {
   uint8_t   reg
 
   uint8_t   val
 
rt5390_def_bbp []
 
struct {
   uint8_t   reg
 
   uint8_t   val
 
rt5592_def_bbp []
 
static const uint8_t rt5592_bbp_r196 []
 
static const struct rfprog rt2860_rf2850 []
 
struct {
   uint8_t   n
 
   uint8_t   r
 
   uint8_t   k
 
rt3070_freqs []
 
static const struct rt5592_freqs rt5592_freqs_20mhz []
 
static const struct rt5592_freqs rt5592_freqs_40mhz []
 
struct {
   uint8_t   reg
 
   uint8_t   val
 
rt3070_def_rf []
 
struct {
   uint8_t   reg
 
   uint8_t   val
 
rt3572_def_rf []
 
struct {
   uint8_t   reg
 
   uint8_t   val
 
rt3593_def_rf []
 
struct {
   uint8_t   reg
 
   uint8_t   val
 
rt5390_def_rf []
 
struct {
   uint8_t   reg
 
   uint8_t   val
 
rt5392_def_rf []
 
struct {
   uint8_t   reg
 
   uint8_t   val
 
rt5592_def_rf []
 
struct {
   uint8_t   reg
 
   uint8_t   val
 
rt5592_2ghz_def_rf []
 
struct {
   uint8_t   reg
 
   uint8_t   val
 
rt5592_5ghz_def_rf []
 
struct {
   u_int   firstchan
 
   u_int   lastchan
 
   uint8_t   reg
 
   uint8_t   val
 
rt5592_chan_5ghz []
 
static const struct usb_config run_config [RUN_N_XFER]
 
static device_method_t run_methods []
 
static driver_t run_driver
 
static devclass_t run_devclass
 

Macro Definition Documentation

◆ CCK

#define CCK (   mcs)    (mcs)

◆ IEEE80211_HAS_ADDR4

#define IEEE80211_HAS_ADDR4 (   wh)    IEEE80211_IS_DSTODS(wh)

Definition at line 123 of file if_run.c.

◆ OFDM

#define OFDM (   mcs)    (1 << 3 | (mcs))

◆ RT2860_RIDX_CCK1

#define RT2860_RIDX_CCK1   0

Definition at line 565 of file if_run.c.

◆ RT2860_RIDX_CCK11

#define RT2860_RIDX_CCK11   3

Definition at line 566 of file if_run.c.

◆ RT2860_RIDX_MAX

#define RT2860_RIDX_MAX   36

Definition at line 569 of file if_run.c.

◆ RT2860_RIDX_MCS0

#define RT2860_RIDX_MCS0   12

Definition at line 568 of file if_run.c.

◆ RT2860_RIDX_OFDM6

#define RT2860_RIDX_OFDM6   4

Definition at line 567 of file if_run.c.

◆ RUN_CMDQ_GET

#define RUN_CMDQ_GET (   c)    (atomic_fetchadd_32((c), 1) & RUN_CMDQ_MASQ)

Definition at line 129 of file if_run.c.

◆ RUN_DEV

#define RUN_DEV (   v,
 
)    { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) }

◆ RUN_DEV_EJECT

#define RUN_DEV_EJECT (   v,
 
)     { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, RUN_EJECT) }

◆ RUN_DPRINTF

#define RUN_DPRINTF (   _sc,
  _m,
  ... 
)    do { (void) _sc; } while (0)

Definition at line 120 of file if_run.c.

◆ RUN_EJECT

#define RUN_EJECT   1

◆ USB_DEBUG_VAR

#define USB_DEBUG_VAR   run_debug

Definition at line 75 of file if_run.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ b4inc()

static __inline uint32_t b4inc ( uint32_t  b32,
int8_t  delta 
)
static

Definition at line 1690 of file if_run.c.

Referenced by run_read_eeprom().

Here is the caller graph for this function:

◆ DRIVER_MODULE()

DRIVER_MODULE ( run  ,
uhub  ,
run_driver  ,
run_devclass  ,
run_driver_loaded  ,
NULL   
)

◆ MODULE_DEPEND() [1/3]

MODULE_DEPEND ( run  ,
firmware  ,
,
,
 
)

◆ MODULE_DEPEND() [2/3]

MODULE_DEPEND ( run  ,
usb  ,
,
,
 
)

◆ MODULE_DEPEND() [3/3]

MODULE_DEPEND ( run  ,
wlan  ,
,
,
 
)

◆ MODULE_VERSION()

MODULE_VERSION ( run  ,
 
)

◆ run_adjust_freq_offset()

static void run_adjust_freq_offset ( struct run_softc sc)
static

Definition at line 6084 of file if_run.c.

References run_softc::freq, run_mcu_cmd(), and run_rt3070_rf_read().

Referenced by run_rt3593_rf_init(), run_rt3593_set_chan(), run_rt5390_rf_init(), run_rt5390_set_chan(), and run_rt5592_set_chan().

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

◆ run_ampdu_enable()

static int run_ampdu_enable ( struct ieee80211_node *  ni,
struct ieee80211_tx_ampdu *  tap 
)
static

Definition at line 6419 of file if_run.c.

Referenced by run_attach().

Here is the caller graph for this function:

◆ run_attach()

◆ run_autoinst()

static void run_autoinst ( void *  arg,
struct usb_device udev,
struct usb_attach_arg uaa 
)
static

Definition at line 728 of file if_run.c.

References usb_attach_arg::dev_state, id, usb_interface::idesc, MSC_EJECT_STOPUNIT, run_devs, UAA_DEV_EJECTING, UAA_DEV_READY, UICLASS_MASS, usb_msc_eject(), usbd_get_iface(), and usbd_lookup_id_by_uaa().

Referenced by run_driver_loaded().

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

◆ run_bbp_init()

static int run_bbp_init ( struct run_softc sc)
static

Definition at line 5470 of file if_run.c.

References error, run_softc::mac_rev, run_softc::mac_ver, reg, rt2860_def_bbp, run_bbp_read(), run_bbp_write(), run_rt5390_bbp_init(), and val.

Referenced by run_init_locked().

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

◆ run_bbp_read()

static int run_bbp_read ( struct run_softc sc,
uint8_t  reg,
uint8_t *  val 
)
static

◆ run_bbp_write()

static int run_bbp_write ( struct run_softc sc,
uint8_t  reg,
uint8_t  val 
)
static

◆ run_bulk_rx_callback()

◆ run_bulk_tx_callback0()

static void run_bulk_tx_callback0 ( struct usb_xfer xfer,
usb_error_t  error 
)
static

Definition at line 3317 of file if_run.c.

References error, and run_bulk_tx_callbackN().

Here is the call graph for this function:

◆ run_bulk_tx_callback1()

static void run_bulk_tx_callback1 ( struct usb_xfer xfer,
usb_error_t  error 
)
static

Definition at line 3323 of file if_run.c.

References error, and run_bulk_tx_callbackN().

Here is the call graph for this function:

◆ run_bulk_tx_callback2()

static void run_bulk_tx_callback2 ( struct usb_xfer xfer,
usb_error_t  error 
)
static

Definition at line 3329 of file if_run.c.

References error, and run_bulk_tx_callbackN().

Here is the call graph for this function:

◆ run_bulk_tx_callback3()

static void run_bulk_tx_callback3 ( struct usb_xfer xfer,
usb_error_t  error 
)
static

Definition at line 3335 of file if_run.c.

References error, and run_bulk_tx_callbackN().

Here is the call graph for this function:

◆ run_bulk_tx_callback4()

static void run_bulk_tx_callback4 ( struct usb_xfer xfer,
usb_error_t  error 
)
static

Definition at line 3341 of file if_run.c.

References error, and run_bulk_tx_callbackN().

Here is the call graph for this function:

◆ run_bulk_tx_callback5()

static void run_bulk_tx_callback5 ( struct usb_xfer xfer,
usb_error_t  error 
)
static

Definition at line 3347 of file if_run.c.

References error, and run_bulk_tx_callbackN().

Here is the call graph for this function:

◆ run_bulk_tx_callbackN()

◆ run_cmdq_cb()

static void run_cmdq_cb ( void *  arg,
int  pending 
)
static

Definition at line 1146 of file if_run.c.

References run_cmdq::arg0, run_softc::cmdq, run_softc::cmdq_exec, run_softc::cmdq_run, run_cmdq::func, RUN_CMDQ_GO, RUN_CMDQ_MASQ, RUN_DPRINTF, RUN_LOCK, and RUN_UNLOCK.

Referenced by run_attach().

Here is the caller graph for this function:

◆ run_delay()

static void run_delay ( struct run_softc sc,
u_int  ms 
)
static

◆ run_detach()

◆ run_disable_tsf()

static void run_disable_tsf ( struct run_softc sc)
static

Definition at line 5258 of file if_run.c.

References RT2860_BCN_TIME_CFG, RT2860_BCN_TX_EN, RT2860_TBTT_TIMER_EN, RT2860_TSF_TIMER_EN, run_read(), and run_write().

Referenced by run_init_locked(), run_newstate(), and run_scan_start().

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

◆ run_do_request()

static usb_error_t run_do_request ( struct run_softc sc,
struct usb_device_request req,
void *  data 
)
static

Definition at line 1329 of file if_run.c.

References data, req, run_delay(), RUN_DPRINTF, RUN_LOCK_ASSERT, run_softc::sc_mtx, run_softc::sc_udev, usbd_do_request_flags(), and usbd_errstr().

Referenced by run_read_region_1(), run_write_2(), and run_write_region_1().

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

◆ run_drain_fifo()

static void run_drain_fifo ( void *  arg)
static

◆ run_drain_mbufq()

static void run_drain_mbufq ( struct run_softc sc)
static

Definition at line 932 of file if_run.c.

References RUN_LOCK_ASSERT, and run_softc::sc_snd.

Referenced by run_detach(), and run_stop().

Here is the caller graph for this function:

◆ run_driver_loaded()

static int run_driver_loaded ( struct module *  mod,
int  what,
void *  arg 
)
static

Definition at line 751 of file if_run.c.

References run_autoinst(), and run_etag.

Here is the call graph for this function:

◆ run_eeprom_read_2()

static int run_eeprom_read_2 ( struct run_softc sc,
uint16_t  addr,
uint16_t *  val 
)
static

Definition at line 1513 of file if_run.c.

References addr, error, req, RT2870_EEPROM_READ, run_softc::sc_mtx, run_softc::sc_udev, usbd_do_request, USETW, UT_READ_VENDOR_DEVICE, and val.

Referenced by run_read_eeprom().

Here is the caller graph for this function:

◆ run_efuse_read()

static int run_efuse_read ( struct run_softc sc,
uint16_t  addr,
uint16_t *  val,
int  count 
)
static

Definition at line 1459 of file if_run.c.

References addr, count, error, reg, RT3070_EFSROM_AIN_MASK, RT3070_EFSROM_AIN_SHIFT, RT3070_EFSROM_KICK, RT3070_EFSROM_MODE_MASK, RT3070_EFUSE_AOUT_MASK, RT3070_EFUSE_CTRL, RT3070_EFUSE_DATA3, run_delay(), run_read(), run_write(), and val.

Referenced by run_efuse_read_2(), and run_iq_calib().

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

◆ run_efuse_read_2()

static int run_efuse_read_2 ( struct run_softc sc,
uint16_t  addr,
uint16_t *  val 
)
static

Definition at line 1507 of file if_run.c.

References addr, run_efuse_read(), and val.

Referenced by run_read_eeprom().

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

◆ run_enable_mrr()

static void run_enable_mrr ( struct run_softc sc)
static

Definition at line 5277 of file if_run.c.

References CCK, OFDM, RT2860_LG_FBK_CFG0, RT2860_LG_FBK_CFG1, and run_write().

Referenced by run_newstate().

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

◆ run_enable_tsf()

static void run_enable_tsf ( struct run_softc sc)
static

Definition at line 5246 of file if_run.c.

References RT2860_BCN_TIME_CFG, RT2860_BCN_TX_EN, RT2860_TBTT_TIMER_EN, RT2860_TSF_TIMER_EN, run_read(), and run_write().

Referenced by run_newstate().

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

◆ run_enable_tsf_sync()

static void run_enable_tsf_sync ( struct run_softc sc)
static

Definition at line 5204 of file if_run.c.

References RT2860_BCN_TIME_CFG, RT2860_BCN_TX_EN, RT2860_TBTT_TIMER_EN, RT2860_TSF_SYNC_MODE_SHIFT, RT2860_TSF_TIMER_EN, RUN_DPRINTF, run_read(), RUN_VAP, run_write(), and run_softc::sc_ic.

Referenced by run_newstate(), and run_scan_end().

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

◆ run_get_rf()

static const char * run_get_rf ( uint16_t  rev)
static

◆ run_get_tsf()

static void run_get_tsf ( struct run_softc sc,
uint64_t *  buf 
)
static

Definition at line 5270 of file if_run.c.

References RT2860_TSF_TIMER_DW0, and run_read_region_1().

Referenced by run_recv_mgmt(), and run_rx_frame().

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

◆ run_get_txpower()

static void run_get_txpower ( struct run_softc sc)
static

Definition at line 1785 of file if_run.c.

References chan, run_softc::mac_ver, RT2860_EEPROM_PWR2GHZ_BASE1, RT2860_EEPROM_PWR2GHZ_BASE2, RT2860_EEPROM_PWR5GHZ_BASE1, RT2860_EEPROM_PWR5GHZ_BASE2, rt2860_rf2850, RUN_DPRINTF, run_srom_read(), run_softc::txpow1, run_softc::txpow2, and val.

Referenced by run_read_eeprom().

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

◆ run_getradiocaps()

static void run_getradiocaps ( struct ieee80211com *  ic,
int  maxchans,
int *  nchans,
struct ieee80211_channel  chans[] 
)
static

Definition at line 4936 of file if_run.c.

References run_softc::rf_rev, RT2860_RF_2750, RT2860_RF_2850, RT3070_RF_2020, RT3070_RF_3052, RT3593_RF_3053, RT5592_RF_5592, and run_chan_5ghz.

Referenced by run_attach().

Here is the caller graph for this function:

◆ run_init_locked()

static void run_init_locked ( struct run_softc sc)
static

Definition at line 6098 of file if_run.c.

References run_softc::bbp, run_softc::cmdq_key_set, run_softc::cmdq_run, fail, run_softc::led, run_softc::mac_rev, run_softc::mac_ver, run_softc::nrxchains, run_softc::ntxchains, reg, run_softc::reg, run_softc::rf_rev, RT2860_ASIC_VER_ID, RT2860_AUTO_RSP_CFG, RT2860_AUTO_RSP_EN, RT2860_BAC_ACKPOLICY_EN, RT2860_BBP_HRST, RT2860_CTS_40M_MODE_EN, RT2860_DLY_PAPE_EN_SHIFT, RT2860_H2M_BBPAGENT, RT2860_H2M_MAILBOX, RT2860_HT_FBK_CFG1, RT2860_LED_RADIO, RT2860_LG_FBK_CFG0, RT2860_MAC_SRST, RT2860_MAC_STATUS_REG, RT2860_MAC_SYS_CTRL, RT2860_MAX_LEN_CFG, RT2860_MCU_CMD_LED1, RT2860_MCU_CMD_LED2, RT2860_MCU_CMD_LED3, RT2860_PME_OEN, RT2860_RX_DMA_BUSY, RT2860_RX_STATUS_BUSY, RT2860_SKEY, RT2860_SKEY_MODE_0_7, RT2860_SYS_CTRL, RT2860_TX_DMA_BUSY, RT2860_TX_PWR_CFG, RT2860_TX_STATUS_BUSY, RT2860_TX_SW_CFG0, RT2860_TX_WB_DDONE, RT2860_TXOP_CTRL_CFG, RT2860_TXOP_HLDR_ET, RT2860_US_CYC_CNT, RT2860_USB_DMA_CFG, RT2860_WCID_ATTR, RT2860_WCID_ENTRY, RT2860_WMM_AIFSN_CFG, RT2860_WMM_CWMAX_CFG, RT2860_WMM_CWMIN_CFG, RT2860_WMM_TXOP0_CFG, RT2860_WMM_TXOP1_CFG, RT2860_WPDMA_GLO_CFG, rt2870_def_mac, RT3070_RF_3020, RT5390_RF_5370, run_bbp_init(), run_bbp_read(), run_bbp_write(), RUN_BULK_RX, RUN_CMDQ_GO, run_delay(), run_disable_tsf(), RUN_EP_QUEUES, run_load_microcode(), run_mcu_cmd(), RUN_N_XFER, run_read(), run_reset(), run_rt3070_rf_init(), run_rt3070_rf_setup(), run_rt3593_rf_init(), run_rt3593_rf_setup(), run_rt5390_rf_init(), run_rt5390_rf_setup(), RUN_RUNNING, run_set_chan(), run_set_leds(), run_set_macaddr(), run_set_region_4(), run_set_rx_antenna(), run_setup_tx_list(), run_stop(), run_txrx_enable(), run_updateprot_cb(), run_write(), run_softc::sc_dev, run_softc::sc_epq, run_softc::sc_flags, run_softc::sc_ic, run_softc::sc_xfer, run_softc::txpow20mhz, usbd_transfer_start(), usbd_xfer_set_stall(), val, and run_softc::val.

Referenced by run_media_change(), and run_parent().

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

◆ run_iq_calib()

◆ run_iter_func()

static void run_iter_func ( void *  arg,
struct ieee80211_node *  ni 
)
static

Definition at line 2681 of file if_run.c.

References run_node::amrr_ridx, error, fail, run_node::ni, rt2860_rates, RT2860_RIDX_MAX, RT2860_TX_STA_CNT0, RT2870_WCID_MAX, RUN_AID2WCID, RUN_DPRINTF, RUN_LOCK, RUN_NODE, run_read_region_1(), RUN_RETRY, RUN_SUCCESS, RUN_TXCNT, RUN_UNLOCK, run_softc::rvp_cnt, run_softc::sc_txs, tx, and run_softc::wcid_stats.

Referenced by run_ratectl_cb().

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

◆ run_key_delete()

static int run_key_delete ( struct ieee80211vap *  vap,
struct ieee80211_key *  k 
)
static

Definition at line 2550 of file if_run.c.

References run_cmdq::arg0, run_cmdq::arg1, run_softc::cmdq, run_softc::cmdq_store, run_softc::cmdq_task, run_cmdq::func, k, run_cmdq::key, RUN_CMDQ_GET, RUN_DPRINTF, and run_key_delete_cb().

Referenced by run_vap_create().

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

◆ run_key_delete_cb()

static void run_key_delete_cb ( void *  arg)
static

Definition at line 2515 of file if_run.c.

References run_cmdq::arg1, run_softc::cmdq, k, run_cmdq::key, RT2860_SKEY_MODE_0_7, RT2860_WCID_ATTR, RT2860_WCID_ENTRY, RUN_DPRINTF, RUN_LOCK_ASSERT, run_read(), run_set_region_4(), and run_write().

Referenced by run_key_delete().

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

◆ run_key_set()

static int run_key_set ( struct ieee80211vap *  vap,
struct ieee80211_key *  k 
)
static

Definition at line 2481 of file if_run.c.

References run_cmdq::arg0, run_cmdq::arg1, run_softc::cmdq, run_softc::cmdq_key_set, run_softc::cmdq_store, run_softc::cmdq_task, run_cmdq::func, k, run_cmdq::k, run_cmdq::mac, RUN_CMDQ_GET, RUN_CMDQ_GO, RUN_DPRINTF, run_key_set_cb(), RUN_LOCK, and RUN_UNLOCK.

Referenced by run_vap_create().

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

◆ run_key_set_cb()

static void run_key_set_cb ( void *  arg)
static

◆ run_load_microcode()

◆ run_match()

static int run_match ( device_t  self)
static

◆ run_maxrssi_chain()

static __inline uint8_t run_maxrssi_chain ( struct run_softc sc,
const struct rt2860_rxwi rxwi 
)
static

Definition at line 2826 of file if_run.c.

References run_softc::nrxchains, and rt2860_rxwi::rssi.

Referenced by run_rx_frame().

Here is the caller graph for this function:

◆ run_mcu_cmd()

static int run_mcu_cmd ( struct run_softc sc,
uint8_t  cmd,
uint16_t  arg 
)
static

Definition at line 1665 of file if_run.c.

References error, RT2860_H2M_BUSY, RT2860_H2M_MAILBOX, RT2860_HOST_CMD, RT2860_TOKEN_NO_INTR, run_read(), and run_write().

Referenced by run_adjust_freq_offset(), run_init_locked(), run_load_microcode(), run_set_leds(), and run_set_rx_antenna().

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

◆ run_media_change()

static int run_media_change ( struct ifnet *  ifp)
static

Definition at line 2119 of file if_run.c.

References error, run_node::fix_ridx, run_node::ni, rt2860_rates, RT2860_RIDX_MAX, RUN_DPRINTF, run_init_locked(), RUN_LOCK, RUN_NODE, RUN_RUNNING, and RUN_UNLOCK.

Referenced by run_vap_create().

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

◆ run_newassoc()

static void run_newassoc ( struct ieee80211_node *  ni,
int  isnew 
)
static

◆ run_newassoc_cb()

static void run_newassoc_cb ( void *  arg)
static

Definition at line 2754 of file if_run.c.

References run_cmdq::arg1, run_softc::cmdq, RT2860_WCID_ENTRY, RUN_LOCK_ASSERT, run_write_region_1(), run_cmdq::wcid, and run_softc::wcid_stats.

Referenced by run_newassoc().

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

◆ run_newstate()

◆ run_node_alloc()

static struct ieee80211_node * run_node_alloc ( struct ieee80211vap *  vap,
const uint8_t  mac[IEEE80211_ADDR_LEN] 
)
static

Definition at line 2112 of file if_run.c.

Referenced by run_attach().

Here is the caller graph for this function:

◆ run_parent()

static void run_parent ( struct ieee80211com *  ic)
static

Definition at line 3873 of file if_run.c.

References run_init_locked(), RUN_LOCK, RUN_RUNNING, run_stop(), RUN_UNLOCK, run_update_promisc_locked(), run_softc::rvp_cnt, run_softc::sc_detached, and run_softc::sc_flags.

Referenced by run_attach().

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

◆ run_ratectl_cb()

static void run_ratectl_cb ( void *  arg,
int  pending 
)
static

Definition at line 2590 of file if_run.c.

References run_softc::ratectl_ch, run_softc::ratectl_run, run_drain_fifo(), run_iter_func(), RUN_LOCK, RUN_RATECTL_OFF, run_ratectl_to(), run_reset_livelock(), RUN_UNLOCK, run_softc::rvp_cnt, run_softc::sc_ic, and usb_callout_reset.

Referenced by run_attach().

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

◆ run_ratectl_to()

static void run_ratectl_to ( void *  arg)
static

Definition at line 2579 of file if_run.c.

References run_softc::ratectl_task, and run_softc::sc_ic.

Referenced by run_newassoc(), run_newstate(), and run_ratectl_cb().

Here is the caller graph for this function:

◆ run_raw_xmit()

static int run_raw_xmit ( struct ieee80211_node *  ni,
struct mbuf *  m,
const struct ieee80211_bpf_params *  params 
)
static

Definition at line 3791 of file if_run.c.

References error, RUN_DPRINTF, RUN_LOCK, RUN_RUNNING, run_tx_mgt(), run_tx_param(), RUN_UNLOCK, and run_softc::sc_flags.

Referenced by run_attach().

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

◆ run_read()

◆ run_read_eeprom()

static int run_read_eeprom ( struct run_softc sc)
static

Definition at line 1849 of file if_run.c.

References b4inc(), run_softc::bbp, run_softc::calib_2ghz, run_softc::calib_5ghz, run_softc::ext_2ghz_lna, run_softc::ext_5ghz_lna, run_softc::freq, run_softc::led, run_softc::leds, run_softc::lna, run_softc::mac_ver, run_softc::nrxchains, run_softc::ntxchains, run_softc::patch_dac, reg, run_softc::reg, run_softc::rf, run_softc::rf_rev, run_softc::rfswitch, run_softc::rssi_2ghz, run_softc::rssi_5ghz, RT2860_EEPROM_ANTENNA, RT2860_EEPROM_BBP_BASE, RT2860_EEPROM_CONFIG, RT2860_EEPROM_DELTAPWR, RT2860_EEPROM_FREQ_LEDS, RT2860_EEPROM_LED1, RT2860_EEPROM_LED2, RT2860_EEPROM_LED3, RT2860_EEPROM_LNA, RT2860_EEPROM_MAC01, RT2860_EEPROM_MAC23, RT2860_EEPROM_MAC45, RT2860_EEPROM_RPWR, RT2860_EEPROM_RSSI1_2GHZ, RT2860_EEPROM_RSSI1_5GHZ, RT2860_EEPROM_RSSI2_2GHZ, RT2860_EEPROM_RSSI2_5GHZ, RT2860_EEPROM_VERSION, RT2860_RF_2820, RT3070_EFUSE_CTRL, RT3070_RF_3020, RT3070_RF_3052, RT3070_SEL_EFUSE, RT3071_EEPROM_RF_BASE, RT3593_EEPROM_FREQ, RT3593_EEPROM_FREQ_LEDS, RT3593_EEPROM_LED1, RT3593_EEPROM_LED2, RT3593_EEPROM_LED3, RT3593_EEPROM_LNA, RT3593_EEPROM_LNA_5GHZ, RT3593_EEPROM_RSSI1_2GHZ, RT3593_EEPROM_RSSI1_5GHZ, RT3593_EEPROM_RSSI2_2GHZ, RT3593_EEPROM_RSSI2_5GHZ, RUN_DPRINTF, run_eeprom_read_2(), run_efuse_read_2(), run_get_txpower(), run_read(), run_rt3593_get_txpower(), run_srom_read(), run_softc::sc_dev, run_softc::sc_ic, run_softc::sc_srom_read, run_softc::txmixgain_2ghz, run_softc::txmixgain_5ghz, run_softc::txpow20mhz, run_softc::txpow40mhz_2ghz, run_softc::txpow40mhz_5ghz, val, and run_softc::val.

Referenced by run_attach().

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

◆ run_read_region_1()

static int run_read_region_1 ( struct run_softc sc,
uint16_t  reg,
uint8_t *  buf,
int  len 
)
static

Definition at line 1365 of file if_run.c.

References len, reg, req, RT2870_READ_REGION_1, run_do_request(), USETW, and UT_READ_VENDOR_DEVICE.

Referenced by run_get_tsf(), run_iter_func(), run_newstate(), and run_read().

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

◆ run_recv_mgmt()

static void run_recv_mgmt ( struct ieee80211_node *  ni,
struct mbuf *  m,
int  subtype,
const struct ieee80211_rx_stats *  rxs,
int  rssi,
int  nf 
)
static

Definition at line 2841 of file if_run.c.

References run_vap::recv_mgmt, RUN_DPRINTF, run_get_tsf(), RUN_LOCK, RUN_UNLOCK, RUN_VAP, and run_vap::vap.

Referenced by run_vap_create().

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

◆ run_reset()

static int run_reset ( struct run_softc sc)
static

Definition at line 1316 of file if_run.c.

References req, RT2870_RESET, run_softc::sc_mtx, run_softc::sc_udev, usbd_do_request, USETW, and UT_WRITE_VENDOR_DEVICE.

Referenced by run_init_locked().

Here is the caller graph for this function:

◆ run_reset_livelock()

static void run_reset_livelock ( struct run_softc sc)
static

Definition at line 5150 of file if_run.c.

References RT2860_DEBUG, RT2860_MAC_RX_EN, RT2860_MAC_SRST, RT2860_MAC_SYS_CTRL, RT2860_MAC_TX_EN, run_delay(), RUN_DPRINTF, RUN_LOCK_ASSERT, run_read(), and run_write().

Referenced by run_ratectl_cb(), and run_usb_timeout_cb().

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

◆ run_rssi2dbm()

static int8_t run_rssi2dbm ( struct run_softc sc,
uint8_t  rssi,
uint8_t  rxchain 
)
static

Definition at line 5388 of file if_run.c.

References chan, run_softc::lna, run_softc::rssi_2ghz, run_softc::rssi_5ghz, and run_softc::sc_ic.

Referenced by run_rx_frame().

Here is the caller graph for this function:

◆ run_rt2870_rf_write()

static int run_rt2870_rf_write ( struct run_softc sc,
uint32_t  val 
)
static

Definition at line 1542 of file if_run.c.

References error, RT2860_RF_CSR_CFG0, RT2860_RF_REG_CTRL, run_read(), run_write(), and val.

Referenced by run_rt2870_set_chan().

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

◆ run_rt2870_set_chan()

static void run_rt2870_set_chan ( struct run_softc sc,
u_int  chan 
)
static

Definition at line 4159 of file if_run.c.

References rfprog::chan, chan, run_softc::freq, run_softc::nrxchains, run_softc::ntxchains, r1, rfprog::r2, r2, rfprog::r3, rfprog::r4, r4, rt2860_rf2850, run_delay(), run_rt2870_rf_write(), run_softc::txpow1, and run_softc::txpow2.

Referenced by run_set_chan().

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

◆ run_rt3070_filter_calib()

static int run_rt3070_filter_calib ( struct run_softc sc,
uint8_t  init,
uint8_t  target,
uint8_t *  val 
)
static

Definition at line 5777 of file if_run.c.

References init, run_bbp_read(), run_bbp_write(), run_delay(), run_rt3070_rf_read(), run_rt3070_rf_write(), and val.

Referenced by run_rt3070_rf_init().

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

◆ run_rt3070_rf_init()

◆ run_rt3070_rf_read()

static int run_rt3070_rf_read ( struct run_softc sc,
uint8_t  reg,
uint8_t *  val 
)
static

◆ run_rt3070_rf_setup()

static void run_rt3070_rf_setup ( struct run_softc sc)
static

◆ run_rt3070_rf_write()

static int run_rt3070_rf_write ( struct run_softc sc,
uint8_t  reg,
uint8_t  val 
)
static

◆ run_rt3070_set_chan()

static void run_rt3070_set_chan ( struct run_softc sc,
u_int  chan 
)
static

Definition at line 4230 of file if_run.c.

References rfprog::chan, chan, run_softc::freq, k, n, run_softc::nrxchains, run_softc::ntxchains, r, run_softc::rf24_20mhz, rt2860_rf2850, rt3070_freqs, run_rt3070_rf_read(), run_rt3070_rf_write(), run_softc::txpow1, and run_softc::txpow2.

Referenced by run_set_chan().

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

◆ run_rt3572_set_chan()

static void run_rt3572_set_chan ( struct run_softc sc,
u_int  chan 
)
static

◆ run_rt3593_get_txpower()

static void run_rt3593_get_txpower ( struct run_softc sc)
static

◆ run_rt3593_rf_init()

static void run_rt3593_rf_init ( struct run_softc sc)
static

◆ run_rt3593_rf_setup()

static void run_rt3593_rf_setup ( struct run_softc sc)
static

◆ run_rt3593_set_chan()

static void run_rt3593_set_chan ( struct run_softc sc,
u_int  chan 
)
static

◆ run_rt5390_bbp_init()

static void run_rt5390_bbp_init ( struct run_softc sc)
static

Definition at line 5412 of file if_run.c.

References run_softc::mac_rev, run_softc::mac_ver, run_softc::nrxchains, reg, rt5390_def_bbp, RT5390_MAC_IF_CTRL, RT5390_MLD, rt5592_bbp_r196, rt5592_def_bbp, run_bbp_read(), run_bbp_write(), and val.

Referenced by run_bbp_init().

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

◆ run_rt5390_rf_init()

static void run_rt5390_rf_init ( struct run_softc sc)
static

◆ run_rt5390_rf_setup()

static void run_rt5390_rf_setup ( struct run_softc sc)
static

◆ run_rt5390_set_chan()

static void run_rt5390_set_chan ( struct run_softc sc,
u_int  chan 
)
static

◆ run_rt5592_set_chan()

◆ run_rx_frame()

◆ run_scan_end()

static void run_scan_end ( struct ieee80211com *  ic)
static

Definition at line 4980 of file if_run.c.

References run_enable_tsf_sync(), RUN_LOCK, run_set_bssid(), RUN_UNLOCK, and run_softc::sc_bssid.

Referenced by run_attach().

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

◆ run_scan_start()

static void run_scan_start ( struct ieee80211com *  ic)
static

Definition at line 4964 of file if_run.c.

References run_disable_tsf(), RUN_LOCK, run_set_bssid(), and RUN_UNLOCK.

Referenced by run_attach().

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

◆ run_select_chan_group()

◆ run_sendprot()

static int run_sendprot ( struct run_softc sc,
const struct mbuf *  m,
struct ieee80211_node *  ni,
int  prot,
int  rate 
)
static

◆ run_set_agc()

static void run_set_agc ( struct run_softc sc,
uint8_t  agc 
)
static

Definition at line 3999 of file if_run.c.

References run_softc::bbp, run_softc::mac_ver, run_bbp_read(), and run_bbp_write().

Referenced by run_select_chan_group().

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

◆ run_set_basicrates()

static void run_set_basicrates ( struct run_softc sc)
static

Definition at line 5315 of file if_run.c.

References RT2860_LEGACY_BASIC_RATE, run_write(), and run_softc::sc_ic.

Referenced by run_newstate().

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

◆ run_set_bssid()

static void run_set_bssid ( struct run_softc sc,
const uint8_t *  bssid 
)
static

Definition at line 5336 of file if_run.c.

References RT2860_MAC_BSSID_DW0, RT2860_MAC_BSSID_DW1, and run_write().

Referenced by run_newstate(), run_scan_end(), and run_scan_start().

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

◆ run_set_chan()

static int run_set_chan ( struct run_softc sc,
struct ieee80211_channel *  c 
)
static

Definition at line 4879 of file if_run.c.

References chan, run_softc::mac_ver, run_delay(), run_iq_calib(), run_rt2870_set_chan(), run_rt3070_set_chan(), run_rt3572_set_chan(), run_rt3593_set_chan(), run_rt5390_set_chan(), run_rt5592_set_chan(), run_select_chan_group(), and run_softc::sc_ic.

Referenced by run_init_locked(), and run_set_channel().

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

◆ run_set_channel()

static void run_set_channel ( struct ieee80211com *  ic)
static

Definition at line 4924 of file if_run.c.

References RUN_LOCK, run_set_chan(), and RUN_UNLOCK.

Referenced by run_attach().

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

◆ run_set_leds()

static void run_set_leds ( struct run_softc sc,
uint16_t  which 
)
static

Definition at line 5329 of file if_run.c.

References run_softc::leds, RT2860_MCU_CMD_LEDS, and run_mcu_cmd().

Referenced by run_init_locked(), run_newstate(), and run_stop().

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

◆ run_set_macaddr()

static void run_set_macaddr ( struct run_softc sc,
const uint8_t *  addr 
)
static

Definition at line 5345 of file if_run.c.

References addr, RT2860_MAC_ADDR_DW0, RT2860_MAC_ADDR_DW1, and run_write().

Referenced by run_init_locked().

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

◆ run_set_region_4()

static int run_set_region_4 ( struct run_softc sc,
uint16_t  reg,
uint32_t  val,
int  len 
)
static

Definition at line 1448 of file if_run.c.

References error, len, reg, run_write(), and val.

Referenced by run_init_locked(), run_key_delete_cb(), and run_vap_delete().

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

◆ run_set_rx_antenna()

static void run_set_rx_antenna ( struct run_softc sc,
int  aux 
)
static

Definition at line 4852 of file if_run.c.

References run_softc::rf_rev, RT2860_GPIO_CTRL, RT2860_MCU_CMD_ANTSEL, RT5390_RF_5370, run_bbp_read(), run_bbp_write(), run_mcu_cmd(), run_read(), and run_write().

Referenced by run_init_locked().

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

◆ run_set_tx_desc()

◆ run_set_txpreamble()

static void run_set_txpreamble ( struct run_softc sc)
static

Definition at line 5301 of file if_run.c.

References RT2860_AUTO_RSP_CFG, RT2860_CCK_SHORT_EN, run_read(), run_write(), and run_softc::sc_ic.

Referenced by run_newstate().

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

◆ run_setup_tx_list()

static void run_setup_tx_list ( struct run_softc sc,
struct run_endpoint_queue pq 
)
static

Definition at line 1176 of file if_run.c.

References data, next, RUN_TX_RING_COUNT, run_tx_data::sc, run_endpoint_queue::tx_data, run_endpoint_queue::tx_fh, run_endpoint_queue::tx_nfree, and run_endpoint_queue::tx_qh.

Referenced by run_init_locked().

Here is the caller graph for this function:

◆ run_srom_read()

static __inline int run_srom_read ( struct run_softc sc,
uint16_t  addr,
uint16_t *  val 
)
static

Definition at line 1535 of file if_run.c.

References addr, run_softc::sc_srom_read, and val.

Referenced by run_get_txpower(), run_read_eeprom(), and run_rt3593_get_txpower().

Here is the caller graph for this function:

◆ run_start()

static void run_start ( struct run_softc sc)
static

Definition at line 3853 of file if_run.c.

References RUN_LOCK_ASSERT, RUN_RUNNING, run_tx(), run_softc::sc_flags, and run_softc::sc_snd.

Referenced by run_bulk_tx_callbackN(), and run_transmit().

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

◆ run_stop()

◆ run_transmit()

static int run_transmit ( struct ieee80211com *  ic,
struct mbuf *  m 
)
static

Definition at line 3831 of file if_run.c.

References error, RUN_LOCK, RUN_RUNNING, run_start(), RUN_UNLOCK, run_softc::sc_flags, and run_softc::sc_snd.

Referenced by run_attach().

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

◆ run_tx()

◆ run_tx_free()

static void run_tx_free ( struct run_endpoint_queue pq,
struct run_tx_data data,
int  txerr 
)
static

Definition at line 3164 of file if_run.c.

References data, next, run_endpoint_queue::tx_fh, and run_endpoint_queue::tx_nfree.

Referenced by run_bulk_tx_callbackN().

Here is the caller graph for this function:

◆ run_tx_mgt()

static int run_tx_mgt ( struct run_softc sc,
struct mbuf *  m,
struct ieee80211_node *  ni 
)
static

◆ run_tx_param()

static int run_tx_param ( struct run_softc sc,
struct mbuf *  m,
struct ieee80211_node *  ni,
const struct ieee80211_bpf_params *  params 
)
static

◆ run_txrx_enable()

◆ run_unsetup_tx_list()

static void run_unsetup_tx_list ( struct run_softc sc,
struct run_endpoint_queue pq 
)
static

Definition at line 1194 of file if_run.c.

References data, RUN_TX_RING_COUNT, run_endpoint_queue::tx_data, run_endpoint_queue::tx_fh, run_endpoint_queue::tx_nfree, and run_endpoint_queue::tx_qh.

Referenced by run_detach(), and run_stop().

Here is the caller graph for this function:

◆ run_update_beacon()

static void run_update_beacon ( struct ieee80211vap *  vap,
int  item 
)
static

Definition at line 4999 of file if_run.c.

References run_cmdq::arg0, run_vap::beacon_mbuf, run_softc::cmdq, run_softc::cmdq_store, run_softc::cmdq_task, run_cmdq::func, RUN_CMDQ_GET, RUN_DPRINTF, run_update_beacon_cb(), run_updateprot(), run_updateslot(), RUN_VAP, and run_vap::vap.

Referenced by run_vap_create().

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

◆ run_update_beacon_cb()

static void run_update_beacon_cb ( void *  arg)
static

◆ run_update_chw()

static void run_update_chw ( struct ieee80211com *  ic)
static

Definition at line 6412 of file if_run.c.

Referenced by run_attach().

Here is the caller graph for this function:

◆ run_update_mcast()

static void run_update_mcast ( struct ieee80211com *  ic)
static

Definition at line 5383 of file if_run.c.

Referenced by run_attach().

Here is the caller graph for this function:

◆ run_update_promisc()

static void run_update_promisc ( struct ieee80211com *  ic)
static

Definition at line 5191 of file if_run.c.

References RUN_LOCK, RUN_RUNNING, RUN_UNLOCK, run_update_promisc_locked(), and run_softc::sc_flags.

Referenced by run_attach().

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

◆ run_update_promisc_locked()

static void run_update_promisc_locked ( struct run_softc sc)
static

Definition at line 5174 of file if_run.c.

References RT2860_DROP_UC_NOME, RT2860_RX_FILTR_CFG, RUN_DPRINTF, run_read(), run_write(), and run_softc::sc_ic.

Referenced by run_parent(), and run_update_promisc().

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

◆ run_updateprot()

static void run_updateprot ( struct ieee80211com *  ic)
static

Definition at line 5092 of file if_run.c.

References run_cmdq::arg0, run_softc::cmdq, run_softc::cmdq_store, run_softc::cmdq_task, run_cmdq::func, RUN_CMDQ_GET, RUN_DPRINTF, and run_updateprot_cb().

Referenced by run_update_beacon().

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

◆ run_updateprot_cb()

static void run_updateprot_cb ( void *  arg)
static

Definition at line 5105 of file if_run.c.

References RT2860_CCK_PROT_CFG, RT2860_OFDM_PROT_CFG, RT2860_PHY_OFDM, RT2860_PROT_CTRL_CTS, RT2860_PROT_CTRL_RTS_CTS, RT2860_PROT_NAV_SHORT, rt2860_rates, RT2860_RIDX_CCK11, RT2860_RIDX_OFDM6, RT2860_RTSTH_EN, RT2860_TXOP_ALLOW_ALL, and run_write().

Referenced by run_init_locked(), and run_updateprot().

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

◆ run_updateslot()

static void run_updateslot ( struct ieee80211com *  ic)
static

Definition at line 5354 of file if_run.c.

References run_cmdq::arg0, run_softc::cmdq, run_softc::cmdq_store, run_softc::cmdq_task, run_cmdq::func, RUN_CMDQ_GET, RUN_DPRINTF, and run_updateslot_cb().

Referenced by run_attach(), run_newstate(), and run_update_beacon().

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

◆ run_updateslot_cb()

static void run_updateslot_cb ( void *  arg)
static

Definition at line 5370 of file if_run.c.

References RT2860_BKOFF_SLOT_CFG, run_read(), and run_write().

Referenced by run_updateslot().

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

◆ run_usb_timeout_cb()

static void run_usb_timeout_cb ( void *  arg)
static

Definition at line 5129 of file if_run.c.

References RUN_DPRINTF, RUN_LOCK_ASSERT, and run_reset_livelock().

Referenced by run_bulk_tx_callbackN().

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

◆ run_vap_create()

static struct ieee80211vap * run_vap_create ( struct ieee80211com *  ic,
const char  name[IFNAMSIZ],
int  unit,
enum ieee80211_opmode  opmode,
int  flags,
const uint8_t  bssid[IEEE80211_ADDR_LEN],
const uint8_t  mac[IEEE80211_ADDR_LEN] 
)
static

◆ run_vap_delete()

static void run_vap_delete ( struct ieee80211vap *  vap)
static

Definition at line 1101 of file if_run.c.

References run_vap::beacon_mbuf, run_softc::ratectl_run, RT2860_BCN_BASE, RT2860_SKEY, RUN_DPRINTF, RUN_LOCK, run_set_region_4(), RUN_UNLOCK, RUN_VAP, run_softc::rvp_bmap, run_softc::rvp_cnt, run_vap::rvp_id, and run_vap::vap.

Referenced by run_attach().

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

◆ run_wme_update()

static int run_wme_update ( struct ieee80211com *  ic)
static

Definition at line 2298 of file if_run.c.

References error, RT2860_EDCA_AC_CFG, RT2860_WMM_AIFSN_CFG, RT2860_WMM_CWMAX_CFG, RT2860_WMM_CWMIN_CFG, RT2860_WMM_TXOP0_CFG, RT2860_WMM_TXOP1_CFG, RUN_DPRINTF, RUN_LOCK, RUN_UNLOCK, and run_write().

Referenced by run_attach().

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

◆ run_write()

◆ run_write_2()

static int run_write_2 ( struct run_softc sc,
uint16_t  reg,
uint16_t  val 
)
static

Definition at line 1379 of file if_run.c.

References reg, req, RT2870_WRITE_2, run_do_request(), USETW, UT_WRITE_VENDOR_DEVICE, and val.

Referenced by run_write(), and run_write_region_1().

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

◆ run_write_region_1()

static int run_write_region_1 ( struct run_softc sc,
uint16_t  reg,
const uint8_t *  buf,
int  len 
)
static

Definition at line 1403 of file if_run.c.

References error, len, reg, req, RT2870_WRITE_REGION_1, run_do_request(), run_write_2(), USETW, and UT_WRITE_VENDOR_DEVICE.

Referenced by run_key_set_cb(), run_load_microcode(), run_newassoc_cb(), and run_update_beacon_cb().

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

◆ USB_PNP_HOST_INFO()

USB_PNP_HOST_INFO ( run_devs  )

Variable Documentation

◆ firstchan

u_int firstchan

Definition at line 648 of file if_run.c.

Referenced by run_rt5592_set_chan().

◆ k

◆ lastchan

u_int lastchan

Definition at line 649 of file if_run.c.

Referenced by run_rt5592_set_chan().

◆ n

◆ r

◆ reg

◆ 

const struct { ... } rt2860_def_bbp[]
Initial value:
= {
}
#define RT2860_DEF_BBP
Definition: if_runreg.h:1006

Referenced by run_bbp_init().

◆ rt2860_rates

◆ rt2860_rf2850

◆ 

const struct { ... } rt2870_def_mac[]
Initial value:
= {
}
#define RT2870_DEF_MAC
Definition: if_runreg.h:969

Referenced by run_init_locked().

◆ 

const struct { ... } rt3070_def_rf[]
Initial value:
= {
}
#define RT3070_DEF_RF
Definition: if_runreg.h:1319

Referenced by run_rt3070_rf_init().

◆ 

struct { ... } rt3070_freqs[]

◆ 

const struct { ... } rt3572_def_rf[]
Initial value:
= {
}
#define RT3572_DEF_RF
Definition: if_runreg.h:1340

Referenced by run_rt3070_rf_init().

◆ 

const struct { ... } rt3593_def_rf[]
Initial value:
= {
}
#define RT3593_DEF_RF
Definition: if_runreg.h:1373

Referenced by run_rt3593_rf_init().

◆ 

const struct { ... } rt5390_def_bbp[]
Initial value:
= {
}
#define RT5390_DEF_BBP
Definition: if_runreg.h:1024

Referenced by run_rt5390_bbp_init().

◆ 

const struct { ... } rt5390_def_rf[]
Initial value:
= {
}
#define RT5390_DEF_RF
Definition: if_runreg.h:1407

Referenced by run_rt5390_rf_init().

◆ 

const struct { ... } rt5392_def_rf[]
Initial value:
= {
}
#define RT5392_DEF_RF
Definition: if_runreg.h:1466

Referenced by run_rt5390_rf_init().

◆ 

const struct { ... } rt5592_2ghz_def_rf[]
Initial value:
= {
}
#define RT5592_2GHZ_DEF_RF
Definition: if_runreg.h:1549

Referenced by run_rt5592_set_chan().

◆ 

const struct { ... } rt5592_5ghz_def_rf[]
Initial value:
= {
}
#define RT5592_5GHZ_DEF_RF
Definition: if_runreg.h:1580

Referenced by run_rt5592_set_chan().

◆ rt5592_bbp_r196

const uint8_t rt5592_bbp_r196[]
static
Initial value:
= {
0xe0, 0x1f, 0x38, 0x32, 0x08, 0x28, 0x19, 0x0a, 0xff, 0x00,
0x16, 0x10, 0x10, 0x0b, 0x36, 0x2c, 0x26, 0x24, 0x42, 0x36,
0x30, 0x2d, 0x4c, 0x46, 0x3d, 0x40, 0x3e, 0x42, 0x3d, 0x40,
0x3c, 0x34, 0x2c, 0x2f, 0x3c, 0x35, 0x2e, 0x2a, 0x49, 0x41,
0x36, 0x31, 0x30, 0x30, 0x0e, 0x0d, 0x28, 0x21, 0x1c, 0x16,
0x50, 0x4a, 0x43, 0x40, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7d, 0x14, 0x32, 0x2c, 0x36, 0x4c, 0x43, 0x2c,
0x2e, 0x36, 0x30, 0x6e
}

Definition at line 592 of file if_run.c.

Referenced by run_rt5390_bbp_init().

◆ 

const struct { ... } rt5592_chan_5ghz[]
Initial value:
= {
}
#define RT5592_CHAN_5GHZ
Definition: if_runreg.h:1597

Referenced by run_rt5592_set_chan().

◆ 

const struct { ... } rt5592_def_bbp[]
Initial value:
= {
}
#define RT5592_DEF_BBP
Definition: if_runreg.h:1048

Referenced by run_rt5390_bbp_init().

◆ 

const struct { ... } rt5592_def_rf[]
Initial value:
= {
}
#define RT5592_DEF_RF
Definition: if_runreg.h:1526

Referenced by run_rt5390_rf_init().

◆ rt5592_freqs_20mhz

const struct rt5592_freqs rt5592_freqs_20mhz[]
static
Initial value:
= {
}
#define RT5592_RF5592_20MHZ
Definition: if_runreg.h:1209

Referenced by run_rt5592_set_chan().

◆ rt5592_freqs_40mhz

const struct rt5592_freqs rt5592_freqs_40mhz[]
static
Initial value:
= {
}
#define RT5592_RF5592_40MHZ
Definition: if_runreg.h:1264

Referenced by run_rt5592_set_chan().

◆ run_attach

device_attach_t run_attach
static

Definition at line 365 of file if_run.c.

◆ run_bulk_rx_callback

usb_callback_t run_bulk_rx_callback
static

Definition at line 368 of file if_run.c.

◆ run_bulk_tx_callback0

usb_callback_t run_bulk_tx_callback0
static

Definition at line 369 of file if_run.c.

◆ run_bulk_tx_callback1

usb_callback_t run_bulk_tx_callback1
static

Definition at line 370 of file if_run.c.

◆ run_bulk_tx_callback2

usb_callback_t run_bulk_tx_callback2
static

Definition at line 371 of file if_run.c.

◆ run_bulk_tx_callback3

usb_callback_t run_bulk_tx_callback3
static

Definition at line 372 of file if_run.c.

◆ run_bulk_tx_callback4

usb_callback_t run_bulk_tx_callback4
static

Definition at line 373 of file if_run.c.

◆ run_bulk_tx_callback5

usb_callback_t run_bulk_tx_callback5
static

Definition at line 374 of file if_run.c.

◆ run_config

const struct usb_config run_config[RUN_N_XFER]
static

Definition at line 656 of file if_run.c.

Referenced by run_attach().

◆ run_detach

device_detach_t run_detach
static

Definition at line 366 of file if_run.c.

Referenced by run_attach().

◆ run_devclass

devclass_t run_devclass
static

Definition at line 6440 of file if_run.c.

◆ run_devs

const STRUCT_USB_HOST_ID run_devs[]
static

Definition at line 131 of file if_run.c.

Referenced by run_autoinst(), and run_match().

◆ run_driver

driver_t run_driver
static
Initial value:
= {
.name = "run",
.methods = run_methods,
.size = sizeof(struct run_softc)
}
static device_method_t run_methods[]
Definition: if_run.c:6426

Definition at line 6434 of file if_run.c.

◆ run_etag

eventhandler_tag run_etag
static

Definition at line 507 of file if_run.c.

Referenced by run_driver_loaded().

◆ run_match

device_probe_t run_match
static

Definition at line 364 of file if_run.c.

◆ run_methods

device_method_t run_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, run_match),
DEVMETHOD(device_attach, run_attach),
DEVMETHOD(device_detach, run_detach),
DEVMETHOD_END
}
static device_detach_t run_detach
Definition: if_run.c:366
static device_probe_t run_match
Definition: if_run.c:364
static device_attach_t run_attach
Definition: if_run.c:365

Definition at line 6426 of file if_run.c.

◆ val