Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

irlap_frame.h

Go to the documentation of this file.
00001 /*********************************************************************
00002  *                
00003  * Filename:      irlap_frame.h
00004  * Version:       0.9
00005  * Description:   IrLAP frame declarations
00006  * Status:        Experimental.
00007  * Author:        Dag Brattli <dagb@cs.uit.no>
00008  * Created at:    Tue Aug 19 10:27:26 1997
00009  * Modified at:   Sat Dec 25 21:07:26 1999
00010  * Modified by:   Dag Brattli <dagb@cs.uit.no>
00011  * 
00012  *     Copyright (c) 1997-1999 Dag Brattli <dagb@cs.uit.no>,
00013  *     All Rights Reserved.
00014  *     
00015  *     This program is free software; you can redistribute it and/or 
00016  *     modify it under the terms of the GNU General Public License as 
00017  *     published by the Free Software Foundation; either version 2 of 
00018  *     the License, or (at your option) any later version.
00019  * 
00020  *     This program is distributed in the hope that it will be useful,
00021  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00023  *     GNU General Public License for more details.
00024  * 
00025  *     You should have received a copy of the GNU General Public License 
00026  *     along with this program; if not, write to the Free Software 
00027  *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
00028  *     MA 02111-1307 USA
00029  *     
00030  ********************************************************************/
00031 
00032 #ifndef IRLAP_FRAME_H
00033 #define IRLAP_FRAME_H
00034 
00035 #include <linux/skbuff.h>
00036 
00037 #include <net/irda/irda.h>
00038 #include <net/irda/irlap.h>
00039 #include <net/irda/qos.h>
00040 
00041 /* Frame types and templates */
00042 #define INVALID   0xff
00043 
00044 /* Unnumbered (U) commands */
00045 #define SNRM_CMD  0x83 /* Set Normal Response Mode */
00046 #define DISC_CMD  0x43 /* Disconnect */
00047 #define XID_CMD   0x2f /* Exchange Station Identification */
00048 #define TEST_CMD  0xe3 /* Test */
00049 
00050 /* Unnumbered responses */
00051 #define RNRM_RSP  0x83 /* Request Normal Response Mode */
00052 #define UA_RSP    0x63 /* Unnumbered Acknowledgement */
00053 #define FRMR_RSP  0x87 /* Frame Reject */
00054 #define DM_RSP    0x0f /* Disconnect Mode */
00055 #define RD_RSP    0x43 /* Request Disconnection */
00056 #define XID_RSP   0xaf /* Exchange Station Identification */
00057 #define TEST_RSP  0xe3 /* Test frame */
00058 
00059 /* Supervisory (S) */
00060 #define RR        0x01 /* Receive Ready */
00061 #define REJ       0x09 /* Reject */
00062 #define RNR       0x05 /* Receive Not Ready */
00063 #define SREJ      0x0d /* Selective Reject */
00064 
00065 /* Information (I) */
00066 #define I_FRAME   0x00 /* Information Format */
00067 #define UI_FRAME  0x03 /* Unnumbered Information */
00068 
00069 #define CMD_FRAME 0x01
00070 #define RSP_FRAME 0x00
00071 
00072 #define PF_BIT    0x10 /* Poll/final bit */
00073 
00074 struct xid_frame {
00075         __u8  caddr; /* Connection address */
00076         __u8  control;
00077         __u8  ident; /* Should always be XID_FORMAT */ 
00078         __u32 saddr; /* Source device address */
00079         __u32 daddr; /* Destination device address */
00080         __u8  flags; /* Discovery flags */
00081         __u8  slotnr;
00082         __u8  version;
00083 } PACK;
00084 
00085 struct test_frame {
00086         __u8 caddr;          /* Connection address */
00087         __u8 control;
00088         __u32 saddr;         /* Source device address */
00089         __u32 daddr;         /* Destination device address */
00090 } PACK;
00091 
00092 struct ua_frame {
00093         __u8 caddr;
00094         __u8 control;
00095 
00096         __u32 saddr; /* Source device address */
00097         __u32 daddr; /* Dest device address */
00098 } PACK;
00099         
00100 struct i_frame {
00101         __u8 caddr;
00102         __u8 control;
00103 } PACK;
00104 
00105 struct snrm_frame {
00106         __u8  caddr;
00107         __u8  control;
00108         __u32 saddr;
00109         __u32 daddr;
00110         __u8  ncaddr;
00111 } PACK;
00112 
00113 void irlap_send_discovery_xid_frame(struct irlap_cb *, int S, __u8 s, 
00114                                     __u8 command, discovery_t *discovery);
00115 void irlap_send_snrm_frame(struct irlap_cb *, struct qos_info *);
00116 void irlap_send_test_frame(struct irlap_cb *self, __u8 caddr, __u32 daddr, 
00117                            struct sk_buff *cmd);
00118 void irlap_send_ua_response_frame(struct irlap_cb *, struct qos_info *);
00119 void irlap_send_dm_frame(struct irlap_cb *self);
00120 void irlap_send_rd_frame(struct irlap_cb *self);
00121 void irlap_send_disc_frame(struct irlap_cb *self);
00122 void irlap_send_rr_frame(struct irlap_cb *self, int command);
00123 
00124 void irlap_send_data_primary(struct irlap_cb *, struct sk_buff *);
00125 void irlap_send_data_primary_poll(struct irlap_cb *, struct sk_buff *);
00126 void irlap_send_data_secondary(struct irlap_cb *, struct sk_buff *);
00127 void irlap_send_data_secondary_final(struct irlap_cb *, struct sk_buff *);
00128 void irlap_resend_rejected_frames(struct irlap_cb *, int command);
00129 void irlap_resend_rejected_frame(struct irlap_cb *self, int command);
00130 
00131 void irlap_send_i_frame(struct irlap_cb *, struct sk_buff *, int command);
00132 void irlap_send_ui_frame(struct irlap_cb *self, struct sk_buff *skb,
00133                          __u8 caddr, int command);
00134 
00135 extern int irlap_insert_qos_negotiation_params(struct irlap_cb *self, 
00136                                                struct sk_buff *skb);
00137 
00138 #endif