* Re: [PATCH] rtl8187: Fix kernel oops when device is removed when LEDS enabled (Bugzilla #14539)
From: Larry Finger @ 2009-11-05 5:16 UTC (permalink / raw)
To: Richard Farina
Cc: Herton Ronaldo Krzesinski, John W. Linville, Christian Lamparter,
Hin-Tak Leung, linux-wireless
In-Reply-To: <4AF25AA6.60606@gmail.com>
On 11/04/2009 10:55 PM, Richard Farina wrote:
> Using kernel 2.6.29 and compat-wireless-stable 2.6.31* I am able to make
> it flake. I may be the only one lucky enough to make this explode with
> a high degree of accuracy but I can't see why we wouldn't fix what we
> know is a bug waiting to happen. My vote is to add this patch to
> 2.6.31.x as well.
With compat-wireless-stable 2.6.31, you essentially have the wireless
drivers of 2.6.32, which does have the problem. I could not make the
problem happen with vanilla 2.6.31, which is why I do not think we
need to send the fix to 2.6.31.Y. Of course, your system is much more
sensitive than mine. If you get the kernel panic with 2.6.31, then we
will need to reconsider. As openSUSE 11.2 will be out in a little over
a week using the 2.6.31 kernel, the problem may show up there.
Larry
^ permalink raw reply
* Re: [PATCH] rtl8187: Fix kernel oops when device is removed when LEDS enabled (Bugzilla #14539)
From: Larry Finger @ 2009-11-05 6:00 UTC (permalink / raw)
To: John W. Linville
Cc: Herton Ronaldo Krzesinski, Hin-Tak Leung, sidhayn, linux-wireless,
mcgrof, johannes
In-Reply-To: <20091104184700.GK12965@tuxdriver.com>
On 11/04/2009 12:47 PM, John W. Linville wrote:
>
> They are musings -- but feel free to be inspired! :-)
>
I was somewhat inspired and tried the following alternative patch:
++++++++++++++++++++++++++++++++++++++++++++++++\
Index: wireless-testing/drivers/net/wireless/rtl818x/rtl8187_leds.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtl818x/rtl8187_leds.c
+++ wireless-testing/drivers/net/wireless/rtl818x/rtl8187_leds.c
@@ -107,6 +107,9 @@ static void rtl8187_led_brightness_set(s
struct ieee80211_hw *hw = led->dev;
struct rtl8187_priv *priv = hw->priv;
+ /* detect shutting down */
+ if (priv->leds_off)
+ return;
if (brightness == LED_OFF) {
ieee80211_queue_delayed_work(hw, &priv->led_off, 0);
/* The LED is off for 1/20 sec so that it just blinks. */
@@ -179,6 +182,7 @@ void rtl8187_leds_init(struct ieee80211_
ledpin = LED_PIN_GPIO0;
}
+ priv->leds_off = false;
INIT_DELAYED_WORK(&priv->led_on, led_turn_on);
INIT_DELAYED_WORK(&priv->led_off, led_turn_off);
@@ -210,6 +214,7 @@ void rtl8187_leds_exit(struct ieee80211_
/* turn the LED off before exiting */
ieee80211_queue_delayed_work(dev, &priv->led_off, 0);
+ priv->leds_off = true;
cancel_delayed_work_sync(&priv->led_off);
cancel_delayed_work_sync(&priv->led_on);
rtl8187_unregister_led(&priv->led_rx);
Index: wireless-testing/drivers/net/wireless/rtl818x/rtl8187.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtl818x/rtl8187.h
+++ wireless-testing/drivers/net/wireless/rtl818x/rtl8187.h
@@ -134,6 +134,7 @@ struct rtl8187_priv {
__le32 bits32;
} *io_dmabuf;
bool rfkill_off;
+ bool leds_off;
};
void rtl8187_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data);
++++++++++++++++++++++++++++++++++++++++++++++
Yes, I know it is white-space damaged. I do not want it being applied!
By adding a new variable that is set whenever the LED system is being
shutdown, the kernel no longer panics; however, the LED is not turned
off on shutdown, further confirmation that USB transfers take a long
time to happen. I could add an msleep() between queuing the led_off
work and setting the leds_off flag, but this just seems like extra
complexity. I think we should go with the counter-intuitive order on
the shutdown.
Larry
^ permalink raw reply
* [PATCH] b43: Remove deprecated 'qual' from returned RX status
From: Larry Finger @ 2009-11-05 6:08 UTC (permalink / raw)
To: John W Linville, Michael Buesch; +Cc: linux-wireless
With the deprecation of the qual member of ieee80211_rx_status, that
calculation and an associated constant can be removed.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
John,
This is 2.6.33 material.
Larry
---
Index: wireless-testing/drivers/net/wireless/b43/b43.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/b43.h
+++ wireless-testing/drivers/net/wireless/b43/b43.h
@@ -26,8 +26,6 @@
# define B43_DEBUG 0
#endif
-#define B43_RX_MAX_SSI 60
-
/* MMIO offsets */
#define B43_MMIO_DMA0_REASON 0x20
#define B43_MMIO_DMA0_IRQ_MASK 0x24
Index: wireless-testing/drivers/net/wireless/b43/xmit.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/xmit.c
+++ wireless-testing/drivers/net/wireless/b43/xmit.c
@@ -621,7 +621,6 @@ void b43_rx(struct b43_wldev *dev, struc
(phystat0 & B43_RX_PHYST0_OFDM),
(phystat0 & B43_RX_PHYST0_GAINCTL),
(phystat3 & B43_RX_PHYST3_TRSTATE));
- status.qual = (rxhdr->jssi * 100) / B43_RX_MAX_SSI;
}
if (phystat0 & B43_RX_PHYST0_OFDM)
^ permalink raw reply
* [PATCH] b43legacy: Remove deprecated 'qual' from returned RX status
From: Larry Finger @ 2009-11-05 6:09 UTC (permalink / raw)
To: John W Linville, Michael Buesch; +Cc: linux-wireless
With the deprecation of the qual member of ieee80211_rx_status, that
calculation and an associated constant can be removed.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
John,
This is 2.6.33 material.
Larry
---
Index: wireless-testing/drivers/net/wireless/b43legacy/b43legacy.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43legacy/b43legacy.h
+++ wireless-testing/drivers/net/wireless/b43legacy/b43legacy.h
@@ -29,8 +29,6 @@
#define B43legacy_IRQWAIT_MAX_RETRIES 20
-#define B43legacy_RX_MAX_SSI 60 /* best guess at max ssi */
-
/* MMIO offsets */
#define B43legacy_MMIO_DMA0_REASON 0x20
#define B43legacy_MMIO_DMA0_IRQ_MASK 0x24
Index: wireless-testing/drivers/net/wireless/b43legacy/xmit.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43legacy/xmit.c
+++ wireless-testing/drivers/net/wireless/b43legacy/xmit.c
@@ -549,7 +549,6 @@ void b43legacy_rx(struct b43legacy_wldev
(phystat0 & B43legacy_RX_PHYST0_GAINCTL),
(phystat3 & B43legacy_RX_PHYST3_TRSTATE));
status.noise = dev->stats.link_noise;
- status.qual = (jssi * 100) / B43legacy_RX_MAX_SSI;
/* change to support A PHY */
if (phystat0 & B43legacy_RX_PHYST0_OFDM)
status.rate_idx = b43legacy_plcp_get_bitrate_idx_ofdm(plcp, false);
^ permalink raw reply
* [PATCH] rtl8187: Remove deprecated 'qual' from returned RX status
From: Larry Finger @ 2009-11-05 6:09 UTC (permalink / raw)
To: John W Linville, Hin-Tak Leung, Herton Ronaldo Krzesinski; +Cc: linux-wireless
The qual member of ieee80211_rx_status is deprecated. As a result, this
driver no longer needs to calculate a quality value.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
John,
This is 2.6.33 material.
Larry
---
Index: wireless-testing/drivers/net/wireless/rtl818x/rtl8187_dev.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtl818x/rtl8187_dev.c
+++ wireless-testing/drivers/net/wireless/rtl818x/rtl8187_dev.c
@@ -320,7 +320,6 @@ static void rtl8187_rx_cb(struct urb *ur
struct ieee80211_rx_status rx_status = { 0 };
int rate, signal;
u32 flags;
- u32 quality;
unsigned long f;
spin_lock_irqsave(&priv->rx_queue.lock, f);
@@ -338,10 +337,9 @@ static void rtl8187_rx_cb(struct urb *ur
(typeof(hdr))(skb_tail_pointer(skb) - sizeof(*hdr));
flags = le32_to_cpu(hdr->flags);
/* As with the RTL8187B below, the AGC is used to calculate
- * signal strength and quality. In this case, the scaling
+ * signal strength. In this case, the scaling
* constants are derived from the output of p54usb.
*/
- quality = 130 - ((41 * hdr->agc) >> 6);
signal = -4 - ((27 * hdr->agc) >> 6);
rx_status.antenna = (hdr->signal >> 7) & 1;
rx_status.mactime = le64_to_cpu(hdr->mac_time);
@@ -354,23 +352,18 @@ static void rtl8187_rx_cb(struct urb *ur
* In testing, none of these quantities show qualitative
* agreement with AP signal strength, except for the AGC,
* which is inversely proportional to the strength of the
- * signal. In the following, the quality and signal strength
- * are derived from the AGC. The arbitrary scaling constants
+ * signal. In the following, the signal strength
+ * is derived from the AGC. The arbitrary scaling constants
* are chosen to make the results close to the values obtained
* for a BCM4312 using b43 as the driver. The noise is ignored
* for now.
*/
flags = le32_to_cpu(hdr->flags);
- quality = 170 - hdr->agc;
signal = 14 - hdr->agc / 2;
rx_status.antenna = (hdr->rssi >> 7) & 1;
rx_status.mactime = le64_to_cpu(hdr->mac_time);
}
- if (quality > 100)
- quality = 100;
- rx_status.qual = quality;
- priv->quality = quality;
rx_status.signal = signal;
priv->signal = signal;
rate = (flags >> 20) & 0xF;
Index: wireless-testing/drivers/net/wireless/rtl818x/rtl8187.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtl818x/rtl8187.h
+++ wireless-testing/drivers/net/wireless/rtl818x/rtl8187.h
@@ -119,7 +119,6 @@ struct rtl8187_priv {
} hw_rev;
struct sk_buff_head rx_queue;
u8 signal;
- u8 quality;
u8 noise;
u8 slot_time;
u8 aifsn[4];
^ permalink raw reply
* Re: Reverting 5d423 fixes loading of ath9k on Acer Extensa 7630EZ
From: Ingo Molnar @ 2009-11-05 7:14 UTC (permalink / raw)
To: Linus Torvalds
Cc: Luis R. Rodriguez, linux-kernel, linux-wireless, Yannick Roehlly,
Yinghai Lu, Jesse Barnes, Ivan Kokshaysky, Andrew Morton,
John W. Linville, berndl81, Greg KH
In-Reply-To: <alpine.LFD.2.01.0911041551220.31845@localhost.localdomain>
* Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Wed, 4 Nov 2009, Luis R. Rodriguez wrote:
> >
> > Can you please consider reviewing this issue and help determine if
> > this indeed needs to be reverted for 2.6.32 and the next 2.6.31.y.
> >
> > I am curious if other devices would work by reverting this as well.
> > [ ... ] For details please feel free to check:
> >
> > http://bugzilla.kernel.org/show_bug.cgi?id=14402
>
> That same commit was the cause for
>
> http://bugzilla.kernel.org/show_bug.cgi?id=13940
>
> and we just increased the rounding to make it go away (see commit
> 15b812f1). But that was a hack.
>
> And if that didn't help the ath9k case, then we should just revert
> entirely.
Agreed - below is the combo 15b812f1 + 5d423ccd revert. (Would be nice
to get the boot log of the latest post-15b812f1 kernel that Yinghai
asked for before we revert, in the hope of better understanding the
problem.)
Thanks,
Ingo
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index d17d482..b322e30 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -617,7 +617,7 @@ __init int e820_search_gap(unsigned long *gapstart, unsigned long *gapsize,
*/
__init void e820_setup_gap(void)
{
- unsigned long gapstart, gapsize;
+ unsigned long gapstart, gapsize, round;
int found;
gapstart = 0x10000000;
@@ -634,9 +634,14 @@ __init void e820_setup_gap(void)
#endif
/*
- * e820_reserve_resources_late protect stolen RAM already
+ * See how much we want to round up: start off with
+ * rounding to the next 1MB area.
*/
- pci_mem_start = gapstart;
+ round = 0x100000;
+ while ((gapsize >> 4) > round)
+ round += round;
+ /* Fun with two's complement */
+ pci_mem_start = (gapstart + round) & -round;
printk(KERN_INFO
"Allocating PCI resources starting at %lx (gap: %lx:%lx)\n",
@@ -1378,8 +1383,8 @@ static unsigned long ram_alignment(resource_size_t pos)
if (mb < 16)
return 1024*1024;
- /* To 64MB for anything above that */
- return 64*1024*1024;
+ /* To 32MB for anything above that */
+ return 32*1024*1024;
}
#define MAX_RESOURCE_SIZE ((resource_size_t)-1)
^ permalink raw reply related
* [PATCH net-next-2.6] mac80211: Speedup ieee80211_remove_interfaces()
From: Eric Dumazet @ 2009-11-05 10:06 UTC (permalink / raw)
To: David S. Miller; +Cc: Linux Netdev List, John W. Linville
Speedup ieee80211_remove_interfaces() by factorizing synchronize_rcu() calls
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/mac80211/iface.c | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 14f10eb..a445f50 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -852,22 +852,18 @@ void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata)
void ieee80211_remove_interfaces(struct ieee80211_local *local)
{
struct ieee80211_sub_if_data *sdata, *tmp;
+ LIST_HEAD(unreg_list);
ASSERT_RTNL();
+ mutex_lock(&local->iflist_mtx);
list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) {
- /*
- * we cannot hold the iflist_mtx across unregister_netdevice,
- * but we only need to hold it for list modifications to lock
- * out readers since we're under the RTNL here as all other
- * writers.
- */
- mutex_lock(&local->iflist_mtx);
list_del(&sdata->list);
- mutex_unlock(&local->iflist_mtx);
- unregister_netdevice(sdata->dev);
+ unregister_netdevice_queue(sdata->dev, &unreg_list);
}
+ mutex_unlock(&local->iflist_mtx);
+ unregister_netdevice_many(&unreg_list);
}
static u32 ieee80211_idle_off(struct ieee80211_local *local,
^ permalink raw reply related
* BUG: oops when "rmmod ipw2200"
From: Holger Schurig @ 2009-11-05 14:59 UTC (permalink / raw)
To: linux-wireless
This happened on wireless-testing v2.6.32-rc6-41575-g5e68bfb. I
modprobed ipw2200, put it into monitor mode, used tshark a while to
monitor, then I stopped tshark, "ifconfig eth2 down" and finally
"rmmod ipw2200", and voila:
[ 917.189620] ------------[ cut here ]------------
[ 917.189717] kernel BUG at net/wireless/core.c:543!
[ 917.189805] invalid opcode: 0000 [#1] PREEMPT SMP
[ 917.190002] last sysfs file: /sys/devices/pci0000:00/0000:00:1e.0/0000:02:0d.0/firmware/0000:02:0d.0/loading
[ 917.190136] Modules linked in: lib80211_crypt_wep ipw2200(-) libipw lib80211 ath5k mac80211 ath cfg80211 psmouse uhci_hcd
[ 917.190680]
[ 917.190759] Pid: 1763, comm: rmmod Not tainted (2.6.32-rc6-wl #26) Amilo M1425
[ 917.190886] EIP: 0060:[<f8accf34>] EFLAGS: 00010202 CPU: 0
[ 917.190992] EIP is at wiphy_unregister+0xd3/0x175 [cfg80211]
[ 917.191083] EAX: f601d4c4 EBX: 00000000 ECX: 00000000 EDX: f79e8600
[ 917.191176] ESI: f601d400 EDI: f95b4350 EBP: f6009eb4 ESP: f6009e8c
[ 917.191269] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
[ 917.191360] Process rmmod (pid: 1763, ti=f6008000 task=f79e8130 task.ti=f6008000)
[ 917.191486] Stack:
[ 917.191562] f601d5a0 f601d484 f6460e98 f6009ea0 c01407ee f6009eb8 00000246 f64604c0
[ 917.191916] <0> f6460e5c f95b4350 f6009ec0 f94fd030 f6460e98 f6009edc f95a9d4f f787bc00
[ 917.192100] <0> f787bc58 f787bc00 f95b4350 f95b4350 f6009ee8 c0207fca f787bc58 f6009ef8
[ 917.192100] Call Trace:
[ 917.192100] [<c01407ee>] ? trace_hardirqs_on+0xb/0xd
[ 917.192100] [<f94fd030>] ? unregister_ieee80211+0xe/0x27 [libipw]
[ 917.192100] [<f95a9d4f>] ? ipw_pci_remove+0x59/0x227 [ipw2200]
[ 917.192100] [<c0207fca>] ? pci_device_remove+0x19/0x39
[ 917.192100] [<c02b93a4>] ? __device_release_driver+0x59/0x9d
[ 917.192100] [<c02b944f>] ? driver_detach+0x67/0x85
[ 917.192100] [<c02b88d6>] ? bus_remove_driver+0x69/0x85
[ 917.192100] [<c02b9878>] ? driver_unregister+0x4d/0x54
[ 917.192100] [<c02081c3>] ? pci_unregister_driver+0x28/0x71
[ 917.192100] [<f95a9cf4>] ? ipw_exit+0x1c/0x1e [ipw2200]
[ 917.192100] [<c0148e2b>] ? sys_delete_module+0x192/0x1ef
[ 917.192100] [<c0162cdb>] ? remove_vma+0x52/0x58
[ 917.192100] [<c01028bb>] ? sysenter_exit+0xf/0x18
[ 917.192100] [<c0102888>] ? sysenter_do_call+0x12/0x36
[ 917.192100] Code: 74 07 e8 81 bc 8c c7 eb c8 8d 55 e0 89 f8 e8 d6 6d 66 c7 8b 45 dc 31 d2 e8 81 cc 8c c7 8d 86 c4 00 00 00 39 86 c4 00 00 00 74 04 <0f> 0b eb fe 8b 45 dc 8d 5e 0c e8 5a cc 8c c7 8b 86 94 03 00 00
[ 917.192100] EIP: [<f8accf34>] wiphy_unregister+0xd3/0x175 [cfg80211] SS:ESP 0068:f6009e8c
[ 917.203718] ---[ end trace bcaaf449945a5100 ]---
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: BUG: oops when "rmmod ipw2200"
From: John W. Linville @ 2009-11-05 15:33 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless, Zhu Yi
In-Reply-To: <S1754043AbZKEPJ1/20091105150927Z+225@vger.kernel.org>
On Thu, Nov 05, 2009 at 03:59:16PM +0100, Holger Schurig wrote:
> This happened on wireless-testing v2.6.32-rc6-41575-g5e68bfb. I
> modprobed ipw2200, put it into monitor mode, used tshark a while to
> monitor, then I stopped tshark, "ifconfig eth2 down" and finally
> "rmmod ipw2200", and voila:
>
> [ 917.189620] ------------[ cut here ]------------
> [ 917.189717] kernel BUG at net/wireless/core.c:543!
> [ 917.189805] invalid opcode: 0000 [#1] PREEMPT SMP
> [ 917.190002] last sysfs file: /sys/devices/pci0000:00/0000:00:1e.0/0000:02:0d.0/firmware/0000:02:0d.0/loading
> [ 917.190136] Modules linked in: lib80211_crypt_wep ipw2200(-) libipw lib80211 ath5k mac80211 ath cfg80211 psmouse uhci_hcd
<snip>
Crud...this has to be the following:
commit e6c5fc53d0f44a772398402ee8a1879818e42b4e
Author: Zhu Yi <yi.zhu@intel.com>
Date: Thu Oct 15 14:50:28 2009 +0800
ipw2200: fix oops on missing firmware
For non-monitor interfaces, the syntax for alloc_ieee80211/free_80211
is wrong. Because alloc_ieee80211 only creates (wiphy_new) a wiphy, but
free_80211() does wiphy_unregister() also. This is only correct when
the later wiphy_register() is called successfully, which apparently
is not the case for your fw doesn't exist one.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Can you revert that and attempt to recreate?
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* Re: BUG: oops when "rmmod ipw2200"
From: Holger Schurig @ 2009-11-05 15:53 UTC (permalink / raw)
To: John W. Linville; +Cc: Holger Schurig, linux-wireless, Zhu Yi
In-Reply-To: <20091105153329.GB2817@tuxdriver.com>
At Thu, 5 Nov 2009 10:33:29 -0500,
> Crud...this has to be the following:
>
> commit e6c5fc53d0f44a772398402ee8a1879818e42b4e
...
> Can you revert that and attempt to recreate?
After reverting this, the oops went away.
I just get some leak message, but I can ignore this message for now (I
use this device only for monitoring the other devices ...).
[ 2935.225315] lib80211: common routines for IEEE802.11 drivers
[ 2935.225447] lib80211_crypt: registered algorithm 'NULL'
[ 2935.233860] ieee80211: 802.11 data/management/control stack, git-1.1.13
[ 2935.233911] ieee80211: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>
[ 2935.244407] ipw2200: Intel(R) PRO/Wireless 2200/2915 Network Driver, 1.2.2kmpr
[ 2935.244459] ipw2200: Copyright(c) 2003-2006 Intel Corporation
[ 2935.244637] ipw2200 0000:02:0d.0: PCI INT A -> Link[LNKA] -> GSI 11 (level, low) -> IRQ 11
[ 2935.245503] ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection
[ 2935.245910] ipw2200 0000:02:0d.0: firmware: requesting ipw2200-bss.fw
[ 2935.433770] ipw2200: Detected geography ZZR (14 802.11bg channels, 0 802.11a channels)
[ 2935.606417] lib80211_crypt: registered algorithm 'WEP'
[ 2937.377928] ipw2200 0000:02:0d.0: firmware: requesting ipw2200-sniffer.fw
[ 2939.391363] warning: `tshark' uses 32-bit capabilities (legacy support in use)
[ 2941.657345] device eth2 entered promiscuous mode
[ 2943.028308] device eth2 left promiscuous mode
[ 2948.818739] __dev_addr_discard: address leakage! da_users=1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 2949.076876] ipw2200 0000:02:0d.0: PCI INT A disable
^ permalink raw reply
* [PATCH] usb: Check results of dma_map_single
From: Larry Finger @ 2009-11-05 16:37 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb, linux-wireless
In map_urb_for_dma(), the DMA address returned by dma_map_single()
is not checked to determine if it is legal. This lack of checking
contributed to a problem with the libertas wireless driver
(http://marc.info/?l=linux-wireless&m=125695331205062&w=2). The
difficulty was not detected until the buffer was unmapped. By this
time memory corruption had occurred.
The situation is fixed by testing the returned DMA address, and
returning -EAGAIN if the address is invalid.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
Index: linux-2.6/drivers/usb/core/hcd.c
===================================================================
--- linux-2.6.orig/drivers/usb/core/hcd.c
+++ linux-2.6/drivers/usb/core/hcd.c
@@ -1275,13 +1275,16 @@ static int map_urb_for_dma(struct usb_hc
if (usb_endpoint_xfer_control(&urb->ep->desc)
&& !(urb->transfer_flags & URB_NO_SETUP_DMA_MAP)) {
- if (hcd->self.uses_dma)
+ if (hcd->self.uses_dma) {
urb->setup_dma = dma_map_single(
hcd->self.controller,
urb->setup_packet,
sizeof(struct usb_ctrlrequest),
DMA_TO_DEVICE);
- else if (hcd->driver->flags & HCD_LOCAL_MEM)
+ if (dma_mapping_error(hcd->self.controller,
+ urb->setup_dma))
+ return -EAGAIN;
+ } else if (hcd->driver->flags & HCD_LOCAL_MEM)
ret = hcd_alloc_coherent(
urb->dev->bus, mem_flags,
&urb->setup_dma,
@@ -1293,13 +1296,16 @@ static int map_urb_for_dma(struct usb_hc
dir = usb_urb_dir_in(urb) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
if (ret == 0 && urb->transfer_buffer_length != 0
&& !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP)) {
- if (hcd->self.uses_dma)
+ if (hcd->self.uses_dma) {
urb->transfer_dma = dma_map_single (
hcd->self.controller,
urb->transfer_buffer,
urb->transfer_buffer_length,
dir);
- else if (hcd->driver->flags & HCD_LOCAL_MEM) {
+ if (dma_mapping_error(hcd->self.controller,
+ urb->transfer_dma))
+ return -EAGAIN;
+ } else if (hcd->driver->flags & HCD_LOCAL_MEM) {
ret = hcd_alloc_coherent(
urb->dev->bus, mem_flags,
&urb->transfer_dma,
^ permalink raw reply
* [PATCH] wireless-regdb: update US rules for 5600 MHz - 5650 MHz
From: Luis R. Rodriguez @ 2009-11-05 17:46 UTC (permalink / raw)
To: linville
Cc: linux-wireless, Luis R. Rodriguez, Michael Green,
Senthil Balasubramanian, David Quan, Vivek Natarajan
The FCC is trying to assist airports that use Terminal Doppler
Weather Radar (TDWR) systems in avoiding interference with
some outdoor wireless systems operating in the 5.4 GHz
(5470 MHz - 5725 MHz) band. One of the things they have decided
on is to disallow operation on the 5600 MHz - 5650 MHz frequency
range inclusive. What this means in practice is 5 GHz 802.11
devices programmed to operate in the US will have these
channels now disabled:
* 5600 MHz [120] (disabled)
* 5620 MHz [124] (disabled)
* 5640 MHz [128] (disabled)
Channel on 5660 MHz (132) will be left enabled as the channel
bandwidth is 20 MHz for legacy 802.11 networks but note that
HT40- will be disallowed for that channel. The HT40+ and HT40-
allowed channel map obviously changes. This is computed
dynamically on cfg80211 based on your allowed channel list.
For a US based device this is what you will get now
(excerpt from on /sys/kernel/debug/ieee80211/phy0):
.. etc ..
5540 HT40 -+
5560 HT40 -+
5580 HT40 -
5600 Disabled
5620 Disabled
5640 Disabled
5660 HT40 +
5680 HT40 -+
.. etc ..
The details on which this patch is based on is documented on
the FCC Knowledge based Publication Number: 443999 [1]
[1] https://fjallfoss.fcc.gov/oetcf/kdb/forms/FTSSearchResultPage.cfm?switch=P&id=41732
Cc: Michael Green <Michael.Green@atheros.com>
Cc: Senthil Balasubramanian <senthilkumar@atheros.com>
Cc: David Quan <David.Quan@atheros.com>
Cc: Vivek Natarajan <Vivek.Natarajan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
db.txt | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/db.txt b/db.txt
index 84be443..c71b35b 100644
--- a/db.txt
+++ b/db.txt
@@ -562,7 +562,8 @@ country US:
(2402 - 2472 @ 40), (3, 27)
(5170 - 5250 @ 40), (3, 17)
(5250 - 5330 @ 40), (3, 20), DFS
- (5490 - 5710 @ 40), (3, 20), DFS
+ (5490 - 5600 @ 40), (3, 20), DFS
+ (5650 - 5710 @ 40), (3, 20), DFS
(5735 - 5835 @ 40), (3, 30)
country UY:
--
1.6.5.2.143.g8cc62
^ permalink raw reply related
* Re: [PATCH 01/41] rt2800usb: make Kconfig help entry more helpful
From: Ivo van Doorn @ 2009-11-05 18:40 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: linux-wireless, Gertjan van Wingerde, linux-kernel,
John W. Linville
In-Reply-To: <20091104173158.28463.66661.sendpatchset@localhost.localdomain>
On Wednesday 04 November 2009, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] rt2800usb: make Kconfig help entry more helpful
>
> Document known issues with the driver to aid distribution makers,
> users and developers in making informed decisions instead of wasting
> their time needlessly.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
> ---
> This reflects the actual state of affairs for driver in Linus' tree.
>
> drivers/net/wireless/rt2x00/Kconfig | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> Index: b/drivers/net/wireless/rt2x00/Kconfig
> ===================================================================
> --- a/drivers/net/wireless/rt2x00/Kconfig
> +++ b/drivers/net/wireless/rt2x00/Kconfig
> @@ -104,7 +104,7 @@ config RT73USB
> When compiled as a module, this driver will be called rt73usb.
>
> config RT2800USB
> - tristate "Ralink rt2800 (USB) support"
> + tristate "Ralink rt2800 (USB) support (EXPERIMENTAL)"
> depends on USB && EXPERIMENTAL
> select RT2X00_LIB_USB
> select RT2X00_LIB_HT
> @@ -115,6 +115,10 @@ config RT2800USB
> This adds experimental support for rt2800 wireless chipset family.
> Supported chips: RT2770, RT2870 & RT3070.
>
> + Known issues:
> + - support for RT2870 chips doesn't work with 802.11n APs yet
> + - support for RT3070 chips is non-functional at the moment
> +
> When compiled as a module, this driver will be called "rt2800usb.ko".
>
> config RT2X00_LIB_PCI
>
^ permalink raw reply
* Re: [PATCH 02/41] rt2800pci: make Kconfig help entry more helpful
From: Ivo van Doorn @ 2009-11-05 18:41 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: linux-wireless, Gertjan van Wingerde, linux-kernel,
John W. Linville
In-Reply-To: <20091104173210.28463.95558.sendpatchset@localhost.localdomain>
On Wednesday 04 November 2009, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] rt2800pci: make Kconfig help entry more helpful
>
> Document known issues with the driver to aid distribution makers,
> users and developers in making informed decisions instead of wasting
> their time needlessly.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Making it depend on CONFIG_BROKEN makes more sense if the comment
is "non-functional".
Ivo
> ---
> This reflects the actual state of affairs for driver in net-next tree.
>
> drivers/net/wireless/rt2x00/Kconfig | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> Index: b/drivers/net/wireless/rt2x00/Kconfig
> ===================================================================
> --- a/drivers/net/wireless/rt2x00/Kconfig
> +++ b/drivers/net/wireless/rt2x00/Kconfig
> @@ -64,7 +64,7 @@ config RT2800PCI_SOC
> default y
>
> config RT2800PCI
> - tristate "Ralink rt2800 (PCI/PCMCIA) support"
> + tristate "Ralink rt2800 (PCI/PCMCIA) support (VERY EXPERIMENTAL)"
> depends on (RT2800PCI_PCI || RT2800PCI_SOC) && EXPERIMENTAL
> select RT2X00_LIB_PCI if RT2800PCI_PCI
> select RT2X00_LIB_SOC if RT2800PCI_SOC
> @@ -77,6 +77,9 @@ config RT2800PCI
> This adds support for rt2800 wireless chipset family.
> Supported chips: RT2760, RT2790, RT2860, RT2880, RT2890 & RT3052
>
> + This driver is non-functional at the moment and is intended for
> + developers.
> +
> When compiled as a module, this driver will be called "rt2800pci.ko".
>
> config RT2500USB
>
^ permalink raw reply
* Re: [PATCH 03/41] rt2800usb: fix rt2800usb_rfcsr_read()
From: Ivo van Doorn @ 2009-11-05 18:41 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: linux-wireless, Gertjan van Wingerde, linux-kernel,
John W. Linville
In-Reply-To: <20091104173217.28463.23610.sendpatchset@localhost.localdomain>
On Wednesday 04 November 2009, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] rt2800usb: fix rt2800usb_rfcsr_read()
>
> The driver should write the read request into RF_CSR_CFG register
> and not BBP_CSR_CFG one in rt2800usb_rfcsr_read().
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt2800usb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: b/drivers/net/wireless/rt2x00/rt2800usb.c
> ===================================================================
> --- a/drivers/net/wireless/rt2x00/rt2800usb.c
> +++ b/drivers/net/wireless/rt2x00/rt2800usb.c
> @@ -167,7 +167,7 @@ static void rt2800usb_rfcsr_read(struct
> rt2x00_set_field32(®, RF_CSR_CFG_WRITE, 0);
> rt2x00_set_field32(®, RF_CSR_CFG_BUSY, 1);
>
> - rt2x00usb_register_write_lock(rt2x00dev, BBP_CSR_CFG, reg);
> + rt2x00usb_register_write_lock(rt2x00dev, RF_CSR_CFG, reg);
>
> WAIT_FOR_RFCSR(rt2x00dev, ®);
> }
>
^ permalink raw reply
* Re: [PATCH 04/41] rt2800pci: fix crypto in TX frame
From: Ivo van Doorn @ 2009-11-05 18:41 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: linux-wireless, Gertjan van Wingerde, linux-kernel,
John W. Linville
In-Reply-To: <20091104173224.28463.49296.sendpatchset@localhost.localdomain>
On Wednesday 04 November 2009, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] rt2800pci: fix crypto in TX frame
>
> Based on rt2800usb patch from Benoit PAPILLAULT
> (commit 17616310836ad2cc45a64576ef0e1520b0dcc81b).
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt2800pci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: b/drivers/net/wireless/rt2x00/rt2800pci.c
> ===================================================================
> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> @@ -2195,7 +2195,7 @@ static void rt2800pci_write_tx_desc(stru
> rt2x00_set_field32(&word, TXWI_W1_BW_WIN_SIZE, txdesc->ba_size);
> rt2x00_set_field32(&word, TXWI_W1_WIRELESS_CLI_ID,
> test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags) ?
> - (skbdesc->entry->entry_idx + 1) : 0xff);
> + txdesc->key_idx : 0xff);
> rt2x00_set_field32(&word, TXWI_W1_MPDU_TOTAL_BYTE_COUNT,
> skb->len - txdesc->l2pad);
> rt2x00_set_field32(&word, TXWI_W1_PACKETID,
>
^ permalink raw reply
* Re: [PATCH 05/41] rt2800pci: fix comment about register access
From: Ivo van Doorn @ 2009-11-05 18:41 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: linux-wireless, Gertjan van Wingerde, linux-kernel,
John W. Linville
In-Reply-To: <20091104173232.28463.47998.sendpatchset@localhost.localdomain>
On Wednesday 04 November 2009, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] rt2800pci: fix comment about register access
>
> Registers used for indirect BBP and RF registers access are
> respectively BBPCSR and RFCSR, also make it clear that all CSR
> registers access goes through rt2x00pci_register_[read,write]()
> methods.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt2800pci.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> Index: b/drivers/net/wireless/rt2x00/rt2800pci.c
> ===================================================================
> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> @@ -56,8 +56,10 @@ MODULE_PARM_DESC(nohwcrypt, "Disable har
>
> /*
> * Register access.
> + * All access to the CSR registers will go through the methods
> + * rt2x00pci_register_read and rt2x00pci_register_write.
> * BBP and RF register require indirect register access,
> - * and use the CSR registers PHY_CSR3 and PHY_CSR4 to achieve this.
> + * and use the CSR registers BBPCSR and RFCSR to achieve this.
> * These indirect registers work with busy bits,
> * and we will try maximal REGISTER_BUSY_COUNT times to access
> * the register while taking a REGISTER_BUSY_DELAY us delay
>
^ permalink raw reply
* Re: [PATCH 06/41] rt2800pci: fix comment about IV/EIV fields
From: Ivo van Doorn @ 2009-11-05 18:41 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: linux-wireless, Gertjan van Wingerde, linux-kernel,
John W. Linville
In-Reply-To: <20091104173239.28463.22571.sendpatchset@localhost.localdomain>
On Wednesday 04 November 2009, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] rt2800pci: fix comment about IV/EIV fields
>
> The bit tested by hardware is TXD_W3_WIV and its value
> equals the negated value of ENTRY_TXD_ENCRYPT_IV bit.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt2800pci.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Index: b/drivers/net/wireless/rt2x00/rt2800pci.c
> ===================================================================
> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> @@ -2206,8 +2206,8 @@ static void rt2800pci_write_tx_desc(stru
>
> /*
> * Always write 0 to IV/EIV fields, hardware will insert the IV
> - * from the IVEIV register when ENTRY_TXD_ENCRYPT_IV is set to 0.
> - * When ENTRY_TXD_ENCRYPT_IV is set to 1 it will use the IV data
> + * from the IVEIV register when TXD_W3_WIV is set to 0.
> + * When TXD_W3_WIV is set to 1 it will use the IV data
> * from the descriptor. The TXWI_W1_WIRELESS_CLI_ID indicates which
> * crypto entry in the registers should be used to encrypt the frame.
> */
>
^ permalink raw reply
* Re: [PATCH 07/41] rt2x00: fix rt2x00usb_register_read() comment
From: Ivo van Doorn @ 2009-11-05 18:42 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: linux-wireless, Gertjan van Wingerde, linux-kernel,
John W. Linville
In-Reply-To: <20091104173250.28463.45273.sendpatchset@localhost.localdomain>
On Wednesday 04 November 2009, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] rt2x00: fix rt2x00usb_register_read() comment
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt2x00usb.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: b/drivers/net/wireless/rt2x00/rt2x00usb.h
> ===================================================================
> --- a/drivers/net/wireless/rt2x00/rt2x00usb.h
> +++ b/drivers/net/wireless/rt2x00/rt2x00usb.h
> @@ -232,7 +232,7 @@ static inline int rt2x00usb_eeprom_read(
> }
>
> /**
> - * rt2x00usb_regbusy_read - Read 32bit register word
> + * rt2x00usb_register_read - Read 32bit register word
> * @rt2x00dev: Device pointer, see &struct rt2x00_dev.
> * @offset: Register offset
> * @value: Pointer to where register contents should be stored
>
^ permalink raw reply
* Re: [PATCH 08/41] rt2800usb: use rt2x00usb_register_multiwrite() to set key entries
From: Ivo van Doorn @ 2009-11-05 18:42 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: linux-wireless, Gertjan van Wingerde, linux-kernel,
John W. Linville
In-Reply-To: <20091104173258.28463.94619.sendpatchset@localhost.localdomain>
On Wednesday 04 November 2009, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] rt2800usb: use rt2x00usb_register_multiwrite() to set key entries
>
> Since struct hw_key_entry is 32-bytes large and is smaller than
> CSR cache size (which is 64-bytes large) we can use the standard
> rt2x00usb_register_multiwrite() helper to set key entries.
>
> This cleanup is a part of preparations for later code unification.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt2800usb.c | 18 ++++--------------
> 1 file changed, 4 insertions(+), 14 deletions(-)
>
> Index: b/drivers/net/wireless/rt2x00/rt2800usb.c
> ===================================================================
> --- a/drivers/net/wireless/rt2x00/rt2800usb.c
> +++ b/drivers/net/wireless/rt2x00/rt2800usb.c
> @@ -392,7 +392,6 @@ static int rt2800usb_config_shared_key(s
> {
> struct hw_key_entry key_entry;
> struct rt2x00_field32 field;
> - int timeout;
> u32 offset;
> u32 reg;
>
> @@ -407,12 +406,8 @@ static int rt2800usb_config_shared_key(s
> sizeof(key_entry.rx_mic));
>
> offset = SHARED_KEY_ENTRY(key->hw_key_idx);
> - timeout = REGISTER_TIMEOUT32(sizeof(key_entry));
> - rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE,
> - USB_VENDOR_REQUEST_OUT,
> - offset, &key_entry,
> - sizeof(key_entry),
> - timeout);
> + rt2x00usb_register_multiwrite(rt2x00dev, offset,
> + &key_entry, sizeof(key_entry));
> }
>
> /*
> @@ -445,7 +440,6 @@ static int rt2800usb_config_pairwise_key
> struct ieee80211_key_conf *key)
> {
> struct hw_key_entry key_entry;
> - int timeout;
> u32 offset;
>
> if (crypto->cmd == SET_KEY) {
> @@ -467,12 +461,8 @@ static int rt2800usb_config_pairwise_key
> sizeof(key_entry.rx_mic));
>
> offset = PAIRWISE_KEY_ENTRY(key->hw_key_idx);
> - timeout = REGISTER_TIMEOUT32(sizeof(key_entry));
> - rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE,
> - USB_VENDOR_REQUEST_OUT,
> - offset, &key_entry,
> - sizeof(key_entry),
> - timeout);
> + rt2x00usb_register_multiwrite(rt2x00dev, offset,
> + &key_entry, sizeof(key_entry));
> }
>
> /*
>
^ permalink raw reply
* Re: [PATCH 09/41] rt2800usb: add rt2800_register_[read,write]() wrappers
From: Ivo van Doorn @ 2009-11-05 18:44 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: linux-wireless, Gertjan van Wingerde, linux-kernel,
John W. Linville
In-Reply-To: <20091104173305.28463.69600.sendpatchset@localhost.localdomain>
On Wednesday 04 November 2009, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] rt2800usb: add rt2800_register_[read,write]() wrappers
>
> Part of preparations for later code unification.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
^ permalink raw reply
* Re: [PATCH 10/41] rt2800pci: add rt2800_register_[read,write]() wrappers
From: Ivo van Doorn @ 2009-11-05 18:45 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: linux-wireless, Gertjan van Wingerde, linux-kernel,
John W. Linville
In-Reply-To: <20091104173313.28463.67108.sendpatchset@localhost.localdomain>
On Wednesday 04 November 2009, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] rt2800pci: add rt2800_register_[read,write]() wrappers
>
> Part of preparations for later code unification.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
^ permalink raw reply
* Re: [PATCH 11/41] rt2800usb: add rt2800_register_multi[read,write]() wrappers
From: Ivo van Doorn @ 2009-11-05 18:46 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: linux-wireless, Gertjan van Wingerde, linux-kernel,
John W. Linville
In-Reply-To: <20091104173320.28463.59233.sendpatchset@localhost.localdomain>
On Wednesday 04 November 2009, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] rt2800usb: add rt2800_register_multi[read,write]() wrappers
>
> Part of preparations for later code unification.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
^ permalink raw reply
* Re: [PATCH 12/41] rt2800pci: add rt2800_register_multi[read,write]() wrappers
From: Ivo van Doorn @ 2009-11-05 18:47 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: linux-wireless, Gertjan van Wingerde, linux-kernel,
John W. Linville
In-Reply-To: <20091104173327.28463.25410.sendpatchset@localhost.localdomain>
On Wednesday 04 November 2009, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] rt2800pci: add rt2800_register_multi[read,write]() wrappers
>
> Part of preparations for later code unification.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
^ permalink raw reply
* Re: [PATCH 14/41] rt2800pci: add rt2800_regbusy_read() wrapper
From: Ivo van Doorn @ 2009-11-05 18:49 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: linux-wireless, Gertjan van Wingerde, linux-kernel,
John W. Linville
In-Reply-To: <20091104173341.28463.11122.sendpatchset@localhost.localdomain>
On Wednesday 04 November 2009, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] rt2800pci: add rt2800_regbusy_read() wrapper
>
> Part of preparations for later code unification.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
The macros are the same for rt2800pci and rt2800usb.
So it might be better to move the entire define set into rt2800lib.h
If you haven't done so already in a subsequent patch, please fix it,
otherwise:
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Ivo
> ---
> drivers/net/wireless/rt2x00/rt2800pci.c | 12 ++++++------
> drivers/net/wireless/rt2x00/rt2800pci.h | 8 ++++++++
> 2 files changed, 14 insertions(+), 6 deletions(-)
>
> Index: b/drivers/net/wireless/rt2x00/rt2800pci.c
> ===================================================================
> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> @@ -69,14 +69,14 @@ MODULE_PARM_DESC(nohwcrypt, "Disable har
> * The _lock versions must be used if you already hold the csr_mutex
> */
> #define WAIT_FOR_BBP(__dev, __reg) \
> - rt2x00pci_regbusy_read((__dev), BBP_CSR_CFG, BBP_CSR_CFG_BUSY, (__reg))
> + rt2800_regbusy_read((__dev), BBP_CSR_CFG, BBP_CSR_CFG_BUSY, (__reg))
> #define WAIT_FOR_RFCSR(__dev, __reg) \
> - rt2x00pci_regbusy_read((__dev), RF_CSR_CFG, RF_CSR_CFG_BUSY, (__reg))
> + rt2800_regbusy_read((__dev), RF_CSR_CFG, RF_CSR_CFG_BUSY, (__reg))
> #define WAIT_FOR_RF(__dev, __reg) \
> - rt2x00pci_regbusy_read((__dev), RF_CSR_CFG0, RF_CSR_CFG0_BUSY, (__reg))
> + rt2800_regbusy_read((__dev), RF_CSR_CFG0, RF_CSR_CFG0_BUSY, (__reg))
> #define WAIT_FOR_MCU(__dev, __reg) \
> - rt2x00pci_regbusy_read((__dev), H2M_MAILBOX_CSR, \
> - H2M_MAILBOX_CSR_OWNER, (__reg))
> + rt2800_regbusy_read((__dev), H2M_MAILBOX_CSR, \
> + H2M_MAILBOX_CSR_OWNER, (__reg))
>
> static void rt2800pci_bbp_write(struct rt2x00_dev *rt2x00dev,
> const unsigned int word, const u8 value)
> @@ -350,7 +350,7 @@ static void rt2800pci_efuse_read(struct
> rt2800_register_write(rt2x00dev, EFUSE_CTRL, reg);
>
> /* Wait until the EEPROM has been loaded */
> - rt2x00pci_regbusy_read(rt2x00dev, EFUSE_CTRL, EFUSE_CTRL_KICK, ®);
> + rt2800_regbusy_read(rt2x00dev, EFUSE_CTRL, EFUSE_CTRL_KICK, ®);
>
> /* Apparently the data is read from end to start */
> rt2800_register_read(rt2x00dev, EFUSE_DATA3,
> Index: b/drivers/net/wireless/rt2x00/rt2800pci.h
> ===================================================================
> --- a/drivers/net/wireless/rt2x00/rt2800pci.h
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.h
> @@ -63,6 +63,14 @@ static inline void rt2800_register_multi
> rt2x00pci_register_multiwrite(rt2x00dev, offset, value, length);
> }
>
> +static inline int rt2800_regbusy_read(struct rt2x00_dev *rt2x00dev,
> + const unsigned int offset,
> + const struct rt2x00_field32 field,
> + u32 *reg)
> +{
> + return rt2x00pci_regbusy_read(rt2x00dev, offset, field, reg);
> +}
> +
> /*
> * RF chip defines.
> *
>
^ permalink raw reply
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