iPXE
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
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_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)   cpu_to_le32(virt_to_bus(addr))
 
#define le32desc_to_virt(addr)   bus_to_virt(le32_to_cpu(addr))
 
#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)
 
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)
 

Variables

static const char * media []
 
static const struct pci_id_info tlan_pci_tbl []
 
struct {
   struct TLanList   tx_ring [TLAN_NUM_TX_LISTS]
 
   unsigned char   txb [TLAN_MAX_FRAME_SIZE
      *TLAN_NUM_TX_LISTS]
 
   struct TLanList   rx_ring [TLAN_NUM_RX_LISTS]
 
   unsigned char   rxb [TLAN_MAX_FRAME_SIZE
      *TLAN_NUM_RX_LISTS]
 
__shared
 
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)    cpu_to_le32(virt_to_bus(addr))

Definition at line 59 of file tlan.c.

◆ le32desc_to_virt

#define le32desc_to_virt (   addr)    bus_to_virt(le32_to_cpu(addr))

Definition at line 60 of file tlan.c.

◆ tx_ring

#define tx_ring   tlan_buffers.tx_ring

Definition at line 188 of file tlan.c.

◆ txb

#define txb   tlan_buffers.txb

Definition at line 189 of file tlan.c.

◆ rx_ring

#define rx_ring   tlan_buffers.rx_ring

Definition at line 190 of file tlan.c.

◆ rxb

#define rxb   tlan_buffers.rxb

Definition at line 191 of file tlan.c.

◆ board_found

#define board_found   1

Definition at line 778 of file tlan.c.

◆ valid_link

#define valid_link   0

Definition at line 779 of file tlan.c.

Typedef Documentation

◆ TLanBuffer

typedef u8 TLanBuffer[TLAN_MAX_FRAME_SIZE]

Definition at line 193 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 =
106  NETELLIGENT_10_T2 = 12
107 };
Definition: tlan.c:102
Definition: tlan.c:104
Definition: tlan.c:104
Definition: tlan.c:102
Definition: tlan.c:104
Definition: tlan.c:102

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER  )

◆ TLan_ResetLists()

static void TLan_ResetLists ( struct nic *nic  __unused)
static

Definition at line 242 of file tlan.c.

243 {
244 
245  int i;
246  struct TLanList *list;
247  priv->txHead = 0;
248  priv->txTail = 0;
249 
250  for (i = 0; i < TLAN_NUM_TX_LISTS; i++) {
251  list = &tx_ring[i];
252  list->cStat = TLAN_CSTAT_UNUSED;
253  list->buffer[0].address = virt_to_bus(txb +
254  (i * TLAN_MAX_FRAME_SIZE));
255  list->buffer[2].count = 0;
256  list->buffer[2].address = 0;
257  list->buffer[9].address = 0;
258  }
259 
260  priv->cur_rx = 0;
262 // priv->rx_head_desc = &rx_ring[0];
263 
264  /* Initialize all the Rx descriptors */
265  for (i = 0; i < TLAN_NUM_RX_LISTS; i++) {
266  rx_ring[i].forward = virt_to_le32desc(&rx_ring[i + 1]);
267  rx_ring[i].cStat = TLAN_CSTAT_READY;
268  rx_ring[i].frameSize = TLAN_MAX_FRAME_SIZE;
269  rx_ring[i].buffer[0].count =
271  rx_ring[i].buffer[0].address =
273  rx_ring[i].buffer[1].count = 0;
274  rx_ring[i].buffer[1].address = 0;
275  }
276 
277  /* Mark the last entry as wrapping the ring */
278  rx_ring[i - 1].forward = virt_to_le32desc(&rx_ring[0]);
279  priv->dirty_rx = (unsigned int) (i - TLAN_NUM_RX_LISTS);
280 
281 } /* TLan_ResetLists */
u32 address
Definition: tlan.c:178
#define virt_to_le32desc(addr)
Definition: tlan.c:59
u32 count
Definition: tlan.c:177
#define rx_ring
Definition: tlan.c:190
u32 txTail
Definition: tlan.c:210
#define txb
Definition: tlan.c:189
u32 txHead
Definition: tlan.c:208
#define tx_ring
Definition: tlan.c:188
#define TLAN_CSTAT_UNUSED
Definition: tlan.h:136
Definition: tlan.c:172
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
Definition: io.h:183
u16 cStat
Definition: tlan.c:174
struct TLanList::@352 buffer[TLAN_BUFFERS_PER_LIST]
unsigned rx_buf_sz
Definition: tlan.c:206
#define TLAN_NUM_RX_LISTS
Definition: tlan.h:51
static struct tlan_private * priv
Definition: tlan.c:224
#define TLAN_CSTAT_READY
Definition: tlan.h:138
unsigned int dirty_rx
Definition: tlan.c:205
#define TLAN_LAST_BUFFER
Definition: tlan.h:135
#define TLAN_MAX_FRAME_SIZE
Definition: tlan.h:49
unsigned int cur_rx
Definition: tlan.c:205
#define rxb
Definition: tlan.c:191
#define TLAN_NUM_TX_LISTS
Definition: tlan.h:52

References TLanList::address, TLanList::buffer, TLanList::count, TLanList::cStat, tlan_private::cur_rx, tlan_private::dirty_rx, priv, tlan_private::rx_buf_sz, 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, tlan_private::txHead, tlan_private::txTail, virt_to_bus(), and virt_to_le32desc.

Referenced by tlan_probe().

◆ TLan_ResetAdapter()

void TLan_ResetAdapter ( struct nic *nic  __unused)
static

Definition at line 300 of file tlan.c.

301 {
302  int i;
303  u32 addr;
304  u32 data;
305  u8 data8;
306 
308  priv->phyOnline = 0;
309 /* 1. Assert reset bit. */
310 
311  data = inl(BASE + TLAN_HOST_CMD);
312  data |= TLAN_HC_AD_RST;
314 
315  udelay(1000);
316 
317 /* 2. Turn off interrupts. ( Probably isn't necessary ) */
318 
319  data = inl(BASE + TLAN_HOST_CMD);
322 /* 3. Clear AREGs and HASHs. */
323 
324  for (i = TLAN_AREG_0; i <= TLAN_HASH_2; i += 4) {
325  TLan_DioWrite32(BASE, (u16) i, 0);
326  }
327 
328 /* 4. Setup NetConfig register. */
329 
330  data =
333 
334 /* 5. Load Ld_Tmr and Ld_Thr in HOST_CMD. */
335 
338 
339 /* 6. Unreset the MII by setting NMRST (in NetSio) to 1. */
340 
344 
345 /* 7. Setup the remaining registers. */
346 
347  if (priv->tlanRev >= 0x30) {
350  }
353 
356  if (priv->aui == 1) {
358  } else if (priv->duplex == TLAN_DUPLEX_FULL) {
361  } else {
363  }
364  }
365 
366  if (priv->phyNum == 0) {
368  }
370 
373  } else {
375  }
376 
377 } /* TLan_ResetAdapter */
uint16_t u16
Definition: stdint.h:21
u32 phyOnline
Definition: tlan.c:212
#define TLAN_HC_LD_TMR
Definition: tlan.h:203
#define TLAN_DIO_ADR
Definition: tlan.h:210
#define TLAN_NET_CFG_PHY_EN
Definition: tlan.h:260
#define TLAN_ACOMMIT
Definition: tlan.h:287
static void TLan_PhyDetect(struct nic *nic)
Definition: tlan.c:1341
#define TLAN_ID_TX_EOC
Definition: tlan.h:294
#define outw(data, io_addr)
Definition: io.h:319
static int chip_idx
Definition: tlan.c:195
u32 phyNum
Definition: tlan.c:216
#define TLAN_HC_AD_RST
Definition: tlan.h:202
static void TLan_DioWrite16(u16 base_addr, u16 internal_addr, u16 data)
Definition: tlan.h:392
#define TLAN_HC_LD_THR
Definition: tlan.h:204
#define TLAN_ID_RX_EOC
Definition: tlan.h:296
u32 duplex
Definition: tlan.c:214
#define TLan_SetBit(bit, port)
Definition: tlan.h:436
#define TLAN_HOST_CMD
Definition: tlan.h:194
#define TLAN_DUPLEX_FULL
Definition: tlan.h:106
#define TLAN_ADAPTER_UNMANAGED_PHY
Definition: tlan.h:95
#define TLAN_AREG_0
Definition: tlan.h:269
#define TLAN_HC_INT_OFF
Definition: tlan.h:206
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:60
static void TLan_FinishReset(struct nic *nic __unused)
u8 tlanFullDuplex
Definition: tlan.c:219
#define outl(data, io_addr)
Definition: io.h:329
#define TLAN_NET_CFG_1CHAN
Definition: tlan.h:258
#define TLAN_NET_SIO
Definition: tlan.h:230
#define TLAN_NET_CFG_1FRAG
Definition: tlan.h:257
u32 addr
Definition: sky2.h:8
#define TLAN_NET_SIO_NMRST
Definition: tlan.h:235
u8 tlanRev
Definition: tlan.c:218
Definition: nic.h:49
static void TLan_PhyPowerDown(struct nic *nic)
Definition: tlan.c:1388
#define TRUE
Definition: tlan.h:46
uint8_t data8[16]
Definition: ib_mad.h:18
#define TLAN_NET_CFG_BIT
Definition: tlan.h:254
static struct tlan_private * priv
Definition: tlan.c:224
u32 aui
Definition: tlan.c:213
uint32_t inl(volatile uint32_t *io_addr)
Read 32-bit dword from I/O-mapped device.
uint8_t data[48]
Additional event data.
Definition: ena.h:22
#define FALSE
Definition: tlan.h:45
#define TLAN_DIO_DATA
Definition: tlan.h:216
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_ADAPTER_BIT_RATE_PHY
Definition: tlan.h:96
#define TLAN_HASH_2
Definition: tlan.h:274
static const struct pci_id_info tlan_pci_tbl[]
Definition: tlan.c:120
#define TLAN_NET_CONFIG
Definition: tlan.h:251
uint8_t u8
Definition: stdint.h:19
uint32_t u32
Definition: stdint.h:23
static void TLan_DioWrite32(u16 base_addr, u16 internal_addr, u32 data)
Definition: tlan.h:402
static u32 BASE
Definition: tlan.c:226
uint8_t flags
Flags.
Definition: ena.h:18

References addr, tlan_private::aui, BASE, chip_idx, data, data8, tlan_private::duplex, FALSE, flags, inl(), outl, outw, tlan_private::phyNum, tlan_private::phyOnline, 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, tlan_private::tlanFullDuplex, tlan_private::tlanRev, TRUE, and udelay().

Referenced by tlan_probe().

◆ TLan_FinishReset() [1/2]

static void TLan_FinishReset ( struct nic *nic  __unused)
static

◆ TLan_EeSendStart()

void TLan_EeSendStart ( u16  io_base)
static

Definition at line 884 of file tlan.c.

885 {
886  u16 sio;
887 
888  outw(TLAN_NET_SIO, io_base + TLAN_DIO_ADR);
889  sio = io_base + TLAN_DIO_DATA + TLAN_NET_SIO;
890 
896 
897 } /* TLan_EeSendStart */
uint16_t u16
Definition: stdint.h:21
#define TLAN_DIO_ADR
Definition: tlan.h:210
#define TLan_ClearBit(bit, port)
Definition: tlan.h:434
#define outw(data, io_addr)
Definition: io.h:319
#define TLan_SetBit(bit, port)
Definition: tlan.h:436
#define TLAN_NET_SIO_ETXEN
Definition: tlan.h:233
#define TLAN_NET_SIO
Definition: tlan.h:230
#define TLAN_NET_SIO_EDATA
Definition: tlan.h:234
#define TLAN_DIO_DATA
Definition: tlan.h:216
#define TLAN_NET_SIO_ECLOK
Definition: tlan.h:232

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, and TLan_SetBit.

Referenced by TLan_EeReadByte().

◆ TLan_EeSendByte()

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

Definition at line 921 of file tlan.c.

922 {
923  int err;
924  u8 place;
925  u16 sio;
926 
927  outw(TLAN_NET_SIO, io_base + TLAN_DIO_ADR);
928  sio = io_base + TLAN_DIO_DATA + TLAN_NET_SIO;
929 
930  /* Assume clock is low, tx is enabled; */
931  for (place = 0x80; place != 0; place >>= 1) {
932  if (place & data)
934  else
938  }
941  err = TLan_GetBit(TLAN_NET_SIO_EDATA, sio);
944 
945  if ((!err) && stop) {
946  TLan_ClearBit(TLAN_NET_SIO_EDATA, sio); /* STOP, raise data while clock is high */
949  }
950 
951  return (err);
952 
953 } /* TLan_EeSendByte */
uint16_t u16
Definition: stdint.h:21
#define TLAN_DIO_ADR
Definition: tlan.h:210
#define TLan_ClearBit(bit, port)
Definition: tlan.h:434
#define outw(data, io_addr)
Definition: io.h:319
#define TLan_SetBit(bit, port)
Definition: tlan.h:436
#define TLAN_NET_SIO_ETXEN
Definition: tlan.h:233
#define TLAN_NET_SIO
Definition: tlan.h:230
#define TLan_GetBit(bit, port)
Definition: tlan.h:435
uint8_t data[48]
Additional event data.
Definition: ena.h:22
#define TLAN_NET_SIO_EDATA
Definition: tlan.h:234
#define TLAN_DIO_DATA
Definition: tlan.h:216
#define TLAN_NET_SIO_ECLOK
Definition: tlan.h:232
uint8_t u8
Definition: stdint.h:19

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, and TLan_SetBit.

Referenced by TLan_EeReadByte().

◆ TLan_EeReceiveByte()

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

Definition at line 979 of file tlan.c.

980 {
981  u8 place;
982  u16 sio;
983 
984  outw(TLAN_NET_SIO, io_base + TLAN_DIO_ADR);
985  sio = io_base + TLAN_DIO_DATA + TLAN_NET_SIO;
986  *data = 0;
987 
988  /* Assume clock is low, tx is enabled; */
990  for (place = 0x80; place; place >>= 1) {
993  *data |= place;
995  }
996 
998  if (!stop) {
999  TLan_ClearBit(TLAN_NET_SIO_EDATA, sio); /* Ack = 0 */
1002  } else {
1003  TLan_SetBit(TLAN_NET_SIO_EDATA, sio); /* No ack = 1 (?) */
1006  TLan_ClearBit(TLAN_NET_SIO_EDATA, sio); /* STOP, raise data while clock is high */
1009  }
1010 
1011 } /* TLan_EeReceiveByte */
uint16_t u16
Definition: stdint.h:21
#define TLAN_DIO_ADR
Definition: tlan.h:210
#define TLan_ClearBit(bit, port)
Definition: tlan.h:434
#define outw(data, io_addr)
Definition: io.h:319
#define TLan_SetBit(bit, port)
Definition: tlan.h:436
#define TLAN_NET_SIO_ETXEN
Definition: tlan.h:233
#define TLAN_NET_SIO
Definition: tlan.h:230
#define TLan_GetBit(bit, port)
Definition: tlan.h:435
uint8_t data[48]
Additional event data.
Definition: ena.h:22
#define TLAN_NET_SIO_EDATA
Definition: tlan.h:234
#define TLAN_DIO_DATA
Definition: tlan.h:216
#define TLAN_NET_SIO_ECLOK
Definition: tlan.h:232
uint8_t u8
Definition: stdint.h:19

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, and TLan_SetBit.

Referenced by TLan_EeReadByte().

◆ TLan_EeReadByte()

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

Definition at line 1034 of file tlan.c.

1035 {
1036  int err;
1037  int ret = 0;
1038 
1039 
1040  TLan_EeSendStart(io_base);
1041  err = TLan_EeSendByte(io_base, 0xA0, TLAN_EEPROM_ACK);
1042  if (err) {
1043  ret = 1;
1044  goto fail;
1045  }
1046  err = TLan_EeSendByte(io_base, ee_addr, TLAN_EEPROM_ACK);
1047  if (err) {
1048  ret = 2;
1049  goto fail;
1050  }
1051  TLan_EeSendStart(io_base);
1052  err = TLan_EeSendByte(io_base, 0xA1, TLAN_EEPROM_ACK);
1053  if (err) {
1054  ret = 3;
1055  goto fail;
1056  }
1058  fail:
1059 
1060  return ret;
1061 
1062 } /* TLan_EeReadByte */
static int TLan_EeSendByte(u16, u8, int)
Definition: tlan.c:921
static void TLan_EeReceiveByte(u16, u8 *, int)
Definition: tlan.c:979
#define TLAN_EEPROM_STOP
Definition: tlan.h:184
static void TLan_EeSendStart(u16)
Definition: tlan.c:884
uint8_t data[48]
Additional event data.
Definition: ena.h:22
#define TLAN_EEPROM_ACK
Definition: tlan.h:183

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

Referenced by tlan_probe().

◆ TLan_PhyDetect()

void TLan_PhyDetect ( struct nic nic)
static

Definition at line 1341 of file tlan.c.

1342 {
1343  u16 control;
1344  u16 hi;
1345  u16 lo;
1346  u32 phy;
1347 
1349  priv->phyNum = 0xFFFF;
1350  return;
1351  }
1352 
1354 
1355  if (hi != 0xFFFF) {
1356  priv->phy[0] = TLAN_PHY_MAX_ADDR;
1357  } else {
1358  priv->phy[0] = TLAN_PHY_NONE;
1359  }
1360 
1361  priv->phy[1] = TLAN_PHY_NONE;
1362  for (phy = 0; phy <= TLAN_PHY_MAX_ADDR; phy++) {
1364  TLan_MiiReadReg(nic, phy, MII_PHYSID1, &hi);
1365  TLan_MiiReadReg(nic, phy, MII_PHYSID2, &lo);
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);
1370  if ((priv->phy[1] == TLAN_PHY_NONE)
1371  && (phy != TLAN_PHY_MAX_ADDR)) {
1372  priv->phy[1] = phy;
1373  }
1374  }
1375  }
1376 
1377  if (priv->phy[1] != TLAN_PHY_NONE) {
1378  priv->phyNum = 1;
1379  } else if (priv->phy[0] != TLAN_PHY_NONE) {
1380  priv->phyNum = 0;
1381  } else {
1382  printf
1383  ("TLAN: Cannot initialize device, no PHY was found!\n");
1384  }
1385 
1386 } /* TLan_PhyDetect */
uint16_t u16
Definition: stdint.h:21
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
static int chip_idx
Definition: tlan.c:195
u32 phyNum
Definition: tlan.c:216
u32 phy[2]
Definition: tlan.c:215
#define TLAN_PHY_MAX_ADDR
Definition: tlan.h:154
#define TLAN_ADAPTER_UNMANAGED_PHY
Definition: tlan.h:95
#define TLAN_PHY_NONE
Definition: tlan.h:155
static int TLan_MiiReadReg(struct nic *nic __unused, u16, u16, u16 *)
Definition: tlan.c:1101
uint32_t control
Control.
Definition: myson.h:14
#define MII_BMCR
Definition: atl1e.h:871
Definition: nic.h:49
static struct tlan_private * priv
Definition: tlan.c:224
#define MII_PHYSID2
Definition: atl1e.h:874
static const struct pci_id_info tlan_pci_tbl[]
Definition: tlan.c:120
#define MII_PHYSID1
Definition: atl1e.h:873
uint32_t u32
Definition: stdint.h:23
uint8_t flags
Flags.
Definition: ena.h:18

References chip_idx, control, flags, MII_BMCR, MII_PHYSID1, MII_PHYSID2, tlan_private::phy, tlan_private::phyNum, printf(), priv, TLAN_ADAPTER_UNMANAGED_PHY, TLan_MiiReadReg(), tlan_pci_tbl, TLAN_PHY_MAX_ADDR, and TLAN_PHY_NONE.

Referenced by TLan_ResetAdapter().

◆ TLan_PhyPowerDown()

void TLan_PhyPowerDown ( struct nic nic)
static

Definition at line 1388 of file tlan.c.

1389 {
1390 
1391  u16 value;
1392  DBG ( "%s: Powering down PHY(s).\n", priv->nic_name );
1394  TLan_MiiSync(BASE);
1396  if ((priv->phyNum == 0) && (priv->phy[1] != TLAN_PHY_NONE)
1397  &&
1398  (!(tlan_pci_tbl[chip_idx].
1400  TLan_MiiSync(BASE);
1402  }
1403 
1404  /* Wait for 50 ms and powerup
1405  * This is abitrary. It is intended to make sure the
1406  * tranceiver settles.
1407  */
1408  /* TLan_SetTimer( dev, (HZ/20), TLAN_TIMER_PHY_PUP ); */
1409  mdelay(50);
1411 
1412 } /* TLan_PhyPowerDown */
uint16_t u16
Definition: stdint.h:21
static int chip_idx
Definition: tlan.c:195
u32 phyNum
Definition: tlan.c:216
#define TLAN_ADAPTER_USE_INTERN_10
Definition: tlan.h:97
u32 phy[2]
Definition: tlan.c:215
#define BMCR_LOOPBACK
Definition: mii.h:51
#define BMCR_ISOLATE
Definition: mii.h:47
#define TLAN_PHY_NONE
Definition: tlan.h:155
pseudo_bit_t value[0x00020]
Definition: arbel.h:13
static void TLan_PhyPowerUp(struct nic *nic)
Definition: tlan.c:1415
const char * nic_name
Definition: tlan.c:204
#define MII_BMCR
Definition: atl1e.h:871
Definition: nic.h:49
#define BMCR_PDOWN
Definition: mii.h:48
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
Definition: timer.c:78
static struct tlan_private * priv
Definition: tlan.c:224
static void TLan_MiiSync(u16)
Definition: tlan.c:1219
static const struct pci_id_info tlan_pci_tbl[]
Definition: tlan.c:120
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
static u32 BASE
Definition: tlan.c:226
uint8_t flags
Flags.
Definition: ena.h:18
static void TLan_MiiWriteReg(struct nic *nic __unused, u16, u16, u16)
Definition: tlan.c:1255

References BASE, BMCR_ISOLATE, BMCR_LOOPBACK, BMCR_PDOWN, chip_idx, DBG, flags, mdelay(), MII_BMCR, tlan_private::nic_name, tlan_private::phy, tlan_private::phyNum, priv, TLAN_ADAPTER_USE_INTERN_10, TLan_MiiSync(), TLan_MiiWriteReg(), tlan_pci_tbl, TLAN_PHY_NONE, TLan_PhyPowerUp(), and value.

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

◆ TLan_PhyPowerUp()

void TLan_PhyPowerUp ( struct nic nic)
static

Definition at line 1415 of file tlan.c.

1416 {
1417  u16 value;
1418 
1419  DBG ( "%s: Powering up PHY.\n", priv->nic_name );
1420  TLan_MiiSync(BASE);
1421  value = BMCR_LOOPBACK;
1423  TLan_MiiSync(BASE);
1424  /* Wait for 500 ms and reset the
1425  * tranceiver. The TLAN docs say both 50 ms and
1426  * 500 ms, so do the longer, just in case.
1427  */
1428  mdelay(500);
1429  TLan_PhyReset(nic);
1430  /* TLan_SetTimer( dev, (HZ/20), TLAN_TIMER_PHY_RESET ); */
1431 
1432 } /* TLan_PhyPowerUp */
uint16_t u16
Definition: stdint.h:21
u32 phyNum
Definition: tlan.c:216
u32 phy[2]
Definition: tlan.c:215
static void TLan_PhyReset(struct nic *nic)
Definition: tlan.c:1434
#define BMCR_LOOPBACK
Definition: mii.h:51
pseudo_bit_t value[0x00020]
Definition: arbel.h:13
const char * nic_name
Definition: tlan.c:204
#define MII_BMCR
Definition: atl1e.h:871
Definition: nic.h:49
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
Definition: timer.c:78
static struct tlan_private * priv
Definition: tlan.c:224
static void TLan_MiiSync(u16)
Definition: tlan.c:1219
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
static u32 BASE
Definition: tlan.c:226
static void TLan_MiiWriteReg(struct nic *nic __unused, u16, u16, u16)
Definition: tlan.c:1255

References BASE, BMCR_LOOPBACK, DBG, mdelay(), MII_BMCR, tlan_private::nic_name, tlan_private::phy, tlan_private::phyNum, priv, TLan_MiiSync(), TLan_MiiWriteReg(), TLan_PhyReset(), and value.

Referenced by TLan_PhyPowerDown().

◆ TLan_SetMac()

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

Definition at line 1307 of file tlan.c.

1308 {
1309  int i;
1310 
1311  areg *= 6;
1312 
1313  if (mac != NULL) {
1314  for (i = 0; i < 6; i++)
1315  TLan_DioWrite8(BASE, TLAN_AREG_0 + areg + i,
1316  mac[i]);
1317  } else {
1318  for (i = 0; i < 6; i++)
1319  TLan_DioWrite8(BASE, TLAN_AREG_0 + areg + i, 0);
1320  }
1321 
1322 } /* TLan_SetMac */
uint8_t mac[ETH_ALEN]
MAC address.
Definition: ena.h:24
#define TLAN_AREG_0
Definition: tlan.h:269
static void TLan_DioWrite8(u16 base_addr, u16 internal_addr, u8 data)
Definition: tlan.h:382
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
static u32 BASE
Definition: tlan.c:226

References 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 1434 of file tlan.c.

1435 {
1436  u16 phy;
1437  u16 value;
1438 
1439  phy = priv->phy[priv->phyNum];
1440 
1441  DBG ( "%s: Reseting PHY.\n", priv->nic_name );
1442  TLan_MiiSync(BASE);
1445  TLan_MiiReadReg(nic, phy, MII_BMCR, &value);
1446  while (value & BMCR_RESET) {
1447  TLan_MiiReadReg(nic, phy, MII_BMCR, &value);
1448  }
1449 
1450  /* Wait for 500 ms and initialize.
1451  * I don't remember why I wait this long.
1452  * I've changed this to 50ms, as it seems long enough.
1453  */
1454  /* TLan_SetTimer( dev, (HZ/20), TLAN_TIMER_PHY_START_LINK ); */
1455  mdelay(50);
1457 
1458 } /* TLan_PhyReset */
uint16_t u16
Definition: stdint.h:21
static void TLan_PhyStartLink(struct nic *nic)
Definition: tlan.c:1461
u32 phyNum
Definition: tlan.c:216
u32 phy[2]
Definition: tlan.c:215
#define BMCR_LOOPBACK
Definition: mii.h:51
pseudo_bit_t value[0x00020]
Definition: arbel.h:13
static int TLan_MiiReadReg(struct nic *nic __unused, u16, u16, u16 *)
Definition: tlan.c:1101
const char * nic_name
Definition: tlan.c:204
#define MII_BMCR
Definition: atl1e.h:871
Definition: nic.h:49
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
Definition: timer.c:78
static struct tlan_private * priv
Definition: tlan.c:224
#define BMCR_RESET
Definition: mii.h:52
static void TLan_MiiSync(u16)
Definition: tlan.c:1219
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
static u32 BASE
Definition: tlan.c:226
static void TLan_MiiWriteReg(struct nic *nic __unused, u16, u16, u16)
Definition: tlan.c:1255

References BASE, BMCR_LOOPBACK, BMCR_RESET, DBG, mdelay(), MII_BMCR, tlan_private::nic_name, tlan_private::phy, tlan_private::phyNum, priv, TLan_MiiReadReg(), TLan_MiiSync(), TLan_MiiWriteReg(), TLan_PhyStartLink(), and value.

Referenced by TLan_PhyPowerUp().

◆ TLan_PhyStartLink()

void TLan_PhyStartLink ( struct nic nic)
static

Definition at line 1461 of file tlan.c.

1462 {
1463 
1464  u16 ability;
1465  u16 control;
1466  u16 data;
1467  u16 phy;
1468  u16 status;
1469  u16 tctl;
1470 
1471  phy = priv->phy[priv->phyNum];
1472  DBG ( "%s: Trying to activate link.\n", priv->nic_name );
1474  TLan_MiiReadReg(nic, phy, MII_BMSR, &ability);
1475 
1476  if ((status & BMSR_ANEGCAPABLE) && (!priv->aui)) {
1477  ability = status >> 11;
1478  if (priv->speed == TLAN_SPEED_10 &&
1480  TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x0000);
1481  } else if (priv->speed == TLAN_SPEED_10 &&
1484  TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x0100);
1485  } else if (priv->speed == TLAN_SPEED_100 &&
1487  TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x2000);
1488  } else if (priv->speed == TLAN_SPEED_100 &&
1491  TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x2100);
1492  } else {
1493 
1494  /* Set Auto-Neg advertisement */
1496  (ability << 5) | 1);
1497  /* Enablee Auto-Neg */
1498  TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x1000);
1499  /* Restart Auto-Neg */
1500  TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x1200);
1501  /* Wait for 4 sec for autonegotiation
1502  * to complete. The max spec time is less than this
1503  * but the card need additional time to start AN.
1504  * .5 sec should be plenty extra.
1505  */
1506  DBG ( "TLAN: %s: Starting autonegotiation.\n",
1507  priv->nic_name );
1508  mdelay(4000);
1510  /* TLan_SetTimer( dev, (2*HZ), TLAN_TIMER_PHY_FINISH_AN ); */
1511  return;
1512  }
1513 
1514  }
1515 
1516  if ((priv->aui) && (priv->phyNum != 0)) {
1517  priv->phyNum = 0;
1518  data =
1522  mdelay(50);
1523  /* TLan_SetTimer( dev, (40*HZ/1000), TLAN_TIMER_PHY_PDOWN ); */
1525  return;
1526  } else if (priv->phyNum == 0) {
1527  control = 0;
1528  TLan_MiiReadReg(nic, phy, TLAN_TLPHY_CTL, &tctl);
1529  if (priv->aui) {
1530  tctl |= TLAN_TC_AUISEL;
1531  } else {
1532  tctl &= ~TLAN_TC_AUISEL;
1533  if (priv->duplex == TLAN_DUPLEX_FULL) {
1536  }
1537  if (priv->speed == TLAN_SPEED_100) {
1539  }
1540  }
1542  TLan_MiiWriteReg(nic, phy, TLAN_TLPHY_CTL, tctl);
1543  }
1544 
1545  /* Wait for 2 sec to give the tranceiver time
1546  * to establish link.
1547  */
1548  /* TLan_SetTimer( dev, (4*HZ), TLAN_TIMER_FINISH_RESET ); */
1549  mdelay(2000);
1551 
1552 } /* TLan_PhyStartLink */
#define MII_ADVERTISE
Definition: atl1e.h:875
uint16_t u16
Definition: stdint.h:21
#define TLAN_NET_CFG_PHY_EN
Definition: tlan.h:260
#define TLAN_DUPLEX_HALF
Definition: tlan.h:105
u32 phyNum
Definition: tlan.c:216
u32 phy[2]
Definition: tlan.c:215
static void TLan_DioWrite16(u16 base_addr, u16 internal_addr, u16 data)
Definition: tlan.h:392
u32 duplex
Definition: tlan.c:214
uint8_t status
Status.
Definition: ena.h:16
#define TLAN_DUPLEX_FULL
Definition: tlan.h:106
#define TLAN_TC_AUISEL
Definition: tlan.h:323
static void TLan_PhyFinishAutoNeg(struct nic *nic)
Definition: tlan.c:1554
u32 speed
Definition: tlan.c:217
static void TLan_FinishReset(struct nic *nic __unused)
#define TLAN_TLPHY_CTL
Definition: tlan.h:320
u8 tlanFullDuplex
Definition: tlan.c:219
static int TLan_MiiReadReg(struct nic *nic __unused, u16, u16, u16 *)
Definition: tlan.c:1101
const char * nic_name
Definition: tlan.c:204
#define TLAN_NET_CFG_1CHAN
Definition: tlan.h:258
uint32_t control
Control.
Definition: myson.h:14
#define TLAN_NET_CFG_1FRAG
Definition: tlan.h:257
#define MII_BMCR
Definition: atl1e.h:871
Definition: nic.h:49
static void TLan_PhyPowerDown(struct nic *nic)
Definition: tlan.c:1388
#define TRUE
Definition: tlan.h:46
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
Definition: timer.c:78
static struct tlan_private * priv
Definition: tlan.c:224
#define BMSR_ANEGCAPABLE
Definition: mii.h:58
u32 aui
Definition: tlan.c:213
uint8_t data[48]
Additional event data.
Definition: ena.h:22
#define TLAN_SPEED_10
Definition: tlan.h:101
#define TLAN_SPEED_100
Definition: tlan.h:102
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define MII_BMSR
Definition: atl1e.h:872
#define BMCR_SPEED100
Definition: mii.h:50
#define TLAN_NET_CONFIG
Definition: tlan.h:251
static u32 BASE
Definition: tlan.c:226
#define BMCR_FULLDPLX
Definition: mii.h:45
static void TLan_MiiWriteReg(struct nic *nic __unused, u16, u16, u16)
Definition: tlan.c:1255

