* To be called under TUN_LOCK. Update ifp->if_hwassist according to the * current value of ifp->if_capenable. */
| 1221 | * current value of ifp->if_capenable. |
| 1222 | */ |
| 1223 | static void |
| 1224 | tun_caps_changed(struct ifnet *ifp) |
| 1225 | { |
| 1226 | uint64_t hwassist = 0; |
| 1227 | |
| 1228 | TUN_LOCK_ASSERT((struct tuntap_softc *)ifp->if_softc); |
| 1229 | if (ifp->if_capenable & IFCAP_TXCSUM) |
| 1230 | hwassist |= CSUM_TCP | CSUM_UDP; |
| 1231 | if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) |
| 1232 | hwassist |= CSUM_TCP_IPV6 |
| 1233 | | CSUM_UDP_IPV6; |
| 1234 | if (ifp->if_capenable & IFCAP_TSO4) |
| 1235 | hwassist |= CSUM_IP_TSO; |
| 1236 | if (ifp->if_capenable & IFCAP_TSO6) |
| 1237 | hwassist |= CSUM_IP6_TSO; |
| 1238 | ifp->if_hwassist = hwassist; |
| 1239 | } |
| 1240 | |
| 1241 | /* |
| 1242 | * To be called under TUN_LOCK. Update tp->tun_vhdrlen and adjust |
no outgoing calls
no test coverage detected