FreeBSD kernel usb device Code
if_zyd.c File Reference
#include <sys/cdefs.h>
#include "opt_wlan.h"
#include <sys/param.h>
#include <sys/sockio.h>
#include <sys/sysctl.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/condvar.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/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 <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 <dev/usb/usbdi_util.h>
#include "usbdevs.h"
#include <dev/usb/wlan/if_zydreg.h>
#include <dev/usb/wlan/if_zydfw.h>
Include dependency graph for if_zyd.c:

Go to the source code of this file.

Macros

#define DPRINTF(sc, m, fmt, ...)
 
#define zyd_do_request(sc, req, data)    usbd_do_request_flags((sc)->sc_udev, &(sc)->sc_mtx, req, data, 0, NULL, 5000)
 
#define ZYD_ZD1211   0
 
#define ZYD_ZD1211B   1
 
#define ZYD_ZD1211_DEV(v, p)    { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, ZYD_ZD1211) }
 
#define ZYD_ZD1211B_DEV(v, p)    { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, ZYD_ZD1211B) }
 
#define zyd_read16_m(sc, val, data)
 
#define zyd_write16_m(sc, val, data)
 
#define zyd_read32_m(sc, val, data)
 
#define zyd_write32_m(sc, val, data)
 
#define ZYD_AL2230_PHY_BANDEDGE6
 
#define ZYD_GCT_INTR_REG   0x85c1
 

Functions

 __FBSDID ("$FreeBSD$")
 
static struct ieee80211vap * zyd_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 zyd_vap_delete (struct ieee80211vap *)
 
static void zyd_tx_free (struct zyd_tx_data *, int)
 
static void zyd_setup_tx_list (struct zyd_softc *)
 
static void zyd_unsetup_tx_list (struct zyd_softc *)
 
static int zyd_newstate (struct ieee80211vap *, enum ieee80211_state, int)
 
static int zyd_cmd (struct zyd_softc *, uint16_t, const void *, int, void *, int, int)
 
static int zyd_read16 (struct zyd_softc *, uint16_t, uint16_t *)
 
static int zyd_read32 (struct zyd_softc *, uint16_t, uint32_t *)
 
static int zyd_write16 (struct zyd_softc *, uint16_t, uint16_t)
 
static int zyd_write32 (struct zyd_softc *, uint16_t, uint32_t)
 
static int zyd_rfwrite (struct zyd_softc *, uint32_t)
 
static int zyd_lock_phy (struct zyd_softc *)
 
static int zyd_unlock_phy (struct zyd_softc *)
 
static int zyd_rf_attach (struct zyd_softc *, uint8_t)
 
static const char * zyd_rf_name (uint8_t)
 
static int zyd_hw_init (struct zyd_softc *)
 
static int zyd_read_pod (struct zyd_softc *)
 
static int zyd_read_eeprom (struct zyd_softc *)
 
static int zyd_get_macaddr (struct zyd_softc *)
 
static int zyd_set_macaddr (struct zyd_softc *, const uint8_t *)
 
static int zyd_set_bssid (struct zyd_softc *, const uint8_t *)
 
static int zyd_switch_radio (struct zyd_softc *, int)
 
static int zyd_set_led (struct zyd_softc *, int, int)
 
static void zyd_set_multi (struct zyd_softc *)
 
static void zyd_update_mcast (struct ieee80211com *)
 
static int zyd_set_rxfilter (struct zyd_softc *)
 
static void zyd_set_chan (struct zyd_softc *, struct ieee80211_channel *)
 
static int zyd_set_beacon_interval (struct zyd_softc *, int)
 
static void zyd_rx_data (struct usb_xfer *, int, uint16_t)
 
static int zyd_tx_start (struct zyd_softc *, struct mbuf *, struct ieee80211_node *)
 
static int zyd_transmit (struct ieee80211com *, struct mbuf *)
 
static void zyd_start (struct zyd_softc *)
 
static int zyd_raw_xmit (struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *)
 
static void zyd_parent (struct ieee80211com *)
 
static void zyd_init_locked (struct zyd_softc *)
 
static void zyd_stop (struct zyd_softc *)
 
static int zyd_loadfirmware (struct zyd_softc *)
 
static void zyd_scan_start (struct ieee80211com *)
 
static void zyd_scan_end (struct ieee80211com *)
 
static void zyd_getradiocaps (struct ieee80211com *, int, int *, struct ieee80211_channel[])
 
static void zyd_set_channel (struct ieee80211com *)
 
static int zyd_rfmd_init (struct zyd_rf *)
 
static int zyd_rfmd_switch_radio (struct zyd_rf *, int)
 
static int zyd_rfmd_set_channel (struct zyd_rf *, uint8_t)
 
static int zyd_al2230_init (struct zyd_rf *)
 
static int zyd_al2230_switch_radio (struct zyd_rf *, int)
 
static int zyd_al2230_set_channel (struct zyd_rf *, uint8_t)
 
static int zyd_al2230_set_channel_b (struct zyd_rf *, uint8_t)
 
static int zyd_al2230_init_b (struct zyd_rf *)
 
static int zyd_al7230B_init (struct zyd_rf *)
 
static int zyd_al7230B_switch_radio (struct zyd_rf *, int)
 
static int zyd_al7230B_set_channel (struct zyd_rf *, uint8_t)
 
static int zyd_al2210_init (struct zyd_rf *)
 
static int zyd_al2210_switch_radio (struct zyd_rf *, int)
 
static int zyd_al2210_set_channel (struct zyd_rf *, uint8_t)
 
static int zyd_gct_init (struct zyd_rf *)
 
static int zyd_gct_switch_radio (struct zyd_rf *, int)
 
static int zyd_gct_set_channel (struct zyd_rf *, uint8_t)
 
static int zyd_gct_mode (struct zyd_rf *)
 
static int zyd_gct_set_channel_synth (struct zyd_rf *, int, int)
 
static int zyd_gct_write (struct zyd_rf *, uint16_t)
 
static int zyd_gct_txgain (struct zyd_rf *, uint8_t)
 
static int zyd_maxim2_init (struct zyd_rf *)
 
static int zyd_maxim2_switch_radio (struct zyd_rf *, int)
 
static int zyd_maxim2_set_channel (struct zyd_rf *, uint8_t)
 
static int zyd_match (device_t dev)
 
static int zyd_attach (device_t dev)
 
static void zyd_drain_mbufq (struct zyd_softc *sc)
 
static int zyd_detach (device_t dev)
 
static void zyd_intr_read_callback (struct usb_xfer *xfer, usb_error_t error)
 
static void zyd_intr_write_callback (struct usb_xfer *xfer, usb_error_t error)
 
static int zyd_rfwrite_cr (struct zyd_softc *sc, uint32_t val)
 
static int zyd_al2230_fini (struct zyd_rf *rf)
 
static int zyd_al2230_bandedge6 (struct zyd_rf *rf, struct ieee80211_channel *c)
 
static u_int zyd_hash_maddr (void *arg, struct sockaddr_dl *sdl, u_int cnt)
 
static void zyd_bulk_read_callback (struct usb_xfer *xfer, usb_error_t error)
 
static uint8_t zyd_plcp_signal (struct zyd_softc *sc, int rate)
 
static void zyd_bulk_write_callback (struct usb_xfer *xfer, usb_error_t error)
 
 DRIVER_MODULE (zyd, uhub, zyd_driver, zyd_devclass, NULL, 0)
 
 MODULE_DEPEND (zyd, usb, 1, 1, 1)
 
 MODULE_DEPEND (zyd, wlan, 1, 1, 1)
 
 MODULE_VERSION (zyd, 1)
 
 USB_PNP_HOST_INFO (zyd_devs)
 

Variables

static device_probe_t zyd_match
 
static device_attach_t zyd_attach
 
static device_detach_t zyd_detach
 
static usb_callback_t zyd_intr_read_callback
 
static usb_callback_t zyd_intr_write_callback
 
static usb_callback_t zyd_bulk_read_callback
 
static usb_callback_t zyd_bulk_write_callback
 
static const struct zyd_phy_pair zyd_def_phy [] = ZYD_DEF_PHY
 
static const struct zyd_phy_pair zyd_def_phyB [] = ZYD_DEF_PHYB
 
static const STRUCT_USB_HOST_ID zyd_devs []
 
static const struct usb_config zyd_config [ZYD_N_TRANSFER]
 
static device_method_t zyd_methods []
 
static driver_t zyd_driver
 
static devclass_t zyd_devclass
 

Macro Definition Documentation

◆ DPRINTF

#define DPRINTF (   sc,
  m,
  fmt,
  ... 
)
Value:
do { \
(void) sc; \
} while (0)

Definition at line 103 of file if_zyd.c.

◆ ZYD_AL2230_PHY_BANDEDGE6

#define ZYD_AL2230_PHY_BANDEDGE6
Value:
{ \
{ ZYD_CR128, 0x14 }, { ZYD_CR129, 0x12 }, { ZYD_CR130, 0x10 }, \
{ ZYD_CR47, 0x1e } \
}
#define ZYD_CR129
Definition: if_zydreg.h:304
#define ZYD_CR128
Definition: if_zydreg.h:303
#define ZYD_CR47
Definition: if_zydreg.h:222
#define ZYD_CR130
Definition: if_zydreg.h:305

Definition at line 1223 of file if_zyd.c.

◆ zyd_do_request

#define zyd_do_request (   sc,
  req,
  data 
)     usbd_do_request_flags((sc)->sc_udev, &(sc)->sc_mtx, req, data, 0, NULL, 5000)

Definition at line 108 of file if_zyd.c.

◆ ZYD_GCT_INTR_REG

#define ZYD_GCT_INTR_REG   0x85c1

◆ zyd_read16_m

#define zyd_read16_m (   sc,
  val,
  data 
)
Value:
do { \
error = zyd_read16(sc, val, data); \
if (error != 0) \
goto fail; \
} while (0)
uint32_t val
Definition: if_rum.c:284
uint16_t fail
Definition: if_runreg.h:2
struct @109 error
static int zyd_read16(struct zyd_softc *, uint16_t, uint16_t *)
Definition: if_zyd.c:839

Definition at line 296 of file if_zyd.c.

◆ zyd_read32_m

#define zyd_read32_m (   sc,
  val,
  data 
)
Value:
do { \
error = zyd_read32(sc, val, data); \
if (error != 0) \
goto fail; \
} while (0)
static int zyd_read32(struct zyd_softc *, uint16_t, uint32_t *)
Definition: if_zyd.c:853

