Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
e100.c File Reference
#include <linux/hardirq.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/mii.h>
#include <linux/if_vlan.h>
#include <linux/skbuff.h>
#include <linux/ethtool.h>
#include <linux/string.h>
#include <linux/firmware.h>
#include <linux/rtnetlink.h>
#include <asm/unaligned.h>

Go to the source code of this file.

Data Structures

struct  csr
 
struct  rfd
 
struct  rx
 
struct  config
 
struct  multi
 
struct  cb
 
struct  stats
 
struct  mem
 
struct  param_range
 
struct  params
 
struct  nic
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRV_NAME   "e100"
 
#define DRV_EXT   "-NAPI"
 
#define DRV_VERSION   "3.5.24-k2"DRV_EXT
 
#define DRV_DESCRIPTION   "Intel(R) PRO/100 Network Driver"
 
#define DRV_COPYRIGHT   "Copyright(c) 1999-2006 Intel Corporation"
 
#define E100_WATCHDOG_PERIOD   (2 * HZ)
 
#define E100_NAPI_WEIGHT   16
 
#define FIRMWARE_D101M   "e100/d101m_ucode.bin"
 
#define FIRMWARE_D101S   "e100/d101s_ucode.bin"
 
#define FIRMWARE_D102E   "e100/d102e_ucode.bin"
 
#define INTEL_8255X_ETHERNET_DEVICE(device_id, ich)
 
#define X(a, b)   a,b
 
#define E100_MAX_MULTICAST_ADDRS   64
 
#define UCODE_SIZE   134
 
#define E100_WAIT_SCB_TIMEOUT   20000 /* we might have to wait 100ms!!! */
 
#define E100_WAIT_SCB_FAST   20 /* delay like the old code */
 
#define BUNDLESMALL   1
 
#define BUNDLEMAX   (u16)6
 
#define INTDELAY   (u16)1536 /* 0x600 */
 
#define NCONFIG_AUTO_SWITCH   0x0080
 
#define MII_NSC_CONG   MII_RESV1
 
#define NSC_CONG_ENABLE   0x0100
 
#define NSC_CONG_TXREADY   0x0400
 
#define ADVERTISE_FC_SUPPORTED   0x0400
 
#define NCS_PHY_MODEL_MASK   0xFFF0FFFF
 
#define RFD_BUF_LEN   (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)
 
#define MII_LED_CONTROL   0x1B
 
#define E100_82552_LED_OVERRIDE   0x19
 
#define E100_82552_LED_ON   0x000F /* LEDTX and LED_RX both on */
 
#define E100_82552_LED_OFF   0x000A /* LEDTX and LED_RX both off */
 
#define E100_PHY_REGS   0x1C
 
#define E100_EEPROM_MAGIC   0x1234
 
#define E100_TEST_LEN   ARRAY_SIZE(e100_gstrings_test)
 
#define E100_NET_STATS_LEN   21
 
#define E100_STATS_LEN   ARRAY_SIZE(e100_gstrings_stats)
 
#define E100_82552_SMARTSPEED   0x14 /* SmartSpeed Ctrl register */
 
#define E100_82552_REV_ANEG   0x0200 /* Reverse auto-negotiation */
 
#define E100_82552_ANEG_NOW   0x0400 /* Auto-negotiate now */
 

Enumerations

enum  mac {
  mac_82557_D100_A = 0, mac_82557_D100_B = 1, mac_82557_D100_C = 2, mac_82558_D101_A4 = 4,
  mac_82558_D101_B0 = 5, mac_82559_D101M = 8, mac_82559_D101S = 9, mac_82550_D102 = 12,
  mac_82550_D102_C = 13, mac_82551_E = 14, mac_82551_F = 15, mac_82551_10 = 16,
  mac_unknown = 0xFF
}
 
enum  phy {
  phy_100a = 0x000003E0, phy_100c = 0x035002A8, phy_82555_tx = 0x015002A8, phy_nsc_tx = 0x5C002000,
  phy_82562_et = 0x033002A8, phy_82562_em = 0x032002A8, phy_82562_ek = 0x031002A8, phy_82562_eh = 0x017002A8,
  phy_82552_v = 0xd061004d, phy_unknown = 0xFFFFFFFF
}
 
enum  scb_status { rus_no_res = 0x08, rus_ready = 0x10, rus_mask = 0x3C }
 
enum  ru_state { RU_SUSPENDED = 0, RU_RUNNING = 1, RU_UNINITIALIZED = -1 }
 
enum  scb_stat_ack {
  stat_ack_not_ours = 0x00, stat_ack_sw_gen = 0x04, stat_ack_rnr = 0x10, stat_ack_cu_idle = 0x20,
  stat_ack_frame_rx = 0x40, stat_ack_cu_cmd_done = 0x80, stat_ack_not_present = 0xFF, stat_ack_rx = (stat_ack_sw_gen | stat_ack_rnr | stat_ack_frame_rx),
  stat_ack_tx = (stat_ack_cu_idle | stat_ack_cu_cmd_done)
}
 
enum  scb_cmd_hi { irq_mask_none = 0x00, irq_mask_all = 0x01, irq_sw_gen = 0x02 }
 
enum  scb_cmd_lo {
  cuc_nop = 0x00, ruc_start = 0x01, ruc_load_base = 0x06, cuc_start = 0x10,
  cuc_resume = 0x20, cuc_dump_addr = 0x40, cuc_dump_stats = 0x50, cuc_load_base = 0x60,
  cuc_dump_reset = 0x70
}
 
enum  cuc_dump { cuc_dump_complete = 0x0000A005, cuc_dump_reset_complete = 0x0000A007 }
 
enum  port {
  PORT_A = 0, PORT_B, PORT_C, PORT_D,
  PORT_E, I915_MAX_PORTS, CX25821_UNDEFINED = 0, CX25821_RAW,
  CX25821_264, software_reset = 0x0000, selftest = 0x0001, selective_reset = 0x0002
}
 
enum  eeprom_ctrl_lo { eesk = 0x01, eecs = 0x02, eedi = 0x04, eedo = 0x08 }
 
enum  mdi_ctrl { mdi_write = 0x04000000, mdi_read = 0x08000000, mdi_ready = 0x10000000 }
 
enum  eeprom_op { op_write = 0x05, op_read = 0x06, op_ewds = 0x10, op_ewen = 0x13 }
 
enum  eeprom_offsets {
  eeprom_cnfg_mdix = 0x03, eeprom_phy_iface = 0x06, eeprom_id = 0x0A, eeprom_config_asf = 0x0D,
  eeprom_smbus_addr = 0x90
}
 
enum  eeprom_cnfg_mdix { eeprom_mdix_enabled = 0x0080 }
 
enum  eeprom_phy_iface {
  NoSuchPhy = 0, I82553AB, I82553C, I82503,
  DP83840, S80C240, S80C24, I82555,
  DP83840A = 10
}
 
enum  eeprom_id { eeprom_id_wol = 0x0020 }
 
enum  eeprom_config_asf { eeprom_asf = 0x8000, eeprom_gcl = 0x4000 }
 
enum  cb_status { cb_complete = 0x8000, cb_ok = 0x2000 }
 
enum  cb_command {
  cb_nop = 0x0000, cb_iaaddr = 0x0001, cb_config = 0x0002, cb_multi = 0x0003,
  cb_tx = 0x0004, cb_ucode = 0x0005, cb_dump = 0x0006, cb_tx_sf = 0x0008,
  cb_tx_nc = 0x0010, cb_cid = 0x1f00, cb_i = 0x2000, cb_s = 0x4000,
  cb_el = 0x8000
}
 
enum  loopback { lb_none = 0, lb_mac = 1, lb_phy = 3 }
 

Functions

 MODULE_DESCRIPTION (DRV_DESCRIPTION)
 
 MODULE_AUTHOR (DRV_COPYRIGHT)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (DRV_VERSION)
 
 MODULE_FIRMWARE (FIRMWARE_D101M)
 
 MODULE_FIRMWARE (FIRMWARE_D101S)
 
 MODULE_FIRMWARE (FIRMWARE_D102E)
 
 module_param (debug, int, 0)
 
 module_param (eeprom_bad_csum_allow, int, 0)
 
 module_param (use_io, int, 0)
 
 MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)")
 
 MODULE_PARM_DESC (eeprom_bad_csum_allow,"Allow bad eeprom checksums")
 
 MODULE_PARM_DESC (use_io,"Force use of i/o access mode")
 
 MODULE_DEVICE_TABLE (pci, e100_id_table)
 
 module_init (e100_init_module)
 
 module_exit (e100_cleanup_module)
 

Macro Definition Documentation

#define ADVERTISE_FC_SUPPORTED   0x0400

Definition at line 1457 of file e100.c.

#define BUNDLEMAX   (u16)6

Definition at line 1242 of file e100.c.

#define BUNDLESMALL   1

Definition at line 1241 of file e100.c.

#define DRV_COPYRIGHT   "Copyright(c) 1999-2006 Intel Corporation"

