omit redundant code
This commit is contained in:
@@ -660,10 +660,10 @@ int32_t Linklayer_Init(L2_INST **instPtr, const L2_CONFIG *config)
|
||||
DBG_ERROR("Allocate memory for L2_InstPtr failed.\n");
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
// Clear random content
|
||||
memset(*instPtr, 0x00, sizeof(L2_INST));
|
||||
memcpy(&((*instPtr)->config), config, sizeof(L2_CONFIG));
|
||||
// Clear log
|
||||
memset(&((*instPtr)->log), 0x00, sizeof((*instPtr)->log));
|
||||
|
||||
// Packet buffer
|
||||
(*instPtr)->sendPktData = calloc(L2_PACK_LEN_MAX / sizeof(uint64_t), sizeof(uint64_t));
|
||||
|
||||
@@ -420,7 +420,7 @@ int32_t SystemBus_HandleCmd(SYSBUS *instPtr)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Do not response
|
||||
// Ignore current command
|
||||
DBG_ERROR("Unexpected config command 0x%02X:0x%02X",
|
||||
WD_MODE_CMD, data[WD_MODE_CMD]);
|
||||
Status = EPARAM;
|
||||
@@ -453,19 +453,8 @@ int32_t SystemBus_HandleCmd(SYSBUS *instPtr)
|
||||
Phy_SetupNextSlot(phyRef, PHY_TOR_RX, L1_10KBPS_10MS_FRAME, NULL);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Do not response
|
||||
DBG_ERROR("Unexpected config command 0x%02X:0x%02X",
|
||||
WD_EN_CMD, data[WD_EN_CMD]);
|
||||
Status = EPARAM;
|
||||
break;
|
||||
}
|
||||
if (reconfig == true)
|
||||
{
|
||||
Linklayer_Reconfig(linkInstPtr, &linkConfig);
|
||||
Linklayer_Start(linkInstPtr);
|
||||
}
|
||||
|
||||
Linklayer_Start(linkInstPtr);
|
||||
instPtr->sysbusLog.lastConfig[0] = data[WD_MODE_CMD];
|
||||
instPtr->sysbusLog.lastConfig[1] = data[WD_EN_CMD];
|
||||
Status = SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user