diff options
Diffstat (limited to 'drivers/net/s2io.h')
-rw-r--r-- | drivers/net/s2io.h | 59 |
1 files changed, 48 insertions, 11 deletions
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 0a0b5b29d81e..3203732a668d 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -31,6 +31,8 @@ | |||
31 | #define SUCCESS 0 | 31 | #define SUCCESS 0 |
32 | #define FAILURE -1 | 32 | #define FAILURE -1 |
33 | 33 | ||
34 | #define CHECKBIT(value, nbit) (value & (1 << nbit)) | ||
35 | |||
34 | /* Maximum time to flicker LED when asked to identify NIC using ethtool */ | 36 | /* Maximum time to flicker LED when asked to identify NIC using ethtool */ |
35 | #define MAX_FLICKER_TIME 60000 /* 60 Secs */ | 37 | #define MAX_FLICKER_TIME 60000 /* 60 Secs */ |
36 | 38 | ||
@@ -78,6 +80,11 @@ static int debug_level = ERR_DBG; | |||
78 | typedef struct { | 80 | typedef struct { |
79 | unsigned long long single_ecc_errs; | 81 | unsigned long long single_ecc_errs; |
80 | unsigned long long double_ecc_errs; | 82 | unsigned long long double_ecc_errs; |
83 | unsigned long long parity_err_cnt; | ||
84 | unsigned long long serious_err_cnt; | ||
85 | unsigned long long soft_reset_cnt; | ||
86 | unsigned long long fifo_full_cnt; | ||
87 | unsigned long long ring_full_cnt; | ||
81 | /* LRO statistics */ | 88 | /* LRO statistics */ |
82 | unsigned long long clubbed_frms_cnt; | 89 | unsigned long long clubbed_frms_cnt; |
83 | unsigned long long sending_both; | 90 | unsigned long long sending_both; |
@@ -87,6 +94,25 @@ typedef struct { | |||
87 | unsigned long long num_aggregations; | 94 | unsigned long long num_aggregations; |
88 | } swStat_t; | 95 | } swStat_t; |
89 | 96 | ||
97 | /* Xpak releated alarm and warnings */ | ||
98 | typedef struct { | ||
99 | u64 alarm_transceiver_temp_high; | ||
100 | u64 alarm_transceiver_temp_low; | ||
101 | u64 alarm_laser_bias_current_high; | ||
102 | u64 alarm_laser_bias_current_low; | ||
103 | u64 alarm_laser_output_power_high; | ||
104 | u64 alarm_laser_output_power_low; | ||
105 | u64 warn_transceiver_temp_high; | ||
106 | u64 warn_transceiver_temp_low; | ||
107 | u64 warn_laser_bias_current_high; | ||
108 | u64 warn_laser_bias_current_low; | ||
109 | u64 warn_laser_output_power_high; | ||
110 | u64 warn_laser_output_power_low; | ||
111 | u64 xpak_regs_stat; | ||
112 | u32 xpak_timer_count; | ||
113 | } xpakStat_t; | ||
114 | |||
115 | |||
90 | /* The statistics block of Xena */ | 116 | /* The statistics block of Xena */ |
91 | typedef struct stat_block { | 117 | typedef struct stat_block { |
92 | /* Tx MAC statistics counters. */ | 118 | /* Tx MAC statistics counters. */ |
@@ -263,7 +289,9 @@ typedef struct stat_block { | |||
263 | u32 rmac_accepted_ip_oflow; | 289 | u32 rmac_accepted_ip_oflow; |
264 | u32 reserved_14; | 290 | u32 reserved_14; |
265 | u32 link_fault_cnt; | 291 | u32 link_fault_cnt; |
292 | u8 buffer[20]; | ||
266 | swStat_t sw_stat; | 293 | swStat_t sw_stat; |
294 | xpakStat_t xpak_stat; | ||
267 | } StatInfo_t; | 295 | } StatInfo_t; |
268 | 296 | ||
269 | /* | 297 | /* |
@@ -659,7 +687,8 @@ typedef struct { | |||
659 | } usr_addr_t; | 687 | } usr_addr_t; |
660 | 688 | ||
661 | /* Default Tunable parameters of the NIC. */ | 689 | /* Default Tunable parameters of the NIC. */ |
662 | #define DEFAULT_FIFO_LEN 4096 | 690 | #define DEFAULT_FIFO_0_LEN 4096 |
691 | #define DEFAULT_FIFO_1_7_LEN 512 | ||
663 | #define SMALL_BLK_CNT 30 | 692 | #define SMALL_BLK_CNT 30 |
664 | #define LARGE_BLK_CNT 100 | 693 | #define LARGE_BLK_CNT 100 |
665 | 694 | ||
@@ -732,7 +761,7 @@ struct s2io_nic { | |||
732 | int device_close_flag; | 761 | int device_close_flag; |
733 | int device_enabled_once; | 762 | int device_enabled_once; |
734 | 763 | ||
735 | char name[50]; | 764 | char name[60]; |
736 | struct tasklet_struct task; | 765 | struct tasklet_struct task; |
737 | volatile unsigned long tasklet_status; | 766 | volatile unsigned long tasklet_status; |
738 | 767 | ||
@@ -803,6 +832,8 @@ struct s2io_nic { | |||
803 | char desc1[35]; | 832 | char desc1[35]; |
804 | char desc2[35]; | 833 | char desc2[35]; |
805 | 834 | ||
835 | int avail_msix_vectors; /* No. of MSI-X vectors granted by system */ | ||
836 | |||
806 | struct msix_info_st msix_info[0x3f]; | 837 | struct msix_info_st msix_info[0x3f]; |
807 | 838 | ||
808 | #define XFRAME_I_DEVICE 1 | 839 | #define XFRAME_I_DEVICE 1 |
@@ -824,6 +855,8 @@ struct s2io_nic { | |||
824 | spinlock_t rx_lock; | 855 | spinlock_t rx_lock; |
825 | atomic_t isr_cnt; | 856 | atomic_t isr_cnt; |
826 | u64 *ufo_in_band_v; | 857 | u64 *ufo_in_band_v; |
858 | #define VPD_PRODUCT_NAME_LEN 50 | ||
859 | u8 product_name[VPD_PRODUCT_NAME_LEN]; | ||
827 | }; | 860 | }; |
828 | 861 | ||
829 | #define RESET_ERROR 1; | 862 | #define RESET_ERROR 1; |
@@ -848,28 +881,32 @@ static inline void writeq(u64 val, void __iomem *addr) | |||
848 | writel((u32) (val), addr); | 881 | writel((u32) (val), addr); |
849 | writel((u32) (val >> 32), (addr + 4)); | 882 | writel((u32) (val >> 32), (addr + 4)); |
850 | } | 883 | } |
884 | #endif | ||
851 | 885 | ||
852 | /* In 32 bit modes, some registers have to be written in a | 886 | /* |
853 | * particular order to expect correct hardware operation. The | 887 | * Some registers have to be written in a particular order to |
854 | * macro SPECIAL_REG_WRITE is used to perform such ordered | 888 | * expect correct hardware operation. The macro SPECIAL_REG_WRITE |
855 | * writes. Defines UF (Upper First) and LF (Lower First) will | 889 | * is used to perform such ordered writes. Defines UF (Upper First) |
856 | * be used to specify the required write order. | 890 | * and LF (Lower First) will be used to specify the required write order. |
857 | */ | 891 | */ |
858 | #define UF 1 | 892 | #define UF 1 |
859 | #define LF 2 | 893 | #define LF 2 |
860 | static inline void SPECIAL_REG_WRITE(u64 val, void __iomem *addr, int order) | 894 | static inline void SPECIAL_REG_WRITE(u64 val, void __iomem *addr, int order) |
861 | { | 895 | { |
896 | u32 ret; | ||
897 | |||
862 | if (order == LF) { | 898 | if (order == LF) { |
863 | writel((u32) (val), addr); | 899 | writel((u32) (val), addr); |
900 | ret = readl(addr); | ||
864 | writel((u32) (val >> 32), (addr + 4)); | 901 | writel((u32) (val >> 32), (addr + 4)); |
902 | ret = readl(addr + 4); | ||
865 | } else { | 903 | } else { |
866 | writel((u32) (val >> 32), (addr + 4)); | 904 | writel((u32) (val >> 32), (addr + 4)); |
905 | ret = readl(addr + 4); | ||
867 | writel((u32) (val), addr); | 906 | writel((u32) (val), addr); |
907 | ret = readl(addr); | ||
868 | } | 908 | } |
869 | } | 909 | } |
870 | #else | ||
871 | #define SPECIAL_REG_WRITE(val, addr, dummy) writeq(val, addr) | ||
872 | #endif | ||
873 | 910 | ||
874 | /* Interrupt related values of Xena */ | 911 | /* Interrupt related values of Xena */ |
875 | 912 | ||
@@ -965,7 +1002,7 @@ static int verify_xena_quiescence(nic_t *sp, u64 val64, int flag); | |||
965 | static struct ethtool_ops netdev_ethtool_ops; | 1002 | static struct ethtool_ops netdev_ethtool_ops; |
966 | static void s2io_set_link(unsigned long data); | 1003 | static void s2io_set_link(unsigned long data); |
967 | static int s2io_set_swapper(nic_t * sp); | 1004 | static int s2io_set_swapper(nic_t * sp); |
968 | static void s2io_card_down(nic_t *nic); | 1005 | static void s2io_card_down(nic_t *nic, int flag); |
969 | static int s2io_card_up(nic_t *nic); | 1006 | static int s2io_card_up(nic_t *nic); |
970 | static int get_xena_rev_id(struct pci_dev *pdev); | 1007 | static int get_xena_rev_id(struct pci_dev *pdev); |
971 | static void restore_xmsi_data(nic_t *nic); | 1008 | static void restore_xmsi_data(nic_t *nic); |