75 DBGP(
"a3c90x_internal_IssueCommand\n");
81 for (cnt = 0; cnt < 100000; cnt++) {
85 DBG2(
"Command 0x%04X finished in time. cnt = %d.\n",
cmd, cnt);
90 DBG(
"Command 0x%04X DID NOT finish in time. cnt = %d.\n",
cmd, cnt);
101 DBGP(
"a3c90x_internal_SetWindow\n");
118 DBGP(
"a3c90x_internal_WaitForEeprom\n");
122 DBG(
"Read from eeprom failed: timeout\n");
143 unsigned short *
dest = (
unsigned short *)
data;
147 DBGP(
"a3c90x_internal_ReadEeprom\n");
188 int eeprom_size = (inf_3c90x->
isBrev ? 0x20 : 0x17) * 2;
190 DBGP(
"a3c90x_internal_ReadEepromContents\n");
206 DBGP(
"a3c90x_reset\n");
208 DBG2(
"3c90x: Issuing RESET\n");
250 DBGP(
"a3c90x_setup_tx_ring\n");
255 DBG(
"Could not allocate TX-ring\n");
276 unsigned int downlist_ptr;
278 DBGP(
"a3c90x_process_tx_packets\n");
286 DBG2(
" downlist_ptr: %#08x\n", downlist_ptr);
295 DBG2(
"transmitted packet\n");
305 DBGP(
"a3c90x_free_tx_ring\n");
324 struct TXD *tx_cur_desc;
325 struct TXD *tx_prev_desc;
328 unsigned int downlist_ptr;
330 DBGP(
"a3c90x_transmit\n");
333 DBG(
"TX-Ring overflow\n");
340 tx_prev_desc = inf_3c90x->
tx_ring +
370 if (downlist_ptr == 0) {
395 DBGP(
"a3c90x_prepare_rx_desc\n");
424 struct RXD *rx_cur_desc;
426 DBGP(
"a3c90x_refill_rx_ring\n");
442 DBG(
"alloc_iob() failed\n");
461 DBGP(
"a3c90x_setup_rx_ring\n");
467 DBG(
"Could not allocate RX-ring\n");
492 DBGP(
"a3c90x_free_rx_ring\n");
502 DBGP(
"a3c90x_free_rx_iobuf\n");
520 unsigned int rx_status;
522 struct RXD *rx_cur_desc;
524 DBGP(
"a3c90x_process_rx_packets\n");
537 DBG(
"Corrupted packet received: %#x\n", rx_status);
544 packet_len = rx_status & 0x1FFF;
547 DBG2(
"received packet\n");
548 DBG2(
" size: %d\n", packet_len);
573 DBGP(
"a3c90x_poll\n");
576 int_status = (raw_status & 0x0FFF);
578 if ( int_status == 0 )
587 DBG2(
"poll: status = %#04x\n", raw_status);
598 DBGP(
"a3c90x_free_resources\n");
616 DBGP(
"a3c90x_remove\n");
633 DBGP(
"a3c90x_irq\n");
662 DBGP(
"a3c90x_hw_start\n");
695 DBG2(
"Connectors present: ");
699 DBG2(
"%s100Base-T4", (
c++) ?
", " :
"");
703 DBG2(
"%s100Base-FX", (
c++) ?
", " :
"");
707 DBG2(
"%s10Base-2", (
c++) ?
", " :
"");
711 DBG2(
"%sAUI", (
c++) ?
", " :
"");
715 DBG2(
"%sMII", (
c++) ?
", " :
"");
718 if ((mopt & 0xA) == 0xA) {
719 DBG2(
"%s10Base-T / 100Base-TX", (
c++) ?
", " :
"");
721 }
else if ((mopt & 0xA) == 0x2) {
722 DBG2(
"%s100Base-TX", (
c++) ?
", " :
"");
724 }
else if ((mopt & 0xA) == 0x8) {
725 DBG2(
"%s10Base-T", (
c++) ?
", " :
"");
742 DBG(
"WARNING: MII External MAC Mode only supported on B-revision " "cards!!!!\nFalling Back to MII Mode\n");
759 DBG2(
"Setting internal cfg register: 0x%08X (linktype: 0x%02X)\n",
801 DBGP(
"a3c90x_open\n");
807 DBG(
"Error setting up TX Ring\n");
813 DBG(
"Error setting up RX Ring\n");
850 DBGP(
"a3c90x_close\n");
882 unsigned char *HWAddr;
885 DBGP(
"a3c90x_probe\n");
899 memset(inf_3c90x, 0,
sizeof(*inf_3c90x));
917 DBG2(
"[3c90x]: found NIC(0x%04X, 0x%04X), isBrev=%d, is3c556=%d\n",
945 DBG(
"3c90x: register_netdev() failed\n");
958 PCI_ROM(0x10b7, 0x1201,
"3c982a",
"3Com982A", 0),
959 PCI_ROM(0x10b7, 0x1202,
"3c982b",
"3Com982B", 0),
960 PCI_ROM(0x10b7, 0x4500,
"3c450",
"3Com450 HomePNA Tornado", 0),
961 PCI_ROM(0x10b7, 0x6055,
"3c556",
"3C556", 0),
962 PCI_ROM(0x10b7, 0x7646,
"3csoho100-tx",
"3CSOHO100-TX", 0),
963 PCI_ROM(0x10b7, 0x9000,
"3c905-tpo",
"3Com900-TPO", 0),
964 PCI_ROM(0x10b7, 0x9001,
"3c905-t4",
"3Com900-Combo", 0),
966 PCI_ROM(0x10b7, 0x9004,
"3c905b-tpo",
"3Com900B-TPO", 0),
967 PCI_ROM(0x10b7, 0x9005,
"3c905b-combo",
"3Com900B-Combo", 0),
968 PCI_ROM(0x10b7, 0x9006,
"3c905b-tpb2",
"3Com900B-2/T", 0),
969 PCI_ROM(0x10b7, 0x900a,
"3c905b-fl",
"3Com900B-FL", 0),
970 PCI_ROM(0x10b7, 0x9050,
"3c905-tpo100",
"3Com905-TX", 0),
971 PCI_ROM(0x10b7, 0x9051,
"3c905-combo",
"3Com905-T4", 0),
972 PCI_ROM(0x10b7, 0x9055,
"3c905b-tpo100",
"3Com905B-TX", 0),
973 PCI_ROM(0x10b7, 0x9056,
"3c905b-t4",
"3Com905B-T4", 0),
974 PCI_ROM(0x10b7, 0x9058,
"3c905b-9058",
"3Com905B-9058", 0),
975 PCI_ROM(0x10b7, 0x905a,
"3c905b-fx",
"3Com905B-FL", 0),
977 PCI_ROM(0x10b7, 0x9200,
"3c905c-tpo",
"3Com905C-TXM", 0),
978 PCI_ROM(0x10b7, 0x9202,
"3c920b-emb-ati",
"3c920B-EMB-WNM (ATI Radeon 9100 IGP)", 0),
979 PCI_ROM(0x10b7, 0x9210,
"3c920b-emb-wnm",
"3Com20B-EMB WNM", 0),
980 PCI_ROM(0x10b7, 0x9800,
"3c980",
"3Com980-Cyclone", 0),
981 PCI_ROM(0x10b7, 0x9805,
"3c9805",
"3Com9805", 0),
#define EINVAL
Invalid argument.
int(* write)(struct nvs_device *nvs, unsigned int address, const void *data, size_t len)
Write data to device.
struct arbelprm_rc_send_wqe rc
static void netdev_tx_complete(struct net_device *netdev, struct io_buffer *iobuf)
Complete network transmission.
unsigned int word_len_log2
Word length.
static __always_inline void off_t int c
#define iob_put(iobuf, len)
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
uint16_t inw(volatile uint16_t *io_addr)
Read 16-bit word from I/O-mapped device.
static void a3c90x_process_tx_packets(struct net_device *netdev)
a3c90x_process_tx_packets - Checks for successfully sent packets, reports them to iPXE with netdev_tx...
unsigned short eeprom[0x21]
static int a3c90x_open(struct net_device *netdev)
a3c90x_open - Routine to initialize the card.
int(* open)(struct net_device *netdev)
Open network device.
#define outw(data, io_addr)
static void a3c90x_free_resources(struct INF_3C90X *p)
unsigned long ioaddr
I/O address.
static void a3c90x_irq(struct net_device *netdev, int enable)
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
A non-volatile storage device.
struct pci_device_id * ids
PCI ID table.
volatile unsigned int DataLength
uint64_t address
Base address.
struct arbelprm_completion_with_error error
static void a3c90x_refill_rx_ring(struct INF_3C90X *p)
a3c90x_refill_rx_ring -checks every entry in the rx ring and reallocates them as necessary.
volatile unsigned int DnNextPtr
static void a3c90x_free_tx_ring(struct INF_3C90X *p)
static int a3c90x_internal_WriteEeprom(struct nvs_device *nvs __unused, unsigned int address __unused, const void *data __unused, size_t len __unused)
a3c90x_internal_WriteEeprom - nvs routine to write eeprom data currently not implemented
static int a3c90x_internal_ReadEeprom(struct nvs_device *nvs, unsigned int address, void *data, size_t len)
a3c90x_internal_ReadEeprom - nvs routine to read eeprom data We only support reading one word(2 byte)...
static void *__malloc malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.
static void a3c90x_free_rx_iobuf(struct INF_3C90X *p)
static int a3c90x_setup_tx_ring(struct INF_3C90X *p)
a3c90x_setup_tx_ring - Allocates TX ring, initialize tx_desc values
volatile unsigned int UpPktStatus
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
struct device dev
Generic device.
static int a3c90x_probe(struct pci_device *pci)
a3c90x_probe: exported routine to probe for the 3c905 card.
volatile unsigned int DataAddr
#define ENOTSUP
Operation not supported.
Dynamic memory allocation.
static void a3c90x_remove(struct pci_device *pci)
a3c90x_remove - Routine to remove the card.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
#define ENOMEM
Not enough space.
static unsigned long ioaddr
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
uint16_t device
Device ID.
unsigned int block_size
Data block size (in words)
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.
void * priv
Driver private data.
#define __unused
Declare a variable or data structure as unused.
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
static struct net_device * netdev
static void a3c90x_free_rx_ring(struct INF_3C90X *p)
static void a3c90x_internal_SetWindow(struct INF_3C90X *inf_3c90x, int window)
a3c90x_internal_SetWindow: selects a register window set.
volatile unsigned int DataLength
static void a3c90x_internal_ReadEepromContents(struct INF_3C90X *inf_3c90x)
void unregister_netdev(struct net_device *netdev)
Unregister network device.
int(* read)(struct nvs_device *nvs, unsigned int address, void *data, size_t len)
Read data from device.
static void a3c90x_internal_WaitForEeprom(struct INF_3C90X *inf_3c90x)
static struct pci_device_id a3c90x_nics[]
#define outl(data, io_addr)
struct io_buffer * tx_iobuf[TX_RING_SIZE]
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.
struct hv_monitor_parameter param[4][32]
Parameters.
static void a3c90x_process_rx_packets(struct net_device *netdev)
a3c90x_process_rx_packets - Checks for received packets, reports them to iPXE with netdev_rx() or net...
unsigned char CurrentWindow
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
static void a3c90x_poll(struct net_device *netdev)
a3c90x_poll - Routine that gets called periodically.
static void a3c90x_internal_IssueCommand(int ioaddr, int cmd, int param)
a3c90x_internal_IssueCommand: sends a command to the 3c90x card and waits for it's completion
A PCI device ID list entry.
static void a3c90x_hw_start(struct net_device *netdev)
a3c90x_hw_start - Initialize hardware, copy MAC address to NIC registers, set default receiver
static void a3c90x_reset(struct INF_3C90X *inf_3c90x)
a3c90x_reset: exported function that resets the card to its default state.
#define INT_CMDINPROGRESS
static struct xen_remove_from_physmap * remove
uint16_t vendor
Vendor ID.
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.
volatile unsigned int FrameStartHeader
Network device management.
static int a3c90x_setup_rx_ring(struct INF_3C90X *p)
a3c90x_setup_rx_ring - Allocates RX ring, initialize rx_desc values
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
static void a3c90x_prepare_rx_desc(struct INF_3C90X *p, unsigned int index)
a3c90x_prepare_rx_desc - fills the rx desc with initial data
#define outb(data, io_addr)
static void a3c90x_close(struct net_device *netdev)
a3c90x_close - free()s TX and RX ring, disablex RX/TX, resets NIC
#define ENOBUFS
No buffer space available.
int(* probe)(struct pci_device *pci)
Probe device.
static struct net_device_operations a3c90x_operations
volatile unsigned int DataAddr
void * data
Start of data.
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
struct pci_driver a3c90x_driver __pci_driver
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
if(len >=6 *4) __asm__ __volatile__("movsl" if(len >=5 *4) __asm__ __volatile__("movsl" if(len >=4 *4) __asm__ __volatile__("movsl" if(len >=3 *4) __asm__ __volatile__("movsl" if(len >=2 *4) __asm__ __volatile__("movsl" if(len >=1 *4) __asm__ __volatile__("movsl" if((len % 4) >=2) __asm__ __volatile__("movsw" if((len % 2) >=1) __asm__ __volatile__("movsb" return dest
uint8_t data[48]
Additional event data.
int nvs_read(struct nvs_device *nvs, unsigned int address, void *data, size_t len)
Read from non-volatile storage device.
static void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
static int a3c90x_transmit(struct net_device *netdev, struct io_buffer *iob)
a3c90x_transmit - Transmits a packet.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
#define DBG(...)
Print a debugging message.
volatile unsigned int UpNextPtr
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
#define NULL
NULL pointer (VOID *)
#define PCI_ROM(_vendor, _device, _name, _description, _data)
unsigned int size
Device size (in words)
struct io_buffer * rx_iobuf[RX_RING_SIZE]
void * memset(void *dest, int character, size_t len) __nonnull