claude-noether 843d40231f danctnix-besser: regen cumulative patch with bes_chardev.{c,h} merge fix
Build (PID 558898 on boltzmann) failed at bes2600_btuart.c:81:
  error: implicit declaration of function 'bes2600_chrdev_switch_subsys_glb'

Root cause: the original danctnix-flavor adaptation overlaid Mobian's
heavily-trimmed bes_chardev.{c,h} on top of pristine danctnix.  Mobian's
flavor (694 lines) had stripped out the BT/WiFi subsystem-switch
orchestration that pristine danctnix (1387 lines) carries and that
danctnix-only bes2600_btuart.c calls.

Fix: restore pristine danctnix bes_chardev.{c,h} as the baseline for
those two files in the danctnix flavor, then reapply Mobian's
campaign-relevant changes:
  - Patch G: SPDX-License-Identifier header + corrected attribution
  - Patch B: bes2600_chrdev_do_bus_reset + _trigger_bus_reset
    (definitions in bes_chardev.c, declarations in bes_chardev.h,
    EXPORT_SYMBOL_GPL on _trigger_bus_reset since it is called from
    sta.c connection-loss-storm fast-recover path)

Phase 6 thread-safety contract: bus_reset functions read
bes2600_cdev.{sbus_ops,sbus_priv} without locking, identical to the
Mobian-flavor source-of-truth - acceptable given the bus_reset is
invoked from already-serialized higher-level error paths in sta.c.

48 files unchanged in count, +1412/-1243 (was +1426/-2003).  The
delta vs the previous patch is concentrated in bes_chardev.{c,h}:
+776/-16 in .c (restoring the BT/WiFi switching infrastructure plus
appending Patch B), +2/-2 in .h (declarations + SPDX).

Patch verified to apply cleanly to v7.0-danctnix1 baseline.
b2sum updated in PKGBUILD.

Build retrigger pending on his.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 13:59:04 +02:00

BESser — BES2600 driver mainlining for Pine64 PineTab2

Working tree for upstreaming the Bestechnic BES2600WM WiFi/BT combo driver currently shipped out-of-tree by the danctnix kernel for the Pine64 PineTab2.

Why "BESser"

"BES" (the chip vendor) + German besser ("better"). Sibling to:

  • Bin — u-boot upstreaming for the CoolPi GenBook (RK3588)
  • MegabitChip — DDR init blob RE for the same SoC
  • SouthAfrica — OpenPineBuds / 1MORE Fit SE BES2300 firmware RE (chip family relative)
  • RockHard — RK3588 mainline kernel work

Hardware target

Item Value
Device PineTab2
Host name ohm (ohm.fritz.box, ohm.vpn = 10.170.16.14)
SoC Rockchip RK3566 (aarch64)
WiFi/BT Bestechnic BES2600WM — WiFi 4 (11n dual-band 1x1) + BT 5.2/5.3
WiFi interface SDIO 3.0, vendor 0xBE57 device 0x2002
BT interface UART HCI (separate bes2600_btuart module)
OS Arch Linux ARM, danctnix kernel 6.19.10-danctnix1-1-pinetab2

Driver lineage

ST-Ericsson CW1200 (mainline drivers/net/wireless/st/cw1200/)
        │   author: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>
        ▼
Bestechnic BES2600 (closed fork ~20152023, same author)
        │   adds: BT-over-UART, 5GHz, ePTA coexistence, SDIO ADMA, char-dev API
        ▼
Released for Chinese Android burner-phone vendor kernels (~2023)
        │
        ▼
arjan-vlek/bes2600 (GitLab, 2023-07) → 26-commit checkpatch cleanup
        │
        ├── TuxThePenguin0/bes2600 (preserves pre-removal Android source)
        ├── salsa.debian.org/Mobian-team/devices/bes2600-dkms (active, our PR target)
        └── codeberg.org/DanctNIX/linux-pinetab2 (in-kernel at drivers/staging/bes2600/)

