Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reform-boundary-uboot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jack Humbert
reform-boundary-uboot
Commits
922f735e
Commit
922f735e
authored
9 years ago
by
Tom Rini
Browse files
Options
Downloads
Plain Diff
Merge
git://git.denx.de/u-boot-usb
parents
4ae6cfe3
b337b3b2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/usb/gadget/ci_udc.c
+34
-10
34 additions, 10 deletions
drivers/usb/gadget/ci_udc.c
with
34 additions
and
10 deletions
drivers/usb/gadget/ci_udc.c
+
34
−
10
View file @
922f735e
...
...
@@ -87,6 +87,7 @@ static int ci_ep_enable(struct usb_ep *ep,
static
int
ci_ep_disable
(
struct
usb_ep
*
ep
);
static
int
ci_ep_queue
(
struct
usb_ep
*
ep
,
struct
usb_request
*
req
,
gfp_t
gfp_flags
);
static
int
ci_ep_dequeue
(
struct
usb_ep
*
ep
,
struct
usb_request
*
req
);
static
struct
usb_request
*
ci_ep_alloc_request
(
struct
usb_ep
*
ep
,
unsigned
int
gfp_flags
);
static
void
ci_ep_free_request
(
struct
usb_ep
*
ep
,
struct
usb_request
*
_req
);
...
...
@@ -99,6 +100,7 @@ static struct usb_ep_ops ci_ep_ops = {
.
enable
=
ci_ep_enable
,
.
disable
=
ci_ep_disable
,
.
queue
=
ci_ep_queue
,
.
dequeue
=
ci_ep_dequeue
,
.
alloc_request
=
ci_ep_alloc_request
,
.
free_request
=
ci_ep_free_request
,
};
...
...
@@ -424,7 +426,7 @@ static void ci_ep_submit_next_request(struct ci_ep *ci_ep)
int
bit
,
num
,
len
,
in
;
struct
ci_req
*
ci_req
;
u8
*
buf
;
uint32_t
len
gth
,
actlen
;
uint32_t
len
_left
,
len_this_dtd
;
struct
ept_queue_item
*
dtd
,
*
qtd
;
ci_ep
->
req_primed
=
true
;
...
...
@@ -442,25 +444,23 @@ static void ci_ep_submit_next_request(struct ci_ep *ci_ep)
ci_req
->
dtd_count
=
0
;
buf
=
ci_req
->
hw_buf
;
actlen
=
0
;
len_left
=
len
;
dtd
=
item
;
do
{
length
=
min
(
ci_req
->
req
.
length
-
actlen
,
(
unsigned
)
EP_MAX_LENGTH_TRANSFER
);
len_this_dtd
=
min
(
len_left
,
(
unsigned
)
EP_MAX_LENGTH_TRANSFER
);
dtd
->
info
=
INFO_BYTES
(
len
g
th
)
|
INFO_ACTIVE
;
dtd
->
info
=
INFO_BYTES
(
len
_
th
is_dtd
)
|
INFO_ACTIVE
;
dtd
->
page0
=
(
unsigned
long
)
buf
;
dtd
->
page1
=
((
unsigned
long
)
buf
&
0xfffff000
)
+
0x1000
;
dtd
->
page2
=
((
unsigned
long
)
buf
&
0xfffff000
)
+
0x2000
;
dtd
->
page3
=
((
unsigned
long
)
buf
&
0xfffff000
)
+
0x3000
;
dtd
->
page4
=
((
unsigned
long
)
buf
&
0xfffff000
)
+
0x4000
;
len
-=
length
;
actlen
+=
length
;
buf
+=
length
;
len_left
-=
len_this_dtd
;
buf
+=
len_this_dtd
;
if
(
len
)
{
if
(
len
_left
)
{
qtd
=
(
struct
ept_queue_item
*
)
memalign
(
ILIST_ALIGN
,
ILIST_ENT_SZ
);
dtd
->
next
=
(
unsigned
long
)
qtd
;
...
...
@@ -469,7 +469,7 @@ static void ci_ep_submit_next_request(struct ci_ep *ci_ep)
}
ci_req
->
dtd_count
++
;
}
while
(
len
);
}
while
(
len
_left
);
item
=
dtd
;
/*
...
...
@@ -525,6 +525,30 @@ static void ci_ep_submit_next_request(struct ci_ep *ci_ep)
writel
(
bit
,
&
udc
->
epprime
);
}
static
int
ci_ep_dequeue
(
struct
usb_ep
*
_ep
,
struct
usb_request
*
_req
)
{
struct
ci_ep
*
ci_ep
=
container_of
(
_ep
,
struct
ci_ep
,
ep
);
struct
ci_req
*
ci_req
;
list_for_each_entry
(
ci_req
,
&
ci_ep
->
queue
,
queue
)
{
if
(
&
ci_req
->
req
==
_req
)
break
;
}
if
(
&
ci_req
->
req
!=
_req
)
return
-
EINVAL
;
list_del_init
(
&
ci_req
->
queue
);
if
(
ci_req
->
req
.
status
==
-
EINPROGRESS
)
{
ci_req
->
req
.
status
=
-
ECONNRESET
;
if
(
ci_req
->
req
.
complete
)
ci_req
->
req
.
complete
(
_ep
,
_req
);
}
return
0
;
}
static
int
ci_ep_queue
(
struct
usb_ep
*
ep
,
struct
usb_request
*
req
,
gfp_t
gfp_flags
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment