Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
ksz884x.c File Reference
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/proc_fs.h>
#include <linux/mii.h>
#include <linux/platform_device.h>
#include <linux/ethtool.h>
#include <linux/etherdevice.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/if_vlan.h>
#include <linux/crc32.h>
#include <linux/sched.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  ksz_desc_rx_stat
 
struct  ksz_desc_tx_stat
 
struct  ksz_desc_rx_buf
 
struct  ksz_desc_tx_buf
 
union  desc_stat
 
union  desc_buf
 
struct  ksz_hw_desc
 
struct  ksz_sw_desc
 
struct  ksz_dma_buf
 
struct  ksz_desc
 
struct  ksz_desc_info
 
struct  ksz_mac_table
 
struct  ksz_vlan_table
 
struct  ksz_port_mib
 
struct  ksz_port_cfg
 
struct  ksz_switch
 
struct  ksz_port_info
 
struct  ksz_hw
 
struct  ksz_port
 
struct  ksz_timer_info
 
struct  ksz_shared_mem
 
struct  ksz_counter_info
 
struct  dev_info
 
struct  dev_priv
 
struct  hw_regs
 
struct  platform_info
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define KS_DMA_TX_CTRL   0x0000
 
#define DMA_TX_ENABLE   0x00000001
 
#define DMA_TX_CRC_ENABLE   0x00000002
 
#define DMA_TX_PAD_ENABLE   0x00000004
 
#define DMA_TX_LOOPBACK   0x00000100
 
#define DMA_TX_FLOW_ENABLE   0x00000200
 
#define DMA_TX_CSUM_IP   0x00010000
 
#define DMA_TX_CSUM_TCP   0x00020000
 
#define DMA_TX_CSUM_UDP   0x00040000
 
#define DMA_TX_BURST_SIZE   0x3F000000
 
#define KS_DMA_RX_CTRL   0x0004
 
#define DMA_RX_ENABLE   0x00000001
 
#define KS884X_DMA_RX_MULTICAST   0x00000002
 
#define DMA_RX_PROMISCUOUS   0x00000004
 
#define DMA_RX_ERROR   0x00000008
 
#define DMA_RX_UNICAST   0x00000010
 
#define DMA_RX_ALL_MULTICAST   0x00000020
 
#define DMA_RX_BROADCAST   0x00000040
 
#define DMA_RX_FLOW_ENABLE   0x00000200
 
#define DMA_RX_CSUM_IP   0x00010000
 
#define DMA_RX_CSUM_TCP   0x00020000
 
#define DMA_RX_CSUM_UDP   0x00040000
 
#define DMA_RX_BURST_SIZE   0x3F000000
 
#define DMA_BURST_SHIFT   24
 
#define DMA_BURST_DEFAULT   8
 
#define KS_DMA_TX_START   0x0008
 
#define KS_DMA_RX_START   0x000C
 
#define DMA_START   0x00000001
 
#define KS_DMA_TX_ADDR   0x0010
 
#define KS_DMA_RX_ADDR   0x0014
 
#define DMA_ADDR_LIST_MASK   0xFFFFFFFC
 
#define DMA_ADDR_LIST_SHIFT   2
 
#define KS884X_MULTICAST_0_OFFSET   0x0020
 
#define KS884X_MULTICAST_1_OFFSET   0x0021
 
#define KS884X_MULTICAST_2_OFFSET   0x0022
 
#define KS884x_MULTICAST_3_OFFSET   0x0023
 
#define KS884X_MULTICAST_4_OFFSET   0x0024
 
#define KS884X_MULTICAST_5_OFFSET   0x0025
 
#define KS884X_MULTICAST_6_OFFSET   0x0026
 
#define KS884X_MULTICAST_7_OFFSET   0x0027
 
#define KS884X_INTERRUPTS_ENABLE   0x0028
 
#define KS884X_INTERRUPTS_STATUS   0x002C
 
#define KS884X_INT_RX_STOPPED   0x02000000
 
#define KS884X_INT_TX_STOPPED   0x04000000
 
#define KS884X_INT_RX_OVERRUN   0x08000000
 
#define KS884X_INT_TX_EMPTY   0x10000000
 
#define KS884X_INT_RX   0x20000000
 
#define KS884X_INT_TX   0x40000000
 
#define KS884X_INT_PHY   0x80000000
 
#define KS884X_INT_RX_MASK   (KS884X_INT_RX | KS884X_INT_RX_OVERRUN)
 
#define KS884X_INT_TX_MASK   (KS884X_INT_TX | KS884X_INT_TX_EMPTY)
 
#define KS884X_INT_MASK   (KS884X_INT_RX | KS884X_INT_TX | KS884X_INT_PHY)
 
#define KS_ADD_ADDR_0_LO   0x0080
 
#define KS_ADD_ADDR_0_HI   0x0084
 
#define KS_ADD_ADDR_1_LO   0x0088
 
#define KS_ADD_ADDR_1_HI   0x008C
 
#define KS_ADD_ADDR_2_LO   0x0090
 
#define KS_ADD_ADDR_2_HI   0x0094
 
#define KS_ADD_ADDR_3_LO   0x0098
 
#define KS_ADD_ADDR_3_HI   0x009C
 
#define KS_ADD_ADDR_4_LO   0x00A0
 
#define KS_ADD_ADDR_4_HI   0x00A4
 
#define KS_ADD_ADDR_5_LO   0x00A8
 
#define KS_ADD_ADDR_5_HI   0x00AC
 
#define KS_ADD_ADDR_6_LO   0x00B0
 
#define KS_ADD_ADDR_6_HI   0x00B4
 
#define KS_ADD_ADDR_7_LO   0x00B8
 
#define KS_ADD_ADDR_7_HI   0x00BC
 
#define KS_ADD_ADDR_8_LO   0x00C0
 
#define KS_ADD_ADDR_8_HI   0x00C4
 
#define KS_ADD_ADDR_9_LO   0x00C8
 
#define KS_ADD_ADDR_9_HI   0x00CC
 
#define KS_ADD_ADDR_A_LO   0x00D0
 
#define KS_ADD_ADDR_A_HI   0x00D4
 
#define KS_ADD_ADDR_B_LO   0x00D8
 
#define KS_ADD_ADDR_B_HI   0x00DC
 
#define KS_ADD_ADDR_C_LO   0x00E0
 
#define KS_ADD_ADDR_C_HI   0x00E4
 
#define KS_ADD_ADDR_D_LO   0x00E8
 
#define KS_ADD_ADDR_D_HI   0x00EC
 
#define KS_ADD_ADDR_E_LO   0x00F0
 
#define KS_ADD_ADDR_E_HI   0x00F4
 
#define KS_ADD_ADDR_F_LO   0x00F8
 
#define KS_ADD_ADDR_F_HI   0x00FC
 
#define ADD_ADDR_HI_MASK   0x0000FFFF
 
#define ADD_ADDR_ENABLE   0x80000000
 
#define ADD_ADDR_INCR   8
 
#define KS884X_ADDR_0_OFFSET   0x0200
 
#define KS884X_ADDR_1_OFFSET   0x0201
 
#define KS884X_ADDR_2_OFFSET   0x0202
 
#define KS884X_ADDR_3_OFFSET   0x0203
 
#define KS884X_ADDR_4_OFFSET   0x0204
 
#define KS884X_ADDR_5_OFFSET   0x0205
 
#define KS884X_BUS_CTRL_OFFSET   0x0210
 
#define BUS_SPEED_125_MHZ   0x0000
 
#define BUS_SPEED_62_5_MHZ   0x0001
 
#define BUS_SPEED_41_66_MHZ   0x0002
 
#define BUS_SPEED_25_MHZ   0x0003
 
#define KS884X_EEPROM_CTRL_OFFSET   0x0212
 
#define EEPROM_CHIP_SELECT   0x0001
 
#define EEPROM_SERIAL_CLOCK   0x0002
 
#define EEPROM_DATA_OUT   0x0004
 
#define EEPROM_DATA_IN   0x0008
 
#define EEPROM_ACCESS_ENABLE   0x0010
 
#define KS884X_MEM_INFO_OFFSET   0x0214
 
#define RX_MEM_TEST_FAILED   0x0008
 
#define RX_MEM_TEST_FINISHED   0x0010
 
#define TX_MEM_TEST_FAILED   0x0800
 
#define TX_MEM_TEST_FINISHED   0x1000
 
#define KS884X_GLOBAL_CTRL_OFFSET   0x0216
 
#define GLOBAL_SOFTWARE_RESET   0x0001
 
#define KS8841_POWER_MANAGE_OFFSET   0x0218
 
#define KS8841_WOL_CTRL_OFFSET   0x021A
 
#define KS8841_WOL_MAGIC_ENABLE   0x0080
 
#define KS8841_WOL_FRAME3_ENABLE   0x0008
 
#define KS8841_WOL_FRAME2_ENABLE   0x0004
 
#define KS8841_WOL_FRAME1_ENABLE   0x0002
 
#define KS8841_WOL_FRAME0_ENABLE   0x0001
 
#define KS8841_WOL_FRAME_CRC_OFFSET   0x0220
 
#define KS8841_WOL_FRAME_BYTE0_OFFSET   0x0224
 
#define KS8841_WOL_FRAME_BYTE2_OFFSET   0x0228
 
#define KS884X_IACR_P   0x04A0
 
#define KS884X_IACR_OFFSET   KS884X_IACR_P
 
#define KS884X_IADR1_P   0x04A2
 
#define KS884X_IADR2_P   0x04A4
 
#define KS884X_IADR3_P   0x04A6
 
#define KS884X_IADR4_P   0x04A8
 
#define KS884X_IADR5_P   0x04AA
 
#define KS884X_ACC_CTRL_SEL_OFFSET   KS884X_IACR_P
 
#define KS884X_ACC_CTRL_INDEX_OFFSET   (KS884X_ACC_CTRL_SEL_OFFSET + 1)
 
#define KS884X_ACC_DATA_0_OFFSET   KS884X_IADR4_P
 
#define KS884X_ACC_DATA_1_OFFSET   (KS884X_ACC_DATA_0_OFFSET + 1)
 
#define KS884X_ACC_DATA_2_OFFSET   KS884X_IADR5_P
 
#define KS884X_ACC_DATA_3_OFFSET   (KS884X_ACC_DATA_2_OFFSET + 1)
 
#define KS884X_ACC_DATA_4_OFFSET   KS884X_IADR2_P
 
#define KS884X_ACC_DATA_5_OFFSET   (KS884X_ACC_DATA_4_OFFSET + 1)
 
#define KS884X_ACC_DATA_6_OFFSET   KS884X_IADR3_P
 
#define KS884X_ACC_DATA_7_OFFSET   (KS884X_ACC_DATA_6_OFFSET + 1)
 
#define KS884X_ACC_DATA_8_OFFSET   KS884X_IADR1_P
 
#define KS884X_P1MBCR_P   0x04D0
 
#define KS884X_P1MBSR_P   0x04D2
 
#define KS884X_PHY1ILR_P   0x04D4
 
#define KS884X_PHY1IHR_P   0x04D6
 
#define KS884X_P1ANAR_P   0x04D8
 
#define KS884X_P1ANLPR_P   0x04DA
 
#define KS884X_P2MBCR_P   0x04E0
 
#define KS884X_P2MBSR_P   0x04E2
 
#define KS884X_PHY2ILR_P   0x04E4
 
#define KS884X_PHY2IHR_P   0x04E6
 
#define KS884X_P2ANAR_P   0x04E8
 
#define KS884X_P2ANLPR_P   0x04EA
 
#define KS884X_PHY_1_CTRL_OFFSET   KS884X_P1MBCR_P
 
#define PHY_CTRL_INTERVAL   (KS884X_P2MBCR_P - KS884X_P1MBCR_P)
 
#define KS884X_PHY_CTRL_OFFSET   0x00
 
#define PHY_REG_CTRL   0
 
#define PHY_RESET   0x8000
 
#define PHY_LOOPBACK   0x4000
 
#define PHY_SPEED_100MBIT   0x2000
 
#define PHY_AUTO_NEG_ENABLE   0x1000
 
#define PHY_POWER_DOWN   0x0800
 
#define PHY_MII_DISABLE   0x0400
 
#define PHY_AUTO_NEG_RESTART   0x0200
 
#define PHY_FULL_DUPLEX   0x0100
 
#define PHY_COLLISION_TEST   0x0080
 
#define PHY_HP_MDIX   0x0020
 
#define PHY_FORCE_MDIX   0x0010
 
#define PHY_AUTO_MDIX_DISABLE   0x0008
 
#define PHY_REMOTE_FAULT_DISABLE   0x0004
 
#define PHY_TRANSMIT_DISABLE   0x0002
 
#define PHY_LED_DISABLE   0x0001
 
#define KS884X_PHY_STATUS_OFFSET   0x02
 
#define PHY_REG_STATUS   1
 
#define PHY_100BT4_CAPABLE   0x8000
 
#define PHY_100BTX_FD_CAPABLE   0x4000
 
#define PHY_100BTX_CAPABLE   0x2000
 
#define PHY_10BT_FD_CAPABLE   0x1000
 
#define PHY_10BT_CAPABLE   0x0800
 
#define PHY_MII_SUPPRESS_CAPABLE   0x0040
 
#define PHY_AUTO_NEG_ACKNOWLEDGE   0x0020
 
#define PHY_REMOTE_FAULT   0x0010
 
#define PHY_AUTO_NEG_CAPABLE   0x0008
 
#define PHY_LINK_STATUS   0x0004
 
#define PHY_JABBER_DETECT   0x0002
 
#define PHY_EXTENDED_CAPABILITY   0x0001
 
#define KS884X_PHY_ID_1_OFFSET   0x04
 
#define KS884X_PHY_ID_2_OFFSET   0x06
 
#define PHY_REG_ID_1   2
 
#define PHY_REG_ID_2   3
 
#define KS884X_PHY_AUTO_NEG_OFFSET   0x08
 
#define PHY_REG_AUTO_NEGOTIATION   4
 
#define PHY_AUTO_NEG_NEXT_PAGE   0x8000
 
#define PHY_AUTO_NEG_REMOTE_FAULT   0x2000
 
#define PHY_AUTO_NEG_ASYM_PAUSE   0x0800
 
#define PHY_AUTO_NEG_SYM_PAUSE   0x0400
 
#define PHY_AUTO_NEG_100BT4   0x0200
 
#define PHY_AUTO_NEG_100BTX_FD   0x0100
 
#define PHY_AUTO_NEG_100BTX   0x0080
 
#define PHY_AUTO_NEG_10BT_FD   0x0040
 
#define PHY_AUTO_NEG_10BT   0x0020
 
#define PHY_AUTO_NEG_SELECTOR   0x001F
 
#define PHY_AUTO_NEG_802_3   0x0001
 
#define PHY_AUTO_NEG_PAUSE   (PHY_AUTO_NEG_SYM_PAUSE | PHY_AUTO_NEG_ASYM_PAUSE)
 
#define KS884X_PHY_REMOTE_CAP_OFFSET   0x0A
 
#define PHY_REG_REMOTE_CAPABILITY   5
 
#define PHY_REMOTE_NEXT_PAGE   0x8000
 
#define PHY_REMOTE_ACKNOWLEDGE   0x4000
 
#define PHY_REMOTE_REMOTE_FAULT   0x2000
 
#define PHY_REMOTE_SYM_PAUSE   0x0400
 
#define PHY_REMOTE_100BTX_FD   0x0100
 
#define PHY_REMOTE_100BTX   0x0080
 
#define PHY_REMOTE_10BT_FD   0x0040
 
#define PHY_REMOTE_10BT   0x0020
 
#define KS884X_P1VCT_P   0x04F0
 
#define KS884X_P1PHYCTRL_P   0x04F2
 
#define KS884X_P2VCT_P   0x04F4
 
#define KS884X_P2PHYCTRL_P   0x04F6
 
#define KS884X_PHY_SPECIAL_OFFSET   KS884X_P1VCT_P
 
#define PHY_SPECIAL_INTERVAL   (KS884X_P2VCT_P - KS884X_P1VCT_P)
 
#define KS884X_PHY_LINK_MD_OFFSET   0x00
 
#define PHY_START_CABLE_DIAG   0x8000
 
#define PHY_CABLE_DIAG_RESULT   0x6000
 
#define PHY_CABLE_STAT_NORMAL   0x0000
 
#define PHY_CABLE_STAT_OPEN   0x2000
 
#define PHY_CABLE_STAT_SHORT   0x4000
 
#define PHY_CABLE_STAT_FAILED   0x6000
 
#define PHY_CABLE_10M_SHORT   0x1000
 
#define PHY_CABLE_FAULT_COUNTER   0x01FF
 
#define KS884X_PHY_PHY_CTRL_OFFSET   0x02
 
#define PHY_STAT_REVERSED_POLARITY   0x0020
 
#define PHY_STAT_MDIX   0x0010
 
#define PHY_FORCE_LINK   0x0008
 
#define PHY_POWER_SAVING_DISABLE   0x0004
 
#define PHY_REMOTE_LOOPBACK   0x0002
 
#define KS884X_SIDER_P   0x0400
 
#define KS884X_CHIP_ID_OFFSET   KS884X_SIDER_P
 
#define KS884X_FAMILY_ID_OFFSET   (KS884X_CHIP_ID_OFFSET + 1)
 
#define REG_FAMILY_ID   0x88
 
#define REG_CHIP_ID_41   0x8810
 
#define REG_CHIP_ID_42   0x8800
 
#define KS884X_CHIP_ID_MASK_41   0xFF10
 
#define KS884X_CHIP_ID_MASK   0xFFF0
 
#define KS884X_CHIP_ID_SHIFT   4
 
#define KS884X_REVISION_MASK   0x000E
 
#define KS884X_REVISION_SHIFT   1
 
#define KS8842_START   0x0001
 
#define CHIP_IP_41_M   0x8810
 
#define CHIP_IP_42_M   0x8800
 
#define CHIP_IP_61_M   0x8890
 
#define CHIP_IP_62_M   0x8880
 
#define CHIP_IP_41_P   0x8850
 
#define CHIP_IP_42_P   0x8840
 
#define CHIP_IP_61_P   0x88D0
 
#define CHIP_IP_62_P   0x88C0
 
#define KS8842_SGCR1_P   0x0402
 
#define KS8842_SWITCH_CTRL_1_OFFSET   KS8842_SGCR1_P
 
#define SWITCH_PASS_ALL   0x8000
 
#define SWITCH_TX_FLOW_CTRL   0x2000
 
#define SWITCH_RX_FLOW_CTRL   0x1000
 
#define SWITCH_CHECK_LENGTH   0x0800
 
#define SWITCH_AGING_ENABLE   0x0400
 
#define SWITCH_FAST_AGING   0x0200
 
#define SWITCH_AGGR_BACKOFF   0x0100
 
#define SWITCH_PASS_PAUSE   0x0008
 
#define SWITCH_LINK_AUTO_AGING   0x0001
 
#define KS8842_SGCR2_P   0x0404
 
#define KS8842_SWITCH_CTRL_2_OFFSET   KS8842_SGCR2_P
 
#define SWITCH_VLAN_ENABLE   0x8000
 
#define SWITCH_IGMP_SNOOP   0x4000
 
#define IPV6_MLD_SNOOP_ENABLE   0x2000
 
#define IPV6_MLD_SNOOP_OPTION   0x1000
 
#define PRIORITY_SCHEME_SELECT   0x0800
 
#define SWITCH_MIRROR_RX_TX   0x0100
 
#define UNICAST_VLAN_BOUNDARY   0x0080
 
#define MULTICAST_STORM_DISABLE   0x0040
 
#define SWITCH_BACK_PRESSURE   0x0020
 
#define FAIR_FLOW_CTRL   0x0010
 
#define NO_EXC_COLLISION_DROP   0x0008
 
#define SWITCH_HUGE_PACKET   0x0004
 
#define SWITCH_LEGAL_PACKET   0x0002
 
#define SWITCH_BUF_RESERVE   0x0001
 
#define KS8842_SGCR3_P   0x0406
 
#define KS8842_SWITCH_CTRL_3_OFFSET   KS8842_SGCR3_P
 
#define BROADCAST_STORM_RATE_LO   0xFF00
 
#define SWITCH_REPEATER   0x0080
 
#define SWITCH_HALF_DUPLEX   0x0040
 
#define SWITCH_FLOW_CTRL   0x0020
 
#define SWITCH_10_MBIT   0x0010
 
#define SWITCH_REPLACE_NULL_VID   0x0008
 
#define BROADCAST_STORM_RATE_HI   0x0007
 
#define BROADCAST_STORM_RATE   0x07FF
 
#define KS8842_SGCR4_P   0x0408
 
#define KS8842_SGCR5_P   0x040A
 
#define KS8842_SWITCH_CTRL_5_OFFSET   KS8842_SGCR5_P
 
#define LED_MODE   0x8200
 
#define LED_SPEED_DUPLEX_ACT   0x0000
 
#define LED_SPEED_DUPLEX_LINK_ACT   0x8000
 
#define LED_DUPLEX_10_100   0x0200
 
#define KS8842_SGCR6_P   0x0410
 
#define KS8842_SWITCH_CTRL_6_OFFSET   KS8842_SGCR6_P
 
#define KS8842_PRIORITY_MASK   3
 
#define KS8842_PRIORITY_SHIFT   2
 
#define KS8842_SGCR7_P   0x0412
 
#define KS8842_SWITCH_CTRL_7_OFFSET   KS8842_SGCR7_P
 
#define SWITCH_UNK_DEF_PORT_ENABLE   0x0008
 
#define SWITCH_UNK_DEF_PORT_3   0x0004
 
#define SWITCH_UNK_DEF_PORT_2   0x0002
 
#define SWITCH_UNK_DEF_PORT_1   0x0001
 
#define KS8842_MACAR1_P   0x0470
 
#define KS8842_MACAR2_P   0x0472
 
#define KS8842_MACAR3_P   0x0474
 
#define KS8842_MAC_ADDR_1_OFFSET   KS8842_MACAR1_P
 
#define KS8842_MAC_ADDR_0_OFFSET   (KS8842_MAC_ADDR_1_OFFSET + 1)
 
#define KS8842_MAC_ADDR_3_OFFSET   KS8842_MACAR2_P
 
#define KS8842_MAC_ADDR_2_OFFSET   (KS8842_MAC_ADDR_3_OFFSET + 1)
 
#define KS8842_MAC_ADDR_5_OFFSET   KS8842_MACAR3_P
 
#define KS8842_MAC_ADDR_4_OFFSET   (KS8842_MAC_ADDR_5_OFFSET + 1)
 
#define KS8842_TOSR1_P   0x0480
 
#define KS8842_TOSR2_P   0x0482
 
#define KS8842_TOSR3_P   0x0484
 
#define KS8842_TOSR4_P   0x0486
 
#define KS8842_TOSR5_P   0x0488
 
#define KS8842_TOSR6_P   0x048A
 
#define KS8842_TOSR7_P   0x0490
 
#define KS8842_TOSR8_P   0x0492
 
#define KS8842_TOS_1_OFFSET   KS8842_TOSR1_P
 
#define KS8842_TOS_2_OFFSET   KS8842_TOSR2_P
 
#define KS8842_TOS_3_OFFSET   KS8842_TOSR3_P
 
#define KS8842_TOS_4_OFFSET   KS8842_TOSR4_P
 
#define KS8842_TOS_5_OFFSET   KS8842_TOSR5_P
 
#define KS8842_TOS_6_OFFSET   KS8842_TOSR6_P
 
#define KS8842_TOS_7_OFFSET   KS8842_TOSR7_P
 
#define KS8842_TOS_8_OFFSET   KS8842_TOSR8_P
 
#define KS8842_P1CR1_P   0x0500
 
#define KS8842_P1CR2_P   0x0502
 
#define KS8842_P1VIDR_P   0x0504
 
#define KS8842_P1CR3_P   0x0506
 
#define KS8842_P1IRCR_P   0x0508
 
#define KS8842_P1ERCR_P   0x050A
 
#define KS884X_P1SCSLMD_P   0x0510
 
#define KS884X_P1CR4_P   0x0512
 
#define KS884X_P1SR_P   0x0514
 
#define KS8842_P2CR1_P   0x0520
 
#define KS8842_P2CR2_P   0x0522
 
#define KS8842_P2VIDR_P   0x0524
 
#define KS8842_P2CR3_P   0x0526
 
#define KS8842_P2IRCR_P   0x0528
 
#define KS8842_P2ERCR_P   0x052A
 
#define KS884X_P2SCSLMD_P   0x0530
 
#define KS884X_P2CR4_P   0x0532
 
#define KS884X_P2SR_P   0x0534
 
#define KS8842_P3CR1_P   0x0540
 
#define KS8842_P3CR2_P   0x0542
 
#define KS8842_P3VIDR_P   0x0544
 
#define KS8842_P3CR3_P   0x0546
 
#define KS8842_P3IRCR_P   0x0548
 
#define KS8842_P3ERCR_P   0x054A
 
#define KS8842_PORT_1_CTRL_1   KS8842_P1CR1_P
 
#define KS8842_PORT_2_CTRL_1   KS8842_P2CR1_P
 
#define KS8842_PORT_3_CTRL_1   KS8842_P3CR1_P
 
#define PORT_CTRL_ADDR(port, addr)
 
#define KS8842_PORT_CTRL_1_OFFSET   0x00
 
#define PORT_BROADCAST_STORM   0x0080
 
#define PORT_DIFFSERV_ENABLE   0x0040
 
#define PORT_802_1P_ENABLE   0x0020
 
#define PORT_BASED_PRIORITY_MASK   0x0018
 
#define PORT_BASED_PRIORITY_BASE   0x0003
 
#define PORT_BASED_PRIORITY_SHIFT   3
 
#define PORT_BASED_PRIORITY_0   0x0000
 
#define PORT_BASED_PRIORITY_1   0x0008
 
#define PORT_BASED_PRIORITY_2   0x0010
 
#define PORT_BASED_PRIORITY_3   0x0018
 
#define PORT_INSERT_TAG   0x0004
 
#define PORT_REMOVE_TAG   0x0002
 
#define PORT_PRIO_QUEUE_ENABLE   0x0001
 
#define KS8842_PORT_CTRL_2_OFFSET   0x02
 
#define PORT_INGRESS_VLAN_FILTER   0x4000
 
#define PORT_DISCARD_NON_VID   0x2000
 
#define PORT_FORCE_FLOW_CTRL   0x1000
 
#define PORT_BACK_PRESSURE   0x0800
 
#define PORT_TX_ENABLE   0x0400
 
#define PORT_RX_ENABLE   0x0200
 
#define PORT_LEARN_DISABLE   0x0100
 
#define PORT_MIRROR_SNIFFER   0x0080
 
#define PORT_MIRROR_RX   0x0040
 
#define PORT_MIRROR_TX   0x0020
 
#define PORT_USER_PRIORITY_CEILING   0x0008
 
#define PORT_VLAN_MEMBERSHIP   0x0007
 
#define KS8842_PORT_CTRL_VID_OFFSET   0x04
 
#define PORT_DEFAULT_VID   0x0001
 
#define KS8842_PORT_CTRL_3_OFFSET   0x06
 
#define PORT_INGRESS_LIMIT_MODE   0x000C
 
#define PORT_INGRESS_ALL   0x0000
 
#define PORT_INGRESS_UNICAST   0x0004
 
#define PORT_INGRESS_MULTICAST   0x0008
 
#define PORT_INGRESS_BROADCAST   0x000C
 
#define PORT_COUNT_IFG   0x0002
 
#define PORT_COUNT_PREAMBLE   0x0001
 
#define KS8842_PORT_IN_RATE_OFFSET   0x08
 
#define KS8842_PORT_OUT_RATE_OFFSET   0x0A
 
#define PORT_PRIORITY_RATE   0x0F
 
#define PORT_PRIORITY_RATE_SHIFT   4
 
#define KS884X_PORT_LINK_MD   0x10
 
#define PORT_CABLE_10M_SHORT   0x8000
 
#define PORT_CABLE_DIAG_RESULT   0x6000
 
#define PORT_CABLE_STAT_NORMAL   0x0000
 
#define PORT_CABLE_STAT_OPEN   0x2000
 
#define PORT_CABLE_STAT_SHORT   0x4000
 
#define PORT_CABLE_STAT_FAILED   0x6000
 
#define PORT_START_CABLE_DIAG   0x1000
 
#define PORT_FORCE_LINK   0x0800
 
#define PORT_POWER_SAVING_DISABLE   0x0400
 
#define PORT_PHY_REMOTE_LOOPBACK   0x0200
 
#define PORT_CABLE_FAULT_COUNTER   0x01FF
 
#define KS884X_PORT_CTRL_4_OFFSET   0x12
 
#define PORT_LED_OFF   0x8000
 
#define PORT_TX_DISABLE   0x4000
 
#define PORT_AUTO_NEG_RESTART   0x2000
 
#define PORT_REMOTE_FAULT_DISABLE   0x1000
 
#define PORT_POWER_DOWN   0x0800
 
#define PORT_AUTO_MDIX_DISABLE   0x0400
 
#define PORT_FORCE_MDIX   0x0200
 
#define PORT_LOOPBACK   0x0100
 
#define PORT_AUTO_NEG_ENABLE   0x0080
 
#define PORT_FORCE_100_MBIT   0x0040
 
#define PORT_FORCE_FULL_DUPLEX   0x0020
 
#define PORT_AUTO_NEG_SYM_PAUSE   0x0010
 
#define PORT_AUTO_NEG_100BTX_FD   0x0008
 
#define PORT_AUTO_NEG_100BTX   0x0004
 
#define PORT_AUTO_NEG_10BT_FD   0x0002
 
#define PORT_AUTO_NEG_10BT   0x0001
 
#define KS884X_PORT_STATUS_OFFSET   0x14
 
#define PORT_HP_MDIX   0x8000
 
#define PORT_REVERSED_POLARITY   0x2000
 
#define PORT_RX_FLOW_CTRL   0x0800
 
#define PORT_TX_FLOW_CTRL   0x1000
 
#define PORT_STATUS_SPEED_100MBIT   0x0400
 
#define PORT_STATUS_FULL_DUPLEX   0x0200
 
#define PORT_REMOTE_FAULT   0x0100
 
#define PORT_MDIX_STATUS   0x0080
 
#define PORT_AUTO_NEG_COMPLETE   0x0040
 
#define PORT_STATUS_LINK_GOOD   0x0020
 
#define PORT_REMOTE_SYM_PAUSE   0x0010
 
#define PORT_REMOTE_100BTX_FD   0x0008
 
#define PORT_REMOTE_100BTX   0x0004
 
#define PORT_REMOTE_10BT_FD   0x0002
 
#define PORT_REMOTE_10BT   0x0001
 
#define STATIC_MAC_TABLE_ADDR   0x0000FFFF
 
#define STATIC_MAC_TABLE_FWD_PORTS   0x00070000
 
#define STATIC_MAC_TABLE_VALID   0x00080000
 
#define STATIC_MAC_TABLE_OVERRIDE   0x00100000
 
#define STATIC_MAC_TABLE_USE_FID   0x00200000
 
#define STATIC_MAC_TABLE_FID   0x03C00000
 
#define STATIC_MAC_FWD_PORTS_SHIFT   16
 
#define STATIC_MAC_FID_SHIFT   22
 
#define VLAN_TABLE_VID   0x00000FFF
 
#define VLAN_TABLE_FID   0x0000F000
 
#define VLAN_TABLE_MEMBERSHIP   0x00070000
 
#define VLAN_TABLE_VALID   0x00080000
 
#define VLAN_TABLE_FID_SHIFT   12
 
#define VLAN_TABLE_MEMBERSHIP_SHIFT   16
 
#define DYNAMIC_MAC_TABLE_ADDR   0x0000FFFF
 
#define DYNAMIC_MAC_TABLE_FID   0x000F0000
 
#define DYNAMIC_MAC_TABLE_SRC_PORT   0x00300000
 
#define DYNAMIC_MAC_TABLE_TIMESTAMP   0x00C00000
 
#define DYNAMIC_MAC_TABLE_ENTRIES   0xFF000000
 
#define DYNAMIC_MAC_TABLE_ENTRIES_H   0x03
 
#define DYNAMIC_MAC_TABLE_MAC_EMPTY   0x04
 
#define DYNAMIC_MAC_TABLE_RESERVED   0x78
 
#define DYNAMIC_MAC_TABLE_NOT_READY   0x80
 
#define DYNAMIC_MAC_FID_SHIFT   16
 
#define DYNAMIC_MAC_SRC_PORT_SHIFT   20
 
#define DYNAMIC_MAC_TIMESTAMP_SHIFT   22
 
#define DYNAMIC_MAC_ENTRIES_SHIFT   24
 
#define DYNAMIC_MAC_ENTRIES_H_SHIFT   8
 
#define MIB_COUNTER_VALUE   0x3FFFFFFF
 
#define MIB_COUNTER_VALID   0x40000000
 
#define MIB_COUNTER_OVERFLOW   0x80000000
 
#define MIB_PACKET_DROPPED   0x0000FFFF
 
#define KS_MIB_PACKET_DROPPED_TX_0   0x100
 
#define KS_MIB_PACKET_DROPPED_TX_1   0x101
 
#define KS_MIB_PACKET_DROPPED_TX   0x102
 
#define KS_MIB_PACKET_DROPPED_RX_0   0x103
 
#define KS_MIB_PACKET_DROPPED_RX_1   0x104
 
#define KS_MIB_PACKET_DROPPED_RX   0x105
 
#define SET_DEFAULT_LED   LED_SPEED_DUPLEX_ACT
 
#define MAC_ADDR_ORDER(i)   (ETH_ALEN - 1 - (i))
 
#define MAX_ETHERNET_BODY_SIZE   1500
 
#define ETHERNET_HEADER_SIZE   (14 + VLAN_HLEN)
 
#define MAX_ETHERNET_PACKET_SIZE   (MAX_ETHERNET_BODY_SIZE + ETHERNET_HEADER_SIZE)
 
#define REGULAR_RX_BUF_SIZE   (MAX_ETHERNET_PACKET_SIZE + 4)
 
#define MAX_RX_BUF_SIZE   (1912 + 4)
 
#define ADDITIONAL_ENTRIES   16
 
#define MAX_MULTICAST_LIST   32
 
#define HW_MULTICAST_SIZE   8
 
#define HW_TO_DEV_PORT(port)   (port - 1)
 
#define DESC_ALIGNMENT   16
 
#define BUFFER_ALIGNMENT   8
 
#define NUM_OF_RX_DESC   64
 
#define NUM_OF_TX_DESC   64
 
#define KS_DESC_RX_FRAME_LEN   0x000007FF
 
#define KS_DESC_RX_FRAME_TYPE   0x00008000
 
#define KS_DESC_RX_ERROR_CRC   0x00010000
 
#define KS_DESC_RX_ERROR_RUNT   0x00020000
 
#define KS_DESC_RX_ERROR_TOO_LONG   0x00040000
 
#define KS_DESC_RX_ERROR_PHY   0x00080000
 
#define KS884X_DESC_RX_PORT_MASK   0x00300000
 
#define KS_DESC_RX_MULTICAST   0x01000000
 
#define KS_DESC_RX_ERROR   0x02000000
 
#define KS_DESC_RX_ERROR_CSUM_UDP   0x04000000
 
#define KS_DESC_RX_ERROR_CSUM_TCP   0x08000000
 
#define KS_DESC_RX_ERROR_CSUM_IP   0x10000000
 
#define KS_DESC_RX_LAST   0x20000000
 
#define KS_DESC_RX_FIRST   0x40000000
 
#define KS_DESC_RX_ERROR_COND
 
#define KS_DESC_HW_OWNED   0x80000000
 
#define KS_DESC_BUF_SIZE   0x000007FF
 
#define KS884X_DESC_TX_PORT_MASK   0x00300000
 
#define KS_DESC_END_OF_RING   0x02000000
 
#define KS_DESC_TX_CSUM_GEN_UDP   0x04000000
 
#define KS_DESC_TX_CSUM_GEN_TCP   0x08000000
 
#define KS_DESC_TX_CSUM_GEN_IP   0x10000000
 
#define KS_DESC_TX_LAST   0x20000000
 
#define KS_DESC_TX_FIRST   0x40000000
 
#define KS_DESC_TX_INTERRUPT   0x80000000
 
#define KS_DESC_PORT_SHIFT   20
 
#define KS_DESC_RX_MASK   (KS_DESC_BUF_SIZE)
 
#define KS_DESC_TX_MASK
 
#define DMA_BUFFER(desc)   ((struct ksz_dma_buf *)(&(desc)->dma_buf))
 
#define LEARNED_MAC_TABLE_ENTRIES   1024
 
#define STATIC_MAC_TABLE_ENTRIES   8
 
#define VLAN_TABLE_ENTRIES   16
 
#define DIFFSERV_ENTRIES   64
 
#define PRIO_802_1P_ENTRIES   8
 
#define PRIO_QUEUES   4
 
#define SWITCH_PORT_NUM   2
 
#define TOTAL_PORT_NUM   (SWITCH_PORT_NUM + 1)
 
#define HOST_MASK   (1 << SWITCH_PORT_NUM)
 
#define PORT_MASK   7
 
#define MAIN_PORT   0
 
#define OTHER_PORT   1
 
#define HOST_PORT   SWITCH_PORT_NUM
 
#define PORT_COUNTER_NUM   0x20
 
#define TOTAL_PORT_COUNTER_NUM   (PORT_COUNTER_NUM + 2)
 
#define MIB_COUNTER_RX_LO_PRIORITY   0x00
 
#define MIB_COUNTER_RX_HI_PRIORITY   0x01
 
#define MIB_COUNTER_RX_UNDERSIZE   0x02
 
#define MIB_COUNTER_RX_FRAGMENT   0x03
 
#define MIB_COUNTER_RX_OVERSIZE   0x04
 
#define MIB_COUNTER_RX_JABBER   0x05
 
#define MIB_COUNTER_RX_SYMBOL_ERR   0x06
 
#define MIB_COUNTER_RX_CRC_ERR   0x07
 
#define MIB_COUNTER_RX_ALIGNMENT_ERR   0x08
 
#define MIB_COUNTER_RX_CTRL_8808   0x09
 
#define MIB_COUNTER_RX_PAUSE   0x0A
 
#define MIB_COUNTER_RX_BROADCAST   0x0B
 
#define MIB_COUNTER_RX_MULTICAST   0x0C
 
#define MIB_COUNTER_RX_UNICAST   0x0D
 
#define MIB_COUNTER_RX_OCTET_64   0x0E
 
#define MIB_COUNTER_RX_OCTET_65_127   0x0F
 
#define MIB_COUNTER_RX_OCTET_128_255   0x10
 
#define MIB_COUNTER_RX_OCTET_256_511   0x11
 
#define MIB_COUNTER_RX_OCTET_512_1023   0x12
 
#define MIB_COUNTER_RX_OCTET_1024_1522   0x13
 
#define MIB_COUNTER_TX_LO_PRIORITY   0x14
 
#define MIB_COUNTER_TX_HI_PRIORITY   0x15
 
#define MIB_COUNTER_TX_LATE_COLLISION   0x16
 
#define MIB_COUNTER_TX_PAUSE   0x17
 
#define MIB_COUNTER_TX_BROADCAST   0x18
 
#define MIB_COUNTER_TX_MULTICAST   0x19
 
#define MIB_COUNTER_TX_UNICAST   0x1A
 
#define MIB_COUNTER_TX_DEFERRED   0x1B
 
#define MIB_COUNTER_TX_TOTAL_COLLISION   0x1C
 
#define MIB_COUNTER_TX_EXCESS_COLLISION   0x1D
 
#define MIB_COUNTER_TX_SINGLE_COLLISION   0x1E
 
#define MIB_COUNTER_TX_MULTI_COLLISION   0x1F
 
#define MIB_COUNTER_RX_DROPPED_PACKET   0x20
 
#define MIB_COUNTER_TX_DROPPED_PACKET   0x21
 
#define TX_RATE_UNIT   10000
 
#define MAX_TX_HELD_SIZE   52000
 
#define LINK_INT_WORKING   (1 << 0)
 
#define SMALL_PACKET_TX_BUG   (1 << 1)
 
#define HALF_DUPLEX_SIGNAL_BUG   (1 << 2)
 
#define RX_HUGE_FRAME   (1 << 4)
 
#define STP_SUPPORT   (1 << 8)
 
#define PAUSE_FLOW_CTRL   (1 << 0)
 
#define FAST_AGING   (1 << 1)
 
#define DRV_NAME   "KSZ884X PCI"
 
#define DEVICE_NAME   "KSZ884x PCI"
 
#define DRV_VERSION   "1.0.0"
 
#define DRV_RELDATE   "Feb 8, 2010"
 
#define TABLE_READ   0x10
 
#define TABLE_SEL_SHIFT   2
 
#define HW_DELAY(hw, reg)
 
#define BROADCAST_STORM_PROTECTION_RATE   10
 
#define BROADCAST_STORM_VALUE   9969
 
#define STP_ENTRY   0
 
#define BROADCAST_ENTRY   1
 
#define BRIDGE_ADDR_ENTRY   2
 
#define IPV6_ADDR_ENTRY   3
 
#define PHY_LINK_SUPPORT
 
#define AT93C_CODE   0
 
#define AT93C_WR_OFF   0x00
 
#define AT93C_WR_ALL   0x10
 
#define AT93C_ER_ALL   0x20
 
#define AT93C_WR_ON   0x30
 
#define AT93C_WRITE   1
 
#define AT93C_READ   2
 
#define AT93C_ERASE   3
 
#define EEPROM_DELAY   4
 
#define EEPROM_DATA_RESERVED   0
 
#define EEPROM_DATA_MAC_ADDR_0   1
 
#define EEPROM_DATA_MAC_ADDR_1   2
 
#define EEPROM_DATA_MAC_ADDR_2   3
 
#define EEPROM_DATA_SUBSYS_ID   4
 
#define EEPROM_DATA_SUBSYS_VEN_ID   5
 
#define EEPROM_DATA_PM_CAP   6
 
#define EEPROM_DATA_OTHER_MAC_ADDR   9
 
#define PHY_RESET_TIMEOUT   10
 
#define MIN_DESC_SHIFT   2
 
#define EEPROM_SIZE   0x40
 
#define ADVERTISED_ALL
 
#define WOL_SUPPORT
 
#define EEPROM_MAGIC   0x10A18842
 
#define STATS_LEN   (TOTAL_PORT_COUNTER_NUM)
 
#define KS884X_DMA_MASK   (~0x0UL)
 
#define PCI_VENDOR_ID_MICREL_KS   0x16c6
 

Enumerations

enum  { media_connected, media_disconnected }
 
enum  {
  OID_COUNTER_UNKOWN, OID_COUNTER_FIRST, OID_COUNTER_XMIT_ERROR, OID_COUNTER_RCV_ERROR,
  OID_COUNTER_LAST
}
 
enum  { TABLE_STATIC_MAC = 0, TABLE_VLAN, TABLE_DYNAMIC_MAC, TABLE_MIB }
 
enum  { PHY_NO_FLOW_CTRL, PHY_FLOW_CTRL, PHY_TX_ONLY, PHY_RX_ONLY }
 
enum  {
  STP_STATE_DISABLED = 0, STP_STATE_LISTENING, STP_STATE_LEARNING, STP_STATE_FORWARDING,
  STP_STATE_BLOCKED, STP_STATE_SIMPLE
}
 

Functions

 MODULE_DEVICE_TABLE (pci, pcidev_table)
 
 module_init (ksz884x_init_module)
 
 module_exit (ksz884x_cleanup_module)
 
 MODULE_DESCRIPTION ("KSZ8841/2 PCI network driver")
 
 MODULE_AUTHOR ("Tristram Ha <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 
 module_param_named (message, msg_enable, int, 0)
 
 MODULE_PARM_DESC (message,"Message verbosity level (0=none, 31=all)")
 
 module_param (macaddr, charp, 0)
 
 module_param (mac1addr, charp, 0)
 
 module_param (fast_aging, int, 0)
 
 module_param (multi_dev, int, 0)
 
 module_param (stp, int, 0)
 
 MODULE_PARM_DESC (macaddr,"MAC address")
 
 MODULE_PARM_DESC (mac1addr,"Second MAC address")
 
 MODULE_PARM_DESC (fast_aging,"Fast aging")
 
 MODULE_PARM_DESC (multi_dev,"Multiple device interfaces")
 
 MODULE_PARM_DESC (stp,"STP support")
 

Macro Definition Documentation

#define ADD_ADDR_ENABLE   0x80000000

Definition at line 178 of file ksz884x.c.

#define ADD_ADDR_HI_MASK   0x0000FFFF

Definition at line 177 of file ksz884x.c.

#define ADD_ADDR_INCR   8

Definition at line 179 of file ksz884x.c.

#define ADDITIONAL_ENTRIES   16

Definition at line 757 of file ksz884x.c.

#define ADVERTISED_ALL
Value:
ADVERTISED_10baseT_Full | \
ADVERTISED_100baseT_Half | \
ADVERTISED_100baseT_Full)

Definition at line 5949 of file ksz884x.c.

#define AT93C_CODE   0

Definition at line 3008 of file ksz884x.c.

#define AT93C_ER_ALL   0x20

Definition at line 3011 of file ksz884x.c.

#define AT93C_ERASE   3

Definition at line 3016 of file ksz884x.c.

#define AT93C_READ   2

Definition at line 3015 of file ksz884x.c.

#define AT93C_WR_ALL   0x10

Definition at line 3010 of file ksz884x.c.

#define AT93C_WR_OFF   0x00

Definition at line 3009 of file ksz884x.c.

#define AT93C_WR_ON   0x30

Definition at line 3012 of file ksz884x.c.

#define AT93C_WRITE   1

Definition at line 3014 of file ksz884x.c.

#define BRIDGE_ADDR_ENTRY   2

Definition at line 2831 of file ksz884x.c.

#define BROADCAST_ENTRY   1

Definition at line 2830 of file ksz884x.c.

#define BROADCAST_STORM_PROTECTION_RATE   10

Definition at line 2135 of file ksz884x.c.

#define BROADCAST_STORM_RATE   0x07FF

Definition at line 462 of file ksz884x.c.

#define BROADCAST_STORM_RATE_HI   0x0007

Definition at line 460 of file ksz884x.c.

#define BROADCAST_STORM_RATE_LO   0xFF00

Definition at line 454 of file ksz884x.c.

#define BROADCAST_STORM_VALUE   9969

Definition at line 2138 of file ksz884x.c.

#define BUFFER_ALIGNMENT   8

Definition at line 788 of file ksz884x.c.

#define BUS_SPEED_125_MHZ   0x0000

Definition at line 196 of file ksz884x.c.

#define BUS_SPEED_25_MHZ   0x0003

Definition at line 199 of file ksz884x.c.

#define BUS_SPEED_41_66_MHZ   0x0002

Definition at line 198 of file ksz884x.c.

#define BUS_SPEED_62_5_MHZ   0x0001

Definition at line 197 of file ksz884x.c.

#define CHIP_IP_41_M   0x8810

Definition at line 407 of file ksz884x.c.

#define CHIP_IP_41_P   0x8850

Definition at line 412 of file ksz884x.c.

#define CHIP_IP_42_M   0x8800

Definition at line 408 of file ksz884x.c.

#define CHIP_IP_42_P   0x8840

Definition at line 413 of file ksz884x.c.

#define CHIP_IP_61_M   0x8890

Definition at line 409 of file ksz884x.c.

#define CHIP_IP_61_P   0x88D0

Definition at line 414 of file ksz884x.c.

#define CHIP_IP_62_M   0x8880

Definition at line 410 of file ksz884x.c.

#define CHIP_IP_62_P   0x88C0

Definition at line 415 of file ksz884x.c.

#define DESC_ALIGNMENT   16

Definition at line 787 of file ksz884x.c.

#define DEVICE_NAME   "KSZ884x PCI"

Definition at line 1486 of file ksz884x.c.

#define DIFFSERV_ENTRIES   64

Definition at line 1068 of file ksz884x.c.

#define DMA_ADDR_LIST_MASK   0xFFFFFFFC

Definition at line 75 of file ksz884x.c.

#define DMA_ADDR_LIST_SHIFT   2

Definition at line 76 of file ksz884x.c.

#define DMA_BUFFER (   desc)    ((struct ksz_dma_buf *)(&(desc)->dma_buf))

Definition at line 992 of file ksz884x.c.

#define DMA_BURST_DEFAULT   8

Definition at line 66 of file ksz884x.c.

#define DMA_BURST_SHIFT   24

Definition at line 65 of file ksz884x.c.

#define DMA_RX_ALL_MULTICAST   0x00000020

Definition at line 57 of file ksz884x.c.

#define DMA_RX_BROADCAST   0x00000040

Definition at line 58 of file ksz884x.c.

#define DMA_RX_BURST_SIZE   0x3F000000

Definition at line 63 of file ksz884x.c.

#define DMA_RX_CSUM_IP   0x00010000

Definition at line 60 of file ksz884x.c.

#define DMA_RX_CSUM_TCP   0x00020000

Definition at line 61 of file ksz884x.c.

#define DMA_RX_CSUM_UDP   0x00040000

Definition at line 62 of file ksz884x.c.

#define DMA_RX_ENABLE   0x00000001

Definition at line 52 of file ksz884x.c.

#define DMA_RX_ERROR   0x00000008

Definition at line 55 of file ksz884x.c.

#define DMA_RX_FLOW_ENABLE   0x00000200

Definition at line 59 of file ksz884x.c.

#define DMA_RX_PROMISCUOUS   0x00000004

Definition at line 54 of file ksz884x.c.

#define DMA_RX_UNICAST   0x00000010

Definition at line 56 of file ksz884x.c.

#define DMA_START   0x00000001

Definition at line 70 of file ksz884x.c.

#define DMA_TX_BURST_SIZE   0x3F000000

Definition at line 49 of file ksz884x.c.

#define DMA_TX_CRC_ENABLE   0x00000002

Definition at line 42 of file ksz884x.c.

#define DMA_TX_CSUM_IP   0x00010000

Definition at line 46 of file ksz884x.c.

#define DMA_TX_CSUM_TCP   0x00020000

Definition at line 47 of file ksz884x.c.

#define DMA_TX_CSUM_UDP   0x00040000

Definition at line 48 of file ksz884x.c.

#define DMA_TX_ENABLE   0x00000001

Definition at line 41 of file ksz884x.c.

#define DMA_TX_FLOW_ENABLE   0x00000200

Definition at line 45 of file ksz884x.c.

#define DMA_TX_LOOPBACK   0x00000100

Definition at line 44 of file ksz884x.c.

#define DMA_TX_PAD_ENABLE   0x00000004

Definition at line 43 of file ksz884x.c.

#define DRV_NAME   "KSZ884X PCI"

Definition at line 1485 of file ksz884x.c.

#define DRV_RELDATE   "Feb 8, 2010"

Definition at line 1488 of file ksz884x.c.

#define DRV_VERSION   "1.0.0"

Definition at line 1487 of file ksz884x.c.

#define DYNAMIC_MAC_ENTRIES_H_SHIFT   8

Definition at line 722 of file ksz884x.c.

#define DYNAMIC_MAC_ENTRIES_SHIFT   24

Definition at line 721 of file ksz884x.c.

#define DYNAMIC_MAC_FID_SHIFT   16

Definition at line 718 of file ksz884x.c.

#define DYNAMIC_MAC_SRC_PORT_SHIFT   20

Definition at line 719 of file ksz884x.c.

#define DYNAMIC_MAC_TABLE_ADDR   0x0000FFFF

Definition at line 707 of file ksz884x.c.

#define DYNAMIC_MAC_TABLE_ENTRIES   0xFF000000

Definition at line 711 of file ksz884x.c.

#define DYNAMIC_MAC_TABLE_ENTRIES_H   0x03

Definition at line 713 of file ksz884x.c.

#define DYNAMIC_MAC_TABLE_FID   0x000F0000

Definition at line 708 of file ksz884x.c.

#define DYNAMIC_MAC_TABLE_MAC_EMPTY   0x04

Definition at line 714 of file ksz884x.c.

#define DYNAMIC_MAC_TABLE_NOT_READY   0x80

Definition at line 716 of file ksz884x.c.

#define DYNAMIC_MAC_TABLE_RESERVED   0x78

Definition at line 715 of file ksz884x.c.

#define DYNAMIC_MAC_TABLE_SRC_PORT   0x00300000

Definition at line 709 of file ksz884x.c.

#define DYNAMIC_MAC_TABLE_TIMESTAMP   0x00C00000

Definition at line 710 of file ksz884x.c.

#define DYNAMIC_MAC_TIMESTAMP_SHIFT   22

Definition at line 720 of file ksz884x.c.

#define EEPROM_ACCESS_ENABLE   0x0010

Definition at line 208 of file ksz884x.c.

#define EEPROM_CHIP_SELECT   0x0001

Definition at line 204 of file ksz884x.c.

#define EEPROM_DATA_IN   0x0008

Definition at line 207 of file ksz884x.c.

#define EEPROM_DATA_MAC_ADDR_0   1

Definition at line 3106 of file ksz884x.c.

#define EEPROM_DATA_MAC_ADDR_1   2

Definition at line 3107 of file ksz884x.c.

#define EEPROM_DATA_MAC_ADDR_2   3

Definition at line 3108 of file ksz884x.c.

#define EEPROM_DATA_OTHER_MAC_ADDR   9

Definition at line 3114 of file ksz884x.c.

#define EEPROM_DATA_OUT   0x0004

Definition at line 206 of file ksz884x.c.

#define EEPROM_DATA_PM_CAP   6

Definition at line 3111 of file ksz884x.c.

#define EEPROM_DATA_RESERVED   0

Definition at line 3105 of file ksz884x.c.

#define EEPROM_DATA_SUBSYS_ID   4

Definition at line 3109 of file ksz884x.c.

#define EEPROM_DATA_SUBSYS_VEN_ID   5

Definition at line 3110 of file ksz884x.c.

#define EEPROM_DELAY   4

Definition at line 3018 of file ksz884x.c.

#define EEPROM_MAGIC   0x10A18842

netdev_get_eeprom - get EEPROM data : Network device. : Ethtool EEPROM data structure. : Buffer to store the EEPROM data.

This function dumps the EEPROM data in the provided buffer.

Return 0 if successful; otherwise an error code.

Definition at line 6270 of file ksz884x.c.

#define EEPROM_SERIAL_CLOCK   0x0002

Definition at line 205 of file ksz884x.c.

#define EEPROM_SIZE   0x40

Definition at line 5945 of file ksz884x.c.

#define ETHERNET_HEADER_SIZE   (14 + VLAN_HLEN)

Definition at line 749 of file ksz884x.c.

#define FAIR_FLOW_CTRL   0x0010

Definition at line 444 of file ksz884x.c.

#define FAST_AGING   (1 << 1)

Definition at line 1229 of file ksz884x.c.

#define GLOBAL_SOFTWARE_RESET   0x0001

Definition at line 220 of file ksz884x.c.

#define HALF_DUPLEX_SIGNAL_BUG   (1 << 2)

Definition at line 1223 of file ksz884x.c.

#define HOST_MASK   (1 << SWITCH_PORT_NUM)

Definition at line 1074 of file ksz884x.c.

#define HOST_PORT   SWITCH_PORT_NUM

Definition at line 1079 of file ksz884x.c.

#define HW_DELAY (   hw,
  reg 
)
Value:
do { \
dummy = readw(hw->io + reg); \
} while (0)

Definition at line 1658 of file ksz884x.c.

#define HW_MULTICAST_SIZE   8

Definition at line 760 of file ksz884x.c.

#define HW_TO_DEV_PORT (   port)    (port - 1)

Definition at line 762 of file ksz884x.c.

#define IPV6_ADDR_ENTRY   3

Definition at line 2832 of file ksz884x.c.

#define IPV6_MLD_SNOOP_ENABLE   0x2000

Definition at line 437 of file ksz884x.c.

#define IPV6_MLD_SNOOP_OPTION   0x1000

Definition at line 438 of file ksz884x.c.

#define KS8841_POWER_MANAGE_OFFSET   0x0218

Definition at line 222 of file ksz884x.c.

#define KS8841_WOL_CTRL_OFFSET   0x021A

Definition at line 225 of file ksz884x.c.

#define KS8841_WOL_FRAME0_ENABLE   0x0001

Definition at line 230 of file ksz884x.c.

#define KS8841_WOL_FRAME1_ENABLE   0x0002

Definition at line 229 of file ksz884x.c.

#define KS8841_WOL_FRAME2_ENABLE   0x0004

Definition at line 228 of file ksz884x.c.

#define KS8841_WOL_FRAME3_ENABLE   0x0008

Definition at line 227 of file ksz884x.c.

#define KS8841_WOL_FRAME_BYTE0_OFFSET   0x0224

Definition at line 234 of file ksz884x.c.

#define KS8841_WOL_FRAME_BYTE2_OFFSET   0x0228

Definition at line 235 of file ksz884x.c.

#define KS8841_WOL_FRAME_CRC_OFFSET   0x0220

Definition at line 233 of file ksz884x.c.

#define KS8841_WOL_MAGIC_ENABLE   0x0080

Definition at line 226 of file ksz884x.c.

#define KS8842_MAC_ADDR_0_OFFSET   (KS8842_MAC_ADDR_1_OFFSET + 1)

Definition at line 497 of file ksz884x.c.

#define KS8842_MAC_ADDR_1_OFFSET   KS8842_MACAR1_P

Definition at line 496 of file ksz884x.c.

#define KS8842_MAC_ADDR_2_OFFSET   (KS8842_MAC_ADDR_3_OFFSET + 1)

Definition at line 499 of file ksz884x.c.

#define KS8842_MAC_ADDR_3_OFFSET   KS8842_MACAR2_P

Definition at line 498 of file ksz884x.c.

#define KS8842_MAC_ADDR_4_OFFSET   (KS8842_MAC_ADDR_5_OFFSET + 1)

Definition at line 501 of file ksz884x.c.

