7 .Nd Device Independent Configuration Functions
10 .Ss "Device Independent Functions"
12 .Fn iflib_device_attach "device_t dev"
14 .Fn iflib_device_detach "device_t dev"
16 .Fn iflib_device_suspend "device_t dev"
18 .Fn iflib_device_resume "device_t dev"
20 .Fn iflib_device_register "device_t dev, void *softc, if_shared_ctx_t sctx, if_ctx_t *ctxp"
22 .Fn iflib_device_deregister "if_ctx_t ctx"
24 .Fn iflib_irq_alloc "if_ctx_t ctx, if_irq_t irq_info, int rid, driver_filter_t filter, void *filter_arg, driver_intr_t handler, void *arg, char *name"
26 .Fn iflib_irq_alloc_generic "if_ctx_t, ctx, if_irq_t irq, int rid, intr_type_t type, driver_filter_t *filter, void *filter_arg, int qid, char *name"
28 .Fn iflib_led_create "if_ctx_t ctx"
30 .Fn iflib_tx_intr_deferred "if_ctx_t ctx, int txqid"
32 .Fn iflib_rx_intr_deferred "if_ctx_t ctx, int rxqid"
34 .Fn iflib_link_intr_deferred "if_ctx_t ctx"
36 .Fn iflib_link_state_change "if_ctx_t ctx, int linkstate"
38 .Fn iflib_led_create "if_ctx_t ctx"
40 .Fn iflib_add_int_delay_sysctl "if_ctx_t ctx, const char *, const char *, if_int_delay_info_t, int, int"
41 .Ss "Global Variables"
42 .Vt extern struct if_txrx
44 The \fIif_ctx_t\fP Structure is the device independent data structure that contains statistics and identifying information used to transmit and receive data packets. The interface is associated with an array of queues assigned sequentially. Each queu has its own transmit (iflib_txq_t) and receive (iflib_rxq_t) queue. The transmit queue is used to hold packets while the interface is in the process of sending another. The receive queue is used to receive packets that are awaiting processing.
46 .Ss The if_ctx_t Structure
50 .Bl -tag -width ".Va if_capabilities" -offset indent
53 A pointer to the driver's private state block.
56 The underlying device structure.
59 A link back to the interface structure
64 Mutex lock used to maintain data integrity
70 Device independent transmit queue maintained internally by iflib
73 Device independent receive queue maintained internally by iflib
76 Output queue that contains a single transmit (ifc_txq_t) and receive (ifc_rxq_t) queue
79 Flags describing the operational parameter of the interface
84 Describes the current link state of the Ethernet interface. It's possible values are either active or inactive.
87 .It Va ifc_vlan_attach_event
88 .Pq Vt "eventhandler_tag"
89 .It Va ifc_vlan_detach_event
90 .Pq Vt "eventhandler_tag"
91 .It Va ifc_pause_frames
93 .It Va ifc_watchdog_events
98 .Pq Vt "struct resource *"
100 .Pq Vt "struct if_irq"
101 .It Va ifc_admin_task
102 .Pq Vt "struct grouptask"
103 Taskqueue task scheduled for link state change events of the interface
104 .It Va ifc_filter_info
105 .Pq Vt "struct iflib_filter_info"
106 Statistics and information relating to the interface device filter
108 .Pq Vt "struct ifmedia"
110 .Pq Vt "struct if_txrx"
113 The above named functions are found exclusively in iflib. They are independent of the underlying hardware type or configuration.
114 .Ss Device Independent Functions
115 .Bl -ohang -offset indent
116 .It Fn iflib_device_attach
117 Function initiates a device registration with the iflib framework. It calls the iflib_register function, which is responsible for allocating and initializing the \fIif_ctx_t\fP structure.
118 .It Fn iflib_device_detach
119 Shutdown and detach the device. Unregister vlan events, drain any dependent tasks, and release irq, pci, and msix memory.
120 .It Fn iflib_device_suspend
121 Suspend a device by calling the device dependent suspend function and bus_generic_suspend.
122 .It Fn iflib_device_resume
123 Resume a device by calling the device dependent resume function, the iflib_init_locked function, and bus_generic_resume.
124 .It Fn iflib_device_register
125 Register a device with the iflib framework. Allocate and initialize the \fIif_ctx_t\fP structure. Setup and initialize the MSI or MSI/X interrupt queues if necessary. Allocate memory for queues and qset structure setup.
126 .It Fn iflib_device_irq_alloc
127 Allocate an interrupt resource for a given rid value with an associated filter and handler function.
128 .It Fn iflib_device_irq_alloc_generic
129 Performs the same function as iflib_device_irq_alloc along with the additional functionality of adding a taskgroup. The data fields and callback function are determined by the type of interrupt, such as IFLIB_INTR_TX, IFLIB_INTR_RX, and IFLIB_INTR_ADMIN.
130 .It Fn iflib_led_create
131 Calls led_create to initialize the ctx->ifc_led_dev field
132 .It Fn iflib_tx_intr_deferred
133 Calls GROUPTASK_ENQUEUE to enqueue the transfer queues ift_task.
134 .It Fn iflib_rx_intr_deferred
135 Calls GROUPTASK_ENQUEUE to enqueue the receive queues ifr_task.
136 .It Fn iflib_link_intr_deferred
137 Calls GROUPTASK_ENQUEUE to enqueue the link task
138 .It Fn iflib_link_state_change
139 Change the interface link status to either LINK_STATE_UP or LINK_STATE_DOWN as specified by the second argument to the function.
140 \fBInterface Link States\fP
141 The following link states are currently defined:
143 LINK_STATE_UP The link is up.
144 LINK_STATE_DOWN The link is down.
145 .It Fn iflib_add_int_delay_sysctl
146 Modifies settings to user defined values for a given set of variables.
149 iflibtxrx(9), iflibdd(9)
151 This manual page was written by