~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/net/e1000e/hw.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*******************************************************************************
2
2
 
3
3
  Intel PRO/1000 Linux driver
4
 
  Copyright(c) 1999 - 2008 Intel Corporation.
 
4
  Copyright(c) 1999 - 2011 Intel Corporation.
5
5
 
6
6
  This program is free software; you can redistribute it and/or modify it
7
7
  under the terms and conditions of the GNU General Public License,
57
57
        E1000_SCTL     = 0x00024, /* SerDes Control - RW */
58
58
        E1000_FCAL     = 0x00028, /* Flow Control Address Low - RW */
59
59
        E1000_FCAH     = 0x0002C, /* Flow Control Address High -RW */
 
60
        E1000_FEXTNVM4 = 0x00024, /* Future Extended NVM 4 - RW */
60
61
        E1000_FEXTNVM  = 0x00028, /* Future Extended NVM - RW */
61
62
        E1000_FCT      = 0x00030, /* Flow Control Type - RW */
62
63
        E1000_VET      = 0x00038, /* VLAN Ether Type - RW */
82
83
        E1000_EXTCNF_CTRL  = 0x00F00, /* Extended Configuration Control */
83
84
        E1000_EXTCNF_SIZE  = 0x00F08, /* Extended Configuration Size */
84
85
        E1000_PHY_CTRL     = 0x00F10, /* PHY Control Register in CSR */
 
86
#define E1000_POEMB     E1000_PHY_CTRL  /* PHY OEM Bits */
85
87
        E1000_PBA      = 0x01000, /* Packet Buffer Allocation - RW */
86
88
        E1000_PBS      = 0x01008, /* Packet Buffer Size */
87
89
        E1000_EEMNGCTL = 0x01010, /* MNG EEprom Control */
100
102
        E1000_RDTR     = 0x02820, /* Rx Delay Timer - RW */
101
103
        E1000_RXDCTL_BASE = 0x02828, /* Rx Descriptor Control - RW */
102
104
#define E1000_RXDCTL(_n)   (E1000_RXDCTL_BASE + (_n << 8))
103
 
        E1000_RADV     = 0x0282C, /* RX Interrupt Absolute Delay Timer - RW */
 
105
        E1000_RADV     = 0x0282C, /* Rx Interrupt Absolute Delay Timer - RW */
104
106
 
105
107
/* Convenience macros
106
108
 *
208
210
 
209
211
        E1000_KMRNCTRLSTA = 0x00034, /* MAC-PHY interface - RW */
210
212
        E1000_MANC2H    = 0x05860, /* Management Control To Host - RW */
 
213
        E1000_MDEF_BASE = 0x05890, /* Management Decision Filters */
 
214
#define E1000_MDEF(_n)   (E1000_MDEF_BASE + ((_n) * 4))
211
215
        E1000_SW_FW_SYNC = 0x05B5C, /* Software-Firmware Synchronization - RW */
212
216
        E1000_GCR       = 0x05B00, /* PCI-Ex Control */
213
217
        E1000_GCR2      = 0x05B64, /* PCI-Ex Control #2 */
215
219
        E1000_SWSM      = 0x05B50, /* SW Semaphore */
216
220
        E1000_FWSM      = 0x05B54, /* FW Semaphore */
217
221
        E1000_SWSM2     = 0x05B58, /* Driver-only SW semaphore */
218
 
        E1000_CRC_OFFSET = 0x05F50, /* CRC Offset register */
 
222
        E1000_FFLT_DBG  = 0x05F04, /* Debug Register */
 
223
        E1000_PCH_RAICC_BASE = 0x05F50, /* Receive Address Initial CRC */
 
224
#define E1000_PCH_RAICC(_n)     (E1000_PCH_RAICC_BASE + ((_n) * 4))
 
225
#define E1000_CRC_OFFSET        E1000_PCH_RAICC_BASE
219
226
        E1000_HICR      = 0x08F00, /* Host Interface Control */
