7 .Nd Device Dependent Configuration Functions
10 .Ss "Soft Queue Setup and Teardown Functions"
11 .Ss "Mandatory Functions"
16 .Fa "uint64_t *paddrs"
23 .Ss "Optional Functions"
34 .Ss "Device Setup and Teardown Functions"
35 .Ss "Mandatory Functions"
48 .Ss "Optional Functions"
50 .Fo ifdi_vlan_register
55 .Fo ifdi_vlan_unregister
67 .Ss "Device Configuration Functions"
68 .Ss "Mandatory Functions"
89 .Fa "struct ifmediareq *ifr"
103 .Fa "ift_counter cnt"
106 .Fo ifdi_update_admin_status
109 .Ss "Optional Functions"
114 .Ss "Interrupt enable/disable"
115 .Ss "Mandatory Functions"
121 .Fo ifdi_queue_intr_enable
126 .Fo ifdi_intr_disable
133 .Fa "uint16_t num_vfs"
134 .Fa "const nvlist_t *params"
148 .Fa "const nvlist_t *params"
150 .Ss "Optional Functions"
152 .Fo ifdi_link_intr_enable
155 .Ss "Optional Service Routines"
161 .Fo ifdi_watchdog_reset
164 .Ss "Additional Functions"
171 .Fo ifdi_sysctl_int_delay
173 .Fa "if_int_delay_info_t iidi"
178 .Fa "struct ifi2creq *req"
181 The above named functions are device dependent configuration functions.
182 These routines are registered with iflib by the driver and are called from the
183 corresponding iflib function to configure device specific functions and
185 .Ss Device Dependent Functions
186 .Ss Soft Queue Setup and Teardown
187 .Bl -ohang -offset indent
188 .It Fn ifdi_queues_alloc
189 Mandatory queues allocation function that is called during iflib_attach.
190 vaddrs and paddrs are arrays of virtual and physical addresses respectively of
191 the hardware transmit and receive queues, and if relevany, any command
193 nqs is the number of queues per qset.
194 For example, a driver with a single receive and transmit queue would have a nqs
196 .It Fn ifdi_queues_free
197 Mandatory function that frees the allocated queues and associated transmit
199 .It Fn ifdi_txq_setup
200 Optional function for each transmit queue that handles device specific
202 .It Fn ifdi_rxq_setup
203 Optional function for each receive queue that handles device specific
206 .Ss Device Setup and Teardown
207 .Bl -ohang -offset indent
208 .It Fn ifdi_attach_pre
209 Mandatory function implemented by the driver to perform any attach logic that
210 procedes interrupt and queue allocation, queue setup, and interrupt assignment.
211 .It Fn ifdi_attach_post
212 Mandatory function implemented by the driver to perform any attach logic that
213 occurs after ifdi_attach_pre, and iflib's queue setup and MSI/MSIX(X) or legacy
214 interrupt assignment.
216 Mandatory function that frees any resources allocated by the driver in
217 ifdi_attach_pre and ifdi_attach_post.
218 .It Fn ifdi_vlan_register
219 Optional function called by the VLAN config eventhandler.
222 .It Fn ifdi_vlan_unregister
223 Optional function called by the VLAN unconfig eventhandler.
225 Optional function that suspends the driver.
227 Optional function that resumes a driver.
229 .Ss Device Configuration Functions
230 .Bl -ohang -offset indent
232 Mandatory function that will initialize and bring up the hardware.
233 For example, it will reset the chip and enable the receiver unit.
234 It should mark the interface running, but not active (
235 .Dv IFF_DRV_RUNNING ,
236 .Dv ~IIF_DRV_OACTIVE ).
238 Mandatory function that should disable all traffic on the interface by issuing
239 a global reset on the MAC and deallocating the TX and RX buffers.
240 .It Fn ifdi_multi_set
241 Programs the interfaces multicast addresses
242 .It Fn ifdi_media_status
243 Media Ioctl Callback.
244 Function is called whenever the user queries the status of the interface using
246 The driver sets the appropriate link type and speed in ifmr->ifm_active.
248 Sets the mtu interface to the value of the second function parameter mtu.
249 .It Fn ifdi_media_change
250 Function is called when the user changes speed/duplex using the media/mediaopt
253 .It Fn ifdi_promisc_set
254 Enables or disables promisc settings depending upon the flags value.
256 contains the interface's
259 .It Fn ifdi_get_counter
260 Returns the value for counter cnt depending upon counter type.
261 .It Fn ifdi_update_admin_status
262 Sets the link_up state to TRUE or FALSE depending upon the OS link state.
263 A real check of the hardware only happens with a link interrupt.
264 .It Fn ifdi_media_set
267 .Ss Interrupt Enable/Disable
268 .Bl -ohang -offset indent
269 .It Fn ifdi_intr_enable
270 Mandatory function that enables all interrupts.
271 .It Fn ifdi_intr_disable
272 Mandatory function that disables all interrupts.
273 .It Fn ifdi_queue_intr_enable
274 Mandatory function that enables interrupts on queue qid.
276 Initialize num_vfs VFs.
278 Tear down the context for all VFs.
279 .It Fn ifdi_vflr_handle
280 Handle any VFs that have reset themselves via a Function Level Reset (FLR).
282 Set parameters in params in VF vfnum.
285 .Bl -ohang -offset indent
287 Optional timer routine that will be run every 500ms.
288 .It Fn ifdi_watchdog_reset
289 Optional function to run when a transmit queue is hung.
291 .Ss Additional Functions
292 .Bl -ohang -offset indent
294 .It Fn ifdi_sysctl_int_delay
303 This manual page was written by