Commit graph

22 commits

Author SHA1 Message Date
98356a2663 Board drivers: audit fixes V6, V8, V9, V11; relabel ported drivers GPL-2.0
Security fixes from the audit:
- V8 caam: the HMAC raw key (up to 128 bytes) was copied into a buffer
  of the split key's size (32 bytes for MD5, 48 for SHA-1), reachable
  through /dev/crypto. The buffer now fits both. caam_dma_free() zeroes
  every buffer itself, which also fixes the QI path clearing twice the
  split key buffer's size at each session teardown.
- V6 mwifiex: the uap_passphrase sysctl, readable by every local user,
  is write-only; mwifiex_uap says to keep the passphrase in a 0600
  /etc/rc.conf.d/mwifiex_uap.
- V9 dpaa_wifi: hardware frame lengths were copied into a 4 KB cluster
  unchecked, and scatter/gather frames read as one buffer. One helper
  now takes only contiguous frames within the buffer, at any length.
- V11: cdx frees IPsec keys and shared descriptors with zfree(); fmc's
  state file moves from /tmp (symlink attack by any local user) to
  /var/run.
- The firmware object pcieuart9098_combo_v1.bin.fwo is a build output
  and no longer tracked.

caam, ina2xx and lp5812 were ported from Linux and relabelled BSD-2 by
the vendor (8f9b3bf, 84e318c, ac81eea). They are GPL-2.0-only again,
with the Linux sources' copyright holders; LICENSING.md lists them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 21:30:15 -05:00
87893ded3e Build 26.7 for FreeBSD 15 only; port caam and cdx to its kernel
- caam: the bus activate, deactivate and release resource methods take
  no type and rid in FreeBSD 15.
- cdx: sys/cdefs.h defines __maybe_unused now; define it only if missing.
- 26.1 is end of life and no longer built: remove patches/26.1 and
  make-26.1.conf, default to 26.7 and FreeBSD 15.1 throughout, and move
  the build examples in README.md and RELEASE.md to 26.7.9. The 26.1
  tree on the mirror stays, for gateways that still have to upgrade.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 19:26:41 -05:00
bd67c63c2c Untrack the mwifiex build symlinks
drivers/mwifiex/Makefile links the vendor mlan sources and the firmware
from _vendor/ into its directory when building, and removes them on clean.
Those links were committed by accident (absolute /usr/deps/_vendor paths,
dangling everywhere else), and Portainer refuses to clone a repository
that contains symlinks. They are ignored now; the modules build the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:45:45 -05:00
Tomaz Zaman
ac81eea5d5 lp5812: replace Linux references with datasheet citations in comments
Change "from leds-lp5812.h" to "from LP5812 datasheet" and
"matches Linux driver" to "per LP5812 datasheet" in comments.
No functional changes.
2026-03-29 17:02:18 +02:00
Tomaz Zaman
c3ad5aa81a mwifiex: relicense moal files to GPL-2.0 with NXP copyright
The FreeBSD moal shim layer links directly against NXP's GPL-2.0
mlan core (~127K lines). Relicense the 4 moal files and Makefile
from BSD-2-Clause to GPL-2.0 and add NXP copyright, consistent
with the mlan source they are compiled against.
2026-03-29 17:02:10 +02:00
Tomaz Zaman
8f9b3bf487 caam: rename descriptor constants and remove GPL source references
Add CAAM_ prefix to all 253 descriptor command constants (CMD_* ->
CAAM_CMD_*, HDR_* -> CAAM_HDR_*, KEY_* -> CAAM_KEY_*, OP_ALG_* ->
CAAM_OP_ALG_*, LDST_*, FIFOLD_*, FIFOST_*, JUMP_*, MATH_*, MOVE_*)
to differentiate from Linux drivers/crypto/caam/desc.h naming.

Replace all 30+ Linux references in comments with NXP SEC reference
manual citations. Change "ported from" and "matches exactly" language
to hardware-specification references.

No functional changes — purely mechanical renames and comment rewording
for licensing clarity. Build verified clean with -Werror.
2026-03-29 01:12:41 +01:00
Tomaz Zaman
84e318cb09 ina2xx: rename constants and structs to differentiate from GPL source
Rename register macros (INA2XX_* -> INA_REG_*), config struct
(ina2xx_config -> ina_chip_params with new field names), and LSB
calculation variable to remove 1:1 naming correspondence with the
Linux hwmon/ina2xx.c GPL driver. Change "Based on" to "Inspired by"
and remove explicit Linux function reference from comments.

No functional changes — purely mechanical renames for licensing clarity.
2026-03-29 01:12:31 +01:00
Tomaz Zaman
16e02dd356 pcf2131: call inittodr() after late clock registration
The driver attaches via config_intrhook, which runs after the kernel's
inittodr() has already failed with ENXIO. Re-invoke inittodr() after
clock_register_flags() so the system time is set from the RTC.
2026-03-26 18:15:12 +01:00
Tomaz Zaman
36526892ec sfpled: use ifnet link state instead of SFP GPIOs
The dtsec driver now owns the SFP GPIO pins (mod-def0, LOS,
TX-disable).  FreeBSD gpiobus only allows one consumer per pin,
so sfpled can no longer acquire them.  Remove all SFP GPIO and
I2C EEPROM access from sfpled — derive module presence and link
state purely from the dtsec ifnet link state:

  LINK_STATE_UNKNOWN → no module → LEDs off
  LINK_STATE_DOWN    → module present, no link → orange solid
  LINK_STATE_UP      → link up → green on, orange blinks on traffic
2026-03-15 14:27:17 +01:00
Tomaz Zaman
a5258dd258 build: use standard OPNsense paths (/usr/src, /usr/tools, /usr/deps)
Replace custom /build/ layout with standard OPNsense /usr/ hierarchy.
Add DEPSDIR variable to GATEWAY.conf. Make git pull non-fatal for NFS
setups. Update all Makefile paths, symlinks, and README instructions.
2026-03-15 02:23:20 +01:00
Maurice Walker
a906b7adc0
drivers/fand: fix SRCDIR
This is not the same SRCDIR as in the top-level Makefile. The SRCDIR of the top-level Makefile must not flow through to here.
2026-03-15 02:17:14 +01:00
Tomaz Zaman
3481c87698 build: forward SYSROOT/KSRCDIR to sub-makes, fix parallel clean race
- Pass SYSROOT and KSRCDIR from top-level Makefile to all Makefile.cross
  invocations so SRCTOP override flows through to sub-makes
- Add .ORDER directives to prevent "make -j clean all" race where clean
  deletes .ko files while modules target tries to copy them
- Remove redundant dist target (modules/userspace already copy to dist/)
- Fix package target depending on clean (raced with its own dist dep)
- Make IMAGESDIR/SETSDIR overridable with ?=
- Update mk-kernel-img.sh defaults from legacy /mnt/vision paths
- Replace MONO-GATEWAY with GATEWAY in all Makefile comments
- Remove stale patches/ from README directory tree
- Document SRCTOP override and make image shortcut in README
2026-03-14 15:07:06 +01:00
Tomaz Zaman
ef5b163670 WiFi UAP: WPA3-SAE PMF fix, rc.d service, CMM loopback fix
- Fix WPA3-SAE authentication failure by injecting custom RSN IE with
  PMF capability bits (MFPC/MFPR) via MLAN_OID_MISC_CUSTOM_IE. Without
  PMF advertised in beacons, WPA3 clients reject the connection.
- Use PROTOCOL_WPA2 + KEY_MGMT_SAE instead of PROTOCOL_WPA3_SAE so
  mlan TLV builder emits AKMP/cipher/passphrase TLVs correctly.
- Add SAE password field population for WPA3 and WPA2+WPA3 modes.
- Add UAP sysctls: country code, beacon interval, DTIM period.
- Add mwifiex_uap rc.d service script for rc.conf-based AP config.
- Load dpaa_wifi module before mwifiex in early syshook script.
- Fix CMM route offload logging thousands of errors for loopback input
  device — skip lo0 in cmm_fe_route_register() since CDX can't use it.
- Remove uninformative debug printk from CDX control_wifi.c.
2026-03-06 21:59:21 +01:00
Tomaz Zaman
96a1d5ade8 WiFi offload: per-VAP FQs, SG inject, backpressure, debug control
dpaa_wifi: Add per-VAP distribution FQs (64 per VAP, hash across CPUs)
for CDX→WiFi download, with fallback to OH default FQ. Add SG inject
path for oversized frames. Add TX backpressure via BMan pool threshold.
Add sysctl tree (dev.dpaa_wifi.*) for runtime stats and tuning. Switch
RX paths to copy-then-free model to prevent dtsec BMan pool drain.
Add enqueue retry loop and per-VAP/global counters.

mwifiex: Route debug prints through log() instead of printf() so they
go to syslog, not console. MFATAL still goes to console, MERROR to
syslog, everything else suppressed unless dev.mwifiex.0.debug=1.
Add TX backpressure (IFF_DRV_OACTIVE) with configurable watermark.
Fix UAP 5 GHz rate table, HT capabilities, and MLAN_STATUS_PENDING
reschedule in main_task.

cdx: Use per-VAP distribution FQs for WiFi TX routing with OH fallback.
Add dist fallback callback for dtsec-BPID frames on OH port dist FQs.

pf_notify: Keep PF state alive while CDX offloads the flow by updating
expire on counter sync, preventing premature state purge.
2026-03-06 12:24:24 +01:00
Tomaz Zaman
1bc132cc48 CDX: PLCR/KG miss fixup, per-CPU dist FQs, clean kldunload
- Miss action fixup: Ethernet/PPPoE tables → PLCR policer (rate-limits
  exception traffic), all other tables → KG scheme with CC_EN (re-enters
  CC tree). Replaces previous ENQ_FRAME-to-default-FQID approach.

- Distribution FQRs now use per-CPU SW portal channels instead of pool
  channel, preventing TCP reordering on miss path.

- BMan buffer refill: cdx_dist_fq_rx_callback now calls
  dtsec_rm_pool_rx_refill_bpid() and frees buffers via
  dtsec_rm_buf_free_external() (per-port UMA zone) instead of direct
  bman_put_buffer().

- Clean kldunload: cdx_destroy_port_fqs() retires all dist FQRs,
  qman_portal_quiesce() drains in-flight portal polls.
  FM_PORT_DeletePCD() called on all dtsec RX + OH ports before hash
  table deletion, preventing FMan PCD exceptions after unload.
2026-03-05 23:49:54 +01:00
Tomaz Zaman
2339ecc091 Fix CAAM detach stale children, update CEETM and kernel patches 2026-03-03 21:05:53 +01:00
Tomaz Zaman
0ac9dbe362 Fix CAAM JR double enumeration, stale NOP interrupt, add make image target 2026-03-03 17:32:47 +01:00
Tomaz Zaman
9fb890cc1d Fix CAAM JR RNG polling failure caused by ISR/NOP-test race on sc_out_ridx 2026-03-03 11:46:55 +01:00
Tomaz Zaman
55441f0eca Add hwmon dashboard widget and fix EMC2302 fan stall detection 2026-03-03 02:02:49 +01:00
Tomaz Zaman
f535564d2d Add TI TMP431 dual-channel temperature sensor driver 2026-03-03 01:42:55 +01:00
Tomaz Zaman
f88576c880 Move pcf2131 and caam to out-of-tree kernel modules 2026-03-02 13:57:35 +01:00
Tomaz Zaman
5514d65ac5 Hello world. 2026-02-25 15:13:46 +01:00