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))
83static 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 tlan_buffers NIC_FAKE_BSS ( struct tlan_bss )
189#define tx_ring tlan_buffers.tx_ring
190#define txb tlan_buffers.txb
191#define rx_ring tlan_buffers.rx_ring
192#define rxb tlan_buffers.rxb
274 rx_ring[i].buffer[1].count = 0;
275 rx_ring[i].buffer[1].address = 0;
348 if (
priv->tlanRev >= 0x30) {
357 if (
priv->aui == 1) {
367 if (
priv->phyNum == 0) {
390 u16 tlphy_id1, tlphy_id2;
396 if (
priv->tlanFullDuplex) {
401 if (
priv->phyNum == 0) {
412 DBG (
"TLAN: %s: Link forced.\n",
priv->nic_name );
424 DBG (
"TLAN: %s: Link active with ",
427 DBG (
"forced 10%sMbps %s-Duplex\n",
434 (
"AutoNegotiation enabled, at 10%sMbps %s-Duplex\n",
439 DBG (
"TLAN: Partner capability: " );
440 for (i = 5; i <= 10; i++)
454 TLan_PhyMonitor(
nic);
457 DBG (
"TLAN: %s: Link active\n",
priv->nic_name );
462 if (
priv->phyNum == 0) {
479 (
"TLAN: %s: Link inactive, will retry in 10 secs...\n",
518 framesize =
rx_ring[entry].frameSize;
522 DBG (
".%d.", (
unsigned int) framesize );
532 priv->cur_rx = entry;
587 DBG (
"INT0-0x%hX\n", host_int );
589 if (!
priv->phyOnline) {
590 printf(
"TRANSMIT: %s PHY is not ready\n",
priv->nic_name);
594 tail_list =
priv->txList +
priv->txTail;
597 printf(
"TRANSMIT: %s is busy (Head=%p Tail=%x)\n",
598 priv->nic_name,
priv->txList, (
unsigned int)
priv->txTail);
618 tail_buffer[s++] =
'\0';
648 if (!
priv->txInProgress) {
649 priv->txInProgress = 1;
653 if (
priv->txTail == 0) {
654 DBG (
"Out buffer\n" );
658 DBG (
"Fix this \n" );
671 head_list =
priv->txList +
priv->txHead;
679 head_list =
priv->txList +
priv->txHead;
683 printf(
"Incomplete TX Frame\n");
686 head_list =
priv->txList +
priv->txHead;
691 priv->txInProgress = 0;
699 if(
priv->tlanRev < 0x30 ) {
701 head_list =
priv->txList +
priv->txHead;
706 priv->txInProgress = 0;
768 for(i = 0; i< 3; i++)
821 for (i = 0; i < 6; i++)
827 printf (
"TLAN: %s: Error reading MAC from eeprom: %d\n",
830 DBG (
"%s: %s at ioaddr %#lX, ",
932 for (place = 0x80; place != 0; place >>= 1) {
946 if ((!err) && stop) {
991 for (place = 0x80; place; place >>= 1) {
1135 for (i = 0; i < 16; i++) {
1142 for (
tmp = 0, i = 0x8000; i; i >>= 1) {
1193 for (i = (0x1 << (num_bits - 1)); i; i >>= 1) {
1229 for (i = 0; i < 32; i++) {
1315 for (i = 0; i < 6; i++)
1319 for (i = 0; i < 6; i++)
1350 priv->phyNum = 0xFFFF;
1367 if ((
control != 0xFFFF) || (hi != 0xFFFF)
1368 || (lo != 0xFFFF)) {
1369 printf(
"PHY found at %hX %hX %hX %hX\n",
1370 (
unsigned int) phy,
control, hi, lo);
1384 (
"TLAN: Cannot initialize device, no PHY was found!\n");
1393 DBG (
"%s: Powering down PHY(s).\n",
priv->nic_name );
1420 DBG (
"%s: Powering up PHY.\n",
priv->nic_name );
1442 DBG (
"%s: Reseting PHY.\n",
priv->nic_name );
1473 DBG (
"%s: Trying to activate link.\n",
priv->nic_name );
1497 (ability << 5) | 1);
1507 DBG (
"TLAN: %s: Starting autonegotiation.\n",
1517 if ((
priv->aui) && (
priv->phyNum != 0)) {
1527 }
else if (
priv->phyNum == 0) {
1575 if (!
priv->neg_be_verbose++) {
1577 (
"TLAN: Giving autonegotiation more time.\n");
1579 (
"TLAN: Please check that your adapter has\n");
1581 (
"TLAN: been properly connected to a HUB or Switch.\n");
1583 (
"TLAN: Trying to establish link in the background...\n");
1591 DBG (
"TLAN: %s: Autonegotiation complete.\n",
priv->nic_name );
1594 mode = an_adv & an_lpa & 0x03E0;
1595 if (
mode & 0x0100) {
1598 }
else if (!(
mode & 0x0080) && (
mode & 0x0040)) {
1603 if ((!(
mode & 0x0180))
1605 && (
priv->phyNum != 0)) {
1617 if (
priv->phyNum == 0) {
1619 || (an_adv & an_lpa & 0x0040)) {
1623 (
"TLAN: Starting internal PHY with FULL-DUPLEX\n" );
1628 (
"TLAN: Starting internal PHY with HALF-DUPLEX\n" );
1675 printf(
"TLAN: %s has lost link\n",
priv->nic_name);
1676 priv->flags &= ~IFF_RUNNING;
1678 TLan_PhyMonitor(
nic);
1687 printf(
"TLAN: %s has reestablished link\n",
1689 priv->flags |= IFF_RUNNING;
1695 TLan_PhyMonitor(
nic);
1701 PCI_ROM(0x0e11, 0xae32,
"netel100",
"Compaq Netelligent 10/100 TX PCI UTP", 0),
1702 PCI_ROM(0x0e11, 0xae34,
"netel10",
"Compaq Netelligent 10 T PCI UTP", 0),
1703 PCI_ROM(0x0e11, 0xae35,
"netflex3i",
"Compaq Integrated NetFlex-3/P", 0),
1704 PCI_ROM(0x0e11, 0xae40,
"netel100d",
"Compaq Netelligent Dual 10/100 TX PCI UTP", 0),
1705 PCI_ROM(0x0e11, 0xae43,
"netel100pi",
"Compaq Netelligent Integrated 10/100 TX UTP", 0),
1706 PCI_ROM(0x0e11, 0xb011,
"netel100i",
"Compaq Netelligent 10/100 TX Embedded UTP", 0),
1707 PCI_ROM(0x0e11, 0xb012,
"netelligent_10_t2",
"Compaq Netelligent 10 T/2 PCI UTP/Coax", 0),
1708 PCI_ROM(0x0e11, 0xb030,
"netelligent_10_100_ws_5100",
"Compaq Netelligent 10/100 TX UTP", 0),
1709 PCI_ROM(0x0e11, 0xf130,
"thunder",
"Compaq NetFlex-3/P", 0),
1710 PCI_ROM(0x0e11, 0xf150,
"netflex3b",
"Compaq NetFlex-3/P", 0),
1711 PCI_ROM(0x108d, 0x0012,
"oc2325",
"Olicom OC-2325", 0),
1712 PCI_ROM(0x108d, 0x0013,
"oc2183",
"Olicom OC-2183/2185", 0),
1713 PCI_ROM(0x108d, 0x0014,
"oc2326",
"Olicom OC-2326", 0),
#define NULL
NULL pointer (VOID *)
pseudo_bit_t value[0x00020]
uint32_t addr
Buffer address.
uint8_t id
Request identifier.
uint8_t data[48]
Additional event data.
uint8_t mac[ETH_ALEN]
MAC address.
uint16_t mode
Acceleration mode.
struct eth_slow_lacp_entity_tlv partner
Partner information.
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
#define __unused
Declare a variable or data structure as unused.
#define DBG(...)
Print a debugging message.
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define le32_to_cpu(value)
#define outb(data, io_addr)
#define outw(data, io_addr)
#define outl(data, io_addr)
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
int dummy_connect(struct nic *nic __unused)
Media Independent Interface constants.
#define BMSR_ANEGCOMPLETE
static unsigned int unsigned int reg
#define DRIVER(_name_text, _unused2, _unused3, _name, _probe, _disable, _fake_bss)
#define PCI_DRIVER(_name, _ids, _class)
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
#define PCI_ROM(_vendor, _device, _name, _description, _data)
struct TLanList::@305343174134316356326231312366206106076301324152 buffer[TLAN_BUFFERS_PER_LIST]
void * priv
Driver private data.
unsigned char * node_addr
struct nic_operations * nic_op
A PCI device ID list entry.
unsigned long ioaddr
I/O address.
struct pci_device_id * id
Driver device ID.
uint16_t vendor
Vendor ID.
uint16_t device
Device ID.
struct TLanList rx_ring[TLAN_NUM_RX_LISTS]
unsigned char rxb[TLAN_MAX_FRAME_SIZE *TLAN_NUM_RX_LISTS]
unsigned char txb[TLAN_MAX_FRAME_SIZE *TLAN_NUM_TX_LISTS]
struct TLanList tx_ring[TLAN_NUM_TX_LISTS]
unsigned long currticks(void)
Get current system time in ticks.
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
static void TLan_MiiSync(u16)
static struct tlan_private * priv
static void TLan_SetMulticastList(struct nic *nic)
static int tlan_poll(struct nic *nic, int retrieve)
static void TLan_EeSendStart(u16)
static void TLan_FinishReset(struct nic *nic __unused)
static struct nic_operations tlan_operations
static void TLan_SetMac(struct nic *nic __unused, int areg, unsigned char *mac)
u8 TLanBuffer[TLAN_MAX_FRAME_SIZE]
static struct tlan_private TLanPrivateInfo
static void TLan_PhyPowerUp(struct nic *nic)
#define virt_to_le32desc(addr)
static void refill_rx(struct nic *nic __unused)
static void tlan_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p)
static void TLan_ResetLists(struct nic *nic __unused)
static void TLan_PhyPowerDown(struct nic *nic)
static void tlan_disable(struct nic *nic __unused, void *hwdev __unused)
static void TLan_MiiWriteReg(struct nic *nic __unused, u16, u16, u16)
@ NETELLIGENT_10_100_WS_5100
static void TLan_MiiSendData(u16, u32, unsigned)
static void TLan_PhyStartLink(struct nic *nic)
static int tlan_probe(struct nic *nic, struct pci_device *pci)
static int TLan_EeSendByte(u16, u8, int)
static void TLan_PhyDetect(struct nic *nic)
static int TLan_EeReadByte(u16 io_base, u8, u8 *)
static const struct pci_id_info tlan_pci_tbl[]
static void TLan_EeReceiveByte(u16, u8 *, int)
static int TLan_MiiReadReg(struct nic *nic __unused, u16, u16, u16 *)
static void TLan_PhyFinishAutoNeg(struct nic *nic)
static void TLan_PhyReset(struct nic *nic)
static void TLan_ResetAdapter(struct nic *nic __unused)
static void tlan_irq(struct nic *nic __unused, irq_action_t action __unused)
#define TLAN_NET_SIO_ECLOK
#define TLAN_NUM_TX_LISTS
#define TLAN_NET_SIO_MDATA
#define TLAN_NET_CFG_1CHAN
#define TLAN_NET_MASK_MASK4
#define TLAN_NET_SIO_EDATA
#define TLAN_CSTAT_UNUSED
#define TLAN_DEF_REVISION
#define TLAN_PHY_AN_EN_STAT
#define TLan_GetBit(bit, port)
#define TLAN_NET_SIO_ETXEN
#define TLAN_NET_CMD_NWRAP
static u8 TLan_DioRead8(u16 base_addr, u16 internal_addr)
#define TLan_ClearBit(bit, port)
#define TLAN_MAX_FRAME_SIZE
#define TLAN_PHY_SPEED_100
#define TLAN_NET_CFG_1FRAG
#define TLAN_CSTAT_FRM_CMP
#define TLAN_NET_SIO_MCLK
#define TLAN_ADAPTER_BIT_RATE_PHY
#define TLAN_BUFFERS_PER_LIST
#define TLAN_NUM_RX_LISTS
#define TLAN_NET_CMD_DUPLEX
static void TLan_DioWrite16(u16 base_addr, u16 internal_addr, u16 data)
#define TLAN_ADAPTER_NONE
#define TLAN_PHY_DUPLEX_FULL
#define TLAN_ADAPTER_UNMANAGED_PHY
static void TLan_DioWrite8(u16 base_addr, u16 internal_addr, u8 data)
#define TLAN_ADAPTER_USE_INTERN_10
#define TLan_SetBit(bit, port)
#define TLAN_NET_CFG_PHY_EN
#define TLAN_NET_SIO_MTXEN
static void TLan_DioWrite32(u16 base_addr, u16 internal_addr, u32 data)
#define TLAN_NET_MASK_MASK5
#define TLAN_ADAPTER_ACTIVITY_LED
#define TLAN_NET_CMD_NRESET
#define TLAN_PHY_MAX_ADDR
#define TLAN_NET_SIO_MINTEN
#define TLAN_NET_SIO_NMRST
#define TLAN_NET_MASK_MASK7
int printf(const char *fmt,...)
Write a formatted string to the console.