Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
tc35815.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <linux/if_vlan.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/spinlock.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/phy.h>
#include <linux/workqueue.h>
#include <linux/platform_device.h>
#include <linux/prefetch.h>
#include <asm/io.h>
#include <asm/byteorder.h>

Go to the source code of this file.

Data Structures

struct  tc35815_options
 
struct  tc35815_regs
 
struct  FDesc
 
struct  BDesc
 
struct  TxFD
 
struct  RxFD
 
struct  FrFD
 
struct  tc35815_local
 

Macros

#define DRV_VERSION   "1.39"
 
#define MODNAME   "tc35815"
 
#define DMA_RxAlign   0x00c00000 /* 1:Reception Alignment */
 
#define DMA_RxAlign_1   0x00400000
 
#define DMA_RxAlign_2   0x00800000
 
#define DMA_RxAlign_3   0x00c00000
 
#define DMA_M66EnStat   0x00080000 /* 1:66MHz Enable State */
 
#define DMA_IntMask   0x00040000 /* 1:Interrupt mask */
 
#define DMA_SWIntReq   0x00020000 /* 1:Software Interrupt request */
 
#define DMA_TxWakeUp   0x00010000 /* 1:Transmit Wake Up */
 
#define DMA_RxBigE   0x00008000 /* 1:Receive Big Endian */
 
#define DMA_TxBigE   0x00004000 /* 1:Transmit Big Endian */
 
#define DMA_TestMode   0x00002000 /* 1:Test Mode */
 
#define DMA_PowrMgmnt   0x00001000 /* 1:Power Management */
 
#define DMA_DmBurst_Mask   0x000001fc /* DMA Burst size */
 
#define RxFrag_EnPack   0x00008000 /* 1:Enable Packing */
 
#define RxFrag_MinFragMask   0x00000ffc /* Minimum Fragment */
 
#define MAC_Link10   0x00008000 /* 1:Link Status 10Mbits */
 
#define MAC_EnMissRoll   0x00002000 /* 1:Enable Missed Roll */
 
#define MAC_MissRoll   0x00000400 /* 1:Missed Roll */
 
#define MAC_Loop10   0x00000080 /* 1:Loop 10 Mbps */
 
#define MAC_Conn_Auto   0x00000000 /*00:Connection mode (Automatic) */
 
#define MAC_Conn_10M   0x00000020 /*01: (10Mbps endec)*/
 
#define MAC_Conn_Mll   0x00000040 /*10: (Mll clock) */
 
#define MAC_MacLoop   0x00000010 /* 1:MAC Loopback */
 
#define MAC_FullDup   0x00000008 /* 1:Full Duplex 0:Half Duplex */
 
#define MAC_Reset   0x00000004 /* 1:Software Reset */
 
#define MAC_HaltImm   0x00000002 /* 1:Halt Immediate */
 
#define MAC_HaltReq   0x00000001 /* 1:Halt request */
 
#define PROM_Busy   0x00008000 /* 1:Busy (Start Operation) */
 
#define PROM_Read   0x00004000 /*10:Read operation */
 
#define PROM_Write   0x00002000 /*01:Write operation */
 
#define PROM_Erase   0x00006000 /*11:Erase operation */
 
#define PROM_Addr_Ena   0x00000030 /*11xxxx:PROM Write enable */
 
#define CAM_CompEn   0x00000010 /* 1:CAM Compare Enable */
 
#define CAM_NegCAM   0x00000008 /* 1:Reject packets CAM recognizes,*/
 
#define CAM_BroadAcc   0x00000004 /* 1:Broadcast assept */
 
#define CAM_GroupAcc   0x00000002 /* 1:Multicast assept */
 
#define CAM_StationAcc   0x00000001 /* 1:unicast accept */
 
#define CAM_ENTRY_MAX   21 /* CAM Data entry max count */
 
#define CAM_Ena_Mask   ((1<<CAM_ENTRY_MAX)-1) /* CAM Enable bits (Max 21bits) */
 
#define CAM_Ena_Bit(index)   (1 << (index))
 
#define CAM_ENTRY_DESTINATION   0
 
#define CAM_ENTRY_SOURCE   1
 
#define CAM_ENTRY_MACCTL   20
 
#define Tx_En   0x00000001 /* 1:Transmit enable */
 
#define Tx_TxHalt   0x00000002 /* 1:Transmit Halt Request */
 
#define Tx_NoPad   0x00000004 /* 1:Suppress Padding */
 
#define Tx_NoCRC   0x00000008 /* 1:Suppress Padding */
 
#define Tx_FBack   0x00000010 /* 1:Fast Back-off */
 
#define Tx_EnUnder   0x00000100 /* 1:Enable Underrun */
 
#define Tx_EnExDefer   0x00000200 /* 1:Enable Excessive Deferral */
 
#define Tx_EnLCarr   0x00000400 /* 1:Enable Lost Carrier */
 
#define Tx_EnExColl   0x00000800 /* 1:Enable Excessive Collision */
 
#define Tx_EnLateColl   0x00001000 /* 1:Enable Late Collision */
 
#define Tx_EnTxPar   0x00002000 /* 1:Enable Transmit Parity */
 
#define Tx_EnComp   0x00004000 /* 1:Enable Completion */
 
#define Tx_TxColl_MASK   0x0000000F /* Tx Collision Count */
 
#define Tx_ExColl   0x00000010 /* Excessive Collision */
 
#define Tx_TXDefer   0x00000020 /* Transmit Defered */
 
#define Tx_Paused   0x00000040 /* Transmit Paused */
 
#define Tx_IntTx   0x00000080 /* Interrupt on Tx */
 
#define Tx_Under   0x00000100 /* Underrun */
 
#define Tx_Defer   0x00000200 /* Deferral */
 
#define Tx_NCarr   0x00000400 /* No Carrier */
 
#define Tx_10Stat   0x00000800 /* 10Mbps Status */
 
#define Tx_LateColl   0x00001000 /* Late Collision */
 
#define Tx_TxPar   0x00002000 /* Tx Parity Error */
 
#define Tx_Comp   0x00004000 /* Completion */
 
#define Tx_Halted   0x00008000 /* Tx Halted */
 
#define Tx_SQErr   0x00010000 /* Signal Quality Error(SQE) */
 
#define Rx_EnGood   0x00004000 /* 1:Enable Good */
 
#define Rx_EnRxPar   0x00002000 /* 1:Enable Receive Parity */
 
#define Rx_EnLongErr   0x00000800 /* 1:Enable Long Error */
 
#define Rx_EnOver   0x00000400 /* 1:Enable OverFlow */
 
#define Rx_EnCRCErr   0x00000200 /* 1:Enable CRC Error */
 
#define Rx_EnAlign   0x00000100 /* 1:Enable Alignment */
 
#define Rx_IgnoreCRC   0x00000040 /* 1:Ignore CRC Value */
 
#define Rx_StripCRC   0x00000010 /* 1:Strip CRC Value */
 
#define Rx_ShortEn   0x00000008 /* 1:Short Enable */
 
#define Rx_LongEn   0x00000004 /* 1:Long Enable */
 
#define Rx_RxHalt   0x00000002 /* 1:Receive Halt Request */
 
#define Rx_RxEn   0x00000001 /* 1:Receive Intrrupt Enable */
 
#define Rx_Halted   0x00008000 /* Rx Halted */
 
#define Rx_Good   0x00004000 /* Rx Good */
 
#define Rx_RxPar   0x00002000 /* Rx Parity Error */
 
#define Rx_TypePkt   0x00001000 /* Rx Type Packet */
 
#define Rx_LongErr   0x00000800 /* Rx Long Error */
 
#define Rx_Over   0x00000400 /* Rx Overflow */
 
#define Rx_CRCErr   0x00000200 /* Rx CRC Error */
 
#define Rx_Align   0x00000100 /* Rx Alignment Error */
 
#define Rx_10Stat   0x00000080 /* Rx 10Mbps Status */
 
#define Rx_IntRx   0x00000040 /* Rx Interrupt */
 
#define Rx_CtlRecd   0x00000020 /* Rx Control Receive */
 
#define Rx_InLenErr   0x00000010 /* Rx In Range Frame Length Error */
 
#define Rx_Stat_Mask   0x0000FFF0 /* Rx All Status Mask */
 
#define Int_NRAbtEn   0x00000800 /* 1:Non-recoverable Abort Enable */
 
#define Int_TxCtlCmpEn   0x00000400 /* 1:Transmit Ctl Complete Enable */
 
#define Int_DmParErrEn   0x00000200 /* 1:DMA Parity Error Enable */
 
#define Int_DParDEn   0x00000100 /* 1:Data Parity Error Enable */
 
#define Int_EarNotEn   0x00000080 /* 1:Early Notify Enable */
 
#define Int_DParErrEn   0x00000040 /* 1:Detected Parity Error Enable */
 
#define Int_SSysErrEn   0x00000020 /* 1:Signalled System Error Enable */
 
#define Int_RMasAbtEn   0x00000010 /* 1:Received Master Abort Enable */
 
#define Int_RTargAbtEn   0x00000008 /* 1:Received Target Abort Enable */
 
#define Int_STargAbtEn   0x00000004 /* 1:Signalled Target Abort Enable */
 
#define Int_BLExEn   0x00000002 /* 1:Buffer List Exhausted Enable */
 
#define Int_FDAExEn   0x00000001 /* 1:Free Descriptor Area */
 
#define Int_NRabt   0x00004000 /* 1:Non Recoverable error */
 
#define Int_DmParErrStat   0x00002000 /* 1:DMA Parity Error & Clear */
 
#define Int_BLEx   0x00001000 /* 1:Buffer List Empty & Clear */
 
#define Int_FDAEx   0x00000800 /* 1:FDA Empty & Clear */
 
#define Int_IntNRAbt   0x00000400 /* 1:Non Recoverable Abort */
 
#define Int_IntCmp   0x00000200 /* 1:MAC control packet complete */
 
#define Int_IntExBD   0x00000100 /* 1:Interrupt Extra BD & Clear */
 
#define Int_DmParErr   0x00000080 /* 1:DMA Parity Error & Clear */
 
#define Int_IntEarNot   0x00000040 /* 1:Receive Data write & Clear */
 
#define Int_SWInt   0x00000020 /* 1:Software request & Clear */
 
#define Int_IntBLEx   0x00000010 /* 1:Buffer List Empty & Clear */
 
#define Int_IntFDAEx   0x00000008 /* 1:FDA Empty & Clear */
 
#define Int_IntPCI   0x00000004 /* 1:PCI controller & Clear */
 
#define Int_IntMacRx   0x00000002 /* 1:Rx controller & Clear */
 
#define Int_IntMacTx   0x00000001 /* 1:Tx controller & Clear */
 
#define MD_CA_PreSup   0x00001000 /* 1:Preamble Suppress */
 
#define MD_CA_Busy   0x00000800 /* 1:Busy (Start Operation) */
 
#define MD_CA_Wr   0x00000400 /* 1:Write 0:Read */
 
#define FD_ALIGN   16
 
#define FD_FDLength_MASK   0x0000FFFF /* Length MASK */
 
#define FD_BDCnt_MASK   0x001F0000 /* BD count MASK in FD */
 
#define FD_FrmOpt_MASK   0x7C000000 /* Frame option MASK */
 
#define FD_FrmOpt_BigEndian   0x40000000 /* Tx/Rx */
 
#define FD_FrmOpt_IntTx   0x20000000 /* Tx only */
 
#define FD_FrmOpt_NoCRC   0x10000000 /* Tx only */
 
#define FD_FrmOpt_NoPadding   0x08000000 /* Tx only */
 
#define FD_FrmOpt_Packing   0x04000000 /* Rx only */
 
#define FD_CownsFD   0x80000000 /* FD Controller owner bit */
 
#define FD_Next_EOL   0x00000001 /* FD EOL indicator */
 
#define FD_BDCnt_SHIFT   16
 
#define BD_BuffLength_MASK   0x0000FFFF /* Receive Data Size */
 
#define BD_RxBDID_MASK   0x00FF0000 /* BD ID Number MASK */
 
#define BD_RxBDSeqN_MASK   0x7F000000 /* Rx BD Sequence Number */
 
#define BD_CownsBD   0x80000000 /* BD Controller owner bit */
 
#define BD_RxBDID_SHIFT   16
 
#define BD_RxBDSeqN_SHIFT   24
 
#define TX_CTL_CMD
 
#define RX_CTL_CMD
 
#define INT_EN_CMD
 
#define DMA_CTL_CMD   DMA_BURST_SIZE
 
#define HAVE_DMA_RXALIGN(lp)   likely((lp)->chiptype != TC35815CF)
 
#define DMA_BURST_SIZE   32
 
#define TX_THRESHOLD   1024
 
#define TX_THRESHOLD_MAX   1536
 
#define TX_THRESHOLD_KEEP_LIMIT   10
 
#define FD_PAGE_NUM   4
 
#define RX_BUF_NUM   128 /* < 256 */
 
#define RX_FD_NUM   256 /* >= 32 */
 
#define TX_FD_NUM   128
 
#define RX_BUF_SIZE   L1_CACHE_ALIGN(ETH_FRAME_LEN + VLAN_HLEN + ETH_FCS_LEN + NET_IP_ALIGN)
 
#define RX_FD_RESERVE   (2 / 2) /* max 2 BD per RxFD */
 
#define NAPI_WEIGHT   16
 
