Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
yellowfin.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/mii.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/ethtool.h>
#include <linux/crc32.h>
#include <linux/bitops.h>
#include <asm/uaccess.h>
#include <asm/processor.h>
#include <asm/unaligned.h>
#include <asm/io.h>

Go to the source code of this file.

Data Structures

struct  pci_id_info
 
struct  pci_id_info::match_info
 
struct  yellowfin_desc
 
struct  tx_status_words
 
struct  yellowfin_private
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRV_NAME   "yellowfin"
 
#define DRV_VERSION   "2.1"
 
#define DRV_RELDATE   "Sep 11, 2006"
 
#define MAX_UNITS   8 /* More are supported, limit only on options */
 
#define TX_RING_SIZE   16
 
#define TX_QUEUE_SIZE   12 /* Must be > 4 && <= TX_RING_SIZE */
 
#define RX_RING_SIZE   64
 
#define STATUS_TOTAL_SIZE   TX_RING_SIZE*sizeof(struct tx_status_words)
 
#define TX_TOTAL_SIZE   2*TX_RING_SIZE*sizeof(struct yellowfin_desc)
 
#define RX_TOTAL_SIZE   RX_RING_SIZE*sizeof(struct yellowfin_desc)
 
#define TX_TIMEOUT   (2*HZ)
 
#define PKT_BUF_SZ   1536 /* Size of each temporary Rx buffer.*/
 
#define yellowfin_debug   debug
 
#define PRIV_ALIGN   31 /* Required alignment mask */
 
#define MII_CNT   4
 
#define NO_TXSTATS
 

Enumerations

enum  capability_flags {
  CanHaveMII =1, HasMII =1, FullTxStatus =2, IsGigabit =4,
  HasMulticastBug =8, FullRxStatus =16, HasMACAddrBug =32, DontUseEeprom =64
}
 
enum  { YELLOWFIN_SIZE = 0x100 }
 
enum  yellowfin_offsets {
  TxCtrl =0x00, TxStatus =0x04, TxPtr =0x0C, TxIntrSel =0x10,
  TxBranchSel =0x14, TxWaitSel =0x18, RxCtrl =0x40, RxStatus =0x44,
  RxPtr =0x4C, RxIntrSel =0x50, RxBranchSel =0x54, RxWaitSel =0x58,
  EventStatus =0x80, IntrEnb =0x82, IntrClear =0x84, IntrStatus =0x86,
  ChipRev =0x8C, DMACtrl =0x90, TxThreshold =0x94, Cnfg =0xA0,
  FrameGap0 =0xA2, FrameGap1 =0xA4, MII_Cmd =0xA6, MII_Addr =0xA8,
  MII_Wr_Data =0xAA, MII_Rd_Data =0xAC, MII_Status =0xAE, RxDepth =0xB8,
  FlowCtrl =0xBC, AddrMode =0xD0, StnAddr =0xD2, HashTbl =0xD8,
  FIFOcfg =0xF8, EEStatus =0xF0, EECtrl =0xF1, EEAddr =0xF2,
  EERead =0xF3, EEWrite =0xF4, EEFeature =0xF5
}
 
enum  desc_cmd_bits {
  CMD_TX_PKT =0x10000000, CMD_RX_BUF =0x20000000, CMD_TXSTATUS =0x30000000, CMD_NOP =0x60000000,
  CMD_STOP =0x70000000, BRANCH_ALWAYS =0x0C0000, INTR_ALWAYS =0x300000, WAIT_ALWAYS =0x030000,
  BRANCH_IFTRUE =0x040000
}
 
enum  desc_status_bits {
  DescOwned = 0x80000000, DescWholePkt = 0x60000000, DescEndPkt = 0x40000000, DescStartPkt = 0x20000000,
  DescEndRing = 0x02000000, DescUseLink = 0x01000000, RxDescErrorSummary = 0x8000, RxDescCRCError = 0x0002,
  RxDescCollisionSeen = 0x0040, RxDescFrameTooLong = 0x0080, RxDescRunt = 0x0800, RxDescDescErr = 0x4000,
  RxWholePkt = 0x00000300, RxLengthOver2047 = 0x38000010, DescOwn =0x8000, DescEndPacket =0x4000,
  DescEndRing =0x2000, LastFrag =0x80000000, DescIntrOnTx =0x8000, DescIntrOnDMADone =0x80000000,
  DisableAlign = 0x00000001, DescOwn =0x80000000, DescMore =0x40000000, DescIntr =0x20000000,
  DescNoCRC =0x10000000, DescPktOK =0x08000000, DescSizeMask =0xfff, DescTxAbort =0x04000000,
  DescTxFIFO =0x02000000, DescTxCarrier =0x01000000, DescTxDefer =0x00800000, DescTxExcDefer =0x00400000,
  DescTxOOWCol =0x00200000, DescTxExcColl =0x00100000, DescTxCollCount =0x000f0000, DescRxAbort =0x04000000,
  DescRxOver =0x02000000, DescRxDest =0x01800000, DescRxLong =0x00400000, DescRxRunt =0x00200000,
  DescRxInvalid =0x00100000, DescRxCRC =0x00080000, DescRxAlign =0x00040000, DescRxLoop =0x00020000,
  DesRxColl =0x00010000, DescOwn =0x80000000, DescEndPacket =0x40000000, DescEndRing =0x20000000,
  DescIntr =0x10000000, RX_EOP =0x0040, DescOwn =0x8000, DescOwn =0x80000000
}
 
enum  intr_status_bits {
  IntrLinkChange =0xf0000000, IntrStatsMax =0x08000000, IntrAbnormalSummary =0x02000000, IntrGeneralTimer =0x01000000,
  IntrSoftware =0x800000, IntrRxComplQ1Low =0x400000, IntrTxComplQLow =0x200000, IntrPCI =0x100000,
  IntrDMAErr =0x080000, IntrTxDataLow =0x040000, IntrRxComplQ2Low =0x020000, IntrRxDescQ1Low =0x010000,
  IntrNormalSummary =0x8000, IntrTxDone =0x4000, IntrTxDMADone =0x2000, IntrTxEmpty =0x1000,
  IntrEarlyRxQ2 =0x0800, IntrEarlyRxQ1 =0x0400, IntrRxQ2Done =0x0200, IntrRxQ1Done =0x0100,
  IntrRxGFPDead =0x80, IntrRxDescQ2Low =0x40, IntrNoTxCsum =0x20, IntrTxBadID =0x10,
  IntrHiPriTxBadID =0x08, IntrRxGfp =0x04, IntrTxGfp =0x02, IntrPCIPad =0x01,
  IntrRxDone =IntrRxQ2Done | IntrRxQ1Done, IntrRxEmpty =IntrRxDescQ1Low | IntrRxDescQ2Low, IntrNormalMask =0xff00, IntrAbnormalMask =0x3ff00fe,
  IntrSummary =0x0001, IntrPCIErr =0x0002, IntrMACCtrl =0x0008, IntrTxDone =0x0004,
  IntrRxDone =0x0010, IntrRxStart =0x0020, IntrDrvRqst =0x0040, StatsMax =0x0080,
  LinkChange =0x0100, IntrTxDMADone =0x0200, IntrRxDMADone =0x0400, RFCON = 0x00020000,
  RFCOFF = 0x00010000, LSCStatus = 0x00008000, ANCStatus = 0x00004000, FBE = 0x00002000,
  FBEMask = 0x00001800, ParityErr = 0x00000000, TargetErr = 0x00001000, MasterErr = 0x00000800,
  TUNF = 0x00000400, ROVF = 0x00000200, ETI = 0x00000100, ERI = 0x00000080,
  CNTOVF = 0x00000040, RBU = 0x00000020, TBU = 0x00000010, TI = 0x00000008,
  RI = 0x00000004, RxErr = 0x00000002, IntrRxDone =0x01, IntrRxPCIFault =0x02,
  IntrRxPCIErr =0x04, IntrTxDone =0x100, IntrTxPCIFault =0x200, IntrTxPCIErr =0x400,
  LinkChange =0x10000, NegotiationChange =0x20000, StatsMax =0x40000, IntrRxDone =0x01,
  IntrRxInvalid =0x02, IntrRxPCIFault =0x04, IntrRxPCIErr =0x08, IntrTxDone =0x10,
  IntrTxInvalid =0x20, IntrTxPCIFault =0x40, IntrTxPCIErr =0x80, IntrEarlyRx =0x100,
  IntrWakeup =0x200, IntrRxDone = 0x0001, IntrTxDone = 0x0002, IntrRxErr = 0x0004,
  IntrTxError = 0x0008, IntrRxEmpty = 0x0020, IntrPCIErr = 0x0040, IntrStatsMax = 0x0080,
  IntrRxEarly = 0x0100, IntrTxUnderrun = 0x0210, IntrRxOverflow = 0x0400, IntrRxDropped = 0x0800,
  IntrRxNoBuf = 0x1000, IntrTxAborted = 0x2000, IntrLinkChange = 0x4000, IntrRxWakeUp = 0x8000,
  IntrTxDescRace = 0x080000, IntrNormalSummary = IntrRxDone | IntrTxDone, IntrTxErrSummary
}
 

Functions

 MODULE_AUTHOR ("Donald Becker <[email protected]>")
 
 MODULE_DESCRIPTION ("Packet Engines Yellowfin G-NIC Gigabit Ethernet driver")
 
 MODULE_LICENSE ("GPL")
 
 module_param (max_interrupt_work, int, 0)
 
 module_param (mtu, int, 0)
 
 module_param (debug, int, 0)
 
 module_param (rx_copybreak, int, 0)
 
 module_param_array (options, int, NULL, 0)
 
 module_param_array (full_duplex, int, NULL, 0)
 
 module_param (gx_fix, int, 0)
 
 MODULE_PARM_DESC (max_interrupt_work,"G-NIC maximum events handled per interrupt")
 
 MODULE_PARM_DESC (mtu,"G-NIC MTU (all boards)")
 
 MODULE_PARM_DESC (debug,"G-NIC debug level (0-7)")
 
 MODULE_PARM_DESC (rx_copybreak,"G-NIC copy breakpoint for copy-only-tiny-frames")
 
 MODULE_PARM_DESC (options,"G-NIC: Bits 0-3: media type, bit 17: full duplex")
 
 MODULE_PARM_DESC (full_duplex,"G-NIC full duplex setting(s) (1)")
 
 MODULE_PARM_DESC (gx_fix,"G-NIC: enable GX server chipset bug workaround (0-1)")
 
 MODULE_DEVICE_TABLE (pci, yellowfin_pci_tbl)
 
 module_init (yellowfin_init)
 
 module_exit (yellowfin_cleanup)
 

Macro Definition Documentation

#define DRV_NAME   "yellowfin"

Definition at line 28 of file yellowfin.c.

#define DRV_RELDATE   "Sep 11, 2006"

Definition at line 30 of file yellowfin.c.

#define DRV_VERSION   "2.1"

Definition at line 29 of file yellowfin.c.

#define MAX_UNITS   8 /* More are supported, limit only on options */

Definition at line 60 of file yellowfin.c.

#define MII_CNT   4

Definition at line 305 of file yellowfin.c.

#define NO_TXSTATS
#define PKT_BUF_SZ   1536 /* Size of each temporary Rx buffer.*/

Definition at line 83 of file yellowfin.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 26 of file yellowfin.c.

#define PRIV_ALIGN   31 /* Required alignment mask */

Definition at line 304 of file yellowfin.c.

#define RX_RING_SIZE   64

Definition at line 75 of file yellowfin.c.

#define RX_TOTAL_SIZE   RX_RING_SIZE*sizeof(struct yellowfin_desc)

Definition at line 78 of file yellowfin.c.

#define STATUS_TOTAL_SIZE   TX_RING_SIZE*sizeof(struct tx_status_words)

Definition at line 76 of file yellowfin.c.

#define TX_QUEUE_SIZE   12 /* Must be > 4 && <= TX_RING_SIZE */

Definition at line 74 of file yellowfin.c.

#define TX_RING_SIZE   16

Definition at line 73 of file yellowfin.c.

#define TX_TIMEOUT   (2*HZ)

Definition at line 82 of file yellowfin.c.

#define TX_TOTAL_SIZE   2*TX_RING_SIZE*sizeof(struct yellowfin_desc)

Definition at line 77 of file yellowfin.c.

#define yellowfin_debug   debug

Definition at line 85 of file yellowfin.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
YELLOWFIN_SIZE 

Definition at line 218 of file yellowfin.c.

Enumerator:
CanHaveMII 
HasMII 
FullTxStatus 
IsGigabit 
HasMulticastBug 
FullRxStatus 
HasMACAddrBug 
DontUseEeprom 

Definition at line 211 of file yellowfin.c.

Enumerator:
CMD_TX_PKT 
CMD_RX_BUF 
CMD_TXSTATUS 
CMD_NOP 
CMD_STOP 
BRANCH_ALWAYS 
INTR_ALWAYS 
WAIT_ALWAYS 
BRANCH_IFTRUE 

Definition at line 288 of file yellowfin.c.

Enumerator:
DescOwned 
DescWholePkt 
DescEndPkt 
DescStartPkt 
DescEndRing 
DescUseLink 
RxDescErrorSummary 
RxDescCRCError 
RxDescCollisionSeen 
RxDescFrameTooLong 
RxDescRunt 
RxDescDescErr 
RxWholePkt 
RxLengthOver2047 
DescOwn 
DescEndPacket 
DescEndRing 
LastFrag 
DescIntrOnTx 
DescIntrOnDMADone 
DisableAlign 
DescOwn 
DescMore 
DescIntr 
DescNoCRC 
DescPktOK 
DescSizeMask 
DescTxAbort 
DescTxFIFO 
DescTxCarrier 
DescTxDefer 
DescTxExcDefer 
DescTxOOWCol 
DescTxExcColl 
DescTxCollCount 
DescRxAbort 
DescRxOver 
DescRxDest 
DescRxLong 
DescRxRunt 
DescRxInvalid 
DescRxCRC 
DescRxAlign 
DescRxLoop 
DesRxColl 
DescOwn 
DescEndPacket 
DescEndRing 
DescIntr 
RX_EOP 
DescOwn 
DescOwn 

Definition at line 296 of file yellowfin.c.

