~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/include/net/irda/irttp.h

Version: ~ [ 2.2.5 ] ~ [ 2.4.1 ] ~ [ 2.4.9 ] ~ [ 2.6.17.10 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*********************************************************************
  2  *                
  3  * Filename:      irttp.h
  4  * Version:       1.0
  5  * Description:   Tiny Transport Protocol (TTP) definitions
  6  * Status:        Experimental.
  7  * Author:        Dag Brattli <dagb@cs.uit.no>
  8  * Created at:    Sun Aug 31 20:14:31 1997
  9  * Modified at:   Sun Dec 12 13:09:07 1999
 10  * Modified by:   Dag Brattli <dagb@cs.uit.no>
 11  * 
 12  *     Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, 
 13  *     All Rights Reserved.
 14  *     
 15  *     This program is free software; you can redistribute it and/or 
 16  *     modify it under the terms of the GNU General Public License as 
 17  *     published by the Free Software Foundation; either version 2 of 
 18  *     the License, or (at your option) any later version.
 19  *
 20  *     Neither Dag Brattli nor University of Tromsų admit liability nor
 21  *     provide warranty for any of this software. This material is 
 22  *     provided "AS-IS" and at no charge.
 23  *
 24  ********************************************************************/
 25 
 26 #ifndef IRTTP_H
 27 #define IRTTP_H
 28 
 29 #include <linux/types.h>
 30 #include <linux/skbuff.h>
 31 #include <linux/spinlock.h>
 32 
 33 #include <net/irda/irda.h>
 34 #include <net/irda/irlmp.h>
 35 #include <net/irda/qos.h>
 36 #include <net/irda/irqueue.h>
 37 
 38 #define TTP_MAX_CONNECTIONS    LM_MAX_CONNECTIONS
 39 #define TTP_HEADER             1
 40 #define TTP_MAX_HEADER         (TTP_HEADER + LMP_MAX_HEADER)
 41 #define TTP_SAR_HEADER         5
 42 #define TTP_PARAMETERS         0x80
 43 #define TTP_MORE               0x80
 44 
 45 #define DEFAULT_INITIAL_CREDIT 14
 46 
 47 #define TTP_LOW_THRESHOLD       4
 48 #define TTP_HIGH_THRESHOLD     10
 49 #define TTP_MAX_QUEUE          14
 50 
 51 /* Some priorities for disconnect requests */
 52 #define P_NORMAL    0
 53 #define P_HIGH      1
 54 
 55 #define TTP_SAR_DISABLE 0
 56 #define TTP_SAR_UNBOUND 0xffffffff
 57 
 58 /* Parameters */
 59 #define TTP_MAX_SDU_SIZE 0x01
 60 
 61 /*
 62  *  This structure contains all data assosiated with one instance of a TTP 
 63  *  connection.
 64  */
 65 struct tsap_cb {
 66         irda_queue_t q;            /* Must be first */
 67         magic_t magic;        /* Just in case */
 68 
 69         __u8 stsap_sel;       /* Source TSAP */
 70         __u8 dtsap_sel;       /* Destination TSAP */
 71 
 72         struct lsap_cb *lsap; /* Corresponding LSAP to this TSAP */
 73 
 74         __u8 connected;       /* TSAP connected */
 75          
 76         __u8 initial_credit;  /* Initial credit to give peer */
 77 
 78         int avail_credit;    /* Available credit to return to peer */
 79         int remote_credit;   /* Credit held by peer TTP entity */
 80         int send_credit;     /* Credit held by local TTP entity */
 81         
 82         struct sk_buff_head tx_queue; /* Frames to be transmitted */
 83         struct sk_buff_head rx_queue; /* Received frames */
 84         struct sk_buff_head rx_fragments;
 85         int tx_queue_lock;
 86         int rx_queue_lock;
 87         spinlock_t lock;
 88 
 89         notify_t notify;       /* Callbacks to client layer */
 90 
 91         struct net_device_stats stats;
 92         struct timer_list todo_timer; 
 93         
 94         __u32 max_seg_size;     /* Max data that fit into an IrLAP frame */
 95         __u8  max_header_size;
 96 
 97         int   rx_sdu_busy;     /* RxSdu.busy */
 98         __u32 rx_sdu_size;     /* Current size of a partially received frame */
 99         __u32 rx_max_sdu_size; /* Max receive user data size */
100 
101         int tx_sdu_busy;       /* TxSdu.busy */
102         __u32 tx_max_sdu_size; /* Max transmit user data size */
103 
104         int close_pend;        /* Close, but disconnect_pend */
105         int disconnect_pend;   /* Disconnect, but still data to send */
106         struct sk_buff *disconnect_skb;
107 };
108 
109 struct irttp_cb {
110         magic_t    magic;       
111         hashbin_t *tsaps;
112 };
113 
114 int  irttp_init(void);
115 void irttp_cleanup(void);
116 
117 struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify);
118 int irttp_close_tsap(struct tsap_cb *self);
119 
120 int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb);
121 int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb);
122 
123 int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel, 
124                           __u32 saddr, __u32 daddr,
125                           struct qos_info *qos, __u32 max_sdu_size, 
126                           struct sk_buff *userdata);
127 int irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size, 
128                             struct sk_buff *userdata);
129 int irttp_disconnect_request(struct tsap_cb *self, struct sk_buff *skb,
130                              int priority);
131 void irttp_flow_request(struct tsap_cb *self, LOCAL_FLOW flow);
132 void irttp_status_indication(void *instance,
133                              LINK_STATUS link, LOCK_STATUS lock);
134 struct tsap_cb *irttp_dup(struct tsap_cb *self, void *instance);
135 
136 static __inline __u32 irttp_get_saddr(struct tsap_cb *self)
137 {
138         return irlmp_get_saddr(self->lsap);
139 }
140 
141 static __inline __u32 irttp_get_daddr(struct tsap_cb *self)
142 {
143         return irlmp_get_daddr(self->lsap);
144 }
145 
146 static __inline __u32 irttp_get_max_seg_size(struct tsap_cb *self)
147 {
148         return self->max_seg_size;
149 }
150 
151 extern struct irttp_cb *irttp;
152 
153 #endif /* IRTTP_H */
154 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.