Page MenuHomeFreeBSD

aq(4): modernize and de-Linuxify the vendor driver
ClosedPublic

Authored by nick_spun.io on Thu, Jun 4, 11:25 AM.
Referenced Files
F160138250: D57438.id.diff
Sun, Jun 21, 5:02 PM
Unknown Object (File)
Sun, Jun 21, 1:11 AM
Unknown Object (File)
Sun, Jun 21, 1:09 AM
Unknown Object (File)
Sat, Jun 20, 5:57 PM
Unknown Object (File)
Sat, Jun 20, 12:27 PM
Unknown Object (File)
Fri, Jun 19, 1:58 AM
Unknown Object (File)
Fri, Jun 19, 12:17 AM
Unknown Object (File)
Fri, Jun 19, 12:13 AM
Subscribers

Details

Summary

Dead-code removal, device_printf(9) logging, style(9) de-Linuxification,
const F/W-ops tables, and readability cleanups. No change for valid
traffic.

Dead code and logging:

  • Remove the sub-gigabit TSO-masking block in the link-state ISR: it cleared IFCAP_TSO from the static isc_capabilities record (read only at attach / SIOCSIFCAP, never on the datapath), so it never gated TSO and only corrupted the validation mask. The Atlantic has no sub-gigabit TSO erratum.
  • Tidy the RX buffer-size handling: drop the dead switch(MCLBYTES) in aq_if_rx_queues_alloc, rename rx_max_frame_size -> rx_buf_size, and bound the per-fragment length from the wb.pkt_len writeback (EBADMSG on underflow or a final fragment longer than the RX buffer).
  • Drop every FreeBSD__/FreeBSD_version branch (FreeBSD 14.0 baseline); the pre-13 arms used pre-opaque-if_t APIs since removed and one never built.
  • Route all log messages through device_printf(9) (MAC via %6D), adding a device_t to struct aq_hw; drop the dead AQ_XXX_UNIMPLEMENTED_FUNCTION and aq_log_error macros and the per-ring init console spam.
  • Minor: comma -> semicolon in aq_if_attach_pre; (uint64_t) -> (uint32_t) TX high-word cast; MODULE_VERSION(atlantic, 1); remove unused/duplicate #includes.

style(9) and types:

  • Remove all typedef'd struct/enum/union types (aq_dev_t, the speed/fc/ debug enums, the volatile RX/TX descriptor types, the firmware-file types) in favor of bare tags; for the DMA descriptors the volatile qualifier moves to the pointer/use sites. Drop the _s/_e tag suffixes and the "#define aq_hw_s aq_hw" alias. Rename the OOP-style *self parameter to hw. Replace usec_delay/msec_delay/ARRAY_SIZE/LOWORD with FreeBSD equivalents (BIT kept). attribute((packed)) -> __packed.

F/W-ops vtable:

  • Rename the leftover hal parameter to hw; make aq_fw1x_ops/aq_fw2x_ops const (read-only data); drop the always-true "fw_ops &&" and always-present dispatch guards (only led_control, absent in F/W 1.x, keeps its NULL check).

Readability:

  • aq_isc_rxd_pkt_get: fold the four identical RX-error blocks into one rx_err: label. aq_isc_rxd_available: hoist the shared descriptor advance out of the EOP test and drop the redundant continue. aq_hw_offload_set: drop the dead "int err = 0". Fix a stale "10 ms" comment on a 50 ms DELAY and the redundant literal parentheses.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Sun, Jun 14, 4:22 PM
This revision now requires review to proceed.Sat, Jun 20, 4:41 PM
This revision was not accepted when it landed; it landed in state Needs Review.Sat, Jun 20, 7:11 PM
This revision was automatically updated to reflect the committed changes.