Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
winbond-840.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/dma-mapping.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
#include <linux/rtnetlink.h>
#include <linux/crc32.h>
#include <linux/bitops.h>
#include <asm/uaccess.h>
#include <asm/processor.h>
#include <asm/io.h>
#include <asm/irq.h>
#include "tulip.h"

Go to the source code of this file.

Data Structures

struct  pci_id_info
 
struct  w840_rx_desc
 
struct  w840_tx_desc
 
struct  netdev_private
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRV_NAME   "winbond-840"
 
#define DRV_VERSION   "1.01-e"
 
#define DRV_RELDATE   "Sep-11-2006"
 
#define MAX_UNITS   8 /* More are supported, limit only on options */
 
#define TX_QUEUE_LEN   10 /* Limit ring entries actually used. */
 
#define TX_QUEUE_LEN_RESTART   5
 
#define TX_BUFLIMIT   (1024-128)
 
#define TX_FIFO_SIZE   (2048)
 
#define TX_BUG_FIFO_LIMIT   (TX_FIFO_SIZE-1514-16)
 
#define TX_TIMEOUT   (2*HZ)
 
#define PKT_BUF_SZ   1536 /* Size of each temporary Rx buffer.*/
 
#define MII_CNT   1 /* winbond only supports one MII */
 
#define eeprom_delay(ee_addr)   ioread32(ee_addr)
 
#define mdio_delay(mdio_addr)   ioread32(mdio_addr)
 
#define MDIO_WRITE0   (MDIO_EnbOutput)
 
#define MDIO_WRITE1   (MDIO_DataOut | MDIO_EnbOutput)
 
#define MII_DAVICOM_DM9101   0x0181b800
 
#define RXTX_TIMEOUT   2000
 

Enumerations

enum  chip_capability_flags {
  CanHaveMII =1, CanHaveMII =1, HasBrokenTx =2, AlwaysFDX =4,
  FDXOnNoMII =8, HAS_MII_XCVR, HAS_CHIP_XCVR, MII_PWRDWN =1,
  TYPE2_INTR =2, NO_MII =4
}
 
enum  { netdev_res_size = 128 }
 
enum  w840_offsets {
  PCIBusCfg =0x00, TxStartDemand =0x04, RxStartDemand =0x08, RxRingPtr =0x0C,
  TxRingPtr =0x10, IntrStatus =0x14, NetworkConfig =0x18, IntrEnable =0x1C,
  RxMissed =0x20, EECtrl =0x24, MIICtrl =0x24, BootRom =0x28,
  GPTimer =0x2C, CurRxDescAddr =0x30, CurRxBufAddr =0x34, MulticastFilter0 =0x38,
  MulticastFilter1 =0x3C, StationAddr =0x40, CurTxDescAddr =0x4C, CurTxBufAddr =0x50
}
 
enum  rx_mode_bits {
  AcceptBroadcast =0x04, AcceptAllMulticast =0x02, AcceptAll =0x01, AcceptMulticast =0x10,
  PerfectFilter =0x40, HashFilter =0x30, PerfectFilterVlan =0x80, MinVLANPrio =0xE000,
  VlanMode =0x0200, WakeupOnGFP =0x0800, AcceptErr =0x80, RxAcceptBroadcast =0x20,
  AcceptMulticast =0x10, RxAcceptAllPhys =0x08, AcceptMyPhys =0x02, AcceptAllIPMulti =0x20,
  AcceptMultiHash =0x10, AcceptAll =0x08, AcceptBroadcast =0x04, AcceptMulticast =0x02,
  AcceptMyPhys =0x01, CR_W_ENH = 0x02000000, CR_W_FD = 0x00100000, CR_W_PS10 = 0x00080000,
  CR_W_TXEN = 0x00040000, CR_W_PS1000 = 0x00010000, CR_W_RXMODEMASK = 0x000000e0, CR_W_PROM = 0x00000080,
  CR_W_AB = 0x00000040, CR_W_AM = 0x00000020, CR_W_ARP = 0x00000008, CR_W_ALP = 0x00000004,
  CR_W_SEP = 0x00000002, CR_W_RXEN = 0x00000001, CR_R_TXSTOP = 0x04000000, CR_R_FD = 0x00100000,
  CR_R_PS10 = 0x00080000, CR_R_RXSTOP = 0x00008000, AcceptErr = 0x20, AcceptRunt = 0x10,
  AcceptBroadcast = 0x08, AcceptMulticast = 0x04, AcceptMyPhys = 0x02, AcceptAllPhys = 0x01
}
 
enum  mii_reg_bits {
  MDIO_ShiftClk =0x10000, MDIO_DataIn =0x80000, MDIO_DataOut =0x20000, MDIO_EnbOutput =0x40000,
  MDIO_EnbIn = 0x00000, MDIO_ShiftClk =0x0001, MDIO_Data =0x0002, MDIO_EnbOutput =0x0004
}
 
enum  EEPROM_Ctrl_Bits {
  EE_ShiftClk =0x02, EE_Write0 =0x801, EE_Write1 =0x805, EE_ChipSelect =0x801,
  EE_DataIn =0x08
}
 
enum  EEPROM_Cmds {
  EE_WriteCmd =(5 << 6), EE_ReadCmd =(6 << 6), EE_EraseCmd =(7 << 6), EE_WriteCmd =(5 << 6),
  EE_ReadCmd =(6 << 6), EE_EraseCmd =(7 << 6)
}
 

Functions

 MODULE_AUTHOR ("Donald Becker <[email protected]>")
 
 MODULE_DESCRIPTION ("Winbond W89c840 Ethernet driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (DRV_VERSION)
 
 module_param (max_interrupt_work, int, 0)
 
 module_param (debug, int, 0)
 
 module_param (rx_copybreak, int, 0)
 
 module_param (multicast_filter_limit, int, 0)
 
 module_param_array (options, int, NULL, 0)
 
 module_param_array (full_duplex, int, NULL, 0)
 
 MODULE_PARM_DESC (max_interrupt_work,"winbond-840 maximum events handled per interrupt")
 
 MODULE_PARM_DESC (debug,"winbond-840 debug level (0-6)")
 
 MODULE_PARM_DESC (rx_copybreak,"winbond-840 copy breakpoint for copy-only-tiny-frames")
 
 MODULE_PARM_DESC (multicast_filter_limit,"winbond-840 maximum number of filtered multicast addresses")
 
 MODULE_PARM_DESC (options,"winbond-840: Bits 0-3: media type, bit 17: full duplex")
 
 MODULE_PARM_DESC (full_duplex,"winbond-840 full duplex setting(s) (1)")
 
 MODULE_DEVICE_TABLE (pci, w840_pci_tbl)
 
 module_init (w840_init)
 
 module_exit (w840_exit)
 

Macro Definition Documentation

#define DRV_NAME   "winbond-840"

Definition at line 49 of file winbond-840.c.

#define DRV_RELDATE   "Sep-11-2006"

Definition at line 51 of file winbond-840.c.

#define DRV_VERSION   "1.01-e"

Definition at line 50 of file winbond-840.c.

#define eeprom_delay (   ee_addr)    ioread32(ee_addr)

Definition at line 493 of file winbond-840.c.

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

Definition at line 84 of file winbond-840.c.

#define mdio_delay (   mdio_addr)    ioread32(mdio_addr)

Definition at line 544 of file winbond-840.c.

#define MDIO_WRITE0   (MDIO_EnbOutput)

Definition at line 551 of file winbond-840.c.

#define MDIO_WRITE1   (MDIO_DataOut | MDIO_EnbOutput)

Definition at line 552 of file winbond-840.c.

#define MII_CNT   1 /* winbond only supports one MII */

Definition at line 293 of file winbond-840.c.

#define MII_DAVICOM_DM9101   0x0181b800

Definition at line 672 of file winbond-840.c.

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

Definition at line 140 of file winbond-840.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 47 of file winbond-840.c.

#define RXTX_TIMEOUT   2000

Definition at line 739 of file winbond-840.c.

#define TX_BUFLIMIT   (1024-128)

Definition at line 98 of file winbond-840.c.

#define TX_BUG_FIFO_LIMIT   (TX_FIFO_SIZE-1514-16)

Definition at line 105 of file winbond-840.c.

#define TX_FIFO_SIZE   (2048)

Definition at line 104 of file winbond-840.c.

#define TX_QUEUE_LEN   10 /* Limit ring entries actually used. */

Definition at line 95 of file winbond-840.c.

#define TX_QUEUE_LEN_RESTART   5

Definition at line 96 of file winbond-840.c.

#define TX_TIMEOUT   (2*HZ)

Definition at line 110 of file winbond-840.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
netdev_res_size 

Definition at line 230 of file winbond-840.c.

Enumerator:
CanHaveMII 
CanHaveMII 
HasBrokenTx 
AlwaysFDX 
FDXOnNoMII 
HAS_MII_XCVR 
HAS_CHIP_XCVR 
MII_PWRDWN 
TYPE2_INTR 
NO_MII 

Definition at line 218 of file winbond-840.c.

Enumerator:
EE_WriteCmd 
EE_ReadCmd 
EE_EraseCmd 
EE_WriteCmd 
EE_ReadCmd 
EE_EraseCmd 

Definition at line 501 of file winbond-840.c.

Enumerator:
EE_ShiftClk 
EE_Write0 
EE_Write1 
EE_ChipSelect 
EE_DataIn 

Definition at line 495 of file winbond-840.c.

Enumerator:
MDIO_ShiftClk 
MDIO_DataIn 
MDIO_DataOut 
MDIO_EnbOutput 
MDIO_EnbIn 
MDIO_ShiftClk 
MDIO_Data 
MDIO_EnbOutput 

Definition at line 274 of file winbond-840.c.

Enumerator:
AcceptBroadcast 
AcceptAllMulticast 
AcceptAll 
AcceptMulticast 
PerfectFilter 
HashFilter 
PerfectFilterVlan 
MinVLANPrio 
VlanMode 
WakeupOnGFP 
AcceptErr 
RxAcceptBroadcast 
AcceptMulticast 
RxAcceptAllPhys 
AcceptMyPhys 
AcceptAllIPMulti 
AcceptMultiHash 
AcceptAll 
AcceptBroadcast 
AcceptMulticast 
AcceptMyPhys 
CR_W_ENH 
CR_W_FD 
CR_W_PS10 
CR_W_TXEN 
CR_W_PS1000 
CR_W_RXMODEMASK 
CR_W_PROM 
CR_W_AB 
CR_W_AM 
CR_W_ARP 
CR_W_ALP 
CR_W_SEP 
CR_W_RXEN 
CR_R_TXSTOP 
CR_R_FD 
CR_R_PS10 
CR_R_RXSTOP 
AcceptErr 
AcceptRunt 
AcceptBroadcast 
AcceptMulticast 
AcceptMyPhys 
AcceptAllPhys 

Definition at line 268 of file winbond-840.c.

Enumerator:
PCIBusCfg 
TxStartDemand 
RxStartDemand 
RxRingPtr 
TxRingPtr 
IntrStatus 
NetworkConfig 
IntrEnable 
RxMissed 
EECtrl 
MIICtrl 
BootRom 
GPTimer 
CurRxDescAddr 
CurRxBufAddr 
MulticastFilter0 
MulticastFilter1 
StationAddr 
CurTxDescAddr 
CurTxBufAddr 

Definition at line 257 of file winbond-840.c.

Function Documentation

MODULE_AUTHOR ( "Donald Becker <[email protected]>"  )
MODULE_DESCRIPTION ( "Winbond W89c840 Ethernet driver )
MODULE_DEVICE_TABLE ( pci  ,
w840_pci_tbl   
)
module_exit ( w840_exit  )
module_init ( w840_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( max_interrupt_work  ,
int  ,
 
)
module_param ( debug  ,
int  ,
 
)
module_param ( rx_copybreak  ,
int  ,
 
)
module_param ( multicast_filter_limit  ,
int  ,
 
)
module_param_array ( options  ,
int  ,
NULL  ,
 
)
module_param_array ( full_duplex  ,
int  ,
NULL  ,
 
)
MODULE_PARM_DESC ( max_interrupt_work  ,
"winbond-840 maximum events handled per interrupt  
)
MODULE_PARM_DESC ( debug  ,
"winbond-840 debug level (0-6)"   
)
MODULE_PARM_DESC ( rx_copybreak  ,
"winbond-840 copy breakpoint for copy-only-tiny-frames"   
)
MODULE_PARM_DESC ( multicast_filter_limit  ,
"winbond-840 maximum number of filtered multicast addresses"   
)
MODULE_PARM_DESC ( options  ,
"winbond-840: Bits 0-3: media  type,
bit 17:full duplex  
)
MODULE_PARM_DESC ( full_duplex  ,
"winbond-840 full duplex setting(s) (1)"   
)
MODULE_VERSION ( DRV_VERSION  )