iPXE
Data Structures | Defines | 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

Defines

#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)

Define Documentation

#define RTL818X_CMD_TX_ENABLE   (1 << 2)

Definition at line 45 of file rtl818x.h.

Referenced by rtl818x_start(), and rtl818x_stop().

#define RTL818X_CMD_RX_ENABLE   (1 << 3)

Definition at line 46 of file rtl818x.h.

Referenced by rtl818x_start(), and rtl818x_stop().

#define RTL818X_CMD_RESET   (1 << 4)

Definition at line 47 of file rtl818x.h.

Referenced by rtl818x_init_hw().

#define RTL818X_INT_RX_OK   (1 << 0)

Definition at line 51 of file rtl818x.h.

Referenced by rtl818x_poll().

#define RTL818X_INT_RX_ERR   (1 << 1)

Definition at line 52 of file rtl818x.h.

Referenced by rtl818x_poll().

#define RTL818X_INT_TXL_OK   (1 << 2)

Definition at line 53 of file rtl818x.h.

#define RTL818X_INT_TXL_ERR   (1 << 3)

Definition at line 54 of file rtl818x.h.

#define RTL818X_INT_RX_DU   (1 << 4)

Definition at line 55 of file rtl818x.h.

#define RTL818X_INT_RX_FO   (1 << 5)

Definition at line 56 of file rtl818x.h.

#define RTL818X_INT_TXN_OK   (1 << 6)

Definition at line 57 of file rtl818x.h.

Referenced by rtl818x_poll().

#define RTL818X_INT_TXN_ERR   (1 << 7)

Definition at line 58 of file rtl818x.h.

Referenced by rtl818x_poll().

#define RTL818X_INT_TXH_OK   (1 << 8)

Definition at line 59 of file rtl818x.h.

#define RTL818X_INT_TXH_ERR   (1 << 9)

Definition at line 60 of file rtl818x.h.

#define RTL818X_INT_TXB_OK   (1 << 10)

Definition at line 61 of file rtl818x.h.

#define RTL818X_INT_TXB_ERR   (1 << 11)

Definition at line 62 of file rtl818x.h.

#define RTL818X_INT_ATIM   (1 << 12)

Definition at line 63 of file rtl818x.h.

#define RTL818X_INT_BEACON   (1 << 13)

Definition at line 64 of file rtl818x.h.

#define RTL818X_INT_TIME_OUT   (1 << 14)

Definition at line 65 of file rtl818x.h.

#define RTL818X_INT_TX_FO   (1 << 15)

Definition at line 66 of file rtl818x.h.

#define RTL818X_TX_CONF_LOOPBACK_MAC   (1 << 17)

Definition at line 68 of file rtl818x.h.

#define RTL818X_TX_CONF_LOOPBACK_CONT   (3 << 17)

Definition at line 69 of file rtl818x.h.

Referenced by sa2400_rf_init().

#define RTL818X_TX_CONF_NO_ICV   (1 << 19)

Definition at line 70 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_TX_CONF_DISCW   (1 << 20)

Definition at line 71 of file rtl818x.h.

#define RTL818X_TX_CONF_SAT_HWPLCP   (1 << 24)

Definition at line 72 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_TX_CONF_R8180_ABCD   (2 << 25)

Definition at line 73 of file rtl818x.h.

Referenced by rtl818x_probe().

#define RTL818X_TX_CONF_R8180_F   (3 << 25)

Definition at line 74 of file rtl818x.h.

Referenced by rtl818x_probe().

#define RTL818X_TX_CONF_R8185_ABC   (4 << 25)

Definition at line 75 of file rtl818x.h.

Referenced by rtl818x_probe().

#define RTL818X_TX_CONF_R8185_D   (5 << 25)

Definition at line 76 of file rtl818x.h.

Referenced by rtl818x_probe().

#define RTL818X_TX_CONF_R8187vD   (5 << 25)

Definition at line 77 of file rtl818x.h.

#define RTL818X_TX_CONF_R8187vD_B   (6 << 25)

Definition at line 78 of file rtl818x.h.

#define RTL818X_TX_CONF_HWVER_MASK   (7 << 25)

Definition at line 79 of file rtl818x.h.

