Skip to content

Commit

Permalink
[nes]: ETHERNET changes ...
Browse files Browse the repository at this point in the history
  • Loading branch information
nes-repo committed Jan 5, 2015
1 parent c1a9138 commit 00837a9
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions ethernet/ethernetUtils.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ ieee8021If_ilanStackModify (
static bool
ieee8021BridgeBaseRowStatus_halUpdate (
ieee8021BridgeBaseEntry_t *poEntry, uint8_t u8RowStatus);
static bool
ieee8021BridgeBasePortRowStatus_halUpdate (
ieee8021BridgeBaseEntry_t *poComponent,
ieee8021BridgeBasePortEntry_t *poEntry, uint8_t u8RowStatus);
static bool
ieee8021QBridgePortRowStatus_halUpdate (
ieee8021BridgeBaseEntry_t *poComponent,
Expand Down Expand Up @@ -446,19 +450,43 @@ ieee8021BridgeBasePortRowStatus_update (
{
register bool bRetCode = false;

if (u8RowStatus == xRowStatus_active_c && !ieee8021BridgeBasePortRowStatus_halUpdate (poComponent, poEntry, u8RowStatus))
{
goto ieee8021BridgeBasePortRowStatus_update_cleanup;
}

/* TODO */

if (u8RowStatus != xRowStatus_active_c && !ieee8021BridgeBasePortRowStatus_halUpdate (poComponent, poEntry, u8RowStatus))
{
goto ieee8021BridgeBasePortRowStatus_update_cleanup;
}

bRetCode = true;

ieee8021BridgeBasePortRowStatus_update_cleanup:

return bRetCode;
}

bool
ieee8021BridgeBasePortRowStatus_halUpdate (
ieee8021BridgeBaseEntry_t *poComponent,
ieee8021BridgeBasePortEntry_t *poEntry, uint8_t u8RowStatus)
{
register bool bRetCode = false;
register uint8_t u8HalOpCode =
u8RowStatus == xRowStatus_active_c && poEntry->u8RowStatus != xRowStatus_active_c ? halEthernet_componentPortAttach_c:
u8RowStatus != xRowStatus_active_c && poEntry->u8RowStatus == xRowStatus_active_c ? halEthernet_componentPortDetach_c: halEthernet_componentNone_c;

if (u8HalOpCode != halEthernet_componentNone_c &&
!halEthernet_componentConfigure (poComponent, u8HalOpCode, poEntry))
if (u8HalOpCode != halEthernet_componentNone_c && !halEthernet_componentConfigure (poComponent, u8HalOpCode, poEntry))
{
goto ieee8021BridgeBasePortRowStatus_update_cleanup;
goto ieee8021BridgeBasePortRowStatus_halUpdate_cleanup;
}

bRetCode = true;

ieee8021BridgeBasePortRowStatus_update_cleanup:
ieee8021BridgeBasePortRowStatus_halUpdate_cleanup:

return bRetCode;
}
Expand Down

0 comments on commit 00837a9

Please sign in to comment.