Commit e0b5c524 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Paul Mackerras

Added mem_flags to usb_submit_urb(), this is the USB core code changes.

parent 6e9490a7
...@@ -303,7 +303,7 @@ static int usb_hub_configure(struct usb_hub *hub, ...@@ -303,7 +303,7 @@ static int usb_hub_configure(struct usb_hub *hub,
if (maxp > sizeof(hub->buffer)) if (maxp > sizeof(hub->buffer))
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) { if (!hub->urb) {
err("couldn't allocate interrupt urb"); err("couldn't allocate interrupt urb");
kfree(hub->descriptor); kfree(hub->descriptor);
......
...@@ -1085,6 +1085,7 @@ void usb_inc_dev_use(struct usb_device *dev) ...@@ -1085,6 +1085,7 @@ void usb_inc_dev_use(struct usb_device *dev)
/** /**
* usb_alloc_urb - creates a new urb for a USB driver to use * usb_alloc_urb - creates a new urb for a USB driver to use
* @iso_packets: number of iso packets for this urb * @iso_packets: number of iso packets for this urb
* @mem_flags: the type of memory to allocate, see kmalloc() for a list of valid options for this.
* *
* Creates an urb for the USB driver to use, initializes a few internal * Creates an urb for the USB driver to use, initializes a few internal
* structures, incrementes the usage counter, and returns a pointer to it. * structures, incrementes the usage counter, and returns a pointer to it.
...@@ -1096,13 +1097,13 @@ void usb_inc_dev_use(struct usb_device *dev) ...@@ -1096,13 +1097,13 @@ void usb_inc_dev_use(struct usb_device *dev)
* *
* The driver must call usb_free_urb() when it is finished with the urb. * 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; struct urb *urb;
urb = (struct urb *)kmalloc(sizeof(struct urb) + urb = (struct urb *)kmalloc(sizeof(struct urb) +
iso_packets * sizeof(struct usb_iso_packet_descriptor), iso_packets * sizeof(struct usb_iso_packet_descriptor),
in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); mem_flags);
if (!urb) { if (!urb) {
err("alloc_urb: kmalloc failed"); err("alloc_urb: kmalloc failed");
return NULL; return NULL;
...@@ -1368,7 +1369,7 @@ int usb_internal_control_msg(struct usb_device *usb_dev, unsigned int pipe, ...@@ -1368,7 +1369,7 @@ int usb_internal_control_msg(struct usb_device *usb_dev, unsigned int pipe,
int retv; int retv;
int length; int length;
urb = usb_alloc_urb(0); urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb) if (!urb)
return -ENOMEM; return -ENOMEM;
...@@ -1456,7 +1457,7 @@ int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, ...@@ -1456,7 +1457,7 @@ int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
if (len < 0) if (len < 0)
return -EINVAL; return -EINVAL;
urb=usb_alloc_urb(0); urb=usb_alloc_urb(0, GFP_KERNEL);
if (!urb) if (!urb)
return -ENOMEM; return -ENOMEM;
......
...@@ -856,7 +856,7 @@ static inline void usb_fill_int_urb (struct urb *urb, ...@@ -856,7 +856,7 @@ static inline void usb_fill_int_urb (struct urb *urb,
#define FILL_INT_URB(URB,DEV,PIPE,TRANSFER_BUFFER,BUFFER_LENGTH,COMPLETE,CONTEXT,INTERVAL) \ #define FILL_INT_URB(URB,DEV,PIPE,TRANSFER_BUFFER,BUFFER_LENGTH,COMPLETE,CONTEXT,INTERVAL) \
usb_fill_int_urb(URB,DEV,PIPE,TRANSFER_BUFFER,BUFFER_LENGTH,COMPLETE,CONTEXT,INTERVAL) usb_fill_int_urb(URB,DEV,PIPE,TRANSFER_BUFFER,BUFFER_LENGTH,COMPLETE,CONTEXT,INTERVAL)
extern struct urb *usb_alloc_urb(int iso_packets); extern struct urb *usb_alloc_urb(int iso_packets, int mem_flags);
extern void usb_free_urb(struct urb *urb); extern void usb_free_urb(struct urb *urb);
#define usb_put_urb usb_free_urb #define usb_put_urb usb_free_urb
extern struct urb *usb_get_urb(struct urb *urb); extern struct urb *usb_get_urb(struct urb *urb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment