Hi,
here's a patch to add a mem_flags to usb_alloc_urb()
Regards
Oliver
--- hub.c.alt Thu Feb 7 18:11:38 2002
+++ hub.c Thu Feb 7 18:12:19 2002
@@ -303,7 +303,7 @@
if (maxp > sizeof(hub->buffer))
maxp = sizeof(hub->buffer);
- hub->urb = usb_alloc_urb(0);
+ hub->urb = usb_alloc_urb(0, GFP_KERNEL);
if (!hub->urb) {
err("couldn't allocate interrupt urb");
kfree(hub->descriptor);
--- usb.c.alt Thu Feb 7 18:09:16 2002
+++ usb.c Thu Feb 7 18:11:00 2002
@@ -1076,6 +1076,7 @@
/**
* usb_alloc_urb - creates a new urb for a USB driver to use
* @iso_packets: number of iso packets for this urb
+ * @mem_flags: way of allocating memory
*
* Creates an urb for the USB driver to use, initializes a few internal
* structures, incrementes the usage counter, and returns a pointer to it.
@@ -1087,13 +1088,13 @@
*
* The driver must call usb_free_urb() when it is finished with the urb.
*/
-struct urb *usb_alloc_urb(int iso_packets)
+struct urb *usb_alloc_urb(int iso_packets, int mem_flags)
{
struct urb *urb;
urb = (struct urb *)kmalloc(sizeof(struct urb) +
iso_packets * sizeof(struct usb_iso_packet_descriptor),
- in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
+ mem_flags);
if (!urb) {
err("alloc_urb: kmalloc failed");
return NULL;
@@ -1359,7 +1360,7 @@
int retv;
int length;
- urb = usb_alloc_urb(0);
+ urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb)
return -ENOMEM;
@@ -1447,7 +1448,7 @@
if (len < 0)
return -EINVAL;
- urb=usb_alloc_urb(0);
+ urb=usb_alloc_urb(0, GFP_KERNEL);
if (!urb)
return -ENOMEM;
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel