[CFA_RESOURCE_TYPE_P58_WC_FKB] = "wc_fkb ",
[CFA_RESOURCE_TYPE_P58_VEB_TCAM] = "veb ",
[CFA_RESOURCE_TYPE_P58_METADATA] = "metadata",
+ [CFA_RESOURCE_TYPE_P58_METER_DROP_CNT] = "meter_dc",
};
/**
return 0;
}
+/**
+ * Device specific function that maps the hcapi resource types
+ * to Truflow type.
+ *
+ * [in] hcapi_caps
+ * CFA resource type bitmap
+ *
+ * [out] ident_caps
+ * Pointer to identifier type bitmap
+ *
+ * [out] tcam_caps
+ * Pointer to tcam type bitmap
+ *
+ * [out] tbl_caps
+ * Pointer to table type bitmap
+ *
+ * [out] em_caps
+ * Pointer to em type bitmap
+ *
+ * Returns
+ * - (0) if successful.
+ * - (-EINVAL) on failure.
+ */
+static int tf_dev_p58_map_hcapi_caps(uint64_t hcapi_caps,
+ uint32_t *ident_caps,
+ uint32_t *tcam_caps,
+ uint32_t *tbl_caps,
+ uint32_t *em_caps)
+{
+ uint32_t i;
+
+ *ident_caps = 0;
+ *tcam_caps = 0;
+ *tbl_caps = 0;
+ *em_caps = 0;
+
+ for (i = 0; i <= CFA_RESOURCE_TYPE_P58_LAST; i++) {
+ if (hcapi_caps & 1ULL << i) {
+ switch (tf_hcapi_res_map_p58[i].module_type) {
+ case TF_MODULE_TYPE_IDENTIFIER:
+ *ident_caps |= tf_hcapi_res_map_p58[i].type_caps;
+ break;
+ case TF_MODULE_TYPE_TABLE:
+ *tbl_caps |= tf_hcapi_res_map_p58[i].type_caps;
+ break;
+ case TF_MODULE_TYPE_TCAM:
+ *tcam_caps |= tf_hcapi_res_map_p58[i].type_caps;
+ break;
+ case TF_MODULE_TYPE_EM:
+ *em_caps |= tf_hcapi_res_map_p58[i].type_caps;
+ break;
+ default:
+ return -EINVAL;
+ }
+ }
+ }
+
+ return 0;
+}
+
/**
* Truflow P58 device specific functions
*/
.tf_dev_get_global_cfg = NULL,
.tf_dev_get_mailbox = tf_dev_p58_get_mailbox,
.tf_dev_word_align = NULL,
+ .tf_dev_map_hcapi_caps = tf_dev_p58_map_hcapi_caps
};
/**
.tf_dev_get_global_cfg = tf_global_cfg_get,
.tf_dev_get_mailbox = tf_dev_p58_get_mailbox,
.tf_dev_word_align = tf_dev_p58_word_align,
- .tf_dev_cfa_key_hash = hcapi_cfa_p58_key_hash
+ .tf_dev_cfa_key_hash = hcapi_cfa_p58_key_hash,
+ .tf_dev_map_hcapi_caps = tf_dev_p58_map_hcapi_caps
};