Referenced by rtl818x_probe().

#define RTL818X_TX_CONF_DISREQQSIZE   (1 << 28)

Definition at line 80 of file rtl818x.h.

#define RTL818X_TX_CONF_PROBE_DTS   (1 << 29)

Definition at line 81 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_TX_CONF_HW_SEQNUM   (1 << 30)

Definition at line 82 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_TX_CONF_CW_MIN   (1 << 31)

Definition at line 83 of file rtl818x.h.

#define RTL818X_RX_CONF_MONITOR   (1 << 0)

Definition at line 85 of file rtl818x.h.

#define RTL818X_RX_CONF_NICMAC   (1 << 1)

Definition at line 86 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_RX_CONF_MULTICAST   (1 << 2)

Definition at line 87 of file rtl818x.h.

#define RTL818X_RX_CONF_BROADCAST   (1 << 3)

Definition at line 88 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_RX_CONF_FCS   (1 << 5)

Definition at line 89 of file rtl818x.h.

#define RTL818X_RX_CONF_DATA   (1 << 18)

Definition at line 90 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_RX_CONF_CTRL   (1 << 19)

Definition at line 91 of file rtl818x.h.

#define RTL818X_RX_CONF_MGMT   (1 << 20)

Definition at line 92 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_RX_CONF_ADDR3   (1 << 21)

Definition at line 93 of file rtl818x.h.

#define RTL818X_RX_CONF_PM   (1 << 22)

Definition at line 94 of file rtl818x.h.

#define RTL818X_RX_CONF_BSSID   (1 << 23)

Definition at line 95 of file rtl818x.h.

#define RTL818X_RX_CONF_RX_AUTORESETPHY   (1 << 28)

Definition at line 96 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_RX_CONF_CSDM1   (1 << 29)

Definition at line 97 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_RX_CONF_CSDM2   (1 << 30)

Definition at line 98 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_RX_CONF_ONLYERLPKT   (1 << 31)

Definition at line 99 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_EEPROM_CMD_READ   (1 << 0)

Definition at line 103 of file rtl818x.h.

#define RTL818X_EEPROM_CMD_WRITE   (1 << 1)

Definition at line 104 of file rtl818x.h.

#define RTL818X_EEPROM_CMD_CK   (1 << 2)

Definition at line 105 of file rtl818x.h.

#define RTL818X_EEPROM_CMD_CS   (1 << 3)

Definition at line 106 of file rtl818x.h.

#define RTL818X_EEPROM_CMD_NORMAL   (0 << 6)
#define RTL818X_EEPROM_CMD_LOAD   (1 << 6)

Definition at line 108 of file rtl818x.h.

Referenced by rtl818x_init_hw().

#define RTL818X_EEPROM_CMD_PROGRAM   (2 << 6)

Definition at line 109 of file rtl818x.h.

Referenced by rtl818x_probe().

#define RTL818X_EEPROM_CMD_CONFIG   (3 << 6)
#define RTL818X_CONFIG2_ANTENNA_DIV   (1 << 6)

Definition at line 114 of file rtl818x.h.

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

#define RTL818X_MSR_NO_LINK   (0 << 2)

Definition at line 117 of file rtl818x.h.

Referenced by rtl818x_config().

#define RTL818X_MSR_ADHOC   (1 << 2)

Definition at line 118 of file rtl818x.h.

#define RTL818X_MSR_INFRA   (2 << 2)

Definition at line 119 of file rtl818x.h.

Referenced by rtl818x_config().

#define RTL818X_MSR_MASTER   (3 << 2)

Definition at line 120 of file rtl818x.h.

#define RTL818X_MSR_ENEDCA   (4 << 2)

Definition at line 121 of file rtl818x.h.

#define RTL818X_CONFIG3_ANAPARAM_WRITE   (1 << 6)

Definition at line 123 of file rtl818x.h.

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

#define RTL818X_CONFIG3_GNT_SELECT   (1 << 7)

Definition at line 124 of file rtl818x.h.

#define RTL818X_CONFIG4_POWEROFF   (1 << 6)

Definition at line 126 of file rtl818x.h.

#define RTL818X_CONFIG4_VCOOFF   (1 << 7)

