History

Merge tag 'tty-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial updates from Greg KH: "Here is the large set of TTY and Serial driver patches for 5.9-rc1. Lots of bugfixes in here, thanks to syzbot fuzzing for serial and vt and console code. Other highlights include: - much needed vt/vc code cleanup from Jiri Slaby - 8250 driver fixes and additions - various serial driver updates and feature enhancements - locking cleanup for serial/console initializations - other minor cleanups All of these have been in linux-next with no reported issues" * tag 'tty-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (90 commits) MAINTAINERS: enlist Greg formally for console stuff vgacon: Fix for missing check in scrollback handling Revert "serial: 8250: Let serial core initialise spin lock" serial: 8250: Let serial core initialise spin lock tty: keyboard, do not speculate on func_table index serial: stm32: Add RS485 RTS GPIO control serial: 8250_dw: Fix common clocks usage race condition serial: 8250_dw: Pass the same rate to the clk round and set rate methods serial: 8250_dw: Simplify the ref clock rate setting procedure serial: 8250: Add 8250 port clock update method tty: serial: imx: add imx earlycon driver tty: serial: imx: enable imx serial console port as module tty/synclink: remove leftover bits of non-PCI card support tty: Use the preferred form for passing the size of a structure type tty: Fix identation issues in struct serial_struct32 tty: Avoid the use of one-element arrays serial: msm_serial: add sparse context annotation serial: pmac_zilog: add sparse context annotation newport_con: vc_color is now in state serial: imx: use hrtimers for rs485 delays ...

Linus Torvalds committed 6 years ago

Commit d6efb3a2 parents c0c419c f6c6eb263 files · +1847 −1613Browse files

Showing the changes to include/linux (5 of 63 files). Show all

Unified · Split

5 files
  1. include/linux/console.h +5 −8
  2. include/linux/console_struct.h +58 −35
  3. include/linux/serial_8250.h +2 −0
  4. include/linux/serial_core.h +1 −1
  5. include/linux/vt_kern.h +0 −3
include/linux/console.h+5−8
@@ -24,17 +24,13 @@ struct module; · 23 unmodified lines
24struct tty_struct;24struct tty_struct;
25struct notifier_block;25struct notifier_block;
26 26
27/*
28 * this is what the terminal answers to a ESC-Z or csi0c query.
29 */
30#define VT100ID "\033[?1;2c"
31#define VT102ID "\033[?6c"
32
33enum con_scroll {27enum con_scroll {
34 SM_UP,28 SM_UP,
35 SM_DOWN,29 SM_DOWN,
36};30};
37 31
32enum vc_intensity;
33
38/**34/**
39 * struct consw - callbacks for consoles35 * struct consw - callbacks for consoles
40 *36 *
@@ -74,8 +70,9 @@ struct consw { · 33 unmodified lines
74 void (*con_scrolldelta)(struct vc_data *vc, int lines);70 void (*con_scrolldelta)(struct vc_data *vc, int lines);
75 int (*con_set_origin)(struct vc_data *vc);71 int (*con_set_origin)(struct vc_data *vc);
76 void (*con_save_screen)(struct vc_data *vc);72 void (*con_save_screen)(struct vc_data *vc);
77 u8 (*con_build_attr)(struct vc_data *vc, u8 color, u8 intensity,73 u8 (*con_build_attr)(struct vc_data *vc, u8 color,
78 u8 blink, u8 underline, u8 reverse, u8 italic);74 enum vc_intensity intensity,
75 bool blink, bool underline, bool reverse, bool italic);
79 void (*con_invert_region)(struct vc_data *vc, u16 *p, int count);76 void (*con_invert_region)(struct vc_data *vc, u16 *p, int count);
80 u16 *(*con_screen_pos)(struct vc_data *vc, int offset);77 u16 *(*con_screen_pos)(struct vc_data *vc, int offset);
81 unsigned long (*con_getxy)(struct vc_data *vc, unsigned long position,78 unsigned long (*con_getxy)(struct vc_data *vc, unsigned long position,
include/linux/console_struct.h+58−35
@@ -21,6 +21,43 @@ struct uni_pagedir; · 20 unmodified lines
21struct uni_screen;21struct uni_screen;
22 22
23#define NPAR 1623#define NPAR 16
24#define VC_TABSTOPS_COUNT 256U
25
26enum vc_intensity {
27 VCI_HALF_BRIGHT,
28 VCI_NORMAL,
29 VCI_BOLD,
30 VCI_MASK = 0x3,
31};
32
33/**
34 * struct vc_state -- state of a VC
35 * @x: cursor's x-position
36 * @y: cursor's y-position
37 * @color: foreground & background colors
38 * @Gx_charset: what's G0/G1 slot set to (like GRAF_MAP, LAT1_MAP)
39 * @charset: what character set to use (0=G0 or 1=G1)
40 * @intensity: see enum vc_intensity for values
41 * @reverse: reversed foreground/background colors
42 *
43 * These members are defined separately from struct vc_data as we save &
44 * restore them at times.
45 */
46struct vc_state {
47 unsigned int x, y;
48
49 unsigned char color;
50
51 unsigned char Gx_charset[2];
52 unsigned int charset : 1;
53
54 /* attribute flags */
55 enum vc_intensity intensity;
56 bool italic;
57 bool underline;
58 bool blink;
59 bool reverse;
60};
24 61
25/*62/*
26 * Example: vc_data of a console that was scrolled 3 lines down.63 * Example: vc_data of a console that was scrolled 3 lines down.
@@ -57,6 +94,8 @@ struct uni_screen; · 30 unmodified lines
57struct vc_data {94struct vc_data {
58 struct tty_port port; /* Upper level data */95 struct tty_port port; /* Upper level data */
59 96
97 struct vc_state state, saved_state;
98
60 unsigned short vc_num; /* Console number */99 unsigned short vc_num; /* Console number */
61 unsigned int vc_cols; /* [#] Console size */100 unsigned int vc_cols; /* [#] Console size */
62 unsigned int vc_rows;101 unsigned int vc_rows;
@@ -73,8 +112,6 @@ struct vc_data { · 10 unmodified lines
73 /* attributes for all characters on screen */112 /* attributes for all characters on screen */
74 unsigned char vc_attr; /* Current attributes */113 unsigned char vc_attr; /* Current attributes */
75 unsigned char vc_def_color; /* Default colors */114 unsigned char vc_def_color; /* Default colors */
76 unsigned char vc_color; /* Foreground & background */
77 unsigned char vc_s_color; /* Saved foreground & background */
78 unsigned char vc_ulcolor; /* Color for underline mode */115 unsigned char vc_ulcolor; /* Color for underline mode */
79 unsigned char vc_itcolor;116 unsigned char vc_itcolor;
80 unsigned char vc_halfcolor; /* Color for half intensity mode */117 unsigned char vc_halfcolor; /* Color for half intensity mode */
@@ -82,8 +119,6 @@ struct vc_data { · 1 unmodified line
82 unsigned int vc_cursor_type;119 unsigned int vc_cursor_type;
83 unsigned short vc_complement_mask; /* [#] Xor mask for mouse pointer */120 unsigned short vc_complement_mask; /* [#] Xor mask for mouse pointer */
84 unsigned short vc_s_complement_mask; /* Saved mouse pointer mask */121 unsigned short vc_s_complement_mask; /* Saved mouse pointer mask */
85 unsigned int vc_x, vc_y; /* Cursor position */
86 unsigned int vc_saved_x, vc_saved_y;
87 unsigned long vc_pos; /* Cursor address */122 unsigned long vc_pos; /* Cursor address */
88 /* fonts */ 123 /* fonts */
89 unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */124 unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */
@@ -98,8 +133,6 @@ struct vc_data { · 8 unmodified lines
98 int vt_newvt;133 int vt_newvt;
99 wait_queue_head_t paste_wait;134 wait_queue_head_t paste_wait;
100 /* mode flags */135 /* mode flags */
101 unsigned int vc_charset : 1; /* Character set G0 / G1 */
102 unsigned int vc_s_charset : 1; /* Saved character set */
103 unsigned int vc_disp_ctrl : 1; /* Display chars < 32? */136 unsigned int vc_disp_ctrl : 1; /* Display chars < 32? */
104 unsigned int vc_toggle_meta : 1; /* Toggle high bit? */137 unsigned int vc_toggle_meta : 1; /* Toggle high bit? */
105 unsigned int vc_decscnm : 1; /* Screen Mode */138 unsigned int vc_decscnm : 1; /* Screen Mode */
@@ -107,17 +140,6 @@ struct vc_data { · 1 unmodified line
107 unsigned int vc_decawm : 1; /* Autowrap Mode */140 unsigned int vc_decawm : 1; /* Autowrap Mode */
108 unsigned int vc_deccm : 1; /* Cursor Visible */141 unsigned int vc_deccm : 1; /* Cursor Visible */
109 unsigned int vc_decim : 1; /* Insert Mode */142 unsigned int vc_decim : 1; /* Insert Mode */
110 /* attribute flags */
111 unsigned int vc_intensity : 2; /* 0=half-bright, 1=normal, 2=bold */
112 unsigned int vc_italic:1;
113 unsigned int vc_underline : 1;
114 unsigned int vc_blink : 1;
115 unsigned int vc_reverse : 1;
116 unsigned int vc_s_intensity : 2; /* saved rendition */
117 unsigned int vc_s_italic:1;
118 unsigned int vc_s_underline : 1;
119 unsigned int vc_s_blink : 1;
120 unsigned int vc_s_reverse : 1;
121 /* misc */143 /* misc */
122 unsigned int vc_priv : 3;144 unsigned int vc_priv : 3;
123 unsigned int vc_need_wrap : 1;145 unsigned int vc_need_wrap : 1;
@@ -126,13 +148,9 @@ struct vc_data { · 2 unmodified lines
126 unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */148 unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */
127 unsigned char vc_utf_count;149 unsigned char vc_utf_count;
128 int vc_utf_char;150 int vc_utf_char;
129 unsigned int vc_tab_stop[8]; /* Tab stops. 256 columns. */151 DECLARE_BITMAP(vc_tab_stop, VC_TABSTOPS_COUNT); /* Tab stops. 256 columns. */
130 unsigned char vc_palette[16*3]; /* Colour palette for VGA+ */152 unsigned char vc_palette[16*3]; /* Colour palette for VGA+ */
131 unsigned short * vc_translate;153 unsigned short * vc_translate;
132 unsigned char vc_G0_charset;
133 unsigned char vc_G1_charset;
134 unsigned char vc_saved_G0;
135 unsigned char vc_saved_G1;
136 unsigned int vc_resize_user; /* resize request from user */154 unsigned int vc_resize_user; /* resize request from user */
137 unsigned int vc_bell_pitch; /* Console bell pitch */155 unsigned int vc_bell_pitch; /* Console bell pitch */
138 unsigned int vc_bell_duration; /* Console bell duration */156 unsigned int vc_bell_duration; /* Console bell duration */
@@ -149,24 +167,29 @@ struct vc { · 10 unmodified lines
149 struct work_struct SAK_work;167 struct work_struct SAK_work;
150 168
151 /* might add scrmem, kbd at some time,169 /* might add scrmem, kbd at some time,
152 to have everything in one place - the disadvantage170 to have everything in one place */
153 would be that vc_cons etc can no longer be static */
154};171};
155 172
156extern struct vc vc_cons [MAX_NR_CONSOLES];173extern struct vc vc_cons [MAX_NR_CONSOLES];
157extern void vc_SAK(struct work_struct *work);174extern void vc_SAK(struct work_struct *work);
158 175
159#define CUR_DEF 0176#define CUR_MAKE(size, change, set) ((size) | ((change) << 8) | \
160#define CUR_NONE 1177 ((set) << 16))
161#define CUR_UNDERLINE 2178#define CUR_SIZE(c) ((c) & 0x00000f)
162#define CUR_LOWER_THIRD 3179# define CUR_DEF 0
163#define CUR_LOWER_HALF 4180# define CUR_NONE 1
164#define CUR_TWO_THIRDS 5181# define CUR_UNDERLINE 2
165#define CUR_BLOCK 6182# define CUR_LOWER_THIRD 3
166#define CUR_HWMASK 0x0f183# define CUR_LOWER_HALF 4
167#define CUR_SWMASK 0xfff0184# define CUR_TWO_THIRDS 5
168 185# define CUR_BLOCK 6
169#define CUR_DEFAULT CUR_UNDERLINE186#define CUR_SW 0x000010
187#define CUR_ALWAYS_BG 0x000020
188#define CUR_INVERT_FG_BG 0x000040
189#define CUR_FG 0x000700
190#define CUR_BG 0x007000
191#define CUR_CHANGE(c) ((c) & 0x00ff00)
192#define CUR_SET(c) (((c) & 0xff0000) >> 8)
170 193
171bool con_is_visible(const struct vc_data *vc);194bool con_is_visible(const struct vc_data *vc);
172 195
include/linux/serial_8250.h+2−0
@@ -155,6 +155,8 @@ extern int early_serial_setup(struct uart_port *port); · 154 unmodified lines
155 155
156extern int early_serial8250_setup(struct earlycon_device *device,156extern int early_serial8250_setup(struct earlycon_device *device,
157 const char *options);157 const char *options);
158extern void serial8250_update_uartclk(struct uart_port *port,
159 unsigned int uartclk);
158extern void serial8250_do_set_termios(struct uart_port *port,160extern void serial8250_do_set_termios(struct uart_port *port,
159 struct ktermios *termios, struct ktermios *old);161 struct ktermios *termios, struct ktermios *old);
160extern void serial8250_do_set_ldisc(struct uart_port *port,162extern void serial8250_do_set_ldisc(struct uart_port *port,
include/linux/serial_core.h+1−1
@@ -10,7 +10,6 @@ · 9 unmodified lines
10#include <linux/bitops.h>10#include <linux/bitops.h>
11#include <linux/compiler.h>11#include <linux/compiler.h>
12#include <linux/console.h>12#include <linux/console.h>
13#include <linux/gpio/consumer.h>
14#include <linux/interrupt.h>13#include <linux/interrupt.h>
15#include <linux/circ_buf.h>14#include <linux/circ_buf.h>
16#include <linux/spinlock.h>15#include <linux/spinlock.h>
@@ -30,6 +29,7 @@ · 13 unmodified lines
30struct uart_port;29struct uart_port;
31struct serial_struct;30struct serial_struct;
32struct device;31struct device;
32struct gpio_desc;
33 33
34/*34/*
35 * This structure describes all the operations that can be done on the35 * This structure describes all the operations that can be done on the
include/linux/vt_kern.h+0−3
@@ -74,8 +74,6 @@ int con_set_default_unimap(struct vc_data *vc); · 73 unmodified lines
74void con_free_unimap(struct vc_data *vc);74void con_free_unimap(struct vc_data *vc);
75int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);75int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
76 76
77#define vc_translate(vc, c) ((vc)->vc_translate[(c) | \
78 ((vc)->vc_toggle_meta ? 0x80 : 0)])
79#else77#else
80static inline int con_set_trans_old(unsigned char __user *table)78static inline int con_set_trans_old(unsigned char __user *table)
81{79{
@@ -124,7 +122,6 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc) · 42 unmodified lines
124 return 0;122 return 0;
125}123}
126 124
127#define vc_translate(vc, c) (c)
128#endif125#endif
129 126
130/* vt.c */127/* vt.c */