netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 23/32] rt2x00: Make correct cast in USB interrupt
@ 2006-04-27 22:03 Ivo van Doorn
  0 siblings, 0 replies; only message in thread
From: Ivo van Doorn @ 2006-04-27 22:03 UTC (permalink / raw)
  To: netdev; +Cc: rt2x00-devel

[-- Attachment #1: Type: text/plain, Size: 1760 bytes --]

From: Ivo van Doorn <IvDoorn@gmail.com>

The USB interrupt handler receives the entry
in the ring and not the ring itself.
Also check if the status indicates an error
before queueing the work.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>

diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-27 21:53:13.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-27 21:54:33.000000000 +0200
@@ -856,11 +856,14 @@ rt2500usb_txdone(void *data)
 static void
 rt2500usb_interrupt(struct urb *urb, struct pt_regs *regs)
 {
-	struct data_ring	*ring = (struct data_ring*)urb->context;
+	struct data_entry	*entry = (struct data_entry*)urb->context;
 	struct rt2x00_usb	*rt2x00usb =
-		ieee80211_dev_hw_data(ring->net_dev);
+		ieee80211_dev_hw_data(entry->ring->net_dev);
 
-	queue_work(rt2x00usb->workqueue, &ring->irq_work);
+	if (urb->status)
+		return;
+
+	queue_work(rt2x00usb->workqueue, &entry->ring->irq_work);
 }
 
 /*
@@ -1064,7 +1067,6 @@ rt2500usb_init_txring(struct rt2x00_usb 
 	}
 }
 
-
 static int
 rt2500usb_init_rings(struct rt2x00_usb *rt2x00usb)
 {
@@ -1798,7 +1800,7 @@ rt2500usb_init_hw_channels(struct rt2x00
 		for (counter = 0; counter < ARRAY_SIZE(vals); counter++)
 			channels[counter].val = vals[counter] | rf2_base;
 	} else if (rt2x00_rf(&rt2x00usb->chip, RF2525E)) {
-		u32 vals[] = {
+		static u32 vals[] = {
 			0x0000089a, 0x0000089e, 0x0000089e, 0x000008a2,
 			0x000008a2, 0x000008a6, 0x000008a6, 0x000008aa,
 			0x000008aa, 0x000008ae, 0x000008ae, 0x000008b2,

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-27 22:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-27 22:03 [PATCH 23/32] rt2x00: Make correct cast in USB interrupt Ivo van Doorn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).