2 #error multicast support is not yet implemented 51 #define TX_TIME_OUT 2*TICKS_PER_SEC 61 #define EEPROM_ADDRLEN 6 62 #define EEPROM_SIZE 32 70 #define EE_WRITE_CMD (5 << addr_len) 71 #define EE_READ_CMD (6 << addr_len) 72 #define EE_ERASE_CMD (7 << addr_len) 75 #define EE_SHIFT_CLK 0x02 77 #define EE_DATA_WRITE 0x04 78 #define EE_WRITE_0 0x01 79 #define EE_WRITE_1 0x05 80 #define EE_DATA_READ 0x08 81 #define EE_ENB (0x4800 | EE_CS) 84 #define PHY_DATA_0 0x0 85 #define PHY_DATA_1 0x20000 86 #define MDCLKH 0x10000 91 #define eeprom_delay() inl(ee_addr) 143 #define txd davicom_bufs.txd 144 #define txb davicom_bufs.txb 145 #define rxd davicom_bufs.rxd 146 #define rxb davicom_bufs.rxb 154 static void whereami(
const char *str);
160 unsigned int s,
const char *p);
217 for (i=0x10; i>0; i=i>>1)
221 for (i=0x10; i>0; i=i>>1)
228 for (phy_data=0, i=0; i<16; i++) {
261 for (i=0x10; i>0; i=i>>1)
265 for (i=0x10; i>0; i=i>>1)
273 for (i=0x8000; i>0; i>>=1)
283 outl(phy_data, ee_addr);
287 outl(phy_data, ee_addr);
300 outl(0x50000, ee_addr);
303 phy_data=(
inl(ee_addr)>>19) & 0x1;
305 outl(0x40000, ee_addr);
317 if ( (
phy_read(3) & 0xfff0) == 0xb900 ) {
338 unsigned long to, csr6;
343 #define PCI_VENDOR_ID_DAVICOM 0x1282 344 #define PCI_DEVICE_ID_DM9009 0x9009 354 if ( (
phy_read(1) & 0x24) == 0x24 ) {
380 unsigned short retval = 0;
390 for (i = 4 + addr_len; i >= 0; i--) {
399 for (i = 16; i > 0; i--) {
423 for (i=0; i<
NTXD; i++) {
428 txd[i].control = 0x184;
429 txd[i].status = 0x00000000;
434 for (i=0; i<192; i++)
txb[i] = 0xFF;
443 for (i=0; i<
NRXD; i++) {
448 rxd[i].control = 0x4;
449 rxd[i].status = 0x80000000;
506 DBG (
"TX Setup Timeout!\n");
526 unsigned int s,
const char *p)
555 DBG (
"TX Timeout!\n");
573 if ( ! retrieve )
return 1;
667 for (i = 0; i <
sizeof(
ee_data)/2; i++)
668 ((
unsigned short *)
ee_data)[i] =
692 PCI_ROM(0x1282, 0x9009,
"davicom9009",
"Davicom 9009", 0),
693 PCI_ROM(0x1282, 0x9100,
"davicom9100",
"Davicom 9100", 0),
694 PCI_ROM(0x1282, 0x9102,
"davicom9102",
"Davicom 9102", 0),
695 PCI_ROM(0x1282, 0x9132,
"davicom9132",
"Davicom 9132", 0),
static int read_eeprom(unsigned long ioaddr, int location, int addr_len)
PCI_DRIVER(davicom_driver, davicom_nics, PCI_NO_CLASS)
#define TICKS_PER_SEC
Number of ticks per second.
static void phy_write_1bit(u32, u32)
const unsigned char * buf1addr
static void phy_write(int, u16)
static void HPNA_process(void)
unsigned long ioaddr
I/O address.
static unsigned short vendor
static unsigned char ee_data[EEPROM_SIZE]
static int davicom_poll(struct nic *nic, int retrieve)
static void davicom_disable(struct nic *nic)
static void whereami(const char *str)
int dummy_connect(struct nic *nic __unused)
DRIVER("DAVICOM", nic_driver, pci_driver, davicom_driver, davicom_probe, davicom_disable)
volatile unsigned long status
static unsigned long ioaddr
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
uint16_t device
Device ID.
#define __unused
Declare a variable or data structure as unused.
static struct pci_device_id davicom_nics[]
static struct nic_operations davicom_operations
A 16-bit general register.
#define PCI_DEVICE_ID_DM9009
#define outl(data, io_addr)
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
static void davicom_irq(struct nic *nic __unused, irq_action_t action __unused)
A PCI device ID list entry.
#define le16_to_cpu(value)
uint16_t vendor
Vendor ID.
unsigned char * node_addr
static void davicom_media_chk(struct nic *)
static int davicom_probe(struct nic *nic, struct pci_device *pci)
static void davicom_wait(unsigned int nticks)
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
int pci_write_config_dword(struct pci_device *pci, unsigned int where, uint32_t value)
Write 32-bit dword to PCI configuration space.
static unsigned short dev_id
volatile unsigned long status
unsigned long currticks(void)
Get current system time in ticks.
#define DBG(...)
Print a debugging message.
struct nic_operations * nic_op
static void davicom_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p)
#define PCI_VENDOR_ID_DAVICOM
static int phy_read_1bit(u32)
static struct command_descriptor read_cmd
"read" command descriptor
int(* connect)(struct nic *)
#define PCI_ROM(_vendor, _device, _name, _description, _data)
static void davicom_reset(struct nic *nic)
static void davicom_init_chain(struct nic *nic)
const unsigned char * buf2addr