#define tc_readl(addr)   ioread32(addr)
 
#define tc_writel(d, addr)   iowrite32(d, addr)
 
#define TC35815_TX_TIMEOUT   msecs_to_jiffies(400)
 
#define FATAL_ERROR_INT   (Int_IntPCI | Int_DmParErr | Int_IntNRAbt)
 
#define TX_STA_ERR   (Tx_ExColl|Tx_Under|Tx_Defer|Tx_NCarr|Tx_LateColl|Tx_TxPar|Tx_SQErr)
 

Enumerations

enum  tc35815_chiptype { TC35815CF = 0, TC35815_NWU, TC35815_TX4939 }
 

Functions

 MODULE_DEVICE_TABLE (pci, tc35815_pci_tbl)
 
 module_param_named (speed, options.speed, int, 0)
 
 MODULE_PARM_DESC (speed,"0:auto, 10:10Mbps, 100:100Mbps")
 
 module_param_named (duplex, options.duplex, int, 0)
 
 MODULE_PARM_DESC (duplex,"0:auto, 1:half, 2:full")
 
 module_init (tc35815_init_module)
 
 module_exit (tc35815_cleanup_module)
 
 MODULE_DESCRIPTION ("TOSHIBA TC35815 PCI 10M/100M Ethernet driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define BD_BuffLength_MASK   0x0000FFFF /* Receive Data Size */

Definition at line 314 of file tc35815.c.

#define BD_CownsBD   0x80000000 /* BD Controller owner bit */

Definition at line 317 of file tc35815.c.

#define BD_RxBDID_MASK   0x00FF0000 /* BD ID Number MASK */

Definition at line 315 of file tc35815.c.

#define BD_RxBDID_SHIFT   16

Definition at line 318 of file tc35815.c.

#define BD_RxBDSeqN_MASK   0x7F000000 /* Rx BD Sequence Number */

Definition at line 316 of file tc35815.c.

#define BD_RxBDSeqN_SHIFT   24

Definition at line 319 of file tc35815.c.

#define CAM_BroadAcc   0x00000004 /* 1:Broadcast assept */

Definition at line 170 of file tc35815.c.

#define CAM_CompEn   0x00000010 /* 1:CAM Compare Enable */

Definition at line 167 of file tc35815.c.

#define CAM_Ena_Bit (   index)    (1 << (index))

Definition at line 177 of file tc35815.c.

#define CAM_Ena_Mask   ((1<<CAM_ENTRY_MAX)-1) /* CAM Enable bits (Max 21bits) */

Definition at line 176 of file tc35815.c.

#define CAM_ENTRY_DESTINATION   0

Definition at line 178 of file tc35815.c.

#define CAM_ENTRY_MACCTL   20

Definition at line 180 of file tc35815.c.

#define CAM_ENTRY_MAX   21 /* CAM Data entry max count */

Definition at line 175 of file tc35815.c.

#define CAM_ENTRY_SOURCE   1

Definition at line 179 of file tc35815.c.

#define CAM_GroupAcc   0x00000002 /* 1:Multicast assept */

Definition at line 171 of file tc35815.c.

#define CAM_NegCAM   0x00000008 /* 1:Reject packets CAM recognizes,*/

Definition at line 168 of file tc35815.c.

#define CAM_StationAcc   0x00000001 /* 1:unicast accept */

Definition at line 172 of file tc35815.c.

#define DMA_BURST_SIZE   32

Definition at line 339 of file tc35815.c.

#define DMA_CTL_CMD   DMA_BURST_SIZE

Definition at line 335 of file tc35815.c.

#define DMA_DmBurst_Mask   0x000001fc /* DMA Burst size */

Definition at line 136 of file tc35815.c.

#define DMA_IntMask   0x00040000 /* 1:Interrupt mask */

Definition at line 129 of file tc35815.c.

#define DMA_M66EnStat   0x00080000 /* 1:66MHz Enable State */

Definition at line 128 of file tc35815.c.

#define DMA_PowrMgmnt   0x00001000 /* 1:Power Management */

Definition at line 135 of file tc35815.c.

#define DMA_RxAlign   0x00c00000 /* 1:Reception Alignment */

Definition at line 124 of file tc35815.c.

#define DMA_RxAlign_1   0x00400000

Definition at line 125 of file tc35815.c.

#define DMA_RxAlign_2   0x00800000

Definition at line 126 of file tc35815.c.

#define DMA_RxAlign_3   0x00c00000

Definition at line 127 of file tc35815.c.

#define DMA_RxBigE   0x00008000 /* 1:Receive Big Endian */

Definition at line 132 of file tc35815.c.

#define DMA_SWIntReq   0x00020000 /* 1:Software Interrupt request */

Definition at line 130 of file tc35815.c.

#define DMA_TestMode   0x00002000 /* 1:Test Mode */

Definition at line 134 of file tc35815.c.

#define DMA_TxBigE   0x00004000 /* 1:Transmit Big Endian */

Definition at line 133 of file tc35815.c.

#define DMA_TxWakeUp   0x00010000 /* 1:Transmit Wake Up */

Definition at line 131 of file tc35815.c.

#define DRV_VERSION   "1.39"

Definition at line 25 of file tc35815.c.

#define FATAL_ERROR_INT   (Int_IntPCI | Int_DmParErr | Int_IntNRAbt)

Definition at line 1378 of file tc35815.c.

#define FD_ALIGN   16

Definition at line 298 of file tc35815.c.

#define FD_BDCnt_MASK   0x001F0000 /* BD count MASK in FD */

Definition at line 302 of file tc35815.c.

#define FD_BDCnt_SHIFT   16

Definition at line 311 of file tc35815.c.

#define FD_CownsFD   0x80000000 /* FD Controller owner bit */

Definition at line 309 of file tc35815.c.

#define FD_FDLength_MASK   0x0000FFFF /* Length MASK */

Definition at line 301 of file tc35815.c.

#define FD_FrmOpt_BigEndian   0x40000000 /* Tx/Rx */

Definition at line 304 of file tc35815.c.

#define FD_FrmOpt_IntTx   0x20000000 /* Tx only */

Definition at line 305 of file tc35815.c.

#define FD_FrmOpt_MASK   0x7C000000 /* Frame option MASK */

Definition at line 303 of file tc35815.c.

#define FD_FrmOpt_NoCRC   0x10000000 /* Tx only */

Definition at line 306 of file tc35815.c.

#define FD_FrmOpt_NoPadding   0x08000000 /* Tx only */

Definition at line 307 of file tc35815.c.

#define FD_FrmOpt_Packing   0x04000000 /* Rx only */

Definition at line 308 of file tc35815.c.

#define FD_Next_EOL   0x00000001 /* FD EOL indicator */

Definition at line 310 of file tc35815.c.

#define FD_PAGE_NUM   4

Definition at line 347 of file tc35815.c.

#define HAVE_DMA_RXALIGN (   lp)    likely((lp)->chiptype != TC35815CF)

Definition at line 336 of file tc35815.c.

#define Int_BLEx   0x00001000 /* 1:Buffer List Empty & Clear */

Definition at line 260 of file tc35815.c.

#define Int_BLExEn   0x00000002 /* 1:Buffer List Exhausted Enable */

Definition at line 253 of file tc35815.c.

#define Int_DmParErr   0x00000080 /* 1:DMA Parity Error & Clear */

Definition at line 265 of file tc35815.c.

#define Int_DmParErrEn   0x00000200 /* 1:DMA Parity Error Enable */

Definition at line 245 of file tc35815.c.

#define Int_DmParErrStat   0x00002000 /* 1:DMA Parity Error & Clear */

Definition at line 259 of file tc35815.c.

#define Int_DParDEn   0x00000100 /* 1:Data Parity Error Enable */

Definition at line 246 of file tc35815.c.

#define Int_DParErrEn   0x00000040 /* 1:Detected Parity Error Enable */

Definition at line 248 of file tc35815.c.

#define Int_EarNotEn   0x00000080 /* 1:Early Notify Enable */

Definition at line 247 of file tc35815.c.

#define INT_EN_CMD
Value:
Int_DmParErrEn | Int_DParDEn | Int_DParErrEn | \
Int_SSysErrEn | Int_RMasAbtEn | Int_RTargAbtEn | \
Int_STargAbtEn | \
Int_BLExEn | Int_FDAExEn) /* maybe 0xb7f*/

