48 { .
name =
"axge.intr" };
52 { .
name =
"axge.in" };
56 { .
name =
"axge.out" };
221 DBGC ( axge,
"AXGE %p could not read PLSR: %s\n",
235 DBGC ( axge,
"AXGE %p could not write MSR: %s\n",
242 DBGC ( axge,
"AXGE %p link up (PLSR %02x MSR %04x)\n",
246 DBGC ( axge,
"AXGE %p link down (PLSR %02x MSR %04x)\n",
275 unsigned int link_ok;
286 DBGC ( axge,
"AXGE %p interrupt failed: %s\n",
293 if (
len <
sizeof ( *
intr ) ) {
294 DBGC ( axge,
"AXGE %p underlength interrupt:\n", axge );
303 DBGC ( axge,
"AXGE %p malformed interrupt:\n", axge );
368 DBGC ( axge,
"AXGE %p bulk IN failed: %s\n",
374 if (
iob_len ( iobuf ) <
sizeof ( *ftr ) ) {
375 DBGC ( axge,
"AXGE %p underlength bulk IN:\n", axge );
386 DBGC ( axge,
"AXGE %p zero-packet bulk IN:\n", axge );
393 DBGC ( axge,
"AXGE %p malformed bulk IN footer:\n", axge );
408 if (
iob_len ( iobuf ) < padded_len ) {
409 DBGC ( axge,
"AXGE %p malformed bulk IN descriptor:\n",
536 DBGC ( axge,
"AXGE %p could not set configuration: %s\n",
538 goto err_set_configuration;
543 DBGC ( axge,
"AXGE %p could not open: %s\n",
551 DBGC ( axge,
"AXGE %p could not set MAC address: %s\n",
560 DBGC ( axge,
"AXGE %p could not write RCR: %s\n",
577 err_set_configuration:
681 memset ( axge, 0,
sizeof ( *axge ) );
691 DBGC ( axge,
"AXGE %p on %s\n", axge, func->
name );
695 DBGC ( axge,
"AXGE %p could not describe: %s\n",
703 DBGC ( axge,
"AXGE %p could not fetch MAC address: %s\n",
710 DBGC ( axge,
"AXGE %p could not write EPPRCR: %s\n",
712 goto err_write_epprcr_off;
716 DBGC ( axge,
"AXGE %p could not write EPPRCR: %s\n",
718 goto err_write_epprcr_on;
725 DBGC ( axge,
"AXGE %p could not write CSR: %s\n",
734 DBGC ( axge,
"AXGE %p could not write BICR: %s\n",
756 err_write_epprcr_off:
797 .name =
"axge-sitecom",
802 .name =
"axge-samsung",
807 .name =
"onelinkdock",
Asix 10/100/1000 USB Ethernet driver.
#define iob_pull(iobuf, len)
#define EINVAL
Invalid argument.
#define AXGE_INTR_MAGIC
Interrupt magic signature.
struct arbelprm_rc_send_wqe rc
#define AXGE_EPPRCR_IPRL
Undocumented.
#define iob_put(iobuf, len)
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.
static int axge_read_byte(struct axge_device *axge, unsigned int offset, uint8_t *value)
Read one-byte register.
static int usb_set_configuration(struct usb_device *usb, unsigned int index)
Set USB configuration.
#define AXGE_RX_DROP_ERROR
Receive packet dropped error.
struct usb_device * usb
USB device.
#define AXGE_PLSR_EPHY_100
Ethernet at 100Mbps.
int(* open)(struct net_device *netdev)
Open network device.
static void axge_close(struct net_device *netdev)
Close network device.
static void axge_poll(struct net_device *netdev)
Poll for completed and received packets.
struct golan_inbox_hdr hdr
Message header.
#define iob_push(iobuf, len)
#define AXGE_EPPRCR_DELAY_MS
Delay after initialising EPPRCR.
struct usb_bus * bus
USB bus.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
#define AXGE_RCR
RX Control Register.
struct arbelprm_completion_with_error error
static int axge_open(struct net_device *netdev)
Open network device.
uint64_t desc
Microcode descriptor list physical address.
#define AXGE_IN_RESERVE
Amount of space to reserve at start of bulk IN buffers.
#define AXGE_INTR_MAX_FILL
Interrupt maximum fill level.
int usb_stream(struct usb_endpoint *ep, struct io_buffer *iobuf, int terminate)
Enqueue USB stream transfer.
void netdev_link_down(struct net_device *netdev)
Mark network device as having link down.
#define AXGE_RX_CRC_ERROR
Receive packet CRC error.
static void axge_remove(struct usb_function *func)
Remove device.
#define AXGE_MSR_RFC
RX flow control enable.
#define AXGE_RX_LEN_PAD_ALIGN
Receive packet length alignment.
static struct profiler axge_intr_profiler __profiler
Interrupt completion profiler.
A data structure for storing profiling information.
#define AXGE_RCR_SO
Start operation.
#define AXGE_MSR
Medium Status Register.
int open
Endpoint is open.
static void profile_stop(struct profiler *profiler)
Stop profiling.
struct usb_endpoint intr
Interrupt endpoint.
static void axge_intr_complete(struct usb_endpoint *ep, struct io_buffer *iobuf, int rc)
Complete interrupt transfer.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
int usb_control(struct usb_device *usb, unsigned int request, unsigned int value, unsigned int index, void *data, size_t len)
Issue USB control transaction.
static struct axge_bulk_in_control axge_bicr
Default bulk IN configuration.
#define AXGE_RCR_PRO
Promiscuous mode.
static struct net_device_operations axge_operations
AXGE network device operations.
static int axge_out_transmit(struct axge_device *axge, struct io_buffer *iobuf)
Transmit packet.
struct usb_endpoint out
Bulk OUT endpoint.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
#define AXGE_PLSR
Physical Link Status Register.
#define ENOMEM
Not enough space.
#define iob_disown(iobuf)
Disown an I/O buffer.
static int axge_check_link(struct axge_device *axge)
Get link status.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
struct usb_port * port
USB port.
#define AXGE_CSR_DELAY_MS
Delay after initialising CSR.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
#define container_of(ptr, type, field)
Get containing structure.
uint8_t intr
Interrupts enabled.
void * priv
Driver private data.
static void axge_in_complete(struct usb_endpoint *ep, struct io_buffer *iobuf, int rc)
Complete bulk IN transfer.
pseudo_bit_t value[0x00020]
struct net_device * netdev
Network device.
#define AXGE_READ_MAC_REGISTER
Read MAC register.
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
#define AXGE_CSR
Clock Select Register (undocumented)
static void usb_refill_init(struct usb_endpoint *ep, size_t reserve, size_t len, unsigned int max)
Initialise USB endpoint refill.
static int axge_read_dword(struct axge_device *axge, unsigned int offset, uint32_t *value)
Read four-byte register.
static int netdev_link_ok(struct net_device *netdev)
Check link state of network device.
static struct net_device * netdev
uint16_t count
Number of entries.
#define AXGE_MSR_PS
100Mbps port speed
static void usb_func_set_drvdata(struct usb_function *func, void *priv)
Set USB function driver private data.
static void profile_start(struct profiler *profiler)
Start profiling.
static int axge_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
void unregister_netdev(struct net_device *netdev)
Unregister network device.
static int axge_write_dword(struct axge_device *axge, unsigned int offset, uint32_t value)
Write one-byte register.
int usbnet_refill(struct usbnet_device *usbnet)
Refill USB network device bulk IN and interrupt endpoints.
#define cpu_to_le32(value)
int check_link
Link state has changed.
#define AXGE_IN_MAX_FILL
Bulk IN maximum fill level.
static void usb_poll(struct usb_bus *bus)
Poll USB bus.
#define iob_unput(iobuf, len)
#define AXGE_INTR_LINK_PPLS
Link is up.
char * strerror(int errno)
Retrieve string representation of error number.
Bulk IN Control (undocumented)
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 USB_CLASS_ID(base, subclass, protocol)
Construct USB class ID.
#define AXGE_CSR_BCS
Undocumented.
#define AXGE_BICR
Bulk IN Control Register (undocumented)
struct usb_endpoint in
Bulk IN endpoint.
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
static int axge_probe(struct usb_function *func, struct usb_configuration_descriptor *config)
Probe device.
#define AXGE_PLSR_EPHY_ANY
struct usb_device * usb
USB device.
struct usb_driver axge_driver __usb_driver
AXGE driver.
#define le16_to_cpu(value)
static struct usb_endpoint_driver_operations axge_intr_operations
Interrupt endpoint operations.
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.
#define AXGE_WRITE_MAC_REGISTER
Write MAC register.
#define AXGE_MSR_GM
Gigabit mode.
Network device management.
static int axge_write_word(struct axge_device *axge, unsigned int offset, uint16_t value)
Write two-byte register.
#define AXGE_NIDR
Node ID Register.
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
#define iob_reserve(iobuf, len)
#define AXGE_RX_LEN_MASK
Receive packet length mask.
A USB configuration descriptor.
void netdev_tx_complete_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Complete network transmission.
#define AXGE_CSR_ACS
Undocumented.
static int axge_read_register(struct axge_device *axge, unsigned int offset, void *data, size_t len)
Read register.
#define ENOBUFS
No buffer space available.
#define USB_ANY_ID
Match-anything ID.
Universal Serial Bus (USB)
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.
#define AXGE_RCR_AMALL
Accept all multicasts.
void * data
Start of data.
struct usb_hub * hub
USB hub.
#define EIO
Input/output error.
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
static struct usb_endpoint_driver_operations axge_out_operations
Bulk OUT endpoint operations.
#define cpu_to_le16(value)
unsigned int config
Device configuration.
static void axge_out_complete(struct usb_endpoint *ep, struct io_buffer *iobuf, int rc)
Complete bulk OUT transfer.
uint8_t data[48]
Additional event data.
static struct usb_endpoint_driver_operations axge_in_operations
Bulk IN endpoint operations.
static struct usb_device_id axge_ids[]
AXGE device IDs.
uint16_t offset
Offset to command line.
#define AXGE_PLSR_EPHY_1000
Ethernet at 1000Mbps.
#define AXGE_EPPRCR
Ethernet PHY Power and Reset Control Register.
int usbnet_describe(struct usbnet_device *usbnet, struct usb_configuration_descriptor *config)
Describe USB network device interfaces.
#define AXGE_MSR_TFC
TX flow control enable.
Receive packet descriptor.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
void usbnet_close(struct usbnet_device *usbnet)
Close USB network device.
USB endpoint driver operations.
struct device dev
Generic device.
static int axge_write_register(struct axge_device *axge, unsigned int offset, void *data, size_t len)
Write register.
struct usb_bus * bus
USB bus.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int iob_ensure_headroom(struct io_buffer *iobuf, size_t len)
Ensure I/O buffer has sufficient headroom.
static int axge_write_byte(struct axge_device *axge, unsigned int offset, uint8_t value)
Write one-byte register.
struct usbnet_device usbnet
USB network device.
#define AXGE_IN_MTU
Bulk IN buffer size.
#define AXGE_RCR_AB
Accept broadcasts.
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
#define NULL
NULL pointer (VOID *)
#define AXGE_MSR_FD
Full duplex.
static int axge_read_word(struct axge_device *axge, unsigned int offset, uint16_t *value)
Read two-byte register.
#define AXGE_MSR_RE
Receive enable.
struct usb_device_id * ids
USB ID table.
void * memset(void *dest, int character, size_t len) __nonnull
int usbnet_open(struct usbnet_device *usbnet)
Open USB network device.