Definition at line 181 of file e100.c.

#define DRV_DESCRIPTION   "Intel(R) PRO/100 Network Driver"

Definition at line 180 of file e100.c.

#define DRV_EXT   "-NAPI"

Definition at line 178 of file e100.c.

#define DRV_NAME   "e100"

Definition at line 177 of file e100.c.

#define DRV_VERSION   "3.5.24-k2"DRV_EXT

Definition at line 179 of file e100.c.

#define E100_82552_ANEG_NOW   0x0400 /* Auto-negotiate now */

Definition at line 3003 of file e100.c.

#define E100_82552_LED_OFF   0x000A /* LEDTX and LED_RX both off */

Definition at line 2421 of file e100.c.

#define E100_82552_LED_ON   0x000F /* LEDTX and LED_RX both on */

Definition at line 2420 of file e100.c.

#define E100_82552_LED_OVERRIDE   0x19

Definition at line 2419 of file e100.c.

#define E100_82552_REV_ANEG   0x0200 /* Reverse auto-negotiation */

Definition at line 3002 of file e100.c.

#define E100_82552_SMARTSPEED   0x14 /* SmartSpeed Ctrl register */

Definition at line 3001 of file e100.c.

#define E100_EEPROM_MAGIC   0x1234

Definition at line 2536 of file e100.c.

#define E100_MAX_MULTICAST_ADDRS   64

Definition at line 494 of file e100.c.

#define E100_NAPI_WEIGHT   16

Definition at line 184 of file e100.c.

#define E100_NET_STATS_LEN   21

Definition at line 2689 of file e100.c.

#define E100_PHY_REGS   0x1C

Definition at line 2451 of file e100.c.

#define E100_STATS_LEN   ARRAY_SIZE(e100_gstrings_stats)

Definition at line 2690 of file e100.c.

#define E100_TEST_LEN   ARRAY_SIZE(e100_gstrings_test)

Definition at line 2606 of file e100.c.

#define E100_WAIT_SCB_FAST   20 /* delay like the old code */

Definition at line 840 of file e100.c.

#define E100_WAIT_SCB_TIMEOUT   20000 /* we might have to wait 100ms!!! */

Definition at line 839 of file e100.c.

#define E100_WATCHDOG_PERIOD   (2 * HZ)

Definition at line 183 of file e100.c.

#define FIRMWARE_D101M   "e100/d101m_ucode.bin"

Definition at line 186 of file e100.c.

#define FIRMWARE_D101S   "e100/d101s_ucode.bin"

Definition at line 187 of file e100.c.

#define FIRMWARE_D102E   "e100/d102e_ucode.bin"

Definition at line 188 of file e100.c.

#define INTDELAY   (u16)1536 /* 0x600 */

Definition at line 1243 of file e100.c.

#define INTEL_8255X_ETHERNET_DEVICE (   device_id,
  ich 
)
Value:
{\
PCI_VENDOR_ID_INTEL, device_id, PCI_ANY_ID, PCI_ANY_ID, \
PCI_CLASS_NETWORK_ETHERNET << 8, 0xFFFF00, ich }

Definition at line 208 of file e100.c.

#define MII_LED_CONTROL   0x1B

Definition at line 2418 of file e100.c.

#define MII_NSC_CONG   MII_RESV1

Definition at line 1454 of file e100.c.

#define NCONFIG_AUTO_SWITCH   0x0080

Definition at line 1453 of file e100.c.

#define NCS_PHY_MODEL_MASK   0xFFF0FFFF
#define NSC_CONG_ENABLE   0x0100

Definition at line 1455 of file e100.c.

#define NSC_CONG_TXREADY   0x0400

Definition at line 1456 of file e100.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 150 of file e100.c.

#define RFD_BUF_LEN   (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)

Definition at line 1935 of file e100.c.

#define UCODE_SIZE   134

Definition at line 501 of file e100.c.

#define X (   a,
  b 
)    a,b

Definition at line 453 of file e100.c.

Enumeration Type Documentation

enum cb_command

cb_command - Command Block flags : 0: controler does CRC (normal), 1: CRC from skb memory

Enumerator:
cb_nop 
cb_iaaddr 
cb_config 
cb_multi 
cb_tx 
cb_ucode 
cb_dump 
cb_tx_sf 
cb_tx_nc 
cb_cid 
cb_i 
cb_s 
cb_el 

Definition at line 419 of file e100.c.

enum cb_status
Enumerator:
cb_complete 
cb_ok 

Definition at line 410 of file e100.c.

