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
0f0bca32
Commit
0f0bca32
authored
Feb 19, 2002
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usb usb-ohci.c:
- added usb_put_urb() and usb_get_urb() logic
parent
d612b753
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
drivers/usb/usb-ohci.c
drivers/usb/usb-ohci.c
+13
-0
No files found.
drivers/usb/usb-ohci.c
View file @
0f0bca32
...
@@ -205,6 +205,7 @@ static void urb_rm_priv_locked (struct urb * urb)
...
@@ -205,6 +205,7 @@ static void urb_rm_priv_locked (struct urb * urb)
urb_free_priv
((
struct
ohci
*
)
urb
->
dev
->
bus
->
hcpriv
,
urb_priv
);
urb_free_priv
((
struct
ohci
*
)
urb
->
dev
->
bus
->
hcpriv
,
urb_priv
);
usb_dec_dev_use
(
urb
->
dev
);
usb_dec_dev_use
(
urb
->
dev
);
urb
->
dev
=
NULL
;
urb
->
dev
=
NULL
;
usb_put_urb
(
urb
);
}
}
}
}
...
@@ -553,6 +554,9 @@ static int sohci_submit_urb (struct urb * urb, int mem_flags)
...
@@ -553,6 +554,9 @@ static int sohci_submit_urb (struct urb * urb, int mem_flags)
// if(usb_endpoint_halted (urb->dev, usb_pipeendpoint (pipe), usb_pipeout (pipe)))
// if(usb_endpoint_halted (urb->dev, usb_pipeendpoint (pipe), usb_pipeout (pipe)))
// return -EPIPE;
// return -EPIPE;
/* increment the reference count of the urb, as we now also control it */
urb
=
usb_get_urb
(
urb
);
usb_inc_dev_use
(
urb
->
dev
);
usb_inc_dev_use
(
urb
->
dev
);
ohci
=
(
ohci_t
*
)
urb
->
dev
->
bus
->
hcpriv
;
ohci
=
(
ohci_t
*
)
urb
->
dev
->
bus
->
hcpriv
;
...
@@ -568,12 +572,14 @@ static int sohci_submit_urb (struct urb * urb, int mem_flags)
...
@@ -568,12 +572,14 @@ static int sohci_submit_urb (struct urb * urb, int mem_flags)
* such as powering down ports */
* such as powering down ports */
if
(
ohci
->
disabled
)
{
if
(
ohci
->
disabled
)
{
usb_dec_dev_use
(
urb
->
dev
);
usb_dec_dev_use
(
urb
->
dev
);
usb_put_urb
(
urb
);
return
-
ESHUTDOWN
;
return
-
ESHUTDOWN
;
}
}
/* every endpoint has a ed, locate and fill it */
/* every endpoint has a ed, locate and fill it */
if
(
!
(
ed
=
ep_add_ed
(
urb
->
dev
,
pipe
,
urb
->
interval
,
1
,
mem_flags
)))
{
if
(
!
(
ed
=
ep_add_ed
(
urb
->
dev
,
pipe
,
urb
->
interval
,
1
,
mem_flags
)))
{
usb_dec_dev_use
(
urb
->
dev
);
usb_dec_dev_use
(
urb
->
dev
);
usb_put_urb
(
urb
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
...
@@ -595,6 +601,7 @@ static int sohci_submit_urb (struct urb * urb, int mem_flags)
...
@@ -595,6 +601,7 @@ static int sohci_submit_urb (struct urb * urb, int mem_flags)
size
=
urb
->
number_of_packets
;
size
=
urb
->
number_of_packets
;
if
(
size
<=
0
)
{
if
(
size
<=
0
)
{
usb_dec_dev_use
(
urb
->
dev
);
usb_dec_dev_use
(
urb
->
dev
);
usb_put_urb
(
urb
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
for
(
i
=
0
;
i
<
urb
->
number_of_packets
;
i
++
)
{
for
(
i
=
0
;
i
<
urb
->
number_of_packets
;
i
++
)
{
...
@@ -615,6 +622,7 @@ static int sohci_submit_urb (struct urb * urb, int mem_flags)
...
@@ -615,6 +622,7 @@ static int sohci_submit_urb (struct urb * urb, int mem_flags)
urb_priv
=
kmalloc
(
sizeof
(
urb_priv_t
)
+
size
*
sizeof
(
td_t
*
),
mem_flags
);
urb_priv
=
kmalloc
(
sizeof
(
urb_priv_t
)
+
size
*
sizeof
(
td_t
*
),
mem_flags
);
if
(
!
urb_priv
)
{
if
(
!
urb_priv
)
{
usb_dec_dev_use
(
urb
->
dev
);
usb_dec_dev_use
(
urb
->
dev
);
usb_put_urb
(
urb
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
memset
(
urb_priv
,
0
,
sizeof
(
urb_priv_t
)
+
size
*
sizeof
(
td_t
*
));
memset
(
urb_priv
,
0
,
sizeof
(
urb_priv_t
)
+
size
*
sizeof
(
td_t
*
));
...
@@ -632,6 +640,7 @@ static int sohci_submit_urb (struct urb * urb, int mem_flags)
...
@@ -632,6 +640,7 @@ static int sohci_submit_urb (struct urb * urb, int mem_flags)
urb_free_priv
(
ohci
,
urb_priv
);
urb_free_priv
(
ohci
,
urb_priv
);
spin_unlock_irqrestore
(
&
usb_ed_lock
,
flags
);
spin_unlock_irqrestore
(
&
usb_ed_lock
,
flags
);
usb_dec_dev_use
(
urb
->
dev
);
usb_dec_dev_use
(
urb
->
dev
);
usb_put_urb
(
urb
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
}
}
...
@@ -640,6 +649,7 @@ static int sohci_submit_urb (struct urb * urb, int mem_flags)
...
@@ -640,6 +649,7 @@ static int sohci_submit_urb (struct urb * urb, int mem_flags)
urb_free_priv
(
ohci
,
urb_priv
);
urb_free_priv
(
ohci
,
urb_priv
);
spin_unlock_irqrestore
(
&
usb_ed_lock
,
flags
);
spin_unlock_irqrestore
(
&
usb_ed_lock
,
flags
);
usb_dec_dev_use
(
urb
->
dev
);
usb_dec_dev_use
(
urb
->
dev
);
usb_put_urb
(
urb
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
@@ -662,6 +672,7 @@ static int sohci_submit_urb (struct urb * urb, int mem_flags)
...
@@ -662,6 +672,7 @@ static int sohci_submit_urb (struct urb * urb, int mem_flags)
urb_free_priv
(
ohci
,
urb_priv
);
urb_free_priv
(
ohci
,
urb_priv
);
spin_unlock_irqrestore
(
&
usb_ed_lock
,
flags
);
spin_unlock_irqrestore
(
&
usb_ed_lock
,
flags
);
usb_dec_dev_use
(
urb
->
dev
);
usb_dec_dev_use
(
urb
->
dev
);
usb_put_urb
(
urb
);
return
bustime
;
return
bustime
;
}
}
usb_claim_bandwidth
(
urb
->
dev
,
urb
,
bustime
,
usb_pipeisoc
(
urb
->
pipe
));
usb_claim_bandwidth
(
urb
->
dev
,
urb
,
bustime
,
usb_pipeisoc
(
urb
->
pipe
));
...
@@ -2100,6 +2111,7 @@ static int rh_submit_urb (struct urb * urb)
...
@@ -2100,6 +2111,7 @@ static int rh_submit_urb (struct urb * urb)
urb
->
dev
=
NULL
;
urb
->
dev
=
NULL
;
if
(
urb
->
complete
)
if
(
urb
->
complete
)
urb
->
complete
(
urb
);
urb
->
complete
(
urb
);
usb_put_urb
(
urb
);
return
0
;
return
0
;
}
}
...
@@ -2123,6 +2135,7 @@ static int rh_unlink_urb (struct urb * urb)
...
@@ -2123,6 +2135,7 @@ static int rh_unlink_urb (struct urb * urb)
urb
->
complete
(
urb
);
urb
->
complete
(
urb
);
}
else
}
else
urb
->
status
=
-
ENOENT
;
urb
->
status
=
-
ENOENT
;
usb_put_urb
(
urb
);
}
}
return
0
;
return
0
;
}
}
...
...
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