[S2IO]: Handle and monitor all of the device errors and alarms
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / net / s2io.h
index 420fefb..1e2e72d 100644 (file)
@@ -91,7 +91,7 @@ struct swStat {
        unsigned long long serious_err_cnt;
        unsigned long long soft_reset_cnt;
        unsigned long long fifo_full_cnt;
-       unsigned long long ring_full_cnt;
+       unsigned long long ring_full_cnt[8];
        /* LRO statistics */
        unsigned long long clubbed_frms_cnt;
        unsigned long long sending_both;
@@ -126,6 +126,26 @@ struct swStat {
        unsigned long long rx_buf_size_err_cnt;
        unsigned long long rx_rxd_corrupt_cnt;
        unsigned long long rx_unkn_err_cnt;
+
+       /* Error/alarm statistics*/
+       unsigned long long tda_err_cnt;
+       unsigned long long pfc_err_cnt;
+       unsigned long long pcc_err_cnt;
+       unsigned long long tti_err_cnt;
+       unsigned long long lso_err_cnt;
+       unsigned long long tpa_err_cnt;
+       unsigned long long sm_err_cnt;
+       unsigned long long mac_tmac_err_cnt;
+       unsigned long long mac_rmac_err_cnt;
+       unsigned long long xgxs_txgxs_err_cnt;
+       unsigned long long xgxs_rxgxs_err_cnt;
+       unsigned long long rc_err_cnt;
+       unsigned long long prc_pcix_err_cnt;
+       unsigned long long rpa_err_cnt;
+       unsigned long long rda_err_cnt;
+       unsigned long long rti_err_cnt;
+       unsigned long long mc_err_cnt;
+
 };
 
 /* Xpak releated alarm and warnings */
@@ -412,6 +432,11 @@ struct config_param {
        struct tx_fifo_config tx_cfg[MAX_TX_FIFOS];     /*Per-Tx FIFO config */
        u32 max_txds;           /*Max no. of Tx buffer descriptor per TxDL */
        u64 tx_intr_type;
+#define INTA   0
+#define MSI_X  2
+       u8 intr_type;
+       u8 napi;
+
        /* Specifies if Tx Intr is UTILZ or PER_LIST type. */
 
 /* Rx Side */
@@ -862,6 +887,8 @@ struct s2io_nic {
        struct vlan_group *vlgrp;
 #define MSIX_FLG                0xA5
        struct msix_entry *entries;
+       int msi_detected;
+       wait_queue_head_t msi_wait;
        struct s2io_msix_entry *s2io_entries;
        char desc[MAX_REQUESTED_MSI_X][25];
 
@@ -886,6 +913,7 @@ struct s2io_nic {
 
        spinlock_t      rx_lock;
        atomic_t        isr_cnt;
+       u64             general_int_mask;
        u64 *ufo_in_band_v;
 #define VPD_STRING_LEN 80
        u8  product_name[VPD_STRING_LEN];
@@ -1010,7 +1038,7 @@ static void free_shared_mem(struct s2io_nic *sp);
 static int init_nic(struct s2io_nic *nic);
 static void rx_intr_handler(struct ring_info *ring_data);
 static void tx_intr_handler(struct fifo_info *fifo_data);
-static void alarm_intr_handler(struct s2io_nic *sp);
+static void s2io_handle_errors(void * dev_id);
 
 static int s2io_starter(void);
 static void s2io_closer(void);