#define KS8842_MAC_ADDR_5_OFFSET   KS8842_MACAR3_P

Definition at line 500 of file ksz884x.c.

#define KS8842_MACAR1_P   0x0470

Definition at line 493 of file ksz884x.c.

#define KS8842_MACAR2_P   0x0472

Definition at line 494 of file ksz884x.c.

#define KS8842_MACAR3_P   0x0474

Definition at line 495 of file ksz884x.c.

#define KS8842_P1CR1_P   0x0500

Definition at line 523 of file ksz884x.c.

#define KS8842_P1CR2_P   0x0502

Definition at line 524 of file ksz884x.c.

#define KS8842_P1CR3_P   0x0506

Definition at line 526 of file ksz884x.c.

#define KS8842_P1ERCR_P   0x050A

Definition at line 528 of file ksz884x.c.

#define KS8842_P1IRCR_P   0x0508

Definition at line 527 of file ksz884x.c.

#define KS8842_P1VIDR_P   0x0504

Definition at line 525 of file ksz884x.c.

#define KS8842_P2CR1_P   0x0520

Definition at line 534 of file ksz884x.c.

#define KS8842_P2CR2_P   0x0522

Definition at line 535 of file ksz884x.c.

#define KS8842_P2CR3_P   0x0526

Definition at line 537 of file ksz884x.c.

#define KS8842_P2ERCR_P   0x052A

Definition at line 539 of file ksz884x.c.

#define KS8842_P2IRCR_P   0x0528

Definition at line 538 of file ksz884x.c.

#define KS8842_P2VIDR_P   0x0524

Definition at line 536 of file ksz884x.c.

#define KS8842_P3CR1_P   0x0540

Definition at line 545 of file ksz884x.c.

#define KS8842_P3CR2_P   0x0542

Definition at line 546 of file ksz884x.c.

#define KS8842_P3CR3_P   0x0546

Definition at line 548 of file ksz884x.c.

#define KS8842_P3ERCR_P   0x054A

Definition at line 550 of file ksz884x.c.

#define KS8842_P3IRCR_P   0x0548

Definition at line 549 of file ksz884x.c.

#define KS8842_P3VIDR_P   0x0544

Definition at line 547 of file ksz884x.c.

#define KS8842_PORT_1_CTRL_1   KS8842_P1CR1_P

Definition at line 552 of file ksz884x.c.

#define KS8842_PORT_2_CTRL_1   KS8842_P2CR1_P

Definition at line 553 of file ksz884x.c.

#define KS8842_PORT_3_CTRL_1   KS8842_P3CR1_P

Definition at line 554 of file ksz884x.c.

#define KS8842_PORT_CTRL_1_OFFSET   0x00

Definition at line 560 of file ksz884x.c.

#define KS8842_PORT_CTRL_2_OFFSET   0x02

Definition at line 576 of file ksz884x.c.

#define KS8842_PORT_CTRL_3_OFFSET   0x06

Definition at line 595 of file ksz884x.c.

#define KS8842_PORT_CTRL_VID_OFFSET   0x04

Definition at line 591 of file ksz884x.c.

#define KS8842_PORT_IN_RATE_OFFSET   0x08

Definition at line 605 of file ksz884x.c.

#define KS8842_PORT_OUT_RATE_OFFSET   0x0A

Definition at line 606 of file ksz884x.c.

#define KS8842_PRIORITY_MASK   3

Definition at line 480 of file ksz884x.c.

#define KS8842_PRIORITY_SHIFT   2

Definition at line 481 of file ksz884x.c.

#define KS8842_SGCR1_P   0x0402

Definition at line 418 of file ksz884x.c.

#define KS8842_SGCR2_P   0x0404

Definition at line 432 of file ksz884x.c.

#define KS8842_SGCR3_P   0x0406

Definition at line 451 of file ksz884x.c.

#define KS8842_SGCR4_P   0x0408

Definition at line 465 of file ksz884x.c.

#define KS8842_SGCR5_P   0x040A

Definition at line 468 of file ksz884x.c.

#define KS8842_SGCR6_P   0x0410

Definition at line 477 of file ksz884x.c.

#define KS8842_SGCR7_P   0x0412

Definition at line 484 of file ksz884x.c.

#define KS8842_START   0x0001

Definition at line 405 of file ksz884x.c.

#define KS8842_SWITCH_CTRL_1_OFFSET   KS8842_SGCR1_P

Definition at line 419 of file ksz884x.c.

#define KS8842_SWITCH_CTRL_2_OFFSET   KS8842_SGCR2_P

Definition at line 433 of file ksz884x.c.

#define KS8842_SWITCH_CTRL_3_OFFSET   KS8842_SGCR3_P

Definition at line 452 of file ksz884x.c.

#define KS8842_SWITCH_CTRL_5_OFFSET   KS8842_SGCR5_P

Definition at line 469 of file ksz884x.c.

#define KS8842_SWITCH_CTRL_6_OFFSET   KS8842_SGCR6_P

Definition at line 478 of file ksz884x.c.

#define KS8842_SWITCH_CTRL_7_OFFSET   KS8842_SGCR7_P

Definition at line 485 of file ksz884x.c.

#define KS8842_TOS_1_OFFSET   KS8842_TOSR1_P

Definition at line 512 of file ksz884x.c.

#define KS8842_TOS_2_OFFSET   KS8842_TOSR2_P

Definition at line 513 of file ksz884x.c.

#define KS8842_TOS_3_OFFSET   KS8842_TOSR3_P

Definition at line 514 of file ksz884x.c.

#define KS8842_TOS_4_OFFSET   KS8842_TOSR4_P

Definition at line 515 of file ksz884x.c.

#define KS8842_TOS_5_OFFSET   KS8842_TOSR5_P

Definition at line 516 of file ksz884x.c.

#define KS8842_TOS_6_OFFSET   KS8842_TOSR6_P

Definition at line 517 of file ksz884x.c.

#define KS8842_TOS_7_OFFSET   KS8842_TOSR7_P

Definition at line 519 of file ksz884x.c.

#define KS8842_TOS_8_OFFSET   KS8842_TOSR8_P

Definition at line 520 of file ksz884x.c.

#define KS8842_TOSR1_P   0x0480

Definition at line 504 of file ksz884x.c.

#define KS8842_TOSR2_P   0x0482

Definition at line 505 of file ksz884x.c.

#define KS8842_TOSR3_P   0x0484

Definition at line 506 of file ksz884x.c.

#define KS8842_TOSR4_P   0x0486

Definition at line 507 of file ksz884x.c.

#define KS8842_TOSR5_P   0x0488

Definition at line 508 of file ksz884x.c.

#define KS8842_TOSR6_P   0x048A

Definition at line 509 of file ksz884x.c.

#define KS8842_TOSR7_P   0x0490

Definition at line 510 of file ksz884x.c.

#define KS8842_TOSR8_P   0x0492

Definition at line 511 of file ksz884x.c.

#define KS884X_ACC_CTRL_INDEX_OFFSET   (KS884X_ACC_CTRL_SEL_OFFSET + 1)

Definition at line 249 of file ksz884x.c.

#define KS884X_ACC_CTRL_SEL_OFFSET   KS884X_IACR_P

Definition at line 248 of file ksz884x.c.

#define KS884X_ACC_DATA_0_OFFSET   KS884X_IADR4_P

Definition at line 251 of file ksz884x.c.

#define KS884X_ACC_DATA_1_OFFSET   (KS884X_ACC_DATA_0_OFFSET + 1)

Definition at line 252 of file ksz884x.c.

#define KS884X_ACC_DATA_2_OFFSET   KS884X_IADR5_P

Definition at line 253 of file ksz884x.c.

#define KS884X_ACC_DATA_3_OFFSET   (KS884X_ACC_DATA_2_OFFSET + 1)

Definition at line 254 of file ksz884x.c.

#define KS884X_ACC_DATA_4_OFFSET   KS884X_IADR2_P

Definition at line 255 of file ksz884x.c.

#define KS884X_ACC_DATA_5_OFFSET   (KS884X_ACC_DATA_4_OFFSET + 1)

Definition at line 256 of file ksz884x.c.

#define KS884X_ACC_DATA_6_OFFSET   KS884X_IADR3_P

Definition at line 257 of file ksz884x.c.

#define KS884X_ACC_DATA_7_OFFSET   (KS884X_ACC_DATA_6_OFFSET + 1)

Definition at line 258 of file ksz884x.c.

#define KS884X_ACC_DATA_8_OFFSET   KS884X_IADR1_P

Definition at line 259 of file ksz884x.c.

#define KS884X_ADDR_0_OFFSET   0x0200

Definition at line 184 of file ksz884x.c.

#define KS884X_ADDR_1_OFFSET   0x0201

Definition at line 185 of file ksz884x.c.

#define KS884X_ADDR_2_OFFSET   0x0202

Definition at line 187 of file ksz884x.c.

#define KS884X_ADDR_3_OFFSET   0x0203

Definition at line 188 of file ksz884x.c.

#define KS884X_ADDR_4_OFFSET   0x0204

Definition at line 190 of file ksz884x.c.

#define KS884X_ADDR_5_OFFSET   0x0205

Definition at line 191 of file ksz884x.c.

#define KS884X_BUS_CTRL_OFFSET   0x0210

Definition at line 194 of file ksz884x.c.

#define KS884X_CHIP_ID_MASK   0xFFF0

Definition at line 401 of file ksz884x.c.

#define KS884X_CHIP_ID_MASK_41   0xFF10

Definition at line 400 of file ksz884x.c.

#define KS884X_CHIP_ID_OFFSET   KS884X_SIDER_P

Definition at line 392 of file ksz884x.c.

#define KS884X_CHIP_ID_SHIFT   4

Definition at line 402 of file ksz884x.c.

#define KS884X_DESC_RX_PORT_MASK   0x00300000

Definition at line 799 of file ksz884x.c.

#define KS884X_DESC_TX_PORT_MASK   0x00300000

Definition at line 816 of file ksz884x.c.

#define KS884X_DMA_MASK   (~0x0UL)

Definition at line 6898 of file ksz884x.c.

#define KS884X_DMA_RX_MULTICAST   0x00000002

Definition at line 53 of file ksz884x.c.

#define KS884X_EEPROM_CTRL_OFFSET   0x0212

Definition at line 202 of file ksz884x.c.

#define KS884X_FAMILY_ID_OFFSET   (KS884X_CHIP_ID_OFFSET + 1)

Definition at line 393 of file ksz884x.c.

#define KS884X_GLOBAL_CTRL_OFFSET   0x0216

Definition at line 219 of file ksz884x.c.

#define KS884X_IACR_OFFSET   KS884X_IACR_P

Definition at line 239 of file ksz884x.c.

#define KS884X_IACR_P   0x04A0

Definition at line 238 of file ksz884x.c.

#define KS884X_IADR1_P   0x04A2

Definition at line 242 of file ksz884x.c.

#define KS884X_IADR2_P   0x04A4

Definition at line 243 of file ksz884x.c.

#define KS884X_IADR3_P   0x04A6

Definition at line 244 of file ksz884x.c.

#define KS884X_IADR4_P   0x04A8

Definition at line 245 of file ksz884x.c.

#define KS884X_IADR5_P   0x04AA

Definition at line 246 of file ksz884x.c.

#define KS884X_INT_MASK   (KS884X_INT_RX | KS884X_INT_TX | KS884X_INT_PHY)

Definition at line 108 of file ksz884x.c.

#define KS884X_INT_PHY   0x80000000

Definition at line 102 of file ksz884x.c.

#define KS884X_INT_RX   0x20000000

Definition at line 100 of file ksz884x.c.

#define KS884X_INT_RX_MASK   (KS884X_INT_RX | KS884X_INT_RX_OVERRUN)

Definition at line 104 of file ksz884x.c.

#define KS884X_INT_RX_OVERRUN   0x08000000

Definition at line 98 of file ksz884x.c.

#define KS884X_INT_RX_STOPPED   0x02000000

Definition at line 96 of file ksz884x.c.

#define KS884X_INT_TX   0x40000000

Definition at line 101 of file ksz884x.c.

#define KS884X_INT_TX_EMPTY   0x10000000

Definition at line 99 of file ksz884x.c.

#define KS884X_INT_TX_MASK   (KS884X_INT_TX | KS884X_INT_TX_EMPTY)

Definition at line 106 of file ksz884x.c.

#define KS884X_INT_TX_STOPPED   0x04000000

Definition at line 97 of file ksz884x.c.

#define KS884X_INTERRUPTS_ENABLE   0x0028

Definition at line 92 of file ksz884x.c.

#define KS884X_INTERRUPTS_STATUS   0x002C

Definition at line 94 of file ksz884x.c.

#define KS884X_MEM_INFO_OFFSET   0x0214

Definition at line 211 of file ksz884x.c.

#define KS884X_MULTICAST_0_OFFSET   0x0020

Definition at line 79 of file ksz884x.c.

#define KS884X_MULTICAST_1_OFFSET   0x0021

Definition at line 80 of file ksz884x.c.

#define KS884X_MULTICAST_2_OFFSET   0x0022

Definition at line 81 of file ksz884x.c.

#define KS884x_MULTICAST_3_OFFSET   0x0023

Definition at line 82 of file ksz884x.c.

#define KS884X_MULTICAST_4_OFFSET   0x0024

Definition at line 84 of file ksz884x.c.

#define KS884X_MULTICAST_5_OFFSET   0x0025

Definition at line 85 of file ksz884x.c.

#define KS884X_MULTICAST_6_OFFSET   0x0026

Definition at line 86 of file ksz884x.c.

#define KS884X_MULTICAST_7_OFFSET   0x0027

Definition at line 87 of file ksz884x.c.

#define KS884X_P1ANAR_P   0x04D8

Definition at line 266 of file ksz884x.c.

#define KS884X_P1ANLPR_P   0x04DA

Definition at line 267 of file ksz884x.c.

#define KS884X_P1CR4_P   0x0512

Definition at line 530 of file ksz884x.c.

#define KS884X_P1MBCR_P   0x04D0

Definition at line 262 of file ksz884x.c.

#define KS884X_P1MBSR_P   0x04D2

Definition at line 263 of file ksz884x.c.

#define KS884X_P1PHYCTRL_P   0x04F2

Definition at line 362 of file ksz884x.c.

#define KS884X_P1SCSLMD_P   0x0510

Definition at line 529 of file ksz884x.c.

#define KS884X_P1SR_P   0x0514

Definition at line 531 of file ksz884x.c.

#define KS884X_P1VCT_P   0x04F0

Definition at line 361 of file ksz884x.c.

#define KS884X_P2ANAR_P   0x04E8

Definition at line 274 of file ksz884x.c.

