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
d5d1903d
Commit
d5d1903d
authored
Aug 11, 2014
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
greybus: add framework for 'struct gbuf'
This is the equlivant of sk_buf or urbs for Greybus.
parent
83ddaaab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
2 deletions
+93
-2
drivers/staging/greybus/Makefile
drivers/staging/greybus/Makefile
+1
-1
drivers/staging/greybus/gbuf.c
drivers/staging/greybus/gbuf.c
+42
-0
drivers/staging/greybus/greybus.h
drivers/staging/greybus/greybus.h
+50
-1
No files found.
drivers/staging/greybus/Makefile
View file @
d5d1903d
greybus-y
:=
core.o
greybus-y
:=
core.o
gbuf.o
obj-m
+=
greybus.o
obj-m
+=
i2c-gb.o
...
...
drivers/staging/greybus/gbuf.c
0 → 100644
View file @
d5d1903d
/*
* Greybus gbuf handling
*
* Copyright 2014 Google Inc.
*
* Released under the GPLv2 only.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/types.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include "greybus.h"
struct
gbuf
*
greybus_alloc_gbuf
(
struct
greybus_device
*
gdev
,
struct
cport
*
cport
,
gfp_t
mem_flags
)
{
return
NULL
;
}
void
greybus_free_gbuf
(
struct
gbuf
*
gbuf
)
{
}
int
greybus_submit_gbuf
(
struct
gbuf
*
gbuf
,
gfp_t
mem_flags
)
{
return
-
ENOMEM
;
}
int
greybus_kill_gbuf
(
struct
gbuf
*
gbuf
)
{
return
-
ENOMEM
;
}
drivers/staging/greybus/greybus.h
View file @
d5d1903d
...
...
@@ -29,19 +29,68 @@
.match_flags = GREYBUS_DEVICE_ID_MATCH_SERIAL, \
.lSerial = (serial),
struct
greybus_descriptor
{
__u16
wVendor
;
__u16
wProduct
;
__u64
lSerialNumber
;
};
struct
gbuf
;
struct
cport
{
u16
number
;
// FIXME, what else?
};
typedef
void
(
*
gbuf_complete_t
)(
struct
gbuf
*
gbuf
);
struct
gbuf
{
struct
kref
kref
;
void
*
hcpriv
;
struct
list_head
anchor_list
;
struct
gbuf_anchor
*
anchor
;
// FIXME do we need?
struct
greybus_device
*
gdev
;
struct
cport
*
cport
;
int
status
;
void
*
transfer_buffer
;
u32
transfer_flags
;
/* flags for the transfer buffer */
u32
transfer_buffer_length
;
u32
actual_length
;
struct
scatterlist
*
sg
;
// FIXME do we need?
int
num_sgs
;
void
*
context
;
gbuf_complete_t
complete
;
};
/*
* gbuf->transfer_flags
*/
#define GBUF_FREE_BUFFER BIT(0)
/* Free the transfer buffer with the gbuf */
struct
greybus_device
{
struct
device
dev
;
struct
greybus_descriptor
descriptor
;
int
num_cport
;
struct
cport
cport
[
0
];
};
#define to_greybus_device(d) container_of(d, struct greybus_device, dev)
struct
gbuf
*
greybus_alloc_gbuf
(
struct
greybus_device
*
gdev
,
struct
cport
*
cport
,
gfp_t
mem_flags
);
void
greybus_free_gbuf
(
struct
gbuf
*
gbuf
);
int
greybus_submit_gbuf
(
struct
gbuf
*
gbuf
,
gfp_t
mem_flags
);
int
greybus_kill_gbuf
(
struct
gbuf
*
gbuf
);
struct
greybus_driver
{
const
char
*
name
;
...
...
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