References tlan_private::aui, BASE, BMCR_FULLDPLX, BMCR_SPEED100, BMSR_ANEGCAPABLE, control, data, DBG, tlan_private::duplex, mdelay(), MII_ADVERTISE, MII_BMCR, MII_BMSR, tlan_private::nic_name, tlan_private::phy, tlan_private::phyNum, priv, tlan_private::speed, 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, tlan_private::tlanFullDuplex, and TRUE.

Referenced by TLan_PhyReset().

◆ TLan_PhyFinishAutoNeg()

void TLan_PhyFinishAutoNeg ( struct nic nic)
static

Definition at line 1554 of file tlan.c.

1555 {
1556 
1557  u16 an_adv;
1558  u16 an_lpa;
1559  u16 data;
1560  u16 mode;
1561  u16 phy;
1562  u16 status;
1563 
1564  phy = priv->phy[priv->phyNum];
1565 
1567  udelay(1000);
1569 
1570  if (!(status & BMSR_ANEGCOMPLETE)) {
1571  /* Wait for 8 sec to give the process
1572  * more time. Perhaps we should fail after a while.
1573  */
1574  if (!priv->neg_be_verbose++) {
1575  printf
1576  ("TLAN: Giving autonegotiation more time.\n");
1577  printf
1578  ("TLAN: Please check that your adapter has\n");
1579  printf
1580  ("TLAN: been properly connected to a HUB or Switch.\n");
1581  printf
1582  ("TLAN: Trying to establish link in the background...\n");
1583  }
1584  mdelay(8000);
1586  /* TLan_SetTimer( dev, (8*HZ), TLAN_TIMER_PHY_FINISH_AN ); */
1587  return;
1588  }
1589 
1590  DBG ( "TLAN: %s: Autonegotiation complete.\n", priv->nic_name );
1591  TLan_MiiReadReg(nic, phy, MII_ADVERTISE, &an_adv);
1592  TLan_MiiReadReg(nic, phy, MII_LPA, &an_lpa);
1593  mode = an_adv & an_lpa & 0x03E0;
1594  if (mode & 0x0100) {
1595  printf("Full Duplex\n");
1597  } else if (!(mode & 0x0080) && (mode & 0x0040)) {
1599  printf("Full Duplex\n");
1600  }
1601 
1602  if ((!(mode & 0x0180))
1604  && (priv->phyNum != 0)) {
1605  priv->phyNum = 0;
1606  data =
1610  /* TLan_SetTimer( nic, (400*HZ/1000), TLAN_TIMER_PHY_PDOWN ); */
1611  mdelay(400);
1613  return;
1614  }
1615 
1616  if (priv->phyNum == 0) {
1617  if ((priv->duplex == TLAN_DUPLEX_FULL)
1618  || (an_adv & an_lpa & 0x0040)) {
1621  DBG
1622  ( "TLAN: Starting internal PHY with FULL-DUPLEX\n" );
1623  } else {
1625  BMCR_ANENABLE);
1626  DBG
1627  ( "TLAN: Starting internal PHY with HALF-DUPLEX\n" );
1628  }
1629  }
1630 
1631  /* Wait for 100 ms. No reason in partiticular.
1632  */
1633  /* TLan_SetTimer( dev, (HZ/10), TLAN_TIMER_FINISH_RESET ); */
1634  mdelay(100);
1636 
1637 } /* TLan_PhyFinishAutoNeg */
#define MII_ADVERTISE
Definition: atl1e.h:875
uint16_t u16
Definition: stdint.h:21
#define MII_LPA
Definition: atl1e.h:876
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
#define TLAN_NET_CFG_PHY_EN
Definition: tlan.h:260
static int chip_idx
Definition: tlan.c:195
u32 phyNum
Definition: tlan.c:216
u8 neg_be_verbose
Definition: tlan.c:221
#define TLAN_ADAPTER_USE_INTERN_10
Definition: tlan.h:97
u32 phy[2]
Definition: tlan.c:215
static void TLan_DioWrite16(u16 base_addr, u16 internal_addr, u16 data)
Definition: tlan.h:392
u32 duplex
Definition: tlan.c:214
uint8_t status
Status.
Definition: ena.h:16
#define TLAN_DUPLEX_FULL
Definition: tlan.h:106
static void TLan_PhyFinishAutoNeg(struct nic *nic)
Definition: tlan.c:1554
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:60
#define BMSR_ANEGCOMPLETE
Definition: mii.h:60
static void TLan_FinishReset(struct nic *nic __unused)
u8 tlanFullDuplex
Definition: tlan.c:219
static int TLan_MiiReadReg(struct nic *nic __unused, u16, u16, u16 *)
Definition: tlan.c:1101
const char * nic_name
Definition: tlan.c:204
#define TLAN_NET_CFG_1CHAN
Definition: tlan.h:258
#define TLAN_NET_CFG_1FRAG
Definition: tlan.h:257
#define MII_BMCR
Definition: atl1e.h:871
Definition: nic.h:49
static void TLan_PhyPowerDown(struct nic *nic)
Definition: tlan.c:1388
#define TRUE
Definition: tlan.h:46
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
Definition: timer.c:78
static struct tlan_private * priv
Definition: tlan.c:224
uint8_t data[48]
Additional event data.
Definition: ena.h:22
static const struct pci_id_info tlan_pci_tbl[]
Definition: tlan.c:120
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define BMCR_ANENABLE
Definition: mii.h:49
#define MII_BMSR
Definition: atl1e.h:872
#define TLAN_NET_CONFIG
Definition: tlan.h:251
static u32 BASE
Definition: tlan.c:226
#define BMCR_FULLDPLX
Definition: mii.h:45
uint8_t flags
Flags.
Definition: ena.h:18
static void TLan_MiiWriteReg(struct nic *nic __unused, u16, u16, u16)
Definition: tlan.c:1255

References BASE, BMCR_ANENABLE, BMCR_FULLDPLX, BMSR_ANEGCOMPLETE, chip_idx, data, DBG, tlan_private::duplex, flags, mdelay(), MII_ADVERTISE, MII_BMCR, MII_BMSR, MII_LPA, tlan_private::neg_be_verbose, tlan_private::nic_name, tlan_private::phy, tlan_private::phyNum, 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_PhyPowerDown(), tlan_private::tlanFullDuplex, TRUE, and udelay().

Referenced by TLan_PhyStartLink().

◆ refill_rx()

static void refill_rx ( struct nic *nic  __unused)
static

Definition at line 550 of file tlan.c.

551 {
552  int entry = 0;
553 
554  for (;
555  (priv->cur_rx - priv->dirty_rx +
559  rx_ring[entry].frameSize = TLAN_MAX_FRAME_SIZE;
560  rx_ring[entry].cStat = TLAN_CSTAT_READY;
561  }
562 
563 }
#define rx_ring
Definition: tlan.c:190
union aes_table_entry entry[256]
Table entries, indexed by S(N)
Definition: aes.c:26
#define TLAN_NUM_RX_LISTS
Definition: tlan.h:51
static struct tlan_private * priv
Definition: tlan.c:224
#define TLAN_CSTAT_READY
Definition: tlan.h:138
unsigned int dirty_rx
Definition: tlan.c:205
#define TLAN_MAX_FRAME_SIZE
Definition: tlan.h:49
unsigned int cur_rx
Definition: tlan.c:205
#define TLAN_NUM_TX_LISTS
Definition: tlan.h:52

References tlan_private::cur_rx, tlan_private::dirty_rx, entry, 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 1101 of file tlan.c.

1102 {
1103  u8 nack;
1104  u16 sio, tmp;
1105  u32 i;
1106  int err;
1107  int minten;
1108 
1109  err = FALSE;
1111  sio = BASE + TLAN_DIO_DATA + TLAN_NET_SIO;
1112 
1113  TLan_MiiSync(BASE);
1114 
1115  minten = TLan_GetBit(TLAN_NET_SIO_MINTEN, sio);
1116  if (minten)
1118 
1119  TLan_MiiSendData(BASE, 0x1, 2); /* Start ( 01b ) */
1120  TLan_MiiSendData(BASE, 0x2, 2); /* Read ( 10b ) */
1121  TLan_MiiSendData(BASE, phy, 5); /* Device # */
1122  TLan_MiiSendData(BASE, reg, 5); /* Register # */
1123 
1124 
1125  TLan_ClearBit(TLAN_NET_SIO_MTXEN, sio); /* Change direction */
1126 
1127  TLan_ClearBit(TLAN_NET_SIO_MCLK, sio); /* Clock Idle bit */
1129  TLan_ClearBit(TLAN_NET_SIO_MCLK, sio); /* Wait 300ns */
1130 
1131  nack = TLan_GetBit(TLAN_NET_SIO_MDATA, sio); /* Check for ACK */
1132  TLan_SetBit(TLAN_NET_SIO_MCLK, sio); /* Finish ACK */
1133  if (nack) { /* No ACK, so fake it */
1134  for (i = 0; i < 16; i++) {
1137  }
1138  tmp = 0xffff;
1139  err = TRUE;
1140  } else { /* ACK, so read data */
1141  for (tmp = 0, i = 0x8000; i; i >>= 1) {
1143  if (TLan_GetBit(TLAN_NET_SIO_MDATA, sio))
1144  tmp |= i;
1146  }
1147  }
1148 
1149 
1150  TLan_ClearBit(TLAN_NET_SIO_MCLK, sio); /* Idle cycle */
1152 
1153  if (minten)
1155 
1156  *val = tmp;
1157 
1158  return err;
1159 
1160 } /* TLan_MiiReadReg */
uint16_t u16
Definition: stdint.h:21
#define TLAN_DIO_ADR
Definition: tlan.h:210
#define TLan_ClearBit(bit, port)
Definition: tlan.h:434
static unsigned int unsigned int reg
Definition: myson.h:162
#define outw(data, io_addr)
Definition: io.h:319
#define TLAN_NET_SIO_MINTEN
Definition: tlan.h:231
#define TLan_SetBit(bit, port)
Definition: tlan.h:436
unsigned long tmp
Definition: linux_pci.h:53
static void TLan_MiiSendData(u16, u32, unsigned)
Definition: tlan.c:1180
#define TLAN_NET_SIO_MCLK
Definition: tlan.h:236
#define TLAN_NET_SIO
Definition: tlan.h:230
#define TLan_GetBit(bit, port)
Definition: tlan.h:435
#define TLAN_NET_SIO_MDATA
Definition: tlan.h:238
#define TRUE
Definition: tlan.h:46
void __asmcall int val
Definition: setjmp.h:28
#define FALSE
Definition: tlan.h:45
#define TLAN_DIO_DATA
Definition: tlan.h:216
static void TLan_MiiSync(u16)
Definition: tlan.c:1219
#define TLAN_NET_SIO_MTXEN
Definition: tlan.h:237
uint8_t u8
Definition: stdint.h:19
uint32_t u32
Definition: stdint.h:23
static u32 BASE
Definition: tlan.c:226

References 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, 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 1180 of file tlan.c.

1181 {
1182  u16 sio;
1183  u32 i;
1184 
1185  if (num_bits == 0)
1186  return;
1187 
1188  outw(TLAN_NET_SIO, base_port + TLAN_DIO_ADR);
1189  sio = base_port + TLAN_DIO_DATA + TLAN_NET_SIO;
1191 
1192  for (i = (0x1 << (num_bits - 1)); i; i >>= 1) {
1194  (void) TLan_GetBit(TLAN_NET_SIO_MCLK, sio);
1195  if (data & i)
1197  else
1200  (void) TLan_GetBit(TLAN_NET_SIO_MCLK, sio);
1201  }
1202 
1203 } /* TLan_MiiSendData */
uint16_t u16
Definition: stdint.h:21
#define TLAN_DIO_ADR
Definition: tlan.h:210
#define TLan_ClearBit(bit, port)
Definition: tlan.h:434
#define outw(data, io_addr)
Definition: io.h:319
#define TLan_SetBit(bit, port)
Definition: tlan.h:436
#define TLAN_NET_SIO_MCLK
Definition: tlan.h:236
#define TLAN_NET_SIO
Definition: tlan.h:230
#define TLan_GetBit(bit, port)
Definition: tlan.h:435
#define TLAN_NET_SIO_MDATA
Definition: tlan.h:238
uint8_t data[48]
Additional event data.
Definition: ena.h:22
#define TLAN_DIO_DATA
Definition: tlan.h:216
#define TLAN_NET_SIO_MTXEN
Definition: tlan.h:237
uint32_t u32
Definition: stdint.h:23

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, and TLan_SetBit.

Referenced by TLan_MiiReadReg(), and TLan_MiiWriteReg().

◆ TLan_MiiSync()

void TLan_MiiSync ( u16  base_port)
static

Definition at line 1219 of file tlan.c.

1220 {
1221  int i;
1222  u16 sio;
1223 
1224  outw(TLAN_NET_SIO, base_port + TLAN_DIO_ADR);
1225  sio = base_port + TLAN_DIO_DATA + TLAN_NET_SIO;
1226 
1228  for (i = 0; i < 32; i++) {
1231  }
1232 
1233 } /* TLan_MiiSync */
uint16_t u16
Definition: stdint.h:21
#define TLAN_DIO_ADR
Definition: tlan.h:210
#define TLan_ClearBit(bit, port)
Definition: tlan.h:434
#define outw(data, io_addr)
Definition: io.h:319
#define TLan_SetBit(bit, port)
Definition: tlan.h:436
#define TLAN_NET_SIO_MCLK
Definition: tlan.h:236
#define TLAN_NET_SIO
Definition: tlan.h:230
#define TLAN_DIO_DATA
Definition: tlan.h:216
#define TLAN_NET_SIO_MTXEN
Definition: tlan.h:237

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

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 1255 of file tlan.c.

1256 {
1257  u16 sio;
1258  int minten;
1259 
1261  sio = BASE + TLAN_DIO_DATA + TLAN_NET_SIO;
1262 
1263  TLan_MiiSync(BASE);
1264 
1265  minten = TLan_GetBit(TLAN_NET_SIO_MINTEN, sio);
1266  if (minten)
1268 
1269  TLan_MiiSendData(BASE, 0x1, 2); /* Start ( 01b ) */
1270  TLan_MiiSendData(BASE, 0x1, 2); /* Write ( 01b ) */
1271  TLan_MiiSendData(BASE, phy, 5); /* Device # */
1272  TLan_MiiSendData(BASE, reg, 5); /* Register # */
1273 
1274  TLan_MiiSendData(BASE, 0x2, 2); /* Send ACK */
1275  TLan_MiiSendData(BASE, val, 16); /* Send Data */
1276 
1277  TLan_ClearBit(TLAN_NET_SIO_MCLK, sio); /* Idle cycle */
1279 
1280  if (minten)
1282 
1283 
1284 } /* TLan_MiiWriteReg */
uint16_t u16
Definition: stdint.h:21
#define TLAN_DIO_ADR
Definition: tlan.h:210
#define TLan_ClearBit(bit, port)
Definition: tlan.h:434
static unsigned int unsigned int reg
Definition: myson.h:162
#define outw(data, io_addr)
Definition: io.h:319
#define TLAN_NET_SIO_MINTEN
Definition: tlan.h:231
#define TLan_SetBit(bit, port)
Definition: tlan.h:436
static void TLan_MiiSendData(u16, u32, unsigned)
Definition: tlan.c:1180
#define TLAN_NET_SIO_MCLK
Definition: tlan.h:236
#define TLAN_NET_SIO
Definition: tlan.h:230
#define TLan_GetBit(bit, port)
Definition: tlan.h:435
void __asmcall int val
Definition: setjmp.h:28
#define TLAN_DIO_DATA
Definition: tlan.h:216
static void TLan_MiiSync(u16)
Definition: tlan.c:1219
static u32 BASE
Definition: tlan.c:226

References 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, 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 379 of file tlan.c.

380 {
381 
382  u8 data;
383  u32 phy;
384  u8 sio;
385  u16 status;
386  u16 partner;
387  u16 tlphy_ctl;
388  u16 tlphy_par;
389  u16 tlphy_id1, tlphy_id2;
390  int i;
391 
392  phy = priv->phy[priv->phyNum];
393 
395  if (priv->tlanFullDuplex) {
397  }
400  if (priv->phyNum == 0) {
402  }
404  TLan_DioWrite16(BASE, TLAN_MAX_RX, ((1536) + 7) & ~7);
405  TLan_MiiReadReg(nic, phy, MII_PHYSID1, &tlphy_id1);
406  TLan_MiiReadReg(nic, phy, MII_PHYSID2, &tlphy_id2);
407 
409  || (priv->aui)) {
411  DBG ( "TLAN: %s: Link forced.\n", priv->nic_name );
412  } else {
414  udelay(1000);
416  if ((status & BMSR_LSTATUS) && /* We only support link info on Nat.Sem. PHY's */
417  (tlphy_id1 == NAT_SEM_ID1)
418  && (tlphy_id2 == NAT_SEM_ID2)) {
421  &tlphy_par);
422 
423  DBG ( "TLAN: %s: Link active with ",
424  priv->nic_name );
425  if (!(tlphy_par & TLAN_PHY_AN_EN_STAT)) {
426  DBG ( "forced 10%sMbps %s-Duplex\n",
427  tlphy_par & TLAN_PHY_SPEED_100 ? ""
428  : "0",
429  tlphy_par & TLAN_PHY_DUPLEX_FULL ?
430  "Full" : "Half" );
431  } else {
432  DBG
433  ( "AutoNegotiation enabled, at 10%sMbps %s-Duplex\n",
434  tlphy_par & TLAN_PHY_SPEED_100 ? "" :
435  "0",
436  tlphy_par & TLAN_PHY_DUPLEX_FULL ?
437  "Full" : "Half" );
438  DBG ( "TLAN: Partner capability: " );
439  for (i = 5; i <= 10; i++)
440  if (partner & (1 << i)) {
441  DBG ( "%s", media[i - 5] );
442  }
443  DBG ( "\n" );
444  }
445 
447 #ifdef MONITOR
448  /* We have link beat..for now anyway */
449  priv->link = 1;
450  /*Enabling link beat monitoring */
451  /* TLan_SetTimer( nic, (10*HZ), TLAN_TIMER_LINK_BEAT ); */
452  mdelay(10000);
453  TLan_PhyMonitor(nic);
454 #endif
455  } else if (status & BMSR_LSTATUS) {
456  DBG ( "TLAN: %s: Link active\n", priv->nic_name );
458  }
459  }
460 
461  if (priv->phyNum == 0) {
462  TLan_MiiReadReg(nic, phy, TLAN_TLPHY_CTL, &tlphy_ctl);
463  tlphy_ctl |= TLAN_TC_INTEN;
464  TLan_MiiWriteReg(nic, phy, TLAN_TLPHY_CTL, tlphy_ctl);
466  sio |= TLAN_NET_SIO_MINTEN;
468  }
469 
470  if (status & BMSR_LSTATUS) {
472  priv->phyOnline = 1;
473  outb((TLAN_HC_INT_ON >> 8), BASE + TLAN_HOST_CMD + 1);
476  } else {
477  DBG
478  ( "TLAN: %s: Link inactive, will retry in 10 secs...\n",
479  priv->nic_name );
480  /* TLan_SetTimer( nic, (10*HZ), TLAN_TIMER_FINISH_RESET ); */
481  mdelay(10000);
483  return;
484 
485  }
486 
487 } /* TLan_FinishReset */
uint16_t u16
Definition: stdint.h:21
u32 phyOnline
Definition: tlan.c:212
#define MII_LPA
Definition: atl1e.h:876
#define TLAN_CH_PARM
Definition: tlan.h:209
#define TLAN_NET_MASK_MASK4
Definition: tlan.h:249
#define TLAN_LED_REG
Definition: tlan.h:288
#define TLAN_NET_CMD
Definition: tlan.h:221
#define TLAN_TLPHY_PAR
Definition: tlan.h:336
static u8 TLan_DioRead8(u16 base_addr, u16 internal_addr)
Definition: tlan.h:352
static int chip_idx
Definition: tlan.c:195
u32 phyNum
Definition: tlan.c:216
#define TLAN_TC_INTEN
Definition: tlan.h:328
static void TLan_SetMac(struct nic *nic __unused, int areg, unsigned char *mac)
Definition: tlan.c:1307
#define TLAN_HC_RT
Definition: tlan.h:200
#define rx_ring
Definition: tlan.c:190
u32 phy[2]
Definition: tlan.c:215
#define TLAN_NET_SIO_MINTEN
Definition: tlan.h:231
static void TLan_DioWrite16(u16 base_addr, u16 internal_addr, u16 data)
Definition: tlan.h:392
#define TLAN_LED_LINK
Definition: tlan.h:290
#define TLAN_HOST_CMD
Definition: tlan.h:194
uint8_t status
Status.
Definition: ena.h:16
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
Definition: io.h:183
#define TLAN_MAX_RX
Definition: tlan.h:292
#define TLAN_ADAPTER_UNMANAGED_PHY
Definition: tlan.h:95
#define TLAN_NET_MASK_MASK7
Definition: tlan.h:246
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:60
static void TLan_FinishReset(struct nic *nic __unused)
#define TLAN_TLPHY_CTL
Definition: tlan.h:320
u8 tlanFullDuplex
Definition: tlan.c:219
static int TLan_MiiReadReg(struct nic *nic __unused, u16, u16, u16 *)
Definition: tlan.c:1101
#define BMSR_LSTATUS
Definition: mii.h:57
#define TLAN_NET_CMD_NRESET
Definition: tlan.h:222
const char * nic_name
Definition: tlan.c:204
#define outl(data, io_addr)
Definition: io.h:329
#define TLAN_NET_MASK
Definition: tlan.h:245
#define TLAN_NET_SIO
Definition: tlan.h:230
#define TLAN_NET_MASK_MASK5
Definition: tlan.h:248
u8 link
Definition: tlan.c:220
Definition: nic.h:49
#define TLAN_PHY_AN_EN_STAT
Definition: tlan.h:340
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
Definition: timer.c:78
#define TLAN_HC_INT_ON
Definition: tlan.h:207
unsigned char * node_addr
Definition: nic.h:52
#define outb(data, io_addr)
Definition: io.h:309
#define NAT_SEM_ID2
Definition: tlan.h:344
static struct tlan_private * priv
Definition: tlan.c:224
#define MII_PHYSID2
Definition: atl1e.h:874
#define TLAN_PHY_DUPLEX_FULL
Definition: tlan.h:339
u32 aui
Definition: tlan.c:213
#define NAT_SEM_ID1
Definition: tlan.h:343
uint8_t data[48]
Additional event data.
Definition: ena.h:22
static void TLan_DioWrite8(u16 base_addr, u16 internal_addr, u8 data)
Definition: tlan.h:382
static const struct pci_id_info tlan_pci_tbl[]
Definition: tlan.c:120
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define MII_BMSR
Definition: atl1e.h:872
#define MII_PHYSID1
Definition: atl1e.h:873
#define TLAN_NET_CMD_DUPLEX
Definition: tlan.h:227
#define TLAN_PHY_SPEED_100
Definition: tlan.h:338
uint8_t u8
Definition: stdint.h:19
uint32_t u32
Definition: stdint.h:23
static u32 BASE
Definition: tlan.c:226
#define TLAN_NET_CMD_NWRAP
Definition: tlan.h:223
struct eth_slow_lacp_entity_tlv partner
Partner information.
Definition: eth_slow.h:16
static const char * media[]
Definition: tlan.c:95
#define TLAN_HC_GO
Definition: tlan.h:195
uint8_t flags
Flags.
Definition: ena.h:18
static void TLan_MiiWriteReg(struct nic *nic __unused, u16, u16, u16)
Definition: tlan.c:1255

