7 .Nd Device Dependent Configuration Functions
10 .Ss "Soft Queue Setup and Teardown Functions"
11 .Ss "Mandatory Functions"
13 .Fo ifdi_tx_queues_alloc
16 .Fa "uint64_t *paddrs"
21 .Fo ifdi_rx_queues_alloc
24 .Fa "uint64_t *paddrs"
32 .Ss "Optional Functions"
43 .Ss "Device Setup and Teardown Functions"
44 .Ss "Mandatory Functions"
57 .Ss "Optional Functions"
59 .Fo ifdi_vlan_register
64 .Fo ifdi_vlan_unregister
76 .Ss "Device Configuration Functions"
77 .Ss "Mandatory Functions"
98 .Fa "struct ifmediareq *ifr"
101 .Fo ifdi_media_change
112 .Fa "ift_counter cnt"
115 .Fo ifdi_update_admin_status
118 .Ss "Optional Functions"
123 .Ss "Interrupt enable/disable"
124 .Ss "Mandatory Functions"
130 .Fo ifdi_queue_intr_enable
135 .Fo ifdi_intr_disable
142 .Fa "uint16_t num_vfs"
143 .Fa "const nvlist_t *params"
157 .Fa "const nvlist_t *params"
159 .Ss "Optional Functions"
161 .Fo ifdi_link_intr_enable
164 .Ss "Optional Service Routines"
170 .Fo ifdi_watchdog_reset
173 .Ss "Additional Functions"
180 .Fo ifdi_sysctl_int_delay
182 .Fa "if_int_delay_info_t iidi"
187 .Fa "struct ifi2creq *req"
190 The above named functions are device dependent configuration functions.
191 These routines are registered with iflib by the driver and are called from the
192 corresponding iflib function to configure device specific functions and
194 .Ss Device Dependent Functions
195 .Ss Soft Queue Setup and Teardown
196 .Bl -ohang -offset indent
197 .It Fn ifdi_tx_queues_alloc
198 Mandatory function that is called during iflib_attach to allocate transmit
200 vaddrs and paddrs are arrays of virtual and physical addresses respectively of
201 the hardware transmit queues.
202 ntxqs is the number of queues per qset.
203 ntxqsets is the number of qsets.
204 .It Fn ifdi_rx_queues_alloc
205 Mandatory function that is called during iflib_attach to allocate receive
207 vaddrs and paddrs are arrays of virtual and physical addresses respectively of
208 the hardware receive queues.
209 nrxqs is the number of queues per qset.
210 nrxqsets is the number of qsets.
211 .It Fn ifdi_queues_free
212 Mandatory function that frees the allocated queues and associated transmit
214 .It Fn ifdi_txq_setup
215 Optional function for each transmit queue that handles device specific
217 .It Fn ifdi_rxq_setup
218 Optional function for each receive queue that handles device specific
221 .Ss Device Setup and Teardown
222 .Bl -ohang -offset indent
223 .It Fn ifdi_attach_pre
224 Mandatory function implemented by the driver to perform any attach logic that
225 procedes interrupt and queue allocation, queue setup, and interrupt assignment.
226 .It Fn ifdi_attach_post
227 Mandatory function implemented by the driver to perform any attach logic that
228 occurs after ifdi_attach_pre, and iflib's queue setup and MSI/MSIX(X) or legacy
229 interrupt assignment.
231 Mandatory function that frees any resources allocated by the driver in
232 ifdi_attach_pre and ifdi_attach_post.
233 .It Fn ifdi_vlan_register
234 Optional function called by the VLAN config eventhandler.
237 .It Fn ifdi_vlan_unregister
238 Optional function called by the VLAN unconfig eventhandler.
240 Optional function that suspends the driver.
242 Optional function that resumes a driver.
244 .Ss Device Configuration Functions
245 .Bl -ohang -offset indent
247 Mandatory function that will initialize and bring up the hardware.
248 For example, it will reset the chip and enable the receiver unit.
249 It should mark the interface running, but not active (
250 .Dv IFF_DRV_RUNNING ,
251 .Dv ~IIF_DRV_OACTIVE ).
253 Mandatory function that should disable all traffic on the interface by issuing
254 a global reset on the MAC and deallocating the TX and RX buffers.
255 .It Fn ifdi_multi_set
256 Programs the interfaces multicast addresses
257 .It Fn ifdi_media_status
258 Media Ioctl Callback.
259 Function is called whenever the user queries the status of the interface using
261 The driver sets the appropriate link type and speed in ifmr->ifm_active.
263 Sets the mtu interface to the value of the second function parameter mtu.
264 .It Fn ifdi_media_change
265 Function is called when the user changes speed/duplex using the media/mediaopt
268 .It Fn ifdi_promisc_set
269 Enables or disables promisc settings depending upon the flags value.
271 contains the interface's
274 .It Fn ifdi_get_counter
275 Returns the value for counter cnt depending upon counter type.
276 .It Fn ifdi_update_admin_status
277 Sets the link_up state to TRUE or FALSE depending upon the OS link state.
278 A real check of the hardware only happens with a link interrupt.
279 .It Fn ifdi_media_set
282 .Ss Interrupt Enable/Disable
283 .Bl -ohang -offset indent
284 .It Fn ifdi_intr_enable
285 Mandatory function that enables all interrupts.
286 .It Fn ifdi_intr_disable
287 Mandatory function that disables all interrupts.
288 .It Fn ifdi_queue_intr_enable
289 Mandatory function that enables interrupts on queue qid.
291 Initialize num_vfs VFs.
293 Tear down the context for all VFs.
294 .It Fn ifdi_vflr_handle
295 Handle any VFs that have reset themselves via a Function Level Reset (FLR).
297 Set parameters in params in VF vfnum.
300 .Bl -ohang -offset indent
302 Optional timer routine that will be run every 500ms.
303 .It Fn ifdi_watchdog_reset
304 Optional function to run when a transmit queue is hung.
306 .Ss Additional Functions
307 .Bl -ohang -offset indent
309 .It Fn ifdi_sysctl_int_delay
318 This manual page was written by