7#define LINUX_OUT_MACROS
16#define virt_to_le32desc(addr) cpu_to_le32(virt_to_bus(addr))
17#define le32desc_to_virt(addr) bus_to_virt(le32_to_cpu(addr))
22#define PKT_BUF_SZ 1536
40#define TD_STDFLAGS TD_LASTDESC
49#define delay(nanosec) do { int _i = 3; while (--_i > 0) \
50 { __SLOW_DOWN_IO; }} while (0)
57 unsigned int type,
unsigned int len,
const char *
data);
61static int mii_read(
int phy_id,
int location);
86static unsigned short eeprom[64];
97#define epic100_bufs NIC_FAKE_BSS ( struct epic100_bss )
98#define rx_ring epic100_bufs.rx_ring
99#define tx_ring epic100_bufs.tx_ring
100#define rx_packet epic100_bufs.rx_packet
101#define tx_packet epic100_bufs.tx_packet
113 unsigned int phy, phy_idx;
164 for (i = 0; i < 16; i++) {
170 unsigned short sum = 0;
171 unsigned short value;
172 for (i = 0; i < 64; i++) {
180 printf(
"EEPROM contents\n");
181 for (i = 0; i < 64; i++) {
189 for (i = 0; i < 3; i++)
195 for (phy = 0, phy_idx = 0; phy < 32 && phy_idx <
sizeof(
phys); phy++) {
198 if (mii_status != 0xffff && mii_status != 0x0000) {
199 phys[phy_idx++] = phy;
201 printf(
"MII transceiver found at address %d.\n", phy);
207 printf(
"***WARNING***: No MII transceiver found!\n");
221 unsigned char mc_filter[8];
223 memset(mc_filter, 0xff,
sizeof(mc_filter));
225 for(i = 0; i < 4; i++)
226 outw(((
unsigned short *)mc_filter)[i],
mc0 + i*4);
246 if (mii_reg5 != 0xffff && (mii_reg5 & 0x0100)) {
247 printf(
" full-duplex mode");
307 unsigned int len,
const char *
data)
309 unsigned short nstype;
318 printf(
"eth_transmit: Unable to transmit. status=%4.4lx. Resetting...\n",
330 memcpy(txp + 12, (
char*)&nstype, 2);
359 printf(
"Oops, transmitter timeout, status=%4.4lX\n",
386 if ( ! retrieve )
return 1;
392 printf(
"epic_poll: entry %d status %hX\n", entry,
status);
397 printf(
"epic_poll: Giant packet\n");
399 }
else if (
status & 0x0006) {
401 printf(
"epic_poll: Frame received with errors\n");
444#define EE_SHIFT_CLK 0x04
446#define EE_DATA_WRITE 0x08
447#define EE_WRITE_0 0x01
448#define EE_WRITE_1 0x09
449#define EE_DATA_READ 0x10
450#define EE_ENB (0x0001 | EE_CS)
453#define EE_WRITE_CMD (5 << 6)
454#define EE_READ_CMD (6 << 6)
455#define EE_ERASE_CMD (7 << 6)
457#define eeprom_delay(n) delay(n)
470 for (i = 10; i >= 0; i--) {
481 for (i = 16; i > 0; i--) {
507 for (i = 4000; i > 0; i--)
522PCI_ROM(0x10b8, 0x0005,
"epic100",
"SMC EtherPowerII", 0),
523PCI_ROM(0x10b8, 0x0006,
"smc-83c175",
"SMC EPIC/C 83c175", 0),
pseudo_bit_t value[0x00020]
#define COMMAND(name, exec)
int putchar(int character)
Write a single character to each console device.
static unsigned long ioaddr
static int read_eeprom(unsigned long ioaddr, int location, int addr_len)
uint32_t type
Operating system type.
uint8_t data[48]
Additional event data.
static struct pci_device_id epic100_nics[]
static unsigned int cur_rx
static int epic100_poll(struct nic *nic, int retrieve)
#define virt_to_le32desc(addr)
static void epic100_irq(struct nic *nic, irq_action_t action)
static void epic100_disable(struct nic *nic, void *hwdev)
static int mii_read(int phy_id, int location)
static void set_rx_mode(void)
static void epic100_transmit(struct nic *nic, const char *destaddr, unsigned int type, unsigned int len, const char *data)
static void epic100_init_ring(void)
static signed char phys[4]
static void epic100_open(void)
static unsigned int cur_tx
static struct nic_operations epic100_operations
static int epic100_probe(struct nic *nic, struct pci_device *pci)
#define GC_RX_FIFO_THR_64
#define TC_EARLY_TX_ENABLE
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
#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 le32_to_cpu(value)
#define cpu_to_le32(value)
#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 * memcpy(void *dest, const void *src, size_t len) __nonnull
void * memset(void *dest, int character, size_t len) __nonnull
int dummy_connect(struct nic *nic __unused)
#define DRIVER(_name_text, _unused2, _unused3, _name, _probe, _disable, _fake_bss)
#define PCI_DRIVER(_name, _ids, _class)
static struct command_descriptor read_cmd
"read" command descriptor
#define PCI_ROM(_vendor, _device, _name, _description, _data)
struct epic_tx_desc tx_ring[TX_RING_SIZE]
struct epic_rx_desc rx_ring[RX_RING_SIZE]
unsigned char tx_packet[PKT_BUF_SZ *TX_RING_SIZE]
unsigned char rx_packet[PKT_BUF_SZ *RX_RING_SIZE]
unsigned char * node_addr
struct nic_operations * nic_op
A PCI device ID list entry.
unsigned long ioaddr
I/O address.
unsigned long currticks(void)
Get current system time in ticks.
int printf(const char *fmt,...)
Write a formatted string to the console.