iPXE
|
#include <stdint.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <byteswap.h>
#include <ipxe/iobuf.h>
#include <ipxe/malloc.h>
#include <ipxe/pci.h>
#include <ipxe/net80211.h>
#include <ipxe/netdevice.h>
#include <ipxe/threewire.h>
#include "rtl818x.h"
Go to the source code of this file.
Macros | |
#define | RTL818X_NR_B_RATES 4 |
#define | RTL818X_NR_RATES 12 |
#define | DIV_ROUND_UP(n, d) (((n)+(d)-1)/(d)) |
Functions | |
FILE_LICENCE (GPL2_ONLY) | |
void | rtl818x_write_phy (struct net80211_device *dev, u8 addr, u32 data) |
static void | rtl818x_handle_rx (struct net80211_device *dev) |
static void | rtl818x_handle_tx (struct net80211_device *dev) |
static void | rtl818x_poll (struct net80211_device *dev) |
static int | rtl818x_tx (struct net80211_device *dev, struct io_buffer *iob) |
void | rtl818x_set_anaparam (struct rtl818x_priv *priv, u32 anaparam) |
static int | rtl818x_init_hw (struct net80211_device *dev) |
static int | rtl818x_init_rx_ring (struct net80211_device *dev) |
static void | rtl818x_free_rx_ring (struct net80211_device *dev) |
static int | rtl818x_init_tx_ring (struct net80211_device *dev) |
static void | rtl818x_free_tx_ring (struct net80211_device *dev) |
static void | rtl818x_irq (struct net80211_device *dev, int enable) |
static void | rtl818x_set_hwaddr (struct net80211_device *dev, u8 *hwaddr) |
static int | rtl818x_start (struct net80211_device *dev) |
static void | rtl818x_stop (struct net80211_device *dev) |
static int | rtl818x_config (struct net80211_device *dev, int changed) |
static int | rtl818x_spi_read_bit (struct bit_basher *basher, unsigned int bit_id) |
static void | rtl818x_spi_write_bit (struct bit_basher *basher, unsigned int bit_id, unsigned long data) |
int | rtl818x_probe (struct pci_device *pdev) |
void | rtl818x_remove (struct pci_device *pdev) |
Variables | |
static const u16 | rtl818x_rates [] |
static const u8 | rtl818x_eeprom_bits [] |
static struct bit_basher_operations | rtl818x_basher_ops |
struct net80211_device_operations | rtl818x_operations |
FILE_LICENCE | ( | GPL2_ONLY | ) |
void rtl818x_write_phy | ( | struct net80211_device * | dev, |
u8 | addr, | ||
u32 | data | ||
) |
Definition at line 46 of file rtl818x.c.
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().
|
static |
Definition at line 62 of file rtl818x.c.
References alloc_iob(), count, cpu_to_le32, io_buffer::data, DBG2, DBGP, done, EIO, ENOMEM, flags, rtl818x_rx_desc::flags, rtl818x_rx_desc::flags2, iob_put, le32_to_cpu, MAX_RX_SIZE, net80211_rx(), net80211_rx_err(), NULL, priv, net80211_device::priv, rtl818x_rates, RTL818X_RX_DESC_FLAG_CRC32_ERR, RTL818X_RX_DESC_FLAG_DMA_FAIL, RTL818X_RX_DESC_FLAG_EOR, RTL818X_RX_DESC_FLAG_FOF, RTL818X_RX_DESC_FLAG_OWN, RTL818X_RX_DESC_FLAG_RX_ERR, RTL818X_RX_RING_SIZE, rtl818x_rx_desc::rx_buf, and virt_to_bus().
Referenced by rtl818x_poll().
|
static |
Definition at line 117 of file rtl818x.c.
References count, EIO, flags, rtl818x_tx_desc::flags, le32_to_cpu, net80211_tx_complete(), NULL, priv, net80211_device::priv, rc, RTL818X_TX_DESC_FLAG_OWN, RTL818X_TX_DESC_FLAG_TX_OK, and RTL818X_TX_RING_SIZE.
Referenced by rtl818x_poll().
|
static |
Definition at line 144 of file rtl818x.c.
References priv, net80211_device::priv, reg, rtl818x_handle_rx(), rtl818x_handle_tx(), RTL818X_INT_RX_ERR, RTL818X_INT_RX_OK, RTL818X_INT_TXN_ERR, RTL818X_INT_TXN_OK, rtl818x_ioread16(), and rtl818x_iowrite16().
|
static |
Definition at line 163 of file rtl818x.c.
References cpu_to_le16, cpu_to_le32, io_buffer::data, DIV_ROUND_UP, EBUSY, rtl818x_tx_desc::flags, rtl818x_tx_desc::flags2, rtl818x_tx_desc::frame_len, iob_len(), len, net80211_cts_duration(), NET80211_PHY_USE_PROTECTION, net80211_device::phy_flags, rtl818x_tx_desc::plcp_len, priv, net80211_device::priv, net80211_device::rate, net80211_device::rates, rtl818x_tx_desc::retry_limit, rtl818x_iowrite8(), RTL818X_MAX_RETRIES, RTL818X_TX_DESC_FLAG_CTS, RTL818X_TX_DESC_FLAG_DMA, RTL818X_TX_DESC_FLAG_FS, RTL818X_TX_DESC_FLAG_LS, RTL818X_TX_DESC_FLAG_NO_ENC, RTL818X_TX_DESC_FLAG_OWN, RTL818X_TX_RING_SIZE, rtl818x_tx_desc::rts_duration, rtl818x_tx_desc::tx_buf, and virt_to_bus().
void rtl818x_set_anaparam | ( | struct rtl818x_priv * | priv, |
u32 | anaparam | ||
) |
Definition at line 219 of file rtl818x.c.
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().
|
static |
Definition at line 233 of file rtl818x.c.
References DBG, ETIMEDOUT, mdelay(), net_device::name, net80211_device::netdev, priv, net80211_device::priv, reg, RTL818X_CMD_RESET, RTL818X_EEPROM_CMD_CONFIG, RTL818X_EEPROM_CMD_LOAD, RTL818X_EEPROM_CMD_NORMAL, rtl818x_ioread16(), rtl818x_ioread8(), rtl818x_iowrite16(), rtl818x_iowrite32(), rtl818x_iowrite8(), and rtl818x_set_anaparam().
Referenced by rtl818x_start().
|
static |
Definition at line 325 of file rtl818x.c.
References alloc_iob(), cpu_to_le32, io_buffer::data, DBG, ENOMEM, rtl818x_rx_desc::flags, malloc_phys(), MAX_RX_SIZE, memset(), net_device::name, net80211_device::netdev, priv, net80211_device::priv, RTL818X_RING_ALIGN, RTL818X_RX_DESC_FLAG_EOR, RTL818X_RX_DESC_FLAG_OWN, RTL818X_RX_RING_SIZE, rtl818x_rx_desc::rx_buf, and virt_to_bus().
Referenced by rtl818x_start().
|
static |
Definition at line 357 of file rtl818x.c.
References free_iob(), free_phys(), NULL, priv, net80211_device::priv, and RTL818X_RX_RING_SIZE.
Referenced by rtl818x_start(), and rtl818x_stop().
|
static |
Definition at line 371 of file rtl818x.c.
References cpu_to_le32, DBG, ENOMEM, malloc_phys(), memset(), net_device::name, net80211_device::netdev, priv, net80211_device::priv, RTL818X_RING_ALIGN, RTL818X_TX_RING_SIZE, and virt_to_bus().
Referenced by rtl818x_start().
|
static |
Definition at line 394 of file rtl818x.c.
References ECANCELED, free_phys(), net80211_tx_complete(), NULL, priv, net80211_device::priv, and RTL818X_TX_RING_SIZE.
Referenced by rtl818x_start(), and rtl818x_stop().
|
static |
Definition at line 409 of file rtl818x.c.
References priv, net80211_device::priv, and rtl818x_iowrite16().
Referenced by rtl818x_stop().
|
static |
Definition at line 416 of file rtl818x.c.
References le16_to_cpu, le32_to_cpu, priv, net80211_device::priv, RTL818X_EEPROM_CMD_CONFIG, RTL818X_EEPROM_CMD_NORMAL, rtl818x_iowrite16(), rtl818x_iowrite32(), and rtl818x_iowrite8().
Referenced by rtl818x_start().
|
static |
Definition at line 427 of file rtl818x.c.
References DBG, net_device::ll_addr, net_device::name, net80211_device::netdev, priv, net80211_device::priv, reg, RF_PARAM_CARRIERSENSE1, RF_PARAM_CARRIERSENSE2, RTL818X_CMD_RX_ENABLE, RTL818X_CMD_TX_ENABLE, RTL818X_CW_CONF_PERPACKET_CW_SHIFT, RTL818X_CW_CONF_PERPACKET_RETRY_SHIFT, rtl818x_free_rx_ring(), rtl818x_free_tx_ring(), rtl818x_init_hw(), rtl818x_init_rx_ring(), rtl818x_init_tx_ring(), rtl818x_ioread32(), rtl818x_ioread8(), rtl818x_iowrite16(), rtl818x_iowrite32(), rtl818x_iowrite8(), RTL818X_RX_CONF_BROADCAST, RTL818X_RX_CONF_CSDM1, RTL818X_RX_CONF_CSDM2, RTL818X_RX_CONF_DATA, RTL818X_RX_CONF_MGMT, RTL818X_RX_CONF_NICMAC, RTL818X_RX_CONF_ONLYERLPKT, RTL818X_RX_CONF_RX_AUTORESETPHY, rtl818x_set_hwaddr(), RTL818X_TX_AGC_CTL_FEEDBACK_ANT, RTL818X_TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT, RTL818X_TX_AGC_CTL_PERPACKET_GAIN_SHIFT, RTL818X_TX_CONF_HW_SEQNUM, RTL818X_TX_CONF_NO_ICV, RTL818X_TX_CONF_PROBE_DTS, and RTL818X_TX_CONF_SAT_HWPLCP.
|
static |
Definition at line 524 of file rtl818x.c.
References priv, net80211_device::priv, reg, RTL818X_CMD_RX_ENABLE, RTL818X_CMD_TX_ENABLE, RTL818X_CONFIG4_VCOOFF, RTL818X_EEPROM_CMD_CONFIG, RTL818X_EEPROM_CMD_NORMAL, rtl818x_free_rx_ring(), rtl818x_free_tx_ring(), rtl818x_ioread8(), rtl818x_iowrite8(), and rtl818x_irq().
|
static |
Definition at line 547 of file rtl818x.c.
References net80211_device::bssid, net80211_device::channel, net80211_device::channels, EINVAL, ETH_ALEN, rtl818x_priv::hw_rate, NET80211_ASSOCIATED, NET80211_CFG_ASSOC, NET80211_CFG_CHANNEL, NET80211_CFG_PHY_PARAMS, NET80211_CFG_RATE, priv, net80211_device::priv, net80211_device::rate, net80211_device::rates, rtl818x_iowrite8(), RTL818X_MSR_INFRA, RTL818X_MSR_NO_LINK, RTL818X_NR_RATES, rtl818x_rates, net80211_device::rtscts_rate, and net80211_device::state.
|
static |
Definition at line 601 of file rtl818x.c.
References spi_bit_basher::basher, container_of, priv, reg, rtl818x_eeprom_bits, rtl818x_ioread8(), and rtl818x_priv::spibit.
|
static |
Definition at line 610 of file rtl818x.c.
References spi_bit_basher::basher, container_of, data, priv, reg, rtl818x_eeprom_bits, rtl818x_ioread8(), rtl818x_iowrite8(), rtl818x_priv::spibit, and udelay().
int rtl818x_probe | ( | struct pci_device * | pdev | ) |
Definition at line 652 of file rtl818x.c.
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().
void rtl818x_remove | ( | struct pci_device * | pdev | ) |
Definition at line 827 of file rtl818x.c.
References net80211_free(), net80211_unregister(), and pci_get_drvdata().
|
static |
Definition at line 37 of file rtl818x.c.
Referenced by rtl818x_config(), rtl818x_handle_rx(), and rtl818x_probe().
|
static |
Definition at line 594 of file rtl818x.c.
Referenced by rtl818x_spi_read_bit(), and rtl818x_spi_write_bit().
|
static |
Definition at line 626 of file rtl818x.c.
Referenced by rtl818x_probe().
struct net80211_device_operations rtl818x_operations |
Definition at line 643 of file rtl818x.c.
Referenced by rtl818x_probe().