freebsd-skq/share/man/man9/iflibdd.9
Sean Bruno 34bac11eba Add iflib man pages for developers.
Doc review is probably waranted here for editing.

Submitted by:	Nicole Graziano
2017-01-28 00:40:36 +00:00

182 lines
6.6 KiB
Groff

.\" $FreeBSD$
.Dd January 27, 2017
.Dt IFlIBDD(9)
.Os
.Sh NAME
.Nm iflibdd
.Nd Device Dependent Configuration Functions
.Sh SYNOPSIS
.In "ifdi_if.h"
.Ss "Soft Queue Setup and Teardown Functions"
.Ss "Mandatory Functions"
.Ft int
.Fn ifdi_queues_alloc "if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int nqs"
.Ft int
.Fn ifdi_queues_free "if_ctx_t ctx"
.Ss "Optional Functions"
.Ft int
.Fn ifdi_txq_setup "if_ctx_t ctx, uint16_t qid"
.Ft int
.Fn ifdi_rxq_setup "if_ctx_t ctx, uint16_t qid"
.Ss "Device Setup and Teardown Functions"
.Ss "Mandatory Functions"
.Ft int
.Fn ifdi_attach_pre "if_ctx_t ctx"
.Ft int
.Fn ifdi_attach_post "if_ctx_t ctx"
.Ft int
.Fn ifdi_detach "if_ctx_t ctx"
.Ss "Optional Functions"
.Ft void
.Fn ifdi_vlan_register "if_ctx_t ctx, uint16_t vtag"
.Ft void
.Fn ifdi_vlan_unregister "if_ctx_t ctx, uint16_t vtag"
.Ft int
.Fn ifdi_suspend "if_ctx_t ctx"
.Ft int
.Fn ifdi_resume "if_ctx_t ctx"
.Ss "Device Configuration Functions"
.Ss "Mandatory Functions"
.Ft void
.Fn ifdi_init "if_ctx_t ctx"
.Ft void
.Fn ifdi_stop "if_ctx_t ctx"
.Ft void
.Fn ifdi_multi_set "if_ctx_t ctx"
.Ft int
.Fn ifdi_mtu_set "if_ctx_t ctx, uint32_t mtu"
.Ft void
.Fn ifdi_media_status "if_ctx_t ctx, struct ifmediareq *ifr"
.Ft int
.Fn ifdi_media_change "if_ctx_t ctx"
.Ft void
.Fn ifdi_promisc_set "if_ctx_t ctx, int flags"
.Ft uint64_t
.Fn ifdi_get_counter "if_ctx_t ctx, ift_counter cnt"
.Ft void
.Fn ifdi_update_admin_status "if_ctx_t ctx"
.Ss "Optional Functions"
.Ft void
.Fn ifdi_media_set "if_ctx_t ctx"
.Ss "Interrupt enable/disable"
.Ss "Mandatory Functions"
.Ft void
.Fn ifdi_intr_enable "if_ctx_t ctx"
.Ft void
.Fn ifdi_queue_intr_enable "if_ctx_t ctx, uint16_t qid"
.Ft void
.Fn ifdi_intr_disable "if_ctx_t ctx"
.Ss IOV Support
.Ft init
.Fn iov_init "if_ctx_t, uint16_t num_vfs, const nvlist_t *params"
.Ft void
.Fn iov_uinit "if_ctx_t ctx"
.Ft void
.Fn ifdi_vflr_handle "if_ctx_t ctx"
.Ft int
.Fn ifdi_vf_add "if_ctx_t ctx, uint16_t vfnum, const nvlist_t *params"
.Ss "Optional Functions"
.Ft void
.Fn ifdi_link_intr_enable "if_ctx_t ctx"
.Ss "Optional Service Routines"
.Ft void
.Fn ifdi_timer "if_ctx_t ctx"
.Ft void
.Fn ifdi_watchdog_reset "if_ctx_t ctx"
.Ss "Additional Functions"
.Ft void
.Fn ifdi_led_func "if_ctx_t ctx, int onoff"
.Ft int
.Fn ifdi_sysctl_int_delay "if_ctx_t ctx, if_int_delay_info_t iidi"
.Ft int
.Fn ifdi_i2c_req "if_ctx_t ctx, struct ifi2creq *req"
.Sh FUNCTIONS
The above named functions are device dependent configuration functions. These routines are registerd with iflib by the driver and are called from the corresponding iflib function to configure device specific functions and registers.
.Ss Device Dependent Functions
.Ss Soft Queue Setup and Teardown
.Bl -ohang -offset indent
.It Fn ifdi_queues_alloc
Manditory queues allocation function that is called during iflib_attach. vaddrs and paddrs are arrays of virtual and physical addresses respectively of the hardware transmit and receive queues, and if relevany, any command completion queues. nqs is the number of queues per qset. For example, a driver with a single receive and transmit queue would have a nqs equal to 2.
.It Fn ifdi_queues_free
Mandatory function that frees the allocated queues and associated transmit buffers.
.It Fn ifdi_txq_setup
Optional function for each transmit queue that handles device specific initialization.
.It Fn ifdi_rxq_setup
Optional function for each receive queue that handles device specific initialization.
.El
.Ss Device Setup and Teardown
.Bl -ohang -offset indent
.It Fn ifdi_attach_pre
Mandatory function implemented by the driver to perform any attach logic that procedes interrupt and queue allocation, queue setup, and interrupt assignment.
.It Fn ifdi_attach_post
Mandatory function implemented by the driver to perform any attach logic that occurs after ifdi_attach_pre, and iflib's queue setup and MSI/MSIX(X) or legacy interrupt assignment.
.It Fn ifdi_detach
Mandatory function that frees any resources allocated by the driver in ifdi_attach_pre and ifdi_attach_post.
.It Fn ifdi_vlan_register
Optional function called by the VLAN config eventhandler. _vtag is the new VLAN tag.
.It Fn ifdi_vlan_unregister
Optional function called by the VLAN unconfig eventhandler.
.It Fn ifdi_suspend
Optional function that suspends the driver.
.It Fn ifdi_resume
Optional function that resumes a driver.
.El
.Ss Device Configuration Functions
.Bl -ohang -offset indent
.It Fn ifdi_init
Mandatory function that will initialize and bring up the hardware. For example, it will reset the chip and enable the receiver unit. It should mark the interface running, but not active (IFF_DRV_RUNNING, ~IIF_DRV_OACTIVE).
.It Fn ifdi_stop
Mandatory function that should disable all traffic on the interface by issuing a global reset on the MAC and deallocating the TX and RX buffers.
.It Fn ifdi_multi_set
Programs the interfaces multicast addresses
.It Fn ifdi_media_status
Media Ioctl Callback. Function is called whenever the user queries the status of the interface using ifconfig. The driver sets the appropriate link type and speed in ifmr->ifm_active.
.It Fn ifdi_mtu_set
Sets the mtu interface to the value of the second function parameter mtu.
.It Fn ifdi_media_change
Function is called when the user changes speed/duplex using the media/mediaopt option with ifconfig.
.It Fn ifdi_promisc_set
Enables or disables promisc settings depending upon the flags value. Flags contains the interfaces' ifnet flags.
.It Fn ifdi_get_counter
Returns the value for counter cnt depending upon counter type.
.It Fn ifdi_update_admin_status
Sets the link_up state to TRUE or FALSE depending upon the OS link state. A real check of the hardware only happens with a link interrupt.
.It Fn ifdi_media_set
Need to define
.El
.Ss Interrupt Enable/Disable
.Bl -ohang -offset indent
.It Fn ifdi_intr_enable
Mandatory function that enables all interrupts.
.It Fn ifdi_intr_disable
Mandatory function that disables all interrupts.
.It Fn ifdi_queue_intr_enable
Mandatory function that enables interrupts on queue qid.
.It Fn iov_init
Initialize num_vfs VFs.
.It Fn io_uninit
Tear down the context for all VFs.
.It Fn ifdi_vflr_handle
Handle any VFs that have reset themselves via a Function Level Reset(FLR).
.It Fn ifdi_vf_add
Set parameters in params in VF vfnum.
.El
.Ss Service Routines
.Bl -ohang -offset indent
.It ifdi_timer
Optional timer routine that will be run every 500ms.
.It ifdi_watchdog_reset
Optional function to run when a transmit queue is hung.
.El
.Ss Additional Functions
.Bl -ohang -offset indent
.It ifdi_led_func
.It ifdi_sysctl_int_delay
.It ifdi_i2c_req
.El
.Sh "SEE ALSO"
iflibtxrx(9), iflibdd(9)
.Sh AUTHORS
This manual page was written by
.An Nicole Graziano