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),
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.
static void a3c90x_free_tx_ring(struct INF_3C90X *p)
static int a3c90x_transmit(struct net_device *netdev, struct io_buffer *iob)
a3c90x_transmit - Transmits a packet.
static void a3c90x_internal_WaitForEeprom(struct INF_3C90X *inf_3c90x)
static int a3c90x_setup_rx_ring(struct INF_3C90X *p)
a3c90x_setup_rx_ring - Allocates RX ring, initialize rx_desc values
static void a3c90x_free_rx_iobuf(struct INF_3C90X *p)
static void a3c90x_internal_SetWindow(struct INF_3C90X *inf_3c90x, int window)
a3c90x_internal_SetWindow: selects a register window set.
static int a3c90x_setup_tx_ring(struct INF_3C90X *p)
a3c90x_setup_tx_ring - Allocates TX ring, initialize tx_desc values
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 void a3c90x_free_resources(struct INF_3C90X *p)
static void a3c90x_hw_start(struct net_device *netdev)
a3c90x_hw_start - Initialize hardware, copy MAC address to NIC registers, set default receiver
static int a3c90x_open(struct net_device *netdev)
a3c90x_open - Routine to initialize the card.
static struct net_device_operations a3c90x_operations
static void a3c90x_poll(struct net_device *netdev)
a3c90x_poll - Routine that gets called periodically.
static struct pci_device_id a3c90x_nics[]
static void a3c90x_prepare_rx_desc(struct INF_3C90X *p, unsigned int index)
a3c90x_prepare_rx_desc - fills the rx desc with initial data
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
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 a3c90x_internal_ReadEepromContents(struct INF_3C90X *inf_3c90x)
static void a3c90x_remove(struct pci_device *pci)
a3c90x_remove - Routine to remove the card.
static void a3c90x_irq(struct net_device *netdev, int enable)
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...
static int a3c90x_probe(struct pci_device *pci)
a3c90x_probe: exported routine to probe for the 3c905 card.
static void a3c90x_free_rx_ring(struct INF_3C90X *p)
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...
static void a3c90x_reset(struct INF_3C90X *inf_3c90x)
a3c90x_reset: exported function that resets the card to its default state.
static void a3c90x_close(struct net_device *netdev)
a3c90x_close - free()s TX and RX ring, disablex RX/TX, resets NIC
@ cmdAcknowledgeInterrupt
@ cmdSelectRegisterWindow
@ regResetMediaOptions_3_w
#define INT_CMDINPROGRESS
#define NULL
NULL pointer (VOID *)
struct arbelprm_rc_send_wqe rc
struct arbelprm_completion_with_error error
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" retur dest)
#define assert(condition)
Assert a condition at run-time.
static unsigned long ioaddr
uint8_t data[48]
Additional event data.
uint64_t address
Base address.
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
static struct net_device * netdev
#define __unused
Declare a variable or data structure as unused.
#define DBG(...)
Print a debugging message.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define EINVAL
Invalid argument.
#define ENOMEM
Not enough space.
#define ENOTSUP
Operation not supported.
#define ENOBUFS
No buffer space available.
struct hv_monitor_parameter param[4][32]
Parameters.
#define outb(data, io_addr)
#define outw(data, io_addr)
#define outl(data, io_addr)
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
void * memset(void *dest, int character, size_t len) __nonnull
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
#define iob_put(iobuf, len)
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
void * malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.
void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
Dynamic memory allocation.
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_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.
Network device management.
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.
static void netdev_tx_complete(struct net_device *netdev, struct io_buffer *iobuf)
Complete network transmission.
int nvs_read(struct nvs_device *nvs, unsigned int address, void *data, size_t len)
Read from non-volatile storage device.
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
#define __pci_driver
Declare a PCI driver.
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
#define PCI_ROM(_vendor, _device, _name, _description, _data)
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
#define container_of(ptr, type, field)
Get containing structure.
unsigned char CurrentWindow
struct io_buffer * tx_iobuf[TX_RING_SIZE]
struct io_buffer * rx_iobuf[RX_RING_SIZE]
unsigned short eeprom[0x21]
volatile unsigned int DataAddr
volatile unsigned int UpPktStatus
volatile unsigned int UpNextPtr
volatile unsigned int DataLength
volatile unsigned int DataLength
volatile unsigned int DataAddr
volatile unsigned int FrameStartHeader
volatile unsigned int DnNextPtr
void * data
Start of data.
Network device operations.
A non-volatile storage device.
unsigned int block_size
Data block size (in words)
unsigned int word_len_log2
Word length.
int(* read)(struct nvs_device *nvs, unsigned int address, void *data, size_t len)
Read data from device.
unsigned int size
Device size (in words)
int(* write)(struct nvs_device *nvs, unsigned int address, const void *data, size_t len)
Write data to device.
A PCI device ID list entry.
unsigned long ioaddr
I/O address.
struct device dev
Generic device.
uint16_t vendor
Vendor ID.
uint16_t device
Device ID.
int(* probe)(struct pci_device *pci)
Probe device.
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
static struct xen_remove_from_physmap * remove