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