[OpenWrt-Devel] ath9k-htc init

Alexey Brodkin Alexey.Brodkin at synopsys.com
Thu Nov 26 15:52:09 EST 2015


Hi Jonas,

On Thu, 2015-11-26 at 14:19 +0100, Jonas Gorski wrote:
> On Thu, Nov 26, 2015 at 2:07 PM, Alexey Brodkin
> <Alexey.Brodkin at synopsys.com> wrote:
> > Hi Jonas,
> > 
> > On Mon, 2015-11-23 at 16:48 +0100, Jonas Gorski wrote:
> > > 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.
> > 
> > Ooops I didn't realize that right away, indeed I'm trying to setup WiFi
> > AP and hostAPD (which is really just "host AP Daemon") or alike is a must.
> > 
> > The next question would be which option should I use then?
> >  1) good olde HostAPD
> >  2) its -mini sibling
> >  3) wpad
> >  4) its -mini sibling
> 
> OpenWrt default is wpad-mini for wifi capable devices (which is just a
> unified binary of hostapd and wpasupplicant to prevent code
> duplication and save space). The non-mini versions add support for
> enterprisey stuff like radius athentication, which aren't needed for
> most home setups.

Thanks, now that's completely clear.
A bit of-topic.

With current configuration:
a) network
    ucidef_set_interface_raw "lan" "eth0" "dhcp"
    uci set network.lan.type='bridge'

b) wireless
    as set with "wifi detect"

I was expecting my board with ath9k-htc Wi-Fi USB dongle to become
a "dumb AP". And to some extent it happens. I do see new Wi-Fi network with
SSID OpenWRT but devices I'm trying to connect to this network cannot obtain
configuration via DHCP.

If on say my smartphone I set IP address and gateway manually for OpenWRT
Wi-Fi connection then I may reach my access-point. For example I may open
LuCI in smartphone's web-browser. But I cannot reach anything behind AP.
It looks like bridge (that I do see in ifconfig output) doesn't actually
work.

I tried to build and run TCP dump but it crashes quite soon (interesting
enough because of the same unaligned access exception as ath9k-htc driver
itself when multicast_to_unicast is enabled). In other words I wasn't able
to figure out myself what's wrong in my setup.

I'm wondering if there're known issues or limitations for that king of
configuration (bridged ethX and USB wlanX)?

> > > > 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.
> > 
> > May I get a reference to an example of that workaround?
> 
> see
> 
> package/kernel/mac80211/patches/861-brcmfmac-register-wiphy-s-during-module_init.patch
> package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch
> package/kernel/mac80211/patches/940-mwl8k_init_devices_synchronously.patch

Hm, it doesn't look quite familiar to me so not sure if I'll be able to do
something like this for ath9k-htc unfortunately, sorry.

At least not now.

-Alexey
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list