iPXE
Data Structures | Macros | Enumerations | Functions
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)
 
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 45 of file rtl818x.h.

◆ RTL818X_CMD_RX_ENABLE

#define RTL818X_CMD_RX_ENABLE   (1 << 3)

Definition at line 46 of file rtl818x.h.

◆ RTL818X_CMD_RESET

#define RTL818X_CMD_RESET   (1 << 4)

Definition at line 47 of file rtl818x.h.

◆ RTL818X_INT_RX_OK

#define RTL818X_INT_RX_OK   (1 << 0)

Definition at line 51 of file rtl818x.h.

◆ RTL818X_INT_RX_ERR

#define RTL818X_INT_RX_ERR   (1 << 1)

Definition at line 52 of file rtl818x.h.

◆ RTL818X_INT_TXL_OK

#define RTL818X_INT_TXL_OK   (1 << 2)

Definition at line 53 of file rtl818x.h.

◆ RTL818X_INT_TXL_ERR

#define RTL818X_INT_TXL_ERR   (1 << 3)

Definition at line 54 of file rtl818x.h.

◆ RTL818X_INT_RX_DU

#define RTL818X_INT_RX_DU   (1 << 4)

Definition at line 55 of file rtl818x.h.

◆ RTL818X_INT_RX_FO

#define RTL818X_INT_RX_FO   (1 << 5)

Definition at line 56 of file rtl818x.h.

◆ RTL818X_INT_TXN_OK

#define RTL818X_INT_TXN_OK   (1 << 6)

Definition at line 57 of file rtl818x.h.

◆ RTL818X_INT_TXN_ERR

#define RTL818X_INT_TXN_ERR   (1 << 7)

Definition at line 58 of file rtl818x.h.

◆ RTL818X_INT_TXH_OK

#define RTL818X_INT_TXH_OK   (1 << 8)

Definition at line 59 of file rtl818x.h.

◆ RTL818X_INT_TXH_ERR

#define RTL818X_INT_TXH_ERR   (1 << 9)

Definition at line 60 of file rtl818x.h.

◆ RTL818X_INT_TXB_OK

#define RTL818X_INT_TXB_OK   (1 << 10)

Definition at line 61 of file rtl818x.h.

◆ RTL818X_INT_TXB_ERR

#define RTL818X_INT_TXB_ERR   (1 << 11)

Definition at line 62 of file rtl818x.h.

◆ RTL818X_INT_ATIM

#define RTL818X_INT_ATIM   (1 << 12)

Definition at line 63 of file rtl818x.h.

◆ RTL818X_INT_BEACON

#define RTL818X_INT_BEACON   (1 << 13)

Definition at line 64 of file rtl818x.h.

◆ RTL818X_INT_TIME_OUT

#define RTL818X_INT_TIME_OUT   (1 << 14)

Definition at line 65 of file rtl818x.h.

◆ RTL818X_INT_TX_FO

#define RTL818X_INT_TX_FO   (1 << 15)

Definition at line 66 of file rtl818x.h.

◆ RTL818X_TX_CONF_LOOPBACK_MAC

#define RTL818X_TX_CONF_LOOPBACK_MAC   (1 << 17)

Definition at line 68 of file rtl818x.h.

◆ RTL818X_TX_CONF_LOOPBACK_CONT

#define RTL818X_TX_CONF_LOOPBACK_CONT   (3 << 17)

Definition at line 69 of file rtl818x.h.

◆ RTL818X_TX_CONF_NO_ICV

#define RTL818X_TX_CONF_NO_ICV   (1 << 19)

Definition at line 70 of file rtl818x.h.

◆ RTL818X_TX_CONF_DISCW

#define RTL818X_TX_CONF_DISCW   (1 << 20)

Definition at line 71 of file rtl818x.h.

◆ RTL818X_TX_CONF_SAT_HWPLCP

#define RTL818X_TX_CONF_SAT_HWPLCP   (1 << 24)

Definition at line 72 of file rtl818x.h.

◆ RTL818X_TX_CONF_R8180_ABCD

#define RTL818X_TX_CONF_R8180_ABCD   (2 << 25)

Definition at line 73 of file rtl818x.h.

◆ RTL818X_TX_CONF_R8180_F

#define RTL818X_TX_CONF_R8180_F   (3 << 25)

Definition at line 74 of file rtl818x.h.

◆ RTL818X_TX_CONF_R8185_ABC

#define RTL818X_TX_CONF_R8185_ABC   (4 << 25)

Definition at line 75 of file rtl818x.h.

◆ RTL818X_TX_CONF_R8185_D

