aboutsummaryrefslogtreecommitdiff
path: root/include/linux/usb/tty_diag.h
blob: 665f77acf99bee6966422275200990bd5bee1943 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef _DRIVERS_TTY_DIAG_H_
#define _DRIVERS_TTY_DIAG_H_

#ifdef CONFIG_DIAG_OVER_USB
#include <linux/usb/usbdiag.h>
#endif

#ifdef CONFIG_DIAG_OVER_TTY
struct usb_diag_ch *tty_diag_channel_open(const char *name, void *priv,
		void (*notify)(void *, unsigned, struct diag_request *));
void tty_diag_channel_close(struct usb_diag_ch *diag_ch);
int tty_diag_channel_read(struct usb_diag_ch *diag_ch,
				struct diag_request *d_req);
int tty_diag_channel_write(struct usb_diag_ch *diag_ch,
				struct diag_request *d_req);
void tty_diag_channel_abandon_request(void);
int tty_diag_get_dbg_ftm_flag_value(void);
int tty_diag_set_dbg_ftm_flag_value(int val);
#else
static inline struct usb_diag_ch *tty_diag_channel_open(const char *name,
		void *priv,
		void (*notify)(void *, unsigned, struct diag_request *))
{
	return ERR_PTR(-ENODEV);
}

static inline void tty_diag_channel_close(struct usb_diag_ch *diag_ch)
{
}

static inline int tty_diag_channel_read(struct usb_diag_ch *diag_ch,
				struct diag_request *d_req)
{
	return -ENODEV;
}

static inline int tty_diag_channel_write(struct usb_diag_ch *diag_ch,
				struct diag_request *d_req)
{
	return -ENODEV;
}

static inline void tty_diag_channel_abandon_request(void)
{
	return -ENODEV;
}

static inline int tty_diag_get_dbg_ftm_flag_value(void)
{
	return -ENODEV;
}

static inline int tty_diag_set_dbg_ftm_flag_value(int val)
{
	return -ENODEV;
}

#endif

#endif /* _DRIVERS_TTY_DIAG_H_ */