Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
pcnet32.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
#include <linux/crc32.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/if_ether.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/moduleparam.h>
#include <linux/bitops.h>
#include <linux/io.h>
#include <linux/uaccess.h>
#include <asm/dma.h>
#include <asm/irq.h>

Go to the source code of this file.

Data Structures

struct  pcnet32_rx_head
 
struct  pcnet32_tx_head
 
struct  pcnet32_init_block
 
struct  pcnet32_access
 
struct  pcnet32_private
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRV_NAME   "pcnet32"
 
#define DRV_VERSION   "1.35"
 
#define DRV_RELDATE   "21.Apr.2008"
 
#define PFX   DRV_NAME ": "
 
#define PCNET32_PORT_AUI   0x00
 
#define PCNET32_PORT_10BT   0x01
 
#define PCNET32_PORT_GPSI   0x02
 
#define PCNET32_PORT_MII   0x03
 
#define PCNET32_PORT_PORTSEL   0x03
 
#define PCNET32_PORT_ASEL   0x04
 
#define PCNET32_PORT_100   0x40
 
#define PCNET32_PORT_FD   0x80
 
#define PCNET32_DMA_MASK   0xffffffff
 
#define PCNET32_WATCHDOG_TIMEOUT   (jiffies + (2 * HZ))
 
#define PCNET32_BLINK_TIMEOUT   (jiffies + (HZ/4))
 
#define PCNET32_TEST_LEN   ARRAY_SIZE(pcnet32_gstrings_test)
 
#define PCNET32_NUM_REGS   136
 
#define MAX_UNITS   8 /* More are supported, limit only on options */
 
#define PCNET32_LOG_TX_BUFFERS   4
 
#define PCNET32_LOG_RX_BUFFERS   5
 
#define PCNET32_LOG_MAX_TX_BUFFERS   9 /* 2^9 == 512 */
 
#define PCNET32_LOG_MAX_RX_BUFFERS   9
 
#define TX_RING_SIZE   (1 << (PCNET32_LOG_TX_BUFFERS))
 
#define TX_MAX_RING_SIZE   (1 << (PCNET32_LOG_MAX_TX_BUFFERS))
 
#define RX_RING_SIZE   (1 << (PCNET32_LOG_RX_BUFFERS))
 
#define RX_MAX_RING_SIZE   (1 << (PCNET32_LOG_MAX_RX_BUFFERS))
 
#define PKT_BUF_SKB   1544
 
#define PKT_BUF_SIZE   (PKT_BUF_SKB - NET_IP_ALIGN)
 
#define NEG_BUF_SIZE   (NET_IP_ALIGN - PKT_BUF_SKB)
 
#define PCNET32_WIO_RDP   0x10
 
#define PCNET32_WIO_RAP   0x12
 
#define PCNET32_WIO_RESET   0x14
 
#define PCNET32_WIO_BDP   0x16
 
#define PCNET32_DWIO_RDP   0x10
 
#define PCNET32_DWIO_RAP   0x14
 
#define PCNET32_DWIO_RESET   0x18
 
#define PCNET32_DWIO_BDP   0x1C
 
#define PCNET32_TOTAL_SIZE   0x20
 
#define CSR0   0
 
#define CSR0_INIT   0x1
 
#define CSR0_START   0x2
 
#define CSR0_STOP   0x4
 
#define CSR0_TXPOLL   0x8
 
#define CSR0_INTEN   0x40
 
#define CSR0_IDON   0x0100
 
#define CSR0_NORMAL   (CSR0_START | CSR0_INTEN)
 
#define PCNET32_INIT_LOW   1
 
#define PCNET32_INIT_HIGH   2
 
#define CSR3   3
 
#define CSR4   4
 
#define CSR5   5
 
#define CSR5_SUSPEND   0x0001
 
#define CSR15   15
 
#define PCNET32_MC_FILTER   8
 
#define PCNET32_79C970A   0x2621
 
#define PCNET32_REGS_PER_PHY   32
 
#define PCNET32_MAX_PHYS   32
 
#define PCNET32_MSG_DEFAULT   (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)
 

Functions

 MODULE_DEVICE_TABLE (pci, pcnet32_pci_tbl)
 
 module_param (debug, int, 0)
 
 MODULE_PARM_DESC (debug, DRV_NAME" debug level")
 
 module_param (max_interrupt_work, int, 0)
 
 MODULE_PARM_DESC (max_interrupt_work, DRV_NAME" maximum events handled per interrupt")
 
 module_param (rx_copybreak, int, 0)
 
 MODULE_PARM_DESC (rx_copybreak, DRV_NAME" copy breakpoint for copy-only-tiny-frames")
 
 module_param (tx_start_pt, int, 0)
 
 MODULE_PARM_DESC (tx_start_pt, DRV_NAME" transmit start point (0-3)")
 
 module_param (pcnet32vlb, int, 0)
 
 MODULE_PARM_DESC (pcnet32vlb, DRV_NAME" Vesa local bus (VLB) support (0/1)")
 
 module_param_array (options, int, NULL, 0)
 
 MODULE_PARM_DESC (options, DRV_NAME" initial option setting(s) (0-15)")
 
 module_param_array (full_duplex, int, NULL, 0)
 
 MODULE_PARM_DESC (full_duplex, DRV_NAME" full duplex setting(s) (1)")
 
 module_param_array (homepna, int, NULL, 0)
 
 MODULE_PARM_DESC (homepna, DRV_NAME" mode for 79C978 cards (1 for HomePNA, 0 for Ethernet, default Ethernet")
 
 MODULE_AUTHOR ("Thomas Bogendoerfer")
 
 MODULE_DESCRIPTION ("Driver for PCnet32 and PCnetPCI based ethercards")
 
 MODULE_LICENSE ("GPL")
 
 module_init (pcnet32_init_module)
 
 module_exit (pcnet32_cleanup_module)
 

Macro Definition Documentation

#define CSR0   0

Definition at line 196 of file pcnet32.c.

#define CSR0_IDON   0x0100

Definition at line 202 of file pcnet32.c.

#define CSR0_INIT   0x1

Definition at line 197 of file pcnet32.c.

#define CSR0_INTEN   0x40

Definition at line 201 of file pcnet32.c.

#define CSR0_NORMAL   (CSR0_START | CSR0_INTEN)

Definition at line 203 of file pcnet32.c.

#define CSR0_START   0x2

Definition at line 198 of file pcnet32.c.

#define CSR0_STOP   0x4

Definition at line 199 of file pcnet32.c.

#define CSR0_TXPOLL   0x8

Definition at line 200 of file pcnet32.c.

#define CSR15   15

Definition at line 210 of file pcnet32.c.

#define CSR3   3

Definition at line 206 of file pcnet32.c.

#define CSR4   4

Definition at line 207 of file pcnet32.c.

#define CSR5   5

Definition at line 208 of file pcnet32.c.

#define CSR5_SUSPEND   0x0001

Definition at line 209 of file pcnet32.c.

#define DRV_NAME   "pcnet32"

Definition at line 26 of file pcnet32.c.

#define DRV_RELDATE   "21.Apr.2008"

Definition at line 28 of file pcnet32.c.

#define DRV_VERSION   "1.35"

Definition at line 27 of file pcnet32.c.

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

Definition at line 144 of file pcnet32.c.

#define NEG_BUF_SIZE   (NET_IP_ALIGN - PKT_BUF_SKB)

Definition at line 181 of file pcnet32.c.

#define PCNET32_79C970A   0x2621

Definition at line 213 of file pcnet32.c.

#define PCNET32_BLINK_TIMEOUT   (jiffies + (HZ/4))

Definition at line 110 of file pcnet32.c.

#define PCNET32_DMA_MASK   0xffffffff

Definition at line 107 of file pcnet32.c.

#define PCNET32_DWIO_BDP   0x1C

Definition at line 192 of file pcnet32.c.

#define PCNET32_DWIO_RAP   0x14

Definition at line 190 of file pcnet32.c.

#define PCNET32_DWIO_RDP   0x10

Definition at line 189 of file pcnet32.c.

#define PCNET32_DWIO_RESET   0x18

Definition at line 191 of file pcnet32.c.

#define PCNET32_INIT_HIGH   2

Definition at line 205 of file pcnet32.c.

#define PCNET32_INIT_LOW   1

Definition at line 204 of file pcnet32.c.

#define PCNET32_LOG_MAX_RX_BUFFERS   9

Definition at line 168 of file pcnet32.c.

#define PCNET32_LOG_MAX_TX_BUFFERS   9 /* 2^9 == 512 */

Definition at line 167 of file pcnet32.c.

#define PCNET32_LOG_RX_BUFFERS   5

Definition at line 166 of file pcnet32.c.

#define PCNET32_LOG_TX_BUFFERS   4

Definition at line 165 of file pcnet32.c.

#define PCNET32_MAX_PHYS   32

Definition at line 1355 of file pcnet32.c.

#define PCNET32_MC_FILTER   8

Definition at line 211 of file pcnet32.c.

#define PCNET32_MSG_DEFAULT   (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)

