linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksij Rempel <linux@rempel-privat.de>
To: "Li, Hongchun" <lihongchun@cn.fujitsu.com>,
	"(ath9k-devel@lists.ath9k.org)" <ath9k-devel@lists.ath9k.org>,
	Johannes Berg <johannes.berg@intel.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [ath9k-devel] IBSS network crashes after one device leaves network
Date: Mon, 20 Oct 2014 21:09:19 +0200	[thread overview]
Message-ID: <54455DDF.50305@rempel-privat.de> (raw)
In-Reply-To: <C7367401563A9D46BC5A92B9456C061D48D210@G08CNEXMBPEKD03.g08.fujitsu.local>

[-- Attachment #1: Type: text/plain, Size: 3844 bytes --]

Hi Johannes,

since this function was added by you, may be you can help here (commit
f09603a259). ath9k_htc support max 8 STAs in AP or ADHOC mode.  If more
then 8 stations connected, driver will return error, but
sta_info_insert_drv_state() setting it to zero.
What was initial purpose of this?
net/mac80211/sta_info.c:
        if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
                sdata_info(sdata,
                           "failed to move IBSS STA %pM to state %d (%d)
- keeping it anyway\n",
                           sta->sta.addr, state + 1, err);
                err = 0;
        }


Am 18.10.2014 um 09:46 schrieb Li, Hongchun:
> I’m building an IBSS network using TP-Link TL-WN722N USB WiFi dongle.
> 
> I find that it is drived by ath9k.
> 
>  
> 
> Here is a problem I encountered.
> 
> First, I build an IBSS network with more than 8 devices.
> 
> For example, a network consists of 9 devices, N1, N2, …, N9.
> 
> All devices have same WiFi module.
> 
>  
> 
> When N9 joined network, kernel throws a warning, “Unable to move IBSS
> STA MAC_ADDR to state 3 (-105)”.
> 
> However, the network works correctly. Any node can communicate with each
> other.
> 
>  
> 
> But if I turn off one device, for example N3, the network crashes after
> a few minutes.
> 
> Ping command fails between any two devices in network.
> 
> Get no warning/error message from kernel.
> 
> After N3 is turned off and network crashes, I turned on N3 and network
> works correctly again.
> 
>  
> 
> I find the number 8 is an macro in device driver code:
> drivers/net/wireless/ath/ath9k/htc.h
> 
> 252 <http://lxr.free-electrons.com/source/drivers/net/wireless/ath/ath9k/htc.h?v=3.11#L252> #define ATH9K_HTC_MAX_STA <http://lxr.free-electrons.com/ident?v=3.11;i=ATH9K_HTC_MAX_STA> 8
> 
> It seems like that when there are more than 8 devices in network, driver
> returns an error ENOBUFS(-105).
> 
>  
> 
> But in linux kernel source: net/mac80211/sta_info.c, I found this,
> 
> 436
> <http://lxr.free-electrons.com/source/net/mac80211/sta_info.c?v=3.11#L436> 
> if (sdata <http://lxr.free-electrons.com/ident?v=3.11;i=sdata>->vif.type
> <http://lxr.free-electrons.com/ident?v=3.11;i=type> ==
> NL80211_IFTYPE_ADHOC) {
> 
> 437
> <http://lxr.free-electrons.com/source/net/mac80211/sta_info.c?v=3.11#L437> 
>       sdata_info
> <http://lxr.free-electrons.com/ident?v=3.11;i=sdata_info>(sdata
> <http://lxr.free-electrons.com/ident?v=3.11;i=sdata>,
> 
> 438
> <http://lxr.free-electrons.com/source/net/mac80211/sta_info.c?v=3.11#L438> 
>                "failed to move IBSS STA %pM to state %d (%d) - keeping
> it anyway\n",
> 
> 439
> <http://lxr.free-electrons.com/source/net/mac80211/sta_info.c?v=3.11#L439> 
>                sta->sta.addr
> <http://lxr.free-electrons.com/ident?v=3.11;i=addr>, state
> <http://lxr.free-electrons.com/ident?v=3.11;i=state> + 1, err
> <http://lxr.free-electrons.com/ident?v=3.11;i=err>);
> 
> 440
> <http://lxr.free-electrons.com/source/net/mac80211/sta_info.c?v=3.11#L440> 
>      err <http://lxr.free-electrons.com/ident?v=3.11;i=err> = 0;
> 
> 441
> <http://lxr.free-electrons.com/source/net/mac80211/sta_info.c?v=3.11#L441> 
> }
> 
> So when it is an ad hoc network, kernel just ignore errors from driver.
> 
> This answers why ibss network work correctly when there are more than 8
> devices.
> 
>  
> 
> But I cannot figure out why the network crashes after one device is
> turned off.
> 
> Does anyone have any idea how to solve this problem?
> 
>  
> 
> Li Chun
> 
>  
> 
> 
> 
> _______________________________________________
> ath9k-devel mailing list
> ath9k-devel@lists.ath9k.org
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
> 


-- 
Regards,
Oleksij


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

       reply	other threads:[~2014-10-20 19:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <C7367401563A9D46BC5A92B9456C061D48D210@G08CNEXMBPEKD03.g08.fujitsu.local>
2014-10-20 19:09 ` Oleksij Rempel [this message]
2014-10-20 19:29   ` [ath9k-devel] IBSS network crashes after one device leaves network Johannes Berg
2014-10-21 13:56     ` Oleksij Rempel
2014-12-24  2:45       ` Melroy van den Berg
2014-12-24 16:46         ` Oleksij Rempel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54455DDF.50305@rempel-privat.de \
    --to=linux@rempel-privat.de \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=johannes.berg@intel.com \
    --cc=lihongchun@cn.fujitsu.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).