[OpenWrt-Devel] ath9k-htc init

Jonas Gorski jogo at openwrt.org
Mon Nov 23 10:48:49 EST 2015

On Mon, Nov 23, 2015 at 9:21 AM, Alexey Brodkin
<Alexey.Brodkin at synopsys.com> wrote:
> Hi Felix, Jonas,
> While playing with my AXS101 board and USB WI-Fi dongles I bumped in
> a couple of issues. Fortunately I found at least one dongle that
> works quite nice. That's TP-Link TL-WN721N (or its WN722N sibling)
> which is based on Atheros AR9271 chip even though it did require
> one unexpected tweak.
> For starters I just selected "kmod-ath9k-htc" in menuconfig and
> on boot saw USB device recognized, its firmware was loaded,
> "wifi detect" recognized it as well, see log below.
> But then "wlan0" interface was not created on "wifi" command.
> After some googling I somehow came to resolution that "hostapd"
> package installation fixes this problem. And indeed once I got
> image rebuilt with "CONFIG_PACKAGE_hostapd=y" all worked as expected
> and I was able to use my board as a Wi-Fi access point.
> So the question is if this is expected (requirement for "hostapd")
> [for "ath9k_htc"]?

Yes, hostapd[-mini] (or wpad[-mini]) is required for AP mode, and
wpasupplicant or wpad for encrypted STA mode.

> Another minor issue is that USB dongle gets recognized a bit late
> so that automatic "wifi detect" gets already executed and
> "/etc/config/wireless" isn't created. That requires manual execution of
> "wifi detect > /etc/config/wireless". Essentially extending delay in
> "package/base-files/files/etc/init.d/boot" makes a difference:
> ---------------------->8-------------------
>         # allow wifi modules time to settle
>         sleep 15 # instead of 1
> ---------------------->8-------------------
> but I'm not sure if we want to do that change for all devices.
> Then if there's a better way to make auto population of
> "/etc/config/wireless"?

Likely the firmware is loaded asynchronously, so the _probe function
returns quickly. Our workaround in OpenWrt  for other drivers is to
make the _probe function wait for the firmware to have loaded. and
thus the wifi device registered in the linux kernel. This will ensure
the wifi subsystem knows about it when wifi detect is called. This
seems to be missing for ath9k-htc.

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list