Definition at line 2884 of file pcnet32.c.

#define PCNET32_NUM_REGS   136

Definition at line 142 of file pcnet32.c.

#define PCNET32_PORT_100   0x40

Definition at line 104 of file pcnet32.c.

#define PCNET32_PORT_10BT   0x01

Definition at line 98 of file pcnet32.c.

#define PCNET32_PORT_ASEL   0x04

Definition at line 103 of file pcnet32.c.

#define PCNET32_PORT_AUI   0x00

Definition at line 97 of file pcnet32.c.

#define PCNET32_PORT_FD   0x80

Definition at line 105 of file pcnet32.c.

#define PCNET32_PORT_GPSI   0x02

Definition at line 99 of file pcnet32.c.

#define PCNET32_PORT_MII   0x03

Definition at line 100 of file pcnet32.c.

#define PCNET32_PORT_PORTSEL   0x03

Definition at line 102 of file pcnet32.c.

#define PCNET32_REGS_PER_PHY   32

Definition at line 1354 of file pcnet32.c.

#define PCNET32_TEST_LEN   ARRAY_SIZE(pcnet32_gstrings_test)

Definition at line 140 of file pcnet32.c.

#define PCNET32_TOTAL_SIZE   0x20

Definition at line 194 of file pcnet32.c.

#define PCNET32_WATCHDOG_TIMEOUT   (jiffies + (2 * HZ))

Definition at line 109 of file pcnet32.c.

#define PCNET32_WIO_BDP   0x16

Definition at line 187 of file pcnet32.c.

#define PCNET32_WIO_RAP   0x12

Definition at line 185 of file pcnet32.c.

#define PCNET32_WIO_RDP   0x10

Definition at line 184 of file pcnet32.c.

#define PCNET32_WIO_RESET   0x14

Definition at line 186 of file pcnet32.c.

#define PFX   DRV_NAME ": "

Definition at line 29 of file pcnet32.c.

#define PKT_BUF_SIZE   (PKT_BUF_SKB - NET_IP_ALIGN)

Definition at line 179 of file pcnet32.c.

#define PKT_BUF_SKB   1544

Definition at line 177 of file pcnet32.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 24 of file pcnet32.c.

#define RX_MAX_RING_SIZE   (1 << (PCNET32_LOG_MAX_RX_BUFFERS))

Definition at line 175 of file pcnet32.c.

#define RX_RING_SIZE   (1 << (PCNET32_LOG_RX_BUFFERS))

Definition at line 174 of file pcnet32.c.

#define TX_MAX_RING_SIZE   (1 << (PCNET32_LOG_MAX_TX_BUFFERS))

Definition at line 172 of file pcnet32.c.

#define TX_RING_SIZE   (1 << (PCNET32_LOG_TX_BUFFERS))

Definition at line 171 of file pcnet32.c.

Function Documentation

MODULE_AUTHOR ( "Thomas Bogendoerfer"  )
MODULE_DESCRIPTION ( "Driver for PCnet32 and PCnetPCI based ethercards"  )
MODULE_DEVICE_TABLE ( pci  ,
pcnet32_pci_tbl   
)
module_exit ( pcnet32_cleanup_module  )
module_init ( pcnet32_init_module  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
 
)
module_param ( max_interrupt_work  ,
int  ,
 
)
module_param ( rx_copybreak  ,
int  ,
 
)
module_param ( tx_start_pt  ,
int  ,
 
)
module_param ( pcnet32vlb  ,
int  ,
 
)
module_param_array ( options  ,
int  ,
NULL  ,
 
)
module_param_array ( full_duplex  ,
int  ,
NULL  ,
 
)
module_param_array ( homepna  ,
int  ,
NULL  ,
 
)
MODULE_PARM_DESC ( debug  ,
DRV_NAME" debug level  
)
MODULE_PARM_DESC ( max_interrupt_work  ,
DRV_NAME" maximum events handled per interrupt  
)
MODULE_PARM_DESC ( rx_copybreak  ,
DRV_NAME" copy breakpoint for copy-only-tiny-frames"   
)
MODULE_PARM_DESC ( tx_start_pt  ,
DRV_NAME" transmit start point (0-3)"   
)
MODULE_PARM_DESC ( pcnet32vlb  ,
DRV_NAME" Vesa local bus (VLB) support (0/1)"   
)
MODULE_PARM_DESC ( options  ,
DRV_NAME" initial option setting(s) (0-15)"   
)
MODULE_PARM_DESC ( full_duplex  ,
DRV_NAME" full duplex setting(s) (1)"   
)
MODULE_PARM_DESC ( homepna  )