iPXE
|
SMSC LAN75xx USB Ethernet driver. More...
#include "smscusb.h"
Go to the source code of this file.
Data Structures | |
struct | smsc75xx_rx_header |
Receive packet header. More... | |
struct | smsc75xx_tx_header |
Transmit packet header. More... | |
struct | smsc75xx_byte_statistics |
Byte count statistics. More... | |
struct | smsc75xx_frame_statistics |
Frame count statistics. More... | |
struct | smsc75xx_rx_error_statistics |
Receive error statistics. More... | |
struct | smsc75xx_rx_statistics |
Receive statistics. More... | |
struct | smsc75xx_tx_error_statistics |
Transmit error statistics. More... | |
struct | smsc75xx_tx_statistics |
Transmit statistics. More... | |
struct | smsc75xx_statistics |
Statistics. More... | |
Macros | |
#define | SMSC75XX_INT_STS 0x00c |
Interrupt status register. More... | |
#define | SMSC75XX_INT_STS_RDFO_INT 0x00400000UL |
RX FIFO overflow. More... | |
#define | SMSC75XX_INT_STS_PHY_INT 0x00020000UL |
PHY interrupt. More... | |
#define | SMSC75XX_HW_CFG 0x010 |
Hardware configuration register. More... | |
#define | SMSC75XX_HW_CFG_BIR 0x00000080UL |
Bulk IN use NAK. More... | |
#define | SMSC75XX_HW_CFG_LRST 0x00000002UL |
Soft lite reset. More... | |
#define | SMSC75XX_INT_EP_CTL 0x038 |
Interrupt endpoint control register. More... | |
#define | SMSC75XX_INT_EP_CTL_RDFO_EN 0x00400000UL |
RX FIFO overflow. More... | |
#define | SMSC75XX_INT_EP_CTL_PHY_EN 0x00020000UL |
PHY interrupt. More... | |
#define | SMSC75XX_BULK_IN_DLY 0x03c |
Bulk IN delay register. More... | |
#define | SMSC75XX_BULK_IN_DLY_SET(ticks) ( (ticks) << 0 ) |
Delay / 16.7ns. More... | |
#define | SMSC75XX_E2P_BASE 0x040 |
EEPROM register base. More... | |
#define | SMSC75XX_RFE_CTL 0x060 |
Receive filtering engine control register. More... | |
#define | SMSC75XX_RFE_CTL_AB 0x00000400UL |
Accept broadcast. More... | |
#define | SMSC75XX_RFE_CTL_AM 0x00000200UL |
Accept multicast. More... | |
#define | SMSC75XX_RFE_CTL_AU 0x00000100UL |
Accept unicast. More... | |
#define | SMSC75XX_FCT_RX_CTL 0x090 |
FIFO controller RX FIFO control register. More... | |
#define | SMSC75XX_FCT_RX_CTL_EN 0x80000000UL |
FCT RX enable. More... | |
#define | SMSC75XX_FCT_RX_CTL_BAD 0x02000000UL |
Store bad frames. More... | |
#define | SMSC75XX_FCT_TX_CTL 0x094 |
FIFO controller TX FIFO control register. More... | |
#define | SMSC75XX_FCT_TX_CTL_EN 0x80000000UL |
FCT TX enable. More... | |
#define | SMSC75XX_MAC_RX 0x104 |
MAC receive register. More... | |
#define | SMSC75XX_MAC_RX_MAX_SIZE(mtu) ( (mtu) << 16 ) |
Max frame size. More... | |
#define | SMSC75XX_MAC_RX_MAX_SIZE_DEFAULT SMSC75XX_MAC_RX_MAX_SIZE ( ETH_FRAME_LEN + 4 /* VLAN */ + 4 /* CRC */ ) |
#define | SMSC75XX_MAC_RX_FCS 0x00000010UL |
FCS stripping. More... | |
#define | SMSC75XX_MAC_RX_EN 0x00000001UL |
RX enable. More... | |
#define | SMSC75XX_MAC_TX 0x108 |
MAC transmit register. More... | |
#define | SMSC75XX_MAC_TX_EN 0x00000001UL |
TX enable. More... | |
#define | SMSC75XX_RX_ADDR_BASE 0x118 |
MAC receive address register base. More... | |
#define | SMSC75XX_MII_BASE 0x120 |
MII register base. More... | |
#define | SMSC75XX_MII_PHY_INTR_SOURCE 29 |
PHY interrupt source MII register. More... | |
#define | SMSC75XX_MII_PHY_INTR_MASK 30 |
PHY interrupt mask MII register. More... | |
#define | SMSC75XX_PHY_INTR_ANEG_DONE 0x0040 |
PHY interrupt: auto-negotiation complete. More... | |
#define | SMSC75XX_PHY_INTR_LINK_DOWN 0x0010 |
PHY interrupt: link down. More... | |
#define | SMSC75XX_ADDR_FILT_BASE 0x300 |
MAC address perfect filter register base. More... | |
#define | SMSC75XX_RX_RED 0x00400000UL |
Receive error detected. More... | |
#define | SMSC75XX_TX_FCS 0x00400000UL |
Insert frame checksum and pad. More... | |
#define | SMSC75XX_RESET_MAX_WAIT_MS 100 |
Maximum time to wait for reset (in milliseconds) More... | |
#define | SMSC75XX_IN_MAX_FILL 8 |
Bulk IN maximum fill level. More... | |
#define | SMSC75XX_IN_MTU |
Bulk IN buffer size. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
int | smsc75xx_dump_statistics (struct smscusb_device *smscusb) |
Dump statistics (for debugging) More... | |
int | smsc75xx_transmit (struct net_device *netdev, struct io_buffer *iobuf) |
Transmit packet. More... | |
void | smsc75xx_poll (struct net_device *netdev) |
Poll for completed and received packets. More... | |
Variables | |
struct usb_endpoint_driver_operations | smsc75xx_in_operations |
Bulk IN endpoint operations. More... | |
SMSC LAN75xx USB Ethernet driver.
Definition in file smsc75xx.h.
#define SMSC75XX_INT_STS 0x00c |
Interrupt status register.
Definition at line 15 of file smsc75xx.h.
#define SMSC75XX_INT_STS_RDFO_INT 0x00400000UL |
RX FIFO overflow.
Definition at line 16 of file smsc75xx.h.
#define SMSC75XX_INT_STS_PHY_INT 0x00020000UL |
PHY interrupt.
Definition at line 17 of file smsc75xx.h.
#define SMSC75XX_HW_CFG 0x010 |
Hardware configuration register.
Definition at line 20 of file smsc75xx.h.
#define SMSC75XX_HW_CFG_BIR 0x00000080UL |
Bulk IN use NAK.
Definition at line 21 of file smsc75xx.h.
#define SMSC75XX_HW_CFG_LRST 0x00000002UL |
Soft lite reset.
Definition at line 22 of file smsc75xx.h.
#define SMSC75XX_INT_EP_CTL 0x038 |
Interrupt endpoint control register.
Definition at line 25 of file smsc75xx.h.
#define SMSC75XX_INT_EP_CTL_RDFO_EN 0x00400000UL |
RX FIFO overflow.
Definition at line 26 of file smsc75xx.h.
#define SMSC75XX_INT_EP_CTL_PHY_EN 0x00020000UL |
PHY interrupt.
Definition at line 27 of file smsc75xx.h.
#define SMSC75XX_BULK_IN_DLY 0x03c |
Bulk IN delay register.
Definition at line 30 of file smsc75xx.h.
#define SMSC75XX_BULK_IN_DLY_SET | ( | ticks | ) | ( (ticks) << 0 ) |
Delay / 16.7ns.
Definition at line 31 of file smsc75xx.h.
#define SMSC75XX_E2P_BASE 0x040 |
EEPROM register base.
Definition at line 34 of file smsc75xx.h.
#define SMSC75XX_RFE_CTL 0x060 |
Receive filtering engine control register.
Definition at line 37 of file smsc75xx.h.
#define SMSC75XX_RFE_CTL_AB 0x00000400UL |
Accept broadcast.
Definition at line 38 of file smsc75xx.h.
#define SMSC75XX_RFE_CTL_AM 0x00000200UL |
Accept multicast.
Definition at line 39 of file smsc75xx.h.
#define SMSC75XX_RFE_CTL_AU 0x00000100UL |
Accept unicast.
Definition at line 40 of file smsc75xx.h.
#define SMSC75XX_FCT_RX_CTL 0x090 |
FIFO controller RX FIFO control register.
Definition at line 43 of file smsc75xx.h.
#define SMSC75XX_FCT_RX_CTL_EN 0x80000000UL |
FCT RX enable.
Definition at line 44 of file smsc75xx.h.
#define SMSC75XX_FCT_RX_CTL_BAD 0x02000000UL |
Store bad frames.
Definition at line 45 of file smsc75xx.h.
#define SMSC75XX_FCT_TX_CTL 0x094 |
FIFO controller TX FIFO control register.
Definition at line 48 of file smsc75xx.h.
#define SMSC75XX_FCT_TX_CTL_EN 0x80000000UL |
FCT TX enable.
Definition at line 49 of file smsc75xx.h.
#define SMSC75XX_MAC_RX 0x104 |
MAC receive register.
Definition at line 52 of file smsc75xx.h.
Max frame size.
Definition at line 53 of file smsc75xx.h.
#define SMSC75XX_MAC_RX_MAX_SIZE_DEFAULT SMSC75XX_MAC_RX_MAX_SIZE ( ETH_FRAME_LEN + 4 /* VLAN */ + 4 /* CRC */ ) |
Definition at line 54 of file smsc75xx.h.
#define SMSC75XX_MAC_RX_FCS 0x00000010UL |
FCS stripping.
Definition at line 56 of file smsc75xx.h.
#define SMSC75XX_MAC_RX_EN 0x00000001UL |
RX enable.
Definition at line 57 of file smsc75xx.h.
#define SMSC75XX_MAC_TX 0x108 |
MAC transmit register.
Definition at line 60 of file smsc75xx.h.
#define SMSC75XX_MAC_TX_EN 0x00000001UL |
TX enable.
Definition at line 61 of file smsc75xx.h.
#define SMSC75XX_RX_ADDR_BASE 0x118 |
MAC receive address register base.
Definition at line 64 of file smsc75xx.h.
#define SMSC75XX_MII_BASE 0x120 |
MII register base.
Definition at line 67 of file smsc75xx.h.
#define SMSC75XX_MII_PHY_INTR_SOURCE 29 |
PHY interrupt source MII register.
Definition at line 70 of file smsc75xx.h.
#define SMSC75XX_MII_PHY_INTR_MASK 30 |
PHY interrupt mask MII register.
Definition at line 73 of file smsc75xx.h.
#define SMSC75XX_PHY_INTR_ANEG_DONE 0x0040 |
PHY interrupt: auto-negotiation complete.
Definition at line 76 of file smsc75xx.h.
#define SMSC75XX_PHY_INTR_LINK_DOWN 0x0010 |
PHY interrupt: link down.
Definition at line 79 of file smsc75xx.h.
#define SMSC75XX_ADDR_FILT_BASE 0x300 |
MAC address perfect filter register base.
Definition at line 82 of file smsc75xx.h.
#define SMSC75XX_RX_RED 0x00400000UL |
Receive error detected.
Definition at line 97 of file smsc75xx.h.
#define SMSC75XX_TX_FCS 0x00400000UL |
Insert frame checksum and pad.
Definition at line 110 of file smsc75xx.h.
#define SMSC75XX_RESET_MAX_WAIT_MS 100 |
Maximum time to wait for reset (in milliseconds)
Definition at line 203 of file smsc75xx.h.
#define SMSC75XX_IN_MAX_FILL 8 |
#define SMSC75XX_IN_MTU |
Bulk IN buffer size.
Definition at line 212 of file smsc75xx.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
int smsc75xx_dump_statistics | ( | struct smscusb_device * | smscusb | ) |
Dump statistics (for debugging)
smscusb | SMSC USB device |
rc | Return status code |
Definition at line 63 of file smsc75xx.c.
References smsc75xx_rx_error_statistics::alignment, smsc75xx_byte_statistics::broadcast, smsc75xx_frame_statistics::broadcast, smsc75xx_rx_statistics::byte, smsc75xx_tx_statistics::byte, smsc75xx_tx_error_statistics::carrier, smsc75xx_tx_error_statistics::count, DBG_LOG, DBGC, smsc75xx_tx_error_statistics::deferral, smsc75xx_rx_error_statistics::dropped, smsc75xx_rx_statistics::err, smsc75xx_tx_statistics::err, smsc75xx_tx_error_statistics::excessive, smsc75xx_rx_error_statistics::fcs, smsc75xx_tx_error_statistics::fcs, smsc75xx_rx_error_statistics::fragment, smsc75xx_rx_statistics::frame, smsc75xx_tx_statistics::frame, smsc75xx_rx_error_statistics::jabber, smsc75xx_tx_error_statistics::late, le32_to_cpu, smsc75xx_byte_statistics::multicast, smsc75xx_frame_statistics::multicast, smsc75xx_tx_error_statistics::multiple, smsc75xx_rx_error_statistics::oversize, smsc75xx_frame_statistics::pause, rc, smsc75xx_statistics::rx, smsc75xx_tx_error_statistics::single, smscusb_get_statistics(), strerror(), smsc75xx_statistics::tx, smsc75xx_rx_error_statistics::undersize, smsc75xx_byte_statistics::unicast, and smsc75xx_frame_statistics::unicast.
Referenced by lan78xx_close(), and smsc75xx_close().
int smsc75xx_transmit | ( | struct net_device * | netdev, |
struct io_buffer * | iobuf | ||
) |
Transmit packet.
netdev | Network device |
iobuf | I/O buffer |
rc | Return status code |
Definition at line 403 of file smsc75xx.c.
References netdev, net_device::priv, rc, and smsc75xx_out_transmit().
void smsc75xx_poll | ( | struct net_device * | netdev | ) |
Poll for completed and received packets.
netdev | Network device |
Definition at line 419 of file smsc75xx.c.
References smscusb_device::bus, DBGC, DBGC2, ENOBUFS, ENOTTY, smscusb_device::int_sts, netdev, netdev_rx_err(), NULL, net_device::priv, rc, SMSC75XX_INT_STS, SMSC75XX_INT_STS_PHY_INT, SMSC75XX_INT_STS_RDFO_INT, smscusb_mii_check_link(), smscusb_writel(), usb_poll(), smscusb_device::usbnet, and usbnet_refill().
struct usb_endpoint_driver_operations smsc75xx_in_operations |
Bulk IN endpoint operations.
Definition at line 233 of file smsc75xx.c.
Referenced by lan78xx_probe(), and smsc75xx_probe().