Enumerator:
IntrLinkChange 
IntrStatsMax 
IntrAbnormalSummary 
IntrGeneralTimer 
IntrSoftware 
IntrRxComplQ1Low 
IntrTxComplQLow 
IntrPCI 
IntrDMAErr 
IntrTxDataLow 
IntrRxComplQ2Low 
IntrRxDescQ1Low 
IntrNormalSummary 
IntrTxDone 
IntrTxDMADone 
IntrTxEmpty 
IntrEarlyRxQ2 
IntrEarlyRxQ1 
IntrRxQ2Done 
IntrRxQ1Done 
IntrRxGFPDead 
IntrRxDescQ2Low 
IntrNoTxCsum 
IntrTxBadID 
IntrHiPriTxBadID 
IntrRxGfp 
IntrTxGfp 
IntrPCIPad 
IntrRxDone 
IntrRxEmpty 
IntrNormalMask 
IntrAbnormalMask 
IntrSummary 
IntrPCIErr 
IntrMACCtrl 
IntrTxDone 
IntrRxDone 
IntrRxStart 
IntrDrvRqst 
StatsMax 
LinkChange 
IntrTxDMADone 
IntrRxDMADone 
RFCON 
RFCOFF 
LSCStatus 
ANCStatus 
FBE 
FBEMask 
ParityErr 
TargetErr 
MasterErr 
TUNF 
ROVF 
ETI 
ERI 
CNTOVF 
RBU 
TBU 
TI 
RI 
RxErr 
IntrRxDone 
IntrRxPCIFault 
IntrRxPCIErr 
IntrTxDone 
IntrTxPCIFault 
IntrTxPCIErr 
LinkChange 
NegotiationChange 
StatsMax 
IntrRxDone 
IntrRxInvalid 
IntrRxPCIFault 
IntrRxPCIErr 
IntrTxDone 
IntrTxInvalid 
IntrTxPCIFault 
IntrTxPCIErr 
IntrEarlyRx 
IntrWakeup 
IntrRxDone 
IntrTxDone 
IntrRxErr 
IntrTxError 
IntrRxEmpty 
IntrPCIErr 
IntrStatsMax 
IntrRxEarly 
IntrTxUnderrun 
IntrRxOverflow 
IntrRxDropped 
IntrRxNoBuf 
IntrTxAborted 
IntrLinkChange 
IntrRxWakeUp 
IntrTxDescRace 
IntrNormalSummary 
IntrTxErrSummary 

Definition at line 299 of file yellowfin.c.

Enumerator:
TxCtrl 
TxStatus 
TxPtr 
TxIntrSel 
TxBranchSel 
TxWaitSel 
RxCtrl 
RxStatus 
RxPtr 
RxIntrSel 
RxBranchSel 
RxWaitSel 
EventStatus 
IntrEnb 
IntrClear 
IntrStatus 
ChipRev 
DMACtrl 
TxThreshold 
Cnfg 
FrameGap0 
FrameGap1 
MII_Cmd 
MII_Addr 
MII_Wr_Data 
MII_Rd_Data 
MII_Status 
RxDepth 
FlowCtrl 
AddrMode 
StnAddr 
HashTbl 
FIFOcfg 
EEStatus 
EECtrl 
EEAddr 
EERead 
EEWrite 
EEFeature 

Definition at line 248 of file yellowfin.c.

Function Documentation

MODULE_AUTHOR ( "Donald Becker <[email protected]>"  )
MODULE_DESCRIPTION ( "Packet Engines Yellowfin G-NIC Gigabit Ethernet driver )
MODULE_DEVICE_TABLE ( pci  ,
yellowfin_pci_tbl   
)
module_exit ( yellowfin_cleanup  )
module_init ( yellowfin_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( max_interrupt_work  ,
int  ,
 
)
module_param ( mtu  ,
int  ,
 
)
module_param ( debug  ,
int  ,
 
)
module_param ( rx_copybreak  ,
int  ,
 
)
module_param ( gx_fix  ,
int  ,
 
)
module_param_array ( options  ,
int  ,
NULL  ,
 
)
module_param_array ( full_duplex  ,
int  ,
NULL  ,
 
)
MODULE_PARM_DESC ( max_interrupt_work  ,
"G-NIC maximum events handled per interrupt  
)
MODULE_PARM_DESC ( mtu  ,
"G-NIC MTU (all boards)"   
)
MODULE_PARM_DESC ( debug  ,
"G-NIC debug level (0-7)"   
)
MODULE_PARM_DESC ( rx_copybreak  ,
"G-NIC copy breakpoint for copy-only-tiny-frames"   
)
MODULE_PARM_DESC ( options  ,
"G-NIC: Bits 0-3: media  type,
bit 17:full duplex  
)
MODULE_PARM_DESC ( full_duplex  ,
"G-NIC full duplex setting(s) (1)"   
)
MODULE_PARM_DESC ( gx_fix  ,
"G-NIC: enable GX server chipset bug workaround (0-1)"   
)