* Re: [PATCH] ath6kl: add support for WPS
From: Kalle Valo @ 2011-10-27 7:53 UTC (permalink / raw)
To: Aarthi Thiruvengadam; +Cc: linux-wireless
In-Reply-To: <1319567152-19789-1-git-send-email-aarthi.thiruvengadam@qca.qualcomm.com>
On 10/25/2011 09:25 PM, Aarthi Thiruvengadam wrote:
> Add control flag CONNECT_WPS_FLAG if a WPS IE is present in the
> Association Request IEs. This flag is needed when the station must
> connect to a WPS-enabled AP.
Thanks, applied. There was a conflict due to multivif patches which I
fixed manually, please check that I didn't break anything.
Kalle
^ permalink raw reply
* Re: [PATCH v3] ath6kl: Implement support for listen interval from userspace
From: Kalle Valo @ 2011-10-27 8:11 UTC (permalink / raw)
To: Rishi Panjwani; +Cc: linux-wireless
In-Reply-To: <1319588789-17632-2-git-send-email-rpanjwan@qca.qualcomm.com>
On 10/26/2011 03:26 AM, Rishi Panjwani wrote:
> In order to allow user space based control of listen interval, we use
> available debugfs infrastructure. Listen interval implies how frequently
> we want the WLAN chip to wake up and synchronize the beacons in case it
> is in sleep mode. The command requires two parameters in the following order:
>
> 1) listen_interval_time
> 2) listen_interval_beacons
>
> The user has to write the listen interval_time (in msecs) and
> listen_interval_beacons (in no. of beacons) to the listen_interval file in
> ath6kl debug directory.
>
> Example:
>
> echo "30 1" > listen_interval
Applied, thanks. I had to add vif index to the wmi call due to multi vif
changes. Please check my changes.
Kalle
^ permalink raw reply
* Re: [PATCH v2] ath6kl: Implement support for power parameter control from userspace
From: Kalle Valo @ 2011-10-27 8:22 UTC (permalink / raw)
To: Rishi Panjwani; +Cc: linux-wireless
In-Reply-To: <1319597561-20454-2-git-send-email-rpanjwan@qca.qualcomm.com>
On 10/26/2011 05:52 AM, Rishi Panjwani wrote:
> In order to allow user space based control of power parameters, we use
> available debugfs infrastructure. With these features user can control
> power consumption by adjusting various sleep/wake up related parameters.
> The feature has been added for testing purposes. All 5 parameters are
> mandatory in correct order. They have to be written to the power_params
> file. These are:
>
> 1) idle_period
> 2) no_of_pspoll
> 3) dtim_policy
> 4) tx_wakeup_policy
> 5) no_tx_to_wakeup
>
> Example:
>
> echo "200 1 0 1 1" > power_params
Applied, thanks. Again I added a vif index to the wmi call, please check
that.
Kalle
^ permalink raw reply
* Re: [PATCH] ath6kl: Fix compile error for ARM
From: Kalle Valo @ 2011-10-27 8:33 UTC (permalink / raw)
To: Sangwook Lee; +Cc: linux-wireless, patches
In-Reply-To: <1319642918-27076-1-git-send-email-sangwook.lee@linaro.org>
On 10/26/2011 06:28 PM, Sangwook Lee wrote:
> Fix the compile error for ARM Platform.
>
> Signed-off-by: Sangwook Lee <sangwook.lee@linaro.org>
> ---
>
> Compile errors come from ARM plaform:
> In file included from drivers/net/wireless/ath/ath6kl/init.c:19:0:
> include/linux/of.h: In function ‘of_property_read_u32_array’:
> include/linux/of.h:249:10: error: ‘ENOSYS’ undeclared
In my opinion this is a bug in of.h and I sent a patch few weeks ago:
https://lkml.org/lkml/2011/10/6/133
But it seems that openfirmware maintainers don't care as I haven't
received any reply to the patch. So let's just workaround this in ath6kl.
Patch applied, but I changed the commit log a bit. Thank you again.
commit e0627e2c7e0647d174d9fcac06fa194d38740f7d
Author: Sangwook Lee <sangwook.lee@linaro.org>
Date: Wed Oct 26 16:28:38 2011 +0100
ath6kl: Fix compilation error from of.h
When compiling ath6kl for ARM with device tree tree compilation fails
with errors like:
include/linux/of.h: In function 'of_property_read_u32_array':
include/linux/of.h:249:10: error: 'ENOSYS' undeclared
Workaround this by including errno.h from init.c.
kvalo: improved commit log
Signed-off-by: Sangwook Lee <sangwook.lee@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Kalle
^ permalink raw reply
* does the creation of a mesh interface trigger a udev event?
From: David Goodenough @ 2011-10-27 9:46 UTC (permalink / raw)
To: linux-wireless
When I create a mesh interface:-
iw dev wlan0 interface add mesh0 type mp ...
does a device creation event appear through udev? Similarly while
the creation of wlan0 for a wireless card does create such an event,
do the monitor interfaces and phy's also create such events?
As far as I can see they do not, but I may be wrong - I may just be
listening for them wrongly. If they do, any clues as to how to spot
them?
I ask for two reasons:-
1) It would seem consistent if they did.
2) For a configuration system like the one Debian uses, it is those
events that cause configuration to happen and so it would be easier
to configure things like a mesh network if the events occur.
David
^ permalink raw reply
* carl9170: fast channel change
From: Louis @ 2011-10-27 10:47 UTC (permalink / raw)
To: linux-wireless
Hello,
I want to analyze the spectrum with an carl9710 device. (Fritz!WLAN USB Stick N)
Therefor I require to monitor all channels.
Does someone know if the carl9170-device is principally capable of performing a fast channel change ?
Best regards,
Louis
--
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
Jetzt informieren: http://www.gmx.net/de/go/freephone
^ permalink raw reply
* Re: How to enable clock/power from a wlan device driver
From: Dmitry Tarnyagin @ 2011-10-27 11:37 UTC (permalink / raw)
To: Bob Copeland; +Cc: linux-wireless
In-Reply-To: <CAEKwDSDBf6kXYp6hdqgHoUORAEkQOJrJmrsqXg6BVQTQvEYwxg@mail.gmail.com>
On Thu, Oct 27, 2011 at 3:39 AM, Bob Copeland <me@bobcopeland.com> wrote:
> Beats me what is best for your needs, but in light of the above it
> seems #3 fits the bill?
Thank you a lot! I will do it like that.
--
With best regards,
Dmitry Tarnyagin
^ permalink raw reply
* [PATCH] cfg80211: annotate cfg80211_inform_bss
From: Johannes Berg @ 2011-10-27 12:45 UTC (permalink / raw)
To: John Linville
Cc: linux-wireless, Samuel Ortiz, Bing Zhao, Jussi Kivilinna,
Dan Williams, Arend Van Spriel
From: Johannes Berg <johannes.berg@intel.com>
This function returns a referenced BSS struct
(or NULL), annotate with __must_check. It seems
that a lot of drivers get this completely wrong
and leak all BSS structs as a result.
Reported-by: Adam Mikuta <Adam.Mikuta@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
CC lots of driver maintainers who need to fix this bug.
include/net/cfg80211.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/include/net/cfg80211.h 2011-10-27 14:05:17.000000000 +0200
+++ b/include/net/cfg80211.h 2011-10-27 14:42:51.000000000 +0200
@@ -2651,8 +2651,10 @@ void cfg80211_sched_scan_stopped(struct
*
* This informs cfg80211 that BSS information was found and
* the BSS should be updated/added.
+ *
+ * NOTE: Returns a referenced struct, must be released with cfg80211_put_bss()!
*/
-struct cfg80211_bss*
+struct cfg80211_bss * __must_check
cfg80211_inform_bss_frame(struct wiphy *wiphy,
struct ieee80211_channel *channel,
struct ieee80211_mgmt *mgmt, size_t len,
@@ -2674,8 +2676,10 @@ cfg80211_inform_bss_frame(struct wiphy *
*
* This informs cfg80211 that BSS information was found and
* the BSS should be updated/added.
+ *
+ * NOTE: Returns a referenced struct, must be released with cfg80211_put_bss()!
*/
-struct cfg80211_bss*
+struct cfg80211_bss * __must_check
cfg80211_inform_bss(struct wiphy *wiphy,
struct ieee80211_channel *channel,
const u8 *bssid,
^ permalink raw reply
* 3.1-rc9 and 3.1 wifi problem , problem continues with 3.1
From: werner @ 2011-10-27 12:53 UTC (permalink / raw)
To: linux-kernel, linux-wireless, dave.taht, rientjes, arend,
toralf.foerster, wey-yi.w.guy, ilw, larry.finger
With the patch sent by Guy, Wey-Yi W , now wifi works at
that laptop.
Werner Landgraf
---
Professional hosting for everyone - http://www.host.ru
^ permalink raw reply
* [PATCH] ath6kl: Report unique remain-on-channel cookie values
From: Jouni Malinen @ 2011-10-27 13:00 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless
Even though only a single concurrent remain-on-channel operation is
supported, there may be two pending remain-on-channel events (one to
indicate end of a canceled operation and another to indicate start of a
new operation). User space won't be able to distinguish these events
unless unique cookies are used.
The previous behavior resulted in wpa_supplicant getting quite
confused about the driver's offchannel state in various sequences
and this made the P2P state machine behave incorrectly. Use of
more than a single remain-on-channel cookie value fixes this.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 11 +++++++++--
drivers/net/wireless/ath/ath6kl/core.h | 2 ++
drivers/net/wireless/ath/ath6kl/wmi.c | 13 +++++++++++--
3 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 0b044aa..adb3c3f 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1932,10 +1932,16 @@ static int ath6kl_remain_on_channel(struct wiphy *wiphy,
{
struct ath6kl *ar = ath6kl_priv(dev);
struct ath6kl_vif *vif = netdev_priv(dev);
+ u32 id;
/* TODO: if already pending or ongoing remain-on-channel,
* return -EBUSY */
- *cookie = 1; /* only a single pending request is supported */
+ id = ++vif->last_roc_id;
+ if (id == 0) {
+ /* Do not use 0 as the cookie value */
+ id = ++vif->last_roc_id;
+ }
+ *cookie = id;
return ath6kl_wmi_remain_on_chnl_cmd(ar->wmi, vif->fw_vif_idx,
chan->center_freq, duration);
@@ -1948,8 +1954,9 @@ static int ath6kl_cancel_remain_on_channel(struct wiphy *wiphy,
struct ath6kl *ar = ath6kl_priv(dev);
struct ath6kl_vif *vif = netdev_priv(dev);
- if (cookie != 1)
+ if (cookie != vif->last_roc_id)
return -ENOENT;
+ vif->last_cancel_roc_id = cookie;
return ath6kl_wmi_cancel_remain_on_chnl_cmd(ar->wmi, vif->fw_vif_idx);
}
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 97d7f11..5ac415e 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -427,6 +427,8 @@ struct ath6kl_vif {
struct cfg80211_scan_request *scan_req;
enum sme_state sme_state;
int reconnect_flag;
+ u32 last_roc_id;
+ u32 last_cancel_roc_id;
u32 send_action_id;
bool probe_req_report;
u16 next_chan;
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index e6b0960..ddefc8e 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -443,6 +443,7 @@ static int ath6kl_wmi_remain_on_chnl_event_rx(struct wmi *wmi, u8 *datap,
u32 dur;
struct ieee80211_channel *chan;
struct ath6kl *ar = wmi->parent_dev;
+ u32 id;
if (len < sizeof(*ev))
return -EINVAL;
@@ -458,7 +459,8 @@ static int ath6kl_wmi_remain_on_chnl_event_rx(struct wmi *wmi, u8 *datap,
"(freq=%u)\n", freq);
return -EINVAL;
}
- cfg80211_ready_on_channel(vif->ndev, 1, chan, NL80211_CHAN_NO_HT,
+ id = vif->last_roc_id;
+ cfg80211_ready_on_channel(vif->ndev, id, chan, NL80211_CHAN_NO_HT,
dur, GFP_ATOMIC);
return 0;
@@ -473,6 +475,7 @@ static int ath6kl_wmi_cancel_remain_on_chnl_event_rx(struct wmi *wmi,
u32 dur;
struct ieee80211_channel *chan;
struct ath6kl *ar = wmi->parent_dev;
+ u32 id;
if (len < sizeof(*ev))
return -EINVAL;
@@ -488,7 +491,13 @@ static int ath6kl_wmi_cancel_remain_on_chnl_event_rx(struct wmi *wmi,
"channel (freq=%u)\n", freq);
return -EINVAL;
}
- cfg80211_remain_on_channel_expired(vif->ndev, 1, chan,
+ if (vif->last_cancel_roc_id &&
+ vif->last_cancel_roc_id + 1 == vif->last_roc_id)
+ id = vif->last_cancel_roc_id; /* event for cancel command */
+ else
+ id = vif->last_roc_id; /* timeout on uncanceled r-o-c */
+ vif->last_cancel_roc_id = 0;
+ cfg80211_remain_on_channel_expired(vif->ndev, id, chan,
NL80211_CHAN_NO_HT, GFP_ATOMIC);
return 0;
--
1.7.4.1
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply related
* Re: 3.1-rc9 and 3.1 wifi problem , problem continues with 3.1
From: wwguy @ 2011-10-27 12:57 UTC (permalink / raw)
To: werner
Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
dave.taht@gmail.com, rientjes@google.com, arend@broadcom.com,
toralf.foerster@gmx.de, ilw@linux.intel.com,
larry.finger@gmail.com
In-Reply-To: <web-634287632@zbackend1.aha.ru>
On Thu, 2011-10-27 at 05:53 -0700, werner wrote:
> With the patch sent by Guy, Wey-Yi W , now wifi works at
> that laptop.
>
thanks for reporting and testing
Wey
^ permalink raw reply
* Re: RTL8188RU no injection?
From: Roman Proud @ 2011-10-27 13:17 UTC (permalink / raw)
To: Larry Finger; +Cc: linux-wireless
In-Reply-To: <4EA89B8D.7060104@lwfinger.net>
Hi peops
thx for all youre responses!
Well i didnt really thought about g and n -.-
Im using the latest 8192cu driver from Realtek now, it works just
fine. Also monitor mode works like a charm (yes if i use airmon-ng for
it). My Kernel is (now the default) Arch kernel, on Linux Version
3.0.4
My last problem is the Package injection. Im surprised you are
thinking it could work (ive found many resources that say something
different, but hey its an OpenSource driver ;)
Pls excuse my "stupidness" but im really not sure if i am using
"mac80211", i think so, its leaded in the System.
And yes its Aircrack im trying to work with, and its Aircrack which
tells me i cant use Packet Injection.
I will try Packetspammer as soon as i am at home. If this works i have
to contact Aircrack, am i right?
Greetings
Roman
2011/10/27 Larry Finger <Larry.Finger@lwfinger.net>:
> On 10/26/2011 05:29 PM, Roman Proud wrote:
>>
>> Hi there,
>>
>> i hope you guys can help me.
>> I wanted a new Wifi card, because mine has no injection, what i need
>> sometimes.
>>
>> So i forced the Internet to find that a 8187 would be best for. So i
>> bought the 8188 (newer = better?)... i never had thought about so much
>> difference in just one number... it was horrible to even get the card
>> work, first no monitor mode works, but now it does (i dunno why
>> O_o)... The only thing i miss is Package injection.
>>
>> So my Question. Is it there? is it in the driver and i just have to do
>> some magic again like i did with the monitor mode?
>> If not, is there any Patch? (i didn't find anything...)
>> Or should i simply send the damn thing back and get me an 8187? (its
>> not that simple, and i like hacking into my linux, so one of the first
>> both, would be nicer)
>
> I found that packetspammer works just fine with rtl8192cu.
>
> Larry
>
>
^ permalink raw reply
* Re: [PATCH] mac80211: init rate-control for TDLS sta when supp-rates are known
From: Jouni Malinen @ 2011-10-27 14:22 UTC (permalink / raw)
To: Arik Nemtsov; +Cc: linux-wireless, Johannes Berg
In-Reply-To: <1319636866-12171-1-git-send-email-arik@wizery.com>
On Wed, Oct 26, 2011 at 03:47:46PM +0200, Arik Nemtsov wrote:
> Initialize rate control algorithms only when supported rates are known
> for a TDLS peer sta. Direct Tx between peers is not allowed before the
> link is enabled. In turn, this only occurs after a change_station()
> call that sets supported rates.
Thanks - this seems to fix the issues I saw previously. I tested ath9k
with this instead of my earlier patch and was able to run successfully
through my TDLS test scripts against another implementation.
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply
* [PATCH] ath9k: Advertise support for TDLS
From: Jouni Malinen @ 2011-10-27 14:31 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless
Based on a quick test, TDLS seemed to be working fine with ath9k, so
let's start advertising support for this in the driver.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/init.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
Since some rate control algorithms don't really like the idea of a STA
entry with no supported rates, it would be a good idea to make sure that
this gets applied only after a fix for that from Arik goes in:
mac80211: init rate-control for TDLS sta when supp-rates are known
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index af1b325..c91d464 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -694,6 +694,7 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
+ hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS;
hw->queues = 4;
hw->max_rates = 4;
--
1.7.4.1
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply related
* Re: RTL8188RU no injection?
From: Larry Finger @ 2011-10-27 15:05 UTC (permalink / raw)
To: Roman Proud; +Cc: linux-wireless
In-Reply-To: <CAF7qGM7hfaz0SGiZVZ62r_nPO8viMT5F2_Kd1uRxN9Ha3mRO+Q@mail.gmail.com>
On 10/27/2011 08:17 AM, Roman Proud wrote:
> Hi peops
>
> thx for all youre responses!
>
> Well i didnt really thought about g and n -.-
>
> Im using the latest 8192cu driver from Realtek now, it works just
> fine. Also monitor mode works like a charm (yes if i use airmon-ng for
> it). My Kernel is (now the default) Arch kernel, on Linux Version
> 3.0.4
>
> My last problem is the Package injection. Im surprised you are
> thinking it could work (ive found many resources that say something
> different, but hey its an OpenSource driver ;)
Well, I tested with Packetspammer and it worked. As in many cases, the resources
that say otherwise are wrong.
> Pls excuse my "stupidness" but im really not sure if i am using
> "mac80211", i think so, its leaded in the System.
The drivers for most devices without a hardware MAC use mac80211 and friends. In
fact, it is a prerequisite for getting a driver included in the mainline
drivers/net/wireless/ tree. If the driver implements its own MAC layer, then it
resides in drivers/staging/. Yes, it is loaded on your system, and it handles a
lot of things for the drivers that use it.
> And yes its Aircrack im trying to work with, and its Aircrack which
> tells me i cant use Packet Injection.
> I will try Packetspammer as soon as i am at home. If this works i have
> to contact Aircrack, am i right?
If Aircrack adds the socket method used by Packetspammer, it will work with
nearly every driver in the kernel that supports monitor mode. Whether they want
to do that will be their decision, of course.
Larry
^ permalink raw reply
* [PATCH 01/10] ath6kl: don't use cfg80211_scan_request after cfg80211_scan_done()
From: Kalle Valo @ 2011-10-27 15:47 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
Use of cfg80211_scan_request is not valid after calling cfg80211_scan_done()
but ath6kl_cfg80211_scan_complete_event() was doing exactly that. Change
the function to call cfg80211_scan_done() last.
This was found during code review, I didn't see any visible problems
due to this bug.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 0b044aa..f5f4a1d 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -874,6 +874,7 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, int status)
{
struct ath6kl *ar = vif->ar;
+ bool aborted;
int i;
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: status %d\n", __func__, status);
@@ -882,11 +883,11 @@ void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, int status)
return;
if ((status == -ECANCELED) || (status == -EBUSY)) {
- cfg80211_scan_done(vif->scan_req, true);
+ aborted = true;
goto out;
}
- cfg80211_scan_done(vif->scan_req, false);
+ aborted = false;
if (vif->scan_req->n_ssids && vif->scan_req->ssids[0].ssid_len) {
for (i = 0; i < vif->scan_req->n_ssids; i++) {
@@ -897,6 +898,7 @@ void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, int status)
}
out:
+ cfg80211_scan_done(vif->scan_req, aborted);
vif->scan_req = NULL;
}
^ permalink raw reply related
* [PATCH 02/10] ath6kl: rename ath6kl_wmi_qos_state_init() to _wmi_reset()
From: Kalle Valo @ 2011-10-27 15:48 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111027154746.23519.39680.stgit@localhost6.localdomain6>
Just to make it more clear that this function is supposed to
reset wmi related variables.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/wmi.c | 7 ++-----
drivers/net/wireless/ath/ath6kl/wmi.h | 1 +
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index e6b0960..3921c2c 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -3201,11 +3201,8 @@ int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb)
return ret;
}
-static void ath6kl_wmi_qos_state_init(struct wmi *wmi)
+void ath6kl_wmi_reset(struct wmi *wmi)
{
- if (!wmi)
- return;
-
spin_lock_bh(&wmi->lock);
wmi->fat_pipe_exist = 0;
@@ -3228,7 +3225,7 @@ void *ath6kl_wmi_init(struct ath6kl *dev)
wmi->pwr_mode = REC_POWER;
- ath6kl_wmi_qos_state_init(wmi);
+ ath6kl_wmi_reset(wmi);
return wmi;
}
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h
index 9055c75..ae514cb 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.h
+++ b/drivers/net/wireless/ath/ath6kl/wmi.h
@@ -2316,5 +2316,6 @@ int ath6kl_wmi_set_appie_cmd(struct wmi *wmi, u8 if_idx, u8 mgmt_frm_type,
struct ath6kl_vif *ath6kl_get_vif_by_index(struct ath6kl *ar, u8 if_idx);
void *ath6kl_wmi_init(struct ath6kl *devt);
void ath6kl_wmi_shutdown(struct wmi *wmi);
+void ath6kl_wmi_reset(struct wmi *wmi);
#endif /* WMI_H */
^ permalink raw reply related
* [PATCH 03/10] ath6kl: move power control from sdio to core
From: Kalle Valo @ 2011-10-27 15:48 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111027154746.23519.39680.stgit@localhost6.localdomain6>
In preparation for cutting down power from the chip on the fly.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/hif-ops.h | 15 +++++++++++++++
drivers/net/wireless/ath/ath6kl/hif.h | 2 ++
drivers/net/wireless/ath/ath6kl/init.c | 16 ++++++++++++----
drivers/net/wireless/ath/ath6kl/sdio.c | 20 ++++++++------------
4 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/hif-ops.h b/drivers/net/wireless/ath/ath6kl/hif-ops.h
index 95e7303..34adc77 100644
--- a/drivers/net/wireless/ath/ath6kl/hif-ops.h
+++ b/drivers/net/wireless/ath/ath6kl/hif-ops.h
@@ -96,4 +96,19 @@ static inline int ath6kl_hif_resume(struct ath6kl *ar)
return ar->hif_ops->resume(ar);
}
+
+static inline int ath6kl_hif_power_on(struct ath6kl *ar)
+{
+ ath6kl_dbg(ATH6KL_DBG_HIF, "hif power on\n");
+
+ return ar->hif_ops->power_on(ar);
+}
+
+static inline int ath6kl_hif_power_off(struct ath6kl *ar)
+{
+ ath6kl_dbg(ATH6KL_DBG_HIF, "hif power off\n");
+
+ return ar->hif_ops->power_off(ar);
+}
+
#endif
diff --git a/drivers/net/wireless/ath/ath6kl/hif.h b/drivers/net/wireless/ath/ath6kl/hif.h
index 93d2912..ee7c31a 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.h
+++ b/drivers/net/wireless/ath/ath6kl/hif.h
@@ -242,6 +242,8 @@ struct ath6kl_hif_ops {
void (*cleanup_scatter)(struct ath6kl *ar);
int (*suspend)(struct ath6kl *ar);
int (*resume)(struct ath6kl *ar);
+ int (*power_on)(struct ath6kl *ar);
+ int (*power_off)(struct ath6kl *ar);
};
int ath6kl_hif_setup(struct ath6kl_device *dev);
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 64975a9..0564add 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -554,6 +554,8 @@ void ath6kl_core_free(struct ath6kl *ar)
void ath6kl_core_cleanup(struct ath6kl *ar)
{
+ ath6kl_hif_power_off(ar);
+
destroy_workqueue(ar->ath6kl_wq);
if (ar->htc_target)
@@ -1601,27 +1603,31 @@ int ath6kl_core_init(struct ath6kl *ar)
if (ret)
goto err_wq;
- ret = ath6kl_bmi_get_target_info(ar, &targ_info);
+ ret = ath6kl_hif_power_on(ar);
if (ret)
goto err_bmi_cleanup;
+ ret = ath6kl_bmi_get_target_info(ar, &targ_info);
+ if (ret)
+ goto err_power_off;
+
ar->version.target_ver = le32_to_cpu(targ_info.version);
ar->target_type = le32_to_cpu(targ_info.type);
ar->wiphy->hw_version = le32_to_cpu(targ_info.version);
ret = ath6kl_init_hw_params(ar);
if (ret)
- goto err_bmi_cleanup;
+ goto err_power_off;
ret = ath6kl_configure_target(ar);
if (ret)
- goto err_bmi_cleanup;
+ goto err_power_off;
ar->htc_target = ath6kl_htc_create(ar);
if (!ar->htc_target) {
ret = -ENOMEM;
- goto err_bmi_cleanup;
+ goto err_power_off;
}
ret = ath6kl_fetch_firmwares(ar);
@@ -1640,6 +1646,8 @@ int ath6kl_core_init(struct ath6kl *ar)
err_htc_cleanup:
ath6kl_htc_cleanup(ar->htc_target);
+err_power_off:
+ ath6kl_hif_power_off(ar);
err_bmi_cleanup:
ath6kl_bmi_cleanup(ar);
err_wq:
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index 5ce0b8b..682c47c 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -463,8 +463,9 @@ static void ath6kl_sdio_irq_handler(struct sdio_func *func)
WARN_ON(status && status != -ECANCELED);
}
-static int ath6kl_sdio_power_on(struct ath6kl_sdio *ar_sdio)
+static int ath6kl_sdio_power_on(struct ath6kl *ar)
{
+ struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar);
struct sdio_func *func = ar_sdio->func;
int ret = 0;
@@ -495,8 +496,9 @@ static int ath6kl_sdio_power_on(struct ath6kl_sdio *ar_sdio)
return ret;
}
-static int ath6kl_sdio_power_off(struct ath6kl_sdio *ar_sdio)
+static int ath6kl_sdio_power_off(struct ath6kl *ar)
{
+ struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar);
int ret;
if (ar_sdio->is_disabled)
@@ -772,6 +774,8 @@ static const struct ath6kl_hif_ops ath6kl_sdio_ops = {
.cleanup_scatter = ath6kl_sdio_cleanup_scatter,
.suspend = ath6kl_sdio_suspend,
.resume = ath6kl_sdio_resume,
+ .power_on = ath6kl_sdio_power_on,
+ .power_off = ath6kl_sdio_power_off,
};
static int ath6kl_sdio_probe(struct sdio_func *func,
@@ -852,10 +856,6 @@ static int ath6kl_sdio_probe(struct sdio_func *func,
sdio_release_host(func);
- ret = ath6kl_sdio_power_on(ar_sdio);
- if (ret)
- goto err_core_alloc;
-
sdio_claim_host(func);
ret = sdio_set_block_size(func, HIF_MBOX_BLOCK_SIZE);
@@ -863,7 +863,7 @@ static int ath6kl_sdio_probe(struct sdio_func *func,
ath6kl_err("Set sdio block size %d failed: %d)\n",
HIF_MBOX_BLOCK_SIZE, ret);
sdio_release_host(func);
- goto err_off;
+ goto err_hif;
}
sdio_release_host(func);
@@ -871,13 +871,11 @@ static int ath6kl_sdio_probe(struct sdio_func *func,
ret = ath6kl_core_init(ar);
if (ret) {
ath6kl_err("Failed to init ath6kl core\n");
- goto err_off;
+ goto err_hif;
}
return ret;
-err_off:
- ath6kl_sdio_power_off(ar_sdio);
err_core_alloc:
ath6kl_core_free(ar_sdio->ar);
err_dma:
@@ -903,8 +901,6 @@ static void ath6kl_sdio_remove(struct sdio_func *func)
ath6kl_core_cleanup(ar_sdio->ar);
- ath6kl_sdio_power_off(ar_sdio);
-
kfree(ar_sdio->dma_buffer);
kfree(ar_sdio);
}
^ permalink raw reply related
* [PATCH 04/10] ath6kl: add a fixme to ath6kl_htc_wait_target()
From: Kalle Valo @ 2011-10-27 15:48 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111027154746.23519.39680.stgit@localhost6.localdomain6>
This doesn't look right, but investigate it later.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/htc.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index 976e352..d03456b 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -2598,6 +2598,10 @@ int ath6kl_htc_wait_target(struct htc_target *target)
status = ath6kl_htc_conn_service((void *)target, &connect, &resp);
if (status)
+ /*
+ * FIXME: this call doesn't make sense, the caller should
+ * call ath6kl_htc_cleanup() when it wants remove htc
+ */
ath6kl_hif_cleanup_scatter(target->dev->ar);
fail_wait_target:
^ permalink raw reply related
* [PATCH 05/10] ath6kl: merge ath6kl_init() to ath6kl_core_init()
From: Kalle Valo @ 2011-10-27 15:48 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111027154746.23519.39680.stgit@localhost6.localdomain6>
In preparation for splitting module initialisation and hardware boot
code from each other.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/init.c | 148 ++++++++++++++------------------
1 files changed, 65 insertions(+), 83 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 0564add..f5d0b99 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1421,20 +1421,62 @@ static int ath6kl_init_hw_params(struct ath6kl *ar)
return 0;
}
-static int ath6kl_init(struct ath6kl *ar)
+int ath6kl_core_init(struct ath6kl *ar)
{
- int status = 0;
+ struct ath6kl_bmi_target_info targ_info;
s32 timeleft;
struct net_device *ndev;
- int i;
+ int i, ret = 0;
- if (!ar)
- return -EIO;
+ ar->ath6kl_wq = create_singlethread_workqueue("ath6kl");
+ if (!ar->ath6kl_wq)
+ return -ENOMEM;
+
+ ret = ath6kl_bmi_init(ar);
+ if (ret)
+ goto err_wq;
+
+ ret = ath6kl_hif_power_on(ar);
+ if (ret)
+ goto err_bmi_cleanup;
+
+ ret = ath6kl_bmi_get_target_info(ar, &targ_info);
+ if (ret)
+ goto err_power_off;
+
+ ar->version.target_ver = le32_to_cpu(targ_info.version);
+ ar->target_type = le32_to_cpu(targ_info.type);
+ ar->wiphy->hw_version = le32_to_cpu(targ_info.version);
+
+ ret = ath6kl_init_hw_params(ar);
+ if (ret)
+ goto err_power_off;
+
+ ret = ath6kl_configure_target(ar);
+ if (ret)
+ goto err_power_off;
+
+ ar->htc_target = ath6kl_htc_create(ar);
+
+ if (!ar->htc_target) {
+ ret = -ENOMEM;
+ goto err_power_off;
+ }
+
+ ret = ath6kl_fetch_firmwares(ar);
+ if (ret)
+ goto err_htc_cleanup;
+
+ /* FIXME: we should free all firmwares in the error cases below */
+
+ ret = ath6kl_init_upload(ar);
+ if (ret)
+ goto err_htc_cleanup;
/* Do we need to finish the BMI phase */
if (ath6kl_bmi_done(ar)) {
- status = -EIO;
- goto ath6kl_init_done;
+ ret = -EIO;
+ goto err_htc_cleanup;
}
/* Indicate that WMI is enabled (although not ready yet) */
@@ -1442,18 +1484,18 @@ static int ath6kl_init(struct ath6kl *ar)
ar->wmi = ath6kl_wmi_init(ar);
if (!ar->wmi) {
ath6kl_err("failed to initialize wmi\n");
- status = -EIO;
- goto ath6kl_init_done;
+ ret = -EIO;
+ goto err_htc_cleanup;
}
ath6kl_dbg(ATH6KL_DBG_TRC, "%s: got wmi @ 0x%p.\n", __func__, ar->wmi);
- status = ath6kl_register_ieee80211_hw(ar);
- if (status)
+ ret = ath6kl_register_ieee80211_hw(ar);
+ if (ret)
goto err_node_cleanup;
- status = ath6kl_debug_init(ar);
- if (status) {
+ ret = ath6kl_debug_init(ar);
+ if (ret) {
wiphy_unregister(ar->wiphy);
goto err_node_cleanup;
}
@@ -1471,7 +1513,7 @@ static int ath6kl_init(struct ath6kl *ar)
if (!ndev) {
ath6kl_err("Failed to instantiate a network device\n");
- status = -ENOMEM;
+ ret = -ENOMEM;
wiphy_unregister(ar->wiphy);
goto err_debug_init;
}
@@ -1486,12 +1528,12 @@ static int ath6kl_init(struct ath6kl *ar)
* size.
*/
if (ath6kl_htc_wait_target(ar->htc_target)) {
- status = -EIO;
+ ret = -EIO;
goto err_if_deinit;
}
if (ath6kl_init_service_ep(ar)) {
- status = -EIO;
+ ret = -EIO;
goto err_cleanup_scatter;
}
@@ -1514,9 +1556,8 @@ static int ath6kl_init(struct ath6kl *ar)
ath6kl_cookie_init(ar);
/* start HTC */
- status = ath6kl_htc_start(ar->htc_target);
-
- if (status) {
+ ret = ath6kl_htc_start(ar->htc_target);
+ if (ret) {
ath6kl_cookie_cleanup(ar);
goto err_rxbuf_cleanup;
}
@@ -1532,13 +1573,13 @@ static int ath6kl_init(struct ath6kl *ar)
if (ar->version.abi_ver != ATH6KL_ABI_VERSION) {
ath6kl_err("abi version mismatch: host(0x%x), target(0x%x)\n",
ATH6KL_ABI_VERSION, ar->version.abi_ver);
- status = -EIO;
+ ret = -EIO;
goto err_htc_stop;
}
if (!timeleft || signal_pending(current)) {
ath6kl_err("wmi is not ready or wait was interrupted\n");
- status = -EIO;
+ ret = -EIO;
goto err_htc_stop;
}
@@ -1554,8 +1595,8 @@ static int ath6kl_init(struct ath6kl *ar)
ar->wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM;
for (i = 0; i < MAX_NUM_VIF; i++) {
- status = ath6kl_target_config_wlan_params(ar, i);
- if (status)
+ ret = ath6kl_target_config_wlan_params(ar, i);
+ if (ret)
goto err_htc_stop;
}
@@ -1565,7 +1606,7 @@ static int ath6kl_init(struct ath6kl *ar)
*/
memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN);
- return status;
+ return ret;
err_htc_stop:
ath6kl_htc_stop(ar->htc_target);
@@ -1585,65 +1626,6 @@ err_node_cleanup:
ath6kl_wmi_shutdown(ar->wmi);
clear_bit(WMI_ENABLED, &ar->flag);
ar->wmi = NULL;
-
-ath6kl_init_done:
- return status;
-}
-
-int ath6kl_core_init(struct ath6kl *ar)
-{
- int ret = 0;
- struct ath6kl_bmi_target_info targ_info;
-
- ar->ath6kl_wq = create_singlethread_workqueue("ath6kl");
- if (!ar->ath6kl_wq)
- return -ENOMEM;
-
- ret = ath6kl_bmi_init(ar);
- if (ret)
- goto err_wq;
-
- ret = ath6kl_hif_power_on(ar);
- if (ret)
- goto err_bmi_cleanup;
-
- ret = ath6kl_bmi_get_target_info(ar, &targ_info);
- if (ret)
- goto err_power_off;
-
- ar->version.target_ver = le32_to_cpu(targ_info.version);
- ar->target_type = le32_to_cpu(targ_info.type);
- ar->wiphy->hw_version = le32_to_cpu(targ_info.version);
-
- ret = ath6kl_init_hw_params(ar);
- if (ret)
- goto err_power_off;
-
- ret = ath6kl_configure_target(ar);
- if (ret)
- goto err_power_off;
-
- ar->htc_target = ath6kl_htc_create(ar);
-
- if (!ar->htc_target) {
- ret = -ENOMEM;
- goto err_power_off;
- }
-
- ret = ath6kl_fetch_firmwares(ar);
- if (ret)
- goto err_htc_cleanup;
-
- ret = ath6kl_init_upload(ar);
- if (ret)
- goto err_htc_cleanup;
-
- ret = ath6kl_init(ar);
- if (ret)
- goto err_htc_cleanup;
-
- return ret;
-
err_htc_cleanup:
ath6kl_htc_cleanup(ar->htc_target);
err_power_off:
^ permalink raw reply related
* [PATCH 06/10] ath6kl: separate hardware boot code from module initialisation code
From: Kalle Valo @ 2011-10-27 15:48 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111027154746.23519.39680.stgit@localhost6.localdomain6>
Refactor the code needed to boot the hardware to a separate function so
that it will be easier boot and shutdown hardware.
No functional changes (hopefully).
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/init.c | 183 +++++++++++++++++++-------------
1 files changed, 106 insertions(+), 77 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index f5d0b99..a0b81c3 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1421,12 +1421,107 @@ static int ath6kl_init_hw_params(struct ath6kl *ar)
return 0;
}
+static int ath6kl_hw_start(struct ath6kl *ar)
+{
+ long timeleft;
+ int ret, i;
+
+ ret = ath6kl_hif_power_on(ar);
+ if (ret)
+ return ret;
+
+ ret = ath6kl_configure_target(ar);
+ if (ret)
+ goto err_power_off;
+
+ ret = ath6kl_init_upload(ar);
+ if (ret)
+ goto err_power_off;
+
+ /* Do we need to finish the BMI phase */
+ /* FIXME: return error from ath6kl_bmi_done() */
+ if (ath6kl_bmi_done(ar)) {
+ ret = -EIO;
+ goto err_power_off;
+ }
+
+ /*
+ * The reason we have to wait for the target here is that the
+ * driver layer has to init BMI in order to set the host block
+ * size.
+ */
+ if (ath6kl_htc_wait_target(ar->htc_target)) {
+ ret = -EIO;
+ goto err_power_off;
+ }
+
+ if (ath6kl_init_service_ep(ar)) {
+ ret = -EIO;
+ goto err_cleanup_scatter;
+ }
+
+ /* setup credit distribution */
+ ath6kl_credit_setup(ar->htc_target, &ar->credit_state_info);
+
+ /* start HTC */
+ ret = ath6kl_htc_start(ar->htc_target);
+ if (ret) {
+ /* FIXME: call this */
+ ath6kl_cookie_cleanup(ar);
+ goto err_cleanup_scatter;
+ }
+
+ /* Wait for Wmi event to be ready */
+ timeleft = wait_event_interruptible_timeout(ar->event_wq,
+ test_bit(WMI_READY,
+ &ar->flag),
+ WMI_TIMEOUT);
+
+ ath6kl_dbg(ATH6KL_DBG_BOOT, "firmware booted\n");
+
+ if (ar->version.abi_ver != ATH6KL_ABI_VERSION) {
+ ath6kl_err("abi version mismatch: host(0x%x), target(0x%x)\n",
+ ATH6KL_ABI_VERSION, ar->version.abi_ver);
+ ret = -EIO;
+ goto err_htc_stop;
+ }
+
+ if (!timeleft || signal_pending(current)) {
+ ath6kl_err("wmi is not ready or wait was interrupted\n");
+ ret = -EIO;
+ goto err_htc_stop;
+ }
+
+ ath6kl_dbg(ATH6KL_DBG_TRC, "%s: wmi is ready\n", __func__);
+
+ /* communicate the wmi protocol verision to the target */
+ /* FIXME: return error */
+ if ((ath6kl_set_host_app_area(ar)) != 0)
+ ath6kl_err("unable to set the host app area\n");
+
+ for (i = 0; i < MAX_NUM_VIF; i++) {
+ ret = ath6kl_target_config_wlan_params(ar, i);
+ if (ret)
+ goto err_htc_stop;
+ }
+
+ return 0;
+
+err_htc_stop:
+ ath6kl_htc_stop(ar->htc_target);
+err_cleanup_scatter:
+ ath6kl_hif_cleanup_scatter(ar);
+err_power_off:
+ ath6kl_hif_power_off(ar);
+
+ return ret;
+}
+
int ath6kl_core_init(struct ath6kl *ar)
{
struct ath6kl_bmi_target_info targ_info;
- s32 timeleft;
struct net_device *ndev;
- int i, ret = 0;
+ int ret = 0, i;
ar->ath6kl_wq = create_singlethread_workqueue("ath6kl");
if (!ar->ath6kl_wq)
@@ -1436,6 +1531,11 @@ int ath6kl_core_init(struct ath6kl *ar)
if (ret)
goto err_wq;
+ /*
+ * Turn on power to get hardware (target) version and leave power
+ * on delibrately as we will boot the hardware anyway within few
+ * seconds.
+ */
ret = ath6kl_hif_power_on(ar);
if (ret)
goto err_bmi_cleanup;
@@ -1452,10 +1552,6 @@ int ath6kl_core_init(struct ath6kl *ar)
if (ret)
goto err_power_off;
- ret = ath6kl_configure_target(ar);
- if (ret)
- goto err_power_off;
-
ar->htc_target = ath6kl_htc_create(ar);
if (!ar->htc_target) {
@@ -1469,16 +1565,6 @@ int ath6kl_core_init(struct ath6kl *ar)
/* FIXME: we should free all firmwares in the error cases below */
- ret = ath6kl_init_upload(ar);
- if (ret)
- goto err_htc_cleanup;
-
- /* Do we need to finish the BMI phase */
- if (ath6kl_bmi_done(ar)) {
- ret = -EIO;
- goto err_htc_cleanup;
- }
-
/* Indicate that WMI is enabled (although not ready yet) */
set_bit(WMI_ENABLED, &ar->flag);
ar->wmi = ath6kl_wmi_init(ar);
@@ -1522,21 +1608,6 @@ int ath6kl_core_init(struct ath6kl *ar)
ath6kl_dbg(ATH6KL_DBG_TRC, "%s: name=%s dev=0x%p, ar=0x%p\n",
__func__, ndev->name, ndev, ar);
- /*
- * The reason we have to wait for the target here is that the
- * driver layer has to init BMI in order to set the host block
- * size.
- */
- if (ath6kl_htc_wait_target(ar->htc_target)) {
- ret = -EIO;
- goto err_if_deinit;
- }
-
- if (ath6kl_init_service_ep(ar)) {
- ret = -EIO;
- goto err_cleanup_scatter;
- }
-
/* setup access class priority mappings */
ar->ac_stream_pri_map[WMM_AC_BK] = 0; /* lowest */
ar->ac_stream_pri_map[WMM_AC_BE] = 1;
@@ -1550,54 +1621,17 @@ int ath6kl_core_init(struct ath6kl *ar)
/* allocate some buffers that handle larger AMSDU frames */
ath6kl_refill_amsdu_rxbufs(ar, ATH6KL_MAX_AMSDU_RX_BUFFERS);
- /* setup credit distribution */
- ath6kl_credit_setup(ar->htc_target, &ar->credit_state_info);
-
ath6kl_cookie_init(ar);
- /* start HTC */
- ret = ath6kl_htc_start(ar->htc_target);
- if (ret) {
- ath6kl_cookie_cleanup(ar);
- goto err_rxbuf_cleanup;
- }
-
- /* Wait for Wmi event to be ready */
- timeleft = wait_event_interruptible_timeout(ar->event_wq,
- test_bit(WMI_READY,
- &ar->flag),
- WMI_TIMEOUT);
-
- ath6kl_dbg(ATH6KL_DBG_BOOT, "firmware booted\n");
-
- if (ar->version.abi_ver != ATH6KL_ABI_VERSION) {
- ath6kl_err("abi version mismatch: host(0x%x), target(0x%x)\n",
- ATH6KL_ABI_VERSION, ar->version.abi_ver);
- ret = -EIO;
- goto err_htc_stop;
- }
-
- if (!timeleft || signal_pending(current)) {
- ath6kl_err("wmi is not ready or wait was interrupted\n");
- ret = -EIO;
- goto err_htc_stop;
- }
-
- ath6kl_dbg(ATH6KL_DBG_TRC, "%s: wmi is ready\n", __func__);
-
- /* communicate the wmi protocol verision to the target */
- if ((ath6kl_set_host_app_area(ar)) != 0)
- ath6kl_err("unable to set the host app area\n");
-
ar->conf_flags = ATH6KL_CONF_IGNORE_ERP_BARKER |
ATH6KL_CONF_ENABLE_11N | ATH6KL_CONF_ENABLE_TX_BURST;
ar->wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM;
- for (i = 0; i < MAX_NUM_VIF; i++) {
- ret = ath6kl_target_config_wlan_params(ar, i);
- if (ret)
- goto err_htc_stop;
+ ret = ath6kl_hw_start(ar);
+ if (ret) {
+ ath6kl_err("Failed to boot hardware: %d\n", ret);
+ goto err_rxbuf_cleanup;
}
/*
@@ -1608,14 +1642,9 @@ int ath6kl_core_init(struct ath6kl *ar)
return ret;
-err_htc_stop:
- ath6kl_htc_stop(ar->htc_target);
err_rxbuf_cleanup:
ath6kl_htc_flush_rx_buf(ar->htc_target);
ath6kl_cleanup_amsdu_rxbufs(ar);
-err_cleanup_scatter:
- ath6kl_hif_cleanup_scatter(ar);
-err_if_deinit:
rtnl_lock();
ath6kl_deinit_if_data(netdev_priv(ndev));
rtnl_unlock();
^ permalink raw reply related
* [PATCH 07/10] ath6kl: remove useless cleanup call from ath6kl_bmi_done()
From: Kalle Valo @ 2011-10-27 15:48 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111027154746.23519.39680.stgit@localhost6.localdomain6>
aht6kl core code will call the cleanup function when the device is removed.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/bmi.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/bmi.c b/drivers/net/wireless/ath/ath6kl/bmi.c
index c5d11cc..5a4c24d 100644
--- a/drivers/net/wireless/ath/ath6kl/bmi.c
+++ b/drivers/net/wireless/ath/ath6kl/bmi.c
@@ -196,8 +196,6 @@ int ath6kl_bmi_done(struct ath6kl *ar)
return ret;
}
- ath6kl_bmi_cleanup(ar);
-
return 0;
}
^ permalink raw reply related
* [PATCH 08/10] ath6kl: add a timeout to ath6kl_hif_intr_bh_handler()
From: Kalle Valo @ 2011-10-27 15:48 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111027154746.23519.39680.stgit@localhost6.localdomain6>
It's possible to busyloop forever in ath6kl_hif_intr_bh_handler(). Add
a check that it lasts only one second.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/hif.c | 4 +++-
drivers/net/wireless/ath/ath6kl/hif.h | 2 ++
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/hif.c b/drivers/net/wireless/ath/ath6kl/hif.c
index e2d8088..309be98 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.c
+++ b/drivers/net/wireless/ath/ath6kl/hif.c
@@ -485,6 +485,7 @@ out:
int ath6kl_hif_intr_bh_handler(struct ath6kl *ar)
{
struct ath6kl_device *dev = ar->htc_target->dev;
+ unsigned long timeout;
int status = 0;
bool done = false;
@@ -498,7 +499,8 @@ int ath6kl_hif_intr_bh_handler(struct ath6kl *ar)
* IRQ processing is synchronous, interrupt status registers can be
* re-read.
*/
- while (!done) {
+ timeout = jiffies + msecs_to_jiffies(ATH6KL_HIF_COMMUNICATION_TIMEOUT);
+ while (time_before(jiffies, timeout) && !done) {
status = proc_pending_irqs(dev, &done);
if (status)
break;
diff --git a/drivers/net/wireless/ath/ath6kl/hif.h b/drivers/net/wireless/ath/ath6kl/hif.h
index ee7c31a..78a6c79 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.h
+++ b/drivers/net/wireless/ath/ath6kl/hif.h
@@ -69,6 +69,8 @@
#define ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER (16 * 1024)
#define ATH6KL_SCATTER_REQS 4
+#define ATH6KL_HIF_COMMUNICATION_TIMEOUT 1000
+
struct bus_request {
struct list_head list;
^ permalink raw reply related
* [PATCH 09/10] ath6kl: create ath6kl_htc_reset()
From: Kalle Valo @ 2011-10-27 15:49 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111027154746.23519.39680.stgit@localhost6.localdomain6>
When rebooting hardware we need to reset the htc state in ath6kl_htc_stop().
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/htc.c | 91 ++++++++++++++++++---------------
1 files changed, 49 insertions(+), 42 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index d03456b..04b4070 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -2656,6 +2656,44 @@ int ath6kl_htc_start(struct htc_target *target)
return status;
}
+static int ath6kl_htc_reset(struct htc_target *target)
+{
+ u32 block_size, ctrl_bufsz;
+ struct htc_packet *packet;
+ int i;
+
+ reset_ep_state(target);
+
+ block_size = target->dev->ar->mbox_info.block_size;
+
+ ctrl_bufsz = (block_size > HTC_MAX_CTRL_MSG_LEN) ?
+ (block_size + HTC_HDR_LENGTH) :
+ (HTC_MAX_CTRL_MSG_LEN + HTC_HDR_LENGTH);
+
+ for (i = 0; i < NUM_CONTROL_BUFFERS; i++) {
+ packet = kzalloc(sizeof(*packet), GFP_KERNEL);
+ if (!packet)
+ return -ENOMEM;
+
+ packet->buf_start = kzalloc(ctrl_bufsz, GFP_KERNEL);
+ if (!packet->buf_start) {
+ kfree(packet);
+ return -ENOMEM;
+ }
+
+ packet->buf_len = ctrl_bufsz;
+ if (i < NUM_CONTROL_RX_BUFFERS) {
+ packet->act_len = 0;
+ packet->buf = packet->buf_start;
+ packet->endpoint = ENDPOINT_0;
+ list_add_tail(&packet->list, &target->free_ctrl_rxbuf);
+ } else
+ list_add_tail(&packet->list, &target->free_ctrl_txbuf);
+ }
+
+ return 0;
+}
+
/* htc_stop: stop interrupt reception, and flush all queued buffers */
void ath6kl_htc_stop(struct htc_target *target)
{
@@ -2674,15 +2712,13 @@ void ath6kl_htc_stop(struct htc_target *target)
ath6kl_htc_flush_rx_buf(target);
- reset_ep_state(target);
+ ath6kl_htc_reset(target);
}
void *ath6kl_htc_create(struct ath6kl *ar)
{
struct htc_target *target = NULL;
- struct htc_packet *packet;
- int status = 0, i = 0;
- u32 block_size, ctrl_bufsz;
+ int status = 0;
target = kzalloc(sizeof(*target), GFP_KERNEL);
if (!target) {
@@ -2694,7 +2730,7 @@ void *ath6kl_htc_create(struct ath6kl *ar)
if (!target->dev) {
ath6kl_err("unable to allocate memory\n");
status = -ENOMEM;
- goto fail_create_htc;
+ goto err_htc_cleanup;
}
spin_lock_init(&target->htc_lock);
@@ -2709,49 +2745,20 @@ void *ath6kl_htc_create(struct ath6kl *ar)
target->dev->htc_cnxt = target;
target->ep_waiting = ENDPOINT_MAX;
- reset_ep_state(target);
-
status = ath6kl_hif_setup(target->dev);
-
if (status)
- goto fail_create_htc;
-
- block_size = ar->mbox_info.block_size;
-
- ctrl_bufsz = (block_size > HTC_MAX_CTRL_MSG_LEN) ?
- (block_size + HTC_HDR_LENGTH) :
- (HTC_MAX_CTRL_MSG_LEN + HTC_HDR_LENGTH);
+ goto err_htc_cleanup;
- for (i = 0; i < NUM_CONTROL_BUFFERS; i++) {
- packet = kzalloc(sizeof(*packet), GFP_KERNEL);
- if (!packet)
- break;
-
- packet->buf_start = kzalloc(ctrl_bufsz, GFP_KERNEL);
- if (!packet->buf_start) {
- kfree(packet);
- break;
- }
+ status = ath6kl_htc_reset(target);
+ if (status)
+ goto err_htc_cleanup;
- packet->buf_len = ctrl_bufsz;
- if (i < NUM_CONTROL_RX_BUFFERS) {
- packet->act_len = 0;
- packet->buf = packet->buf_start;
- packet->endpoint = ENDPOINT_0;
- list_add_tail(&packet->list, &target->free_ctrl_rxbuf);
- } else
- list_add_tail(&packet->list, &target->free_ctrl_txbuf);
- }
+ return target;
-fail_create_htc:
- if (i != NUM_CONTROL_BUFFERS || status) {
- if (target) {
- ath6kl_htc_cleanup(target);
- target = NULL;
- }
- }
+err_htc_cleanup:
+ ath6kl_htc_cleanup(target);
- return target;
+ return NULL;
}
/* cleanup the HTC instance */
^ permalink raw reply related
* [PATCH 10/10] ath6kl: don't print an error for canceled packets
From: Kalle Valo @ 2011-10-27 15:49 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111027154746.23519.39680.stgit@localhost6.localdomain6>
ath6kl_tx_complete() was printing an error when packet was canceled.
That causes unnecessary errors when hardware is powered off.
Also change the error to a warning and cleanup the message.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/txrx.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index ab9a5c1..9dfd7f5 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -606,8 +606,9 @@ void ath6kl_tx_complete(void *context, struct list_head *packet_queue)
vif->net_stats.tx_errors++;
- if (status != -ENOSPC)
- ath6kl_err("tx error, status: 0x%x\n", status);
+ if (status != -ENOSPC && status != -ECANCELED)
+ ath6kl_warn("tx complete error: %d\n", status);
+
ath6kl_dbg(ATH6KL_DBG_WLAN_TX,
"%s: skb=0x%p data=0x%p len=0x%x eid=%d %s\n",
__func__, skb, packet->buf, packet->act_len,
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox