From e698bc3efe31e0807976eb9ff215379a7cde0ef6 Mon Sep 17 00:00:00 2001 From: Jens Osterkamp Date: Thu, 3 Feb 2011 23:00:05 +0000 Subject: [PATCH 04/51] cleanup: change request from mode to boolean Signed-off-by: Jens Osterkamp Signed-off-by: Petr Sabata --- ecp/ecp_tx.c | 10 +++++----- event_iface.c | 2 +- include/lldp_vdp.h | 7 ------- lldp_vdp_cmds.c | 2 +- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/ecp/ecp_tx.c b/ecp/ecp_tx.c index 69bca30..6dff8c7 100644 --- a/ecp/ecp_tx.c +++ b/ecp/ecp_tx.c @@ -53,7 +53,7 @@ void ecp_somethingChangedLocal(struct vdp_data *vd) if (!vd) return; - vd->ecp.tx.localChange = 1; + vd->ecp.tx.localChange = true; return; } @@ -216,7 +216,7 @@ void ecp_tx_Initialize(struct vdp_data *vd) free(vd->ecp.tx.frameout); vd->ecp.tx.frameout = NULL; } - vd->ecp.tx.localChange = VDP_PROFILE_REQ; + vd->ecp.tx.localChange = true; vd->ecp.lastSequence = ECP_SEQUENCE_NR_START; vd->ecp.stats.statsFramesOutTotal = 0; vd->ecp.ackTimerExpired = false; @@ -265,7 +265,7 @@ void ecp_tx_create_frame(struct vdp_data *vd) ecp_txFrame(vd); } - vd->ecp.tx.localChange = 0; + vd->ecp.tx.localChange = false; return; } @@ -431,7 +431,7 @@ static bool ecp_set_tx_state(struct vdp_data *vd) } return false; case ECP_TX_REQUEST_PDU: - if (vd->ecp.tx.localChange & VDP_PROFILE_REQ) { + if (vd->ecp.tx.localChange) { ecp_tx_change_state(vd, ECP_TX_TRANSMIT_ECPDU); return true; } @@ -470,7 +470,7 @@ void ecp_tx_run_sm(struct vdp_data *vd) vd->ifname); LLDPAD_DBG("%s(%i)-%s: seqECPDU %x lastSequence %x \n", __func__, __LINE__, vd->ifname, vd->ecp.seqECPDU, vd->ecp.lastSequence); - vd->ecp.tx.localChange = 0; + vd->ecp.tx.localChange = false; ecp_tx_stop_ackTimer(vd); } break; diff --git a/event_iface.c b/event_iface.c index 70ff72f..5d447c6 100644 --- a/event_iface.c +++ b/event_iface.c @@ -454,7 +454,7 @@ static int event_if_parse_setmsg(struct nlmsghdr *nlh) return -EINVAL; } - vdp_somethingChangedLocal(profile, VDP_PROFILE_REQ); + vdp_somethingChangedLocal(profile, true); vdp_vsi_sm_station(p); return 0; diff --git a/include/lldp_vdp.h b/include/lldp_vdp.h index 146e29d..2caf57a 100644 --- a/include/lldp_vdp.h +++ b/include/lldp_vdp.h @@ -62,13 +62,6 @@ static char *vsi_responses[] = { "out of sync" }; -enum { - VDP_PROFILE_NOCHANGE = 0, - VDP_PROFILE_REQ, - VDP_PROFILE_ACK, - VDP_PROFILE_NACK, -}; - #define VDP_MACVLAN_FORMAT_1 1 #define VDP_TIMER_GRANULARITY 10000 /* 10 ms in us */ diff --git a/lldp_vdp_cmds.c b/lldp_vdp_cmds.c index d2e5b2f..9f67d7d 100644 --- a/lldp_vdp_cmds.c +++ b/lldp_vdp_cmds.c @@ -322,7 +322,7 @@ static int set_arg_mode(struct cmd *cmd, char *arg, char *argvalue, return cmd_invalid; } - vdp_somethingChangedLocal(profile, VDP_PROFILE_REQ); + vdp_somethingChangedLocal(profile, true); vdp_vsi_sm_station(p); return cmd_success; -- 1.7.4.4