| 1324 | } |
| 1325 | |
| 1326 | static int |
| 1327 | bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg) |
| 1328 | { |
| 1329 | struct ifbreq *req = arg; |
| 1330 | struct bridge_iflist *bif; |
| 1331 | struct bstp_port *bp; |
| 1332 | int error; |
| 1333 | |
| 1334 | bif = bridge_lookup_member(sc, req->ifbr_ifsname); |
| 1335 | if (bif == NULL) |
| 1336 | return (ENOENT); |
| 1337 | bp = &bif->bif_stp; |
| 1338 | |
| 1339 | if (req->ifbr_ifsflags & IFBIF_SPAN) |
| 1340 | /* SPAN is readonly */ |
| 1341 | return (EINVAL); |
| 1342 | |
| 1343 | if (req->ifbr_ifsflags & IFBIF_STP) { |
| 1344 | if ((bif->bif_flags & IFBIF_STP) == 0) { |
| 1345 | error = bstp_enable(&bif->bif_stp); |
| 1346 | if (error) |
| 1347 | return (error); |
| 1348 | } |
| 1349 | } else { |
| 1350 | if ((bif->bif_flags & IFBIF_STP) != 0) |
| 1351 | bstp_disable(&bif->bif_stp); |
| 1352 | } |
| 1353 | |
| 1354 | /* Pass on STP flags */ |
| 1355 | bstp_set_edge(bp, req->ifbr_ifsflags & IFBIF_BSTP_EDGE ? 1 : 0); |
| 1356 | bstp_set_autoedge(bp, req->ifbr_ifsflags & IFBIF_BSTP_AUTOEDGE ? 1 : 0); |
| 1357 | bstp_set_ptp(bp, req->ifbr_ifsflags & IFBIF_BSTP_PTP ? 1 : 0); |
| 1358 | bstp_set_autoptp(bp, req->ifbr_ifsflags & IFBIF_BSTP_AUTOPTP ? 1 : 0); |
| 1359 | |
| 1360 | /* Save the bits relating to the bridge */ |
| 1361 | bif->bif_flags = req->ifbr_ifsflags & IFBIFMASK; |
| 1362 | |
| 1363 | return (0); |
| 1364 | } |
| 1365 | |
| 1366 | static int |
| 1367 | bridge_ioctl_scache(struct bridge_softc *sc, void *arg) |
nothing calls this directly
no test coverage detected