7 .Nd Device Independent Configuration Functions
10 .Ss "Device Independent Functions"
12 .Fo iflib_device_attach
16 .Fo iflib_device_detach
20 .Fo iflib_device_suspend
24 .Fo iflib_device_resume
28 .Fo iflib_device_register
31 .Fa "if_shared_ctx_t sctx"
35 .Fo iflib_device_deregister
41 .Fa "if_irq_t irq_info"
43 .Fa "driver_filter_t filter"
44 .Fa "void *filter_arg"
45 .Fa "driver_intr_t handler"
50 .Fo iflib_irq_alloc_generic
54 .Fa "intr_type_t type"
55 .Fa "driver_filter_t *filter"
56 .Fa "void *filter_arg"
65 .Fo iflib_tx_intr_deferred
70 .Fo iflib_rx_intr_deferred
75 .Fo iflib_link_intr_deferred
79 .Fo iflib_link_state_change
84 .Fo iflib_add_int_delay_sysctl
88 .Fa "if_int_delay_info_t"
92 .Ss "Global Variables"
93 .Vt extern struct if_txrx
95 The \fIif_ctx_t\fP Structure is the device independent data structure that
96 contains statistics and identifying information used to transmit and receive
98 The interface is associated with an array of queues assigned sequentially.
99 Each queue has its own transmit (iflib_txq_t) and receive (iflib_rxq_t) queue.
100 The transmit queue is used to hold packets while the interface is in the
101 process of sending another.
102 The receive queue is used to receive packets that are awaiting processing.
104 .Ss The if_ctx_t Structure
106 .Vt "struct if_ctx_t"
108 .Bl -tag -width ".Va if_capabilities" -offset indent
111 A pointer to the driver's private state block.
114 The underlying device structure.
117 A link back to the interface structure
122 Mutex lock used to maintain data integrity
125 The name of the mutex
128 Device independent transmit queue maintained internally by iflib
131 Device independent receive queue maintained internally by iflib
133 .Pq Vt "iflib_qset_t"
134 Output queue that contains a single transmit (ifc_txq_t) and receive
138 Flags describing the operational parameter of the interface
141 .It Va ifc_link_state
143 Describes the current link state of the Ethernet interface.
144 Its possible values are either active or inactive.
147 .It Va ifc_vlan_attach_event
148 .Pq Vt "eventhandler_tag"
149 .It Va ifc_vlan_detach_event
150 .Pq Vt "eventhandler_tag"
151 .It Va ifc_pause_frames
153 .It Va ifc_watchdog_events
158 .Pq Vt "struct resource *"
159 .It Va ifc_legacy_irq
160 .Pq Vt "struct if_irq"
161 .It Va ifc_admin_task
162 .Pq Vt "struct grouptask"
163 Taskqueue task scheduled for link state change events of the interface
164 .It Va ifc_filter_info
165 .Pq Vt "struct iflib_filter_info"
166 Statistics and information relating to the interface device filter
168 .Pq Vt "struct ifmedia"
170 .Pq Vt "struct if_txrx"
173 The above named functions are found exclusively in iflib.
174 They are independent of the underlying hardware type or configuration.
175 .Ss Device Independent Functions
176 .Bl -ohang -offset indent
177 .It Fn iflib_device_attach
178 Function initiates a device registration with the iflib framework.
179 It calls the iflib_register function, which is responsible for allocating
180 and initializing the \fIif_ctx_t\fP structure.
181 .It Fn iflib_device_detach
182 Shutdown and detach the device.
183 Unregister vlan events, drain any dependent tasks, and release irq, pci, and
185 .It Fn iflib_device_suspend
186 Suspend a device by calling the device dependent suspend function and
188 .It Fn iflib_device_resume
189 Resume a device by calling the device dependent resume function, the
190 iflib_init_locked function, and bus_generic_resume.
191 .It Fn iflib_device_register
192 Register a device with the iflib framework.
193 Allocate and initialize the
194 \fIif_ctx_t\fP structure.
195 Setup and initialize the MSI or MSI/X interrupt queues if necessary.
196 Allocate memory for queues and qset structure setup.
197 .It Fn iflib_device_irq_alloc
198 Allocate an interrupt resource for a given rid value with an associated filter
199 and handler function.
200 .It Fn iflib_device_irq_alloc_generic
201 Performs the same function as iflib_device_irq_alloc along with the additional
202 functionality of adding a taskgroup.
203 The data fields and callback function are determined by the type of interrupt,
208 .Dv IFLIB_INTR_ADMIN .
209 .It Fn iflib_led_create
210 Calls led_create to initialize the ctx->ifc_led_dev field
211 .It Fn iflib_tx_intr_deferred
212 Calls GROUPTASK_ENQUEUE to enqueue the transfer queues ift_task.
213 .It Fn iflib_rx_intr_deferred
214 Calls GROUPTASK_ENQUEUE to enqueue the receive queues ifr_task.
215 .It Fn iflib_link_intr_deferred
216 Calls GROUPTASK_ENQUEUE to enqueue the link task
217 .It Fn iflib_link_state_change
218 Change the interface link status to either
222 as specified by the second argument to the function.
224 .Em Interface Link States
225 The following link states are currently defined:
228 .It Dv LINK_STATE_DOWN
230 .It Fn iflib_add_int_delay_sysctl
231 Modifies settings to user defined values for a given set of variables.
237 This manual page was written by