r130 - unstable/rt2570/debian/patches

benh at alioth.debian.org benh at alioth.debian.org
Mon Jun 23 01:17:47 UTC 2008


Author: benh
Date: 2008-06-23 01:17:47 +0000 (Mon, 23 Jun 2008)
New Revision: 130

Modified:
   unstable/rt2570/debian/patches/005_fix_delays.diff
Log:
Redefined NdisMSleep() as equivalent to udelay() but usable with larger delays.
In NDIS it behaves like usleep(), but on Linux it may be being used in atomic context.


Modified: unstable/rt2570/debian/patches/005_fix_delays.diff
===================================================================
--- unstable/rt2570/debian/patches/005_fix_delays.diff	2008-06-22 23:47:50 UTC (rev 129)
+++ unstable/rt2570/debian/patches/005_fix_delays.diff	2008-06-23 01:17:47 UTC (rev 130)
@@ -1,42 +1,18 @@
 --- rt2570.orig/Module/rt2570sw.h
 +++ rt2570/Module/rt2570sw.h
-@@ -384,7 +384,7 @@
+@@ -391,7 +391,14 @@
  #define CMD_SingleRead 0x0C
  #define CMD_SingleWrite 0x0D
  
 -#define NdisMSleep	mdelay
-+#define NdisMSleep	msleep
++static inline void NdisMSleep(unsigned long usecs)
++{
++	while (usecs > MAX_UDELAY_MS * 1000) {
++		udelay(MAX_UDELAY_MS * 1000);
++		usecs -= MAX_UDELAY_MS * 1000;
++	}
++	udelay(usecs);
++}
  
  
  //  Assert MACRO to make sure program running
---- rt2570.orig/Module/rtusb_main.c
-+++ rt2570/Module/rtusb_main.c
-@@ -847,7 +847,7 @@
- 								}
- 							}
- 
--							NdisMSleep(500000);
-+							NdisMSleep(500);
- 						}
- 
- 						NICResetFromError(pAdapter);
---- rt2570.orig/Module/rtusb_bulk.c
-+++ rt2570/Module/rtusb_bulk.c
-@@ -1386,7 +1386,7 @@
- 			usb_kill_urb(pMLMEContext->pUrb);
- 
- 			// Sleep 200 microsecs to give cancellation time to work
--			NdisMSleep(200);
-+			udelay(200);
- 		}
- 	}
- 
-@@ -1405,7 +1405,7 @@
- 			usb_kill_urb(pBeaconContext->pUrb);
- 
- 			// Sleep 200 microsecs to give cancellation time to work
--			NdisMSleep(200);
-+			udelay(200);
- 		}
- 	}
- 




More information about the Pkg-ralink-commits mailing list