iPXE
rtl818x.h File Reference
#include <ipxe/spi_bit.h>
#include <ipxe/tables.h>
#include <ipxe/net80211.h>

Go to the source code of this file.

Data Structures

struct  rtl818x_csr
struct  rtl818x_tx_desc
struct  rtl818x_rx_desc
struct  rtl818x_priv
struct  rtl818x_rf_ops

Macros

#define RTL818X_CMD_TX_ENABLE   (1 << 2)
#define RTL818X_CMD_RX_ENABLE   (1 << 3)
#define RTL818X_CMD_RESET   (1 << 4)
#define RTL818X_INT_RX_OK   (1 << 0)
#define RTL818X_INT_RX_ERR   (1 << 1)
#define RTL818X_INT_TXL_OK   (1 << 2)
#define RTL818X_INT_TXL_ERR   (1 << 3)
#define RTL818X_INT_RX_DU   (1 << 4)
#define RTL818X_INT_RX_FO   (1 << 5)
#define RTL818X_INT_TXN_OK   (1 << 6)
#define RTL818X_INT_TXN_ERR   (1 << 7)
#define RTL818X_INT_TXH_OK   (1 << 8)
#define RTL818X_INT_TXH_ERR   (1 << 9)
#define RTL818X_INT_TXB_OK   (1 << 10)
#define RTL818X_INT_TXB_ERR   (1 << 11)
#define RTL818X_INT_ATIM   (1 << 12)
#define RTL818X_INT_BEACON   (1 << 13)
#define RTL818X_INT_TIME_OUT   (1 << 14)
#define RTL818X_INT_TX_FO   (1 << 15)
#define RTL818X_TX_CONF_LOOPBACK_MAC   (1 << 17)
#define RTL818X_TX_CONF_LOOPBACK_CONT   (3 << 17)
#define RTL818X_TX_CONF_NO_ICV   (1 << 19)
#define RTL818X_TX_CONF_DISCW   (1 << 20)
#define RTL818X_TX_CONF_SAT_HWPLCP   (1 << 24)
#define RTL818X_TX_CONF_R8180_ABCD   (2 << 25)
#define RTL818X_TX_CONF_R8180_F   (3 << 25)
#define RTL818X_TX_CONF_R8185_ABC   (4 << 25)
#define RTL818X_TX_CONF_R8185_D   (5 << 25)
#define RTL818X_TX_CONF_R8187vD   (5 << 25)
#define RTL818X_TX_CONF_R8187vD_B   (6 << 25)
#define RTL818X_TX_CONF_HWVER_MASK   (7 << 25)
#define RTL818X_TX_CONF_DISREQQSIZE   (1 << 28)
#define RTL818X_TX_CONF_PROBE_DTS   (1 << 29)
#define RTL818X_TX_CONF_HW_SEQNUM   (1 << 30)
#define RTL818X_TX_CONF_CW_MIN   (1 << 31)
#define RTL818X_RX_CONF_MONITOR   (1 << 0)
#define RTL818X_RX_CONF_NICMAC   (1 << 1)
#define RTL818X_RX_CONF_MULTICAST   (1 << 2)
#define RTL818X_RX_CONF_BROADCAST   (1 << 3)
#define RTL818X_RX_CONF_FCS   (1 << 5)
#define RTL818X_RX_CONF_DATA   (1 << 18)
#define RTL818X_RX_CONF_CTRL   (1 << 19)
#define RTL818X_RX_CONF_MGMT   (1 << 20)
#define RTL818X_RX_CONF_ADDR3   (1 << 21)
#define RTL818X_RX_CONF_PM   (1 << 22)
#define RTL818X_RX_CONF_BSSID   (1 << 23)
#define RTL818X_RX_CONF_RX_AUTORESETPHY   (1 << 28)
#define RTL818X_RX_CONF_CSDM1   (1 << 29)
#define RTL818X_RX_CONF_CSDM2   (1 << 30)
#define RTL818X_RX_CONF_ONLYERLPKT   (1 << 31)
#define RTL818X_EEPROM_CMD_READ   (1 << 0)
#define RTL818X_EEPROM_CMD_WRITE   (1 << 1)
#define RTL818X_EEPROM_CMD_CK   (1 << 2)
#define RTL818X_EEPROM_CMD_CS   (1 << 3)
#define RTL818X_EEPROM_CMD_NORMAL   (0 << 6)
#define RTL818X_EEPROM_CMD_LOAD   (1 << 6)
#define RTL818X_EEPROM_CMD_PROGRAM   (2 << 6)
#define RTL818X_EEPROM_CMD_CONFIG   (3 << 6)
#define RTL818X_CONFIG2_ANTENNA_DIV   (1 << 6)
#define RTL818X_MSR_NO_LINK   (0 << 2)
#define RTL818X_MSR_ADHOC   (1 << 2)
#define RTL818X_MSR_INFRA   (2 << 2)
#define RTL818X_MSR_MASTER   (3 << 2)
#define RTL818X_MSR_ENEDCA   (4 << 2)
#define RTL818X_CONFIG3_ANAPARAM_WRITE   (1 << 6)
#define RTL818X_CONFIG3_GNT_SELECT   (1 << 7)
#define RTL818X_CONFIG4_POWEROFF   (1 << 6)
#define RTL818X_CONFIG4_VCOOFF   (1 << 7)
#define RTL818X_TX_AGC_CTL_PERPACKET_GAIN_SHIFT   (1 << 0)
#define RTL818X_TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT   (1 << 1)
#define RTL818X_TX_AGC_CTL_FEEDBACK_ANT   (1 << 2)
#define RTL818X_CW_CONF_PERPACKET_CW_SHIFT   (1 << 0)
#define RTL818X_CW_CONF_PERPACKET_RETRY_SHIFT   (1 << 1)
#define RTL818X_RATE_FALLBACK_ENABLE   (1 << 7)
#define RTL818X_R8187B_B   0
#define RTL818X_R8187B_D   1
#define RTL818X_R8187B_E   2
#define MAX_RX_SIZE   IEEE80211_MAX_FRAME_LEN
#define RF_PARAM_ANALOGPHY   (1 << 0)
#define RF_PARAM_ANTBDEFAULT   (1 << 1)
#define RF_PARAM_CARRIERSENSE1   (1 << 2)
#define RF_PARAM_CARRIERSENSE2   (1 << 3)
#define BB_ANTATTEN_CHAN14   0x0C
#define BB_ANTENNA_B   0x40
#define BB_HOST_BANG   (1 << 30)
#define BB_HOST_BANG_EN   (1 << 2)
#define BB_HOST_BANG_CLK   (1 << 1)
#define BB_HOST_BANG_DATA   1
#define ANAPARAM_TXDACOFF_SHIFT   27
#define ANAPARAM_PWR0_SHIFT   28
#define ANAPARAM_PWR0_MASK   (0x07 << ANAPARAM_PWR0_SHIFT)
#define ANAPARAM_PWR1_SHIFT   20
#define ANAPARAM_PWR1_MASK   (0x7F << ANAPARAM_PWR1_SHIFT)
#define RTL818X_RX_RING_SIZE   8 /* doesn't have to be a power of 2 */
#define RTL818X_TX_RING_SIZE   8 /* nor this [but 2^n is very slightly faster] */
#define RTL818X_RING_ALIGN   256
#define RTL818X_MAX_RETRIES   4
#define RTL818X_RF_DRIVERS   __table(struct rtl818x_rf_ops, "rtl818x_rf_drivers")
#define __rtl818x_rf_driver   __table_entry(RTL818X_RF_DRIVERS, 01)

Enumerations

enum  rtl818x_tx_desc_flags {
  RTL818X_TX_DESC_FLAG_NO_ENC = (1 << 15) , RTL818X_TX_DESC_FLAG_TX_OK = (1 << 15) , RTL818X_TX_DESC_FLAG_SPLCP = (1 << 16) , RTL818X_TX_DESC_FLAG_RX_UNDER = (1 << 16) ,
  RTL818X_TX_DESC_FLAG_MOREFRAG = (1 << 17) , RTL818X_TX_DESC_FLAG_CTS = (1 << 18) , RTL818X_TX_DESC_FLAG_RTS = (1 << 23) , RTL818X_TX_DESC_FLAG_LS = (1 << 28) ,
  RTL818X_TX_DESC_FLAG_FS = (1 << 29) , RTL818X_TX_DESC_FLAG_DMA = (1 << 30) , RTL818X_TX_DESC_FLAG_OWN = (1 << 31)
}
enum  rtl818x_rx_desc_flags {
  RTL818X_RX_DESC_FLAG_ICV_ERR = (1 << 12) , RTL818X_RX_DESC_FLAG_CRC32_ERR = (1 << 13) , RTL818X_RX_DESC_FLAG_PM = (1 << 14) , RTL818X_RX_DESC_FLAG_RX_ERR = (1 << 15) ,
  RTL818X_RX_DESC_FLAG_BCAST = (1 << 16) , RTL818X_RX_DESC_FLAG_PAM = (1 << 17) , RTL818X_RX_DESC_FLAG_MCAST = (1 << 18) , RTL818X_RX_DESC_FLAG_QOS = (1 << 19) ,
  RTL818X_RX_DESC_FLAG_TRSW = (1 << 24) , RTL818X_RX_DESC_FLAG_SPLCP = (1 << 25) , RTL818X_RX_DESC_FLAG_FOF = (1 << 26) , RTL818X_RX_DESC_FLAG_DMA_FAIL = (1 << 27) ,
  RTL818X_RX_DESC_FLAG_LS = (1 << 28) , RTL818X_RX_DESC_FLAG_FS = (1 << 29) , RTL818X_RX_DESC_FLAG_EOR = (1 << 30) , RTL818X_RX_DESC_FLAG_OWN = (1 << 31)
}

Functions

 FILE_LICENCE (GPL2_ONLY)
 FILE_SECBOOT (FORBIDDEN)
void rtl818x_write_phy (struct net80211_device *dev, u8 addr, u32 data)
void rtl818x_set_anaparam (struct rtl818x_priv *priv, u32 anaparam)
static u8 rtl818x_ioread8 (struct rtl818x_priv *priv __unused, u8 *addr)
static u16 rtl818x_ioread16 (struct rtl818x_priv *priv __unused, u16 *addr)
static u32 rtl818x_ioread32 (struct rtl818x_priv *priv __unused, u32 *addr)
static void rtl818x_iowrite8 (struct rtl818x_priv *priv __unused, u8 *addr, u8 val)
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)
int rtl818x_probe (struct pci_device *pdev)
void rtl818x_remove (struct pci_device *pdev)

Macro Definition Documentation

◆ RTL818X_CMD_TX_ENABLE

#define RTL818X_CMD_TX_ENABLE   (1 << 2)

Definition at line 46 of file rtl818x.h.

Referenced by rtl818x_start(), and rtl818x_stop().

◆ RTL818X_CMD_RX_ENABLE

#define RTL818X_CMD_RX_ENABLE   (1 << 3)

Definition at line 47 of file rtl818x.h.

Referenced by rtl818x_start(), and rtl818x_stop().

◆ RTL818X_CMD_RESET

#define RTL818X_CMD_RESET   (1 << 4)

Definition at line 48 of file rtl818x.h.

Referenced by rtl818x_init_hw().

◆ RTL818X_INT_RX_OK

#define RTL818X_INT_RX_OK   (1 << 0)

Definition at line 52 of file rtl818x.h.

Referenced by rtl818x_poll().

◆ RTL818X_INT_RX_ERR

#define RTL818X_INT_RX_ERR   (1 << 1)

Definition at line 53 of file rtl818x.h.

Referenced by rtl818x_poll().

◆ RTL818X_INT_TXL_OK

#define RTL818X_INT_TXL_OK   (1 << 2)

Definition at line 54 of file rtl818x.h.

◆ RTL818X_INT_TXL_ERR

#define RTL818X_INT_TXL_ERR   (1 << 3)

Definition at line 55 of file rtl818x.h.

◆ RTL818X_INT_RX_DU

#define RTL818X_INT_RX_DU   (1 << 4)

Definition at line 56 of file rtl818x.h.

◆ RTL818X_INT_RX_FO

#define RTL818X_INT_RX_FO   (1 << 5)

Definition at line 57 of file rtl818x.h.

◆ RTL818X_INT_TXN_OK

#define RTL818X_INT_TXN_OK   (1 << 6)

Definition at line 58 of file rtl818x.h.

Referenced by rtl818x_poll().

◆ RTL818X_INT_TXN_ERR

#define RTL818X_INT_TXN_ERR   (1 << 7)

Definition at line 59 of file rtl818x.h.

Referenced by rtl818x_poll().

◆ RTL818X_INT_TXH_OK

#define RTL818X_INT_TXH_OK   (1 << 8)

Definition at line 60 of file rtl818x.h.

◆ RTL818X_INT_TXH_ERR

#define RTL818X_INT_TXH_ERR   (1 << 9)

Definition at line 61 of file rtl818x.h.

