iPXE
tlan.c File Reference
#include "etherboot.h"
#include "nic.h"
#include <ipxe/pci.h>
#include <ipxe/ethernet.h>
#include <mii.h>
#include "tlan.h"

Go to the source code of this file.

Data Structures

struct  pci_id_info
struct  pci_id_info::match_info
struct  TLanList
struct  tlan_bss
struct  tlan_private

Macros

#define drv_version   "v1.4"
#define drv_date   "01-17-2004"
#define HZ   100
#define TX_TIME_OUT   (6*HZ)
#define virt_to_le32desc(addr)
#define le32desc_to_virt(addr)
#define tlan_buffers   NIC_FAKE_BSS ( struct tlan_bss )
#define tx_ring   tlan_buffers.tx_ring
#define txb   tlan_buffers.txb
#define rx_ring   tlan_buffers.rx_ring
#define rxb   tlan_buffers.rxb
#define board_found   1
#define valid_link   0

Typedefs

typedef u8 TLanBuffer[TLAN_MAX_FRAME_SIZE]

Enumerations

enum  tlan_nics {
  NETEL10 = 0 , NETEL100 = 1 , NETFLEX3I = 2 , THUNDER = 3 ,
  NETFLEX3B , NETEL100PI = 5 , NETEL100D = 6 , NETEL100I = 7 ,
  OC2183 = 8 , OC2325 = 9 , OC2326 , NETELLIGENT_10_100_WS_5100 = 11 ,
  NETELLIGENT_10_T2 = 12
}

Functions

 FILE_LICENCE (GPL2_OR_LATER)
static void TLan_ResetLists (struct nic *nic __unused)
static void TLan_ResetAdapter (struct nic *nic __unused)
static void TLan_FinishReset (struct nic *nic __unused)
static void TLan_EeSendStart (u16)
static int TLan_EeSendByte (u16, u8, int)
static void TLan_EeReceiveByte (u16, u8 *, int)
static int TLan_EeReadByte (u16 io_base, u8, u8 *)
static void TLan_PhyDetect (struct nic *nic)
static void TLan_PhyPowerDown (struct nic *nic)
static void TLan_PhyPowerUp (struct nic *nic)
static void TLan_SetMac (struct nic *nic __unused, int areg, unsigned char *mac)
static void TLan_PhyReset (struct nic *nic)
static void TLan_PhyStartLink (struct nic *nic)
static void TLan_PhyFinishAutoNeg (struct nic *nic)
static void refill_rx (struct nic *nic __unused)
static int TLan_MiiReadReg (struct nic *nic __unused, u16, u16, u16 *)
static void TLan_MiiSendData (u16, u32, unsigned)
static void TLan_MiiSync (u16)
static void TLan_MiiWriteReg (struct nic *nic __unused, u16, u16, u16)
void TLan_FinishReset (struct nic *nic)
static int tlan_poll (struct nic *nic, int retrieve)
static void tlan_transmit (struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p)
static void tlan_disable (struct nic *nic __unused, void *hwdev __unused)
static void tlan_irq (struct nic *nic __unused, irq_action_t action __unused)
static void TLan_SetMulticastList (struct nic *nic)
static int tlan_probe (struct nic *nic, struct pci_device *pci)
 PCI_DRIVER (tlan_driver, tlan_nics, PCI_NO_CLASS)
 DRIVER ("TLAN/PCI", nic_driver, pci_driver, tlan_driver, tlan_probe, tlan_disable, tlan_buffers)

Variables

static const char * media []
static const struct pci_id_info tlan_pci_tbl []
static int chip_idx
static struct tlan_private TLanPrivateInfo
static struct tlan_privatepriv
static u32 BASE
static struct nic_operations tlan_operations
static struct pci_device_id tlan_nics []

Macro Definition Documentation

◆ drv_version

#define drv_version   "v1.4"

Definition at line 51 of file tlan.c.

◆ drv_date

#define drv_date   "01-17-2004"

Definition at line 52 of file tlan.c.

◆ HZ

#define HZ   100

Definition at line 55 of file tlan.c.

◆ TX_TIME_OUT

#define TX_TIME_OUT   (6*HZ)

Definition at line 56 of file tlan.c.

◆ virt_to_le32desc

#define virt_to_le32desc ( addr)
Value:
uint32_t addr
Buffer address.
Definition dwmac.h:9
#define cpu_to_le32(value)
Definition byteswap.h:108
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
Definition io.h:184

Definition at line 59 of file tlan.c.

Referenced by TLan_ResetLists(), and tlan_transmit().

◆ le32desc_to_virt

#define le32desc_to_virt ( addr)
Value:
#define le32_to_cpu(value)
Definition byteswap.h:114
static __always_inline void * bus_to_virt(unsigned long bus_addr)
Convert bus address to a virtual address.
Definition io.h:196

Definition at line 60 of file tlan.c.

◆ tlan_buffers

#define tlan_buffers   NIC_FAKE_BSS ( struct tlan_bss )

Definition at line 188 of file tlan.c.

Referenced by DRIVER().

◆ tx_ring

#define tx_ring   tlan_buffers.tx_ring

Definition at line 189 of file tlan.c.

◆ txb

#define txb   tlan_buffers.txb

Definition at line 190 of file tlan.c.

◆ rx_ring

#define rx_ring   tlan_buffers.rx_ring

Definition at line 191 of file tlan.c.

◆ rxb

#define rxb   tlan_buffers.rxb

Definition at line 192 of file tlan.c.

◆ board_found

#define board_found   1

Definition at line 779 of file tlan.c.

◆ valid_link

#define valid_link   0

Definition at line 780 of file tlan.c.

Typedef Documentation

◆ TLanBuffer

typedef u8 TLanBuffer[TLAN_MAX_FRAME_SIZE]

Definition at line 194 of file tlan.c.

Enumeration Type Documentation

◆ tlan_nics

enum tlan_nics
Enumerator
NETEL10 
NETEL100 
NETFLEX3I 
THUNDER 
NETFLEX3B 
NETEL100PI 
NETEL100D 
NETEL100I 
OC2183 
OC2325 
OC2326 
NETELLIGENT_10_100_WS_5100 
NETELLIGENT_10_T2 

Definition at line 101 of file tlan.c.

101 {
102 NETEL10 = 0, NETEL100 = 1, NETFLEX3I = 2, THUNDER = 3, NETFLEX3B =
103 4, NETEL100PI = 5,
104 NETEL100D = 6, NETEL100I = 7, OC2183 = 8, OC2325 = 9, OC2326 =
107};
@ NETEL100D
Definition tlan.c:104
@ OC2326
Definition tlan.c:104
@ NETELLIGENT_10_100_WS_5100
Definition tlan.c:105
@ THUNDER
Definition tlan.c:102
@ OC2325
Definition tlan.c:104
@ NETEL100
Definition tlan.c:102
@ NETEL10
Definition tlan.c:102
@ NETFLEX3I
Definition tlan.c:102
@ NETFLEX3B
Definition tlan.c:102
@ OC2183
Definition tlan.c:104
@ NETEL100I
Definition tlan.c:104
@ NETELLIGENT_10_T2
Definition tlan.c:106
@ NETEL100PI
Definition tlan.c:103

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER )

◆ TLan_ResetLists()

void TLan_ResetLists ( struct nic *nic __unused)
static

Definition at line 243 of file tlan.c.

244{
245
246 int i;
247 struct TLanList *list;
248 priv->txHead = 0;
249 priv->txTail = 0;
250
251 for (i = 0; i < TLAN_NUM_TX_LISTS; i++) {
252 list = &tx_ring[i];
253 list->cStat = TLAN_CSTAT_UNUSED;
254 list->buffer[0].address = virt_to_bus(txb +
255 (i * TLAN_MAX_FRAME_SIZE));
256 list->buffer[2].count = 0;
257 list->buffer[2].address = 0;
258 list->buffer[9].address = 0;
259 }
260
261 priv->cur_rx = 0;
262 priv->rx_buf_sz = (TLAN_MAX_FRAME_SIZE);
263// priv->rx_head_desc = &rx_ring[0];
264
265 /* Initialize all the Rx descriptors */
266 for (i = 0; i < TLAN_NUM_RX_LISTS; i++) {
267 rx_ring[i].forward = virt_to_le32desc(&rx_ring[i + 1]);
268 rx_ring[i].cStat = TLAN_CSTAT_READY;
269 rx_ring[i].frameSize = TLAN_MAX_FRAME_SIZE;
270 rx_ring[i].buffer[0].count =
272 rx_ring[i].buffer[0].address =
274 rx_ring[i].buffer[1].count = 0;
275 rx_ring[i].buffer[1].address = 0;
276 }
277
278 /* Mark the last entry as wrapping the ring */
279 rx_ring[i - 1].forward = virt_to_le32desc(&rx_ring[0]);
280 priv->dirty_rx = (unsigned int) (i - TLAN_NUM_RX_LISTS);
281
282} /* TLan_ResetLists */
#define rxb
Definition davicom.c:147
#define txb
Definition davicom.c:145
#define tx_ring
Definition epic100.c:99
#define rx_ring
Definition epic100.c:98
struct TLanList::@305343174134316356326231312366206106076301324152 buffer[TLAN_BUFFERS_PER_LIST]
u32 count
Definition tlan.c:177
u16 cStat
Definition tlan.c:174
u32 address
Definition tlan.c:178
static struct tlan_private * priv
Definition tlan.c:225
#define virt_to_le32desc(addr)
Definition tlan.c:59
#define TLAN_NUM_TX_LISTS
Definition tlan.h:52
#define TLAN_LAST_BUFFER
Definition tlan.h:135
#define TLAN_CSTAT_READY
Definition tlan.h:138
#define TLAN_CSTAT_UNUSED
Definition tlan.h:136
#define TLAN_MAX_FRAME_SIZE
Definition tlan.h:49
#define TLAN_NUM_RX_LISTS
Definition tlan.h:51

References __unused, TLanList::address, TLanList::buffer, TLanList::count, TLanList::cStat, priv, rx_ring, rxb, TLAN_CSTAT_READY, TLAN_CSTAT_UNUSED, TLAN_LAST_BUFFER, TLAN_MAX_FRAME_SIZE, TLAN_NUM_RX_LISTS, TLAN_NUM_TX_LISTS, tx_ring, txb, virt_to_bus(), and virt_to_le32desc.

Referenced by tlan_probe().

◆ TLan_ResetAdapter()

void TLan_ResetAdapter ( struct nic *nic __unused)
static

Definition at line 301 of file tlan.c.

302{
303 int i;
304 u32 addr;
305 u32 data;
306 u8 data8;
307
308 priv->tlanFullDuplex = FALSE;
309 priv->phyOnline = 0;
310/* 1. Assert reset bit. */
311
315
316 udelay(1000);
317
318/* 2. Turn off interrupts. ( Probably isn't necessary ) */
319
323/* 3. Clear AREGs and HASHs. */
324
325 for (i = TLAN_AREG_0; i <= TLAN_HASH_2; i += 4) {
326 TLan_DioWrite32(BASE, (u16) i, 0);
327 }
328
329/* 4. Setup NetConfig register. */
330
331 data =
334
335/* 5. Load Ld_Tmr and Ld_Thr in HOST_CMD. */
336
339
340/* 6. Unreset the MII by setting NMRST (in NetSio) to 1. */
341
345
346/* 7. Setup the remaining registers. */
347
348 if (priv->tlanRev >= 0x30) {
351 }
354
357 if (priv->aui == 1) {
359 } else if (priv->duplex == TLAN_DUPLEX_FULL) {
361 priv->tlanFullDuplex = TRUE;
362 } else {
364 }
365 }
366
367 if (priv->phyNum == 0) {
369 }
371
374 } else {
376 }
377
378} /* TLan_ResetAdapter */
#define BASE
Definition 3c595.h:69
uint8_t data[48]
Additional event data.
Definition ena.h:11
uint8_t flags
Flags.
Definition ena.h:7
uint8_t data8[16]
Definition ib_mad.h:7
#define u8
Definition igbvf_osdep.h:40
#define outw(data, io_addr)
Definition io.h:320
#define inl(io_addr)
Definition io.h:301
#define outl(data, io_addr)
Definition io.h:330
Definition nic.h:49
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition timer.c:61
static void TLan_FinishReset(struct nic *nic __unused)
static void TLan_PhyPowerDown(struct nic *nic)
Definition tlan.c:1389
static void TLan_PhyDetect(struct nic *nic)
Definition tlan.c:1342
static int chip_idx
Definition tlan.c:196
static const struct pci_id_info tlan_pci_tbl[]
Definition tlan.c:120
#define TLAN_NET_CFG_1CHAN
Definition tlan.h:258
#define TLAN_ID_RX_EOC
Definition tlan.h:296
#define TLAN_ID_TX_EOC
Definition tlan.h:294
#define TLAN_HC_LD_THR
Definition tlan.h:204
#define TLAN_DIO_DATA
Definition tlan.h:216
#define TLAN_HC_INT_OFF
Definition tlan.h:206
#define TLAN_HASH_2
Definition tlan.h:274
#define TLAN_NET_CFG_BIT
Definition tlan.h:254
#define TLAN_NET_CFG_1FRAG
Definition tlan.h:257
#define TLAN_HC_AD_RST
Definition tlan.h:202
#define TLAN_ADAPTER_BIT_RATE_PHY
Definition tlan.h:96
#define TLAN_DUPLEX_FULL
Definition tlan.h:106
#define TLAN_ACOMMIT
Definition tlan.h:287
#define TLAN_NET_CONFIG
Definition tlan.h:251
#define TLAN_DIO_ADR
Definition tlan.h:210
#define TLAN_NET_SIO
Definition tlan.h:230
#define TLAN_HC_LD_TMR
Definition tlan.h:203
static void TLan_DioWrite16(u16 base_addr, u16 internal_addr, u16 data)
Definition tlan.h:392
#define TLAN_ADAPTER_UNMANAGED_PHY
Definition tlan.h:95
#define TRUE
Definition tlan.h:46
#define FALSE
Definition tlan.h:45
static void TLan_DioWrite8(u16 base_addr, u16 internal_addr, u8 data)
Definition tlan.h:382
#define TLAN_INT_DIS
Definition tlan.h:293
#define TLan_SetBit(bit, port)
Definition tlan.h:436
#define TLAN_NET_CFG_PHY_EN
Definition tlan.h:260
static void TLan_DioWrite32(u16 base_addr, u16 internal_addr, u32 data)
Definition tlan.h:402
#define TLAN_HOST_CMD
Definition tlan.h:194
#define TLAN_AREG_0
Definition tlan.h:269
#define TLAN_NET_SIO_NMRST
Definition tlan.h:235
#define u16
Definition vga.h:20
#define u32
Definition vga.h:21

References __unused, addr, BASE, chip_idx, data, data8, FALSE, flags, inl, outl, outw, priv, TLAN_ACOMMIT, TLAN_ADAPTER_BIT_RATE_PHY, TLAN_ADAPTER_UNMANAGED_PHY, TLAN_AREG_0, TLAN_DIO_ADR, TLAN_DIO_DATA, TLan_DioWrite16(), TLan_DioWrite32(), TLan_DioWrite8(), TLAN_DUPLEX_FULL, TLan_FinishReset(), TLAN_HASH_2, TLAN_HC_AD_RST, TLAN_HC_INT_OFF, TLAN_HC_LD_THR, TLAN_HC_LD_TMR, TLAN_HOST_CMD, TLAN_ID_RX_EOC, TLAN_ID_TX_EOC, TLAN_INT_DIS, TLAN_NET_CFG_1CHAN, TLAN_NET_CFG_1FRAG, TLAN_NET_CFG_BIT, TLAN_NET_CFG_PHY_EN, TLAN_NET_CONFIG, TLAN_NET_SIO, TLAN_NET_SIO_NMRST, tlan_pci_tbl, TLan_PhyDetect(), TLan_PhyPowerDown(), TLan_SetBit, TRUE, u16, u32, u8, and udelay().

Referenced by tlan_probe().

◆ TLan_FinishReset() [1/2]

void TLan_FinishReset ( struct nic *nic __unused)
static

◆ TLan_EeSendStart()

void TLan_EeSendStart ( u16 io_base)
static

Definition at line 885 of file tlan.c.

886{
887 u16 sio;
888
889 outw(TLAN_NET_SIO, io_base + TLAN_DIO_ADR);
890 sio = io_base + TLAN_DIO_DATA + TLAN_NET_SIO;
891
897
898} /* TLan_EeSendStart */
#define TLAN_NET_SIO_ECLOK
Definition tlan.h:232
#define TLAN_NET_SIO_EDATA
Definition tlan.h:234
#define TLAN_NET_SIO_ETXEN
Definition tlan.h:233
#define TLan_ClearBit(bit, port)
Definition tlan.h:434

References outw, TLan_ClearBit, TLAN_DIO_ADR, TLAN_DIO_DATA, TLAN_NET_SIO, TLAN_NET_SIO_ECLOK, TLAN_NET_SIO_EDATA, TLAN_NET_SIO_ETXEN, TLan_SetBit, and u16.

Referenced by TLan_EeReadByte().

◆ TLan_EeSendByte()

int TLan_EeSendByte ( u16 io_base,
u8 data,
int stop )
static

Definition at line 922 of file tlan.c.

923{
924 int err;
925 u8 place;
926 u16 sio;
927
928 outw(TLAN_NET_SIO, io_base + TLAN_DIO_ADR);
929 sio = io_base + TLAN_DIO_DATA + TLAN_NET_SIO;
930
931 /* Assume clock is low, tx is enabled; */
932 for (place = 0x80; place != 0; place >>= 1) {
933 if (place & data)
935 else
939 }
945
946 if ((!err) && stop) {
947 TLan_ClearBit(TLAN_NET_SIO_EDATA, sio); /* STOP, raise data while clock is high */
950 }
951
952 return (err);
953
954} /* TLan_EeSendByte */
#define TLan_GetBit(bit, port)
Definition tlan.h:435

References data, outw, TLan_ClearBit, TLAN_DIO_ADR, TLAN_DIO_DATA, TLan_GetBit, TLAN_NET_SIO, TLAN_NET_SIO_ECLOK, TLAN_NET_SIO_EDATA, TLAN_NET_SIO_ETXEN, TLan_SetBit, u16, and u8.

Referenced by TLan_EeReadByte().

◆ TLan_EeReceiveByte()

void TLan_EeReceiveByte ( u16 io_base,
u8 * data,
int stop )
static

Definition at line 980 of file tlan.c.

981{
982 u8 place;
983 u16 sio;
984
985 outw(TLAN_NET_SIO, io_base + TLAN_DIO_ADR);
986 sio = io_base + TLAN_DIO_DATA + TLAN_NET_SIO;
987 *data = 0;
988
989 /* Assume clock is low, tx is enabled; */
991 for (place = 0x80; place; place >>= 1) {
994 *data |= place;
996 }
997
999 if (!stop) {
1000 TLan_ClearBit(TLAN_NET_SIO_EDATA, sio); /* Ack = 0 */
1003 } else {
1004 TLan_SetBit(TLAN_NET_SIO_EDATA, sio); /* No ack = 1 (?) */
1007 TLan_ClearBit(TLAN_NET_SIO_EDATA, sio); /* STOP, raise data while clock is high */
1010 }
1011
1012} /* TLan_EeReceiveByte */

References data, outw, TLan_ClearBit, TLAN_DIO_ADR, TLAN_DIO_DATA, TLan_GetBit, TLAN_NET_SIO, TLAN_NET_SIO_ECLOK, TLAN_NET_SIO_EDATA, TLAN_NET_SIO_ETXEN, TLan_SetBit, u16, and u8.

Referenced by TLan_EeReadByte().

◆ TLan_EeReadByte()

int TLan_EeReadByte ( u16 io_base,
u8 ee_addr,
u8 * data )
static

Definition at line 1035 of file tlan.c.

1036{
1037 int err;
1038 int ret = 0;
1039
1040
1041 TLan_EeSendStart(io_base);
1042 err = TLan_EeSendByte(io_base, 0xA0, TLAN_EEPROM_ACK);
1043 if (err) {
1044 ret = 1;
1045 goto fail;
1046 }
1047 err = TLan_EeSendByte(io_base, ee_addr, TLAN_EEPROM_ACK);
1048 if (err) {
1049 ret = 2;
1050 goto fail;
1051 }
1052 TLan_EeSendStart(io_base);
1053 err = TLan_EeSendByte(io_base, 0xA1, TLAN_EEPROM_ACK);
1054 if (err) {
1055 ret = 3;
1056 goto fail;
1057 }
1059 fail:
1060
1061 return ret;
1062
1063} /* TLan_EeReadByte */
static void TLan_EeSendStart(u16)
Definition tlan.c:885
static int TLan_EeSendByte(u16, u8, int)
Definition tlan.c:922
static void TLan_EeReceiveByte(u16, u8 *, int)
Definition tlan.c:980
#define TLAN_EEPROM_ACK
Definition tlan.h:183
#define TLAN_EEPROM_STOP
Definition tlan.h:184

References data, TLAN_EEPROM_ACK, TLAN_EEPROM_STOP, TLan_EeReceiveByte(), TLan_EeSendByte(), TLan_EeSendStart(), u16, and u8.

Referenced by tlan_probe().

◆ TLan_PhyDetect()

void TLan_PhyDetect ( struct nic * nic)
static

Definition at line 1342 of file tlan.c.

1343{
1344 u16 control;
1345 u16 hi;
1346 u16 lo;
1347 u32 phy;
1348
1350 priv->phyNum = 0xFFFF;
1351 return;
1352 }
1353
1355
1356 if (hi != 0xFFFF) {
1357 priv->phy[0] = TLAN_PHY_MAX_ADDR;
1358 } else {
1359 priv->phy[0] = TLAN_PHY_NONE;
1360 }
1361
1362 priv->phy[1] = TLAN_PHY_NONE;
1363 for (phy = 0; phy <= TLAN_PHY_MAX_ADDR; phy++) {
1365 TLan_MiiReadReg(nic, phy, MII_PHYSID1, &hi);
1366 TLan_MiiReadReg(nic, phy, MII_PHYSID2, &lo);
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);
1371 if ((priv->phy[1] == TLAN_PHY_NONE)
1372 && (phy != TLAN_PHY_MAX_ADDR)) {
1373 priv->phy[1] = phy;
1374 }
1375 }
1376 }
1377
1378 if (priv->phy[1] != TLAN_PHY_NONE) {
1379 priv->phyNum = 1;
1380 } else if (priv->phy[0] != TLAN_PHY_NONE) {
1381 priv->phyNum = 0;
1382 } else {
1383 printf
1384 ("TLAN: Cannot initialize device, no PHY was found!\n");
1385 }
1386
1387} /* TLan_PhyDetect */
#define MII_BMCR
Definition atl1e.h:871
#define MII_PHYSID2
Definition atl1e.h:874
#define MII_PHYSID1
Definition atl1e.h:873
uint32_t control
Control.
Definition myson.h:3
static int TLan_MiiReadReg(struct nic *nic __unused, u16, u16, u16 *)
Definition tlan.c:1102
#define TLAN_PHY_NONE
Definition tlan.h:155
#define TLAN_PHY_MAX_ADDR
Definition tlan.h:154
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition vsprintf.c:465

References chip_idx, control, flags, MII_BMCR, MII_PHYSID1, MII_PHYSID2, printf(), priv, TLAN_ADAPTER_UNMANAGED_PHY, TLan_MiiReadReg(), tlan_pci_tbl, TLAN_PHY_MAX_ADDR, TLAN_PHY_NONE, u16, and u32.

Referenced by TLan_ResetAdapter().

◆ TLan_PhyPowerDown()

void TLan_PhyPowerDown ( struct nic * nic)
static

Definition at line 1389 of file tlan.c.

1390{
1391
1392 u16 value;
1393 DBG ( "%s: Powering down PHY(s).\n", priv->nic_name );
1396 TLan_MiiWriteReg(nic, priv->phy[priv->phyNum], MII_BMCR, value);
1397 if ((priv->phyNum == 0) && (priv->phy[1] != TLAN_PHY_NONE)
1398 &&
1403 }
1404
1405 /* Wait for 50 ms and powerup
1406 * This is abitrary. It is intended to make sure the
1407 * tranceiver settles.
1408 */
1409 /* TLan_SetTimer( dev, (HZ/20), TLAN_TIMER_PHY_PUP ); */
1410 mdelay(50);
1412
1413} /* TLan_PhyPowerDown */
pseudo_bit_t value[0x00020]
Definition arbel.h:2
#define DBG(...)
Print a debugging message.
Definition compiler.h:498
#define BMCR_PDOWN
Definition mii.h:49
#define BMCR_LOOPBACK
Definition mii.h:52
#define BMCR_ISOLATE
Definition mii.h:48
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
Definition timer.c:79
static void TLan_MiiSync(u16)
Definition tlan.c:1220
static void TLan_PhyPowerUp(struct nic *nic)
Definition tlan.c:1416
static void TLan_MiiWriteReg(struct nic *nic __unused, u16, u16, u16)
Definition tlan.c:1256
#define TLAN_ADAPTER_USE_INTERN_10
Definition tlan.h:97

References BASE, BMCR_ISOLATE, BMCR_LOOPBACK, BMCR_PDOWN, chip_idx, DBG, flags, mdelay(), MII_BMCR, priv, TLAN_ADAPTER_USE_INTERN_10, TLan_MiiSync(), TLan_MiiWriteReg(), tlan_pci_tbl, TLAN_PHY_NONE, TLan_PhyPowerUp(), u16, and value.

Referenced by TLan_PhyFinishAutoNeg(), TLan_PhyStartLink(), and TLan_ResetAdapter().

◆ TLan_PhyPowerUp()

void TLan_PhyPowerUp ( struct nic * nic)
static

Definition at line 1416 of file tlan.c.

1417{
1418 u16 value;
1419
1420 DBG ( "%s: Powering up PHY.\n", priv->nic_name );
1423 TLan_MiiWriteReg(nic, priv->phy[priv->phyNum], MII_BMCR, value);
1425 /* Wait for 500 ms and reset the
1426 * tranceiver. The TLAN docs say both 50 ms and
1427 * 500 ms, so do the longer, just in case.
1428 */
1429 mdelay(500);
1431 /* TLan_SetTimer( dev, (HZ/20), TLAN_TIMER_PHY_RESET ); */
1432
1433} /* TLan_PhyPowerUp */
static void TLan_PhyReset(struct nic *nic)
Definition tlan.c:1435

References BASE, BMCR_LOOPBACK, DBG, mdelay(), MII_BMCR, priv, TLan_MiiSync(), TLan_MiiWriteReg(), TLan_PhyReset(), u16, and value.

Referenced by TLan_PhyPowerDown().

◆ TLan_SetMac()

void TLan_SetMac ( struct nic *nic __unused,
int areg,
unsigned char * mac )
static

Definition at line 1308 of file tlan.c.

1309{
1310 int i;
1311
1312 areg *= 6;
1313
1314 if (mac != NULL) {
1315 for (i = 0; i < 6; i++)
1316 TLan_DioWrite8(BASE, TLAN_AREG_0 + areg + i,
1317 mac[i]);
1318 } else {
1319 for (i = 0; i < 6; i++)
1320 TLan_DioWrite8(BASE, TLAN_AREG_0 + areg + i, 0);
1321 }
1322
1323} /* TLan_SetMac */
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
uint8_t mac[ETH_ALEN]
MAC address.
Definition ena.h:13

References __unused, BASE, mac, NULL, TLAN_AREG_0, and TLan_DioWrite8().

Referenced by TLan_FinishReset(), and TLan_SetMulticastList().

◆ TLan_PhyReset()

void TLan_PhyReset ( struct nic * nic)
static

Definition at line 1435 of file tlan.c.

1436{
1437 u16 phy;
1438 u16 value;
1439
1440 phy = priv->phy[priv->phyNum];
1441
1442 DBG ( "%s: Reseting PHY.\n", priv->nic_name );
1447 while (value & BMCR_RESET) {
1449 }
1450
1451 /* Wait for 500 ms and initialize.
1452 * I don't remember why I wait this long.
1453 * I've changed this to 50ms, as it seems long enough.
1454 */
1455 /* TLan_SetTimer( dev, (HZ/20), TLAN_TIMER_PHY_START_LINK ); */
1456 mdelay(50);
1458
1459} /* TLan_PhyReset */
#define BMCR_RESET
Definition mii.h:53
static void TLan_PhyStartLink(struct nic *nic)
Definition tlan.c:1462

References BASE, BMCR_LOOPBACK, BMCR_RESET, DBG, mdelay(), MII_BMCR, priv, TLan_MiiReadReg(), TLan_MiiSync(), TLan_MiiWriteReg(), TLan_PhyStartLink(), u16, and value.

Referenced by TLan_PhyPowerUp().

◆ TLan_PhyStartLink()

void TLan_PhyStartLink ( struct nic * nic)
static

Definition at line 1462 of file tlan.c.

1463{
1464
1465 u16 ability;
1466 u16 control;
1467 u16 data;
1468 u16 phy;
1469 u16 status;
1470 u16 tctl;
1471
1472 phy = priv->phy[priv->phyNum];
1473 DBG ( "%s: Trying to activate link.\n", priv->nic_name );
1475 TLan_MiiReadReg(nic, phy, MII_BMSR, &ability);
1476
1477 if ((status & BMSR_ANEGCAPABLE) && (!priv->aui)) {
1478 ability = status >> 11;
1479 if (priv->speed == TLAN_SPEED_10 &&
1480 priv->duplex == TLAN_DUPLEX_HALF) {
1481 TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x0000);
1482 } else if (priv->speed == TLAN_SPEED_10 &&
1483 priv->duplex == TLAN_DUPLEX_FULL) {
1484 priv->tlanFullDuplex = TRUE;
1485 TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x0100);
1486 } else if (priv->speed == TLAN_SPEED_100 &&
1487 priv->duplex == TLAN_DUPLEX_HALF) {
1488 TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x2000);
1489 } else if (priv->speed == TLAN_SPEED_100 &&
1490 priv->duplex == TLAN_DUPLEX_FULL) {
1491 priv->tlanFullDuplex = TRUE;
1492 TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x2100);
1493 } else {
1494
1495 /* Set Auto-Neg advertisement */
1497 (ability << 5) | 1);
1498 /* Enablee Auto-Neg */
1499 TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x1000);
1500 /* Restart Auto-Neg */
1501 TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x1200);
1502 /* Wait for 4 sec for autonegotiation
1503 * to complete. The max spec time is less than this
1504 * but the card need additional time to start AN.
1505 * .5 sec should be plenty extra.
1506 */
1507 DBG ( "TLAN: %s: Starting autonegotiation.\n",
1508 priv->nic_name );
1509 mdelay(4000);
1511 /* TLan_SetTimer( dev, (2*HZ), TLAN_TIMER_PHY_FINISH_AN ); */
1512 return;
1513 }
1514
1515 }
1516
1517 if ((priv->aui) && (priv->phyNum != 0)) {
1518 priv->phyNum = 0;
1519 data =
1523 mdelay(50);
1524 /* TLan_SetTimer( dev, (40*HZ/1000), TLAN_TIMER_PHY_PDOWN ); */
1526 return;
1527 } else if (priv->phyNum == 0) {
1528 control = 0;
1529 TLan_MiiReadReg(nic, phy, TLAN_TLPHY_CTL, &tctl);
1530 if (priv->aui) {
1531 tctl |= TLAN_TC_AUISEL;
1532 } else {
1533 tctl &= ~TLAN_TC_AUISEL;
1534 if (priv->duplex == TLAN_DUPLEX_FULL) {
1536 priv->tlanFullDuplex = TRUE;
1537 }
1538 if (priv->speed == TLAN_SPEED_100) {
1540 }
1541 }
1543 TLan_MiiWriteReg(nic, phy, TLAN_TLPHY_CTL, tctl);
1544 }
1545
1546 /* Wait for 2 sec to give the tranceiver time
1547 * to establish link.
1548 */
1549 /* TLan_SetTimer( dev, (4*HZ), TLAN_TIMER_FINISH_RESET ); */
1550 mdelay(2000);
1552
1553} /* TLan_PhyStartLink */
#define MII_ADVERTISE
Definition atl1e.h:875
#define MII_BMSR
Definition atl1e.h:872
uint8_t status
Status.
Definition ena.h:5
#define BMCR_SPEED100
Definition mii.h:51
#define BMSR_ANEGCAPABLE
Definition mii.h:59
#define BMCR_FULLDPLX
Definition mii.h:46
static void TLan_PhyFinishAutoNeg(struct nic *nic)
Definition tlan.c:1555
#define TLAN_DUPLEX_HALF
Definition tlan.h:105
#define TLAN_SPEED_100
Definition tlan.h:102
#define TLAN_SPEED_10
Definition tlan.h:101
#define TLAN_TC_AUISEL
Definition tlan.h:323
#define TLAN_TLPHY_CTL
Definition tlan.h:320

References BASE, BMCR_FULLDPLX, BMCR_SPEED100, BMSR_ANEGCAPABLE, control, data, DBG, mdelay(), MII_ADVERTISE, MII_BMCR, MII_BMSR, priv, status, TLan_DioWrite16(), TLAN_DUPLEX_FULL, TLAN_DUPLEX_HALF, TLan_FinishReset(), TLan_MiiReadReg(), TLan_MiiWriteReg(), TLAN_NET_CFG_1CHAN, TLAN_NET_CFG_1FRAG, TLAN_NET_CFG_PHY_EN, TLAN_NET_CONFIG, TLan_PhyFinishAutoNeg(), TLan_PhyPowerDown(), TLAN_SPEED_10, TLAN_SPEED_100, TLAN_TC_AUISEL, TLAN_TLPHY_CTL, TRUE, and u16.

Referenced by TLan_PhyReset().

◆ TLan_PhyFinishAutoNeg()

void TLan_PhyFinishAutoNeg ( struct nic * nic)
static

Definition at line 1555 of file tlan.c.

1556{
1557
1558 u16 an_adv;
1559 u16 an_lpa;
1560 u16 data;
1561 u16 mode;
1562 u16 phy;
1563 u16 status;
1564
1565 phy = priv->phy[priv->phyNum];
1566
1568 udelay(1000);
1570
1571 if (!(status & BMSR_ANEGCOMPLETE)) {
1572 /* Wait for 8 sec to give the process
1573 * more time. Perhaps we should fail after a while.
1574 */
1575 if (!priv->neg_be_verbose++) {
1576 printf
1577 ("TLAN: Giving autonegotiation more time.\n");
1578 printf
1579 ("TLAN: Please check that your adapter has\n");
1580 printf
1581 ("TLAN: been properly connected to a HUB or Switch.\n");
1582 printf
1583 ("TLAN: Trying to establish link in the background...\n");
1584 }
1585 mdelay(8000);
1587 /* TLan_SetTimer( dev, (8*HZ), TLAN_TIMER_PHY_FINISH_AN ); */
1588 return;
1589 }
1590
1591 DBG ( "TLAN: %s: Autonegotiation complete.\n", priv->nic_name );
1592 TLan_MiiReadReg(nic, phy, MII_ADVERTISE, &an_adv);
1593 TLan_MiiReadReg(nic, phy, MII_LPA, &an_lpa);
1594 mode = an_adv & an_lpa & 0x03E0;
1595 if (mode & 0x0100) {
1596 printf("Full Duplex\n");
1597 priv->tlanFullDuplex = TRUE;
1598 } else if (!(mode & 0x0080) && (mode & 0x0040)) {
1599 priv->tlanFullDuplex = TRUE;
1600 printf("Full Duplex\n");
1601 }
1602
1603 if ((!(mode & 0x0180))
1605 && (priv->phyNum != 0)) {
1606 priv->phyNum = 0;
1607 data =
1611 /* TLan_SetTimer( nic, (400*HZ/1000), TLAN_TIMER_PHY_PDOWN ); */
1612 mdelay(400);
1614 return;
1615 }
1616
1617 if (priv->phyNum == 0) {
1618 if ((priv->duplex == TLAN_DUPLEX_FULL)
1619 || (an_adv & an_lpa & 0x0040)) {
1622 DBG
1623 ( "TLAN: Starting internal PHY with FULL-DUPLEX\n" );
1624 } else {
1627 DBG
1628 ( "TLAN: Starting internal PHY with HALF-DUPLEX\n" );
1629 }
1630 }
1631
1632 /* Wait for 100 ms. No reason in partiticular.
1633 */
1634 /* TLan_SetTimer( dev, (HZ/10), TLAN_TIMER_FINISH_RESET ); */
1635 mdelay(100);
1637
1638} /* TLan_PhyFinishAutoNeg */
#define MII_LPA
Definition atl1e.h:876
uint16_t mode
Acceleration mode.
Definition ena.h:15
#define BMSR_ANEGCOMPLETE
Definition mii.h:61
#define BMCR_ANENABLE
Definition mii.h:50

References BASE, BMCR_ANENABLE, BMCR_FULLDPLX, BMSR_ANEGCOMPLETE, chip_idx, data, DBG, flags, mdelay(), MII_ADVERTISE, MII_BMCR, MII_BMSR, MII_LPA, mode, printf(), priv, status, TLAN_ADAPTER_USE_INTERN_10, TLan_DioWrite16(), TLAN_DUPLEX_FULL, TLan_FinishReset(), TLan_MiiReadReg(), TLan_MiiWriteReg(), TLAN_NET_CFG_1CHAN, TLAN_NET_CFG_1FRAG, TLAN_NET_CFG_PHY_EN, TLAN_NET_CONFIG, tlan_pci_tbl, TLan_PhyFinishAutoNeg(), TLan_PhyPowerDown(), TRUE, u16, and udelay().

Referenced by TLan_PhyFinishAutoNeg(), and TLan_PhyStartLink().

◆ refill_rx()

void refill_rx ( struct nic *nic __unused)
static

Definition at line 551 of file tlan.c.

552{
553 int entry = 0;
554
555 for (;
556 (priv->cur_rx - priv->dirty_rx +
558 priv->dirty_rx = (priv->dirty_rx + 1) % TLAN_NUM_RX_LISTS) {
559 entry = priv->dirty_rx % TLAN_NUM_TX_LISTS;
560 rx_ring[entry].frameSize = TLAN_MAX_FRAME_SIZE;
561 rx_ring[entry].cStat = TLAN_CSTAT_READY;
562 }
563
564}

References __unused, priv, rx_ring, TLAN_CSTAT_READY, TLAN_MAX_FRAME_SIZE, TLAN_NUM_RX_LISTS, and TLAN_NUM_TX_LISTS.

Referenced by tlan_poll().

◆ TLan_MiiReadReg()

int TLan_MiiReadReg ( struct nic *nic __unused,
u16 phy,
u16 reg,
u16 * val )
static

Definition at line 1102 of file tlan.c.

1103{
1104 u8 nack;
1105 u16 sio, tmp;
1106 u32 i;
1107 int err;
1108 int minten;
1109
1110 err = FALSE;
1113
1115
1116 minten = TLan_GetBit(TLAN_NET_SIO_MINTEN, sio);
1117 if (minten)
1119
1120 TLan_MiiSendData(BASE, 0x1, 2); /* Start ( 01b ) */
1121 TLan_MiiSendData(BASE, 0x2, 2); /* Read ( 10b ) */
1122 TLan_MiiSendData(BASE, phy, 5); /* Device # */
1123 TLan_MiiSendData(BASE, reg, 5); /* Register # */
1124
1125
1126 TLan_ClearBit(TLAN_NET_SIO_MTXEN, sio); /* Change direction */
1127
1128 TLan_ClearBit(TLAN_NET_SIO_MCLK, sio); /* Clock Idle bit */
1130 TLan_ClearBit(TLAN_NET_SIO_MCLK, sio); /* Wait 300ns */
1131
1132 nack = TLan_GetBit(TLAN_NET_SIO_MDATA, sio); /* Check for ACK */
1133 TLan_SetBit(TLAN_NET_SIO_MCLK, sio); /* Finish ACK */
1134 if (nack) { /* No ACK, so fake it */
1135 for (i = 0; i < 16; i++) {
1138 }
1139 tmp = 0xffff;
1140 err = TRUE;
1141 } else { /* ACK, so read data */
1142 for (tmp = 0, i = 0x8000; i; i >>= 1) {
1145 tmp |= i;
1147 }
1148 }
1149
1150
1151 TLan_ClearBit(TLAN_NET_SIO_MCLK, sio); /* Idle cycle */
1153
1154 if (minten)
1156
1157 *val = tmp;
1158
1159 return err;
1160
1161} /* TLan_MiiReadReg */
void __asmcall int val
Definition setjmp.h:12
unsigned long tmp
Definition linux_pci.h:65
static unsigned int unsigned int reg
Definition myson.h:162
static void TLan_MiiSendData(u16, u32, unsigned)
Definition tlan.c:1181
#define TLAN_NET_SIO_MDATA
Definition tlan.h:238
#define TLAN_NET_SIO_MCLK
Definition tlan.h:236
#define TLAN_NET_SIO_MTXEN
Definition tlan.h:237
#define TLAN_NET_SIO_MINTEN
Definition tlan.h:231

References __unused, BASE, FALSE, outw, reg, TLan_ClearBit, TLAN_DIO_ADR, TLAN_DIO_DATA, TLan_GetBit, TLan_MiiSendData(), TLan_MiiSync(), TLAN_NET_SIO, TLAN_NET_SIO_MCLK, TLAN_NET_SIO_MDATA, TLAN_NET_SIO_MINTEN, TLAN_NET_SIO_MTXEN, TLan_SetBit, tmp, TRUE, u16, u32, u8, and val.

Referenced by TLan_FinishReset(), TLan_PhyDetect(), TLan_PhyFinishAutoNeg(), TLan_PhyReset(), and TLan_PhyStartLink().

◆ TLan_MiiSendData()

void TLan_MiiSendData ( u16 base_port,
u32 data,
unsigned num_bits )
static

Definition at line 1181 of file tlan.c.

1182{
1183 u16 sio;
1184 u32 i;
1185
1186 if (num_bits == 0)
1187 return;
1188
1189 outw(TLAN_NET_SIO, base_port + TLAN_DIO_ADR);
1190 sio = base_port + TLAN_DIO_DATA + TLAN_NET_SIO;
1192
1193 for (i = (0x1 << (num_bits - 1)); i; i >>= 1) {
1195 (void) TLan_GetBit(TLAN_NET_SIO_MCLK, sio);
1196 if (data & i)
1198 else
1201 (void) TLan_GetBit(TLAN_NET_SIO_MCLK, sio);
1202 }
1203
1204} /* TLan_MiiSendData */

References data, outw, TLan_ClearBit, TLAN_DIO_ADR, TLAN_DIO_DATA, TLan_GetBit, TLAN_NET_SIO, TLAN_NET_SIO_MCLK, TLAN_NET_SIO_MDATA, TLAN_NET_SIO_MTXEN, TLan_SetBit, u16, and u32.

Referenced by TLan_MiiReadReg(), and TLan_MiiWriteReg().

◆ TLan_MiiSync()

void TLan_MiiSync ( u16 base_port)
static

Definition at line 1220 of file tlan.c.

1221{
1222 int i;
1223 u16 sio;
1224
1225 outw(TLAN_NET_SIO, base_port + TLAN_DIO_ADR);
1226 sio = base_port + TLAN_DIO_DATA + TLAN_NET_SIO;
1227
1229 for (i = 0; i < 32; i++) {
1232 }
1233
1234} /* TLan_MiiSync */

References outw, TLan_ClearBit, TLAN_DIO_ADR, TLAN_DIO_DATA, TLAN_NET_SIO, TLAN_NET_SIO_MCLK, TLAN_NET_SIO_MTXEN, TLan_SetBit, and u16.

Referenced by TLan_MiiReadReg(), TLan_MiiWriteReg(), TLan_PhyPowerDown(), TLan_PhyPowerUp(), and TLan_PhyReset().

◆ TLan_MiiWriteReg()

void TLan_MiiWriteReg ( struct nic *nic __unused,
u16 phy,
u16 reg,
u16 val )
static

Definition at line 1256 of file tlan.c.

1257{
1258 u16 sio;
1259 int minten;
1260
1263
1265
1266 minten = TLan_GetBit(TLAN_NET_SIO_MINTEN, sio);
1267 if (minten)
1269
1270 TLan_MiiSendData(BASE, 0x1, 2); /* Start ( 01b ) */
1271 TLan_MiiSendData(BASE, 0x1, 2); /* Write ( 01b ) */
1272 TLan_MiiSendData(BASE, phy, 5); /* Device # */
1273 TLan_MiiSendData(BASE, reg, 5); /* Register # */
1274
1275 TLan_MiiSendData(BASE, 0x2, 2); /* Send ACK */
1276 TLan_MiiSendData(BASE, val, 16); /* Send Data */
1277
1278 TLan_ClearBit(TLAN_NET_SIO_MCLK, sio); /* Idle cycle */
1280
1281 if (minten)
1283
1284
1285} /* TLan_MiiWriteReg */

References __unused, BASE, outw, reg, TLan_ClearBit, TLAN_DIO_ADR, TLAN_DIO_DATA, TLan_GetBit, TLan_MiiSendData(), TLan_MiiSync(), TLAN_NET_SIO, TLAN_NET_SIO_MCLK, TLAN_NET_SIO_MINTEN, TLan_SetBit, u16, and val.

Referenced by TLan_FinishReset(), TLan_PhyFinishAutoNeg(), TLan_PhyPowerDown(), TLan_PhyPowerUp(), TLan_PhyReset(), and TLan_PhyStartLink().

◆ TLan_FinishReset() [2/2]

void TLan_FinishReset ( struct nic * nic)

Definition at line 380 of file tlan.c.

381{
382
383 u8 data;
384 u32 phy;
385 u8 sio;
386 u16 status;
387 u16 partner;
388 u16 tlphy_ctl;
389 u16 tlphy_par;
390 u16 tlphy_id1, tlphy_id2;
391 int i;
392
393 phy = priv->phy[priv->phyNum];
394
396 if (priv->tlanFullDuplex) {
398 }
401 if (priv->phyNum == 0) {
403 }
405 TLan_DioWrite16(BASE, TLAN_MAX_RX, ((1536) + 7) & ~7);
406 TLan_MiiReadReg(nic, phy, MII_PHYSID1, &tlphy_id1);
407 TLan_MiiReadReg(nic, phy, MII_PHYSID2, &tlphy_id2);
408
410 || (priv->aui)) {
412 DBG ( "TLAN: %s: Link forced.\n", priv->nic_name );
413 } else {
415 udelay(1000);
417 if ((status & BMSR_LSTATUS) && /* We only support link info on Nat.Sem. PHY's */
418 (tlphy_id1 == NAT_SEM_ID1)
419 && (tlphy_id2 == NAT_SEM_ID2)) {
422 &tlphy_par);
423
424 DBG ( "TLAN: %s: Link active with ",
425 priv->nic_name );
426 if (!(tlphy_par & TLAN_PHY_AN_EN_STAT)) {
427 DBG ( "forced 10%sMbps %s-Duplex\n",
428 tlphy_par & TLAN_PHY_SPEED_100 ? ""
429 : "0",
430 tlphy_par & TLAN_PHY_DUPLEX_FULL ?
431 "Full" : "Half" );
432 } else {
433 DBG
434 ( "AutoNegotiation enabled, at 10%sMbps %s-Duplex\n",
435 tlphy_par & TLAN_PHY_SPEED_100 ? "" :
436 "0",
437 tlphy_par & TLAN_PHY_DUPLEX_FULL ?
438 "Full" : "Half" );
439 DBG ( "TLAN: Partner capability: " );
440 for (i = 5; i <= 10; i++)
441 if (partner & (1 << i)) {
442 DBG ( "%s", media[i - 5] );
443 }
444 DBG ( "\n" );
445 }
446
448#ifdef MONITOR
449 /* We have link beat..for now anyway */
450 priv->link = 1;
451 /*Enabling link beat monitoring */
452 /* TLan_SetTimer( nic, (10*HZ), TLAN_TIMER_LINK_BEAT ); */
453 mdelay(10000);
454 TLan_PhyMonitor(nic);
455#endif
456 } else if (status & BMSR_LSTATUS) {
457 DBG ( "TLAN: %s: Link active\n", priv->nic_name );
459 }
460 }
461
462 if (priv->phyNum == 0) {
463 TLan_MiiReadReg(nic, phy, TLAN_TLPHY_CTL, &tlphy_ctl);
464 tlphy_ctl |= TLAN_TC_INTEN;
465 TLan_MiiWriteReg(nic, phy, TLAN_TLPHY_CTL, tlphy_ctl);
467 sio |= TLAN_NET_SIO_MINTEN;
469 }
470
471 if (status & BMSR_LSTATUS) {
473 priv->phyOnline = 1;
474 outb((TLAN_HC_INT_ON >> 8), BASE + TLAN_HOST_CMD + 1);
477 } else {
478 DBG
479 ( "TLAN: %s: Link inactive, will retry in 10 secs...\n",
480 priv->nic_name );
481 /* TLan_SetTimer( nic, (10*HZ), TLAN_TIMER_FINISH_RESET ); */
482 mdelay(10000);
484 return;
485
486 }
487
488} /* TLan_FinishReset */
struct eth_slow_lacp_entity_tlv partner
Partner information.
Definition eth_slow.h:5
#define outb(data, io_addr)
Definition io.h:310
#define BMSR_LSTATUS
Definition mii.h:58
unsigned char * node_addr
Definition nic.h:52
static char media[]
Definition sundance.c:85
static void TLan_SetMac(struct nic *nic __unused, int areg, unsigned char *mac)
Definition tlan.c:1308
#define NAT_SEM_ID1
Definition tlan.h:343
#define TLAN_NET_MASK_MASK4
Definition tlan.h:249
#define TLAN_NET_MASK
Definition tlan.h:245
#define TLAN_HC_GO
Definition tlan.h:195
#define TLAN_PHY_AN_EN_STAT
Definition tlan.h:340
#define TLAN_HC_RT
Definition tlan.h:200
#define TLAN_NET_CMD
Definition tlan.h:221
#define TLAN_NET_CMD_NWRAP
Definition tlan.h:223
static u8 TLan_DioRead8(u16 base_addr, u16 internal_addr)
Definition tlan.h:352
#define TLAN_PHY_SPEED_100
Definition tlan.h:338
#define TLAN_TC_INTEN
Definition tlan.h:328
#define TLAN_LED_REG
Definition tlan.h:288
#define TLAN_NET_CMD_DUPLEX
Definition tlan.h:227
#define TLAN_PHY_DUPLEX_FULL
Definition tlan.h:339
#define TLAN_NET_MASK_MASK5
Definition tlan.h:248
#define TLAN_MAX_RX
Definition tlan.h:292
#define NAT_SEM_ID2
Definition tlan.h:344
#define TLAN_NET_CMD_NRESET
Definition tlan.h:222
#define TLAN_HC_INT_ON
Definition tlan.h:207
#define TLAN_CH_PARM
Definition tlan.h:209
#define TLAN_NET_MASK_MASK7
Definition tlan.h:246
#define TLAN_LED_LINK
Definition tlan.h:290
#define TLAN_TLPHY_PAR
Definition tlan.h:336

References BASE, BMSR_LSTATUS, chip_idx, data, DBG, flags, mdelay(), media, MII_BMSR, MII_LPA, MII_PHYSID1, MII_PHYSID2, NAT_SEM_ID1, NAT_SEM_ID2, nic::node_addr, outb, outl, partner, priv, rx_ring, status, TLAN_ADAPTER_UNMANAGED_PHY, TLAN_CH_PARM, TLan_DioRead8(), TLan_DioWrite16(), TLan_DioWrite8(), TLan_FinishReset(), TLAN_HC_GO, TLAN_HC_INT_ON, TLAN_HC_RT, TLAN_HOST_CMD, TLAN_LED_LINK, TLAN_LED_REG, TLAN_MAX_RX, TLan_MiiReadReg(), TLan_MiiWriteReg(), TLAN_NET_CMD, TLAN_NET_CMD_DUPLEX, TLAN_NET_CMD_NRESET, TLAN_NET_CMD_NWRAP, TLAN_NET_MASK, TLAN_NET_MASK_MASK4, TLAN_NET_MASK_MASK5, TLAN_NET_MASK_MASK7, TLAN_NET_SIO, TLAN_NET_SIO_MINTEN, tlan_pci_tbl, TLAN_PHY_AN_EN_STAT, TLAN_PHY_DUPLEX_FULL, TLAN_PHY_SPEED_100, TLan_SetMac(), TLAN_TC_INTEN, TLAN_TLPHY_CTL, TLAN_TLPHY_PAR, u16, u32, u8, udelay(), and virt_to_bus().

◆ tlan_poll()

int tlan_poll ( struct nic * nic,
int retrieve )
static

Definition at line 493 of file tlan.c.

494{
495 /* return true if there's an ethernet packet ready to read */
496 /* nic->packet should contain data on return */
497 /* nic->packetlen should contain length of data */
498 u32 framesize;
499 u32 host_cmd = 0;
500 u32 ack = 1;
501 int eoc = 0;
502 int entry = priv->cur_rx % TLAN_NUM_RX_LISTS;
503 u16 tmpCStat = le32_to_cpu(rx_ring[entry].cStat);
504 u16 host_int = inw(BASE + TLAN_HOST_INT);
505
506 if ((tmpCStat & TLAN_CSTAT_FRM_CMP) && !retrieve)
507 return 1;
508
509 outw(host_int, BASE + TLAN_HOST_INT);
510
511 if (!(tmpCStat & TLAN_CSTAT_FRM_CMP))
512 return 0;
513
514 /* printf("PI-1: 0x%hX\n", host_int); */
515 if (tmpCStat & TLAN_CSTAT_EOC)
516 eoc = 1;
517
518 framesize = rx_ring[entry].frameSize;
519
520 nic->packetlen = framesize;
521
522 DBG ( ".%d.", (unsigned int) framesize );
523
524 memcpy(nic->packet, rxb +
525 (priv->cur_rx * TLAN_MAX_FRAME_SIZE), nic->packetlen);
526
527 rx_ring[entry].cStat = 0;
528
529 DBG ( "%d", entry );
530
531 entry = (entry + 1) % TLAN_NUM_RX_LISTS;
532 priv->cur_rx = entry;
533 if (eoc) {
534 if ((rx_ring[entry].cStat & TLAN_CSTAT_READY) ==
536 ack |= TLAN_HC_GO | TLAN_HC_RT;
537 host_cmd = TLAN_HC_ACK | ack | 0x001C0000;
538 outl(host_cmd, BASE + TLAN_HOST_CMD);
539 }
540 } else {
541 host_cmd = TLAN_HC_ACK | ack | (0x000C0000);
542 outl(host_cmd, BASE + TLAN_HOST_CMD);
543
544 DBG ( "AC: 0x%hX\n", inw(BASE + TLAN_CH_PARM) );
545 DBG ( "PI-2: 0x%hX\n", inw(BASE + TLAN_HOST_INT) );
546 }
547 refill_rx(nic);
548 return (1); /* initially as this is called to flush the input */
549}
#define inw(io_addr)
Definition io.h:292
void * memcpy(void *dest, const void *src, size_t len) __nonnull
unsigned char * packet
Definition nic.h:53
unsigned int packetlen
Definition nic.h:54
static void refill_rx(struct nic *nic __unused)
Definition tlan.c:551
#define TLAN_HC_ACK
Definition tlan.h:197
#define TLAN_CSTAT_FRM_CMP
Definition tlan.h:137
#define TLAN_HOST_INT
Definition tlan.h:213
#define TLAN_CSTAT_EOC
Definition tlan.h:139

References BASE, TLanList::cStat, DBG, inw, le32_to_cpu, memcpy(), outl, outw, nic::packet, nic::packetlen, priv, refill_rx(), rx_ring, rxb, TLAN_CH_PARM, TLAN_CSTAT_EOC, TLAN_CSTAT_FRM_CMP, TLAN_CSTAT_READY, TLAN_HC_ACK, TLAN_HC_GO, TLAN_HC_RT, TLAN_HOST_CMD, TLAN_HOST_INT, TLAN_MAX_FRAME_SIZE, TLAN_NUM_RX_LISTS, u16, and u32.

◆ tlan_transmit()

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

Definition at line 569 of file tlan.c.

573{ /* Packet */
574 u16 nstype;
575 u32 to;
576 struct TLanList *tail_list;
577 struct TLanList *head_list;
578 u8 *tail_buffer;
579 u32 ack = 0;
580 u32 host_cmd;
581 int eoc = 0;
582 u16 tmpCStat;
583 u16 host_int = inw(BASE + TLAN_HOST_INT);
584
585 int entry = 0;
586
587 DBG ( "INT0-0x%hX\n", host_int );
588
589 if (!priv->phyOnline) {
590 printf("TRANSMIT: %s PHY is not ready\n", priv->nic_name);
591 return;
592 }
593
594 tail_list = priv->txList + priv->txTail;
595
596 if (tail_list->cStat != TLAN_CSTAT_UNUSED) {
597 printf("TRANSMIT: %s is busy (Head=%p Tail=%x)\n",
598 priv->nic_name, priv->txList, (unsigned int) priv->txTail);
599 tx_ring[entry].cStat = TLAN_CSTAT_UNUSED;
600// priv->txBusyCount++;
601 return;
602 }
603
604 tail_list->forward = 0;
605
606 tail_buffer = txb + (priv->txTail * TLAN_MAX_FRAME_SIZE);
607
608 /* send the packet to destination */
609 memcpy(tail_buffer, d, ETH_ALEN);
610 memcpy(tail_buffer + ETH_ALEN, nic->node_addr, ETH_ALEN);
611 nstype = htons((u16) t);
612 memcpy(tail_buffer + 2 * ETH_ALEN, (u8 *) & nstype, 2);
613 memcpy(tail_buffer + ETH_HLEN, p, s);
614
615 s += ETH_HLEN;
616 s &= 0x0FFF;
617 while (s < ETH_ZLEN)
618 tail_buffer[s++] = '\0';
619
620 /*=====================================================*/
621 /* Receive
622 * 0000 0000 0001 1100
623 * 0000 0000 0000 1100
624 * 0000 0000 0000 0011 = 0x0003
625 *
626 * 0000 0000 0000 0000 0000 0000 0000 0011
627 * 0000 0000 0000 1100 0000 0000 0000 0000 = 0x000C0000
628 *
629 * Transmit
630 * 0000 0000 0001 1100
631 * 0000 0000 0000 0100
632 * 0000 0000 0000 0001 = 0x0001
633 *
634 * 0000 0000 0000 0000 0000 0000 0000 0001
635 * 0000 0000 0000 0100 0000 0000 0000 0000 = 0x00040000
636 * */
637
638 /* Setup the transmit descriptor */
639 tail_list->frameSize = (u16) s;
640 tail_list->buffer[0].count = TLAN_LAST_BUFFER | (u32) s;
641 tail_list->buffer[1].count = 0;
642 tail_list->buffer[1].address = 0;
643
644 tail_list->cStat = TLAN_CSTAT_READY;
645
646 DBG ( "INT1-0x%hX\n", inw(BASE + TLAN_HOST_INT) );
647
648 if (!priv->txInProgress) {
649 priv->txInProgress = 1;
650 outl(virt_to_le32desc(tail_list), BASE + TLAN_CH_PARM);
652 } else {
653 if (priv->txTail == 0) {
654 DBG ( "Out buffer\n" );
655 (priv->txList + (TLAN_NUM_TX_LISTS - 1))->forward =
656 virt_to_le32desc(tail_list);
657 } else {
658 DBG ( "Fix this \n" );
659 (priv->txList + (priv->txTail - 1))->forward =
660 virt_to_le32desc(tail_list);
661 }
662 }
663
665
666 DBG ( "INT2-0x%hX\n", inw(BASE + TLAN_HOST_INT) );
667
668 to = currticks() + TX_TIME_OUT;
669 while ((tail_list->cStat == TLAN_CSTAT_READY) && currticks() < to);
670
671 head_list = priv->txList + priv->txHead;
672 while (((tmpCStat = head_list->cStat) & TLAN_CSTAT_FRM_CMP)
673 && (ack < 255)) {
674 ack++;
675 if(tmpCStat & TLAN_CSTAT_EOC)
676 eoc =1;
677 head_list->cStat = TLAN_CSTAT_UNUSED;
679 head_list = priv->txList + priv->txHead;
680
681 }
682 if(!ack)
683 printf("Incomplete TX Frame\n");
684
685 if(eoc) {
686 head_list = priv->txList + priv->txHead;
687 if ((head_list->cStat & TLAN_CSTAT_READY) == TLAN_CSTAT_READY) {
688 outl(virt_to_le32desc(head_list), BASE + TLAN_CH_PARM);
689 ack |= TLAN_HC_GO;
690 } else {
691 priv->txInProgress = 0;
692 }
693 }
694 if(ack) {
695 host_cmd = TLAN_HC_ACK | ack;
696 outl(host_cmd, BASE + TLAN_HOST_CMD);
697 }
698
699 if(priv->tlanRev < 0x30 ) {
700 ack = 1;
701 head_list = priv->txList + priv->txHead;
702 if ((head_list->cStat & TLAN_CSTAT_READY) == TLAN_CSTAT_READY) {
703 outl(virt_to_le32desc(head_list), BASE + TLAN_CH_PARM);
704 ack |= TLAN_HC_GO;
705 } else {
706 priv->txInProgress = 0;
707 }
708 host_cmd = TLAN_HC_ACK | ack | 0x00140000;
709 outl(host_cmd, BASE + TLAN_HOST_CMD);
710
711 }
712
713 if (currticks() >= to) {
714 printf("TX Time Out");
715 }
716}
#define TX_TIME_OUT
Definition davicom.c:51
#define ETH_ZLEN
Definition if_ether.h:11
#define ETH_ALEN
Definition if_ether.h:9
#define ETH_HLEN
Definition if_ether.h:10
#define htons(value)
Definition byteswap.h:136
u16 frameSize
Definition tlan.c:175
u32 forward
Definition tlan.c:173
unsigned long currticks(void)
Get current system time in ticks.
Definition timer.c:43
#define CIRC_INC(a, b)
Definition tlan.h:348

References TLanList::address, BASE, TLanList::buffer, CIRC_INC, TLanList::count, TLanList::cStat, currticks(), DBG, ETH_ALEN, ETH_HLEN, ETH_ZLEN, TLanList::forward, TLanList::frameSize, htons, inw, memcpy(), nic::node_addr, outl, printf(), priv, TLAN_CH_PARM, TLAN_CSTAT_EOC, TLAN_CSTAT_FRM_CMP, TLAN_CSTAT_READY, TLAN_CSTAT_UNUSED, TLAN_HC_ACK, TLAN_HC_GO, TLAN_HOST_CMD, TLAN_HOST_INT, TLAN_LAST_BUFFER, TLAN_MAX_FRAME_SIZE, TLAN_NUM_TX_LISTS, tx_ring, TX_TIME_OUT, txb, u16, u32, u8, and virt_to_le32desc.

◆ tlan_disable()

void tlan_disable ( struct nic *nic __unused,
void *hwdev __unused )
static

Definition at line 721 of file tlan.c.

721 {
722 /* put the card in its initial state */
723 /* This function serves 3 purposes.
724 * This disables DMA and interrupts so we don't receive
725 * unexpected packets or interrupts from the card after
726 * etherboot has finished.
727 * This frees resources so etherboot may use
728 * this driver on another interface
729 * This allows etherboot to reinitialize the interface
730 * if something is something goes wrong.
731 *
732 */
734}

References __unused, BASE, outl, TLAN_HC_AD_RST, and TLAN_HOST_CMD.

Referenced by DRIVER().

◆ tlan_irq()

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

Definition at line 739 of file tlan.c.

740{
741 switch ( action ) {
742 case DISABLE :
743 break;
744 case ENABLE :
745 break;
746 case FORCE :
747 break;
748 }
749}
@ FORCE
Definition nic.h:37
@ ENABLE
Definition nic.h:36
@ DISABLE
Definition nic.h:35

References __unused, DISABLE, ENABLE, and FORCE.

◆ TLan_SetMulticastList()

void TLan_SetMulticastList ( struct nic * nic)
static

Definition at line 759 of file tlan.c.

759 {
760 int i;
761 u8 tmp;
762
763 /* !IFF_PROMISC */
766
767 /* IFF_ALLMULTI */
768 for(i = 0; i< 3; i++)
769 TLan_SetMac(nic, i + 1, NULL);
770 TLan_DioWrite32(BASE, TLAN_HASH_1, 0xFFFFFFFF);
771 TLan_DioWrite32(BASE, TLAN_HASH_2, 0xFFFFFFFF);
772
773
774}
#define TLAN_HASH_1
Definition tlan.h:273
#define TLAN_NET_CMD_CAF
Definition tlan.h:225

References BASE, NULL, TLan_DioRead8(), TLan_DioWrite32(), TLan_DioWrite8(), TLAN_HASH_1, TLAN_HASH_2, TLAN_NET_CMD, TLAN_NET_CMD_CAF, TLan_SetMac(), tmp, and u8.

Referenced by tlan_probe().

◆ tlan_probe()

int tlan_probe ( struct nic * nic,
struct pci_device * pci )
static

Definition at line 781 of file tlan.c.

781 {
782
783 u16 data = 0;
784 int err;
785 int i;
786
787 if (pci->ioaddr == 0)
788 return 0;
789
790 nic->irqno = 0;
791 nic->ioaddr = pci->ioaddr;
792
793 BASE = pci->ioaddr;
794
795 /* Set nic as PCI bus master */
797
798 /* Point to private storage */
800
801 /* Figure out which chip we're dealing with */
802 i = 0;
803 chip_idx = -1;
804 while (tlan_pci_tbl[i].name) {
805 if ((((u32) pci->device << 16) | pci->vendor) ==
806 (tlan_pci_tbl[i].id.pci & 0xffffffff)) {
807 chip_idx = i;
808 break;
809 }
810 i++;
811 }
812 if (chip_idx == -1)
813 return 0;
814
815 priv->vendor_id = pci->vendor;
816 priv->dev_id = pci->device;
817 priv->nic_name = pci->id->name;
818 priv->eoc = 0;
819
820 err = 0;
821 for (i = 0; i < 6; i++)
822 err |= TLan_EeReadByte(BASE,
824 addrOfs + i,
825 (u8 *) & nic->node_addr[i]);
826 if (err) {
827 printf ( "TLAN: %s: Error reading MAC from eeprom: %d\n",
828 pci->id->name, err);
829 } else {
830 DBG ( "%s: %s at ioaddr %#lX, ",
831 pci->id->name, eth_ntoa ( nic->node_addr ), pci->ioaddr );
832 }
833
835 printf("revision: 0x%hX\n", priv->tlanRev);
836
839
843
845 udelay(100);
846 priv->txList = tx_ring;
847
848/* if (board_found && valid_link)
849 {*/
850 /* point to NIC specific routines */
852 return 1;
853}
const char * name
Definition ath9k_hw.c:1986
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
Definition ethernet.c:176
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
Definition pci.c:241
unsigned char irqno
Definition nic.h:56
unsigned int ioaddr
Definition nic.h:55
struct nic_operations * nic_op
Definition nic.h:50
const char * name
Name.
Definition pci.h:177
unsigned long ioaddr
I/O address.
Definition pci.h:226
struct pci_device_id * id
Driver device ID.
Definition pci.h:248
uint16_t vendor
Vendor ID.
Definition pci.h:228
uint16_t device
Device ID.
Definition pci.h:230
static void TLan_SetMulticastList(struct nic *nic)
Definition tlan.c:759
static struct nic_operations tlan_operations
Definition tlan.c:751
static struct tlan_private TLanPrivateInfo
static void TLan_ResetLists(struct nic *nic __unused)
Definition tlan.c:243
static int TLan_EeReadByte(u16 io_base, u8, u8 *)
Definition tlan.c:1035
static void TLan_ResetAdapter(struct nic *nic __unused)
Definition tlan.c:301
#define TLAN_DEF_REVISION
Definition tlan.h:265

References adjust_pci_device(), BASE, chip_idx, data, DBG, pci_device::device, eth_ntoa(), pci_device::id, inl, nic::ioaddr, pci_device::ioaddr, nic::irqno, name, pci_device_id::name, nic::nic_op, nic::node_addr, outw, printf(), priv, TLAN_DEF_REVISION, TLan_DioRead8(), TLan_EeReadByte(), TLAN_HC_INT_OFF, TLAN_HOST_CMD, tlan_operations, tlan_pci_tbl, TLan_ResetAdapter(), TLan_ResetLists(), TLan_SetMulticastList(), TLanPrivateInfo, tx_ring, u16, u32, u8, udelay(), and pci_device::vendor.

Referenced by DRIVER().

◆ PCI_DRIVER()

PCI_DRIVER ( tlan_driver ,
tlan_nics ,
PCI_NO_CLASS  )

◆ DRIVER()

DRIVER ( "TLAN/PCI" ,
nic_driver ,
pci_driver ,
tlan_driver ,
tlan_probe ,
tlan_disable ,
tlan_buffers  )

Variable Documentation

◆ media

const char* media[]
static
Initial value:
= {
"10BaseT-HD ", "10BaseT-FD ", "100baseTx-HD ",
"100baseTx-FD", "100baseT4", NULL
}

Definition at line 95 of file tlan.c.

95 {
96 "10BaseT-HD ", "10BaseT-FD ", "100baseTx-HD ",
97 "100baseTx-FD", "100baseT4", NULL
98};

◆ tlan_pci_tbl

const struct pci_id_info tlan_pci_tbl[]
static

Definition at line 120 of file tlan.c.

