Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FPGA Configuration Space
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FPGA Configuration Space
Commits
99640fa5
Commit
99640fa5
authored
Mar 12, 2018
by
A. Hahn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wishbone: added support for kernel 4.x
parent
372ebdde
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
142 additions
and
102 deletions
+142
-102
wishbone-serial.c
pcie-wb/wishbone-serial.c
+1
-1
wishbone.c
pcie-wb/wishbone.c
+141
-101
No files found.
pcie-wb/wishbone-serial.c
View file @
99640fa5
...
...
@@ -43,7 +43,7 @@
#define API 8
#endif
#if API <=
7
#if API <=
8
static
const
struct
usb_device_id
id_table
[]
=
{
{
USB_DEVICE_AND_INTERFACE_INFO
(
0x1D50
,
0x6062
,
0xFF
,
0xFF
,
0xFF
)
},
...
...
pcie-wb/wishbone.c
View file @
99640fa5
...
...
@@ -28,7 +28,7 @@ static DEFINE_MUTEX(wishbone_mutex);
static
struct
class
*
wishbone_master_class
;
static
dev_t
wishbone_master_dev_first
;
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,30)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,30)
|| LINUX_VERSION_CODE > KERNEL_VERSION(3,1,19)
/* missing 'const' in 2.6.30. present in 2.6.31. */
static
int
compat_memcpy_fromiovecend
(
unsigned
char
*
kdata
,
const
struct
iovec
*
iov
,
...
...
@@ -56,6 +56,7 @@ static int compat_memcpy_fromiovecend(unsigned char *kdata, const struct iovec *
}
/* does not exist in 2.6.30. does in 2.6.31. */
static
int
compat_memcpy_toiovecend
(
const
struct
iovec
*
iov
,
unsigned
char
*
kdata
,
int
offset
,
int
len
)
...
...
@@ -524,6 +525,8 @@ static ssize_t char_master_aio_read(struct kiocb *iocb, const struct iovec *iov,
return
len
;
}
static
ssize_t
char_master_aio_write
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
{
struct
file
*
filep
=
iocb
->
ki_filp
;
...
...
@@ -591,6 +594,23 @@ static int char_master_fasync(int fd, struct file *file, int on)
return
fasync_helper
(
fd
,
file
,
on
,
&
context
->
fasync
);
}
#if LINUX_VERSION_CODE > KERNEL_VERSION(4,1,0)
static
ssize_t
char_master_aio_read_iter
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
iter
)
{
return
char_master_aio_read
(
iocb
,
iter
->
iov
,
iter
->
nr_segs
,
iter
->
iov_offset
);
}
static
ssize_t
char_master_aio_write_iter
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
iter
)
{
return
char_master_aio_write
(
iocb
,
iter
->
iov
,
iter
->
nr_segs
,
iter
->
iov_offset
);
}
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,1,0)
static
const
struct
file_operations
etherbone_master_fops
=
{
.
owner
=
THIS_MODULE
,
.
llseek
=
no_llseek
,
...
...
@@ -604,6 +624,26 @@ static const struct file_operations etherbone_master_fops = {
.
fasync
=
char_master_fasync
,
};
#else
static
const
struct
file_operations
etherbone_master_fops
=
{
.
owner
=
THIS_MODULE
,
.
llseek
=
no_llseek
,
//.read = new_sync_read,
.
read_iter
=
char_master_aio_read_iter
,
//.write = new_sync_write,
.
write_iter
=
char_master_aio_write_iter
,
.
open
=
char_master_open
,
.
poll
=
char_master_poll
,
.
release
=
char_master_release
,
.
fasync
=
char_master_fasync
,
};
#endif
//ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
//ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
int
wishbone_register
(
struct
wishbone
*
wb
)
{
struct
list_head
*
list_pos
;
...
...
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