tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bwfm(4) PCI support



On Fri, 4 May 2018, coypu%sdf.org@localhost wrote:

http://coypu.sdf.org/0001-sync-with-openbsd-bwfm.patch

Two issues:

@@ -307,6 +313,12 @@ bwfm_start(struct ifnet *ifp)
 			continue;
 		}

+		if (sc->sc_bus_ops->bs_txcheck(sc)) {
+			IF_PREPEND(&ifp->if_snd, m);
+			ifp->if_flags |= IFF_OACTIVE;
+			break;
+		}
+
 		IFQ_DEQUEUE(&ifp->if_snd, m);
 		if (m == NULL)
 			break;

Remove the IF_PREPEND here. You only need to do that after dequeue. In this case, m will always be NULL.

-

+int
+bwfm_usb_txcheck(struct bwfm_softc *bwfm)
+{
+	struct bwfm_usb_softc *sc = (void *)bwfm;
+
+	mutex_enter(&sc->sc_tx_lock);
+
+	if (TAILQ_EMPTY(&sc->sc_tx_free_list)) {
+		mutex_exit(&sc->sc_tx_lock);
+		return ENOBUFS;
+	}
+
+	return 0;
+}

Missing mutex_exit in the success path here.

http://coypu.sdf.org/0004-Update-bwfm-4-to-note-PCI-support-and-mention-jmcnei.patch

I wouldn't say I wrote the driver, only ported it. Also note capitalization of my last name.

Cheers,
Jared


Home | Main Index | Thread Index | Old Index