|
| 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) More...
|
|
int | smscusb_raw_readl (struct smscusb_device *smscusb, unsigned int address, uint32_t *value) |
| Read register (without byte-swapping) More...
|
|
static int | smscusb_writel (struct smscusb_device *smscusb, unsigned int address, uint32_t value) |
| Write register. More...
|
|
static int | smscusb_readl (struct smscusb_device *smscusb, unsigned int address, uint32_t *value) |
| Read register. More...
|
|
static int | smscusb_get_statistics (struct smscusb_device *smscusb, unsigned int index, void *data, size_t len) |
| Get statistics. More...
|
|
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. More...
|
|
static void | smscusb_mii_init (struct smscusb_device *smscusb, unsigned int mii_base, unsigned int phy_source) |
| Initialise SMSC USB device MII interface. More...
|
|
int | smscusb_eeprom_fetch_mac (struct smscusb_device *smscusb, unsigned int e2p_base) |
| Fetch MAC address from EEPROM. More...
|
|
int | smscusb_otp_fetch_mac (struct smscusb_device *smscusb, unsigned int otp_base) |
| Fetch MAC address from OTP. More...
|
|
int | smscusb_fdt_fetch_mac (struct smscusb_device *smscusb) |
| Fetch MAC address from device tree. More...
|
|
int | smscusb_mii_check_link (struct smscusb_device *smscusb) |
| Check link status. More...
|
|
int | smscusb_mii_open (struct smscusb_device *smscusb, unsigned int phy_mask, unsigned int intrs) |
| Enable PHY interrupts and update link status. More...
|
|
int | smscusb_set_address (struct smscusb_device *smscusb, unsigned int addr_base) |
| Set receive address. More...
|
|
int | smscusb_set_filter (struct smscusb_device *smscusb, unsigned int filt_base) |
| Set receive filter. More...
|
|
SMSC USB Ethernet drivers.
Definition in file smscusb.h.
Write register (without byte-swapping)
- Parameters
-
smscusb | Smscusb device |
address | Register address |
value | Register value |
- Return values
-
Definition at line 61 of file smscusb.c.
66 DBGCIO ( smscusb,
"SMSCUSB %p [%03x] <= %08x\n",
70 DBGC ( smscusb,
"SMSCUSB %p could not write %03x: %s\n",
struct arbelprm_rc_send_wqe rc
#define le32_to_cpu(value)
#define SMSCUSB_REGISTER_WRITE
Register write command.
uint64_t address
Base address.
struct usb_device * usb
USB device.
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.
pseudo_bit_t value[0x00020]
char * strerror(int errno)
Retrieve string representation of error number.
References address, DBGC, DBGCIO, le32_to_cpu, rc, SMSCUSB_REGISTER_WRITE, strerror(), smscusb_device::usb, usb_control(), and value.
Referenced by smscusb_set_address(), and smscusb_set_filter().
int smscusb_eeprom_fetch_mac |
( |
struct smscusb_device * |
smscusb, |
|
|
unsigned int |
e2p_base |
|
) |
| |
Fetch MAC address from EEPROM.
- Parameters
-
smscusb | SMSC USB device |
e2p_base | E2P register base |
- Return values
-
Definition at line 215 of file smscusb.c.
227 DBGC ( smscusb,
"SMSCUSB %p has no EEPROM MAC (%s)\n",
232 DBGC ( smscusb,
"SMSCUSB %p using EEPROM MAC %s\n",
struct arbelprm_rc_send_wqe rc
#define SMSCUSB_EEPROM_MAC
MAC address EEPROM address.
static struct net_device * netdev
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
#define ENODEV
No such device.
static int is_valid_ether_addr(const void *addr)
Check if Ethernet address is valid.
static int smscusb_eeprom_read(struct smscusb_device *smscusb, unsigned int e2p_base, unsigned int address, void *data, size_t len)
Read data from EEPROM.
struct net_device * netdev
Network device.
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
References DBGC, ENODEV, ETH_ALEN, eth_ntoa(), net_device::hw_addr, is_valid_ether_addr(), netdev, smscusb_device::netdev, rc, SMSCUSB_EEPROM_MAC, and smscusb_eeprom_read().
Referenced by lan78xx_eeprom_fetch_mac(), smsc75xx_probe(), and smsc95xx_fetch_mac().
int smscusb_otp_fetch_mac |
( |
struct smscusb_device * |
smscusb, |
|
|
unsigned int |
otp_base |
|
) |
| |
Fetch MAC address from OTP.
- Parameters
-
smscusb | SMSC USB device |
otp_base | OTP register base |
- Return values
-
Definition at line 400 of file smscusb.c.
421 DBGC ( smscusb,
"SMSCUSB %p unknown OTP signature %#02x\n",
433 DBGC ( smscusb,
"SMSCUSB %p has no layout %#02x OTP MAC (%s)\n",
438 DBGC ( smscusb,
"SMSCUSB %p using layout %#02x OTP MAC %s\n",
struct arbelprm_rc_send_wqe rc
uint64_t address
Base address.
#define SMSCUSB_OTP_1_MAC
OTP layout 1 MAC address offset.
#define SMSCUSB_OTP_2_MAC
OTP layout 2 MAC address offset.
#define ENOTSUP
Operation not supported.
#define SMSCUSB_OTP_2_SIG
OTP layout 2 signature.
static struct net_device * netdev
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
#define ENODEV
No such device.
static int is_valid_ether_addr(const void *addr)
Check if Ethernet address is valid.
struct net_device * netdev
Network device.
static int smscusb_otp_read(struct smscusb_device *smscusb, unsigned int otp_base, unsigned int address, void *data, size_t len)
Read data from OTP.
#define SMSCUSB_OTP_1_SIG
OTP layout 1 signature.
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
References address, DBGC, ENODEV, ENOTSUP, ETH_ALEN, eth_ntoa(), net_device::hw_addr, is_valid_ether_addr(), netdev, smscusb_device::netdev, rc, signature, SMSCUSB_OTP_1_MAC, SMSCUSB_OTP_1_SIG, SMSCUSB_OTP_2_MAC, SMSCUSB_OTP_2_SIG, and smscusb_otp_read().
Referenced by lan78xx_fetch_mac().
Fetch MAC address from device tree.
- Parameters
-
- Return values
-
Definition at line 456 of file smscusb.c.
471 DBGC ( smscusb,
"SMSCUSB %p using FDT MAC %s\n",
struct arbelprm_rc_send_wqe rc
int fdt_mac(unsigned int offset, struct net_device *netdev)
Get MAC address from property.
static userptr_t size_t offset
Offset of the first segment within the content.
static struct net_device * netdev
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
struct net_device * netdev
Network device.
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
int fdt_alias(const char *name, unsigned int *offset)
Find node by alias.
References DBGC, eth_ntoa(), fdt_alias(), fdt_mac(), net_device::hw_addr, netdev, smscusb_device::netdev, offset, and rc.
Referenced by lan78xx_fetch_mac(), and smsc95xx_fetch_mac().
Check link status.
- Parameters
-
- Return values
-
Definition at line 613 of file smscusb.c.
622 DBGC ( smscusb,
"SMSCUSB %p could not get PHY interrupt " 630 DBGC ( smscusb,
"SMSCUSB %p could not acknowledge PHY " 631 "interrupt: %s\n", smscusb,
strerror (
rc ) );
637 DBGC ( smscusb,
"SMSCUSB %p could not check link: %s\n",
642 DBGC ( smscusb,
"SMSCUSB %p link %s (intr %#04x)\n",
struct arbelprm_rc_send_wqe rc
uint16_t phy_source
PHY interrupt source register.
uint8_t intr
Interrupts enabled.
static int netdev_link_ok(struct net_device *netdev)
Check link state of network device.
static struct net_device * netdev
char * strerror(int errno)
Retrieve string representation of error number.
struct mii_device mii
MII device.
int mii_check_link(struct mii_device *mii, struct net_device *netdev)
Update link status via MII.
static int mii_read(int phy_id, int location)
struct net_device * netdev
Network device.
static int mii_write(struct mii_device *mii, unsigned int reg, unsigned int data)
Write to MII register.
References DBGC, intr, smscusb_device::mii, mii_check_link(), mii_read(), mii_write(), netdev, smscusb_device::netdev, netdev_link_ok(), smscusb_device::phy_source, rc, and strerror().
Referenced by smsc75xx_poll(), smsc95xx_poll(), and smscusb_mii_open().
int smscusb_mii_open |
( |
struct smscusb_device * |
smscusb, |
|
|
unsigned int |
phy_mask, |
|
|
unsigned int |
intrs |
|
) |
| |
Enable PHY interrupts and update link status.
- Parameters
-
smscusb | SMSC USB device |
phy_mask | PHY interrupt mask register |
intrs | PHY interrupts to enable |
- Return values
-
Definition at line 655 of file smscusb.c.
660 if ( (
rc =
mii_write ( &smscusb->
mii, phy_mask, intrs ) ) != 0 ) {
661 DBGC ( smscusb,
"SMSCUSB %p could not set PHY interrupt " struct arbelprm_rc_send_wqe rc
char * strerror(int errno)
Retrieve string representation of error number.
struct mii_device mii
MII device.
int smscusb_mii_check_link(struct smscusb_device *smscusb)
Check link status.
static int mii_write(struct mii_device *mii, unsigned int reg, unsigned int data)
Write to MII register.
References DBGC, smscusb_device::mii, mii_write(), rc, smscusb_mii_check_link(), and strerror().
Referenced by lan78xx_open(), smsc75xx_open(), and smsc95xx_open().
int smscusb_set_address |
( |
struct smscusb_device * |
smscusb, |
|
|
unsigned int |
addr_base |
|
) |
| |
Set receive address.
- Parameters
-
smscusb | SMSC USB device |
addr_base | Receive address register base |
- Return values
-
Definition at line 686 of file smscusb.c.
699 mac.addr.h ) ) != 0 )
705 mac.addr.l ) ) != 0 )
struct arbelprm_rc_send_wqe rc
uint8_t mac[ETH_ALEN]
MAC address.
#define SMSCUSB_RX_ADDRH
MAC receive address high register offset.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static struct net_device * netdev
int smscusb_raw_writel(struct smscusb_device *smscusb, unsigned int address, uint32_t value)
Write register (without byte-swapping)
#define SMSCUSB_RX_ADDRL
MAC receive address low register offset.
struct net_device * netdev
Network device.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
void * memset(void *dest, int character, size_t len) __nonnull
References ETH_ALEN, net_device::ll_addr, mac, memcpy(), memset(), netdev, smscusb_device::netdev, rc, smscusb_raw_writel(), SMSCUSB_RX_ADDRH, and SMSCUSB_RX_ADDRL.
Referenced by lan78xx_open(), smsc75xx_open(), and smsc95xx_open().
int smscusb_set_filter |
( |
struct smscusb_device * |
smscusb, |
|
|
unsigned int |
filt_base |
|
) |
| |
Set receive filter.
- Parameters
-
smscusb | SMSC USB device |
filt_base | Receive filter register base |
- Return values
-
Definition at line 718 of file smscusb.c.
732 mac.addr.h ) ) != 0 )
738 mac.addr.l ) ) != 0 )
struct arbelprm_rc_send_wqe rc
#define SMSCUSB_ADDR_FILTH_VALID
Address valid.
uint8_t mac[ETH_ALEN]
MAC address.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static struct net_device * netdev
int smscusb_raw_writel(struct smscusb_device *smscusb, unsigned int address, uint32_t value)
Write register (without byte-swapping)
#define SMSCUSB_ADDR_FILTL(n)
MAC address perfect filter N low register offset.
#define cpu_to_le32(value)
#define SMSCUSB_ADDR_FILTH(n)
MAC address perfect filter N high register offset.
struct net_device * netdev
Network device.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
void * memset(void *dest, int character, size_t len) __nonnull
References cpu_to_le32, ETH_ALEN, net_device::ll_addr, mac, memcpy(), memset(), netdev, smscusb_device::netdev, rc, SMSCUSB_ADDR_FILTH, SMSCUSB_ADDR_FILTH_VALID, SMSCUSB_ADDR_FILTL, and smscusb_raw_writel().
Referenced by lan78xx_open(), and smsc75xx_open().