◆ RTL818X_INT_TXB_OK

#define RTL818X_INT_TXB_OK   (1 << 10)

Definition at line 62 of file rtl818x.h.

◆ RTL818X_INT_TXB_ERR

#define RTL818X_INT_TXB_ERR   (1 << 11)

Definition at line 63 of file rtl818x.h.

◆ RTL818X_INT_ATIM

#define RTL818X_INT_ATIM   (1 << 12)

Definition at line 64 of file rtl818x.h.

◆ RTL818X_INT_BEACON

#define RTL818X_INT_BEACON   (1 << 13)

Definition at line 65 of file rtl818x.h.

◆ RTL818X_INT_TIME_OUT

#define RTL818X_INT_TIME_OUT   (1 << 14)

Definition at line 66 of file rtl818x.h.

◆ RTL818X_INT_TX_FO

#define RTL818X_INT_TX_FO   (1 << 15)

Definition at line 67 of file rtl818x.h.

◆ RTL818X_TX_CONF_LOOPBACK_MAC

#define RTL818X_TX_CONF_LOOPBACK_MAC   (1 << 17)

Definition at line 69 of file rtl818x.h.

◆ RTL818X_TX_CONF_LOOPBACK_CONT

#define RTL818X_TX_CONF_LOOPBACK_CONT   (3 << 17)

Definition at line 70 of file rtl818x.h.

Referenced by sa2400_rf_init().

◆ RTL818X_TX_CONF_NO_ICV

#define RTL818X_TX_CONF_NO_ICV   (1 << 19)

Definition at line 71 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_TX_CONF_DISCW

#define RTL818X_TX_CONF_DISCW   (1 << 20)

Definition at line 72 of file rtl818x.h.

◆ RTL818X_TX_CONF_SAT_HWPLCP

#define RTL818X_TX_CONF_SAT_HWPLCP   (1 << 24)

Definition at line 73 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_TX_CONF_R8180_ABCD

#define RTL818X_TX_CONF_R8180_ABCD   (2 << 25)

Definition at line 74 of file rtl818x.h.

Referenced by rtl818x_probe().

◆ RTL818X_TX_CONF_R8180_F

#define RTL818X_TX_CONF_R8180_F   (3 << 25)

Definition at line 75 of file rtl818x.h.

Referenced by rtl818x_probe().

◆ RTL818X_TX_CONF_R8185_ABC

#define RTL818X_TX_CONF_R8185_ABC   (4 << 25)

Definition at line 76 of file rtl818x.h.

Referenced by rtl818x_probe().

◆ RTL818X_TX_CONF_R8185_D

#define RTL818X_TX_CONF_R8185_D   (5 << 25)

Definition at line 77 of file rtl818x.h.

Referenced by rtl818x_probe().

◆ RTL818X_TX_CONF_R8187vD

#define RTL818X_TX_CONF_R8187vD   (5 << 25)

Definition at line 78 of file rtl818x.h.

◆ RTL818X_TX_CONF_R8187vD_B

#define RTL818X_TX_CONF_R8187vD_B   (6 << 25)

Definition at line 79 of file rtl818x.h.

◆ RTL818X_TX_CONF_HWVER_MASK

#define RTL818X_TX_CONF_HWVER_MASK   (7 << 25)

Definition at line 80 of file rtl818x.h.

Referenced by rtl818x_probe().

◆ RTL818X_TX_CONF_DISREQQSIZE

#define RTL818X_TX_CONF_DISREQQSIZE   (1 << 28)

Definition at line 81 of file rtl818x.h.

◆ RTL818X_TX_CONF_PROBE_DTS

#define RTL818X_TX_CONF_PROBE_DTS   (1 << 29)

Definition at line 82 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_TX_CONF_HW_SEQNUM

#define RTL818X_TX_CONF_HW_SEQNUM   (1 << 30)

Definition at line 83 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_TX_CONF_CW_MIN

#define RTL818X_TX_CONF_CW_MIN   (1 << 31)

Definition at line 84 of file rtl818x.h.

◆ RTL818X_RX_CONF_MONITOR

#define RTL818X_RX_CONF_MONITOR   (1 << 0)

Definition at line 86 of file rtl818x.h.

◆ RTL818X_RX_CONF_NICMAC

#define RTL818X_RX_CONF_NICMAC   (1 << 1)

Definition at line 87 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_RX_CONF_MULTICAST

#define RTL818X_RX_CONF_MULTICAST   (1 << 2)

Definition at line 88 of file rtl818x.h.

◆ RTL818X_RX_CONF_BROADCAST

#define RTL818X_RX_CONF_BROADCAST   (1 << 3)

Definition at line 89 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_RX_CONF_FCS

#define RTL818X_RX_CONF_FCS   (1 << 5)

Definition at line 90 of file rtl818x.h.

◆ RTL818X_RX_CONF_DATA

#define RTL818X_RX_CONF_DATA   (1 << 18)

Definition at line 91 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_RX_CONF_CTRL

#define RTL818X_RX_CONF_CTRL   (1 << 19)

Definition at line 92 of file rtl818x.h.

◆ RTL818X_RX_CONF_MGMT

#define RTL818X_RX_CONF_MGMT   (1 << 20)

Definition at line 93 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_RX_CONF_ADDR3

#define RTL818X_RX_CONF_ADDR3   (1 << 21)

Definition at line 94 of file rtl818x.h.

◆ RTL818X_RX_CONF_PM

#define RTL818X_RX_CONF_PM   (1 << 22)

Definition at line 95 of file rtl818x.h.

◆ RTL818X_RX_CONF_BSSID

#define RTL818X_RX_CONF_BSSID   (1 << 23)

Definition at line 96 of file rtl818x.h.

◆ RTL818X_RX_CONF_RX_AUTORESETPHY

#define RTL818X_RX_CONF_RX_AUTORESETPHY   (1 << 28)

Definition at line 97 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_RX_CONF_CSDM1

#define RTL818X_RX_CONF_CSDM1   (1 << 29)

Definition at line 98 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_RX_CONF_CSDM2

#define RTL818X_RX_CONF_CSDM2   (1 << 30)

Definition at line 99 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_RX_CONF_ONLYERLPKT

#define RTL818X_RX_CONF_ONLYERLPKT   (1 << 31)

Definition at line 100 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_EEPROM_CMD_READ

#define RTL818X_EEPROM_CMD_READ   (1 << 0)

Definition at line 104 of file rtl818x.h.

◆ RTL818X_EEPROM_CMD_WRITE

#define RTL818X_EEPROM_CMD_WRITE   (1 << 1)