#define RTL818X_TX_CONF_R8185_D   (5 << 25)

Definition at line 76 of file rtl818x.h.

◆ RTL818X_TX_CONF_R8187vD

#define RTL818X_TX_CONF_R8187vD   (5 << 25)

Definition at line 77 of file rtl818x.h.

◆ RTL818X_TX_CONF_R8187vD_B

#define RTL818X_TX_CONF_R8187vD_B   (6 << 25)

Definition at line 78 of file rtl818x.h.

◆ RTL818X_TX_CONF_HWVER_MASK

#define RTL818X_TX_CONF_HWVER_MASK   (7 << 25)

Definition at line 79 of file rtl818x.h.

◆ RTL818X_TX_CONF_DISREQQSIZE

#define RTL818X_TX_CONF_DISREQQSIZE   (1 << 28)

Definition at line 80 of file rtl818x.h.

◆ RTL818X_TX_CONF_PROBE_DTS

#define RTL818X_TX_CONF_PROBE_DTS   (1 << 29)

Definition at line 81 of file rtl818x.h.

◆ RTL818X_TX_CONF_HW_SEQNUM

#define RTL818X_TX_CONF_HW_SEQNUM   (1 << 30)

Definition at line 82 of file rtl818x.h.

◆ RTL818X_TX_CONF_CW_MIN

#define RTL818X_TX_CONF_CW_MIN   (1 << 31)

Definition at line 83 of file rtl818x.h.

◆ RTL818X_RX_CONF_MONITOR

#define RTL818X_RX_CONF_MONITOR   (1 << 0)

Definition at line 85 of file rtl818x.h.

◆ RTL818X_RX_CONF_NICMAC

#define RTL818X_RX_CONF_NICMAC   (1 << 1)

Definition at line 86 of file rtl818x.h.

◆ RTL818X_RX_CONF_MULTICAST

#define RTL818X_RX_CONF_MULTICAST   (1 << 2)

Definition at line 87 of file rtl818x.h.

◆ RTL818X_RX_CONF_BROADCAST

#define RTL818X_RX_CONF_BROADCAST   (1 << 3)

Definition at line 88 of file rtl818x.h.

◆ RTL818X_RX_CONF_FCS

#define RTL818X_RX_CONF_FCS   (1 << 5)

Definition at line 89 of file rtl818x.h.

◆ RTL818X_RX_CONF_DATA

#define RTL818X_RX_CONF_DATA   (1 << 18)

Definition at line 90 of file rtl818x.h.

◆ RTL818X_RX_CONF_CTRL

#define RTL818X_RX_CONF_CTRL   (1 << 19)

Definition at line 91 of file rtl818x.h.

◆ RTL818X_RX_CONF_MGMT

#define RTL818X_RX_CONF_MGMT   (1 << 20)

Definition at line 92 of file rtl818x.h.

◆ RTL818X_RX_CONF_ADDR3

#define RTL818X_RX_CONF_ADDR3   (1 << 21)

Definition at line 93 of file rtl818x.h.

◆ RTL818X_RX_CONF_PM

#define RTL818X_RX_CONF_PM   (1 << 22)

Definition at line 94 of file rtl818x.h.

◆ RTL818X_RX_CONF_BSSID

#define RTL818X_RX_CONF_BSSID   (1 << 23)

Definition at line 95 of file rtl818x.h.

◆ RTL818X_RX_CONF_RX_AUTORESETPHY

#define RTL818X_RX_CONF_RX_AUTORESETPHY   (1 << 28)

Definition at line 96 of file rtl818x.h.

◆ RTL818X_RX_CONF_CSDM1

#define RTL818X_RX_CONF_CSDM1   (1 << 29)

Definition at line 97 of file rtl818x.h.

◆ RTL818X_RX_CONF_CSDM2

#define RTL818X_RX_CONF_CSDM2   (1 << 30)

Definition at line 98 of file rtl818x.h.

◆ RTL818X_RX_CONF_ONLYERLPKT

#define RTL818X_RX_CONF_ONLYERLPKT   (1 << 31)

Definition at line 99 of file rtl818x.h.

◆ RTL818X_EEPROM_CMD_READ

#define RTL818X_EEPROM_CMD_READ   (1 << 0)

Definition at line 103 of file rtl818x.h.

◆ RTL818X_EEPROM_CMD_WRITE

#define RTL818X_EEPROM_CMD_WRITE   (1 << 1)

Definition at line 104 of file rtl818x.h.

◆ RTL818X_EEPROM_CMD_CK

#define RTL818X_EEPROM_CMD_CK   (1 << 2)

Definition at line 105 of file rtl818x.h.

◆ RTL818X_EEPROM_CMD_CS

#define RTL818X_EEPROM_CMD_CS   (1 << 3)

Definition at line 106 of file rtl818x.h.

◆ RTL818X_EEPROM_CMD_NORMAL

#define RTL818X_EEPROM_CMD_NORMAL   (0 << 6)

Definition at line 107 of file rtl818x.h.

◆ RTL818X_EEPROM_CMD_LOAD

#define RTL818X_EEPROM_CMD_LOAD   (1 << 6)

Definition at line 108 of file rtl818x.h.

◆ RTL818X_EEPROM_CMD_PROGRAM

#define RTL818X_EEPROM_CMD_PROGRAM   (2 << 6)

Definition at line 109 of file rtl818x.h.

◆ RTL818X_EEPROM_CMD_CONFIG

#define RTL818X_EEPROM_CMD_CONFIG   (3 << 6)

Definition at line 110 of file rtl818x.h.

◆ RTL818X_CONFIG2_ANTENNA_DIV

#define RTL818X_CONFIG2_ANTENNA_DIV   (1 << 6)

Definition at line 114 of file rtl818x.h.

◆ RTL818X_MSR_NO_LINK

#define RTL818X_MSR_NO_LINK   (0 << 2)

Definition at line 117 of file rtl818x.h.

◆ RTL818X_MSR_ADHOC

#define RTL818X_MSR_ADHOC   (1 << 2)

Definition at line 118 of file rtl818x.h.

◆ RTL818X_MSR_INFRA

#define RTL818X_MSR_INFRA   (2 << 2)

Definition at line 119 of file rtl818x.h.

◆ RTL818X_MSR_MASTER

#define RTL818X_MSR_MASTER   (3 << 2)

Definition at line 120 of file rtl818x.h.

◆ RTL818X_MSR_ENEDCA

#define RTL818X_MSR_ENEDCA   (4 << 2)

Definition at line 121 of file rtl818x.h.

◆ RTL818X_CONFIG3_ANAPARAM_WRITE

#define RTL818X_CONFIG3_ANAPARAM_WRITE   (1 << 6)

Definition at line 123 of file rtl818x.h.

◆ RTL818X_CONFIG3_GNT_SELECT

#define RTL818X_CONFIG3_GNT_SELECT   (1 << 7)

Definition at line 124 of file rtl818x.h.

◆ RTL818X_CONFIG4_POWEROFF

#define RTL818X_CONFIG4_POWEROFF   (1 << 6)

Definition at line 126 of file rtl818x.h.

◆ RTL818X_CONFIG4_VCOOFF

#define RTL818X_CONFIG4_VCOOFF   (1 << 7)

Definition at line 127 of file rtl818x.h.

◆ RTL818X_TX_AGC_CTL_PERPACKET_GAIN_SHIFT

#define RTL818X_TX_AGC_CTL_PERPACKET_GAIN_SHIFT   (1 << 0)

Definition at line 154 of file rtl818x.h.

◆ RTL818X_TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT

#define RTL818X_TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT   (1 << 1)

Definition at line 155 of file rtl818x.h.

◆ RTL818X_TX_AGC_CTL_FEEDBACK_ANT

#define RTL818X_TX_AGC_CTL_FEEDBACK_ANT   (1 << 2)

Definition at line 156 of file rtl818x.h.

◆ RTL818X_CW_CONF_PERPACKET_CW_SHIFT

#define RTL818X_CW_CONF_PERPACKET_CW_SHIFT   (1 << 0)

Definition at line 168 of file rtl818x.h.

◆ RTL818X_CW_CONF_PERPACKET_RETRY_SHIFT

#define RTL818X_CW_CONF_PERPACKET_RETRY_SHIFT   (1 << 1)

Definition at line 169 of file rtl818x.h.

◆ RTL818X_RATE_FALLBACK_ENABLE

#define RTL818X_RATE_FALLBACK_ENABLE   (1 << 7)

Definition at line 172 of file rtl818x.h.

◆ RTL818X_R8187B_B

#define RTL818X_R8187B_B   0

Definition at line 183 of file rtl818x.h.

◆ RTL818X_R8187B_D

#define RTL818X_R8187B_D   1

Definition at line 184 of file rtl818x.h.

◆ RTL818X_R8187B_E

#define RTL818X_R8187B_E   2

Definition at line 185 of file rtl818x.h.

◆ MAX_RX_SIZE

#define MAX_RX_SIZE   IEEE80211_MAX_FRAME_LEN

Definition at line 197 of file rtl818x.h.

◆ RF_PARAM_ANALOGPHY

#define RF_PARAM_ANALOGPHY   (1 << 0)

Definition at line 199 of file rtl818x.h.

◆ RF_PARAM_ANTBDEFAULT

#define RF_PARAM_ANTBDEFAULT   (1 << 1)

Definition at line 200 of file rtl818x.h.

◆ RF_PARAM_CARRIERSENSE1

#define RF_PARAM_CARRIERSENSE1   (1 << 2)

Definition at line 201 of file rtl818x.h.

◆ RF_PARAM_CARRIERSENSE2

#define RF_PARAM_CARRIERSENSE2   (1 << 3)

Definition at line 202 of file rtl818x.h.

◆ BB_ANTATTEN_CHAN14

#define BB_ANTATTEN_CHAN14   0x0C

Definition at line 204 of file rtl818x.h.

◆ BB_ANTENNA_B

#define BB_ANTENNA_B   0x40

Definition at line 205 of file rtl818x.h.

◆ BB_HOST_BANG

#define BB_HOST_BANG   (1 << 30)

Definition at line 207 of file rtl818x.h.

◆ BB_HOST_BANG_EN

#define BB_HOST_BANG_EN   (1 << 2)

Definition at line 208 of file rtl818x.h.

◆ BB_HOST_BANG_CLK

#define BB_HOST_BANG_CLK   (1 << 1)

Definition at line 209 of file rtl818x.h.

◆ BB_HOST_BANG_DATA

#define BB_HOST_BANG_DATA   1

Definition at line 210 of file rtl818x.h.

◆ ANAPARAM_TXDACOFF_SHIFT

#define ANAPARAM_TXDACOFF_SHIFT   27

Definition at line 212 of file rtl818x.h.

◆ ANAPARAM_PWR0_SHIFT

#define ANAPARAM_PWR0_SHIFT   28

Definition at line 213 of file rtl818x.h.

◆ ANAPARAM_PWR0_MASK

#define ANAPARAM_PWR0_MASK   (0x07 << ANAPARAM_PWR0_SHIFT)

Definition at line 214 of file rtl818x.h.

◆ ANAPARAM_PWR1_SHIFT

#define ANAPARAM_PWR1_SHIFT   20

Definition at line 215 of file rtl818x.h.

◆ ANAPARAM_PWR1_MASK

#define ANAPARAM_PWR1_MASK   (0x7F << ANAPARAM_PWR1_SHIFT)

Definition at line 216 of file rtl818x.h.

◆ RTL818X_RX_RING_SIZE

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

Definition at line 218 of file rtl818x.h.

◆ RTL818X_TX_RING_SIZE

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

Definition at line 219 of file rtl818x.h.

◆ RTL818X_RING_ALIGN

#define RTL818X_RING_ALIGN   256

Definition at line 220 of file rtl818x.h.

◆ RTL818X_MAX_RETRIES

#define RTL818X_MAX_RETRIES   4

Definition at line 222 of file rtl818x.h.

◆ RTL818X_RF_DRIVERS

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

Definition at line 348 of file rtl818x.h.

◆ __rtl818x_rf_driver

#define __rtl818x_rf_driver   __table_entry(RTL818X_RF_DRIVERS, 01)

Definition at line 349 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 224 of file rtl818x.h.

◆ 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 252 of file rtl818x.h.

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

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_ONLY  )

◆ rtl818x_write_phy()

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

Definition at line 46 of file rtl818x.c.

47 {
48  struct rtl818x_priv *priv = dev->priv;
49  int i = 10;
50  u32 buf;
51 
52  buf = (data << 8) | addr;
53 
54  rtl818x_iowrite32(priv, (u32 *)&priv->map->PHY[0], buf | 0x80);
55  while (i--) {
56  rtl818x_iowrite32(priv, (u32 *)&priv->map->PHY[0], buf);
57  if (rtl818x_ioread8(priv, &priv->map->PHY[2]) == (data & 0xFF))
58  return;
59  }
60 }
static u8 rtl818x_ioread8(struct rtl818x_priv *priv __unused, u8 *addr)
Definition: rtl818x.h:315
static void rtl818x_iowrite32(struct rtl818x_priv *priv __unused, u32 *addr, u32 val)
Definition: rtl818x.h:342
void * priv
Driver private data.
Definition: net80211.h:798
static struct tlan_private * priv
Definition: tlan.c:224
u32 addr
Definition: sky2.h:8
uint8_t data[48]
Additional event data.
Definition: ena.h:22
uint32_t u32
Definition: stdint.h:23

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

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 219 of file rtl818x.c.

220 {
221  u8 reg;
222 
224  reg = rtl818x_ioread8(priv, &priv->map->CONFIG3);
225  rtl818x_iowrite8(priv, &priv->map->CONFIG3,
227  rtl818x_iowrite32(priv, &priv->map->ANAPARAM, anaparam);
228  rtl818x_iowrite8(priv, &priv->map->CONFIG3,
231 }
#define RTL818X_CONFIG3_ANAPARAM_WRITE
Definition: rtl818x.h:123
static unsigned int unsigned int reg
Definition: myson.h:162
static u8 rtl818x_ioread8(struct rtl818x_priv *priv __unused, u8 *addr)
Definition: rtl818x.h:315
static void rtl818x_iowrite8(struct rtl818x_priv *priv __unused, u8 *addr, u8 val)
Definition: rtl818x.h:330
#define RTL818X_EEPROM_CMD_CONFIG
Definition: rtl818x.h:110
static void rtl818x_iowrite32(struct rtl818x_priv *priv __unused, u32 *addr, u32 val)
Definition: rtl818x.h:342
static struct tlan_private * priv
Definition: tlan.c:224
#define RTL818X_EEPROM_CMD_NORMAL
Definition: rtl818x.h:107
u32 anaparam
Definition: rtl818x.h:307
uint8_t u8
Definition: stdint.h:19

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

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

◆ rtl818x_ioread8()

static u8 rtl818x_ioread8 ( struct rtl818x_priv *priv  __unused,
u8 addr 
)
inlinestatic

◆ rtl818x_ioread16()

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

Definition at line 320 of file rtl818x.h.

321 {
322  return inw(addr);
323 }
uint16_t inw(volatile uint16_t *io_addr)
Read 16-bit word from I/O-mapped device.
u32 addr
Definition: sky2.h:8

References addr, and inw().

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

◆ rtl818x_ioread32()

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

Definition at line 325 of file rtl818x.h.

326 {
327  return inl(addr);
328 }
u32 addr
Definition: sky2.h:8
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.

References addr, and inl().

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

◆ rtl818x_iowrite8()

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

◆ rtl818x_iowrite16()

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

Definition at line 336 of file rtl818x.h.

338 {
339  outw(val, addr);
340 }
void __asmcall int val
Definition: setjmp.h:12
#define outw(data, io_addr)
Definition: io.h:319
u32 addr
Definition: sky2.h:8

References addr, outw, and val.

Referenced by rtl818x_init_hw(), rtl818x_irq(), rtl818x_poll(), rtl818x_set_hwaddr(), rtl818x_start(), rtl8225_read(), rtl8225_rf_init(), rtl8225_write(), rtl8225x_rf_init(), rtl8225z2_rf_init(), write_grf5101(), write_max2820(), and write_sa2400().

◆ rtl818x_iowrite32()

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

Definition at line 342 of file rtl818x.h.

344 {
345  outl(val, addr);
346 }
void __asmcall int val
Definition: setjmp.h:12
#define outl(data, io_addr)
Definition: io.h:329
u32 addr
Definition: sky2.h:8

References addr, outl, and val.

Referenced by rtl818x_init_hw(), rtl818x_set_anaparam(), rtl818x_set_hwaddr(), rtl818x_start(), rtl818x_write_phy(), rtl8225_rf_init(), rtl8225_rf_set_tx_power(), rtl8225_rf_stop(), rtl8225z2_rf_init(), and sa2400_rf_init().

◆ rtl818x_probe()

int rtl818x_probe ( struct pci_device pdev)

Definition at line 652 of file rtl818x.c.

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

References adjust_pci_device(), net80211_hw_info::bands, net80211_hw_info::channel_change_time, DBG, DBG2, pci_device::dev, net_device::dev, ENOMEM, ENOSYS, ENXIO, net80211_hw_info::flags, for_each_table_entry, free, net80211_hw_info::hwaddr, rtl818x_rf_ops::id, if(), 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(), priv, net80211_device::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, udelay(), and zalloc().

◆ rtl818x_remove()

void rtl818x_remove ( struct pci_device pdev)

Definition at line 827 of file rtl818x.c.

828 {
829  struct net80211_device *dev = pci_get_drvdata(pdev);
830 
831  if (!dev)
832  return;
833 
834  net80211_unregister(dev);
835  net80211_free(dev);
836 }
void net80211_free(struct net80211_device *dev)
Free 802.11 device.
Definition: net80211.c:838
void net80211_unregister(struct net80211_device *dev)
Unregister 802.11 device from network stack.
Definition: net80211.c:824
Structure encapsulating the complete state of an 802.11 device.
Definition: net80211.h:786
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
Definition: pci.h:369

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