iPXE
Data Structures | Macros | Enumerations | Functions | Variables
tulip.c File Reference
#include "etherboot.h"
#include "nic.h"
#include <ipxe/ethernet.h>
#include <ipxe/pci.h>

Go to the source code of this file.

Data Structures

struct  pci_id_info
 
struct  pci_id_info::match_info
 
struct  tulip_chip_table
 
struct  medialeaf
 
struct  mediatable
 
struct  mediainfo
 
struct  tulip_rx_desc
 
struct  tulip_tx_desc
 
struct  tulip_private
 
struct  fixups
 

Macros

#define TX_TIME_OUT   2*TICKS_PER_SEC
 
#define get_unaligned(ptr)   (*(ptr))
 
#define put_unaligned(val, ptr)   ((void)( *(ptr) = (val) ))
 
#define get_u16(ptr)   (*(u16 *)(ptr))
 
#define virt_to_le32desc(addr)   virt_to_bus(addr)
 
#define TULIP_IOTYPE   PCI_USES_MASTER | PCI_USES_IO | PCI_ADDR0
 
#define TULIP_SIZE   0x80
 
#define FULL_DUPLEX_MAGIC   0x6969
 
#define MEDIA_MASK   31
 
#define EEPROM_ADDRLEN   6
 
#define EEPROM_SIZE   128 /* 2 << EEPROM_ADDRLEN */
 
#define EE_WRITE_CMD   (5 << addr_len)
 
#define EE_READ_CMD   (6 << addr_len)
 
#define EE_ERASE_CMD   (7 << addr_len)
 
#define EE_SHIFT_CLK   0x02 /* EEPROM shift clock. */
 
#define EE_CS   0x01 /* EEPROM chip select. */
 
#define EE_DATA_WRITE   0x04 /* EEPROM chip data in. */
 
#define EE_WRITE_0   0x01
 
#define EE_WRITE_1   0x05
 
#define EE_DATA_READ   0x08 /* EEPROM chip data out. */
 
#define EE_ENB   (0x4800 | EE_CS)
 
#define eeprom_delay()   inl(ee_addr)
 
#define BUFLEN   1536
 
#define DESC_RING_WRAP   0x02000000
 
#define TX_RING_SIZE   2
 
#define RX_RING_SIZE   4
 
#define tx_ring   tulip_bss.tx_ring
 
#define txb   tulip_bss.txb
 
#define rx_ring   tulip_bss.rx_ring
 
#define rxb   tulip_bss.rxb
 
#define mdio_delay()   inl(mdio_addr)
 
#define MDIO_SHIFT_CLK   0x10000
 
#define MDIO_DATA_WRITE0   0x00000
 
#define MDIO_DATA_WRITE1   0x20000
 
#define MDIO_ENB   0x00000 /* Ignore the 0x02000 databook setting. */
 
#define MDIO_ENB_IN   0x40000
 
#define MDIO_DATA_READ   0x80000
 

Enumerations

enum  tulip_chips {
  DC21040 =0, DC21041 =1, DC21140 =2, DC21142 =3,
  DC21143 =3, LC82C168, MX98713, MX98715,
  MX98725, AX88141, AX88140, PNIC2,
  COMET, COMPEX9881, I21145, XIRCOM,
  SGThomson
}
 
enum  pci_id_flags_bits {
  PCI_USES_IO = 1, PCI_USES_MEM = 2, PCI_USES_MASTER = 4, PCI_ADDR0 = 0 << 4,
  PCI_ADDR1 = 1 << 4, PCI_ADDR2, PCI_ADDR3 = 3 << 4, PCI_USES_IO =1,
  PCI_USES_MEM =2, PCI_USES_MASTER =4, PCI_ADDR0 =0<<4, PCI_ADDR1 =1<<4,
  PCI_ADDR2 =2<<4, PCI_ADDR3 =3<<4, PCI_ADDR_64BITS =0x100, PCI_NO_ACPI_WAKE =0x200,
  PCI_NO_MIN_LATENCY =0x400, PCI_UNUSED_IRQ =0x800
}
 
enum  tbl_flag {
  HAS_MII =1, HAS_MEDIA_TABLE =2, CSR12_IN_SROM =4, ALWAYS_CHECK_MII =8,
  HAS_PWRDWN =0x10, MC_HASH_ONLY =0x20, HAS_PNICNWAY =0x80, HAS_NWAY =0x40,
  HAS_INTR_MITIGATION =0x100, IS_ASIX =0x200, HAS_8023X =0x400
}
 
enum  MediaIs {
  MediaIsFD = 1, MediaAlwaysFD =2, MediaIsMII =4, MediaIsFx =8,
  MediaIs100 =16
}
 
enum  tulip_offsets {
  CSR0 =0, CSR1 =0x08, CSR2 =0x10, CSR3 =0x18,
  CSR4 =0x20, CSR5 =0x28, CSR6 =0x30, CSR7 =0x38,
  CSR8 =0x40, CSR9 =0x48, CSR10 =0x50, CSR11 =0x58,
  CSR12 =0x60, CSR13 =0x68, CSR14 =0x70, CSR15 =0x78,
  CSR16 =0x80, CSR20 =0xA0
}
 
enum  status_bits {
  TimerInt =0x800, TPLnkFail =0x1000, TPLnkPass =0x10, NormalIntr =0x10000,
  AbnormalIntr =0x8000, RxJabber =0x200, RxDied =0x100, RxNoBuf =0x80,
  RxIntr =0x40, TxFIFOUnderflow =0x20, TxJabber =0x08, TxNoBuf =0x04,
  TxDied =0x02, TxIntr =0x01
}
 
enum  csr6_mode_bits {
  TxOn =0x2000, RxOn =0x0002, FullDuplex =0x0200, AcceptBroadcast =0x0100,
  AcceptAllMulticast =0x0080, AcceptAllPhys =0x0040, AcceptRunt =0x0008
}
 
enum  desc_status_bits {
  DescOwn = 0x8000, DescEndPacket = 0x4000, DescEndRing = 0x2000, LastFrag = 0x80000000,
  DescIntrOnTx = 0x8000, DescIntrOnDMADone = 0x80000000, DisableAlign = 0x00000001, DescOwnded =0x80000000,
  RxDescFatalErr =0x8000, RxWholePkt =0x0300, DescOwn =0x80000000, DescEndRing =0x02000000,
  DescUseLink =0x01000000, DescWholePkt =0x60000000, DescStartPkt =0x20000000, DescEndPkt =0x40000000,
  DescIntr =0x80000000
}
 

Functions

 FILE_LICENCE (GPL_ANY)
 
static int mdio_read (struct nic *nic, int phy_id, int location)
 
static void mdio_write (struct nic *nic, int phy_id, int location, int value)
 
static int read_eeprom (unsigned long ioaddr, int location, int addr_len)
 
static void parse_eeprom (struct nic *nic)
 
static int tulip_probe (struct nic *nic, struct pci_device *pci)
 
static void tulip_init_ring (struct nic *nic)
 
static void tulip_reset (struct nic *nic)
 
static void tulip_transmit (struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p)
 
static int tulip_poll (struct nic *nic, int retrieve)
 
static void tulip_disable (struct nic *nic)
 
static void nway_start (struct nic *nic)
 
static void pnic_do_nway (struct nic *nic)
 
static void select_media (struct nic *nic, int startup)
 
static void init_media (struct nic *nic)
 
static void start_link (struct nic *nic)
 
static int tulip_check_duplex (struct nic *nic)
 
static void tulip_wait (unsigned int nticks)
 
static void whereami (const char *str)
 
int mdio_read (struct nic *nic __unused, int phy_id, int location)
 
void mdio_write (struct nic *nic __unused, int phy_id, int location, int value)
 
static void tulip_init_ring (struct nic *nic __unused)
 
static void set_rx_mode (struct nic *nic __unused)
 
static void tulip_irq (struct nic *nic __unused, irq_action_t action __unused)
 
static void nway_start (struct nic *nic __unused)
 
static void pnic_do_nway (struct nic *nic __unused)
 
 PCI_DRIVER (tulip_driver, tulip_nics, PCI_NO_CLASS)
 
 DRIVER ("Tulip", nic_driver, pci_driver, tulip_driver, tulip_probe, tulip_disable)
 

Variables

static const int csr0 = 0x01A00000 | 0x8000
 
static const char *const medianame [32]
 
static const struct pci_id_info pci_id_tbl []
 
static struct tulip_chip_table tulip_tbl []
 
static const char media_cap [32]
 
static u8 t21040_csr13 [] = {2,0x0C,8,4, 4,0,0,0, 0,0,0,0, 4,0,0,0}
 
static u16 t21041_csr13 [] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, }
 
static u16 t21041_csr14 [] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, }
 
static u16 t21041_csr15 [] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, }
 
static u16 t21142_csr14 [] = { 0xFFFF, 0x0705, 0x0705, 0x0000, 0x7F3D, }
 
static u32 ioaddr
 
struct {
   struct tulip_tx_desc   tx_ring [TX_RING_SIZE]
 
   unsigned char   txb [BUFLEN]
 
   struct tulip_rx_desc   rx_ring [RX_RING_SIZE]
 
   unsigned char   rxb [RX_RING_SIZE *BUFLEN]
 
   struct tulip_private   tpx
 
__shared
 
static struct tulip_privatetp
 
static struct fixups eeprom_fixups []
 
static const char * block_name []
 
static struct nic_operations tulip_operations
 
static struct pci_device_id tulip_nics []
 

Macro Definition Documentation

◆ TX_TIME_OUT

#define TX_TIME_OUT   2*TICKS_PER_SEC

Definition at line 119 of file tulip.c.

◆ get_unaligned

#define get_unaligned (   ptr)    (*(ptr))

Definition at line 123 of file tulip.c.

◆ put_unaligned

#define put_unaligned (   val,
  ptr 
)    ((void)( *(ptr) = (val) ))

Definition at line 124 of file tulip.c.

◆ get_u16

#define get_u16 (   ptr)    (*(u16 *)(ptr))

Definition at line 125 of file tulip.c.

◆ virt_to_le32desc

#define virt_to_le32desc (   addr)    virt_to_bus(addr)

Definition at line 126 of file tulip.c.

◆ TULIP_IOTYPE

#define TULIP_IOTYPE   PCI_USES_MASTER | PCI_USES_IO | PCI_ADDR0

Definition at line 128 of file tulip.c.

◆ TULIP_SIZE

#define TULIP_SIZE   0x80

Definition at line 129 of file tulip.c.

◆ FULL_DUPLEX_MAGIC

#define FULL_DUPLEX_MAGIC   0x6969

Definition at line 135 of file tulip.c.

◆ MEDIA_MASK

#define MEDIA_MASK   31

Definition at line 140 of file tulip.c.

◆ EEPROM_ADDRLEN

#define EEPROM_ADDRLEN   6

Definition at line 342 of file tulip.c.

◆ EEPROM_SIZE

#define EEPROM_SIZE   128 /* 2 << EEPROM_ADDRLEN */

Definition at line 343 of file tulip.c.

◆ EE_WRITE_CMD

#define EE_WRITE_CMD   (5 << addr_len)

Definition at line 346 of file tulip.c.

◆ EE_READ_CMD

#define EE_READ_CMD   (6 << addr_len)

Definition at line 347 of file tulip.c.

◆ EE_ERASE_CMD

#define EE_ERASE_CMD   (7 << addr_len)

Definition at line 348 of file tulip.c.

◆ EE_SHIFT_CLK

#define EE_SHIFT_CLK   0x02 /* EEPROM shift clock. */

Definition at line 351 of file tulip.c.

◆ EE_CS

#define EE_CS   0x01 /* EEPROM chip select. */

Definition at line 352 of file tulip.c.

◆ EE_DATA_WRITE

#define EE_DATA_WRITE   0x04 /* EEPROM chip data in. */

Definition at line 353 of file tulip.c.

◆ EE_WRITE_0

#define EE_WRITE_0   0x01

Definition at line 354 of file tulip.c.

◆ EE_WRITE_1

#define EE_WRITE_1   0x05

Definition at line 355 of file tulip.c.

◆ EE_DATA_READ

#define EE_DATA_READ   0x08 /* EEPROM chip data out. */

Definition at line 356 of file tulip.c.

◆ EE_ENB

#define EE_ENB   (0x4800 | EE_CS)

Definition at line 357 of file tulip.c.

◆ eeprom_delay

#define eeprom_delay ( )    inl(ee_addr)

Definition at line 362 of file tulip.c.

◆ BUFLEN

#define BUFLEN   1536

Definition at line 365 of file tulip.c.

◆ DESC_RING_WRAP

#define DESC_RING_WRAP   0x02000000

Definition at line 374 of file tulip.c.

◆ TX_RING_SIZE

#define TX_RING_SIZE   2

Definition at line 427 of file tulip.c.

◆ RX_RING_SIZE

#define RX_RING_SIZE   4

Definition at line 428 of file tulip.c.

◆ tx_ring

#define tx_ring   tulip_bss.tx_ring

Definition at line 436 of file tulip.c.

◆ txb

#define txb   tulip_bss.txb

Definition at line 437 of file tulip.c.

◆ rx_ring

#define rx_ring   tulip_bss.rx_ring

Definition at line 438 of file tulip.c.

◆ rxb

#define rxb   tulip_bss.rxb

Definition at line 439 of file tulip.c.

◆ mdio_delay

#define mdio_delay ( )    inl(mdio_addr)

Definition at line 538 of file tulip.c.

◆ MDIO_SHIFT_CLK

#define MDIO_SHIFT_CLK   0x10000

Definition at line 543 of file tulip.c.

◆ MDIO_DATA_WRITE0

#define MDIO_DATA_WRITE0   0x00000

Definition at line 544 of file tulip.c.

◆ MDIO_DATA_WRITE1

#define MDIO_DATA_WRITE1   0x20000

Definition at line 545 of file tulip.c.

◆ MDIO_ENB

#define MDIO_ENB   0x00000 /* Ignore the 0x02000 databook setting. */

Definition at line 546 of file tulip.c.

◆ MDIO_ENB_IN

#define MDIO_ENB_IN   0x40000

Definition at line 547 of file tulip.c.

◆ MDIO_DATA_READ

#define MDIO_DATA_READ   0x80000

Definition at line 548 of file tulip.c.

Enumeration Type Documentation

◆ tulip_chips

Enumerator
DC21040 
DC21041 
DC21140 
DC21142 
DC21143 
LC82C168 
MX98713 
MX98715 
MX98725 
AX88141 
AX88140 
PNIC2 
COMET 
COMPEX9881 
I21145 
XIRCOM 
SGThomson 

Definition at line 150 of file tulip.c.

150  {
151  DC21040=0, DC21041=1, DC21140=2, DC21142=3, DC21143=3,
153  COMPEX9881, I21145, XIRCOM, SGThomson, /*Ramesh Chander*/
154 };
Definition: tulip.c:151
Definition: tulip.c:152
Definition: tulip.c:152
Definition: tulip.c:152
Definition: tulip.c:153
Definition: tulip.c:152
Definition: tulip.c:152
Definition: tulip.c:151
Definition: tulip.c:153
Definition: tulip.c:151
Definition: tulip.c:152
Definition: tulip.c:151
Definition: tulip.c:152
Definition: tulip.c:151

