]> git.pld-linux.org Git - packages/kernel.git/blob - vbr-kernel-diffs
- sparse fixes for 2.4.x <2.4.27
[packages/kernel.git] / vbr-kernel-diffs
1 Index: linux/include/linux/atm.h
2 ===================================================================
3 RCS file: /afs/cmf/project/cvsroot/linux/include/linux/atm.h,v
4 retrieving revision 1.2
5 diff -u -r1.2 atm.h
6 --- linux/include/linux/atm.h   12 Feb 2003 20:56:33 -0000      1.2
7 +++ linux/include/linux/atm.h   9 Apr 2003 12:08:38 -0000
8 @@ -72,7 +72,7 @@
9                             /* connection identifier range; socket must be
10                                bound or connected */
11  #define SO_ATMQOS      __SO_ENCODE(SOL_ATM,2,struct atm_qos)
12 -                           /* Quality of Service setting */
13 +                           /* Quality of Service setting (with vbr support) */
14  #define SO_ATMSAP      __SO_ENCODE(SOL_ATM,3,struct atm_sap)
15                             /* Service Access Point */
16  #define SO_ATMPVC      __SO_ENCODE(SOL_ATM,4,struct sockaddr_atmpvc)
17 @@ -127,9 +127,11 @@
18  #define ATM_NONE       0               /* no traffic */
19  #define ATM_UBR                1
20  #define ATM_CBR                2
21 -#define ATM_VBR                3
22 +#define ATM_VBR_NRT    3
23 +#define ATM_VBR                ATM_VBR_NRT     /* for backward compatibility */
24  #define ATM_ABR                4
25  #define ATM_ANYCLASS   5               /* compatible with everything */
26 +#define ATM_VBR_RT     6
27  
28  #define ATM_MAX_PCR    -1              /* maximum available PCR */
29  
30 @@ -140,6 +142,11 @@
31         int             min_pcr;        /* minimum PCR in cells per second */
32         int             max_cdv;        /* maximum CDV in microseconds */
33         int             max_sdu;        /* maximum SDU in bytes */
34 +
35 +       /* extra params for VBR */
36 +       int             scr;            /* sustained rate in cells per second */
37 +       int             mbs;            /* maximum burst size (MBS) in cells */
38 +
39          /* extra params for ABR */
40          unsigned int   icr;            /* Initial Cell Rate (24-bit) */
41          unsigned int   tbe;            /* Transient Buffer Exposure (24-bit) */ 
42 @@ -164,6 +171,7 @@
43         unsigned char aal __ATM_API_ALIGN;
44  };
45  
46 +
47  /* PVC addressing */
48  
49  #define ATM_ITF_ANY    -1              /* "magic" PVC address values */
50 @@ -243,6 +251,39 @@
51  
52  #include <linux/net.h> /* struct net_proto */
53  
54 +struct atm_trafprm_compat {
55 +       unsigned char   traffic_class;  /* traffic class (ATM_UBR, ...) */
56 +       int             max_pcr;        /* maximum PCR in cells per second */
57 +       int             pcr;            /* desired PCR in cells per second */
58 +       int             min_pcr;        /* minimum PCR in cells per second */
59 +       int             max_cdv;        /* maximum CDV in microseconds */
60 +       int             max_sdu;        /* maximum SDU in bytes */
61 +        /* extra params for ABR */
62 +        unsigned int   icr;            /* Initial Cell Rate (24-bit) */
63 +        unsigned int   tbe;            /* Transient Buffer Exposure (24-bit) */ 
64 +        unsigned int   frtt : 24;      /* Fixed Round Trip Time (24-bit) */
65 +        unsigned int   rif  : 4;       /* Rate Increment Factor (4-bit) */
66 +        unsigned int   rdf  : 4;       /* Rate Decrease Factor (4-bit) */
67 +        unsigned int nrm_pres  :1;      /* nrm present bit */
68 +        unsigned int trm_pres  :1;             /* rm present bit */
69 +        unsigned int adtf_pres :1;             /* adtf present bit */
70 +        unsigned int cdf_pres  :1;     /* cdf present bit*/
71 +        unsigned int nrm       :3;             /* Max # of Cells for each forward RM cell (3-bit) */
72 +        unsigned int trm       :3;     /* Time between forward RM cells (3-bit) */    
73 +       unsigned int adtf      :10;     /* ACR Decrease Time Factor (10-bit) */
74 +       unsigned int cdf       :3;      /* Cutoff Decrease Factor (3-bit) */
75 +        unsigned int spare     :9;      /* spare bits */ 
76 +};
77 +
78 +struct atm_qos_compat {
79 +       struct atm_trafprm_compat txtp; /* parameters in TX direction */
80 +       struct atm_trafprm_compat rxtp __ATM_API_ALIGN;
81 +                                       /* parameters in RX direction */
82 +       unsigned char aal __ATM_API_ALIGN;
83 +};
84 +
85 +#define SO_ATMQOS_COMPAT __SO_ENCODE(SOL_ATM,2,struct atm_qos_compat)
86 +                           /* Quality of Service setting (no vbr support) */
87  
88  void atmpvc_proto_init(struct net_proto *pro);
89  void atmsvc_proto_init(struct net_proto *pro);
90 Index: linux/net/atm/common.c
91 ===================================================================
92 RCS file: /afs/cmf/project/cvsroot/linux/net/atm/common.c,v
93 retrieving revision 1.13
94 diff -u -r1.13 common.c
95 --- linux/net/atm/common.c      17 Mar 2003 16:13:12 -0000      1.13
96 +++ linux/net/atm/common.c      9 Apr 2003 12:10:28 -0000
97 @@ -1085,6 +1085,43 @@
98  
99         vcc = ATM_SD(sock);
100         switch (optname) {
101 +               case SO_ATMQOS_COMPAT:
102 +                       {
103 +                               struct atm_qos_compat qos_compat;
104 +                               struct atm_qos qos;
105 +
106 +                               if (copy_from_user(&qos_compat,optval,sizeof(qos_compat)))
107 +                                       return -EFAULT;
108 +
109 +                               /* convert old atm_qos to new atm_qos */
110 +                               qos.aal = qos_compat.aal;
111 +                               qos.rxtp.traffic_class = qos_compat.rxtp.traffic_class;
112 +                               qos.rxtp.max_pcr = qos_compat.rxtp.max_pcr;
113 +                               qos.rxtp.pcr = qos_compat.rxtp.pcr;
114 +                               qos.rxtp.min_pcr = qos_compat.rxtp.min_pcr;
115 +                               qos.rxtp.max_cdv = qos_compat.rxtp.max_cdv;
116 +                               qos.rxtp.max_sdu = qos_compat.rxtp.max_sdu;
117 +                               qos.rxtp.scr = 0;
118 +                               qos.rxtp.mbs = 0;
119 +                               qos.txtp.traffic_class = qos_compat.txtp.traffic_class;
120 +                               qos.txtp.max_pcr = qos_compat.txtp.max_pcr;
121 +                               qos.txtp.pcr = qos_compat.txtp.pcr;
122 +                               qos.txtp.min_pcr = qos_compat.txtp.min_pcr;
123 +                               qos.txtp.max_cdv = qos_compat.txtp.max_cdv;
124 +                               qos.txtp.max_sdu = qos_compat.txtp.max_sdu;
125 +                               qos.txtp.scr = 0;
126 +                               qos.txtp.mbs = 0;
127 +
128 +                               error = check_qos(&qos);
129 +                               if (error) return error;
130 +                               if (sock->state == SS_CONNECTED)
131 +                                       return atm_change_qos(vcc,&qos);
132 +                               if (sock->state != SS_UNCONNECTED)
133 +                                       return -EBADFD;
134 +                               vcc->qos = qos;
135 +                               set_bit(ATM_VF_HASQOS,&vcc->flags);
136 +                               return 0;
137 +                       }
138                 case SO_ATMQOS:
139                         {
140                                 struct atm_qos qos;
141 @@ -1132,6 +1169,31 @@
142  
143         vcc = ATM_SD(sock);
144         switch (optname) {
145 +               case SO_ATMQOS_COMPAT:
146 +                       {
147 +                               struct atm_qos_compat qos_compat;
148 +
149 +                               if (!test_bit(ATM_VF_HASQOS,&vcc->flags))
150 +                                       return -EINVAL;
151 +
152 +                               /* convert new atm_qos to old atm_qos */
153 +                               qos_compat.aal = vcc->qos.aal;
154 +                               qos_compat.rxtp.traffic_class = vcc->qos.rxtp.traffic_class;
155 +                               qos_compat.rxtp.max_pcr = vcc->qos.rxtp.max_pcr;
156 +                               qos_compat.rxtp.pcr = vcc->qos.rxtp.pcr;
157 +                               qos_compat.rxtp.min_pcr = vcc->qos.rxtp.min_pcr;
158 +                               qos_compat.rxtp.max_cdv = vcc->qos.rxtp.max_cdv;
159 +                               qos_compat.rxtp.max_sdu = vcc->qos.rxtp.max_sdu;
160 +                               qos_compat.txtp.traffic_class = vcc->qos.txtp.traffic_class;
161 +                               qos_compat.txtp.max_pcr = vcc->qos.txtp.max_pcr;
162 +                               qos_compat.txtp.pcr = vcc->qos.txtp.pcr;
163 +                               qos_compat.txtp.min_pcr = vcc->qos.txtp.min_pcr;
164 +                               qos_compat.txtp.max_cdv = vcc->qos.txtp.max_cdv;
165 +                               qos_compat.txtp.max_sdu = vcc->qos.txtp.max_sdu;
166 +
167 +                               return copy_to_user(optval,&qos_compat,sizeof(qos_compat)) ?
168 +                                   -EFAULT : 0;
169 +                       }
170                 case SO_ATMQOS:
171                         if (!test_bit(ATM_VF_HASQOS,&vcc->flags))
172                                 return -EINVAL;
This page took 0.048436 seconds and 3 git commands to generate.