Commit 22979275 authored by Max Filippov's avatar Max Filippov Committed by Zefan Li

xtensa: replace IOCTL code definitions with constants

commit f61bf8e7 upstream.

This fixes userspace code that builds on other architectures but fails
on xtensa due to references to structures that other architectures don't
refer to. E.g. this fixes the following issue with python-2.7.8:

  python-2.7.8/Modules/termios.c:861:25: error: invalid application
     of 'sizeof' to incomplete type 'struct serial_multiport_struct'
     {"TIOCSERGETMULTI", TIOCSERGETMULTI},
  python-2.7.8/Modules/termios.c:870:25: error: invalid application
     of 'sizeof' to incomplete type 'struct serial_multiport_struct'
     {"TIOCSERSETMULTI", TIOCSERSETMULTI},
  python-2.7.8/Modules/termios.c:900:24: error: invalid application
     of 'sizeof' to incomplete type 'struct tty_struct'
     {"TIOCTTYGSTRUCT", TIOCTTYGSTRUCT},
Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
[lizf: Backported to 3.4: adjust filename]
Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
parent 483320c2
...@@ -28,17 +28,17 @@ ...@@ -28,17 +28,17 @@
#define TCSETSW 0x5403 #define TCSETSW 0x5403
#define TCSETSF 0x5404 #define TCSETSF 0x5404
#define TCGETA _IOR('t', 23, struct termio) #define TCGETA 0x80127417 /* _IOR('t', 23, struct termio) */
#define TCSETA _IOW('t', 24, struct termio) #define TCSETA 0x40127418 /* _IOW('t', 24, struct termio) */
#define TCSETAW _IOW('t', 25, struct termio) #define TCSETAW 0x40127419 /* _IOW('t', 25, struct termio) */
#define TCSETAF _IOW('t', 28, struct termio) #define TCSETAF 0x4012741C /* _IOW('t', 28, struct termio) */
#define TCSBRK _IO('t', 29) #define TCSBRK _IO('t', 29)
#define TCXONC _IO('t', 30) #define TCXONC _IO('t', 30)
#define TCFLSH _IO('t', 31) #define TCFLSH _IO('t', 31)
#define TIOCSWINSZ _IOW('t', 103, struct winsize) #define TIOCSWINSZ 0x40087467 /* _IOW('t', 103, struct winsize) */
#define TIOCGWINSZ _IOR('t', 104, struct winsize) #define TIOCGWINSZ 0x80087468 /* _IOR('t', 104, struct winsize) */
#define TIOCSTART _IO('t', 110) /* start output, like ^Q */ #define TIOCSTART _IO('t', 110) /* start output, like ^Q */
#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ #define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ #define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
...@@ -88,7 +88,6 @@ ...@@ -88,7 +88,6 @@
#define TIOCSETD _IOW('T', 35, int) #define TIOCSETD _IOW('T', 35, int)
#define TIOCGETD _IOR('T', 36, int) #define TIOCGETD _IOR('T', 36, int)
#define TCSBRKP _IOW('T', 37, int) /* Needed for POSIX tcsendbreak()*/ #define TCSBRKP _IOW('T', 37, int) /* Needed for POSIX tcsendbreak()*/
#define TIOCTTYGSTRUCT _IOR('T', 38, struct tty_struct) /* For debugging only*/
#define TIOCSBRK _IO('T', 39) /* BSD compatibility */ #define TIOCSBRK _IO('T', 39) /* BSD compatibility */
#define TIOCCBRK _IO('T', 40) /* BSD compatibility */ #define TIOCCBRK _IO('T', 40) /* BSD compatibility */
#define TIOCGSID _IOR('T', 41, pid_t) /* Return the session ID of FD*/ #define TIOCGSID _IOR('T', 41, pid_t) /* Return the session ID of FD*/
...@@ -111,8 +110,10 @@ ...@@ -111,8 +110,10 @@
#define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* Get line status reg. */ #define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* Get line status reg. */
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ # define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
#define TIOCSERGETMULTI _IOR('T', 90, struct serial_multiport_struct) /* Get multiport config */ #define TIOCSERGETMULTI 0x80a8545a /* Get multiport config */
#define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */ /* _IOR('T', 90, struct serial_multiport_struct) */
#define TIOCSERSETMULTI 0x40a8545b /* Set multiport config */
/* _IOW('T', 91, struct serial_multiport_struct) */
#define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */ #define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */
#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment