/*1* IrNET protocol module : Synchronous PPP over an IrDA socket.2*3* Jean II - HPL `00 - <[email protected]>4*5* This file contains all definitions and declarations necessary for the6* IRDA part of the IrNET module (dealing with IrTTP, IrIAS and co).7* This file is a private header, so other modules don't want to know8* what's in there...9*/1011#ifndef IRNET_IRDA_H12#define IRNET_IRDA_H1314/***************************** INCLUDES *****************************/15/* Please add other headers in irnet.h */1617#include "irnet.h" /* Module global include */1819/************************ CONSTANTS & MACROS ************************/2021/*22* Name of the service (socket name) used by IrNET23*/24/* IAS object name (or part of it) */25#define IRNET_SERVICE_NAME "IrNetv1"26/* IAS attribute */27#define IRNET_IAS_VALUE "IrDA:TinyTP:LsapSel"28/* LMP notify name for client (only for /proc/net/irda/irlmp) */29#define IRNET_NOTIFY_NAME "IrNET socket"30/* LMP notify name for server (only for /proc/net/irda/irlmp) */31#define IRNET_NOTIFY_NAME_SERV "IrNET server"3233/****************************** TYPES ******************************/3435/*36* This is the main structure where we store all the data pertaining to37* the IrNET server (listen for connection requests) and the root38* of the IrNET socket list39*/40typedef struct irnet_root41{42irnet_socket s; /* To pretend we are a client... */4344/* Generic stuff */45int magic; /* Paranoia */46int running; /* Are we operational ? */4748/* Link list of all IrNET instances opened */49hashbin_t * list;50spinlock_t spinlock; /* Serialize access to the list */51/* Note : the way hashbin has been designed is absolutely not52* reentrant, beware... So, we blindly protect all with spinlock */5354/* Handle for the hint bit advertised in IrLMP */55void * skey;5657/* Server socket part */58struct ias_object * ias_obj; /* Our service name + lsap in IAS */5960} irnet_root;616263/**************************** PROTOTYPES ****************************/6465/* ----------------------- CONTROL CHANNEL ----------------------- */66static void67irnet_post_event(irnet_socket *,68irnet_event,69__u32,70__u32,71char *,72__u16);73/* ----------------------- IRDA SUBROUTINES ----------------------- */74static inline int75irnet_open_tsap(irnet_socket *);76static inline __u877irnet_ias_to_tsap(irnet_socket *,78int,79struct ias_value *);80static inline int81irnet_find_lsap_sel(irnet_socket *);82static inline int83irnet_connect_tsap(irnet_socket *);84static inline int85irnet_discover_next_daddr(irnet_socket *);86static inline int87irnet_discover_daddr_and_lsap_sel(irnet_socket *);88static inline int89irnet_dname_to_daddr(irnet_socket *);90/* ------------------------ SERVER SOCKET ------------------------ */91static inline int92irnet_daddr_to_dname(irnet_socket *);93static inline irnet_socket *94irnet_find_socket(irnet_socket *);95static inline int96irnet_connect_socket(irnet_socket *,97irnet_socket *,98struct qos_info *,99__u32,100__u8);101static inline void102irnet_disconnect_server(irnet_socket *,103struct sk_buff *);104static inline int105irnet_setup_server(void);106static inline void107irnet_destroy_server(void);108/* ---------------------- IRDA-TTP CALLBACKS ---------------------- */109static int110irnet_data_indication(void *, /* instance */111void *, /* sap */112struct sk_buff *);113static void114irnet_disconnect_indication(void *,115void *,116LM_REASON,117struct sk_buff *);118static void119irnet_connect_confirm(void *,120void *,121struct qos_info *,122__u32,123__u8,124struct sk_buff *);125static void126irnet_flow_indication(void *,127void *,128LOCAL_FLOW);129static void130irnet_status_indication(void *,131LINK_STATUS,132LOCK_STATUS);133static void134irnet_connect_indication(void *,135void *,136struct qos_info *,137__u32,138__u8,139struct sk_buff *);140/* -------------------- IRDA-IAS/LMP CALLBACKS -------------------- */141static void142irnet_getvalue_confirm(int,143__u16,144struct ias_value *,145void *);146static void147irnet_discovervalue_confirm(int,148__u16,149struct ias_value *,150void *);151#ifdef DISCOVERY_EVENTS152static void153irnet_discovery_indication(discinfo_t *,154DISCOVERY_MODE,155void *);156static void157irnet_expiry_indication(discinfo_t *,158DISCOVERY_MODE,159void *);160#endif161162/**************************** VARIABLES ****************************/163164/*165* The IrNET server. Listen to connection requests and co...166*/167static struct irnet_root irnet_server;168169/* Control channel stuff (note : extern) */170struct irnet_ctrl_channel irnet_events;171172/* The /proc/net/irda directory, defined elsewhere... */173#ifdef CONFIG_PROC_FS174extern struct proc_dir_entry *proc_irda;175#endif /* CONFIG_PROC_FS */176177#endif /* IRNET_IRDA_H */178179180