Definition at line 105 of file rtl818x.h.

◆ RTL818X_EEPROM_CMD_CK

#define RTL818X_EEPROM_CMD_CK   (1 << 2)

Definition at line 106 of file rtl818x.h.

◆ RTL818X_EEPROM_CMD_CS

#define RTL818X_EEPROM_CMD_CS   (1 << 3)

Definition at line 107 of file rtl818x.h.

◆ RTL818X_EEPROM_CMD_NORMAL

◆ RTL818X_EEPROM_CMD_LOAD

#define RTL818X_EEPROM_CMD_LOAD   (1 << 6)

Definition at line 109 of file rtl818x.h.

Referenced by rtl818x_init_hw().

◆ RTL818X_EEPROM_CMD_PROGRAM

#define RTL818X_EEPROM_CMD_PROGRAM   (2 << 6)

Definition at line 110 of file rtl818x.h.

Referenced by rtl818x_probe().

◆ RTL818X_EEPROM_CMD_CONFIG

#define RTL818X_EEPROM_CMD_CONFIG   (3 << 6)

◆ RTL818X_CONFIG2_ANTENNA_DIV

#define RTL818X_CONFIG2_ANTENNA_DIV   (1 << 6)

Definition at line 115 of file rtl818x.h.

Referenced by grf5101_rf_init(), max2820_rf_init(), and sa2400_rf_init().

◆ RTL818X_MSR_NO_LINK

#define RTL818X_MSR_NO_LINK   (0 << 2)

Definition at line 118 of file rtl818x.h.

Referenced by rtl818x_config().

◆ RTL818X_MSR_ADHOC

#define RTL818X_MSR_ADHOC   (1 << 2)

Definition at line 119 of file rtl818x.h.

◆ RTL818X_MSR_INFRA

#define RTL818X_MSR_INFRA   (2 << 2)

Definition at line 120 of file rtl818x.h.

Referenced by rtl818x_config().

◆ RTL818X_MSR_MASTER

#define RTL818X_MSR_MASTER   (3 << 2)

Definition at line 121 of file rtl818x.h.

◆ RTL818X_MSR_ENEDCA

#define RTL818X_MSR_ENEDCA   (4 << 2)

Definition at line 122 of file rtl818x.h.

◆ RTL818X_CONFIG3_ANAPARAM_WRITE

#define RTL818X_CONFIG3_ANAPARAM_WRITE   (1 << 6)

Definition at line 124 of file rtl818x.h.

Referenced by rtl818x_set_anaparam(), rtl8225_rf_set_tx_power(), and rtl8225_rf_stop().

◆ RTL818X_CONFIG3_GNT_SELECT

#define RTL818X_CONFIG3_GNT_SELECT   (1 << 7)

Definition at line 125 of file rtl818x.h.

◆ RTL818X_CONFIG4_POWEROFF

#define RTL818X_CONFIG4_POWEROFF   (1 << 6)

Definition at line 127 of file rtl818x.h.

◆ RTL818X_CONFIG4_VCOOFF

#define RTL818X_CONFIG4_VCOOFF   (1 << 7)

Definition at line 128 of file rtl818x.h.

Referenced by rtl818x_stop().

◆ RTL818X_TX_AGC_CTL_PERPACKET_GAIN_SHIFT

#define RTL818X_TX_AGC_CTL_PERPACKET_GAIN_SHIFT   (1 << 0)

Definition at line 155 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT

#define RTL818X_TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT   (1 << 1)

Definition at line 156 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_TX_AGC_CTL_FEEDBACK_ANT

#define RTL818X_TX_AGC_CTL_FEEDBACK_ANT   (1 << 2)

Definition at line 157 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_CW_CONF_PERPACKET_CW_SHIFT

#define RTL818X_CW_CONF_PERPACKET_CW_SHIFT   (1 << 0)

Definition at line 169 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_CW_CONF_PERPACKET_RETRY_SHIFT

#define RTL818X_CW_CONF_PERPACKET_RETRY_SHIFT   (1 << 1)

Definition at line 170 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RTL818X_RATE_FALLBACK_ENABLE

#define RTL818X_RATE_FALLBACK_ENABLE   (1 << 7)

Definition at line 173 of file rtl818x.h.

◆ RTL818X_R8187B_B

#define RTL818X_R8187B_B   0

Definition at line 184 of file rtl818x.h.

◆ RTL818X_R8187B_D

#define RTL818X_R8187B_D   1

Definition at line 185 of file rtl818x.h.

◆ RTL818X_R8187B_E

#define RTL818X_R8187B_E   2

Definition at line 186 of file rtl818x.h.

◆ MAX_RX_SIZE

#define MAX_RX_SIZE   IEEE80211_MAX_FRAME_LEN

Definition at line 198 of file rtl818x.h.

Referenced by rtl818x_handle_rx(), and rtl818x_init_rx_ring().

◆ RF_PARAM_ANALOGPHY

#define RF_PARAM_ANALOGPHY   (1 << 0)

Definition at line 200 of file rtl818x.h.

Referenced by sa2400_rf_init().

◆ RF_PARAM_ANTBDEFAULT

#define RF_PARAM_ANTBDEFAULT   (1 << 1)

◆ RF_PARAM_CARRIERSENSE1

#define RF_PARAM_CARRIERSENSE1   (1 << 2)

Definition at line 202 of file rtl818x.h.

Referenced by rtl818x_start().

◆ RF_PARAM_CARRIERSENSE2

#define RF_PARAM_CARRIERSENSE2   (1 << 3)

Definition at line 203 of file rtl818x.h.

Referenced by rtl818x_start().

◆ BB_ANTATTEN_CHAN14

#define BB_ANTATTEN_CHAN14   0x0C

◆ BB_ANTENNA_B

#define BB_ANTENNA_B   0x40

◆ BB_HOST_BANG

#define BB_HOST_BANG   (1 << 30)

Definition at line 208 of file rtl818x.h.

◆ BB_HOST_BANG_EN

#define BB_HOST_BANG_EN   (1 << 2)

Definition at line 209 of file rtl818x.h.

◆ BB_HOST_BANG_CLK

#define BB_HOST_BANG_CLK   (1 << 1)

Definition at line 210 of file rtl818x.h.

◆ BB_HOST_BANG_DATA

#define BB_HOST_BANG_DATA   1

Definition at line 211 of file rtl818x.h.

◆ ANAPARAM_TXDACOFF_SHIFT

#define ANAPARAM_TXDACOFF_SHIFT   27

Definition at line 213 of file rtl818x.h.

Referenced by sa2400_rf_init().

◆ ANAPARAM_PWR0_SHIFT

