46 { .
name =
"smsc95xx.in" };
50 { .
name =
"smsc95xx.out" };
79 &structure ) ) != 0 ) {
80 DBGC ( smscusb,
"SMSC95XX %p could not find system " 81 "information: %s\n", smscusb,
strerror (
rc ) );
87 sizeof (
system ) ) ) != 0 ) {
88 DBGC ( smscusb,
"SMSC95XX %p could not read system " 89 "information: %s\n", smscusb,
strerror (
rc ) );
94 memset ( &strings, 0,
sizeof ( strings ) );
99 ( sizeof ( strings.manufacturer ) - 1 ) );
102 DBGC ( smscusb,
"SMSC95XX %p could not read manufacturer " 109 ( sizeof ( strings.product ) - 1 ) );
112 DBGC ( smscusb,
"SMSC95XX %p could not read product name: " 118 if ( (
strcmp ( strings.manufacturer,
"Honeywell" ) != 0 ) ||
119 (
strcmp ( strings.product,
"VM3" ) != 0 ) )
124 &structure ) ) != 0 ) {
125 DBGC ( smscusb,
"SMSC95XX %p could not find OEM strings: %s\n",
132 strings.mac, ( sizeof ( strings.mac ) - 1 ));
135 DBGC ( smscusb,
"SMSC95XX %p could not read OEM string: %s\n",
141 if (
len != ( (
int ) (
sizeof ( strings.mac ) - 1 ) ) ) {
142 DBGC ( smscusb,
"SMSC95XX %p invalid MAC address \"%s\"\n",
143 smscusb, strings.mac );
151 DBGC ( smscusb,
"SMSC95XX %p invalid MAC address \"%s\"\n",
152 smscusb, strings.mac );
156 DBGC ( smscusb,
"SMSC95XX %p using VM3 MAC %s\n",
186 DBGC ( smscusb,
"SMSC95XX %p using random MAC %s\n",
215 &
rx,
sizeof (
rx ) ) ) != 0 ) {
216 DBGC ( smscusb,
"SMSC95XX %p could not get RX statistics: " 223 &
tx,
sizeof (
tx ) ) ) != 0 ) {
224 DBGC ( smscusb,
"SMSC95XX %p could not get TX statistics: " 230 DBGC ( smscusb,
"SMSC95XX %p RX good %d bad %d crc %d und %d aln %d " 236 DBGC ( smscusb,
"SMSC95XX %p TX good %d bad %d pau %d sgl %d mul %d " 237 "exc %d lat %d und %d def %d car %d\n", smscusb,
277 DBGC ( smscusb,
"SMSC95XX %p failed to reset\n", smscusb );
286 led_gpio_cfg ) ) != 0 ) {
287 DBGC ( smscusb,
"SMSC95XX %p could not configure LEDs: %s\n",
327 DBGC ( smscusb,
"SMSC95XX %p bulk IN failed: %s\n",
334 DBGC ( smscusb,
"SMSC95XX %p underlength bulk IN\n",
350 DBGC ( smscusb,
"SMSC95XX %p receive error (%08x):\n",
432 DBGC ( smscusb,
"SMSC95XX %p could not open: %s\n",
446 goto err_bulk_in_dly;
466 goto err_set_address;
556 DBGC2 ( smscusb,
"SMSC95XX %p RX FIFO overflowed\n",
564 DBGC ( smscusb,
"SMSC95XX %p unexpected interrupt %#08x\n",
613 memset ( smscusb, 0,
sizeof ( *smscusb ) );
621 DBGC ( smscusb,
"SMSC95XX %p on %s\n", smscusb, func->
name );
625 DBGC ( smscusb,
"SMSC95XX %p could not describe: %s\n",
697 .name =
"smsc9500-s",
702 .name =
"smsc9505-s",
707 .name =
"smsc9500a-s",
712 .name =
"smsc9505a-s",
717 .name =
"smsc9514-s",
722 .name =
"smsc9500a-h",
727 .name =
"smsc9505a-h",
732 .name =
"smsc9500-2",
737 .name =
"smsc9500a-2",
742 .name =
"smsc9514-2",
int smscusb_set_address(struct smscusb_device *smscusb, unsigned int addr_base)
Set receive address.
#define iob_pull(iobuf, len)
#define SMSC95XX_INT_EP_CTL_RXDF_EN
RX FIFO overflow.
#define EINVAL
Invalid argument.
#define SMSC95XX_VM3_OEM_STRING_MAC
Honeywell VM3 MAC address OEM string index.
struct arbelprm_rc_send_wqe rc
static int smsc95xx_open(struct net_device *netdev)
Open network device.
static struct usb_device_id smsc95xx_ids[]
SMSC95xx device IDs.
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.
static void * usb_func_get_drvdata(struct usb_function *func)
Get USB function driver private data.
#define SMSC95XX_PHY_INTR_LINK_DOWN
PHY interrupt: link down.
static void smsc95xx_close(struct net_device *netdev)
Close network device.
#define le32_to_cpu(value)
int(* open)(struct net_device *netdev)
Open network device.
static int smsc95xx_out_transmit(struct smscusb_device *smscusb, struct io_buffer *iobuf)
Transmit packet.
#define iob_push(iobuf, len)
#define SMSC95XX_ADDR_BASE
MAC address register base.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
#define SMSC95XX_RX_LATE
Late collision.
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 SMSC95XX_HW_CFG
Hardware configuration register.
int read_smbios_structure(struct smbios_structure *structure, void *data, size_t len)
Copy SMBIOS structure.
#define SMSC95XX_INT_STS
Interrupt status register.
int usb_stream(struct usb_endpoint *ep, struct io_buffer *iobuf, int terminate)
Enqueue USB stream transfer.
#define SMSC95XX_LED_GPIO_CFG_GPCTL0_NFDX_LED
Full-duplex LED.
#define SMSC95XX_TX_LAST
Last segment.
static struct net_device_operations smsc95xx_operations
SMSC95xx network device operations.
#define SMSC95XX_BULK_IN_DLY
Bulk IN delay register.
#define SMSC95XX_LED_GPIO_CFG_GPCTL1_NLNKA_LED
Activity LED.
static int smscusb_writel(struct smscusb_device *smscusb, unsigned int address, uint32_t value)
Write register.
uint8_t mac[ETH_ALEN]
MAC address.
A data structure for storing profiling information.
#define SMSC95XX_HW_CFG_BIR
Bulk IN use NAK.
int open
Endpoint is open.
static void profile_stop(struct profiler *profiler)
Stop profiling.
#define SMSC95XX_TX_LEN(len)
Buffer size.
#define SMSC95XX_E2P_BASE
EEPROM register base.
static void smscusb_mii_init(struct smscusb_device *smscusb, unsigned int mii_base, unsigned int phy_source)
Initialise SMSC USB device MII interface.
#define SMSC95XX_TX_CFG_ON
TX enable.
int smscusb_mii_open(struct smscusb_device *smscusb, unsigned int phy_mask, unsigned int intrs)
Enable PHY interrupts and update link status.
static size_t base16_encoded_len(size_t raw_len)
Calculate length of base16-encoded data.
struct usb_endpoint out
Bulk OUT endpoint.
#define SMSC95XX_MAC_CR_MCPAS
All multicast.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
static int smsc95xx_probe(struct usb_function *func, struct usb_configuration_descriptor *config)
Probe device.
uint32_t int_sts
Interrupt status.
#define ENOMEM
Not enough space.
#define iob_disown(iobuf)
Disown an I/O buffer.
#define SMSC95XX_PHY_INTR_ANEG_DONE
PHY interrupt: auto-negotiation complete.
#define SMBIOS_TYPE_OEM_STRINGS
SMBIOS OEM strings structure type.
int find_smbios_structure(unsigned int type, unsigned int instance, struct smbios_structure *structure)
Find specific structure type within SMBIOS.
struct usbnet_device usbnet
USB network device.
#define SMSC95XX_IN_MTU
Bulk IN buffer size.
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
#define container_of(ptr, type, field)
Get containing structure.
#define SMSC95XX_MAC_CR
MAC control register.
void * priv
Driver private data.
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
#define SMSC95XX_INT_EP_CTL
Interrupt endpoint control register.
static void usb_refill_init(struct usb_endpoint *ep, size_t reserve, size_t len, unsigned int max)
Initialise USB endpoint refill.
static struct net_device * netdev
#define SMSC95XX_IN_MAX_FILL
Bulk IN maximum fill level.
int read_smbios_string(struct smbios_structure *structure, unsigned int index, void *data, size_t len)
Find indexed string within SMBIOS structure.
static int smscusb_readl(struct smscusb_device *smscusb, unsigned int address, uint32_t *value)
Read register.
static void usb_func_set_drvdata(struct usb_function *func, void *priv)
Set USB function driver private data.
static void smsc95xx_poll(struct net_device *netdev)
Poll for completed and received packets.
static void profile_start(struct profiler *profiler)
Start profiling.
void unregister_netdev(struct net_device *netdev)
Unregister network device.
#define SMSC95XX_TX_CFG
Transmit configuration register.
int usbnet_refill(struct usbnet_device *usbnet)
Refill USB network device bulk IN and interrupt endpoints.
#define cpu_to_le32(value)
static int smsc95xx_dump_statistics(struct smscusb_device *smscusb)
Dump statistics (for debugging)
static int smsc95xx_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
#define SMSC95XX_INT_STS_PHY_INT
PHY interrupt.
static void usb_poll(struct usb_bus *bus)
Poll USB bus.
#define iob_unput(iobuf, len)
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 SMSC95XX_RX_STATISTICS
Receive statistics.
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.
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
#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 SMSC95XX_INT_STS_RXDF_INT
RX FIFO overflow.
#define SMSC95XX_MAC_CR_TXEN
TX enabled.
static struct profiler smsc95xx_in_profiler __profiler
Bulk IN completion profiler.
static int smsc95xx_vm3_fetch_mac(struct smscusb_device *smscusb)
Construct MAC address for Honeywell VM3.
#define SMSC95XX_HW_CFG_LRST
Soft lite reset.
#define SMSC95XX_INT_EP_CTL_PHY_EN
PHY interrupt.
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.
static int smsc95xx_fetch_mac(struct smscusb_device *smscusb)
Fetch MAC address.
static struct usb_endpoint_driver_operations smsc95xx_in_operations
Bulk IN endpoint operations.
A USB configuration descriptor.
#define ENOBUFS
No buffer space available.
#define ENOTTY
Inappropriate I/O control operation.
int strcmp(const char *first, const char *second)
Compare strings.
Universal Serial Bus (USB)
#define SMSC95XX_MAC_CR_PRMS
Promiscuous.
SMSC LAN95xx USB Ethernet driver.
void * data
Start of data.
int smscusb_mii_check_link(struct smscusb_device *smscusb)
Check link status.
#define EIO
Input/output error.
#define SMSC95XX_MAC_CR_FDPX
Full duplex.
#define SMSC95XX_BULK_IN_DLY_SET(ticks)
Delay / 16.7ns.
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
u8 rx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets from the AP.
struct ena_aq_header header
Header.
#define SMSC95XX_MAC_CR_PASSBAD
Pass bad frames.
static int smsc95xx_reset(struct smscusb_device *smscusb)
Reset device.
int usbnet_describe(struct usbnet_device *usbnet, struct usb_configuration_descriptor *config)
Describe USB network device interfaces.
#define SMSC95XX_RX_CRC
CRC error.
struct usb_bus * bus
USB bus.
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.
#define SMSC95XX_RX_RUNT
Runt frame.
void usbnet_close(struct usbnet_device *usbnet)
Close USB network device.
USB endpoint driver operations.
struct device dev
Generic device.
#define SMSC95XX_MAC_CR_RXEN
RX enabled.
int iob_ensure_headroom(struct io_buffer *iobuf, size_t len)
Ensure I/O buffer has sufficient headroom.
#define SMSC95XX_RESET_DELAY_US
Reset delay (in microseconds)
#define SMSC95XX_TX_STATISTICS
Transmit statistics.
#define SMSC95XX_MII_BASE
MII register base.
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
SMBIOS structure descriptor.
int smscusb_fdt_fetch_mac(struct smscusb_device *smscusb)
Fetch MAC address from device tree.
#define SMBIOS_TYPE_SYSTEM_INFORMATION
SMBIOS system information structure type.
#define NULL
NULL pointer (VOID *)
#define ETIMEDOUT
Connection timed out.
struct usb_driver smsc95xx_driver __usb_driver
SMSC LAN95xx driver.
#define SMSC95XX_TX_FIRST
First segment.
#define SMSC95XX_MII_PHY_INTR_MASK
PHY interrupt mask MII register.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define SMSC95XX_LED_GPIO_CFG
LED GPIO configuration register.
void eth_random_addr(void *hw_addr)
Generate random Ethernet address.
#define SMSC95XX_MAC_CR_RXALL
Receive all.
static void smsc95xx_in_complete(struct usb_endpoint *ep, struct io_buffer *iobuf, int rc)
Complete bulk IN transfer.
#define SMSC95XX_MII_PHY_INTR_SOURCE
PHY interrupt source MII register.
struct usb_device_id * ids
USB ID table.
u8 tx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets to the AP.
static void smsc95xx_remove(struct usb_function *func)
Remove device.
uint8_t system[ETH_ALEN]
System identifier.
void * memset(void *dest, int character, size_t len) __nonnull
#define SMSC95XX_LED_GPIO_CFG_GPCTL2_NSPD_LED
Link speed LED.
int usbnet_open(struct usbnet_device *usbnet)
Open USB network device.