Definition at line 306 of file if_zyd.c.

◆ zyd_write16_m

#define zyd_write16_m (   sc,
  val,
  data 
)
Value:
do { \
error = zyd_write16(sc, val, data); \
if (error != 0) \
goto fail; \
} while (0)
static int zyd_write16(struct zyd_softc *, uint16_t, uint16_t)
Definition: if_zyd.c:869

Definition at line 301 of file if_zyd.c.

◆ zyd_write32_m

#define zyd_write32_m (   sc,
  val,
  data 
)
Value:
do { \
error = zyd_write32(sc, val, data); \
if (error != 0) \
goto fail; \
} while (0)
static int zyd_write32(struct zyd_softc *, uint16_t, uint32_t)
Definition: if_zyd.c:880

Definition at line 311 of file if_zyd.c.

◆ ZYD_ZD1211

#define ZYD_ZD1211   0

Definition at line 198 of file if_zyd.c.

◆ ZYD_ZD1211_DEV

#define ZYD_ZD1211_DEV (   v,
 
)     { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, ZYD_ZD1211) }

Definition at line 201 of file if_zyd.c.

◆ ZYD_ZD1211B

#define ZYD_ZD1211B   1

Definition at line 199 of file if_zyd.c.

◆ ZYD_ZD1211B_DEV

#define ZYD_ZD1211B_DEV (   v,
 
)     { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, ZYD_ZD1211B) }

Definition at line 203 of file if_zyd.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ DRIVER_MODULE()

DRIVER_MODULE ( zyd  ,
uhub  ,
zyd_driver  ,
zyd_devclass  ,
NULL  ,
 
)

◆ MODULE_DEPEND() [1/2]

MODULE_DEPEND ( zyd  ,
usb  ,
,
,
 
)

◆ MODULE_DEPEND() [2/2]

MODULE_DEPEND ( zyd  ,
wlan  ,
,
,
 
)

◆ MODULE_VERSION()

MODULE_VERSION ( zyd  ,
 
)

◆ USB_PNP_HOST_INFO()

USB_PNP_HOST_INFO ( zyd_devs  )

◆ zyd_al2210_init()

static int zyd_al2210_init ( struct zyd_rf rf)
static

Definition at line 1345 of file if_zyd.c.

References error, fail, reg, zyd_rf::rf_sc, val, ZYD_AL2210_PHY, ZYD_AL2210_RF, ZYD_CR18, ZYD_CR47, ZYD_CR_RADIO_PD, ZYD_CR_RFCFG, zyd_read32_m, zyd_rfwrite(), zyd_write16_m, and zyd_write32_m.

Referenced by zyd_rf_attach().

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

◆ zyd_al2210_set_channel()

static int zyd_al2210_set_channel ( struct zyd_rf rf,
uint8_t  chan 
)
static

Definition at line 1385 of file if_zyd.c.

References chan, error, fail, zyd_rf::rf_sc, ZYD_AL2210_CHANTABLE, ZYD_CR18, ZYD_CR47, ZYD_CR_RADIO_PD, ZYD_CR_RFCFG, zyd_read32_m, zyd_rfwrite(), zyd_write16_m, and zyd_write32_m.

Referenced by zyd_rf_attach().

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

◆ zyd_al2210_switch_radio()

static int zyd_al2210_switch_radio ( struct zyd_rf rf,
int  on 
)
static

Definition at line 1377 of file if_zyd.c.

Referenced by zyd_rf_attach().

Here is the caller graph for this function:

◆ zyd_al2230_bandedge6()

static int zyd_al2230_bandedge6 ( struct zyd_rf rf,
struct ieee80211_channel *  c 
)
static

Definition at line 1230 of file if_zyd.c.

References chan, error, fail, r, reg, zyd_rf::rf_sc, zyd_softc::sc_ic, val, ZYD_AL2230_PHY_BANDEDGE6, and zyd_write16_m.

Referenced by zyd_rf_attach().

Here is the caller graph for this function:

◆ zyd_al2230_fini()

static int zyd_al2230_fini ( struct zyd_rf rf)
static

Definition at line 1070 of file if_zyd.c.

References error, fail, reg, zyd_rf::rf_sc, zyd_softc::sc_newphy, val, ZYD_AL2230_PHY_FINI_PART1, ZYD_CR203, ZYD_CR9, and zyd_write16_m.

Referenced by zyd_al2230_init_b(), and zyd_al2230_set_channel_b().

Here is the caller graph for this function:

◆ zyd_al2230_init()

static int zyd_al2230_init ( struct zyd_rf rf)
static

Definition at line 1014 of file if_zyd.c.

References error, fail, reg, zyd_rf::rf_sc, zyd_softc::sc_al2230s, zyd_softc::sc_rfrev, val, ZYD_AL2230_PHY, ZYD_AL2230_RF_PART1, ZYD_AL2230_RF_PART2, ZYD_AL2230_RF_PART3, ZYD_AL2230S_PHY_INIT, ZYD_CR138, ZYD_CR203, ZYD_CR251, ZYD_RF_AL2230S, zyd_rfwrite(), and zyd_write16_m.

Referenced by zyd_rf_attach().

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

◆ zyd_al2230_init_b()

static int zyd_al2230_init_b ( struct zyd_rf rf)
static

◆ zyd_al2230_set_channel()

static int zyd_al2230_set_channel ( struct zyd_rf rf,
uint8_t  chan 
)
static

Definition at line 1169 of file if_zyd.c.

References chan, error, fail, r1, r2, reg, zyd_rf::rf_sc, val, ZYD_AL2230_CHANTABLE, ZYD_CR138, ZYD_CR203, zyd_rfwrite(), and zyd_write16_m.

Referenced by zyd_rf_attach().

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

◆ zyd_al2230_set_channel_b()

static int zyd_al2230_set_channel_b ( struct zyd_rf rf,
uint8_t  chan 
)
static

Definition at line 1197 of file if_zyd.c.

References chan, error, fail, r1, r2, reg, zyd_rf::rf_sc, val, ZYD_AL2230_CHANTABLE_B, zyd_al2230_fini(), ZYD_AL2230_PHY_PART1, zyd_rfwrite_cr(), and zyd_write16_m.

Referenced by zyd_rf_attach().

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

◆ zyd_al2230_switch_radio()

static int zyd_al2230_switch_radio ( struct zyd_rf rf,
int  on 
)
static

Definition at line 1157 of file if_zyd.c.

References error, fail, zyd_rf::rf_sc, zyd_softc::sc_macrev, ZYD_CR11, ZYD_CR251, zyd_write16_m, and ZYD_ZD1211.

Referenced by zyd_rf_attach().

Here is the caller graph for this function:

◆ zyd_al7230B_init()

static int zyd_al7230B_init ( struct zyd_rf rf)
static

Definition at line 1251 of file if_zyd.c.

References error, fail, reg, zyd_rf::rf_sc, val, ZYD_AL7230B_PHY_1, ZYD_AL7230B_PHY_2, ZYD_AL7230B_PHY_3, ZYD_AL7230B_RF_1, ZYD_AL7230B_RF_2, zyd_rfwrite(), and zyd_write16_m.

Referenced by zyd_rf_attach().

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

◆ zyd_al7230B_set_channel()

static int zyd_al7230B_set_channel ( struct zyd_rf rf,
uint8_t  chan 
)
static

Definition at line 1301 of file if_zyd.c.

References chan, error, fail, r1, r2, zyd_rf::rf_sc, ZYD_AL7230B_CHANTABLE, ZYD_AL7230B_RF_SETCHANNEL, ZYD_CR128, ZYD_CR129, ZYD_CR130, ZYD_CR136, ZYD_CR203, ZYD_CR240, ZYD_CR251, ZYD_CR38, zyd_rfwrite(), and zyd_write16_m.

Referenced by zyd_rf_attach().

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

◆ zyd_al7230B_switch_radio()

static int zyd_al7230B_switch_radio ( struct zyd_rf rf,
int  on 
)
static

Definition at line 1289 of file if_zyd.c.

References error, fail, zyd_rf::rf_sc, ZYD_CR11, ZYD_CR251, and zyd_write16_m.

Referenced by zyd_rf_attach().

Here is the caller graph for this function:

◆ zyd_attach()

◆ zyd_bulk_read_callback()

◆ zyd_bulk_write_callback()

◆ zyd_cmd()

static int zyd_cmd ( struct zyd_softc sc,
uint16_t  code,
const void *  idata,
int  ilen,
void *  odata,
int  olen,
int  flags 
)
static

Definition at line 802 of file if_zyd.c.

References zyd_rq::cmd, zyd_cmd::code, zyd_cmd::data, DPRINTF, error, zyd_rq::flags, zyd_rq::idata, zyd_rq::ilen, zyd_rq::odata, zyd_rq::olen, zyd_softc::sc_dev, zyd_softc::sc_mtx, zyd_softc::sc_xfer, usbd_transfer_start(), ZYD_INTR_RD, and ZYD_INTR_WR.

Referenced by zyd_read16(), zyd_read32(), zyd_rfwrite(), zyd_write16(), and zyd_write32().

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

◆ zyd_detach()

◆ zyd_drain_mbufq()

static void zyd_drain_mbufq ( struct zyd_softc sc)
static

Definition at line 424 of file if_zyd.c.

References zyd_softc::sc_snd, and ZYD_LOCK_ASSERT.

Referenced by zyd_detach(), and zyd_stop().

Here is the caller graph for this function:

◆ zyd_gct_init()

static int zyd_gct_init ( struct zyd_rf rf)
static

Definition at line 1415 of file if_zyd.c.

References data, error, fail, zyd_rf::idx, reg, zyd_rf::rf_sc, val, ZYD_CR203, ZYD_GCT_INTR_REG, zyd_gct_mode(), ZYD_GCT_PHY, ZYD_GCT_RF, zyd_gct_set_channel_synth(), ZYD_GCT_VCO, zyd_gct_write(), zyd_read16_m, zyd_rfwrite(), and zyd_write16_m.

Referenced by zyd_rf_attach().

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

◆ zyd_gct_mode()

static int zyd_gct_mode ( struct zyd_rf rf)
static

Definition at line 1470 of file if_zyd.c.

References error, zyd_rf::rf_sc, and zyd_rfwrite().

Referenced by zyd_gct_init(), and zyd_gct_set_channel().

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

◆ zyd_gct_set_channel()

