| 1672 | } |
| 1673 | |
| 1674 | int |
| 1675 | bstp_set_autoptp(struct bstp_port *bp, int set) |
| 1676 | { |
| 1677 | struct bstp_state *bs = bp->bp_bs; |
| 1678 | |
| 1679 | BSTP_LOCK(bs); |
| 1680 | if (set) { |
| 1681 | bp->bp_flags |= BSTP_PORT_AUTOPTP; |
| 1682 | if (bp->bp_role != BSTP_ROLE_DISABLED) |
| 1683 | taskqueue_enqueue(taskqueue_swi, &bp->bp_mediatask); |
| 1684 | } else |
| 1685 | bp->bp_flags &= ~BSTP_PORT_AUTOPTP; |
| 1686 | BSTP_UNLOCK(bs); |
| 1687 | return (0); |
| 1688 | } |
| 1689 | |
| 1690 | /* |
| 1691 | * Calculate the path cost according to the link speed. |
no test coverage detected