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

[altq 851] Re: what chances for sis/NatSemi to be supported?




Gunther Schadow wrote:
> what are the chances for the sis driver (as for the National 
> Semiconductor chip) to be supported by ALTQ? I am somewhat 
> overwhelmed by trying to figure out how I could do this myself.
> What is the general stance on this? Will most/all ethernet
> hardware be ALTQualified soon or is it on an as-needed (and
> as being able to do) basis? If so, is there some instructions
> on how best to do this for driver X?

At this moment, drivers are ALTQified by requests, since I can't test
those cards.

Please test and resport the attached patch. (it's from FreeBSD-4.3 but
should work for 4.2.)

If you want to learn how to modify drivers, it is described in
altq-3.0/docs/altq-new-design.txt.

-Kenjiro

Index: if_sis.c
===================================================================
RCS file: /cvsroot/kame/kame/freebsd4/sys/pci/if_sis.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 if_sis.c
--- if_sis.c	2001/04/23 13:14:18	1.1.1.4
+++ if_sis.c	2001/05/03 17:01:53
@@ -922,7 +922,8 @@
 	ifp->if_watchdog = sis_watchdog;
 	ifp->if_init = sis_init;
 	ifp->if_baudrate = 10000000;
-	ifp->if_snd.ifq_maxlen = SIS_TX_LIST_CNT - 1;
+	IFQ_SET_MAXLEN(&ifp->if_snd, SIS_TX_LIST_CNT - 1);
+	IFQ_SET_READY(&ifp->if_snd);
 
 	/*
 	 * Do MII setup.
@@ -1249,7 +1250,7 @@
 		if (mii->mii_media_status & IFM_ACTIVE &&
 		    IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)
 			sc->sis_link++;
-			if (ifp->if_snd.ifq_head != NULL)
+			if (!IFQ_IS_EMPTY(&ifp->if_snd))
 				sis_start(ifp);
 	}
 
@@ -1310,7 +1311,7 @@
 	/* Re-enable interrupts. */
 	CSR_WRITE_4(sc, SIS_IER, 1);
 
-	if (ifp->if_snd.ifq_head != NULL)
+	if (!IFQ_IS_EMPTY(&ifp->if_snd))
 		sis_start(ifp);
 
 	return;
@@ -1390,16 +1391,18 @@
 		return;
 
 	while(sc->sis_ldata->sis_tx_list[idx].sis_mbuf == NULL) {
-		IF_DEQUEUE(&ifp->if_snd, m_head);
+		IFQ_POLL(&ifp->if_snd, m_head);
 		if (m_head == NULL)
 			break;
 
 		if (sis_encap(sc, m_head, &idx)) {
-			IF_PREPEND(&ifp->if_snd, m_head);
 			ifp->if_flags |= IFF_OACTIVE;
 			break;
 		}
 
+		/* now we are committed to transmit the packet */
+		IFQ_DEQUEUE(&ifp->if_snd, m_head);
+
 		/*
 		 * If there's a BPF listener, bounce a copy of this frame
 		 * to him.
@@ -1408,6 +1411,8 @@
 			bpf_mtap(ifp, m_head);
 
 	}
+	if (idx == sc->sis_cdata.sis_tx_prod)
+		return;
 
 	/* Transmit */
 	sc->sis_cdata.sis_tx_prod = idx;
@@ -1689,7 +1694,7 @@
 	sis_reset(sc);
 	sis_init(sc);
 
-	if (ifp->if_snd.ifq_head != NULL)
+	if (!IFQ_IS_EMPTY(&ifp->if_snd))
 		sis_start(ifp);
 
 	return;