Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
et131x.c File Reference
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/ptrace.h>
#include <linux/slab.h>
#include <linux/ctype.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <linux/in.h>
#include <linux/delay.h>
#include <linux/bitops.h>
#include <linux/io.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/ioport.h>
#include <linux/crc32.h>
#include <linux/random.h>
#include <linux/phy.h>
#include "et131x.h"

Go to the source code of this file.

Data Structures

struct  fbr_desc
 
struct  pkt_stat_desc
 
struct  rx_status_block
 
struct  fbr_lookup
 
struct  rx_ring
 
struct  tx_desc
 
struct  tcb
 
struct  tx_ring
 
struct  rfd
 
struct  ce_stats
 
struct  et131x_adapter
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define MAX_NUM_REGISTER_POLLS   1000
 
#define MAX_NUM_WRITE_RETRIES   2
 
#define COUNTER_WRAP_16_BIT   0x10000
 
#define COUNTER_WRAP_12_BIT   0x1000
 
#define INTERNAL_MEM_SIZE   0x400 /* 1024 of internal memory */
 
#define INTERNAL_MEM_RX_OFFSET   0x1FF /* 50% Tx, 50% Rx */
 
#define INT_MASK_DISABLE   0xffffffff
 
#define INT_MASK_ENABLE   0xfffebf17
 
#define INT_MASK_ENABLE_NO_FLOW   0xfffebfd7
 
#define NIC_MIN_PACKET_SIZE   60
 
#define NIC_MAX_MCAST_LIST   128
 
#define ET131X_PACKET_TYPE_DIRECTED   0x0001
 
#define ET131X_PACKET_TYPE_MULTICAST   0x0002
 
#define ET131X_PACKET_TYPE_BROADCAST   0x0004
 
#define ET131X_PACKET_TYPE_PROMISCUOUS   0x0008
 
#define ET131X_PACKET_TYPE_ALL_MULTICAST   0x0010
 
#define ET131X_TX_TIMEOUT   (1 * HZ)
 
#define NIC_SEND_HANG_THRESHOLD   0
 
#define fMP_DEST_MULTI   0x00000001
 
#define fMP_DEST_BROAD   0x00000002
 
#define fMP_ADAPTER_RECV_LOOKASIDE   0x00000004
 
#define fMP_ADAPTER_INTERRUPT_IN_USE   0x00000008
 
#define fMP_ADAPTER_LOWER_POWER   0x00200000
 
#define fMP_ADAPTER_NON_RECOVER_ERROR   0x00800000
 
#define fMP_ADAPTER_HARDWARE_ERROR   0x04000000
 
#define fMP_ADAPTER_FAIL_SEND_MASK   0x3ff00000
 
#define ET1310_PCI_MAC_ADDRESS   0xA4
 
#define ET1310_PCI_EEPROM_STATUS   0xB2
 
#define ET1310_PCI_ACK_NACK   0xC0
 
#define ET1310_PCI_REPLAY   0xC2
 
#define ET1310_PCI_L0L1LATENCY   0xCF
 
#define ET131X_PCI_DEVICE_ID_GIG   0xED00 /* ET1310 1000 Base-T 8 */
 
#define ET131X_PCI_DEVICE_ID_FAST   0xED01 /* ET1310 100 Base-T */
 
#define NANO_IN_A_MICRO   1000
 
#define PARM_RX_NUM_BUFS_DEF   4
 
#define PARM_RX_TIME_INT_DEF   10
 
#define PARM_RX_MEM_END_DEF   0x2bc
 
#define PARM_TX_TIME_INT_DEF   40
 
#define PARM_TX_NUM_BUFS_DEF   4
 
#define PARM_DMA_CACHE_DEF   0
 
#define USE_FBR0   1
 
#define FBR_CHUNKS   32
 
#define MAX_DESC_PER_RING_RX   1024
 
#define RFD_LOW_WATER_MARK   40
 
#define NIC_DEFAULT_NUM_RFD   1024
 
#define NUM_FBRS   2
 
#define NIC_MIN_NUM_RFD   64
 
#define NUM_PACKETS_HANDLED   256
 
#define ALCATEL_MULTICAST_PKT   0x01000000
 
#define ALCATEL_BROADCAST_PKT   0x02000000
 
#define NUM_DESC_PER_RING_TX   512 /* TX Do not change these values */
 
#define NUM_TCB   64
 
#define TX_ERROR_PERIOD   1000
 
#define LO_MARK_PERCENT_FOR_PSR   15
 
#define LO_MARK_PERCENT_FOR_RX   15
 
#define FLOW_BOTH   0
 
#define FLOW_TXONLY   1
 
#define FLOW_RXONLY   2
 
#define FLOW_NONE   3
 
#define ET131X_REGS_LEN   256
 
#define ET131X_DRVINFO_LEN   32 /* value from ethtool.h */
 
#define ET131X_PM_OPS   NULL
 

Functions

 MODULE_AUTHOR ("Victor Soriano <[email protected]>")
 
 MODULE_AUTHOR ("Mark Einon <[email protected]>")
 
 MODULE_LICENSE ("Dual BSD/GPL")
 
 MODULE_DESCRIPTION ("10/100/1000 Base-T Ethernet Driver for the ET1310 by Agere Systems")
 
irqreturn_t et131x_isr (int irq, void *dev_id)
 
 MODULE_DEVICE_TABLE (pci, et131x_pci_table)
 
 module_pci_driver (et131x_driver)
 

Macro Definition Documentation

#define ALCATEL_BROADCAST_PKT   0x02000000

Definition at line 198 of file et131x.c.

#define ALCATEL_MULTICAST_PKT   0x01000000

Definition at line 197 of file et131x.c.

#define COUNTER_WRAP_12_BIT   0x1000

Definition at line 98 of file et131x.c.

#define COUNTER_WRAP_16_BIT   0x10000

Definition at line 97 of file et131x.c.

#define ET1310_PCI_ACK_NACK   0xC0

Definition at line 160 of file et131x.c.

#define ET1310_PCI_EEPROM_STATUS   0xB2

Definition at line 159 of file et131x.c.

#define ET1310_PCI_L0L1LATENCY   0xCF

Definition at line 162 of file et131x.c.

#define ET1310_PCI_MAC_ADDRESS   0xA4

Definition at line 158 of file et131x.c.

#define ET1310_PCI_REPLAY   0xC2

Definition at line 161 of file et131x.c.

#define ET131X_DRVINFO_LEN   32 /* value from ethtool.h */

Definition at line 3929 of file et131x.c.

#define ET131X_PACKET_TYPE_ALL_MULTICAST   0x0010

Definition at line 135 of file et131x.c.

#define ET131X_PACKET_TYPE_BROADCAST   0x0004

Definition at line 133 of file et131x.c.

#define ET131X_PACKET_TYPE_DIRECTED   0x0001

Definition at line 131 of file et131x.c.

#define ET131X_PACKET_TYPE_MULTICAST   0x0002

Definition at line 132 of file et131x.c.

#define ET131X_PACKET_TYPE_PROMISCUOUS   0x0008

Definition at line 134 of file et131x.c.

#define ET131X_PCI_DEVICE_ID_FAST   0xED01 /* ET1310 100 Base-T */

Definition at line 166 of file et131x.c.

#define ET131X_PCI_DEVICE_ID_GIG   0xED00 /* ET1310 1000 Base-T 8 */

Definition at line 165 of file et131x.c.

#define ET131X_PM_OPS   NULL

Definition at line 4440 of file et131x.c.

#define ET131X_REGS_LEN   256
#define ET131X_TX_TIMEOUT   (1 * HZ)

Definition at line 138 of file et131x.c.

#define FBR_CHUNKS   32

Definition at line 180 of file et131x.c.

#define FLOW_BOTH   0

Definition at line 453 of file et131x.c.

#define FLOW_NONE   3

Definition at line 456 of file et131x.c.

#define FLOW_RXONLY   2

Definition at line 455 of file et131x.c.

#define FLOW_TXONLY   1

Definition at line 454 of file et131x.c.

#define fMP_ADAPTER_FAIL_SEND_MASK   0x3ff00000

Definition at line 155 of file et131x.c.

#define fMP_ADAPTER_HARDWARE_ERROR   0x04000000

Definition at line 153 of file et131x.c.

#define fMP_ADAPTER_INTERRUPT_IN_USE   0x00000008

Definition at line 147 of file et131x.c.

#define fMP_ADAPTER_LOWER_POWER   0x00200000

