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
00027
00028
00029
00030
00031 #ifndef IRCOMM_CORE_H
00032 #define IRCOMM_CORE_H
00033
00034 #include <net/irda/irda.h>
00035 #include <net/irda/ircomm_event.h>
00036
00037 #define IRCOMM_MAGIC 0x98347298
00038 #define IRCOMM_HEADER_SIZE 1
00039
00040 struct ircomm_cb;
00041
00042
00043
00044
00045
00046 typedef struct {
00047 int (*data_request)(struct ircomm_cb *, struct sk_buff *, int clen);
00048 int (*connect_request)(struct ircomm_cb *, struct sk_buff *,
00049 struct ircomm_info *);
00050 int (*connect_response)(struct ircomm_cb *, struct sk_buff *);
00051 int (*disconnect_request)(struct ircomm_cb *, struct sk_buff *,
00052 struct ircomm_info *);
00053 } call_t;
00054
00055 struct ircomm_cb {
00056 queue_t queue;
00057 magic_t magic;
00058
00059 notify_t notify;
00060 call_t issue;
00061
00062 int state;
00063 int line;
00064
00065 struct tsap_cb *tsap;
00066 struct lsap_cb *lsap;
00067
00068 __u8 dlsap_sel;
00069 __u8 slsap_sel;
00070
00071 __u32 saddr;
00072 __u32 daddr;
00073
00074 int max_header_size;
00075 int max_data_size;
00076
00077 LOCAL_FLOW flow_status;
00078 int pkt_count;
00079
00080 __u8 service_type;
00081 };
00082
00083 extern hashbin_t *ircomm;
00084
00085 struct ircomm_cb *ircomm_open(notify_t *notify, __u8 service_type, int line);
00086 int ircomm_close(struct ircomm_cb *self);
00087
00088 int ircomm_data_request(struct ircomm_cb *self, struct sk_buff *skb);
00089 void ircomm_data_indication(struct ircomm_cb *self, struct sk_buff *skb);
00090 void ircomm_process_data(struct ircomm_cb *self, struct sk_buff *skb);
00091 int ircomm_control_request(struct ircomm_cb *self, struct sk_buff *skb);
00092 int ircomm_connect_request(struct ircomm_cb *self, __u8 dlsap_sel,
00093 __u32 saddr, __u32 daddr, struct sk_buff *skb,
00094 __u8 service_type);
00095 void ircomm_connect_indication(struct ircomm_cb *self, struct sk_buff *skb,
00096 struct ircomm_info *info);
00097 void ircomm_connect_confirm(struct ircomm_cb *self, struct sk_buff *skb,
00098 struct ircomm_info *info);
00099 int ircomm_connect_response(struct ircomm_cb *self, struct sk_buff *userdata);
00100 int ircomm_disconnect_request(struct ircomm_cb *self, struct sk_buff *userdata);
00101 void ircomm_disconnect_indication(struct ircomm_cb *self, struct sk_buff *skb,
00102 struct ircomm_info *info);
00103 void ircomm_flow_request(struct ircomm_cb *self, LOCAL_FLOW flow);
00104
00105 #define ircomm_is_connected(self) (self->state == IRCOMM_CONN)
00106
00107 #endif