1 the minimum frame size for token ring (802.5) pdus is 16 octets. also,
2 count the pdus that failed to copy as dropped. also, skb_copy_expand()
3 now seems to be the right way to do this.
5 Index: linux/net/atm/lec.c
6 ===================================================================
7 RCS file: /home/chas/CVSROOT/linux/net/atm/lec.c,v
8 retrieving revision 1.5
9 retrieving revision 1.6
10 diff -u -d -b -w -r1.5 -r1.6
11 --- linux/net/atm/lec.c 22 Feb 2003 19:23:22 -0000 1.5
12 +++ linux/net/atm/lec.c 24 Feb 2003 13:24:45 -0000 1.6
14 struct lecdatahdr_8023 *lec_h;
15 struct atm_vcc *send_vcc;
16 struct lec_arp_table *entry;
17 - unsigned char *nb, *dst;
21 unsigned char rdesc[ETH_ALEN]; /* Token Ring route descriptor */
24 #endif /* DUMP_PACKETS > 0 */
26 /* Minimum ethernet-frame size */
28 - if (skb->truesize < 62) {
29 - printk("%s:data packet %d / %d\n",
31 - skb->len,skb->truesize);
32 - nb=(unsigned char*)kmalloc(64, GFP_ATOMIC);
36 + min_frame_size = LEC_MINIMUM_8025_SIZE;
39 + min_frame_size = LEC_MINIMUM_8023_SIZE;
40 + if (skb->len < min_frame_size) {
41 + if (skb->truesize < min_frame_size) {
42 + skb2 = skb_copy_expand(skb, 0,
43 + min_frame_size - skb->truesize, GFP_ATOMIC);
46 + priv->stats.tx_dropped++;
49 - memcpy(nb,skb->data,skb->len);
51 - skb->head = skb->data = nb;
60 + skb_put(skb, min_frame_size - skb->len);
63 /* Send to right vcc */
64 Index: linux/net/atm/lec.h
65 ===================================================================
66 RCS file: /home/chas/CVSROOT/linux/net/atm/lec.h,v
67 retrieving revision 1.2
68 retrieving revision 1.3
69 diff -u -d -b -w -r1.2 -r1.3
70 --- linux/net/atm/lec.h 22 Feb 2003 19:29:27 -0000 1.2
71 +++ linux/net/atm/lec.h 24 Feb 2003 13:24:46 -0000 1.3
73 unsigned char h_source[ETH_ALEN];
76 +#define LEC_MINIMUM_8023_SIZE 62
77 +#define LEC_MINIMUM_8025_SIZE 16
80 * Operations that LANE2 capable device can do. Two first functions
81 * are used to make the device do things. See spec 3.1.3 and 3.1.4.
83 To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
84 the body of a message to majordomo@vger.kernel.org
85 More majordomo info at http://vger.kernel.org/majordomo-info.html
86 Please read the FAQ at http://www.tux.org/lkml/