References tlan_private::aui, BASE, BMSR_LSTATUS, chip_idx, data, DBG, flags, tlan_private::link, mdelay(), media, MII_BMSR, MII_LPA, MII_PHYSID1, MII_PHYSID2, NAT_SEM_ID1, NAT_SEM_ID2, tlan_private::nic_name, nic::node_addr, outb, outl, partner, tlan_private::phy, tlan_private::phyNum, tlan_private::phyOnline, 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, tlan_private::tlanFullDuplex, udelay(), and virt_to_bus().

◆ tlan_poll()

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

Definition at line 492 of file tlan.c.

493 {
494  /* return true if there's an ethernet packet ready to read */
495  /* nic->packet should contain data on return */
496  /* nic->packetlen should contain length of data */
497  u32 framesize;
498  u32 host_cmd = 0;
499  u32 ack = 1;
500  int eoc = 0;
502  u16 tmpCStat = le32_to_cpu(rx_ring[entry].cStat);
503  u16 host_int = inw(BASE + TLAN_HOST_INT);
504 
505  if ((tmpCStat & TLAN_CSTAT_FRM_CMP) && !retrieve)
506  return 1;
507 
508  outw(host_int, BASE + TLAN_HOST_INT);
509 
510  if (!(tmpCStat & TLAN_CSTAT_FRM_CMP))
511  return 0;
512 
513  /* printf("PI-1: 0x%hX\n", host_int); */
514  if (tmpCStat & TLAN_CSTAT_EOC)
515  eoc = 1;
516 
517  framesize = rx_ring[entry].frameSize;
518 
519  nic->packetlen = framesize;
520 
521  DBG ( ".%d.", (unsigned int) framesize );
522 
523  memcpy(nic->packet, rxb +
525 
526  rx_ring[entry].cStat = 0;
527 
528  DBG ( "%d", entry );
529 
530  entry = (entry + 1) % TLAN_NUM_RX_LISTS;
531  priv->cur_rx = entry;
532  if (eoc) {
533  if ((rx_ring[entry].cStat & TLAN_CSTAT_READY) ==
535  ack |= TLAN_HC_GO | TLAN_HC_RT;
536  host_cmd = TLAN_HC_ACK | ack | 0x001C0000;
537  outl(host_cmd, BASE + TLAN_HOST_CMD);
538  }
539  } else {
540  host_cmd = TLAN_HC_ACK | ack | (0x000C0000);
541  outl(host_cmd, BASE + TLAN_HOST_CMD);
542 
543  DBG ( "AC: 0x%hX\n", inw(BASE + TLAN_CH_PARM) );
544  DBG ( "PI-2: 0x%hX\n", inw(BASE + TLAN_HOST_INT) );
545  }
546  refill_rx(nic);
547  return (1); /* initially as this is called to flush the input */
548 }
#define TLAN_HC_ACK
Definition: tlan.h:197
uint16_t u16
Definition: stdint.h:21
static void refill_rx(struct nic *nic __unused)
Definition: tlan.c:550
#define TLAN_CH_PARM
Definition: tlan.h:209
uint16_t inw(volatile uint16_t *io_addr)
Read 16-bit word from I/O-mapped device.
#define le32_to_cpu(value)
Definition: byteswap.h:113
#define outw(data, io_addr)
Definition: io.h:319
#define TLAN_HC_RT
Definition: tlan.h:200
#define rx_ring
Definition: tlan.c:190
#define TLAN_CSTAT_EOC
Definition: tlan.h:139
#define TLAN_HOST_CMD
Definition: tlan.h:194
void * memcpy(void *dest, const void *src, size_t len) __nonnull
u16 cStat
Definition: tlan.c:174
#define TLAN_CSTAT_FRM_CMP
Definition: tlan.h:137
unsigned int packetlen
Definition: nic.h:54
union aes_table_entry entry[256]
Table entries, indexed by S(N)
Definition: aes.c:26
#define outl(data, io_addr)
Definition: io.h:329
Definition: nic.h:49
#define TLAN_NUM_RX_LISTS
Definition: tlan.h:51
unsigned char * packet
Definition: nic.h:53
static struct tlan_private * priv
Definition: tlan.c:224
#define TLAN_HOST_INT
Definition: tlan.h:213
#define TLAN_CSTAT_READY
Definition: tlan.h:138
#define TLAN_MAX_FRAME_SIZE
Definition: tlan.h:49
unsigned int cur_rx
Definition: tlan.c:205
#define rxb
Definition: tlan.c:191
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
uint32_t u32
Definition: stdint.h:23
static u32 BASE
Definition: tlan.c:226
#define TLAN_HC_GO
Definition: tlan.h:195

References BASE, TLanList::cStat, tlan_private::cur_rx, DBG, entry, 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, and TLAN_NUM_RX_LISTS.

◆ tlan_transmit()

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

Definition at line 568 of file tlan.c.

572 { /* Packet */
573  u16 nstype;
574  u32 to;
575  struct TLanList *tail_list;
576  struct TLanList *head_list;
577  u8 *tail_buffer;
578  u32 ack = 0;
579  u32 host_cmd;
580  int eoc = 0;
581  u16 tmpCStat;
582  u16 host_int = inw(BASE + TLAN_HOST_INT);
583 
584  int entry = 0;
585 
586  DBG ( "INT0-0x%hX\n", host_int );
587 
588  if (!priv->phyOnline) {
589  printf("TRANSMIT: %s PHY is not ready\n", priv->nic_name);
590  return;
591  }
592 
593  tail_list = priv->txList + priv->txTail;
594 
595  if (tail_list->cStat != TLAN_CSTAT_UNUSED) {
596  printf("TRANSMIT: %s is busy (Head=%p Tail=%x)\n",
597  priv->nic_name, priv->txList, (unsigned int) priv->txTail);
599 // priv->txBusyCount++;
600  return;
601  }
602 
603  tail_list->forward = 0;
604 
605  tail_buffer = txb + (priv->txTail * TLAN_MAX_FRAME_SIZE);
606 
607  /* send the packet to destination */
608  memcpy(tail_buffer, d, ETH_ALEN);
609  memcpy(tail_buffer + ETH_ALEN, nic->node_addr, ETH_ALEN);
610  nstype = htons((u16) t);
611  memcpy(tail_buffer + 2 * ETH_ALEN, (u8 *) & nstype, 2);
612  memcpy(tail_buffer + ETH_HLEN, p, s);
613 
614  s += ETH_HLEN;
615  s &= 0x0FFF;
616  while (s < ETH_ZLEN)
617  tail_buffer[s++] = '\0';
618 
619  /*=====================================================*/
620  /* Receive
621  * 0000 0000 0001 1100
622  * 0000 0000 0000 1100
623  * 0000 0000 0000 0011 = 0x0003
624  *
625  * 0000 0000 0000 0000 0000 0000 0000 0011
626  * 0000 0000 0000 1100 0000 0000 0000 0000 = 0x000C0000
627  *
628  * Transmit
629  * 0000 0000 0001 1100
630  * 0000 0000 0000 0100
631  * 0000 0000 0000 0001 = 0x0001
632  *
633  * 0000 0000 0000 0000 0000 0000 0000 0001
634  * 0000 0000 0000 0100 0000 0000 0000 0000 = 0x00040000
635  * */
636 
637  /* Setup the transmit descriptor */
638  tail_list->frameSize = (u16) s;
639  tail_list->buffer[0].count = TLAN_LAST_BUFFER | (u32) s;
640  tail_list->buffer[1].count = 0;
641  tail_list->buffer[1].address = 0;
642 
643  tail_list->cStat = TLAN_CSTAT_READY;
644 
645  DBG ( "INT1-0x%hX\n", inw(BASE + TLAN_HOST_INT) );
646 
647  if (!priv->txInProgress) {
648  priv->txInProgress = 1;
649  outl(virt_to_le32desc(tail_list), BASE + TLAN_CH_PARM);
651  } else {
652  if (priv->txTail == 0) {
653  DBG ( "Out buffer\n" );
654  (priv->txList + (TLAN_NUM_TX_LISTS - 1))->forward =
655  virt_to_le32desc(tail_list);
656  } else {
657  DBG ( "Fix this \n" );
658  (priv->txList + (priv->txTail - 1))->forward =
659  virt_to_le32desc(tail_list);
660  }
661  }
662 
664 
665  DBG ( "INT2-0x%hX\n", inw(BASE + TLAN_HOST_INT) );
666 
667  to = currticks() + TX_TIME_OUT;
668  while ((tail_list->cStat == TLAN_CSTAT_READY) && currticks() < to);
669 
670  head_list = priv->txList + priv->txHead;
671  while (((tmpCStat = head_list->cStat) & TLAN_CSTAT_FRM_CMP)
672  && (ack < 255)) {
673  ack++;
674  if(tmpCStat & TLAN_CSTAT_EOC)
675  eoc =1;
676  head_list->cStat = TLAN_CSTAT_UNUSED;
678  head_list = priv->txList + priv->txHead;
679 
680  }
681  if(!ack)
682  printf("Incomplete TX Frame\n");
683 
684  if(eoc) {
685  head_list = priv->txList + priv->txHead;
686  if ((head_list->cStat & TLAN_CSTAT_READY) == TLAN_CSTAT_READY) {
687  outl(virt_to_le32desc(head_list), BASE + TLAN_CH_PARM);
688  ack |= TLAN_HC_GO;
689  } else {
690  priv->txInProgress = 0;
691  }
692  }
693  if(ack) {
694  host_cmd = TLAN_HC_ACK | ack;
695  outl(host_cmd, BASE + TLAN_HOST_CMD);
696  }
697 
698  if(priv->tlanRev < 0x30 ) {
699  ack = 1;
700  head_list = priv->txList + priv->txHead;
701  if ((head_list->cStat & TLAN_CSTAT_READY) == TLAN_CSTAT_READY) {
702  outl(virt_to_le32desc(head_list), BASE + TLAN_CH_PARM);
703  ack |= TLAN_HC_GO;
704  } else {
705  priv->txInProgress = 0;
706  }
707  host_cmd = TLAN_HC_ACK | ack | 0x00140000;
708  outl(host_cmd, BASE + TLAN_HOST_CMD);
709 
710  }
711 
712  if (currticks() >= to) {
713  printf("TX Time Out");
714  }
715 }
#define TLAN_HC_ACK
Definition: tlan.h:197
#define u16
Definition: vga.h:20
uint16_t u16
Definition: stdint.h:21
u32 phyOnline
Definition: tlan.c:212
#define TLAN_CH_PARM
Definition: tlan.h:209
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
uint16_t inw(volatile uint16_t *io_addr)
Read 16-bit word from I/O-mapped device.
u32 address
Definition: tlan.c:178
#define virt_to_le32desc(addr)
Definition: tlan.c:59
u32 count
Definition: tlan.c:177
u32 forward
Definition: tlan.c:173
u32 txTail
Definition: tlan.c:210
#define txb
Definition: tlan.c:189
#define TLAN_CSTAT_EOC
Definition: tlan.h:139
u32 txHead
Definition: tlan.c:208
#define tx_ring
Definition: tlan.c:188
#define TLAN_HOST_CMD
Definition: tlan.h:194
#define TLAN_CSTAT_UNUSED
Definition: tlan.h:136
u16 frameSize
Definition: tlan.c:175
void * memcpy(void *dest, const void *src, size_t len) __nonnull
Definition: tlan.c:172
#define ETH_HLEN
Definition: if_ether.h:9
u16 cStat
Definition: tlan.c:174
#define TLAN_CSTAT_FRM_CMP
Definition: tlan.h:137
struct TLanList * txList
Definition: tlan.c:207
#define u32
Definition: vga.h:21
#define CIRC_INC(a, b)
Definition: tlan.h:348
struct TLanList::@352 buffer[TLAN_BUFFERS_PER_LIST]
union aes_table_entry entry[256]
Table entries, indexed by S(N)
Definition: aes.c:26
const char * nic_name
Definition: tlan.c:204
#define outl(data, io_addr)
Definition: io.h:329
#define ETH_ALEN
Definition: if_ether.h:8
#define ETH_ZLEN
Definition: if_ether.h:10
u8 tlanRev
Definition: tlan.c:218
Definition: nic.h:49
unsigned char * node_addr
Definition: nic.h:52
static struct tlan_private * priv
Definition: tlan.c:224
#define TLAN_HOST_INT
Definition: tlan.h:213
u32 txInProgress
Definition: tlan.c:209
#define TLAN_CSTAT_READY
Definition: tlan.h:138
#define TLAN_LAST_BUFFER
Definition: tlan.h:135
uint32_t d
Definition: md4.c:31
#define TLAN_MAX_FRAME_SIZE
Definition: tlan.h:49
#define TX_TIME_OUT
Definition: tlan.c:56
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 TLAN_NUM_TX_LISTS
Definition: tlan.h:52
#define htons(value)
Definition: byteswap.h:135
uint8_t u8
Definition: stdint.h:19
uint32_t u32
Definition: stdint.h:23
static u32 BASE
Definition: tlan.c:226
#define TLAN_HC_GO
Definition: tlan.h:195

References TLanList::address, BASE, TLanList::buffer, CIRC_INC, TLanList::count, TLanList::cStat, currticks(), d, DBG, entry, ETH_ALEN, ETH_HLEN, ETH_ZLEN, TLanList::forward, TLanList::frameSize, htons, inw(), memcpy(), tlan_private::nic_name, nic::node_addr, outl, tlan_private::phyOnline, 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, tlan_private::tlanRev, tx_ring, TX_TIME_OUT, txb, tlan_private::txHead, tlan_private::txInProgress, tlan_private::txList, tlan_private::txTail, u16, u32, and virt_to_le32desc.

◆ tlan_disable()

static void tlan_disable ( struct nic *nic  __unused)
static

Definition at line 720 of file tlan.c.

720  {
721  /* put the card in its initial state */
722  /* This function serves 3 purposes.
723  * This disables DMA and interrupts so we don't receive
724  * unexpected packets or interrupts from the card after
725  * etherboot has finished.
726  * This frees resources so etherboot may use
727  * this driver on another interface
728  * This allows etherboot to reinitialize the interface
729  * if something is something goes wrong.
730  *
731  */
733 }
#define TLAN_HC_AD_RST
Definition: tlan.h:202
#define TLAN_HOST_CMD
Definition: tlan.h:194
#define outl(data, io_addr)
Definition: io.h:329
static u32 BASE
Definition: tlan.c:226

References BASE, outl, TLAN_HC_AD_RST, and TLAN_HOST_CMD.

◆ tlan_irq()

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

Definition at line 738 of file tlan.c.

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

References DISABLE, ENABLE, and FORCE.

◆ TLan_SetMulticastList()

static void TLan_SetMulticastList ( struct nic nic)
static

Definition at line 758 of file tlan.c.

758  {
759  int i;
760  u8 tmp;
761 
762  /* !IFF_PROMISC */
765 
766  /* IFF_ALLMULTI */
767  for(i = 0; i< 3; i++)
768  TLan_SetMac(nic, i + 1, NULL);
769  TLan_DioWrite32(BASE, TLAN_HASH_1, 0xFFFFFFFF);
770  TLan_DioWrite32(BASE, TLAN_HASH_2, 0xFFFFFFFF);
771 
772 
773 }
#define TLAN_NET_CMD
Definition: tlan.h:221
static u8 TLan_DioRead8(u16 base_addr, u16 internal_addr)
Definition: tlan.h:352
static void TLan_SetMac(struct nic *nic __unused, int areg, unsigned char *mac)
Definition: tlan.c:1307
#define TLAN_NET_CMD_CAF
Definition: tlan.h:225
unsigned long tmp
Definition: linux_pci.h:53
Definition: nic.h:49
static void TLan_DioWrite8(u16 base_addr, u16 internal_addr, u8 data)
Definition: tlan.h:382
#define TLAN_HASH_2
Definition: tlan.h:274
#define TLAN_HASH_1
Definition: tlan.h:273
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
uint8_t u8
Definition: stdint.h:19
static void TLan_DioWrite32(u16 base_addr, u16 internal_addr, u32 data)
Definition: tlan.h:402
static u32 BASE
Definition: tlan.c:226

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

Referenced by tlan_probe().

◆ tlan_probe()

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

Definition at line 780 of file tlan.c.

780  {
781 
782  u16 data = 0;
783  int err;
784  int i;
785 
786  if (pci->ioaddr == 0)
787  return 0;
788 
789  nic->irqno = 0;
790  nic->ioaddr = pci->ioaddr;
791 
792  BASE = pci->ioaddr;
793 
794  /* Set nic as PCI bus master */
795  adjust_pci_device(pci);
796 
797  /* Point to private storage */
799 
800  /* Figure out which chip we're dealing with */
801  i = 0;
802  chip_idx = -1;
803  while (tlan_pci_tbl[i].name) {
804  if ((((u32) pci->device << 16) | pci->vendor) ==
805  (tlan_pci_tbl[i].id.pci & 0xffffffff)) {
806  chip_idx = i;
807  break;
808  }
809  i++;
810  }
811  if (chip_idx == -1)
812  return 0;
813 
814  priv->vendor_id = pci->vendor;
815  priv->dev_id = pci->device;
816  priv->nic_name = pci->id->name;
817  priv->eoc = 0;
818 
819  err = 0;
820  for (i = 0; i < 6; i++)
821  err |= TLan_EeReadByte(BASE,
823  addrOfs + i,
824  (u8 *) & nic->node_addr[i]);
825  if (err) {
826  printf ( "TLAN: %s: Error reading MAC from eeprom: %d\n",
827  pci->id->name, err);
828  } else {
829  DBG ( "%s: %s at ioaddr %#lX, ",
830  pci->id->name, eth_ntoa ( nic->node_addr ), pci->ioaddr );
831  }
832 
834  printf("revision: 0x%hX\n", priv->tlanRev);
835 
838 
839  data = inl(BASE + TLAN_HOST_CMD);
842 
844  udelay(100);
845  priv->txList = tx_ring;
846 
847 /* if (board_found && valid_link)
848  {*/
849  /* point to NIC specific routines */
851  return 1;
852 }
unsigned char irqno
Definition: nic.h:56
uint16_t u16
Definition: stdint.h:21
const char * name
Definition: ath9k_hw.c:1984
#define TLAN_DEF_REVISION
Definition: tlan.h:265
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
#define outw(data, io_addr)
Definition: io.h:319
static u8 TLan_DioRead8(u16 base_addr, u16 internal_addr)
Definition: tlan.h:352
unsigned long ioaddr
I/O address.
Definition: pci.h:221
static int chip_idx
Definition: tlan.c:195
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
Definition: pci.c:154
#define tx_ring
Definition: tlan.c:188
#define TLAN_HOST_CMD
Definition: tlan.h:194
int eoc
Definition: tlan.c:211
unsigned int ioaddr
Definition: nic.h:55
uint16_t device
Device ID.
Definition: pci.h:225
static void TLan_SetMulticastList(struct nic *nic)
Definition: tlan.c:758
#define TLAN_HC_INT_OFF
Definition: tlan.h:206
struct TLanList * txList
Definition: tlan.c:207
static void TLan_ResetLists(struct nic *nic __unused)
Definition: tlan.c:242
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:60
const char * nic_name
Definition: tlan.c:204
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
Definition: ethernet.c:175
unsigned short vendor_id
Definition: tlan.c:202
u8 tlanRev
Definition: tlan.c:218
Definition: nic.h:49
const char * name
Name.
Definition: pci.h:172
static struct nic_operations tlan_operations
Definition: tlan.c:750
uint16_t vendor
Vendor ID.
Definition: pci.h:223
struct pci_id_info::match_info id
unsigned char * node_addr
Definition: nic.h:52
static struct tlan_private * priv
Definition: tlan.c:224
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.
Definition: pci.h:243
uint8_t data[48]
Additional event data.
Definition: ena.h:22
static int TLan_EeReadByte(u16 io_base, u8, u8 *)
Definition: tlan.c:1034
static const struct pci_id_info tlan_pci_tbl[]
Definition: tlan.c:120
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
struct nic_operations * nic_op
Definition: nic.h:50
static void TLan_ResetAdapter(struct nic *nic __unused)
Definition: tlan.c:300
uint8_t u8
Definition: stdint.h:19
uint32_t u32
Definition: stdint.h:23
static u32 BASE
Definition: tlan.c:226
unsigned short dev_id
Definition: tlan.c:203
static struct tlan_private TLanPrivateInfo

References adjust_pci_device(), BASE, chip_idx, data, DBG, tlan_private::dev_id, pci_device::device, tlan_private::eoc, eth_ntoa(), pci_id_info::id, pci_device::id, inl(), nic::ioaddr, pci_device::ioaddr, nic::irqno, pci_device_id::name, name, tlan_private::nic_name, nic::nic_op, nic::node_addr, outw, pci_id_info::match_info::pci, 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, tlan_private::tlanRev, tx_ring, tlan_private::txList, udelay(), pci_device::vendor, and tlan_private::vendor_id.

◆ 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   
)

