net/sfc/base: import PHY flags control
[dpdk.git] / drivers / net / sfc / base / efx_impl.h
index 10ab36b..489fcbc 100644 (file)
 #include "hunt_impl.h"
 #endif /* EFSYS_OPT_HUNTINGTON */
 
+#if EFSYS_OPT_MEDFORD
+#include "medford_impl.h"
+#endif /* EFSYS_OPT_MEDFORD */
+
 #if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
 #include "ef10_impl.h"
 #endif /* (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */
@@ -93,6 +97,9 @@ typedef struct efx_ev_ops_s {
        efx_rc_t        (*eevo_qprime)(efx_evq_t *, unsigned int);
        void            (*eevo_qpost)(efx_evq_t *, uint16_t);
        efx_rc_t        (*eevo_qmoderate)(efx_evq_t *, unsigned int);
+#if EFSYS_OPT_QSTATS
+       void            (*eevo_qstats_update)(efx_evq_t *, efsys_stat_t *);
+#endif
 } efx_ev_ops_t;
 
 typedef struct efx_tx_ops_s {
@@ -132,6 +139,10 @@ typedef struct efx_tx_ops_s {
                                                efx_desc_t *, int);
        void            (*etxo_qdesc_vlantci_create)(efx_txq_t *, uint16_t,
                                                efx_desc_t *);
+#if EFSYS_OPT_QSTATS
+       void            (*etxo_qstats_update)(efx_txq_t *,
+                                             efsys_stat_t *);
+#endif
 } efx_tx_ops_t;
 
 typedef struct efx_rx_ops_s {
@@ -171,6 +182,14 @@ typedef struct efx_phy_ops_s {
        efx_rc_t        (*epo_reconfigure)(efx_nic_t *);
        efx_rc_t        (*epo_verify)(efx_nic_t *);
        efx_rc_t        (*epo_oui_get)(efx_nic_t *, uint32_t *);
+#if EFSYS_OPT_BIST
+       efx_rc_t        (*epo_bist_enable_offline)(efx_nic_t *);
+       efx_rc_t        (*epo_bist_start)(efx_nic_t *, efx_bist_type_t);
+       efx_rc_t        (*epo_bist_poll)(efx_nic_t *, efx_bist_type_t,
+                                        efx_bist_result_t *, uint32_t *,
+                                        unsigned long *, size_t);
+       void            (*epo_bist_stop)(efx_nic_t *, efx_bist_type_t);
+#endif /* EFSYS_OPT_BIST */
 } efx_phy_ops_t;
 
 #if EFSYS_OPT_FILTER
@@ -218,6 +237,9 @@ typedef struct efx_port_s {
        uint8_t                 ep_mulcst_addr_list[EFX_MAC_ADDR_LEN *
                                                    EFX_MAC_MULTICAST_LIST_MAX];
        uint32_t                ep_mulcst_addr_count;
+#if EFSYS_OPT_PHY_FLAGS
+       uint32_t                ep_phy_flags;
+#endif /* EFSYS_OPT_PHY_FLAGS */
        efx_phy_media_type_t    ep_fixed_port_type;
        efx_phy_media_type_t    ep_module_type;
        uint32_t                ep_adv_cap_mask;
@@ -226,6 +248,9 @@ typedef struct efx_port_s {
        uint32_t                ep_phy_cap_mask;
        boolean_t               ep_mac_drain;
        boolean_t               ep_mac_stats_pending;
+#if EFSYS_OPT_BIST
+       efx_bist_type_t         ep_current_bist;
+#endif
        const efx_mac_ops_t     *ep_emop;
        const efx_phy_ops_t     *ep_epop;
 } efx_port_t;
@@ -267,6 +292,9 @@ typedef struct efx_nic_ops_s {
        efx_rc_t        (*eno_get_vi_pool)(efx_nic_t *, uint32_t *);
        efx_rc_t        (*eno_get_bar_region)(efx_nic_t *, efx_nic_region_t,
                                        uint32_t *, size_t *);
+#if EFSYS_OPT_DIAG
+       efx_rc_t        (*eno_register_test)(efx_nic_t *);
+#endif /* EFSYS_OPT_DIAG */
        void            (*eno_fini)(efx_nic_t *);
        void            (*eno_unprobe)(efx_nic_t *);
 } efx_nic_ops_t;
@@ -461,6 +489,9 @@ struct efx_evq_s {
        unsigned int                    ee_index;
        unsigned int                    ee_mask;
        efsys_mem_t                     *ee_esmp;
+#if EFSYS_OPT_QSTATS
+       uint32_t                        ee_stat[EV_NQSTATS];
+#endif /* EFSYS_OPT_QSTATS */
 
        efx_ev_handler_t                ee_rx;
        efx_ev_handler_t                ee_tx;
@@ -505,6 +536,9 @@ struct efx_txq_s {
        uint32_t                        et_pio_offset;
        size_t                          et_pio_size;
 #endif
+#if EFSYS_OPT_QSTATS
+       uint32_t                        et_stat[TX_NQSTATS];
+#endif /* EFSYS_OPT_QSTATS */
 };
 
 #define        EFX_TXQ_MAGIC   0x05092005
@@ -825,6 +859,32 @@ extern                     void
 efx_phy_unprobe(
        __in            efx_nic_t *enp);
 
+#if EFSYS_OPT_DIAG
+
+extern efx_sram_pattern_fn_t   __efx_sram_pattern_fns[];
+
+typedef struct efx_register_set_s {
+       unsigned int            address;
+       unsigned int            step;
+       unsigned int            rows;
+       efx_oword_t             mask;
+} efx_register_set_t;
+
+extern __checkReturn   efx_rc_t
+efx_nic_test_registers(
+       __in            efx_nic_t *enp,
+       __in            efx_register_set_t *rsp,
+       __in            size_t count);
+
+extern __checkReturn   efx_rc_t
+efx_nic_test_tables(
+       __in            efx_nic_t *enp,
+       __in            efx_register_set_t *rsp,
+       __in            efx_pattern_type_t pattern,
+       __in            size_t count);
+
+#endif /* EFSYS_OPT_DIAG */
+
 #if EFSYS_OPT_MCDI
 
 extern __checkReturn           efx_rc_t