* [PATCH 3.11] mac80211: add missing channel context release
From: Johannes Berg @ 2013-08-21 10:04 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
IBSS needs to release the channel context when leaving
but I evidently missed that. Fix it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/ibss.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index ea7b9c2..5e8bb3b 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1138,6 +1138,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state);
ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED |
BSS_CHANGED_IBSS);
+ ieee80211_vif_release_channel(sdata);
synchronize_rcu();
kfree(presp);
--
1.8.4.rc2
^ permalink raw reply related
* Re: [PATCH] mac80211: add missing channel context release
From: Johannes Berg @ 2013-08-21 9:59 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <1377079129-23481-1-git-send-email-johannes@sipsolutions.net>
On Wed, 2013-08-21 at 11:58 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> IBSS needs to release the channel context when leaving
> but I evidently missed that. Fix it.
>
> Change-Id: Iaa87fdd143d5a1a7eac5b0bb63d11dca372a6bb3
Umm, I'll remove that :)
johannes
^ permalink raw reply
* [PATCH] mac80211: add missing channel context release
From: Johannes Berg @ 2013-08-21 9:58 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
IBSS needs to release the channel context when leaving
but I evidently missed that. Fix it.
Change-Id: Iaa87fdd143d5a1a7eac5b0bb63d11dca372a6bb3
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/ibss.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 74de0f1..5fb1b14 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1304,6 +1304,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state);
ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED |
BSS_CHANGED_IBSS);
+ ieee80211_vif_release_channel(sdata);
synchronize_rcu();
kfree(presp);
--
1.8.4.rc2
^ permalink raw reply related
* [PATCH V2 12/12] brcmsmac: add support for BCM4313 iPA variant
From: Arend van Spriel @ 2013-08-21 9:45 UTC (permalink / raw)
To: John W. Linville; +Cc: Joe Perches, linux-wireless, Arend van Spriel
In-Reply-To: <1377007246-9957-13-git-send-email-arend@broadcom.com>
This patch completes the changes needed for supporting the
iPA variant cards of the BCM4313 wireless chipset.
Tested-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
Added 'static const' qualifier to address comment from Joe Perches.
This patch replaces the previous patch with
Message-ID: <1377007246-9957-13-git-send-email-arend@broadcom.com>
Regards,
Arend
---
.../net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c | 73 ++++++++++++++------
1 file changed, 53 insertions(+), 20 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
index 8fb1048..b2d6d6d 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -1826,6 +1826,19 @@ wlc_lcnphy_radio_2064_channel_tune_4313(struct brcms_phy *pi, u8 channel)
write_radio_reg(pi, RADIO_2064_REG038, 3);
write_radio_reg(pi, RADIO_2064_REG091, 7);
}
+
+ if (!(pi->sh->boardflags & BFL_FEM)) {
+ static const u8 reg038[14] = {
+ 0xd, 0xe, 0xd, 0xd, 0xd, 0xc, 0xa,
+ 0xb, 0xb, 0x3, 0x3, 0x2, 0x0, 0x0
+ };
+
+ write_radio_reg(pi, RADIO_2064_REG02A, 0xf);
+ write_radio_reg(pi, RADIO_2064_REG091, 0x3);
+ write_radio_reg(pi, RADIO_2064_REG038, 0x3);
+
+ write_radio_reg(pi, RADIO_2064_REG038, reg038[channel - 1]);
+ }
}
static int
@@ -2123,7 +2136,16 @@ static void wlc_lcnphy_tssi_setup(struct brcms_phy *pi)
{
struct phytbl_info tab;
u32 rfseq, ind;
+ enum lcnphy_tssi_mode mode;
+ u8 tssi_sel;
+ if (pi->sh->boardflags & BFL_FEM) {
+ tssi_sel = 0x1;
+ mode = LCNPHY_TSSI_EXT;
+ } else {
+ tssi_sel = 0xe;
+ mode = LCNPHY_TSSI_POST_PA;
+ }
tab.tbl_id = LCNPHY_TBL_ID_TXPWRCTL;
tab.tbl_width = 32;
tab.tbl_ptr = &ind;
@@ -2144,7 +2166,7 @@ static void wlc_lcnphy_tssi_setup(struct brcms_phy *pi)
mod_phy_reg(pi, 0x503, (0x1 << 4), (1) << 4);
- wlc_lcnphy_set_tssi_mux(pi, LCNPHY_TSSI_EXT);
+ wlc_lcnphy_set_tssi_mux(pi, mode);
mod_phy_reg(pi, 0x4a4, (0x1 << 14), (0) << 14);
mod_phy_reg(pi, 0x4a4, (0x1 << 15), (1) << 15);
@@ -2180,9 +2202,10 @@ static void wlc_lcnphy_tssi_setup(struct brcms_phy *pi)
mod_phy_reg(pi, 0x49a, (0x1ff << 0), (0xff) << 0);
if (LCNREV_IS(pi->pubpi.phy_rev, 2)) {
- mod_radio_reg(pi, RADIO_2064_REG028, 0xf, 0xe);
+ mod_radio_reg(pi, RADIO_2064_REG028, 0xf, tssi_sel);
mod_radio_reg(pi, RADIO_2064_REG086, 0x4, 0x4);
} else {
+ mod_radio_reg(pi, RADIO_2064_REG028, 0x1e, tssi_sel << 1);
mod_radio_reg(pi, RADIO_2064_REG03A, 0x1, 1);
mod_radio_reg(pi, RADIO_2064_REG11A, 0x8, 1 << 3);
}
@@ -4358,8 +4381,11 @@ wlc_lcnphy_load_tx_gain_table(struct brcms_phy *pi,
tab.tbl_len = 1;
tab.tbl_ptr = &val;
+ /* fixed gm_gain value for iPA */
+ gm_gain = 15;
for (j = 0; j < 128; j++) {
- gm_gain = gain_table[j].gm;
+ if (pi->sh->boardflags & BFL_FEM)
+ gm_gain = gain_table[j].gm;
val = (((u32) pa_gain << 24) |
(gain_table[j].pad << 16) |
(gain_table[j].pga << 8) | gm_gain);
@@ -4570,7 +4596,10 @@ static void wlc_radio_2064_init(struct brcms_phy *pi)
write_phy_reg(pi, 0x4ea, 0x4688);
- mod_phy_reg(pi, 0x4eb, (0x7 << 0), 2 << 0);
+ if (pi->sh->boardflags & BFL_FEM)
+ mod_phy_reg(pi, 0x4eb, (0x7 << 0), 2 << 0);
+ else
+ mod_phy_reg(pi, 0x4eb, (0x7 << 0), 3 << 0);
mod_phy_reg(pi, 0x4eb, (0x7 << 6), 0 << 6);
@@ -4581,6 +4610,13 @@ static void wlc_radio_2064_init(struct brcms_phy *pi)
wlc_lcnphy_rcal(pi);
wlc_lcnphy_rc_cal(pi);
+
+ if (!(pi->sh->boardflags & BFL_FEM)) {
+ write_radio_reg(pi, RADIO_2064_REG032, 0x6f);
+ write_radio_reg(pi, RADIO_2064_REG033, 0x19);
+ write_radio_reg(pi, RADIO_2064_REG039, 0xe);
+ }
+
}
static void wlc_lcnphy_radio_init(struct brcms_phy *pi)
@@ -4611,22 +4647,20 @@ static void wlc_lcnphy_tbl_init(struct brcms_phy *pi)
wlc_lcnphy_write_table(pi, &tab);
}
- tab.tbl_id = LCNPHY_TBL_ID_RFSEQ;
- tab.tbl_width = 16;
- tab.tbl_ptr = &val;
- tab.tbl_len = 1;
-
- val = 114;
- tab.tbl_offset = 0;
- wlc_lcnphy_write_table(pi, &tab);
+ if (!(pi->sh->boardflags & BFL_FEM)) {
+ tab.tbl_id = LCNPHY_TBL_ID_RFSEQ;
+ tab.tbl_width = 16;
+ tab.tbl_ptr = &val;
+ tab.tbl_len = 1;
- val = 130;
- tab.tbl_offset = 1;
- wlc_lcnphy_write_table(pi, &tab);
+ val = 150;
+ tab.tbl_offset = 0;
+ wlc_lcnphy_write_table(pi, &tab);
- val = 6;
- tab.tbl_offset = 8;
- wlc_lcnphy_write_table(pi, &tab);
+ val = 220;
+ tab.tbl_offset = 1;
+ wlc_lcnphy_write_table(pi, &tab);
+ }
if (CHSPEC_IS2G(pi->radio_chanspec)) {
if (pi->sh->boardflags & BFL_FEM)
@@ -5059,8 +5093,7 @@ bool wlc_phy_attach_lcnphy(struct brcms_phy *pi)
if (!wlc_phy_txpwr_srom_read_lcnphy(pi))
return false;
- if ((pi->sh->boardflags & BFL_FEM) &&
- (LCNREV_IS(pi->pubpi.phy_rev, 1))) {
+ if (LCNREV_IS(pi->pubpi.phy_rev, 1)) {
if (pi_lcn->lcnphy_tempsense_option == 3) {
pi->hwpwrctrl = true;
pi->hwpwrctrl_capable = true;
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCHv3 09/18] mac80211: change IBSS channel state to chandef
From: Johannes Berg @ 2013-08-21 9:35 UTC (permalink / raw)
To: Simon Wunderlich; +Cc: linux-wireless, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368702045-27598-10-git-send-email-siwu@hrz.tu-chemnitz.de>
On Thu, 2013-05-16 at 13:00 +0200, Simon Wunderlich wrote:
> - cfg80211_chandef_create(&chandef, chan, ifibss->channel_type);
> + chandef = ifibss->chandef;
This part is obviously wrong - it ignores the given channel. Please post
a fix as soon as you can, with the code as it is now we never join an
existing IBSS correctly but always use the channel the user gave.
johannes
^ permalink raw reply
* [PATCH] mac80211: add missing channel context release
From: Johannes Berg @ 2013-08-21 9:31 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
IBSS needs to release the channel context when leaving
but I evidently missed that. Fix it.
Change-Id: Iaa87fdd143d5a1a7eac5b0bb63d11dca372a6bb3
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/ibss.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 74de0f1..5fb1b14 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1304,6 +1304,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state);
ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED |
BSS_CHANGED_IBSS);
+ ieee80211_vif_release_channel(sdata);
synchronize_rcu();
kfree(presp);
--
1.8.4.rc2
^ permalink raw reply related
* Re: [PATCH 12/12] brcmsmac: add support for BCM4313 iPA variant
From: Arend van Spriel @ 2013-08-21 9:28 UTC (permalink / raw)
To: Joe Perches; +Cc: John W. Linville, linux-wireless
In-Reply-To: <1377023415.2016.63.camel@joe-AO722>
On 08/20/2013 08:30 PM, Joe Perches wrote:
> On Tue, 2013-08-20 at 16:00 +0200, Arend van Spriel wrote:
>> This patch completes the changes needed for supporting the
>> iPA variant cards of the BCM4313 wireless chipset.
> []
>> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
> []
>> @@ -1826,6 +1826,17 @@ wlc_lcnphy_radio_2064_channel_tune_4313(struct brcms_phy *pi, u8 channel)
>> write_radio_reg(pi, RADIO_2064_REG038, 3);
>> write_radio_reg(pi, RADIO_2064_REG091, 7);
>> }
>> +
>> + if (!(pi->sh->boardflags & BFL_FEM)) {
>> + u8 reg038[14] = {0xd, 0xe, 0xd, 0xd, 0xd, 0xc,
>> + 0xa, 0xb, 0xb, 0x3, 0x3, 0x2, 0x0, 0x0};
>
> static const would reduce the object size.
You are right. I will change that.
>> + write_radio_reg(pi, RADIO_2064_REG02A, 0xf);
>> + write_radio_reg(pi, RADIO_2064_REG091, 0x3);
>> + write_radio_reg(pi, RADIO_2064_REG038, 0x3);
>> +
>> + write_radio_reg(pi, RADIO_2064_REG038, reg038[channel - 1]);
>
> Does anything limit channel to < 15?
The 4313 is a 2.4GHz wireless device so channel will always be in the
range 1 to 14. This is validated earlier in the call sequence leading to
this function.
> There seem to be an awful lot of magic numbers
> in the patch.
Unfortunately, that is the case for most of the phy code. Most stuff is
the result of tuning the phy performance.
Regards,
Arend
^ permalink raw reply
* [PATCH] mac80211: move setting WIPHY_FLAG_SUPPORTS_SCHED_SCAN into drivers
From: Johannes Berg @ 2013-08-21 9:27 UTC (permalink / raw)
To: linux-wireless; +Cc: Luciano Coelho, Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
mac80211 currently sets WIPHY_FLAG_SUPPORTS_SCHED_SCAN based on whether
the start_sched_scan operation is supported or not, but that will not
be correct for all drivers, we're adding scheduled scan to the iwlmvm
driver but it depends on firmware support.
Therefore, move setting WIPHY_FLAG_SUPPORTS_SCHED_SCAN into the drivers
so that they can control it regardless of implementing the operation.
This currently only affects the TI drivers since they're the only ones
implementing scheduled scan (in a mac80211 driver.)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/ti/wlcore/main.c | 3 ++-
net/mac80211/main.c | 3 ---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index d1b19c3..38995f9 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -5623,7 +5623,8 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
wl->hw->wiphy->max_remain_on_channel_duration = 5000;
wl->hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD |
- WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
+ WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
+ WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
/* make sure all our channels fit in the scanned_ch bitmask */
BUILD_BUG_ON(ARRAY_SIZE(wl1271_channels) +
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 25eb35b..21d5d44 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -892,9 +892,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
if (!local->ops->remain_on_channel)
local->hw.wiphy->max_remain_on_channel_duration = 5000;
- if (local->ops->sched_scan_start)
- local->hw.wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
-
/* mac80211 based drivers don't support internal TDLS setup */
if (local->hw.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS)
local->hw.wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP;
--
1.8.4.rc2
^ permalink raw reply related
* Re: [PATCH 01/16] wcn36xx: Add main.c
From: Eugene Krasnikov @ 2013-08-21 9:00 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, wcn36xx
In-Reply-To: <1377074351.15268.7.camel@jlt4.sipsolutions.net>
> [remove wcn list, it annoys me with moderator messages]
Sorry for that, now should be fixed.
>> >> + if (IEEE80211_KEY_FLAG_PAIRWISE & key_conf->flags) {
>> >> + sta_priv->is_data_encrypted = true;
>> >> + /* Reconfigure bss with encrypt_type */
>> >> + if (NL80211_IFTYPE_STATION == vif->type)
>> >> + wcn36xx_smd_config_bss(wcn,
>> >> + vif,
>> >> + sta,
>> >> + sta->addr,
>> >> + true);
>> >
>> > It seems to me this should not be here but you should have mac80211 set
>> > something in e.g. bss_conf that indicates encryption?
>> >
>>
>> It's a good idea and I tried to find anything encryption related in
>> bss_conf but without luck. I do not like this line myself so I would
>> really appreciate if you can point where exactly in
>> bss_conf/bss_info_changed information about encryption is located.
>
> There isn't anything, but you could always add it.
Aha, ok will add this to my todo list:)
>> >> + static const u32 cipher_suites[] = {
>> >> + WLAN_CIPHER_SUITE_TKIP,
>> >> + WLAN_CIPHER_SUITE_CCMP,
>> >> + };
>> >
>> > You actually don't want to support WEP, not even in software? Otherwise
>> > just leave this out and mac80211 will add it.
>>
>> WEP is supported by HW but wcn36xx does not configure it yet. Is that
>> ok to add HW WEP encryption in nearest future after wcn36xx is pushed
>> to upstream?
>
> I don't see why you'd even bother - why not just use software encryption
> for WEP for the time being? Then you don't need this code.
Because if I add something I test it, and that will take the same
amount of time as to add HW WEP ;) Let me add HW WEP since it's faster
then SW WEP.
>> >> + wcn->hw->wiphy->iface_combinations = &if_comb;
>> >> + wcn->hw->wiphy->n_iface_combinations = 1;
>> >
>> > Your code with "wcn->current_vif = " etc. *really* doesn't look like you
>> > support combinations. Are you positive this is OK?
>>
>> So far wcn36xx supports only one interface at once. But in the nearest
>> future it will definitely support more than one. So how about keeping
>> this for future?;)
>
> It's *wrong* though - you're saying two interfaces are supported and
> then they aren't. Don't do that.
You are right. Will remove this for now.
--
Best regards,
Eugene
^ permalink raw reply
* Re: [REGRESSION] 3.10.{6,7} crashes on network activity
From: Arend van Spriel @ 2013-08-21 8:52 UTC (permalink / raw)
To: Josh Boyer
Cc: Felix Fietkau, Greg Kroah-Hartman, Tom Gundersen,
stable@vger.kernel.org, Linux Wireless List, LKML, Johannes Berg
In-Reply-To: <CA+5PVA7gvnfX2vnpxEGCgaAYXRvA=SME4SYZpTESqLsMkgSu=g@mail.gmail.com>
On 08/21/2013 02:11 AM, Josh Boyer wrote:
> On Tue, Aug 20, 2013 at 4:15 AM, Arend van Spriel <arend@broadcom.com> wrote:
>> On 08/20/2013 06:56 AM, Felix Fietkau wrote:
>>>
>>> On 2013-08-20 2:28 AM, Greg Kroah-Hartman wrote:
>>>>
>>>> On Tue, Aug 20, 2013 at 08:26:11AM +0800, Tom Gundersen wrote:
>>>>>
>>>>> On Tue, Aug 20, 2013 at 8:03 AM, Greg Kroah-Hartman
>>>>> <gregkh@linuxfoundation.org> wrote:
>>>>>>
>>>>>> On Tue, Aug 20, 2013 at 07:59:47AM +0800, Tom Gundersen wrote:
>>>>>>>
>>>>>>> Hi guys,
>>>>>>>
>>>>>>> Starting with 3.10.6 (and still present in .7) I get an oops on
>>>>>>> connecting to the network.
>>>>>>>
>>>>>>> The attached picture shows the oops. In case it does not reach the ML,
>>>>>>> the top of the call trace reads:
>>>>>>>
>>>>>>> brcms_c_compute_rtscts_dur
>>>>>>> brcms_c_ampdu_finalize
>>>>>>> ampdu_finalize
>>>>>>> dma_txfast
>>>>>>> brcms_c_txfifo
>>>>>>> brcms_c_sendpkt_mac80211
>>>>>>> brcms_ops_tx
>>>>>>> __ieee80211_tx
>>>>>>>
>>>>>>> I bisected the problem and the first bad commit is
>>>>>>>
>>>>>>> commit ef47a5e4f1aaf1d0e2e6875e34b2c9595897bef6
>>>>>>> Author: Felix Fietkau <nbd@openwrt.org>
>>>>>>> Date: Fri Jun 28 21:04:35 2013 +0200
>>>>>>>
>>>>>>> mac80211/minstrel_ht: fix cck rate sampling
>>>>>>>
>>>>>>> commit 1cd158573951f737fbc878a35cb5eb47bf9af3d5 upstream.
>>>>>>>
>>>>>>> Reverting it on top of .7 fixes the problem.
>>>>>>>
>>>>>>> I had the same (I suppose) problem on mainline some time ago, but I
>>>>>>> have not bisected it, verified that the problem still occurs there, or
>>>>>>> checked if reverting the upstream patch fixes it. I'd be happy to do
>>>>>>> that if it would help though.
>>>>>>>
>>>>>>> Let me know if you need any more information.
>>>>>>
>>>>>>
>>>>>> Do you have this same problem with 3.11-rc6 as well?
>>>>>
>>>>>
>>>>> Yes, I just confirmed. I also confirmed that reverting the mainline
>>>>> commit on top of -rc6 fixes the problem.
>>>>
>>>>
>>>> Great, thanks.
>>>>
>>>> Felix and Johannes, any chance we can get this reverted in Linus tree
>>>> soon, and push that revert back to the 3.10 stable tree as well?
>>>
>>> I'd like to avoid a revert, since that will simply replace one set of
>>> issues with another. Let's limit the use of the feature that brcmsmac
>>> can't handle to drivers that are known to work with it. Tom, Please
>>> test this patch to see if it fixes your issue.
>>
>>
>> Hi Felix,
>>
>> I have been diving into root causing why brcmsmac can not handle cck
>> fallback rates, because it should. Maybe it is better to flag no cck support
>> and only change brcmsmac.
>
> We have a number of users hitting this in Fedora 18 and 19 now. We're
> tracking it with https://bugzilla.redhat.com/show_bug.cgi?id=998080
> and I'm sure we can find people to test easily.
There is already another one (possibly) dealing with the same issue:
https://bugzilla.redhat.com/show_bug.cgi?id=989269
One of them should probably be flagged as duplicate.
> If you have a patch disabling cck in brcmsmac, I'd be happy to build a
> kernel for people. If that's going to be some time coming, perhaps
> it's better to grab Felix's patch on a temporary basis?
I think it is better to grab Felix's patch because as we both observed
there is stuff missing in brcmsmac to deal with CCK rates and A-MPDU
packet aggregation.
Regards,
Arend
^ permalink raw reply
* Re: [PATCH 09/16] wcn36xx: Add smd.c
From: Eugene Krasnikov @ 2013-08-21 8:49 UTC (permalink / raw)
To: Johannes Berg; +Cc: Joe Perches, linux-wireless, wcn36xx
In-Reply-To: <1377072922.15268.4.camel@jlt4.sipsolutions.net>
>> >> diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
>> > []
>> >> +int wcn36xx_smd_load_nv(struct wcn36xx *wcn)
>> >> +{
>> > []
>> >> + /* Add NV body itself */
>> >> + /* Rework me */
>> >> + memcpy(wcn->smd_buf + sizeof(msg_body),
>> >> + (void *)(&nv_d->table) + fm_offset,
>> >> + msg_body.nv_img_buffer_size);
>> >
>> > Does this really do what you want?
>> >
>> > Perhaps it should be:
>> >
>> > memcpy(wcn->smd_buf + sizeof(msg_body),
>> > ((void *)&nv_d->table) + fm_offset,
>> > msg_body.nv_img_buffer_size);
>> >
>>
>> Yes, this line is working. Tested it for ARM. Do you see any potential
>> problems with this pointer operation?
>
> It should really be u8* instead of void*, since void* pointer arithmetic
> isn't really defined I think?
>
> Other than that, this was just about precedence rules, and casts have a
> higher precedence.
>
Aha, now i understand what you mean. You are absolutely right it must
be u8*. Will fix in the next round.
--
Best regards,
Eugene
^ permalink raw reply
* Re: [PATCH 11/16] wcn36xx: Add txrx.c
From: Eugene Krasnikov @ 2013-08-21 8:44 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, wcn36xx
In-Reply-To: <1377032637.13829.42.camel@jlt4.sipsolutions.net>
> On Tue, 2013-08-20 at 19:41 +0200, Eugene Krasnikov wrote:
>
>> +int wcn36xx_start_tx(struct wcn36xx *wcn,
>> + struct wcn36xx_sta *sta_priv,
>> + struct sk_buff *skb)
>
> err ... this can return errors that you never handle, probably gets you
> leaks that way?
Good catch. In some corner cases ieee80211_free_txskb is not called.
--
Best regards,
Eugene
^ permalink raw reply
* Re: [PATCH 11/16] wcn36xx: Add txrx.c
From: Eugene Krasnikov @ 2013-08-21 8:39 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, wcn36xx
In-Reply-To: <1377032500.13829.41.camel@jlt4.sipsolutions.net>
>> + /* Data frames served first*/
>> + if (is_low) {
>> + /*
>> + * Sometimes in AP mode mac80211 is trying to send data
>> + * frame to nobody. Why?
>> + */
>> + if (!sta_priv)
>> + wcn36xx_warn("Sending data packet to nobody");
>
> Umm, really? Have you heard of something called multicast? ;-)
>
Do not know who wrote this code but this comment definitely must be removed!
--
Best regards,
Eugene
^ permalink raw reply
* Re: [PATCH 01/16] wcn36xx: Add main.c
From: Johannes Berg @ 2013-08-21 8:39 UTC (permalink / raw)
To: Eugene Krasnikov; +Cc: linux-wireless
In-Reply-To: <CAFSJ42ZH3ZJ+-+6wUbqQvaM8D2t6oWqyqkGiGRRx4o2NA60EjA@mail.gmail.com>
[remove wcn list, it annoys me with moderator messages]
> >> + if (IEEE80211_KEY_FLAG_PAIRWISE & key_conf->flags) {
> >> + sta_priv->is_data_encrypted = true;
> >> + /* Reconfigure bss with encrypt_type */
> >> + if (NL80211_IFTYPE_STATION == vif->type)
> >> + wcn36xx_smd_config_bss(wcn,
> >> + vif,
> >> + sta,
> >> + sta->addr,
> >> + true);
> >
> > It seems to me this should not be here but you should have mac80211 set
> > something in e.g. bss_conf that indicates encryption?
> >
>
> It's a good idea and I tried to find anything encryption related in
> bss_conf but without luck. I do not like this line myself so I would
> really appreciate if you can point where exactly in
> bss_conf/bss_info_changed information about encryption is located.
There isn't anything, but you could always add it.
> >> + static const u32 cipher_suites[] = {
> >> + WLAN_CIPHER_SUITE_TKIP,
> >> + WLAN_CIPHER_SUITE_CCMP,
> >> + };
> >
> > You actually don't want to support WEP, not even in software? Otherwise
> > just leave this out and mac80211 will add it.
>
> WEP is supported by HW but wcn36xx does not configure it yet. Is that
> ok to add HW WEP encryption in nearest future after wcn36xx is pushed
> to upstream?
I don't see why you'd even bother - why not just use software encryption
for WEP for the time being? Then you don't need this code.
> >> + wcn->hw->wiphy->iface_combinations = &if_comb;
> >> + wcn->hw->wiphy->n_iface_combinations = 1;
> >
> > Your code with "wcn->current_vif = " etc. *really* doesn't look like you
> > support combinations. Are you positive this is OK?
>
> So far wcn36xx supports only one interface at once. But in the nearest
> future it will definitely support more than one. So how about keeping
> this for future?;)
It's *wrong* though - you're saying two interfaces are supported and
then they aren't. Don't do that.
johannes
^ permalink raw reply
* Re: [PATCH 01/16] wcn36xx: Add main.c
From: Eugene Krasnikov @ 2013-08-21 8:36 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, wcn36xx
In-Reply-To: <1377032397.13829.40.camel@jlt4.sipsolutions.net>
> Just a cursory review ...
>
Any review is very welcome;)
>
>> + .cap = IEEE80211_HT_CAP_GRN_FLD
>> + | IEEE80211_HT_CAP_SGI_20
>
> wouldn't that usually be written as
>
> GRN_FLD |
> SGI_20 |
> ...
>
> (multiple similar places)
Will be fixed in the next round.
>> +#ifdef CONFIG_PM
>> +
>> +static const struct wiphy_wowlan_support wowlan_support = {
>> + .flags = WIPHY_WOWLAN_ANY,
>> + .n_patterns = 0,
>
> that n_patterns is pretty useless.
>
Will be removed in the next patch set.
>> +#define WCN36XX_SUPPORTED_FILTERS (0)
>> +
>> +static void wcn36xx_configure_filter(struct ieee80211_hw *hw,
>> + unsigned int changed,
>> + unsigned int *total, u64 multicast)
>> +{
>> + wcn36xx_dbg(WCN36XX_DBG_MAC, "mac configure filter");
>> +
>> + changed &= WCN36XX_SUPPORTED_FILTERS;
>
> That's pointless
Yes, it is better to remove wcn36xx_configure_filter completely for now.
>> + if (IEEE80211_KEY_FLAG_PAIRWISE & key_conf->flags) {
>> + sta_priv->is_data_encrypted = true;
>> + /* Reconfigure bss with encrypt_type */
>> + if (NL80211_IFTYPE_STATION == vif->type)
>> + wcn36xx_smd_config_bss(wcn,
>> + vif,
>> + sta,
>> + sta->addr,
>> + true);
>
> It seems to me this should not be here but you should have mac80211 set
> something in e.g. bss_conf that indicates encryption?
>
It's a good idea and I tried to find anything encryption related in
bss_conf but without luck. I do not like this line myself so I would
really appreciate if you can point where exactly in
bss_conf/bss_info_changed information about encryption is located.
>> + /* Not supported so far*/
>> + case IEEE80211_AMPDU_TX_STOP_CONT:
>> + ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
>> + break;
>> + case IEEE80211_AMPDU_TX_STOP_FLUSH:
>> + case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
>> + break;
>
> You can't just "not support" them - you have to at least stop the
> aggregation session, see the commit that introduced this.
>
Good point. Will fix this in the next round.
>> + static const u32 cipher_suites[] = {
>> + WLAN_CIPHER_SUITE_TKIP,
>> + WLAN_CIPHER_SUITE_CCMP,
>> + };
>
> You actually don't want to support WEP, not even in software? Otherwise
> just leave this out and mac80211 will add it.
WEP is supported by HW but wcn36xx does not configure it yet. Is that
ok to add HW WEP encryption in nearest future after wcn36xx is pushed
to upstream?
>> + wcn->hw->wiphy->iface_combinations = &if_comb;
>> + wcn->hw->wiphy->n_iface_combinations = 1;
>
> Your code with "wcn->current_vif = " etc. *really* doesn't look like you
> support combinations. Are you positive this is OK?
So far wcn36xx supports only one interface at once. But in the nearest
future it will definitely support more than one. So how about keeping
this for future?;)
>> + wcn->hw->wiphy->max_scan_ssids = 1;
>
> Really? You don't even have hardware scan, so why?
>
Good catch. wcn36xx used to have hw scan but now it is moved to sw
scan. Will remove this completely.
> johannes
>
--
Best regards,
Eugene
^ permalink raw reply
* [PATCH 3.11] iwl4965: fix rfkill set state regression
From: Stanislaw Gruszka @ 2013-08-21 8:18 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
My current 3.11 fix:
commit 788f7a56fce1bcb2067b62b851a086fca48a0056
Author: Stanislaw Gruszka <sgruszka@redhat.com>
Date: Thu Aug 1 12:07:55 2013 +0200
iwl4965: reset firmware after rfkill off
broke rfkill notification to user-space . I missed that bug, because
I compiled without CONFIG_RFKILL, sorry about that.
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/4965-mac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index f2ed62e..7acf5ee 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -4464,9 +4464,9 @@ il4965_irq_tasklet(struct il_priv *il)
set_bit(S_RFKILL, &il->status);
} else {
clear_bit(S_RFKILL, &il->status);
- wiphy_rfkill_set_hw_state(il->hw->wiphy, hw_rf_kill);
il_force_reset(il, true);
}
+ wiphy_rfkill_set_hw_state(il->hw->wiphy, hw_rf_kill);
handled |= CSR_INT_BIT_RF_KILL;
}
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH 09/16] wcn36xx: Add smd.c
From: Johannes Berg @ 2013-08-21 8:15 UTC (permalink / raw)
To: Eugene Krasnikov; +Cc: Joe Perches, linux-wireless, wcn36xx
In-Reply-To: <CAFSJ42ZMk6sN6povWHkSodk0J7pBvyak8sH-MqNXVhi_iSmq9Q@mail.gmail.com>
On Wed, 2013-08-21 at 09:58 +0200, Eugene Krasnikov wrote:
> 2013/8/20 Joe Perches <joe@perches.com>:
> > On Tue, 2013-08-20 at 19:41 +0200, Eugene Krasnikov wrote:
> >
> >> diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
> > []
> >> +int wcn36xx_smd_load_nv(struct wcn36xx *wcn)
> >> +{
> > []
> >> + /* Add NV body itself */
> >> + /* Rework me */
> >> + memcpy(wcn->smd_buf + sizeof(msg_body),
> >> + (void *)(&nv_d->table) + fm_offset,
> >> + msg_body.nv_img_buffer_size);
> >
> > Does this really do what you want?
> >
> > Perhaps it should be:
> >
> > memcpy(wcn->smd_buf + sizeof(msg_body),
> > ((void *)&nv_d->table) + fm_offset,
> > msg_body.nv_img_buffer_size);
> >
>
> Yes, this line is working. Tested it for ARM. Do you see any potential
> problems with this pointer operation?
It should really be u8* instead of void*, since void* pointer arithmetic
isn't really defined I think?
Other than that, this was just about precedence rules, and casts have a
higher precedence.
johannes
^ permalink raw reply
* Re: [PATCH 09/16] wcn36xx: Add smd.c
From: Eugene Krasnikov @ 2013-08-21 7:58 UTC (permalink / raw)
To: Joe Perches; +Cc: linux-wireless, wcn36xx
In-Reply-To: <1377022333.2016.59.camel@joe-AO722>
2013/8/20 Joe Perches <joe@perches.com>:
> On Tue, 2013-08-20 at 19:41 +0200, Eugene Krasnikov wrote:
>
>> diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
> []
>> +int wcn36xx_smd_load_nv(struct wcn36xx *wcn)
>> +{
> []
>> + /* Add NV body itself */
>> + /* Rework me */
>> + memcpy(wcn->smd_buf + sizeof(msg_body),
>> + (void *)(&nv_d->table) + fm_offset,
>> + msg_body.nv_img_buffer_size);
>
> Does this really do what you want?
>
> Perhaps it should be:
>
> memcpy(wcn->smd_buf + sizeof(msg_body),
> ((void *)&nv_d->table) + fm_offset,
> msg_body.nv_img_buffer_size);
>
Yes, this line is working. Tested it for ARM. Do you see any potential
problems with this pointer operation?
--
Best regards,
Eugene
^ permalink raw reply
* Re: [PATCH 13/16] wcn36xx: Add wcn36xx.h
From: Eugene Krasnikov @ 2013-08-21 7:55 UTC (permalink / raw)
To: Joe Perches; +Cc: linux-wireless, wcn36xx
In-Reply-To: <1377021890.2016.55.camel@joe-AO722>
Hi Joe,
Thank you very much for your comments.
Please find my comments bellow:
>> Adding wcn36xx.h
> []
>> +#define DRIVER_PREFIX "wcn36xx: "
> []
>
> I think you should use pr_fmt and/or netdev_<level>
Thanx, will add pr_fmt in the next round.
>> +#define wcn36xx_error(fmt, arg...) do { \
>> + pr_err(DRIVER_PREFIX "ERROR " fmt "\n", ##arg); \
>> + __WARN(); \
>> +} while (0)
>
> What value is there in this __WARN?
This warn is there just to scream louder every time when error happens:)
> Please use _err rather than _error
Thanx, will fix in the next patch set.
>> +#define wcn36xx_warn(fmt, arg...) \
>> + pr_warn(DRIVER_PREFIX "WARNING " fmt "\n", ##arg)
>> +
>> +#define wcn36xx_info(fmt, arg...) \
>> + pr_info(DRIVER_PREFIX fmt "\n", ##arg)
>> +
>> +#define wcn36xx_dbg(mask, fmt, arg...) do { \
>> + if (debug_mask & mask) \
>> + pr_debug(DRIVER_PREFIX fmt "\n", ##arg); \
>> +} while (0)
>> +
>> +#define wcn36xx_dbg_dump(mask, prefix_str, buf, len) do { \
>> + if (debug_mask & mask) \
>> + print_hex_dump(KERN_DEBUG, prefix_str, \
>> + DUMP_PREFIX_OFFSET, 32, 1, \
>> + buf, len, false); \
>> +} while (0)
>> +
>
> Please move the "\n" to the uses instead of the macro.
> This would be consistent with all the other ath macros.
Thanx, will fix in the next patch set.
--
Best regards,
Eugene
^ permalink raw reply
* [PATCH 6/6] ath10k: rename ce_ring_state to ath10k_ce_ring
From: Michal Kazior @ 2013-08-21 6:57 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Michal Kazior
In-Reply-To: <1377068249-26025-1-git-send-email-michal.kazior@tieto.com>
The new naming makes more sense.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/ce.c | 30 +++++++++++++++---------------
drivers/net/wireless/ath/ath10k/ce.h | 7 +++----
2 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
index 112897b..16be8c2 100644
--- a/drivers/net/wireless/ath/ath10k/ce.c
+++ b/drivers/net/wireless/ath/ath10k/ce.c
@@ -264,7 +264,7 @@ static int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state,
unsigned int flags)
{
struct ath10k *ar = ce_state->ar;
- struct ce_ring_state *src_ring = ce_state->src_ring;
+ struct ath10k_ce_ring *src_ring = ce_state->src_ring;
struct ce_desc *desc, *sdesc;
unsigned int nentries_mask = src_ring->nentries_mask;
unsigned int sw_index = src_ring->sw_index;
@@ -354,7 +354,7 @@ int ath10k_ce_sendlist_send(struct ath10k_ce_pipe *ce_state,
struct ce_sendlist *sendlist,
unsigned int transfer_id)
{
- struct ce_ring_state *src_ring = ce_state->src_ring;
+ struct ath10k_ce_ring *src_ring = ce_state->src_ring;
struct ce_sendlist_item *item;
struct ath10k *ar = ce_state->ar;
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
@@ -406,7 +406,7 @@ int ath10k_ce_recv_buf_enqueue(struct ath10k_ce_pipe *ce_state,
void *per_recv_context,
u32 buffer)
{
- struct ce_ring_state *dest_ring = ce_state->dest_ring;
+ struct ath10k_ce_ring *dest_ring = ce_state->dest_ring;
u32 ctrl_addr = ce_state->ctrl_addr;
struct ath10k *ar = ce_state->ar;
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
@@ -457,7 +457,7 @@ static int ath10k_ce_completed_recv_next_nolock(struct ath10k_ce_pipe *ce_state,
unsigned int *transfer_idp,
unsigned int *flagsp)
{
- struct ce_ring_state *dest_ring = ce_state->dest_ring;
+ struct ath10k_ce_ring *dest_ring = ce_state->dest_ring;
unsigned int nentries_mask = dest_ring->nentries_mask;
unsigned int sw_index = dest_ring->sw_index;
@@ -531,7 +531,7 @@ int ath10k_ce_revoke_recv_next(struct ath10k_ce_pipe *ce_state,
void **per_transfer_contextp,
u32 *bufferp)
{
- struct ce_ring_state *dest_ring;
+ struct ath10k_ce_ring *dest_ring;
unsigned int nentries_mask;
unsigned int sw_index;
unsigned int write_index;
@@ -589,7 +589,7 @@ static int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
unsigned int *nbytesp,
unsigned int *transfer_idp)
{
- struct ce_ring_state *src_ring = ce_state->src_ring;
+ struct ath10k_ce_ring *src_ring = ce_state->src_ring;
u32 ctrl_addr = ce_state->ctrl_addr;
struct ath10k *ar = ce_state->ar;
unsigned int nentries_mask = src_ring->nentries_mask;
@@ -646,7 +646,7 @@ int ath10k_ce_cancel_send_next(struct ath10k_ce_pipe *ce_state,
unsigned int *nbytesp,
unsigned int *transfer_idp)
{
- struct ce_ring_state *src_ring;
+ struct ath10k_ce_ring *src_ring;
unsigned int nentries_mask;
unsigned int sw_index;
unsigned int write_index;
@@ -894,7 +894,7 @@ static int ath10k_ce_init_src_ring(struct ath10k *ar,
const struct ce_attr *attr)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct ce_ring_state *src_ring;
+ struct ath10k_ce_ring *src_ring;
unsigned int nentries = attr->src_nentries;
unsigned int ce_nbytes;
u32 ctrl_addr = ath10k_ce_base_address(ce_id);
@@ -908,15 +908,15 @@ static int ath10k_ce_init_src_ring(struct ath10k *ar,
return 0;
}
- ce_nbytes = sizeof(struct ce_ring_state) + (nentries * sizeof(void *));
+ ce_nbytes = sizeof(struct ath10k_ce_ring) + (nentries * sizeof(void *));
ptr = kzalloc(ce_nbytes, GFP_KERNEL);
if (ptr == NULL)
return -ENOMEM;
- ce_state->src_ring = (struct ce_ring_state *)ptr;
+ ce_state->src_ring = (struct ath10k_ce_ring *)ptr;
src_ring = ce_state->src_ring;
- ptr += sizeof(struct ce_ring_state);
+ ptr += sizeof(struct ath10k_ce_ring);
src_ring->nentries = nentries;
src_ring->nentries_mask = nentries - 1;
@@ -997,7 +997,7 @@ static int ath10k_ce_init_dest_ring(struct ath10k *ar,
const struct ce_attr *attr)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct ce_ring_state *dest_ring;
+ struct ath10k_ce_ring *dest_ring;
unsigned int nentries = attr->dest_nentries;
unsigned int ce_nbytes;
u32 ctrl_addr = ath10k_ce_base_address(ce_id);
@@ -1011,15 +1011,15 @@ static int ath10k_ce_init_dest_ring(struct ath10k *ar,
return 0;
}
- ce_nbytes = sizeof(struct ce_ring_state) + (nentries * sizeof(void *));
+ ce_nbytes = sizeof(struct ath10k_ce_ring) + (nentries * sizeof(void *));
ptr = kzalloc(ce_nbytes, GFP_KERNEL);
if (ptr == NULL)
return -ENOMEM;
- ce_state->dest_ring = (struct ce_ring_state *)ptr;
+ ce_state->dest_ring = (struct ath10k_ce_ring *)ptr;
dest_ring = ce_state->dest_ring;
- ptr += sizeof(struct ce_ring_state);
+ ptr += sizeof(struct ath10k_ce_ring);
dest_ring->nentries = nentries;
dest_ring->nentries_mask = nentries - 1;
diff --git a/drivers/net/wireless/ath/ath10k/ce.h b/drivers/net/wireless/ath/ath10k/ce.h
index 1267b49..0ccf235 100644
--- a/drivers/net/wireless/ath/ath10k/ce.h
+++ b/drivers/net/wireless/ath/ath10k/ce.h
@@ -50,8 +50,7 @@ struct ce_desc {
__le16 flags; /* %CE_DESC_FLAGS_ */
};
-/* Copy Engine Ring internal state */
-struct ce_ring_state {
+struct ath10k_ce_ring {
/* Number of entries in this ring; must be power of 2 */
unsigned int nentries;
unsigned int nentries_mask;
@@ -130,8 +129,8 @@ struct ath10k_ce_pipe {
unsigned int flags);
unsigned int src_sz_max;
- struct ce_ring_state *src_ring;
- struct ce_ring_state *dest_ring;
+ struct ath10k_ce_ring *src_ring;
+ struct ath10k_ce_ring *dest_ring;
};
struct ce_sendlist_item {
--
1.7.9.5
^ permalink raw reply related
* [PATCH 4/6] ath10k: rename hif_ce_pipe_info to ath10k_pci_pipe
From: Michal Kazior @ 2013-08-21 6:57 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Michal Kazior
In-Reply-To: <1377068249-26025-1-git-send-email-michal.kazior@tieto.com>
The new naming makes more sense.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/pci.c | 34 ++++++++++++++++-----------------
drivers/net/wireless/ath/ath10k/pci.h | 6 +++---
2 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 80cc7fd..b740960 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -48,9 +48,9 @@ static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address,
static void ath10k_pci_process_ce(struct ath10k *ar);
static int ath10k_pci_post_rx(struct ath10k *ar);
-static int ath10k_pci_post_rx_pipe(struct hif_ce_pipe_info *pipe_info,
+static int ath10k_pci_post_rx_pipe(struct ath10k_pci_pipe *pipe_info,
int num);
-static void ath10k_pci_rx_pipe_cleanup(struct hif_ce_pipe_info *pipe_info);
+static void ath10k_pci_rx_pipe_cleanup(struct ath10k_pci_pipe *pipe_info);
static void ath10k_pci_stop_ce(struct ath10k *ar);
static void ath10k_pci_device_reset(struct ath10k *ar);
static int ath10k_pci_reset_target(struct ath10k *ar);
@@ -491,7 +491,7 @@ void ath10k_do_pci_sleep(struct ath10k *ar)
* FIXME: Handle OOM properly.
*/
static inline
-struct ath10k_pci_compl *get_free_compl(struct hif_ce_pipe_info *pipe_info)
+struct ath10k_pci_compl *get_free_compl(struct ath10k_pci_pipe *pipe_info)
{
struct ath10k_pci_compl *compl = NULL;
@@ -517,7 +517,7 @@ static void ath10k_pci_ce_send_done(struct ce_state *ce_state,
{
struct ath10k *ar = ce_state->ar;
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct hif_ce_pipe_info *pipe_info = &ar_pci->pipe_info[ce_state->id];
+ struct ath10k_pci_pipe *pipe_info = &ar_pci->pipe_info[ce_state->id];
struct ath10k_pci_compl *compl;
bool process = false;
@@ -579,7 +579,7 @@ static void ath10k_pci_ce_recv_data(struct ce_state *ce_state,
{
struct ath10k *ar = ce_state->ar;
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct hif_ce_pipe_info *pipe_info = &ar_pci->pipe_info[ce_state->id];
+ struct ath10k_pci_pipe *pipe_info = &ar_pci->pipe_info[ce_state->id];
struct ath10k_pci_compl *compl;
struct sk_buff *skb;
@@ -623,7 +623,7 @@ static int ath10k_pci_hif_send_head(struct ath10k *ar, u8 pipe_id,
{
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(nbuf);
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct hif_ce_pipe_info *pipe_info = &(ar_pci->pipe_info[pipe_id]);
+ struct ath10k_pci_pipe *pipe_info = &(ar_pci->pipe_info[pipe_id]);
struct ce_state *ce_hdl = pipe_info->ce_hdl;
struct ce_sendlist sendlist;
unsigned int len;
@@ -668,7 +668,7 @@ static int ath10k_pci_hif_send_head(struct ath10k *ar, u8 pipe_id,
static u16 ath10k_pci_hif_get_free_queue_number(struct ath10k *ar, u8 pipe)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct hif_ce_pipe_info *pipe_info = &(ar_pci->pipe_info[pipe]);
+ struct ath10k_pci_pipe *pipe_info = &(ar_pci->pipe_info[pipe]);
int ret;
spin_lock_bh(&pipe_info->pipe_lock);
@@ -764,7 +764,7 @@ static int ath10k_pci_start_ce(struct ath10k *ar)
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
struct ce_state *ce_diag = ar_pci->ce_diag;
const struct ce_attr *attr;
- struct hif_ce_pipe_info *pipe_info;
+ struct ath10k_pci_pipe *pipe_info;
struct ath10k_pci_compl *compl;
int i, pipe_num, completions, disable_interrupts;
@@ -847,7 +847,7 @@ static void ath10k_pci_cleanup_ce(struct ath10k *ar)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
struct ath10k_pci_compl *compl, *tmp;
- struct hif_ce_pipe_info *pipe_info;
+ struct ath10k_pci_pipe *pipe_info;
struct sk_buff *netbuf;
int pipe_num;
@@ -1044,7 +1044,7 @@ static void ath10k_pci_hif_get_default_pipe(struct ath10k *ar,
&dl_is_polled);
}
-static int ath10k_pci_post_rx_pipe(struct hif_ce_pipe_info *pipe_info,
+static int ath10k_pci_post_rx_pipe(struct ath10k_pci_pipe *pipe_info,
int num)
{
struct ath10k *ar = pipe_info->hif_ce_state;
@@ -1104,7 +1104,7 @@ err:
static int ath10k_pci_post_rx(struct ath10k *ar)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct hif_ce_pipe_info *pipe_info;
+ struct ath10k_pci_pipe *pipe_info;
const struct ce_attr *attr;
int pipe_num, ret = 0;
@@ -1154,7 +1154,7 @@ static int ath10k_pci_hif_start(struct ath10k *ar)
return 0;
}
-static void ath10k_pci_rx_pipe_cleanup(struct hif_ce_pipe_info *pipe_info)
+static void ath10k_pci_rx_pipe_cleanup(struct ath10k_pci_pipe *pipe_info)
{
struct ath10k *ar;
struct ath10k_pci *ar_pci;
@@ -1186,7 +1186,7 @@ static void ath10k_pci_rx_pipe_cleanup(struct hif_ce_pipe_info *pipe_info)
}
}
-static void ath10k_pci_tx_pipe_cleanup(struct hif_ce_pipe_info *pipe_info)
+static void ath10k_pci_tx_pipe_cleanup(struct ath10k_pci_pipe *pipe_info)
{
struct ath10k *ar;
struct ath10k_pci *ar_pci;
@@ -1239,7 +1239,7 @@ static void ath10k_pci_buffer_cleanup(struct ath10k *ar)
int pipe_num;
for (pipe_num = 0; pipe_num < ar_pci->ce_count; pipe_num++) {
- struct hif_ce_pipe_info *pipe_info;
+ struct ath10k_pci_pipe *pipe_info;
pipe_info = &ar_pci->pipe_info[pipe_num];
ath10k_pci_rx_pipe_cleanup(pipe_info);
@@ -1250,7 +1250,7 @@ static void ath10k_pci_buffer_cleanup(struct ath10k *ar)
static void ath10k_pci_ce_deinit(struct ath10k *ar)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct hif_ce_pipe_info *pipe_info;
+ struct ath10k_pci_pipe *pipe_info;
int pipe_num;
for (pipe_num = 0; pipe_num < ar_pci->ce_count; pipe_num++) {
@@ -1686,7 +1686,7 @@ static int ath10k_pci_init_config(struct ath10k *ar)
static int ath10k_pci_ce_init(struct ath10k *ar)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct hif_ce_pipe_info *pipe_info;
+ struct ath10k_pci_pipe *pipe_info;
const struct ce_attr *attr;
int pipe_num;
@@ -1902,7 +1902,7 @@ static const struct ath10k_hif_ops ath10k_pci_hif_ops = {
static void ath10k_pci_ce_tasklet(unsigned long ptr)
{
- struct hif_ce_pipe_info *pipe = (struct hif_ce_pipe_info *)ptr;
+ struct ath10k_pci_pipe *pipe = (struct ath10k_pci_pipe *)ptr;
struct ath10k_pci *ar_pci = pipe->ar_pci;
ath10k_ce_per_engine_service(ar_pci->ar, pipe->pipe_num);
diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index 64fcef5..de26311 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -53,7 +53,7 @@ struct ath10k_pci_compl {
struct list_head list;
enum ath10k_pci_compl_state state;
struct ce_state *ce_state;
- struct hif_ce_pipe_info *pipe_info;
+ struct ath10k_pci_pipe *pipe_info;
void *transfer_context;
unsigned int nbytes;
unsigned int transfer_id;
@@ -160,7 +160,7 @@ enum ath10k_pci_features {
};
/* Per-pipe state. */
-struct hif_ce_pipe_info {
+struct ath10k_pci_pipe {
/* Handle of underlying Copy Engine */
struct ce_state *ce_hdl;
@@ -219,7 +219,7 @@ struct ath10k_pci {
bool compl_processing;
- struct hif_ce_pipe_info pipe_info[CE_COUNT_MAX];
+ struct ath10k_pci_pipe pipe_info[CE_COUNT_MAX];
struct ath10k_hif_cb msg_callbacks_current;
--
1.7.9.5
^ permalink raw reply related
* [PATCH 2/6] ath10k: remove ce_op_state
From: Michal Kazior @ 2013-08-21 6:57 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Michal Kazior
In-Reply-To: <1377068249-26025-1-git-send-email-michal.kazior@tieto.com>
It was only written to and never read back. No use
to keep it around.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/ce.c | 2 --
drivers/net/wireless/ath/ath10k/ce.h | 8 --------
2 files changed, 10 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
index c8b7d21..c391f46 100644
--- a/drivers/net/wireless/ath/ath10k/ce.c
+++ b/drivers/net/wireless/ath/ath10k/ce.c
@@ -1089,7 +1089,6 @@ static struct ce_state *ath10k_ce_init_state(struct ath10k *ar,
ce_state->ar = ar;
ce_state->id = ce_id;
ce_state->ctrl_addr = ctrl_addr;
- ce_state->state = CE_RUNNING;
ce_state->attr_flags = attr->flags;
ce_state->src_sz_max = attr->src_sz_max;
@@ -1173,7 +1172,6 @@ void ath10k_ce_deinit(struct ce_state *ce_state)
kfree(ce_state->dest_ring);
}
- ce_state->state = CE_UNUSED;
ce_state->src_ring = NULL;
ce_state->dest_ring = NULL;
}
diff --git a/drivers/net/wireless/ath/ath10k/ce.h b/drivers/net/wireless/ath/ath10k/ce.h
index c17f07c..6f6bca0 100644
--- a/drivers/net/wireless/ath/ath10k/ce.h
+++ b/drivers/net/wireless/ath/ath10k/ce.h
@@ -39,13 +39,6 @@
struct ce_state;
-/* Copy Engine operational state */
-enum ce_op_state {
- CE_UNUSED,
- CE_PAUSED,
- CE_RUNNING,
-};
-
#define CE_DESC_FLAGS_GATHER (1 << 0)
#define CE_DESC_FLAGS_BYTE_SWAP (1 << 1)
#define CE_DESC_FLAGS_META_DATA_MASK 0xFFFC
@@ -124,7 +117,6 @@ struct ce_state {
unsigned int attr_flags;
u32 ctrl_addr;
- enum ce_op_state state;
void (*send_cb) (struct ce_state *ce_state,
void *per_transfer_send_context,
--
1.7.9.5
^ permalink raw reply related
* [PATCH 5/6] ath10k: rename ce_state to ath10k_ce_pipe
From: Michal Kazior @ 2013-08-21 6:57 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Michal Kazior
In-Reply-To: <1377068249-26025-1-git-send-email-michal.kazior@tieto.com>
The new naming makes more sense.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/ce.c | 48 ++++++++++++++++-----------------
drivers/net/wireless/ath/ath10k/ce.h | 35 ++++++++++++------------
drivers/net/wireless/ath/ath10k/pci.c | 26 +++++++++---------
drivers/net/wireless/ath/ath10k/pci.h | 8 +++---
4 files changed, 58 insertions(+), 59 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
index c391f46..112897b 100644
--- a/drivers/net/wireless/ath/ath10k/ce.c
+++ b/drivers/net/wireless/ath/ath10k/ce.c
@@ -256,7 +256,7 @@ static inline void ath10k_ce_engine_int_status_clear(struct ath10k *ar,
* ath10k_ce_sendlist_send.
* The caller takes responsibility for any needed locking.
*/
-static int ath10k_ce_send_nolock(struct ce_state *ce_state,
+static int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state,
void *per_transfer_context,
u32 buffer,
unsigned int nbytes,
@@ -317,7 +317,7 @@ exit:
return ret;
}
-int ath10k_ce_send(struct ce_state *ce_state,
+int ath10k_ce_send(struct ath10k_ce_pipe *ce_state,
void *per_transfer_context,
u32 buffer,
unsigned int nbytes,
@@ -349,7 +349,7 @@ void ath10k_ce_sendlist_buf_add(struct ce_sendlist *sendlist, u32 buffer,
sendlist->num_items++;
}
-int ath10k_ce_sendlist_send(struct ce_state *ce_state,
+int ath10k_ce_sendlist_send(struct ath10k_ce_pipe *ce_state,
void *per_transfer_context,
struct ce_sendlist *sendlist,
unsigned int transfer_id)
@@ -402,7 +402,7 @@ int ath10k_ce_sendlist_send(struct ce_state *ce_state,
return ret;
}
-int ath10k_ce_recv_buf_enqueue(struct ce_state *ce_state,
+int ath10k_ce_recv_buf_enqueue(struct ath10k_ce_pipe *ce_state,
void *per_recv_context,
u32 buffer)
{
@@ -450,7 +450,7 @@ int ath10k_ce_recv_buf_enqueue(struct ce_state *ce_state,
* Guts of ath10k_ce_completed_recv_next.
* The caller takes responsibility for any necessary locking.
*/
-static int ath10k_ce_completed_recv_next_nolock(struct ce_state *ce_state,
+static int ath10k_ce_completed_recv_next_nolock(struct ath10k_ce_pipe *ce_state,
void **per_transfer_contextp,
u32 *bufferp,
unsigned int *nbytesp,
@@ -506,7 +506,7 @@ static int ath10k_ce_completed_recv_next_nolock(struct ce_state *ce_state,
return 0;
}
-int ath10k_ce_completed_recv_next(struct ce_state *ce_state,
+int ath10k_ce_completed_recv_next(struct ath10k_ce_pipe *ce_state,
void **per_transfer_contextp,
u32 *bufferp,
unsigned int *nbytesp,
@@ -527,7 +527,7 @@ int ath10k_ce_completed_recv_next(struct ce_state *ce_state,
return ret;
}
-int ath10k_ce_revoke_recv_next(struct ce_state *ce_state,
+int ath10k_ce_revoke_recv_next(struct ath10k_ce_pipe *ce_state,
void **per_transfer_contextp,
u32 *bufferp)
{
@@ -583,7 +583,7 @@ int ath10k_ce_revoke_recv_next(struct ce_state *ce_state,
* Guts of ath10k_ce_completed_send_next.
* The caller takes responsibility for any necessary locking.
*/
-static int ath10k_ce_completed_send_next_nolock(struct ce_state *ce_state,
+static int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
void **per_transfer_contextp,
u32 *bufferp,
unsigned int *nbytesp,
@@ -640,7 +640,7 @@ static int ath10k_ce_completed_send_next_nolock(struct ce_state *ce_state,
}
/* NB: Modeled after ath10k_ce_completed_send_next */
-int ath10k_ce_cancel_send_next(struct ce_state *ce_state,
+int ath10k_ce_cancel_send_next(struct ath10k_ce_pipe *ce_state,
void **per_transfer_contextp,
u32 *bufferp,
unsigned int *nbytesp,
@@ -698,7 +698,7 @@ int ath10k_ce_cancel_send_next(struct ce_state *ce_state,
return ret;
}
-int ath10k_ce_completed_send_next(struct ce_state *ce_state,
+int ath10k_ce_completed_send_next(struct ath10k_ce_pipe *ce_state,
void **per_transfer_contextp,
u32 *bufferp,
unsigned int *nbytesp,
@@ -727,7 +727,7 @@ int ath10k_ce_completed_send_next(struct ce_state *ce_state,
void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct ce_state *ce_state = &ar_pci->ce_states[ce_id];
+ struct ath10k_ce_pipe *ce_state = &ar_pci->ce_states[ce_id];
u32 ctrl_addr = ce_state->ctrl_addr;
void *transfer_context;
u32 buf;
@@ -820,7 +820,7 @@ void ath10k_ce_per_engine_service_any(struct ath10k *ar)
*
* Called with ce_lock held.
*/
-static void ath10k_ce_per_engine_handler_adjust(struct ce_state *ce_state,
+static void ath10k_ce_per_engine_handler_adjust(struct ath10k_ce_pipe *ce_state,
int disable_copy_compl_intr)
{
u32 ctrl_addr = ce_state->ctrl_addr;
@@ -846,7 +846,7 @@ void ath10k_ce_disable_interrupts(struct ath10k *ar)
ath10k_pci_wake(ar);
for (ce_id = 0; ce_id < ar_pci->ce_count; ce_id++) {
- struct ce_state *ce_state = &ar_pci->ce_states[ce_id];
+ struct ath10k_ce_pipe *ce_state = &ar_pci->ce_states[ce_id];
u32 ctrl_addr = ce_state->ctrl_addr;
ath10k_ce_copy_complete_intr_disable(ar, ctrl_addr);
@@ -854,8 +854,8 @@ void ath10k_ce_disable_interrupts(struct ath10k *ar)
ath10k_pci_sleep(ar);
}
-void ath10k_ce_send_cb_register(struct ce_state *ce_state,
- void (*send_cb) (struct ce_state *ce_state,
+void ath10k_ce_send_cb_register(struct ath10k_ce_pipe *ce_state,
+ void (*send_cb) (struct ath10k_ce_pipe *ce_state,
void *transfer_context,
u32 buffer,
unsigned int nbytes,
@@ -871,8 +871,8 @@ void ath10k_ce_send_cb_register(struct ce_state *ce_state,
spin_unlock_bh(&ar_pci->ce_lock);
}
-void ath10k_ce_recv_cb_register(struct ce_state *ce_state,
- void (*recv_cb) (struct ce_state *ce_state,
+void ath10k_ce_recv_cb_register(struct ath10k_ce_pipe *ce_state,
+ void (*recv_cb) (struct ath10k_ce_pipe *ce_state,
void *transfer_context,
u32 buffer,
unsigned int nbytes,
@@ -890,7 +890,7 @@ void ath10k_ce_recv_cb_register(struct ce_state *ce_state,
static int ath10k_ce_init_src_ring(struct ath10k *ar,
unsigned int ce_id,
- struct ce_state *ce_state,
+ struct ath10k_ce_pipe *ce_state,
const struct ce_attr *attr)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
@@ -993,7 +993,7 @@ static int ath10k_ce_init_src_ring(struct ath10k *ar,
static int ath10k_ce_init_dest_ring(struct ath10k *ar,
unsigned int ce_id,
- struct ce_state *ce_state,
+ struct ath10k_ce_pipe *ce_state,
const struct ce_attr *attr)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
@@ -1076,12 +1076,12 @@ static int ath10k_ce_init_dest_ring(struct ath10k *ar,
return 0;
}
-static struct ce_state *ath10k_ce_init_state(struct ath10k *ar,
+static struct ath10k_ce_pipe *ath10k_ce_init_state(struct ath10k *ar,
unsigned int ce_id,
const struct ce_attr *attr)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct ce_state *ce_state = &ar_pci->ce_states[ce_id];
+ struct ath10k_ce_pipe *ce_state = &ar_pci->ce_states[ce_id];
u32 ctrl_addr = ath10k_ce_base_address(ce_id);
spin_lock_bh(&ar_pci->ce_lock);
@@ -1104,11 +1104,11 @@ static struct ce_state *ath10k_ce_init_state(struct ath10k *ar,
* initialization. It may be that only one side or the other is
* initialized by software/firmware.
*/
-struct ce_state *ath10k_ce_init(struct ath10k *ar,
+struct ath10k_ce_pipe *ath10k_ce_init(struct ath10k *ar,
unsigned int ce_id,
const struct ce_attr *attr)
{
- struct ce_state *ce_state;
+ struct ath10k_ce_pipe *ce_state;
u32 ctrl_addr = ath10k_ce_base_address(ce_id);
int ret;
@@ -1146,7 +1146,7 @@ struct ce_state *ath10k_ce_init(struct ath10k *ar,
return ce_state;
}
-void ath10k_ce_deinit(struct ce_state *ce_state)
+void ath10k_ce_deinit(struct ath10k_ce_pipe *ce_state)
{
struct ath10k *ar = ce_state->ar;
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
diff --git a/drivers/net/wireless/ath/ath10k/ce.h b/drivers/net/wireless/ath/ath10k/ce.h
index ce4cbbf..1267b49 100644
--- a/drivers/net/wireless/ath/ath10k/ce.h
+++ b/drivers/net/wireless/ath/ath10k/ce.h
@@ -36,7 +36,7 @@
* how to use copy engines.
*/
-struct ce_state;
+struct ath10k_ce_pipe;
#define CE_DESC_FLAGS_GATHER (1 << 0)
@@ -109,8 +109,7 @@ struct ce_ring_state {
void **per_transfer_context;
};
-/* Copy Engine internal state */
-struct ce_state {
+struct ath10k_ce_pipe {
struct ath10k *ar;
unsigned int id;
@@ -118,12 +117,12 @@ struct ce_state {
u32 ctrl_addr;
- void (*send_cb) (struct ce_state *ce_state,
+ void (*send_cb) (struct ath10k_ce_pipe *ce_state,
void *per_transfer_send_context,
u32 buffer,
unsigned int nbytes,
unsigned int transfer_id);
- void (*recv_cb) (struct ce_state *ce_state,
+ void (*recv_cb) (struct ath10k_ce_pipe *ce_state,
void *per_transfer_recv_context,
u32 buffer,
unsigned int nbytes,
@@ -174,7 +173,7 @@ struct ce_attr;
*
* Implementation note: pushes 1 buffer to Source ring
*/
-int ath10k_ce_send(struct ce_state *ce_state,
+int ath10k_ce_send(struct ath10k_ce_pipe *ce_state,
void *per_transfer_send_context,
u32 buffer,
unsigned int nbytes,
@@ -182,8 +181,8 @@ int ath10k_ce_send(struct ce_state *ce_state,
unsigned int transfer_id,
unsigned int flags);
-void ath10k_ce_send_cb_register(struct ce_state *ce_state,
- void (*send_cb) (struct ce_state *ce_state,
+void ath10k_ce_send_cb_register(struct ath10k_ce_pipe *ce_state,
+ void (*send_cb) (struct ath10k_ce_pipe *ce_state,
void *transfer_context,
u32 buffer,
unsigned int nbytes,
@@ -207,7 +206,7 @@ void ath10k_ce_sendlist_buf_add(struct ce_sendlist *sendlist,
*
* Implemenation note: Pushes multiple buffers with Gather to Source ring.
*/
-int ath10k_ce_sendlist_send(struct ce_state *ce_state,
+int ath10k_ce_sendlist_send(struct ath10k_ce_pipe *ce_state,
void *per_transfer_send_context,
struct ce_sendlist *sendlist,
/* 14 bits */
@@ -225,12 +224,12 @@ int ath10k_ce_sendlist_send(struct ce_state *ce_state,
*
* Implemenation note: Pushes a buffer to Dest ring.
*/
-int ath10k_ce_recv_buf_enqueue(struct ce_state *ce_state,
+int ath10k_ce_recv_buf_enqueue(struct ath10k_ce_pipe *ce_state,
void *per_transfer_recv_context,
u32 buffer);
-void ath10k_ce_recv_cb_register(struct ce_state *ce_state,
- void (*recv_cb) (struct ce_state *ce_state,
+void ath10k_ce_recv_cb_register(struct ath10k_ce_pipe *ce_state,
+ void (*recv_cb) (struct ath10k_ce_pipe *ce_state,
void *transfer_context,
u32 buffer,
unsigned int nbytes,
@@ -245,7 +244,7 @@ void ath10k_ce_recv_cb_register(struct ce_state *ce_state,
* Supply data for the next completed unprocessed receive descriptor.
* Pops buffer from Dest ring.
*/
-int ath10k_ce_completed_recv_next(struct ce_state *ce_state,
+int ath10k_ce_completed_recv_next(struct ath10k_ce_pipe *ce_state,
void **per_transfer_contextp,
u32 *bufferp,
unsigned int *nbytesp,
@@ -255,7 +254,7 @@ int ath10k_ce_completed_recv_next(struct ce_state *ce_state,
* Supply data for the next completed unprocessed send descriptor.
* Pops 1 completed send buffer from Source ring.
*/
-int ath10k_ce_completed_send_next(struct ce_state *ce_state,
+int ath10k_ce_completed_send_next(struct ath10k_ce_pipe *ce_state,
void **per_transfer_contextp,
u32 *bufferp,
unsigned int *nbytesp,
@@ -264,7 +263,7 @@ int ath10k_ce_completed_send_next(struct ce_state *ce_state,
/*==================CE Engine Initialization=======================*/
/* Initialize an instance of a CE */
-struct ce_state *ath10k_ce_init(struct ath10k *ar,
+struct ath10k_ce_pipe *ath10k_ce_init(struct ath10k *ar,
unsigned int ce_id,
const struct ce_attr *attr);
@@ -274,7 +273,7 @@ struct ce_state *ath10k_ce_init(struct ath10k *ar,
* receive buffers. Target DMA must be stopped before using
* this API.
*/
-int ath10k_ce_revoke_recv_next(struct ce_state *ce_state,
+int ath10k_ce_revoke_recv_next(struct ath10k_ce_pipe *ce_state,
void **per_transfer_contextp,
u32 *bufferp);
@@ -283,13 +282,13 @@ int ath10k_ce_revoke_recv_next(struct ce_state *ce_state,
* pending sends. Target DMA must be stopped before using
* this API.
*/
-int ath10k_ce_cancel_send_next(struct ce_state *ce_state,
+int ath10k_ce_cancel_send_next(struct ath10k_ce_pipe *ce_state,
void **per_transfer_contextp,
u32 *bufferp,
unsigned int *nbytesp,
unsigned int *transfer_idp);
-void ath10k_ce_deinit(struct ce_state *ce_state);
+void ath10k_ce_deinit(struct ath10k_ce_pipe *ce_state);
/*==================CE Interrupt Handlers====================*/
void ath10k_ce_per_engine_service_any(struct ath10k *ar);
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index b740960..e29213b 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -112,7 +112,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
unsigned int completed_nbytes, orig_nbytes, remaining_bytes;
unsigned int id;
unsigned int flags;
- struct ce_state *ce_diag;
+ struct ath10k_ce_pipe *ce_diag;
/* Host buffer address in CE space */
u32 ce_data;
dma_addr_t ce_data_base = 0;
@@ -276,7 +276,7 @@ static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
unsigned int completed_nbytes, orig_nbytes, remaining_bytes;
unsigned int id;
unsigned int flags;
- struct ce_state *ce_diag;
+ struct ath10k_ce_pipe *ce_diag;
void *data_buf = NULL;
u32 ce_data; /* Host buffer address in CE space */
dma_addr_t ce_data_base = 0;
@@ -509,7 +509,7 @@ exit:
}
/* Called by lower (CE) layer when a send to Target completes. */
-static void ath10k_pci_ce_send_done(struct ce_state *ce_state,
+static void ath10k_pci_ce_send_done(struct ath10k_ce_pipe *ce_state,
void *transfer_context,
u32 ce_data,
unsigned int nbytes,
@@ -571,7 +571,7 @@ static void ath10k_pci_ce_send_done(struct ce_state *ce_state,
}
/* Called by lower (CE) layer when data is received from the Target. */
-static void ath10k_pci_ce_recv_data(struct ce_state *ce_state,
+static void ath10k_pci_ce_recv_data(struct ath10k_ce_pipe *ce_state,
void *transfer_context, u32 ce_data,
unsigned int nbytes,
unsigned int transfer_id,
@@ -624,7 +624,7 @@ static int ath10k_pci_hif_send_head(struct ath10k *ar, u8 pipe_id,
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(nbuf);
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
struct ath10k_pci_pipe *pipe_info = &(ar_pci->pipe_info[pipe_id]);
- struct ce_state *ce_hdl = pipe_info->ce_hdl;
+ struct ath10k_ce_pipe *ce_hdl = pipe_info->ce_hdl;
struct ce_sendlist sendlist;
unsigned int len;
u32 flags = 0;
@@ -762,7 +762,7 @@ static void ath10k_pci_hif_set_callbacks(struct ath10k *ar,
static int ath10k_pci_start_ce(struct ath10k *ar)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct ce_state *ce_diag = ar_pci->ce_diag;
+ struct ath10k_ce_pipe *ce_diag = ar_pci->ce_diag;
const struct ce_attr *attr;
struct ath10k_pci_pipe *pipe_info;
struct ath10k_pci_compl *compl;
@@ -1049,7 +1049,7 @@ static int ath10k_pci_post_rx_pipe(struct ath10k_pci_pipe *pipe_info,
{
struct ath10k *ar = pipe_info->hif_ce_state;
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct ce_state *ce_state = pipe_info->ce_hdl;
+ struct ath10k_ce_pipe *ce_state = pipe_info->ce_hdl;
struct sk_buff *skb;
dma_addr_t ce_data;
int i, ret = 0;
@@ -1158,7 +1158,7 @@ static void ath10k_pci_rx_pipe_cleanup(struct ath10k_pci_pipe *pipe_info)
{
struct ath10k *ar;
struct ath10k_pci *ar_pci;
- struct ce_state *ce_hdl;
+ struct ath10k_ce_pipe *ce_hdl;
u32 buf_sz;
struct sk_buff *netbuf;
u32 ce_data;
@@ -1190,7 +1190,7 @@ static void ath10k_pci_tx_pipe_cleanup(struct ath10k_pci_pipe *pipe_info)
{
struct ath10k *ar;
struct ath10k_pci *ar_pci;
- struct ce_state *ce_hdl;
+ struct ath10k_ce_pipe *ce_hdl;
struct sk_buff *netbuf;
u32 ce_data;
unsigned int nbytes;
@@ -1300,8 +1300,8 @@ static int ath10k_pci_hif_exchange_bmi_msg(struct ath10k *ar,
void *resp, u32 *resp_len)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct ce_state *ce_tx = ar_pci->pipe_info[BMI_CE_NUM_TO_TARG].ce_hdl;
- struct ce_state *ce_rx = ar_pci->pipe_info[BMI_CE_NUM_TO_HOST].ce_hdl;
+ struct ath10k_ce_pipe *ce_tx = ar_pci->pipe_info[BMI_CE_NUM_TO_TARG].ce_hdl;
+ struct ath10k_ce_pipe *ce_rx = ar_pci->pipe_info[BMI_CE_NUM_TO_HOST].ce_hdl;
dma_addr_t req_paddr = 0;
dma_addr_t resp_paddr = 0;
struct bmi_xfer xfer = {};
@@ -1385,7 +1385,7 @@ err_dma:
return ret;
}
-static void ath10k_pci_bmi_send_done(struct ce_state *ce_state,
+static void ath10k_pci_bmi_send_done(struct ath10k_ce_pipe *ce_state,
void *transfer_context,
u32 data,
unsigned int nbytes,
@@ -1399,7 +1399,7 @@ static void ath10k_pci_bmi_send_done(struct ce_state *ce_state,
complete(&xfer->done);
}
-static void ath10k_pci_bmi_recv_data(struct ce_state *ce_state,
+static void ath10k_pci_bmi_recv_data(struct ath10k_ce_pipe *ce_state,
void *transfer_context,
u32 data,
unsigned int nbytes,
diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index de26311..c65fe1b 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -52,7 +52,7 @@ enum ath10k_pci_compl_state {
struct ath10k_pci_compl {
struct list_head list;
enum ath10k_pci_compl_state state;
- struct ce_state *ce_state;
+ struct ath10k_ce_pipe *ce_state;
struct ath10k_pci_pipe *pipe_info;
void *transfer_context;
unsigned int nbytes;
@@ -162,7 +162,7 @@ enum ath10k_pci_features {
/* Per-pipe state. */
struct ath10k_pci_pipe {
/* Handle of underlying Copy Engine */
- struct ce_state *ce_hdl;
+ struct ath10k_ce_pipe *ce_hdl;
/* Our pipe number; facilitiates use of pipe_info ptrs. */
u8 pipe_num;
@@ -227,13 +227,13 @@ struct ath10k_pci {
u32 fw_indicator_address;
/* Copy Engine used for Diagnostic Accesses */
- struct ce_state *ce_diag;
+ struct ath10k_ce_pipe *ce_diag;
/* FIXME: document what this really protects */
spinlock_t ce_lock;
/* Map CE id to ce_state */
- struct ce_state ce_states[CE_COUNT_MAX];
+ struct ath10k_ce_pipe ce_states[CE_COUNT_MAX];
/* makes sure that dummy reads are atomic */
spinlock_t hw_v1_workaround_lock;
--
1.7.9.5
^ permalink raw reply related
* [PATCH 1/6] ath10k: use inline ce_state structure
From: Michal Kazior @ 2013-08-21 6:57 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Michal Kazior
In-Reply-To: <1377068249-26025-1-git-send-email-michal.kazior@tieto.com>
Simplifies memory managament of ce_state.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/ce.c | 37 ++++++++++++---------------------
drivers/net/wireless/ath/ath10k/pci.h | 5 ++++-
2 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
index 1a702e1..c8b7d21 100644
--- a/drivers/net/wireless/ath/ath10k/ce.c
+++ b/drivers/net/wireless/ath/ath10k/ce.c
@@ -727,7 +727,7 @@ int ath10k_ce_completed_send_next(struct ce_state *ce_state,
void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct ce_state *ce_state = ar_pci->ce_id_to_state[ce_id];
+ struct ce_state *ce_state = &ar_pci->ce_states[ce_id];
u32 ctrl_addr = ce_state->ctrl_addr;
void *transfer_context;
u32 buf;
@@ -846,7 +846,7 @@ void ath10k_ce_disable_interrupts(struct ath10k *ar)
ath10k_pci_wake(ar);
for (ce_id = 0; ce_id < ar_pci->ce_count; ce_id++) {
- struct ce_state *ce_state = ar_pci->ce_id_to_state[ce_id];
+ struct ce_state *ce_state = &ar_pci->ce_states[ce_id];
u32 ctrl_addr = ce_state->ctrl_addr;
ath10k_ce_copy_complete_intr_disable(ar, ctrl_addr);
@@ -1081,27 +1081,17 @@ static struct ce_state *ath10k_ce_init_state(struct ath10k *ar,
const struct ce_attr *attr)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- struct ce_state *ce_state = NULL;
+ struct ce_state *ce_state = &ar_pci->ce_states[ce_id];
u32 ctrl_addr = ath10k_ce_base_address(ce_id);
spin_lock_bh(&ar_pci->ce_lock);
- if (!ar_pci->ce_id_to_state[ce_id]) {
- ce_state = kzalloc(sizeof(*ce_state), GFP_ATOMIC);
- if (ce_state == NULL) {
- spin_unlock_bh(&ar_pci->ce_lock);
- return NULL;
- }
-
- ar_pci->ce_id_to_state[ce_id] = ce_state;
- ce_state->ar = ar;
- ce_state->id = ce_id;
- ce_state->ctrl_addr = ctrl_addr;
- ce_state->state = CE_RUNNING;
- /* Save attribute flags */
- ce_state->attr_flags = attr->flags;
- ce_state->src_sz_max = attr->src_sz_max;
- }
+ ce_state->ar = ar;
+ ce_state->id = ce_id;
+ ce_state->ctrl_addr = ctrl_addr;
+ ce_state->state = CE_RUNNING;
+ ce_state->attr_flags = attr->flags;
+ ce_state->src_sz_max = attr->src_sz_max;
spin_unlock_bh(&ar_pci->ce_lock);
@@ -1159,13 +1149,9 @@ struct ce_state *ath10k_ce_init(struct ath10k *ar,
void ath10k_ce_deinit(struct ce_state *ce_state)
{
- unsigned int ce_id = ce_state->id;
struct ath10k *ar = ce_state->ar;
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
- ce_state->state = CE_UNUSED;
- ar_pci->ce_id_to_state[ce_id] = NULL;
-
if (ce_state->src_ring) {
kfree(ce_state->src_ring->shadow_base_unaligned);
pci_free_consistent(ar_pci->pdev,
@@ -1186,5 +1172,8 @@ void ath10k_ce_deinit(struct ce_state *ce_state)
ce_state->dest_ring->base_addr_ce_space);
kfree(ce_state->dest_ring);
}
- kfree(ce_state);
+
+ ce_state->state = CE_UNUSED;
+ ce_state->src_ring = NULL;
+ ce_state->dest_ring = NULL;
}
diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index 153ae28..64fcef5 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -233,7 +233,10 @@ struct ath10k_pci {
spinlock_t ce_lock;
/* Map CE id to ce_state */
- struct ce_state *ce_id_to_state[CE_COUNT_MAX];
+ struct ce_state ce_states[CE_COUNT_MAX];
+
+ /* makes sure that dummy reads are atomic */
+ spinlock_t hw_v1_workaround_lock;
};
static inline struct ath10k_pci *ath10k_pci_priv(struct ath10k *ar)
--
1.7.9.5
^ permalink raw reply related
* [PATCH 3/6] ath10k: remove unused ce_attr parameters
From: Michal Kazior @ 2013-08-21 6:57 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Michal Kazior
In-Reply-To: <1377068249-26025-1-git-send-email-michal.kazior@tieto.com>
Some parameters were unused and are not required.
They have no representation in firmware. Clean
them up.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/ce.h | 6 ------
drivers/net/wireless/ath/ath10k/pci.c | 18 +++++++++---------
2 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/ce.h b/drivers/net/wireless/ath/ath10k/ce.h
index 6f6bca0..ce4cbbf 100644
--- a/drivers/net/wireless/ath/ath10k/ce.h
+++ b/drivers/net/wireless/ath/ath10k/ce.h
@@ -314,9 +314,6 @@ struct ce_attr {
/* CE_ATTR_* values */
unsigned int flags;
- /* currently not in use */
- unsigned int priority;
-
/* #entries in source ring - Must be a power of 2 */
unsigned int src_nentries;
@@ -328,9 +325,6 @@ struct ce_attr {
/* #entries in destination ring - Must be a power of 2 */
unsigned int dest_nentries;
-
- /* Future use */
- void *reserved;
};
/*
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 996efdd..80cc7fd 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -59,23 +59,23 @@ static void ath10k_pci_stop_intr(struct ath10k *ar);
static const struct ce_attr host_ce_config_wlan[] = {
/* host->target HTC control and raw streams */
- { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL,},
+ { /* CE0 */ CE_ATTR_FLAGS, 16, 256, 0 },
/* could be moved to share CE3 */
/* target->host HTT + HTC control */
- { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL,},
+ { /* CE1 */ CE_ATTR_FLAGS, 0, 512, 512 },
/* target->host WMI */
- { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 32, NULL,},
+ { /* CE2 */ CE_ATTR_FLAGS, 0, 2048, 32 },
/* host->target WMI */
- { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,},
+ { /* CE3 */ CE_ATTR_FLAGS, 32, 2048, 0 },
/* host->target HTT */
- { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DIS_INTR, 0,
- CE_HTT_H2T_MSG_SRC_NENTRIES, 256, 0, NULL,},
+ { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DIS_INTR,
+ CE_HTT_H2T_MSG_SRC_NENTRIES, 256, 0 },
/* unused */
- { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
+ { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0 },
/* Target autonomous hif_memcpy */
- { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
+ { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0 },
/* ce_diag, the Diagnostic Window */
- { /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
+ { /* CE7 */ CE_ATTR_FLAGS, 2, DIAG_TRANSFER_LIMIT, 2 },
};
/* Target firmware's Copy Engine configuration. */
--
1.7.9.5
^ 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