/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2019-2020 Broadcom
+ * Copyright(c) 2019-2021 Broadcom
* All rights reserved.
*/
struct tf_tbl_scope_cb *tbl_scope_cb;
struct hcapi_cfa_em_table *em_tables;
struct tf_free_tbl_scope_parms free_parms;
-
- rc = tf_tbl_scope_alloc(&parms->tbl_scope_id);
+ struct tf_rm_allocate_parms aparms = { 0 };
+ struct tf_rm_free_parms fparms = { 0 };
+
+ /* Get Table Scope control block from the session pool */
+ aparms.rm_db = eem_db[TF_DIR_RX];
+ aparms.db_index = TF_EM_TBL_TYPE_TBL_SCOPE;
+ aparms.index = (uint32_t *)&parms->tbl_scope_id;
+ rc = tf_rm_allocate(&aparms);
if (rc) {
TFP_DRV_LOG(ERR,
"Failed to allocate table scope\n");
tbl_scope_cb->index = parms->tbl_scope_id;
tbl_scope_cb->tbl_scope_id = parms->tbl_scope_id;
+ rc = tfp_get_pf(tfp, &tbl_scope_cb->pf);
+ if (rc) {
+ TFP_DRV_LOG(ERR,
+ "EEM: PF query error rc:%s\n",
+ strerror(-rc));
+ goto cleanup;
+ }
+
for (dir = 0; dir < TF_DIR_MAX; dir++) {
rc = tf_msg_em_qcaps(tfp,
dir,
return -EINVAL;
cleanup:
- tf_tbl_scope_free(parms->tbl_scope_id);
+ /* Free Table control block */
+ fparms.rm_db = eem_db[TF_DIR_RX];
+ fparms.db_index = TF_EM_TBL_TYPE_TBL_SCOPE;
+ fparms.index = parms->tbl_scope_id;
+ tf_rm_free(&fparms);
return -EINVAL;
}
int rc = 0;
enum tf_dir dir;
struct tf_tbl_scope_cb *tbl_scope_cb;
+ struct tf_rm_free_parms aparms = { 0 };
tbl_scope_cb = tbl_scope_cb_find(parms->tbl_scope_id);
return -EINVAL;
}
- rc = tf_tbl_scope_free(parms->tbl_scope_id);
+ /* Free Table control block */
+ aparms.rm_db = eem_db[TF_DIR_RX];
+ aparms.db_index = TF_EM_TBL_TYPE_TBL_SCOPE;
+ aparms.index = parms->tbl_scope_id;
+ rc = tf_rm_free(&aparms);
if (rc) {
TFP_DRV_LOG(ERR,
"Failed to free table scope\n");