static int zyd_gct_set_channel ( struct zyd_rf rf,
uint8_t  chan 
)
static

Definition at line 1527 of file if_zyd.c.

References chan, error, fail, zyd_rf::idx, reg, zyd_rf::rf_sc, val, ZYD_CR12, ZYD_CR203, ZYD_CR77, ZYD_CR78, ZYD_CR79, ZYD_CR80, ZYD_CR81, zyd_gct_mode(), zyd_gct_set_channel_synth(), zyd_gct_txgain(), ZYD_GCT_VCO, zyd_gct_write(), and zyd_write16_m.

Referenced by zyd_rf_attach().

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

◆ zyd_gct_set_channel_synth()

static int zyd_gct_set_channel_synth ( struct zyd_rf rf,
int  chan,
int  acal 
)
static

Definition at line 1486 of file if_zyd.c.

References chan, error, zyd_rf::rf_sc, ZYD_GCT_CHANNEL_ACAL, ZYD_GCT_CHANNEL_DIV, ZYD_GCT_CHANNEL_STD, and zyd_rfwrite().

Referenced by zyd_gct_init(), and zyd_gct_set_channel().

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

◆ zyd_gct_switch_radio()

static int zyd_gct_switch_radio ( struct zyd_rf rf,
int  on 
)
static

Definition at line 1510 of file if_zyd.c.

References error, fail, zyd_rf::rf_sc, zyd_softc::sc_macrev, ZYD_CR11, ZYD_CR251, zyd_rfwrite(), zyd_write16_m, and ZYD_ZD1211B.

Referenced by zyd_rf_attach().

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

◆ zyd_gct_txgain()

static int zyd_gct_txgain ( struct zyd_rf rf,
uint8_t  chan 
)
static

Definition at line 1558 of file if_zyd.c.

References chan, zyd_rf::rf_sc, zyd_softc::sc_dev, zyd_softc::sc_pwrint, ZYD_GCT_TXGAIN, and zyd_rfwrite().

Referenced by zyd_gct_set_channel().

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

◆ zyd_gct_write()

static int zyd_gct_write ( struct zyd_rf rf,
uint16_t  value 
)
static

Definition at line 1502 of file if_zyd.c.

References zyd_rf::rf_sc, value, and zyd_rfwrite().

Referenced by zyd_gct_init(), and zyd_gct_set_channel().

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

◆ zyd_get_macaddr()

static int zyd_get_macaddr ( struct zyd_softc sc)
static

Definition at line 1892 of file if_zyd.c.

References error, req, zyd_softc::sc_dev, zyd_softc::sc_ic, usbd_errstr(), USETW, UT_READ_VENDOR_DEVICE, zyd_do_request, ZYD_EEPROM_MAC_ADDR_P1, and ZYD_READFWDATAREQ.

Referenced by zyd_attach().

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

◆ zyd_getradiocaps()

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

Definition at line 2881 of file if_zyd.c.

Referenced by zyd_attach().

Here is the caller graph for this function:

◆ zyd_hash_maddr()

static u_int zyd_hash_maddr ( void *  arg,
struct sockaddr_dl *  sdl,
u_int  cnt 
)
static

Definition at line 1973 of file if_zyd.c.

Referenced by zyd_set_multi().

Here is the caller graph for this function:

◆ zyd_hw_init()

◆ zyd_init_locked()

◆ zyd_intr_read_callback()

◆ zyd_intr_write_callback()

◆ zyd_loadfirmware()

static int zyd_loadfirmware ( struct zyd_softc sc)
static

◆ zyd_lock_phy()

static int zyd_lock_phy ( struct zyd_softc sc)
static

Definition at line 928 of file if_zyd.c.

References error, fail, ZYD_MAC_MISC, zyd_read32_m, and zyd_write32_m.

Referenced by zyd_hw_init(), zyd_set_chan(), and zyd_switch_radio().

Here is the caller graph for this function:

◆ zyd_match()

static int zyd_match ( device_t  dev)
static

◆ zyd_maxim2_init()

static int zyd_maxim2_init ( struct zyd_rf rf)
static

Definition at line 1577 of file if_zyd.c.

References error, fail, reg, zyd_rf::rf_sc, val, ZYD_CR203, ZYD_MAXIM2_PHY, ZYD_MAXIM2_RF, zyd_read16_m, zyd_rfwrite(), and zyd_write16_m.

Referenced by zyd_rf_attach().

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

◆ zyd_maxim2_set_channel()

static int zyd_maxim2_set_channel ( struct zyd_rf rf,
uint8_t  chan 
)
static

Definition at line 1612 of file if_zyd.c.

References chan, error, fail, r1, r2, reg, zyd_rf::rf_sc, val, ZYD_CR203, ZYD_MAXIM2_CHANTABLE, ZYD_MAXIM2_PHY, ZYD_MAXIM2_RF, zyd_read16_m, zyd_rfwrite(), and zyd_write16_m.

Referenced by zyd_rf_attach().

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

◆ zyd_maxim2_switch_radio()

static int zyd_maxim2_switch_radio ( struct zyd_rf rf,
int  on 
)
static

Definition at line 1604 of file if_zyd.c.

Referenced by zyd_rf_attach().

Here is the caller graph for this function:

◆ zyd_newstate()