Definition at line 330 of file tc35815.c.

#define Int_FDAEx   0x00000800 /* 1:FDA Empty & Clear */

Definition at line 261 of file tc35815.c.

#define Int_FDAExEn   0x00000001 /* 1:Free Descriptor Area */

Definition at line 254 of file tc35815.c.

#define Int_IntBLEx   0x00000010 /* 1:Buffer List Empty & Clear */

Definition at line 268 of file tc35815.c.

#define Int_IntCmp   0x00000200 /* 1:MAC control packet complete */

Definition at line 263 of file tc35815.c.

#define Int_IntEarNot   0x00000040 /* 1:Receive Data write & Clear */

Definition at line 266 of file tc35815.c.

#define Int_IntExBD   0x00000100 /* 1:Interrupt Extra BD & Clear */

Definition at line 264 of file tc35815.c.

#define Int_IntFDAEx   0x00000008 /* 1:FDA Empty & Clear */

Definition at line 269 of file tc35815.c.

#define Int_IntMacRx   0x00000002 /* 1:Rx controller & Clear */

Definition at line 271 of file tc35815.c.

#define Int_IntMacTx   0x00000001 /* 1:Tx controller & Clear */

Definition at line 272 of file tc35815.c.

#define Int_IntNRAbt   0x00000400 /* 1:Non Recoverable Abort */