#define KS884X_P2ANLPR_P   0x04EA

Definition at line 275 of file ksz884x.c.

#define KS884X_P2CR4_P   0x0532

Definition at line 541 of file ksz884x.c.

#define KS884X_P2MBCR_P   0x04E0

Definition at line 270 of file ksz884x.c.

#define KS884X_P2MBSR_P   0x04E2

Definition at line 271 of file ksz884x.c.

#define KS884X_P2PHYCTRL_P   0x04F6

Definition at line 366 of file ksz884x.c.

#define KS884X_P2SCSLMD_P   0x0530

Definition at line 540 of file ksz884x.c.

#define KS884X_P2SR_P   0x0534

Definition at line 542 of file ksz884x.c.

#define KS884X_P2VCT_P   0x04F4

Definition at line 365 of file ksz884x.c.

#define KS884X_PHY1IHR_P   0x04D6

Definition at line 265 of file ksz884x.c.

#define KS884X_PHY1ILR_P   0x04D4

Definition at line 264 of file ksz884x.c.

#define KS884X_PHY2IHR_P   0x04E6

Definition at line 273 of file ksz884x.c.

#define KS884X_PHY2ILR_P   0x04E4

Definition at line 272 of file ksz884x.c.

#define KS884X_PHY_1_CTRL_OFFSET   KS884X_P1MBCR_P

Definition at line 277 of file ksz884x.c.

#define KS884X_PHY_AUTO_NEG_OFFSET   0x08

Definition at line 326 of file ksz884x.c.

#define KS884X_PHY_CTRL_OFFSET   0x00

Definition at line 280 of file ksz884x.c.

#define KS884X_PHY_ID_1_OFFSET   0x04

Definition at line 319 of file ksz884x.c.

#define KS884X_PHY_ID_2_OFFSET   0x06

Definition at line 320 of file ksz884x.c.

#define KS884X_PHY_LINK_MD_OFFSET   0x00

Definition at line 371 of file ksz884x.c.

#define KS884X_PHY_PHY_CTRL_OFFSET   0x02

Definition at line 382 of file ksz884x.c.

#define KS884X_PHY_REMOTE_CAP_OFFSET   0x0A

Definition at line 346 of file ksz884x.c.

#define KS884X_PHY_SPECIAL_OFFSET   KS884X_P1VCT_P

Definition at line 368 of file ksz884x.c.

#define KS884X_PHY_STATUS_OFFSET   0x02

Definition at line 301 of file ksz884x.c.

#define KS884X_PORT_CTRL_4_OFFSET   0x12

Definition at line 625 of file ksz884x.c.

#define KS884X_PORT_LINK_MD   0x10

Definition at line 611 of file ksz884x.c.

#define KS884X_PORT_STATUS_OFFSET   0x14

Definition at line 644 of file ksz884x.c.

#define KS884X_REVISION_MASK   0x000E

Definition at line 403 of file ksz884x.c.

#define KS884X_REVISION_SHIFT   1

Definition at line 404 of file ksz884x.c.

#define KS884X_SIDER_P   0x0400

Definition at line 391 of file ksz884x.c.

#define KS_ADD_ADDR_0_HI   0x0084

Definition at line 115 of file ksz884x.c.

#define KS_ADD_ADDR_0_LO   0x0080

Definition at line 113 of file ksz884x.c.

#define KS_ADD_ADDR_1_HI   0x008C

Definition at line 119 of file ksz884x.c.

#define KS_ADD_ADDR_1_LO   0x0088

Definition at line 117 of file ksz884x.c.

#define KS_ADD_ADDR_2_HI   0x0094

Definition at line 123 of file ksz884x.c.

#define KS_ADD_ADDR_2_LO   0x0090

Definition at line 121 of file ksz884x.c.

#define KS_ADD_ADDR_3_HI   0x009C

Definition at line 127 of file ksz884x.c.

#define KS_ADD_ADDR_3_LO   0x0098

Definition at line 125 of file ksz884x.c.

#define KS_ADD_ADDR_4_HI   0x00A4

Definition at line 131 of file ksz884x.c.

#define KS_ADD_ADDR_4_LO   0x00A0

Definition at line 129 of file ksz884x.c.

#define KS_ADD_ADDR_5_HI   0x00AC

Definition at line 135 of file ksz884x.c.

#define KS_ADD_ADDR_5_LO   0x00A8

Definition at line 133 of file ksz884x.c.

#define KS_ADD_ADDR_6_HI   0x00B4

Definition at line 139 of file ksz884x.c.

#define KS_ADD_ADDR_6_LO   0x00B0

Definition at line 137 of file ksz884x.c.

#define KS_ADD_ADDR_7_HI   0x00BC

Definition at line 143 of file ksz884x.c.

#define KS_ADD_ADDR_7_LO   0x00B8

Definition at line 141 of file ksz884x.c.

#define KS_ADD_ADDR_8_HI   0x00C4

Definition at line 147 of file ksz884x.c.

#define KS_ADD_ADDR_8_LO   0x00C0

Definition at line 145 of file ksz884x.c.

#define KS_ADD_ADDR_9_HI   0x00CC

Definition at line 151 of file ksz884x.c.

#define KS_ADD_ADDR_9_LO   0x00C8

Definition at line 149 of file ksz884x.c.

#define KS_ADD_ADDR_A_HI   0x00D4

Definition at line 155 of file ksz884x.c.

#define KS_ADD_ADDR_A_LO   0x00D0

Definition at line 153 of file ksz884x.c.

#define KS_ADD_ADDR_B_HI   0x00DC

Definition at line 159 of file ksz884x.c.

#define KS_ADD_ADDR_B_LO   0x00D8

Definition at line 157 of file ksz884x.c.

#define KS_ADD_ADDR_C_HI   0x00E4

Definition at line 163 of file ksz884x.c.

#define KS_ADD_ADDR_C_LO   0x00E0

Definition at line 161 of file ksz884x.c.

#define KS_ADD_ADDR_D_HI   0x00EC

Definition at line 167 of file ksz884x.c.

#define KS_ADD_ADDR_D_LO   0x00E8

Definition at line 165 of file ksz884x.c.

#define KS_ADD_ADDR_E_HI   0x00F4

Definition at line 171 of file ksz884x.c.

#define KS_ADD_ADDR_E_LO   0x00F0

Definition at line 169 of file ksz884x.c.

#define KS_ADD_ADDR_F_HI   0x00FC

Definition at line 175 of file ksz884x.c.

#define KS_ADD_ADDR_F_LO   0x00F8

Definition at line 173 of file ksz884x.c.

#define KS_DESC_BUF_SIZE   0x000007FF

Definition at line 815 of file ksz884x.c.

#define KS_DESC_END_OF_RING   0x02000000

Definition at line 817 of file ksz884x.c.

#define KS_DESC_HW_OWNED   0x80000000

Definition at line 813 of file ksz884x.c.

#define KS_DESC_PORT_SHIFT   20

Definition at line 825 of file ksz884x.c.

#define KS_DESC_RX_ERROR   0x02000000

Definition at line 801 of file ksz884x.c.

#define KS_DESC_RX_ERROR_COND
Value:
KS_DESC_RX_ERROR_RUNT | \
KS_DESC_RX_ERROR_PHY | \
KS_DESC_RX_ERROR_TOO_LONG)

Definition at line 807 of file ksz884x.c.

#define KS_DESC_RX_ERROR_CRC   0x00010000

Definition at line 795 of file ksz884x.c.

#define KS_DESC_RX_ERROR_CSUM_IP   0x10000000

Definition at line 804 of file ksz884x.c.

#define KS_DESC_RX_ERROR_CSUM_TCP   0x08000000

Definition at line 803 of file ksz884x.c.

#define KS_DESC_RX_ERROR_CSUM_UDP   0x04000000

Definition at line 802 of file ksz884x.c.

#define KS_DESC_RX_ERROR_PHY   0x00080000

Definition at line 798 of file ksz884x.c.

#define KS_DESC_RX_ERROR_RUNT   0x00020000

Definition at line 796 of file ksz884x.c.

#define KS_DESC_RX_ERROR_TOO_LONG   0x00040000

Definition at line 797 of file ksz884x.c.

#define KS_DESC_RX_FIRST   0x40000000

Definition at line 806 of file ksz884x.c.

#define KS_DESC_RX_FRAME_LEN   0x000007FF

Definition at line 793 of file ksz884x.c.

#define KS_DESC_RX_FRAME_TYPE   0x00008000

Definition at line 794 of file ksz884x.c.

#define KS_DESC_RX_LAST   0x20000000

Definition at line 805 of file ksz884x.c.

#define KS_DESC_RX_MASK   (KS_DESC_BUF_SIZE)

Definition at line 827 of file ksz884x.c.

#define KS_DESC_RX_MULTICAST   0x01000000

Definition at line 800 of file ksz884x.c.

#define KS_DESC_TX_CSUM_GEN_IP   0x10000000

Definition at line 820 of file ksz884x.c.

#define KS_DESC_TX_CSUM_GEN_TCP   0x08000000

Definition at line 819 of file ksz884x.c.

#define KS_DESC_TX_CSUM_GEN_UDP   0x04000000

Definition at line 818 of file ksz884x.c.

#define KS_DESC_TX_FIRST   0x40000000

Definition at line 822 of file ksz884x.c.

#define KS_DESC_TX_INTERRUPT   0x80000000

Definition at line 823 of file ksz884x.c.

#define KS_DESC_TX_LAST   0x20000000

Definition at line 821 of file ksz884x.c.

#define KS_DESC_TX_MASK
Value:
KS_DESC_TX_FIRST | \
KS_DESC_TX_LAST | \
KS_DESC_TX_CSUM_GEN_IP | \
KS_DESC_TX_CSUM_GEN_TCP | \
KS_DESC_TX_CSUM_GEN_UDP | \
KS_DESC_BUF_SIZE)

Definition at line 829 of file ksz884x.c.

#define KS_DMA_RX_ADDR   0x0014

Definition at line 73 of file ksz884x.c.

#define KS_DMA_RX_CTRL   0x0004

Definition at line 51 of file ksz884x.c.

#define KS_DMA_RX_START   0x000C

Definition at line 69 of file ksz884x.c.

#define KS_DMA_TX_ADDR   0x0010

Definition at line 72 of file ksz884x.c.

#define KS_DMA_TX_CTRL   0x0000

Definition at line 40 of file ksz884x.c.

#define KS_DMA_TX_START   0x0008

Definition at line 68 of file ksz884x.c.

#define KS_MIB_PACKET_DROPPED_RX   0x105

Definition at line 741 of file ksz884x.c.

#define KS_MIB_PACKET_DROPPED_RX_0   0x103

Definition at line 739 of file ksz884x.c.

#define KS_MIB_PACKET_DROPPED_RX_1   0x104

Definition at line 740 of file ksz884x.c.

#define KS_MIB_PACKET_DROPPED_TX   0x102

Definition at line 738 of file ksz884x.c.

#define KS_MIB_PACKET_DROPPED_TX_0   0x100

Definition at line 736 of file ksz884x.c.

#define KS_MIB_PACKET_DROPPED_TX_1   0x101

Definition at line 737 of file ksz884x.c.

#define LEARNED_MAC_TABLE_ENTRIES   1024

Definition at line 1031 of file ksz884x.c.

#define LED_DUPLEX_10_100   0x0200

Definition at line 474 of file ksz884x.c.

#define LED_MODE   0x8200

Definition at line 471 of file ksz884x.c.

#define LED_SPEED_DUPLEX_ACT   0x0000

Definition at line 472 of file ksz884x.c.

#define LED_SPEED_DUPLEX_LINK_ACT   0x8000

Definition at line 473 of file ksz884x.c.

#define LINK_INT_WORKING   (1 << 0)

Definition at line 1221 of file ksz884x.c.

#define MAC_ADDR_ORDER (   i)    (ETH_ALEN - 1 - (i))

Definition at line 746 of file ksz884x.c.

#define MAIN_PORT   0

Definition at line 1077 of file ksz884x.c.

#define MAX_ETHERNET_BODY_SIZE   1500

Definition at line 748 of file ksz884x.c.

#define MAX_ETHERNET_PACKET_SIZE   (MAX_ETHERNET_BODY_SIZE + ETHERNET_HEADER_SIZE)

Definition at line 751 of file ksz884x.c.

#define MAX_MULTICAST_LIST   32

Definition at line 758 of file ksz884x.c.

#define MAX_RX_BUF_SIZE   (1912 + 4)

Definition at line 755 of file ksz884x.c.

#define MAX_TX_HELD_SIZE   52000

Definition at line 1218 of file ksz884x.c.

#define MIB_COUNTER_OVERFLOW   0x80000000

Definition at line 732 of file ksz884x.c.

#define MIB_COUNTER_RX_ALIGNMENT_ERR   0x08

Definition at line 1092 of file ksz884x.c.

#define MIB_COUNTER_RX_BROADCAST   0x0B

Definition at line 1095 of file ksz884x.c.

#define MIB_COUNTER_RX_CRC_ERR   0x07

Definition at line 1091 of file ksz884x.c.

#define MIB_COUNTER_RX_CTRL_8808   0x09

Definition at line 1093 of file ksz884x.c.

#define MIB_COUNTER_RX_DROPPED_PACKET   0x20

Definition at line 1117 of file ksz884x.c.

#define MIB_COUNTER_RX_FRAGMENT   0x03

Definition at line 1087 of file ksz884x.c.

#define MIB_COUNTER_RX_HI_PRIORITY   0x01

Definition at line 1085 of file ksz884x.c.

#define MIB_COUNTER_RX_JABBER   0x05

Definition at line 1089 of file ksz884x.c.

#define MIB_COUNTER_RX_LO_PRIORITY   0x00

Definition at line 1084 of file ksz884x.c.

#define MIB_COUNTER_RX_MULTICAST   0x0C

Definition at line 1096 of file ksz884x.c.

#define MIB_COUNTER_RX_OCTET_1024_1522   0x13

Definition at line 1103 of file ksz884x.c.

#define MIB_COUNTER_RX_OCTET_128_255   0x10

Definition at line 1100 of file ksz884x.c.

#define MIB_COUNTER_RX_OCTET_256_511   0x11

Definition at line 1101 of file ksz884x.c.

#define MIB_COUNTER_RX_OCTET_512_1023   0x12

Definition at line 1102 of file ksz884x.c.

#define MIB_COUNTER_RX_OCTET_64   0x0E

Definition at line 1098 of file ksz884x.c.

#define MIB_COUNTER_RX_OCTET_65_127   0x0F

Definition at line 1099 of file ksz884x.c.

#define MIB_COUNTER_RX_OVERSIZE   0x04

Definition at line 1088 of file ksz884x.c.

#define MIB_COUNTER_RX_PAUSE   0x0A

Definition at line 1094 of file ksz884x.c.

#define MIB_COUNTER_RX_SYMBOL_ERR   0x06

Definition at line 1090 of file ksz884x.c.

#define MIB_COUNTER_RX_UNDERSIZE   0x02

Definition at line 1086 of file ksz884x.c.

#define MIB_COUNTER_RX_UNICAST   0x0D

Definition at line 1097 of file ksz884x.c.

#define MIB_COUNTER_TX_BROADCAST   0x18

Definition at line 1108 of file ksz884x.c.

#define MIB_COUNTER_TX_DEFERRED   0x1B

Definition at line 1111 of file ksz884x.c.

#define MIB_COUNTER_TX_DROPPED_PACKET   0x21

Definition at line 1118 of file ksz884x.c.

#define MIB_COUNTER_TX_EXCESS_COLLISION   0x1D

Definition at line 1113 of file ksz884x.c.

#define MIB_COUNTER_TX_HI_PRIORITY   0x15

Definition at line 1105 of file ksz884x.c.

#define MIB_COUNTER_TX_LATE_COLLISION   0x16

Definition at line 1106 of file ksz884x.c.

#define MIB_COUNTER_TX_LO_PRIORITY   0x14

Definition at line 1104 of file ksz884x.c.

#define MIB_COUNTER_TX_MULTI_COLLISION   0x1F

Definition at line 1115 of file ksz884x.c.

#define MIB_COUNTER_TX_MULTICAST   0x19

Definition at line 1109 of file ksz884x.c.

#define MIB_COUNTER_TX_PAUSE   0x17

Definition at line 1107 of file ksz884x.c.

#define MIB_COUNTER_TX_SINGLE_COLLISION   0x1E

Definition at line 1114 of file ksz884x.c.

#define MIB_COUNTER_TX_TOTAL_COLLISION   0x1C

Definition at line 1112 of file ksz884x.c.

#define MIB_COUNTER_TX_UNICAST   0x1A

Definition at line 1110 of file ksz884x.c.

#define MIB_COUNTER_VALID   0x40000000

Definition at line 731 of file ksz884x.c.

#define MIB_COUNTER_VALUE   0x3FFFFFFF

Definition at line 730 of file ksz884x.c.

#define MIB_PACKET_DROPPED   0x0000FFFF

Definition at line 734 of file ksz884x.c.

#define MIN_DESC_SHIFT   2
#define MULTICAST_STORM_DISABLE   0x0040

Definition at line 442 of file ksz884x.c.

#define NO_EXC_COLLISION_DROP   0x0008

Definition at line 445 of file ksz884x.c.

#define NUM_OF_RX_DESC   64

Definition at line 790 of file ksz884x.c.

#define NUM_OF_TX_DESC   64

Definition at line 791 of file ksz884x.c.

#define OTHER_PORT   1

Definition at line 1078 of file ksz884x.c.

#define PAUSE_FLOW_CTRL   (1 << 0)

Definition at line 1228 of file ksz884x.c.

#define PCI_VENDOR_ID_MICREL_KS   0x16c6

Definition at line 6919 of file ksz884x.c.

#define PHY_100BT4_CAPABLE   0x8000

Definition at line 306 of file ksz884x.c.

#define PHY_100BTX_CAPABLE   0x2000

Definition at line 308 of file ksz884x.c.

#define PHY_100BTX_FD_CAPABLE   0x4000

Definition at line 307 of file ksz884x.c.

#define PHY_10BT_CAPABLE   0x0800

Definition at line 310 of file ksz884x.c.

#define PHY_10BT_FD_CAPABLE   0x1000

Definition at line 309 of file ksz884x.c.

#define PHY_AUTO_MDIX_DISABLE   0x0008

Definition at line 296 of file ksz884x.c.

#define PHY_AUTO_NEG_100BT4   0x0200

Definition at line 336 of file ksz884x.c.

#define PHY_AUTO_NEG_100BTX   0x0080

Definition at line 338 of file ksz884x.c.

#define PHY_AUTO_NEG_100BTX_FD   0x0100

Definition at line 337 of file ksz884x.c.

#define PHY_AUTO_NEG_10BT   0x0020

Definition at line 340 of file ksz884x.c.

#define PHY_AUTO_NEG_10BT_FD   0x0040

Definition at line 339 of file ksz884x.c.

#define PHY_AUTO_NEG_802_3   0x0001

Definition at line 342 of file ksz884x.c.

#define PHY_AUTO_NEG_ACKNOWLEDGE   0x0020

Definition at line 312 of file ksz884x.c.

#define PHY_AUTO_NEG_ASYM_PAUSE   0x0800

Definition at line 334 of file ksz884x.c.

#define PHY_AUTO_NEG_CAPABLE   0x0008

Definition at line 314 of file ksz884x.c.

#define PHY_AUTO_NEG_ENABLE   0x1000

Definition at line 288 of file ksz884x.c.

#define PHY_AUTO_NEG_NEXT_PAGE   0x8000

Definition at line 331 of file ksz884x.c.

#define PHY_AUTO_NEG_PAUSE   (PHY_AUTO_NEG_SYM_PAUSE | PHY_AUTO_NEG_ASYM_PAUSE)

Definition at line 344 of file ksz884x.c.

#define PHY_AUTO_NEG_REMOTE_FAULT   0x2000

Definition at line 332 of file ksz884x.c.

#define PHY_AUTO_NEG_RESTART   0x0200

Definition at line 291 of file ksz884x.c.

#define PHY_AUTO_NEG_SELECTOR   0x001F

Definition at line 341 of file ksz884x.c.

#define PHY_AUTO_NEG_SYM_PAUSE   0x0400

Definition at line 335 of file ksz884x.c.

#define PHY_CABLE_10M_SHORT   0x1000

Definition at line 379 of file ksz884x.c.

#define PHY_CABLE_DIAG_RESULT   0x6000

Definition at line 374 of file ksz884x.c.

#define PHY_CABLE_FAULT_COUNTER   0x01FF

Definition at line 380 of file ksz884x.c.

#define PHY_CABLE_STAT_FAILED   0x6000

Definition at line 378 of file ksz884x.c.

#define PHY_CABLE_STAT_NORMAL   0x0000

Definition at line 375 of file ksz884x.c.

#define PHY_CABLE_STAT_OPEN   0x2000

Definition at line 376 of file ksz884x.c.

#define PHY_CABLE_STAT_SHORT   0x4000

Definition at line 377 of file ksz884x.c.

#define PHY_COLLISION_TEST   0x0080

Definition at line 293 of file ksz884x.c.

#define PHY_CTRL_INTERVAL   (KS884X_P2MBCR_P - KS884X_P1MBCR_P)

Definition at line 278 of file ksz884x.c.

#define PHY_EXTENDED_CAPABILITY   0x0001

Definition at line 317 of file ksz884x.c.

#define PHY_FORCE_LINK   0x0008

Definition at line 386 of file ksz884x.c.

#define PHY_FORCE_MDIX   0x0010

Definition at line 295 of file ksz884x.c.

#define PHY_FULL_DUPLEX   0x0100

Definition at line 292 of file ksz884x.c.

#define PHY_HP_MDIX   0x0020

Definition at line 294 of file ksz884x.c.

#define PHY_JABBER_DETECT   0x0002

Definition at line 316 of file ksz884x.c.

#define PHY_LED_DISABLE   0x0001

Definition at line 299 of file ksz884x.c.

#define PHY_LINK_STATUS   0x0004

Definition at line 315 of file ksz884x.c.

#define PHY_LINK_SUPPORT
Value:
PHY_AUTO_NEG_SYM_PAUSE | \
PHY_AUTO_NEG_100BT4 | \
PHY_AUTO_NEG_100BTX_FD | \
PHY_AUTO_NEG_100BTX | \
PHY_AUTO_NEG_10BT_FD | \
PHY_AUTO_NEG_10BT)

Definition at line 2901 of file ksz884x.c.

#define PHY_LOOPBACK   0x4000

Definition at line 286 of file ksz884x.c.

#define PHY_MII_DISABLE   0x0400

Definition at line 290 of file ksz884x.c.

#define PHY_MII_SUPPRESS_CAPABLE   0x0040

Definition at line 311 of file ksz884x.c.

#define PHY_POWER_DOWN   0x0800

Definition at line 289 of file ksz884x.c.

#define PHY_POWER_SAVING_DISABLE   0x0004

Definition at line 387 of file ksz884x.c.

#define PHY_REG_AUTO_NEGOTIATION   4

Definition at line 329 of file ksz884x.c.

#define PHY_REG_CTRL   0

Definition at line 283 of file ksz884x.c.

#define PHY_REG_ID_1   2

Definition at line 323 of file ksz884x.c.

#define PHY_REG_ID_2   3

Definition at line 324 of file ksz884x.c.

#define PHY_REG_REMOTE_CAPABILITY   5

Definition at line 349 of file ksz884x.c.

#define PHY_REG_STATUS   1

Definition at line 304 of file ksz884x.c.

#define PHY_REMOTE_100BTX   0x0080

Definition at line 356 of file ksz884x.c.

#define PHY_REMOTE_100BTX_FD   0x0100

Definition at line 355 of file ksz884x.c.

#define PHY_REMOTE_10BT   0x0020

Definition at line 358 of file ksz884x.c.

#define PHY_REMOTE_10BT_FD   0x0040

Definition at line 357 of file ksz884x.c.

#define PHY_REMOTE_ACKNOWLEDGE   0x4000

Definition at line 352 of file ksz884x.c.

#define PHY_REMOTE_FAULT   0x0010

Definition at line 313 of file ksz884x.c.

#define PHY_REMOTE_FAULT_DISABLE   0x0004

Definition at line 297 of file ksz884x.c.

#define PHY_REMOTE_LOOPBACK   0x0002

Definition at line 388 of file ksz884x.c.

#define PHY_REMOTE_NEXT_PAGE   0x8000

Definition at line 351 of file ksz884x.c.

#define PHY_REMOTE_REMOTE_FAULT   0x2000

Definition at line 353 of file ksz884x.c.

#define PHY_REMOTE_SYM_PAUSE   0x0400

Definition at line 354 of file ksz884x.c.

#define PHY_RESET   0x8000

Definition at line 285 of file ksz884x.c.

#define PHY_RESET_TIMEOUT   10

Definition at line 3372 of file ksz884x.c.

#define PHY_SPECIAL_INTERVAL   (KS884X_P2VCT_P - KS884X_P1VCT_P)

Definition at line 369 of file ksz884x.c.

#define PHY_SPEED_100MBIT   0x2000

Definition at line 287 of file ksz884x.c.

#define PHY_START_CABLE_DIAG   0x8000

Definition at line 373 of file ksz884x.c.

#define PHY_STAT_MDIX   0x0010

Definition at line 385 of file ksz884x.c.

#define PHY_STAT_REVERSED_POLARITY   0x0020

Definition at line 384 of file ksz884x.c.

#define PHY_TRANSMIT_DISABLE   0x0002

Definition at line 298 of file ksz884x.c.

#define PORT_802_1P_ENABLE   0x0020

Definition at line 564 of file ksz884x.c.

#define PORT_AUTO_MDIX_DISABLE   0x0400

Definition at line 632 of file ksz884x.c.

#define PORT_AUTO_NEG_100BTX   0x0004

Definition at line 640 of file ksz884x.c.

#define PORT_AUTO_NEG_100BTX_FD   0x0008

Definition at line 639 of file ksz884x.c.

#define PORT_AUTO_NEG_10BT   0x0001

Definition at line 642 of file ksz884x.c.

#define PORT_AUTO_NEG_10BT_FD   0x0002

Definition at line 641 of file ksz884x.c.

#define PORT_AUTO_NEG_COMPLETE   0x0040

Definition at line 654 of file ksz884x.c.

#define PORT_AUTO_NEG_ENABLE   0x0080

Definition at line 635 of file ksz884x.c.

#define PORT_AUTO_NEG_RESTART   0x2000

Definition at line 629 of file ksz884x.c.

#define PORT_AUTO_NEG_SYM_PAUSE   0x0010

Definition at line 638 of file ksz884x.c.

#define PORT_BACK_PRESSURE   0x0800

Definition at line 581 of file ksz884x.c.

#define PORT_BASED_PRIORITY_0   0x0000

Definition at line 568 of file ksz884x.c.

#define PORT_BASED_PRIORITY_1   0x0008

Definition at line 569 of file ksz884x.c.

#define PORT_BASED_PRIORITY_2   0x0010

Definition at line 570 of file ksz884x.c.

#define PORT_BASED_PRIORITY_3   0x0018

Definition at line 571 of file ksz884x.c.

#define PORT_BASED_PRIORITY_BASE   0x0003

Definition at line 566 of file ksz884x.c.

#define PORT_BASED_PRIORITY_MASK   0x0018

Definition at line 565 of file ksz884x.c.

#define PORT_BASED_PRIORITY_SHIFT   3

Definition at line 567 of file ksz884x.c.

#define PORT_BROADCAST_STORM   0x0080

Definition at line 562 of file ksz884x.c.

#define PORT_CABLE_10M_SHORT   0x8000

Definition at line 613 of file ksz884x.c.

#define PORT_CABLE_DIAG_RESULT   0x6000

Definition at line 614 of file ksz884x.c.

#define PORT_CABLE_FAULT_COUNTER   0x01FF

Definition at line 623 of file ksz884x.c.

#define PORT_CABLE_STAT_FAILED   0x6000

Definition at line 618 of file ksz884x.c.

#define PORT_CABLE_STAT_NORMAL   0x0000

Definition at line 615 of file ksz884x.c.

#define PORT_CABLE_STAT_OPEN   0x2000

Definition at line 616 of file ksz884x.c.

#define PORT_CABLE_STAT_SHORT   0x4000

Definition at line 617 of file ksz884x.c.

#define PORT_COUNT_IFG   0x0002

Definition at line 602 of file ksz884x.c.

#define PORT_COUNT_PREAMBLE   0x0001

Definition at line 603 of file ksz884x.c.

#define PORT_COUNTER_NUM   0x20

Definition at line 1081 of file ksz884x.c.

#define PORT_CTRL_ADDR (   port,
  addr 
)
Value:

Definition at line 556 of file ksz884x.c.

#define PORT_DEFAULT_VID   0x0001

Definition at line 593 of file ksz884x.c.

#define PORT_DIFFSERV_ENABLE   0x0040

Definition at line 563 of file ksz884x.c.

#define PORT_DISCARD_NON_VID   0x2000

Definition at line 579 of file ksz884x.c.

#define PORT_FORCE_100_MBIT   0x0040

Definition at line 636 of file ksz884x.c.

#define PORT_FORCE_FLOW_CTRL   0x1000

Definition at line 580 of file ksz884x.c.

#define PORT_FORCE_FULL_DUPLEX   0x0020

Definition at line 637 of file ksz884x.c.

#define PORT_FORCE_LINK   0x0800

Definition at line 620 of file ksz884x.c.

#define PORT_FORCE_MDIX   0x0200

Definition at line 633 of file ksz884x.c.

#define PORT_HP_MDIX   0x8000

Definition at line 646 of file ksz884x.c.

#define PORT_INGRESS_ALL   0x0000

Definition at line 598 of file ksz884x.c.

#define PORT_INGRESS_BROADCAST   0x000C

Definition at line 601 of file ksz884x.c.

#define PORT_INGRESS_LIMIT_MODE   0x000C

Definition at line 597 of file ksz884x.c.

#define PORT_INGRESS_MULTICAST   0x0008

Definition at line 600 of file ksz884x.c.

#define PORT_INGRESS_UNICAST   0x0004

Definition at line 599 of file ksz884x.c.

#define PORT_INGRESS_VLAN_FILTER   0x4000

Definition at line 578 of file ksz884x.c.

#define PORT_INSERT_TAG   0x0004

Definition at line 572 of file ksz884x.c.

#define PORT_LEARN_DISABLE   0x0100

Definition at line 584 of file ksz884x.c.

#define PORT_LED_OFF   0x8000

Definition at line 627 of file ksz884x.c.

#define PORT_LOOPBACK   0x0100

Definition at line 634 of file ksz884x.c.

#define PORT_MASK   7

Definition at line 1075 of file ksz884x.c.

#define PORT_MDIX_STATUS   0x0080

Definition at line 653 of file ksz884x.c.

#define PORT_MIRROR_RX   0x0040

Definition at line 586 of file ksz884x.c.

#define PORT_MIRROR_SNIFFER   0x0080

Definition at line 585 of file ksz884x.c.

#define PORT_MIRROR_TX   0x0020

Definition at line 587 of file ksz884x.c.

#define PORT_PHY_REMOTE_LOOPBACK   0x0200

Definition at line 622 of file ksz884x.c.

#define PORT_POWER_DOWN   0x0800

Definition at line 631 of file ksz884x.c.

#define PORT_POWER_SAVING_DISABLE   0x0400

Definition at line 621 of file ksz884x.c.

#define PORT_PRIO_QUEUE_ENABLE   0x0001

Definition at line 574 of file ksz884x.c.

#define PORT_PRIORITY_RATE   0x0F

Definition at line 608 of file ksz884x.c.

#define PORT_PRIORITY_RATE_SHIFT   4

Definition at line 609 of file ksz884x.c.

#define PORT_REMOTE_100BTX   0x0004

Definition at line 658 of file ksz884x.c.

#define PORT_REMOTE_100BTX_FD   0x0008

Definition at line 657 of file ksz884x.c.

#define PORT_REMOTE_10BT   0x0001

Definition at line 660 of file ksz884x.c.

#define PORT_REMOTE_10BT_FD   0x0002

Definition at line 659 of file ksz884x.c.

#define PORT_REMOTE_FAULT   0x0100

Definition at line 652 of file ksz884x.c.

#define PORT_REMOTE_FAULT_DISABLE   0x1000

Definition at line 630 of file ksz884x.c.

#define PORT_REMOTE_SYM_PAUSE   0x0010

Definition at line 656 of file ksz884x.c.

#define PORT_REMOVE_TAG   0x0002

Definition at line 573 of file ksz884x.c.

#define PORT_REVERSED_POLARITY   0x2000

Definition at line 647 of file ksz884x.c.

#define PORT_RX_ENABLE   0x0200

Definition at line 583 of file ksz884x.c.

#define PORT_RX_FLOW_CTRL   0x0800

Definition at line 648 of file ksz884x.c.

#define PORT_START_CABLE_DIAG   0x1000

Definition at line 619 of file ksz884x.c.

#define PORT_STATUS_FULL_DUPLEX   0x0200

Definition at line 651 of file ksz884x.c.

#define PORT_STATUS_LINK_GOOD   0x0020

Definition at line 655 of file ksz884x.c.

#define PORT_STATUS_SPEED_100MBIT   0x0400

Definition at line 650 of file ksz884x.c.

#define PORT_TX_DISABLE   0x4000

Definition at line 628 of file ksz884x.c.

#define PORT_TX_ENABLE   0x0400

Definition at line 582 of file ksz884x.c.

#define PORT_TX_FLOW_CTRL   0x1000

Definition at line 649 of file ksz884x.c.

#define PORT_USER_PRIORITY_CEILING   0x0008

Definition at line 588 of file ksz884x.c.

#define PORT_VLAN_MEMBERSHIP   0x0007

Definition at line 589 of file ksz884x.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

drivers/net/ethernet/micrel/ksx884x.c - Micrel KSZ8841/2 PCI Ethernet driver

Copyright (c) 2009-2010 Micrel, Inc. Tristram Ha Trist.nosp@m.ram..nosp@m.Ha@mi.nosp@m.crel.nosp@m..com

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Definition at line 17 of file ksz884x.c.

#define PRIO_802_1P_ENTRIES   8

Definition at line 1069 of file ksz884x.c.

#define PRIO_QUEUES   4

Definition at line 1070 of file ksz884x.c.

#define PRIORITY_SCHEME_SELECT   0x0800

Definition at line 439 of file ksz884x.c.

#define REG_CHIP_ID_41   0x8810

Definition at line 397 of file ksz884x.c.

#define REG_CHIP_ID_42   0x8800

Definition at line 398 of file ksz884x.c.

#define REG_FAMILY_ID   0x88

Definition at line 395 of file ksz884x.c.

#define REGULAR_RX_BUF_SIZE   (MAX_ETHERNET_PACKET_SIZE + 4)

Definition at line 754 of file ksz884x.c.

#define RX_HUGE_FRAME   (1 << 4)

Definition at line 1224 of file ksz884x.c.

#define RX_MEM_TEST_FAILED   0x0008

Definition at line 213 of file ksz884x.c.

#define RX_MEM_TEST_FINISHED   0x0010

Definition at line 214 of file ksz884x.c.

#define SET_DEFAULT_LED   LED_SPEED_DUPLEX_ACT

Definition at line 744 of file ksz884x.c.

#define SMALL_PACKET_TX_BUG   (1 << 1)

Definition at line 1222 of file ksz884x.c.

#define STATIC_MAC_FID_SHIFT   22

Definition at line 679 of file ksz884x.c.

#define STATIC_MAC_FWD_PORTS_SHIFT   16

Definition at line 678 of file ksz884x.c.

#define STATIC_MAC_TABLE_ADDR   0x0000FFFF

Definition at line 671 of file ksz884x.c.

#define STATIC_MAC_TABLE_ENTRIES   8

Definition at line 1032 of file ksz884x.c.

#define STATIC_MAC_TABLE_FID   0x03C00000

Definition at line 676 of file ksz884x.c.

#define STATIC_MAC_TABLE_FWD_PORTS   0x00070000

Definition at line 672 of file ksz884x.c.

#define STATIC_MAC_TABLE_OVERRIDE   0x00100000

Definition at line 674 of file ksz884x.c.

#define STATIC_MAC_TABLE_USE_FID   0x00200000

Definition at line 675 of file ksz884x.c.

#define STATIC_MAC_TABLE_VALID   0x00080000

Definition at line 673 of file ksz884x.c.

#define STATS_LEN   (TOTAL_PORT_COUNTER_NUM)

Definition at line 6425 of file ksz884x.c.

#define STP_ENTRY   0

Definition at line 2829 of file ksz884x.c.

#define STP_SUPPORT   (1 << 8)

Definition at line 1225 of file ksz884x.c.

#define SWITCH_10_MBIT   0x0010

Definition at line 458 of file ksz884x.c.

#define SWITCH_AGGR_BACKOFF   0x0100

Definition at line 427 of file ksz884x.c.

#define SWITCH_AGING_ENABLE   0x0400

Definition at line 425 of file ksz884x.c.

#define SWITCH_BACK_PRESSURE   0x0020

Definition at line 443 of file ksz884x.c.

#define SWITCH_BUF_RESERVE   0x0001

Definition at line 448 of file ksz884x.c.

#define SWITCH_CHECK_LENGTH   0x0800

Definition at line 424 of file ksz884x.c.

#define SWITCH_FAST_AGING   0x0200

Definition at line 426 of file ksz884x.c.

#define SWITCH_FLOW_CTRL   0x0020

Definition at line 457 of file ksz884x.c.

#define SWITCH_HALF_DUPLEX   0x0040

Definition at line 456 of file ksz884x.c.

#define SWITCH_HUGE_PACKET   0x0004

Definition at line 446 of file ksz884x.c.

#define SWITCH_IGMP_SNOOP   0x4000

Definition at line 436 of file ksz884x.c.

#define SWITCH_LEGAL_PACKET   0x0002

Definition at line 447 of file ksz884x.c.

#define SWITCH_LINK_AUTO_AGING   0x0001

Definition at line 429 of file ksz884x.c.

#define SWITCH_MIRROR_RX_TX   0x0100

Definition at line 440 of file ksz884x.c.

#define SWITCH_PASS_ALL   0x8000

Definition at line 421 of file ksz884x.c.

#define SWITCH_PASS_PAUSE   0x0008

Definition at line 428 of file ksz884x.c.

#define SWITCH_PORT_NUM   2

Definition at line 1072 of file ksz884x.c.

#define SWITCH_REPEATER   0x0080

Definition at line 455 of file ksz884x.c.

#define SWITCH_REPLACE_NULL_VID   0x0008

Definition at line 459 of file ksz884x.c.

#define SWITCH_RX_FLOW_CTRL   0x1000

Definition at line 423 of file ksz884x.c.

#define SWITCH_TX_FLOW_CTRL   0x2000

Definition at line 422 of file ksz884x.c.

#define SWITCH_UNK_DEF_PORT_1   0x0001

Definition at line 490 of file ksz884x.c.

#define SWITCH_UNK_DEF_PORT_2   0x0002

Definition at line 489 of file ksz884x.c.

#define SWITCH_UNK_DEF_PORT_3   0x0004

Definition at line 488 of file ksz884x.c.

#define SWITCH_UNK_DEF_PORT_ENABLE   0x0008

Definition at line 487 of file ksz884x.c.

#define SWITCH_VLAN_ENABLE   0x8000

Definition at line 435 of file ksz884x.c.

#define TABLE_READ   0x10

Definition at line 1655 of file ksz884x.c.

#define TABLE_SEL_SHIFT   2

Definition at line 1656 of file ksz884x.c.

#define TOTAL_PORT_COUNTER_NUM   (PORT_COUNTER_NUM + 2)

Definition at line 1082 of file ksz884x.c.

#define TOTAL_PORT_NUM   (SWITCH_PORT_NUM + 1)

Definition at line 1073 of file ksz884x.c.

#define TX_MEM_TEST_FAILED   0x0800

Definition at line 215 of file ksz884x.c.

#define TX_MEM_TEST_FINISHED   0x1000

Definition at line 216 of file ksz884x.c.

#define TX_RATE_UNIT   10000

Definition at line 1196 of file ksz884x.c.

#define UNICAST_VLAN_BOUNDARY   0x0080

Definition at line 441 of file ksz884x.c.

#define VLAN_TABLE_ENTRIES   16

Definition at line 1054 of file ksz884x.c.

#define VLAN_TABLE_FID   0x0000F000

Definition at line 689 of file ksz884x.c.

#define VLAN_TABLE_FID_SHIFT   12

Definition at line 693 of file ksz884x.c.

#define VLAN_TABLE_MEMBERSHIP   0x00070000

Definition at line 690 of file ksz884x.c.

#define VLAN_TABLE_MEMBERSHIP_SHIFT   16

Definition at line 694 of file ksz884x.c.

#define VLAN_TABLE_VALID   0x00080000

Definition at line 691 of file ksz884x.c.

#define VLAN_TABLE_VID   0x00000FFF

Definition at line 688 of file ksz884x.c.

#define WOL_SUPPORT
Value:
WAKE_UCAST | WAKE_MCAST | \
WAKE_BCAST | WAKE_ARP)

Definition at line 6165 of file ksz884x.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
media_connected 
media_disconnected 

Definition at line 764 of file ksz884x.c.

anonymous enum
Enumerator:
OID_COUNTER_UNKOWN 
OID_COUNTER_FIRST 
OID_COUNTER_XMIT_ERROR 
OID_COUNTER_RCV_ERROR 
OID_COUNTER_LAST 

Definition at line 769 of file ksz884x.c.

anonymous enum
Enumerator:
TABLE_STATIC_MAC 
TABLE_VLAN 
TABLE_DYNAMIC_MAC 
TABLE_MIB 

Definition at line 1024 of file ksz884x.c.

anonymous enum
Enumerator:
PHY_NO_FLOW_CTRL 
PHY_FLOW_CTRL 
PHY_TX_ONLY 
PHY_RX_ONLY 

Definition at line 1315 of file ksz884x.c.

anonymous enum
Enumerator:
STP_STATE_DISABLED 
STP_STATE_LISTENING 
STP_STATE_LEARNING 
STP_STATE_FORWARDING 
STP_STATE_BLOCKED 
STP_STATE_SIMPLE 

Definition at line 2767 of file ksz884x.c.

Function Documentation

MODULE_AUTHOR ( "Tristram Ha <[email protected]>"  )
MODULE_DESCRIPTION ( "KSZ8841/2 PCI network driver )
MODULE_DEVICE_TABLE ( pci  ,
pcidev_table   
)
module_exit ( ksz884x_cleanup_module  )
module_init ( ksz884x_init_module  )
MODULE_LICENSE ( "GPL"  )
module_param ( macaddr  ,
charp  ,
 
)
module_param ( mac1addr  ,
charp  ,
 
)
module_param ( fast_aging  ,
int  ,
 
)
module_param ( multi_dev  ,
int  ,
 
)
module_param ( stp  ,
int  ,
 
)
module_param_named ( message  ,
msg_enable  ,
int  ,
 
)
MODULE_PARM_DESC ( message  ,
"Message verbosity level (0=none, 31=all)"   
)
MODULE_PARM_DESC ( macaddr  ,
"MAC address  
)
MODULE_PARM_DESC ( mac1addr  ,
"Second MAC address  
)
MODULE_PARM_DESC ( fast_aging  ,
"Fast aging"   
)
MODULE_PARM_DESC ( multi_dev  ,
"Multiple device interfaces"   
)
MODULE_PARM_DESC ( stp  ,
"STP support  
)

Variable Documentation

Definition at line 6428 of file ksz884x.c.