static int zyd_newstate ( struct ieee80211vap *  vap,
enum ieee80211_state  nstate,
int  arg 
)
static

Definition at line 581 of file if_zyd.c.

References DPRINTF, error, fail, zyd_vap::newstate, zyd_softc::sc_bssid, zyd_softc::sc_fwbase, zyd_vap::vap, ZYD_FW_LINK_STATUS, ZYD_LED1, ZYD_LOCK, zyd_set_bssid(), zyd_set_chan(), zyd_set_led(), ZYD_UNLOCK, ZYD_VAP, and zyd_write32_m.

Referenced by zyd_vap_create().

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

◆ zyd_parent()

static void zyd_parent ( struct ieee80211com *  ic)
static

Definition at line 2630 of file if_zyd.c.

References zyd_softc::sc_flags, ZYD_FLAG_DETACHED, ZYD_FLAG_RUNNING, zyd_init_locked(), ZYD_LOCK, zyd_set_multi(), zyd_stop(), and ZYD_UNLOCK.

Referenced by zyd_attach().

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

◆ zyd_plcp_signal()

static uint8_t zyd_plcp_signal ( struct zyd_softc sc,
int  rate 
)
static

Definition at line 2315 of file if_zyd.c.

References zyd_softc::sc_dev.

Referenced by zyd_tx_start().

Here is the caller graph for this function:

◆ zyd_raw_xmit()

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

Definition at line 2596 of file if_zyd.c.

References zyd_softc::sc_flags, zyd_softc::tx_nfree, ZYD_FLAG_RUNNING, ZYD_LOCK, zyd_tx_start(), and ZYD_UNLOCK.

Referenced by zyd_attach().

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

◆ zyd_read16()

static int zyd_read16 ( struct zyd_softc sc,
uint16_t  reg,
uint16_t *  val 
)
static

Definition at line 839 of file if_zyd.c.

References error, reg, val, zyd_pair::val, zyd_cmd(), ZYD_CMD_FLAG_READ, and ZYD_CMD_IORD.

Here is the call graph for this function:

◆ zyd_read32()

static int zyd_read32 ( struct zyd_softc sc,
uint16_t  reg,
uint32_t *  val 
)
static

Definition at line 853 of file if_zyd.c.

References error, reg, val, zyd_cmd(), ZYD_CMD_FLAG_READ, ZYD_CMD_IORD, ZYD_REG32_HI, and ZYD_REG32_LO.

Referenced by zyd_set_chan().

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

◆ zyd_read_eeprom()

static int zyd_read_eeprom ( struct zyd_softc sc)
static

◆ zyd_read_pod()

static int zyd_read_pod ( struct zyd_softc sc)
static

◆ zyd_rf_attach()

◆ zyd_rf_name()

static const char * zyd_rf_name ( uint8_t  type)
static

Definition at line 1718 of file if_zyd.c.

References type.

Referenced by zyd_init_locked(), and zyd_rf_attach().

Here is the caller graph for this function:

◆ zyd_rfmd_init()

static int zyd_rfmd_init ( struct zyd_rf rf)
static

Definition at line 957 of file if_zyd.c.

References error, fail, reg, zyd_rf::rf_sc, val, ZYD_RFMD_PHY, ZYD_RFMD_RF, zyd_rfwrite(), and zyd_write16_m.

Referenced by zyd_rf_attach().

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

◆ zyd_rfmd_set_channel()

static int zyd_rfmd_set_channel ( struct zyd_rf rf,
uint8_t  chan 
)
static

Definition at line 991 of file if_zyd.c.

References chan, error, fail, r1, r2, zyd_rf::rf_sc, ZYD_RFMD_CHANTABLE, and zyd_rfwrite().

Referenced by zyd_rf_attach().

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

◆ zyd_rfmd_switch_radio()

static int zyd_rfmd_switch_radio ( struct zyd_rf rf,
int  on 
)
static

Definition at line 979 of file if_zyd.c.

References error, fail, zyd_rf::rf_sc, ZYD_CR10, ZYD_CR11, and zyd_write16_m.

Referenced by zyd_rf_attach().

Here is the caller graph for this function:

◆ zyd_rfwrite()

◆ zyd_rfwrite_cr()

static int zyd_rfwrite_cr ( struct zyd_softc sc,
uint32_t  val 
)
static

Definition at line 916 of file if_zyd.c.

References error, fail, val, ZYD_CR242, ZYD_CR243, ZYD_CR244, and zyd_write16_m.

Referenced by zyd_al2230_init_b(), and zyd_al2230_set_channel_b().

Here is the caller graph for this function:

◆ zyd_rx_data()

◆ zyd_scan_end()

static void zyd_scan_end ( struct ieee80211com *  ic)
static

Definition at line 2870 of file if_zyd.c.

References zyd_softc::sc_bssid, ZYD_LOCK, zyd_set_bssid(), and ZYD_UNLOCK.

Referenced by zyd_attach().

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

◆ zyd_scan_start()

static void zyd_scan_start ( struct ieee80211com *  ic)
static

Definition at line 2859 of file if_zyd.c.

References ZYD_LOCK, zyd_set_bssid(), and ZYD_UNLOCK.

Referenced by zyd_attach().

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

◆ zyd_set_beacon_interval()

static int zyd_set_beacon_interval ( struct zyd_softc sc,
int  bintval 
)
static

Definition at line 2120 of file if_zyd.c.

References error, fail, zyd_softc::sc_atim_wnd, zyd_softc::sc_bcn_int, zyd_softc::sc_pre_tbtt, val, ZYD_CR_ATIM_WND_PERIOD, ZYD_CR_BCN_INTERVAL, ZYD_CR_PRE_TBTT, zyd_read32_m, and zyd_write32_m.

Referenced by zyd_hw_init().

Here is the caller graph for this function:

◆ zyd_set_bssid()

static int zyd_set_bssid ( struct zyd_softc sc,
const uint8_t *  addr 
)
static

Definition at line 1927 of file if_zyd.c.

References addr, error, fail, ZYD_MAC_BSSADRH, ZYD_MAC_BSSADRL, and zyd_write32_m.

Referenced by zyd_newstate(), zyd_scan_end(), and zyd_scan_start().

Here is the caller graph for this function:

◆ zyd_set_chan()

◆ zyd_set_channel()

static void zyd_set_channel ( struct ieee80211com *  ic)
static

Definition at line 2893 of file if_zyd.c.

References ZYD_LOCK, zyd_set_chan(), and ZYD_UNLOCK.

Referenced by zyd_attach().

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

◆ zyd_set_led()

static int zyd_set_led ( struct zyd_softc sc,
int  which,
int  on 
)
static

Definition at line 1958 of file if_zyd.c.

References error, fail, ZYD_MAC_TX_PE_CONTROL, zyd_read32_m, and zyd_write32_m.

Referenced by zyd_newstate().

Here is the caller graph for this function:

◆ zyd_set_macaddr()

static int zyd_set_macaddr ( struct zyd_softc sc,
const uint8_t *  addr 
)
static

Definition at line 1913 of file if_zyd.c.

References addr, error, fail, ZYD_MAC_MACADRH, ZYD_MAC_MACADRL, and zyd_write32_m.

Referenced by zyd_init_locked().

Here is the caller graph for this function:

◆ zyd_set_multi()

static void zyd_set_multi ( struct zyd_softc sc)
static

Definition at line 1988 of file if_zyd.c.

References error, fail, zyd_softc::sc_dev, zyd_softc::sc_flags, zyd_softc::sc_ic, ZYD_FLAG_RUNNING, zyd_hash_maddr(), ZYD_MAC_GHTBH, ZYD_MAC_GHTBL, and zyd_write32_m.

Referenced by zyd_init_locked(), zyd_parent(), and zyd_update_mcast().

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

◆ zyd_set_rxfilter()

static int zyd_set_rxfilter ( struct zyd_softc sc)
static

Definition at line 2031 of file if_zyd.c.

References zyd_softc::sc_ic, ZYD_FILTER_BSS, ZYD_FILTER_HOSTAP, ZYD_FILTER_MONITOR, ZYD_MAC_RXFILTER, and zyd_write32().

Referenced by zyd_init_locked().

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

◆ zyd_setup_tx_list()

static void zyd_setup_tx_list ( struct zyd_softc sc)
static

Definition at line 536 of file if_zyd.c.

References data, next, zyd_tx_data::sc, zyd_softc::tx_data, zyd_softc::tx_free, zyd_softc::tx_nfree, zyd_softc::tx_q, and ZYD_TX_LIST_CNT.

Referenced by zyd_init_locked().

Here is the caller graph for this function:

◆ zyd_start()

static void zyd_start ( struct zyd_softc sc)
static

Definition at line 2576 of file if_zyd.c.

References zyd_softc::sc_snd, zyd_softc::tx_nfree, ZYD_LOCK_ASSERT, and zyd_tx_start().

Referenced by zyd_bulk_read_callback(), zyd_bulk_write_callback(), and zyd_transmit().

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

◆ zyd_stop()

static void zyd_stop ( struct zyd_softc sc)
static

Definition at line 2762 of file if_zyd.c.

References error, fail, zyd_softc::sc_flags, zyd_softc::sc_xfer, usbd_transfer_drain(), ZYD_BULK_RD, ZYD_BULK_WR, ZYD_CR_INTERRUPT, zyd_drain_mbufq(), ZYD_FLAG_INITONCE, ZYD_LOCK, ZYD_LOCK_ASSERT, ZYD_MAC_RXFILTER, zyd_switch_radio(), ZYD_UNLOCK, zyd_unsetup_tx_list(), and zyd_write32_m.

Referenced by zyd_init_locked(), and zyd_parent().

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

◆ zyd_switch_radio()

static int zyd_switch_radio ( struct zyd_softc sc,
int  on 
)
static

Definition at line 1941 of file if_zyd.c.

References error, fail, zyd_softc::sc_rf, zyd_rf::switch_radio, zyd_lock_phy(), and zyd_unlock_phy().

Referenced by zyd_init_locked(), and zyd_stop().

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

◆ zyd_transmit()

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

Definition at line 2554 of file if_zyd.c.

References error, zyd_softc::sc_flags, zyd_softc::sc_snd, ZYD_FLAG_RUNNING, ZYD_LOCK, zyd_start(), and ZYD_UNLOCK.

Referenced by zyd_attach().

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

◆ zyd_tx_free()

static void zyd_tx_free ( struct zyd_tx_data data,
int  txerr 
)
static

Definition at line 522 of file if_zyd.c.