Definition at line 127 of file rtl818x.h.

Referenced by rtl818x_stop().

Definition at line 154 of file rtl818x.h.

Referenced by rtl818x_start().

Definition at line 155 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_TX_AGC_CTL_FEEDBACK_ANT   (1 << 2)

Definition at line 156 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_CW_CONF_PERPACKET_CW_SHIFT   (1 << 0)

Definition at line 168 of file rtl818x.h.

Referenced by rtl818x_start().

Definition at line 169 of file rtl818x.h.

Referenced by rtl818x_start().

#define RTL818X_RATE_FALLBACK_ENABLE   (1 << 7)

Definition at line 172 of file rtl818x.h.

#define RTL818X_R8187B_B   0

Definition at line 183 of file rtl818x.h.

#define RTL818X_R8187B_D   1

Definition at line 184 of file rtl818x.h.

#define RTL818X_R8187B_E   2

Definition at line 185 of file rtl818x.h.

Definition at line 197 of file rtl818x.h.

Referenced by rtl818x_handle_rx(), and rtl818x_init_rx_ring().

#define RF_PARAM_ANALOGPHY   (1 << 0)

Definition at line 199 of file rtl818x.h.

Referenced by sa2400_rf_init().

#define RF_PARAM_ANTBDEFAULT   (1 << 1)
#define RF_PARAM_CARRIERSENSE1   (1 << 2)

Definition at line 201 of file rtl818x.h.

Referenced by rtl818x_start().

#define RF_PARAM_CARRIERSENSE2   (1 << 3)

Definition at line 202 of file rtl818x.h.

Referenced by rtl818x_start().

#define BB_ANTATTEN_CHAN14   0x0C
#define BB_ANTENNA_B   0x40
#define BB_HOST_BANG   (1 << 30)

Definition at line 207 of file rtl818x.h.

#define BB_HOST_BANG_EN   (1 << 2)

Definition at line 208 of file rtl818x.h.

#define BB_HOST_BANG_CLK   (1 << 1)

Definition at line 209 of file rtl818x.h.

#define BB_HOST_BANG_DATA   1

Definition at line 210 of file rtl818x.h.

#define ANAPARAM_TXDACOFF_SHIFT   27

Definition at line 212 of file rtl818x.h.

Referenced by sa2400_rf_init().

#define ANAPARAM_PWR0_SHIFT   28

Definition at line 213 of file rtl818x.h.

Referenced by sa2400_rf_init().

#define ANAPARAM_PWR0_MASK   (0x07 << ANAPARAM_PWR0_SHIFT)

Definition at line 214 of file rtl818x.h.

Referenced by sa2400_rf_init().

#define ANAPARAM_PWR1_SHIFT   20

Definition at line 215 of file rtl818x.h.

Referenced by sa2400_rf_init().

#define ANAPARAM_PWR1_MASK   (0x7F << ANAPARAM_PWR1_SHIFT)

Definition at line 216 of file rtl818x.h.

Referenced by sa2400_rf_init().

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

Definition at line 218 of file rtl818x.h.

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

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

Definition at line 220 of file rtl818x.h.

Referenced by rtl818x_init_rx_ring(), and rtl818x_init_tx_ring().

#define RTL818X_MAX_RETRIES   4

Definition at line 222 of file rtl818x.h.

Referenced by rtl818x_tx().

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

Definition at line 348 of file rtl818x.h.

Referenced by rtl818x_probe().

Definition at line 349 of file rtl818x.h.


Enumeration Type Documentation

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.

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.

                           {
        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), /* RTL8187(B) only */
        RTL818X_RX_DESC_FLAG_TRSW       = (1 << 24), /* RTL8187(B) only */
        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)
};

Function Documentation

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 
) [inline, static]
static u16 rtl818x_ioread16 ( struct rtl818x_priv *priv  __unused,
u16 addr 
) [inline, static]

Definition at line 320 of file rtl818x.h.

References inw().

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

{
        return inw(addr);
}
static u32 rtl818x_ioread32 ( struct rtl818x_priv *priv  __unused,
u32 addr 
) [inline, static]

Definition at line 325 of file rtl818x.h.

References inl().

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

