]> git.pld-linux.org Git - packages/kernel.git/blob - linux-netdrivers_vlan.patch
- added description of djurban's branch
[packages/kernel.git] / linux-netdrivers_vlan.patch
1 diff -uNr linux.orig/drivers/net/3c501.c linux/drivers/net/3c501.c
2 --- linux.orig/drivers/net/3c501.c      Sun Mar 25 18:31:15 2001
3 +++ linux/drivers/net/3c501.c   Wed Nov 28 12:52:22 2001
4 @@ -105,6 +105,15 @@
5  #include <linux/skbuff.h>
6  #include <linux/init.h>
7  
8 +#ifdef CONFIG_VLAN_802_1Q
9 +#define MAX_FRAME_SIZE (1518 + 4)
10 +#else
11 +#define MAX_FRAME_SIZE 1518
12 +#endif
13 +
14 +#define MAX_ETH_FRAME_SIZE      (MAX_FRAME_SIZE+18)
15 +
16 +
17  /* A zero-terminated list of I/O addresses to be probed.
18     The 3c501 can be at many locations, but here are the popular ones. */
19  static unsigned int netcard_portlist[] __initdata = { 
20 @@ -673,7 +682,7 @@
21         if (el_debug > 4)
22                 printk(" el_receive %d.\n", pkt_len);
23  
24 -       if ((pkt_len < 60)  ||  (pkt_len > 1536))
25 +       if ((pkt_len < 60)  ||  (pkt_len > MAX_ETH_FRAME_SIZE))
26         {
27                 if (el_debug)
28                         printk("%s: bogus packet, length=%d\n", dev->name, pkt_len);
29 diff -uNr linux.orig/drivers/net/3c507.c linux/drivers/net/3c507.c
30 --- linux.orig/drivers/net/3c507.c      Sun Mar 25 18:31:15 2001
31 +++ linux/drivers/net/3c507.c   Wed Nov 28 13:04:04 2001
32 @@ -70,6 +70,12 @@
33  #endif
34  static unsigned int net_debug = NET_DEBUG;
35  
36 +#ifdef CONFIG_VLAN_802_1Q
37 +#define MAX_FRAME_SIZE (1518 + 4)
38 +#else
39 +#define MAX_FRAME_SIZE 1518
40 +#endif
41 +
42  /* A zero-terminated list of common I/O addresses to be probed. */
43  static unsigned int netcard_portlist[] __initdata =
44         { 0x300, 0x320, 0x340, 0x280, 0};
45 @@ -97,7 +103,7 @@
46  #define         RX_SUSPEND      0x0030
47  
48  /* The Rx unit uses a list of frame descriptors and a list of data buffer
49 -   descriptors.  We use full-sized (1518 byte) data buffers, so there is
50 +   descriptors.  We use full-sized (MAX_FRAME_SIZE byte) data buffers, so there is
51     a one-to-one pairing of frame descriptors to buffer descriptors.
52  
53     The Tx ("command") unit executes a list of commands that look like:
54 @@ -195,10 +201,10 @@
55  
56  #define TX_BUF_START   0x0100
57  #define NUM_TX_BUFS    5
58 -#define TX_BUF_SIZE    (1518+14+20+16) /* packet+header+TBD */
59 +#define TX_BUF_SIZE    (MAX_FRAME_SIZE+14+20+16) /* packet+header+TBD */
60  
61  #define RX_BUF_START   0x2000
62 -#define RX_BUF_SIZE    (1518+14+18)    /* packet+header+RBD */
63 +#define RX_BUF_SIZE    (MAX_FRAME_SIZE+14+18)  /* packet+header+RBD */
64  #define RX_BUF_END             (dev->mem_end - dev->mem_start)
65  
66  /*
67 diff -uNr linux.orig/drivers/net/3c509.c linux/drivers/net/3c509.c
68 --- linux.orig/drivers/net/3c509.c      Fri Nov  2 17:39:07 2001
69 +++ linux/drivers/net/3c509.c   Wed Nov 28 13:03:14 2001
70 @@ -44,6 +44,15 @@
71  static char *version = "3c509.c:1.16 (2.2) 2/3/98 becker@cesdis.gsfc.nasa.gov.\n";
72  /* A few values that may be tweaked. */
73  
74 +#ifdef CONFIG_VLAN_802_1Q
75 +#define MAX_FRAME_SIZE (1518 + 4)
76 +#else
77 +#define MAX_FRAME_SIZE 1518
78 +#endif
79 +
80 +#define MAX_ETH_FRAME_SIZE      (MAX_FRAME_SIZE+18)
81 +
82 +
83  /* Time in jiffies before concluding the transmitter is hung. */
84  #define TX_TIMEOUT  (400*HZ/1000)
85  /* Maximum events (Rx packets, etc.) to handle at each interrupt. */
86 @@ -591,11 +600,11 @@
87  #endif
88  
89                 dev->trans_start = jiffies;
90 -               if (inw(ioaddr + TX_FREE) > 1536) {
91 +               if (inw(ioaddr + TX_FREE) > MAX_ETH_FRAME_SIZE) {
92                         dev->tbusy = 0;
93                 } else
94                         /* Interrupt us when the FIFO has room for max-sized packet. */
95 -                       outw(SetTxThreshold + 1536, ioaddr + EL3_CMD);
96 +                       outw(SetTxThreshold + MAX_ETH_FRAME_SIZE, ioaddr + EL3_CMD);
97  #ifdef __SMP__
98                 spin_unlock(&lp->lock);
99                 enable_irq(dev->irq);
100 diff -uNr linux.orig/drivers/net/3c59x.c linux/drivers/net/3c59x.c
101 --- linux.orig/drivers/net/3c59x.c      Sun Mar 25 18:37:34 2001
102 +++ linux/drivers/net/3c59x.c   Wed Nov 28 13:55:01 2001
103 @@ -106,6 +106,15 @@
104  /* Maximum events (Rx packets, etc.) to handle at each interrupt. */
105  static int max_interrupt_work = 20;
106  
107 +#ifdef CONFIG_VLAN_802_1Q
108 +#define MAX_FRAME_SIZE (1518 + 4)
109 +#else
110 +#define MAX_FRAME_SIZE 1518
111 +#endif
112 +
113 +#define MAX_ETH_FRAME_SIZE      (MAX_FRAME_SIZE+18)
114 +
115 +
116  /* Put out somewhat more debugging messages. (0: no msg, 1 minimal .. 6). */
117  #define vortex_debug debug
118  #ifdef VORTEX_DEBUG
119 @@ -125,7 +134,7 @@
120  /* Keep the ring sizes a power of two for efficiency. */
121  #define TX_RING_SIZE   16
122  #define RX_RING_SIZE   32
123 -#define PKT_BUF_SZ             1536                    /* Size of each temporary Rx buffer.*/
124 +#define PKT_BUF_SZ             MAX_ETH_FRAME_SIZE                      /* Size of each temporary Rx buffer.*/
125  
126  #include <linux/config.h>
127  #include <linux/version.h>
128 @@ -1108,7 +1117,11 @@
129         }
130  
131         /* Set the full-duplex bit. */
132 +       #ifdef CONFIG_VLAN_802_1Q
133 +       outb((vp->full_duplex ? 0x20 : 0) | 0x40, ioaddr + Wn3_MAC_Ctrl);
134 +       #else
135         outb((vp->full_duplex ? 0x20 : 0) | (dev->mtu > 1500 ? 0x40 : 0), ioaddr + Wn3_MAC_Ctrl);
136 +       #endif
137  
138         if (vortex_debug > 1) {
139                 printk(KERN_DEBUG "%s: vortex_open() InternalConfig %8.8x.\n", dev->name, config);
140 @@ -1168,7 +1181,7 @@
141         if (vp->full_bus_master_rx) { /* Boomerang bus master. */
142                 vp->cur_rx = vp->dirty_rx = 0;
143                 /* Initialize the RxEarly register as recommended. */
144 -               outw(SetRxThreshold + (1536>>2), ioaddr + EL3_CMD);
145 +               outw(SetRxThreshold + (MAX_ETH_FRAME_SIZE>>2), ioaddr + EL3_CMD);
146                 outl(0x0020, ioaddr + PktStatus);
147                 if (vortex_debug > 2)
148                         printk(KERN_DEBUG "%s:  Filling in the Rx ring.\n", dev->name);
149 @@ -1304,9 +1317,15 @@
150                                                          vp->phys[0], mii_reg5);
151                                           /* Set the full-duplex bit. */
152                                           EL3WINDOW(3);
153 +                                         #ifdef CONFIG_VLAN_802_1Q
154 +                                         outb((vp->full_duplex ? 0x20 : 0) |
155 +                                                   0x40,
156 +                                                   ioaddr + Wn3_MAC_Ctrl);
157 +                                         #else
158                                           outb((vp->full_duplex ? 0x20 : 0) |
159                                                    (dev->mtu > 1500 ? 0x40 : 0),
160                                                    ioaddr + Wn3_MAC_Ctrl);
161 +                                         #endif
162                                   }
163                                   next_tick = 60*HZ;
164                           }
165 @@ -1554,11 +1573,11 @@
166                 outsl(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2);
167  #endif
168                 dev_kfree_skb(skb);
169 -               if (inw(ioaddr + TxFree) > 1536) {
170 +               if (inw(ioaddr + TxFree) > MAX_ETH_FRAME_SIZE) {
171                         clear_bit(0, (void*)&dev->tbusy);
172                 } else
173                         /* Interrupt us when the FIFO has room for max-sized packet. */
174 -                       outw(SetTxThreshold + (1536>>2), ioaddr + EL3_CMD);
175 +                       outw(SetTxThreshold + (MAX_ETH_FRAME_SIZE>>2), ioaddr + EL3_CMD);
176         }
177  
178         dev->trans_start = jiffies;
179 @@ -1696,11 +1715,11 @@
180                         if (inw(ioaddr + Wn7_MasterStatus) & 0x1000) {
181                                 outw(0x1000, ioaddr + Wn7_MasterStatus); /* Ack the event. */
182                                 dev_kfree_skb(vp->tx_skb); /* Release the transfered buffer */
183 -                               if (inw(ioaddr + TxFree) > 1536) {
184 +                               if (inw(ioaddr + TxFree) > MAX_ETH_FRAME_SIZE) {
185                                         clear_bit(0, (void*)&dev->tbusy);
186                                         mark_bh(NET_BH);
187                                 } else /* Interrupt when FIFO has room for max-sized packet. */
188 -                                       outw(SetTxThreshold + (1536>>2), ioaddr + EL3_CMD);
189 +                                       outw(SetTxThreshold + (MAX_ETH_FRAME_SIZE>>2), ioaddr + EL3_CMD);
190                         }
191                 }
192  
193 diff -uNr linux.orig/drivers/net/8139too.c linux/drivers/net/8139too.c
194 --- linux.orig/drivers/net/8139too.c    Fri Nov  2 17:39:07 2001
195 +++ linux/drivers/net/8139too.c Wed Nov 28 13:56:24 2001
196 @@ -348,7 +348,13 @@
197  #define NUM_TX_DESC    4
198  
199  /* max supported ethernet frame size -- must be at least (dev->mtu+14+4).*/
200 -#define MAX_ETH_FRAME_SIZE     1536
201 +#ifdef CONFIG_VLAN_802_1Q
202 +#define MAX_FRAME_SIZE (1518 + 4)
203 +#else
204 +#define MAX_FRAME_SIZE 1518
205 +#endif
206 +
207 +#define MAX_ETH_FRAME_SIZE     (MAX_FRAME_SIZE+18)
208  
209  /* Size of the Tx bounce buffers -- must be at least (dev->mtu+14+4). */
210  #define TX_BUF_SIZE    MAX_ETH_FRAME_SIZE
211 diff -uNr linux.orig/drivers/net/82596.c linux/drivers/net/82596.c
212 --- linux.orig/drivers/net/82596.c      Fri Nov  2 17:39:07 2001
213 +++ linux/drivers/net/82596.c   Wed Nov 28 14:16:59 2001
214 @@ -159,7 +159,14 @@
215   */
216  static int rx_copybreak = 100;
217  
218 -#define PKT_BUF_SZ     1536
219 +#ifdef CONFIG_VLAN_802_1Q
220 +#define MAX_FRAME_SIZE (1518 + 4)
221 +#else
222 +#define MAX_FRAME_SIZE 1518
223 +#endif
224 +
225 +#define MAX_ETH_FRAME_SIZE      (MAX_FRAME_SIZE+18)
226 +#define PKT_BUF_SZ     MAX_ETH_FRAME_SIZE
227  #define MAX_MC_CNT     64
228  
229  #define I596_TOTAL_SIZE 17
230 diff -uNr linux.orig/drivers/net/8390.c linux/drivers/net/8390.c
231 --- linux.orig/drivers/net/8390.c       Sun Mar 25 18:31:15 2001
232 +++ linux/drivers/net/8390.c    Wed Nov 28 12:33:49 2001
233 @@ -74,6 +74,12 @@
234  
235  #define BUG_83C690
236  
237 +#ifdef CONFIG_VLAN_802_1Q
238 +#define MAX_FRAME_SIZE (1518 + 4)
239 +#else
240 +#define MAX_FRAME_SIZE 1518
241 +#endif
242 +
243  /* These are the operational function interfaces to board-specific
244     routines.
245         void reset_8390(struct device *dev)
246 @@ -698,7 +704,7 @@
247                         continue;
248                 }
249  
250 -               if (pkt_len < 60  ||  pkt_len > 1518) 
251 +               if (pkt_len < 60  ||  pkt_len > MAX_FRAME_SIZE) 
252                 {
253                         if (ei_debug)
254                                 printk(KERN_DEBUG "%s: bogus packet size: %d, status=%#2x nxpg=%#2x.\n",
255 diff -uNr linux.orig/drivers/net/eepro100.c linux/drivers/net/eepro100.c
256 --- linux.orig/drivers/net/eepro100.c   Sun Mar 25 18:37:34 2001
257 +++ linux/drivers/net/eepro100.c        Wed Nov 28 13:13:18 2001
258 @@ -46,6 +46,15 @@
259  */
260  
261  /*#define USE_IO*/
262 +#ifdef CONFIG_VLAN_802_1Q
263 +#define MAX_FRAME_SIZE (1518 + 4)
264 +#else
265 +#define MAX_FRAME_SIZE 1518
266 +#endif
267 +
268 +#define MAX_ETH_FRAME_SIZE      (MAX_FRAME_SIZE+18)
269 +
270 +
271  static const char *version =
272  "eepro100.c:v1.09j-t 9/29/99 Donald Becker http://cesdis.gsfc.nasa.gov/linux/drivers/eepro100.html\n"
273  "eepro100.c: $Revision$ 2000/05/31 Modified by Andrey V. Savochkin <saw@saw.sw.com.sg> and others\n"
274 @@ -65,7 +74,7 @@
275     Lower values use more memory, but are faster. */
276  #if defined(__alpha__) || defined(__sparc__)
277  /* force copying of all packets to avoid unaligned accesses on Alpha */
278 -static int rx_copybreak = 1518;
279 +static int rx_copybreak = MAX_FRAME_SIZE;
280  #else
281  static int rx_copybreak = 200;
282  #endif
283 @@ -103,7 +112,7 @@
284  /* Time in jiffies before concluding the transmitter is hung. */
285  #define TX_TIMEOUT             (2*HZ)
286  /* Size of an pre-allocated Rx buffer: <Ethernet MTU> + slack.*/
287 -#define PKT_BUF_SZ             1536
288 +#define PKT_BUF_SZ             MAX_ETH_FRAME_SIZE
289  
290  #if !defined(__OPTIMIZE__)  ||  !defined(__KERNEL__)
291  #warning  You must compile this file with the correct options!
292 @@ -549,12 +558,12 @@
293  const char i82557_config_cmd[22] = {
294         22, 0x08, 0, 0,  0, 0, 0x32, 0x03,  1, /* 1=Use MII  0=Use AUI */
295         0, 0x2E, 0,  0x60, 0,
296 -       0xf2, 0x48,   0, 0x40, 0xf2, 0x80,              /* 0x40=Force full-duplex */
297 +       0xf2, 0x48,   0, 0x40, 0xfa, 0x80,              /* 0x40=Force full-duplex */
298         0x3f, 0x05, };
299  const char i82558_config_cmd[22] = {
300         22, 0x08, 0, 1,  0, 0, 0x22, 0x03,  1, /* 1=Use MII  0=Use AUI */
301         0, 0x2E, 0,  0x60, 0x08, 0x88,
302 -       0x68, 0, 0x40, 0xf2, 0x84,              /* Disable FC */
303 +       0x68, 0, 0x40, 0xfa, 0x84,              /* Disable FC */
304         0x31, 0x05, };
305  
306  /* PHY media interface chips. */
307 diff -uNr linux.orig/drivers/net/epic100.c linux/drivers/net/epic100.c
308 --- linux.orig/drivers/net/epic100.c    Sun Mar 25 18:31:20 2001
309 +++ linux/drivers/net/epic100.c Wed Nov 28 14:12:44 2001
310 @@ -48,7 +48,15 @@
311  /* Time in jiffies before concluding the transmitter is hung. */
312  #define TX_TIMEOUT  (2*HZ)
313  
314 -#define PKT_BUF_SZ             1536                    /* Size of each temporary Rx buffer.*/
315 +#ifdef CONFIG_VLAN_802_1Q
316 +#define MAX_FRAME_SIZE (1518 + 4)
317 +#else
318 +#define MAX_FRAME_SIZE 1518
319 +#endif
320 +
321 +#define MAX_ETH_FRAME_SIZE      (MAX_FRAME_SIZE+18)
322 +
323 +#define PKT_BUF_SZ             MAX_ETH_FRAME_SIZE                      /* Size of each temporary Rx buffer.*/
324  
325  /* Bytes transferred to chip before transmission starts. */
326  /* Initial threshold, increased on underflow, rounded down to 4 byte units. */
327 diff -uNr linux.orig/drivers/net/hamachi.c linux/drivers/net/hamachi.c
328 --- linux.orig/drivers/net/hamachi.c    Sun Mar 25 18:31:22 2001
329 +++ linux/drivers/net/hamachi.c Wed Nov 28 14:25:46 2001
330 @@ -446,19 +446,25 @@
331  -fix the reset procedure.  It doesn't quite work.  
332  */
333  
334 +/* For now, this is going to be set to the maximum size of an ethernet
335 + * packet.  Eventually, we may want to make it a variable that is
336 + * related to the MTU
337 + */
338 +#ifdef CONFIG_VLAN_802_1Q
339 +#define MAX_FRAME_SIZE (1518 + 4)
340 +#else
341 +#define MAX_FRAME_SIZE 1518
342 +#endif
343 +
344 +#define MAX_ETH_FRAME_SIZE      (MAX_FRAME_SIZE+18)
345 +
346  /* A few values that may be tweaked. */
347  /* Size of each temporary Rx buffer, calculated as:
348   * 1518 bytes (ethernet packet) + 2 bytes (to get 8 byte alignment for
349   * the card) + 8 bytes of status info + 8 bytes for the Rx Checksum +
350   * 2 more because we use skb_reserve.  
351   */
352 -#define PKT_BUF_SZ             1538
353 -
354 -/* For now, this is going to be set to the maximum size of an ethernet
355 - * packet.  Eventually, we may want to make it a variable that is
356 - * related to the MTU
357 - */
358 -#define MAX_FRAME_SIZE  1518
359 +#define PKT_BUF_SZ             (MAX_ETH_FRAME_SIZE+2)
360  
361  /* The rest of these values should never change. */
362  
363 diff -uNr linux.orig/drivers/net/old_tulip.c linux/drivers/net/old_tulip.c
364 --- linux.orig/drivers/net/old_tulip.c  Sun Mar 25 18:31:22 2001
365 +++ linux/drivers/net/old_tulip.c       Wed Nov 28 12:50:30 2001
366 @@ -53,9 +53,15 @@
367  #define TX_RING_SIZE   16
368  #define RX_RING_SIZE   32
369  
370 +#ifdef CONFIG_VLAN_802_1Q
371 +#define MAX_FRAME_SIZE (1518 + 4)
372 +#else
373 +#define MAX_FRAME_SIZE 1518
374 +#endif
375 +
376  /* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */
377  #ifdef __alpha__
378 -static int rx_copybreak = 1518;
379 +static int rx_copybreak = MAX_FRAME_SIZE;
380  #else
381  static int rx_copybreak = 100;
382  #endif
383 @@ -221,7 +227,7 @@
384  
385  
386  /* A few values that may be tweaked. */
387 -#define PKT_BUF_SZ             1536                    /* Size of each temporary Rx buffer.*/
388 +#define PKT_BUF_SZ             (MAX_FRAME_SIZE+18)                     /* Size of each temporary Rx buffer.*/
389  
390  /* This is a mysterious value that can be written to CSR11 in the 21040 (only)
391     to support a pre-NWay full-duplex signaling mechanism using short frames.
392 diff -uNr linux.orig/drivers/net/rtl8139.c linux/drivers/net/rtl8139.c
393 --- linux.orig/drivers/net/rtl8139.c    Fri Nov  2 17:39:07 2001
394 +++ linux/drivers/net/rtl8139.c Wed Nov 28 12:44:42 2001
395 @@ -37,11 +37,17 @@
396  static int options[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
397  static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
398  
399 +#ifdef CONFIG_VLAN_802_1Q
400 +#define MAX_FRAME_SIZE (1518 + 4)
401 +#else
402 +#define MAX_FRAME_SIZE 1518
403 +#endif
404 +
405  /* Size of the in-memory receive ring. */
406  #define RX_BUF_LEN_IDX 3                       /* 0==8K, 1==16K, 2==32K, 3==64K */
407  #define RX_BUF_LEN (8192 << RX_BUF_LEN_IDX)
408  /* Size of the Tx bounce buffers -- must be at least (dev->mtu+14+4). */
409 -#define TX_BUF_SIZE    1536
410 +#define TX_BUF_SIZE    (MAX_FRAME_SIZE+18)
411  
412  /* PCI Tuning Parameters
413     Threshold is bytes transferred to chip before transmission starts. */
414 diff -uNr linux.orig/drivers/net/sis900.c linux/drivers/net/sis900.c
415 --- linux.orig/drivers/net/sis900.c     Fri Nov  2 17:39:07 2001
416 +++ linux/drivers/net/sis900.c  Wed Nov 28 13:49:28 2001
417 @@ -1058,6 +1058,10 @@
418                 rx_flags |= RxATX;
419         }
420  
421 +       #ifdef CONFIG_VLAN_802_1Q
422 +       rx_flags |= RxAJAB;
423 +       #endif
424 +
425         outl (tx_flags, ioaddr + txcfg);
426         outl (rx_flags, ioaddr + rxcfg);
427  }
428 @@ -1286,15 +1290,24 @@
429  
430         while (rx_status & OWN) {
431                 unsigned int rx_size;
432 +               unsigned int data_size;
433 +
434 +               data_size = rx_status & DSIZE;
435 +               rx_size = data_size - CRC_SIZE;
436  
437 -               rx_size = (rx_status & DSIZE) - CRC_SIZE;
438 +               #ifdef CONFIG_VLAN_802_1Q
439 +               /* ``TOOLONG'' flag means jumbo packet recived. */
440 +               if(rx_status & TOOLONG)
441 +                 if(data_size <= MAX_FRAME_SIZE)
442 +                   rx_status &= (~ ((unsigned int)TOOLONG));
443 +               #endif
444  
445                 if (rx_status & (ABORT|OVERRUN|TOOLONG|RUNT|RXISERR|CRCERR|FAERR)) {
446                         /* corrupted packet received */
447                         if (sis900_debug > 3)
448                                 printk(KERN_INFO "%s: Corrupted packet "
449 -                                      "received, buffer status = 0x%8.8x.\n",
450 -                                      net_dev->name, rx_status);
451 +                                      "received, buffer status = 0x%8.8x/%d.\n",
452 +                                      net_dev->name, rx_status, data_size);
453                         sis_priv->stats.rx_errors++;
454                         if (rx_status & OVERRUN)
455                                 sis_priv->stats.rx_over_errors++;
456 diff -uNr linux.orig/drivers/net/sis900.h linux/drivers/net/sis900.h
457 --- linux.orig/drivers/net/sis900.h     Fri Nov  2 17:39:07 2001
458 +++ linux/drivers/net/sis900.h  Wed Nov 28 13:41:36 2001
459 @@ -258,8 +258,16 @@
460  #define CRC_SIZE                4
461  #define MAC_HEADER_SIZE         14
462  
463 -#define TX_BUF_SIZE     1536
464 -#define RX_BUF_SIZE     1536
465 +#ifdef CONFIG_VLAN_802_1Q
466 +#define MAX_FRAME_SIZE (1518 + 4)
467 +#else
468 +#define MAX_FRAME_SIZE 1518
469 +#endif
470 +
471 +#define MAX_ETH_FRAME_SIZE      (MAX_FRAME_SIZE+18)
472 +
473 +#define TX_BUF_SIZE     MAX_ETH_FRAME_SIZE
474 +#define RX_BUF_SIZE     MAX_ETH_FRAME_SIZE
475  
476  #define NUM_TX_DESC     16             /* Number of Tx descriptor registers. */
477  #define NUM_RX_DESC     16             /* Number of Rx descriptor registers. */
478 diff -uNr linux.orig/drivers/net/starfire.c linux/drivers/net/starfire.c
479 --- linux.orig/drivers/net/starfire.c   Fri Nov  2 17:39:07 2001
480 +++ linux/drivers/net/starfire.c        Wed Nov 28 14:15:16 2001
481 @@ -157,7 +157,14 @@
482     The Starfire has a 512 element hash table based on the Ethernet CRC. */
483  static int multicast_filter_limit = 512;
484  
485 -#define PKT_BUF_SZ     1536            /* Size of each temporary Rx buffer.*/
486 +#ifdef CONFIG_VLAN_802_1Q
487 +#define MAX_FRAME_SIZE (1518 + 4)
488 +#else
489 +#define MAX_FRAME_SIZE 1518
490 +#endif
491 +
492 +#define MAX_ETH_FRAME_SIZE      (MAX_FRAME_SIZE+18)
493 +#define PKT_BUF_SZ     MAX_ETH_FRAME_SIZE              /* Size of each temporary Rx buffer.*/
494  /*
495   * Set the copy breakpoint for the copy-only-tiny-frames scheme.
496   * Setting to > 1518 effectively disables this feature.
497 diff -uNr linux.orig/drivers/net/sunlance.c linux/drivers/net/sunlance.c
498 --- linux.orig/drivers/net/sunlance.c   Sun Mar 25 18:31:17 2001
499 +++ linux/drivers/net/sunlance.c        Wed Nov 28 14:08:33 2001
500 @@ -634,7 +634,9 @@
501         }
502  
503         if (csr0 & LE_C0_BABL)
504 +       #ifndef CONFIG_VLAN_802_1Q
505                 lp->stats.tx_errors++;
506 +       #endif
507  
508         if (csr0 & LE_C0_MISS)
509                 lp->stats.rx_errors++;
510 diff -uNr linux.orig/drivers/net/tulip.c linux/drivers/net/tulip.c
511 --- linux.orig/drivers/net/tulip.c      Fri Nov  2 17:39:07 2001
512 +++ linux/drivers/net/tulip.c   Wed Nov 28 13:18:02 2001
513 @@ -51,6 +51,12 @@
514  static int reverse_probe = 0;
515  #endif
516  
517 +#ifdef CONFIG_VLAN_802_1Q
518 +#define MAX_FRAME_SIZE (1518 + 4)
519 +#else
520 +#define MAX_FRAME_SIZE 1518
521 +#endif
522 +
523  /* Keep the ring sizes a power of two for efficiency.
524     Making the Tx ring too large decreases the effectiveness of channel
525     bonding and packet priority.
526 @@ -60,7 +66,7 @@
527  
528  /* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */
529  #ifdef __alpha__
530 -static int rx_copybreak = 1518;
531 +static int rx_copybreak = MAX_FRAME_SIZE;
532  #else
533  static int rx_copybreak = 100;
534  #endif
535 @@ -90,7 +96,7 @@
536  /* Operational parameters that usually are not changed. */
537  /* Time in jiffies before concluding the transmitter is hung. */
538  #define TX_TIMEOUT  (4*HZ)
539 -#define PKT_BUF_SZ             1536                    /* Size of each temporary Rx buffer.*/
540 +#define PKT_BUF_SZ             (MAX_FRAME_SIZE+18)                     /* Size of each temporary Rx buffer.*/
541  /* This is a mysterious value that can be written to CSR11 in the 21040 (only)
542     to support a pre-NWay full-duplex signaling mechanism using short frames.
543     No one knows what it should be, but if left at its default value some
544 @@ -458,7 +464,7 @@
545  };
546  
547  enum desc_status_bits {
548 -       DescOwned=0x80000000, RxDescFatalErr=0x8000, RxWholePkt=0x0300,
549 +       DescOwned=0x80000000, RxDescFatalErr=0x4842, RxWholePkt=0x0300,
550  };
551  
552  /* Ring-wrap flag in length field, use for last ring entry.
553 @@ -2851,8 +2857,8 @@
554                                    dev->name, entry, status);
555                 if (--rx_work_limit < 0)
556                         break;
557 -               if ((status & 0x38008300) != 0x0300) {
558 -                       if ((status & 0x38000300) != 0x0300) {
559 +               if ((status & (0x38000000 | RxDescFatalErr | RxWholePkt)) != RxWholePkt) {
560 +                       if ((status & (0x38000000 | RxWholePkt)) != RxWholePkt) {
561                                 /* Ingore earlier buffers. */
562                                 if ((status & 0xffff) != 0x7fff) {
563                                         if (tulip_debug > 1)
564 @@ -2878,10 +2884,10 @@
565                         struct sk_buff *skb;
566  
567  #ifndef final_version
568 -                       if (pkt_len > 1518) {
569 +                       if (pkt_len > MAX_FRAME_SIZE) {
570                                 printk(KERN_WARNING "%s: Bogus packet size of %d (%#x).\n",
571                                            dev->name, pkt_len, pkt_len);
572 -                               pkt_len = 1518;
573 +                               pkt_len = MAX_FRAME_SIZE;
574                                 tp->stats.rx_length_errors++;
575                         }
576  #endif
577 diff -uNr linux.orig/drivers/net/via-rhine.c linux/drivers/net/via-rhine.c
578 --- linux.orig/drivers/net/via-rhine.c  Fri Nov  2 17:39:07 2001
579 +++ linux/drivers/net/via-rhine.c       Wed Nov 28 14:03:02 2001
580 @@ -76,7 +76,15 @@
581  /* Time in jiffies before concluding the transmitter is hung. */
582  #define TX_TIMEOUT  (2*HZ)
583  
584 -#define PKT_BUF_SZ             1536                    /* Size of each temporary Rx buffer.*/
585 +#ifdef CONFIG_VLAN_802_1Q
586 +#define MAX_FRAME_SIZE (1518 + 4)
587 +#else
588 +#define MAX_FRAME_SIZE 1518
589 +#endif
590 +
591 +#define MAX_ETH_FRAME_SIZE      (MAX_FRAME_SIZE+18)
592 +
593 +#define PKT_BUF_SZ             MAX_ETH_FRAME_SIZE                      /* Size of each temporary Rx buffer.*/
594  
595  
596  #if !defined(__OPTIMIZE__)
597 @@ -639,7 +647,11 @@
598         np->cur_rx = 0;
599         np->dirty_rx = 0;
600  
601 +       #ifdef CONFIG_VLAN_802_1Q
602 +       np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 36);
603 +       #else
604         np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32);
605 +       #endif
606         np->rx_head_desc = &np->rx_ring[0];
607  
608         for (i = 0; i < RX_RING_SIZE; i++) {
This page took 0.076855 seconds and 3 git commands to generate.