◆ pci_id_flags_bits

Enumerator
PCI_USES_IO 
PCI_USES_MEM 
PCI_USES_MASTER 
PCI_ADDR0 
PCI_ADDR1 
PCI_ADDR2 
PCI_ADDR3 
PCI_USES_IO 
PCI_USES_MEM 
PCI_USES_MASTER 
PCI_ADDR0 
PCI_ADDR1 
PCI_ADDR2 
PCI_ADDR3 
PCI_ADDR_64BITS 
PCI_NO_ACPI_WAKE 
PCI_NO_MIN_LATENCY 
PCI_UNUSED_IRQ 

Definition at line 156 of file tulip.c.

156  {
157  /* Set PCI command register bits before calling probe1(). */
159  /* Read and map the single following PCI BAR. */
160  PCI_ADDR0=0<<4, PCI_ADDR1=1<<4, PCI_ADDR2=2<<4, PCI_ADDR3=3<<4,
162  PCI_UNUSED_IRQ=0x800,
163 };

◆ tbl_flag

enum tbl_flag
Enumerator
HAS_MII 
HAS_MEDIA_TABLE 
CSR12_IN_SROM 
ALWAYS_CHECK_MII 
HAS_PWRDWN 
MC_HASH_ONLY 
HAS_PNICNWAY 
HAS_NWAY 
HAS_INTR_MITIGATION 
IS_ASIX 
HAS_8023X 

Definition at line 234 of file tulip.c.

234  {
236  HAS_PWRDWN=0x10, MC_HASH_ONLY=0x20, /* Hash-only multicast filter. */
237  HAS_PNICNWAY=0x80, HAS_NWAY=0x40, /* Uses internal NWay xcvr. */
238  HAS_INTR_MITIGATION=0x100, IS_ASIX=0x200, HAS_8023X=0x400,
239 };
Definition: tulip.c:235
Definition: tulip.c:238

◆ MediaIs

enum MediaIs
Enumerator
MediaIsFD 
MediaAlwaysFD 
MediaIsMII 
MediaIsFx 
MediaIs100 

Definition at line 271 of file tulip.c.

271  {
273  MediaIs100=16};

◆ tulip_offsets

Enumerator
CSR0 
CSR1 
CSR2 
CSR3 
CSR4 
CSR5 
CSR6 
CSR7 
CSR8 
CSR9 
CSR10 
CSR11 
CSR12 
CSR13 
CSR14 
CSR15 
CSR16 
CSR20 

Definition at line 294 of file tulip.c.

294  {
295  CSR0=0, CSR1=0x08, CSR2=0x10, CSR3=0x18, CSR4=0x20, CSR5=0x28,
296  CSR6=0x30, CSR7=0x38, CSR8=0x40, CSR9=0x48, CSR10=0x50, CSR11=0x58,
297  CSR12=0x60, CSR13=0x68, CSR14=0x70, CSR15=0x78, CSR16=0x80, CSR20=0xA0
298 };
Definition: tulip.c:295
Definition: tulip.c:295
Definition: tulip.c:297
Definition: tulip.c:295
Definition: tulip.c:295
Definition: tulip.c:296
Definition: tulip.c:295
Definition: tulip.c:296
Definition: tulip.c:297
Definition: tulip.c:296
Definition: tulip.c:295
Definition: tulip.c:297
Definition: tulip.c:297
Definition: tulip.c:296
Definition: tulip.c:296
Definition: tulip.c:296
Definition: tulip.c:297
Definition: tulip.c:297

◆ status_bits

Enumerator
TimerInt 
TPLnkFail 
TPLnkPass 
NormalIntr 
AbnormalIntr 
RxJabber 
RxDied 
RxNoBuf 
RxIntr 
TxFIFOUnderflow 
TxJabber 
TxNoBuf 
TxDied 
TxIntr 

Definition at line 301 of file tulip.c.

301  {
302  TimerInt=0x800, TPLnkFail=0x1000, TPLnkPass=0x10,
303  NormalIntr=0x10000, AbnormalIntr=0x8000,
304  RxJabber=0x200, RxDied=0x100, RxNoBuf=0x80, RxIntr=0x40,
305  TxFIFOUnderflow=0x20, TxJabber=0x08, TxNoBuf=0x04, TxDied=0x02, TxIntr=0x01,
306 };
Definition: tulip.c:304
Definition: tulip.c:304
Definition: tulip.c:305
Definition: tulip.c:305
Definition: tulip.c:305
Definition: tulip.c:304

◆ csr6_mode_bits

Enumerator
TxOn 
RxOn 
FullDuplex 
AcceptBroadcast 
AcceptAllMulticast 
AcceptAllPhys 
AcceptRunt 

Definition at line 309 of file tulip.c.

309  {
310  TxOn=0x2000, RxOn=0x0002, FullDuplex=0x0200,
311  AcceptBroadcast=0x0100, AcceptAllMulticast=0x0080,
312  AcceptAllPhys=0x0040, AcceptRunt=0x0008,
313 };
Definition: tulip.c:310
Definition: tulip.c:310

◆ desc_status_bits

Enumerator
DescOwn 
DescEndPacket 
DescEndRing 
LastFrag 
DescIntrOnTx 
DescIntrOnDMADone 
DisableAlign 
DescOwnded 
RxDescFatalErr 
RxWholePkt 
DescOwn 
DescEndRing 
DescUseLink 
DescWholePkt 
DescStartPkt 
DescEndPkt 
DescIntr 

Definition at line 316 of file tulip.c.

316  {
317  DescOwnded=0x80000000, RxDescFatalErr=0x8000, RxWholePkt=0x0300,
318 };

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL_ANY  )

◆ mdio_read() [1/2]

static int mdio_read ( struct nic nic,
int  phy_id,
int  location 
)
static

◆ mdio_write() [1/2]

static void mdio_write ( struct nic nic,
int  phy_id,
int  location,
int  value 
)
static

Referenced by select_media(), and start_link().

◆ read_eeprom()

static int read_eeprom ( unsigned long  ioaddr,
int  location,
int  addr_len 
)
static

Definition at line 676 of file tulip.c.

677 {
678  int i;
679  unsigned short retval = 0;
680  long ee_addr = ioaddr + CSR9;
681  int read_cmd = location | EE_READ_CMD;
682 
683  whereami("read_eeprom\n");
684 
685  outl(EE_ENB & ~EE_CS, ee_addr);
686  outl(EE_ENB, ee_addr);
687 
688  /* Shift the read command bits out. */
689  for (i = 4 + addr_len; i >= 0; i--) {
690  short dataval = (read_cmd & (1 << i)) ? EE_DATA_WRITE : 0;
691  outl(EE_ENB | dataval, ee_addr);
692  eeprom_delay();
693  outl(EE_ENB | dataval | EE_SHIFT_CLK, ee_addr);
694  eeprom_delay();
695  }
696  outl(EE_ENB, ee_addr);
697 
698  for (i = 16; i > 0; i--) {
699  outl(EE_ENB | EE_SHIFT_CLK, ee_addr);
700  eeprom_delay();
701  retval = (retval << 1) | ((inl(ee_addr) & EE_DATA_READ) ? 1 : 0);
702  outl(EE_ENB, ee_addr);
703  eeprom_delay();
704  }
705 
706  /* Terminate the EEPROM access. */
707  outl(EE_ENB & ~EE_CS, ee_addr);
708  return retval;
709 }
#define EE_CS
Definition: tulip.c:352
#define EE_DATA_READ
Definition: tulip.c:356
static void whereami(const char *str)
Definition: tulip.c:512
#define eeprom_delay()
Definition: tulip.c:362
#define EE_DATA_WRITE
Definition: tulip.c:353
#define EE_READ_CMD
Definition: tulip.c:347
static u32 ioaddr
Definition: tulip.c:393
#define EE_ENB
Definition: tulip.c:357
#define outl(data, io_addr)
Definition: io.h:329
Definition: tulip.c:296
unsigned long retval
Definition: xen.h:45
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
#define EE_SHIFT_CLK
Definition: tulip.c:351

References CSR9, EE_CS, EE_DATA_READ, EE_DATA_WRITE, EE_ENB, EE_READ_CMD, EE_SHIFT_CLK, eeprom_delay, inl(), ioaddr, outl, retval, and whereami().

Referenced by tulip_probe().

◆ parse_eeprom()

static void parse_eeprom ( struct nic nic)
static

Definition at line 715 of file tulip.c.