References data, next, zyd_softc::tx_free, and zyd_softc::tx_nfree.

Referenced by zyd_bulk_write_callback().

Here is the caller graph for this function:

◆ zyd_tx_start()

◆ zyd_unlock_phy()

static int zyd_unlock_phy ( struct zyd_softc sc)
static

Definition at line 941 of file if_zyd.c.

References error, fail, ZYD_MAC_MISC, zyd_read32_m, ZYD_UNLOCK_PHY_REGS, and zyd_write32_m.

Referenced by zyd_hw_init(), zyd_set_chan(), and zyd_switch_radio().

Here is the caller graph for this function:

◆ zyd_unsetup_tx_list()

static void zyd_unsetup_tx_list ( struct zyd_softc sc)
static

Definition at line 555 of file if_zyd.c.

References data, zyd_tx_data::sc, zyd_softc::tx_data, zyd_softc::tx_free, zyd_softc::tx_nfree, zyd_softc::tx_q, and ZYD_TX_LIST_CNT.

Referenced by zyd_detach(), and zyd_stop().

Here is the caller graph for this function:

◆ zyd_update_mcast()

static void zyd_update_mcast ( struct ieee80211com *  ic)
static

Definition at line 2021 of file if_zyd.c.

References ZYD_LOCK, zyd_set_multi(), and ZYD_UNLOCK.

Referenced by zyd_attach().

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

◆ zyd_vap_create()

static struct ieee80211vap * zyd_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

Definition at line 476 of file if_zyd.c.

References name, zyd_vap::newstate, zyd_vap::vap, and zyd_newstate().

Referenced by zyd_attach().

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

◆ zyd_vap_delete()

static void zyd_vap_delete ( struct ieee80211vap *  vap)
static

Definition at line 512 of file if_zyd.c.

References zyd_vap::vap, and ZYD_VAP.

Referenced by zyd_attach().

Here is the caller graph for this function:

◆ zyd_write16()

static int zyd_write16 ( struct zyd_softc sc,
uint16_t  reg,
uint16_t  val 
)
static

Definition at line 869 of file if_zyd.c.

References reg, zyd_pair::reg, val, zyd_pair::val, zyd_cmd(), and ZYD_CMD_IOWR.

Here is the call graph for this function:

◆ zyd_write32()

static int zyd_write32 ( struct zyd_softc sc,
uint16_t  reg,
uint32_t  val 
)
static

Definition at line 880 of file if_zyd.c.

References reg, zyd_pair::reg, val, zyd_pair::val, zyd_cmd(), ZYD_CMD_IOWR, ZYD_REG32_HI, and ZYD_REG32_LO.

Referenced by zyd_set_rxfilter().

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

Variable Documentation

◆ zyd_attach

device_attach_t zyd_attach
static

Definition at line 112 of file if_zyd.c.

◆ zyd_bulk_read_callback

usb_callback_t zyd_bulk_read_callback
static

Definition at line 117 of file if_zyd.c.

◆ zyd_bulk_write_callback

usb_callback_t zyd_bulk_write_callback
static

Definition at line 118 of file if_zyd.c.

◆ zyd_config

const struct usb_config zyd_config[ZYD_N_TRANSFER]
static

Definition at line 257 of file if_zyd.c.

Referenced by zyd_attach().

◆ zyd_def_phy

const struct zyd_phy_pair zyd_def_phy[] = ZYD_DEF_PHY
static

Definition at line 194 of file if_zyd.c.

Referenced by zyd_hw_init().

◆ zyd_def_phyB

const struct zyd_phy_pair zyd_def_phyB[] = ZYD_DEF_PHYB
static

Definition at line 195 of file if_zyd.c.

Referenced by zyd_hw_init().

◆ zyd_detach

device_detach_t zyd_detach
static

Definition at line 113 of file if_zyd.c.

Referenced by zyd_attach().

◆ zyd_devclass

devclass_t zyd_devclass
static

Definition at line 2916 of file if_zyd.c.

◆ zyd_devs

const STRUCT_USB_HOST_ID zyd_devs[]
static

Definition at line 205 of file if_zyd.c.

Referenced by zyd_match().

◆ zyd_driver

driver_t zyd_driver
static
Initial value:
= {
.name = "zyd",
.methods = zyd_methods,
.size = sizeof(struct zyd_softc)
}
static device_method_t zyd_methods[]
Definition: if_zyd.c:2902

Definition at line 2910 of file if_zyd.c.

◆ zyd_intr_read_callback

usb_callback_t zyd_intr_read_callback
static

Definition at line 115 of file if_zyd.c.

◆ zyd_intr_write_callback

usb_callback_t zyd_intr_write_callback
static

Definition at line 116 of file if_zyd.c.

◆ zyd_match

device_probe_t zyd_match
static

Definition at line 111 of file if_zyd.c.

◆ zyd_methods

device_method_t zyd_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, zyd_match),
DEVMETHOD(device_attach, zyd_attach),
DEVMETHOD(device_detach, zyd_detach),
DEVMETHOD_END
}
static device_detach_t zyd_detach
Definition: if_zyd.c:113
static device_attach_t zyd_attach
Definition: if_zyd.c:112
static device_probe_t zyd_match
Definition: if_zyd.c:111

Definition at line 2902 of file if_zyd.c.