2 * IrNET protocol module : Synchronous PPP over an IrDA socket.
4 * Jean II - HPL `00 - <jt@hpl.hp.com>
6 * This file contains all definitions and declarations necessary for the
7 * IRDA part of the IrNET module (dealing with IrTTP, IrIAS and co).
8 * This file is a private header, so other modules don't want to know
15 /***************************** INCLUDES *****************************/
16 /* Please add other headers in irnet.h */
18 #include "irnet.h" /* Module global include */
20 /************************ CONSTANTS & MACROS ************************/
23 * Name of the service (socket name) used by IrNET
25 /* IAS object name (or part of it) */
26 #define IRNET_SERVICE_NAME "IrNetv1"
28 #define IRNET_IAS_VALUE "IrDA:TinyTP:LsapSel"
29 /* LMP notify name for client (only for /proc/net/irda/irlmp) */
30 #define IRNET_NOTIFY_NAME "IrNET socket"
31 /* LMP notify name for server (only for /proc/net/irda/irlmp) */
32 #define IRNET_NOTIFY_NAME_SERV "IrNET server"
34 /****************************** TYPES ******************************/
37 * This is the main structure where we store all the data pertaining to
38 * the IrNET server (listen for connection requests) and the root
39 * of the IrNET socket list
41 typedef struct irnet_root
43 irnet_socket s; /* To pretend we are a client... */
46 int magic; /* Paranoia */
47 int running; /* Are we operational ? */
49 /* Link list of all IrNET instances opened */
51 spinlock_t spinlock; /* Serialize access to the list */
52 /* Note : the way hashbin has been designed is absolutely not
53 * reentrant, beware... So, we blindly protect all with spinlock */
55 /* Handle for the hint bit advertised in IrLMP */
58 /* Server socket part */
59 struct ias_object * ias_obj; /* Our service name + lsap in IAS */
64 /**************************** PROTOTYPES ****************************/
66 /* ----------------------- CONTROL CHANNEL ----------------------- */
68 irnet_post_event(irnet_socket *,
74 /* ----------------------- IRDA SUBROUTINES ----------------------- */
76 irnet_open_tsap(irnet_socket *);
78 irnet_ias_to_tsap(irnet_socket *,
82 irnet_find_lsap_sel(irnet_socket *);
84 irnet_connect_tsap(irnet_socket *);
86 irnet_discover_next_daddr(irnet_socket *);
88 irnet_discover_daddr_and_lsap_sel(irnet_socket *);
90 irnet_dname_to_daddr(irnet_socket *);
91 /* ------------------------ SERVER SOCKET ------------------------ */
93 irnet_daddr_to_dname(irnet_socket *);
94 static inline irnet_socket *
95 irnet_find_socket(irnet_socket *);
97 irnet_connect_socket(irnet_socket *,
103 irnet_disconnect_server(irnet_socket *,
106 irnet_setup_server(void);
108 irnet_destroy_server(void);
109 /* ---------------------- IRDA-TTP CALLBACKS ---------------------- */
111 irnet_data_indication(void *, /* instance */
115 irnet_disconnect_indication(void *,
120 irnet_connect_confirm(void *,
127 irnet_flow_indication(void *,
131 irnet_status_indication(void *,
135 irnet_connect_indication(void *,
141 /* -------------------- IRDA-IAS/LMP CALLBACKS -------------------- */
143 irnet_getvalue_confirm(int,
148 irnet_discovervalue_confirm(int,
152 #ifdef DISCOVERY_EVENTS
154 irnet_discovery_indication(discinfo_t *,
158 irnet_expiry_indication(discinfo_t *,
162 /* -------------------------- PROC ENTRY -------------------------- */
163 #ifdef CONFIG_PROC_FS
165 irnet_proc_read(char *,
169 #endif /* CONFIG_PROC_FS */
171 /**************************** VARIABLES ****************************/
174 * The IrNET server. Listen to connection requests and co...
176 static struct irnet_root irnet_server;
178 /* Control channel stuff (note : extern) */
179 struct irnet_ctrl_channel irnet_events;
181 /* The /proc/net/irda directory, defined elsewhere... */
182 #ifdef CONFIG_PROC_FS
183 extern struct proc_dir_entry *proc_irda;
184 #endif /* CONFIG_PROC_FS */
186 #endif /* IRNET_IRDA_H */