220
227
};
221
228
 
222
 
/* RSS registers */
 
229
#define E1000_MAX_PHY_ADDR              4
223
230
 
224
231
/* IGP01E1000 Specific Registers */
225
232
#define IGP01E1000_PHY_PORT_CONFIG      0x10 /* Port Config */
301
308
#define E1000_KMRNCTRLSTA_OFFSET        0x001F0000
302
309
#define E1000_KMRNCTRLSTA_OFFSET_SHIFT  16
303
310
#define E1000_KMRNCTRLSTA_REN           0x00200000
 
311
#define E1000_KMRNCTRLSTA_CTRL_OFFSET   0x1    /* Kumeran Control */
304
312
#define E1000_KMRNCTRLSTA_DIAG_OFFSET   0x3    /* Kumeran Diagnostic */
 
313
#define E1000_KMRNCTRLSTA_TIMEOUTS      0x4    /* Kumeran Timeouts */
 
314
#define E1000_KMRNCTRLSTA_INBAND_PARAM  0x9    /* Kumeran InBand Parameters */
305
315
#define E1000_KMRNCTRLSTA_DIAG_NELPBK   0x1000 /* Nearend Loopback mode */
306
316
#define E1000_KMRNCTRLSTA_K1_CONFIG     0x7
307
 
#define E1000_KMRNCTRLSTA_K1_ENABLE     0x140E
308
 
#define E1000_KMRNCTRLSTA_K1_DISABLE    0x1400
 
317
#define E1000_KMRNCTRLSTA_K1_ENABLE     0x0002
 
318
#define E1000_KMRNCTRLSTA_HD_CTRL       0x10   /* Kumeran HD Control */
309
319
 
310
320
#define IFE_PHY_EXTENDED_STATUS_CONTROL 0x10
311
321
#define IFE_PHY_SPECIAL_CONTROL         0x11 /* 100BaseTx PHY Special Control */
356
366
#define E1000_DEV_ID_80003ES2LAN_COPPER_SPT     0x10BA
357
367
#define E1000_DEV_ID_80003ES2LAN_SERDES_SPT     0x10BB
358
368
 
 
369
#define E1000_DEV_ID_ICH8_82567V_3              0x1501
359
370
#define E1000_DEV_ID_ICH8_IGP_M_AMT             0x1049
360
371
#define E1000_DEV_ID_ICH8_IGP_AMT               0x104A
361
372
#define E1000_DEV_ID_ICH8_IGP_C                 0x104B
377
388
#define E1000_DEV_ID_ICH10_R_BM_V               0x10CE
378
389
#define E1000_DEV_ID_ICH10_D_BM_LM              0x10DE
379
390
#define E1000_DEV_ID_ICH10_D_BM_LF              0x10DF
 
391
#define E1000_DEV_ID_ICH10_D_BM_V               0x1525
380
392
#define E1000_DEV_ID_PCH_M_HV_LM                0x10EA
381
393
#define E1000_DEV_ID_PCH_M_HV_LC                0x10EB
382
394
#define E1000_DEV_ID_PCH_D_HV_DM                0x10EF
383
395
#define E1000_DEV_ID_PCH_D_HV_DC                0x10F0
 
396
#define E1000_DEV_ID_PCH2_LV_LM                 0x1502
 
397
#define E1000_DEV_ID_PCH2_LV_V                  0x1503
384
398
 
385
399
#define E1000_REVISION_4 4
386
400
 
387
401
#define E1000_FUNC_1 1
388
402
 
 
403
#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN0   0
 
404
#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN1   3
 
405
 
389
406
enum e1000_mac_type {
390
407
        e1000_82571,
391
408
        e1000_82572,
397
414
        e1000_ich9lan,
398
415
        e1000_ich10lan,
399
416
        e1000_pchlan,
 
417
        e1000_pch2lan,
400
418
};
401
419
 
