Skip to content

Commit 02b2396

Browse files
KAGA-KOKOpmladek
authored andcommitted
console: Document struct console
Add kerneldoc comments to struct console. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Signed-off-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 717a565 commit 02b2396

File tree

1 file changed

+37
-17
lines changed

1 file changed

+37
-17
lines changed

include/linux/console.h

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -164,24 +164,44 @@ enum cons_flags {
164164
CON_EXTENDED = BIT(6),
165165
};
166166

167+
/**
168+
* struct console - The console descriptor structure
169+
* @name: The name of the console driver
170+
* @write: Write callback to output messages (Optional)
171+
* @read: Read callback for console input (Optional)
172+
* @device: The underlying TTY device driver (Optional)
173+
* @unblank: Callback to unblank the console (Optional)
174+
* @setup: Callback for initializing the console (Optional)
175+
* @exit: Callback for teardown of the console (Optional)
176+
* @match: Callback for matching a console (Optional)
177+
* @flags: Console flags. See enum cons_flags
178+
* @index: Console index, e.g. port number
179+
* @cflag: TTY control mode flags
180+
* @ispeed: TTY input speed
181+
* @ospeed: TTY output speed
182+
* @seq: Sequence number of the next ringbuffer record to print
183+
* @dropped: Number of unreported dropped ringbuffer records
184+
* @data: Driver private data
185+
* @node: hlist node for the console list
186+
*/
167187
struct console {
168-
char name[16];
169-
void (*write)(struct console *, const char *, unsigned);
170-
int (*read)(struct console *, char *, unsigned);
171-
struct tty_driver *(*device)(struct console *, int *);
172-
void (*unblank)(void);
173-
int (*setup)(struct console *, char *);
174-
int (*exit)(struct console *);
175-
int (*match)(struct console *, char *name, int idx, char *options);
176-
short flags;
177-
short index;
178-
int cflag;
179-
uint ispeed;
180-
uint ospeed;
181-
u64 seq;
182-
unsigned long dropped;
183-
void *data;
184-
struct hlist_node node;
188+
char name[16];
189+
void (*write)(struct console *co, const char *s, unsigned int count);
190+
int (*read)(struct console *co, char *s, unsigned int count);
191+
struct tty_driver *(*device)(struct console *co, int *index);
192+
void (*unblank)(void);
193+
int (*setup)(struct console *co, char *options);
194+
int (*exit)(struct console *co);
195+
int (*match)(struct console *co, char *name, int idx, char *options);
196+
short flags;
197+
short index;
198+
int cflag;
199+
uint ispeed;
200+
uint ospeed;
201+
u64 seq;
202+
unsigned long dropped;
203+
void *data;
204+
struct hlist_node node;
185205
};
186206

187207
#ifdef CONFIG_LOCKDEP

0 commit comments

Comments
 (0)