| 1586 | } |
| 1587 | |
| 1588 | int |
| 1589 | bstp_set_port_priority(struct bstp_port *bp, int pri) |
| 1590 | { |
| 1591 | struct bstp_state *bs = bp->bp_bs; |
| 1592 | |
| 1593 | if (pri < 0 || pri > BSTP_MAX_PORT_PRIORITY) |
| 1594 | return (EINVAL); |
| 1595 | |
| 1596 | /* Limit to steps of 16 */ |
| 1597 | pri -= pri % 16; |
| 1598 | |
| 1599 | BSTP_LOCK(bs); |
| 1600 | bp->bp_priority = pri; |
| 1601 | bstp_reinit(bs); |
| 1602 | BSTP_UNLOCK(bs); |
| 1603 | return (0); |
| 1604 | } |
| 1605 | |
| 1606 | int |
| 1607 | bstp_set_path_cost(struct bstp_port *bp, uint32_t path_cost) |
no test coverage detected