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
88 .Fo iflib_add_int_delay_sysctl
92 .Fa "if_int_delay_info_t"
96 .Ss "Global Variables"
97 .Vt extern struct if_txrx
99 The \fIif_ctx_t\fP Structure is the device independent data structure that
100 contains statistics and identifying information used to transmit and receive
102 The interface is associated with an array of queues assigned sequentially.
103 Each queue has its own transmit (iflib_txq_t) and receive (iflib_rxq_t) queue.
104 The transmit queue is used to hold packets while the interface is in the
105 process of sending another.
106 The receive queue is used to receive packets that are awaiting processing.
108 .Ss The if_ctx_t Structure
110 .Vt "struct if_ctx_t"
112 .Bl -tag -width ".Va if_capabilities" -offset indent
115 A pointer to the driver's private state block.
118 The underlying device structure.
121 A link back to the interface structure
126 Mutex lock used to maintain data integrity
129 The name of the mutex
132 Device independent transmit queue maintained internally by iflib
135 Device independent receive queue maintained internally by iflib
137 .Pq Vt "iflib_qset_t"
138 Output queue that contains a single transmit (ifc_txq_t) and receive
142 Flags describing the operational parameter of the interface
145 .It Va ifc_link_state
147 Describes the current link state of the Ethernet interface.
148 Its possible values are either active or inactive.
151 .It Va ifc_vlan_attach_event
152 .Pq Vt "eventhandler_tag"
153 .It Va ifc_vlan_detach_event
154 .Pq Vt "eventhandler_tag"
155 .It Va ifc_pause_frames
157 .It Va ifc_watchdog_events
162 .Pq Vt "struct resource *"
163 .It Va ifc_legacy_irq
164 .Pq Vt "struct if_irq"
165 .It Va ifc_admin_task
166 .Pq Vt "struct grouptask"
167 Taskqueue task scheduled for link state change events of the interface
168 .It Va ifc_filter_info
169 .Pq Vt "struct iflib_filter_info"
170 Statistics and information relating to the interface device filter
172 .Pq Vt "struct ifmedia"
174 .Pq Vt "struct if_txrx"
177 The above named functions are found exclusively in iflib.
178 They are independent of the underlying hardware type or configuration.
179 .Ss Device Independent Functions
180 .Bl -ohang -offset indent
181 .It Fn iflib_device_attach
182 Function initiates a device registration with the iflib framework.
183 It calls the iflib_register function, which is responsible for allocating
184 and initializing the \fIif_ctx_t\fP structure.
185 .It Fn iflib_device_detach
186 Shutdown and detach the device.
187 Unregister vlan events, drain any dependent tasks, and release irq, pci, and
189 .It Fn iflib_device_suspend
190 Suspend a device by calling the device dependent suspend function and
192 .It Fn iflib_device_resume
193 Resume a device by calling the device dependent resume function, the
194 iflib_init_locked function, and bus_generic_resume.
195 .It Fn iflib_device_register
196 Register a device with the iflib framework.
197 Allocate and initialize the
198 \fIif_ctx_t\fP structure.
199 Setup and initialize the MSI or MSI/X interrupt queues if necessary.
200 Allocate memory for queues and qset structure setup.
201 .It Fn iflib_device_irq_alloc
202 Allocate an interrupt resource for a given rid value with an associated filter
203 and handler function.
204 .It Fn iflib_device_irq_alloc_generic
205 Performs the same function as iflib_device_irq_alloc along with the additional
206 functionality of adding a taskgroup.
207 The data fields and callback function are determined by the type of interrupt,
212 .Dv IFLIB_INTR_ADMIN .
213 .It Fn iflib_led_create
214 Calls led_create to initialize the ctx->ifc_led_dev field
215 .It Fn iflib_tx_intr_deferred
216 Calls GROUPTASK_ENQUEUE to enqueue the transfer queues ift_task.
217 .It Fn iflib_rx_intr_deferred
218 Calls GROUPTASK_ENQUEUE to enqueue the receive queues ifr_task.
219 .It Fn iflib_link_intr_deferred
220 Calls GROUPTASK_ENQUEUE to enqueue the link task
221 .It Fn iflib_link_state_change
222 Change the interface link status to either
226 as specified by the second argument to the function.
228 .Em Interface Link States
229 The following link states are currently defined:
232 .It Dv LINK_STATE_DOWN
234 .It Fn iflib_add_int_delay_sysctl
235 Modifies settings to user defined values for a given set of variables.
241 This manual page was written by