1 /*********************************************************************
3 * Filename: irlap_frame.h
5 * Description: IrLAP frame declarations
6 * Status: Experimental.
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Tue Aug 19 10:27:26 1997
9 * Modified at: Sat Dec 25 21:07:26 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
12 * Copyright (c) 1997-1999 Dag Brattli <dagb@cs.uit.no>,
13 * All Rights Reserved.
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.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 ********************************************************************/
35 #include <linux/skbuff.h>
37 #include <net/irda/irda.h>
38 #include <net/irda/irlap.h>
39 #include <net/irda/qos.h>
41 /* Frame types and templates */
44 /* Unnumbered (U) commands */
45 #define SNRM_CMD 0x83 /* Set Normal Response Mode */
46 #define DISC_CMD 0x43 /* Disconnect */
47 #define XID_CMD 0x2f /* Exchange Station Identification */
48 #define TEST_CMD 0xe3 /* Test */
50 /* Unnumbered responses */
51 #define RNRM_RSP 0x83 /* Request Normal Response Mode */
52 #define UA_RSP 0x63 /* Unnumbered Acknowledgement */
53 #define FRMR_RSP 0x87 /* Frame Reject */
54 #define DM_RSP 0x0f /* Disconnect Mode */
55 #define RD_RSP 0x43 /* Request Disconnection */
56 #define XID_RSP 0xaf /* Exchange Station Identification */
57 #define TEST_RSP 0xe3 /* Test frame */
60 #define RR 0x01 /* Receive Ready */
61 #define REJ 0x09 /* Reject */
62 #define RNR 0x05 /* Receive Not Ready */
63 #define SREJ 0x0d /* Selective Reject */
66 #define I_FRAME 0x00 /* Information Format */
67 #define UI_FRAME 0x03 /* Unnumbered Information */
69 #define CMD_FRAME 0x01
70 #define RSP_FRAME 0x00
72 #define PF_BIT 0x10 /* Poll/final bit */
75 __u8 caddr; /* Connection address */
77 __u8 ident; /* Should always be XID_FORMAT */
78 __u32 saddr; /* Source device address */
79 __u32 daddr; /* Destination device address */
80 __u8 flags; /* Discovery flags */
86 __u8 caddr; /* Connection address */
88 __u32 saddr; /* Source device address */
89 __u32 daddr; /* Destination device address */
96 __u32 saddr; /* Source device address */
97 __u32 daddr; /* Dest device address */
113 void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb);
114 void irlap_send_discovery_xid_frame(struct irlap_cb *, int S, __u8 s,
115 __u8 command, discovery_t *discovery);
116 void irlap_send_snrm_frame(struct irlap_cb *, struct qos_info *);
117 void irlap_send_test_frame(struct irlap_cb *self, __u8 caddr, __u32 daddr,
118 struct sk_buff *cmd);
119 void irlap_send_ua_response_frame(struct irlap_cb *, struct qos_info *);
120 void irlap_send_dm_frame(struct irlap_cb *self);
121 void irlap_send_rd_frame(struct irlap_cb *self);
122 void irlap_send_disc_frame(struct irlap_cb *self);
123 void irlap_send_rr_frame(struct irlap_cb *self, int command);
125 void irlap_send_data_primary(struct irlap_cb *, struct sk_buff *);
126 void irlap_send_data_primary_poll(struct irlap_cb *, struct sk_buff *);
127 void irlap_send_data_secondary(struct irlap_cb *, struct sk_buff *);
128 void irlap_send_data_secondary_final(struct irlap_cb *, struct sk_buff *);
129 void irlap_resend_rejected_frames(struct irlap_cb *, int command);
130 void irlap_resend_rejected_frame(struct irlap_cb *self, int command);
132 void irlap_send_i_frame(struct irlap_cb *, struct sk_buff *, int command);
133 void irlap_send_ui_frame(struct irlap_cb *self, struct sk_buff *skb,
134 __u8 caddr, int command);
136 extern int irlap_insert_qos_negotiation_params(struct irlap_cb *self,
137 struct sk_buff *skb);