net/sfc/base: report verify result from RW finish callback
[dpdk.git] / drivers / net / sfc / base / efx_impl.h
index 6b84f43..6cb015a 100644 (file)
@@ -152,11 +152,17 @@ typedef struct efx_rx_ops_s {
        efx_rc_t        (*erxo_scatter_enable)(efx_nic_t *, unsigned int);
 #endif
 #if EFSYS_OPT_RX_SCALE
-       efx_rc_t        (*erxo_scale_mode_set)(efx_nic_t *, efx_rx_hash_alg_t,
+       efx_rc_t        (*erxo_scale_context_alloc)(efx_nic_t *,
+                                                   efx_rx_scale_context_type_t,
+                                                   uint32_t, uint32_t *);
+       efx_rc_t        (*erxo_scale_context_free)(efx_nic_t *, uint32_t);
+       efx_rc_t        (*erxo_scale_mode_set)(efx_nic_t *, uint32_t,
+                                              efx_rx_hash_alg_t,
                                               efx_rx_hash_type_t, boolean_t);
-       efx_rc_t        (*erxo_scale_key_set)(efx_nic_t *, uint8_t *, size_t);
-       efx_rc_t        (*erxo_scale_tbl_set)(efx_nic_t *, unsigned int *,
-                                             size_t);
+       efx_rc_t        (*erxo_scale_key_set)(efx_nic_t *, uint32_t,
+                                             uint8_t *, size_t);
+       efx_rc_t        (*erxo_scale_tbl_set)(efx_nic_t *, uint32_t,
+                                             unsigned int *, size_t);
        uint32_t        (*erxo_prefix_hash)(efx_nic_t *, efx_rx_hash_alg_t,
                                            uint8_t *);
 #endif /* EFSYS_OPT_RX_SCALE */
@@ -198,6 +204,7 @@ typedef struct efx_mac_ops_s {
 #endif /* EFSYS_OPT_LOOPBACK */
 #if EFSYS_OPT_MAC_STATS
        efx_rc_t        (*emo_stats_get_mask)(efx_nic_t *, uint32_t *, size_t);
+       efx_rc_t        (*emo_stats_clear)(efx_nic_t *);
        efx_rc_t        (*emo_stats_upload)(efx_nic_t *, efsys_mem_t *);
        efx_rc_t        (*emo_stats_periodic)(efx_nic_t *, efsys_mem_t *,
                                              uint16_t, boolean_t);
@@ -234,7 +241,8 @@ typedef struct efx_filter_ops_s {
        efx_rc_t        (*efo_add)(efx_nic_t *, efx_filter_spec_t *,
                                   boolean_t may_replace);
        efx_rc_t        (*efo_delete)(efx_nic_t *, efx_filter_spec_t *);
-       efx_rc_t        (*efo_supported_filters)(efx_nic_t *, uint32_t *, size_t *);
+       efx_rc_t        (*efo_supported_filters)(efx_nic_t *, uint32_t *,
+                                  size_t, size_t *);
        efx_rc_t        (*efo_reconfigure)(efx_nic_t *, uint8_t const *, boolean_t,
                                   boolean_t, boolean_t, boolean_t,
                                   uint8_t const *, uint32_t);
@@ -467,7 +475,8 @@ typedef struct efx_nvram_ops_s {
                                            unsigned int, size_t);
        efx_rc_t        (*envo_partn_write)(efx_nic_t *, uint32_t,
                                            unsigned int, caddr_t, size_t);
-       efx_rc_t        (*envo_partn_rw_finish)(efx_nic_t *, uint32_t);
+       efx_rc_t        (*envo_partn_rw_finish)(efx_nic_t *, uint32_t,
+                                           uint32_t *);
        efx_rc_t        (*envo_partn_get_version)(efx_nic_t *, uint32_t,
                                            uint32_t *, uint16_t *);
        efx_rc_t        (*envo_partn_set_version)(efx_nic_t *, uint32_t,
@@ -477,6 +486,24 @@ typedef struct efx_nvram_ops_s {
 } efx_nvram_ops_t;
 #endif /* EFSYS_OPT_NVRAM */
 
+#if EFSYS_OPT_VPD
+typedef struct efx_vpd_ops_s {
+       efx_rc_t        (*evpdo_init)(efx_nic_t *);
+       efx_rc_t        (*evpdo_size)(efx_nic_t *, size_t *);
+       efx_rc_t        (*evpdo_read)(efx_nic_t *, caddr_t, size_t);
+       efx_rc_t        (*evpdo_verify)(efx_nic_t *, caddr_t, size_t);
+       efx_rc_t        (*evpdo_reinit)(efx_nic_t *, caddr_t, size_t);
+       efx_rc_t        (*evpdo_get)(efx_nic_t *, caddr_t, size_t,
+                                       efx_vpd_value_t *);
+       efx_rc_t        (*evpdo_set)(efx_nic_t *, caddr_t, size_t,
+                                       efx_vpd_value_t *);
+       efx_rc_t        (*evpdo_next)(efx_nic_t *, caddr_t, size_t,
+                                       efx_vpd_value_t *, unsigned int *);
+       efx_rc_t        (*evpdo_write)(efx_nic_t *, caddr_t, size_t);
+       void            (*evpdo_fini)(efx_nic_t *);
+} efx_vpd_ops_t;
+#endif /* EFSYS_OPT_VPD */
+
 #if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM
 
        __checkReturn           efx_rc_t
@@ -538,7 +565,7 @@ efx_mcdi_nvram_update_finish(
        __in                    efx_nic_t *enp,
        __in                    uint32_t partn,
        __in                    boolean_t reboot,
-       __out_opt               uint32_t *resultp);
+       __out_opt               uint32_t *verify_resultp);
 
 #if EFSYS_OPT_DIAG
 
@@ -551,6 +578,39 @@ efx_mcdi_nvram_test(
 
 #endif /* EFSYS_OPT_VPD || EFSYS_OPT_NVRAM */
 
+#if EFSYS_OPT_LICENSING
+
+typedef struct efx_lic_ops_s {
+       efx_rc_t        (*elo_update_licenses)(efx_nic_t *);
+       efx_rc_t        (*elo_get_key_stats)(efx_nic_t *, efx_key_stats_t *);
+       efx_rc_t        (*elo_app_state)(efx_nic_t *, uint64_t, boolean_t *);
+       efx_rc_t        (*elo_get_id)(efx_nic_t *, size_t, uint32_t *,
+                                     size_t *, uint8_t *);
+       efx_rc_t        (*elo_find_start)
+                               (efx_nic_t *, caddr_t, size_t, uint32_t *);
+       efx_rc_t        (*elo_find_end)(efx_nic_t *, caddr_t, size_t,
+                               uint32_t, uint32_t *);
+       boolean_t       (*elo_find_key)(efx_nic_t *, caddr_t, size_t,
+                               uint32_t, uint32_t *, uint32_t *);
+       boolean_t       (*elo_validate_key)(efx_nic_t *,
+                               caddr_t, uint32_t);
+       efx_rc_t        (*elo_read_key)(efx_nic_t *,
+                               caddr_t, size_t, uint32_t, uint32_t,
+                               caddr_t, size_t, uint32_t *);
+       efx_rc_t        (*elo_write_key)(efx_nic_t *,
+                               caddr_t, size_t, uint32_t,
+                               caddr_t, uint32_t, uint32_t *);
+       efx_rc_t        (*elo_delete_key)(efx_nic_t *,
+                               caddr_t, size_t, uint32_t,
+                               uint32_t, uint32_t, uint32_t *);
+       efx_rc_t        (*elo_create_partition)(efx_nic_t *,
+                               caddr_t, size_t);
+       efx_rc_t        (*elo_finish_partition)(efx_nic_t *,
+                               caddr_t, size_t);
+} efx_lic_ops_t;
+
+#endif
+
 typedef struct efx_drv_cfg_s {
        uint32_t                edc_min_vi_count;
        uint32_t                edc_max_vi_count;
@@ -591,18 +651,29 @@ struct efx_nic_s {
        efx_nvram_type_t        en_nvram_locked;
        const efx_nvram_ops_t   *en_envop;
 #endif /* EFSYS_OPT_NVRAM */
+#if EFSYS_OPT_VPD
+       const efx_vpd_ops_t     *en_evpdop;
+#endif /* EFSYS_OPT_VPD */
 #if EFSYS_OPT_RX_SCALE
-       efx_rx_hash_support_t   en_hash_support;
-       efx_rx_scale_support_t  en_rss_support;
-       uint32_t                en_rss_context;
+       efx_rx_hash_support_t           en_hash_support;
+       efx_rx_scale_context_type_t     en_rss_context_type;
+       uint32_t                        en_rss_context;
 #endif /* EFSYS_OPT_RX_SCALE */
        uint32_t                en_vport_id;
+#if EFSYS_OPT_LICENSING
+       const efx_lic_ops_t     *en_elop;
+       boolean_t               en_licensing_supported;
+#endif
        union {
 #if EFSYS_OPT_SIENA
                struct {
 #if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD
                        unsigned int            enu_partn_mask;
 #endif /* EFSYS_OPT_NVRAM || EFSYS_OPT_VPD */
+#if EFSYS_OPT_VPD
+                       caddr_t                 enu_svpd;
+                       size_t                  enu_svpd_length;
+#endif /* EFSYS_OPT_VPD */
                        int                     enu_unused;
                } siena;
 #endif /* EFSYS_OPT_SIENA */
@@ -614,6 +685,10 @@ struct efx_nic_s {
                        int                     ena_vi_base;
                        int                     ena_vi_count;
                        int                     ena_vi_shift;
+#if EFSYS_OPT_VPD
+                       caddr_t                 ena_svpd;
+                       size_t                  ena_svpd_length;
+#endif /* EFSYS_OPT_VPD */
                        efx_piobuf_handle_t     ena_piobuf_handle[EF10_MAX_PIOBUF_NBUFS];
                        uint32_t                ena_piobuf_count;
                        uint32_t                ena_pio_alloc_map[EF10_MAX_PIOBUF_NBUFS];
@@ -1020,6 +1095,55 @@ extern                   void
 efx_phy_unprobe(
        __in            efx_nic_t *enp);
 
+#if EFSYS_OPT_VPD
+
+/* VPD utility functions */
+
+extern __checkReturn           efx_rc_t
+efx_vpd_hunk_length(
+       __in_bcount(size)       caddr_t data,
+       __in                    size_t size,
+       __out                   size_t *lengthp);
+
+extern __checkReturn           efx_rc_t
+efx_vpd_hunk_verify(
+       __in_bcount(size)       caddr_t data,
+       __in                    size_t size,
+       __out_opt               boolean_t *cksummedp);
+
+extern __checkReturn           efx_rc_t
+efx_vpd_hunk_reinit(
+       __in_bcount(size)       caddr_t data,
+       __in                    size_t size,
+       __in                    boolean_t wantpid);
+
+extern __checkReturn           efx_rc_t
+efx_vpd_hunk_get(
+       __in_bcount(size)       caddr_t data,
+       __in                    size_t size,
+       __in                    efx_vpd_tag_t tag,
+       __in                    efx_vpd_keyword_t keyword,
+       __out                   unsigned int *payloadp,
+       __out                   uint8_t *paylenp);
+
+extern __checkReturn                   efx_rc_t
+efx_vpd_hunk_next(
+       __in_bcount(size)               caddr_t data,
+       __in                            size_t size,
+       __out                           efx_vpd_tag_t *tagp,
+       __out                           efx_vpd_keyword_t *keyword,
+       __out_opt                       unsigned int *payloadp,
+       __out_opt                       uint8_t *paylenp,
+       __inout                         unsigned int *contp);
+
+extern __checkReturn           efx_rc_t
+efx_vpd_hunk_set(
+       __in_bcount(size)       caddr_t data,
+       __in                    size_t size,
+       __in                    efx_vpd_value_t *evvp);
+
+#endif /* EFSYS_OPT_VPD */
+
 #if EFSYS_OPT_DIAG
 
 extern efx_sram_pattern_fn_t   __efx_sram_pattern_fns[];