#define ANAPARAM_PWR0_SHIFT   28

Definition at line 214 of file rtl818x.h.

Referenced by sa2400_rf_init().

◆ ANAPARAM_PWR0_MASK

#define ANAPARAM_PWR0_MASK   (0x07 << ANAPARAM_PWR0_SHIFT)

Definition at line 215 of file rtl818x.h.

Referenced by sa2400_rf_init().

◆ ANAPARAM_PWR1_SHIFT

#define ANAPARAM_PWR1_SHIFT   20

Definition at line 216 of file rtl818x.h.

Referenced by sa2400_rf_init().

◆ ANAPARAM_PWR1_MASK

#define ANAPARAM_PWR1_MASK   (0x7F << ANAPARAM_PWR1_SHIFT)

Definition at line 217 of file rtl818x.h.

Referenced by sa2400_rf_init().

◆ RTL818X_RX_RING_SIZE

#define RTL818X_RX_RING_SIZE   8 /* doesn't have to be a power of 2 */

Definition at line 219 of file rtl818x.h.

Referenced by rtl818x_free_rx_ring(), rtl818x_handle_rx(), and rtl818x_init_rx_ring().

◆ RTL818X_TX_RING_SIZE

#define RTL818X_TX_RING_SIZE   8 /* nor this [but 2^n is very slightly faster] */

◆ RTL818X_RING_ALIGN

#define RTL818X_RING_ALIGN   256

Definition at line 221 of file rtl818x.h.

Referenced by rtl818x_init_rx_ring(), and rtl818x_init_tx_ring().

◆ RTL818X_MAX_RETRIES

#define RTL818X_MAX_RETRIES   4

Definition at line 223 of file rtl818x.h.

Referenced by rtl818x_tx().

◆ RTL818X_RF_DRIVERS

#define RTL818X_RF_DRIVERS   __table(struct rtl818x_rf_ops, "rtl818x_rf_drivers")

Definition at line 349 of file rtl818x.h.

Referenced by rtl818x_probe().

◆ __rtl818x_rf_driver

#define __rtl818x_rf_driver   __table_entry(RTL818X_RF_DRIVERS, 01)

Definition at line 350 of file rtl818x.h.

Enumeration Type Documentation

◆ rtl818x_tx_desc_flags

Enumerator
RTL818X_TX_DESC_FLAG_NO_ENC 
RTL818X_TX_DESC_FLAG_TX_OK 
RTL818X_TX_DESC_FLAG_SPLCP 
RTL818X_TX_DESC_FLAG_RX_UNDER 
RTL818X_TX_DESC_FLAG_MOREFRAG 
RTL818X_TX_DESC_FLAG_CTS 
RTL818X_TX_DESC_FLAG_RTS 
RTL818X_TX_DESC_FLAG_LS 
RTL818X_TX_DESC_FLAG_FS 
RTL818X_TX_DESC_FLAG_DMA 
RTL818X_TX_DESC_FLAG_OWN 

Definition at line 225 of file rtl818x.h.

225 {
226 RTL818X_TX_DESC_FLAG_NO_ENC = (1 << 15),
227 RTL818X_TX_DESC_FLAG_TX_OK = (1 << 15),
228 RTL818X_TX_DESC_FLAG_SPLCP = (1 << 16),
231 RTL818X_TX_DESC_FLAG_CTS = (1 << 18),
232 RTL818X_TX_DESC_FLAG_RTS = (1 << 23),
233 RTL818X_TX_DESC_FLAG_LS = (1 << 28),
234 RTL818X_TX_DESC_FLAG_FS = (1 << 29),
235 RTL818X_TX_DESC_FLAG_DMA = (1 << 30),
236 RTL818X_TX_DESC_FLAG_OWN = (1 << 31)
237};
@ RTL818X_TX_DESC_FLAG_RTS
Definition rtl818x.h:232
@ RTL818X_TX_DESC_FLAG_CTS
Definition rtl818x.h:231
@ RTL818X_TX_DESC_FLAG_NO_ENC
Definition rtl818x.h:226
@ RTL818X_TX_DESC_FLAG_RX_UNDER
Definition rtl818x.h:229
@ RTL818X_TX_DESC_FLAG_LS
Definition rtl818x.h:233
@ RTL818X_TX_DESC_FLAG_TX_OK
Definition rtl818x.h:227
@ RTL818X_TX_DESC_FLAG_FS
Definition rtl818x.h:234
@ RTL818X_TX_DESC_FLAG_SPLCP
Definition rtl818x.h:228
@ RTL818X_TX_DESC_FLAG_OWN
Definition rtl818x.h:236
@ RTL818X_TX_DESC_FLAG_DMA
Definition rtl818x.h:235
@ RTL818X_TX_DESC_FLAG_MOREFRAG
Definition rtl818x.h:230

◆ rtl818x_rx_desc_flags

Enumerator
RTL818X_RX_DESC_FLAG_ICV_ERR 
RTL818X_RX_DESC_FLAG_CRC32_ERR 
RTL818X_RX_DESC_FLAG_PM 
RTL818X_RX_DESC_FLAG_RX_ERR 
RTL818X_RX_DESC_FLAG_BCAST 
RTL818X_RX_DESC_FLAG_PAM 
RTL818X_RX_DESC_FLAG_MCAST 
RTL818X_RX_DESC_FLAG_QOS 
RTL818X_RX_DESC_FLAG_TRSW 
RTL818X_RX_DESC_FLAG_SPLCP 
RTL818X_RX_DESC_FLAG_FOF 
RTL818X_RX_DESC_FLAG_DMA_FAIL 
RTL818X_RX_DESC_FLAG_LS 
RTL818X_RX_DESC_FLAG_FS 
RTL818X_RX_DESC_FLAG_EOR 
RTL818X_RX_DESC_FLAG_OWN 

Definition at line 253 of file rtl818x.h.

253 {
256 RTL818X_RX_DESC_FLAG_PM = (1 << 14),
257 RTL818X_RX_DESC_FLAG_RX_ERR = (1 << 15),
258 RTL818X_RX_DESC_FLAG_BCAST = (1 << 16),
259 RTL818X_RX_DESC_FLAG_PAM = (1 << 17),
260 RTL818X_RX_DESC_FLAG_MCAST = (1 << 18),
261 RTL818X_RX_DESC_FLAG_QOS = (1 << 19), /* RTL8187(B) only */
262 RTL818X_RX_DESC_FLAG_TRSW = (1 << 24), /* RTL8187(B) only */
263 RTL818X_RX_DESC_FLAG_SPLCP = (1 << 25),
264 RTL818X_RX_DESC_FLAG_FOF = (1 << 26),
266 RTL818X_RX_DESC_FLAG_LS = (1 << 28),
267 RTL818X_RX_DESC_FLAG_FS = (1 << 29),
268 RTL818X_RX_DESC_FLAG_EOR = (1 << 30),
269 RTL818X_RX_DESC_FLAG_OWN = (1 << 31)
270};
@ RTL818X_RX_DESC_FLAG_SPLCP
Definition rtl818x.h:263
@ RTL818X_RX_DESC_FLAG_FOF
Definition rtl818x.h:264
@ RTL818X_RX_DESC_FLAG_QOS
Definition rtl818x.h:261
@ RTL818X_RX_DESC_FLAG_RX_ERR
Definition rtl818x.h:257
@ RTL818X_RX_DESC_FLAG_PM
Definition rtl818x.h:256
@ RTL818X_RX_DESC_FLAG_MCAST
Definition rtl818x.h:260
@ RTL818X_RX_DESC_FLAG_BCAST
Definition rtl818x.h:258
@ RTL818X_RX_DESC_FLAG_FS
Definition rtl818x.h:267
@ RTL818X_RX_DESC_FLAG_OWN
Definition rtl818x.h:269
@ RTL818X_RX_DESC_FLAG_EOR
Definition rtl818x.h:268
@ RTL818X_RX_DESC_FLAG_DMA_FAIL
Definition rtl818x.h:265
@ RTL818X_RX_DESC_FLAG_CRC32_ERR
Definition rtl818x.h:255
@ RTL818X_RX_DESC_FLAG_PAM
Definition rtl818x.h:259
@ RTL818X_RX_DESC_FLAG_ICV_ERR
Definition rtl818x.h:254
@ RTL818X_RX_DESC_FLAG_TRSW
Definition rtl818x.h:262
@ RTL818X_RX_DESC_FLAG_LS
Definition rtl818x.h:266

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_ONLY )

◆ FILE_SECBOOT()

FILE_SECBOOT ( FORBIDDEN )

◆ rtl818x_write_phy()

void rtl818x_write_phy ( struct net80211_device * dev,
u8 addr,
u32 data )

Definition at line 48 of file rtl818x.c.

49{
50 struct rtl818x_priv *priv = dev->priv;
51 int i = 10;
52 u32 buf;
53
54 buf = (data << 8) | addr;
55
56 rtl818x_iowrite32(priv, (u32 *)&priv->map->PHY[0], buf | 0x80);
57 while (i--) {
58 rtl818x_iowrite32(priv, (u32 *)&priv->map->PHY[0], buf);
59 if (rtl818x_ioread8(priv, &priv->map->PHY[2]) == (data & 0xFF))
60 return;
61 }
62}
uint32_t addr
Buffer address.
Definition dwmac.h:9
uint8_t data[48]
Additional event data.
Definition ena.h:11
static u8 rtl818x_ioread8(struct rtl818x_priv *priv __unused, u8 *addr)
Definition rtl818x.h:316
static void rtl818x_iowrite32(struct rtl818x_priv *priv __unused, u32 *addr, u32 val)
Definition rtl818x.h:343
void * priv
Driver private data.
Definition net80211.h:798
static struct tlan_private * priv
Definition tlan.c:225
#define u32
Definition vga.h:21

References addr, data, net80211_device::priv, priv, rtl818x_ioread8(), rtl818x_iowrite32(), u32, and u8.

Referenced by grf5101_rf_init(), grf5101_write_phy_antenna(), max2820_rf_init(), max2820_rf_set_channel(), max2820_rf_stop(), max2820_write_phy_antenna(), rtl8225_write_phy_cck(), rtl8225_write_phy_ofdm(), sa2400_rf_init(), and sa2400_write_phy_antenna().

◆ rtl818x_set_anaparam()

void rtl818x_set_anaparam ( struct rtl818x_priv * priv,
u32 anaparam )

Definition at line 221 of file rtl818x.c.

222{
223 u8 reg;
224
226 reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
227 rtl818x_iowrite8(priv, &priv->map->CONFIG3,
229 rtl818x_iowrite32(priv, &priv->map->ANAPARAM, anaparam);
230 rtl818x_iowrite8(priv, &priv->map->CONFIG3,
233}
#define u8
Definition igbvf_osdep.h:40
static unsigned int unsigned int reg
Definition myson.h:162
#define RTL818X_EEPROM_CMD_NORMAL
Definition rtl818x.h:108
static void rtl818x_iowrite8(struct rtl818x_priv *priv __unused, u8 *addr, u8 val)
Definition rtl818x.h:331
#define RTL818X_EEPROM_CMD_CONFIG
Definition rtl818x.h:111
#define RTL818X_CONFIG3_ANAPARAM_WRITE
Definition rtl818x.h:124

References priv, reg, RTL818X_CONFIG3_ANAPARAM_WRITE, RTL818X_EEPROM_CMD_CONFIG, RTL818X_EEPROM_CMD_NORMAL, rtl818x_ioread8(), rtl818x_iowrite32(), rtl818x_iowrite8(), u32, and u8.

Referenced by grf5101_rf_init(), grf5101_rf_stop(), rtl818x_init_hw(), rtl8225_rf_init(), rtl8225z2_rf_init(), and sa2400_rf_init().

◆ rtl818x_ioread8()

◆ rtl818x_ioread16()

u16 rtl818x_ioread16 ( struct rtl818x_priv *priv __unused,
u16 * addr )
inlinestatic

Definition at line 321 of file rtl818x.h.

322{
323 return inw(addr);
324}
#define inw(io_addr)
Definition io.h:292

References __unused, addr, inw, priv, and u16.

Referenced by rtl818x_init_hw(), rtl818x_poll(), rtl8225_read(), rtl8225_rf_init(), rtl8225_write(), and rtl8225z2_rf_init().

◆ rtl818x_ioread32()

u32 rtl818x_ioread32 ( struct rtl818x_priv *priv __unused,
u32 * addr )
inlinestatic

Definition at line 326 of file rtl818x.h.

327{
328 return inl(addr);
329}
#define inl(io_addr)
Definition io.h:301

References __unused, addr, inl, priv, and u32.

Referenced by rtl818x_probe(), rtl818x_start(), and sa2400_rf_init().

◆ rtl818x_iowrite8()

void rtl818x_iowrite8 ( struct rtl818x_priv *priv __unused,
u8 * addr,
u8 val )
inlinestatic

◆ rtl818x_iowrite16()

void rtl818x_iowrite16 ( struct rtl818x_priv *priv __unused,
u16 * addr,
u16 val )
inlinestatic

◆ rtl818x_iowrite32()

void rtl818x_iowrite32 ( struct rtl818x_priv *priv __unused,
u32 * addr,
u32 val )
inlinestatic

◆ rtl818x_probe()

int rtl818x_probe ( struct pci_device * pdev)
extern

Definition at line 654 of file rtl818x.c.

655{
656 struct net80211_device *dev;
657 struct rtl818x_priv *priv;
658 struct rtl818x_rf_ops *rf;
659 int err, i;
660 const char *chip_name;
661 u32 reg;
662 u16 eeprom_val;
663 struct net80211_hw_info *hwinfo;
664
665 hwinfo = zalloc(sizeof(*hwinfo));
666 if (!hwinfo) {
667 DBG("rtl818x: hwinfo alloc failed\n");
668 err = -ENOMEM;
669 goto err_alloc_hwinfo;
670 }
671
672 adjust_pci_device(pdev);
673
674 dev = net80211_alloc(sizeof(*priv));
675 if (!dev) {
676 DBG("rtl818x: net80211 alloc failed\n");
677 err = -ENOMEM;
678 goto err_alloc_dev;
679 }
680
681 priv = dev->priv;
682 priv->pdev = pdev;
683 dev->netdev->dev = &pdev->dev;
684
685 priv->map = (struct rtl818x_csr *)pdev->ioaddr;
686 if (!priv->map) {
687 DBG("rtl818x: cannot find device memory\n");
688 err = -ENXIO;
689 goto err_free_dev;
690 }
691
692 reg = rtl818x_ioread32(priv, &priv->map->TX_CONF);
694 switch (reg) {
696 chip_name = "0";
697 break;
699 chip_name = "0vF";
700 break;
702 chip_name = "5";
703 break;
705 chip_name = "5vD";
706 break;
707 default:
708 DBG("rtl818x: Unknown chip! (0x%x)\n", reg >> 25);
709 err = -ENOSYS;
710 goto err_free_dev;
711 }
712
714
716 hwinfo->flags = NET80211_HW_RX_HAS_FCS;
717 hwinfo->signal_type = NET80211_SIGNAL_ARBITRARY;
718 hwinfo->signal_max = 65;
719 hwinfo->channel_change_time = 1000;
720
723
724 if (priv->r8185) {
727 } else {
728 hwinfo->modes = NET80211_MODE_B;
730 }
731
732 priv->spibit.basher.op = &rtl818x_basher_ops;
733 priv->spibit.bus.mode = SPI_MODE_THREEWIRE;
734 init_spi_bit_basher(&priv->spibit);
735
736 DBG2("rtl818x RX_CONF: %08x\n", rtl818x_ioread32(priv, &priv->map->RX_CONF));
737
738 if (rtl818x_ioread32(priv, &priv->map->RX_CONF) & (1 << 6))
739 init_at93c66(&priv->eeprom, 16);
740 else
741 init_at93c46(&priv->eeprom, 16);
742 priv->eeprom.bus = &priv->spibit.bus;
743
745 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD);
746 udelay(10);
747
748 nvs_read(&priv->eeprom.nvs, 0x06, &eeprom_val, 2);
749 DBG2("rtl818x eeprom val = %04x\n", eeprom_val);
750 eeprom_val &= 0xFF;
751
752 priv->rf = NULL;
754 if (rf->id == eeprom_val) {
755 priv->rf = rf;
756 break;
757 }
758 }
759
760 if (!priv->rf) {
761#if DBGLVL_MAX
762 if (eeprom_val < RTL818X_NR_RF_NAMES &&
763 rtl818x_rf_names[eeprom_val] != NULL)
764 DBG("rtl818x: %s RF frontend not supported!\n",
765 rtl818x_rf_names[eeprom_val]);
766 else
767 DBG("rtl818x: RF frontend #%d not recognized!\n",
768 eeprom_val);
769#endif
770
771 err = -ENOSYS;
772 goto err_free_dev;
773 }
774
775 nvs_read(&priv->eeprom.nvs, 0x17, &eeprom_val, 2);
776 priv->csthreshold = eeprom_val >> 8;
777 if (!priv->r8185) {
778 nvs_read(&priv->eeprom.nvs, 0xD, &priv->anaparam, 4);
779 nvs_read(&priv->eeprom.nvs, 0x19, &priv->rfparam, 2);
780 priv->anaparam = le32_to_cpu(priv->anaparam);
781 priv->rfparam = le16_to_cpu(priv->rfparam);
782 }
783
784 /* read the MAC address */
785 nvs_read(&priv->eeprom.nvs, 0x7, hwinfo->hwaddr, 6);
786
787 /* CCK TX power */
788 for (i = 0; i < 14; i += 2) {
789 u16 txpwr;
790 nvs_read(&priv->eeprom.nvs, 0x10 + (i >> 1), &txpwr, 2);
791 priv->txpower[i] = txpwr & 0xFF;
792 priv->txpower[i + 1] = txpwr >> 8;
793 }
794
795 /* OFDM TX power */
796 if (priv->r8185) {
797 for (i = 0; i < 14; i += 2) {
798 u16 txpwr;
799 nvs_read(&priv->eeprom.nvs, 0x20 + (i >> 1), &txpwr, 2);
800 priv->txpower[i] |= (txpwr & 0xFF) << 8;
801 priv->txpower[i + 1] |= txpwr & 0xFF00;
802 }
803 }
804
806
807 err = net80211_register(dev, &rtl818x_operations, hwinfo);
808 if (err) {
809 DBG("rtl818x: cannot register device\n");
810 goto err_free_dev;
811 }
812
813 free(hwinfo);
814
815 DBG("rtl818x: Realtek RTL818%s (RF chip %s) with address %s\n",
816 chip_name, priv->rf->name, netdev_addr(dev->netdev));
817
818 return 0;
819
820 err_free_dev:
821 pci_set_drvdata(pdev, NULL);
822 net80211_free(dev);
823 err_alloc_dev:
824 free(hwinfo);
825 err_alloc_hwinfo:
826 return err;
827}
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
#define DBG2(...)
Definition compiler.h:515
#define DBG(...)
Print a debugging message.
Definition compiler.h:498
#define NET80211_BAND_BIT_2GHZ
Bitmask for the 2GHz band.
Definition net80211.h:52
#define NET80211_BAND_2GHZ
The 2.4 GHz ISM band, unlicensed in most countries.
Definition net80211.h:45
struct net80211_device * net80211_alloc(size_t priv_size)
Allocate 802.11 device.
Definition net80211.c:755
int net80211_register(struct net80211_device *dev, struct net80211_device_operations *ops, struct net80211_hw_info *hw)
Register 802.11 device with network stack.
Definition net80211.c:792
void net80211_free(struct net80211_device *dev)
Free 802.11 device.
Definition net80211.c:839
#define NET80211_MODE_G
802.11g: 54 Mbps operation using ERP/OFDM signaling on the 2.4GHz band
Definition net80211.h:69
#define NET80211_MODE_B
802.11b: 1-11 Mbps operation using DSSS/CCK signaling on the 2.4GHz band
Definition net80211.h:66
#define ENXIO
No such device or address.
Definition errno.h:600
#define ENOSYS
Function not implemented.
Definition errno.h:565
#define ENOMEM
Not enough space.
Definition errno.h:535
#define le16_to_cpu(value)
Definition byteswap.h:113
#define le32_to_cpu(value)
Definition byteswap.h:114
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * zalloc(size_t size)
Allocate cleared memory.
Definition malloc.c:662
static const char * netdev_addr(struct net_device *netdev)
Get printable network device link-layer address.
Definition netdevice.h:542
int nvs_read(struct nvs_device *nvs, unsigned int address, void *data, size_t len)
Read from non-volatile storage device.
Definition nvs.c:76
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
Definition pci.c:241
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
Definition pci.h:366
static void(* free)(struct refcnt *refcnt))
Definition refcnt.h:55
struct net80211_device_operations rtl818x_operations
Definition rtl818x.c:645
#define RTL818X_NR_B_RATES
Definition rtl818x.c:44
static struct bit_basher_operations rtl818x_basher_ops
Definition rtl818x.c:628
static const u16 rtl818x_rates[]
Definition rtl818x.c:39
#define RTL818X_NR_RATES
Definition rtl818x.c:45
#define RTL818X_RF_DRIVERS
Definition rtl818x.h:349
#define RTL818X_TX_CONF_HWVER_MASK
Definition rtl818x.h:80
#define RTL818X_TX_CONF_R8185_D
Definition rtl818x.h:77
#define RTL818X_TX_CONF_R8180_F
Definition rtl818x.h:75
#define RTL818X_EEPROM_CMD_PROGRAM
Definition rtl818x.h:110
#define RTL818X_TX_CONF_R8180_ABCD
Definition rtl818x.h:74
#define RTL818X_TX_CONF_R8185_ABC
Definition rtl818x.h:76
static u32 rtl818x_ioread32(struct rtl818x_priv *priv __unused, u32 *addr)
Definition rtl818x.h:326
#define SPI_MODE_THREEWIRE
Threewire-compatible mode.
Definition spi.h:200
void init_spi_bit_basher(struct spi_bit_basher *spibit)
Initialise SPI bit-bashing interface.
Definition spi_bit.c:236
Structure encapsulating the complete state of an 802.11 device.
Definition net80211.h:787
struct net_device * netdev
The net_device that wraps us.
Definition net80211.h:789
Information on the capabilities of an 802.11 hardware device.
Definition net80211.h:437
int modes
A bitwise OR of the 802.11x modes supported by this device.
Definition net80211.h:450
enum net80211_hw_info::@277203366166200071173154201003141076360026365126 flags
A set of flags indicating peculiarities of this device.
int nr_rates[NET80211_NR_BANDS]
Number of supported rates, indexed by band.
Definition net80211.h:511
int bands
A bitwise OR of the bands on which this device can communicate.
Definition net80211.h:453
unsigned channel_change_time
Estimate of the time required to change channels, in microseconds.
Definition net80211.h:518
u8 hwaddr[ETH_ALEN]
Default hardware MAC address.
Definition net80211.h:447
unsigned signal_max
Maximum signal in arbitrary cases.
Definition net80211.h:495
enum net80211_hw_info::@160150106134320172247032061203111226300065160315 signal_type
Signal strength information that can be provided by the device.
u16 rates[NET80211_NR_BANDS][NET80211_MAX_RATES]
List of transmission rates supported by the card, indexed by band.
Definition net80211.h:508
struct device * dev
Underlying hardware device.
Definition netdevice.h:365
unsigned long ioaddr
I/O address.
Definition pci.h:226
struct device dev
Generic device.
Definition pci.h:213
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
Definition tables.h:386
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition timer.c:61
#define u16
Definition vga.h:20

References adjust_pci_device(), net80211_hw_info::bands, net80211_hw_info::channel_change_time, DBG, DBG2, net_device::dev, pci_device::dev, ENOMEM, ENOSYS, ENXIO, net80211_hw_info::flags, for_each_table_entry, free, net80211_hw_info::hwaddr, rtl818x_rf_ops::id, init_spi_bit_basher(), pci_device::ioaddr, le16_to_cpu, le32_to_cpu, memcpy(), net80211_hw_info::modes, net80211_alloc(), NET80211_BAND_2GHZ, NET80211_BAND_BIT_2GHZ, net80211_free(), NET80211_MODE_B, NET80211_MODE_G, net80211_register(), net80211_device::netdev, netdev_addr(), net80211_hw_info::nr_rates, NULL, nvs_read(), pci_set_drvdata(), net80211_device::priv, priv, net80211_hw_info::rates, reg, rtl818x_basher_ops, RTL818X_EEPROM_CMD_NORMAL, RTL818X_EEPROM_CMD_PROGRAM, rtl818x_ioread32(), rtl818x_ioread8(), rtl818x_iowrite8(), RTL818X_NR_B_RATES, RTL818X_NR_RATES, rtl818x_operations, rtl818x_rates, RTL818X_RF_DRIVERS, RTL818X_TX_CONF_HWVER_MASK, RTL818X_TX_CONF_R8180_ABCD, RTL818X_TX_CONF_R8180_F, RTL818X_TX_CONF_R8185_ABC, RTL818X_TX_CONF_R8185_D, net80211_hw_info::signal_max, net80211_hw_info::signal_type, SPI_MODE_THREEWIRE, u16, u32, udelay(), and zalloc().

◆ rtl818x_remove()

void rtl818x_remove ( struct pci_device * pdev)
extern

Definition at line 829 of file rtl818x.c.

830{
831 struct net80211_device *dev = pci_get_drvdata(pdev);
832
833 if (!dev)
834 return;
835
837 net80211_free(dev);
838}
void net80211_unregister(struct net80211_device *dev)
Unregister 802.11 device from network stack.
Definition net80211.c:825
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
Definition pci.h:376

References net80211_free(), net80211_unregister(), and pci_get_drvdata().