
Quick tips on how to modify network drivers.

Currently supported drivers are very limited.  If you want to use
unsupported drivers, you have to make modifications by yourself.

If you successfully made modifications, please send diffs to
<kjc@csl.sony.co.jp>.  I'll include the support in the next release.

(1) ethernet drivers

Step 1: attach routine  (e.g. vxattach)

When a driver supports ALTQ, it should set the ALTQF_READY flag in the
driver's attach routine.

	#ifdef ALTQ
		/*
		 * set ALTQF_READY to show this driver supports
		 * alternate queueing.
		 */
	        ifp->if_altqflags |= ALTQF_READY;
	#endif
	        if_attach(ifp);

Step 2: if_start routine.  (e.g. vxstart)

This is an example of how to put the alternate dequeue operation in
the if_start routine.

	#ifdef ALTQ
	    if (IS_ALTQ_ON(ifp))
		m0 = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE);
	    else
	#endif
	    IF_DEQUEUE(&ifp->if_snd, m0);

Also, many drivers peek the next packet in the queue to see they have
enough buffer space.  Those should be modified like this.

	    /* Sneak a peek at the next packet */
	#ifdef ALTQ
	    if (IS_ALTQ_ON(ifp))
		m0 = (*ifp->if_altqdequeue)(ifp, ALTDQ_PEEK);
	    else
	#endif
	    m0 = ifp->if_snd.ifq_head;

A queueing scheme guarantees that if a driver peeks the next packet
and then dequeues the packet, the same peeked packet is returned.
Because if_start is assumed to be called in splimp, if_start can
safely dequeue the same packet.

The last variation is flushing the queue.  This is necessary for
non-work conserving queueing schemes, since just dequeueing until NULL
returned doesn't drain those queues.

	(*ifp->if_altqdequeue)(ifp, ALTDQ_FLUSH);

See the altq document for more details.  Also, vxstart in if_vx.c is a 
good reference.

(2) other network drivers

You have to modify if_output too.  See the altq document and
ether_output() in "net/if_ethersubr.c" as a reference.