Definition at line 262 of file tc35815.c.

#define Int_IntPCI   0x00000004 /* 1:PCI controller & Clear */

Definition at line 270 of file tc35815.c.

#define Int_NRabt   0x00004000 /* 1:Non Recoverable error */

Definition at line 258 of file tc35815.c.

#define Int_NRAbtEn   0x00000800 /* 1:Non-recoverable Abort Enable */

Definition at line 243 of file tc35815.c.

#define Int_RMasAbtEn   0x00000010 /* 1:Received Master Abort Enable */

Definition at line 250 of file tc35815.c.

#define Int_RTargAbtEn   0x00000008 /* 1:Received Target Abort Enable */

Definition at line 251 of file tc35815.c.

#define Int_SSysErrEn   0x00000020 /* 1:Signalled System Error Enable */

Definition at line 249 of file tc35815.c.

#define Int_STargAbtEn   0x00000004 /* 1:Signalled Target Abort Enable */

Definition at line 252 of file tc35815.c.

#define Int_SWInt   0x00000020 /* 1:Software request & Clear */

Definition at line 267 of file tc35815.c.

#define Int_TxCtlCmpEn   0x00000400 /* 1:Transmit Ctl Complete Enable */

Definition at line 244 of file tc35815.c.

#define MAC_Conn_10M   0x00000020 /*01: (10Mbps endec)*/

Definition at line 148 of file tc35815.c.

#define MAC_Conn_Auto   0x00000000 /*00:Connection mode (Automatic) */

Definition at line 147 of file tc35815.c.

#define MAC_Conn_Mll   0x00000040 /*10: (Mll clock) */

Definition at line 149 of file tc35815.c.

#define MAC_EnMissRoll   0x00002000 /* 1:Enable Missed Roll */

Definition at line 144 of file tc35815.c.

#define MAC_FullDup   0x00000008 /* 1:Full Duplex 0:Half Duplex */

Definition at line 151 of file tc35815.c.

#define MAC_HaltImm   0x00000002 /* 1:Halt Immediate */

Definition at line 153 of file tc35815.c.

#define MAC_HaltReq   0x00000001 /* 1:Halt request */

Definition at line 154 of file tc35815.c.

#define MAC_Link10   0x00008000 /* 1:Link Status 10Mbits */

Definition at line 143 of file tc35815.c.

#define MAC_Loop10   0x00000080 /* 1:Loop 10 Mbps */

Definition at line 146 of file tc35815.c.

#define MAC_MacLoop   0x00000010 /* 1:MAC Loopback */

Definition at line 150 of file tc35815.c.

#define MAC_MissRoll   0x00000400 /* 1:Missed Roll */

Definition at line 145 of file tc35815.c.

#define MAC_Reset   0x00000004 /* 1:Software Reset */

Definition at line 152 of file tc35815.c.

#define MD_CA_Busy   0x00000800 /* 1:Busy (Start Operation) */

Definition at line 276 of file tc35815.c.

#define MD_CA_PreSup   0x00001000 /* 1:Preamble Suppress */

Definition at line 275 of file tc35815.c.

#define MD_CA_Wr   0x00000400 /* 1:Write 0:Read */

Definition at line 277 of file tc35815.c.

#define MODNAME   "tc35815"

Definition at line 27 of file tc35815.c.

#define NAPI_WEIGHT   16

Definition at line 361 of file tc35815.c.

#define PROM_Addr_Ena   0x00000030 /*11xxxx:PROM Write enable */

Definition at line 163 of file tc35815.c.

#define PROM_Busy   0x00008000 /* 1:Busy (Start Operation) */

Definition at line 157 of file tc35815.c.

#define PROM_Erase   0x00006000 /*11:Erase operation */

Definition at line 160 of file tc35815.c.

#define PROM_Read   0x00004000 /*10:Read operation */

Definition at line 158 of file tc35815.c.

