tlan.c

Go to the documentation of this file.
00001 /**************************************************************************
00002 *
00003 *    tlan.c -- Etherboot device driver for the Texas Instruments ThunderLAN
00004 *    Written 2003-2003 by Timothy Legge <tlegge@rogers.com>
00005 *
00006 *    This program is free software; you can redistribute it and/or modify
00007 *    it under the terms of the GNU General Public License as published by
00008 *    the Free Software Foundation; either version 2 of the License, or
00009 *    (at your option) any later version.
00010 *
00011 *    This program is distributed in the hope that it will be useful,
00012 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 *    GNU General Public License for more details.
00015 *
00016 *    You should have received a copy of the GNU General Public License
00017 *    along with this program; if not, write to the Free Software
00018 *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019 *
00020 *    Portions of this code based on:
00021 *       lan.c: Linux ThunderLan Driver:
00022 *
00023 *       by James Banks
00024 *
00025 *       (C) 1997-1998 Caldera, Inc.
00026 *       (C) 1998 James Banks
00027 *       (C) 1999-2001 Torben Mathiasen
00028 *       (C) 2002 Samuel Chessman
00029 *
00030 *    REVISION HISTORY:
00031 *    ================
00032 *    v1.0       07-08-2003      timlegge        Initial not quite working version
00033 *    v1.1       07-27-2003      timlegge        Sync 5.0 and 5.1 versions
00034 *    v1.2       08-19-2003      timlegge        Implement Multicast Support
00035 *    v1.3       08-23-2003      timlegge        Fix the transmit Function
00036 *    v1.4       01-17-2004      timlegge        Initial driver output cleanup    
00037 *    
00038 *    Indent Options: indent -kr -i8
00039 ***************************************************************************/
00040 
00041 FILE_LICENCE ( GPL2_OR_LATER );
00042 
00043 #include "etherboot.h"
00044 #include "nic.h"
00045 #include <gpxe/pci.h>
00046 #include <gpxe/ethernet.h>
00047 #include <mii.h>
00048 #include "tlan.h"
00049 
00050 #define drv_version "v1.4"
00051 #define drv_date "01-17-2004"
00052 
00053 /* NIC specific static variables go here */
00054 #define HZ 100
00055 #define TX_TIME_OUT       (6*HZ)
00056 
00057 /* Condensed operations for readability. */
00058 #define virt_to_le32desc(addr)  cpu_to_le32(virt_to_bus(addr))
00059 #define le32desc_to_virt(addr)  bus_to_virt(le32_to_cpu(addr))
00060 
00061 static void TLan_ResetLists(struct nic *nic __unused);
00062 static void TLan_ResetAdapter(struct nic *nic __unused);
00063 static void TLan_FinishReset(struct nic *nic __unused);
00064 
00065 static void TLan_EeSendStart(u16);
00066 static int TLan_EeSendByte(u16, u8, int);
00067 static void TLan_EeReceiveByte(u16, u8 *, int);
00068 static int TLan_EeReadByte(u16 io_base, u8, u8 *);
00069 
00070 static void TLan_PhyDetect(struct nic *nic);
00071 static void TLan_PhyPowerDown(struct nic *nic);
00072 static void TLan_PhyPowerUp(struct nic *nic);
00073 
00074 
00075 static void TLan_SetMac(struct nic *nic __unused, int areg, unsigned char *mac);
00076 
00077 static void TLan_PhyReset(struct nic *nic);
00078 static void TLan_PhyStartLink(struct nic *nic);
00079 static void TLan_PhyFinishAutoNeg(struct nic *nic);
00080 
00081 #ifdef MONITOR
00082 static void TLan_PhyMonitor(struct nic *nic);
00083 #endif
00084 
00085 
00086 static void refill_rx(struct nic *nic __unused);
00087 
00088 static int TLan_MiiReadReg(struct nic *nic __unused, u16, u16, u16 *);
00089 static void TLan_MiiSendData(u16, u32, unsigned);
00090 static void TLan_MiiSync(u16);
00091 static void TLan_MiiWriteReg(struct nic *nic __unused, u16, u16, u16);
00092 
00093 
00094 static const char *media[] = {
00095         "10BaseT-HD ", "10BaseT-FD ", "100baseTx-HD ",
00096         "100baseTx-FD", "100baseT4", 0
00097 };
00098 
00099 /* This much match tlan_pci_tbl[]!  */
00100 enum tlan_nics {
00101         NETEL10 = 0, NETEL100 = 1, NETFLEX3I = 2, THUNDER = 3, NETFLEX3B =
00102             4, NETEL100PI = 5,
00103         NETEL100D = 6, NETEL100I = 7, OC2183 = 8, OC2325 = 9, OC2326 =
00104             10, NETELLIGENT_10_100_WS_5100 = 11,
00105         NETELLIGENT_10_T2 = 12
00106 };
00107 
00108 struct pci_id_info {
00109         const char *name;
00110         int nic_id;
00111         struct match_info {
00112                 u32 pci, pci_mask, subsystem, subsystem_mask;
00113                 u32 revision, revision_mask;    /* Only 8 bits. */
00114         } id;
00115         u32 flags;
00116         u16 addrOfs;            /* Address Offset */
00117 };
00118 
00119 static const struct pci_id_info tlan_pci_tbl[] = {
00120         {"Compaq Netelligent 10 T PCI UTP", NETEL10,
00121          {0xae340e11, 0xffffffff, 0, 0, 0, 0},
00122          TLAN_ADAPTER_ACTIVITY_LED, 0x83},
00123         {"Compaq Netelligent 10/100 TX PCI UTP", NETEL100,
00124          {0xae320e11, 0xffffffff, 0, 0, 0, 0},
00125          TLAN_ADAPTER_ACTIVITY_LED, 0x83},
00126         {"Compaq Integrated NetFlex-3/P", NETFLEX3I,
00127          {0xae350e11, 0xffffffff, 0, 0, 0, 0},
00128          TLAN_ADAPTER_NONE, 0x83},
00129         {"Compaq NetFlex-3/P", THUNDER,
00130          {0xf1300e11, 0xffffffff, 0, 0, 0, 0},
00131          TLAN_ADAPTER_UNMANAGED_PHY | TLAN_ADAPTER_BIT_RATE_PHY, 0x83},
00132         {"Compaq NetFlex-3/P", NETFLEX3B,
00133          {0xf1500e11, 0xffffffff, 0, 0, 0, 0},
00134          TLAN_ADAPTER_NONE, 0x83},
00135         {"Compaq Netelligent Integrated 10/100 TX UTP", NETEL100PI,
00136          {0xae430e11, 0xffffffff, 0, 0, 0, 0},
00137          TLAN_ADAPTER_ACTIVITY_LED, 0x83},
00138         {"Compaq Netelligent Dual 10/100 TX PCI UTP", NETEL100D,
00139          {0xae400e11, 0xffffffff, 0, 0, 0, 0},
00140          TLAN_ADAPTER_NONE, 0x83},
00141         {"Compaq Netelligent 10/100 TX Embedded UTP", NETEL100I,
00142          {0xb0110e11, 0xffffffff, 0, 0, 0, 0},
00143          TLAN_ADAPTER_NONE, 0x83},
00144         {"Olicom OC-2183/2185", OC2183,
00145          {0x0013108d, 0xffffffff, 0, 0, 0, 0},
00146          TLAN_ADAPTER_USE_INTERN_10, 0x83},
00147         {"Olicom OC-2325", OC2325,
00148          {0x0012108d, 0xffffffff, 0, 0, 0, 0},
00149          TLAN_ADAPTER_UNMANAGED_PHY, 0xF8},
00150         {"Olicom OC-2326", OC2326,
00151          {0x0014108d, 0xffffffff, 0, 0, 0, 0},
00152          TLAN_ADAPTER_USE_INTERN_10, 0xF8},
00153         {"Compaq Netelligent 10/100 TX UTP", NETELLIGENT_10_100_WS_5100,
00154          {0xb0300e11, 0xffffffff, 0, 0, 0, 0},
00155          TLAN_ADAPTER_ACTIVITY_LED, 0x83},
00156         {"Compaq Netelligent 10 T/2 PCI UTP/Coax", NETELLIGENT_10_T2,
00157          {0xb0120e11, 0xffffffff, 0, 0, 0, 0},
00158          TLAN_ADAPTER_NONE, 0x83},
00159         {"Compaq NetFlex-3/E", 0,       /* EISA card */
00160          {0, 0, 0, 0, 0, 0},
00161          TLAN_ADAPTER_ACTIVITY_LED | TLAN_ADAPTER_UNMANAGED_PHY |
00162          TLAN_ADAPTER_BIT_RATE_PHY, 0x83},
00163         {"Compaq NetFlex-3/E", 0,       /* EISA card */
00164          {0, 0, 0, 0, 0, 0},
00165          TLAN_ADAPTER_ACTIVITY_LED, 0x83},
00166         {0, 0,
00167          {0, 0, 0, 0, 0, 0},
00168          0, 0},
00169 };
00170 
00171 struct TLanList {
00172         u32 forward;
00173         u16 cStat;
00174         u16 frameSize;
00175         struct {
00176                 u32 count;
00177                 u32 address;
00178         } buffer[TLAN_BUFFERS_PER_LIST];
00179 };
00180 
00181 struct {
00182         struct TLanList tx_ring[TLAN_NUM_TX_LISTS];
00183         unsigned char txb[TLAN_MAX_FRAME_SIZE * TLAN_NUM_TX_LISTS];
00184         struct TLanList rx_ring[TLAN_NUM_RX_LISTS];
00185         unsigned char rxb[TLAN_MAX_FRAME_SIZE * TLAN_NUM_RX_LISTS];
00186 } tlan_buffers __shared;
00187 #define tx_ring tlan_buffers.tx_ring
00188 #define txb tlan_buffers.txb
00189 #define rx_ring tlan_buffers.rx_ring
00190 #define rxb tlan_buffers.rxb
00191 
00192 typedef u8 TLanBuffer[TLAN_MAX_FRAME_SIZE];
00193 
00194 static int chip_idx;
00195 
00196 /*****************************************************************
00197 * TLAN Private Information Structure
00198 *
00199 ****************************************************************/
00200 static struct tlan_private {
00201         unsigned short vendor_id;       /* PCI Vendor code */
00202         unsigned short dev_id;  /* PCI Device code */
00203         const char *nic_name;
00204         unsigned int cur_rx, dirty_rx;  /* Producer/consumer ring indicies */
00205         unsigned rx_buf_sz;     /* Based on mtu + Slack */
00206         struct TLanList *txList;
00207         u32 txHead;
00208         u32 txInProgress;
00209         u32 txTail;
00210         int eoc;
00211         u32 phyOnline;
00212         u32 aui;
00213         u32 duplex;
00214         u32 phy[2];
00215         u32 phyNum;
00216         u32 speed;
00217         u8 tlanRev;
00218         u8 tlanFullDuplex;
00219         u8 link;
00220         u8 neg_be_verbose;
00221 } TLanPrivateInfo;
00222 
00223 static struct tlan_private *priv;
00224 
00225 static u32 BASE;
00226 
00227 /***************************************************************
00228 *       TLan_ResetLists
00229 *
00230 *       Returns:
00231 *               Nothing
00232 *       Parms:
00233 *               dev     The device structure with the list
00234 *                       stuctures to be reset.
00235 *
00236 *       This routine sets the variables associated with managing
00237 *       the TLAN lists to their initial values.
00238 *
00239 **************************************************************/
00240 
00241 static void TLan_ResetLists(struct nic *nic __unused)
00242 {
00243 
00244         int i;
00245         struct TLanList *list;
00246         priv->txHead = 0;
00247         priv->txTail = 0;
00248 
00249         for (i = 0; i < TLAN_NUM_TX_LISTS; i++) {
00250                 list = &tx_ring[i];
00251                 list->cStat = TLAN_CSTAT_UNUSED;
00252                 list->buffer[0].address = virt_to_bus(txb + 
00253                                 (i * TLAN_MAX_FRAME_SIZE)); 
00254                 list->buffer[2].count = 0;
00255                 list->buffer[2].address = 0;
00256                 list->buffer[9].address = 0;
00257         }
00258 
00259         priv->cur_rx = 0;
00260         priv->rx_buf_sz = (TLAN_MAX_FRAME_SIZE);
00261 //      priv->rx_head_desc = &rx_ring[0];
00262 
00263         /* Initialize all the Rx descriptors */
00264         for (i = 0; i < TLAN_NUM_RX_LISTS; i++) {
00265                 rx_ring[i].forward = virt_to_le32desc(&rx_ring[i + 1]);
00266                 rx_ring[i].cStat = TLAN_CSTAT_READY;
00267                 rx_ring[i].frameSize = TLAN_MAX_FRAME_SIZE;
00268                 rx_ring[i].buffer[0].count =
00269                     TLAN_MAX_FRAME_SIZE | TLAN_LAST_BUFFER;
00270                 rx_ring[i].buffer[0].address =
00271                     virt_to_le32desc(&rxb[i * TLAN_MAX_FRAME_SIZE]);
00272                 rx_ring[i].buffer[1].count = 0;
00273                 rx_ring[i].buffer[1].address = 0;
00274         }
00275 
00276         /* Mark the last entry as wrapping the ring */
00277         rx_ring[i - 1].forward = virt_to_le32desc(&rx_ring[0]);
00278         priv->dirty_rx = (unsigned int) (i - TLAN_NUM_RX_LISTS);
00279 
00280 } /* TLan_ResetLists */
00281 
00282 /***************************************************************
00283 *       TLan_Reset
00284 *
00285 *       Returns:
00286 *               0
00287 *       Parms:
00288 *               dev     Pointer to device structure of adapter
00289 *                       to be reset.
00290 *
00291 *       This function resets the adapter and it's physical
00292 *       device.  See Chap. 3, pp. 9-10 of the "ThunderLAN
00293 *       Programmer's Guide" for details.  The routine tries to
00294 *       implement what is detailed there, though adjustments
00295 *       have been made.
00296 *
00297 **************************************************************/
00298 
00299 void TLan_ResetAdapter(struct nic *nic __unused)
00300 {
00301         int i;
00302         u32 addr;
00303         u32 data;
00304         u8 data8;
00305 
00306         priv->tlanFullDuplex = FALSE;
00307         priv->phyOnline = 0;
00308 /*  1.  Assert reset bit. */
00309 
00310         data = inl(BASE + TLAN_HOST_CMD);
00311         data |= TLAN_HC_AD_RST;
00312         outl(data, BASE + TLAN_HOST_CMD);
00313 
00314         udelay(1000);
00315 
00316 /*  2.  Turn off interrupts. ( Probably isn't necessary ) */
00317 
00318         data = inl(BASE + TLAN_HOST_CMD);
00319         data |= TLAN_HC_INT_OFF;
00320         outl(data, BASE + TLAN_HOST_CMD);
00321 /*  3.  Clear AREGs and HASHs. */
00322 
00323         for (i = TLAN_AREG_0; i <= TLAN_HASH_2; i += 4) {
00324                 TLan_DioWrite32(BASE, (u16) i, 0);
00325         }
00326 
00327 /*  4.  Setup NetConfig register. */
00328 
00329         data =
00330             TLAN_NET_CFG_1FRAG | TLAN_NET_CFG_1CHAN | TLAN_NET_CFG_PHY_EN;
00331         TLan_DioWrite16(BASE, TLAN_NET_CONFIG, (u16) data);
00332 
00333 /*  5.  Load Ld_Tmr and Ld_Thr in HOST_CMD. */
00334 
00335         outl(TLAN_HC_LD_TMR | 0x3f, BASE + TLAN_HOST_CMD);
00336         outl(TLAN_HC_LD_THR | 0x0, BASE + TLAN_HOST_CMD);
00337 
00338 /*  6.  Unreset the MII by setting NMRST (in NetSio) to 1. */
00339 
00340         outw(TLAN_NET_SIO, BASE + TLAN_DIO_ADR);
00341         addr = BASE + TLAN_DIO_DATA + TLAN_NET_SIO;
00342         TLan_SetBit(TLAN_NET_SIO_NMRST, addr);
00343 
00344 /*  7.  Setup the remaining registers. */
00345 
00346         if (priv->tlanRev >= 0x30) {
00347                 data8 = TLAN_ID_TX_EOC | TLAN_ID_RX_EOC;
00348                 TLan_DioWrite8(BASE, TLAN_INT_DIS, data8);
00349         }
00350         TLan_PhyDetect(nic);
00351         data = TLAN_NET_CFG_1FRAG | TLAN_NET_CFG_1CHAN;
00352 
00353         if (tlan_pci_tbl[chip_idx].flags & TLAN_ADAPTER_BIT_RATE_PHY) {
00354                 data |= TLAN_NET_CFG_BIT;
00355                 if (priv->aui == 1) {
00356                         TLan_DioWrite8(BASE, TLAN_ACOMMIT, 0x0a);
00357                 } else if (priv->duplex == TLAN_DUPLEX_FULL) {
00358                         TLan_DioWrite8(BASE, TLAN_ACOMMIT, 0x00);
00359                         priv->tlanFullDuplex = TRUE;
00360                 } else {
00361                         TLan_DioWrite8(BASE, TLAN_ACOMMIT, 0x08);
00362                 }
00363         }
00364 
00365         if (priv->phyNum == 0) {
00366                 data |= TLAN_NET_CFG_PHY_EN;
00367         }
00368         TLan_DioWrite16(BASE, TLAN_NET_CONFIG, (u16) data);
00369 
00370         if (tlan_pci_tbl[chip_idx].flags & TLAN_ADAPTER_UNMANAGED_PHY) {
00371                 TLan_FinishReset(nic);
00372         } else {
00373                 TLan_PhyPowerDown(nic);
00374         }
00375 
00376 }       /* TLan_ResetAdapter */
00377 
00378 void TLan_FinishReset(struct nic *nic)
00379 {
00380 
00381         u8 data;
00382         u32 phy;
00383         u8 sio;
00384         u16 status;
00385         u16 partner;
00386         u16 tlphy_ctl;
00387         u16 tlphy_par;
00388         u16 tlphy_id1, tlphy_id2;
00389         int i;
00390 
00391         phy = priv->phy[priv->phyNum];
00392 
00393         data = TLAN_NET_CMD_NRESET | TLAN_NET_CMD_NWRAP;
00394         if (priv->tlanFullDuplex) {
00395                 data |= TLAN_NET_CMD_DUPLEX;
00396         }
00397         TLan_DioWrite8(BASE, TLAN_NET_CMD, data);
00398         data = TLAN_NET_MASK_MASK4 | TLAN_NET_MASK_MASK5;
00399         if (priv->phyNum == 0) {
00400                 data |= TLAN_NET_MASK_MASK7;
00401         }
00402         TLan_DioWrite8(BASE, TLAN_NET_MASK, data);
00403         TLan_DioWrite16(BASE, TLAN_MAX_RX, ((1536) + 7) & ~7);
00404         TLan_MiiReadReg(nic, phy, MII_PHYSID1, &tlphy_id1);
00405         TLan_MiiReadReg(nic, phy, MII_PHYSID2, &tlphy_id2);
00406 
00407         if ((tlan_pci_tbl[chip_idx].flags & TLAN_ADAPTER_UNMANAGED_PHY)
00408             || (priv->aui)) {
00409                 status = BMSR_LSTATUS;
00410                 DBG ( "TLAN:  %s: Link forced.\n", priv->nic_name );
00411         } else {
00412                 TLan_MiiReadReg(nic, phy, MII_BMSR, &status);
00413                 udelay(1000);
00414                 TLan_MiiReadReg(nic, phy, MII_BMSR, &status);
00415                 if ((status & BMSR_LSTATUS) &&  /* We only support link info on Nat.Sem. PHY's */
00416                     (tlphy_id1 == NAT_SEM_ID1)
00417                     && (tlphy_id2 == NAT_SEM_ID2)) {
00418                         TLan_MiiReadReg(nic, phy, MII_LPA, &partner);
00419                         TLan_MiiReadReg(nic, phy, TLAN_TLPHY_PAR,
00420                                         &tlphy_par);
00421 
00422                         DBG ( "TLAN: %s: Link active with ",
00423                                priv->nic_name );
00424                         if (!(tlphy_par & TLAN_PHY_AN_EN_STAT)) {
00425                                 DBG ( "forced 10%sMbps %s-Duplex\n",
00426                                        tlphy_par & TLAN_PHY_SPEED_100 ? ""
00427                                        : "0",
00428                                        tlphy_par & TLAN_PHY_DUPLEX_FULL ?
00429                                        "Full" : "Half" );
00430                         } else {
00431                                 DBG 
00432                                     ( "AutoNegotiation enabled, at 10%sMbps %s-Duplex\n",
00433                                      tlphy_par & TLAN_PHY_SPEED_100 ? "" :
00434                                      "0",
00435                                      tlphy_par & TLAN_PHY_DUPLEX_FULL ?
00436                                      "Full" : "Half" );
00437                                 DBG ( "TLAN: Partner capability: " );
00438                                 for (i = 5; i <= 10; i++)
00439                                         if (partner & (1 << i)) {
00440                                                 DBG ( "%s", media[i - 5] );
00441                                         }
00442                                 DBG ( "\n" );
00443                         }
00444 
00445                         TLan_DioWrite8(BASE, TLAN_LED_REG, TLAN_LED_LINK);
00446 #ifdef MONITOR
00447                         /* We have link beat..for now anyway */
00448                         priv->link = 1;
00449                         /*Enabling link beat monitoring */
00450                         /* TLan_SetTimer( nic, (10*HZ), TLAN_TIMER_LINK_BEAT ); */
00451                         mdelay(10000);
00452                         TLan_PhyMonitor(nic);
00453 #endif
00454                 } else if (status & BMSR_LSTATUS) {
00455                         DBG ( "TLAN: %s: Link active\n", priv->nic_name );
00456                         TLan_DioWrite8(BASE, TLAN_LED_REG, TLAN_LED_LINK);
00457                 }
00458         }
00459 
00460         if (priv->phyNum == 0) {
00461                 TLan_MiiReadReg(nic, phy, TLAN_TLPHY_CTL, &tlphy_ctl);
00462                 tlphy_ctl |= TLAN_TC_INTEN;
00463                 TLan_MiiWriteReg(nic, phy, TLAN_TLPHY_CTL, tlphy_ctl);
00464                 sio = TLan_DioRead8(BASE, TLAN_NET_SIO);
00465                 sio |= TLAN_NET_SIO_MINTEN;
00466                 TLan_DioWrite8(BASE, TLAN_NET_SIO, sio);
00467         }
00468 
00469         if (status & BMSR_LSTATUS) {
00470                 TLan_SetMac(nic, 0, nic->node_addr);
00471                 priv->phyOnline = 1;
00472                 outb((TLAN_HC_INT_ON >> 8), BASE + TLAN_HOST_CMD + 1);
00473                 outl(virt_to_bus(&rx_ring), BASE + TLAN_CH_PARM);
00474                 outl(TLAN_HC_GO | TLAN_HC_RT, BASE + TLAN_HOST_CMD);
00475         } else {
00476                 DBG 
00477                     ( "TLAN: %s: Link inactive, will retry in 10 secs...\n",
00478                      priv->nic_name );
00479                 /* TLan_SetTimer( nic, (10*HZ), TLAN_TIMER_FINISH_RESET ); */
00480                 mdelay(10000);
00481                 TLan_FinishReset(nic);
00482                 return;
00483 
00484         }
00485 
00486 }       /* TLan_FinishReset */
00487 
00488 /**************************************************************************
00489 POLL - Wait for a frame
00490 ***************************************************************************/
00491 static int tlan_poll(struct nic *nic, int retrieve)
00492 {
00493         /* return true if there's an ethernet packet ready to read */
00494         /* nic->packet should contain data on return */
00495         /* nic->packetlen should contain length of data */
00496         u32 framesize;
00497         u32 host_cmd = 0;
00498         u32 ack = 1;
00499         int eoc = 0;
00500         int entry = priv->cur_rx % TLAN_NUM_RX_LISTS;
00501         u16 tmpCStat = le32_to_cpu(rx_ring[entry].cStat);
00502         u16 host_int = inw(BASE + TLAN_HOST_INT);
00503 
00504         if ((tmpCStat & TLAN_CSTAT_FRM_CMP) && !retrieve)
00505           return 1;
00506 
00507         outw(host_int, BASE + TLAN_HOST_INT);
00508 
00509         if (!(tmpCStat & TLAN_CSTAT_FRM_CMP))
00510                 return 0;
00511 
00512         /* printf("PI-1: 0x%hX\n", host_int); */
00513         if (tmpCStat & TLAN_CSTAT_EOC)
00514                 eoc = 1;
00515 
00516         framesize = rx_ring[entry].frameSize;
00517 
00518         nic->packetlen = framesize;
00519 
00520         DBG ( ".%d.", (unsigned int) framesize ); 
00521      
00522         memcpy(nic->packet, rxb +
00523                (priv->cur_rx * TLAN_MAX_FRAME_SIZE), nic->packetlen);
00524 
00525         rx_ring[entry].cStat = 0;
00526 
00527         DBG ( "%d", entry );  
00528 
00529         entry = (entry + 1) % TLAN_NUM_RX_LISTS;
00530         priv->cur_rx = entry;
00531         if (eoc) {
00532                 if ((rx_ring[entry].cStat & TLAN_CSTAT_READY) ==
00533                     TLAN_CSTAT_READY) {
00534                         ack |= TLAN_HC_GO | TLAN_HC_RT;
00535                         host_cmd = TLAN_HC_ACK | ack | 0x001C0000;
00536                         outl(host_cmd, BASE + TLAN_HOST_CMD);
00537                 }
00538         } else {
00539                 host_cmd = TLAN_HC_ACK | ack | (0x000C0000);
00540                 outl(host_cmd, BASE + TLAN_HOST_CMD);
00541                 
00542                 DBG ( "AC: 0x%hX\n", inw(BASE + TLAN_CH_PARM) ); 
00543                 DBG ( "PI-2: 0x%hX\n", inw(BASE + TLAN_HOST_INT) );
00544         }
00545         refill_rx(nic);
00546         return (1);             /* initially as this is called to flush the input */
00547 }
00548 
00549 static void refill_rx(struct nic *nic __unused)
00550 {
00551         int entry = 0;
00552 
00553         for (;
00554              (priv->cur_rx - priv->dirty_rx +
00555               TLAN_NUM_RX_LISTS) % TLAN_NUM_RX_LISTS > 0;
00556              priv->dirty_rx = (priv->dirty_rx + 1) % TLAN_NUM_RX_LISTS) {
00557                 entry = priv->dirty_rx % TLAN_NUM_TX_LISTS;
00558                 rx_ring[entry].frameSize = TLAN_MAX_FRAME_SIZE;
00559                 rx_ring[entry].cStat = TLAN_CSTAT_READY;
00560         }
00561 
00562 }
00563 
00564 /**************************************************************************
00565 TRANSMIT - Transmit a frame
00566 ***************************************************************************/
00567 static void tlan_transmit(struct nic *nic, const char *d,       /* Destination */
00568                           unsigned int t,       /* Type */
00569                           unsigned int s,       /* size */
00570                           const char *p)
00571 {                               /* Packet */
00572         u16 nstype;
00573         u32 to;
00574         struct TLanList *tail_list;
00575         struct TLanList *head_list;
00576         u8 *tail_buffer;
00577         u32 ack = 0;
00578         u32 host_cmd;
00579         int eoc = 0;
00580         u16 tmpCStat;
00581         u16 host_int = inw(BASE + TLAN_HOST_INT);
00582 
00583         int entry = 0;
00584 
00585         DBG ( "INT0-0x%hX\n", host_int );
00586 
00587         if (!priv->phyOnline) {
00588                 printf("TRANSMIT:  %s PHY is not ready\n", priv->nic_name);
00589                 return;
00590         }
00591 
00592         tail_list = priv->txList + priv->txTail;
00593 
00594         if (tail_list->cStat != TLAN_CSTAT_UNUSED) {
00595                 printf("TRANSMIT: %s is busy (Head=%p Tail=%x)\n",
00596                        priv->nic_name, priv->txList, (unsigned int) priv->txTail);
00597                 tx_ring[entry].cStat = TLAN_CSTAT_UNUSED;
00598 //              priv->txBusyCount++;
00599                 return;
00600         }
00601 
00602         tail_list->forward = 0;
00603 
00604         tail_buffer = txb + (priv->txTail * TLAN_MAX_FRAME_SIZE);
00605 
00606         /* send the packet to destination */
00607         memcpy(tail_buffer, d, ETH_ALEN);
00608         memcpy(tail_buffer + ETH_ALEN, nic->node_addr, ETH_ALEN);
00609         nstype = htons((u16) t);
00610         memcpy(tail_buffer + 2 * ETH_ALEN, (u8 *) & nstype, 2);
00611         memcpy(tail_buffer + ETH_HLEN, p, s);
00612 
00613         s += ETH_HLEN;
00614         s &= 0x0FFF;
00615         while (s < ETH_ZLEN)
00616                 tail_buffer[s++] = '\0';
00617 
00618         /*=====================================================*/
00619         /* Receive
00620          * 0000 0000 0001 1100
00621          * 0000 0000 0000 1100
00622          * 0000 0000 0000 0011 = 0x0003
00623          *
00624          * 0000 0000 0000 0000 0000 0000 0000 0011
00625          * 0000 0000 0000 1100 0000 0000 0000 0000 = 0x000C0000
00626          *
00627          * Transmit
00628          * 0000 0000 0001 1100
00629          * 0000 0000 0000 0100
00630          * 0000 0000 0000 0001 = 0x0001
00631          *
00632          * 0000 0000 0000 0000 0000 0000 0000 0001
00633          * 0000 0000 0000 0100 0000 0000 0000 0000 = 0x00040000
00634          * */
00635 
00636         /* Setup the transmit descriptor */
00637         tail_list->frameSize = (u16) s;
00638         tail_list->buffer[0].count = TLAN_LAST_BUFFER | (u32) s;
00639         tail_list->buffer[1].count = 0;
00640         tail_list->buffer[1].address = 0;
00641 
00642         tail_list->cStat = TLAN_CSTAT_READY;
00643 
00644         DBG ( "INT1-0x%hX\n", inw(BASE + TLAN_HOST_INT) );
00645 
00646         if (!priv->txInProgress) {
00647                 priv->txInProgress = 1;
00648                 outl(virt_to_le32desc(tail_list), BASE + TLAN_CH_PARM);
00649                 outl(TLAN_HC_GO, BASE + TLAN_HOST_CMD);
00650         } else {
00651                 if (priv->txTail == 0) {
00652                         DBG ( "Out buffer\n" );
00653                         (priv->txList + (TLAN_NUM_TX_LISTS - 1))->forward =
00654                             virt_to_le32desc(tail_list);
00655                 } else {
00656                         DBG ( "Fix this \n" );
00657                         (priv->txList + (priv->txTail - 1))->forward =
00658                             virt_to_le32desc(tail_list);
00659                 }
00660         }
00661         
00662         CIRC_INC(priv->txTail, TLAN_NUM_TX_LISTS);
00663 
00664         DBG ( "INT2-0x%hX\n", inw(BASE + TLAN_HOST_INT) );
00665 
00666         to = currticks() + TX_TIME_OUT;
00667         while ((tail_list->cStat == TLAN_CSTAT_READY) && currticks() < to);
00668 
00669         head_list = priv->txList + priv->txHead;
00670         while (((tmpCStat = head_list->cStat) & TLAN_CSTAT_FRM_CMP) 
00671                         && (ack < 255)) {
00672                 ack++;
00673                 if(tmpCStat & TLAN_CSTAT_EOC)
00674                         eoc =1;
00675                 head_list->cStat = TLAN_CSTAT_UNUSED;
00676                 CIRC_INC(priv->txHead, TLAN_NUM_TX_LISTS);
00677                 head_list = priv->txList + priv->txHead;
00678                 
00679         }
00680         if(!ack)
00681                 printf("Incomplete TX Frame\n");
00682 
00683         if(eoc) {
00684                 head_list = priv->txList + priv->txHead;
00685                 if ((head_list->cStat & TLAN_CSTAT_READY) == TLAN_CSTAT_READY) {
00686                         outl(virt_to_le32desc(head_list), BASE + TLAN_CH_PARM);
00687                         ack |= TLAN_HC_GO;
00688                 } else {
00689                         priv->txInProgress = 0;
00690                 }
00691         }
00692         if(ack) {
00693                 host_cmd = TLAN_HC_ACK | ack;
00694                 outl(host_cmd, BASE + TLAN_HOST_CMD);
00695         }
00696         
00697         if(priv->tlanRev < 0x30 ) {
00698                 ack = 1;
00699                 head_list = priv->txList + priv->txHead;
00700                 if ((head_list->cStat & TLAN_CSTAT_READY) == TLAN_CSTAT_READY) {
00701                         outl(virt_to_le32desc(head_list), BASE + TLAN_CH_PARM);
00702                         ack |= TLAN_HC_GO;
00703                 } else {
00704                         priv->txInProgress = 0;
00705                 }
00706                 host_cmd = TLAN_HC_ACK | ack | 0x00140000;
00707                 outl(host_cmd, BASE + TLAN_HOST_CMD);
00708                 
00709         }
00710                         
00711         if (currticks() >= to) {
00712                 printf("TX Time Out");
00713         }
00714 }
00715 
00716 /**************************************************************************
00717 DISABLE - Turn off ethernet interface
00718 ***************************************************************************/
00719 static void tlan_disable ( struct nic *nic __unused ) {
00720         /* put the card in its initial state */
00721         /* This function serves 3 purposes.
00722          * This disables DMA and interrupts so we don't receive
00723          *  unexpected packets or interrupts from the card after
00724          *  etherboot has finished.
00725          * This frees resources so etherboot may use
00726          *  this driver on another interface
00727          * This allows etherboot to reinitialize the interface
00728          *  if something is something goes wrong.
00729          *
00730          */
00731         outl(TLAN_HC_AD_RST, BASE + TLAN_HOST_CMD);
00732 }
00733 
00734 /**************************************************************************
00735 IRQ - Enable, Disable, or Force interrupts
00736 ***************************************************************************/
00737 static void tlan_irq(struct nic *nic __unused, irq_action_t action __unused)
00738 {
00739   switch ( action ) {
00740   case DISABLE :
00741     break;
00742   case ENABLE :
00743     break;
00744   case FORCE :
00745     break;
00746   }
00747 }
00748 
00749 static struct nic_operations tlan_operations = {
00750         .connect        = dummy_connect,
00751         .poll           = tlan_poll,
00752         .transmit       = tlan_transmit,
00753         .irq            = tlan_irq,
00754 
00755 };
00756 
00757 static void TLan_SetMulticastList(struct nic *nic) {
00758         int i;
00759         u8 tmp;
00760 
00761         /* !IFF_PROMISC */
00762         tmp = TLan_DioRead8(BASE, TLAN_NET_CMD);
00763         TLan_DioWrite8(BASE, TLAN_NET_CMD, tmp & ~TLAN_NET_CMD_CAF);
00764 
00765         /* IFF_ALLMULTI */
00766         for(i = 0; i< 3; i++)
00767                 TLan_SetMac(nic, i + 1, NULL);
00768         TLan_DioWrite32(BASE, TLAN_HASH_1, 0xFFFFFFFF);
00769         TLan_DioWrite32(BASE, TLAN_HASH_2, 0xFFFFFFFF);
00770 
00771         
00772 }
00773 /**************************************************************************
00774 PROBE - Look for an adapter, this routine's visible to the outside
00775 ***************************************************************************/
00776 
00777 #define board_found 1
00778 #define valid_link 0
00779 static int tlan_probe ( struct nic *nic, struct pci_device *pci ) {
00780 
00781         u16 data = 0;
00782         int err;
00783         int i;
00784 
00785         if (pci->ioaddr == 0)
00786                 return 0;
00787 
00788         nic->irqno  = 0;
00789         nic->ioaddr = pci->ioaddr;
00790 
00791         BASE = pci->ioaddr;
00792 
00793         /* Set nic as PCI bus master */
00794         adjust_pci_device(pci);
00795         
00796         /* Point to private storage */
00797         priv = &TLanPrivateInfo;
00798 
00799         /* Figure out which chip we're dealing with */
00800         i = 0;
00801         chip_idx = -1;
00802         while (tlan_pci_tbl[i].name) {
00803                 if ((((u32) pci->device << 16) | pci->vendor) ==
00804                     (tlan_pci_tbl[i].id.pci & 0xffffffff)) {
00805                         chip_idx = i;
00806                         break;
00807                 }
00808                 i++;
00809         }
00810 
00811         priv->vendor_id = pci->vendor;
00812         priv->dev_id = pci->device;
00813         priv->nic_name = pci->driver_name;
00814         priv->eoc = 0;
00815 
00816         err = 0;
00817         for (i = 0; i < 6; i++)
00818                 err |= TLan_EeReadByte(BASE,
00819                                        (u8) tlan_pci_tbl[chip_idx].
00820                                        addrOfs + i,
00821                                        (u8 *) & nic->node_addr[i]);
00822         if (err) {
00823             printf ( "TLAN: %s: Error reading MAC from eeprom: %d\n",
00824                     pci->driver_name, err);
00825         } else {
00826             DBG ( "%s: %s at ioaddr %#lX, ", 
00827                   pci->driver_name, eth_ntoa ( nic->node_addr ), pci->ioaddr );
00828         }
00829 
00830         priv->tlanRev = TLan_DioRead8(BASE, TLAN_DEF_REVISION);
00831         printf("revision: 0x%hX\n", priv->tlanRev);
00832 
00833         TLan_ResetLists(nic);
00834         TLan_ResetAdapter(nic);
00835 
00836         data = inl(BASE + TLAN_HOST_CMD);
00837         data |= TLAN_HC_INT_OFF;
00838         outw(data, BASE + TLAN_HOST_CMD);
00839 
00840         TLan_SetMulticastList(nic);
00841         udelay(100); 
00842         priv->txList = tx_ring;
00843 
00844 /*      if (board_found && valid_link)
00845         {*/
00846         /* point to NIC specific routines */
00847         nic->nic_op     = &tlan_operations;
00848         return 1;
00849 }
00850 
00851 
00852 /*****************************************************************************
00853 ******************************************************************************
00854 
00855         ThunderLAN Driver Eeprom routines
00856 
00857         The Compaq Netelligent 10 and 10/100 cards use a Microchip 24C02A
00858         EEPROM.  These functions are based on information in Microchip's
00859         data sheet.  I don't know how well this functions will work with
00860         other EEPROMs.
00861 
00862 ******************************************************************************
00863 *****************************************************************************/
00864 
00865 
00866 /***************************************************************
00867 *       TLan_EeSendStart
00868 *
00869 *       Returns:
00870 *               Nothing
00871 *       Parms:
00872 *               io_base         The IO port base address for the
00873 *                               TLAN device with the EEPROM to
00874 *                               use.
00875 *
00876 *       This function sends a start cycle to an EEPROM attached
00877 *       to a TLAN chip.
00878 *
00879 **************************************************************/
00880 
00881 void TLan_EeSendStart(u16 io_base)
00882 {
00883         u16 sio;
00884 
00885         outw(TLAN_NET_SIO, io_base + TLAN_DIO_ADR);
00886         sio = io_base + TLAN_DIO_DATA + TLAN_NET_SIO;
00887 
00888         TLan_SetBit(TLAN_NET_SIO_ECLOK, sio);
00889         TLan_SetBit(TLAN_NET_SIO_EDATA, sio);
00890         TLan_SetBit(TLAN_NET_SIO_ETXEN, sio);
00891         TLan_ClearBit(TLAN_NET_SIO_EDATA, sio);
00892         TLan_ClearBit(TLAN_NET_SIO_ECLOK, sio);
00893 
00894 }       /* TLan_EeSendStart */
00895 
00896 /***************************************************************
00897 *       TLan_EeSendByte
00898 *
00899 *       Returns:
00900 *               If the correct ack was received, 0, otherwise 1
00901 *       Parms:  io_base         The IO port base address for the
00902 *                               TLAN device with the EEPROM to
00903 *                               use.
00904 *               data            The 8 bits of information to
00905 *                               send to the EEPROM.
00906 *               stop            If TLAN_EEPROM_STOP is passed, a
00907 *                               stop cycle is sent after the
00908 *                               byte is sent after the ack is
00909 *                               read.
00910 *
00911 *       This function sends a byte on the serial EEPROM line,
00912 *       driving the clock to send each bit. The function then
00913 *       reverses transmission direction and reads an acknowledge
00914 *       bit.
00915 *
00916 **************************************************************/
00917 
00918 int TLan_EeSendByte(u16 io_base, u8 data, int stop)
00919 {
00920         int err;
00921         u8 place;
00922         u16 sio;
00923 
00924         outw(TLAN_NET_SIO, io_base + TLAN_DIO_ADR);
00925         sio = io_base + TLAN_DIO_DATA + TLAN_NET_SIO;
00926 
00927         /* Assume clock is low, tx is enabled; */
00928         for (place = 0x80; place != 0; place >>= 1) {
00929                 if (place & data)
00930                         TLan_SetBit(TLAN_NET_SIO_EDATA, sio);
00931                 else
00932                         TLan_ClearBit(TLAN_NET_SIO_EDATA, sio);
00933                 TLan_SetBit(TLAN_NET_SIO_ECLOK, sio);
00934                 TLan_ClearBit(TLAN_NET_SIO_ECLOK, sio);
00935         }
00936         TLan_ClearBit(TLAN_NET_SIO_ETXEN, sio);
00937         TLan_SetBit(TLAN_NET_SIO_ECLOK, sio);
00938         err = TLan_GetBit(TLAN_NET_SIO_EDATA, sio);
00939         TLan_ClearBit(TLAN_NET_SIO_ECLOK, sio);
00940         TLan_SetBit(TLAN_NET_SIO_ETXEN, sio);
00941 
00942         if ((!err) && stop) {
00943                 TLan_ClearBit(TLAN_NET_SIO_EDATA, sio); /* STOP, raise data while clock is high */
00944                 TLan_SetBit(TLAN_NET_SIO_ECLOK, sio);
00945                 TLan_SetBit(TLAN_NET_SIO_EDATA, sio);
00946         }
00947 
00948         return (err);
00949 
00950 }       /* TLan_EeSendByte */
00951 
00952 /***************************************************************
00953 *       TLan_EeReceiveByte
00954 *
00955 *       Returns:
00956 *               Nothing
00957 *       Parms:
00958 *               io_base         The IO port base address for the
00959 *                               TLAN device with the EEPROM to
00960 *                               use.
00961 *               data            An address to a char to hold the
00962 *                               data sent from the EEPROM.
00963 *               stop            If TLAN_EEPROM_STOP is passed, a
00964 *                               stop cycle is sent after the
00965 *                               byte is received, and no ack is
00966 *                               sent.
00967 *
00968 *       This function receives 8 bits of data from the EEPROM
00969 *       over the serial link.  It then sends and ack bit, or no
00970 *       ack and a stop bit.  This function is used to retrieve
00971 *       data after the address of a byte in the EEPROM has been
00972 *       sent.
00973 *
00974 **************************************************************/
00975 
00976 void TLan_EeReceiveByte(u16 io_base, u8 * data, int stop)
00977 {
00978         u8 place;
00979         u16 sio;
00980 
00981         outw(TLAN_NET_SIO, io_base + TLAN_DIO_ADR);
00982         sio = io_base + TLAN_DIO_DATA + TLAN_NET_SIO;
00983         *data = 0;
00984 
00985         /* Assume clock is low, tx is enabled; */
00986         TLan_ClearBit(TLAN_NET_SIO_ETXEN, sio);
00987         for (place = 0x80; place; place >>= 1) {
00988                 TLan_SetBit(TLAN_NET_SIO_ECLOK, sio);
00989                 if (TLan_GetBit(TLAN_NET_SIO_EDATA, sio))
00990                         *data |= place;
00991                 TLan_ClearBit(TLAN_NET_SIO_ECLOK, sio);
00992         }
00993 
00994         TLan_SetBit(TLAN_NET_SIO_ETXEN, sio);
00995         if (!stop) {
00996                 TLan_ClearBit(TLAN_NET_SIO_EDATA, sio); /* Ack = 0 */
00997                 TLan_SetBit(TLAN_NET_SIO_ECLOK, sio);
00998                 TLan_ClearBit(TLAN_NET_SIO_ECLOK, sio);
00999         } else {
01000                 TLan_SetBit(TLAN_NET_SIO_EDATA, sio);   /* No ack = 1 (?) */
01001                 TLan_SetBit(TLAN_NET_SIO_ECLOK, sio);
01002                 TLan_ClearBit(TLAN_NET_SIO_ECLOK, sio);
01003                 TLan_ClearBit(TLAN_NET_SIO_EDATA, sio); /* STOP, raise data while clock is high */
01004                 TLan_SetBit(TLAN_NET_SIO_ECLOK, sio);
01005                 TLan_SetBit(TLAN_NET_SIO_EDATA, sio);
01006         }
01007 
01008 }       /* TLan_EeReceiveByte */
01009 
01010 /***************************************************************
01011 *       TLan_EeReadByte
01012 *
01013 *       Returns:
01014 *               No error = 0, else, the stage at which the error
01015 *               occurred.
01016 *       Parms:
01017 *               io_base         The IO port base address for the
01018 *                               TLAN device with the EEPROM to
01019 *                               use.
01020 *               ee_addr         The address of the byte in the
01021 *                               EEPROM whose contents are to be
01022 *                               retrieved.
01023 *               data            An address to a char to hold the
01024 *                               data obtained from the EEPROM.
01025 *
01026 *       This function reads a byte of information from an byte
01027 *       cell in the EEPROM.
01028 *
01029 **************************************************************/
01030 
01031 int TLan_EeReadByte(u16 io_base, u8 ee_addr, u8 * data)
01032 {
01033         int err;
01034         int ret = 0;
01035 
01036 
01037         TLan_EeSendStart(io_base);
01038         err = TLan_EeSendByte(io_base, 0xA0, TLAN_EEPROM_ACK);
01039         if (err) {
01040                 ret = 1;
01041                 goto fail;
01042         }
01043         err = TLan_EeSendByte(io_base, ee_addr, TLAN_EEPROM_ACK);
01044         if (err) {
01045                 ret = 2;
01046                 goto fail;
01047         }
01048         TLan_EeSendStart(io_base);
01049         err = TLan_EeSendByte(io_base, 0xA1, TLAN_EEPROM_ACK);
01050         if (err) {
01051                 ret = 3;
01052                 goto fail;
01053         }
01054         TLan_EeReceiveByte(io_base, data, TLAN_EEPROM_STOP);
01055       fail:
01056 
01057         return ret;
01058 
01059 }       /* TLan_EeReadByte */
01060 
01061 
01062 /*****************************************************************************
01063 ******************************************************************************
01064 
01065 ThunderLAN Driver MII Routines
01066 
01067 These routines are based on the information in Chap. 2 of the
01068 "ThunderLAN Programmer's Guide", pp. 15-24.
01069 
01070 ******************************************************************************
01071 *****************************************************************************/
01072 
01073 
01074 /***************************************************************
01075 *       TLan_MiiReadReg
01076 *
01077 *       Returns:
01078 *               0       if ack received ok
01079 *               1       otherwise.
01080 *
01081 *       Parms:
01082 *               dev             The device structure containing
01083 *                               The io address and interrupt count
01084 *                               for this device.
01085 *               phy             The address of the PHY to be queried.
01086 *               reg             The register whose contents are to be
01087 *                               retreived.
01088 *               val             A pointer to a variable to store the
01089 *                               retrieved value.
01090 *
01091 *       This function uses the TLAN's MII bus to retreive the contents
01092 *       of a given register on a PHY.  It sends the appropriate info
01093 *       and then reads the 16-bit register value from the MII bus via
01094 *       the TLAN SIO register.
01095 *
01096 **************************************************************/
01097 
01098 int TLan_MiiReadReg(struct nic *nic __unused, u16 phy, u16 reg, u16 * val)
01099 {
01100         u8 nack;
01101         u16 sio, tmp;
01102         u32 i;
01103         int err;
01104         int minten;
01105 
01106         err = FALSE;
01107         outw(TLAN_NET_SIO, BASE + TLAN_DIO_ADR);
01108         sio = BASE + TLAN_DIO_DATA + TLAN_NET_SIO;
01109 
01110         TLan_MiiSync(BASE);
01111 
01112         minten = TLan_GetBit(TLAN_NET_SIO_MINTEN, sio);
01113         if (minten)
01114                 TLan_ClearBit(TLAN_NET_SIO_MINTEN, sio);
01115 
01116         TLan_MiiSendData(BASE, 0x1, 2); /* Start ( 01b ) */
01117         TLan_MiiSendData(BASE, 0x2, 2); /* Read  ( 10b ) */
01118         TLan_MiiSendData(BASE, phy, 5); /* Device #      */
01119         TLan_MiiSendData(BASE, reg, 5); /* Register #    */
01120 
01121 
01122         TLan_ClearBit(TLAN_NET_SIO_MTXEN, sio); /* Change direction */
01123 
01124         TLan_ClearBit(TLAN_NET_SIO_MCLK, sio);  /* Clock Idle bit */
01125         TLan_SetBit(TLAN_NET_SIO_MCLK, sio);
01126         TLan_ClearBit(TLAN_NET_SIO_MCLK, sio);  /* Wait 300ns */
01127 
01128         nack = TLan_GetBit(TLAN_NET_SIO_MDATA, sio);    /* Check for ACK */
01129         TLan_SetBit(TLAN_NET_SIO_MCLK, sio);    /* Finish ACK */
01130         if (nack) {             /* No ACK, so fake it */
01131                 for (i = 0; i < 16; i++) {
01132                         TLan_ClearBit(TLAN_NET_SIO_MCLK, sio);
01133                         TLan_SetBit(TLAN_NET_SIO_MCLK, sio);
01134                 }
01135                 tmp = 0xffff;
01136                 err = TRUE;
01137         } else {                /* ACK, so read data */
01138                 for (tmp = 0, i = 0x8000; i; i >>= 1) {
01139                         TLan_ClearBit(TLAN_NET_SIO_MCLK, sio);
01140                         if (TLan_GetBit(TLAN_NET_SIO_MDATA, sio))
01141                                 tmp |= i;
01142                         TLan_SetBit(TLAN_NET_SIO_MCLK, sio);
01143                 }
01144         }
01145 
01146 
01147         TLan_ClearBit(TLAN_NET_SIO_MCLK, sio);  /* Idle cycle */
01148         TLan_SetBit(TLAN_NET_SIO_MCLK, sio);
01149 
01150         if (minten)
01151                 TLan_SetBit(TLAN_NET_SIO_MINTEN, sio);
01152 
01153         *val = tmp;
01154 
01155         return err;
01156 
01157 }                               /* TLan_MiiReadReg */
01158 
01159 /***************************************************************
01160 *       TLan_MiiSendData
01161 *
01162 *       Returns:
01163 *               Nothing
01164 *       Parms:
01165 *               base_port       The base IO port of the adapter in
01166 *                               question.
01167 *               dev             The address of the PHY to be queried.
01168 *               data            The value to be placed on the MII bus.
01169 *               num_bits        The number of bits in data that are to
01170 *                               be placed on the MII bus.
01171 *
01172 *       This function sends on sequence of bits on the MII
01173 *       configuration bus.
01174 *
01175 **************************************************************/
01176 
01177 void TLan_MiiSendData(u16 base_port, u32 data, unsigned num_bits)
01178 {
01179         u16 sio;
01180         u32 i;
01181 
01182         if (num_bits == 0)
01183                 return;
01184 
01185         outw(TLAN_NET_SIO, base_port + TLAN_DIO_ADR);
01186         sio = base_port + TLAN_DIO_DATA + TLAN_NET_SIO;
01187         TLan_SetBit(TLAN_NET_SIO_MTXEN, sio);
01188 
01189         for (i = (0x1 << (num_bits - 1)); i; i >>= 1) {
01190                 TLan_ClearBit(TLAN_NET_SIO_MCLK, sio);
01191                 (void) TLan_GetBit(TLAN_NET_SIO_MCLK, sio);
01192                 if (data & i)
01193                         TLan_SetBit(TLAN_NET_SIO_MDATA, sio);
01194                 else
01195                         TLan_ClearBit(TLAN_NET_SIO_MDATA, sio);
01196                 TLan_SetBit(TLAN_NET_SIO_MCLK, sio);
01197                 (void) TLan_GetBit(TLAN_NET_SIO_MCLK, sio);
01198         }
01199 
01200 }                               /* TLan_MiiSendData */
01201 
01202 /***************************************************************
01203 *       TLan_MiiSync
01204 *
01205 *       Returns:
01206 *               Nothing
01207 *       Parms:
01208 *               base_port       The base IO port of the adapter in
01209 *                               question.
01210 *
01211 *       This functions syncs all PHYs in terms of the MII configuration
01212 *       bus.
01213 *
01214 **************************************************************/
01215 
01216 void TLan_MiiSync(u16 base_port)
01217 {
01218         int i;
01219         u16 sio;
01220 
01221         outw(TLAN_NET_SIO, base_port + TLAN_DIO_ADR);
01222         sio = base_port + TLAN_DIO_DATA + TLAN_NET_SIO;
01223 
01224         TLan_ClearBit(TLAN_NET_SIO_MTXEN, sio);
01225         for (i = 0; i < 32; i++) {
01226                 TLan_ClearBit(TLAN_NET_SIO_MCLK, sio);
01227                 TLan_SetBit(TLAN_NET_SIO_MCLK, sio);
01228         }
01229 
01230 }                               /* TLan_MiiSync */
01231 
01232 /***************************************************************
01233 *       TLan_MiiWriteReg
01234 *
01235 *       Returns:
01236 *               Nothing
01237 *       Parms:
01238 *               dev             The device structure for the device
01239 *                               to write to.
01240 *               phy             The address of the PHY to be written to.
01241 *               reg             The register whose contents are to be
01242 *                               written.
01243 *               val             The value to be written to the register.
01244 *
01245 *       This function uses the TLAN's MII bus to write the contents of a
01246 *       given register on a PHY.  It sends the appropriate info and then
01247 *       writes the 16-bit register value from the MII configuration bus
01248 *       via the TLAN SIO register.
01249 *
01250 **************************************************************/
01251 
01252 void TLan_MiiWriteReg(struct nic *nic __unused, u16 phy, u16 reg, u16 val)
01253 {
01254         u16 sio;
01255         int minten;
01256 
01257         outw(TLAN_NET_SIO, BASE + TLAN_DIO_ADR);
01258         sio = BASE + TLAN_DIO_DATA + TLAN_NET_SIO;
01259 
01260         TLan_MiiSync(BASE);
01261 
01262         minten = TLan_GetBit(TLAN_NET_SIO_MINTEN, sio);
01263         if (minten)
01264                 TLan_ClearBit(TLAN_NET_SIO_MINTEN, sio);
01265 
01266         TLan_MiiSendData(BASE, 0x1, 2); /* Start ( 01b ) */
01267         TLan_MiiSendData(BASE, 0x1, 2); /* Write ( 01b ) */
01268         TLan_MiiSendData(BASE, phy, 5); /* Device #      */
01269         TLan_MiiSendData(BASE, reg, 5); /* Register #    */
01270 
01271         TLan_MiiSendData(BASE, 0x2, 2); /* Send ACK */
01272         TLan_MiiSendData(BASE, val, 16);        /* Send Data */
01273 
01274         TLan_ClearBit(TLAN_NET_SIO_MCLK, sio);  /* Idle cycle */
01275         TLan_SetBit(TLAN_NET_SIO_MCLK, sio);
01276 
01277         if (minten)
01278                 TLan_SetBit(TLAN_NET_SIO_MINTEN, sio);
01279 
01280 
01281 }                               /* TLan_MiiWriteReg */
01282 
01283 /***************************************************************
01284 *       TLan_SetMac
01285 *
01286 *       Returns:
01287 *               Nothing
01288 *       Parms:
01289 *               dev     Pointer to device structure of adapter
01290 *                       on which to change the AREG.
01291 *               areg    The AREG to set the address in (0 - 3).
01292 *               mac     A pointer to an array of chars.  Each
01293 *                       element stores one byte of the address.
01294 *                       IE, it isn't in ascii.
01295 *
01296 *       This function transfers a MAC address to one of the
01297 *       TLAN AREGs (address registers).  The TLAN chip locks
01298 *       the register on writing to offset 0 and unlocks the
01299 *       register after writing to offset 5.  If NULL is passed
01300 *       in mac, then the AREG is filled with 0's.
01301 *
01302 **************************************************************/
01303 
01304 void TLan_SetMac(struct nic *nic __unused, int areg, unsigned char *mac)
01305 {
01306         int i;
01307 
01308         areg *= 6;
01309 
01310         if (mac != NULL) {
01311                 for (i = 0; i < 6; i++)
01312                         TLan_DioWrite8(BASE, TLAN_AREG_0 + areg + i,
01313                                        mac[i]);
01314         } else {
01315                 for (i = 0; i < 6; i++)
01316                         TLan_DioWrite8(BASE, TLAN_AREG_0 + areg + i, 0);
01317         }
01318 
01319 }                               /* TLan_SetMac */
01320 
01321 /*********************************************************************
01322 *       TLan_PhyDetect
01323 *
01324 *       Returns:
01325 *               Nothing
01326 *       Parms:
01327 *               dev     A pointer to the device structure of the adapter
01328 *                       for which the PHY needs determined.
01329 *
01330 *       So far I've found that adapters which have external PHYs
01331 *       may also use the internal PHY for part of the functionality.
01332 *       (eg, AUI/Thinnet).  This function finds out if this TLAN
01333 *       chip has an internal PHY, and then finds the first external
01334 *       PHY (starting from address 0) if it exists).
01335 *
01336 ********************************************************************/
01337 
01338 void TLan_PhyDetect(struct nic *nic)
01339 {
01340         u16 control;
01341         u16 hi;
01342         u16 lo;
01343         u32 phy;
01344 
01345         if (tlan_pci_tbl[chip_idx].flags & TLAN_ADAPTER_UNMANAGED_PHY) {
01346                 priv->phyNum = 0xFFFF;
01347                 return;
01348         }
01349 
01350         TLan_MiiReadReg(nic, TLAN_PHY_MAX_ADDR, MII_PHYSID1, &hi);
01351 
01352         if (hi != 0xFFFF) {
01353                 priv->phy[0] = TLAN_PHY_MAX_ADDR;
01354         } else {
01355                 priv->phy[0] = TLAN_PHY_NONE;
01356         }
01357 
01358         priv->phy[1] = TLAN_PHY_NONE;
01359         for (phy = 0; phy <= TLAN_PHY_MAX_ADDR; phy++) {
01360                 TLan_MiiReadReg(nic, phy, MII_BMCR, &control);
01361                 TLan_MiiReadReg(nic, phy, MII_PHYSID1, &hi);
01362                 TLan_MiiReadReg(nic, phy, MII_PHYSID2, &lo);
01363                 if ((control != 0xFFFF) || (hi != 0xFFFF)
01364                     || (lo != 0xFFFF)) {
01365                         printf("PHY found at %hX %hX %hX %hX\n", 
01366                                (unsigned int) phy, control, hi, lo);
01367                         if ((priv->phy[1] == TLAN_PHY_NONE)
01368                             && (phy != TLAN_PHY_MAX_ADDR)) {
01369                                 priv->phy[1] = phy;
01370                         }
01371                 }
01372         }
01373 
01374         if (priv->phy[1] != TLAN_PHY_NONE) {
01375                 priv->phyNum = 1;
01376         } else if (priv->phy[0] != TLAN_PHY_NONE) {
01377                 priv->phyNum = 0;
01378         } else {
01379                 printf
01380                     ("TLAN:  Cannot initialize device, no PHY was found!\n");
01381         }
01382 
01383 }                               /* TLan_PhyDetect */
01384 
01385 void TLan_PhyPowerDown(struct nic *nic)
01386 {
01387 
01388         u16 value;
01389         DBG ( "%s: Powering down PHY(s).\n", priv->nic_name );
01390         value = BMCR_PDOWN | BMCR_LOOPBACK | BMCR_ISOLATE;
01391         TLan_MiiSync(BASE);
01392         TLan_MiiWriteReg(nic, priv->phy[priv->phyNum], MII_BMCR, value);
01393         if ((priv->phyNum == 0) && (priv->phy[1] != TLAN_PHY_NONE)
01394             &&
01395             (!(tlan_pci_tbl[chip_idx].
01396                flags & TLAN_ADAPTER_USE_INTERN_10))) {
01397                 TLan_MiiSync(BASE);
01398                 TLan_MiiWriteReg(nic, priv->phy[1], MII_BMCR, value);
01399         }
01400 
01401         /* Wait for 50 ms and powerup
01402          * This is abitrary.  It is intended to make sure the
01403          * tranceiver settles.
01404          */
01405         /* TLan_SetTimer( dev, (HZ/20), TLAN_TIMER_PHY_PUP ); */
01406         mdelay(50);
01407         TLan_PhyPowerUp(nic);
01408 
01409 }                               /* TLan_PhyPowerDown */
01410 
01411 
01412 void TLan_PhyPowerUp(struct nic *nic)
01413 {
01414         u16 value;
01415 
01416         DBG ( "%s: Powering up PHY.\n", priv->nic_name );
01417         TLan_MiiSync(BASE);
01418         value = BMCR_LOOPBACK;
01419         TLan_MiiWriteReg(nic, priv->phy[priv->phyNum], MII_BMCR, value);
01420         TLan_MiiSync(BASE);
01421         /* Wait for 500 ms and reset the
01422          * tranceiver.  The TLAN docs say both 50 ms and
01423          * 500 ms, so do the longer, just in case.
01424          */
01425         mdelay(500);
01426         TLan_PhyReset(nic);
01427         /* TLan_SetTimer( dev, (HZ/20), TLAN_TIMER_PHY_RESET ); */
01428 
01429 }                               /* TLan_PhyPowerUp */
01430 
01431 void TLan_PhyReset(struct nic *nic)
01432 {
01433         u16 phy;
01434         u16 value;
01435 
01436         phy = priv->phy[priv->phyNum];
01437 
01438         DBG ( "%s: Reseting PHY.\n", priv->nic_name );
01439         TLan_MiiSync(BASE);
01440         value = BMCR_LOOPBACK | BMCR_RESET;
01441         TLan_MiiWriteReg(nic, phy, MII_BMCR, value);
01442         TLan_MiiReadReg(nic, phy, MII_BMCR, &value);
01443         while (value & BMCR_RESET) {
01444                 TLan_MiiReadReg(nic, phy, MII_BMCR, &value);
01445         }
01446 
01447         /* Wait for 500 ms and initialize.
01448          * I don't remember why I wait this long.
01449          * I've changed this to 50ms, as it seems long enough.
01450          */
01451         /* TLan_SetTimer( dev, (HZ/20), TLAN_TIMER_PHY_START_LINK ); */
01452         mdelay(50);
01453         TLan_PhyStartLink(nic);
01454 
01455 }                               /* TLan_PhyReset */
01456 
01457 
01458 void TLan_PhyStartLink(struct nic *nic)
01459 {
01460 
01461         u16 ability;
01462         u16 control;
01463         u16 data;
01464         u16 phy;
01465         u16 status;
01466         u16 tctl;
01467 
01468         phy = priv->phy[priv->phyNum];
01469         DBG ( "%s: Trying to activate link.\n", priv->nic_name );
01470         TLan_MiiReadReg(nic, phy, MII_BMSR, &status);
01471         TLan_MiiReadReg(nic, phy, MII_BMSR, &ability);
01472 
01473         if ((status & BMSR_ANEGCAPABLE) && (!priv->aui)) {
01474                 ability = status >> 11;
01475                 if (priv->speed == TLAN_SPEED_10 &&
01476                     priv->duplex == TLAN_DUPLEX_HALF) {
01477                         TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x0000);
01478                 } else if (priv->speed == TLAN_SPEED_10 &&
01479                            priv->duplex == TLAN_DUPLEX_FULL) {
01480                         priv->tlanFullDuplex = TRUE;
01481                         TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x0100);
01482                 } else if (priv->speed == TLAN_SPEED_100 &&
01483                            priv->duplex == TLAN_DUPLEX_HALF) {
01484                         TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x2000);
01485                 } else if (priv->speed == TLAN_SPEED_100 &&
01486                            priv->duplex == TLAN_DUPLEX_FULL) {
01487                         priv->tlanFullDuplex = TRUE;
01488                         TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x2100);
01489                 } else {
01490 
01491                         /* Set Auto-Neg advertisement */
01492                         TLan_MiiWriteReg(nic, phy, MII_ADVERTISE,
01493                                          (ability << 5) | 1);
01494                         /* Enablee Auto-Neg */
01495                         TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x1000);
01496                         /* Restart Auto-Neg */
01497                         TLan_MiiWriteReg(nic, phy, MII_BMCR, 0x1200);
01498                         /* Wait for 4 sec for autonegotiation
01499                          * to complete.  The max spec time is less than this
01500                          * but the card need additional time to start AN.
01501                          * .5 sec should be plenty extra.
01502                          */
01503                         DBG ( "TLAN: %s: Starting autonegotiation.\n",
01504                                priv->nic_name );
01505                         mdelay(4000);
01506                         TLan_PhyFinishAutoNeg(nic);
01507                         /* TLan_SetTimer( dev, (2*HZ), TLAN_TIMER_PHY_FINISH_AN ); */
01508                         return;
01509                 }
01510 
01511         }
01512 
01513         if ((priv->aui) && (priv->phyNum != 0)) {
01514                 priv->phyNum = 0;
01515                 data =
01516                     TLAN_NET_CFG_1FRAG | TLAN_NET_CFG_1CHAN |
01517                     TLAN_NET_CFG_PHY_EN;
01518                 TLan_DioWrite16(BASE, TLAN_NET_CONFIG, data);
01519                 mdelay(50);
01520                 /* TLan_SetTimer( dev, (40*HZ/1000), TLAN_TIMER_PHY_PDOWN ); */
01521                 TLan_PhyPowerDown(nic);
01522                 return;
01523         } else if (priv->phyNum == 0) {
01524                 control = 0;
01525                 TLan_MiiReadReg(nic, phy, TLAN_TLPHY_CTL, &tctl);
01526                 if (priv->aui) {
01527                         tctl |= TLAN_TC_AUISEL;
01528                 } else {
01529                         tctl &= ~TLAN_TC_AUISEL;
01530                         if (priv->duplex == TLAN_DUPLEX_FULL) {
01531                                 control |= BMCR_FULLDPLX;
01532                                 priv->tlanFullDuplex = TRUE;
01533                         }
01534                         if (priv->speed == TLAN_SPEED_100) {
01535                                 control |= BMCR_SPEED100;
01536                         }
01537                 }
01538                 TLan_MiiWriteReg(nic, phy, MII_BMCR, control);
01539                 TLan_MiiWriteReg(nic, phy, TLAN_TLPHY_CTL, tctl);
01540         }
01541 
01542         /* Wait for 2 sec to give the tranceiver time
01543          * to establish link.
01544          */
01545         /* TLan_SetTimer( dev, (4*HZ), TLAN_TIMER_FINISH_RESET ); */
01546         mdelay(2000);
01547         TLan_FinishReset(nic);
01548 
01549 }                               /* TLan_PhyStartLink */
01550 
01551 void TLan_PhyFinishAutoNeg(struct nic *nic)
01552 {
01553 
01554         u16 an_adv;
01555         u16 an_lpa;
01556         u16 data;
01557         u16 mode;
01558         u16 phy;
01559         u16 status;
01560 
01561         phy = priv->phy[priv->phyNum];
01562 
01563         TLan_MiiReadReg(nic, phy, MII_BMSR, &status);
01564         udelay(1000);
01565         TLan_MiiReadReg(nic, phy, MII_BMSR, &status);
01566 
01567         if (!(status & BMSR_ANEGCOMPLETE)) {
01568                 /* Wait for 8 sec to give the process
01569                  * more time.  Perhaps we should fail after a while.
01570                  */
01571                 if (!priv->neg_be_verbose++) {
01572                         printf
01573                             ("TLAN:  Giving autonegotiation more time.\n");
01574                         printf
01575                             ("TLAN:  Please check that your adapter has\n");
01576                         printf
01577                             ("TLAN:  been properly connected to a HUB or Switch.\n");
01578                         printf
01579                             ("TLAN:  Trying to establish link in the background...\n");
01580                 }
01581                 mdelay(8000);
01582                 TLan_PhyFinishAutoNeg(nic);
01583                 /* TLan_SetTimer( dev, (8*HZ), TLAN_TIMER_PHY_FINISH_AN ); */
01584                 return;
01585         }
01586 
01587         DBG ( "TLAN: %s: Autonegotiation complete.\n", priv->nic_name );
01588         TLan_MiiReadReg(nic, phy, MII_ADVERTISE, &an_adv);
01589         TLan_MiiReadReg(nic, phy, MII_LPA, &an_lpa);
01590         mode = an_adv & an_lpa & 0x03E0;
01591         if (mode & 0x0100) {
01592                 printf("Full Duplex\n");
01593                 priv->tlanFullDuplex = TRUE;
01594         } else if (!(mode & 0x0080) && (mode & 0x0040)) {
01595                 priv->tlanFullDuplex = TRUE;
01596                 printf("Full Duplex\n");
01597         }
01598 
01599         if ((!(mode & 0x0180))
01600             && (tlan_pci_tbl[chip_idx].flags & TLAN_ADAPTER_USE_INTERN_10)
01601             && (priv->phyNum != 0)) {
01602                 priv->phyNum = 0;
01603                 data =
01604                     TLAN_NET_CFG_1FRAG | TLAN_NET_CFG_1CHAN |
01605                     TLAN_NET_CFG_PHY_EN;
01606                 TLan_DioWrite16(BASE, TLAN_NET_CONFIG, data);
01607                 /* TLan_SetTimer( nic, (400*HZ/1000), TLAN_TIMER_PHY_PDOWN ); */
01608                 mdelay(400);
01609                 TLan_PhyPowerDown(nic);
01610                 return;
01611         }
01612 
01613         if (priv->phyNum == 0) {
01614                 if ((priv->duplex == TLAN_DUPLEX_FULL)
01615                     || (an_adv & an_lpa & 0x0040)) {
01616                         TLan_MiiWriteReg(nic, phy, MII_BMCR,
01617                                          BMCR_ANENABLE | BMCR_FULLDPLX);
01618                         DBG 
01619                             ( "TLAN:  Starting internal PHY with FULL-DUPLEX\n" );
01620                 } else {
01621                         TLan_MiiWriteReg(nic, phy, MII_BMCR,
01622                                          BMCR_ANENABLE);
01623                         DBG 
01624                             ( "TLAN:  Starting internal PHY with HALF-DUPLEX\n" );
01625                 }
01626         }
01627 
01628         /* Wait for 100 ms.  No reason in partiticular.
01629          */
01630         /* TLan_SetTimer( dev, (HZ/10), TLAN_TIMER_FINISH_RESET ); */
01631         mdelay(100);
01632         TLan_FinishReset(nic);
01633 
01634 }                               /* TLan_PhyFinishAutoNeg */
01635 
01636 #ifdef MONITOR
01637 
01638 /*********************************************************************
01639 *
01640 *      TLan_phyMonitor
01641 *
01642 *      Returns:
01643 *              None
01644 *
01645 *      Params:
01646 *              dev             The device structure of this device.
01647 *
01648 *
01649 *      This function monitors PHY condition by reading the status
01650 *      register via the MII bus. This can be used to give info
01651 *      about link changes (up/down), and possible switch to alternate
01652 *      media.
01653 *
01654 ********************************************************************/
01655 
01656 void TLan_PhyMonitor(struct net_device *dev)
01657 {
01658         TLanPrivateInfo *priv = dev->priv;
01659         u16 phy;
01660         u16 phy_status;
01661 
01662         phy = priv->phy[priv->phyNum];
01663 
01664         /* Get PHY status register */
01665         TLan_MiiReadReg(nic, phy, MII_BMSR, &phy_status);
01666 
01667         /* Check if link has been lost */
01668         if (!(phy_status & BMSR_LSTATUS)) {
01669                 if (priv->link) {
01670                         priv->link = 0;
01671                         printf("TLAN: %s has lost link\n", priv->nic_name);
01672                         priv->flags &= ~IFF_RUNNING;
01673                         mdelay(2000);
01674                         TLan_PhyMonitor(nic);
01675                         /* TLan_SetTimer( dev, (2*HZ), TLAN_TIMER_LINK_BEAT ); */
01676                         return;
01677                 }
01678         }
01679 
01680         /* Link restablished? */
01681         if ((phy_status & BMSR_LSTATUS) && !priv->link) {
01682                 priv->link = 1;
01683                 printf("TLAN: %s has reestablished link\n",
01684                        priv->nic_name);
01685                 priv->flags |= IFF_RUNNING;
01686         }
01687 
01688         /* Setup a new monitor */
01689         /* TLan_SetTimer( dev, (2*HZ), TLAN_TIMER_LINK_BEAT ); */
01690         mdelay(2000);
01691         TLan_PhyMonitor(nic);
01692 }
01693 
01694 #endif                          /* MONITOR */
01695 
01696 static struct pci_device_id tlan_nics[] = {
01697         PCI_ROM(0x0e11, 0xae34, "netel10", "Compaq Netelligent 10 T PCI UTP", 0),
01698         PCI_ROM(0x0e11, 0xae32, "netel100","Compaq Netelligent 10/100 TX PCI UTP", 0),
01699         PCI_ROM(0x0e11, 0xae35, "netflex3i", "Compaq Integrated NetFlex-3/P", 0),
01700         PCI_ROM(0x0e11, 0xf130, "thunder", "Compaq NetFlex-3/P", 0),
01701         PCI_ROM(0x0e11, 0xf150, "netflex3b", "Compaq NetFlex-3/P", 0),
01702         PCI_ROM(0x0e11, 0xae43, "netel100pi", "Compaq Netelligent Integrated 10/100 TX UTP", 0),
01703         PCI_ROM(0x0e11, 0xae40, "netel100d", "Compaq Netelligent Dual 10/100 TX PCI UTP", 0),
01704         PCI_ROM(0x0e11, 0xb011, "netel100i", "Compaq Netelligent 10/100 TX Embedded UTP", 0),
01705         PCI_ROM(0x108d, 0x0013, "oc2183", "Olicom OC-2183/2185", 0),
01706         PCI_ROM(0x108d, 0x0012, "oc2325", "Olicom OC-2325", 0),
01707         PCI_ROM(0x108d, 0x0014, "oc2326", "Olicom OC-2326", 0),
01708         PCI_ROM(0x0e11, 0xb030, "netelligent_10_100_ws_5100", "Compaq Netelligent 10/100 TX UTP", 0),
01709         PCI_ROM(0x0e11, 0xb012, "netelligent_10_t2", "Compaq Netelligent 10 T/2 PCI UTP/Coax", 0),
01710 };
01711 
01712 PCI_DRIVER ( tlan_driver, tlan_nics, PCI_NO_CLASS );
01713 
01714 DRIVER ( "TLAN/PCI", nic_driver, pci_driver, tlan_driver,
01715          tlan_probe, tlan_disable );
01716 
01717 /*
01718  * Local variables:
01719  *  c-basic-offset: 8
01720  *  c-indent-level: 8
01721  *  tab-width: 8
01722  * End:
01723  */

Generated on Tue Apr 6 20:01:04 2010 for gPXE by  doxygen 1.5.7.1