| 1311 | } |
| 1312 | |
| 1313 | static void |
| 1314 | bstp_set_port_proto(struct bstp_port *bp, int proto) |
| 1315 | { |
| 1316 | struct bstp_state *bs = bp->bp_bs; |
| 1317 | |
| 1318 | /* supported protocol versions */ |
| 1319 | switch (proto) { |
| 1320 | case BSTP_PROTO_STP: |
| 1321 | /* we can downgrade protocols only */ |
| 1322 | bstp_timer_stop(&bp->bp_migrate_delay_timer); |
| 1323 | /* clear unsupported features */ |
| 1324 | bp->bp_operedge = 0; |
| 1325 | /* STP compat mode only uses 16 bits of the 32 */ |
| 1326 | if (bp->bp_path_cost > 65535) |
| 1327 | bp->bp_path_cost = 65535; |
| 1328 | break; |
| 1329 | |
| 1330 | case BSTP_PROTO_RSTP: |
| 1331 | bstp_timer_start(&bp->bp_migrate_delay_timer, |
| 1332 | bs->bs_migration_delay); |
| 1333 | break; |
| 1334 | |
| 1335 | default: |
| 1336 | DPRINTF("Unsupported STP version %d\n", proto); |
| 1337 | return; |
| 1338 | } |
| 1339 | |
| 1340 | bp->bp_protover = proto; |
| 1341 | bp->bp_flags &= ~BSTP_PORT_CANMIGRATE; |
| 1342 | } |
| 1343 | |
| 1344 | static void |
| 1345 | bstp_set_port_tc(struct bstp_port *bp, int state) |
no test coverage detected