CW1200-ancestry markers in current source: same author Dmitry Tarnyagin, CONFIG_BES2600_USE_STE_EXTENSIONS (STE = ST-Ericsson), CONFIG_BES2600_WSM_DEBUG (WSM = CW1200's host↔FW protocol).

Repos

Role Path
This umbrella git.reauktion.de/marfrit/besser — patches/, scripts/, fw-analysis/, notes/
Mobian DKMS fork (PR target) git.reauktion.de/marfrit/bes2600-dkms — branches per patch; upstream = salsa.debian.org/Mobian-team/devices/bes2600-dkms

Patch series

Patch Status Description
c1 MERGED-LOCAL, deployed on ohm bes2600: use request_firmware() for factory.txt read — kills filp_open / kernel_read in the read path; fixes the (NULL device *) read and check /lib/firmware/bes2600_factory.txt error boot spam
c2 pending PM handshake gate + retry — fixes bes2600_pwr_enter_lp_mode wait pm ind timeout recurring every 510s
c3 pending bes_chardev removal + nl80211 testmode hookup — clears the second upstream blocker (custom char device); secondary effect on bug #3
c4 pending Enable CONFIG_BES2600_TESTMODE=y + route patch_wifi_testMode — exposes hidden firmware testmode features
c5 pending Investigate factory.txt parse fail — uncovered by c1; original bug masked it; parser chokes on data request_firmware now successfully returns
c1.1 pending follow-up Drop kernel_write from factory.c + bes_chardev.c + bes_fw.c (/lib/firmware/bes2002_fw_write.bin debug file!)
c1.2 pending follow-up Thread struct device * through factory API → eliminates (NULL device *) log prefix

Workflow

  1. Edit on Mobian fork (bes2600-dkms) — primary upstream PR target
  2. Topic branch per patch: bes2600/<short-name>
  3. git commit --signoff with full kernel-style message
  4. checkpatch.pl --no-tree --strict before push (must be clean)
  5. git format-patch -1 -o ../besser/patches/ to canonicalize
  6. Push branch to origin (Gitea), open MR upstream when ready

Build + deploy

See scripts/:

  • build-bes2600-on-ohm.sh — native aarch64 build on ohm (requires linux-pinetab2-headers)
  • deploy-c1-to-ohm.sh — install patched modules to /lib/modules/<ver>/extra/ + depmod
  • backup-ohm-kernel.sh — timestamped tar.zst of /boot + /lib/modules + /lib/firmware/bes2600

Firmware RE state (task d)

Firmware blobs (4 .bin + factory.txt) are not committed here (binary, ships from Bestechnic). On boltzmann:~/src/besser/firmware-from-ohm/ and on oppenheimer:/work/besser/ (Ghidra host).

What IS committed under fw-analysis/:

  • *.strings.txt — full sorted-unique strings extraction per blob
  • *.fnnames.txt — function-name pattern extraction (191 candidates from best2002_fw_sdio.bin)

Build provenance: Dec 26-27 2023 build from Bestechnic Jenkins (GCC-10-pipeline), source git commit 8125e20be (NOT public).

Hidden features in firmware (per task d): testmode patch (CONFIG_BES2600_TESTMODE gates it), ePTA coexistence with bypass (gEptaBypass: %d), DPD per-channel calibration, hal_trace_crash_dump_register, METAL_ID + patch_version introspection, RF tone generation (nosignal variant), memory dump (nosignal variant), DAC/IQ calibration v2, fast-PSM tuning hooks.

Adjacent infrastructure

  • oppenheimer (CT131 on data Proxmox): Ghidra 11.3.2 host. SSH via mfritsche@192.168.88.63. Staging at /work/besser/.
  • boltzmann (Rock 5 ITX+): primary build/dev, ARM64 native, hub-tools preferred path.
  • ohm: target hardware; UART-over-USB-C debug rig also available (Tigard FT2232H Channel A @ 1.8V).

Authors / contacts

  • Markus Fritsche <fritsche.markus@gmail.com> (this fork)
  • Driver upstream: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com> (CW1200 / BES2600 base)
  • BT companion: Dang Huynh <dang.huynh@mainlining.org> (bes2600_btuart.c, 2025)
  • Mobian DKMS: Julian <mail@julianfairfax.ch> (current packaging maintainer)
S
Description
BESser - BES2600 driver mainlining umbrella (patches, RE, scripts)
Readme 471 MiB
Languages
Shell 100%