| 439 | } |
| 440 | |
| 441 | static bool |
| 442 | ether_set_pcp(struct mbuf **mp, struct ifnet *ifp, uint8_t pcp) |
| 443 | { |
| 444 | struct ether_8021q_tag qtag; |
| 445 | struct ether_header *eh; |
| 446 | |
| 447 | eh = mtod(*mp, struct ether_header *); |
| 448 | if (ntohs(eh->ether_type) == ETHERTYPE_VLAN || |
| 449 | ntohs(eh->ether_type) == ETHERTYPE_QINQ) |
| 450 | return (true); |
| 451 | |
| 452 | qtag.vid = 0; |
| 453 | qtag.pcp = pcp; |
| 454 | qtag.proto = ETHERTYPE_VLAN; |
| 455 | if (ether_8021q_frame(mp, ifp, ifp, &qtag)) |
| 456 | return (true); |
| 457 | if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); |
| 458 | return (false); |
| 459 | } |
| 460 | |
| 461 | /* |
| 462 | * Ethernet link layer output routine to send a raw frame to the device. |
no test coverage detected