00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef IRIAP_H
00027 #define IRIAP_H
00028
00029 #include <linux/types.h>
00030 #include <linux/skbuff.h>
00031
00032 #include <net/irda/qos.h>
00033 #include <net/irda/iriap_event.h>
00034 #include <net/irda/irias_object.h>
00035 #include <net/irda/irqueue.h>
00036 #include <net/irda/timer.h>
00037
00038 #define IAP_LST 0x80
00039 #define IAP_ACK 0x40
00040
00041 #define IAS_SERVER 0
00042 #define IAS_CLIENT 1
00043
00044
00045 #define GET_INFO_BASE 0x01
00046 #define GET_OBJECTS 0x02
00047 #define GET_VALUE 0x03
00048 #define GET_VALUE_BY_CLASS 0x04
00049 #define GET_OBJECT_INFO 0x05
00050 #define GET_ATTRIB_NAMES 0x06
00051
00052 #define IAS_SUCCESS 0
00053 #define IAS_CLASS_UNKNOWN 1
00054 #define IAS_ATTRIB_UNKNOWN 2
00055 #define IAS_DISCONNECT 10
00056
00057 typedef void (*CONFIRM_CALLBACK)(int result, __u16 obj_id,
00058 struct ias_value *value, void *priv);
00059
00060 struct iriap_cb {
00061 queue_t q;
00062 magic_t magic;
00063
00064 int mode;
00065
00066 __u32 saddr;
00067 __u32 daddr;
00068 __u8 operation;
00069
00070 struct sk_buff *skb;
00071 struct lsap_cb *lsap;
00072 __u8 slsap_sel;
00073
00074
00075 IRIAP_STATE client_state;
00076 IRIAP_STATE call_state;
00077
00078
00079 IRIAP_STATE server_state;
00080 IRIAP_STATE r_connect_state;
00081
00082 CONFIRM_CALLBACK confirm;
00083 void *priv;
00084
00085 __u8 max_header_size;
00086 __u32 max_data_size;
00087
00088 struct timer_list watchdog_timer;
00089 };
00090
00091 int iriap_init(void);
00092 void iriap_cleanup(void);
00093
00094 struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv,
00095 CONFIRM_CALLBACK callback);
00096 void iriap_close(struct iriap_cb *self);
00097
00098 int iriap_getvaluebyclass_request(struct iriap_cb *self,
00099 __u32 saddr, __u32 daddr,
00100 char *name, char *attr);
00101 void iriap_getvaluebyclass_confirm(struct iriap_cb *self, struct sk_buff *skb);
00102 void iriap_connect_request(struct iriap_cb *self);
00103 void iriap_send_ack( struct iriap_cb *self);
00104 void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb);
00105
00106 void iriap_register_server(void);
00107
00108 void iriap_watchdog_timer_expired(void *data);
00109
00110 static inline void iriap_start_watchdog_timer(struct iriap_cb *self,
00111 int timeout)
00112 {
00113 irda_start_timer(&self->watchdog_timer, timeout, self,
00114 iriap_watchdog_timer_expired);
00115 }
00116
00117 #endif
00118
00119