#define PROM_Write   0x00002000 /*01:Write operation */

Definition at line 159 of file tc35815.c.

#define Rx_10Stat   0x00000080 /* Rx 10Mbps Status */

Definition at line 235 of file tc35815.c.

#define Rx_Align   0x00000100 /* Rx Alignment Error */

Definition at line 234 of file tc35815.c.

#define RX_BUF_NUM   128 /* < 256 */

Definition at line 348 of file tc35815.c.

Definition at line 357 of file tc35815.c.

#define Rx_CRCErr   0x00000200 /* Rx CRC Error */

Definition at line 233 of file tc35815.c.

#define RX_CTL_CMD
Value:

Definition at line 328 of file tc35815.c.

#define Rx_CtlRecd   0x00000020 /* Rx Control Receive */

Definition at line 237 of file tc35815.c.

#define Rx_EnAlign   0x00000100 /* 1:Enable Alignment */

Definition at line 218 of file tc35815.c.

#define Rx_EnCRCErr   0x00000200 /* 1:Enable CRC Error */

Definition at line 217 of file tc35815.c.

#define Rx_EnGood   0x00004000 /* 1:Enable Good */

Definition at line 213 of file tc35815.c.

#define Rx_EnLongErr   0x00000800 /* 1:Enable Long Error */

Definition at line 215 of file tc35815.c.

#define Rx_EnOver   0x00000400 /* 1:Enable OverFlow */

Definition at line 216 of file tc35815.c.

#define Rx_EnRxPar   0x00002000 /* 1:Enable Receive Parity */

Definition at line 214 of file tc35815.c.

#define RX_FD_NUM   256 /* >= 32 */

Definition at line 349 of file tc35815.c.

#define RX_FD_RESERVE   (2 / 2) /* max 2 BD per RxFD */

Definition at line 360 of file tc35815.c.

#define Rx_Good   0x00004000 /* Rx Good */

Definition at line 228 of file tc35815.c.

#define Rx_Halted   0x00008000 /* Rx Halted */

Definition at line 227 of file tc35815.c.

#define Rx_IgnoreCRC   0x00000040 /* 1:Ignore CRC Value */

Definition at line 219 of file tc35815.c.

#define Rx_InLenErr   0x00000010 /* Rx In Range Frame Length Error */

Definition at line 238 of file tc35815.c.

#define Rx_IntRx   0x00000040 /* Rx Interrupt */

Definition at line 236 of file tc35815.c.

#define Rx_LongEn   0x00000004 /* 1:Long Enable */

Definition at line 222 of file tc35815.c.

#define Rx_LongErr   0x00000800 /* Rx Long Error */

Definition at line 231 of file tc35815.c.

#define Rx_Over   0x00000400 /* Rx Overflow */

Definition at line 232 of file tc35815.c.

#define Rx_RxEn   0x00000001 /* 1:Receive Intrrupt Enable */

Definition at line 224 of file tc35815.c.

#define Rx_RxHalt   0x00000002 /* 1:Receive Halt Request */

Definition at line 223 of file tc35815.c.

#define Rx_RxPar   0x00002000 /* Rx Parity Error */

Definition at line 229 of file tc35815.c.

#define Rx_ShortEn   0x00000008 /* 1:Short Enable */

Definition at line 221 of file tc35815.c.

#define Rx_Stat_Mask   0x0000FFF0 /* Rx All Status Mask */

Definition at line 240 of file tc35815.c.

#define Rx_StripCRC   0x00000010 /* 1:Strip CRC Value */

Definition at line 220 of file tc35815.c.

#define Rx_TypePkt   0x00001000 /* Rx Type Packet */

Definition at line 230 of file tc35815.c.

#define RxFrag_EnPack   0x00008000 /* 1:Enable Packing */

Definition at line 139 of file tc35815.c.

#define RxFrag_MinFragMask   0x00000ffc /* Minimum Fragment */

Definition at line 140 of file tc35815.c.

#define TC35815_TX_TIMEOUT   msecs_to_jiffies(400)

Definition at line 383 of file tc35815.c.

#define tc_readl (   addr)    ioread32(addr)

Definition at line 380 of file tc35815.c.

#define tc_writel (   d,
  addr 
)    iowrite32(d, addr)

Definition at line 381 of file tc35815.c.

#define Tx_10Stat   0x00000800 /* 10Mbps Status */

Definition at line 205 of file tc35815.c.

#define Tx_Comp   0x00004000 /* Completion */

Definition at line 208 of file tc35815.c.

#define TX_CTL_CMD
Value:
Tx_EnExColl | Tx_EnLCarr | Tx_EnExDefer | Tx_EnUnder | \
Tx_En) /* maybe 0x7b01 */

Definition at line 324 of file tc35815.c.

#define Tx_Defer   0x00000200 /* Deferral */

Definition at line 203 of file tc35815.c.

#define Tx_En   0x00000001 /* 1:Transmit enable */

Definition at line 183 of file tc35815.c.

#define Tx_EnComp   0x00004000 /* 1:Enable Completion */

Definition at line 194 of file tc35815.c.

#define Tx_EnExColl   0x00000800 /* 1:Enable Excessive Collision */

Definition at line 191 of file tc35815.c.

#define Tx_EnExDefer   0x00000200 /* 1:Enable Excessive Deferral */

Definition at line 189 of file tc35815.c.

#define Tx_EnLateColl   0x00001000 /* 1:Enable Late Collision */

Definition at line 192 of file tc35815.c.

#define Tx_EnLCarr   0x00000400 /* 1:Enable Lost Carrier */

Definition at line 190 of file tc35815.c.

#define Tx_EnTxPar   0x00002000 /* 1:Enable Transmit Parity */

Definition at line 193 of file tc35815.c.

#define Tx_EnUnder   0x00000100 /* 1:Enable Underrun */

Definition at line 188 of file tc35815.c.

#define Tx_ExColl   0x00000010 /* Excessive Collision */

Definition at line 198 of file tc35815.c.

#define Tx_FBack   0x00000010 /* 1:Fast Back-off */

Definition at line 187 of file tc35815.c.

#define TX_FD_NUM   128

Definition at line 350 of file tc35815.c.

#define Tx_Halted   0x00008000 /* Tx Halted */

Definition at line 209 of file tc35815.c.

#define Tx_IntTx   0x00000080 /* Interrupt on Tx */

Definition at line 201 of file tc35815.c.

#define Tx_LateColl   0x00001000 /* Late Collision */

Definition at line 206 of file tc35815.c.

#define Tx_NCarr   0x00000400 /* No Carrier */

Definition at line 204 of file tc35815.c.

#define Tx_NoCRC   0x00000008 /* 1:Suppress Padding */

Definition at line 186 of file tc35815.c.

#define Tx_NoPad   0x00000004 /* 1:Suppress Padding */

Definition at line 185 of file tc35815.c.

#define Tx_Paused   0x00000040 /* Transmit Paused */

Definition at line 200 of file tc35815.c.

#define Tx_SQErr   0x00010000 /* Signal Quality Error(SQE) */

Definition at line 210 of file tc35815.c.

Definition at line 1687 of file tc35815.c.

#define TX_THRESHOLD   1024

Definition at line 340 of file tc35815.c.

#define TX_THRESHOLD_KEEP_LIMIT   10

Definition at line 344 of file tc35815.c.

#define TX_THRESHOLD_MAX   1536

Definition at line 342 of file tc35815.c.

#define Tx_TxColl_MASK   0x0000000F /* Tx Collision Count */

Definition at line 197 of file tc35815.c.

#define Tx_TXDefer   0x00000020 /* Transmit Defered */

Definition at line 199 of file tc35815.c.

#define Tx_TxHalt   0x00000002 /* 1:Transmit Halt Request */

Definition at line 184 of file tc35815.c.

#define Tx_TxPar   0x00002000 /* Tx Parity Error */

Definition at line 207 of file tc35815.c.

#define Tx_Under   0x00000100 /* Underrun */

Definition at line 202 of file tc35815.c.

Enumeration Type Documentation

Enumerator:
TC35815CF 
TC35815_NWU 
TC35815_TX4939 

Definition at line 54 of file tc35815.c.

Function Documentation

MODULE_DESCRIPTION ( "TOSHIBA TC35815 PCI 10M/100M Ethernet driver"  )
MODULE_DEVICE_TABLE ( pci  ,
tc35815_pci_tbl   
)
module_exit ( tc35815_cleanup_module  )
module_init ( tc35815_init_module  )
MODULE_LICENSE ( "GPL"  )
module_param_named ( speed  ,
options.  speed,
int  ,
 
)
module_param_named ( duplex  ,
options.  duplex,
int  ,
 
)
MODULE_PARM_DESC ( speed  ,
"0:auto  ,
10:10Mbps  ,
100:100Mbps"   
)
MODULE_PARM_DESC ( duplex  ,
"0:auto  ,
1:half  ,
2:full  
)

Variable Documentation

const char* name

Definition at line 62 of file tc35815.c.

Definition at line 2036 of file tc35815.c.