for (i = 0; i < EMX_NRX_RING; ++i)
lwkt_serialize_init(&sc->rx_data[i].rx_serialize);
- lwkt_serialize_init(&sc->panic_serialize);
- lwkt_serialize_enter(&sc->panic_serialize);
-
i = 0;
sc->serializes[i++] = &sc->main_serialize;
sc->serializes[i++] = &sc->tx_serialize;
ifq_set_maxlen(&ifp->if_snd, sc->num_tx_desc - 1);
ifq_set_ready(&ifp->if_snd);
- ether_ifattach(ifp, sc->hw.mac.addr, &sc->panic_serialize);
+ ether_ifattach(ifp, sc->hw.mac.addr, NULL);
ifp->if_capabilities = IFCAP_HWCSUM |
IFCAP_VLAN_HWTAGGING |
static int if_indexlim = 8;
- /*
- * The serializer can be passed in from the device, allowing the
- * same serializer to be used for both the interrupt interlock and
- * the device queue. If not specified, the netif structure will
- * use an embedded serializer.
- */
- if (serializer == NULL) {
- serializer = &ifp->if_default_serializer;
- lwkt_serialize_init(serializer);
- }
- ifp->if_serializer = serializer;
-
if (ifp->if_serialize != NULL) {
KASSERT(ifp->if_deserialize != NULL &&
ifp->if_tryserialize != NULL &&
ifp->if_serialize_assert != NULL,
("serialize functions are partially setup\n"));
+
+ /*
+ * If the device supplies serialize functions,
+ * then clear if_serializer to catch any invalid
+ * usage of this field.
+ */
+ KASSERT(serializer == NULL,
+ ("both serialize functions and default serializer "
+ "are supplied\n"));
+ ifp->if_serializer = NULL;
} else {
KASSERT(ifp->if_deserialize == NULL &&
ifp->if_tryserialize == NULL &&
#ifdef INVARIANTS
ifp->if_serialize_assert = if_default_serialize_assert;
#endif
+
+ /*
+ * The serializer can be passed in from the device,
+ * allowing the same serializer to be used for both
+ * the interrupt interlock and the device queue.
+ * If not specified, the netif structure will use an
+ * embedded serializer.
+ */
+ if (serializer == NULL) {
+ serializer = &ifp->if_default_serializer;
+ lwkt_serialize_init(serializer);
+ }
+ ifp->if_serializer = serializer;
}
ifp->if_start_cpuid = if_start_cpuid;