Skip to content

Commit e0b0844

Browse files
committed
ap: enable 40/80MHz AP on FullMAC chips (Galaxy S10)
On Broadcom FullMAC (brcmfmac) chips, hostapd aborted with -95 (Not supported) whenever a 40/80MHz AP was requested: the firmware can't run the HT40 OBSS coexistence scan on an AP vif. The crash surfaced reliably in Droidspaces managed mode, where the longer setup window let hostapd reach the scan instead of falling back first. Emit no_pri_sec_switch=1 for HT40/VHT so hostapd skips that scan, and bump the hostapd-vap submodule to wire no_pri_sec_switch into the config parser (the upstream struct field exists but was unreachable from hostapd.conf) and to fall back to 20MHz when the driver rejects the HT40 pair instead of hard-failing. The FullMAC firmware then self-manages the final width. Assert the patch is present at build time so a submodule bump can't silently drop it. Signed-off-by: ravindu644 <droidcasts@protonmail.com>
1 parent d2c2dc1 commit e0b0844

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

backend/start-ap

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,15 +531,26 @@ write_hostapd_conf() {
531531
# max chip compatibility (width is independent of it).
532532
extra="ieee80211n=1
533533
ieee80211ac=1"
534+
# no_pri_sec_switch=1 skips hostapd's 20/40MHz OBSS coexistence scan
535+
# (the HT_SCAN state). FullMAC chips (e.g. Broadcom/brcmfmac on the
536+
# Galaxy S10) can't scan on an AP vif and return -95 (Not supported),
537+
# which aborts hostapd whenever HT40/VHT is requested. The firmware
538+
# self-manages the channel, so skipping the scan is safe. We set HT40+/-
539+
# explicitly, so the pri/sec auto-switch this also disables is unwanted
540+
# anyway. Only needed for HT40/VHT (20MHz has no ht_capab, no HT_SCAN).
541+
# Requires the hostapd-vap fork's config-parser wiring (the upstream
542+
# struct field exists but is otherwise unreachable from hostapd.conf).
534543
if [ "$EFFECTIVE_WIDTH" = "80" ]; then
535544
seg0=$(vht_seg0 "$CHANNEL"); dir=$(ht40_dir "$CHANNEL" "$seg0")
536545
extra="$extra
546+
no_pri_sec_switch=1
537547
ht_capab=[HT40$dir]
538548
vht_oper_chwidth=1
539549
vht_oper_centr_freq_seg0_idx=$seg0"
540550
elif [ "$EFFECTIVE_WIDTH" = "40" ]; then
541551
seg0=$(vht_seg0 "$CHANNEL"); dir=$(ht40_dir "$CHANNEL" "$seg0")
542552
extra="$extra
553+
no_pri_sec_switch=1
543554
ht_capab=[HT40$dir]
544555
vht_oper_chwidth=0"
545556
fi

externals/hostapd

scripts/build-in-container.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ strip "$OUT/busybox" 2>/dev/null || true
6868
echo "### Building hostapd"
6969
vendor hostapd
7070
cd "$SRC/hostapd/hostapd"
71+
# Assert the fork wires no_pri_sec_switch into the config parser. start-ap emits
72+
# no_pri_sec_switch=1 for HT40/VHT to skip the OBSS coexistence scan, which
73+
# FullMAC chips (Broadcom brcmfmac on the Galaxy S10) abort with -95. Stock
74+
# hostapd has the struct field but no parser line, so an unpatched submodule
75+
# would silently reject the option and crash on 40/80MHz. (See externals/hostapd.)
76+
grep -q 'no_pri_sec_switch' config_file.c || {
77+
echo "hostapd source is missing the no_pri_sec_switch config patch - check externals/hostapd"; exit 1; }
7178
cat > .config <<'EOF'
7279
CONFIG_DRIVER_NL80211=y
7380
CONFIG_LIBNL32=y

0 commit comments

Comments
 (0)