22 #define SMSCUSB_REGISTER_WRITE \ 23 ( USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE | \ 24 USB_REQUEST_TYPE ( 0xa0 ) ) 27 #define SMSCUSB_REGISTER_READ \ 28 ( USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE | \ 29 USB_REQUEST_TYPE ( 0xa1 ) ) 32 #define SMSCUSB_GET_STATISTICS \ 33 ( USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE | \ 34 USB_REQUEST_TYPE ( 0xa2 ) ) 37 #define SMSCUSB_E2P_CMD 0x000 38 #define SMSCUSB_E2P_CMD_EPC_BSY 0x80000000UL 39 #define SMSCUSB_E2P_CMD_EPC_CMD_READ 0x00000000UL 40 #define SMSCUSB_E2P_CMD_EPC_ADDR(addr) ( (addr) << 0 ) 43 #define SMSCUSB_E2P_DATA 0x004 44 #define SMSCUSB_E2P_DATA_GET(e2p_data) \ 45 ( ( (e2p_data) >> 0 ) & 0xff ) 48 #define SMSCUSB_EEPROM_MAC 0x01 51 #define SMSCUSB_EEPROM_MAX_WAIT_MS 100 54 #define SMSCUSB_OTP_POWER 0x000 55 #define SMSCUSB_OTP_POWER_DOWN 0x00000001UL 58 #define SMSCUSB_OTP_ADDRH 0x004 61 #define SMSCUSB_OTP_ADDRL 0x008 64 #define SMSCUSB_OTP_DATA 0x018 65 #define SMSCUSB_OTP_DATA_GET(otp_data) \ 66 ( ( (otp_data) >> 0 ) & 0xff ) 69 #define SMSCUSB_OTP_CMD 0x020 70 #define SMSCUSB_OTP_CMD_READ 0x00000001UL 73 #define SMSCUSB_OTP_GO 0x028 74 #define SMSCUSB_OTP_GO_GO 0x00000001UL 77 #define SMSCUSB_OTP_STATUS 0x030 78 #define SMSCUSB_OTP_STATUS_BUSY 0x00000001UL 81 #define SMSCUSB_OTP_MAX_WAIT_MS 100 84 #define SMSCUSB_OTP_1_SIG 0xf3 87 #define SMSCUSB_OTP_1_MAC 0x001 90 #define SMSCUSB_OTP_2_SIG 0xf7 93 #define SMSCUSB_OTP_2_MAC 0x101 96 #define SMSCUSB_MII_ACCESS 0x000 97 #define SMSCUSB_MII_ACCESS_PHY_ADDRESS 0x00000800UL 98 #define SMSCUSB_MII_ACCESS_MIIRINDA(addr) ( (addr) << 6 ) 99 #define SMSCUSB_MII_ACCESS_MIIWNR 0x00000002UL 100 #define SMSCUSB_MII_ACCESS_MIIBZY 0x00000001UL 103 #define SMSCUSB_MII_DATA 0x004 104 #define SMSCUSB_MII_DATA_SET(data) ( (data) << 0 ) 105 #define SMSCUSB_MII_DATA_GET(mii_data) \ 106 ( ( (mii_data) >> 0 ) & 0xffff ) 109 #define SMSCUSB_MII_MAX_WAIT_MS 100 125 #define SMSCUSB_RX_ADDRH 0x000 128 #define SMSCUSB_RX_ADDRL 0x004 131 #define SMSCUSB_ADDR_FILTH(n) ( 0x000 + ( 8 * (n) ) ) 132 #define SMSCUSB_ADDR_FILTH_VALID 0x80000000UL 135 #define SMSCUSB_ADDR_FILTL(n) ( 0x004 + ( 8 * (n) ) ) 229 DBGC ( smscusb,
"SMSCUSB %p could not get statistics set %d: " 241 #define SMSCUSB_INTR_MAX_FILL 2 278 unsigned int phy_source ) {
287 unsigned int e2p_base );
289 unsigned int otp_base );
293 unsigned int phy_mask,
unsigned int intrs );
295 unsigned int addr_base );
297 unsigned int filt_base );
struct arbelprm_rc_send_wqe rc
uint64_t address
Base address.
int smscusb_mii_open(struct smscusb_device *smscusb, unsigned int phy_mask, unsigned int intrs)
Enable PHY interrupts and update link status.
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.
struct usb_device * usb
USB device.
static int smscusb_writel(struct smscusb_device *smscusb, unsigned int address, uint32_t value)
Write register.
struct usb_endpoint_driver_operations smscusb_out_operations
Bulk OUT endpoint operations.
struct usb_endpoint intr
Interrupt endpoint.
static void smscusb_mii_init(struct smscusb_device *smscusb, unsigned int mii_base, unsigned int phy_source)
Initialise SMSC USB device MII interface.
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 void mdio_init(struct mii_interface *mdio, struct mii_operations *op)
Initialise MII interface.
#define SMSCUSB_INTR_MAX_FILL
Interrupt maximum fill level.
uint32_t int_sts
Interrupt status.
uint16_t phy_source
PHY interrupt source register.
struct usbnet_device usbnet
USB network device.
struct usb_port * port
USB port.
uint8_t raw[ETH_ALEN]
Raw MAC address.
pseudo_bit_t value[0x00020]
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
struct mii_operations smscusb_mii_operations
MII operations.
static int smscusb_readl(struct smscusb_device *smscusb, unsigned int address, uint32_t *value)
Read register.
#define SMSCUSB_GET_STATISTICS
Get statistics command.
int smscusb_set_address(struct smscusb_device *smscusb, unsigned int addr_base)
Set receive address.
#define cpu_to_le32(value)
struct mii_interface mdio
MII interface.
char * strerror(int errno)
Retrieve string representation of error number.
uint32_t l
MAC receive address low register.
Media Independent Interface.
uint32_t int_sts
Current value of INT_STS register.
int smscusb_fdt_fetch_mac(struct smscusb_device *smscusb)
Fetch MAC address from device tree.
struct usb_device * usb
USB device.
struct mii_device mii
MII device.
int smscusb_set_filter(struct smscusb_device *smscusb, unsigned int filt_base)
Set receive filter.
struct smscusb_mac::@342 addr
MAC receive address registers.
int smscusb_otp_fetch_mac(struct smscusb_device *smscusb, unsigned int otp_base)
Fetch MAC address from OTP.
static void mii_init(struct mii_device *mii, struct mii_interface *mdio, unsigned int address)
Initialise MII device.
int smscusb_raw_readl(struct smscusb_device *smscusb, unsigned int address, uint32_t *value)
Read register (without byte-swapping)
struct usb_endpoint_driver_operations smscusb_intr_operations
Interrupt endpoint operations.
Network device management.
MII interface operations.
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.
struct usb_hub * hub
USB hub.
uint16_t mii_base
MII register base.
uint8_t data[48]
Additional event data.
int smscusb_mii_check_link(struct smscusb_device *smscusb)
Check link status.
int smscusb_eeprom_fetch_mac(struct smscusb_device *smscusb, unsigned int e2p_base)
Fetch MAC address from EEPROM.
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.
USB endpoint driver operations.
struct usb_bus * bus
USB bus.
uint32_t h
MAC receive address high register.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int smscusb_raw_writel(struct smscusb_device *smscusb, unsigned int address, uint32_t value)
Write register (without byte-swapping)
#define le32_to_cpus(ptr)