51 #define drv_version "v1.4" 52 #define drv_date "01-17-2004" 56 #define TX_TIME_OUT (6*HZ) 59 #define virt_to_le32desc(addr) cpu_to_le32(virt_to_bus(addr)) 60 #define le32desc_to_virt(addr) bus_to_virt(le32_to_cpu(addr)) 83 static void TLan_PhyMonitor(
struct nic *
nic);
96 "10BaseT-HD ",
"10BaseT-FD ",
"100baseTx-HD ",
97 "100baseTx-FD",
"100baseT4",
NULL 121 {
"Compaq Netelligent 10 T PCI UTP",
NETEL10,
122 {0xae340e11, 0xffffffff, 0, 0, 0, 0},
124 {
"Compaq Netelligent 10/100 TX PCI UTP",
NETEL100,
125 {0xae320e11, 0xffffffff, 0, 0, 0, 0},
127 {
"Compaq Integrated NetFlex-3/P",
NETFLEX3I,
128 {0xae350e11, 0xffffffff, 0, 0, 0, 0},
130 {
"Compaq NetFlex-3/P",
THUNDER,
131 {0xf1300e11, 0xffffffff, 0, 0, 0, 0},
134 {0xf1500e11, 0xffffffff, 0, 0, 0, 0},
136 {
"Compaq Netelligent Integrated 10/100 TX UTP",
NETEL100PI,
137 {0xae430e11, 0xffffffff, 0, 0, 0, 0},
139 {
"Compaq Netelligent Dual 10/100 TX PCI UTP",
NETEL100D,
140 {0xae400e11, 0xffffffff, 0, 0, 0, 0},
142 {
"Compaq Netelligent 10/100 TX Embedded UTP",
NETEL100I,
143 {0xb0110e11, 0xffffffff, 0, 0, 0, 0},
145 {
"Olicom OC-2183/2185",
OC2183,
146 {0x0013108d, 0xffffffff, 0, 0, 0, 0},
148 {
"Olicom OC-2325",
OC2325,
149 {0x0012108d, 0xffffffff, 0, 0, 0, 0},
151 {
"Olicom OC-2326",
OC2326,
152 {0x0014108d, 0xffffffff, 0, 0, 0, 0},
155 {0xb0300e11, 0xffffffff, 0, 0, 0, 0},
158 {0xb0120e11, 0xffffffff, 0, 0, 0, 0},
160 {
"Compaq NetFlex-3/E", 0,
164 {
"Compaq NetFlex-3/E", 0,
188 #define tx_ring tlan_buffers.tx_ring 189 #define txb tlan_buffers.txb 190 #define rx_ring tlan_buffers.rx_ring 191 #define rxb tlan_buffers.rxb 273 rx_ring[i].buffer[1].count = 0;
274 rx_ring[i].buffer[1].address = 0;
389 u16 tlphy_id1, tlphy_id2;
423 DBG (
"TLAN: %s: Link active with ",
426 DBG (
"forced 10%sMbps %s-Duplex\n",
433 (
"AutoNegotiation enabled, at 10%sMbps %s-Duplex\n",
438 DBG (
"TLAN: Partner capability: " );
439 for (i = 5; i <= 10; i++)
453 TLan_PhyMonitor(
nic);
478 (
"TLAN: %s: Link inactive, will retry in 10 secs...\n",
517 framesize =
rx_ring[entry].frameSize;
521 DBG (
".%d.", (
unsigned int) framesize );
586 DBG (
"INT0-0x%hX\n", host_int );
596 printf(
"TRANSMIT: %s is busy (Head=%p Tail=%x)\n",
617 tail_buffer[s++] =
'\0';
653 DBG (
"Out buffer\n" );
657 DBG (
"Fix this \n" );
682 printf(
"Incomplete TX Frame\n");
767 for(i = 0; i< 3; i++)
778 #define board_found 1 820 for (i = 0; i < 6; i++)
826 printf (
"TLAN: %s: Error reading MAC from eeprom: %d\n",
829 DBG (
"%s: %s at ioaddr %#lX, ",
931 for (place = 0x80; place != 0; place >>= 1) {
945 if ((!err) && stop) {
990 for (place = 0x80; place; place >>= 1) {
1134 for (i = 0; i < 16; i++) {
1141 for (
tmp = 0, i = 0x8000; i; i >>= 1) {
1192 for (i = (0x1 << (num_bits - 1)); i; i >>= 1) {
1228 for (i = 0; i < 32; i++) {
1314 for (i = 0; i < 6; i++)
1318 for (i = 0; i < 6; i++)
1366 if ((
control != 0xFFFF) || (hi != 0xFFFF)
1367 || (lo != 0xFFFF)) {
1368 printf(
"PHY found at %hX %hX %hX %hX\n",
1369 (
unsigned int) phy,
control, hi, lo);
1383 (
"TLAN: Cannot initialize device, no PHY was found!\n");
1496 (ability << 5) | 1);
1506 DBG (
"TLAN: %s: Starting autonegotiation.\n",
1576 (
"TLAN: Giving autonegotiation more time.\n");
1578 (
"TLAN: Please check that your adapter has\n");
1580 (
"TLAN: been properly connected to a HUB or Switch.\n");
1582 (
"TLAN: Trying to establish link in the background...\n");
1593 mode = an_adv & an_lpa & 0x03E0;
1594 if (mode & 0x0100) {
1597 }
else if (!(mode & 0x0080) && (mode & 0x0040)) {
1602 if ((!(mode & 0x0180))
1618 || (an_adv & an_lpa & 0x0040)) {
1622 (
"TLAN: Starting internal PHY with FULL-DUPLEX\n" );
1627 (
"TLAN: Starting internal PHY with HALF-DUPLEX\n" );
1675 priv->flags &= ~IFF_RUNNING;
1677 TLan_PhyMonitor(
nic);
1686 printf(
"TLAN: %s has reestablished link\n",
1688 priv->flags |= IFF_RUNNING;
1694 TLan_PhyMonitor(
nic);
1700 PCI_ROM(0x0e11, 0xae32,
"netel100",
"Compaq Netelligent 10/100 TX PCI UTP", 0),
1701 PCI_ROM(0x0e11, 0xae34,
"netel10",
"Compaq Netelligent 10 T PCI UTP", 0),
1702 PCI_ROM(0x0e11, 0xae35,
"netflex3i",
"Compaq Integrated NetFlex-3/P", 0),
1703 PCI_ROM(0x0e11, 0xae40,
"netel100d",
"Compaq Netelligent Dual 10/100 TX PCI UTP", 0),
1704 PCI_ROM(0x0e11, 0xae43,
"netel100pi",
"Compaq Netelligent Integrated 10/100 TX UTP", 0),
1705 PCI_ROM(0x0e11, 0xb011,
"netel100i",
"Compaq Netelligent 10/100 TX Embedded UTP", 0),
1706 PCI_ROM(0x0e11, 0xb012,
"netelligent_10_t2",
"Compaq Netelligent 10 T/2 PCI UTP/Coax", 0),
1707 PCI_ROM(0x0e11, 0xb030,
"netelligent_10_100_ws_5100",
"Compaq Netelligent 10/100 TX UTP", 0),
1708 PCI_ROM(0x0e11, 0xf130,
"thunder",
"Compaq NetFlex-3/P", 0),
1709 PCI_ROM(0x0e11, 0xf150,
"netflex3b",
"Compaq NetFlex-3/P", 0),
1710 PCI_ROM(0x108d, 0x0012,
"oc2325",
"Olicom OC-2325", 0),
1711 PCI_ROM(0x108d, 0x0013,
"oc2183",
"Olicom OC-2183/2185", 0),
1712 PCI_ROM(0x108d, 0x0014,
"oc2326",
"Olicom OC-2326", 0),
u8 TLanBuffer[TLAN_MAX_FRAME_SIZE]
static void refill_rx(struct nic *nic __unused)
static void TLan_PhyStartLink(struct nic *nic)
PCI_DRIVER(tlan_driver, tlan_nics, PCI_NO_CLASS)
#define TLAN_NET_MASK_MASK4
#define TLAN_DEF_REVISION
int printf(const char *fmt,...)
Write a formatted string to the console.
uint16_t inw(volatile uint16_t *io_addr)
Read 16-bit word from I/O-mapped device.
#define TLAN_NET_CFG_PHY_EN
#define TLan_ClearBit(bit, port)
static unsigned int unsigned int reg
static void TLan_PhyDetect(struct nic *nic)
#define le32_to_cpu(value)
#define outw(data, io_addr)
static u8 TLan_DioRead8(u16 base_addr, u16 internal_addr)
unsigned long ioaddr
I/O address.
#define virt_to_le32desc(addr)
static void TLan_SetMac(struct nic *nic __unused, int areg, unsigned char *mac)
#define TLAN_ADAPTER_NONE
static int TLan_EeSendByte(u16, u8, int)
#define TLAN_ADAPTER_USE_INTERN_10
#define TLAN_BUFFERS_PER_LIST
static void TLan_EeReceiveByte(u16, u8 *, int)
DRIVER("TLAN/PCI", nic_driver, pci_driver, tlan_driver, tlan_probe, tlan_disable)
#define TLAN_NET_SIO_MINTEN
uint8_t mac[ETH_ALEN]
MAC address.
#define TLAN_PHY_MAX_ADDR
static void TLan_DioWrite16(u16 base_addr, u16 internal_addr, u16 data)
static void TLan_PhyReset(struct nic *nic)
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
static void tlan_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p)
int dummy_connect(struct nic *nic __unused)
#define TLan_SetBit(bit, port)
#define TLAN_CSTAT_UNUSED
static void TLan_MiiSendData(u16, u32, unsigned)
#define TLAN_NET_SIO_ETXEN
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define __unused
Declare a variable or data structure as unused.
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
uint16_t device
Device ID.
static void TLan_SetMulticastList(struct nic *nic)
#define TLAN_ADAPTER_UNMANAGED_PHY
static void TLan_PhyFinishAutoNeg(struct nic *nic)
#define TLAN_CSTAT_FRM_CMP
void * priv
Driver private data.
pseudo_bit_t value[0x00020]
#define TLAN_NET_MASK_MASK7
static void TLan_ResetLists(struct nic *nic __unused)
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
#define BMSR_ANEGCOMPLETE
static void TLan_EeSendStart(u16)
static void TLan_FinishReset(struct nic *nic __unused)
#define TLAN_NET_SIO_MCLK
static int TLan_MiiReadReg(struct nic *nic __unused, u16, u16, u16 *)
static void tlan_disable(struct nic *nic __unused)
#define TLAN_NET_CMD_NRESET
static void TLan_PhyPowerUp(struct nic *nic)
#define outl(data, io_addr)
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
#define TLAN_NET_CFG_1CHAN
#define TLAN_NET_CFG_1FRAG
#define TLAN_NET_MASK_MASK5
struct TLanList::@353 buffer[TLAN_BUFFERS_PER_LIST]
#define TLan_GetBit(bit, port)
FILE_LICENCE(GPL2_OR_LATER)
#define TLAN_NET_SIO_NMRST
#define TLAN_NET_SIO_MDATA
A PCI device ID list entry.
#define TLAN_NUM_RX_LISTS
static void TLan_PhyPowerDown(struct nic *nic)
static struct nic_operations tlan_operations
uint16_t vendor
Vendor ID.
static void tlan_irq(struct nic *nic __unused, irq_action_t action __unused)
struct pci_id_info::match_info id
#define TLAN_PHY_AN_EN_STAT
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
unsigned char * node_addr
#define outb(data, io_addr)
static int tlan_probe(struct nic *nic, struct pci_device *pci)
static struct tlan_private * priv
Media Independent Interface constants.
#define TLAN_PHY_DUPLEX_FULL
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
struct pci_device_id * id
Driver device ID.
#define TLAN_MAX_FRAME_SIZE
uint8_t data[48]
Additional event data.
#define TLAN_NET_SIO_EDATA
static int TLan_EeReadByte(u16 io_base, u8, u8 *)
static void TLan_DioWrite8(u16 base_addr, u16 internal_addr, u8 data)
static void TLan_MiiSync(u16)
#define TLAN_ADAPTER_ACTIVITY_LED
#define TLAN_ADAPTER_BIT_RATE_PHY
static int tlan_poll(struct nic *nic, int retrieve)
#define TLAN_NET_SIO_ECLOK
#define TLAN_NET_SIO_MTXEN
static const struct pci_id_info tlan_pci_tbl[]
unsigned long currticks(void)
Get current system time in ticks.
#define DBG(...)
Print a debugging message.
struct nic_operations * nic_op
#define TLAN_NET_CMD_DUPLEX
int(* connect)(struct nic *)
#define NULL
NULL pointer (VOID *)
static void TLan_ResetAdapter(struct nic *nic __unused)
#define PCI_ROM(_vendor, _device, _name, _description, _data)
#define TLAN_PHY_SPEED_100
#define TLAN_NUM_TX_LISTS
static void TLan_DioWrite32(u16 base_addr, u16 internal_addr, u32 data)
#define TLAN_NET_CMD_NWRAP
struct eth_slow_lacp_entity_tlv partner
Partner information.
static const char * media[]
static struct tlan_private TLanPrivateInfo
static void TLan_MiiWriteReg(struct nic *nic __unused, u16, u16, u16)