{
        return inl(addr);
}
static void rtl818x_iowrite8 ( struct rtl818x_priv *priv  __unused,
u8 addr,
u8  val 
) [inline, static]
static void rtl818x_iowrite16 ( struct rtl818x_priv *priv  __unused,
u16 addr,
u16  val 
) [inline, static]
static void rtl818x_iowrite32 ( struct rtl818x_priv *priv  __unused,
u32 addr,
u32  val 
) [inline, static]
int rtl818x_probe ( struct pci_device pdev)

Definition at line 652 of file rtl818x.c.

References adjust_pci_device(), rtl818x_priv::anaparam, net80211_hw_info::bands, spi_bit_basher::basher, spi_bit_basher::bus, spi_device::bus, net80211_hw_info::channel_change_time, rtl818x_priv::csthreshold, DBG, DBG2, pci_device::dev, net_device::dev, rtl818x_priv::eeprom, rtl818x_csr::EEPROM_CMD, 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, rtl818x_priv::map, memcpy(), spi_bus::mode, net80211_hw_info::modes, rtl818x_rf_ops::name, 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, spi_device::nvs, nvs_read(), bit_basher::op, pci_set_drvdata(), rtl818x_priv::pdev, priv, net80211_device::priv, rtl818x_priv::r8185, net80211_hw_info::rates, reg, rtl818x_priv::rf, rtl818x_priv::rfparam, 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_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, rtl818x_csr::RX_CONF, net80211_hw_info::signal_max, net80211_hw_info::signal_type, SPI_MODE_THREEWIRE, rtl818x_priv::spibit, rtl818x_csr::TX_CONF, rtl818x_priv::txpower, udelay(), and zalloc().

