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
f036e056
Commit
f036e056
authored
Sep 19, 2014
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
greybus: gbuf: implement submission logic
parent
29f000f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
21 deletions
+29
-21
drivers/staging/greybus/es1-ap-usb.c
drivers/staging/greybus/es1-ap-usb.c
+8
-8
drivers/staging/greybus/gbuf.c
drivers/staging/greybus/gbuf.c
+17
-10
drivers/staging/greybus/greybus.h
drivers/staging/greybus/greybus.h
+4
-3
No files found.
drivers/staging/greybus/es1-ap-usb.c
View file @
f036e056
...
@@ -96,7 +96,7 @@ static int alloc_gbuf(struct gbuf *gbuf, unsigned int size, gfp_t gfp_mask)
...
@@ -96,7 +96,7 @@ static int alloc_gbuf(struct gbuf *gbuf, unsigned int size, gfp_t gfp_mask)
u8
*
buffer
;
u8
*
buffer
;
if
(
size
>
ES1_GBUF_MSG_SIZE
)
{
if
(
size
>
ES1_GBUF_MSG_SIZE
)
{
pr_err
(
"guf was asked to be bigger than %d!
\n
"
,
pr_err
(
"guf was asked to be bigger than %
l
d!
\n
"
,
ES1_GBUF_MSG_SIZE
);
ES1_GBUF_MSG_SIZE
);
}
}
...
@@ -189,8 +189,8 @@ static struct urb *next_free_urb(struct es1_ap_dev *es1, gfp_t gfp_mask)
...
@@ -189,8 +189,8 @@ static struct urb *next_free_urb(struct es1_ap_dev *es1, gfp_t gfp_mask)
return
urb
;
return
urb
;
}
}
static
int
s
end
_gbuf
(
struct
gbuf
*
gbuf
,
struct
greybus_host_device
*
hd
,
static
int
s
ubmit
_gbuf
(
struct
gbuf
*
gbuf
,
struct
greybus_host_device
*
hd
,
gfp_t
gfp_mask
)
gfp_t
gfp_mask
)
{
{
struct
es1_ap_dev
*
es1
=
hd_to_es1
(
hd
);
struct
es1_ap_dev
*
es1
=
hd_to_es1
(
hd
);
struct
usb_device
*
udev
=
es1
->
usb_dev
;
struct
usb_device
*
udev
=
es1
->
usb_dev
;
...
@@ -216,11 +216,11 @@ static int send_gbuf(struct gbuf *gbuf, struct greybus_host_device *hd,
...
@@ -216,11 +216,11 @@ static int send_gbuf(struct gbuf *gbuf, struct greybus_host_device *hd,
}
}
static
struct
greybus_host_driver
es1_driver
=
{
static
struct
greybus_host_driver
es1_driver
=
{
.
hd_priv_size
=
sizeof
(
struct
es1_ap_dev
),
.
hd_priv_size
=
sizeof
(
struct
es1_ap_dev
),
.
alloc_gbuf
=
alloc_gbuf
,
.
alloc_gbuf
=
alloc_gbuf
,
.
free_gbuf
=
free_gbuf
,
.
free_gbuf
=
free_gbuf
,
.
send_svc_msg
=
send_svc_msg
,
.
send_svc_msg
=
send_svc_msg
,
.
s
end_gbuf
=
send
_gbuf
,
.
s
ubmit_gbuf
=
submit
_gbuf
,
};
};
/* Callback for when we get a SVC message */
/* Callback for when we get a SVC message */
...
...
drivers/staging/greybus/gbuf.c
View file @
f036e056
...
@@ -112,10 +112,9 @@ struct gbuf *greybus_get_gbuf(struct gbuf *gbuf)
...
@@ -112,10 +112,9 @@ struct gbuf *greybus_get_gbuf(struct gbuf *gbuf)
}
}
EXPORT_SYMBOL_GPL
(
greybus_get_gbuf
);
EXPORT_SYMBOL_GPL
(
greybus_get_gbuf
);
int
greybus_submit_gbuf
(
struct
gbuf
*
gbuf
,
gfp_t
mem_flags
)
int
greybus_submit_gbuf
(
struct
gbuf
*
gbuf
,
gfp_t
gfp_mask
)
{
{
// FIXME - implement
return
gbuf
->
gdev
->
hd
->
driver
->
submit_gbuf
(
gbuf
,
gbuf
->
gdev
->
hd
,
gfp_mask
);
return
-
ENOMEM
;
}
}
int
greybus_kill_gbuf
(
struct
gbuf
*
gbuf
)
int
greybus_kill_gbuf
(
struct
gbuf
*
gbuf
)
...
@@ -124,13 +123,6 @@ int greybus_kill_gbuf(struct gbuf *gbuf)
...
@@ -124,13 +123,6 @@ int greybus_kill_gbuf(struct gbuf *gbuf)
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
/* Can be called in interrupt context, do the work and get out of here */
void
greybus_gbuf_finished
(
struct
gbuf
*
gbuf
)
{
// FIXME - implement
}
EXPORT_SYMBOL_GPL
(
greybus_gbuf_finished
);
#define MAX_CPORTS 1024
#define MAX_CPORTS 1024
struct
gb_cport_handler
{
struct
gb_cport_handler
{
gbuf_complete_t
handler
;
gbuf_complete_t
handler
;
...
@@ -236,6 +228,21 @@ void greybus_cport_in_data(struct greybus_host_device *hd, int cport, u8 *data,
...
@@ -236,6 +228,21 @@ void greybus_cport_in_data(struct greybus_host_device *hd, int cport, u8 *data,
}
}
EXPORT_SYMBOL_GPL
(
greybus_cport_in_data
);
EXPORT_SYMBOL_GPL
(
greybus_cport_in_data
);
/* Can be called in interrupt context, do the work and get out of here */
void
greybus_gbuf_finished
(
struct
gbuf
*
gbuf
)
{
struct
cport_msg
*
cm
;
/* Again with the slow allocate... */
cm
=
kmalloc
(
sizeof
(
*
cm
),
GFP_ATOMIC
);
cm
->
gbuf
=
gbuf
;
INIT_WORK
(
&
cm
->
event
,
cport_process_event
);
queue_work
(
cport_workqueue
,
&
cm
->
event
);
// FIXME - implement
}
EXPORT_SYMBOL_GPL
(
greybus_gbuf_finished
);
int
gb_gbuf_init
(
void
)
int
gb_gbuf_init
(
void
)
{
{
cport_workqueue
=
alloc_workqueue
(
"greybus_gbuf"
,
0
,
1
);
cport_workqueue
=
alloc_workqueue
(
"greybus_gbuf"
,
0
,
1
);
...
...
drivers/staging/greybus/greybus.h
View file @
f036e056
...
@@ -107,9 +107,10 @@ struct greybus_host_driver {
...
@@ -107,9 +107,10 @@ struct greybus_host_driver {
int
(
*
alloc_gbuf
)(
struct
gbuf
*
gbuf
,
unsigned
int
size
,
gfp_t
gfp_mask
);
int
(
*
alloc_gbuf
)(
struct
gbuf
*
gbuf
,
unsigned
int
size
,
gfp_t
gfp_mask
);
void
(
*
free_gbuf
)(
struct
gbuf
*
gbuf
);
void
(
*
free_gbuf
)(
struct
gbuf
*
gbuf
);
int
(
*
send_svc_msg
)(
struct
svc_msg
*
svc_msg
,
struct
greybus_host_device
*
hd
);
int
(
*
send_svc_msg
)(
struct
svc_msg
*
svc_msg
,
int
(
*
send_gbuf
)(
struct
gbuf
*
gbuf
,
struct
greybus_host_device
*
hd
,
struct
greybus_host_device
*
hd
);
gfp_t
gfp_mask
);
int
(
*
submit_gbuf
)(
struct
gbuf
*
gbuf
,
struct
greybus_host_device
*
hd
,
gfp_t
gfp_mask
);
};
};
struct
greybus_host_device
{
struct
greybus_host_device
{
...
...
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