* [PATCH 1/5]wireless:hostap_main.c warning: variable 'iface' set but not used
From: Justin P. Mattock @ 2010-06-16 5:33 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-wireless, linux-pci, linux-scsi, Justin P. Mattock
In-Reply-To: <1276666434-11227-1-git-send-email-justinmattock@gmail.com>
The patch below fixes a warning message Im seeing with gcc 4.6.0
CC [M] drivers/net/wireless/hostap/hostap_main.o
drivers/net/wireless/hostap/hostap_main.c: In function 'hostap_set_multicast_list_queue':
drivers/net/wireless/hostap/hostap_main.c:744:27: warning: variable 'iface' set but not used
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
---
drivers/net/wireless/hostap/hostap_main.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index eb57d1e..eaee84b 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -741,9 +741,7 @@ void hostap_set_multicast_list_queue(struct work_struct *work)
local_info_t *local =
container_of(work, local_info_t, set_multicast_list_queue);
struct net_device *dev = local->dev;
- struct hostap_interface *iface;
- iface = netdev_priv(dev);
if (hostap_set_word(dev, HFA384X_RID_PROMISCUOUSMODE,
local->is_promisc)) {
printk(KERN_INFO "%s: %sabling promiscuous mode failed\n",
--
1.7.1.rc1.21.gf3bd6
^ permalink raw reply related
* [PATCH 2/5]wireless:hostap_ap.c Fix warning: variable 'fc' set but not used
From: Justin P. Mattock @ 2010-06-16 5:33 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-wireless, linux-pci, linux-scsi, Justin P. Mattock
In-Reply-To: <1276666434-11227-1-git-send-email-justinmattock@gmail.com>
The below patch fixes a warning message when compiling with gcc 4.6.0
CC [M] drivers/net/wireless/hostap/hostap_ap.o
drivers/net/wireless/hostap/hostap_ap.c: In function 'hostap_ap_tx_cb_assoc':
drivers/net/wireless/hostap/hostap_ap.c:691:6: warning: variable 'fc' set but not used
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
---
drivers/net/wireless/hostap/hostap_ap.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
index 231dbd7..9cadaa2 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -688,7 +688,7 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
struct ap_data *ap = data;
struct net_device *dev = ap->local->dev;
struct ieee80211_hdr *hdr;
- u16 fc, status;
+ u16 status;
__le16 *pos;
struct sta_info *sta = NULL;
char *txt = NULL;
@@ -699,7 +699,6 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
}
hdr = (struct ieee80211_hdr *) skb->data;
- fc = le16_to_cpu(hdr->frame_control);
if ((!ieee80211_is_assoc_resp(hdr->frame_control) &&
!ieee80211_is_reassoc_resp(hdr->frame_control)) ||
skb->len < IEEE80211_MGMT_HDR_LEN + 4) {
--
1.7.1.rc1.21.gf3bd6
^ permalink raw reply related
* [PATCH 3/5]pci:bus.c Fix variable 'retval' set but not used
From: Justin P. Mattock @ 2010-06-16 5:33 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-wireless, linux-pci, linux-scsi, Justin P. Mattock
In-Reply-To: <1276666434-11227-1-git-send-email-justinmattock@gmail.com>
The patch below fixes the warning message I am seeing with gcc 4.6.0
CC drivers/pci/bus.o
drivers/pci/bus.c: In function 'pci_enable_bridges':
drivers/pci/bus.c:237:6: warning: variable 'retval' set but not used
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
---
drivers/pci/bus.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index 628ea20..84bdb48 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -234,12 +234,10 @@ void pci_bus_add_devices(const struct pci_bus *bus)
void pci_enable_bridges(struct pci_bus *bus)
{
struct pci_dev *dev;
- int retval;
list_for_each_entry(dev, &bus->devices, bus_list) {
if (dev->subordinate) {
if (!pci_is_enabled(dev)) {
- retval = pci_enable_device(dev);
pci_set_master(dev);
}
pci_enable_bridges(dev->subordinate);
--
1.7.1.rc1.21.gf3bd6
^ permalink raw reply related
* [PATCH 4/5]pci:setup_bus.c Fix warning: variable 'retval' set but not used
From: Justin P. Mattock @ 2010-06-16 5:33 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-wireless, linux-pci, linux-scsi, Justin P. Mattock
In-Reply-To: <1276666434-11227-1-git-send-email-justinmattock@gmail.com>
The below patch fixes a warning message when using gcc 4.6.0
CC drivers/pci/setup-bus.o
drivers/pci/setup-bus.c: In function 'pci_assign_unassigned_bridge_resources':
drivers/pci/setup-bus.c:868:6: warning: variable 'retval' set but not used
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
---
drivers/pci/setup-bus.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 19b1113..215590b 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -865,7 +865,6 @@ void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge)
struct pci_bus *parent = bridge->subordinate;
int tried_times = 0;
struct resource_list_x head, *list;
- int retval;
unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM |
IORESOURCE_PREFETCH;
@@ -874,7 +873,6 @@ void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge)
again:
pci_bus_size_bridges(parent);
__pci_bridge_assign_resources(bridge, &head);
- retval = pci_reenable_device(bridge);
pci_set_master(bridge);
pci_enable_bridges(parent);
--
1.7.1.rc1.21.gf3bd6
^ permalink raw reply related
* [PATCH 5/5]scsi:hosts.c Fix warning: variable 'rval' set but not used
From: Justin P. Mattock @ 2010-06-16 5:33 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-wireless, linux-pci, linux-scsi, Justin P. Mattock
In-Reply-To: <1276666434-11227-1-git-send-email-justinmattock@gmail.com>
The below patch fixes a warning message generated by gcc 4.6.0
CC drivers/scsi/hosts.o
drivers/scsi/hosts.c: In function 'scsi_host_alloc':
drivers/scsi/hosts.c:328:6: warning: variable 'rval' set but not used
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
---
drivers/scsi/hosts.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 6660fa9..00fd6a4 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -325,7 +325,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
{
struct Scsi_Host *shost;
gfp_t gfp_mask = GFP_KERNEL;
- int rval;
if (sht->unchecked_isa_dma && privsize)
gfp_mask |= __GFP_DMA;
@@ -420,7 +419,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
shost->ehandler = kthread_run(scsi_error_handler, shost,
"scsi_eh_%d", shost->host_no);
if (IS_ERR(shost->ehandler)) {
- rval = PTR_ERR(shost->ehandler);
goto fail_kfree;
}
--
1.7.1.rc1.21.gf3bd6
^ permalink raw reply related
* Re: [PATCH 3/5]pci:bus.c Fix variable 'retval' set but not used
From: Julian Calaby @ 2010-06-16 5:42 UTC (permalink / raw)
To: Justin P. Mattock; +Cc: linux-kernel, linux-wireless, linux-pci, linux-scsi
In-Reply-To: <1276666434-11227-4-git-send-email-justinmattock@gmail.com>
On Wed, Jun 16, 2010 at 15:33, Justin P. Mattock
<justinmattock@gmail.com> wrote:
> The patch below fixes the warning message I am seeing with gcc 4.6.0
> CC drivers/pci/bus.o
> drivers/pci/bus.c: In function 'pci_enable_bridges':
> drivers/pci/bus.c:237:6: warning: variable 'retval' set but not used
>
> Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
>
> ---
> drivers/pci/bus.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
> index 628ea20..84bdb48 100644
> --- a/drivers/pci/bus.c
> +++ b/drivers/pci/bus.c
> @@ -234,12 +234,10 @@ void pci_bus_add_devices(const struct pci_bus *bus)
> void pci_enable_bridges(struct pci_bus *bus)
> {
> struct pci_dev *dev;
> - int retval;
>
> list_for_each_entry(dev, &bus->devices, bus_list) {
> if (dev->subordinate) {
> if (!pci_is_enabled(dev)) {
> - retval = pci_enable_device(dev);
> pci_set_master(dev);
> }
> pci_enable_bridges(dev->subordinate);
Er, this appears to be bogus: I'm only guessing, but I'd expect that
the pci_enable_device() call is actually doing something useful, and
removing it is going to break *something* - Have you booted a kernel
with this code enabled and these patches applied?
As for this warning, I think that there is a better solution.
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
.Plan: http://sites.google.com/site/juliancalaby/
^ permalink raw reply
* Re: [PATCH] ath9k: Modify LED blinking pattern during wifi activity.
From: Vivek Natarajan @ 2010-06-16 5:51 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless
In-Reply-To: <20100615195157.GC2415@tuxdriver.com>
On Wed, Jun 16, 2010 at 1:21 AM, John W. Linville
<linville@tuxdriver.com> wrote:
> On Tue, Jun 15, 2010 at 10:50:17AM +0530, Vivek Natarajan wrote:
>> Some vendors require the LED to be ON always irrespective of any
>> radio activity. Introducing a module parameter to enable this,
>> so that one can choose between always on or led blink during
>> activity.
>>
>> Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
>
> Any particular reason the always-on behaviour is the default?
There is no specific reason for setting it as default. It is only that
some customers preferred the led to be always on instead of blinking.
Thanks
Vivek.
^ permalink raw reply
* Re: [PATCH 0/5] Fix set but unused variable warnings
From: Julian Calaby @ 2010-06-16 5:52 UTC (permalink / raw)
To: Justin P. Mattock; +Cc: linux-kernel, linux-wireless, linux-pci, linux-scsi
In-Reply-To: <1276666434-11227-1-git-send-email-justinmattock@gmail.com>
On Wed, Jun 16, 2010 at 15:33, Justin P. Mattock
<justinmattock@gmail.com> wrote:
> Here is another set of patches fixing some warning messages generated
> when building the kernel when using gcc 4.6.0.
>
> This set just focuses in on the variables warnings that are reported
> to be unused. Keep in mind there are still lots more warning messages
> that I'm seeing, and will try my hardest to see if I can come up with
> a fix, but if things become too difficult and so forth then a bug should
> be filled etc..
Given that patches 3, 4 and 5 seem to be a cases of missing error
handling, (3 and 4 in particular seem to be breaking things rather
than fixing them) in my humble opinion, I think this set needs some
work and discussion.
Justin, maybe you'd be better off posting the actual error messages
(split up by subsystem) and letting the lists discuss them, rather
than posting patches which are obviously wrong. (like the ones I've
pointed out)
I'm sure that everyone here is as committed as you are to eliminating
compile warnings and errors and, in my opinion, more good will come
from a healthy discussion of the warnings than maintainers NAKing your
patches out of hand.
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
.Plan: http://sites.google.com/site/juliancalaby/
^ permalink raw reply
* [PATCHv2] mac80211: Add interface for driver to temporarily disable dynamic ps
From: Juuso Oikarinen @ 2010-06-16 6:01 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
This mechanism introduced in this patch applies (at least) for hardware
designs using a single shared antenna for both WLAN and BT. In these designs,
the antenna must be toggled between WLAN and BT.
In those hardware, managing WLAN co-existence with Bluetooth requires WLAN
full power save whenever there is Bluetooth activity in order for WLAN to be
able to periodically relinquish the antenna to be used for BT. This is because
BT can only access the shared antenna when WLAN is idle or asleep.
Some hardware, for instance the wl1271, are able to indicate to the host
whenever there is BT traffic. In essence, the hardware will send an indication
to the host whenever there is, for example, SCO traffic or A2DP traffic, and
will send another indication when the traffic is over.
The hardware gets information of Bluetooth traffic via hardware co-existence
control lines - these lines are used to negotiate the shared antenna
ownership. The hardware will give the antenna to BT whenever WLAN is sleeping.
This patch adds the interface to mac80211 to facilitate temporarily disabling
of dynamic power save as per request of the WLAN driver. This interface will
immediately force WLAN to full powersave, hence allowing BT coexistence as
described above.
In these kind of shared antenna desings, when WLAN powersave is fully disabled,
Bluetooth will not work simultaneously with WLAN at all. This patch does not
address that problem. This interface will not change PSM state, so if PSM is
disabled it will remain so. Solving this problem requires knowledge about BT
state, and is best done in user-space.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
---
v2: moved dynamic_ps_user_timeout and disable_dynamic_ps to local
include/net/mac80211.h | 27 +++++++++++++++++++++++++++
net/mac80211/ieee80211_i.h | 3 +++
net/mac80211/mlme.c | 29 ++++++++++++++++++++++++++++-
3 files changed, 58 insertions(+), 1 deletions(-)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index fe1a3a6..2628550 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1271,6 +1271,15 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
* dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS
* enabled whenever user has enabled powersave.
*
+ * Some hardware need to toggle a single shared antenna between WLAN and
+ * Bluetooth to facilitate co-existence. These types of hardware set
+ * limitations on the use of host controlled dynamic powersave whenever there
+ * is simultaneous WLAN and Bluetooth traffic. For these types of hardware, the
+ * driver may request temporarily going into full power save, in order to
+ * enable toggling the antenna between BT and WLAN. If the driver requests
+ * disabling dynamic powersave, the @dynamic_ps_timeout value will be
+ * temporarily set to zero until the driver re-enables dynamic powersave.
+ *
* Driver informs U-APSD client support by enabling
* %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the
* uapsd paramater in conf_tx() operation. Hardware needs to send the QoS
@@ -2447,6 +2456,24 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif);
void ieee80211_connection_loss(struct ieee80211_vif *vif);
/**
+ * ieee80211_disable_dyn_ps - force mac80211 to temporarily disable dynamic psm
+ *
+ * @vif: &struct ieee80211_vif pointer from the add_interface callback.
+ *
+ * Some hardware require full power save to manage simultaneous BT traffic
+ * on the WLAN frequency. Full PSM is required periodically, whenever there are
+ * burst of BT traffic. The hardware gets information of BT traffic via
+ * hardware co-existence lines, and consequentially requests mac80211 to
+ * (temporarily) enter full psm.
+ * This function will only temporarily disable dynamic PS, not enable PSM if
+ * it was not already enabled.
+ * The driver must make sure to re-enable dynamic PS if the driver has disabled
+ * it.
+ *
+ */
+void ieee80211_disable_dyn_ps(struct ieee80211_vif *vif, bool disable);
+
+/**
* ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring
* rssi threshold triggered
*
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index fb54301..f90c48c 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -856,6 +856,9 @@ struct ieee80211_local {
*/
int dynamic_ps_forced_timeout;
+ int dynamic_ps_user_timeout;
+ bool disable_dynamic_ps;
+
int user_power_level; /* in dBm */
int power_constr_level; /* in dBm */
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 85c3ca3..dd16dad 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -478,6 +478,29 @@ static void ieee80211_handle_pwr_constr(struct ieee80211_sub_if_data *sdata,
}
}
+void ieee80211_disable_dyn_ps(struct ieee80211_vif *vif, bool disable)
+{
+ struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
+ struct ieee80211_local *local = sdata->local;
+ struct ieee80211_conf *conf = &local->hw.conf;
+
+ WARN_ON(sdata->vif.type != NL80211_IFTYPE_STATION ||
+ !(local->hw.flags & IEEE80211_HW_SUPPORTS_PS) ||
+ (local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS));
+
+ local->disable_dynamic_ps = disable;
+
+ if (disable) {
+ conf->dynamic_ps_timeout = 0;
+ del_timer_sync(&local->dynamic_ps_timer);
+ ieee80211_queue_work(&local->hw,
+ &local->dynamic_ps_enable_work);
+ } else {
+ conf->dynamic_ps_timeout = local->dynamic_ps_user_timeout;
+ }
+}
+EXPORT_SYMBOL(ieee80211_disable_dyn_ps);
+
/* powersave */
static void ieee80211_enable_ps(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata)
@@ -553,6 +576,7 @@ void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency)
found->u.mgd.associated->beacon_ies &&
!(found->u.mgd.flags & (IEEE80211_STA_BEACON_POLL |
IEEE80211_STA_CONNECTION_POLL))) {
+ struct ieee80211_conf *conf = &local->hw.conf;
s32 beaconint_us;
if (latency < 0)
@@ -575,7 +599,10 @@ void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency)
else
timeout = 100;
}
- local->hw.conf.dynamic_ps_timeout = timeout;
+ local->dynamic_ps_user_timeout = timeout;
+ if (!local->disable_dynamic_ps)
+ conf->dynamic_ps_timeout =
+ local->dynamic_ps_user_timeout;
if (beaconint_us > latency) {
local->ps_sdata = NULL;
--
1.6.3.3
^ permalink raw reply related
* Re: [PATCH 3/5]pci:bus.c Fix variable 'retval' set but not used
From: Junchang Wang @ 2010-06-16 6:07 UTC (permalink / raw)
To: Justin P. Mattock; +Cc: linux-kernel, linux-wireless, linux-pci, linux-scsi
In-Reply-To: <1276666434-11227-4-git-send-email-justinmattock@gmail.com>
On Tue, Jun 15, 2010 at 10:33:52PM -0700, Justin P. Mattock wrote:
>@@ -234,12 +234,10 @@ void pci_bus_add_devices(const struct pci_bus *bus)
> void pci_enable_bridges(struct pci_bus *bus)
> {
> struct pci_dev *dev;
>- int retval;
>
> list_for_each_entry(dev, &bus->devices, bus_list) {
> if (dev->subordinate) {
> if (!pci_is_enabled(dev)) {
>- retval = pci_enable_device(dev);
Hi Justin,
pci_enable_device initializes device before it's used by a driver.
I think you should add check instead of eliminating pci_enable_device.
For example,
retval = pci_enable_device(dev);
if (retval < 0) {
goto handle_err;
}
--Junchang
^ permalink raw reply
* [PATCH v3] iw: Configure basic rates when joining ibss network
From: Teemu Paasikivi @ 2010-06-16 6:22 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Teemu Paasikivi
This patch adds option to configure basic rates when joining ibss network.
Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
---
ibss.c | 35 ++++++++++++++++++++++++++++++++++-
1 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/ibss.c b/ibss.c
index 4715ac8..7e3ff89 100644
--- a/ibss.c
+++ b/ibss.c
@@ -18,6 +18,11 @@ static int join_ibss(struct nl80211_state *state,
{
char *end;
unsigned char abssid[6];
+ unsigned char rates[NL80211_MAX_SUPP_RATES];
+ int n_rates = 0;
+ char *value = NULL, *sptr = NULL;
+ float rate;
+
if (argc < 2)
return 1;
@@ -49,6 +54,32 @@ static int join_ibss(struct nl80211_state *state,
}
}
+ /* basic rates */
+ if (argc > 1 && strcmp(argv[0], "basic-rates") == 0) {
+ argv++;
+ argc--;
+
+ value = strtok_r(argv[0], ",", &sptr);
+
+ while (value && n_rates < NL80211_MAX_SUPP_RATES) {
+ rate = strtod(value, &end);
+ rates[n_rates] = rate * 2;
+
+ /* filter out suspicious values */
+ if (*end != '\0' || !rates[n_rates] ||
+ rate*2 != rates[n_rates])
+ return 1;
+
+ n_rates++;
+ value = strtok_r(NULL, ",", &sptr);
+ }
+
+ NLA_PUT(msg, NL80211_ATTR_BSS_BASIC_RATES, n_rates, rates);
+
+ argv++;
+ argc--;
+ }
+
if (!argc)
return 0;
@@ -73,7 +104,9 @@ static int leave_ibss(struct nl80211_state *state,
COMMAND(ibss, leave, NULL,
NL80211_CMD_LEAVE_IBSS, 0, CIB_NETDEV, leave_ibss,
"Leave the current IBSS cell.");
-COMMAND(ibss, join, "<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] [key d:0:abcde]",
+COMMAND(ibss, join,
+ "<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] "
+ "[basic-rates <rate in Mbps,rate2,...>] [key d:0:abcde]",
NL80211_CMD_JOIN_IBSS, 0, CIB_NETDEV, join_ibss,
"Join the IBSS cell with the given SSID, if it doesn't exist create\n"
"it on the given frequency. When fixed frequency is requested, don't\n"
--
1.5.6.3
^ permalink raw reply related
* Re: [PATCH 3/5]pci:bus.c Fix variable 'retval' set but not used
From: Justin P. Mattock @ 2010-06-16 6:56 UTC (permalink / raw)
To: Julian Calaby; +Cc: linux-kernel, linux-wireless, linux-pci, linux-scsi
In-Reply-To: <AANLkTik27fbCY0pMJdcbuCaEXr-902WiqiFPkju4Bet0@mail.gmail.com>
On 06/15/2010 10:42 PM, Julian Calaby wrote:
> On Wed, Jun 16, 2010 at 15:33, Justin P. Mattock
> <justinmattock@gmail.com> wrote:
>> The patch below fixes the warning message I am seeing with gcc 4.6.0
>> CC drivers/pci/bus.o
>> drivers/pci/bus.c: In function 'pci_enable_bridges':
>> drivers/pci/bus.c:237:6: warning: variable 'retval' set but not used
>>
>> Signed-off-by: Justin P. Mattock<justinmattock@gmail.com>
>>
>> ---
>> drivers/pci/bus.c | 2 --
>> 1 files changed, 0 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
>> index 628ea20..84bdb48 100644
>> --- a/drivers/pci/bus.c
>> +++ b/drivers/pci/bus.c
>> @@ -234,12 +234,10 @@ void pci_bus_add_devices(const struct pci_bus *bus)
>> void pci_enable_bridges(struct pci_bus *bus)
>> {
>> struct pci_dev *dev;
>> - int retval;
>>
>> list_for_each_entry(dev,&bus->devices, bus_list) {
>> if (dev->subordinate) {
>> if (!pci_is_enabled(dev)) {
>> - retval = pci_enable_device(dev);
>> pci_set_master(dev);
>> }
>> pci_enable_bridges(dev->subordinate);
>
> Er, this appears to be bogus: I'm only guessing, but I'd expect that
> the pci_enable_device() call is actually doing something useful, and
> removing it is going to break *something* - Have you booted a kernel
> with this code enabled and these patches applied?
>
> As for this warning, I think that there is a better solution.
>
> Thanks,
>
alright!!
Justin P. Mattock
^ permalink raw reply
* Re: [PATCH 3/5]pci:bus.c Fix variable 'retval' set but not used
From: Justin P. Mattock @ 2010-06-16 6:58 UTC (permalink / raw)
To: Junchang Wang; +Cc: linux-kernel, linux-wireless, linux-pci, linux-scsi
In-Reply-To: <20100616060738.GA12461@host-a-229.ustcsz.edu.cn>
On 06/15/2010 11:07 PM, Junchang Wang wrote:
> On Tue, Jun 15, 2010 at 10:33:52PM -0700, Justin P. Mattock wrote:
>> @@ -234,12 +234,10 @@ void pci_bus_add_devices(const struct pci_bus *bus)
>> void pci_enable_bridges(struct pci_bus *bus)
>> {
>> struct pci_dev *dev;
>> - int retval;
>>
>> list_for_each_entry(dev,&bus->devices, bus_list) {
>> if (dev->subordinate) {
>> if (!pci_is_enabled(dev)) {
>> - retval = pci_enable_device(dev);
> Hi Justin,
>
> pci_enable_device initializes device before it's used by a driver.
>
> I think you should add check instead of eliminating pci_enable_device.
>
> For example,
> retval = pci_enable_device(dev);
> if (retval< 0) {
> goto handle_err;
> }
>
> --Junchang
>
>
cool, thanks for the example and info on this. I'll play around with
this to see if I come up with anything.
cheers,
Justin P. Mattock
^ permalink raw reply
* Re: [PATCH 0/5] Fix set but unused variable warnings
From: Justin P. Mattock @ 2010-06-16 7:01 UTC (permalink / raw)
To: Julian Calaby; +Cc: linux-kernel, linux-wireless, linux-pci, linux-scsi
In-Reply-To: <AANLkTikwKHITQJDaSf9BnHQ9FLiQ-KYlCWNiH438otsV@mail.gmail.com>
On 06/15/2010 10:52 PM, Julian Calaby wrote:
> On Wed, Jun 16, 2010 at 15:33, Justin P. Mattock
> <justinmattock@gmail.com> wrote:
>> Here is another set of patches fixing some warning messages generated
>> when building the kernel when using gcc 4.6.0.
>>
>> This set just focuses in on the variables warnings that are reported
>> to be unused. Keep in mind there are still lots more warning messages
>> that I'm seeing, and will try my hardest to see if I can come up with
>> a fix, but if things become too difficult and so forth then a bug should
>> be filled etc..
>
> Given that patches 3, 4 and 5 seem to be a cases of missing error
> handling, (3 and 4 in particular seem to be breaking things rather
> than fixing them) in my humble opinion, I think this set needs some
> work and discussion.
>
alright..
> Justin, maybe you'd be better off posting the actual error messages
> (split up by subsystem) and letting the lists discuss them, rather
> than posting patches which are obviously wrong. (like the ones I've
> pointed out)
>
yeah I'm a newbie!! alright so just file bugs for all these then.
> I'm sure that everyone here is as committed as you are to eliminating
> compile warnings and errors and, in my opinion, more good will come
> from a healthy discussion of the warnings than maintainers NAKing your
> patches out of hand.
>
> Thanks,
>
NAKing is o.k. but having discussions is better..
Justin P. Mattock
^ permalink raw reply
* Re: [PATCH v3] iw: Configure basic rates when joining ibss network
From: Johannes Berg @ 2010-06-16 7:18 UTC (permalink / raw)
To: Teemu Paasikivi; +Cc: linux-wireless
In-Reply-To: <1276669336-32266-1-git-send-email-ext-teemu.3.paasikivi@nokia.com>
On Wed, 2010-06-16 at 09:22 +0300, Teemu Paasikivi wrote:
> This patch adds option to configure basic rates when joining ibss network.
Applied, thanks.
> Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
> ---
> ibss.c | 35 ++++++++++++++++++++++++++++++++++-
> 1 files changed, 34 insertions(+), 1 deletions(-)
>
> diff --git a/ibss.c b/ibss.c
> index 4715ac8..7e3ff89 100644
> --- a/ibss.c
> +++ b/ibss.c
> @@ -18,6 +18,11 @@ static int join_ibss(struct nl80211_state *state,
> {
> char *end;
> unsigned char abssid[6];
> + unsigned char rates[NL80211_MAX_SUPP_RATES];
> + int n_rates = 0;
> + char *value = NULL, *sptr = NULL;
> + float rate;
> +
>
> if (argc < 2)
> return 1;
> @@ -49,6 +54,32 @@ static int join_ibss(struct nl80211_state *state,
> }
> }
>
> + /* basic rates */
> + if (argc > 1 && strcmp(argv[0], "basic-rates") == 0) {
> + argv++;
> + argc--;
> +
> + value = strtok_r(argv[0], ",", &sptr);
> +
> + while (value && n_rates < NL80211_MAX_SUPP_RATES) {
> + rate = strtod(value, &end);
> + rates[n_rates] = rate * 2;
> +
> + /* filter out suspicious values */
> + if (*end != '\0' || !rates[n_rates] ||
> + rate*2 != rates[n_rates])
> + return 1;
> +
> + n_rates++;
> + value = strtok_r(NULL, ",", &sptr);
> + }
> +
> + NLA_PUT(msg, NL80211_ATTR_BSS_BASIC_RATES, n_rates, rates);
> +
> + argv++;
> + argc--;
> + }
> +
> if (!argc)
> return 0;
>
> @@ -73,7 +104,9 @@ static int leave_ibss(struct nl80211_state *state,
> COMMAND(ibss, leave, NULL,
> NL80211_CMD_LEAVE_IBSS, 0, CIB_NETDEV, leave_ibss,
> "Leave the current IBSS cell.");
> -COMMAND(ibss, join, "<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] [key d:0:abcde]",
> +COMMAND(ibss, join,
> + "<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] "
> + "[basic-rates <rate in Mbps,rate2,...>] [key d:0:abcde]",
> NL80211_CMD_JOIN_IBSS, 0, CIB_NETDEV, join_ibss,
> "Join the IBSS cell with the given SSID, if it doesn't exist create\n"
> "it on the given frequency. When fixed frequency is requested, don't\n"
^ permalink raw reply
* Re: [RFC] Changes in mac80211 to make at76c50x-usb working again
From: Sebastian Smolorz @ 2010-06-16 7:46 UTC (permalink / raw)
To: Kalle Valo
Cc: Johannes Berg, John W. Linville, linux-wireless, Marcel Holtmann
In-Reply-To: <AANLkTinHK_MbKZd9HUDoiWuWs5AmDOQiza0poofzYeDn@mail.gmail.com>
Kalle Valo wrote:
> On 15 June 2010 16:36, Johannes Berg <johannes@sipsolutions.net> wrote:
> > On Tue, 2010-06-15 at 09:26 -0400, John W. Linville wrote:
> >> On Tue, Jun 15, 2010 at 02:16:36PM +0200, Sebastian Smolorz wrote:
> >> > the at76c50x-usb driver fails to authenticate with an AP.
> >
> > We need more information on how it fails.
>
> I debugged this a long time ago. The problem is that firmware's
> CMD_JOIN only works if bssid is correct one. I remember trying
> ff:ff:ff:ff:ff:ff, but that didn't work for some reason. The join
> command needs to be sent before association, otherwise transmission
> won't work at all. And if I use a random bssid the firmware will
> filter the replies. But I tested this a long time ago, I might
> remember something wrong.
>
> I was thinking a hack which would get bssid from association frames
> and then send CMD_JOIN, before the association frame.
Could you elaborate a little bit on this?
How do we proceed to make the driver working again? Do you want to work on
this issue?
--
Sebastian
^ permalink raw reply
* Re: [PATCH 2.6.32.y] ath9k: re-enable ps by default for new single chip families
From: Kristoffer Ericson @ 2010-06-16 8:12 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: stable, greg, linux-wireless, Peter Stuge, Justin P. Mattock,
John W. Linville
In-Reply-To: <1276640359-25360-1-git-send-email-lrodriguez@atheros.com>
On Tue, Jun 15, 2010 at 06:19:19PM -0400, Luis R. Rodriguez wrote:
> commit 14acdde6e527950f66c084dbf19bad6fbfcaeedc upstream.
>
> The newer single chip hardware family of chipsets have not been
> experiencing issues with power saving set by default with recent
> fixes merged (even into stable). The remaining issues are only
> reported with AR5416 and since enabling PS by default can increase
> power savings considerably best to take advantage of that feature
> as this has been tested properly.
I havent had any issues lately. But that said Ive moved on to
2.6.33, 2.6.34 which seems to work fine. Believe you set
to disabled by default on those?
/Kristoffer
>
> For more details on this issue see the bug report:
>
> http://bugzilla.kernel.org/show_bug.cgi?id=14267
>
> We leave AR5416 with PS disabled by default, that seems to require
> some more work.
>
> Cc: stable@kernel.org
> Cc: Peter Stuge <peter@stuge.se>
> Cc: Justin P. Mattock <justinmattock@gmail.com>
> Cc: Kristoffer Ericson <kristoffer.ericson@gmail.com>
> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
>
> Greg, this is the long promised backport of the patch titled
> "ath9k: re-enable ps by default for new single chip families" backported
> down to 2.6.32.y. This just goes test compiled. Manual backport
> was required from the upstream Linus patch since the flag
> WIPHY_FLAG_PS_ON_BY_DEFAULT was not used back on 2.6.32 so instead
> we use the equivalent hw->wiphy->ps_default bool.
>
> Apologies for the delay, was just stuck with other stuff.
>
> I'll remove this from the stable pending list for 802.11 [1] once
> this gets sucked in.
>
> [1] http://wireless.kernel.org/en/developers/stable-pending
>
> drivers/net/wireless/ath/ath9k/main.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
> index 15eb245..dba27b7 100644
> --- a/drivers/net/wireless/ath/ath9k/main.c
> +++ b/drivers/net/wireless/ath/ath9k/main.c
> @@ -1538,6 +1538,8 @@ bad_no_ah:
>
> void ath_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
> {
> + struct ath_hw *ah = sc->sc_ah;
> +
> hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
> IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
> IEEE80211_HW_SIGNAL_DBM |
> @@ -1556,7 +1558,10 @@ void ath_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
> BIT(NL80211_IFTYPE_ADHOC) |
> BIT(NL80211_IFTYPE_MESH_POINT);
>
> - hw->wiphy->ps_default = false;
> + if (AR_SREV_5416(ah))
> + hw->wiphy->ps_default = false;
> + else
> + hw->wiphy->ps_default = true;
>
> hw->queues = 4;
> hw->max_rates = 4;
> --
> 1.6.3.3
^ permalink raw reply
* [PATCH 00/17] ath5: descriptor cleanup series
From: Bruno Randolf @ 2010-06-16 10:11 UTC (permalink / raw)
To: linville; +Cc: ath5k-devel, linux-wireless
hi!
this series is a bunch of smaller changes i made while reviewing rx buffer
handling and some stuff i picked up while carefully reviewing the descriptor
definitions from the HAL against what we have. it's mostly cosmetics and
refactoring.
greetings,
bruno
---
Bruno Randolf (17):
ath5k: more debug prints for resets
ath5k: rename ath5k_txbuf_free() to ath5k_txbuf_free_skb()
ath5k: fix some comment typos
ath5k: fix rx descriptor debugging
ath5k: print more errors when decriptor setup fails
ath5k: reset more pointers after we free skbs
ath5k: unify rx descriptor error handling
ath5k: split descriptor handling and frame receive
ath5k: move checks and stats into new function
ath5k: use direct function calls for descriptors when possible
ath5k: cosmetic changes in ath5k_hw_proc_5212_rx_status()
ath5k: remove pointless rx error overlay struct
ath5k: review and add comments for descriptors
ath5k: update 5210/5211 frame types
ath5k: take descriptor differences between 5210 and 5211 into account
ath5k: review RX descriptor functions
ath5k: report PHY error frames only for chips which need it
drivers/net/wireless/ath/ath5k/ath5k.h | 12 +
drivers/net/wireless/ath/ath5k/base.c | 335 ++++++++++++++++++--------------
drivers/net/wireless/ath/ath5k/debug.c | 5
drivers/net/wireless/ath/ath5k/desc.c | 145 +++++++-------
drivers/net/wireless/ath/ath5k/desc.h | 310 ++++++++++++++----------------
5 files changed, 409 insertions(+), 398 deletions(-)
--
Signature
^ permalink raw reply
* [PATCH 01/17] ath5k: more debug prints for resets
From: Bruno Randolf @ 2010-06-16 10:11 UTC (permalink / raw)
To: linville; +Cc: ath5k-devel, linux-wireless
In-Reply-To: <20100616100809.10067.34787.stgit@tt-desk>
Add a debug print for every case of reset.
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
drivers/net/wireless/ath/ath5k/base.c | 14 +++++++++++---
drivers/net/wireless/ath/ath5k/debug.c | 1 +
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 9d37c1a..936afd7 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1111,8 +1111,9 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
static int
ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan)
{
- ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "(%u MHz) -> (%u MHz)\n",
- sc->curchan->center_freq, chan->center_freq);
+ ATH5K_DBG(sc, ATH5K_DEBUG_RESET,
+ "channel set, resetting (%u -> %u MHz)\n",
+ sc->curchan->center_freq, chan->center_freq);
/*
* To switch channels clear any pending DMA operations;
@@ -2298,6 +2299,8 @@ ath5k_beacon_send(struct ath5k_softc *sc)
ATH5K_DBG(sc, ATH5K_DEBUG_BEACON,
"stuck beacon time (%u missed)\n",
sc->bmisscount);
+ ATH5K_DBG(sc, ATH5K_DEBUG_RESET,
+ "stuck beacon, resetting\n");
tasklet_schedule(&sc->restq);
}
return;
@@ -2705,6 +2708,8 @@ ath5k_intr(int irq, void *dev_id)
* Fatal errors are unrecoverable.
* Typically these are caused by DMA errors.
*/
+ ATH5K_DBG(sc, ATH5K_DEBUG_RESET,
+ "fatal int, resetting\n");
tasklet_schedule(&sc->restq);
} else if (unlikely(status & AR5K_INT_RXORN)) {
/*
@@ -2717,8 +2722,11 @@ ath5k_intr(int irq, void *dev_id)
* this guess is copied from the HAL.
*/
sc->stats.rxorn_intr++;
- if (ah->ah_mac_srev < AR5K_SREV_AR5212)
+ if (ah->ah_mac_srev < AR5K_SREV_AR5212) {
+ ATH5K_DBG(sc, ATH5K_DEBUG_RESET,
+ "rx overrun, resetting\n");
tasklet_schedule(&sc->restq);
+ }
else
tasklet_schedule(&sc->rxtq);
} else {
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index 0f2e37d..5984edc 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -278,6 +278,7 @@ static ssize_t write_file_reset(struct file *file,
size_t count, loff_t *ppos)
{
struct ath5k_softc *sc = file->private_data;
+ ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "debug file triggered reset\n");
tasklet_schedule(&sc->restq);
return count;
}
^ permalink raw reply related
* [PATCH 02/17] ath5k: rename ath5k_txbuf_free() to ath5k_txbuf_free_skb()
From: Bruno Randolf @ 2010-06-16 10:11 UTC (permalink / raw)
To: linville; +Cc: ath5k-devel, linux-wireless
In-Reply-To: <20100616100809.10067.34787.stgit@tt-desk>
Rename ath5k_txbuf_free() to ath5k_txbuf_free_skb() since this is what it does:
it frees the skb and not the buf. Same for ath5k_rxbuf_free().
Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
---
drivers/net/wireless/ath/ath5k/base.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 936afd7..8e6b54d 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -311,7 +311,8 @@ static int ath5k_rxbuf_setup(struct ath5k_softc *sc,
static int ath5k_txbuf_setup(struct ath5k_softc *sc,
struct ath5k_buf *bf,
struct ath5k_txq *txq, int padsize);
-static inline void ath5k_txbuf_free(struct ath5k_softc *sc,
+
+static inline void ath5k_txbuf_free_skb(struct ath5k_softc *sc,
struct ath5k_buf *bf)
{
BUG_ON(!bf);
@@ -323,7 +324,7 @@ static inline void ath5k_txbuf_free(struct ath5k_softc *sc,
bf->skb = NULL;
}
-static inline void ath5k_rxbuf_free(struct ath5k_softc *sc,
+static inline void ath5k_rxbuf_free_skb(struct ath5k_softc *sc,
struct ath5k_buf *bf)
{
struct ath5k_hw *ah = sc->ah;
@@ -1444,11 +1445,11 @@ ath5k_desc_free(struct ath5k_softc *sc, struct pci_dev *pdev)
{
struct ath5k_buf *bf;
- ath5k_txbuf_free(sc, sc->bbuf);
+ ath5k_txbuf_free_skb(sc, sc->bbuf);
list_for_each_entry(bf, &sc->txbuf, list)
- ath5k_txbuf_free(sc, bf);
+ ath5k_txbuf_free_skb(sc, bf);
list_for_each_entry(bf, &sc->rxbuf, list)
- ath5k_rxbuf_free(sc, bf);
+ ath5k_rxbuf_free_skb(sc, bf);
/* Free memory associated with all descriptors */
pci_free_consistent(pdev, sc->desc_len, sc->desc, sc->desc_daddr);
@@ -1603,7 +1604,7 @@ ath5k_txq_drainq(struct ath5k_softc *sc, struct ath5k_txq *txq)
list_for_each_entry_safe(bf, bf0, &txq->q, list) {
ath5k_debug_printtxbuf(sc, bf);
- ath5k_txbuf_free(sc, bf);
+ ath5k_txbuf_free_skb(sc, bf);
spin_lock_bh(&sc->txbuflock);
list_move_tail(&bf->list, &sc->txbuf);
@@ -2650,7 +2651,7 @@ ath5k_stop_hw(struct ath5k_softc *sc)
ATH5K_DBG(sc, ATH5K_DEBUG_RESET,
"putting device to sleep\n");
}
- ath5k_txbuf_free(sc, sc->bbuf);
+ ath5k_txbuf_free_skb(sc, sc->bbuf);
mmiowb();
mutex_unlock(&sc->lock);
@@ -3376,7 +3377,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
ath5k_debug_dump_skb(sc, skb, "BC ", 1);
- ath5k_txbuf_free(sc, sc->bbuf);
+ ath5k_txbuf_free_skb(sc, sc->bbuf);
sc->bbuf->skb = skb;
ret = ath5k_beacon_setup(sc, sc->bbuf);
if (ret)
^ permalink raw reply related
* [PATCH 03/17] ath5k: fix some comment typos
From: Bruno Randolf @ 2010-06-16 10:11 UTC (permalink / raw)
To: linville; +Cc: ath5k-devel, linux-wireless
In-Reply-To: <20100616100809.10067.34787.stgit@tt-desk>
Fix comment about dma sizes, brackets were missing. Replace 'insure' with
'ensure'.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
---
drivers/net/wireless/ath/ath5k/ath5k.h | 2 +-
drivers/net/wireless/ath/ath5k/base.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index cf16318..387c120 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -566,7 +566,7 @@ enum ath5k_pkt_type {
)
/*
- * DMA size definitions (2^n+2)
+ * DMA size definitions (2^(n+2))
*/
enum ath5k_dmasize {
AR5K_DMASIZE_4B = 0,
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 8e6b54d..5bd9a39 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1230,13 +1230,13 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
* not get overrun under high load (as can happen with a
* 5212 when ANI processing enables PHY error frames).
*
- * To insure the last descriptor is self-linked we create
+ * To ensure the last descriptor is self-linked we create
* each descriptor as self-linked and add it to the end. As
* each additional descriptor is added the previous self-linked
- * entry is ``fixed'' naturally. This should be safe even
+ * entry is "fixed" naturally. This should be safe even
* if DMA is happening. When processing RX interrupts we
* never remove/process the last, self-linked, entry on the
- * descriptor list. This insures the hardware always has
+ * descriptor list. This ensures the hardware always has
* someplace to write a new frame.
*/
ds = bf->desc;
^ permalink raw reply related
* [PATCH 04/17] ath5k: fix rx descriptor debugging
From: Bruno Randolf @ 2010-06-16 10:11 UTC (permalink / raw)
To: linville; +Cc: ath5k-devel, linux-wireless
In-Reply-To: <20100616100809.10067.34787.stgit@tt-desk>
In the debug ouptut rx_status_0 was printed twice instead of rx_status_1. Also
make the debug message more clear.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
---
drivers/net/wireless/ath/ath5k/debug.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index 5984edc..02db66e 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -925,7 +925,7 @@ ath5k_debug_printrxbuf(struct ath5k_buf *bf, int done,
ds, (unsigned long long)bf->daddr,
ds->ds_link, ds->ds_data,
rd->rx_ctl.rx_control_0, rd->rx_ctl.rx_control_1,
- rd->u.rx_stat.rx_status_0, rd->u.rx_stat.rx_status_0,
+ rd->u.rx_stat.rx_status_0, rd->u.rx_stat.rx_status_1,
!done ? ' ' : (rs->rs_status == 0) ? '*' : '!');
}
@@ -940,7 +940,7 @@ ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah)
if (likely(!(sc->debug.level & ATH5K_DEBUG_RESET)))
return;
- printk(KERN_DEBUG "rx queue %x, link %p\n",
+ printk(KERN_DEBUG "rxdp %x, rxlink %p\n",
ath5k_hw_get_rxdp(ah), sc->rxlink);
spin_lock_bh(&sc->rxbuflock);
^ permalink raw reply related
* [PATCH 05/17] ath5k: print more errors when decriptor setup fails
From: Bruno Randolf @ 2010-06-16 10:11 UTC (permalink / raw)
To: linville; +Cc: ath5k-devel, linux-wireless
In-Reply-To: <20100616100809.10067.34787.stgit@tt-desk>
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
drivers/net/wireless/ath/ath5k/base.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 5bd9a39..6c303d5 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1243,8 +1243,10 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
ds->ds_link = bf->daddr; /* link to self */
ds->ds_data = bf->skbaddr;
ret = ah->ah_setup_rx_desc(ah, ds, ah->common.rx_bufsize, 0);
- if (ret)
+ if (ret) {
+ ATH5K_ERR(sc, "%s: could not setup RX desc\n", __func__);
return ret;
+ }
if (sc->rxlink != NULL)
*sc->rxlink = bf->daddr;
^ permalink raw reply related
* [PATCH 06/17] ath5k: reset more pointers after we free skbs
From: Bruno Randolf @ 2010-06-16 10:11 UTC (permalink / raw)
To: linville; +Cc: ath5k-devel, linux-wireless
In-Reply-To: <20100616100809.10067.34787.stgit@tt-desk>
After we free skbs for receive or transmit descriptors, make sure we have no
pointers to the now invalid memory address.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
---
drivers/net/wireless/ath/ath5k/base.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 6c303d5..5479f85 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -322,6 +322,8 @@ static inline void ath5k_txbuf_free_skb(struct ath5k_softc *sc,
PCI_DMA_TODEVICE);
dev_kfree_skb_any(bf->skb);
bf->skb = NULL;
+ bf->skbaddr = 0;
+ bf->desc->ds_data = 0;
}
static inline void ath5k_rxbuf_free_skb(struct ath5k_softc *sc,
@@ -337,6 +339,8 @@ static inline void ath5k_rxbuf_free_skb(struct ath5k_softc *sc,
PCI_DMA_FROMDEVICE);
dev_kfree_skb_any(bf->skb);
bf->skb = NULL;
+ bf->skbaddr = 0;
+ bf->desc->ds_data = 0;
}
@@ -1455,9 +1459,12 @@ ath5k_desc_free(struct ath5k_softc *sc, struct pci_dev *pdev)
/* Free memory associated with all descriptors */
pci_free_consistent(pdev, sc->desc_len, sc->desc, sc->desc_daddr);
+ sc->desc = NULL;
+ sc->desc_daddr = 0;
kfree(sc->bufptr);
sc->bufptr = NULL;
+ sc->bbuf = NULL;
}
^ permalink raw reply related
* [PATCH 07/17] ath5k: unify rx descriptor error handling
From: Bruno Randolf @ 2010-06-16 10:11 UTC (permalink / raw)
To: linville; +Cc: ath5k-devel, linux-wireless
In-Reply-To: <20100616100809.10067.34787.stgit@tt-desk>
There is no reason for a special handling (return) here, just break like we do
with the checks before.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
---
drivers/net/wireless/ath/ath5k/base.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 5479f85..d9df114 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1937,8 +1937,7 @@ ath5k_tasklet_rx(unsigned long data)
else if (unlikely(ret)) {
ATH5K_ERR(sc, "error in processing rx descriptor\n");
sc->stats.rxerr_proc++;
- spin_unlock(&sc->rxbuflock);
- return;
+ break;
}
sc->stats.rx_all_count++;
^ 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