blob: 55003840cd689d65f7b130b9b3cd5193951a60b3 [file] [log] [blame]
Greg Kroah-Hartman98602c02021-04-08 14:51:22 +02001/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * TTY core internal functions
4 */
5
6#ifndef _TTY_INTERNAL_H
7#define _TTY_INTERNAL_H
8
9#define tty_msg(fn, tty, f, ...) \
10 fn("%s %s: " f, tty_driver_name(tty), tty_name(tty), ##__VA_ARGS__)
11
12#define tty_debug(tty, f, ...) tty_msg(pr_debug, tty, f, ##__VA_ARGS__)
Greg Kroah-Hartman98602c02021-04-08 14:51:22 +020013#define tty_notice(tty, f, ...) tty_msg(pr_notice, tty, f, ##__VA_ARGS__)
14#define tty_warn(tty, f, ...) tty_msg(pr_warn, tty, f, ##__VA_ARGS__)
15#define tty_err(tty, f, ...) tty_msg(pr_err, tty, f, ##__VA_ARGS__)
16
17#define tty_info_ratelimited(tty, f, ...) \
18 tty_msg(pr_info_ratelimited, tty, f, ##__VA_ARGS__)
19
Greg Kroah-Hartmanda5d6692021-04-08 14:51:29 +020020/* tty_audit.c */
21#ifdef CONFIG_AUDIT
22void tty_audit_add_data(struct tty_struct *tty, const void *data, size_t size);
23void tty_audit_tiocsti(struct tty_struct *tty, char ch);
24#else
25static inline void tty_audit_add_data(struct tty_struct *tty, const void *data,
26 size_t size)
27{
28}
29static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch)
30{
31}
32#endif
33
Greg Kroah-Hartman98602c02021-04-08 14:51:22 +020034#endif