716 {
717  unsigned char *p, *ee_data = tp->eeprom;
718  int new_advertise = 0;
719  int i;
720 
721  whereami("parse_eeprom\n");
722 
723  tp->mtable = NULL;
724  /* Detect an old-style (SA only) EEPROM layout:
725  memcmp(ee_data, ee_data+16, 8). */
726  for (i = 0; i < 8; i ++)
727  if (ee_data[i] != ee_data[16+i])
728  break;
729  if (i >= 8) {
730  /* Do a fix-up based on the vendor half of the station address. */
731  for (i = 0; eeprom_fixups[i].name; i++) {
732  if (nic->node_addr[0] == eeprom_fixups[i].addr0
733  && nic->node_addr[1] == eeprom_fixups[i].addr1
734  && nic->node_addr[2] == eeprom_fixups[i].addr2) {
735  if (nic->node_addr[2] == 0xE8 && ee_data[0x1a] == 0x55)
736  i++; /* An Accton EN1207, not an outlaw Maxtech. */
737  memcpy(ee_data + 26, eeprom_fixups[i].newtable,
738  sizeof(eeprom_fixups[i].newtable));
739  DBG("%s: Old format EEPROM on '%s' board.\n%s: Using substitute media control info.\n",
741  break;
742  }
743  }
744  if (eeprom_fixups[i].name == NULL) { /* No fixup found. */
745  DBG("%s: Old style EEPROM with no media selection information.\n",
746  tp->nic_name);
747  return;
748  }
749  }
750 
751  if (ee_data[19] > 1) {
752  DBG("%s: Multiport cards (%d ports) may not work correctly.\n",
753  tp->nic_name, ee_data[19]);
754  }
755 
756  p = (void *)ee_data + ee_data[27];
757 
758  if (ee_data[27] == 0) { /* No valid media table. */
759  DBG2("%s: No Valid Media Table. ee_data[27] = %hhX\n",
760  tp->nic_name, ee_data[27]);
761  } else if (tp->chip_id == DC21041) {
762  int media = get_u16(p);
763  int count = p[2];
764  p += 3;
765 
766  DBG("%s: 21041 Media table, default media %hX (%s).\n",
767  tp->nic_name, media,
768  media & 0x0800 ? "Autosense" : medianame[media & 15]);
769  for (i = 0; i < count; i++) {
770  unsigned char media_block = *p++;
771  int media_code = media_block & MEDIA_MASK;
772  if (media_block & 0x40)
773  p += 6;
774  switch(media_code) {
775  case 0: new_advertise |= 0x0020; break;
776  case 4: new_advertise |= 0x0040; break;
777  }
778  DBG("%s: 21041 media #%d, %s.\n",
779  tp->nic_name, media_code, medianame[media_code]);
780  }
781  } else {
782  unsigned char csr12dir = 0;
783  int count;
784  struct mediatable *mtable;
785  u16 media = get_u16(p);
786 
787  p += 2;
788  if (tp->flags & CSR12_IN_SROM)
789  csr12dir = *p++;
790  count = *p++;
791 
792  tp->mtable = mtable = (struct mediatable *)&tp->media_table_storage[0];
793 
794  mtable->defaultmedia = media;
795  mtable->leafcount = count;
796  mtable->csr12dir = csr12dir;
797  mtable->has_nonmii = mtable->has_mii = mtable->has_reset = 0;
798  mtable->csr15dir = mtable->csr15val = 0;
799 
800  DBG("%s: EEPROM default media type %s.\n", tp->nic_name,
801  media & 0x0800 ? "Autosense" : medianame[media & MEDIA_MASK]);
802 
803  for (i = 0; i < count; i++) {
804  struct medialeaf *leaf = &mtable->mleaf[i];
805 
806  if ((p[0] & 0x80) == 0) { /* 21140 Compact block. */
807  leaf->type = 0;
808  leaf->media = p[0] & 0x3f;
809  leaf->leafdata = p;
810  if ((p[2] & 0x61) == 0x01) /* Bogus, but Znyx boards do it. */
811  mtable->has_mii = 1;
812  p += 4;
813  } else {
814  switch(leaf->type = p[1]) {
815  case 5:
816  mtable->has_reset = i;
817  leaf->media = p[2] & 0x0f;
818  break;
819  case 1: case 3:
820  mtable->has_mii = 1;
821  leaf->media = 11;
822  break;
823  case 2:
824  if ((p[2] & 0x3f) == 0) {
825  u32 base15 = (p[2] & 0x40) ? get_u16(p + 7) : 0x0008;
826  u16 *p1 = (u16 *)(p + (p[2] & 0x40 ? 9 : 3));
827  mtable->csr15dir = (get_unaligned(p1 + 0)<<16) + base15;
828  mtable->csr15val = (get_unaligned(p1 + 1)<<16) + base15;
829  }
830  /* Fall through. */
831  case 0: case 4:
832  mtable->has_nonmii = 1;
833  leaf->media = p[2] & MEDIA_MASK;
834  switch (leaf->media) {
835  case 0: new_advertise |= 0x0020; break;
836  case 4: new_advertise |= 0x0040; break;
837  case 3: new_advertise |= 0x0080; break;
838  case 5: new_advertise |= 0x0100; break;
839  case 6: new_advertise |= 0x0200; break;
840  }
841  break;
842  default:
843  leaf->media = 19;
844  }
845  leaf->leafdata = p + 2;
846  p += (p[0] & 0x3f) + 1;
847  }
848  if (leaf->media == 11) {
849  unsigned char *bp = leaf->leafdata;
850  DBG2("%s: MII interface PHY %d, setup/reset sequences %d/%d long, capabilities %hhX %hhX.\n",
851  tp->nic_name, bp[0], bp[1], bp[2 + bp[1]*2],
852  bp[5 + bp[2 + bp[1]*2]*2], bp[4 + bp[2 + bp[1]*2]*2]);
853  }
854  DBG("%s: Index #%d - Media %s (#%d) described "
855  "by a %s (%d) block.\n",
856  tp->nic_name, i, medianame[leaf->media], leaf->media,
857  leaf->type < 6 ? block_name[leaf->type] : "UNKNOWN",
858  leaf->type);
859  }
860  if (new_advertise)
861  tp->sym_advertise = new_advertise;
862  }
863 }
uint16_t u16
Definition: stdint.h:21
Definition: tulip.c:151
const char * name
Definition: ath9k_hw.c:1984
u32 csr15val
Definition: tulip.c:330
struct medialeaf mleaf[0]
Definition: tulip.c:331
u8 csr12dir
Definition: tulip.c:328
u8 media
Definition: tulip.c:322
static const char * block_name[]
Definition: tulip.c:480
char * name
Definition: tulip.c:447
struct mediatable * mtable
Definition: tulip.c:416
static unsigned char ee_data[EEPROM_SIZE]
Definition: davicom.c:67
uint16_t bp
Definition: registers.h:23
#define MEDIA_MASK
Definition: tulip.c:140
int flags
Definition: tulip.c:400
unsigned has_mii
Definition: tulip.c:329
static void whereami(const char *str)
Definition: tulip.c:512
int chip_id
Definition: tulip.c:397
void * memcpy(void *dest, const void *src, size_t len) __nonnull
unsigned char eeprom[EEPROM_SIZE]
Definition: tulip.c:413
u8 media_table_storage[(sizeof(struct mediatable)+32 *sizeof(struct medialeaf))]
Definition: tulip.c:414
static struct tulip_private * tp
Definition: tulip.c:441
const char * nic_name
Definition: tulip.c:404
u8 leafcount
Definition: tulip.c:328
#define get_u16(ptr)
Definition: tulip.c:125
u16 defaultmedia
Definition: tulip.c:327
u16 sym_advertise
Definition: tulip.c:415
unsigned char addr2
Definition: tulip.c:448
unsigned has_nonmii
Definition: tulip.c:329
Definition: nic.h:49
static const char *const medianame[32]
Definition: tulip.c:141
unsigned has_reset
Definition: tulip.c:329
static struct fixups eeprom_fixups[]
unsigned char * node_addr
Definition: nic.h:52
uint16_t count
Number of entries.
Definition: ena.h:22
static char media[]
Definition: sundance.c:85
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
u32 csr15dir
Definition: tulip.c:330
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
unsigned char addr1
Definition: tulip.c:448
#define get_unaligned(ptr)
Definition: tulip.c:123
unsigned char * leafdata
Definition: tulip.c:323
u8 type
Definition: tulip.c:321
unsigned char addr0
Definition: tulip.c:448
uint32_t u32
Definition: stdint.h:23
#define DBG2(...)
Definition: compiler.h:515

References fixups::addr0, fixups::addr1, fixups::addr2, block_name, bp, tulip_private::chip_id, count, CSR12_IN_SROM, mediatable::csr12dir, mediatable::csr15dir, mediatable::csr15val, DBG, DBG2, DC21041, mediatable::defaultmedia, ee_data, tulip_private::eeprom, eeprom_fixups, tulip_private::flags, get_u16, get_unaligned, mediatable::has_mii, mediatable::has_nonmii, mediatable::has_reset, mediatable::leafcount, medialeaf::leafdata, media, medialeaf::media, MEDIA_MASK, tulip_private::media_table_storage, medianame, memcpy(), mediatable::mleaf, tulip_private::mtable, fixups::name, name, tulip_private::nic_name, nic::node_addr, NULL, tulip_private::sym_advertise, tp, medialeaf::type, and whereami().

Referenced by tulip_probe().

◆ tulip_probe()

static int tulip_probe ( struct nic nic,
struct pci_device pci 
)
static

Definition at line 1173 of file tulip.c.

1173  {
1174 
1175  u32 i;
1176  u8 chip_rev;
1178  unsigned short sum;
1179  int chip_idx;
1180  static unsigned char last_phys_addr[ETH_ALEN] = {0x00, 'L', 'i', 'n', 'u', 'x'};
1181 
1182  if (pci->ioaddr == 0)
1183  return 0;
1184 
1185  ioaddr = pci->ioaddr;
1186  nic->ioaddr = pci->ioaddr & ~3;
1187  nic->irqno = 0;
1188 
1189  /* point to private storage */
1190  tp = &tulip_bss.tpx;
1191 
1192  tp->vendor_id = pci->vendor;
1193  tp->dev_id = pci->device;
1194  tp->nic_name = pci->id->name;
1195 
1196  tp->if_port = 0;
1197  tp->default_port = 0;
1198 
1199  adjust_pci_device(pci);
1200 
1201  /* disable interrupts */
1202  outl(0x00000000, ioaddr + CSR7);
1203 
1204  /* Stop the chip's Tx and Rx processes. */
1205  outl(inl(ioaddr + CSR6) & ~0x00002002, ioaddr + CSR6);
1206 
1207  /* Clear the missed-packet counter. */
1208  inl(ioaddr + CSR8);
1209 
1210  DBG("\n"); /* so we start on a fresh line */
1211  whereami("tulip_probe\n");
1212 
1213  DBG2 ("%s: Looking for Tulip Chip: Vendor=%hX Device=%hX\n", tp->nic_name,
1214  tp->vendor_id, tp->dev_id);
1215 
1216  /* Figure out which chip we're dealing with */
1217  i = 0;
1218  chip_idx = -1;
1219 
1220  while (pci_id_tbl[i].name) {
1221  if ( (((u32) tp->dev_id << 16) | tp->vendor_id) ==
1222  (pci_id_tbl[i].id.pci & pci_id_tbl[i].id.pci_mask) ) {
1224  break;
1225  }
1226  i++;
1227  }
1228 
1229  if (chip_idx == -1) {
1230  DBG ("%s: Unknown Tulip Chip: Vendor=%hX Device=%hX\n", tp->nic_name,
1231  tp->vendor_id, tp->dev_id);
1232  return 0;
1233  }
1234 
1235  tp->pci_id_idx = i;
1237 
1238  DBG2 ("%s: tp->pci_id_idx == %d, name == %s\n", tp->nic_name,
1240  DBG2 ("%s: chip_idx == %d, name == %s\n", tp->nic_name, chip_idx,
1242 
1243  /* Bring the 21041/21143 out of sleep mode.
1244  Caution: Snooze mode does not work with some boards! */
1245  if (tp->flags & HAS_PWRDWN)
1246  pci_write_config_dword(pci, 0x40, 0x00000000);
1247 
1248  if (inl(ioaddr + CSR5) == 0xFFFFFFFF) {
1249  DBG("%s: The Tulip chip at %X is not functioning.\n",
1250  tp->nic_name, (unsigned int) ioaddr);
1251  return 0;
1252  }
1253 
1254  pci_read_config_byte(pci, PCI_REVISION, &chip_rev);
1255 
1256  DBG("%s: [chip: %s] rev %d at %hX\n", tp->nic_name,
1257  tulip_tbl[chip_idx].chip_name, chip_rev, (unsigned int) ioaddr);
1258  DBG("%s: Vendor=%hX Device=%hX", tp->nic_name, tp->vendor_id, tp->dev_id);
1259 
1260  if (chip_idx == DC21041 && inl(ioaddr + CSR9) & 0x8000) {
1261  DBG(" 21040 compatible mode.");
1262  chip_idx = DC21040;
1263  }
1264 
1265  DBG("\n");
1266 
1267  /* The SROM/EEPROM interface varies dramatically. */
1268  sum = 0;
1269  if (chip_idx == DC21040) {
1270  outl(0, ioaddr + CSR9); /* Reset the pointer with a dummy write. */
1271  for (i = 0; i < ETH_ALEN; i++) {
1272  int value, boguscnt = 100000;
1273  do
1274  value = inl(ioaddr + CSR9);
1275  while (value < 0 && --boguscnt > 0);
1276  nic->node_addr[i] = value;
1277  sum += value & 0xff;
1278  }
1279  } else if (chip_idx == LC82C168) {
1280  for (i = 0; i < 3; i++) {
1281  int value, boguscnt = 100000;
1282  outl(0x600 | i, ioaddr + 0x98);
1283  do
1284  value = inl(ioaddr + CSR9);
1285  while (value < 0 && --boguscnt > 0);
1287  sum += value & 0xffff;
1288  }
1289  } else if (chip_idx == COMET) {
1290  /* No need to read the EEPROM. */
1291  put_unaligned(inl(ioaddr + 0xA4), (u32 *)nic->node_addr);
1292  put_unaligned(inl(ioaddr + 0xA8), (u16 *)(nic->node_addr + 4));
1293  for (i = 0; i < ETH_ALEN; i ++)
1294  sum += nic->node_addr[i];
1295  } else {
1296  /* A serial EEPROM interface, we read now and sort it out later. */
1297  int sa_offset = 0;
1298  int ee_addr_size = read_eeprom(ioaddr, 0xff, 8) & 0x40000 ? 8 : 6;
1299 
1300  for (i = 0; i < sizeof(ee_data)/2; i++)
1301  ((u16 *)ee_data)[i] =
1302  le16_to_cpu(read_eeprom(ioaddr, i, ee_addr_size));
1303 
1304  /* DEC now has a specification (see Notes) but early board makers
1305  just put the address in the first EEPROM locations. */
1306  /* This does memcmp(eedata, eedata+16, 8) */
1307  for (i = 0; i < 8; i ++)
1308  if (ee_data[i] != ee_data[16+i])
1309  sa_offset = 20;
1310  if (ee_data[0] == 0xff && ee_data[1] == 0xff && ee_data[2] == 0) {
1311  sa_offset = 2; /* Grrr, damn Matrox boards. */
1312  }
1313  for (i = 0; i < ETH_ALEN; i ++) {
1314  nic->node_addr[i] = ee_data[i + sa_offset];
1315  sum += ee_data[i + sa_offset];
1316  }
1317  }
1318  /* Lite-On boards have the address byte-swapped. */
1319  if ((nic->node_addr[0] == 0xA0 || nic->node_addr[0] == 0xC0)
1320  && nic->node_addr[1] == 0x00)
1321  for (i = 0; i < ETH_ALEN; i+=2) {
1322  char tmp = nic->node_addr[i];
1323  nic->node_addr[i] = nic->node_addr[i+1];
1324  nic->node_addr[i+1] = tmp;
1325  }
1326 
1327  if (sum == 0 || sum == ETH_ALEN*0xff) {
1328  DBG("%s: EEPROM not present!\n", tp->nic_name);
1329  for (i = 0; i < ETH_ALEN-1; i++)
1330  nic->node_addr[i] = last_phys_addr[i];
1331  nic->node_addr[i] = last_phys_addr[i] + 1;
1332  }
1333 
1334  for (i = 0; i < ETH_ALEN; i++)
1335  last_phys_addr[i] = nic->node_addr[i];
1336 
1337  DBG ( "%s: %s at ioaddr %hX\n", tp->nic_name, eth_ntoa ( nic->node_addr ),
1338  (unsigned int) ioaddr );
1339 
1340  tp->chip_id = chip_idx;
1341  tp->revision = chip_rev;
1342  tp->csr0 = csr0;
1343 
1344  /* BugFixes: The 21143-TD hangs with PCI Write-and-Invalidate cycles.
1345  And the ASIX must have a burst limit or horrible things happen. */
1346  if (chip_idx == DC21143 && chip_rev == 65)
1347  tp->csr0 &= ~0x01000000;
1348  else if (tp->flags & IS_ASIX)
1349  tp->csr0 |= 0x2000;
1350 
1351  if (media_cap[tp->default_port] & MediaIsMII) {
1352  static const u16 media2advert[] = { 0x20, 0x40, 0x03e0, 0x60,
1353  0x80, 0x100, 0x200 };
1354  tp->mii_advertise = media2advert[tp->default_port - 9];
1355  tp->mii_advertise |= (tp->flags & HAS_8023X); /* Matching bits! */
1356  }
1357 
1358  /* This is logically part of the probe routine, but too complex
1359  to write inline. */
1360  if (tp->flags & HAS_MEDIA_TABLE) {
1361  memcpy(tp->eeprom, ee_data, sizeof(tp->eeprom));
1362  parse_eeprom(nic);
1363  }
1364 
1365  start_link(nic);
1366 
1367  /* reset the device and make ready for tx and rx of packets */
1368  tulip_reset(nic);
1370 
1371  /* give the board a chance to reset before returning */
1373 
1374  return 1;
1375 }
Definition: tulip.c:295
unsigned char irqno
Definition: nic.h:56
uint16_t u16
Definition: stdint.h:21
Definition: tulip.c:151
const char * name
Definition: ath9k_hw.c:1984
#define TICKS_PER_SEC
Number of ticks per second.
Definition: timer.h:15
unsigned short dev_id
Definition: tulip.c:402
int drv_flags
Definition: tulip.c:173
unsigned long ioaddr
I/O address.
Definition: pci.h:200
static int chip_idx
Definition: tlan.c:195
unsigned int default_port
Definition: tulip.c:412
int revision
Definition: tulip.c:399
static struct tulip_chip_table tulip_tbl[]
static const char media_cap[32]
Definition: tulip.c:275
static unsigned char ee_data[EEPROM_SIZE]
Definition: davicom.c:67
static const int csr0
Definition: tulip.c:137
int flags
Definition: tulip.c:400
Definition: tulip.c:152
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
Definition: pci.c:149
Definition: tulip.c:296
char * chip_name
Definition: tulip.c:243
static void whereami(const char *str)
Definition: tulip.c:512
int chip_id
Definition: tulip.c:397
unsigned int csr0
Definition: tulip.c:405
static u32 ioaddr
Definition: tulip.c:393
void * memcpy(void *dest, const void *src, size_t len) __nonnull
unsigned int ioaddr
Definition: nic.h:55
uint16_t device
Device ID.
Definition: pci.h:204
const char * name
Definition: tlan.c:110
unsigned char eeprom[EEPROM_SIZE]
Definition: tulip.c:413
static void tulip_wait(unsigned int nticks)
Definition: tulip.c:518
#define EEPROM_SIZE
Definition: tulip.c:343
static struct tulip_private * tp
Definition: tulip.c:441
const char * nic_name
Definition: tulip.c:404
pseudo_bit_t value[0x00020]
Definition: arbel.h:13
static const struct pci_id_info pci_id_tbl[]
Definition: tulip.c:176
Definition: tulip.c:151
unsigned int if_port
Definition: tulip.c:406
#define outl(data, io_addr)
Definition: io.h:329
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
Definition: ethernet.c:175
#define put_unaligned(val, ptr)
Definition: tulip.c:124
uint8_t * tmp
Definition: entropy.h:156
static void tulip_reset(struct nic *nic)
Definition: tulip.c:923
#define ETH_ALEN
Definition: if_ether.h:8
Definition: tulip.c:296
#define le16_to_cpu(value)
Definition: byteswap.h:112
Definition: nic.h:49
const char * name
Name.
Definition: pci.h:153
uint16_t vendor
Vendor ID.
Definition: pci.h:202
struct pci_id_info::match_info id
unsigned char * node_addr
Definition: nic.h:52
static void parse_eeprom(struct nic *nic)
Definition: tulip.c:715
static struct nic_operations tulip_operations
Definition: tulip.c:1162
Definition: tulip.c:296
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
static int read_eeprom(unsigned long ioaddr, int location, int addr_len)
Definition: tulip.c:676
Definition: tulip.c:238
struct pci_device_id * id
Driver device ID.
Definition: pci.h:220
int pci_write_config_dword(struct pci_device *pci, unsigned int where, uint32_t value)
Write 32-bit dword to PCI configuration space.
#define PCI_REVISION
PCI revision.
Definition: pci.h:43
Definition: tulip.c:296
static void start_link(struct nic *nic)
Definition: tulip.c:1377
Definition: tulip.c:151
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
struct nic_operations * nic_op
Definition: nic.h:50
u16 mii_advertise
Definition: tulip.c:415
uint8_t u8
Definition: stdint.h:19
int pci_id_idx
Definition: tulip.c:398
unsigned short vendor_id
Definition: tulip.c:401
uint32_t u32
Definition: stdint.h:23
#define DBG2(...)
Definition: compiler.h:515
int pci_read_config_byte(struct pci_device *pci, unsigned int where, uint8_t *value)
Read byte from PCI configuration space.

References adjust_pci_device(), tulip_private::chip_id, chip_idx, tulip_chip_table::chip_name, COMET, csr0, tulip_private::csr0, CSR5, CSR6, CSR7, CSR8, CSR9, DBG, DBG2, DC21040, DC21041, DC21143, tulip_private::default_port, tulip_private::dev_id, pci_device::device, pci_id_info::drv_flags, ee_data, tulip_private::eeprom, EEPROM_SIZE, ETH_ALEN, eth_ntoa(), tulip_chip_table::flags, tulip_private::flags, HAS_8023X, HAS_MEDIA_TABLE, HAS_PWRDWN, pci_id_info::id, pci_device::id, tulip_private::if_port, inl(), nic::ioaddr, pci_device::ioaddr, ioaddr, nic::irqno, IS_ASIX, LC82C168, le16_to_cpu, media_cap, MediaIsMII, memcpy(), tulip_private::mii_advertise, pci_id_info::name, pci_device_id::name, name, tulip_private::nic_name, nic::nic_op, nic::node_addr, outl, parse_eeprom(), pci_id_info::match_info::pci, tulip_private::pci_id_idx, pci_id_tbl, pci_id_info::match_info::pci_mask, pci_read_config_byte(), PCI_REVISION, pci_write_config_dword(), put_unaligned, read_eeprom(), tulip_private::revision, start_link(), TICKS_PER_SEC, tmp, tp, tulip_operations, tulip_reset(), tulip_tbl, tulip_wait(), value, pci_device::vendor, tulip_private::vendor_id, and whereami().

◆ tulip_init_ring() [1/2]

static void tulip_init_ring ( struct nic nic)
static

Referenced by tulip_reset().

◆ tulip_reset()

static void tulip_reset ( struct nic nic)
static

Definition at line 923 of file tulip.c.

924 {
925  int i;
926  unsigned long to;
927 
928  whereami("tulip_reset\n");
929 
930  /* Stop Tx and RX */
931  outl(inl(ioaddr + CSR6) & ~0x00002002, ioaddr + CSR6);
932 
933  /* On some chip revs we must set the MII/SYM port before the reset!? */
934  if (tp->mii_cnt || (tp->mtable && tp->mtable->has_mii)) {
935  outl(0x814C0000, ioaddr + CSR6);
936  }
937 
938  /* Reset the chip, holding bit 0 set at least 50 PCI cycles. */
939  outl(0x00000001, ioaddr + CSR0);
940  tulip_wait(1);
941 
942  /* turn off reset and set cache align=16lword, burst=unlimit */
943  outl(tp->csr0, ioaddr + CSR0);
944 
945  /* Wait the specified 50 PCI cycles after a reset */
946  tulip_wait(1);
947 
948  /* set up transmit and receive descriptors */
950 
951  if (tp->chip_id == PNIC2) {
952  u32 addr_high = (nic->node_addr[1]<<8) + (nic->node_addr[0]<<0);
953  /* This address setting does not appear to impact chip operation?? */
954  outl((nic->node_addr[5]<<8) + nic->node_addr[4] +
955  (nic->node_addr[3]<<24) + (nic->node_addr[2]<<16),
956  ioaddr + 0xB0);
957  outl(addr_high + (addr_high<<16), ioaddr + 0xB8);
958  }
959 
960  /* MC_HASH_ONLY boards don't support setup packets */
961  if (tp->flags & MC_HASH_ONLY) {
962  u32 addr_low = cpu_to_le32(get_unaligned((u32 *)nic->node_addr));
963  u32 addr_high = cpu_to_le32(get_unaligned((u16 *)(nic->node_addr+4)));
964 
965  /* clear multicast hash filters and setup MAC address filters */
966  if (tp->flags & IS_ASIX) {
967  outl(0, ioaddr + CSR13);
968  outl(addr_low, ioaddr + CSR14);
969  outl(1, ioaddr + CSR13);
970  outl(addr_high, ioaddr + CSR14);
971  outl(2, ioaddr + CSR13);
972  outl(0, ioaddr + CSR14);
973  outl(3, ioaddr + CSR13);
974  outl(0, ioaddr + CSR14);
975  } else if (tp->chip_id == COMET) {
976  outl(addr_low, ioaddr + 0xA4);
977  outl(addr_high, ioaddr + 0xA8);
978  outl(0, ioaddr + 0xAC);
979  outl(0, ioaddr + 0xB0);
980  }
981  } else {
982  /* for other boards we send a setup packet to initialize
983  the filters */
984  u32 tx_flags = 0x08000000 | 192;
985 
986  /* construct perfect filter frame with mac address as first match
987  and broadcast address for all others */
988  for (i=0; i<192; i++)
989  txb[i] = 0xFF;
990  txb[0] = nic->node_addr[0];
991  txb[1] = nic->node_addr[1];
992  txb[4] = nic->node_addr[2];
993  txb[5] = nic->node_addr[3];
994  txb[8] = nic->node_addr[4];
995  txb[9] = nic->node_addr[5];
996 
997  tx_ring[0].length = cpu_to_le32(tx_flags);
998  tx_ring[0].buffer1 = virt_to_le32desc(&txb[0]);
999  tx_ring[0].status = cpu_to_le32(0x80000000);
1000  }
1001 
1002  /* Point to rx and tx descriptors */
1005 
1006  init_media(nic);
1007 
1008  /* set the chip's operating mode (but don't turn on xmit and recv yet) */
1009  outl((tp->csr6 & ~0x00002002), ioaddr + CSR6);
1010 
1011  /* send setup packet for cards that support it */
1012  if (!(tp->flags & MC_HASH_ONLY)) {
1013  /* enable transmit wait for completion */
1014  outl(tp->csr6 | 0x00002000, ioaddr + CSR6);
1015  /* immediate transmit demand */
1016  outl(0, ioaddr + CSR1);
1017 
1018  to = currticks() + TX_TIME_OUT;
1019  while ((tx_ring[0].status & 0x80000000) && (currticks() < to))
1020  /* wait */ ;
1021 
1022  if (currticks() >= to) {
1023  DBG ("%s: TX Setup Timeout.\n", tp->nic_name);
1024  }
1025  }
1026 
1027  if (tp->chip_id == LC82C168)
1029 
1030  set_rx_mode(nic);
1031 
1032  /* enable transmit and receive */
1033  outl(tp->csr6 | 0x00002002, ioaddr + CSR6);
1034 }
uint16_t u16
Definition: stdint.h:21
Definition: tulip.c:295
Definition: tulip.c:295
struct mediatable * mtable
Definition: tulip.c:416
int flags
Definition: tulip.c:400
unsigned has_mii
Definition: tulip.c:329
Definition: tulip.c:152
static void whereami(const char *str)
Definition: tulip.c:512
int chip_id
Definition: tulip.c:397
uint8_t status
Status.
Definition: ena.h:16
unsigned int csr0
Definition: tulip.c:405
static u32 ioaddr
Definition: tulip.c:393
Definition: tulip.c:295
static void tulip_wait(unsigned int nticks)
Definition: tulip.c:518
static int tulip_check_duplex(struct nic *nic)
Definition: tulip.c:1874
static struct tulip_private * tp
Definition: tulip.c:441
const char * nic_name
Definition: tulip.c:404
#define cpu_to_le32(value)
Definition: byteswap.h:107
Definition: tulip.c:152
#define outl(data, io_addr)
Definition: io.h:329
#define TX_TIME_OUT
Definition: tulip.c:119
Definition: nic.h:49
Definition: tulip.c:295
Definition: tulip.c:297
unsigned char * node_addr
Definition: nic.h:52
Definition: tulip.c:297
#define virt_to_le32desc(addr)
Definition: tulip.c:126
Definition: tulip.c:296
#define rx_ring
Definition: tulip.c:438
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
Definition: tulip.c:238
static void set_rx_mode(struct nic *nic __unused)
Definition: tulip.c:905
unsigned long currticks(void)
Get current system time in ticks.
Definition: timer.c:42
signed char mii_cnt
Definition: tulip.c:419
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
unsigned int csr6
Definition: tulip.c:405
static void tulip_init_ring(struct nic *nic)
#define txb
Definition: tulip.c:437
#define tx_ring
Definition: tulip.c:436
#define get_unaligned(ptr)
Definition: tulip.c:123
uint32_t u32
Definition: stdint.h:23
static void init_media(struct nic *nic)
Definition: tulip.c:1525

References tulip_private::chip_id, COMET, cpu_to_le32, CSR0, tulip_private::csr0, CSR1, CSR13, CSR14, CSR3, CSR4, CSR6, tulip_private::csr6, currticks(), DBG, tulip_private::flags, get_unaligned, mediatable::has_mii, init_media(), inl(), ioaddr, IS_ASIX, LC82C168, MC_HASH_ONLY, tulip_private::mii_cnt, tulip_private::mtable, tulip_private::nic_name, nic::node_addr, outl, PNIC2, rx_ring, set_rx_mode(), status, tp, tulip_check_duplex(), tulip_init_ring(), tulip_wait(), tx_ring, TX_TIME_OUT, txb, virt_to_le32desc, and whereami().

Referenced by tulip_disable(), and tulip_probe().

◆ tulip_transmit()

static void tulip_transmit ( struct nic nic,
const char *  d,
unsigned int  t,
unsigned int  s,
const char *  p 
)
static

Definition at line 1040 of file tulip.c.

1042 {
1043  u16 nstype;
1044  u32 to;
1045  u32 csr6 = inl(ioaddr + CSR6);
1046 
1047  whereami("tulip_transmit\n");
1048 
1049  /* Disable Tx */
1050  outl(csr6 & ~0x00002000, ioaddr + CSR6);
1051 
1052  memcpy(txb, d, ETH_ALEN);
1054  nstype = htons((u16) t);
1055  memcpy(txb + 2 * ETH_ALEN, (u8 *)&nstype, 2);
1056  memcpy(txb + ETH_HLEN, p, s);
1057 
1058  s += ETH_HLEN;
1059  s &= 0x0FFF;
1060 
1061  /* pad to minimum packet size */
1062  while (s < ETH_ZLEN)
1063  txb[s++] = '\0';
1064 
1065  DBG2("%s: sending %d bytes ethtype %hX\n", tp->nic_name, s, t);
1066 
1067  /* setup the transmit descriptor */
1068  /* 0x60000000 = no interrupt on completion */
1069  tx_ring[0].length = cpu_to_le32(0x60000000 | s);
1070  tx_ring[0].status = cpu_to_le32(0x80000000);
1071 
1072  /* Point to transmit descriptor */
1074 
1075  /* Enable Tx */
1076  outl(csr6 | 0x00002000, ioaddr + CSR6);
1077  /* immediate transmit demand */
1078  outl(0, ioaddr + CSR1);
1079 
1080  to = currticks() + TX_TIME_OUT;
1081  while ((tx_ring[0].status & 0x80000000) && (currticks() < to))
1082  /* wait */ ;
1083 
1084  if (currticks() >= to) {
1085  DBG ("TX Timeout!\n");
1086  }
1087 
1088  /* Disable Tx */
1089  outl(csr6 & ~0x00002000, ioaddr + CSR6);
1090 }
uint16_t u16
Definition: stdint.h:21
Definition: tulip.c:295
Definition: tulip.c:295
static void whereami(const char *str)
Definition: tulip.c:512
uint8_t status
Status.
Definition: ena.h:16
static u32 ioaddr
Definition: tulip.c:393
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define ETH_HLEN
Definition: if_ether.h:9
static struct tulip_private * tp
Definition: tulip.c:441
const char * nic_name
Definition: tulip.c:404
#define cpu_to_le32(value)
Definition: byteswap.h:107
#define outl(data, io_addr)
Definition: io.h:329
#define TX_TIME_OUT
Definition: tulip.c:119
#define ETH_ALEN
Definition: if_ether.h:8
#define ETH_ZLEN
Definition: if_ether.h:10
Definition: nic.h:49
unsigned char * node_addr
Definition: nic.h:52
#define virt_to_le32desc(addr)
Definition: tulip.c:126
Definition: tulip.c:296
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
uint32_t d
Definition: md4.c:31
unsigned long currticks(void)
Get current system time in ticks.
Definition: timer.c:42
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define txb
Definition: tulip.c:437
#define tx_ring
Definition: tulip.c:436
#define htons(value)
Definition: byteswap.h:135
uint8_t u8
Definition: stdint.h:19
uint32_t u32
Definition: stdint.h:23
#define DBG2(...)
Definition: compiler.h:515

References cpu_to_le32, CSR1, CSR4, CSR6, currticks(), d, DBG, DBG2, ETH_ALEN, ETH_HLEN, ETH_ZLEN, htons, inl(), ioaddr, memcpy(), tulip_private::nic_name, nic::node_addr, outl, status, tp, tx_ring, TX_TIME_OUT, txb, virt_to_le32desc, and whereami().

◆ tulip_poll()

static int tulip_poll ( struct nic nic,
int  retrieve 
)
static

Definition at line 1095 of file tulip.c.

1096 {
1097 
1098  whereami("tulip_poll\n");
1099 
1100  /* no packet waiting. packet still owned by NIC */
1101  if (rx_ring[tp->cur_rx].status & 0x80000000)
1102  return 0;
1103 
1104  if ( ! retrieve ) return 1;
1105 
1106  whereami("tulip_poll got one\n");
1107 
1108  nic->packetlen = (rx_ring[tp->cur_rx].status & 0x3FFF0000) >> 16;
1109 
1110  /* if we get a corrupted packet. throw it away and move on */
1111  if (rx_ring[tp->cur_rx].status & 0x00008000) {
1112  /* return the descriptor and buffer to receive ring */
1113  rx_ring[tp->cur_rx].status = 0x80000000;
1114  tp->cur_rx = (tp->cur_rx + 1) % RX_RING_SIZE;
1115  return 0;
1116  }
1117 
1118  /* copy packet to working buffer */
1120 
1121  /* return the descriptor and buffer to receive ring */
1122  rx_ring[tp->cur_rx].status = 0x80000000;
1123  tp->cur_rx = (tp->cur_rx + 1) % RX_RING_SIZE;
1124 
1125  return 1;
1126 }
#define BUFLEN
Definition: tulip.c:365
#define rxb
Definition: tulip.c:439
static void whereami(const char *str)
Definition: tulip.c:512
#define RX_RING_SIZE
Definition: tulip.c:428
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static struct tulip_private * tp
Definition: tulip.c:441
unsigned int packetlen
Definition: nic.h:54
Definition: nic.h:49
unsigned char * packet
Definition: nic.h:53
#define rx_ring
Definition: tulip.c:438
int cur_rx
Definition: tulip.c:396

References BUFLEN, tulip_private::cur_rx, memcpy(), nic::packet, nic::packetlen, rx_ring, RX_RING_SIZE, rxb, tp, and whereami().

◆ tulip_disable()

static void tulip_disable ( struct nic nic)
static

Definition at line 1131 of file tulip.c.

1131  {
1132 
1133  whereami("tulip_disable\n");
1134 
1135  tulip_reset(nic);
1136 
1137  /* disable interrupts */
1138  outl(0x00000000, ioaddr + CSR7);
1139 
1140  /* Stop the chip's Tx and Rx processes. */
1141  outl(inl(ioaddr + CSR6) & ~0x00002002, ioaddr + CSR6);
1142 
1143  /* Clear the missed-packet counter. */
1144  inl(ioaddr + CSR8);
1145 }
Definition: tulip.c:296
static void whereami(const char *str)
Definition: tulip.c:512
static u32 ioaddr
Definition: tulip.c:393
#define outl(data, io_addr)
Definition: io.h:329
static void tulip_reset(struct nic *nic)
Definition: tulip.c:923
Definition: nic.h:49
Definition: tulip.c:296
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
Definition: tulip.c:296

References CSR6, CSR7, CSR8, inl(), ioaddr, outl, tulip_reset(), and whereami().

◆ nway_start() [1/2]

static void nway_start ( struct nic nic)
static

Referenced by init_media(), and start_link().

◆ pnic_do_nway() [1/2]

static void pnic_do_nway ( struct nic nic)
static

Referenced by init_media().

◆ select_media()

static void select_media ( struct nic nic,
int  startup 
)
static

Definition at line 1672 of file tulip.c.

1673 {
1674  struct mediatable *mtable = tp->mtable;
1675  u32 new_csr6;
1676  int i;
1677 
1678  whereami("select_media\n");
1679 
1680  if (mtable) {
1681  struct medialeaf *mleaf = &mtable->mleaf[tp->cur_index];
1682  unsigned char *p = mleaf->leafdata;
1683  switch (mleaf->type) {
1684  case 0: /* 21140 non-MII xcvr. */
1685  DBG2("%s: Using a 21140 non-MII transceiver"
1686  " with control setting %hhX.\n",
1687  tp->nic_name, p[1]);
1688  tp->if_port = p[0];
1689  if (startup)
1690  outl(mtable->csr12dir | 0x100, ioaddr + CSR12);
1691  outl(p[1], ioaddr + CSR12);
1692  new_csr6 = 0x02000000 | ((p[2] & 0x71) << 18);
1693  break;
1694  case 2: case 4: {
1695  u16 setup[5];
1696  u32 csr13val, csr14val, csr15dir, csr15val;
1697  for (i = 0; i < 5; i++)
1698  setup[i] = get_u16(&p[i*2 + 1]);
1699 
1700  tp->if_port = p[0] & 15;
1702  tp->full_duplex = 1;
1703 
1704  if (startup && mtable->has_reset) {
1705  struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset];
1706  unsigned char *rst = rleaf->leafdata;
1707  DBG2("%s: Resetting the transceiver.\n",
1708  tp->nic_name);
1709  for (i = 0; i < rst[0]; i++)
1710  outl(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15);
1711  }
1712  DBG2("%s: 21143 non-MII %s transceiver control %hX/%hX.\n",
1713  tp->nic_name, medianame[tp->if_port], setup[0], setup[1]);
1714  if (p[0] & 0x40) { /* SIA (CSR13-15) setup values are provided. */
1715  csr13val = setup[0];
1716  csr14val = setup[1];
1717  csr15dir = (setup[3]<<16) | setup[2];
1718  csr15val = (setup[4]<<16) | setup[2];
1719  outl(0, ioaddr + CSR13);
1720  outl(csr14val, ioaddr + CSR14);
1721  outl(csr15dir, ioaddr + CSR15); /* Direction */
1722  outl(csr15val, ioaddr + CSR15); /* Data */
1723  outl(csr13val, ioaddr + CSR13);
1724  } else {
1725  csr13val = 1;
1726  csr14val = 0x0003FF7F;
1727  csr15dir = (setup[0]<<16) | 0x0008;
1728  csr15val = (setup[1]<<16) | 0x0008;
1729  if (tp->if_port <= 4)
1730  csr14val = t21142_csr14[tp->if_port];
1731  if (startup) {
1732  outl(0, ioaddr + CSR13);
1733  outl(csr14val, ioaddr + CSR14);
1734  }
1735  outl(csr15dir, ioaddr + CSR15); /* Direction */
1736  outl(csr15val, ioaddr + CSR15); /* Data */
1737  if (startup) outl(csr13val, ioaddr + CSR13);
1738  }
1739  DBG2("%s: Setting CSR15 to %X/%X.\n",
1740  tp->nic_name, csr15dir, csr15val);
1741  if (mleaf->type == 4)
1742  new_csr6 = 0x82020000 | ((setup[2] & 0x71) << 18);
1743  else
1744  new_csr6 = 0x82420000;
1745  break;
1746  }
1747  case 1: case 3: {
1748  int phy_num = p[0];
1749  int init_length = p[1];
1750  u16 *misc_info;
1751 
1752  tp->if_port = 11;
1753  new_csr6 = 0x020E0000;
1754  if (mleaf->type == 3) { /* 21142 */
1755  u16 *init_sequence = (u16*)(p+2);
1756  u16 *reset_sequence = &((u16*)(p+3))[init_length];
1757  int reset_length = p[2 + init_length*2];
1758  misc_info = reset_sequence + reset_length;
1759  if (startup)
1760  for (i = 0; i < reset_length; i++)
1761  outl(get_u16(&reset_sequence[i]) << 16, ioaddr + CSR15);
1762  for (i = 0; i < init_length; i++)
1763  outl(get_u16(&init_sequence[i]) << 16, ioaddr + CSR15);
1764  } else {
1765  u8 *init_sequence = p + 2;
1766  u8 *reset_sequence = p + 3 + init_length;
1767  int reset_length = p[2 + init_length];
1768  misc_info = (u16*)(reset_sequence + reset_length);
1769  if (startup) {
1770  outl(mtable->csr12dir | 0x100, ioaddr + CSR12);
1771  for (i = 0; i < reset_length; i++)
1772  outl(reset_sequence[i], ioaddr + CSR12);
1773  }
1774  for (i = 0; i < init_length; i++)
1775  outl(init_sequence[i], ioaddr + CSR12);
1776  }
1777  tp->advertising[phy_num] = get_u16(&misc_info[1]) | 1;
1778  if (startup < 2) {
1779  if (tp->mii_advertise == 0)
1780  tp->mii_advertise = tp->advertising[phy_num];
1781  DBG2("%s: Advertising %hX on MII %d.\n",
1782  tp->nic_name, tp->mii_advertise, tp->phys[phy_num]);
1783  mdio_write(nic, tp->phys[phy_num], 4, tp->mii_advertise);
1784  }
1785  break;
1786  }
1787  default:
1788  DBG("%s: Invalid media table selection %d.\n",
1789  tp->nic_name, mleaf->type);
1790  new_csr6 = 0x020E0000;
1791  }
1792  DBG2("%s: Using media type %s, CSR12 is %hhX.\n",
1794  inl(ioaddr + CSR12) & 0xff);
1795  } else if (tp->chip_id == DC21041) {
1796  int port = tp->if_port <= 4 ? tp->if_port : 0;
1797  DBG2("%s: 21041 using media %s, CSR12 is %hX.\n",
1798  tp->nic_name, medianame[port == 3 ? 12: port],
1799  inl(ioaddr + CSR12));
1800  outl(0x00000000, ioaddr + CSR13); /* Reset the serial interface */
1804  new_csr6 = 0x80020000;
1805  } else if (tp->chip_id == LC82C168) {
1806  if (startup && ! tp->medialock)
1807  tp->if_port = tp->mii_cnt ? 11 : 0;
1808  DBG2("%s: PNIC PHY status is %hX, media %s.\n",
1809  tp->nic_name, inl(ioaddr + 0xB8), medianame[tp->if_port]);
1810  if (tp->mii_cnt) {
1811  new_csr6 = 0x810C0000;
1812  outl(0x0001, ioaddr + CSR15);
1813  outl(0x0201B07A, ioaddr + 0xB8);
1814  } else if (startup) {
1815  /* Start with 10mbps to do autonegotiation. */
1816  outl(0x32, ioaddr + CSR12);
1817  new_csr6 = 0x00420000;
1818  outl(0x0001B078, ioaddr + 0xB8);
1819  outl(0x0201B078, ioaddr + 0xB8);
1820  } else if (tp->if_port == 3 || tp->if_port == 5) {
1821  outl(0x33, ioaddr + CSR12);
1822  new_csr6 = 0x01860000;
1823  /* Trigger autonegotiation. */
1824  outl(startup ? 0x0201F868 : 0x0001F868, ioaddr + 0xB8);
1825  } else {
1826  outl(0x32, ioaddr + CSR12);
1827  new_csr6 = 0x00420000;
1828  outl(0x1F078, ioaddr + 0xB8);
1829  }
1830  } else if (tp->chip_id == DC21040) { /* 21040 */
1831  /* Turn on the xcvr interface. */
1832  int csr12 = inl(ioaddr + CSR12);
1833  DBG2("%s: 21040 media type is %s, CSR12 is %hhX.\n",
1834  tp->nic_name, medianame[tp->if_port], csr12);
1836  tp->full_duplex = 1;
1837  new_csr6 = 0x20000;
1838  /* Set the full duplux match frame. */
1840  outl(0x00000000, ioaddr + CSR13); /* Reset the serial interface */
1841  if (t21040_csr13[tp->if_port] & 8) {
1842  outl(0x0705, ioaddr + CSR14);
1843  outl(0x0006, ioaddr + CSR15);
1844  } else {
1845  outl(0xffff, ioaddr + CSR14);
1846  outl(0x0000, ioaddr + CSR15);
1847  }
1848  outl(0x8f01 | t21040_csr13[tp->if_port], ioaddr + CSR13);
1849  } else { /* Unknown chip type with no media table. */
1850  if (tp->default_port == 0)
1851  tp->if_port = tp->mii_cnt ? 11 : 3;
1852  if (media_cap[tp->if_port] & MediaIsMII) {
1853  new_csr6 = 0x020E0000;
1854  } else if (media_cap[tp->if_port] & MediaIsFx) {
1855  new_csr6 = 0x028600000;
1856  } else
1857  new_csr6 = 0x038600000;
1858  DBG2("%s: No media description table, assuming "
1859  "%s transceiver, CSR12 %hhX.\n",
1861  inl(ioaddr + CSR12));
1862  }
1863 
1864  tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0);
1865  return;
1866 }
uint16_t u16
Definition: stdint.h:21
Definition: tulip.c:151
static u8 t21040_csr13[]
Definition: tulip.c:277
struct medialeaf mleaf[0]
Definition: tulip.c:331
u8 csr12dir
Definition: tulip.c:328
unsigned int default_port
Definition: tulip.c:412
struct mediatable * mtable
Definition: tulip.c:416
static const char media_cap[32]
Definition: tulip.c:275
static u16 t21041_csr14[]
Definition: tulip.c:281
static u16 t21041_csr15[]
Definition: tulip.c:282
u16 advertising[4]
Definition: tulip.c:418
static void whereami(const char *str)
Definition: tulip.c:512
#define FULL_DUPLEX_MAGIC
Definition: tulip.c:135
int chip_id
Definition: tulip.c:397
static u32 ioaddr
Definition: tulip.c:393
u8 port
Port number.
Definition: CIB_PRM.h:31
static u16 t21041_csr13[]
Definition: tulip.c:280
Definition: tulip.c:296
static struct tulip_private * tp
Definition: tulip.c:441
const char * nic_name
Definition: tulip.c:404
static void mdio_write(struct nic *nic, int phy_id, int location, int value)
Definition: tulip.c:151
#define get_u16(ptr)
Definition: tulip.c:125
unsigned int if_port
Definition: tulip.c:406
#define outl(data, io_addr)
Definition: io.h:329
Definition: nic.h:49
static const char *const medianame[32]
Definition: tulip.c:141
unsigned has_reset
Definition: tulip.c:329
Definition: tulip.c:297
Definition: tulip.c:297
unsigned int full_duplex
Definition: tulip.c:407
int cur_index
Definition: tulip.c:420
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
signed char phys[4]
Definition: tulip.c:419
unsigned int medialock
Definition: tulip.c:409
signed char mii_cnt
Definition: tulip.c:419
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
unsigned int csr6
Definition: tulip.c:405
static u16 t21142_csr14[]
Definition: tulip.c:287
u16 mii_advertise
Definition: tulip.c:415
unsigned char * leafdata
Definition: tulip.c:323
u8 type
Definition: tulip.c:321
uint8_t u8
Definition: stdint.h:19
uint32_t u32
Definition: stdint.h:23
void startup(void)
Start up iPXE.
Definition: init.c:67
#define DBG2(...)
Definition: compiler.h:515
Definition: tulip.c:297
Definition: tulip.c:297

References tulip_private::advertising, tulip_private::chip_id, CSR11, CSR12, mediatable::csr12dir, CSR13, CSR14, CSR15, tulip_private::csr6, tulip_private::cur_index, DBG, DBG2, DC21040, DC21041, tulip_private::default_port, tulip_private::full_duplex, FULL_DUPLEX_MAGIC, get_u16, mediatable::has_reset, tulip_private::if_port, inl(), ioaddr, LC82C168, medialeaf::leafdata, mdio_write(), media_cap, MediaAlwaysFD, MediaIsFx, MediaIsMII, tulip_private::medialock, medianame, tulip_private::mii_advertise, tulip_private::mii_cnt, mediatable::mleaf, tulip_private::mtable, tulip_private::nic_name, outl, tulip_private::phys, port, startup(), t21040_csr13, t21041_csr13, t21041_csr14, t21041_csr15, t21142_csr14, tp, medialeaf::type, and whereami().

Referenced by init_media(), and start_link().

◆ init_media()

static void init_media ( struct nic nic)
static

Definition at line 1525 of file tulip.c.

1526 {
1527  int i;
1528 
1529  whereami("init_media\n");
1530 
1531  tp->saved_if_port = tp->if_port;
1532  if (tp->if_port == 0)
1533  tp->if_port = tp->default_port;
1534 
1535  /* Allow selecting a default media. */
1536  i = 0;
1537  if (tp->mtable == NULL)
1538  goto media_picked;
1539  if (tp->if_port) {
1540  int looking_for = media_cap[tp->if_port] & MediaIsMII ? 11 :
1541  (tp->if_port == 12 ? 0 : tp->if_port);
1542  for (i = 0; i < tp->mtable->leafcount; i++)
1543  if (tp->mtable->mleaf[i].media == looking_for) {
1544  DBG("%s: Using user-specified media %s.\n",
1546  goto media_picked;
1547  }
1548  }
1549  if ((tp->mtable->defaultmedia & 0x0800) == 0) {
1550  int looking_for = tp->mtable->defaultmedia & 15;
1551  for (i = 0; i < tp->mtable->leafcount; i++)
1552  if (tp->mtable->mleaf[i].media == looking_for) {
1553  DBG("%s: Using EEPROM-set media %s.\n",
1554  tp->nic_name, medianame[looking_for]);
1555  goto media_picked;
1556  }
1557  }
1558  /* Start sensing first non-full-duplex media. */
1559  for (i = tp->mtable->leafcount - 1;
1560  (media_cap[tp->mtable->mleaf[i].media] & MediaAlwaysFD) && i > 0; i--)
1561  ;
1562  media_picked:
1563 
1564  tp->csr6 = 0;
1565  tp->cur_index = i;
1566  tp->nwayset = 0;
1567 
1568  if (tp->if_port) {
1569  if (tp->chip_id == DC21143 && media_cap[tp->if_port] & MediaIsMII) {
1570  /* We must reset the media CSRs when we force-select MII mode. */
1571  outl(0x0000, ioaddr + CSR13);
1572  outl(0x0000, ioaddr + CSR14);
1573  outl(0x0008, ioaddr + CSR15);
1574  }
1575  select_media(nic, 1);
1576  return;
1577  }
1578  switch(tp->chip_id) {
1579  case DC21041:
1580  /* tp->nway = 1;*/
1581  nway_start(nic);
1582  break;
1583  case DC21142:
1584  if (tp->mii_cnt) {
1585  select_media(nic, 1);
1586  DBG2("%s: Using MII transceiver %d, status %hX.\n",
1587  tp->nic_name, tp->phys[0], mdio_read(nic, tp->phys[0], 1));
1588  outl(0x82020000, ioaddr + CSR6);
1589  tp->csr6 = 0x820E0000;
1590  tp->if_port = 11;
1591  outl(0x0000, ioaddr + CSR13);
1592  outl(0x0000, ioaddr + CSR14);
1593  } else
1594  nway_start(nic);
1595  break;
1596  case PNIC2:
1597  nway_start(nic);
1598  break;
1599  case LC82C168:
1600  if (tp->mii_cnt) {
1601  tp->if_port = 11;
1602  tp->csr6 = 0x814C0000 | (tp->full_duplex ? 0x0200 : 0);
1603  outl(0x0001, ioaddr + CSR15);
1604  } else if (inl(ioaddr + CSR5) & TPLnkPass)
1605  pnic_do_nway(nic);
1606  else {
1607  /* Start with 10mbps to do autonegotiation. */
1608  outl(0x32, ioaddr + CSR12);
1609  tp->csr6 = 0x00420000;
1610  outl(0x0001B078, ioaddr + 0xB8);
1611  outl(0x0201B078, ioaddr + 0xB8);
1612  }
1613  break;
1614  case MX98713: case COMPEX9881:
1615  tp->if_port = 0;
1616  tp->csr6 = 0x01880000 | (tp->full_duplex ? 0x0200 : 0);
1617  outl(0x0f370000 | inw(ioaddr + 0x80), ioaddr + 0x80);
1618  break;
1619  case MX98715: case MX98725:
1620  /* Provided by BOLO, Macronix - 12/10/1998. */
1621  tp->if_port = 0;
1622  tp->csr6 = 0x01a80200;
1623  outl(0x0f370000 | inw(ioaddr + 0x80), ioaddr + 0x80);
1624  outl(0x11000 | inw(ioaddr + 0xa0), ioaddr + 0xa0);
1625  break;
1626  case COMET:
1627  /* Enable automatic Tx underrun recovery */
1628  outl(inl(ioaddr + 0x88) | 1, ioaddr + 0x88);
1629  tp->if_port = 0;
1630  tp->csr6 = 0x00040000;
1631  break;
1632  case AX88140: case AX88141:
1633  tp->csr6 = tp->mii_cnt ? 0x00040100 : 0x00000100;
1634  break;
1635  default:
1636  select_media(nic, 1);
1637  }
1638 }
Definition: tulip.c:295
Definition: tulip.c:151
struct medialeaf mleaf[0]
Definition: tulip.c:331
uint16_t inw(volatile uint16_t *io_addr)
Read 16-bit word from I/O-mapped device.
u8 media
Definition: tulip.c:322
Definition: tulip.c:152
Definition: tulip.c:152
static int mdio_read(struct nic *nic, int phy_id, int location)
static void select_media(struct nic *nic, int startup)
Definition: tulip.c:1672
static void nway_start(struct nic *nic)
unsigned int default_port
Definition: tulip.c:412
struct mediatable * mtable
Definition: tulip.c:416
static const char media_cap[32]
Definition: tulip.c:275
Definition: tulip.c:152
Definition: tulip.c:152
static void whereami(const char *str)
Definition: tulip.c:512
int saved_if_port
Definition: tulip.c:421
int chip_id
Definition: tulip.c:397
Definition: tulip.c:152
Definition: tulip.c:151
static u32 ioaddr
Definition: tulip.c:393
static struct tulip_private * tp
Definition: tulip.c:441
const char * nic_name
Definition: tulip.c:404
static void pnic_do_nway(struct nic *nic)
u8 leafcount
Definition: tulip.c:328
unsigned int if_port
Definition: tulip.c:406
Definition: tulip.c:152
#define outl(data, io_addr)
Definition: io.h:329
u16 defaultmedia
Definition: tulip.c:327
Definition: nic.h:49
static const char *const medianame[32]
Definition: tulip.c:141
Definition: tulip.c:297
Definition: tulip.c:297
Definition: tulip.c:296
unsigned int full_duplex
Definition: tulip.c:407
int cur_index
Definition: tulip.c:420
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
signed char phys[4]
Definition: tulip.c:419
unsigned int nwayset
Definition: tulip.c:411
Definition: tulip.c:152
Definition: tulip.c:151
signed char mii_cnt
Definition: tulip.c:419
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
unsigned int csr6
Definition: tulip.c:405
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
#define DBG2(...)
Definition: compiler.h:515
Definition: tulip.c:297
Definition: tulip.c:297

References AX88140, AX88141, tulip_private::chip_id, COMET, COMPEX9881, CSR12, CSR13, CSR14, CSR15, CSR5, CSR6, tulip_private::csr6, tulip_private::cur_index, DBG, DBG2, DC21041, DC21142, DC21143, tulip_private::default_port, mediatable::defaultmedia, tulip_private::full_duplex, tulip_private::if_port, inl(), inw(), ioaddr, LC82C168, mediatable::leafcount, mdio_read(), medialeaf::media, media_cap, MediaAlwaysFD, MediaIsMII, medianame, tulip_private::mii_cnt, mediatable::mleaf, tulip_private::mtable, MX98713, MX98715, MX98725, tulip_private::nic_name, NULL, nway_start(), tulip_private::nwayset, outl, tulip_private::phys, PNIC2, pnic_do_nway(), tulip_private::saved_if_port, select_media(), tp, TPLnkPass, and whereami().

Referenced by tulip_reset().

◆ start_link()

static void start_link ( struct nic nic)
static

Definition at line 1377 of file tulip.c.

1378 {
1379  int i;
1380 
1381  whereami("start_link\n");
1382 
1383  if ((tp->flags & ALWAYS_CHECK_MII) ||
1384  (tp->mtable && tp->mtable->has_mii) ||
1385  ( ! tp->mtable && (tp->flags & HAS_MII))) {
1386  unsigned int phy, phy_idx;
1387  if (tp->mtable && tp->mtable->has_mii) {
1388  for (i = 0; i < tp->mtable->leafcount; i++)
1389  if (tp->mtable->mleaf[i].media == 11) {
1390  tp->cur_index = i;
1391  tp->saved_if_port = tp->if_port;
1392  select_media(nic, 2);
1393  tp->if_port = tp->saved_if_port;
1394  break;
1395  }
1396  }
1397 
1398  /* Find the connected MII xcvrs. */
1399  for (phy = 0, phy_idx = 0; phy < 32 && phy_idx < sizeof(tp->phys);
1400  phy++) {
1401  int mii_status = mdio_read(nic, phy, 1);
1402  if ((mii_status & 0x8301) == 0x8001 ||
1403  ((mii_status & 0x8000) == 0 && (mii_status & 0x7800) != 0)) {
1404  int mii_reg0 = mdio_read(nic, phy, 0);
1405  int mii_advert = mdio_read(nic, phy, 4);
1406  int to_advert;
1407 
1408  if (tp->mii_advertise)
1409  to_advert = tp->mii_advertise;
1410  else if (tp->advertising[phy_idx])
1411  to_advert = tp->advertising[phy_idx];
1412  else /* Leave unchanged. */
1413  tp->mii_advertise = to_advert = mii_advert;
1414 
1415  tp->phys[phy_idx++] = phy;
1416  DBG("%s: MII transceiver %d config %hX status %hX advertising %hX.\n",
1417  tp->nic_name, phy, mii_reg0, mii_status, mii_advert);
1418  /* Fixup for DLink with miswired PHY. */
1419  if (mii_advert != to_advert) {
1420  DBG("%s: Advertising %hX on PHY %d previously advertising %hX.\n",
1421  tp->nic_name, to_advert, phy, mii_advert);
1422  mdio_write(nic, phy, 4, to_advert);
1423  }
1424  /* Enable autonegotiation: some boards default to off. */
1425  mdio_write(nic, phy, 0, mii_reg0 |
1426  (tp->full_duplex ? 0x1100 : 0x1000) |
1427  (media_cap[tp->default_port]&MediaIs100 ? 0x2000:0));
1428  }
1429  }
1430  tp->mii_cnt = phy_idx;
1431  if (tp->mtable && tp->mtable->has_mii && phy_idx == 0) {
1432  DBG("%s: ***WARNING***: No MII transceiver found!\n",
1433  tp->nic_name);
1434  tp->phys[0] = 1;
1435  }
1436  }
1437 
1438  /* Reset the xcvr interface and turn on heartbeat. */
1439  switch (tp->chip_id) {
1440  case DC21040:
1441  outl(0x00000000, ioaddr + CSR13);
1442  outl(0x00000004, ioaddr + CSR13);
1443  break;
1444  case DC21041:
1445  /* This is nway_start(). */
1446  if (tp->sym_advertise == 0)
1447  tp->sym_advertise = 0x0061;
1448  outl(0x00000000, ioaddr + CSR13);
1449  outl(0xFFFFFFFF, ioaddr + CSR14);
1450  outl(0x00000008, ioaddr + CSR15); /* Listen on AUI also. */
1451  outl(inl(ioaddr + CSR6) | 0x0200, ioaddr + CSR6);
1452  outl(0x0000EF01, ioaddr + CSR13);
1453  break;
1454  case DC21140: default:
1455  if (tp->mtable)
1456  outl(tp->mtable->csr12dir | 0x100, ioaddr + CSR12);
1457  break;
1458  case DC21142:
1459  case PNIC2:
1460  if (tp->mii_cnt || media_cap[tp->if_port] & MediaIsMII) {
1461  outl(0x82020000, ioaddr + CSR6);
1462  outl(0x0000, ioaddr + CSR13);
1463  outl(0x0000, ioaddr + CSR14);
1464  outl(0x820E0000, ioaddr + CSR6);
1465  } else
1466  nway_start(nic);
1467  break;
1468  case LC82C168:
1469  if ( ! tp->mii_cnt) {
1470  tp->nway = 1;
1471  tp->nwayset = 0;
1472  outl(0x00420000, ioaddr + CSR6);
1473  outl(0x30, ioaddr + CSR12);
1474  outl(0x0001F078, ioaddr + 0xB8);
1475  outl(0x0201F078, ioaddr + 0xB8); /* Turn on autonegotiation. */
1476  }
1477  break;
1478  case MX98713: case COMPEX9881:
1479  outl(0x00000000, ioaddr + CSR6);
1480  outl(0x000711C0, ioaddr + CSR14); /* Turn on NWay. */
1481  outl(0x00000001, ioaddr + CSR13);
1482  break;
1483  case MX98715: case MX98725:
1484  outl(0x01a80000, ioaddr + CSR6);
1485  outl(0xFFFFFFFF, ioaddr + CSR14);
1486  outl(0x00001000, ioaddr + CSR12);
1487  break;
1488  case COMET:
1489  /* No initialization necessary. */
1490  break;
1491  }
1492 }
Definition: tulip.c:151
struct medialeaf mleaf[0]
Definition: tulip.c:331
u8 csr12dir
Definition: tulip.c:328
u8 media
Definition: tulip.c:322
Definition: tulip.c:152
Definition: tulip.c:152
static int mdio_read(struct nic *nic, int phy_id, int location)
static void select_media(struct nic *nic, int startup)
Definition: tulip.c:1672
static void nway_start(struct nic *nic)
unsigned int default_port
Definition: tulip.c:412
struct mediatable * mtable
Definition: tulip.c:416
static const char media_cap[32]
Definition: tulip.c:275
u16 advertising[4]
Definition: tulip.c:418
Definition: tulip.c:152
int flags
Definition: tulip.c:400
unsigned has_mii
Definition: tulip.c:329
Definition: tulip.c:152
static void whereami(const char *str)
Definition: tulip.c:512
int saved_if_port
Definition: tulip.c:421
int chip_id
Definition: tulip.c:397
Definition: tulip.c:235
Definition: tulip.c:151
static u32 ioaddr
Definition: tulip.c:393
static struct tulip_private * tp
Definition: tulip.c:441
const char * nic_name
Definition: tulip.c:404
u8 leafcount
Definition: tulip.c:328
static void mdio_write(struct nic *nic, int phy_id, int location, int value)
Definition: tulip.c:151
unsigned int if_port
Definition: tulip.c:406
Definition: tulip.c:152
#define outl(data, io_addr)
Definition: io.h:329
u16 sym_advertise
Definition: tulip.c:415
Definition: nic.h:49
Definition: tulip.c:297
Definition: tulip.c:297
Definition: tulip.c:296
unsigned int full_duplex
Definition: tulip.c:407
int cur_index
Definition: tulip.c:420
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
signed char phys[4]
Definition: tulip.c:419
unsigned int nwayset
Definition: tulip.c:411
unsigned int nway
Definition: tulip.c:411
Definition: tulip.c:151
signed char mii_cnt
Definition: tulip.c:419
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
u16 mii_advertise
Definition: tulip.c:415
Definition: tulip.c:297
Definition: tulip.c:297

References tulip_private::advertising, ALWAYS_CHECK_MII, tulip_private::chip_id, COMET, COMPEX9881, CSR12, mediatable::csr12dir, CSR13, CSR14, CSR15, CSR6, tulip_private::cur_index, DBG, DC21040, DC21041, DC21140, DC21142, tulip_private::default_port, tulip_private::flags, tulip_private::full_duplex, HAS_MII, mediatable::has_mii, tulip_private::if_port, inl(), ioaddr, LC82C168, mediatable::leafcount, mdio_read(), mdio_write(), medialeaf::media, media_cap, MediaIs100, MediaIsMII, tulip_private::mii_advertise, tulip_private::mii_cnt, mediatable::mleaf, tulip_private::mtable, MX98713, MX98715, MX98725, tulip_private::nic_name, tulip_private::nway, nway_start(), tulip_private::nwayset, outl, tulip_private::phys, PNIC2, tulip_private::saved_if_port, select_media(), tulip_private::sym_advertise, tp, and whereami().

Referenced by tulip_probe().

◆ tulip_check_duplex()

static int tulip_check_duplex ( struct nic nic)
static

Definition at line 1874 of file tulip.c.

1875 {
1876  unsigned int bmsr, lpa, negotiated, new_csr6;
1877 
1878  bmsr = mdio_read(nic, tp->phys[0], 1);
1879  lpa = mdio_read(nic, tp->phys[0], 5);
1880 
1881  DBG2("%s: MII status %#x, Link partner report %#x.\n",
1882  tp->nic_name, bmsr, lpa);
1883 
1884  if (bmsr == 0xffff)
1885  return -2;
1886  if ((bmsr & 4) == 0) {
1887  int new_bmsr = mdio_read(nic, tp->phys[0], 1);
1888  if ((new_bmsr & 4) == 0) {
1889  DBG2("%s: No link beat on the MII interface,"
1890  " status %#x.\n", tp->nic_name,
1891  new_bmsr);
1892  return -1;
1893  }
1894  }
1895  tp->full_duplex = lpa & 0x140;
1896 
1897  new_csr6 = tp->csr6;
1898  negotiated = lpa & tp->advertising[0];
1899 
1900  if(negotiated & 0x380) new_csr6 &= ~0x400000;
1901  else new_csr6 |= 0x400000;
1902  if (tp->full_duplex) new_csr6 |= 0x200;
1903  else new_csr6 &= ~0x200;
1904 
1905  if (new_csr6 != tp->csr6) {
1906  tp->csr6 = new_csr6;
1907 
1908  DBG("%s: Setting %s-duplex based on MII"
1909  "#%d link partner capability of %#x.\n",
1910  tp->nic_name,
1911  tp->full_duplex ? "full" : "half",
1912  tp->phys[0], lpa);
1913  return 1;
1914  }
1915 
1916  return 0;
1917 }
static int mdio_read(struct nic *nic, int phy_id, int location)
u16 advertising[4]
Definition: tulip.c:418
static struct tulip_private * tp
Definition: tulip.c:441
const char * nic_name
Definition: tulip.c:404
Definition: nic.h:49
unsigned int full_duplex
Definition: tulip.c:407
signed char phys[4]
Definition: tulip.c:419
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
unsigned int csr6
Definition: tulip.c:405
#define DBG2(...)
Definition: compiler.h:515

References tulip_private::advertising, tulip_private::csr6, DBG, DBG2, tulip_private::full_duplex, mdio_read(), tulip_private::nic_name, tulip_private::phys, and tp.

Referenced by tulip_reset().

◆ tulip_wait()

static void tulip_wait ( unsigned int  nticks)
static

Definition at line 518 of file tulip.c.

519 {
520  unsigned int to = currticks() + nticks;
521  while (currticks() < to)
522  /* wait */ ;
523 }
unsigned long currticks(void)
Get current system time in ticks.
Definition: timer.c:42

References currticks().

Referenced by tulip_probe(), and tulip_reset().

◆ whereami()

static void whereami ( const char *  str)
static

Definition at line 512 of file tulip.c.

513 {
514  DBGP("%s\n", str);
515  /* sleep(2); */
516 }
#define DBGP(...)
Definition: compiler.h:532

References DBGP.

Referenced by init_media(), mdio_read(), mdio_write(), nway_start(), parse_eeprom(), pnic_do_nway(), read_eeprom(), select_media(), start_link(), tulip_disable(), tulip_init_ring(), tulip_poll(), tulip_probe(), tulip_reset(), and tulip_transmit().

◆ mdio_read() [2/2]

int mdio_read ( struct nic *nic  __unused,
int  phy_id,
int  location 
)

Definition at line 555 of file tulip.c.

556 {
557  int i;
558  int read_cmd = (0xf6 << 10) | (phy_id << 5) | location;
559  int retval = 0;
560  long mdio_addr = ioaddr + CSR9;
561 
562  whereami("mdio_read\n");
563 
564  if (tp->chip_id == LC82C168) {
565  int i = 1000;
566  outl(0x60020000 + (phy_id<<23) + (location<<18), ioaddr + 0xA0);
567  inl(ioaddr + 0xA0);
568  inl(ioaddr + 0xA0);
569  while (--i > 0)
570  if ( ! ((retval = inl(ioaddr + 0xA0)) & 0x80000000))
571  return retval & 0xffff;
572  return 0xffff;
573  }
574 
575  if (tp->chip_id == COMET) {
576  if (phy_id == 1) {
577  if (location < 7)
578  return inl(ioaddr + 0xB4 + (location<<2));
579  else if (location == 17)
580  return inl(ioaddr + 0xD0);
581  else if (location >= 29 && location <= 31)
582  return inl(ioaddr + 0xD4 + ((location-29)<<2));
583  }
584  return 0xffff;
585  }
586 
587  /* Establish sync by sending at least 32 logic ones. */
588  for (i = 32; i >= 0; i--) {
589  outl(MDIO_ENB | MDIO_DATA_WRITE1, mdio_addr);
590  mdio_delay();
592  mdio_delay();
593  }
594  /* Shift the read command bits out. */
595  for (i = 15; i >= 0; i--) {
596  int dataval = (read_cmd & (1 << i)) ? MDIO_DATA_WRITE1 : 0;
597 
598  outl(MDIO_ENB | dataval, mdio_addr);
599  mdio_delay();
600  outl(MDIO_ENB | dataval | MDIO_SHIFT_CLK, mdio_addr);
601  mdio_delay();
602  }
603  /* Read the two transition, 16 data, and wire-idle bits. */
604  for (i = 19; i > 0; i--) {
605  outl(MDIO_ENB_IN, mdio_addr);
606  mdio_delay();
607  retval = (retval << 1) | ((inl(mdio_addr) & MDIO_DATA_READ) ? 1 : 0);
608  outl(MDIO_ENB_IN | MDIO_SHIFT_CLK, mdio_addr);
609  mdio_delay();
610  }
611  return (retval>>1) & 0xffff;
612 }
#define MDIO_ENB
Definition: tulip.c:546
#define MDIO_DATA_WRITE1
Definition: tulip.c:545
Definition: tulip.c:152
static void whereami(const char *str)
Definition: tulip.c:512
int chip_id
Definition: tulip.c:397
static u32 ioaddr
Definition: tulip.c:393
#define MDIO_DATA_READ
Definition: tulip.c:548
static struct tulip_private * tp
Definition: tulip.c:441
#define outl(data, io_addr)
Definition: io.h:329
#define MDIO_ENB_IN
Definition: tulip.c:547
Definition: tulip.c:296
unsigned long retval
Definition: xen.h:45
#define MDIO_SHIFT_CLK
Definition: tulip.c:543
#define mdio_delay()
Definition: tulip.c:538
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.

References tulip_private::chip_id, COMET, CSR9, inl(), ioaddr, LC82C168, MDIO_DATA_READ, MDIO_DATA_WRITE1, mdio_delay, MDIO_ENB, MDIO_ENB_IN, MDIO_SHIFT_CLK, outl, retval, tp, and whereami().

◆ mdio_write() [2/2]

void mdio_write ( struct nic *nic  __unused,
int  phy_id,
int  location,
int  value 
)

Definition at line 614 of file tulip.c.

615 {
616  int i;
617  int cmd = (0x5002 << 16) | (phy_id << 23) | (location<<18) | value;
618  long mdio_addr = ioaddr + CSR9;
619 
620  whereami("mdio_write\n");
621 
622  if (tp->chip_id == LC82C168) {
623  int i = 1000;
624  outl(cmd, ioaddr + 0xA0);
625  do
626  if ( ! (inl(ioaddr + 0xA0) & 0x80000000))
627  break;
628  while (--i > 0);
629  return;
630  }
631 
632  if (tp->chip_id == COMET) {
633  if (phy_id != 1)
634  return;
635  if (location < 7)
636  outl(value, ioaddr + 0xB4 + (location<<2));
637  else if (location == 17)
638  outl(value, ioaddr + 0xD0);
639  else if (location >= 29 && location <= 31)
640  outl(value, ioaddr + 0xD4 + ((location-29)<<2));
641  return;
642  }
643 
644  /* Establish sync by sending 32 logic ones. */
645  for (i = 32; i >= 0; i--) {
646  outl(MDIO_ENB | MDIO_DATA_WRITE1, mdio_addr);
647  mdio_delay();
649  mdio_delay();
650  }
651  /* Shift the command bits out. */
652  for (i = 31; i >= 0; i--) {
653  int dataval = (cmd & (1 << i)) ? MDIO_DATA_WRITE1 : 0;
654  outl(MDIO_ENB | dataval, mdio_addr);
655  mdio_delay();
656  outl(MDIO_ENB | dataval | MDIO_SHIFT_CLK, mdio_addr);
657  mdio_delay();
658  }
659  /* Clear out extra bits. */
660  for (i = 2; i > 0; i--) {
661  outl(MDIO_ENB_IN, mdio_addr);
662  mdio_delay();
663  outl(MDIO_ENB_IN | MDIO_SHIFT_CLK, mdio_addr);
664  mdio_delay();
665  }
666 }
#define MDIO_ENB
Definition: tulip.c:546
#define MDIO_DATA_WRITE1
Definition: tulip.c:545
Definition: tulip.c:152
static void whereami(const char *str)
Definition: tulip.c:512
int chip_id
Definition: tulip.c:397
static u32 ioaddr
Definition: tulip.c:393
static struct tulip_private * tp
Definition: tulip.c:441
pseudo_bit_t value[0x00020]
Definition: arbel.h:13
#define outl(data, io_addr)
Definition: io.h:329
#define MDIO_ENB_IN
Definition: tulip.c:547
Definition: tulip.c:296
#define MDIO_SHIFT_CLK
Definition: tulip.c:543
#define mdio_delay()
Definition: tulip.c:538
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
struct golan_eqe_cmd cmd
Definition: CIB_PRM.h:29

References tulip_private::chip_id, cmd, COMET, CSR9, inl(), ioaddr, LC82C168, MDIO_DATA_WRITE1, mdio_delay, MDIO_ENB, MDIO_ENB_IN, MDIO_SHIFT_CLK, outl, tp, value, and whereami().

◆ tulip_init_ring() [2/2]

static void tulip_init_ring ( struct nic *nic  __unused)
static

Definition at line 869 of file tulip.c.

870 {
871  int i;
872 
873  whereami("tulip_init_ring\n");
874 
875  tp->cur_rx = 0;
876 
877  for (i = 0; i < RX_RING_SIZE; i++) {
878  rx_ring[i].status = cpu_to_le32(0x80000000);
879  rx_ring[i].length = cpu_to_le32(BUFLEN);
880  rx_ring[i].buffer1 = virt_to_le32desc(&rxb[i * BUFLEN]);
881  rx_ring[i].buffer2 = virt_to_le32desc(&rx_ring[i+1]);
882  }
883  /* Mark the last entry as wrapping the ring. */
884  rx_ring[i-1].length = cpu_to_le32(DESC_RING_WRAP | BUFLEN);
885  rx_ring[i-1].buffer2 = virt_to_le32desc(&rx_ring[0]);
886 
887  /* We only use 1 transmit buffer, but we use 2 descriptors so
888  transmit engines have somewhere to point to if they feel the need */
889 
890  tx_ring[0].status = 0x00000000;
891  tx_ring[0].buffer1 = virt_to_le32desc(&txb[0]);
892  tx_ring[0].buffer2 = virt_to_le32desc(&tx_ring[1]);
893 
894  /* this descriptor should never get used, since it will never be owned
895  by the machine (status will always == 0) */
896  tx_ring[1].status = 0x00000000;
897  tx_ring[1].buffer1 = virt_to_le32desc(&txb[0]);
898  tx_ring[1].buffer2 = virt_to_le32desc(&tx_ring[0]);
899 
900  /* Mark the last entry as wrapping the ring, though this should never happen */
901  tx_ring[1].length = cpu_to_le32(DESC_RING_WRAP | BUFLEN);
902 }
#define BUFLEN
Definition: tulip.c:365
#define rxb
Definition: tulip.c:439
#define DESC_RING_WRAP
Definition: tulip.c:374
static void whereami(const char *str)
Definition: tulip.c:512
#define RX_RING_SIZE
Definition: tulip.c:428
static struct tulip_private * tp
Definition: tulip.c:441
#define cpu_to_le32(value)
Definition: byteswap.h:107
#define virt_to_le32desc(addr)
Definition: tulip.c:126
#define rx_ring
Definition: tulip.c:438
int cur_rx
Definition: tulip.c:396
#define txb
Definition: tulip.c:437
#define tx_ring
Definition: tulip.c:436

References BUFLEN, cpu_to_le32, tulip_private::cur_rx, DESC_RING_WRAP, rx_ring, RX_RING_SIZE, rxb, tp, tx_ring, txb, virt_to_le32desc, and whereami().

◆ set_rx_mode()

static void set_rx_mode ( struct nic *nic  __unused)
static

Definition at line 905 of file tulip.c.

905  {
906  int csr6 = inl(ioaddr + CSR6) & ~0x00D5;
907 
908  tp->csr6 &= ~0x00D5;
909 
910  /* !IFF_PROMISC */
912  csr6 |= AcceptAllMulticast;
913 
914  outl(csr6, ioaddr + CSR6);
915 
916 
917 
918 }
static u32 ioaddr
Definition: tulip.c:393
static struct tulip_private * tp
Definition: tulip.c:441
#define outl(data, io_addr)
Definition: io.h:329
Definition: tulip.c:296
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
unsigned int csr6
Definition: tulip.c:405

References AcceptAllMulticast, CSR6, tulip_private::csr6, inl(), ioaddr, outl, and tp.

Referenced by tulip_reset().

◆ tulip_irq()

static void tulip_irq ( struct nic *nic  __unused,
irq_action_t action  __unused 
)
static

Definition at line 1150 of file tulip.c.

1151 {
1152  switch ( action ) {
1153  case DISABLE :
1154  break;
1155  case ENABLE :
1156  break;
1157  case FORCE :
1158  break;
1159  }
1160 }
Definition: nic.h:35
Definition: nic.h:37
Definition: nic.h:36

References DISABLE, ENABLE, and FORCE.

◆ nway_start() [2/2]

static void nway_start ( struct nic *nic  __unused)
static

Definition at line 1494 of file tulip.c.

1495 {
1496  int csr14 = ((tp->sym_advertise & 0x0780) << 9) |
1497  ((tp->sym_advertise&0x0020)<<1) | 0xffbf;
1498 
1499  whereami("nway_start\n");
1500 
1501  tp->if_port = 0;
1502  tp->nway = tp->mediasense = 1;
1503  tp->nwayset = tp->lpar = 0;
1504  if (tp->chip_id == PNIC2) {
1505  tp->csr6 = 0x01000000 | (tp->sym_advertise & 0x0040 ? 0x0200 : 0);
1506  return;
1507  }
1508  DBG2("%s: Restarting internal NWay autonegotiation, %X.\n",
1509  tp->nic_name, csr14);
1510  outl(0x0001, ioaddr + CSR13);
1511  outl(csr14, ioaddr + CSR14);
1512  tp->csr6 = 0x82420000 | (tp->sym_advertise & 0x0040 ? 0x0200 : 0);
1513  outl(tp->csr6, ioaddr + CSR6);
1514  if (tp->mtable && tp->mtable->csr15dir) {
1517  } else if (tp->chip_id != PNIC2)
1518  outw(0x0008, ioaddr + CSR15);
1519  if (tp->chip_id == DC21041) /* Trigger NWAY. */
1520  outl(0xEF01, ioaddr + CSR12);
1521  else
1522  outl(0x1301, ioaddr + CSR12);
1523 }
Definition: tulip.c:151
u32 csr15val
Definition: tulip.c:330
#define outw(data, io_addr)
Definition: io.h:319
struct mediatable * mtable
Definition: tulip.c:416
static void whereami(const char *str)
Definition: tulip.c:512
int chip_id
Definition: tulip.c:397
u16 lpar
Definition: tulip.c:417
static u32 ioaddr
Definition: tulip.c:393
static struct tulip_private * tp
Definition: tulip.c:441
const char * nic_name
Definition: tulip.c:404
unsigned int if_port
Definition: tulip.c:406
Definition: tulip.c:152
#define outl(data, io_addr)
Definition: io.h:329
u16 sym_advertise
Definition: tulip.c:415
Definition: tulip.c:297
Definition: tulip.c:297
Definition: tulip.c:296
unsigned int nwayset
Definition: tulip.c:411
unsigned int nway
Definition: tulip.c:411
unsigned int mediasense
Definition: tulip.c:410
unsigned int csr6
Definition: tulip.c:405
u32 csr15dir
Definition: tulip.c:330
#define DBG2(...)
Definition: compiler.h:515
Definition: tulip.c:297
Definition: tulip.c:297

References tulip_private::chip_id, CSR12, CSR13, CSR14, CSR15, mediatable::csr15dir, mediatable::csr15val, CSR6, tulip_private::csr6, DBG2, DC21041, tulip_private::if_port, ioaddr, tulip_private::lpar, tulip_private::mediasense, tulip_private::mtable, tulip_private::nic_name, tulip_private::nway, tulip_private::nwayset, outl, outw, PNIC2, tulip_private::sym_advertise, tp, and whereami().

◆ pnic_do_nway() [2/2]

static void pnic_do_nway ( struct nic *nic  __unused)
static

Definition at line 1640 of file tulip.c.

1641 {
1642  u32 phy_reg = inl(ioaddr + 0xB8);
1643  u32 new_csr6 = tp->csr6 & ~0x40C40200;
1644 
1645  whereami("pnic_do_nway\n");
1646 
1647  if (phy_reg & 0x78000000) { /* Ignore baseT4 */
1648  if (phy_reg & 0x20000000) tp->if_port = 5;
1649  else if (phy_reg & 0x40000000) tp->if_port = 3;
1650  else if (phy_reg & 0x10000000) tp->if_port = 4;
1651  else if (phy_reg & 0x08000000) tp->if_port = 0;
1652  tp->nwayset = 1;
1653  new_csr6 = (tp->if_port & 1) ? 0x01860000 : 0x00420000;
1654  outl(0x32 | (tp->if_port & 1), ioaddr + CSR12);
1655  if (tp->if_port & 1)
1656  outl(0x1F868, ioaddr + 0xB8);
1657  if (phy_reg & 0x30000000) {
1658  tp->full_duplex = 1;
1659  new_csr6 |= 0x00000200;
1660  }
1661  DBG2("%s: PNIC autonegotiated status %X, %s.\n",
1662  tp->nic_name, phy_reg, medianame[tp->if_port]);
1663  if (tp->csr6 != new_csr6) {
1664  tp->csr6 = new_csr6;
1665  outl(tp->csr6 | 0x0002, ioaddr + CSR6); /* Restart Tx */
1666  outl(tp->csr6 | 0x2002, ioaddr + CSR6);
1667  }
1668  }
1669 }
static void whereami(const char *str)
Definition: tulip.c:512
static u32 ioaddr
Definition: tulip.c:393
static struct tulip_private * tp
Definition: tulip.c:441
const char * nic_name
Definition: tulip.c:404
unsigned int if_port
Definition: tulip.c:406
#define outl(data, io_addr)
Definition: io.h:329
static const char *const medianame[32]
Definition: tulip.c:141
Definition: tulip.c:296
unsigned int full_duplex
Definition: tulip.c:407
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
unsigned int nwayset
Definition: tulip.c:411
unsigned int csr6
Definition: tulip.c:405
uint32_t u32
Definition: stdint.h:23
#define DBG2(...)
Definition: compiler.h:515
Definition: tulip.c:297

References CSR12, CSR6, tulip_private::csr6, DBG2, tulip_private::full_duplex, tulip_private::if_port, inl(), ioaddr, medianame, tulip_private::nic_name, tulip_private::nwayset, outl, tp, and whereami().

◆ PCI_DRIVER()

PCI_DRIVER ( tulip_driver  ,
tulip_nics  ,
PCI_NO_CLASS   
)

◆ DRIVER()

DRIVER ( "Tulip"  ,
nic_driver  ,
pci_driver  ,
tulip_driver  ,
tulip_probe  ,
tulip_disable   
)

Variable Documentation

◆ csr0

const int csr0 = 0x01A00000 | 0x8000
static

Definition at line 137 of file tulip.c.

Referenced by tulip_probe().

◆ medianame

const char* const medianame[32]
static
Initial value:
= {
"10baseT", "10base2", "AUI", "100baseTx",
"10baseT-FDX", "100baseTx-FDX", "100baseT4", "100baseFx",
"100baseFx-FDX", "MII 10baseT", "MII 10baseT-FDX", "MII",
"10baseT(forced)", "MII 100baseTx", "MII 100baseTx-FDX", "MII 100baseT4",
"MII 100baseFx-HDX", "MII 100baseFx-FDX", "Home-PNA 1Mbps", "Invalid-19",
}

Definition at line 141 of file tulip.c.

Referenced by init_media(), parse_eeprom(), pnic_do_nway(), and select_media().

◆ pci_id_tbl

const struct pci_id_info pci_id_tbl[]
static

Definition at line 176 of file tulip.c.

Referenced by tulip_probe().

◆ tulip_tbl

struct tulip_chip_table tulip_tbl[]
static
Initial value:
= {
{ "Digital DC21040 Tulip", 0},
{ "Digital DC21041 Tulip", HAS_MEDIA_TABLE | HAS_NWAY },
{ "Digital DS21140 Tulip", HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM },
{ "Digital DS21143 Tulip", HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII
{ "Lite-On 82c168 PNIC", HAS_MII | HAS_PNICNWAY },
{ "Macronix 98713 PMAC", HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM },
{ "Macronix 98715 PMAC", HAS_MEDIA_TABLE },
{ "Macronix 98725 PMAC", HAS_MEDIA_TABLE },
{ "ASIX AX88140", HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM
| IS_ASIX },
{ "Lite-On PNIC-II", HAS_MII | HAS_NWAY | HAS_8023X },
{ "ADMtek Comet", HAS_MII | MC_HASH_ONLY },
{ "Compex 9881 PMAC", HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM },
{ "Intel DS21145 Tulip", HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII
{ "Xircom tulip work-alike", HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII
{ "SGThomson STE10/100A", HAS_MII | MC_HASH_ONLY },
{ NULL, 0 },
}
Definition: tulip.c:235
Definition: tulip.c:238
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

Referenced by tulip_probe().

◆ media_cap

const char media_cap[32]
static
Initial value:
=
{0,0,0,16, 3,19,16,24, 27,4,7,5, 0,20,23,20, 20,31,0,0, }

Definition at line 275 of file tulip.c.

Referenced by init_media(), select_media(), start_link(), and tulip_probe().

◆ t21040_csr13

u8 t21040_csr13[] = {2,0x0C,8,4, 4,0,0,0, 0,0,0,0, 4,0,0,0}
static

Definition at line 277 of file tulip.c.

Referenced by select_media().

◆ t21041_csr13

u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, }
static

Definition at line 280 of file tulip.c.

Referenced by select_media().

◆ t21041_csr14

u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, }
static

Definition at line 281 of file tulip.c.

Referenced by select_media().

◆ t21041_csr15

u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, }
static

Definition at line 282 of file tulip.c.

Referenced by select_media().

◆ t21142_csr14

u16 t21142_csr14[] = { 0xFFFF, 0x0705, 0x0705, 0x0000, 0x7F3D, }
static

Definition at line 287 of file tulip.c.

Referenced by select_media().

◆ ioaddr

u32 ioaddr
static

◆ tx_ring

struct tulip_tx_desc tx_ring[TX_RING_SIZE]

Definition at line 430 of file tulip.c.

◆ txb

unsigned char txb[BUFLEN]

Definition at line 431 of file tulip.c.

◆ rx_ring

struct tulip_rx_desc rx_ring[RX_RING_SIZE]

Definition at line 432 of file tulip.c.

◆ rxb

unsigned char rxb[RX_RING_SIZE *BUFLEN]

Definition at line 433 of file tulip.c.

◆ tpx

struct tulip_private tpx

Definition at line 434 of file tulip.c.

◆ __shared

struct { ... } __shared

◆ tp

struct tulip_private* tp
static

Definition at line 441 of file tulip.c.

Referenced by __mdio_read(), __mdio_write(), __tg3_set_coalesce(), __tg3_set_mac_addr(), __tg3_set_rx_mode(), fiber_autoneg(), init_media(), mdio_read(), mdio_write(), nway_start(), parse_eeprom(), pnic_do_nway(), select_media(), set_rx_mode(), sis190_default_phy(), sis190_down(), sis190_free(), sis190_get_mac_addr_from_apc(), sis190_get_mac_addr_from_eeprom(), sis190_hw_start(), sis190_init_board(), sis190_init_phy(), sis190_init_ring(), sis190_init_ring_indexes(), sis190_init_rxfilter(), sis190_irq(), sis190_mii_probe(), sis190_mii_probe_88e1111_fixup(), sis190_mii_remove(), sis190_open(), sis190_phy_task(), sis190_poll(), sis190_probe(), sis190_process_rx(), sis190_process_tx(), sis190_remove(), sis190_rx_fill(), sis190_set_rgmii(), sis190_set_rx_mode(), sis190_set_speed_auto(), sis190_transmit(), sky2_ramset(), start_link(), tg3_5700_link_polarity(), tg3_abort_hw(), tg3_adv_1000T_flowctrl_ok(), tg3_alloc_consistent(), tg3_aux_stat_to_speed_duplex(), tg3_bmcr_reset(), tg3_chip_reset(), tg3_close(), tg3_copper_is_advertising_all(), tg3_disable_ints(), tg3_disable_nvram_access(), tg3_do_test_dma(), tg3_enable_ints(), tg3_enable_nvram_access(), tg3_fiber_aneg_smachine(), tg3_free_consistent(), tg3_get_device_address(), tg3_get_eeprom_hw_cfg(), tg3_get_invariants(), tg3_halt(), tg3_init_5401phy_dsp(), tg3_init_bcm8002(), tg3_init_bufmgr_config(), tg3_init_hw(), tg3_init_one(), tg3_init_rings(), tg3_irq(), tg3_link_report(), tg3_lookup_by_subsys(), tg3_mdio_init(), tg3_nvram_lock(), tg3_nvram_phys_addr(), tg3_nvram_read(), tg3_nvram_read_be32(), tg3_nvram_unlock(), tg3_open(), tg3_phy_apply_otp(), tg3_phy_autoneg_cfg(), tg3_phy_auxctl_read(), tg3_phy_auxctl_write(), tg3_phy_copper_begin(), tg3_phy_init_link_config(), tg3_phy_probe(), tg3_phy_reset(), tg3_phy_reset_5703_4_5(), tg3_phy_reset_chanpat(), tg3_phy_set_wirespeed(), tg3_phy_toggle_automdix(), tg3_phy_write_and_check_testpat(), tg3_phydsp_write(), tg3_poll(), tg3_poll_fw(), tg3_poll_link(), tg3_read32_mbox_5906(), tg3_read_indirect_mbox(), tg3_read_indirect_reg32(), tg3_read_mem(), tg3_read_otp_phycfg(), tg3_readphy(), tg3_refill_prod_ring(), tg3_reset_hw(), tg3_restore_pci_state(), tg3_rings_reset(), tg3_rx_complete(), tg3_rx_prodring_fini(), tg3_save_pci_state(), tg3_set_bdinfo(), tg3_set_power_state_0(), tg3_set_txd(), tg3_setup_copper_phy(), tg3_setup_fiber_by_hand(), tg3_setup_fiber_hw_autoneg(), tg3_setup_fiber_mii_phy(), tg3_setup_fiber_phy(), tg3_setup_flow_control(), tg3_setup_phy(), tg3_setup_rxbd_thresholds(), tg3_stop_block(), tg3_stop_fw(), tg3_switch_clocks(), tg3_test_and_report_link_chg(), tg3_test_dma(), tg3_transmit(), tg3_tx_avail(), tg3_tx_complete(), tg3_ump_link_report(), tg3_wait_macro_done(), tg3_write32_mbox_5906(), tg3_write_indirect_mbox(), tg3_write_indirect_reg32(), tg3_write_mem(), tg3_write_sig_pre_reset(), tg3_writephy(), tulip_check_duplex(), tulip_init_ring(), tulip_poll(), tulip_probe(), tulip_reset(), tulip_transmit(), and tw32_mailbox_flush().

◆ eeprom_fixups

struct fixups eeprom_fixups[]
static
Initial value:
= {
{"Asante", 0, 0, 0x94, {0x1e00, 0x0000, 0x0800, 0x0100, 0x018c,
0x0000, 0x0000, 0xe078, 0x0001, 0x0050, 0x0018 }},
{"SMC9332DST", 0, 0, 0xC0, { 0x1e00, 0x0000, 0x0800, 0x041f,
0x0000, 0x009E,
0x0004, 0x009E,
0x0903, 0x006D,
0x0905, 0x006D, }},
{"Cogent EM100", 0, 0, 0x92, { 0x1e00, 0x0000, 0x0800, 0x063f,
0x0107, 0x8021,
0x0108, 0x8021,
0x0100, 0x009E,
0x0104, 0x009E,
0x0103, 0x006D,
0x0105, 0x006D, }},
{"Maxtech NX-110", 0, 0, 0xE8, { 0x1e00, 0x0000, 0x0800, 0x0513,
0x1001, 0x009E,
0x0000, 0x009E,
0x0004, 0x009E,
0x0303, 0x006D,
0x0305, 0x006D, }},
{"Accton EN1207", 0, 0, 0xE8, { 0x1e00, 0x0000, 0x0800, 0x051F,
0x1B01, 0x0000,
0x0B00, 0x009E,
0x0B04, 0x009E,
0x1B03, 0x006D,
0x1B05, 0x006D,
}},
{NULL, 0, 0, 0, {}}}
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

Referenced by parse_eeprom().

◆ block_name

const char* block_name[]
static
Initial value:
= {"21140 non-MII", "21140 MII PHY",
"21142 Serial PHY", "21142 MII PHY", "21143 SYM PHY", "21143 reset method"}

Definition at line 480 of file tulip.c.

Referenced by parse_eeprom().

◆ tulip_operations

struct nic_operations tulip_operations
static
Initial value:
= {
.connect = dummy_connect,
.poll = tulip_poll,
.transmit = tulip_transmit,
.irq = tulip_irq,
}
static void tulip_irq(struct nic *nic __unused, irq_action_t action __unused)
Definition: tulip.c:1150
static void tulip_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p)
Definition: tulip.c:1040
int dummy_connect(struct nic *nic __unused)
Definition: legacy.c:151
static int tulip_poll(struct nic *nic, int retrieve)
Definition: tulip.c:1095

Definition at line 1162 of file tulip.c.

Referenced by tulip_probe().

◆ tulip_nics

struct pci_device_id tulip_nics[]
static

Definition at line 1919 of file tulip.c.