Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FPGA Configuration Space
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Projects
FPGA Configuration Space
Commits
9108998e
Commit
9108998e
authored
11 years ago
by
Wesley W. Terpstra
Browse files
Options
Downloads
Patches
Plain Diff
wishbone-serial: support kernel v2.6.3[23456789]
API 1&2 were the same; merged. API 0 renamed to 1
parent
ca5cf8d5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pcie-wb/wishbone-serial.c
+16
-18
16 additions, 18 deletions
pcie-wb/wishbone-serial.c
with
16 additions
and
18 deletions
pcie-wb/wishbone-serial.c
+
16
−
18
View file @
9108998e
...
...
@@ -22,11 +22,9 @@
#define GSI_VENDOR_OPENCLOSE 0xB0
#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,26)
#define API 0
#elif LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32)
#define API 1
#elif LINUX_VERSION_CODE
=
= KERNEL_VERSION(2,6,3
4
)
#define API 2
#elif LINUX_VERSION_CODE
>= KERNEL_VERSION(2,6,32) && LINUX_VERSION_CODE <
= KERNEL_VERSION(2,6,3
9
)
#define API 2
/* v2.6.32 v2.6.33 v2.6.34 v2.6.35 v2.6.36 v2.6.37 v2.6.38 v2.6.39 */
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) && LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
#define API 3
/* v3.0 v3.1 */
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) && LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
...
...
@@ -73,13 +71,13 @@ static int usb_gsi_openclose(struct usb_serial_port *port, int value)
5000
);
/* Timeout till operation fails */
}
#if API <=
0
#if API <=
1
static
void
wishbone_serial_set_termios
(
struct
usb_serial_port
*
port
,
struct
ktermios
*
old_termios
)
#else
/* API >=
1
*/
#else
/* API >=
2
*/
static
void
wishbone_serial_init_termios
(
struct
tty_struct
*
tty
)
#endif
{
#if API <=
0
#if API <=
1
struct
ktermios
*
termios
=
port
->
tty
->
termios
;
#elif API <= 6
struct
ktermios
*
termios
=
tty
->
termios
;
...
...
@@ -124,17 +122,17 @@ static void wishbone_serial_init_termios(struct tty_struct *tty)
termios
->
c_cflag
|=
CS8
;
/* character size 8 bits */
#if API <=
0
#if API <=
1
port
->
tty
->
low_latency
=
1
;
tty_encode_baud_rate
(
port
->
tty
,
115200
,
115200
);
#else
/* API >=
1
*/
#else
/* API >=
2
*/
tty_encode_baud_rate
(
tty
,
115200
,
115200
);
#endif
}
#if API <=
0
#if API <=
1
static
int
wishbone_serial_open
(
struct
usb_serial_port
*
port
,
struct
file
*
filp
)
#else
/* API >=
1
*/
#else
/* API >=
2
*/
static
int
wishbone_serial_open
(
struct
tty_struct
*
tty
,
struct
usb_serial_port
*
port
)
#endif
{
...
...
@@ -148,13 +146,13 @@ static int wishbone_serial_open(struct tty_struct *tty, struct usb_serial_port *
return
retval
;
}
#if API <=
0
#if API <=
1
wishbone_serial_set_termios
(
port
,
NULL
);
#endif
#if API <=
0
#if API <=
1
retval
=
usb_serial_generic_open
(
port
,
filp
);
#else
/* API >=
1
*/
#else
/* API >=
2
*/
retval
=
usb_serial_generic_open
(
tty
,
port
);
#endif
if
(
retval
)
...
...
@@ -163,9 +161,9 @@ static int wishbone_serial_open(struct tty_struct *tty, struct usb_serial_port *
return
retval
;
}
#if API <=
0
#if API <=
1
static
void
wishbone_serial_close
(
struct
usb_serial_port
*
port
,
struct
file
*
filp
)
#else
/* API >=
1
*/
#else
/* API >=
2
*/
static
void
wishbone_serial_close
(
struct
usb_serial_port
*
port
)
#endif
{
...
...
@@ -202,9 +200,9 @@ static struct usb_serial_driver wishbone_serial_device = {
.
num_ports
=
1
,
.
open
=
wishbone_serial_open
,
.
close
=
wishbone_serial_close
,
#if API <=
0
#if API <=
1
.
set_termios
=
wishbone_serial_set_termios
,
#else
/* API >=
1
*/
#else
/* API >=
2
*/
.
init_termios
=
wishbone_serial_init_termios
,
#endif
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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