Variable Documentation

◆ media

const char* media[]
static
Initial value:
= {
"10BaseT-HD ", "10BaseT-FD ", "100baseTx-HD ",
"100baseTx-FD", "100baseT4", NULL
}
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

Definition at line 95 of file tlan.c.

Referenced by TLan_FinishReset().

◆ tlan_pci_tbl

const struct pci_id_info tlan_pci_tbl[]
static

◆ tx_ring

struct TLanList tx_ring[TLAN_NUM_TX_LISTS]

Definition at line 183 of file tlan.c.

◆ txb

Definition at line 184 of file tlan.c.

◆ rx_ring

struct TLanList rx_ring[TLAN_NUM_RX_LISTS]

Definition at line 185 of file tlan.c.

◆ rxb

Definition at line 186 of file tlan.c.

◆ __shared

struct { ... } __shared

◆ chip_idx

int chip_idx
static

◆ TLanPrivateInfo

struct tlan_private TLanPrivateInfo
static

Referenced by tlan_probe().

◆ priv

struct tlan_private* priv
static

Definition at line 224 of file tlan.c.

Referenced by atacmd_identify_done(), eapol_notify(), eapol_probe(), efi_path_net_probe(), 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_set_drvdata(), legacy_eisa_set_drvdata(), legacy_isa_set_drvdata(), legacy_isapnp_set_drvdata(), legacy_mca_set_drvdata(), legacy_pci_set_drvdata(), 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(), netdev_notify(), 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(), 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_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(), vmbus_set_drvdata(), write_grf5101(), write_max2820(), write_sa2400(), and xen_set_drvdata().

◆ BASE

u32 BASE
static

◆ tlan_operations

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

Definition at line 750 of file tlan.c.

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:303

Definition at line 1699 of file tlan.c.