summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_cc.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_cc.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_cc.c
index 2e6a0e0..09eec69 100644
--- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_cc.c
+++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_cc.c
@@ -924,18 +924,16 @@ static t_Error DoDynamicChange(t_Handle h_FmPcd,
memset(&nextEngineParams, 0, sizeof(t_FmPcdCcNextEngineParams));
- numOfModifiedPtr = (uint8_t)LIST_NumOfObjs(h_OldPointersLst);
-
- if (numOfModifiedPtr)
- {
-
- p_PosNew = LIST_FIRST(h_NewPointersLst);
-
- /* Invoke host-command to copy from the new Ad to existing Ads */
- err = DynamicChangeHc(h_FmPcd, h_OldPointersLst, h_NewPointersLst, p_AdditionalParams, useShadowStructs);
- if (err)
- RETURN_ERROR(MAJOR, err, NO_MSG);
- }
+ numOfModifiedPtr = (uint8_t)LIST_NumOfObjs(h_OldPointersLst);
+
+
+ p_PosNew = LIST_FIRST(h_NewPointersLst);
+
+ /* Invoke host-command to copy from the new Ad to existing Ads */
+ err = DynamicChangeHc(h_FmPcd, h_OldPointersLst, h_NewPointersLst, p_AdditionalParams, useShadowStructs);
+ if (err)
+ RETURN_ERROR(MAJOR, err, NO_MSG);
+
if (useShadowStructs)
{
/* When the host-command above has ended, the old structures are 'free'and we can update
@@ -953,25 +951,30 @@ static t_Error DoDynamicChange(t_Handle h_FmPcd,
p_AdditionalParams->p_AdTableNew,
(uint32_t)((p_CcNode->maxNumOfKeys + 1) * FM_PCD_CC_AD_ENTRY_SIZE));
- /* Retrieve the address of the allocated Ad */
- p_CcNodeInfo = CC_NODE_F_OBJECT(p_PosNew);
- h_Ad = p_CcNodeInfo->h_CcNode;
- /* Build a new Ad that holds the old (now updated) structures */
p_AdditionalParams->p_KeysMatchTableNew = p_AdditionalParams->p_KeysMatchTableOld;
p_AdditionalParams->p_AdTableNew = p_AdditionalParams->p_AdTableOld;
- nextEngineParams.nextEngine = e_FM_PCD_CC;
- nextEngineParams.params.ccParams.h_CcNode = (t_Handle)p_CcNode;
-
- BuildNewAd(h_Ad, p_AdditionalParams, p_CcNode, &nextEngineParams);
+ if (numOfModifiedPtr)
+ {
+ /* Retrieve the address of the allocated Ad */
+ p_CcNodeInfo = CC_NODE_F_OBJECT(p_PosNew);
+ h_Ad = p_CcNodeInfo->h_CcNode;
+ nextEngineParams.nextEngine = e_FM_PCD_CC;
+ nextEngineParams.params.ccParams.h_CcNode = (t_Handle)p_CcNode;
+ /* Build a new Ad that holds the old (now updated) structures */
+ BuildNewAd(h_Ad, p_AdditionalParams, p_CcNode, &nextEngineParams);
+ }
+
/* HC to copy from the new Ad (old updated structures) to current Ad (uses shadow structures) */
err = DynamicChangeHc(h_FmPcd, h_OldPointersLst, h_NewPointersLst, p_AdditionalParams, useShadowStructs);
if (err)
RETURN_ERROR(MAJOR, err, NO_MSG);
}
+
+
err = ReleaseModifiedDataStructure(h_FmPcd,
h_OldPointersLst,
h_NewPointersLst,