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#ifndef IRCOMM_TTY_ATTACH_H
32#define IRCOMM_TTY_ATTACH_H
33
34#include <net/irda/ircomm_tty.h>
35
36typedef enum {
37 IRCOMM_TTY_IDLE,
38 IRCOMM_TTY_SEARCH,
39 IRCOMM_TTY_QUERY_PARAMETERS,
40 IRCOMM_TTY_QUERY_LSAP_SEL,
41 IRCOMM_TTY_SETUP,
42 IRCOMM_TTY_READY,
43} IRCOMM_TTY_STATE;
44
45
46typedef enum {
47 IRCOMM_TTY_ATTACH_CABLE,
48 IRCOMM_TTY_DETACH_CABLE,
49 IRCOMM_TTY_DATA_REQUEST,
50 IRCOMM_TTY_DATA_INDICATION,
51 IRCOMM_TTY_DISCOVERY_REQUEST,
52 IRCOMM_TTY_DISCOVERY_INDICATION,
53 IRCOMM_TTY_CONNECT_CONFIRM,
54 IRCOMM_TTY_CONNECT_INDICATION,
55 IRCOMM_TTY_DISCONNECT_REQUEST,
56 IRCOMM_TTY_DISCONNECT_INDICATION,
57 IRCOMM_TTY_WD_TIMER_EXPIRED,
58 IRCOMM_TTY_GOT_PARAMETERS,
59 IRCOMM_TTY_GOT_LSAPSEL,
60} IRCOMM_TTY_EVENT;
61
62
63struct ircomm_tty_info {
64 __u32 saddr;
65 __u32 daddr;
66 __u8 dlsap_sel;
67};
68
69extern const char *const ircomm_state[];
70extern const char *const ircomm_tty_state[];
71
72int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event,
73 struct sk_buff *skb, struct ircomm_tty_info *info);
74
75
76int ircomm_tty_attach_cable(struct ircomm_tty_cb *self);
77void ircomm_tty_detach_cable(struct ircomm_tty_cb *self);
78void ircomm_tty_connect_confirm(void *instance, void *sap,
79 struct qos_info *qos,
80 __u32 max_sdu_size,
81 __u8 max_header_size,
82 struct sk_buff *skb);
83void ircomm_tty_disconnect_indication(void *instance, void *sap,
84 LM_REASON reason,
85 struct sk_buff *skb);
86void ircomm_tty_connect_indication(void *instance, void *sap,
87 struct qos_info *qos,
88 __u32 max_sdu_size,
89 __u8 max_header_size,
90 struct sk_buff *skb);
91int ircomm_tty_send_initial_parameters(struct ircomm_tty_cb *self);
92void ircomm_tty_link_established(struct ircomm_tty_cb *self);
93
94#endif
95