61 DBGC ( dm96xx,
"DM96XX %p could not reset: %s\n",
73 DBGC ( dm96xx,
"DM96XX %p failed to reset: %s\n",
78 DBGC ( dm96xx,
"DM96XX %p failed to reset (NCR=%#02x)\n",
99 DBGC ( dm96xx,
"DM96XX %p could not read MAC address: %s\n",
120 DBGC ( dm96xx,
"DM96XX %p could not write MAC address: %s\n",
160 DBGC ( dm96xx,
"DM96XX %p could not read network status: %s\n",
186 DBGC ( dm96xx,
"DM96XX %p could not read chip revision: %s\n",
197 if ( mode_ctl < 0 ) {
199 DBGC ( dm96xx,
"DM96XX %p could not read mode control: %s\n",
207 mode_ctl ) ) != 0 ) {
208 DBGC ( dm96xx,
"DM96XX %p could not write mode control: %s\n",
244 DBGC ( dm96xx,
"DM96XX %p interrupt failed: %s\n",
252 if (
len <
sizeof ( *
intr ) ) {
253 DBGC ( dm96xx,
"DM96XX %p underlength interrupt:\n", dm96xx );
295 DBGC ( dm96xx,
"DM96XX %p bulk IN failed: %s\n",
302 DBGC ( dm96xx,
"DM96XX %p underlength bulk IN\n", dm96xx );
315 DBGC ( dm96xx,
"DM96XX %p receive error %02x:\n",
412 DBGC ( dm96xx,
"DM96XX %p could not open: %s\n",
421 DBGC ( dm96xx,
"DM96XX %p could not write receive filters: "
530 memset ( dm96xx, 0,
sizeof ( *dm96xx ) );
539 DBGC ( dm96xx,
"DM96XX %p on %s\n", dm96xx, func->
name );
543 DBGC ( dm96xx,
"DM96XX %p could not describe: %s\n",
594 USB_ROM ( 0x07aa, 0x9601,
"dm9601-corega",
"Corega FEther", 0 ),
595 USB_ROM ( 0x0a46, 0x9601,
"dm9601",
"DM9601", 0 ),
596 USB_ROM ( 0x0a46, 0x6688,
"zt6688",
"ZT6688", 0 ),
597 USB_ROM ( 0x0a46, 0x0268,
"st268",
"ST268", 0 ),
598 USB_ROM ( 0x0a46, 0x8515,
"adm8515",
"ADMtek ADM8515", 0 ),
599 USB_ROM ( 0x0a47, 0x9601,
"dm9601-hirose",
"DM9601 (Hirose)", 0 ),
600 USB_ROM ( 0x0fe6, 0x8101,
"dm9601-8101",
"DM9601 (ICS8101)", 0 ),
601 USB_ROM ( 0x0fe6, 0x9700,
"dm9601-9700",
"DM9601 (ICS9700)", 0 ),
602 USB_ROM ( 0x0a46, 0x9000,
"dm9000e",
"DM9000E", 0 ),
603 USB_ROM ( 0x0a46, 0x9620,
"dm9620",
"DM9620", 0 ),
604 USB_ROM ( 0x0a46, 0x9621,
"dm9621A",
"DM9621A", 0 ),
605 USB_ROM ( 0x0a46, 0x9622,
"dm9622",
"DM9622", 0 ),
606 USB_ROM ( 0x0a46, 0x0269,
"dm962Oa",
"DM9620A", 0 ),
607 USB_ROM ( 0x0a46, 0x1269,
"dm9621a",
"DM9621A", 0 ),
#define NULL
NULL pointer (VOID *)
struct arbelprm_rc_send_wqe rc
struct bofm_section_header done
static void dm96xx_intr_complete(struct usb_endpoint *ep, struct io_buffer *iobuf, int rc)
Complete interrupt transfer.
static struct usb_device_id dm96xx_ids[]
DM96xx device IDs.
static int dm96xx_open(struct net_device *netdev)
Open network device.
static void dm96xx_link_nsr(struct dm96xx_device *dm96xx, unsigned int nsr)
Update link status based on network status register.
static int dm96xx_reset(struct dm96xx_device *dm96xx)
Reset device.
static int dm96xx_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
static int dm96xx_probe(struct usb_function *func, struct usb_configuration_descriptor *config)
Probe device.
static void dm96xx_out_complete(struct usb_endpoint *ep, struct io_buffer *iobuf, int rc)
Complete bulk OUT transfer.
static struct net_device_operations dm96xx_operations
DM96xx network device operations.
static int dm96xx_read_mac(struct dm96xx_device *dm96xx, uint8_t *mac)
Read MAC address.
static int dm96xx_rx_mode(struct dm96xx_device *dm96xx)
Set DM9601-compatible RX header mode.
static struct usb_endpoint_driver_operations dm96xx_intr_operations
Interrupt endpoint operations.
static void dm96xx_poll(struct net_device *netdev)
Poll for completed and received packets.
static int dm96xx_write_mac(struct dm96xx_device *dm96xx, uint8_t *mac)
Write MAC address.
static void dm96xx_remove(struct usb_function *func)
Remove device.
static struct usb_endpoint_driver_operations dm96xx_in_operations
Bulk IN endpoint operations.
static struct usb_endpoint_driver_operations dm96xx_out_operations
Bulk OUT endpoint operations.
static int dm96xx_out_transmit(struct dm96xx_device *dm96xx, struct io_buffer *iobuf)
Transmit packet.
static void dm96xx_close(struct net_device *netdev)
Close network device.
static void dm96xx_in_complete(struct usb_endpoint *ep, struct io_buffer *iobuf, int rc)
Complete bulk IN transfer.
static int dm96xx_check_link(struct dm96xx_device *dm96xx)
Get link status.
Davicom DM96xx USB Ethernet driver.
#define DM96XX_CHIPR
Chip revision register.
#define DM96XX_RCR_RXEN
RX enable.
#define DM96XX_IN_MTU
Bulk IN buffer size.
#define DM96XX_IN_MAX_FILL
Bulk IN maximum fill level.
#define DM96XX_NCR
Network control register.
#define DM96XX_MODE_CTL_MODE
4-byte header mode
static int dm96xx_read_registers(struct dm96xx_device *dm96xx, unsigned int offset, void *data, size_t len)
Read registers.
#define DM96XX_PAR
PHY address registers.
#define DM96XX_RCR
Receive control register.
static int dm96xx_write_register(struct dm96xx_device *dm96xx, unsigned int offset, uint8_t value)
Write register.
#define DM96XX_CHIPR_9601
DM9601.
#define DM96XX_RCR_RUNT
Pass runt packet.
#define DM96XX_MODE_CTL
RX header control/status register (DM9620+ only)
static int dm96xx_read_register(struct dm96xx_device *dm96xx, unsigned int offset)
Read register.
#define DM96XX_NCR_RST
Software reset.
#define DM96XX_INTR_MAX_FILL
Interrupt maximum fill level.
static int dm96xx_write_registers(struct dm96xx_device *dm96xx, unsigned int offset, void *data, size_t len)
Write registers.
#define DM96XX_RCR_PRMSC
Promiscuous mode.
#define DM96XX_RSR_MF
Multicast frame.
#define DM96XX_RCR_ALL
Pass all multicast.
#define DM96XX_NSR_LINKST
Link status.
#define DM96XX_NSR
Network status register.
#define DM96XX_RESET_DELAY_US
Reset delay (in microseconds)
struct ena_llq_option header
Header locations.
uint8_t mac[ETH_ALEN]
MAC address.
uint8_t intr
Interrupts enabled.
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
static struct net_device * netdev
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define EINVAL
Invalid argument.
#define ENOMEM
Not enough space.
#define EIO
Input/output error.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define cpu_to_le16(value)
Universal Serial Bus (USB)
#define __usb_driver
Declare a USB driver.
static void usb_refill_init(struct usb_endpoint *ep, size_t reserve, size_t len, unsigned int max)
Initialise USB endpoint refill.
#define USB_ANY_ID
Match-anything ID.
#define USB_CLASS_ID(base, subclass, protocol)
Construct USB class ID.
static void usb_poll(struct usb_bus *bus)
Poll USB bus.
#define USB_ROM(_vendor, _product, _name, _description, _data)
static void usb_func_set_drvdata(struct usb_function *func, void *priv)
Set USB function driver private data.
@ USB_SCORE_NORMAL
Normal driver.
static void * usb_func_get_drvdata(struct usb_function *func)
Get USB function driver private data.
void * memset(void *dest, int character, size_t len) __nonnull
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
int iob_ensure_headroom(struct io_buffer *iobuf, size_t len)
Ensure I/O buffer has sufficient headroom.
#define iob_push(iobuf, len)
#define iob_disown(iobuf)
Disown an I/O buffer.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define iob_pull(iobuf, len)
#define iob_unput(iobuf, len)
void netdev_link_down(struct net_device *netdev)
Mark network device as having link down.
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
void unregister_netdev(struct net_device *netdev)
Unregister network device.
void netdev_tx_complete_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Complete network transmission.
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
int register_netdev(struct net_device *netdev)
Register network device.
static int netdev_link_ok(struct net_device *netdev)
Check link state of network device.
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
#define container_of(ptr, type, field)
Get containing structure.
char * strerror(int errno)
Retrieve string representation of error number.
struct net_device * netdev
Network device.
struct usb_bus * bus
USB bus.
struct usb_device * usb
USB device.
struct usbnet_device usbnet
USB network device.
void * data
Start of data.
Network device operations.
A USB configuration descriptor.
struct usb_port * port
USB port.
USB endpoint driver operations.
int open
Endpoint is open.
struct usb_device * usb
USB device.
struct device dev
Generic device.
struct usb_bus * bus
USB bus.
struct usb_hub * hub
USB hub.
struct usb_endpoint out
Bulk OUT endpoint.
struct usb_endpoint intr
Interrupt endpoint.
struct usb_endpoint in
Bulk IN endpoint.
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
int usb_stream(struct usb_endpoint *ep, struct io_buffer *iobuf, int terminate)
Enqueue USB stream transfer.
int usbnet_refill(struct usbnet_device *usbnet)
Refill USB network device bulk IN and interrupt endpoints.
int usbnet_open(struct usbnet_device *usbnet)
Open USB network device.
void usbnet_close(struct usbnet_device *usbnet)
Close USB network device.
int usbnet_describe(struct usbnet_device *usbnet, struct usb_configuration_descriptor *config)
Describe USB network device interfaces.
static void usbnet_init(struct usbnet_device *usbnet, struct usb_function *func, struct usb_endpoint_driver_operations *intr, struct usb_endpoint_driver_operations *in, struct usb_endpoint_driver_operations *out)
Initialise USB network device.