{
        struct net80211_device *dev;
        struct rtl818x_priv *priv;
        struct rtl818x_rf_ops *rf;
        int err, i;
        const char *chip_name;
        u32 reg;
        u16 eeprom_val;
        struct net80211_hw_info *hwinfo;

        hwinfo = zalloc(sizeof(*hwinfo));
        if (!hwinfo) {
                DBG("rtl818x: hwinfo alloc failed\n");
                err = -ENOMEM;
                goto err_alloc_hwinfo;
        }

        adjust_pci_device(pdev);

        dev = net80211_alloc(sizeof(*priv));
        if (!dev) {
                DBG("rtl818x: net80211 alloc failed\n");
                err = -ENOMEM;
                goto err_alloc_dev;
        }

        priv = dev->priv;
        priv->pdev = pdev;
        dev->netdev->dev = &pdev->dev;

        priv->map = (struct rtl818x_csr *)pdev->ioaddr;
        if (!priv->map) {
                DBG("rtl818x: cannot find device memory\n");
                err = -ENXIO;
                goto err_free_dev;
        }

        reg = rtl818x_ioread32(priv, &priv->map->TX_CONF);
        reg &= RTL818X_TX_CONF_HWVER_MASK;
        switch (reg) {
        case RTL818X_TX_CONF_R8180_ABCD:
                chip_name = "0";
                break;
        case RTL818X_TX_CONF_R8180_F:
                chip_name = "0vF";
                break;
        case RTL818X_TX_CONF_R8185_ABC:
                chip_name = "5";
                break;
        case RTL818X_TX_CONF_R8185_D:
                chip_name = "5vD";
                break;
        default:
                DBG("rtl818x: Unknown chip! (0x%x)\n", reg >> 25);
                err = -ENOSYS;
                goto err_free_dev;
        }

        priv->r8185 = reg & RTL818X_TX_CONF_R8185_ABC;

        hwinfo->bands = NET80211_BAND_BIT_2GHZ;
        hwinfo->flags = NET80211_HW_RX_HAS_FCS;
        hwinfo->signal_type = NET80211_SIGNAL_ARBITRARY;
        hwinfo->signal_max = 65;
        hwinfo->channel_change_time = 1000;

        memcpy(hwinfo->rates[NET80211_BAND_2GHZ], rtl818x_rates,
               sizeof(*rtl818x_rates) * RTL818X_NR_RATES);

        if (priv->r8185) {
                hwinfo->modes = NET80211_MODE_B | NET80211_MODE_G;
                hwinfo->nr_rates[NET80211_BAND_2GHZ] = RTL818X_NR_RATES;
        } else {
                hwinfo->modes = NET80211_MODE_B;
                hwinfo->nr_rates[NET80211_BAND_2GHZ] = RTL818X_NR_B_RATES;
        }

        priv->spibit.basher.op = &rtl818x_basher_ops;
        priv->spibit.bus.mode = SPI_MODE_THREEWIRE;
        init_spi_bit_basher(&priv->spibit);

        DBG2("rtl818x RX_CONF: %08x\n", rtl818x_ioread32(priv, &priv->map->RX_CONF));

        if (rtl818x_ioread32(priv, &priv->map->RX_CONF) & (1 << 6))
                init_at93c66(&priv->eeprom, 16);
        else
                init_at93c46(&priv->eeprom, 16);
        priv->eeprom.bus = &priv->spibit.bus;

        rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_PROGRAM);
        rtl818x_ioread8(priv, &priv->map->EEPROM_CMD);
        udelay(10);

        nvs_read(&priv->eeprom.nvs, 0x06, &eeprom_val, 2);
        DBG2("rtl818x eeprom val = %04x\n", eeprom_val);
        eeprom_val &= 0xFF;

        priv->rf = NULL;
        for_each_table_entry(rf, RTL818X_RF_DRIVERS) {
                if (rf->id == eeprom_val) {
                        priv->rf = rf;
                        break;
                }
        }

        if (!priv->rf) {
#if DBGLVL_MAX
                if (eeprom_val < RTL818X_NR_RF_NAMES &&
                    rtl818x_rf_names[eeprom_val] != NULL)
                        DBG("rtl818x: %s RF frontend not supported!\n",
                            rtl818x_rf_names[eeprom_val]);
                else
                        DBG("rtl818x: RF frontend #%d not recognized!\n",
                            eeprom_val);
#endif

                err = -ENOSYS;
                goto err_free_dev;
        }

        nvs_read(&priv->eeprom.nvs, 0x17, &eeprom_val, 2);
        priv->csthreshold = eeprom_val >> 8;
        if (!priv->r8185) {
                nvs_read(&priv->eeprom.nvs, 0xD, &priv->anaparam, 4);
                nvs_read(&priv->eeprom.nvs, 0x19, &priv->rfparam, 2);
                priv->anaparam = le32_to_cpu(priv->anaparam);
                priv->rfparam = le16_to_cpu(priv->rfparam);
        }

        /* read the MAC address */
        nvs_read(&priv->eeprom.nvs, 0x7, hwinfo->hwaddr, 6);

        /* CCK TX power */
        for (i = 0; i < 14; i += 2) {
                u16 txpwr;
                nvs_read(&priv->eeprom.nvs, 0x10 + (i >> 1), &txpwr, 2);
                priv->txpower[i] = txpwr & 0xFF;
                priv->txpower[i + 1] = txpwr >> 8;
        }

        /* OFDM TX power */
        if (priv->r8185) {
                for (i = 0; i < 14; i += 2) {
                        u16 txpwr;
                        nvs_read(&priv->eeprom.nvs, 0x20 + (i >> 1), &txpwr, 2);
                        priv->txpower[i] |= (txpwr & 0xFF) << 8;
                        priv->txpower[i + 1] |= txpwr & 0xFF00;
                }
        }

        rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);

        err = net80211_register(dev, &rtl818x_operations, hwinfo);
        if (err) {
                DBG("rtl818x: cannot register device\n");
                goto err_free_dev;
        }

        free(hwinfo);

        DBG("rtl818x: Realtek RTL818%s (RF chip %s) with address %s\n",
            chip_name, priv->rf->name, netdev_addr(dev->netdev));

        return 0;

 err_free_dev:
        pci_set_drvdata(pdev, NULL);
        net80211_free(dev);
 err_alloc_dev:
        free(hwinfo);
 err_alloc_hwinfo:
        return err;
}
void rtl818x_remove ( struct pci_device pdev)

Definition at line 827 of file rtl818x.c.

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

{
        struct net80211_device *dev = pci_get_drvdata(pdev);

        if (!dev)
                return;

        net80211_unregister(dev);
        net80211_free(dev);
}