1 /*********************************************************************
5 * Description: Quality of Service definitions
6 * Status: Experimental.
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Fri Sep 19 23:21:09 1997
9 * Modified at: Mon Aug 16 10:00:18 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
12 * Copyright (c) 1999 Dag Brattli, All Rights Reserved.
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 ********************************************************************/
34 #include <linux/config.h>
35 #include <linux/skbuff.h>
37 #include <net/irda/parameters.h>
39 #define PI_BAUD_RATE 0x01
40 #define PI_MAX_TURN_TIME 0x82
41 #define PI_DATA_SIZE 0x83
42 #define PI_WINDOW_SIZE 0x84
43 #define PI_ADD_BOFS 0x85
44 #define PI_MIN_TURN_TIME 0x86
45 #define PI_LINK_DISC 0x08
46 #define PI_COMPRESSION 0x07 /* Just a random pick */
49 #define IR_115200_MAX 0x3f
51 /* Baud rates (first byte) */
57 #define IR_115200 0x20
58 #define IR_576000 0x40
59 #define IR_1152000 0x80
61 /* Baud rates (second byte) */
62 #define IR_4000000 0x01
63 #define IR_16000000 0x02
65 /* Quality of Service information */
68 __u16 bits
; /* LSB is first byte, MSB is second byte */
74 qos_value_t baud_rate
; /* IR_11520O | ... */
75 qos_value_t max_turn_time
;
76 qos_value_t data_size
;
77 qos_value_t window_size
;
78 qos_value_t additional_bofs
;
79 qos_value_t min_turn_time
;
80 qos_value_t link_disc_time
;
83 #ifdef CONFIG_IRDA_COMPRESSION
84 /* An experimental non IrDA field */
85 qos_value_t compression
;
89 extern __u32 baud_rates
[];
90 extern __u32 data_size
[];
91 extern __u32 min_turn_time
[];
92 extern __u32 add_bofs
[];
93 extern __u32 compression
[];
95 void irda_init_max_qos_capabilies(struct qos_info
*qos
);
96 void irda_qos_compute_intersection(struct qos_info
*, struct qos_info
*);
98 int msb_index(__u16 byte
);
99 __u32
byte_value(__u8 byte
, int *array
);
100 int value_index(__u32 value
, int *array
);
101 __u32
index_value(int index
, int *array
);
103 void irda_qos_bits_to_value(struct qos_info
*qos
);