46#define RTL818X_CMD_TX_ENABLE (1 << 2)
47#define RTL818X_CMD_RX_ENABLE (1 << 3)
48#define RTL818X_CMD_RESET (1 << 4)
52#define RTL818X_INT_RX_OK (1 << 0)
53#define RTL818X_INT_RX_ERR (1 << 1)
54#define RTL818X_INT_TXL_OK (1 << 2)
55#define RTL818X_INT_TXL_ERR (1 << 3)
56#define RTL818X_INT_RX_DU (1 << 4)
57#define RTL818X_INT_RX_FO (1 << 5)
58#define RTL818X_INT_TXN_OK (1 << 6)
59#define RTL818X_INT_TXN_ERR (1 << 7)
60#define RTL818X_INT_TXH_OK (1 << 8)
61#define RTL818X_INT_TXH_ERR (1 << 9)
62#define RTL818X_INT_TXB_OK (1 << 10)
63#define RTL818X_INT_TXB_ERR (1 << 11)
64#define RTL818X_INT_ATIM (1 << 12)
65#define RTL818X_INT_BEACON (1 << 13)
66#define RTL818X_INT_TIME_OUT (1 << 14)
67#define RTL818X_INT_TX_FO (1 << 15)
69#define RTL818X_TX_CONF_LOOPBACK_MAC (1 << 17)
70#define RTL818X_TX_CONF_LOOPBACK_CONT (3 << 17)
71#define RTL818X_TX_CONF_NO_ICV (1 << 19)
72#define RTL818X_TX_CONF_DISCW (1 << 20)
73#define RTL818X_TX_CONF_SAT_HWPLCP (1 << 24)
74#define RTL818X_TX_CONF_R8180_ABCD (2 << 25)
75#define RTL818X_TX_CONF_R8180_F (3 << 25)
76#define RTL818X_TX_CONF_R8185_ABC (4 << 25)
77#define RTL818X_TX_CONF_R8185_D (5 << 25)
78#define RTL818X_TX_CONF_R8187vD (5 << 25)
79#define RTL818X_TX_CONF_R8187vD_B (6 << 25)
80#define RTL818X_TX_CONF_HWVER_MASK (7 << 25)
81#define RTL818X_TX_CONF_DISREQQSIZE (1 << 28)
82#define RTL818X_TX_CONF_PROBE_DTS (1 << 29)
83#define RTL818X_TX_CONF_HW_SEQNUM (1 << 30)
84#define RTL818X_TX_CONF_CW_MIN (1 << 31)
86#define RTL818X_RX_CONF_MONITOR (1 << 0)
87#define RTL818X_RX_CONF_NICMAC (1 << 1)
88#define RTL818X_RX_CONF_MULTICAST (1 << 2)
89#define RTL818X_RX_CONF_BROADCAST (1 << 3)
90#define RTL818X_RX_CONF_FCS (1 << 5)
91#define RTL818X_RX_CONF_DATA (1 << 18)
92#define RTL818X_RX_CONF_CTRL (1 << 19)
93#define RTL818X_RX_CONF_MGMT (1 << 20)
94#define RTL818X_RX_CONF_ADDR3 (1 << 21)
95#define RTL818X_RX_CONF_PM (1 << 22)
96#define RTL818X_RX_CONF_BSSID (1 << 23)
97#define RTL818X_RX_CONF_RX_AUTORESETPHY (1 << 28)
98#define RTL818X_RX_CONF_CSDM1 (1 << 29)
99#define RTL818X_RX_CONF_CSDM2 (1 << 30)
100#define RTL818X_RX_CONF_ONLYERLPKT (1 << 31)
104#define RTL818X_EEPROM_CMD_READ (1 << 0)
105#define RTL818X_EEPROM_CMD_WRITE (1 << 1)
106#define RTL818X_EEPROM_CMD_CK (1 << 2)
107#define RTL818X_EEPROM_CMD_CS (1 << 3)
108#define RTL818X_EEPROM_CMD_NORMAL (0 << 6)
109#define RTL818X_EEPROM_CMD_LOAD (1 << 6)
110#define RTL818X_EEPROM_CMD_PROGRAM (2 << 6)
111#define RTL818X_EEPROM_CMD_CONFIG (3 << 6)
115#define RTL818X_CONFIG2_ANTENNA_DIV (1 << 6)
118#define RTL818X_MSR_NO_LINK (0 << 2)
119#define RTL818X_MSR_ADHOC (1 << 2)
120#define RTL818X_MSR_INFRA (2 << 2)
121#define RTL818X_MSR_MASTER (3 << 2)
122#define RTL818X_MSR_ENEDCA (4 << 2)
124#define RTL818X_CONFIG3_ANAPARAM_WRITE (1 << 6)
125#define RTL818X_CONFIG3_GNT_SELECT (1 << 7)
127#define RTL818X_CONFIG4_POWEROFF (1 << 6)
128#define RTL818X_CONFIG4_VCOOFF (1 << 7)
155#define RTL818X_TX_AGC_CTL_PERPACKET_GAIN_SHIFT (1 << 0)
156#define RTL818X_TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT (1 << 1)
157#define RTL818X_TX_AGC_CTL_FEEDBACK_ANT (1 << 2)
169#define RTL818X_CW_CONF_PERPACKET_CW_SHIFT (1 << 0)
170#define RTL818X_CW_CONF_PERPACKET_RETRY_SHIFT (1 << 1)
173#define RTL818X_RATE_FALLBACK_ENABLE (1 << 7)
184#define RTL818X_R8187B_B 0
185#define RTL818X_R8187B_D 1
186#define RTL818X_R8187B_E 2
198#define MAX_RX_SIZE IEEE80211_MAX_FRAME_LEN
200#define RF_PARAM_ANALOGPHY (1 << 0)
201#define RF_PARAM_ANTBDEFAULT (1 << 1)
202#define RF_PARAM_CARRIERSENSE1 (1 << 2)
203#define RF_PARAM_CARRIERSENSE2 (1 << 3)
205#define BB_ANTATTEN_CHAN14 0x0C
206#define BB_ANTENNA_B 0x40
208#define BB_HOST_BANG (1 << 30)
209#define BB_HOST_BANG_EN (1 << 2)
210#define BB_HOST_BANG_CLK (1 << 1)
211#define BB_HOST_BANG_DATA 1
213#define ANAPARAM_TXDACOFF_SHIFT 27
214#define ANAPARAM_PWR0_SHIFT 28
215#define ANAPARAM_PWR0_MASK (0x07 << ANAPARAM_PWR0_SHIFT)
216#define ANAPARAM_PWR1_SHIFT 20
217#define ANAPARAM_PWR1_MASK (0x7F << ANAPARAM_PWR1_SHIFT)
219#define RTL818X_RX_RING_SIZE 8
220#define RTL818X_TX_RING_SIZE 8
221#define RTL818X_RING_ALIGN 256
223#define RTL818X_MAX_RETRIES 4
349#define RTL818X_RF_DRIVERS __table(struct rtl818x_rf_ops, "rtl818x_rf_drivers")
350#define __rtl818x_rf_driver __table_entry(RTL818X_RF_DRIVERS, 01)
uint32_t addr
Buffer address.
uint8_t data[48]
Additional event data.
#define __unused
Declare a variable or data structure as unused.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define outb(data, io_addr)
#define outw(data, io_addr)
#define outl(data, io_addr)
The iPXE 802.11 MAC layer.
int rtl818x_probe(struct pci_device *pdev)
void rtl818x_remove(struct pci_device *pdev)
@ RTL818X_TX_DESC_FLAG_RTS
@ RTL818X_TX_DESC_FLAG_CTS
@ RTL818X_TX_DESC_FLAG_NO_ENC
@ RTL818X_TX_DESC_FLAG_RX_UNDER
@ RTL818X_TX_DESC_FLAG_LS
@ RTL818X_TX_DESC_FLAG_TX_OK
@ RTL818X_TX_DESC_FLAG_FS
@ RTL818X_TX_DESC_FLAG_SPLCP
@ RTL818X_TX_DESC_FLAG_OWN
@ RTL818X_TX_DESC_FLAG_DMA
@ RTL818X_TX_DESC_FLAG_MOREFRAG
static void rtl818x_iowrite8(struct rtl818x_priv *priv __unused, u8 *addr, u8 val)
#define RTL818X_TX_RING_SIZE
@ RTL818X_RX_DESC_FLAG_SPLCP
@ RTL818X_RX_DESC_FLAG_FOF
@ RTL818X_RX_DESC_FLAG_QOS
@ RTL818X_RX_DESC_FLAG_RX_ERR
@ RTL818X_RX_DESC_FLAG_PM
@ RTL818X_RX_DESC_FLAG_MCAST
@ RTL818X_RX_DESC_FLAG_BCAST
@ RTL818X_RX_DESC_FLAG_FS
@ RTL818X_RX_DESC_FLAG_OWN
@ RTL818X_RX_DESC_FLAG_EOR
@ RTL818X_RX_DESC_FLAG_DMA_FAIL
@ RTL818X_RX_DESC_FLAG_CRC32_ERR
@ RTL818X_RX_DESC_FLAG_PAM
@ RTL818X_RX_DESC_FLAG_ICV_ERR
@ RTL818X_RX_DESC_FLAG_TRSW
@ RTL818X_RX_DESC_FLAG_LS
void rtl818x_write_phy(struct net80211_device *dev, u8 addr, u32 data)
static u8 rtl818x_ioread8(struct rtl818x_priv *priv __unused, u8 *addr)
void rtl818x_set_anaparam(struct rtl818x_priv *priv, u32 anaparam)
static void rtl818x_iowrite16(struct rtl818x_priv *priv __unused, u16 *addr, u16 val)
static void rtl818x_iowrite32(struct rtl818x_priv *priv __unused, u32 *addr, u32 val)
static u16 rtl818x_ioread16(struct rtl818x_priv *priv __unused, u16 *addr)
#define RTL818X_RX_RING_SIZE
static u32 rtl818x_ioread32(struct rtl818x_priv *priv __unused, u32 *addr)
SPI bit-bashing interface.
Structure encapsulating the complete state of an 802.11 device.
struct device dev
Generic device.
struct rtl818x_rx_desc * rx_ring
struct io_buffer * rx_buf[RTL818X_RX_RING_SIZE]
struct spi_bit_basher spibit
const struct rtl818x_rf_ops * rf
struct io_buffer * tx_buf[RTL818X_TX_RING_SIZE]
struct rtl818x_tx_desc * tx_ring
void(* stop)(struct net80211_device *dev)
void(* init)(struct net80211_device *dev)
void(* conf_erp)(struct net80211_device *dev)
void(* set_chan)(struct net80211_device *dev, struct net80211_channel *chan)
static struct tlan_private * priv