44 { .
name =
"smsc75xx.in" };
48 { .
name =
"smsc75xx.out" };
73 sizeof ( stats ) ) ) != 0 ) {
74 DBGC ( smscusb,
"SMSC75XX %p could not get statistics: " 80 DBGC ( smscusb,
"SMSC75XX %p RXE fcs %d aln %d frg %d jab %d und %d " 88 DBGC ( smscusb,
"SMSC75XX %p RXB ucast %d bcast %d mcast %d\n",
92 DBGC ( smscusb,
"SMSC75XX %p RXF ucast %d bcast %d mcast %d pause " 97 DBGC ( smscusb,
"SMSC75XX %p TXE fcs %d def %d car %d cnt %d sgl %d " 98 "mul %d exc %d lat %d\n", smscusb,
107 DBGC ( smscusb,
"SMSC75XX %p TXB ucast %d bcast %d mcast %d\n",
111 DBGC ( smscusb,
"SMSC75XX %p TXF ucast %d bcast %d mcast %d pause " 157 DBGC ( smscusb,
"SMSC75XX %p timed out waiting for reset\n",
194 DBGC ( smscusb,
"SMSC75XX %p bulk IN failed: %s\n",
201 DBGC ( smscusb,
"SMSC75XX %p underlength bulk IN\n",
214 DBGC ( smscusb,
"SMSC75XX %p receive error (%08x):\n",
296 DBGC ( smscusb,
"SMSC75XX %p could not open: %s\n",
310 goto err_bulk_in_dly;
345 goto err_set_address;
444 DBGC2 ( smscusb,
"SMSC75XX %p RX FIFO overflowed\n", smscusb );
451 DBGC ( smscusb,
"SMSC75XX %p unexpected interrupt %#08x\n",
500 memset ( smscusb, 0,
sizeof ( *smscusb ) );
506 DBGC ( smscusb,
"SMSC75XX %p on %s\n", smscusb, func->
name );
510 DBGC ( smscusb,
"SMSC75XX %p could not describe: %s\n",
int smscusb_set_address(struct smscusb_device *smscusb, unsigned int addr_base)
Set receive address.
#define iob_pull(iobuf, len)
uint32_t pause
Pause frames.
#define EINVAL
Invalid argument.
#define SMSC75XX_IN_MAX_FILL
Bulk IN maximum fill level.
#define SMSC75XX_MII_PHY_INTR_SOURCE
PHY interrupt source MII register.
struct arbelprm_rc_send_wqe rc
#define SMSC75XX_E2P_BASE
EEPROM register base.
void(* complete)(struct usb_endpoint *ep, struct io_buffer *iobuf, int rc)
Complete transfer.
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
#define SMSC75XX_RFE_CTL
Receive filtering engine control register.
static void * usb_func_get_drvdata(struct usb_function *func)
Get USB function driver private data.
uint32_t oversize
Oversize frame errors.
#define le32_to_cpu(value)
int(* open)(struct net_device *netdev)
Open network device.
static struct profiler smsc75xx_in_profiler __profiler
Bulk IN completion profiler.
uint32_t undersize
Undersize frame errors.
#define SMSC75XX_FCT_RX_CTL_BAD
Store bad frames.
#define SMSC75XX_RX_RED
Receive error detected.
static void smsc75xx_close(struct net_device *netdev)
Close network device.
#define iob_push(iobuf, len)
#define SMSC75XX_MAC_RX_MAX_SIZE_DEFAULT
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
#define SMSC75XX_BULK_IN_DLY
Bulk IN delay register.
static int smsc75xx_reset(struct smscusb_device *smscusb)
Reset device.
struct smsc75xx_tx_error_statistics err
Error statistics.
#define SMSC75XX_INT_STS
Interrupt status register.
uint32_t count
Bad byte count.
uint32_t carrier
Carrier errors.
static void smscusb_init(struct smscusb_device *smscusb, struct net_device *netdev, struct usb_function *func, struct usb_endpoint_driver_operations *in)
Initialise SMSC USB device.
#define SMSC75XX_INT_STS_RDFO_INT
RX FIFO overflow.
uint32_t unicast
Unicast frames.
int usb_stream(struct usb_endpoint *ep, struct io_buffer *iobuf, int terminate)
Enqueue USB stream transfer.
uint32_t jabber
Jabber errors.
int smsc75xx_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
#define SMSC75XX_IN_MTU
Bulk IN buffer size.
#define SMSC75XX_PHY_INTR_ANEG_DONE
PHY interrupt: auto-negotiation complete.
#define SMSC75XX_MAC_RX_EN
RX enable.
#define SMSC75XX_MAC_RX
MAC receive register.
static int smscusb_writel(struct smscusb_device *smscusb, unsigned int address, uint32_t value)
Write register.
A data structure for storing profiling information.
#define SMSC75XX_FCT_RX_CTL_EN
FCT RX enable.
struct usb_endpoint_driver_operations smsc75xx_in_operations
Bulk IN endpoint operations.
int open
Endpoint is open.
static void profile_stop(struct profiler *profiler)
Stop profiling.
#define SMSC75XX_FCT_TX_CTL
FIFO controller TX FIFO control register.
static void smsc75xx_remove(struct usb_function *func)
Remove device.
static void smscusb_mii_init(struct smscusb_device *smscusb, unsigned int mii_base, unsigned int phy_source)
Initialise SMSC USB device MII interface.
int smscusb_mii_open(struct smscusb_device *smscusb, unsigned int phy_mask, unsigned int intrs)
Enable PHY interrupts and update link status.
#define SMSC75XX_RFE_CTL_AB
Accept broadcast.
#define SMSC75XX_INT_EP_CTL_PHY_EN
PHY interrupt.
uint32_t multicast
Multicast frames.
static int smsc75xx_probe(struct usb_function *func, struct usb_configuration_descriptor *config)
Probe device.
#define SMSC75XX_INT_EP_CTL_RDFO_EN
RX FIFO overflow.
struct usb_endpoint out
Bulk OUT endpoint.
int smscusb_set_filter(struct smscusb_device *smscusb, unsigned int filt_base)
Set receive filter.
uint32_t multicast
Multicast byte count.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
uint32_t unicast
Unicast byte count.
uint32_t int_sts
Interrupt status.
#define ENOMEM
Not enough space.
#define iob_disown(iobuf)
Disown an I/O buffer.
#define SMSC75XX_RFE_CTL_AM
Accept multicast.
#define SMSC75XX_TX_FCS
Insert frame checksum and pad.
uint32_t dropped
Dropped frame errors.
struct usb_driver smsc75xx_driver __usb_driver
SMSC LAN75xx driver.
struct usbnet_device usbnet
USB network device.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
#define container_of(ptr, type, field)
Get containing structure.
uint32_t deferral
Excess deferral errors.
#define SMSC75XX_RFE_CTL_AU
Accept unicast.
void * priv
Driver private data.
struct smsc75xx_frame_statistics frame
Frame count statistics.
#define SMSC75XX_HW_CFG_LRST
Soft lite reset.
int smsc75xx_dump_statistics(struct smscusb_device *smscusb)
Dump statistics (for debugging)
static void usb_refill_init(struct usb_endpoint *ep, size_t reserve, size_t len, unsigned int max)
Initialise USB endpoint refill.
#define SMSC75XX_PHY_INTR_LINK_DOWN
PHY interrupt: link down.
static struct net_device * netdev
void smsc75xx_poll(struct net_device *netdev)
Poll for completed and received packets.
#define SMSC75XX_FCT_TX_CTL_EN
FCT TX enable.
static int smscusb_readl(struct smscusb_device *smscusb, unsigned int address, uint32_t *value)
Read register.
SMSC LAN75xx USB Ethernet driver.
static int smsc75xx_out_transmit(struct smscusb_device *smscusb, struct io_buffer *iobuf)
Transmit packet.
static void usb_func_set_drvdata(struct usb_function *func, void *priv)
Set USB function driver private data.
static int smsc75xx_open(struct net_device *netdev)
Open network device.
static void profile_start(struct profiler *profiler)
Start profiling.
#define SMSC75XX_MAC_TX
MAC transmit register.
void unregister_netdev(struct net_device *netdev)
Unregister network device.
struct smsc75xx_byte_statistics byte
Byte count statistics.
#define SMSC75XX_MII_BASE
MII register base.
int usbnet_refill(struct usbnet_device *usbnet)
Refill USB network device bulk IN and interrupt endpoints.
#define cpu_to_le32(value)
static void usb_poll(struct usb_bus *bus)
Poll USB bus.
#define SMSC75XX_BULK_IN_DLY_SET(ticks)
Delay / 16.7ns.
int smscusb_eeprom_fetch_mac(struct smscusb_device *smscusb, unsigned int e2p_base)
Fetch MAC address from EEPROM.
char * strerror(int errno)
Retrieve string representation of error number.
#define SMSC75XX_MII_PHY_INTR_MASK
PHY interrupt mask MII register.
uint32_t late
Late collisions.
int register_netdev(struct net_device *netdev)
Register network device.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define SMSC75XX_HW_CFG
Hardware configuration register.
#define USB_CLASS_ID(base, subclass, protocol)
Construct USB class ID.
struct usb_endpoint in
Bulk IN endpoint.
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
#define SMSC75XX_RESET_MAX_WAIT_MS
Maximum time to wait for reset (in milliseconds)
uint32_t broadcast
Broadcast frames.
struct smsc75xx_tx_statistics tx
Transmit statistics.
Network device operations.
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
struct device * dev
Underlying hardware device.
struct smsc75xx_rx_statistics rx
Receive statistics.
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
A USB configuration descriptor.
struct smsc75xx_frame_statistics frame
Frame count statistics.
#define ENOBUFS
No buffer space available.
#define ENOTTY
Inappropriate I/O control operation.
Universal Serial Bus (USB)
#define SMSC75XX_MAC_TX_EN
TX enable.
void * data
Start of data.
uint32_t alignment
Alignment errors.
int smscusb_mii_check_link(struct smscusb_device *smscusb)
Check link status.
uint32_t excessive
Excession collisions.
#define EIO
Input/output error.
#define SMSC75XX_HW_CFG_BIR
Bulk IN use NAK.
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
struct smsc75xx_byte_statistics byte
Byte count statistics.
uint32_t single
Single collisions.
struct ena_aq_header header
Header.
static struct net_device_operations smsc75xx_operations
SMSC75xx network device operations.
#define SMSC75XX_INT_EP_CTL
Interrupt endpoint control register.
uint32_t broadcast
Broadcast byte count.
uint32_t fragment
Fragment errors.
int usbnet_describe(struct usbnet_device *usbnet, struct usb_configuration_descriptor *config)
Describe USB network device interfaces.
struct usb_bus * bus
USB bus.
#define SMSC75XX_ADDR_FILT_BASE
MAC address perfect filter register base.
struct net_device * netdev
Network device.
static int smscusb_get_statistics(struct smscusb_device *smscusb, unsigned int index, void *data, size_t len)
Get statistics.
void usbnet_close(struct usbnet_device *usbnet)
Close USB network device.
USB endpoint driver operations.
struct device dev
Generic device.
#define SMSC75XX_INT_STS_PHY_INT
PHY interrupt.
int iob_ensure_headroom(struct io_buffer *iobuf, size_t len)
Ensure I/O buffer has sufficient headroom.
uint32_t multiple
Multiple collisions.
#define NULL
NULL pointer (VOID *)
#define SMSC75XX_FCT_RX_CTL
FIFO controller RX FIFO control register.
#define ETIMEDOUT
Connection timed out.
#define SMSC75XX_MAC_RX_FCS
FCS stripping.
struct smsc75xx_rx_error_statistics err
Error statistics.
struct usb_device_id * ids
USB ID table.
#define SMSC75XX_RX_ADDR_BASE
MAC receive address register base.
static struct usb_device_id smsc75xx_ids[]
SMSC75xx device IDs.
void * memset(void *dest, int character, size_t len) __nonnull
static void smsc75xx_in_complete(struct usb_endpoint *ep, struct io_buffer *iobuf, int rc)
Complete bulk IN transfer.
int usbnet_open(struct usbnet_device *usbnet)
Open USB network device.