120 {
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},
129 TLAN_ADAPTER_NONE, 0x83},
130 {"Compaq NetFlex-3/P", THUNDER,
131 {0xf1300e11, 0xffffffff, 0, 0, 0, 0},
133 {"Compaq NetFlex-3/P", NETFLEX3B,
134 {0xf1500e11, 0xffffffff, 0, 0, 0, 0},
135 TLAN_ADAPTER_NONE, 0x83},
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},
141 TLAN_ADAPTER_NONE, 0x83},
142 {"Compaq Netelligent 10/100 TX Embedded UTP", NETEL100I,
143 {0xb0110e11, 0xffffffff, 0, 0, 0, 0},
144 TLAN_ADAPTER_NONE, 0x83},
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},
154 {"Compaq Netelligent 10/100 TX UTP", NETELLIGENT_10_100_WS_5100,
155 {0xb0300e11, 0xffffffff, 0, 0, 0, 0},
157 {"Compaq Netelligent 10 T/2 PCI UTP/Coax", NETELLIGENT_10_T2,
158 {0xb0120e11, 0xffffffff, 0, 0, 0, 0},
159 TLAN_ADAPTER_NONE, 0x83},
160 {"Compaq NetFlex-3/E", 0, /* EISA card */
161 {0, 0, 0, 0, 0, 0},
164 {"Compaq NetFlex-3/E", 0, /* EISA card */
165 {0, 0, 0, 0, 0, 0},
167 {NULL, 0,
168 {0, 0, 0, 0, 0, 0},
169 0, 0},
170};
#define TLAN_ADAPTER_NONE
Definition tlan.h:94
#define TLAN_ADAPTER_ACTIVITY_LED
Definition tlan.h:98

Referenced by TLan_FinishReset(), TLan_PhyDetect(), TLan_PhyFinishAutoNeg(), TLan_PhyPowerDown(), tlan_probe(), and TLan_ResetAdapter().

◆ chip_idx

◆ TLanPrivateInfo

struct tlan_private TLanPrivateInfo
static

Referenced by tlan_probe().

◆ priv

struct tlan_private* priv
static

Definition at line 225 of file tlan.c.

Referenced by atacmd_identify_done(), cachedhcp_probe(), dt_set_drvdata(), dummy_irq(), eapol_notify(), eapol_probe(), efi_path_net_probe(), efi_snp_notify(), efi_snp_probe(), efi_snp_remove(), efidev_set_drvdata(), eisa_set_drvdata(), fcoe_notify(), fcoe_probe(), fcoe_remove(), forcedeth_close(), forcedeth_irq(), forcedeth_link_status(), forcedeth_map_regs(), forcedeth_open(), forcedeth_poll(), forcedeth_probe(), forcedeth_remove(), forcedeth_transmit(), grf5101_rf_init(), grf5101_rf_set_channel(), grf5101_rf_stop(), grf5101_write_phy_antenna(), guestinfo_net_probe(), ib_cq_set_drvdata(), ib_madx_set_ownerdata(), ib_path_set_ownerdata(), ib_qp_set_drvdata(), ib_qp_set_ownerdata(), ib_set_drvdata(), ib_wq_set_drvdata(), ifec_check_ru_status(), ifec_free(), ifec_get_rx_desc(), ifec_init_eeprom(), ifec_mdio_read(), ifec_mdio_setup(), ifec_mdio_write(), ifec_net_close(), ifec_net_irq(), ifec_net_open(), ifec_net_poll(), ifec_net_transmit(), ifec_pci_probe(), ifec_refill_rx_ring(), ifec_reprime_ru(), ifec_reset(), ifec_rx_process(), ifec_rx_setup(), ifec_scb_cmd(), ifec_scb_cmd_wait(), ifec_spi_read_bit(), ifec_spi_write_bit(), ifec_tx_process(), ifec_tx_setup(), ifec_tx_wake(), ipv6_register_settings(), isa_set_drvdata(), isapnp_get_drvdata(), legacy_eisa_set_drvdata(), legacy_isa_set_drvdata(), legacy_isapnp_set_drvdata(), legacy_mca_set_drvdata(), legacy_pci_set_drvdata(), legacy_probe(), legacy_t509_set_drvdata(), linux_set_drvdata(), lldp_probe(), lldp_remove(), max2820_rf_init(), max2820_rf_set_channel(), max2820_write_phy_antenna(), mca_set_drvdata(), mii_rw(), myri10ge_command(), myri10ge_interrupt_handler(), myri10ge_net_close(), myri10ge_net_open(), myri10ge_net_poll(), myri10ge_net_transmit(), myri10ge_nv_fini(), myri10ge_nv_init(), myri10ge_nvs_read(), myri10ge_nvs_write(), myri10ge_pci_probe(), myri10ge_post_receive(), neighbour_flush(), netdev_notify(), netfront_net_probe(), nv_alloc_rx(), nv_disable_hw_interrupts(), nv_enable_hw_interrupts(), nv_free_rxtx_resources(), nv_init_rings(), nv_init_rx_ring(), nv_init_tx_ring(), nv_mac_reset(), nv_mgmt_acquire_sema(), nv_mgmt_get_version(), nv_mgmt_release_sema(), nv_process_rx_packets(), nv_process_tx_packets(), nv_restore_phy(), nv_setup_mac_addr(), nv_setup_phy(), nv_start_rx(), nv_start_tx(), nv_stop_rx(), nv_stop_tx(), nv_txrx_gate(), nv_txrx_reset(), nv_update_linkspeed(), nv_update_pause(), pci_set_drvdata(), pcnet32_chip_detect(), pcnet32_close(), pcnet32_free_rx_resources(), pcnet32_free_tx_resources(), pcnet32_hw_start(), pcnet32_irq(), pcnet32_irq_disable(), pcnet32_irq_enable(), pcnet32_mdio_read(), pcnet32_mdio_write(), pcnet32_open(), pcnet32_poll(), pcnet32_probe(), pcnet32_process_rx_packets(), pcnet32_process_tx_packets(), pcnet32_refill_rx_ring(), pcnet32_set_ops(), pcnet32_setup_if_duplex(), pcnet32_setup_init_block(), pcnet32_setup_mac_addr(), pcnet32_setup_probe_phy(), pcnet32_setup_rx_resources(), pcnet32_setup_tx_resources(), pcnet32_transmit(), phy_init(), phy_reset(), pxe_notify(), refill_rx(), reg_delay(), register_netdev(), rootdev_set_drvdata(), rtl818x_config(), rtl818x_free_rx_ring(), rtl818x_free_tx_ring(), rtl818x_handle_rx(), rtl818x_handle_tx(), rtl818x_init_hw(), rtl818x_init_rx_ring(), rtl818x_init_tx_ring(), rtl818x_ioread16(), rtl818x_ioread32(), rtl818x_ioread8(), rtl818x_iowrite16(), rtl818x_iowrite32(), rtl818x_iowrite8(), rtl818x_irq(), rtl818x_poll(), rtl818x_probe(), rtl818x_set_anaparam(), rtl818x_set_hwaddr(), rtl818x_spi_read_bit(), rtl818x_spi_write_bit(), rtl818x_start(), rtl818x_stop(), rtl818x_tx(), rtl818x_write_phy(), rtl8225_read(), rtl8225_rf_conf_erp(), rtl8225_rf_init(), rtl8225_rf_set_channel(), rtl8225_rf_set_tx_power(), rtl8225_rf_stop(), rtl8225_write(), rtl8225x_rf_init(), rtl8225z2_rf_init(), rtl8225z2_rf_set_tx_power(), sa2400_rf_init(), sa2400_rf_set_channel(), sa2400_write_phy_antenna(), scsicmd_read_capacity_cmd(), scsicmd_read_capacity_done(), t509_set_drvdata(), TLan_FinishReset(), TLan_PhyDetect(), TLan_PhyFinishAutoNeg(), TLan_PhyPowerDown(), TLan_PhyPowerUp(), TLan_PhyReset(), TLan_PhyStartLink(), tlan_poll(), tlan_probe(), TLan_ResetAdapter(), TLan_ResetLists(), tlan_transmit(), undi_set_drvdata(), unregister_netdev(), usb_bus_set_hostdata(), usb_endpoint_set_hostdata(), usb_func_set_drvdata(), usb_hub_set_drvdata(), usb_set_hostdata(), vlan_notify(), vlan_probe(), vlan_remove(), vmbus_set_drvdata(), write_grf5101(), write_max2820(), write_sa2400(), xen_set_drvdata(), and xsigo_net_notify().

◆ BASE

u32 BASE
static

Definition at line 227 of file tlan.c.

◆ tlan_operations

struct nic_operations tlan_operations
static
Initial value:
= {
.connect = dummy_connect,
.poll = tlan_poll,
.transmit = tlan_transmit,
.irq = tlan_irq,
}
int dummy_connect(struct nic *nic __unused)
Definition legacy.c:175
static int tlan_poll(struct nic *nic, int retrieve)
Definition tlan.c:493
static void tlan_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p)
Definition tlan.c:569
static void tlan_irq(struct nic *nic __unused, irq_action_t action __unused)
Definition tlan.c:739

Definition at line 751 of file tlan.c.

751 {
752 .connect = dummy_connect,
753 .poll = tlan_poll,
754 .transmit = tlan_transmit,
755 .irq = tlan_irq,
756
757};

Referenced by tlan_probe().

◆ tlan_nics

struct pci_device_id tlan_nics[]
static
Initial value:
= {
PCI_ROM(0x0e11, 0xae32, "netel100","Compaq Netelligent 10/100 TX PCI UTP", 0),
PCI_ROM(0x0e11, 0xae34, "netel10", "Compaq Netelligent 10 T PCI UTP", 0),
PCI_ROM(0x0e11, 0xae35, "netflex3i", "Compaq Integrated NetFlex-3/P", 0),
PCI_ROM(0x0e11, 0xae40, "netel100d", "Compaq Netelligent Dual 10/100 TX PCI UTP", 0),
PCI_ROM(0x0e11, 0xae43, "netel100pi", "Compaq Netelligent Integrated 10/100 TX UTP", 0),
PCI_ROM(0x0e11, 0xb011, "netel100i", "Compaq Netelligent 10/100 TX Embedded UTP", 0),
PCI_ROM(0x0e11, 0xb012, "netelligent_10_t2", "Compaq Netelligent 10 T/2 PCI UTP/Coax", 0),
PCI_ROM(0x0e11, 0xb030, "netelligent_10_100_ws_5100", "Compaq Netelligent 10/100 TX UTP", 0),
PCI_ROM(0x0e11, 0xf130, "thunder", "Compaq NetFlex-3/P", 0),
PCI_ROM(0x0e11, 0xf150, "netflex3b", "Compaq NetFlex-3/P", 0),
PCI_ROM(0x108d, 0x0012, "oc2325", "Olicom OC-2325", 0),
PCI_ROM(0x108d, 0x0013, "oc2183", "Olicom OC-2183/2185", 0),
PCI_ROM(0x108d, 0x0014, "oc2326", "Olicom OC-2326", 0),
}
#define PCI_ROM(_vendor, _device, _name, _description, _data)
Definition pci.h:308

Definition at line 1700 of file tlan.c.

1700 {
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),
1714};