enum cuc_dump
Enumerator:
cuc_dump_complete 
cuc_dump_reset_complete 

Definition at line 346 of file e100.c.

Enumerator:
eeprom_mdix_enabled 

Definition at line 385 of file e100.c.

Enumerator:
eeprom_asf 
eeprom_gcl 

Definition at line 405 of file e100.c.

Enumerator:
eesk 
eecs 
eedi 
eedo 

Definition at line 357 of file e100.c.

enum eeprom_id
Enumerator:
eeprom_id_wol 

Definition at line 401 of file e100.c.

Enumerator:
eeprom_cnfg_mdix 
eeprom_phy_iface 
eeprom_id 
eeprom_config_asf 
eeprom_smbus_addr 

Definition at line 377 of file e100.c.

enum eeprom_op
Enumerator:
op_write 
op_read 
op_ewds 
op_ewen 

Definition at line 370 of file e100.c.

Enumerator:
NoSuchPhy 
I82553AB 
I82553C 
I82503 
DP83840 
S80C240 
S80C24 
I82555 
DP83840A 

Definition at line 389 of file e100.c.

enum loopback
Enumerator:
lb_none 
lb_mac 
lb_phy 

Definition at line 529 of file e100.c.

enum __u8 mac
Enumerator:
mac_82557_D100_A 
mac_82557_D100_B 
mac_82557_D100_C 
mac_82558_D101_A4 
mac_82558_D101_B0 
mac_82559_D101M 
mac_82559_D101S 
mac_82550_D102 
mac_82550_D102_C 
mac_82551_E 
mac_82551_F 
mac_82551_10 
mac_unknown 

Definition at line 258 of file e100.c.

enum mdi_ctrl
Enumerator:
mdi_write 
mdi_read 
mdi_ready 

Definition at line 364 of file e100.c.

enum u8 phy
Enumerator:
phy_100a 
phy_100c 
phy_82555_tx 
phy_nsc_tx 
phy_82562_et 
phy_82562_em 
phy_82562_ek 
phy_82562_eh 
phy_82552_v 
phy_unknown 

Definition at line 274 of file e100.c.

enum port
Enumerator:
PORT_A 
PORT_B 
PORT_C 
PORT_D 
PORT_E 
I915_MAX_PORTS 
CX25821_UNDEFINED 
CX25821_RAW 
CX25821_264 
software_reset 
selftest 
selective_reset 

Definition at line 351 of file e100.c.

enum ru_state
Enumerator:
RU_SUSPENDED 
RU_RUNNING 
RU_UNINITIALIZED 

Definition at line 310 of file e100.c.

enum scb_cmd_hi
Enumerator:
irq_mask_none 
irq_mask_all 
irq_sw_gen 

Definition at line 328 of file e100.c.

enum scb_cmd_lo
Enumerator:
cuc_nop 
ruc_start 
ruc_load_base 
cuc_start 
cuc_resume 
cuc_dump_addr 
cuc_dump_stats 
cuc_load_base 
cuc_dump_reset 

Definition at line 334 of file e100.c.

Enumerator:
stat_ack_not_ours 
stat_ack_sw_gen 
stat_ack_rnr 
stat_ack_cu_idle 
stat_ack_frame_rx 
stat_ack_cu_cmd_done 
stat_ack_not_present 
stat_ack_rx 
stat_ack_tx 

Definition at line 316 of file e100.c.

enum scb_status
Enumerator:
rus_no_res 
rus_ready 
rus_mask 

Definition at line 304 of file e100.c.

Function Documentation

MODULE_AUTHOR ( DRV_COPYRIGHT  )
MODULE_DESCRIPTION ( DRV_DESCRIPTION  )
MODULE_DEVICE_TABLE ( pci  ,
e100_id_table   
)
module_exit ( e100_cleanup_module  )
MODULE_FIRMWARE ( FIRMWARE_D101M  )
MODULE_FIRMWARE ( FIRMWARE_D101S  )
MODULE_FIRMWARE ( FIRMWARE_D102E  )
module_init ( e100_init_module  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
 
)
module_param ( eeprom_bad_csum_allow  ,
int  ,
 
)
module_param ( use_io  ,
int  ,
 
)
MODULE_PARM_DESC ( debug  ,
"Debug level (0=none,...,16=all)"   
)
MODULE_PARM_DESC ( eeprom_bad_csum_allow  ,
"Allow bad eeprom checksums"   
)
MODULE_PARM_DESC ( use_io  ,
"Force use of i/o access mode  
)
MODULE_VERSION ( DRV_VERSION  )