* Re: "Reserved instruction in kernel code" on ath9k insertion
From: Tomasz Chmielewski @ 2009-10-24 20:58 UTC (permalink / raw)
To: Larry Finger; +Cc: linux-wireless
In-Reply-To: <4AE36884.6060806@lwfinger.net>
Larry Finger schrieb:
>> # modprobe ath9k
>> [ 165.440000] Reserved instruction in kernel code[#1]:
(...)
>> [ 165.440000] Code: 00000000 00000000 00000000 <00003009> 005196a8
>> 005196a8 00000002 00000000 005166b0
>> [ 165.440000] Disabling lock debugging due to kernel taint
>> Segmentation fault
>> #
>
> Is that the start of the error dump?
Yes - as I do "modprobe", it starts to print the dump.
Then, modprobe segfaults.
> A BUG() statement places an
> illegal instruction in the code. Is that the case here?
I have no idea.
--
Tomasz Chmielewski
http://wpkg.org
^ permalink raw reply
* Re: "Reserved instruction in kernel code" on ath9k insertion
From: Larry Finger @ 2009-10-24 20:50 UTC (permalink / raw)
To: Tomasz Chmielewski; +Cc: linux-wireless
In-Reply-To: <4AE35A9E.8000507@wpkg.org>
On 10/24/2009 02:50 PM, Tomasz Chmielewski wrote:
> When I do "modprobe ath9k" on ASUS-WL-500gP (MIPS) with _ath5k_ card
> (so, no ath9k hardware), it says "Reserved instruction in kernel code" -
> is it expected?
>
> The kernel is 2.6.31.1.
>
>
> # modprobe ath9k
> [ 165.440000] Reserved instruction in kernel code[#1]:
> [ 165.440000] Cpu 0
> [ 165.440000] $ 0 : 00000000 1000dc00 00000000 00000000
> [ 165.440000] $ 4 : c1135b20 00000001 c044e69c ffffffff
> [ 165.440000] $ 8 : 0000000a 8101f6d8 ffffffe0 0000002b
> [ 165.440000] $12 : 00000e44 00000006 80333ae8 5f657361
> [ 165.440000] $16 : 00000001 c1135ca4 80370000 81418000
> [ 165.440000] $20 : 00000000 00000000 00000000 004fe008
> [ 165.440000] $24 : 00000010 c1115118
> [ 165.440000] $28 : 81da6000 81da7ea8 7febead8 81418014
> [ 165.440000] Hi : 00000000
> [ 165.440000] Lo : 00000000
> [ 165.440000] epc : c044e694 0xc044e694
> [ 165.440000] Not tainted
> [ 165.440000] ra : 81418014 ath9k_init+0x14/0xa4 [ath9k]
> [ 165.440000] Status: 1000dc03 KERNEL EXL IE
> [ 165.440000] Cause : 80800028
> [ 165.440000] PrId : 00029006 (Broadcom BCM3302)
> [ 165.440000] Modules linked in: ath9k(+) aes_generic tun sch_sfq
> cls_fw sch_htb ipt_MASQUERADE iptable_nat nf_nat xt_MARK iptable_mangle
> ipt_ULOG xt_recent nf_conntrack_ipv4 nf_defrag_ipv4 xt_state
> nf_conntrack xt_tcpudp iptable_filter ip_tables x_tables arc4 ecb ath5k
> mac80211 ath ohci_hcd cfg80211 uhci_hcd
> [ 165.440000] Process modprobe (pid: 1285, threadinfo=81da6000,
> task=81dc0048, tls=2aad96f0)
> [ 165.440000] Stack : 00000000 00000000 c1049988 000002a0 00000001
> 8000cda4 80330000 c1135ca4
> [ 165.440000] 0041ee08 2ac50000 005021a8 00000000 8004d59c
> 0029e597 0041ee08 2ac50000
> [ 165.440000] 00000001 c1135ca4 0041ee08 2ac50000 005021a8
> 8005fc84 0029f000 00000002
> [ 165.440000] 00408228 00400de0 004f1400 2aad8f08 00408228
> 00400de0 004f1400 2aad8f08
> [ 165.440000] 800035f0 800035f0 005021a8 004ff648 004fe008
> 00000000 00401090 00000000
> [ 165.440000] ...
> [ 165.440000] Call Trace:
> [ 165.440000] [<8000cda4>] do_one_initcall+0x6c/0x204
> [ 165.440000] [<8004d59c>] blocking_notifier_call_chain+0x14/0x20
> [ 165.440000] [<8005fc84>] sys_init_module+0xe8/0x214
> [ 165.440000] [<800035f0>] stack_done+0x20/0x3c
> [ 165.440000] [<800035f0>] stack_done+0x20/0x3c
> [ 165.440000]
> [ 165.440000]
> [ 165.440000] Code: 00000000 00000000 00000000 <00003009> 005196a8
> 005196a8 00000002 00000000 005166b0
> [ 165.440000] Disabling lock debugging due to kernel taint
> Segmentation fault
> #
Is that the start of the error dump? A BUG() statement places an
illegal instruction in the code. Is that the case here?
^ permalink raw reply
* "Reserved instruction in kernel code" on ath9k insertion
From: Tomasz Chmielewski @ 2009-10-24 19:50 UTC (permalink / raw)
To: linux-wireless
When I do "modprobe ath9k" on ASUS-WL-500gP (MIPS) with _ath5k_ card (so, no ath9k hardware), it says "Reserved instruction in kernel code" - is it expected?
The kernel is 2.6.31.1.
# modprobe ath9k
[ 165.440000] Reserved instruction in kernel code[#1]:
[ 165.440000] Cpu 0
[ 165.440000] $ 0 : 00000000 1000dc00 00000000 00000000
[ 165.440000] $ 4 : c1135b20 00000001 c044e69c ffffffff
[ 165.440000] $ 8 : 0000000a 8101f6d8 ffffffe0 0000002b
[ 165.440000] $12 : 00000e44 00000006 80333ae8 5f657361
[ 165.440000] $16 : 00000001 c1135ca4 80370000 81418000
[ 165.440000] $20 : 00000000 00000000 00000000 004fe008
[ 165.440000] $24 : 00000010 c1115118
[ 165.440000] $28 : 81da6000 81da7ea8 7febead8 81418014
[ 165.440000] Hi : 00000000
[ 165.440000] Lo : 00000000
[ 165.440000] epc : c044e694 0xc044e694
[ 165.440000] Not tainted
[ 165.440000] ra : 81418014 ath9k_init+0x14/0xa4 [ath9k]
[ 165.440000] Status: 1000dc03 KERNEL EXL IE
[ 165.440000] Cause : 80800028
[ 165.440000] PrId : 00029006 (Broadcom BCM3302)
[ 165.440000] Modules linked in: ath9k(+) aes_generic tun sch_sfq cls_fw sch_htb ipt_MASQUERADE iptable_nat nf_nat xt_MARK iptable_mangle ipt_ULOG xt_recent nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack xt_tcpudp iptable_filter ip_tables x_tables arc4 ecb ath5k mac80211 ath ohci_hcd cfg80211 uhci_hcd
[ 165.440000] Process modprobe (pid: 1285, threadinfo=81da6000, task=81dc0048, tls=2aad96f0)
[ 165.440000] Stack : 00000000 00000000 c1049988 000002a0 00000001 8000cda4 80330000 c1135ca4
[ 165.440000] 0041ee08 2ac50000 005021a8 00000000 8004d59c 0029e597 0041ee08 2ac50000
[ 165.440000] 00000001 c1135ca4 0041ee08 2ac50000 005021a8 8005fc84 0029f000 00000002
[ 165.440000] 00408228 00400de0 004f1400 2aad8f08 00408228 00400de0 004f1400 2aad8f08
[ 165.440000] 800035f0 800035f0 005021a8 004ff648 004fe008 00000000 00401090 00000000
[ 165.440000] ...
[ 165.440000] Call Trace:
[ 165.440000] [<8000cda4>] do_one_initcall+0x6c/0x204
[ 165.440000] [<8004d59c>] blocking_notifier_call_chain+0x14/0x20
[ 165.440000] [<8005fc84>] sys_init_module+0xe8/0x214
[ 165.440000] [<800035f0>] stack_done+0x20/0x3c
[ 165.440000] [<800035f0>] stack_done+0x20/0x3c
[ 165.440000]
[ 165.440000]
[ 165.440000] Code: 00000000 00000000 00000000 <00003009> 005196a8 005196a8 00000002 00000000 005166b0
[ 165.440000] Disabling lock debugging due to kernel taint
Segmentation fault
#
--
Tomasz Chmielewski
http://wpkg.org
^ permalink raw reply
* [RFC] more PCMCIA cleanup patches for 2.6.33
From: Dominik Brodowski @ 2009-10-24 19:42 UTC (permalink / raw)
To: linux-pcmcia; +Cc: netdev, linux-wireless, linux-serial, linux-ide
Hej,
In addition to the patches already submitted as RFC on Oct 19th, I'm
interested in your input to this patch series. They'll be sent to the
PCMCIA list shortly, with CC to other lists if deemed appropriate. If
all goes well, I'll ask Linus to pull both patch series once 2.6.32
is released.
pcmcia: use dynamic debug instead of custom infrastructure
pcmcia: use dynamic debug in PCMCIA socket drivers
pcmcia: extend error reporting and debug messages in core
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (ide)
pcmcia: deprecate CS_CHECK (bluetooth)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (char)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (isdn)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (net)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (ray-cs.c)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (wireless)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (scsi)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (serial_cs)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (sound)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers)
pcmcia: remove now-defunct cs_error, pcmcia_error_{func,ret}
pcmcia: use dev_dbg and dev_print in pd6729.c
Documentation/pcmcia/driver-changes.txt | 5 +
drivers/ata/pata_pcmcia.c | 16 +-
drivers/bluetooth/bluecard_cs.c | 12 +-
drivers/bluetooth/bt3c_cs.c | 9 +-
drivers/bluetooth/btuart_cs.c | 9 +-
drivers/bluetooth/dtl1_cs.c | 8 +-
drivers/char/pcmcia/cm4000_cs.c | 69 ++----
drivers/char/pcmcia/cm4040_cs.c | 42 ++--
drivers/char/pcmcia/ipwireless/main.c | 34 +--
drivers/char/pcmcia/synclink_cs.c | 23 +-
drivers/ide/ide-cs.c | 32 +--
drivers/isdn/hardware/avm/avm_cs.c | 2 -
drivers/isdn/hisax/avma1_cs.c | 26 +--
drivers/isdn/hisax/elsa_cs.c | 45 +---
drivers/isdn/hisax/sedlbauer_cs.c | 58 ++---
drivers/isdn/hisax/teles_cs.c | 37 +---
drivers/mtd/maps/pcmciamtd.c | 14 +-
drivers/net/pcmcia/3c574_cs.c | 66 +++---
drivers/net/pcmcia/3c589_cs.c | 75 ++----
drivers/net/pcmcia/axnet_cs.c | 53 ++---
drivers/net/pcmcia/com20020_cs.c | 55 ++---
drivers/net/pcmcia/fmvj18x_cs.c | 109 +++------
drivers/net/pcmcia/ibmtr_cs.c | 54 ++---
drivers/net/pcmcia/nmclan_cs.c | 148 +++++-------
drivers/net/pcmcia/pcnet_cs.c | 67 ++----
drivers/net/pcmcia/smc91c92_cs.c | 85 +++-----
drivers/net/pcmcia/xirc2ps_cs.c | 111 ++++------
drivers/net/wireless/airo_cs.c | 48 ++---
drivers/net/wireless/atmel_cs.c | 46 ++---
drivers/net/wireless/hostap/hostap_cs.c | 23 +--
drivers/net/wireless/netwave_cs.c | 88 +++----
drivers/net/wireless/orinoco/orinoco_cs.c | 27 +--
drivers/net/wireless/orinoco/spectrum_cs.c | 54 +++---
drivers/net/wireless/ray_cs.c | 347 ++++++++++++++--------------
drivers/net/wireless/wavelan_cs.c | 24 --
drivers/net/wireless/wl3501_cs.c | 67 ++----
drivers/parport/parport_cs.c | 37 +--
drivers/pcmcia/Kconfig | 36 ++--
drivers/pcmcia/cardbus.c | 4 +-
drivers/pcmcia/cistpl.c | 10 +-
drivers/pcmcia/cs.c | 60 +++---
drivers/pcmcia/cs_internal.h | 22 --
drivers/pcmcia/ds.c | 188 +++------------
drivers/pcmcia/i82365.c | 37 +--
drivers/pcmcia/m32r_cfc.c | 105 ++++-----
drivers/pcmcia/m32r_pcc.c | 51 ++---
drivers/pcmcia/m8xx_pcmcia.c | 40 ++--
drivers/pcmcia/pcmcia_ioctl.c | 31 +--
drivers/pcmcia/pcmcia_resource.c | 126 ++++++-----
drivers/pcmcia/pd6729.c | 69 +++---
drivers/pcmcia/pd6729.h | 7 -
drivers/pcmcia/tcic.c | 29 +--
drivers/scsi/pcmcia/aha152x_stub.c | 40 ++--
drivers/scsi/pcmcia/fdomain_stub.c | 43 ++---
drivers/scsi/pcmcia/qlogic_stub.c | 44 ++---
drivers/scsi/pcmcia/sym53c500_cs.c | 41 ++---
drivers/serial/serial_cs.c | 53 ++---
drivers/telephony/ixj_pcmcia.c | 36 +--
drivers/usb/host/sl811_cs.c | 46 +---
include/pcmcia/ds.h | 36 ---
sound/pcmcia/pdaudiocf/pdaudiocf.c | 21 +-
sound/pcmcia/vx/vxpocket.c | 21 +-
62 files changed, 1204 insertions(+), 2017 deletions(-)
Best,
Dominik
^ permalink raw reply
* [PATCH 09/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (ray-cs.c)
From: Dominik Brodowski @ 2009-10-24 19:42 UTC (permalink / raw)
To: linux-pcmcia; +Cc: Dominik Brodowski, linux-wireless, netdev
In-Reply-To: <20091024194219.GA19546@comet.dominikbrodowski.net>
Convert PCMCIA drivers to use the dynamic debug infrastructure, instead of
requiring manual settings of PCMCIA_DEBUG.
Also, remove all usages of the CS_CHECK macro and replace them with proper
Linux style calling and return value checking. The extra error reporting may
be dropped, as the PCMCIA core already complains about any (non-driver-author)
errors.
CC: linux-wireless@vger.kernel.org
CC: netdev@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
drivers/net/wireless/ray_cs.c | 347 ++++++++++++++++++++---------------------
1 files changed, 169 insertions(+), 178 deletions(-)
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 88cd58e..28db791 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -71,25 +71,7 @@ typedef u_char mac_addr[ETH_ALEN]; /* Hardware address */
#include "rayctl.h"
#include "ray_cs.h"
-/* All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
- you do not define PCMCIA_DEBUG at all, all the debug code will be
- left out. If you compile with PCMCIA_DEBUG=0, the debug code will
- be present but disabled -- but it can then be enabled for specific
- modules at load time with a 'pc_debug=#' option to insmod.
-*/
-#ifdef RAYLINK_DEBUG
-#define PCMCIA_DEBUG RAYLINK_DEBUG
-#endif
-#ifdef PCMCIA_DEBUG
-static int ray_debug;
-static int pc_debug = PCMCIA_DEBUG;
-module_param(pc_debug, int, 0);
-/* #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args); */
-#define DEBUG(n, args...) if (pc_debug > (n)) printk(args);
-#else
-#define DEBUG(n, args...)
-#endif
/** Prototypes based on PCMCIA skeleton driver *******************************/
static int ray_config(struct pcmcia_device *link);
static void ray_release(struct pcmcia_device *link);
@@ -325,7 +307,7 @@ static int ray_probe(struct pcmcia_device *p_dev)
ray_dev_t *local;
struct net_device *dev;
- DEBUG(1, "ray_attach()\n");
+ dev_dbg(&p_dev->dev, "ray_attach()\n");
/* Allocate space for private device-specific data */
dev = alloc_etherdev(sizeof(ray_dev_t));
@@ -357,7 +339,7 @@ static int ray_probe(struct pcmcia_device *p_dev)
local->card_status = CARD_INSERTED;
local->authentication_state = UNAUTHENTICATED;
local->num_multi = 0;
- DEBUG(2, "ray_attach p_dev = %p, dev = %p, local = %p, intr = %p\n",
+ dev_dbg(&p_dev->dev, "ray_attach p_dev = %p, dev = %p, local = %p, intr = %p\n",
p_dev, dev, local, &ray_interrupt);
/* Raylink entries in the device structure */
@@ -370,7 +352,7 @@ static int ray_probe(struct pcmcia_device *p_dev)
#endif /* WIRELESS_SPY */
- DEBUG(2, "ray_cs ray_attach calling ether_setup.)\n");
+ dev_dbg(&p_dev->dev, "ray_cs ray_attach calling ether_setup.)\n");
netif_stop_queue(dev);
init_timer(&local->timer);
@@ -393,7 +375,7 @@ static void ray_detach(struct pcmcia_device *link)
struct net_device *dev;
ray_dev_t *local;
- DEBUG(1, "ray_detach(0x%p)\n", link);
+ dev_dbg(&link->dev, "ray_detach\n");
this_device = NULL;
dev = link->priv;
@@ -408,7 +390,7 @@ static void ray_detach(struct pcmcia_device *link)
unregister_netdev(dev);
free_netdev(dev);
}
- DEBUG(2, "ray_cs ray_detach ending\n");
+ dev_dbg(&link->dev, "ray_cs ray_detach ending\n");
} /* ray_detach */
/*=============================================================================
@@ -416,19 +398,17 @@ static void ray_detach(struct pcmcia_device *link)
is received, to configure the PCMCIA socket, and to make the
ethernet device available to the system.
=============================================================================*/
-#define CS_CHECK(fn, ret) \
-do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
#define MAX_TUPLE_SIZE 128
static int ray_config(struct pcmcia_device *link)
{
- int last_fn = 0, last_ret = 0;
+ int ret = 0;
int i;
win_req_t req;
memreq_t mem;
struct net_device *dev = (struct net_device *)link->priv;
ray_dev_t *local = netdev_priv(dev);
- DEBUG(1, "ray_config(0x%p)\n", link);
+ dev_dbg(&link->dev, "ray_config\n");
/* Determine card type and firmware version */
printk(KERN_INFO "ray_cs Detected: %s%s%s%s\n",
@@ -440,14 +420,17 @@ static int ray_config(struct pcmcia_device *link)
/* Now allocate an interrupt line. Note that this does not
actually assign a handler to the interrupt.
*/
- CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
+ ret = pcmcia_request_irq(link, &link->irq);
+ if (ret)
+ goto failed;
dev->irq = link->irq.AssignedIRQ;
/* This actually configures the PCMCIA socket -- setting up
the I/O windows and the interrupt mapping.
*/
- CS_CHECK(RequestConfiguration,
- pcmcia_request_configuration(link, &link->conf));
+ ret = pcmcia_request_configuration(link, &link->conf);
+ if (ret)
+ goto failed;
/*** Set up 32k window for shared memory (transmit and control) ************/
req.Attributes =
@@ -455,10 +438,14 @@ static int ray_config(struct pcmcia_device *link)
req.Base = 0;
req.Size = 0x8000;
req.AccessSpeed = ray_mem_speed;
- CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win));
+ ret = pcmcia_request_window(&link, &req, &link->win);
+ if (ret)
+ goto failed;
mem.CardOffset = 0x0000;
mem.Page = 0;
- CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));
+ ret = pcmcia_map_mem_page(link->win, &mem);
+ if (ret)
+ goto failed;
local->sram = ioremap(req.Base, req.Size);
/*** Set up 16k window for shared memory (receive buffer) ***************/
@@ -467,11 +454,14 @@ static int ray_config(struct pcmcia_device *link)
req.Base = 0;
req.Size = 0x4000;
req.AccessSpeed = ray_mem_speed;
- CS_CHECK(RequestWindow,
- pcmcia_request_window(&link, &req, &local->rmem_handle));
+ ret = pcmcia_request_window(&link, &req, &local->rmem_handle);
+ if (ret)
+ goto failed;
mem.CardOffset = 0x8000;
mem.Page = 0;
- CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->rmem_handle, &mem));
+ ret = pcmcia_map_mem_page(local->rmem_handle, &mem);
+ if (ret)
+ goto failed;
local->rmem = ioremap(req.Base, req.Size);
/*** Set up window for attribute memory ***********************************/
@@ -480,16 +470,19 @@ static int ray_config(struct pcmcia_device *link)
req.Base = 0;
req.Size = 0x1000;
req.AccessSpeed = ray_mem_speed;
- CS_CHECK(RequestWindow,
- pcmcia_request_window(&link, &req, &local->amem_handle));
+ ret = pcmcia_request_window(&link, &req, &local->amem_handle);
+ if (ret)
+ goto failed;
mem.CardOffset = 0x0000;
mem.Page = 0;
- CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->amem_handle, &mem));
+ ret = pcmcia_map_mem_page(local->amem_handle, &mem);
+ if (ret)
+ goto failed;
local->amem = ioremap(req.Base, req.Size);
- DEBUG(3, "ray_config sram=%p\n", local->sram);
- DEBUG(3, "ray_config rmem=%p\n", local->rmem);
- DEBUG(3, "ray_config amem=%p\n", local->amem);
+ dev_dbg(&link->dev, "ray_config sram=%p\n", local->sram);
+ dev_dbg(&link->dev, "ray_config rmem=%p\n", local->rmem);
+ dev_dbg(&link->dev, "ray_config amem=%p\n", local->amem);
if (ray_init(dev) < 0) {
ray_release(link);
return -ENODEV;
@@ -511,9 +504,7 @@ static int ray_config(struct pcmcia_device *link)
return 0;
-cs_failed:
- cs_error(link, last_fn, last_ret);
-
+failed:
ray_release(link);
return -ENODEV;
} /* ray_config */
@@ -543,9 +534,9 @@ static int ray_init(struct net_device *dev)
struct ccs __iomem *pccs;
ray_dev_t *local = netdev_priv(dev);
struct pcmcia_device *link = local->finder;
- DEBUG(1, "ray_init(0x%p)\n", dev);
+ dev_dbg(&link->dev, "ray_init(0x%p)\n", dev);
if (!(pcmcia_dev_present(link))) {
- DEBUG(0, "ray_init - device not present\n");
+ dev_dbg(&link->dev, "ray_init - device not present\n");
return -1;
}
@@ -567,13 +558,13 @@ static int ray_init(struct net_device *dev)
local->fw_ver = local->startup_res.firmware_version[0];
local->fw_bld = local->startup_res.firmware_version[1];
local->fw_var = local->startup_res.firmware_version[2];
- DEBUG(1, "ray_init firmware version %d.%d \n", local->fw_ver,
+ dev_dbg(&link->dev, "ray_init firmware version %d.%d \n", local->fw_ver,
local->fw_bld);
local->tib_length = 0x20;
if ((local->fw_ver == 5) && (local->fw_bld >= 30))
local->tib_length = local->startup_res.tib_length;
- DEBUG(2, "ray_init tib_length = 0x%02x\n", local->tib_length);
+ dev_dbg(&link->dev, "ray_init tib_length = 0x%02x\n", local->tib_length);
/* Initialize CCS's to buffer free state */
pccs = ccs_base(local);
for (i = 0; i < NUMBER_OF_CCS; i++) {
@@ -592,7 +583,7 @@ static int ray_init(struct net_device *dev)
clear_interrupt(local); /* Clear any interrupt from the card */
local->card_status = CARD_AWAITING_PARAM;
- DEBUG(2, "ray_init ending\n");
+ dev_dbg(&link->dev, "ray_init ending\n");
return 0;
} /* ray_init */
@@ -605,9 +596,9 @@ static int dl_startup_params(struct net_device *dev)
struct ccs __iomem *pccs;
struct pcmcia_device *link = local->finder;
- DEBUG(1, "dl_startup_params entered\n");
+ dev_dbg(&link->dev, "dl_startup_params entered\n");
if (!(pcmcia_dev_present(link))) {
- DEBUG(2, "ray_cs dl_startup_params - device not present\n");
+ dev_dbg(&link->dev, "ray_cs dl_startup_params - device not present\n");
return -1;
}
@@ -625,7 +616,7 @@ static int dl_startup_params(struct net_device *dev)
local->dl_param_ccs = ccsindex;
pccs = ccs_base(local) + ccsindex;
writeb(CCS_DOWNLOAD_STARTUP_PARAMS, &pccs->cmd);
- DEBUG(2, "dl_startup_params start ccsindex = %d\n",
+ dev_dbg(&link->dev, "dl_startup_params start ccsindex = %d\n",
local->dl_param_ccs);
/* Interrupt the firmware to process the command */
if (interrupt_ecf(local, ccsindex)) {
@@ -641,7 +632,7 @@ static int dl_startup_params(struct net_device *dev)
local->timer.data = (long)local;
local->timer.function = &verify_dl_startup;
add_timer(&local->timer);
- DEBUG(2,
+ dev_dbg(&link->dev,
"ray_cs dl_startup_params started timer for verify_dl_startup\n");
return 0;
} /* dl_startup_params */
@@ -717,11 +708,11 @@ static void verify_dl_startup(u_long data)
struct pcmcia_device *link = local->finder;
if (!(pcmcia_dev_present(link))) {
- DEBUG(2, "ray_cs verify_dl_startup - device not present\n");
+ dev_dbg(&link->dev, "ray_cs verify_dl_startup - device not present\n");
return;
}
-#ifdef PCMCIA_DEBUG
- if (pc_debug > 2) {
+#if 0
+ {
int i;
printk(KERN_DEBUG
"verify_dl_startup parameters sent via ccs %d:\n",
@@ -760,7 +751,7 @@ static void start_net(u_long data)
int ccsindex;
struct pcmcia_device *link = local->finder;
if (!(pcmcia_dev_present(link))) {
- DEBUG(2, "ray_cs start_net - device not present\n");
+ dev_dbg(&link->dev, "ray_cs start_net - device not present\n");
return;
}
/* Fill in the CCS fields for the ECF */
@@ -771,7 +762,7 @@ static void start_net(u_long data)
writeb(0, &pccs->var.start_network.update_param);
/* Interrupt the firmware to process the command */
if (interrupt_ecf(local, ccsindex)) {
- DEBUG(1, "ray start net failed - card not ready for intr\n");
+ dev_dbg(&link->dev, "ray start net failed - card not ready for intr\n");
writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status);
return;
}
@@ -790,7 +781,7 @@ static void join_net(u_long data)
struct pcmcia_device *link = local->finder;
if (!(pcmcia_dev_present(link))) {
- DEBUG(2, "ray_cs join_net - device not present\n");
+ dev_dbg(&link->dev, "ray_cs join_net - device not present\n");
return;
}
/* Fill in the CCS fields for the ECF */
@@ -802,7 +793,7 @@ static void join_net(u_long data)
writeb(0, &pccs->var.join_network.net_initiated);
/* Interrupt the firmware to process the command */
if (interrupt_ecf(local, ccsindex)) {
- DEBUG(1, "ray join net failed - card not ready for intr\n");
+ dev_dbg(&link->dev, "ray join net failed - card not ready for intr\n");
writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status);
return;
}
@@ -821,7 +812,7 @@ static void ray_release(struct pcmcia_device *link)
ray_dev_t *local = netdev_priv(dev);
int i;
- DEBUG(1, "ray_release(0x%p)\n", link);
+ dev_dbg(&link->dev, "ray_release\n");
del_timer(&local->timer);
@@ -831,13 +822,13 @@ static void ray_release(struct pcmcia_device *link)
/* Do bother checking to see if these succeed or not */
i = pcmcia_release_window(local->amem_handle);
if (i != 0)
- DEBUG(0, "ReleaseWindow(local->amem) ret = %x\n", i);
+ dev_dbg(&link->dev, "ReleaseWindow(local->amem) ret = %x\n", i);
i = pcmcia_release_window(local->rmem_handle);
if (i != 0)
- DEBUG(0, "ReleaseWindow(local->rmem) ret = %x\n", i);
+ dev_dbg(&link->dev, "ReleaseWindow(local->rmem) ret = %x\n", i);
pcmcia_disable_device(link);
- DEBUG(2, "ray_release ending\n");
+ dev_dbg(&link->dev, "ray_release ending\n");
}
static int ray_suspend(struct pcmcia_device *link)
@@ -871,9 +862,9 @@ static int ray_dev_init(struct net_device *dev)
ray_dev_t *local = netdev_priv(dev);
struct pcmcia_device *link = local->finder;
- DEBUG(1, "ray_dev_init(dev=%p)\n", dev);
+ dev_dbg(&link->dev, "ray_dev_init(dev=%p)\n", dev);
if (!(pcmcia_dev_present(link))) {
- DEBUG(2, "ray_dev_init - device not present\n");
+ dev_dbg(&link->dev, "ray_dev_init - device not present\n");
return -1;
}
#ifdef RAY_IMMEDIATE_INIT
@@ -887,7 +878,7 @@ static int ray_dev_init(struct net_device *dev)
/* Postpone the card init so that we can still configure the card,
* for example using the Wireless Extensions. The init will happen
* in ray_open() - Jean II */
- DEBUG(1,
+ dev_dbg(&link->dev,
"ray_dev_init: postponing card init to ray_open() ; Status = %d\n",
local->card_status);
#endif /* RAY_IMMEDIATE_INIT */
@@ -896,7 +887,7 @@ static int ray_dev_init(struct net_device *dev)
memcpy(dev->dev_addr, &local->sparm.b4.a_mac_addr, ADDRLEN);
memset(dev->broadcast, 0xff, ETH_ALEN);
- DEBUG(2, "ray_dev_init ending\n");
+ dev_dbg(&link->dev, "ray_dev_init ending\n");
return 0;
}
@@ -906,9 +897,9 @@ static int ray_dev_config(struct net_device *dev, struct ifmap *map)
ray_dev_t *local = netdev_priv(dev);
struct pcmcia_device *link = local->finder;
/* Dummy routine to satisfy device structure */
- DEBUG(1, "ray_dev_config(dev=%p,ifmap=%p)\n", dev, map);
+ dev_dbg(&link->dev, "ray_dev_config(dev=%p,ifmap=%p)\n", dev, map);
if (!(pcmcia_dev_present(link))) {
- DEBUG(2, "ray_dev_config - device not present\n");
+ dev_dbg(&link->dev, "ray_dev_config - device not present\n");
return -1;
}
@@ -924,14 +915,14 @@ static netdev_tx_t ray_dev_start_xmit(struct sk_buff *skb,
short length = skb->len;
if (!pcmcia_dev_present(link)) {
- DEBUG(2, "ray_dev_start_xmit - device not present\n");
+ dev_dbg(&link->dev, "ray_dev_start_xmit - device not present\n");
dev_kfree_skb(skb);
return NETDEV_TX_OK;
}
- DEBUG(3, "ray_dev_start_xmit(skb=%p, dev=%p)\n", skb, dev);
+ dev_dbg(&link->dev, "ray_dev_start_xmit(skb=%p, dev=%p)\n", skb, dev);
if (local->authentication_state == NEED_TO_AUTH) {
- DEBUG(0, "ray_cs Sending authentication request.\n");
+ dev_dbg(&link->dev, "ray_cs Sending authentication request.\n");
if (!build_auth_frame(local, local->auth_id, OPEN_AUTH_REQUEST)) {
local->authentication_state = AUTHENTICATED;
netif_stop_queue(dev);
@@ -971,7 +962,7 @@ static int ray_hw_xmit(unsigned char *data, int len, struct net_device *dev,
struct tx_msg __iomem *ptx; /* Address of xmit buffer in PC space */
short int addr; /* Address of xmit buffer in card space */
- DEBUG(3, "ray_hw_xmit(data=%p, len=%d, dev=%p)\n", data, len, dev);
+ pr_debug("ray_hw_xmit(data=%p, len=%d, dev=%p)\n", data, len, dev);
if (len + TX_HEADER_LENGTH > TX_BUF_SIZE) {
printk(KERN_INFO "ray_hw_xmit packet too large: %d bytes\n",
len);
@@ -979,9 +970,9 @@ static int ray_hw_xmit(unsigned char *data, int len, struct net_device *dev,
}
switch (ccsindex = get_free_tx_ccs(local)) {
case ECCSBUSY:
- DEBUG(2, "ray_hw_xmit tx_ccs table busy\n");
+ pr_debug("ray_hw_xmit tx_ccs table busy\n");
case ECCSFULL:
- DEBUG(2, "ray_hw_xmit No free tx ccs\n");
+ pr_debug("ray_hw_xmit No free tx ccs\n");
case ECARDGONE:
netif_stop_queue(dev);
return XMIT_NO_CCS;
@@ -1018,12 +1009,12 @@ static int ray_hw_xmit(unsigned char *data, int len, struct net_device *dev,
writeb(PSM_CAM, &pccs->var.tx_request.pow_sav_mode);
writeb(local->net_default_tx_rate, &pccs->var.tx_request.tx_rate);
writeb(0, &pccs->var.tx_request.antenna);
- DEBUG(3, "ray_hw_xmit default_tx_rate = 0x%x\n",
+ pr_debug("ray_hw_xmit default_tx_rate = 0x%x\n",
local->net_default_tx_rate);
/* Interrupt the firmware to process the command */
if (interrupt_ecf(local, ccsindex)) {
- DEBUG(2, "ray_hw_xmit failed - ECF not ready for intr\n");
+ pr_debug("ray_hw_xmit failed - ECF not ready for intr\n");
/* TBD very inefficient to copy packet to buffer, and then not
send it, but the alternative is to queue the messages and that
won't be done for a while. Maybe set tbusy until a CCS is free?
@@ -1040,7 +1031,7 @@ static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx,
{
__be16 proto = ((struct ethhdr *)data)->h_proto;
if (ntohs(proto) >= 1536) { /* DIX II ethernet frame */
- DEBUG(3, "ray_cs translate_frame DIX II\n");
+ pr_debug("ray_cs translate_frame DIX II\n");
/* Copy LLC header to card buffer */
memcpy_toio(&ptx->var, eth2_llc, sizeof(eth2_llc));
memcpy_toio(((void __iomem *)&ptx->var) + sizeof(eth2_llc),
@@ -1056,9 +1047,9 @@ static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx,
len - ETH_HLEN);
return (int)sizeof(struct snaphdr_t) - ETH_HLEN;
} else { /* already 802 type, and proto is length */
- DEBUG(3, "ray_cs translate_frame 802\n");
+ pr_debug("ray_cs translate_frame 802\n");
if (proto == htons(0xffff)) { /* evil netware IPX 802.3 without LLC */
- DEBUG(3, "ray_cs translate_frame evil IPX\n");
+ pr_debug("ray_cs translate_frame evil IPX\n");
memcpy_toio(&ptx->var, data + ETH_HLEN, len - ETH_HLEN);
return 0 - ETH_HLEN;
}
@@ -1603,7 +1594,7 @@ static int ray_open(struct net_device *dev)
struct pcmcia_device *link;
link = local->finder;
- DEBUG(1, "ray_open('%s')\n", dev->name);
+ dev_dbg(&link->dev, "ray_open('%s')\n", dev->name);
if (link->open == 0)
local->num_multi = 0;
@@ -1613,7 +1604,7 @@ static int ray_open(struct net_device *dev)
if (local->card_status == CARD_AWAITING_PARAM) {
int i;
- DEBUG(1, "ray_open: doing init now !\n");
+ dev_dbg(&link->dev, "ray_open: doing init now !\n");
/* Download startup parameters */
if ((i = dl_startup_params(dev)) < 0) {
@@ -1629,7 +1620,7 @@ static int ray_open(struct net_device *dev)
else
netif_start_queue(dev);
- DEBUG(2, "ray_open ending\n");
+ dev_dbg(&link->dev, "ray_open ending\n");
return 0;
} /* end ray_open */
@@ -1640,7 +1631,7 @@ static int ray_dev_close(struct net_device *dev)
struct pcmcia_device *link;
link = local->finder;
- DEBUG(1, "ray_dev_close('%s')\n", dev->name);
+ dev_dbg(&link->dev, "ray_dev_close('%s')\n", dev->name);
link->open--;
netif_stop_queue(dev);
@@ -1656,7 +1647,7 @@ static int ray_dev_close(struct net_device *dev)
/*===========================================================================*/
static void ray_reset(struct net_device *dev)
{
- DEBUG(1, "ray_reset entered\n");
+ pr_debug("ray_reset entered\n");
return;
}
@@ -1669,17 +1660,17 @@ static int interrupt_ecf(ray_dev_t *local, int ccs)
struct pcmcia_device *link = local->finder;
if (!(pcmcia_dev_present(link))) {
- DEBUG(2, "ray_cs interrupt_ecf - device not present\n");
+ dev_dbg(&link->dev, "ray_cs interrupt_ecf - device not present\n");
return -1;
}
- DEBUG(2, "interrupt_ecf(local=%p, ccs = 0x%x\n", local, ccs);
+ dev_dbg(&link->dev, "interrupt_ecf(local=%p, ccs = 0x%x\n", local, ccs);
while (i &&
(readb(local->amem + CIS_OFFSET + ECF_INTR_OFFSET) &
ECF_INTR_SET))
i--;
if (i == 0) {
- DEBUG(2, "ray_cs interrupt_ecf card not ready for interrupt\n");
+ dev_dbg(&link->dev, "ray_cs interrupt_ecf card not ready for interrupt\n");
return -1;
}
/* Fill the mailbox, then kick the card */
@@ -1698,12 +1689,12 @@ static int get_free_tx_ccs(ray_dev_t *local)
struct pcmcia_device *link = local->finder;
if (!(pcmcia_dev_present(link))) {
- DEBUG(2, "ray_cs get_free_tx_ccs - device not present\n");
+ dev_dbg(&link->dev, "ray_cs get_free_tx_ccs - device not present\n");
return ECARDGONE;
}
if (test_and_set_bit(0, &local->tx_ccs_lock)) {
- DEBUG(1, "ray_cs tx_ccs_lock busy\n");
+ dev_dbg(&link->dev, "ray_cs tx_ccs_lock busy\n");
return ECCSBUSY;
}
@@ -1716,7 +1707,7 @@ static int get_free_tx_ccs(ray_dev_t *local)
}
}
local->tx_ccs_lock = 0;
- DEBUG(2, "ray_cs ERROR no free tx CCS for raylink card\n");
+ dev_dbg(&link->dev, "ray_cs ERROR no free tx CCS for raylink card\n");
return ECCSFULL;
} /* get_free_tx_ccs */
@@ -1730,11 +1721,11 @@ static int get_free_ccs(ray_dev_t *local)
struct pcmcia_device *link = local->finder;
if (!(pcmcia_dev_present(link))) {
- DEBUG(2, "ray_cs get_free_ccs - device not present\n");
+ dev_dbg(&link->dev, "ray_cs get_free_ccs - device not present\n");
return ECARDGONE;
}
if (test_and_set_bit(0, &local->ccs_lock)) {
- DEBUG(1, "ray_cs ccs_lock busy\n");
+ dev_dbg(&link->dev, "ray_cs ccs_lock busy\n");
return ECCSBUSY;
}
@@ -1747,7 +1738,7 @@ static int get_free_ccs(ray_dev_t *local)
}
}
local->ccs_lock = 0;
- DEBUG(1, "ray_cs ERROR no free CCS for raylink card\n");
+ dev_dbg(&link->dev, "ray_cs ERROR no free CCS for raylink card\n");
return ECCSFULL;
} /* get_free_ccs */
@@ -1823,7 +1814,7 @@ static struct net_device_stats *ray_get_stats(struct net_device *dev)
struct pcmcia_device *link = local->finder;
struct status __iomem *p = local->sram + STATUS_BASE;
if (!(pcmcia_dev_present(link))) {
- DEBUG(2, "ray_cs net_device_stats - device not present\n");
+ dev_dbg(&link->dev, "ray_cs net_device_stats - device not present\n");
return &local->stats;
}
if (readb(&p->mrx_overflow_for_host)) {
@@ -1856,12 +1847,12 @@ static void ray_update_parm(struct net_device *dev, UCHAR objid, UCHAR *value,
struct ccs __iomem *pccs;
if (!(pcmcia_dev_present(link))) {
- DEBUG(2, "ray_update_parm - device not present\n");
+ dev_dbg(&link->dev, "ray_update_parm - device not present\n");
return;
}
if ((ccsindex = get_free_ccs(local)) < 0) {
- DEBUG(0, "ray_update_parm - No free ccs\n");
+ dev_dbg(&link->dev, "ray_update_parm - No free ccs\n");
return;
}
pccs = ccs_base(local) + ccsindex;
@@ -1874,7 +1865,7 @@ static void ray_update_parm(struct net_device *dev, UCHAR objid, UCHAR *value,
}
/* Interrupt the firmware to process the command */
if (interrupt_ecf(local, ccsindex)) {
- DEBUG(0, "ray_cs associate failed - ECF not ready for intr\n");
+ dev_dbg(&link->dev, "ray_cs associate failed - ECF not ready for intr\n");
writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status);
}
}
@@ -1891,12 +1882,12 @@ static void ray_update_multi_list(struct net_device *dev, int all)
void __iomem *p = local->sram + HOST_TO_ECF_BASE;
if (!(pcmcia_dev_present(link))) {
- DEBUG(2, "ray_update_multi_list - device not present\n");
+ dev_dbg(&link->dev, "ray_update_multi_list - device not present\n");
return;
} else
- DEBUG(2, "ray_update_multi_list(%p)\n", dev);
+ dev_dbg(&link->dev, "ray_update_multi_list(%p)\n", dev);
if ((ccsindex = get_free_ccs(local)) < 0) {
- DEBUG(1, "ray_update_multi - No free ccs\n");
+ dev_dbg(&link->dev, "ray_update_multi - No free ccs\n");
return;
}
pccs = ccs_base(local) + ccsindex;
@@ -1910,7 +1901,7 @@ static void ray_update_multi_list(struct net_device *dev, int all)
for (dmip = &dev->mc_list; (dmi = *dmip) != NULL;
dmip = &dmi->next) {
memcpy_toio(p, dmi->dmi_addr, ETH_ALEN);
- DEBUG(1,
+ dev_dbg(&link->dev,
"ray_update_multi add addr %02x%02x%02x%02x%02x%02x\n",
dmi->dmi_addr[0], dmi->dmi_addr[1],
dmi->dmi_addr[2], dmi->dmi_addr[3],
@@ -1921,12 +1912,12 @@ static void ray_update_multi_list(struct net_device *dev, int all)
if (i > 256 / ADDRLEN)
i = 256 / ADDRLEN;
writeb((UCHAR) i, &pccs->var);
- DEBUG(1, "ray_cs update_multi %d addresses in list\n", i);
+ dev_dbg(&link->dev, "ray_cs update_multi %d addresses in list\n", i);
/* Interrupt the firmware to process the command */
local->num_multi = i;
}
if (interrupt_ecf(local, ccsindex)) {
- DEBUG(1,
+ dev_dbg(&link->dev,
"ray_cs update_multi failed - ECF not ready for intr\n");
writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status);
}
@@ -1938,11 +1929,11 @@ static void set_multicast_list(struct net_device *dev)
ray_dev_t *local = netdev_priv(dev);
UCHAR promisc;
- DEBUG(2, "ray_cs set_multicast_list(%p)\n", dev);
+ pr_debug("ray_cs set_multicast_list(%p)\n", dev);
if (dev->flags & IFF_PROMISC) {
if (local->sparm.b5.a_promiscuous_mode == 0) {
- DEBUG(1, "ray_cs set_multicast_list promisc on\n");
+ pr_debug("ray_cs set_multicast_list promisc on\n");
local->sparm.b5.a_promiscuous_mode = 1;
promisc = 1;
ray_update_parm(dev, OBJID_promiscuous_mode,
@@ -1950,7 +1941,7 @@ static void set_multicast_list(struct net_device *dev)
}
} else {
if (local->sparm.b5.a_promiscuous_mode == 1) {
- DEBUG(1, "ray_cs set_multicast_list promisc off\n");
+ pr_debug("ray_cs set_multicast_list promisc off\n");
local->sparm.b5.a_promiscuous_mode = 0;
promisc = 0;
ray_update_parm(dev, OBJID_promiscuous_mode,
@@ -1984,19 +1975,19 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
if (dev == NULL) /* Note that we want interrupts with dev->start == 0 */
return IRQ_NONE;
- DEBUG(4, "ray_cs: interrupt for *dev=%p\n", dev);
+ pr_debug("ray_cs: interrupt for *dev=%p\n", dev);
local = netdev_priv(dev);
link = (struct pcmcia_device *)local->finder;
if (!pcmcia_dev_present(link)) {
- DEBUG(2,
- "ray_cs interrupt from device not present or suspended.\n");
+ pr_debug(
+ "ray_cs interrupt from device not present or suspended.\n");
return IRQ_NONE;
}
rcsindex = readb(&((struct scb __iomem *)(local->sram))->rcs_index);
if (rcsindex >= (NUMBER_OF_CCS + NUMBER_OF_RCS)) {
- DEBUG(1, "ray_cs interrupt bad rcsindex = 0x%x\n", rcsindex);
+ dev_dbg(&link->dev, "ray_cs interrupt bad rcsindex = 0x%x\n", rcsindex);
clear_interrupt(local);
return IRQ_HANDLED;
}
@@ -2008,33 +1999,33 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
case CCS_DOWNLOAD_STARTUP_PARAMS: /* Happens in firmware someday */
del_timer(&local->timer);
if (status == CCS_COMMAND_COMPLETE) {
- DEBUG(1,
+ dev_dbg(&link->dev,
"ray_cs interrupt download_startup_parameters OK\n");
} else {
- DEBUG(1,
+ dev_dbg(&link->dev,
"ray_cs interrupt download_startup_parameters fail\n");
}
break;
case CCS_UPDATE_PARAMS:
- DEBUG(1, "ray_cs interrupt update params done\n");
+ dev_dbg(&link->dev, "ray_cs interrupt update params done\n");
if (status != CCS_COMMAND_COMPLETE) {
tmp =
readb(&pccs->var.update_param.
failure_cause);
- DEBUG(0,
+ dev_dbg(&link->dev,
"ray_cs interrupt update params failed - reason %d\n",
tmp);
}
break;
case CCS_REPORT_PARAMS:
- DEBUG(1, "ray_cs interrupt report params done\n");
+ dev_dbg(&link->dev, "ray_cs interrupt report params done\n");
break;
case CCS_UPDATE_MULTICAST_LIST: /* Note that this CCS isn't returned */
- DEBUG(1,
+ dev_dbg(&link->dev,
"ray_cs interrupt CCS Update Multicast List done\n");
break;
case CCS_UPDATE_POWER_SAVINGS_MODE:
- DEBUG(1,
+ dev_dbg(&link->dev,
"ray_cs interrupt update power save mode done\n");
break;
case CCS_START_NETWORK:
@@ -2043,11 +2034,11 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
if (readb
(&pccs->var.start_network.net_initiated) ==
1) {
- DEBUG(0,
+ dev_dbg(&link->dev,
"ray_cs interrupt network \"%s\" started\n",
local->sparm.b4.a_current_ess_id);
} else {
- DEBUG(0,
+ dev_dbg(&link->dev,
"ray_cs interrupt network \"%s\" joined\n",
local->sparm.b4.a_current_ess_id);
}
@@ -2075,12 +2066,12 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
local->timer.expires = jiffies + HZ * 5;
local->timer.data = (long)local;
if (status == CCS_START_NETWORK) {
- DEBUG(0,
+ dev_dbg(&link->dev,
"ray_cs interrupt network \"%s\" start failed\n",
local->sparm.b4.a_current_ess_id);
local->timer.function = &start_net;
} else {
- DEBUG(0,
+ dev_dbg(&link->dev,
"ray_cs interrupt network \"%s\" join failed\n",
local->sparm.b4.a_current_ess_id);
local->timer.function = &join_net;
@@ -2091,19 +2082,19 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
case CCS_START_ASSOCIATION:
if (status == CCS_COMMAND_COMPLETE) {
local->card_status = CARD_ASSOC_COMPLETE;
- DEBUG(0, "ray_cs association successful\n");
+ dev_dbg(&link->dev, "ray_cs association successful\n");
} else {
- DEBUG(0, "ray_cs association failed,\n");
+ dev_dbg(&link->dev, "ray_cs association failed,\n");
local->card_status = CARD_ASSOC_FAILED;
join_net((u_long) local);
}
break;
case CCS_TX_REQUEST:
if (status == CCS_COMMAND_COMPLETE) {
- DEBUG(3,
+ dev_dbg(&link->dev,
"ray_cs interrupt tx request complete\n");
} else {
- DEBUG(1,
+ dev_dbg(&link->dev,
"ray_cs interrupt tx request failed\n");
}
if (!sniffer)
@@ -2111,21 +2102,21 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
netif_wake_queue(dev);
break;
case CCS_TEST_MEMORY:
- DEBUG(1, "ray_cs interrupt mem test done\n");
+ dev_dbg(&link->dev, "ray_cs interrupt mem test done\n");
break;
case CCS_SHUTDOWN:
- DEBUG(1,
+ dev_dbg(&link->dev,
"ray_cs interrupt Unexpected CCS returned - Shutdown\n");
break;
case CCS_DUMP_MEMORY:
- DEBUG(1, "ray_cs interrupt dump memory done\n");
+ dev_dbg(&link->dev, "ray_cs interrupt dump memory done\n");
break;
case CCS_START_TIMER:
- DEBUG(2,
+ dev_dbg(&link->dev,
"ray_cs interrupt DING - raylink timer expired\n");
break;
default:
- DEBUG(1,
+ dev_dbg(&link->dev,
"ray_cs interrupt Unexpected CCS 0x%x returned 0x%x\n",
rcsindex, cmd);
}
@@ -2139,7 +2130,7 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
ray_rx(dev, local, prcs);
break;
case REJOIN_NET_COMPLETE:
- DEBUG(1, "ray_cs interrupt rejoin net complete\n");
+ dev_dbg(&link->dev, "ray_cs interrupt rejoin net complete\n");
local->card_status = CARD_ACQ_COMPLETE;
/* do we need to clear tx buffers CCS's? */
if (local->sparm.b4.a_network_type == ADHOC) {
@@ -2149,7 +2140,7 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
memcpy_fromio(&local->bss_id,
prcs->var.rejoin_net_complete.
bssid, ADDRLEN);
- DEBUG(1,
+ dev_dbg(&link->dev,
"ray_cs new BSSID = %02x%02x%02x%02x%02x%02x\n",
local->bss_id[0], local->bss_id[1],
local->bss_id[2], local->bss_id[3],
@@ -2159,15 +2150,15 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
}
break;
case ROAMING_INITIATED:
- DEBUG(1, "ray_cs interrupt roaming initiated\n");
+ dev_dbg(&link->dev, "ray_cs interrupt roaming initiated\n");
netif_stop_queue(dev);
local->card_status = CARD_DOING_ACQ;
break;
case JAPAN_CALL_SIGN_RXD:
- DEBUG(1, "ray_cs interrupt japan call sign rx\n");
+ dev_dbg(&link->dev, "ray_cs interrupt japan call sign rx\n");
break;
default:
- DEBUG(1,
+ dev_dbg(&link->dev,
"ray_cs Unexpected interrupt for RCS 0x%x cmd = 0x%x\n",
rcsindex,
(unsigned int)readb(&prcs->interrupt_id));
@@ -2186,7 +2177,7 @@ static void ray_rx(struct net_device *dev, ray_dev_t *local,
int rx_len;
unsigned int pkt_addr;
void __iomem *pmsg;
- DEBUG(4, "ray_rx process rx packet\n");
+ pr_debug("ray_rx process rx packet\n");
/* Calculate address of packet within Rx buffer */
pkt_addr = ((readb(&prcs->var.rx_packet.rx_data_ptr[0]) << 8)
@@ -2199,28 +2190,28 @@ static void ray_rx(struct net_device *dev, ray_dev_t *local,
pmsg = local->rmem + pkt_addr;
switch (readb(pmsg)) {
case DATA_TYPE:
- DEBUG(4, "ray_rx data type\n");
+ pr_debug("ray_rx data type\n");
rx_data(dev, prcs, pkt_addr, rx_len);
break;
case AUTHENTIC_TYPE:
- DEBUG(4, "ray_rx authentic type\n");
+ pr_debug("ray_rx authentic type\n");
if (sniffer)
rx_data(dev, prcs, pkt_addr, rx_len);
else
rx_authenticate(local, prcs, pkt_addr, rx_len);
break;
case DEAUTHENTIC_TYPE:
- DEBUG(4, "ray_rx deauth type\n");
+ pr_debug("ray_rx deauth type\n");
if (sniffer)
rx_data(dev, prcs, pkt_addr, rx_len);
else
rx_deauthenticate(local, prcs, pkt_addr, rx_len);
break;
case NULL_MSG_TYPE:
- DEBUG(3, "ray_cs rx NULL msg\n");
+ pr_debug("ray_cs rx NULL msg\n");
break;
case BEACON_TYPE:
- DEBUG(4, "ray_rx beacon type\n");
+ pr_debug("ray_rx beacon type\n");
if (sniffer)
rx_data(dev, prcs, pkt_addr, rx_len);
@@ -2233,7 +2224,7 @@ static void ray_rx(struct net_device *dev, ray_dev_t *local,
ray_get_stats(dev);
break;
default:
- DEBUG(0, "ray_cs unknown pkt type %2x\n",
+ pr_debug("ray_cs unknown pkt type %2x\n",
(unsigned int)readb(pmsg));
break;
}
@@ -2262,7 +2253,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs,
rx_len >
(dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN +
FCS_LEN)) {
- DEBUG(0,
+ pr_debug(
"ray_cs invalid packet length %d received \n",
rx_len);
return;
@@ -2273,17 +2264,17 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs,
rx_len >
(dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN +
FCS_LEN)) {
- DEBUG(0,
+ pr_debug(
"ray_cs invalid packet length %d received \n",
rx_len);
return;
}
}
}
- DEBUG(4, "ray_cs rx_data packet\n");
+ pr_debug("ray_cs rx_data packet\n");
/* If fragmented packet, verify sizes of fragments add up */
if (readb(&prcs->var.rx_packet.next_frag_rcs_index) != 0xFF) {
- DEBUG(1, "ray_cs rx'ed fragment\n");
+ pr_debug("ray_cs rx'ed fragment\n");
tmp = (readb(&prcs->var.rx_packet.totalpacketlength[0]) << 8)
+ readb(&prcs->var.rx_packet.totalpacketlength[1]);
total_len = tmp;
@@ -2301,7 +2292,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs,
} while (1);
if (tmp < 0) {
- DEBUG(0,
+ pr_debug(
"ray_cs rx_data fragment lengths don't add up\n");
local->stats.rx_dropped++;
release_frag_chain(local, prcs);
@@ -2313,7 +2304,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs,
skb = dev_alloc_skb(total_len + 5);
if (skb == NULL) {
- DEBUG(0, "ray_cs rx_data could not allocate skb\n");
+ pr_debug("ray_cs rx_data could not allocate skb\n");
local->stats.rx_dropped++;
if (readb(&prcs->var.rx_packet.next_frag_rcs_index) != 0xFF)
release_frag_chain(local, prcs);
@@ -2321,7 +2312,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs,
}
skb_reserve(skb, 2); /* Align IP on 16 byte (TBD check this) */
- DEBUG(4, "ray_cs rx_data total_len = %x, rx_len = %x\n", total_len,
+ pr_debug("ray_cs rx_data total_len = %x, rx_len = %x\n", total_len,
rx_len);
/************************/
@@ -2354,7 +2345,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs,
tmp = 17;
if (readb(&prcs->var.rx_packet.next_frag_rcs_index) != 0xFF) {
prcslink = prcs;
- DEBUG(1, "ray_cs rx_data in fragment loop\n");
+ pr_debug("ray_cs rx_data in fragment loop\n");
do {
prcslink = rcs_base(local)
+
@@ -2426,8 +2417,8 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)
memcpy(destaddr, ieee80211_get_DA(pmac), ADDRLEN);
memcpy(srcaddr, ieee80211_get_SA(pmac), ADDRLEN);
-#ifdef PCMCIA_DEBUG
- if (pc_debug > 3) {
+#if 0
+ if {
print_hex_dump(KERN_DEBUG, "skb->data before untranslate: ",
DUMP_PREFIX_NONE, 16, 1,
skb->data, 64, true);
@@ -2441,7 +2432,7 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)
if (psnap->dsap != 0xaa || psnap->ssap != 0xaa || psnap->ctrl != 3) {
/* not a snap type so leave it alone */
- DEBUG(3, "ray_cs untranslate NOT SNAP %02x %02x %02x\n",
+ pr_debug("ray_cs untranslate NOT SNAP %02x %02x %02x\n",
psnap->dsap, psnap->ssap, psnap->ctrl);
delta = RX_MAC_HEADER_LENGTH - ETH_HLEN;
@@ -2450,7 +2441,7 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)
} else { /* Its a SNAP */
if (memcmp(psnap->org, org_bridge, 3) == 0) {
/* EtherII and nuke the LLC */
- DEBUG(3, "ray_cs untranslate Bridge encap\n");
+ pr_debug("ray_cs untranslate Bridge encap\n");
delta = RX_MAC_HEADER_LENGTH
+ sizeof(struct snaphdr_t) - ETH_HLEN;
peth = (struct ethhdr *)(skb->data + delta);
@@ -2459,14 +2450,14 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)
switch (ntohs(type)) {
case ETH_P_IPX:
case ETH_P_AARP:
- DEBUG(3, "ray_cs untranslate RFC IPX/AARP\n");
+ pr_debug("ray_cs untranslate RFC IPX/AARP\n");
delta = RX_MAC_HEADER_LENGTH - ETH_HLEN;
peth = (struct ethhdr *)(skb->data + delta);
peth->h_proto =
htons(len - RX_MAC_HEADER_LENGTH);
break;
default:
- DEBUG(3, "ray_cs untranslate RFC default\n");
+ pr_debug("ray_cs untranslate RFC default\n");
delta = RX_MAC_HEADER_LENGTH +
sizeof(struct snaphdr_t) - ETH_HLEN;
peth = (struct ethhdr *)(skb->data + delta);
@@ -2482,12 +2473,12 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)
}
/* TBD reserve skb_reserve(skb, delta); */
skb_pull(skb, delta);
- DEBUG(3, "untranslate after skb_pull(%d), skb->data = %p\n", delta,
+ pr_debug("untranslate after skb_pull(%d), skb->data = %p\n", delta,
skb->data);
memcpy(peth->h_dest, destaddr, ADDRLEN);
memcpy(peth->h_source, srcaddr, ADDRLEN);
-#ifdef PCMCIA_DEBUG
- if (pc_debug > 3) {
+#if 0
+ {
int i;
printk(KERN_DEBUG "skb->data after untranslate:");
for (i = 0; i < 64; i++)
@@ -2529,7 +2520,7 @@ static void release_frag_chain(ray_dev_t *local, struct rcs __iomem *prcs)
while (tmp--) {
writeb(CCS_BUFFER_FREE, &prcslink->buffer_status);
if (rcsindex >= (NUMBER_OF_CCS + NUMBER_OF_RCS)) {
- DEBUG(1, "ray_cs interrupt bad rcsindex = 0x%x\n",
+ pr_debug("ray_cs interrupt bad rcsindex = 0x%x\n",
rcsindex);
break;
}
@@ -2543,9 +2534,9 @@ static void release_frag_chain(ray_dev_t *local, struct rcs __iomem *prcs)
static void authenticate(ray_dev_t *local)
{
struct pcmcia_device *link = local->finder;
- DEBUG(0, "ray_cs Starting authentication.\n");
+ dev_dbg(&link->dev, "ray_cs Starting authentication.\n");
if (!(pcmcia_dev_present(link))) {
- DEBUG(2, "ray_cs authenticate - device not present\n");
+ dev_dbg(&link->dev, "ray_cs authenticate - device not present\n");
return;
}
@@ -2573,11 +2564,11 @@ static void rx_authenticate(ray_dev_t *local, struct rcs __iomem *prcs,
copy_from_rx_buff(local, buff, pkt_addr, rx_len & 0xff);
/* if we are trying to get authenticated */
if (local->sparm.b4.a_network_type == ADHOC) {
- DEBUG(1, "ray_cs rx_auth var= %02x %02x %02x %02x %02x %02x\n",
+ pr_debug("ray_cs rx_auth var= %02x %02x %02x %02x %02x %02x\n",
msg->var[0], msg->var[1], msg->var[2], msg->var[3],
msg->var[4], msg->var[5]);
if (msg->var[2] == 1) {
- DEBUG(0, "ray_cs Sending authentication response.\n");
+ pr_debug("ray_cs Sending authentication response.\n");
if (!build_auth_frame
(local, msg->mac.addr_2, OPEN_AUTH_RESPONSE)) {
local->authentication_state = NEED_TO_AUTH;
@@ -2591,13 +2582,13 @@ static void rx_authenticate(ray_dev_t *local, struct rcs __iomem *prcs,
/* Verify authentication sequence #2 and success */
if (msg->var[2] == 2) {
if ((msg->var[3] | msg->var[4]) == 0) {
- DEBUG(1, "Authentication successful\n");
+ pr_debug("Authentication successful\n");
local->card_status = CARD_AUTH_COMPLETE;
associate(local);
local->authentication_state =
AUTHENTICATED;
} else {
- DEBUG(0, "Authentication refused\n");
+ pr_debug("Authentication refused\n");
local->card_status = CARD_AUTH_REFUSED;
join_net((u_long) local);
local->authentication_state =
@@ -2617,22 +2608,22 @@ static void associate(ray_dev_t *local)
struct net_device *dev = link->priv;
int ccsindex;
if (!(pcmcia_dev_present(link))) {
- DEBUG(2, "ray_cs associate - device not present\n");
+ dev_dbg(&link->dev, "ray_cs associate - device not present\n");
return;
}
/* If no tx buffers available, return */
if ((ccsindex = get_free_ccs(local)) < 0) {
/* TBD should never be here but... what if we are? */
- DEBUG(1, "ray_cs associate - No free ccs\n");
+ dev_dbg(&link->dev, "ray_cs associate - No free ccs\n");
return;
}
- DEBUG(1, "ray_cs Starting association with access point\n");
+ dev_dbg(&link->dev, "ray_cs Starting association with access point\n");
pccs = ccs_base(local) + ccsindex;
/* fill in the CCS */
writeb(CCS_START_ASSOCIATION, &pccs->cmd);
/* Interrupt the firmware to process the command */
if (interrupt_ecf(local, ccsindex)) {
- DEBUG(1, "ray_cs associate failed - ECF not ready for intr\n");
+ dev_dbg(&link->dev, "ray_cs associate failed - ECF not ready for intr\n");
writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status);
del_timer(&local->timer);
@@ -2655,7 +2646,7 @@ static void rx_deauthenticate(ray_dev_t *local, struct rcs __iomem *prcs,
/* UCHAR buff[256];
struct rx_msg *msg = (struct rx_msg *)buff;
*/
- DEBUG(0, "Deauthentication frame received\n");
+ pr_debug("Deauthentication frame received\n");
local->authentication_state = UNAUTHENTICATED;
/* Need to reauthenticate or rejoin depending on reason code */
/* copy_from_rx_buff(local, buff, pkt_addr, rx_len & 0xff);
@@ -2823,7 +2814,7 @@ static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type)
/* If no tx buffers available, return */
if ((ccsindex = get_free_tx_ccs(local)) < 0) {
- DEBUG(1, "ray_cs send authenticate - No free tx ccs\n");
+ pr_debug("ray_cs send authenticate - No free tx ccs\n");
return -1;
}
@@ -2855,7 +2846,7 @@ static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type)
/* Interrupt the firmware to process the command */
if (interrupt_ecf(local, ccsindex)) {
- DEBUG(1,
+ pr_debug(
"ray_cs send authentication request failed - ECF not ready for intr\n");
writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status);
return -1;
@@ -2942,9 +2933,9 @@ static int __init init_ray_cs(void)
{
int rc;
- DEBUG(1, "%s\n", rcsid);
+ pr_debug("%s\n", rcsid);
rc = pcmcia_register_driver(&ray_driver);
- DEBUG(1, "raylink init_module register_pcmcia_driver returns 0x%x\n",
+ pr_debug("raylink init_module register_pcmcia_driver returns 0x%x\n",
rc);
#ifdef CONFIG_PROC_FS
@@ -2964,7 +2955,7 @@ static int __init init_ray_cs(void)
static void __exit exit_ray_cs(void)
{
- DEBUG(0, "ray_cs: cleanup_module\n");
+ pr_debug("ray_cs: cleanup_module\n");
#ifdef CONFIG_PROC_FS
remove_proc_entry("driver/ray_cs/ray_cs", NULL);
--
1.6.0.4
^ permalink raw reply related
* [PATCH 10/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (wireless)
From: Dominik Brodowski @ 2009-10-24 19:43 UTC (permalink / raw)
To: linux-pcmcia; +Cc: Dominik Brodowski, linux-wireless, netdev
In-Reply-To: <20091024194219.GA19546@comet.dominikbrodowski.net>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 38802 bytes --]
Convert PCMCIA drivers to use the dynamic debug infrastructure, instead of
requiring manual settings of PCMCIA_DEBUG.
Also, remove all usages of the CS_CHECK macro and replace them with proper
Linux style calling and return value checking. The extra error reporting may
be dropped, as the PCMCIA core already complains about any (non-driver-author)
errors.
CC: linux-wireless@vger.kernel.org
CC: netdev@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
drivers/net/wireless/airo_cs.c | 48 +++++----------
drivers/net/wireless/atmel_cs.c | 46 +++++----------
drivers/net/wireless/hostap/hostap_cs.c | 23 +++-----
drivers/net/wireless/netwave_cs.c | 88 +++++++++++----------------
drivers/net/wireless/orinoco/orinoco_cs.c | 27 +++-----
drivers/net/wireless/orinoco/spectrum_cs.c | 54 +++++++++---------
drivers/net/wireless/wavelan_cs.c | 24 --------
drivers/net/wireless/wl3501_cs.c | 67 ++++++++--------------
8 files changed, 136 insertions(+), 241 deletions(-)
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index d0593ed..a1b84fc 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -43,21 +43,6 @@
#include "airo.h"
-/*
- All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
- you do not define PCMCIA_DEBUG at all, all the debug code will be
- left out. If you compile with PCMCIA_DEBUG=0, the debug code will
- be present but disabled -- but it can then be enabled for specific
- modules at load time with a 'pc_debug=#' option to insmod.
-*/
-#ifdef PCMCIA_DEBUG
-static int pc_debug = PCMCIA_DEBUG;
-module_param(pc_debug, int, 0);
-static char *version = "$Revision: 1.2 $";
-#define DEBUG(n, args...) if (pc_debug > (n)) printk(KERN_DEBUG args);
-#else
-#define DEBUG(n, args...)
-#endif
/*====================================================================*/
@@ -145,7 +130,7 @@ static int airo_probe(struct pcmcia_device *p_dev)
{
local_info_t *local;
- DEBUG(0, "airo_attach()\n");
+ dev_dbg(&p_dev->dev, "airo_attach()\n");
/* Interrupt setup */
p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
@@ -184,7 +169,7 @@ static int airo_probe(struct pcmcia_device *p_dev)
static void airo_detach(struct pcmcia_device *link)
{
- DEBUG(0, "airo_detach(0x%p)\n", link);
+ dev_dbg(&link->dev, "airo_detach\n");
airo_release(link);
@@ -204,9 +189,6 @@ static void airo_detach(struct pcmcia_device *link)
======================================================================*/
-#define CS_CHECK(fn, ret) \
-do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-
static int airo_cs_config_check(struct pcmcia_device *p_dev,
cistpl_cftable_entry_t *cfg,
cistpl_cftable_entry_t *dflt,
@@ -291,11 +273,11 @@ static int airo_config(struct pcmcia_device *link)
{
local_info_t *dev;
win_req_t *req;
- int last_fn, last_ret;
+ int ret;
dev = link->priv;
- DEBUG(0, "airo_config(0x%p)\n", link);
+ dev_dbg(&link->dev, "airo_config\n");
req = kzalloc(sizeof(win_req_t), GFP_KERNEL);
if (!req)
@@ -315,8 +297,8 @@ static int airo_config(struct pcmcia_device *link)
* and most client drivers will only use the CIS to fill in
* implementation-defined details.
*/
- last_ret = pcmcia_loop_config(link, airo_cs_config_check, req);
- if (last_ret)
+ ret = pcmcia_loop_config(link, airo_cs_config_check, req);
+ if (ret)
goto failed;
/*
@@ -324,21 +306,25 @@ static int airo_config(struct pcmcia_device *link)
handler to the interrupt, unless the 'Handler' member of the
irq structure is initialized.
*/
- if (link->conf.Attributes & CONF_ENABLE_IRQ)
- CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
+ if (link->conf.Attributes & CONF_ENABLE_IRQ) {
+ ret = pcmcia_request_irq(link, &link->irq);
+ if (ret)
+ goto failed;
+ }
/*
This actually configures the PCMCIA socket -- setting up
the I/O windows and the interrupt mapping, and putting the
card and host interface into "Memory and IO" mode.
*/
- CS_CHECK(RequestConfiguration,
- pcmcia_request_configuration(link, &link->conf));
+ ret = pcmcia_request_configuration(link, &link->conf);
+ if (ret)
+ goto failed;
((local_info_t *)link->priv)->eth_dev =
init_airo_card(link->irq.AssignedIRQ,
link->io.BasePort1, 1, &handle_to_dev(link));
if (!((local_info_t *)link->priv)->eth_dev)
- goto cs_failed;
+ goto failed;
/*
At this point, the dev_node_t structure(s) need to be
@@ -368,8 +354,6 @@ static int airo_config(struct pcmcia_device *link)
kfree(req);
return 0;
- cs_failed:
- cs_error(link, last_fn, last_ret);
failed:
airo_release(link);
kfree(req);
@@ -386,7 +370,7 @@ static int airo_config(struct pcmcia_device *link)
static void airo_release(struct pcmcia_device *link)
{
- DEBUG(0, "airo_release(0x%p)\n", link);
+ dev_dbg(&link->dev, "airo_release\n");
pcmcia_disable_device(link);
}
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index ddaa859..7838572 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -55,22 +55,6 @@
#include "atmel.h"
-/*
- All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
- you do not define PCMCIA_DEBUG at all, all the debug code will be
- left out. If you compile with PCMCIA_DEBUG=0, the debug code will
- be present but disabled -- but it can then be enabled for specific
- modules at load time with a 'pc_debug=#' option to insmod.
-*/
-
-#ifdef PCMCIA_DEBUG
-static int pc_debug = PCMCIA_DEBUG;
-module_param(pc_debug, int, 0);
-static char *version = "$Revision: 1.2 $";
-#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
-#else
-#define DEBUG(n, args...)
-#endif
/*====================================================================*/
@@ -155,7 +139,7 @@ static int atmel_probe(struct pcmcia_device *p_dev)
{
local_info_t *local;
- DEBUG(0, "atmel_attach()\n");
+ dev_dbg(&p_dev->dev, "atmel_attach()\n");
/* Interrupt setup */
p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
@@ -194,7 +178,7 @@ static int atmel_probe(struct pcmcia_device *p_dev)
static void atmel_detach(struct pcmcia_device *link)
{
- DEBUG(0, "atmel_detach(0x%p)\n", link);
+ dev_dbg(&link->dev, "atmel_detach\n");
atmel_release(link);
@@ -209,9 +193,6 @@ static void atmel_detach(struct pcmcia_device *link)
======================================================================*/
-#define CS_CHECK(fn, ret) \
-do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-
/* Call-back function to interrogate PCMCIA-specific information
about the current existance of the card */
static int card_present(void *arg)
@@ -275,13 +256,13 @@ static int atmel_config_check(struct pcmcia_device *p_dev,
static int atmel_config(struct pcmcia_device *link)
{
local_info_t *dev;
- int last_fn, last_ret;
+ int ret;
struct pcmcia_device_id *did;
dev = link->priv;
did = dev_get_drvdata(&handle_to_dev(link));
- DEBUG(0, "atmel_config(0x%p)\n", link);
+ dev_dbg(&link->dev, "atmel_config\n");
/*
In this loop, we scan the CIS for configuration table entries,
@@ -303,20 +284,25 @@ static int atmel_config(struct pcmcia_device *link)
handler to the interrupt, unless the 'Handler' member of the
irq structure is initialized.
*/
- if (link->conf.Attributes & CONF_ENABLE_IRQ)
- CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
+ if (link->conf.Attributes & CONF_ENABLE_IRQ) {
+ ret = pcmcia_request_irq(link, &link->irq);
+ if (ret)
+ goto failed;
+ }
/*
This actually configures the PCMCIA socket -- setting up
the I/O windows and the interrupt mapping, and putting the
card and host interface into "Memory and IO" mode.
*/
- CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
+ ret = pcmcia_request_configuration(link, &link->conf);
+ if (ret)
+ goto failed;
if (link->irq.AssignedIRQ == 0) {
printk(KERN_ALERT
"atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config.");
- goto cs_failed;
+ goto failed;
}
((local_info_t*)link->priv)->eth_dev =
@@ -327,7 +313,7 @@ static int atmel_config(struct pcmcia_device *link)
card_present,
link);
if (!((local_info_t*)link->priv)->eth_dev)
- goto cs_failed;
+ goto failed;
/*
@@ -340,8 +326,6 @@ static int atmel_config(struct pcmcia_device *link)
return 0;
- cs_failed:
- cs_error(link, last_fn, last_ret);
failed:
atmel_release(link);
return -ENODEV;
@@ -359,7 +343,7 @@ static void atmel_release(struct pcmcia_device *link)
{
struct net_device *dev = ((local_info_t*)link->priv)->eth_dev;
- DEBUG(0, "atmel_release(0x%p)\n", link);
+ dev_dbg(&link->dev, "atmel_release\n");
if (dev)
stop_atmel_card(dev);
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index 31b60dd..ca3ab84 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -510,10 +510,6 @@ static void prism2_detach(struct pcmcia_device *link)
}
-#define CS_CHECK(fn, ret) \
-do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-
-
/* run after a CARD_INSERTION event is received to configure the PCMCIA
* socket and make the device available to the system */
@@ -605,7 +601,6 @@ static int prism2_config(struct pcmcia_device *link)
struct hostap_interface *iface;
local_info_t *local;
int ret = 1;
- int last_fn, last_ret;
struct hostap_cs_priv *hw_priv;
PDEBUG(DEBUG_FLOW, "prism2_config()\n");
@@ -617,13 +612,12 @@ static int prism2_config(struct pcmcia_device *link)
}
/* Look for an appropriate configuration table entry in the CIS */
- last_ret = pcmcia_loop_config(link, prism2_config_check, NULL);
- if (last_ret) {
+ ret = pcmcia_loop_config(link, prism2_config_check, NULL);
+ if (ret) {
if (!ignore_cis_vcc)
printk(KERN_ERR "GetNextTuple(): No matching "
"CIS configuration. Maybe you need the "
"ignore_cis_vcc=1 parameter.\n");
- cs_error(link, RequestIO, last_ret);
goto failed;
}
@@ -652,8 +646,9 @@ static int prism2_config(struct pcmcia_device *link)
link->irq.IRQInfo1 = IRQ_LEVEL_ID;
link->irq.Handler = prism2_interrupt;
link->irq.Instance = dev;
- CS_CHECK(RequestIRQ,
- pcmcia_request_irq(link, &link->irq));
+ ret = pcmcia_request_irq(link, &link->irq);
+ if (ret)
+ goto failed;
}
/*
@@ -661,8 +656,9 @@ static int prism2_config(struct pcmcia_device *link)
* the I/O windows and the interrupt mapping, and putting the
* card and host interface into "Memory and IO" mode.
*/
- CS_CHECK(RequestConfiguration,
- pcmcia_request_configuration(link, &link->conf));
+ ret = pcmcia_request_configuration(link, &link->conf);
+ if (ret)
+ goto failed;
dev->irq = link->irq.AssignedIRQ;
dev->base_addr = link->io.BasePort1;
@@ -695,9 +691,6 @@ static int prism2_config(struct pcmcia_device *link)
}
return ret;
- cs_failed:
- cs_error(link, last_fn, last_ret);
-
failed:
kfree(hw_priv);
prism2_release((u_long)link);
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c
index 9498b46..cbd85de 100644
--- a/drivers/net/wireless/netwave_cs.c
+++ b/drivers/net/wireless/netwave_cs.c
@@ -145,23 +145,6 @@ static const unsigned int txConfEUD = 0x10; /* Enable Uni-Data packets */
static const unsigned int txConfKey = 0x02; /* Scramble data packets */
static const unsigned int txConfLoop = 0x01; /* Loopback mode */
-/*
- All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
- you do not define PCMCIA_DEBUG at all, all the debug code will be
- left out. If you compile with PCMCIA_DEBUG=0, the debug code will
- be present but disabled -- but it can then be enabled for specific
- modules at load time with a 'pc_debug=#' option to insmod.
-*/
-
-#ifdef PCMCIA_DEBUG
-static int pc_debug = PCMCIA_DEBUG;
-module_param(pc_debug, int, 0);
-#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
-static char *version =
-"netwave_cs.c 0.3.0 Thu Jul 17 14:36:02 1997 (John Markus Bjørndalen)\n";
-#else
-#define DEBUG(n, args...)
-#endif
/*====================================================================*/
@@ -383,7 +366,7 @@ static int netwave_probe(struct pcmcia_device *link)
struct net_device *dev;
netwave_private *priv;
- DEBUG(0, "netwave_attach()\n");
+ dev_dbg(&link->dev, "netwave_attach()\n");
/* Initialize the struct pcmcia_device structure */
dev = alloc_etherdev(sizeof(netwave_private));
@@ -438,7 +421,7 @@ static void netwave_detach(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
- DEBUG(0, "netwave_detach(0x%p)\n", link);
+ dev_dbg(&link->dev, "netwave_detach\n");
netwave_release(link);
@@ -725,18 +708,15 @@ static const struct iw_handler_def netwave_handler_def =
*
*/
-#define CS_CHECK(fn, ret) \
-do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-
static int netwave_pcmcia_config(struct pcmcia_device *link) {
struct net_device *dev = link->priv;
netwave_private *priv = netdev_priv(dev);
- int i, j, last_ret, last_fn;
+ int i, j, ret;
win_req_t req;
memreq_t mem;
u_char __iomem *ramBase = NULL;
- DEBUG(0, "netwave_pcmcia_config(0x%p)\n", link);
+ dev_dbg(&link->dev, "netwave_pcmcia_config\n");
/*
* Try allocating IO ports. This tries a few fixed addresses.
@@ -749,22 +729,24 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
if (i == 0)
break;
}
- if (i != 0) {
- cs_error(link, RequestIO, i);
+ if (i != 0)
goto failed;
- }
/*
* Now allocate an interrupt line. Note that this does not
* actually assign a handler to the interrupt.
*/
- CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
+ ret = pcmcia_request_irq(link, &link->irq);
+ if (ret)
+ goto failed;
/*
* This actually configures the PCMCIA socket -- setting up
* the I/O windows and the interrupt mapping.
*/
- CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
+ ret = pcmcia_request_configuration(link, &link->conf);
+ if (ret)
+ goto failed;
/*
* Allocate a 32K memory window. Note that the struct pcmcia_device
@@ -772,14 +754,18 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
* device needs several windows, you'll need to keep track of
* the handles in your private data structure, dev->priv.
*/
- DEBUG(1, "Setting mem speed of %d\n", mem_speed);
+ dev_dbg(&link->dev, "Setting mem speed of %d\n", mem_speed);
req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_CM|WIN_ENABLE;
req.Base = 0; req.Size = 0x8000;
req.AccessSpeed = mem_speed;
- CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win));
+ ret = pcmcia_request_window(&link, &req, &link->win);
+ if (ret)
+ goto failed;
mem.CardOffset = 0x20000; mem.Page = 0;
- CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));
+ ret = pcmcia_map_mem_page(link->win, &mem);
+ if (ret)
+ goto failed;
/* Store base address of the common window frame */
ramBase = ioremap(req.Base, 0x8000);
@@ -818,8 +804,6 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
get_uint16(ramBase + NETWAVE_EREG_ARW+2));
return 0;
-cs_failed:
- cs_error(link, last_fn, last_ret);
failed:
netwave_release(link);
return -ENODEV;
@@ -837,7 +821,7 @@ static void netwave_release(struct pcmcia_device *link)
struct net_device *dev = link->priv;
netwave_private *priv = netdev_priv(dev);
- DEBUG(0, "netwave_release(0x%p)\n", link);
+ dev_dbg(&link->dev, "netwave_release\n");
pcmcia_disable_device(link);
if (link->win)
@@ -892,7 +876,7 @@ static void netwave_reset(struct net_device *dev) {
u_char __iomem *ramBase = priv->ramBase;
unsigned int iobase = dev->base_addr;
- DEBUG(0, "netwave_reset: Done with hardware reset\n");
+ pr_debug("netwave_reset: Done with hardware reset\n");
priv->timeoutCounter = 0;
@@ -988,7 +972,7 @@ static int netwave_hw_xmit(unsigned char* data, int len,
dev->stats.tx_bytes += len;
- DEBUG(3, "Transmitting with SPCQ %x SPU %x LIF %x ISPLQ %x\n",
+ pr_debug("Transmitting with SPCQ %x SPU %x LIF %x ISPLQ %x\n",
readb(ramBase + NETWAVE_EREG_SPCQ),
readb(ramBase + NETWAVE_EREG_SPU),
readb(ramBase + NETWAVE_EREG_LIF),
@@ -1000,7 +984,7 @@ static int netwave_hw_xmit(unsigned char* data, int len,
MaxData = get_uint16(ramBase + NETWAVE_EREG_TDP+2);
DataOffset = get_uint16(ramBase + NETWAVE_EREG_TDP+4);
- DEBUG(3, "TxFreeList %x, MaxData %x, DataOffset %x\n",
+ pr_debug("TxFreeList %x, MaxData %x, DataOffset %x\n",
TxFreeList, MaxData, DataOffset);
/* Copy packet to the adapter fragment buffers */
@@ -1088,7 +1072,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
status = inb(iobase + NETWAVE_REG_ASR);
if (!pcmcia_dev_present(link)) {
- DEBUG(1, "netwave_interrupt: Interrupt with status 0x%x "
+ pr_debug("netwave_interrupt: Interrupt with status 0x%x "
"from removed or suspended card!\n", status);
break;
}
@@ -1132,7 +1116,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
int txStatus;
txStatus = readb(ramBase + NETWAVE_EREG_TSER);
- DEBUG(3, "Transmit done. TSER = %x id %x\n",
+ pr_debug("Transmit done. TSER = %x id %x\n",
txStatus, readb(ramBase + NETWAVE_EREG_TSER + 1));
if (txStatus & 0x20) {
@@ -1156,7 +1140,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
* TxGU and TxNOAP is set. (Those are the only ones
* to set TxErr).
*/
- DEBUG(3, "netwave_interrupt: TxDN with error status %x\n",
+ pr_debug("netwave_interrupt: TxDN with error status %x\n",
txStatus);
/* Clear out TxGU, TxNOAP, TxErr and TxTrys */
@@ -1164,7 +1148,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
writeb(0xdf & txStatus, ramBase+NETWAVE_EREG_TSER+4);
++dev->stats.tx_errors;
}
- DEBUG(3, "New status is TSER %x ASR %x\n",
+ pr_debug("New status is TSER %x ASR %x\n",
readb(ramBase + NETWAVE_EREG_TSER),
inb(iobase + NETWAVE_REG_ASR));
@@ -1172,7 +1156,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
}
/* TxBA, this would trigger on all error packets received */
/* if (status & 0x01) {
- DEBUG(4, "Transmit buffers available, %x\n", status);
+ pr_debug("Transmit buffers available, %x\n", status);
}
*/
}
@@ -1190,7 +1174,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
*/
static void netwave_watchdog(struct net_device *dev) {
- DEBUG(1, "%s: netwave_watchdog: watchdog timer expired\n", dev->name);
+ pr_debug("%s: netwave_watchdog: watchdog timer expired\n", dev->name);
netwave_reset(dev);
dev->trans_start = jiffies;
netif_wake_queue(dev);
@@ -1211,7 +1195,7 @@ static int netwave_rx(struct net_device *dev)
int i;
u_char *ptr;
- DEBUG(3, "xinw_rx: Receiving ... \n");
+ pr_debug("xinw_rx: Receiving ... \n");
/* Receive max 10 packets for now. */
for (i = 0; i < 10; i++) {
@@ -1237,7 +1221,7 @@ static int netwave_rx(struct net_device *dev)
skb = dev_alloc_skb(rcvLen+5);
if (skb == NULL) {
- DEBUG(1, "netwave_rx: Could not allocate an sk_buff of "
+ pr_debug("netwave_rx: Could not allocate an sk_buff of "
"length %d\n", rcvLen);
++dev->stats.rx_dropped;
/* Tell the adapter to skip the packet */
@@ -1279,7 +1263,7 @@ static int netwave_rx(struct net_device *dev)
wait_WOC(iobase);
writeb(NETWAVE_CMD_SRP, ramBase + NETWAVE_EREG_CB + 0);
writeb(NETWAVE_CMD_EOC, ramBase + NETWAVE_EREG_CB + 1);
- DEBUG(3, "Packet reception ok\n");
+ pr_debug("Packet reception ok\n");
}
return 0;
}
@@ -1288,7 +1272,7 @@ static int netwave_open(struct net_device *dev) {
netwave_private *priv = netdev_priv(dev);
struct pcmcia_device *link = priv->p_dev;
- DEBUG(1, "netwave_open: starting.\n");
+ dev_dbg(&link->dev, "netwave_open: starting.\n");
if (!pcmcia_dev_present(link))
return -ENODEV;
@@ -1305,7 +1289,7 @@ static int netwave_close(struct net_device *dev) {
netwave_private *priv = netdev_priv(dev);
struct pcmcia_device *link = priv->p_dev;
- DEBUG(1, "netwave_close: finishing.\n");
+ dev_dbg(&link->dev, "netwave_close: finishing.\n");
link->open--;
netif_stop_queue(dev);
@@ -1358,11 +1342,11 @@ static void set_multicast_list(struct net_device *dev)
u_char rcvMode = 0;
#ifdef PCMCIA_DEBUG
- if (pc_debug > 2) {
- static int old;
+ {
+ xstatic int old;
if (old != dev->mc_count) {
old = dev->mc_count;
- DEBUG(0, "%s: setting Rx mode to %d addresses.\n",
+ pr_debug("%s: setting Rx mode to %d addresses.\n",
dev->name, dev->mc_count);
}
}
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
index 38c1c9d..da626ec 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
@@ -160,12 +160,6 @@ static void orinoco_cs_detach(struct pcmcia_device *link)
* device available to the system.
*/
-#define CS_CHECK(fn, ret) do { \
- last_fn = (fn); \
- if ((last_ret = (ret)) != 0) \
- goto cs_failed; \
-} while (0)
-
static int orinoco_cs_config_check(struct pcmcia_device *p_dev,
cistpl_cftable_entry_t *cfg,
cistpl_cftable_entry_t *dflt,
@@ -240,7 +234,7 @@ orinoco_cs_config(struct pcmcia_device *link)
struct orinoco_private *priv = link->priv;
struct orinoco_pccard *card = priv->card;
hermes_t *hw = &priv->hw;
- int last_fn, last_ret;
+ int ret;
void __iomem *mem;
/*
@@ -257,13 +251,12 @@ orinoco_cs_config(struct pcmcia_device *link)
* and most client drivers will only use the CIS to fill in
* implementation-defined details.
*/
- last_ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL);
- if (last_ret) {
+ ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL);
+ if (ret) {
if (!ignore_cis_vcc)
printk(KERN_ERR PFX "GetNextTuple(): No matching "
"CIS configuration. Maybe you need the "
"ignore_cis_vcc=1 parameter.\n");
- cs_error(link, RequestIO, last_ret);
goto failed;
}
@@ -272,14 +265,16 @@ orinoco_cs_config(struct pcmcia_device *link)
* a handler to the interrupt, unless the 'Handler' member of
* the irq structure is initialized.
*/
- CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
+ ret = pcmcia_request_irq(link, &link->irq);
+ if (ret)
+ goto failed;
/* We initialize the hermes structure before completing PCMCIA
* configuration just in case the interrupt handler gets
* called. */
mem = ioport_map(link->io.BasePort1, link->io.NumPorts1);
if (!mem)
- goto cs_failed;
+ goto failed;
hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING);
@@ -288,8 +283,9 @@ orinoco_cs_config(struct pcmcia_device *link)
* the I/O windows and the interrupt mapping, and putting the
* card and host interface into "Memory and IO" mode.
*/
- CS_CHECK(RequestConfiguration,
- pcmcia_request_configuration(link, &link->conf));
+ ret = pcmcia_request_configuration(link, &link->conf);
+ if (ret)
+ goto failed;
/* Ok, we have the configuration, prepare to register the netdev */
card->node.major = card->node.minor = 0;
@@ -315,9 +311,6 @@ orinoco_cs_config(struct pcmcia_device *link)
* net_device has been registered */
return 0;
- cs_failed:
- cs_error(link, last_fn, last_ret);
-
failed:
orinoco_cs_release(link);
return -ENODEV;
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c
index c361310..700010e 100644
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
@@ -73,9 +73,6 @@ static void spectrum_cs_release(struct pcmcia_device *link);
#define HCR_MEM16 0x10 /* memory width bit, should be preserved */
-#define CS_CHECK(fn, ret) \
- do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-
/*
* Reset the card using configuration registers COR and CCSR.
* If IDLE is 1, stop the firmware, so that it can be safely rewritten.
@@ -83,7 +80,7 @@ static void spectrum_cs_release(struct pcmcia_device *link);
static int
spectrum_reset(struct pcmcia_device *link, int idle)
{
- int last_ret, last_fn;
+ int ret;
conf_reg_t reg;
u_int save_cor;
@@ -95,23 +92,26 @@ spectrum_reset(struct pcmcia_device *link, int idle)
reg.Function = 0;
reg.Action = CS_READ;
reg.Offset = CISREG_COR;
- CS_CHECK(AccessConfigurationRegister,
- pcmcia_access_configuration_register(link, ®));
+ ret = pcmcia_access_configuration_register(link, ®);
+ if (ret)
+ goto failed;
save_cor = reg.Value;
/* Soft-Reset card */
reg.Action = CS_WRITE;
reg.Offset = CISREG_COR;
reg.Value = (save_cor | COR_SOFT_RESET);
- CS_CHECK(AccessConfigurationRegister,
- pcmcia_access_configuration_register(link, ®));
+ ret = pcmcia_access_configuration_register(link, ®);
+ if (ret)
+ goto failed;
udelay(1000);
/* Read CCSR */
reg.Action = CS_READ;
reg.Offset = CISREG_CCSR;
- CS_CHECK(AccessConfigurationRegister,
- pcmcia_access_configuration_register(link, ®));
+ ret = pcmcia_access_configuration_register(link, ®);
+ if (ret)
+ goto failed;
/*
* Start or stop the firmware. Memory width bit should be
@@ -120,21 +120,22 @@ spectrum_reset(struct pcmcia_device *link, int idle)
reg.Action = CS_WRITE;
reg.Offset = CISREG_CCSR;
reg.Value = (idle ? HCR_IDLE : HCR_RUN) | (reg.Value & HCR_MEM16);
- CS_CHECK(AccessConfigurationRegister,
- pcmcia_access_configuration_register(link, ®));
+ ret = pcmcia_access_configuration_register(link, ®);
+ if (ret)
+ goto failed;
udelay(1000);
/* Restore original COR configuration index */
reg.Action = CS_WRITE;
reg.Offset = CISREG_COR;
reg.Value = (save_cor & ~COR_SOFT_RESET);
- CS_CHECK(AccessConfigurationRegister,
- pcmcia_access_configuration_register(link, ®));
+ ret = pcmcia_access_configuration_register(link, ®);
+ if (ret)
+ goto failed;
udelay(1000);
return 0;
-cs_failed:
- cs_error(link, last_fn, last_ret);
+failed:
return -ENODEV;
}
@@ -307,7 +308,7 @@ spectrum_cs_config(struct pcmcia_device *link)
struct orinoco_private *priv = link->priv;
struct orinoco_pccard *card = priv->card;
hermes_t *hw = &priv->hw;
- int last_fn, last_ret;
+ int ret;
void __iomem *mem;
/*
@@ -324,13 +325,12 @@ spectrum_cs_config(struct pcmcia_device *link)
* and most client drivers will only use the CIS to fill in
* implementation-defined details.
*/
- last_ret = pcmcia_loop_config(link, spectrum_cs_config_check, NULL);
- if (last_ret) {
+ ret = pcmcia_loop_config(link, spectrum_cs_config_check, NULL);
+ if (ret) {
if (!ignore_cis_vcc)
printk(KERN_ERR PFX "GetNextTuple(): No matching "
"CIS configuration. Maybe you need the "
"ignore_cis_vcc=1 parameter.\n");
- cs_error(link, RequestIO, last_ret);
goto failed;
}
@@ -339,14 +339,16 @@ spectrum_cs_config(struct pcmcia_device *link)
* a handler to the interrupt, unless the 'Handler' member of
* the irq structure is initialized.
*/
- CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
+ ret = pcmcia_request_irq(link, &link->irq);
+ if (ret)
+ goto failed;
/* We initialize the hermes structure before completing PCMCIA
* configuration just in case the interrupt handler gets
* called. */
mem = ioport_map(link->io.BasePort1, link->io.NumPorts1);
if (!mem)
- goto cs_failed;
+ goto failed;
hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING);
@@ -355,8 +357,9 @@ spectrum_cs_config(struct pcmcia_device *link)
* the I/O windows and the interrupt mapping, and putting the
* card and host interface into "Memory and IO" mode.
*/
- CS_CHECK(RequestConfiguration,
- pcmcia_request_configuration(link, &link->conf));
+ ret = pcmcia_request_configuration(link, &link->conf);
+ if (ret)
+ goto failed;
/* Ok, we have the configuration, prepare to register the netdev */
card->node.major = card->node.minor = 0;
@@ -386,9 +389,6 @@ spectrum_cs_config(struct pcmcia_device *link)
* net_device has been registered */
return 0;
- cs_failed:
- cs_error(link, last_fn, last_ret);
-
failed:
spectrum_cs_release(link);
return -ENODEV;
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index 431a20e..2fad4ac 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -3656,10 +3656,7 @@ wv_pcmcia_reset(struct net_device * dev)
i = pcmcia_access_configuration_register(link, ®);
if (i != 0)
- {
- cs_error(link, AccessConfigurationRegister, i);
return FALSE;
- }
#ifdef DEBUG_CONFIG_INFO
printk(KERN_DEBUG "%s: wavelan_pcmcia_reset(): Config reg is 0x%x\n",
@@ -3670,19 +3667,13 @@ wv_pcmcia_reset(struct net_device * dev)
reg.Value = reg.Value | COR_SW_RESET;
i = pcmcia_access_configuration_register(link, ®);
if (i != 0)
- {
- cs_error(link, AccessConfigurationRegister, i);
return FALSE;
- }
reg.Action = CS_WRITE;
reg.Value = COR_LEVEL_IRQ | COR_CONFIG;
i = pcmcia_access_configuration_register(link, ®);
if (i != 0)
- {
- cs_error(link, AccessConfigurationRegister, i);
return FALSE;
- }
#ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "%s: <-wv_pcmcia_reset()\n", dev->name);
@@ -3857,10 +3848,7 @@ wv_pcmcia_config(struct pcmcia_device * link)
{
i = pcmcia_request_io(link, &link->io);
if (i != 0)
- {
- cs_error(link, RequestIO, i);
break;
- }
/*
* Now allocate an interrupt line. Note that this does not
@@ -3868,10 +3856,7 @@ wv_pcmcia_config(struct pcmcia_device * link)
*/
i = pcmcia_request_irq(link, &link->irq);
if (i != 0)
- {
- cs_error(link, RequestIRQ, i);
break;
- }
/*
* This actually configures the PCMCIA socket -- setting up
@@ -3880,10 +3865,7 @@ wv_pcmcia_config(struct pcmcia_device * link)
link->conf.ConfigIndex = 1;
i = pcmcia_request_configuration(link, &link->conf);
if (i != 0)
- {
- cs_error(link, RequestConfiguration, i);
break;
- }
/*
* Allocate a small memory window. Note that the struct pcmcia_device
@@ -3896,10 +3878,7 @@ wv_pcmcia_config(struct pcmcia_device * link)
req.AccessSpeed = mem_speed;
i = pcmcia_request_window(&link, &req, &link->win);
if (i != 0)
- {
- cs_error(link, RequestWindow, i);
break;
- }
lp->mem = ioremap(req.Base, req.Size);
dev->mem_start = (u_long)lp->mem;
@@ -3908,10 +3887,7 @@ wv_pcmcia_config(struct pcmcia_device * link)
mem.CardOffset = 0; mem.Page = 0;
i = pcmcia_map_mem_page(link->win, &mem);
if (i != 0)
- {
- cs_error(link, MapMemPage, i);
break;
- }
/* Feed device with this info... */
dev->irq = link->irq.AssignedIRQ;
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 4f1e0cf..7e8e269 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -67,23 +67,7 @@
/* For rough constant delay */
#define WL3501_NOPLOOP(n) { int x = 0; while (x++ < n) slow_down_io(); }
-/*
- * All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If you do not
- * define PCMCIA_DEBUG at all, all the debug code will be left out. If you
- * compile with PCMCIA_DEBUG=0, the debug code will be present but disabled --
- * but it can then be enabled for specific modules at load time with a
- * 'pc_debug=#' option to insmod.
- */
-#define PCMCIA_DEBUG 0
-#ifdef PCMCIA_DEBUG
-static int pc_debug = PCMCIA_DEBUG;
-module_param(pc_debug, int, 0);
-#define dprintk(n, format, args...) \
- { if (pc_debug > (n)) \
- printk(KERN_INFO "%s: " format "\n", __func__ , ##args); }
-#else
-#define dprintk(n, format, args...)
-#endif
+
#define wl3501_outb(a, b) { outb(a, b); slow_down_io(); }
#define wl3501_outb_p(a, b) { outb_p(a, b); slow_down_io(); }
@@ -684,10 +668,10 @@ static void wl3501_mgmt_scan_confirm(struct wl3501_card *this, u16 addr)
int matchflag = 0;
struct wl3501_scan_confirm sig;
- dprintk(3, "entry");
+ pr_debug("entry");
wl3501_get_from_wla(this, addr, &sig, sizeof(sig));
if (sig.status == WL3501_STATUS_SUCCESS) {
- dprintk(3, "success");
+ pr_debug("success");
if ((this->net_type == IW_MODE_INFRA &&
(sig.cap_info & WL3501_MGMT_CAPABILITY_ESS)) ||
(this->net_type == IW_MODE_ADHOC &&
@@ -722,7 +706,7 @@ static void wl3501_mgmt_scan_confirm(struct wl3501_card *this, u16 addr)
}
}
} else if (sig.status == WL3501_STATUS_TIMEOUT) {
- dprintk(3, "timeout");
+ pr_debug("timeout");
this->join_sta_bss = 0;
for (i = this->join_sta_bss; i < this->bss_cnt; i++)
if (!wl3501_mgmt_join(this, i))
@@ -879,7 +863,7 @@ static int wl3501_mgmt_auth(struct wl3501_card *this)
.timeout = 1000,
};
- dprintk(3, "entry");
+ pr_debug("entry");
memcpy(sig.mac_addr, this->bssid, ETH_ALEN);
return wl3501_esbq_exec(this, &sig, sizeof(sig));
}
@@ -893,7 +877,7 @@ static int wl3501_mgmt_association(struct wl3501_card *this)
.cap_info = this->cap_info,
};
- dprintk(3, "entry");
+ pr_debug("entry");
memcpy(sig.mac_addr, this->bssid, ETH_ALEN);
return wl3501_esbq_exec(this, &sig, sizeof(sig));
}
@@ -903,7 +887,7 @@ static void wl3501_mgmt_join_confirm(struct net_device *dev, u16 addr)
struct wl3501_card *this = netdev_priv(dev);
struct wl3501_join_confirm sig;
- dprintk(3, "entry");
+ pr_debug("entry");
wl3501_get_from_wla(this, addr, &sig, sizeof(sig));
if (sig.status == WL3501_STATUS_SUCCESS) {
if (this->net_type == IW_MODE_INFRA) {
@@ -962,7 +946,7 @@ static inline void wl3501_md_confirm_interrupt(struct net_device *dev,
{
struct wl3501_md_confirm sig;
- dprintk(3, "entry");
+ pr_debug("entry");
wl3501_get_from_wla(this, addr, &sig, sizeof(sig));
wl3501_free_tx_buffer(this, sig.data);
if (netif_queue_stopped(dev))
@@ -1017,7 +1001,7 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev,
static inline void wl3501_get_confirm_interrupt(struct wl3501_card *this,
u16 addr, void *sig, int size)
{
- dprintk(3, "entry");
+ pr_debug("entry");
wl3501_get_from_wla(this, addr, &this->sig_get_confirm,
sizeof(this->sig_get_confirm));
wake_up(&this->wait);
@@ -1029,7 +1013,7 @@ static inline void wl3501_start_confirm_interrupt(struct net_device *dev,
{
struct wl3501_start_confirm sig;
- dprintk(3, "entry");
+ pr_debug("entry");
wl3501_get_from_wla(this, addr, &sig, sizeof(sig));
if (sig.status == WL3501_STATUS_SUCCESS)
netif_wake_queue(dev);
@@ -1041,7 +1025,7 @@ static inline void wl3501_assoc_confirm_interrupt(struct net_device *dev,
struct wl3501_card *this = netdev_priv(dev);
struct wl3501_assoc_confirm sig;
- dprintk(3, "entry");
+ pr_debug("entry");
wl3501_get_from_wla(this, addr, &sig, sizeof(sig));
if (sig.status == WL3501_STATUS_SUCCESS)
@@ -1053,7 +1037,7 @@ static inline void wl3501_auth_confirm_interrupt(struct wl3501_card *this,
{
struct wl3501_auth_confirm sig;
- dprintk(3, "entry");
+ pr_debug("entry");
wl3501_get_from_wla(this, addr, &sig, sizeof(sig));
if (sig.status == WL3501_STATUS_SUCCESS)
@@ -1069,7 +1053,7 @@ static inline void wl3501_rx_interrupt(struct net_device *dev)
u8 sig_id;
struct wl3501_card *this = netdev_priv(dev);
- dprintk(3, "entry");
+ pr_debug("entry");
loop:
morepkts = 0;
if (!wl3501_esbq_confirm(this))
@@ -1302,7 +1286,7 @@ static int wl3501_reset(struct net_device *dev)
wl3501_ack_interrupt(this);
wl3501_unblock_interrupt(this);
wl3501_mgmt_scan(this, 100);
- dprintk(1, "%s: device reset", dev->name);
+ pr_debug("%s: device reset", dev->name);
rc = 0;
out:
return rc;
@@ -1376,7 +1360,7 @@ static int wl3501_open(struct net_device *dev)
link->open++;
/* Initial WL3501 firmware */
- dprintk(1, "%s: Initialize WL3501 firmware...", dev->name);
+ pr_debug("%s: Initialize WL3501 firmware...", dev->name);
if (wl3501_init_firmware(this))
goto fail;
/* Initial device variables */
@@ -1388,7 +1372,7 @@ static int wl3501_open(struct net_device *dev)
wl3501_unblock_interrupt(this);
wl3501_mgmt_scan(this, 100);
rc = 0;
- dprintk(1, "%s: WL3501 opened", dev->name);
+ pr_debug("%s: WL3501 opened", dev->name);
printk(KERN_INFO "%s: Card Name: %s\n"
"%s: Firmware Date: %s\n",
dev->name, this->card_name,
@@ -1945,9 +1929,6 @@ out_link:
return -ENOMEM;
}
-#define CS_CHECK(fn, ret) \
-do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-
/**
* wl3501_config - configure the PCMCIA socket and make eth device available
* @link - FILL_IN
@@ -1959,7 +1940,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
static int wl3501_config(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
- int i = 0, j, last_fn, last_ret;
+ int i = 0, j, ret;
struct wl3501_card *this;
/* Try allocating IO ports. This tries a few fixed addresses. If you
@@ -1975,20 +1956,22 @@ static int wl3501_config(struct pcmcia_device *link)
if (i == 0)
break;
}
- if (i != 0) {
- cs_error(link, RequestIO, i);
+ if (i != 0)
goto failed;
- }
/* Now allocate an interrupt line. Note that this does not actually
* assign a handler to the interrupt. */
- CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
+ ret = pcmcia_request_irq(link, &link->irq);
+ if (ret)
+ goto failed;
/* This actually configures the PCMCIA socket -- setting up the I/O
* windows and the interrupt mapping. */
- CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
+ ret = pcmcia_request_configuration(link, &link->conf);
+ if (ret)
+ goto failed;
dev->irq = link->irq.AssignedIRQ;
dev->base_addr = link->io.BasePort1;
@@ -2041,8 +2024,6 @@ static int wl3501_config(struct pcmcia_device *link)
netif_start_queue(dev);
return 0;
-cs_failed:
- cs_error(link, last_fn, last_ret);
failed:
wl3501_release(link);
return -ENODEV;
--
1.6.0.4
^ permalink raw reply related
* [PATCH] mac80211: fix for incorrect sequence number on hostapd injected frames
From: Björn Smedman @ 2009-10-24 18:55 UTC (permalink / raw)
To: linville
Cc: linux-wireless, Johannes Berg, Jouni Malinen, Joerg Pommnitz,
Will Dyson
When hostapd injects a frame, e.g. an authentication or association
response, mac80211 looks for a suitable access point virtual interface
to associate the frame with based on its source address. This makes it
possible e.g. to correctly assign sequence numbers to the frames.
A small typo in the ethernet address comparison statement caused a
failure to find a suitable ap interface. Sequence numbers on such
frames where therefore left unassigned causing some clients
(especially windows-based 11b/g clients) to reject them and fail to
authenticate or associate with the access point. This patch fixes the
typo in the address comparison statement.
Signed-off-by: Björn Smedman <bjorn.smedman@venatech.se>
---
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index db4bda6..eaa4118 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1445,7 +1445,7 @@ static void ieee80211_xmit(struct
ieee80211_sub_if_data *sdata,
if (tmp_sdata->vif.type != NL80211_IFTYPE_AP)
continue;
if (compare_ether_addr(tmp_sdata->dev->dev_addr,
- hdr->addr2)) {
+ hdr->addr2) == 0) {
dev_hold(tmp_sdata->dev);
dev_put(sdata->dev);
sdata = tmp_sdata;
^ permalink raw reply related
* Re: ath5k AP kernel panic when client uses SCP
From: Tomasz Chmielewski @ 2009-10-24 18:10 UTC (permalink / raw)
To: Bob Copeland; +Cc: Gábor Stefanik, linux-wireless, linux-net, linux-mips
In-Reply-To: <20091024160938.GC31897@hash.localnet>
Bob Copeland wrote:
> On Sat, Oct 24, 2009 at 05:27:56PM +0200, Tomasz Chmielewski wrote:
>> Hmm, I get:
>>
>> 00000000 <skb_gso_segment>
>>
>> So I better leave the files here:
>>
>> http://www1.wpkg.org/skb_gso_segment/
>
> So, do you only get this WARN() once before things go downhill?
Here is everything the system said after being powered on, including all
page allocation failures and the final oops:
http://www1.wpkg.org/skb_gso_segment/minicom.txt
(and it looks slightly different than the last time).
--
Tomasz Chmielewski
http://wpkg.org
^ permalink raw reply
* Re: 2.6.32-rc5-git3 -- EIP is at cfg80211_conn_work+0x73/0xd6 [cfg80211]
From: Johannes Berg @ 2009-10-24 18:05 UTC (permalink / raw)
To: Miles Lane; +Cc: LKML, linux-wireless
In-Reply-To: <4AE2683D.4020000@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 185 bytes --]
On Fri, 2009-10-23 at 22:36 -0400, Miles Lane wrote:
> EIP is at cfg80211_conn_work+0x73/0xd6 [cfg80211]
That's strange. What actually happened here? NULL ptr deref?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [ath9k-devel] mac80211/ath9k/hostapd: Some clients unable to associate with AP
From: Johannes Berg @ 2009-10-24 18:03 UTC (permalink / raw)
To: Björn Smedman
Cc: Jouni Malinen, Joerg Pommnitz, Will Dyson, ath9k-devel,
linux-wireless
In-Reply-To: <133e8d7e0910232012g718dae3kf297bf5d2301b48@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1926 bytes --]
On Sat, 2009-10-24 at 05:12 +0200, Björn Smedman wrote:
> >> diff -urN compat-wireless-2009-10-21-before_seqnum_fix/net/mac80211/tx.c
> >> compat-wireless-2009-10-21/net/mac80211/tx.c
> >> @@ -1445,7 +1445,7 @@
> >> if (tmp_sdata->vif.type != NL80211_IFTYPE_AP)
> >> continue;
> >> if (compare_ether_addr(tmp_sdata->dev->dev_addr,
> >> - hdr->addr2)) {
> >> + hdr->addr2) == 0) {
> >> dev_hold(tmp_sdata->dev);
> >> dev_put(sdata->dev);
> >> sdata = tmp_sdata;
> >
> > This does indeed look like a typo. Though, I'm not sure how this would
> > have caused a regression between compat-wireless-2009-06-02 and
> > compat-wireless-2.6.32-rc1. The incorrect compare_ether_addr() use seems
> > to be there in the original commit that added this code
> > (25d834e16294c8dfd923dae6bdb8a055391a99a5 from September 12, 2008)..
>
> Interesting puzzle. :) It looks like there was a complementary bug
> (the pointer hdr was set to point len_rthdr * sizeof(struct
> ieee80211_hdr) bytes into the skbuff) in that commit:
> ...
> + len_rthdr = ieee80211_get_radiotap_len(skb->data);
> + hdr = (struct ieee80211_hdr *)skb->data + len_rthdr;
> ...
> So the frame source address used to be compared with random data which
> was likely to result in inequality, causing the first ap interface to
> be "found" and the code to work as expected. I guess the pointer bug
> was fixed somewhere between 2006-06-02 and now "causing" the sequence
> number problem.
Heh, indeed, interesting. I remember somebody fixing that, but was
unaware of the second bug (obviously).
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: ath5k AP kernel panic when client uses SCP
From: Bob Copeland @ 2009-10-24 16:09 UTC (permalink / raw)
To: Tomasz Chmielewski
Cc: Gábor Stefanik, linux-wireless, linux-net, linux-mips
In-Reply-To: <4AE31CFC.1080803@wpkg.org>
On Sat, Oct 24, 2009 at 05:27:56PM +0200, Tomasz Chmielewski wrote:
> Hmm, I get:
>
> 00000000 <skb_gso_segment>
>
> So I better leave the files here:
>
> http://www1.wpkg.org/skb_gso_segment/
So, do you only get this WARN() once before things go downhill?
> [ 516.440000] b44: caps=(0x0, 0x0) len=52 data_len=0 ip_summed=1
The actual error is on skb_release_data, this might give a clue if
there's some corruption going on.
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* Re: ath5k: no further txbuf available, dropping packet
From: Michael Buesch @ 2009-10-24 15:32 UTC (permalink / raw)
To: Bob Copeland
Cc: Jiri Slaby, Nick Kossifidis, Luis R. Rodriguez, linux-wireless
In-Reply-To: <200910241705.39104.mb@bu3sch.de>
On Saturday 24 October 2009 17:05:37 Michael Buesch wrote:
> On Saturday 24 October 2009 15:19:29 Bob Copeland wrote:
> > On Fri, Oct 23, 2009 at 04:08:16PM +0200, Michael Buesch wrote:
> > > ath5k breaks in AP mode after some operation time and keeps throwing
> > > this message:
> > >
> > > [2096249.446071] ath5k phy0: no further txbuf available, dropping packet
> > >
> > > Driver is yesterday's compat-wireless on 2.6.31.1
> >
> > Ok looked a bit more at this. I don't see a leak, but I think the
> > txbufs aren't getting reaped. Otherwise, we should reenable the queues
> > when we get back 40 TX completion interrupts.
> >
> > I'm a bit short on time to track it down, but one thing to try is
> > commenting out the following from ath5k_beacon_send (will break buffering
> > but you can test non-ps clients):
> >
> > skb = ieee80211_get_buffered_bc(sc->hw, sc->vif);
> > while (skb) {
> > ath5k_tx_queue(sc->hw, skb, sc->cabq);
> > skb = ieee80211_get_buffered_bc(sc->hw, sc->vif);
> > }
> >
>
> I didn't try this, yet, but PS buffering seems to be broken anyway.
> If I connect the n810 (which does PS) to the ath5k AP, I cannot ping
> the n810 unless I also transfer (ping) _from_ the n810 simultaneously.
> I did not monitor the traffic, yet, but to me it seems the AP is unable
> to notify that the PS device should wake up (TIM problems?). By pinging from
> the n810, I frequently force-wakeup the device, so traffic to the device
> also works (more or less).
>
Ok on the monitor log it looks like the ath5k AP simply sends data while
the STA is in PS, instead of buffering it and updating the TIM.
So if I ping the STA, it keeps sending packets and doesn't set the TIM,
but don't get any repsonse of course, because the STA is power saving.
If I simultaneously ping from the STA, the buffering and TIM handling suddenly
seems to start working. The AP indicates traffic via TIM and the STA sends PS polls.
--
Greetings, Michael.
^ permalink raw reply
* Re: ath5k AP kernel panic when client uses SCP
From: Tomasz Chmielewski @ 2009-10-24 15:27 UTC (permalink / raw)
To: Bob Copeland; +Cc: Gábor Stefanik, linux-wireless, linux-net, linux-mips
In-Reply-To: <20091024125217.GA31897@hash.localnet>
Bob Copeland wrote:
>> [ 516.430000] ------------[ cut here ]------------
>> [ 516.430000] WARNING: at net/core/dev.c:1566 skb_gso_segment+0x110/0x298()
>> [ 516.440000] b44: caps=(0x0, 0x0) len=52 data_len=0 ip_summed=1
>
> So this looks like the ethernet driver b44 instead of ath5k, I think.
Could be, but!
I can trigger it when doing this kind of SSH traffic:
PC >--100Mbit--> b44 (Asus WL-500gP) ath5k >--wireless--> laptop
When I transfer over wired ethernet only through this device, everything
works properly, no page allocation failures, no warnings, panics.
>> [ 516.450000] Modules linked in: configs aes_generic tun sch_sfq cls_fw sch_htb ipt_MASQUERADE iptable_nat nf_nat xt_MARK iptable_mangle ipt_ULOG xt_recent nf_conn1
>> [ 516.480000] Call Trace:
>> [ 516.480000] [<80013ac4>] dump_stack+0x8/0x34
>> [ 516.480000] [<8002f2a0>] warn_slowpath_common+0x70/0x98
>> [ 516.490000] [<8002f308>] warn_slowpath_fmt+0x24/0x30
>> [ 516.490000] [<801f0398>] skb_gso_segment+0x110/0x298
>
> ...but this is higher up the stack. skb_gso_segment is about a year old
> so it would be odd if there were a bug here. Can you do the following?
>
> objdump -S net/core/dev.o, then find the address for skb_gso_segment,
> it should look something like this (your numbers and disassembly will
> differ):
>
> 00004190 <skb_gso_segment>:
> *
> * It may return NULL if the skb requires no segmentation. This is
> * only possible when GSO is used for verifying header integrity.
> */
Hmm, I get:
00000000 <skb_gso_segment>
So I better leave the files here:
http://www1.wpkg.org/skb_gso_segment/
Let me know if you need anything else.
--
Tomasz Chmielewski
http://wpkg.org
^ permalink raw reply
* Re: ath5k: no further txbuf available, dropping packet
From: Michael Buesch @ 2009-10-24 15:05 UTC (permalink / raw)
To: Bob Copeland
Cc: Jiri Slaby, Nick Kossifidis, Luis R. Rodriguez, linux-wireless
In-Reply-To: <20091024131929.GB31897@hash.localnet>
On Saturday 24 October 2009 15:19:29 Bob Copeland wrote:
> On Fri, Oct 23, 2009 at 04:08:16PM +0200, Michael Buesch wrote:
> > ath5k breaks in AP mode after some operation time and keeps throwing
> > this message:
> >
> > [2096249.446071] ath5k phy0: no further txbuf available, dropping packet
> >
> > Driver is yesterday's compat-wireless on 2.6.31.1
>
> Ok looked a bit more at this. I don't see a leak, but I think the
> txbufs aren't getting reaped. Otherwise, we should reenable the queues
> when we get back 40 TX completion interrupts.
>
> I'm a bit short on time to track it down, but one thing to try is
> commenting out the following from ath5k_beacon_send (will break buffering
> but you can test non-ps clients):
>
> skb = ieee80211_get_buffered_bc(sc->hw, sc->vif);
> while (skb) {
> ath5k_tx_queue(sc->hw, skb, sc->cabq);
> skb = ieee80211_get_buffered_bc(sc->hw, sc->vif);
> }
>
I didn't try this, yet, but PS buffering seems to be broken anyway.
If I connect the n810 (which does PS) to the ath5k AP, I cannot ping
the n810 unless I also transfer (ping) _from_ the n810 simultaneously.
I did not monitor the traffic, yet, but to me it seems the AP is unable
to notify that the PS device should wake up (TIM problems?). By pinging from
the n810, I frequently force-wakeup the device, so traffic to the device
also works (more or less).
--
Greetings, Michael.
^ permalink raw reply
* iwl3945, after a while stops working with "No space for Tx"
From: Frederik Nosi @ 2009-10-24 13:44 UTC (permalink / raw)
To: Zhu Yi, Reinette Chatre, Intel Linux Wireless, John W. Linville,
Tomas Winkler, Abhijeet Kolekar, linux-wireless
Cc: netdev, linux-kernel
Hi,
first sorry if somebody is not the right contact, got the adressess from ./scripts/get_maintainer.pl -f drivers/net/wireless/iwlwifi.
>From some kernel versions now, after some time that im using this card it stops working and on messages i get this errors:
Oct 24 14:38:24 kotys NetworkManager: <info> Activation (wlan0) Stage 5 of 5 (IP Configure Commit) complete.
[snip pulseaudio's stuppid log spam warning]
Oct 24 14:40:07 kotys kernel: iwl3945 0000:04:00.0: Error sending REPLY_TX_PWR_TABLE_CMD: time out after 500ms.
Oct 24 14:40:09 kotys pulseaudio[16469]: sap.c: sendmsg() failed: Invalid argument
Oct 24 14:40:10 kotys kernel: iwl3945 0000:04:00.0: Error sending REPLY_SCAN_CMD: time out after 500ms.
Oct 24 14:40:11 kotys kernel: iwl3945 0000:04:00.0: Error sending REPLY_TX_PWR_TABLE_CMD: time out after 500ms.
Oct 24 14:40:11 kotys kernel: iwl3945 0000:04:00.0: Error sending POWER_TABLE_CMD: time out after 500ms.
Oct 24 14:40:14 kotys kernel: iwl3945 0000:04:00.0: set power fail, ret = -110
Oct 24 14:40:14 kotys kernel: No probe response from AP 00:1c:df:82:63:c9 after 500ms, disconnecting.
Oct 24 14:40:14 kotys NetworkManager: <info> (wlan0): supplicant connection state: completed -> disconnected
Oct 24 14:40:14 kotys NetworkManager: <info> (wlan0): supplicant connection state: disconnected -> scanning
Oct 24 14:40:14 kotys pulseaudio[16469]: sap.c: sendmsg() failed: Invalid argument
Oct 24 14:40:14 kotys kernel: iwl3945 0000:04:00.0: Error sending REPLY_RXON: time out after 500ms.
Oct 24 14:40:14 kotys kernel: iwl3945 0000:04:00.0: Error setting new configuration (-110).
Oct 24 14:40:15 kotys kernel: iwl3945 0000:04:00.0: Error sending REPLY_SCAN_CMD: time out after 500ms.
Oct 24 14:40:15 kotys kernel: wlan0: direct probe to AP 00:1c:df:82:63:c9 (try 1)
Oct 24 14:40:15 kotys NetworkManager: <info> (wlan0): supplicant connection state: scanning -> associating
Oct 24 14:40:15 kotys kernel: wlan0: direct probe to AP 00:1c:df:82:63:c9 (try 2)
Oct 24 14:40:15 kotys kernel: wlan0: direct probe to AP 00:1c:df:82:63:c9 (try 3)
Oct 24 14:40:15 kotys kernel: iwl3945 0000:04:00.0: Error sending REPLY_RXON: time out after 500ms.
Oct 24 14:40:15 kotys kernel: iwl3945 0000:04:00.0: Error setting new configuration (-110).
Oct 24 14:40:15 kotys kernel: wlan0: direct probe to AP 00:1c:df:82:63:c9 timed out
Oct 24 14:40:16 kotys kernel: iwl3945 0000:04:00.0: Error sending REPLY_TX_PWR_TABLE_CMD: time out after 500ms.
Oct 24 14:40:16 kotys kernel: iwl3945 0000:04:00.0: Error sending REPLY_RXON: time out after 500ms.
Oct 24 14:40:16 kotys kernel: iwl3945 0000:04:00.0: Error setting new configuration (-110).
When this happens i am able to use the card only after reloading the related modules, iwl3945 ecc. But the problem happens again after some minutes that im connected.
Kernel is 2.6.32-rc5 but his started happening around 2.6.31, not sure exactly what version as i update kernel often. Firmware is iwl3945-ucode-15.32.2.9.
Every other info that you need just ask. I hope i dont have to bisect as this is the laptop i use for work too, but if it's needed i'll do.
I'm not subscribed on any ML, so in case please cc me.
Thanks for all the work!
F.
^ permalink raw reply
* Re: ath5k: no further txbuf available, dropping packet
From: Bob Copeland @ 2009-10-24 13:19 UTC (permalink / raw)
To: Michael Buesch
Cc: Jiri Slaby, Nick Kossifidis, Luis R. Rodriguez, linux-wireless
In-Reply-To: <200910231608.18676.mb@bu3sch.de>
On Fri, Oct 23, 2009 at 04:08:16PM +0200, Michael Buesch wrote:
> ath5k breaks in AP mode after some operation time and keeps throwing
> this message:
>
> [2096249.446071] ath5k phy0: no further txbuf available, dropping packet
>
> Driver is yesterday's compat-wireless on 2.6.31.1
Ok looked a bit more at this. I don't see a leak, but I think the
txbufs aren't getting reaped. Otherwise, we should reenable the queues
when we get back 40 TX completion interrupts.
I'm a bit short on time to track it down, but one thing to try is
commenting out the following from ath5k_beacon_send (will break buffering
but you can test non-ps clients):
skb = ieee80211_get_buffered_bc(sc->hw, sc->vif);
while (skb) {
ath5k_tx_queue(sc->hw, skb, sc->cabq);
skb = ieee80211_get_buffered_bc(sc->hw, sc->vif);
}
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* Re: ath5k AP kernel panic when client uses SCP
From: Bob Copeland @ 2009-10-24 12:52 UTC (permalink / raw)
To: Tomasz Chmielewski
Cc: Gábor Stefanik, linux-wireless, linux-net, linux-mips
In-Reply-To: <4AE2EC3E.3000503@wpkg.org>
>> I'll recompile...
>
> Is this one more useful?
Much! Thanks.
> [ 516.430000] ------------[ cut here ]------------
> [ 516.430000] WARNING: at net/core/dev.c:1566 skb_gso_segment+0x110/0x298()
> [ 516.440000] b44: caps=(0x0, 0x0) len=52 data_len=0 ip_summed=1
So this looks like the ethernet driver b44 instead of ath5k, I think.
> [ 516.450000] Modules linked in: configs aes_generic tun sch_sfq cls_fw sch_htb ipt_MASQUERADE iptable_nat nf_nat xt_MARK iptable_mangle ipt_ULOG xt_recent nf_conn1
> [ 516.480000] Call Trace:
> [ 516.480000] [<80013ac4>] dump_stack+0x8/0x34
> [ 516.480000] [<8002f2a0>] warn_slowpath_common+0x70/0x98
> [ 516.490000] [<8002f308>] warn_slowpath_fmt+0x24/0x30
> [ 516.490000] [<801f0398>] skb_gso_segment+0x110/0x298
...but this is higher up the stack. skb_gso_segment is about a year old
so it would be odd if there were a bug here. Can you do the following?
objdump -S net/core/dev.o, then find the address for skb_gso_segment,
it should look something like this (your numbers and disassembly will
differ):
00004190 <skb_gso_segment>:
*
* It may return NULL if the skb requires no segmentation. This is
* only possible when GSO is used for verifying header integrity.
*/
struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features)
{
4190: 55 push %ebp
4191: 89 e5 mov %esp,%ebp
4193: 57 push %edi
4194: 56 push %esi
Then find whatever 0x4190 (your offset here) + 0x110 is, and pick about
10 lines before and after that and paste it -- the opcodes in the second
column should match up with the code lines below:
> [ 516.650000] [ 516.650000] [ 516.650000] Code: 3c048007 08010d50
> 248436fc <8c820000> 3042c000 10400003 00803821 0801ca7f 00000000 [
Or you can send me the whole objdump -S output off-list if that's easier.
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* Re: ath5k AP kernel panic when client uses SCP
From: Tomasz Chmielewski @ 2009-10-24 11:59 UTC (permalink / raw)
To: Gábor Stefanik; +Cc: linux-wireless, linux-net, linux-mips, Bob Copeland
In-Reply-To: <4AE1AE74.4020600@wpkg.org>
Tomasz Chmielewski wrote:
> Gábor Stefanik wrote:
>> On Fri, Oct 23, 2009 at 3:15 PM, Tomasz Chmielewski <mangoo@wpkg.org>
>> wrote:
>>> Bob Copeland wrote:
>>>> CONFIG_DEBUG_INFO is the basic switch. I don't know if MIPS needs
>>>> CONFIG_FRAME_POINTER but that could help too.
>>> I don't see CONFIG_FRAME_POINTER available.
>>> I compiled with CONFIG_DEBUG_INFO; let me know if I should enable
>>> some other
>>> DEBUG options as well (see below what's enabled and available).
>>>
>>> Before it oopses, I see lots of order 0 page allocation failures
>>> (there are
>>> some extra spaces at the end of each line due to the broken konsole in
>>> KDE4):
>>>
>>> http://www1.wpkg.org/oops2.txt
>
>> Is CONFIG_KALLSYMS set?
>
> Good clue:
>
> # zgrep KALL /proc/config.gz
> # CONFIG_KALLSYMS is not set
>
> I'll recompile...
Is this one more useful?
[ 516.430000] ------------[ cut here ]------------
[ 516.430000] WARNING: at net/core/dev.c:1566 skb_gso_segment+0x110/0x298()
[ 516.440000] b44: caps=(0x0, 0x0) len=52 data_len=0 ip_summed=1
[ 516.450000] Modules linked in: configs aes_generic tun sch_sfq cls_fw sch_htb ipt_MASQUERADE iptable_nat nf_nat xt_MARK iptable_mangle ipt_ULOG xt_recent nf_conn1
[ 516.480000] Call Trace:
[ 516.480000] [<80013ac4>] dump_stack+0x8/0x34
[ 516.480000] [<8002f2a0>] warn_slowpath_common+0x70/0x98
[ 516.490000] [<8002f308>] warn_slowpath_fmt+0x24/0x30
[ 516.490000] [<801f0398>] skb_gso_segment+0x110/0x298
[ 516.500000] [<801f0728>] dev_hard_start_xmit+0x208/0x364
[ 516.500000] [<80207c5c>] __qdisc_run+0x108/0x2f0
[ 516.510000] [<801f4ad8>] dev_queue_xmit+0x25c/0x3a8
[ 516.510000] [<802785c8>] br_dev_queue_push_xmit+0x98/0xac
[ 516.520000] [<8027e66c>] br_nf_post_routing+0x23c/0x25c
[ 516.520000] [<80214e78>] nf_iterate+0x70/0xf8
[ 516.530000] [<80214fc8>] nf_hook_slow+0x88/0x12c
[ 516.530000] [<80278630>] br_forward_finish+0x54/0x80
[ 516.540000] [<8027dac0>] br_nf_forward_finish+0x114/0x130
[ 516.540000] [<8027eba0>] br_nf_forward_ip+0x300/0x33c
[ 516.550000] [<80214e78>] nf_iterate+0x70/0xf8
[ 516.550000] [<80214fc8>] nf_hook_slow+0x88/0x12c
[ 516.560000] [<802786e8>] __br_forward+0x8c/0xe0
[ 516.560000] [<802796d4>] br_handle_frame_finish+0x168/0x1ac
[ 516.570000] [<8027e260>] br_nf_pre_routing_finish+0x40c/0x450
[ 516.580000] [<8027f564>] br_nf_pre_routing+0x824/0x86c
[ 516.580000] [<80214e78>] nf_iterate+0x70/0xf8
[ 516.580000] [<80214fc8>] nf_hook_slow+0x88/0x12c
[ 516.590000] [<80279938>] br_handle_frame+0x220/0x26c
[ 516.590000] [<801ef944>] netif_receive_skb+0x604/0x7b8
[ 516.600000] [<801f23f0>] process_backlog+0xc8/0x138
[ 516.600000] [<801f365c>] net_rx_action+0xe8/0x26c
[ 516.610000] [<80035a84>] __do_softirq+0xac/0x160
[ 516.610000] [<80035b94>] do_softirq+0x5c/0x94
[ 516.620000] [<80036094>] irq_exit+0x40/0x8c
[ 516.620000] [<80001844>] ret_from_irq+0x0/0x4
[ 516.630000] [<800ab12c>] core_sys_select+0x1d0/0x2d0
[ 516.630000] [<800ab870>] sys_select+0xe4/0x12c
[ 516.640000] [<800035f0>] stack_done+0x20/0x3c
[ 516.640000]
[ 516.640000] ---[ end trace b84c10674d0cf224 ]---
[ 516.650000] Unhandled kernel unaligned access[#1]:
[ 516.650000] Cpu 0
[ 516.650000] $ 0 : 00000000 1000dc00 00000001 81f97a40
[ 516.650000] $ 4 : e0f2fdea 00000000 00000001 00000083
[ 516.650000] $ 8 : 00000000 00000083 80380000 ffffffea
[ 516.650000] $12 : 80380000 00000030 00000020 00000000
[ 516.650000] $16 : 0000000c 00000001 80dfa8e0 81c67000
[ 516.650000] $20 : 81ccda00 8029ac50 80278530 81c67000
[ 516.650000] $24 : 00000204 8023e8ec
[ 516.650000] $28 : 81c14000 81c15750 00000005 801e6398
[ 516.650000] Hi : 00000000
[ 516.650000] Lo : 00000000
[ 516.650000] epc : 80073710 put_page+0x0/0x314
[ 516.650000] Tainted: G W
[ 516.650000] ra : 801e6398 skb_release_data+0xf4/0x160
[ 516.650000] Status: 1000dc03 KERNEL EXL IE
[ 516.650000] Cause : 00800010
[ 516.650000] BadVA : e0f2fdea
[ 516.650000] PrId : 00029006 (Broadcom BCM3302)
[ 516.650000] Modules linked in: configs aes_generic tun sch_sfq cls_fw sch_htb ipt_MASQUERADE iptable_nat nf_nat xt_MARK iptable_mangle ipt_ULOG xt_recent nf_conn1
[ 516.650000] Process init (pid: 1, threadinfo=81c14000, task=81c13938, tls=2aada4c0)
[ 516.650000] Stack : 80dfa8e0 801e5c98 00000000 00000000 80dfa8e0 8038b698 80dfa8e0 801e5cf8
[ 516.650000] 81ccda00 8038b698 80dfa8e0 81c67000 81ccda00 801f0858 80dfa8e0 81a40680
[ 516.650000] 81c157d0 81dc6800 81dc6800 81ccda00 81ccda00 00000001 81dc6800 80dfa8e0
[ 516.650000] 81c67000 0000548b 80207c5c 80207bf4 81dc6800 00000002 00000000 8027d934
[ 516.650000] 81dc6800 81ccda00 80dfa8e0 00000000 8038bcd0 80000000 801f4ad8 801f4a34
[ 516.650000] ...
[ 516.650000] Call Trace:
[ 516.650000] [<80073710>] put_page+0x0/0x314
[ 516.650000] [<801e6398>] skb_release_data+0xf4/0x160
[ 516.650000] [<801e5cf8>] __kfree_skb+0x14/0x1c0
[ 516.650000] [<801f0858>] dev_hard_start_xmit+0x338/0x364
[ 516.650000] [<80207c5c>] __qdisc_run+0x108/0x2f0
[ 516.650000] [<801f4ad8>] dev_queue_xmit+0x25c/0x3a8
[ 516.650000] [<802785c8>] br_dev_queue_push_xmit+0x98/0xac
[ 516.650000] [<8027e66c>] br_nf_post_routing+0x23c/0x25c
[ 516.650000] [<80214e78>] nf_iterate+0x70/0xf8
[ 516.650000] [<80214fc8>] nf_hook_slow+0x88/0x12c
[ 516.650000] [<80278630>] br_forward_finish+0x54/0x80
[ 516.650000] [<8027dac0>] br_nf_forward_finish+0x114/0x130
[ 516.650000] [<8027eba0>] br_nf_forward_ip+0x300/0x33c
[ 516.650000] [<80214e78>] nf_iterate+0x70/0xf8
[ 516.650000] [<80214fc8>] nf_hook_slow+0x88/0x12c
[ 516.650000] [<802786e8>] __br_forward+0x8c/0xe0
[ 516.650000] [<802796d4>] br_handle_frame_finish+0x168/0x1ac
[ 516.650000] [<8027e260>] br_nf_pre_routing_finish+0x40c/0x450
[ 516.650000] [<8027f564>] br_nf_pre_routing+0x824/0x86c
[ 516.650000] [<80214e78>] nf_iterate+0x70/0xf8
[ 516.650000] [<80214fc8>] nf_hook_slow+0x88/0x12c
[ 516.650000] [<80279938>] br_handle_frame+0x220/0x26c
[ 516.650000] [<801ef944>] netif_receive_skb+0x604/0x7b8
[ 516.650000] [<801f23f0>] process_backlog+0xc8/0x138
[ 516.650000] [<801f365c>] net_rx_action+0xe8/0x26c
[ 516.650000] [<80035a84>] __do_softirq+0xac/0x160
[ 516.650000] [<80035b94>] do_softirq+0x5c/0x94
[ 516.650000] [<80036094>] irq_exit+0x40/0x8c
[ 516.650000] [<80001844>] ret_from_irq+0x0/0x4
[ 516.650000] [<800ab12c>] core_sys_select+0x1d0/0x2d0
[ 516.650000] [<800ab870>] sys_select+0xe4/0x12c
[ 516.650000] [<800035f0>] stack_done+0x20/0x3c
[ 516.650000]
[ 516.650000]
[ 516.650000] Code: 3c048007 08010d50 248436fc <8c820000> 3042c000 10400003 00803821 0801ca7f 00000000
[ 516.650000] Disabling lock debugging due to kernel taint
[ 516.990000] Kernel panic - not syncing: Fatal exception in interrupt
As this line didn't fit:
Modules linked in: tun sch_sfq cls_fw sch_htb ipt_MASQUERADE iptable_nat nf_nat xt_MARK iptable_mangle ipt_ULOG xt_recent nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack xt_tcpudp iptable_filter ip_tables x_tables ath5k mac80211 ath ohci_hcd cfg80211 uhci_hcd
--
Tomasz Chmielewski
http://wpkg.org
^ permalink raw reply
* Re: [RFC 1/3] mac80211: WIP - add operating BSSID to device configuration struct
From: Luciano Coelho @ 2009-10-24 5:34 UTC (permalink / raw)
To: ext Johannes Berg
Cc: linux-wireless@vger.kernel.org, Valo Kalle (Nokia-D/Tampere),
Oikarinen Juuso (Nokia-D/Tampere)
In-Reply-To: <1256201719.12174.19.camel@johannes.local>
ext Johannes Berg wrote:
> On Fri, 2009-10-16 at 15:27 +0300, Luciano Coelho wrote:
>
>> @@ -2405,7 +2411,15 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
>> * to sleep and then change channel etc.
>> */
>> sdata->local->oper_channel = req->bss->channel;
>> - ieee80211_hw_config(sdata->local, 0);
>> +
>> + if (memcmp(sdata->local->hw.conf.oper_bssid,
>> + req->bss->bssid, ETH_ALEN)) {
>> + config_changed |= IEEE80211_CONF_CHANGE_OPER_BSSID;
>> + memcpy(sdata->local->hw.conf.oper_bssid,
>> + req->bss->bssid, ETH_ALEN);
>> + }
>> +
>> + ieee80211_hw_config(sdata->local, config_changed);
>>
>
> Is this really necessary before you can auth?
As we discussed on IRC, it is really needed. We must always provide a BSSID
when changing channels in preparation for an association. For this reason (and
others) the wl1271 with the current firmware does not support promiscuous mode
or frame injections.
I'll ask TI next time we meet them, if there is any possibility to remove the
need for the BSSID at this point, so things will be greatly simplified. There
is a very slight chance that this could be possible for wl1271, but for wl1251 I
think there's no hope to change it anymore. So in any case, we will need to
support this on the stack if we want to have wl1251 to work correctly. :(
Also, I'm not 100% sure, but IIRC Kalle has mentioned that the at76c50x-usb card
also needs this feature.
> If it is, you're going to have to do a lot more work and go all the way
> up to userspace so wpa_supplicant with -Dnl80211 knows about this too,
> and doesn't try to authenticate twice or do FT-OTA.
Thanks a lot for pointing this out. I think I understand it better after our
discussion on IRC. I'll have to study more the authentication mechanism and
figure out how to deal with multiple authentications, as you pointed out.
These are definitely details that I'll need to sort out. But in principle, do
you agree with the idea of passing the "operating" BSSID down to the driver in
the hw_config op? And saving it as a hardware configuration parameter in
local->hw.conf?
Once again, I really appreciate your help and the time you spend discussing and
explaining these things in detail to me! :)
--
Cheers,
Luca.
^ permalink raw reply
* Re: [ath9k-devel] mac80211/ath9k/hostapd: Some clients unable to associate with AP
From: Björn Smedman @ 2009-10-24 3:12 UTC (permalink / raw)
To: Jouni Malinen
Cc: Joerg Pommnitz, Will Dyson, Johannes Berg, ath9k-devel,
linux-wireless
In-Reply-To: <20091023163001.GA4911@jm.kir.nu>
2009/10/23 Jouni Malinen <j@w1.fi>:
> On Fri, Oct 23, 2009 at 05:27:27PM +0200, Björn Smedman wrote:
>
>> It seems the problem is a typo in net/mac80211/tx.c that causes
>> injected frames from hostapd not to be associated with the correct ap
>> interface before going into ieee80211_tx_h_sequence(). This tiny patch
>> solves my problems (and looks reasonable to me in any case):
>
> Thanks! Would you be able to make the same patch against the
> wireless-testing.git repository and add a Signed-off-by line to meet the
> kernel submission requirements?
It's time i learn. :) I'll give it a shot tomorrow.
>
>> diff -urN compat-wireless-2009-10-21-before_seqnum_fix/net/mac80211/tx.c
>> compat-wireless-2009-10-21/net/mac80211/tx.c
>> @@ -1445,7 +1445,7 @@
>> if (tmp_sdata->vif.type != NL80211_IFTYPE_AP)
>> continue;
>> if (compare_ether_addr(tmp_sdata->dev->dev_addr,
>> - hdr->addr2)) {
>> + hdr->addr2) == 0) {
>> dev_hold(tmp_sdata->dev);
>> dev_put(sdata->dev);
>> sdata = tmp_sdata;
>
> This does indeed look like a typo. Though, I'm not sure how this would
> have caused a regression between compat-wireless-2009-06-02 and
> compat-wireless-2.6.32-rc1. The incorrect compare_ether_addr() use seems
> to be there in the original commit that added this code
> (25d834e16294c8dfd923dae6bdb8a055391a99a5 from September 12, 2008)..
Interesting puzzle. :) It looks like there was a complementary bug
(the pointer hdr was set to point len_rthdr * sizeof(struct
ieee80211_hdr) bytes into the skbuff) in that commit:
...
+ len_rthdr = ieee80211_get_radiotap_len(skb->data);
+ hdr = (struct ieee80211_hdr *)skb->data + len_rthdr;
...
So the frame source address used to be compared with random data which
was likely to result in inequality, causing the first ap interface to
be "found" and the code to work as expected. I guess the pointer bug
was fixed somewhere between 2006-06-02 and now "causing" the sequence
number problem.
/Björn
^ permalink raw reply
* 2.6.32-rc5-git3 -- EIP is at cfg80211_conn_work+0x73/0xd6 [cfg80211]
From: Miles Lane @ 2009-10-24 2:36 UTC (permalink / raw)
To: Johannes Berg, LKML, linux-wireless
Let me know if you need my .config
*pde = 00000000
Modules linked in: ipv6 af_packet iptable_filter snd_hda_codec_realtek ip_tables snd_hda_intel snd_hda_codec snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm ath9k rtc_cmos uvcvideo eeepc_laptop mac80211 snd_timer rtc_core hwmon videodev ath cfg80211 v4l1_compat rtc_lib rfkill snd_page_alloc rng_core battery ac led_class pci_hotplug processor fan sg sd_mod ehci_hcd atl1e uhci_hcd thermal
Pid: 10, comm: events/1 Not tainted (2.6.32-rc5-git3 #4) 1000HE
EIP: 0060:[<f858ac49>] EFLAGS: 00010246 CPU: 1
EIP is at cfg80211_conn_work+0x73/0xd6 [cfg80211]
EAX: 00000000 EBX: f71ae5e8 ECX: 00000000 EDX: c16754e4
ESI: ead9c0c4 EDI: ead9c000 EBP: f7136f34 ESP: f7136f20
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
ead9c084 ead9c00c c2e09700 ead9c164 f7136f94 f7136fa0 c103d5f5 00000000
<0> 00000002 00000000 c103d5b3 f7136f88 f7146c50 f7146900 f7146900 c2e09724
<0> c2e0971c f858abd6 ead9c148 f7146900 c2e09700 00000000 f7146900 c1040721
[<c103d5f5>] ? worker_thread+0x161/0x233
[<c103d5b3>] ? worker_thread+0x11f/0x233
[<f858abd6>] ? cfg80211_conn_work+0x0/0xd6 [cfg80211]
[<c1040721>] ? autoremove_wake_function+0x0/0x2f
[<c103d494>] ? worker_thread+0x0/0x233
[<c1040527>] ? kthread+0x5f/0x64
[<c10404c8>] ? kthread+0x0/0x64
[<c1003e9f>] ? kernel_thread_helper+0x7/0x1a
---[ end trace b24f325f9540f193 ]---
^ permalink raw reply
* [PATCH 16/18] iwlwifi: update lowest API version support for 6x00 & 6x50 series
From: Reinette Chatre @ 2009-10-23 20:42 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre
In-Reply-To: <1256330556-20997-1-git-send-email-reinette.chatre@intel.com>
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
For 6x00 and 6x50 series devices, APIv4 is the lowest firmware version
driver can support. This is also the lowest API version available to the
public so there is no need for backward compatibility support for the
earlier API versions.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-6000.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index f5639b4..32466d3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -52,8 +52,8 @@
#define IWL6050_UCODE_API_MAX 4
/* Lowest firmware API version supported */
-#define IWL6000_UCODE_API_MIN 1
-#define IWL6050_UCODE_API_MIN 1
+#define IWL6000_UCODE_API_MIN 4
+#define IWL6050_UCODE_API_MIN 4
#define IWL6000_FW_PRE "iwlwifi-6000-"
#define _IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE #api ".ucode"
--
1.5.6.3
^ permalink raw reply related
* [PATCH 15/18] iwlwifi: remove duplicated define
From: Reinette Chatre @ 2009-10-23 20:42 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre
In-Reply-To: <1256330556-20997-1-git-send-email-reinette.chatre@intel.com>
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Duplicated define for listen interval (IWL_CONN_MAX_LISTEN_INTERVAL and
IWL_CONN_LISTEN_INTERVAL), remove IWL_CONN_LISTEN_INTERVAL
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Reported-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-power.c | 4 ++--
drivers/net/wireless/iwlwifi/iwl-power.h | 2 --
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c
index 432f465..9bce2c1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.c
+++ b/drivers/net/wireless/iwlwifi/iwl-power.c
@@ -163,9 +163,9 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv,
cmd->flags &= ~IWL_POWER_SLEEP_OVER_DTIM_MSK;
slp_itrvl = le32_to_cpu(cmd->sleep_interval[IWL_POWER_VEC_SIZE - 1]);
- if (slp_itrvl > IWL_CONN_LISTEN_INTERVAL)
+ if (slp_itrvl > IWL_CONN_MAX_LISTEN_INTERVAL)
cmd->sleep_interval[IWL_POWER_VEC_SIZE - 1] =
- cpu_to_le32(IWL_CONN_LISTEN_INTERVAL);
+ cpu_to_le32(IWL_CONN_MAX_LISTEN_INTERVAL);
/* enforce max sleep interval */
for (i = IWL_POWER_VEC_SIZE - 1; i >= 0 ; i--) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.h b/drivers/net/wireless/iwlwifi/iwl-power.h
index 0755518..310c32e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.h
+++ b/drivers/net/wireless/iwlwifi/iwl-power.h
@@ -30,8 +30,6 @@
#include "iwl-commands.h"
-#define IWL_CONN_LISTEN_INTERVAL 10
-
#define IWL_ABSOLUTE_ZERO 0
#define IWL_ABSOLUTE_MAX 0xFFFFFFFF
#define IWL_TT_INCREASE_MARGIN 5
--
1.5.6.3
^ permalink raw reply related
* [PATCH 18/18] iwlwifi: minor comments changes for wimax co-exist command
From: Reinette Chatre @ 2009-10-23 20:42 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre
In-Reply-To: <1256330556-20997-1-git-send-email-reinette.chatre@intel.com>
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
'COEX_PRIORITY_TABLE_CMD' host command will be supported for 5000 series
and up.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-commands.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 0d660a7..954bad6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -109,7 +109,7 @@ enum {
REPLY_TX_LINK_QUALITY_CMD = 0x4e, /* 4965 only */
/* WiMAX coexistence */
- COEX_PRIORITY_TABLE_CMD = 0x5a, /*5000 only */
+ COEX_PRIORITY_TABLE_CMD = 0x5a, /* for 5000 series and up */
COEX_MEDIUM_NOTIFICATION = 0x5b,
COEX_EVENT_CMD = 0x5c,
--
1.5.6.3
^ permalink raw reply related
* [PATCH 17/18] iwlwifi: make sure device is reset when unloading driver
From: Reinette Chatre @ 2009-10-23 20:42 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Ben Cahill, Reinette Chatre
In-Reply-To: <1256330556-20997-1-git-send-email-reinette.chatre@intel.com>
From: Ben Cahill <ben.m.cahill@intel.com>
Add unconditional call to apm_ops.stop() to reset device to low power state
when unloading driver. Some paths have existed to unload driver *without*
resetting device, therefore some errors have persisted through multiple
load/unload cycles, until the whole platform gets rebooted; this is an
attempt to remedy some of those situations. Sorry, I can't seem to find
a bughost.org bug that specifically has these symptoms, but I had it happen
recently here.
Note that this will *not* fix situations in which the PCI express bus has
crashed (evidenced by register reads showing "0xffffffff"), e.g. bughost.org
1855 and 2096; device is unreachable from driver in those cases.
Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-agn.c | 9 +++++++++
drivers/net/wireless/iwlwifi/iwl3945-base.c | 9 +++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index ea1b931..fa1672e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3256,6 +3256,15 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
iwl_down(priv);
}
+ /*
+ * Make sure device is reset to low power before unloading driver.
+ * This may be redundant with iwl_down(), but there are paths to
+ * run iwl_down() without calling apm_ops.stop(), and there are
+ * paths to avoid running iwl_down() at all before leaving driver.
+ * This (inexpensive) call *makes sure* device is reset.
+ */
+ priv->cfg->ops->lib->apm_ops.stop(priv);
+
iwl_tt_exit(priv);
/* make sure we flush any pending irq or
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 9a430ee..bfd7f49 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -4135,6 +4135,15 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev)
iwl3945_down(priv);
}
+ /*
+ * Make sure device is reset to low power before unloading driver.
+ * This may be redundant with iwl_down(), but there are paths to
+ * run iwl_down() without calling apm_ops.stop(), and there are
+ * paths to avoid running iwl_down() at all before leaving driver.
+ * This (inexpensive) call *makes sure* device is reset.
+ */
+ priv->cfg->ops->lib->apm_ops.stop(priv);
+
/* make sure we flush any pending irq or
* tasklet for the driver
*/
--
1.5.6.3
^ 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