2 #error multicast support is not yet implemented 32 #define LINUX_OUT_MACROS 1 33 #define SMC9000_DEBUG 0 36 #define PRINTK2 printf 38 #define PRINTK2(args...) 82 for (i = 0; i < 32; ++i)
95 for (i = 0; i < 5; ++i)
108 for (i = 0; i < 5; ++i)
127 for (i = 0; i < 16; ++i)
146 for (i = 0; i <
sizeof(
bits); ++i)
169 for (i = 0; i < 16; ++i)
178 printf(
"smc_read_phy_register(): phyaddr=%x,phyreg=%x,phydata=%x\n",
179 phyaddr, phyreg, phydata);
190 byte phyaddr,
byte phyreg,
word phydata)
200 for (i = 0; i < 32; ++i)
213 for (i = 0; i < 5; ++i)
226 for (i = 0; i < 5; ++i)
243 for (i = 0; i < 16; ++i)
270 for (i = 0; i <
sizeof(
bits); ++i)
292 printf(
"smc_write_phy_register(): phyaddr=%x,phyreg=%x,phydata=%x\n",
293 phyaddr, phyreg, phydata);
309 for (phyaddr = 0; phyaddr < 32; ++phyaddr)
316 if ((phy_id2 > 0x0000) && (phy_id2 < 0xffff) &&
317 (phy_id1 > 0x0000) && (phy_id1 < 0xffff))
319 if ((phy_id1 != 0x8000) && (phy_id2 != 0x8000))
336 if ( (phy_id1 == 0x0016) && ((phy_id2 & 0xFFF0) == 0xF840 ) )
338 printf(
"PHY=LAN83C183 (LAN91C111 Internal)\n");
341 if ( (phy_id1 == 0x0282) && ((phy_id2 & 0xFFF0) == 0x1C50) )
343 printf(
"PHY=LAN83C180\n");
388 PRINTK2(
"PHY reset timed out\n");
428 PRINTK2(
"phy caps=%x\n", my_phy_caps);
429 PRINTK2(
"phy advertised caps=%x\n", my_ad_caps);
453 PRINTK2(
"PHY remote fault detected\n");
456 PRINTK2(
"PHY restarting auto-negotiation\n");
465 PRINTK2(
"PHY auto-negotiate timed out\n");
471 PRINTK2(
"PHY remote fault detected\n");
560 word revision_register;
561 word base_address_register;
565 if ((bank & 0xFF00) != 0x3300) {
572 if ((bank & 0xFF00) != 0x3300) {
582 if (
ioaddr != (base_address_register >> 3 & 0x3E0)) {
583 DBG(
"SMC9000: IOADDR %hX doesn't match configuration (%hX)." 584 "Probably not a SMC chip\n",
585 ioaddr, base_address_register >> 3 & 0x3E0);
597 if (!
chip_ids[(revision_register >> 4) & 0xF]) {
599 DBG(
"SMC9000: IO %hX: Unrecognized revision register:" 600 " %hX, Contact author.\n",
ioaddr, revision_register );
623 unsigned long time_out;
635 DBG(
"SMC9000: Far too big packet error. \n");
660 printf(
"SMC9000: Memory allocation timed out, resetting MMU.\n");
667 if (packet_no & 0x80) {
669 printf(
"SMC9000: Memory allocation failed. \n");
679 #if SMC9000_DEBUG > 2 680 printf(
"Trying to xmit packet of length %hX\n",
length );
734 DBG(
"SMC9000: TX FAIL STATUS: %hX \n", tx_status);
748 printf(
"SMC9000: TX timed out, resetting board\n");
762 if ( ! retrieve )
return 1;
774 #if SMC9000_DEBUG > 2 775 printf(
" Reading %d words (and %d byte(s))\n",
789 printf(
"SMC9000: RX error\n");
838 const char * version_string;
839 const char * if_string;
849 for ( i = 0; i < 6; i += 2 ) {
878 if ( !version_string ) {
896 DBG(
"Copyright (C) 1998 Daniel Engstr\x94m\n");
897 DBG(
"Copyright (C) 1996 Eric Stahlman\n");
899 printf(
"%s rev:%d I/O port:%hX Interface:%s RAM:%d bytes \n",
917 else if (
media == 2 ) {
934 0x200, 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x2E0,
935 0x300, 0x320, 0x340, 0x360, 0x380, 0x3A0, 0x3C0, 0x3E0,
944 ISA_ROM (
"smc9000",
"SMC9000" );
static isa_probe_addr_t smc9000_probe_addrs[]
#define PHY_STAT_ANEG_ACK
uint16_t ioaddr
I/O address.
#define TICKS_PER_SEC
Number of ticks per second.
int printf(const char *fmt,...)
Write a formatted string to the console.
uint16_t inw(volatile uint16_t *io_addr)
Read 16-bit word from I/O-mapped device.
static void smc9000_disable(struct nic *nic, struct isa_device *isa __unused)
#define outw(data, io_addr)
static const char * chip_ids[15]
uint64_t address
Base address.
void outsw(volatile uint16_t *io_addr, const uint16_t *data, unsigned int count)
Write 16-bit words to I/O-mapped device.
static int smc9000_probe_addr(isa_probe_addr_t ioaddr)
#define PHY_CNTL_ANEG_RST
int dummy_connect(struct nic *nic __unused)
#define SMC_SELECT_BANK(x, y)
static int smc9000_poll(struct nic *nic, int retrieve)
static unsigned long ioaddr
static void smc9000_irq(struct nic *nic __unused, irq_action_t action __unused)
static void smc_reset(int ioaddr)
ISA_DRIVER(smc9000_driver, smc9000_probe_addrs, smc9000_probe_addr, GENERIC_ISAPNP_VENDOR, 0x8228)
#define __unused
Declare a variable or data structure as unused.
uint16_t isa_probe_addr_t
#define GENERIC_ISAPNP_VENDOR
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
uint32_t revision
Entry point revision.
static int smc_detect_phy(int ioaddr, byte *pphyaddr)
static const char * interfaces[2]
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
ISA_ROM("smc9000", "SMC9000")
void insw(volatile uint16_t *io_addr, uint16_t *data, unsigned int count)
Read 16-bit words from I/O-mapped device.
static void smc_phy_configure(int ioaddr)
uint8_t inb(volatile uint8_t *io_addr)
Read byte from I/O-mapped device.
static void smc9000_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p)
static const char smc91c96_id[]
static void smc_write_phy_register(int ioaddr, byte phyaddr, byte phyreg, word phydata)
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
unsigned char * node_addr
static volatile void * bits
static word smc_read_phy_register(int ioaddr, byte phyaddr, byte phyreg)
DRIVER("SMC9000", nic_driver, isa_driver, smc9000_driver, smc9000_probe, smc9000_disable)
unsigned long currticks(void)
Get current system time in ticks.
#define DBG(...)
Print a debugging message.
struct nic_operations * nic_op
static int smc9000_probe(struct nic *nic, struct isa_device *isa)
int(* connect)(struct nic *)
#define NULL
NULL pointer (VOID *)
static struct nic_operations smc9000_operations
static const char smc9000_version[]