402
420
enum e1000_media_type {
433
451
        e1000_phy_bm,
434
452
        e1000_phy_82578,
435
453
        e1000_phy_82577,
 
454
        e1000_phy_82579,
436
455
};
437
456
 
438
457
enum e1000_bus_width {
741
760
        s32  (*check_for_link)(struct e1000_hw *);
742
761
        s32  (*cleanup_led)(struct e1000_hw *);
743
762
        void (*clear_hw_cntrs)(struct e1000_hw *);
 
763
        void (*clear_vfta)(struct e1000_hw *);
744
764
        s32  (*get_bus_info)(struct e1000_hw *);
 
765
        void (*set_lan_id)(struct e1000_hw *);
745
766
        s32  (*get_link_up_info)(struct e1000_hw *, u16 *, u16 *);
746
767
        s32  (*led_on)(struct e1000_hw *);
747
768
        s32  (*led_off)(struct e1000_hw *);
748
 
        void (*update_mc_addr_list)(struct e1000_hw *, u8 *, u32, u32, u32);
 
769
        void (*update_mc_addr_list)(struct e1000_hw *, u8 *, u32);
749
770
        s32  (*reset_hw)(struct e1000_hw *);
750
771
        s32  (*init_hw)(struct e1000_hw *);
751
772
        s32  (*setup_link)(struct e1000_hw *);
752
773
        s32  (*setup_physical_interface)(struct e1000_hw *);
753
774
        s32  (*setup_led)(struct e1000_hw *);
 
775
        void (*write_vfta)(struct e1000_hw *, u32, u32);
 
776
        s32  (*read_mac_addr)(struct e1000_hw *);
754
777
};
755
778
 
756
779
/* Function pointers for the PHY. */
757
780
struct e1000_phy_operations {
758
 
        s32  (*acquire_phy)(struct e1000_hw *);
 
781
        s32  (*acquire)(struct e1000_hw *);
 
782
        s32  (*cfg_on_link_up)(struct e1000_hw *);
759
783
        s32  (*check_polarity)(struct e1000_hw *);
760
784
        s32  (*check_reset_block)(struct e1000_hw *);
761
 
        s32  (*commit_phy)(struct e1000_hw *);
 
785
        s32  (*commit)(struct e1000_hw *);
762
786
        s32  (*force_speed_duplex)(struct e1000_hw *);
763
787
        s32  (*get_cfg_done)(struct e1000_hw *hw);
764
788
        s32  (*get_cable_length)(struct e1000_hw *);
765
 
        s32  (*get_phy_info)(struct e1000_hw *);
766
 
        s32  (*read_phy_reg)(struct e1000_hw *, u32, u16 *);
767
 
        s32  (*read_phy_reg_locked)(struct e1000_hw *, u32, u16 *);
768
 
        void (*release_phy)(struct e1000_hw *);
769
 
        s32  (*reset_phy)(struct e1000_hw *);
 
789
        s32  (*get_info)(struct e1000_hw *);
 
790
        s32  (*read_reg)(struct e1000_hw *, u32, u16 *);
 
791
        s32  (*read_reg_locked)(struct e1000_hw *, u32, u16 *);
 
792
        void (*release)(struct e1000_hw *);
 
793
        s32  (*reset)(struct e1000_hw *);
770
794
        s32  (*set_d0_lplu_state)(struct e1000_hw *, bool);
771
795
        s32  (*set_d3_lplu_state)(struct e1000_hw *, bool);
772
 
        s32  (*write_phy_reg)(struct e1000_hw *, u32, u16);
773
 
        s32  (*write_phy_reg_locked)(struct e1000_hw *, u32, u16);
774
 
        s32  (*cfg_on_link_up)(struct e1000_hw *);
 
796
        s32  (*write_reg)(struct e1000_hw *, u32, u16);
 
797
        s32  (*write_reg_locked)(struct e1000_hw *, u32, u16);
 
798
        void (*power_up)(struct e1000_hw *);
 
799
        void (*power_down)(struct e1000_hw *);
775
800
};
776
801
 
777
802
/* Function pointers for the NVM. */
778
803
struct e1000_nvm_operations {
779
 
        s32  (*acquire_nvm)(struct e1000_hw *);
780
 
        s32  (*read_nvm)(struct e1000_hw *, u16, u16, u16 *);
781
 
        void (*release_nvm)(struct e1000_hw *);
782
 
        s32  (*update_nvm)(struct e1000_hw *);
 
804
        s32  (*acquire)(struct e1000_hw *);
 
805
        s32  (*read)(struct e1000_hw *, u16, u16, u16 *);
 
806
        void (*release)(struct e1000_hw *);
 
807
        s32  (*update)(struct e1000_hw *);
783
808
        s32  (*valid_led_default)(struct e1000_hw *, u16 *);
784
 
        s32  (*validate_nvm)(struct e1000_hw *);
785
 
        s32  (*write_nvm)(struct e1000_hw *, u16, u16, u16 *);
 
809
        s32  (*validate)(struct e1000_hw *);
 
810
        s32  (*write)(struct e1000_hw *, u16, u16, u16 *);
786
811
};
787
812
 
788
813
struct e1000_mac_info {
807
832
        u16 ifs_ratio;
808
833
        u16 ifs_step_size;
809
834
        u16 mta_reg_count;
 
835
 
 
836
        /* Maximum size of the MTA register table in all supported adapters */
 
837
        #define MAX_MTA_REG 128
 
838
        u32 mta_shadow[MAX_MTA_REG];
810
839
        u16 rar_entry_count;
811
840
 
812
841
        u8  forced_speed_duplex;
813
842
 
 
843
        bool adaptive_ifs;
 
844
        bool has_fwsm;
814
845
        bool arc_subsystem_valid;
815
846
        bool autoneg;
816
847
        bool autoneg_failed;
881
912
        u32 high_water;          /* Flow control high-water mark */
882
913
        u32 low_water;           /* Flow control low-water mark */
883
914
        u16 pause_time;          /* Flow control pause timer */
 
915
        u16 refresh_time;        /* Flow control refresh timer */
884
916
        bool send_xon;           /* Flow control send XON */
885
917
        bool strict_ieee;        /* Strict IEEE mode */
886
918
        enum e1000_fc_mode current_mode; /* FC mode in effect */
889
921
 
890
922
struct e1000_dev_spec_82571 {
891
923
        bool laa_is_present;
892
 
        bool alt_mac_addr_is_present;
893
924
        u32 smb_counter;
894
925
};
895
926
 
 
927
struct e1000_dev_spec_80003es2lan {
 
928
        bool  mdic_wa_enable;
 
929
};
 
930
 
896
931
struct e1000_shadow_ram {
897
932
        u16  value;
898
933
        bool modified;
904
939
        bool kmrn_lock_loss_workaround_enabled;
905
940
        struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS];
906
941
        bool nvm_k1_enabled;
 
942
        bool eee_disable;
907
943
};
908
944
 
909
945
struct e1000_hw {
921
957
 
922
958
        union {
923
959
                struct e1000_dev_spec_82571     e82571;
 
960
                struct e1000_dev_spec_80003es2lan e80003es2lan;
924
961
                struct e1000_dev_spec_ich8lan   ich8lan;
925
962
        } dev_spec;
926
963
};
927
964
 
928
 
#ifdef DEBUG
929
 
#define hw_dbg(hw, format, arg...) \
930
 
        printk(KERN_DEBUG "%s: " format, e1000e_get_hw_dev_name(hw), ##arg)
931
 
#else
932
 
static inline int __attribute__ ((format (printf, 2, 3)))
933
 
hw_dbg(struct e1000_hw *hw, const char *format, ...)
934
 
{
935
 
        return 0;
936
 
}
937
 
#endif
938
 
 
939
965
#endif