Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
e0b5c524
Commit
e0b5c524
authored
Feb 13, 2002
by
Greg Kroah-Hartman
Committed by
Paul Mackerras
Feb 13, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added mem_flags to usb_submit_urb(), this is the USB core code changes.
parent
6e9490a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
drivers/usb/hub.c
drivers/usb/hub.c
+1
-1
drivers/usb/usb.c
drivers/usb/usb.c
+5
-4
include/linux/usb.h
include/linux/usb.h
+1
-1
No files found.
drivers/usb/hub.c
View file @
e0b5c524
...
...
@@ -303,7 +303,7 @@ static int usb_hub_configure(struct usb_hub *hub,
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
);
...
...
drivers/usb/usb.c
View file @
e0b5c524
...
...
@@ -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
* @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
* structures, incrementes the usage counter, and returns a pointer to it.
...
...
@@ -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.
*/
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
;
...
...
@@ -1368,7 +1369,7 @@ int usb_internal_control_msg(struct usb_device *usb_dev, unsigned int pipe,
int
retv
;
int
length
;
urb
=
usb_alloc_urb
(
0
);
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
urb
)
return
-
ENOMEM
;
...
...
@@ -1456,7 +1457,7 @@ int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
if
(
len
<
0
)
return
-
EINVAL
;
urb
=
usb_alloc_urb
(
0
);
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
urb
)
return
-
ENOMEM
;
...
...
include/linux/usb.h
View file @
e0b5c524
...
...
@@ -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) \
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
);
#define usb_put_urb usb_free_urb
extern
struct
urb
*
usb_get_urb
(
struct
urb
*
urb
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment