0001
0002
0003
0004 #ifndef _IXGB_HW_H_
0005 #define _IXGB_HW_H_
0006
0007 #include <linux/mdio.h>
0008
0009 #include "ixgb_osdep.h"
0010
0011
0012 typedef enum {
0013 ixgb_mac_unknown = 0,
0014 ixgb_82597,
0015 ixgb_num_macs
0016 } ixgb_mac_type;
0017
0018
0019 typedef enum {
0020 ixgb_phy_type_unknown = 0,
0021 ixgb_phy_type_g6005,
0022 ixgb_phy_type_g6104,
0023 ixgb_phy_type_txn17201,
0024 ixgb_phy_type_txn17401,
0025 ixgb_phy_type_bcm
0026 } ixgb_phy_type;
0027
0028
0029 typedef enum {
0030 ixgb_xpak_vendor_intel,
0031 ixgb_xpak_vendor_infineon
0032 } ixgb_xpak_vendor;
0033
0034
0035 typedef enum {
0036 ixgb_media_type_unknown = 0,
0037 ixgb_media_type_fiber = 1,
0038 ixgb_media_type_copper = 2,
0039 ixgb_num_media_types
0040 } ixgb_media_type;
0041
0042
0043 typedef enum {
0044 ixgb_fc_none = 0,
0045 ixgb_fc_rx_pause = 1,
0046 ixgb_fc_tx_pause = 2,
0047 ixgb_fc_full = 3,
0048 ixgb_fc_default = 0xFF
0049 } ixgb_fc_type;
0050
0051
0052 typedef enum {
0053 ixgb_bus_type_unknown = 0,
0054 ixgb_bus_type_pci,
0055 ixgb_bus_type_pcix
0056 } ixgb_bus_type;
0057
0058
0059 typedef enum {
0060 ixgb_bus_speed_unknown = 0,
0061 ixgb_bus_speed_33,
0062 ixgb_bus_speed_66,
0063 ixgb_bus_speed_100,
0064 ixgb_bus_speed_133,
0065 ixgb_bus_speed_reserved
0066 } ixgb_bus_speed;
0067
0068
0069 typedef enum {
0070 ixgb_bus_width_unknown = 0,
0071 ixgb_bus_width_32,
0072 ixgb_bus_width_64
0073 } ixgb_bus_width;
0074
0075 #define IXGB_EEPROM_SIZE 64
0076
0077 #define SPEED_10000 10000
0078 #define FULL_DUPLEX 2
0079
0080 #define MIN_NUMBER_OF_DESCRIPTORS 8
0081 #define MAX_NUMBER_OF_DESCRIPTORS 0xFFF8
0082
0083 #define IXGB_DELAY_BEFORE_RESET 10
0084 #define IXGB_DELAY_AFTER_RESET 1
0085 #define IXGB_DELAY_AFTER_EE_RESET 10
0086
0087 #define IXGB_DELAY_USECS_AFTER_LINK_RESET 13
0088
0089 #define MAX_RESET_ITERATIONS 8
0090
0091
0092 #define IXGB_CTRL0 0x00000
0093 #define IXGB_CTRL1 0x00008
0094 #define IXGB_STATUS 0x00010
0095 #define IXGB_EECD 0x00018
0096 #define IXGB_MFS 0x00020
0097
0098
0099 #define IXGB_ICR 0x00080
0100 #define IXGB_ICS 0x00088
0101 #define IXGB_IMS 0x00090
0102 #define IXGB_IMC 0x00098
0103
0104
0105 #define IXGB_RCTL 0x00100
0106 #define IXGB_FCRTL 0x00108
0107 #define IXGB_FCRTH 0x00110
0108 #define IXGB_RDBAL 0x00118
0109 #define IXGB_RDBAH 0x0011C
0110 #define IXGB_RDLEN 0x00120
0111 #define IXGB_RDH 0x00128
0112 #define IXGB_RDT 0x00130
0113 #define IXGB_RDTR 0x00138
0114 #define IXGB_RXDCTL 0x00140
0115 #define IXGB_RAIDC 0x00148
0116 #define IXGB_RXCSUM 0x00158
0117 #define IXGB_RA 0x00180
0118 #define IXGB_RAL 0x00180
0119 #define IXGB_RAH 0x00184
0120 #define IXGB_MTA 0x00200
0121 #define IXGB_VFTA 0x00400
0122 #define IXGB_REQ_RX_DESCRIPTOR_MULTIPLE 8
0123
0124
0125 #define IXGB_TCTL 0x00600
0126 #define IXGB_TDBAL 0x00608
0127 #define IXGB_TDBAH 0x0060C
0128 #define IXGB_TDLEN 0x00610
0129 #define IXGB_TDH 0x00618
0130 #define IXGB_TDT 0x00620
0131 #define IXGB_TIDV 0x00628
0132 #define IXGB_TXDCTL 0x00630
0133 #define IXGB_TSPMT 0x00638
0134 #define IXGB_PAP 0x00640
0135 #define IXGB_REQ_TX_DESCRIPTOR_MULTIPLE 8
0136
0137
0138 #define IXGB_PCSC1 0x00700
0139 #define IXGB_PCSC2 0x00708
0140 #define IXGB_PCSS1 0x00710
0141 #define IXGB_PCSS2 0x00718
0142 #define IXGB_XPCSS 0x00720
0143 #define IXGB_UCCR 0x00728
0144 #define IXGB_XPCSTC 0x00730
0145 #define IXGB_MACA 0x00738
0146 #define IXGB_APAE 0x00740
0147 #define IXGB_ARD 0x00748
0148 #define IXGB_AIS 0x00750
0149 #define IXGB_MSCA 0x00758
0150 #define IXGB_MSRWD 0x00760
0151
0152
0153 #define IXGB_WUFC 0x00808
0154 #define IXGB_WUS 0x00810
0155 #define IXGB_FFLT 0x01000
0156 #define IXGB_FFMT 0x01020
0157 #define IXGB_FTVT 0x01420
0158
0159
0160 #define IXGB_TPRL 0x02000
0161 #define IXGB_TPRH 0x02004
0162 #define IXGB_GPRCL 0x02008
0163 #define IXGB_GPRCH 0x0200C
0164 #define IXGB_BPRCL 0x02010
0165 #define IXGB_BPRCH 0x02014
0166 #define IXGB_MPRCL 0x02018
0167 #define IXGB_MPRCH 0x0201C
0168 #define IXGB_UPRCL 0x02020
0169 #define IXGB_UPRCH 0x02024
0170 #define IXGB_VPRCL 0x02028
0171 #define IXGB_VPRCH 0x0202C
0172 #define IXGB_JPRCL 0x02030
0173 #define IXGB_JPRCH 0x02034
0174 #define IXGB_GORCL 0x02038
0175 #define IXGB_GORCH 0x0203C
0176 #define IXGB_TORL 0x02040
0177 #define IXGB_TORH 0x02044
0178 #define IXGB_RNBC 0x02048
0179 #define IXGB_RUC 0x02050
0180 #define IXGB_ROC 0x02058
0181 #define IXGB_RLEC 0x02060
0182 #define IXGB_CRCERRS 0x02068
0183 #define IXGB_ICBC 0x02070
0184 #define IXGB_ECBC 0x02078
0185 #define IXGB_MPC 0x02080
0186 #define IXGB_TPTL 0x02100
0187 #define IXGB_TPTH 0x02104
0188 #define IXGB_GPTCL 0x02108
0189 #define IXGB_GPTCH 0x0210C
0190 #define IXGB_BPTCL 0x02110
0191 #define IXGB_BPTCH 0x02114
0192 #define IXGB_MPTCL 0x02118
0193 #define IXGB_MPTCH 0x0211C
0194 #define IXGB_UPTCL 0x02120
0195 #define IXGB_UPTCH 0x02124
0196 #define IXGB_VPTCL 0x02128
0197 #define IXGB_VPTCH 0x0212C
0198 #define IXGB_JPTCL 0x02130
0199 #define IXGB_JPTCH 0x02134
0200 #define IXGB_GOTCL 0x02138
0201 #define IXGB_GOTCH 0x0213C
0202 #define IXGB_TOTL 0x02140
0203 #define IXGB_TOTH 0x02144
0204 #define IXGB_DC 0x02148
0205 #define IXGB_PLT64C 0x02150
0206 #define IXGB_TSCTC 0x02170
0207 #define IXGB_TSCTFC 0x02178
0208 #define IXGB_IBIC 0x02180
0209 #define IXGB_RFC 0x02188
0210 #define IXGB_LFC 0x02190
0211 #define IXGB_PFRC 0x02198
0212 #define IXGB_PFTC 0x021A0
0213 #define IXGB_MCFRC 0x021A8
0214 #define IXGB_MCFTC 0x021B0
0215 #define IXGB_XONRXC 0x021B8
0216 #define IXGB_XONTXC 0x021C0
0217 #define IXGB_XOFFRXC 0x021C8
0218 #define IXGB_XOFFTXC 0x021D0
0219 #define IXGB_RJC 0x021D8
0220
0221
0222 #define IXGB_CTRL0_LRST 0x00000008
0223 #define IXGB_CTRL0_JFE 0x00000010
0224 #define IXGB_CTRL0_XLE 0x00000020
0225 #define IXGB_CTRL0_MDCS 0x00000040
0226 #define IXGB_CTRL0_CMDC 0x00000080
0227 #define IXGB_CTRL0_SDP0 0x00040000
0228 #define IXGB_CTRL0_SDP1 0x00080000
0229 #define IXGB_CTRL0_SDP2 0x00100000
0230 #define IXGB_CTRL0_SDP3 0x00200000
0231 #define IXGB_CTRL0_SDP0_DIR 0x00400000
0232 #define IXGB_CTRL0_SDP1_DIR 0x00800000
0233 #define IXGB_CTRL0_SDP2_DIR 0x01000000
0234 #define IXGB_CTRL0_SDP3_DIR 0x02000000
0235 #define IXGB_CTRL0_RST 0x04000000
0236 #define IXGB_CTRL0_RPE 0x08000000
0237 #define IXGB_CTRL0_TPE 0x10000000
0238 #define IXGB_CTRL0_VME 0x40000000
0239
0240
0241 #define IXGB_CTRL1_GPI0_EN 0x00000001
0242 #define IXGB_CTRL1_GPI1_EN 0x00000002
0243 #define IXGB_CTRL1_GPI2_EN 0x00000004
0244 #define IXGB_CTRL1_GPI3_EN 0x00000008
0245 #define IXGB_CTRL1_SDP4 0x00000010
0246 #define IXGB_CTRL1_SDP5 0x00000020
0247 #define IXGB_CTRL1_SDP6 0x00000040
0248 #define IXGB_CTRL1_SDP7 0x00000080
0249 #define IXGB_CTRL1_SDP4_DIR 0x00000100
0250 #define IXGB_CTRL1_SDP5_DIR 0x00000200
0251 #define IXGB_CTRL1_SDP6_DIR 0x00000400
0252 #define IXGB_CTRL1_SDP7_DIR 0x00000800
0253 #define IXGB_CTRL1_EE_RST 0x00002000
0254 #define IXGB_CTRL1_RO_DIS 0x00020000
0255 #define IXGB_CTRL1_PCIXHM_MASK 0x00C00000
0256 #define IXGB_CTRL1_PCIXHM_1_2 0x00000000
0257 #define IXGB_CTRL1_PCIXHM_5_8 0x00400000
0258 #define IXGB_CTRL1_PCIXHM_3_4 0x00800000
0259 #define IXGB_CTRL1_PCIXHM_7_8 0x00C00000
0260
0261
0262 #define IXGB_STATUS_LU 0x00000002
0263 #define IXGB_STATUS_AIP 0x00000004
0264 #define IXGB_STATUS_TXOFF 0x00000010
0265 #define IXGB_STATUS_XAUIME 0x00000020
0266 #define IXGB_STATUS_RES 0x00000040
0267 #define IXGB_STATUS_RIS 0x00000080
0268 #define IXGB_STATUS_RIE 0x00000100
0269 #define IXGB_STATUS_RLF 0x00000200
0270 #define IXGB_STATUS_RRF 0x00000400
0271 #define IXGB_STATUS_PCI_SPD 0x00000800
0272 #define IXGB_STATUS_BUS64 0x00001000
0273 #define IXGB_STATUS_PCIX_MODE 0x00002000
0274 #define IXGB_STATUS_PCIX_SPD_MASK 0x0000C000
0275 #define IXGB_STATUS_PCIX_SPD_66 0x00000000
0276 #define IXGB_STATUS_PCIX_SPD_100 0x00004000
0277 #define IXGB_STATUS_PCIX_SPD_133 0x00008000
0278 #define IXGB_STATUS_REV_ID_MASK 0x000F0000
0279 #define IXGB_STATUS_REV_ID_SHIFT 16
0280
0281
0282 #define IXGB_EECD_SK 0x00000001
0283 #define IXGB_EECD_CS 0x00000002
0284 #define IXGB_EECD_DI 0x00000004
0285 #define IXGB_EECD_DO 0x00000008
0286 #define IXGB_EECD_FWE_MASK 0x00000030
0287 #define IXGB_EECD_FWE_DIS 0x00000010
0288 #define IXGB_EECD_FWE_EN 0x00000020
0289
0290
0291 #define IXGB_MFS_SHIFT 16
0292
0293
0294 #define IXGB_INT_TXDW 0x00000001
0295 #define IXGB_INT_TXQE 0x00000002
0296 #define IXGB_INT_LSC 0x00000004
0297 #define IXGB_INT_RXSEQ 0x00000008
0298 #define IXGB_INT_RXDMT0 0x00000010
0299 #define IXGB_INT_RXO 0x00000040
0300 #define IXGB_INT_RXT0 0x00000080
0301 #define IXGB_INT_AUTOSCAN 0x00000200
0302 #define IXGB_INT_GPI0 0x00000800
0303 #define IXGB_INT_GPI1 0x00001000
0304 #define IXGB_INT_GPI2 0x00002000
0305 #define IXGB_INT_GPI3 0x00004000
0306
0307
0308 #define IXGB_RCTL_RXEN 0x00000002
0309 #define IXGB_RCTL_SBP 0x00000004
0310 #define IXGB_RCTL_UPE 0x00000008
0311 #define IXGB_RCTL_MPE 0x00000010
0312 #define IXGB_RCTL_RDMTS_MASK 0x00000300
0313 #define IXGB_RCTL_RDMTS_1_2 0x00000000
0314 #define IXGB_RCTL_RDMTS_1_4 0x00000100
0315 #define IXGB_RCTL_RDMTS_1_8 0x00000200
0316 #define IXGB_RCTL_MO_MASK 0x00003000
0317 #define IXGB_RCTL_MO_47_36 0x00000000
0318 #define IXGB_RCTL_MO_46_35 0x00001000
0319 #define IXGB_RCTL_MO_45_34 0x00002000
0320 #define IXGB_RCTL_MO_43_32 0x00003000
0321 #define IXGB_RCTL_MO_SHIFT 12
0322 #define IXGB_RCTL_BAM 0x00008000
0323 #define IXGB_RCTL_BSIZE_MASK 0x00030000
0324 #define IXGB_RCTL_BSIZE_2048 0x00000000
0325 #define IXGB_RCTL_BSIZE_4096 0x00010000
0326 #define IXGB_RCTL_BSIZE_8192 0x00020000
0327 #define IXGB_RCTL_BSIZE_16384 0x00030000
0328 #define IXGB_RCTL_VFE 0x00040000
0329 #define IXGB_RCTL_CFIEN 0x00080000
0330 #define IXGB_RCTL_CFI 0x00100000
0331 #define IXGB_RCTL_RPDA_MASK 0x00600000
0332 #define IXGB_RCTL_RPDA_MC_MAC 0x00000000
0333 #define IXGB_RCTL_MC_ONLY 0x00400000
0334 #define IXGB_RCTL_CFF 0x00800000
0335 #define IXGB_RCTL_SECRC 0x04000000
0336 #define IXGB_RDT_FPDB 0x80000000
0337
0338 #define IXGB_RCTL_IDLE_RX_UNIT 0
0339
0340
0341 #define IXGB_FCRTL_XONE 0x80000000
0342
0343
0344 #define IXGB_RXDCTL_PTHRESH_MASK 0x000001FF
0345 #define IXGB_RXDCTL_PTHRESH_SHIFT 0
0346 #define IXGB_RXDCTL_HTHRESH_MASK 0x0003FE00
0347 #define IXGB_RXDCTL_HTHRESH_SHIFT 9
0348 #define IXGB_RXDCTL_WTHRESH_MASK 0x07FC0000
0349 #define IXGB_RXDCTL_WTHRESH_SHIFT 18
0350
0351
0352 #define IXGB_RAIDC_HIGHTHRS_MASK 0x0000003F
0353 #define IXGB_RAIDC_DELAY_MASK 0x000FF800
0354 #define IXGB_RAIDC_DELAY_SHIFT 11
0355 #define IXGB_RAIDC_POLL_MASK 0x1FF00000
0356 #define IXGB_RAIDC_POLL_SHIFT 20
0357 #define IXGB_RAIDC_RXT_GATE 0x40000000
0358 #define IXGB_RAIDC_EN 0x80000000
0359
0360 #define IXGB_RAIDC_POLL_1000_INTERRUPTS_PER_SECOND 1220
0361 #define IXGB_RAIDC_POLL_5000_INTERRUPTS_PER_SECOND 244
0362 #define IXGB_RAIDC_POLL_10000_INTERRUPTS_PER_SECOND 122
0363 #define IXGB_RAIDC_POLL_20000_INTERRUPTS_PER_SECOND 61
0364
0365
0366 #define IXGB_RXCSUM_IPOFL 0x00000100
0367 #define IXGB_RXCSUM_TUOFL 0x00000200
0368
0369
0370 #define IXGB_RAH_ASEL_MASK 0x00030000
0371 #define IXGB_RAH_ASEL_DEST 0x00000000
0372 #define IXGB_RAH_ASEL_SRC 0x00010000
0373 #define IXGB_RAH_AV 0x80000000
0374
0375
0376 #define IXGB_TCTL_TCE 0x00000001
0377 #define IXGB_TCTL_TXEN 0x00000002
0378 #define IXGB_TCTL_TPDE 0x00000004
0379
0380 #define IXGB_TCTL_IDLE_TX_UNIT 0
0381
0382
0383 #define IXGB_TXDCTL_PTHRESH_MASK 0x0000007F
0384 #define IXGB_TXDCTL_HTHRESH_MASK 0x00007F00
0385 #define IXGB_TXDCTL_HTHRESH_SHIFT 8
0386 #define IXGB_TXDCTL_WTHRESH_MASK 0x007F0000
0387 #define IXGB_TXDCTL_WTHRESH_SHIFT 16
0388
0389
0390 #define IXGB_TSPMT_TSMT_MASK 0x0000FFFF
0391 #define IXGB_TSPMT_TSPBP_MASK 0xFFFF0000
0392 #define IXGB_TSPMT_TSPBP_SHIFT 16
0393
0394
0395 #define IXGB_PAP_TXPC_MASK 0x0000FFFF
0396 #define IXGB_PAP_TXPV_MASK 0x000F0000
0397 #define IXGB_PAP_TXPV_10G 0x00000000
0398 #define IXGB_PAP_TXPV_1G 0x00010000
0399 #define IXGB_PAP_TXPV_2G 0x00020000
0400 #define IXGB_PAP_TXPV_3G 0x00030000
0401 #define IXGB_PAP_TXPV_4G 0x00040000
0402 #define IXGB_PAP_TXPV_5G 0x00050000
0403 #define IXGB_PAP_TXPV_6G 0x00060000
0404 #define IXGB_PAP_TXPV_7G 0x00070000
0405 #define IXGB_PAP_TXPV_8G 0x00080000
0406 #define IXGB_PAP_TXPV_9G 0x00090000
0407 #define IXGB_PAP_TXPV_WAN 0x000F0000
0408
0409
0410 #define IXGB_PCSC1_LOOPBACK 0x00004000
0411
0412
0413 #define IXGB_PCSC2_PCS_TYPE_MASK 0x00000003
0414 #define IXGB_PCSC2_PCS_TYPE_10GBX 0x00000001
0415
0416
0417 #define IXGB_PCSS1_LOCAL_FAULT 0x00000080
0418 #define IXGB_PCSS1_RX_LINK_STATUS 0x00000004
0419
0420
0421 #define IXGB_PCSS2_DEV_PRES_MASK 0x0000C000
0422 #define IXGB_PCSS2_DEV_PRES 0x00004000
0423 #define IXGB_PCSS2_TX_LF 0x00000800
0424 #define IXGB_PCSS2_RX_LF 0x00000400
0425 #define IXGB_PCSS2_10GBW 0x00000004
0426 #define IXGB_PCSS2_10GBX 0x00000002
0427 #define IXGB_PCSS2_10GBR 0x00000001
0428
0429
0430 #define IXGB_XPCSS_ALIGN_STATUS 0x00001000
0431 #define IXGB_XPCSS_PATTERN_TEST 0x00000800
0432 #define IXGB_XPCSS_LANE_3_SYNC 0x00000008
0433 #define IXGB_XPCSS_LANE_2_SYNC 0x00000004
0434 #define IXGB_XPCSS_LANE_1_SYNC 0x00000002
0435 #define IXGB_XPCSS_LANE_0_SYNC 0x00000001
0436
0437
0438 #define IXGB_XPCSTC_BERT_TRIG 0x00200000
0439 #define IXGB_XPCSTC_BERT_SST 0x00100000
0440 #define IXGB_XPCSTC_BERT_PSZ_MASK 0x000C0000
0441 #define IXGB_XPCSTC_BERT_PSZ_SHIFT 17
0442 #define IXGB_XPCSTC_BERT_PSZ_INF 0x00000003
0443 #define IXGB_XPCSTC_BERT_PSZ_68 0x00000001
0444 #define IXGB_XPCSTC_BERT_PSZ_1028 0x00000000
0445
0446
0447
0448 #define IXGB_MSCA_NP_ADDR_MASK 0x0000FFFF
0449 #define IXGB_MSCA_NP_ADDR_SHIFT 0
0450
0451 #define IXGB_MSCA_DEV_TYPE_MASK 0x001F0000
0452 #define IXGB_MSCA_DEV_TYPE_SHIFT 16
0453 #define IXGB_MSCA_PHY_ADDR_MASK 0x03E00000
0454 #define IXGB_MSCA_PHY_ADDR_SHIFT 21
0455 #define IXGB_MSCA_OP_CODE_MASK 0x0C000000
0456
0457
0458
0459
0460 #define IXGB_MSCA_ADDR_CYCLE 0x00000000
0461 #define IXGB_MSCA_WRITE 0x04000000
0462 #define IXGB_MSCA_READ 0x08000000
0463 #define IXGB_MSCA_READ_AUTOINC 0x0C000000
0464 #define IXGB_MSCA_OP_CODE_SHIFT 26
0465 #define IXGB_MSCA_ST_CODE_MASK 0x30000000
0466
0467
0468 #define IXGB_MSCA_NEW_PROTOCOL 0x00000000
0469 #define IXGB_MSCA_OLD_PROTOCOL 0x10000000
0470 #define IXGB_MSCA_ST_CODE_SHIFT 28
0471
0472 #define IXGB_MSCA_MDI_COMMAND 0x40000000
0473
0474 #define IXGB_MSCA_MDI_IN_PROG_EN 0x80000000
0475
0476
0477 #define IXGB_MSRWD_WRITE_DATA_MASK 0x0000FFFF
0478 #define IXGB_MSRWD_WRITE_DATA_SHIFT 0
0479 #define IXGB_MSRWD_READ_DATA_MASK 0xFFFF0000
0480 #define IXGB_MSRWD_READ_DATA_SHIFT 16
0481
0482
0483 #define IXGB_PHY_ADDRESS 0x0
0484
0485 #define MDIO_PMA_PMD_XPAK_VENDOR_NAME 0x803A
0486
0487
0488 #define G6XXX_PMA_PMD_VS1 0xC001
0489 #define G6XXX_XGXS_XAUI_VS2 0x18
0490
0491 #define G6XXX_PMA_PMD_VS1_PLL_RESET 0x80
0492 #define G6XXX_PMA_PMD_VS1_REMOVE_PLL_RESET 0x00
0493 #define G6XXX_XGXS_XAUI_VS2_INPUT_MASK 0x0F
0494
0495
0496
0497
0498
0499
0500 struct ixgb_rx_desc {
0501 __le64 buff_addr;
0502 __le16 length;
0503 __le16 reserved;
0504 u8 status;
0505 u8 errors;
0506 __le16 special;
0507 };
0508
0509 #define IXGB_RX_DESC_STATUS_DD 0x01
0510 #define IXGB_RX_DESC_STATUS_EOP 0x02
0511 #define IXGB_RX_DESC_STATUS_IXSM 0x04
0512 #define IXGB_RX_DESC_STATUS_VP 0x08
0513 #define IXGB_RX_DESC_STATUS_TCPCS 0x20
0514 #define IXGB_RX_DESC_STATUS_IPCS 0x40
0515 #define IXGB_RX_DESC_STATUS_PIF 0x80
0516
0517 #define IXGB_RX_DESC_ERRORS_CE 0x01
0518 #define IXGB_RX_DESC_ERRORS_SE 0x02
0519 #define IXGB_RX_DESC_ERRORS_P 0x08
0520 #define IXGB_RX_DESC_ERRORS_TCPE 0x20
0521 #define IXGB_RX_DESC_ERRORS_IPE 0x40
0522 #define IXGB_RX_DESC_ERRORS_RXE 0x80
0523
0524 #define IXGB_RX_DESC_SPECIAL_VLAN_MASK 0x0FFF
0525 #define IXGB_RX_DESC_SPECIAL_PRI_MASK 0xE000
0526 #define IXGB_RX_DESC_SPECIAL_PRI_SHIFT 0x000D
0527
0528
0529
0530
0531
0532
0533 struct ixgb_tx_desc {
0534 __le64 buff_addr;
0535 __le32 cmd_type_len;
0536 u8 status;
0537 u8 popts;
0538 __le16 vlan;
0539 };
0540
0541 #define IXGB_TX_DESC_LENGTH_MASK 0x000FFFFF
0542 #define IXGB_TX_DESC_TYPE_MASK 0x00F00000
0543 #define IXGB_TX_DESC_TYPE_SHIFT 20
0544 #define IXGB_TX_DESC_CMD_MASK 0xFF000000
0545 #define IXGB_TX_DESC_CMD_SHIFT 24
0546 #define IXGB_TX_DESC_CMD_EOP 0x01000000
0547 #define IXGB_TX_DESC_CMD_TSE 0x04000000
0548 #define IXGB_TX_DESC_CMD_RS 0x08000000
0549 #define IXGB_TX_DESC_CMD_VLE 0x40000000
0550 #define IXGB_TX_DESC_CMD_IDE 0x80000000
0551
0552 #define IXGB_TX_DESC_TYPE 0x00100000
0553
0554 #define IXGB_TX_DESC_STATUS_DD 0x01
0555
0556 #define IXGB_TX_DESC_POPTS_IXSM 0x01
0557 #define IXGB_TX_DESC_POPTS_TXSM 0x02
0558 #define IXGB_TX_DESC_SPECIAL_PRI_SHIFT IXGB_RX_DESC_SPECIAL_PRI_SHIFT
0559
0560 struct ixgb_context_desc {
0561 u8 ipcss;
0562 u8 ipcso;
0563 __le16 ipcse;
0564 u8 tucss;
0565 u8 tucso;
0566 __le16 tucse;
0567 __le32 cmd_type_len;
0568 u8 status;
0569 u8 hdr_len;
0570 __le16 mss;
0571 };
0572
0573 #define IXGB_CONTEXT_DESC_CMD_TCP 0x01000000
0574 #define IXGB_CONTEXT_DESC_CMD_IP 0x02000000
0575 #define IXGB_CONTEXT_DESC_CMD_TSE 0x04000000
0576 #define IXGB_CONTEXT_DESC_CMD_RS 0x08000000
0577 #define IXGB_CONTEXT_DESC_CMD_IDE 0x80000000
0578
0579 #define IXGB_CONTEXT_DESC_TYPE 0x00000000
0580
0581 #define IXGB_CONTEXT_DESC_STATUS_DD 0x01
0582
0583
0584 #define IXGB_MC_TBL_SIZE 128
0585 #define IXGB_VLAN_FILTER_TBL_SIZE 128
0586 #define IXGB_RAR_ENTRIES 3
0587
0588 #define IXGB_MEMORY_REGISTER_BASE_ADDRESS 0
0589 #define ENET_HEADER_SIZE 14
0590 #define ENET_FCS_LENGTH 4
0591 #define IXGB_MAX_NUM_MULTICAST_ADDRESSES 128
0592 #define IXGB_MIN_ENET_FRAME_SIZE_WITHOUT_FCS 60
0593 #define IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS 1514
0594 #define IXGB_MAX_JUMBO_FRAME_SIZE 0x3F00
0595
0596
0597 #define IXGB_OPTICAL_PHY_ADDR 0x0
0598 #define IXGB_XAUII_PHY_ADDR 0x1
0599 #define IXGB_DIAG_PHY_ADDR 0x1F
0600
0601
0602 struct ixgb_flash_buffer {
0603 u8 manufacturer_id;
0604 u8 device_id;
0605 u8 filler1[0x2AA8];
0606 u8 cmd2;
0607 u8 filler2[0x2AAA];
0608 u8 cmd1;
0609 u8 filler3[0xAAAA];
0610 };
0611
0612
0613 struct ixgb_fc {
0614 u32 high_water;
0615 u32 low_water;
0616 u16 pause_time;
0617 bool send_xon;
0618 ixgb_fc_type type;
0619 };
0620
0621
0622 #define FC_DEFAULT_HI_THRESH (0x8000)
0623 #define FC_DEFAULT_LO_THRESH (0x4000)
0624 #define FC_DEFAULT_TX_TIMER (0x100)
0625
0626
0627 #define IXGB_MAX_PHY_REG_ADDRESS 0xFFFF
0628 #define IXGB_MAX_PHY_ADDRESS 31
0629 #define IXGB_MAX_PHY_DEV_TYPE 31
0630
0631
0632 struct ixgb_bus {
0633 ixgb_bus_speed speed;
0634 ixgb_bus_width width;
0635 ixgb_bus_type type;
0636 };
0637
0638 struct ixgb_hw {
0639 u8 __iomem *hw_addr;
0640 void *back;
0641 struct ixgb_fc fc;
0642 struct ixgb_bus bus;
0643 u32 phy_id;
0644 u32 phy_addr;
0645 ixgb_mac_type mac_type;
0646 ixgb_phy_type phy_type;
0647 u32 max_frame_size;
0648 u32 mc_filter_type;
0649 u32 num_mc_addrs;
0650 u8 curr_mac_addr[ETH_ALEN];
0651 u32 num_tx_desc;
0652 u32 num_rx_desc;
0653 u32 rx_buffer_size;
0654 bool link_up;
0655 bool adapter_stopped;
0656 u16 device_id;
0657 u16 vendor_id;
0658 u8 revision_id;
0659 u16 subsystem_vendor_id;
0660 u16 subsystem_id;
0661 u32 bar0;
0662 u32 bar1;
0663 u32 bar2;
0664 u32 bar3;
0665 u16 pci_cmd_word;
0666 __le16 eeprom[IXGB_EEPROM_SIZE];
0667 unsigned long io_base;
0668 u32 lastLFC;
0669 u32 lastRFC;
0670 };
0671
0672
0673 struct ixgb_hw_stats {
0674 u64 tprl;
0675 u64 tprh;
0676 u64 gprcl;
0677 u64 gprch;
0678 u64 bprcl;
0679 u64 bprch;
0680 u64 mprcl;
0681 u64 mprch;
0682 u64 uprcl;
0683 u64 uprch;
0684 u64 vprcl;
0685 u64 vprch;
0686 u64 jprcl;
0687 u64 jprch;
0688 u64 gorcl;
0689 u64 gorch;
0690 u64 torl;
0691 u64 torh;
0692 u64 rnbc;
0693 u64 ruc;
0694 u64 roc;
0695 u64 rlec;
0696 u64 crcerrs;
0697 u64 icbc;
0698 u64 ecbc;
0699 u64 mpc;
0700 u64 tptl;
0701 u64 tpth;
0702 u64 gptcl;
0703 u64 gptch;
0704 u64 bptcl;
0705 u64 bptch;
0706 u64 mptcl;
0707 u64 mptch;
0708 u64 uptcl;
0709 u64 uptch;
0710 u64 vptcl;
0711 u64 vptch;
0712 u64 jptcl;
0713 u64 jptch;
0714 u64 gotcl;
0715 u64 gotch;
0716 u64 totl;
0717 u64 toth;
0718 u64 dc;
0719 u64 plt64c;
0720 u64 tsctc;
0721 u64 tsctfc;
0722 u64 ibic;
0723 u64 rfc;
0724 u64 lfc;
0725 u64 pfrc;
0726 u64 pftc;
0727 u64 mcfrc;
0728 u64 mcftc;
0729 u64 xonrxc;
0730 u64 xontxc;
0731 u64 xoffrxc;
0732 u64 xofftxc;
0733 u64 rjc;
0734 };
0735
0736
0737 bool ixgb_adapter_stop(struct ixgb_hw *hw);
0738 bool ixgb_init_hw(struct ixgb_hw *hw);
0739 bool ixgb_adapter_start(struct ixgb_hw *hw);
0740 void ixgb_check_for_link(struct ixgb_hw *hw);
0741 bool ixgb_check_for_bad_link(struct ixgb_hw *hw);
0742
0743 void ixgb_rar_set(struct ixgb_hw *hw, const u8 *addr, u32 index);
0744
0745
0746 void ixgb_mc_addr_list_update(struct ixgb_hw *hw, u8 *mc_addr_list,
0747 u32 mc_addr_count, u32 pad);
0748
0749
0750 void ixgb_write_vfta(struct ixgb_hw *hw, u32 offset, u32 value);
0751
0752
0753 void ixgb_get_ee_mac_addr(struct ixgb_hw *hw, u8 *mac_addr);
0754 u32 ixgb_get_ee_pba_number(struct ixgb_hw *hw);
0755 u16 ixgb_get_ee_device_id(struct ixgb_hw *hw);
0756 bool ixgb_get_eeprom_data(struct ixgb_hw *hw);
0757 __le16 ixgb_get_eeprom_word(struct ixgb_hw *hw, u16 index);
0758
0759
0760 void ixgb_led_on(struct ixgb_hw *hw);
0761 void ixgb_led_off(struct ixgb_hw *hw);
0762 void ixgb_write_pci_cfg(struct ixgb_hw *hw,
0763 u32 reg,
0764 u16 * value);
0765
0766
0767 #endif