Definition at line 150 of file et131x.c.

#define fMP_ADAPTER_NON_RECOVER_ERROR   0x00800000

Definition at line 152 of file et131x.c.

#define fMP_ADAPTER_RECV_LOOKASIDE   0x00000004

Definition at line 146 of file et131x.c.

#define fMP_DEST_BROAD   0x00000002

Definition at line 143 of file et131x.c.

#define fMP_DEST_MULTI   0x00000001

Definition at line 142 of file et131x.c.

#define INT_MASK_DISABLE   0xffffffff

Definition at line 114 of file et131x.c.

#define INT_MASK_ENABLE   0xfffebf17

Definition at line 120 of file et131x.c.

#define INT_MASK_ENABLE_NO_FLOW   0xfffebfd7

Definition at line 121 of file et131x.c.

#define INTERNAL_MEM_RX_OFFSET   0x1FF /* 50% Tx, 50% Rx */

Definition at line 102 of file et131x.c.

#define INTERNAL_MEM_SIZE   0x400 /* 1024 of internal memory */

Definition at line 101 of file et131x.c.

#define LO_MARK_PERCENT_FOR_PSR   15

Definition at line 440 of file et131x.c.

#define LO_MARK_PERCENT_FOR_RX   15

Definition at line 441 of file et131x.c.

#define MAX_DESC_PER_RING_RX   1024

Definition at line 181 of file et131x.c.

#define MAX_NUM_REGISTER_POLLS   1000

Definition at line 93 of file et131x.c.

#define MAX_NUM_WRITE_RETRIES   2

Definition at line 94 of file et131x.c.

#define NANO_IN_A_MICRO   1000

Definition at line 169 of file et131x.c.

#define NIC_DEFAULT_NUM_RFD   1024

Definition at line 186 of file et131x.c.

#define NIC_MAX_MCAST_LIST   128

Definition at line 128 of file et131x.c.

#define NIC_MIN_NUM_RFD   64

Definition at line 194 of file et131x.c.

#define NIC_MIN_PACKET_SIZE   60

Definition at line 125 of file et131x.c.

#define NIC_SEND_HANG_THRESHOLD   0

Definition at line 139 of file et131x.c.

#define NUM_DESC_PER_RING_TX   512 /* TX Do not change these values */

Definition at line 430 of file et131x.c.

#define NUM_FBRS   2

Definition at line 187 of file et131x.c.

#define NUM_PACKETS_HANDLED   256

Definition at line 195 of file et131x.c.

#define NUM_TCB   64

Definition at line 431 of file et131x.c.

#define PARM_DMA_CACHE_DEF   0

Definition at line 176 of file et131x.c.

#define PARM_RX_MEM_END_DEF   0x2bc

Definition at line 173 of file et131x.c.

#define PARM_RX_NUM_BUFS_DEF   4

Definition at line 171 of file et131x.c.

#define PARM_RX_TIME_INT_DEF   10

Definition at line 172 of file et131x.c.

#define PARM_TX_NUM_BUFS_DEF   4

Definition at line 175 of file et131x.c.

#define PARM_TX_TIME_INT_DEF   40

Definition at line 174 of file et131x.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 56 of file et131x.c.

#define RFD_LOW_WATER_MARK   40

Definition at line 185 of file et131x.c.

#define TX_ERROR_PERIOD   1000

Definition at line 438 of file et131x.c.

#define USE_FBR0   1

Definition at line 179 of file et131x.c.

Function Documentation

irqreturn_t et131x_isr ( int  irq,
void dev_id 
)

et131x_isr - The Interrupt Service Routine for the driver. : the IRQ on which the interrupt was received. : device-specific info (here a pointer to a net_device struct)

Returns a value indicating if the interrupt was handled.

Definition at line 4450 of file et131x.c.

MODULE_AUTHOR ( "Victor Soriano <[email protected]>"  )
MODULE_AUTHOR ( "Mark Einon <[email protected]>"  )
MODULE_DESCRIPTION ( "10/100/1000 Base-T Ethernet Driver for the ET1310 by Agere Systems"  )
MODULE_DEVICE_TABLE ( pci  ,
et131x_pci_table   
)
MODULE_LICENSE ( "Dual BSD/GPL"  )
module_pci_driver ( et131x_driver  )