+extern errno_t ifnet_allocate(const struct ifnet_init_params *init,
+ ifnet_t *interface);
+
+#ifdef KERNEL_PRIVATE
+/*
+ @function ifnet_allocate_extended
+ @discussion An extended/newer variant of ifnet_allocate, with additional
+ support for the new output and input driver models.
+ @param init The initial values for the interface. These values can
+ not be changed after the interface has been allocated.
+ @param interface The interface allocated upon success.
+ @result May return ENOMEM if there is insufficient memory or EEXIST
+ if an interface with the same uniqueid and family has already
+ been allocated and is in use.
+ */
+extern errno_t ifnet_allocate_extended(const struct ifnet_init_eparams *init,
+ ifnet_t *interface);
+
+/*
+ @function ifnet_purge
+ @discussion Purge the output queue of an interface which implements
+ the new driver output model.
+ @param interface The interface to purge.
+ */
+extern void ifnet_purge(ifnet_t interface);
+
+/*
+ @function ifnet_enqueue
+ @discussion Enqueue a packet to the output queue of an interface
+ which implements the new driver output model.
+ @param interface The interface to enqueue the packet to.
+ @param packet The packet being enqueued; only one packet is allowed
+ to be enqueued at a time.
+ @result May return EINVAL if the parameters are invalid; ENXIO if
+ the interface doesn't implement the new driver output model;
+ EQFULL if the output queue is flow-controlled; or EQSUSPENDED
+ if the output queue is suspended. This routine either frees
+ or consumes the packet; the caller must not modify or free
+ it after calling this routine. Any attempt to enqueue more
+ than one packet will cause the entire packet chain to be freed.
+ */
+extern errno_t ifnet_enqueue(ifnet_t interface, mbuf_t packet);
+
+/*
+ @function ifnet_dequeue
+ @discussion Dequeue a packet from the output queue of an interface
+ which implements the new driver output model, and that the
+ output scheduling model is set to IFNET_SCHED_MODEL_NORMAL.
+ @param interface The interface to dequeue the packet from.
+ @param packet Pointer to the packet being dequeued.
+ @result May return EINVAL if the parameters are invalid, ENXIO if
+ the interface doesn't implement the new driver output model
+ or the output scheduling model isn't IFNET_SCHED_MODEL_NORMAL,
+ or EAGAIN if there is currently no packet available to
+ be dequeued.
+ */
+extern errno_t ifnet_dequeue(ifnet_t interface, mbuf_t *packet);
+
+/*
+ @function ifnet_dequeue_service_class
+ @discussion Dequeue a packet of a particular service class from the
+ appropriate output queue of an interface which implements the
+ new driver output model, and that the output scheduling model
+ is set to IFNET_SCHED_MODEL_DRIVER_MANAGED.
+ @param interface The interface to dequeue the packet from.
+ @param tc The service class.
+ @param packet Pointer to the packet being dequeued.
+ @result May return EINVAL if the parameters are invalid, ENXIO if
+ the interface doesn't implement the new driver output model
+ or if the output scheduling model isn't configured to
+ IFNET_SCHED_MODEL_DRIVER_MANAGED, or EAGAIN if there
+ is currently no packet available to be dequeued.
+ */
+extern errno_t ifnet_dequeue_service_class(ifnet_t interface,
+ mbuf_svc_class_t tc, mbuf_t *packet);
+
+/*
+ @function ifnet_dequeue_multi
+ @discussion Dequeue one or more packets from the output queue of an
+ interface which implements the new driver output model, and that
+ the output scheduling model is set to IFNET_SCHED_MODEL_NORMAL.
+ The returned packet chain is traversable with mbuf_nextpkt().
+ @param interface The interface to dequeue the packets from.
+ @param first_packet Pointer to the first packet being dequeued.
+ @param last_packet Pointer to the last packet being dequeued. Caller
+ may supply NULL if not interested in value.
+ @param cnt Pointer to a storage for the number of packets dequeued.
+ Caller may supply NULL if not interested in value.
+ @param len Pointer to a storage for the total length (in bytes)
+ of the dequeued packets. Caller may supply NULL if not
+ interested in value.
+ @result May return EINVAL if the parameters are invalid, ENXIO if
+ the interface doesn't implement the new driver output model
+ or the output scheduling model isn't IFNET_SCHED_MODEL_NORMAL,
+ or EAGAIN if there is currently no packet available to
+ be dequeued.
+ */
+extern errno_t ifnet_dequeue_multi(ifnet_t interface, u_int32_t max,
+ mbuf_t *first_packet, mbuf_t *last_packet, u_int32_t *cnt, u_int32_t *len);
+
+/*
+ @function ifnet_dequeue_service_class_multi
+ @discussion Dequeue one or more packets of a particular service class
+ from the appropriate output queue of an interface which
+ implements the new driver output model, and that the output
+ scheduling model is set to IFNET_SCHED_MODEL_DRIVER_MANAGED.
+ The returned packet chain is traversable with mbuf_nextpkt().
+ @param interface The interface to dequeue the packets from.
+ @param tc The service class.
+ @param first_packet Pointer to the first packet being dequeued.
+ @param last_packet Pointer to the last packet being dequeued. Caller
+ may supply NULL if not interested in value.
+ @param cnt Pointer to a storage for the number of packets dequeued.
+ Caller may supply NULL if not interested in value.
+ @param len Pointer to a storage for the total length (in bytes)
+ of the dequeued packets. Caller may supply NULL if not
+ interested in value.
+ @result May return EINVAL if the parameters are invalid, ENXIO if
+ the interface doesn't implement the new driver output model
+ or if the output scheduling model isn't configured to
+ IFNET_SCHED_MODEL_DRIVER_MANAGED, or EAGAIN if there
+ is currently no packet available to be dequeued.
+ */
+extern errno_t ifnet_dequeue_service_class_multi(ifnet_t interface,
+ mbuf_svc_class_t tc, u_int32_t max, mbuf_t *first_packet,
+ mbuf_t *last_packet, u_int32_t *cnt, u_int32_t *len);
+
+/*
+ @function ifnet_set_output_sched_model
+ @discussion Set the output scheduling model of an interface which
+ implements the new driver output model.
+ @param interface The interface to set scheduling model on.
+ @param model The IFNET_SCHED_MODEL value as defined in net/if.h
+ @result May return EINVAL if the parameters are invalid or ENXIO if
+ the interface doesn't implement the new driver output model.
+ */
+extern errno_t ifnet_set_output_sched_model(ifnet_t interface,
+ u_int32_t model);
+
+/*
+ @function ifnet_set_sndq_maxlen
+ @discussion Set the maximum length of the output queue of an
+ interface which implements the new driver output model.
+ This call may be issued post ifnet_allocate_extended in
+ order to modify the maximum output queue length previously
+ set at registration time.
+ @param interface The interface to set the max queue length on.
+ @param maxqlen The maximum number of packets in the output queue.
+ @result May return EINVAL if the parameters are invalid or ENXIO if
+ the interface doesn't implement the new driver output model.
+ */
+extern errno_t ifnet_set_sndq_maxlen(ifnet_t interface, u_int32_t maxqlen);
+
+/*
+ @function ifnet_get_sndq_maxlen
+ @discussion Get the maximum length of the output queue of an
+ interface which implements the new driver output model.
+ @param interface The interface to get the max queue length on.
+ @param maxqlen Pointer to a storage for the maximum number of packets
+ in the output queue.
+ @result May return EINVAL if the parameters are invalid or ENXIO if
+ the interface doesn't implement the new driver output model.
+ */
+extern errno_t ifnet_get_sndq_maxlen(ifnet_t interface, u_int32_t *maxqlen);
+
+/*
+ @function ifnet_get_sndq_len
+ @discussion Get the current length of the output queue of an
+ interface which implements the new driver output model.
+ @param interface The interface to get the current queue length on.
+ @param qlen Pointer to a storage for the current number of packets
+ in the output queue.
+ @result May return EINVAL if the parameters are invalid or ENXIO if
+ the interface doesn't implement the new driver output model.
+ */
+extern errno_t ifnet_get_sndq_len(ifnet_t interface, u_int32_t *qlen);
+
+/*
+ @function ifnet_set_rcvq_maxlen
+ @discussion Set the maximum length of the input queue of an
+ interface which implements the new driver input model.
+ This call may be issued post ifnet_allocate_extended in
+ order to modify the maximum input queue length previously
+ set at registration time.
+ @param interface The interface to set the max queue length on.
+ @param maxqlen The maximum number of packets in the input queue.
+ Drivers typically set this to the size of the receive ring
+ or the total number of descriptors used for the input path.
+ @result May return EINVAL if the parameters are invalid or ENXIO if
+ the interface doesn't implement the new driver input model.
+ */
+extern errno_t ifnet_set_rcvq_maxlen(ifnet_t interface, u_int32_t maxqlen);
+
+/*
+ @function ifnet_get_rcvq_maxlen
+ @discussion Get the maximum length of the input queue of an
+ interface which implements the new driver input model.
+ @param interface The interface to get the max queue length on.
+ @param maxqlen Pointer to a storage for the maximum number of packets
+ in the input queue.
+ @result May return EINVAL if the parameters are invalid or ENXIO if
+ the interface doesn't implement the new driver input model.
+ */
+extern errno_t ifnet_get_rcvq_maxlen(ifnet_t interface, u_int32_t *maxqlen);
+
+/*
+ @function ifnet_start
+ @discussion Trigger the transmission at the driver layer on an
+ interface which implements the new driver output model.
+ @param interface The interface to start the transmission on.
+ */
+extern void ifnet_start(ifnet_t interface);
+
+/*
+ @function ifnet_transmit_burst_start
+ @discussion Inform the kernel about the beginning of transmission
+ of a burst. This function should be called when a burst of
+ packets are scheduled to get transmitted over the link. The
+ callback will be used by the system to start measuring
+ bandwidth available on that link. The driver may choose to
+ adopt this scheme for uplink bandwidth measurement, in case
+ the information can't be obtained from the hardware. Else
+ it may alternatively inform the network stack about the
+ information using ifnet_set_bandwidths.
+ @param interface The interface.
+ @param mbuf_t The first packet in a burst of packets that has been
+ scheduled to transmit.
+*/
+extern void ifnet_transmit_burst_start(ifnet_t interface, mbuf_t pkt);
+
+/*
+ @function ifnet_transmit_burst_end
+ @discussion Inform the kernel about the end of transmission of a burst.
+ This function should be called when the transmission of a burst
+ of packets is done. This information will be used by the
+ system to estimate bandwidth available on that link. The
+ driver may choose to adopt this scheme for uplink bandwidth
+ measurement, in case the information can't be obtained from
+ the hardware. Else it may alternatively inform the network
+ stack about the information using ifnet_set_bandwidths.
+ @param interface The interface.
+ @param mbuf_t The last packet in the burst that has been successfully
+ transmitted.
+*/
+extern void ifnet_transmit_burst_end(ifnet_t interface, mbuf_t pkt);
+#endif /* KERNEL_PRIVATE */