| 1200 | } |
| 1201 | |
| 1202 | static void |
| 1203 | bstp_set_port_state(struct bstp_port *bp, int state) |
| 1204 | { |
| 1205 | if (bp->bp_state == state) |
| 1206 | return; |
| 1207 | |
| 1208 | bp->bp_state = state; |
| 1209 | |
| 1210 | switch (bp->bp_state) { |
| 1211 | case BSTP_IFSTATE_DISCARDING: |
| 1212 | DPRINTF("state changed to DISCARDING on %s\n", |
| 1213 | bp->bp_ifp->if_xname); |
| 1214 | break; |
| 1215 | |
| 1216 | case BSTP_IFSTATE_LEARNING: |
| 1217 | DPRINTF("state changed to LEARNING on %s\n", |
| 1218 | bp->bp_ifp->if_xname); |
| 1219 | |
| 1220 | bstp_timer_start(&bp->bp_forward_delay_timer, |
| 1221 | bp->bp_protover == BSTP_PROTO_RSTP ? |
| 1222 | bp->bp_desg_htime : bp->bp_desg_fdelay); |
| 1223 | break; |
| 1224 | |
| 1225 | case BSTP_IFSTATE_FORWARDING: |
| 1226 | DPRINTF("state changed to FORWARDING on %s\n", |
| 1227 | bp->bp_ifp->if_xname); |
| 1228 | |
| 1229 | bstp_timer_stop(&bp->bp_forward_delay_timer); |
| 1230 | /* Record that we enabled forwarding */ |
| 1231 | bp->bp_forward_transitions++; |
| 1232 | break; |
| 1233 | } |
| 1234 | |
| 1235 | /* notify the parent bridge */ |
| 1236 | taskqueue_enqueue(taskqueue_swi, &bp->bp_statetask); |
| 1237 | } |
| 1238 | |
| 1239 | static void |
| 1240 | bstp_set_port_role(struct bstp_port *bp, int role) |
no test coverage detected