rfc1201.c (d8101e7bec352b7b6a154ec2e428d01bddb7e5b4) rfc1201.c (d6d7d3ed56e3bfe7fd34108dbe23f0610e3d8621)
1/*
2 * Linux ARCnet driver - RFC1201 (standard) packet encapsulation
3 *
4 * Written 1994-1999 by Avery Pennarun.
5 * Derived from skeleton.c by Donald Becker.
6 *
7 * Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
8 * for sponsoring the further development of this driver.

--- 174 unchanged lines hidden (view full) ---

183 return;
184 }
185 skb_put(skb, length + ARC_HDR_SIZE);
186 skb->dev = dev;
187
188 pkt = (struct archdr *)skb->data;
189 soft = &pkt->soft.rfc1201;
190
1/*
2 * Linux ARCnet driver - RFC1201 (standard) packet encapsulation
3 *
4 * Written 1994-1999 by Avery Pennarun.
5 * Derived from skeleton.c by Donald Becker.
6 *
7 * Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
8 * for sponsoring the further development of this driver.

--- 174 unchanged lines hidden (view full) ---

183 return;
184 }
185 skb_put(skb, length + ARC_HDR_SIZE);
186 skb->dev = dev;
187
188 pkt = (struct archdr *)skb->data;
189 soft = &pkt->soft.rfc1201;
190
191 /* up to sizeof(pkt->soft) has already been copied from the card */
191 /* up to sizeof(pkt->soft) has already
192 * been copied from the card
193 */
192 memcpy(pkt, pkthdr, sizeof(struct archdr));
193 if (length > sizeof(pkt->soft))
194 memcpy(pkt, pkthdr, sizeof(struct archdr));
195 if (length > sizeof(pkt->soft))
194 lp->hw.copy_from_card(dev, bufnum, ofs + sizeof(pkt->soft),
195 pkt->soft.raw + sizeof(pkt->soft),
196 lp->hw.copy_from_card(dev, bufnum,
197 ofs + sizeof(pkt->soft),
198 pkt->soft.raw + sizeof(pkt->soft),
196 length - sizeof(pkt->soft));
197
198 /* ARP packets have problems when sent from some DOS systems:
199 * the source address is always 0!
200 * So we take the hardware source addr (which is impossible
201 * to fumble) and insert it ourselves.
202 */
203 if (soft->proto == ARC_P_ARP) {

--- 109 unchanged lines hidden (view full) ---

313 soft->sequence,
314 lp->rfc1201.aborted_seq);
315 dev->stats.rx_errors++;
316 dev->stats.rx_missed_errors++;
317 }
318 return;
319 }
320 in->lastpacket++;
199 length - sizeof(pkt->soft));
200
201 /* ARP packets have problems when sent from some DOS systems:
202 * the source address is always 0!
203 * So we take the hardware source addr (which is impossible
204 * to fumble) and insert it ourselves.
205 */
206 if (soft->proto == ARC_P_ARP) {

--- 109 unchanged lines hidden (view full) ---

316 soft->sequence,
317 lp->rfc1201.aborted_seq);
318 dev->stats.rx_errors++;
319 dev->stats.rx_missed_errors++;
320 }
321 return;
322 }
323 in->lastpacket++;
321 if (packetnum != in->lastpacket) { /* not the right flag! */
324 /* if not the right flag */
325 if (packetnum != in->lastpacket) {
322 /* harmless duplicate? ignore. */
323 if (packetnum <= in->lastpacket - 1) {
324 arc_printk(D_EXTRA, dev, "duplicate splitpacket ignored! (splitflag=%d)\n",
325 soft->split_flag);
326 dev->stats.rx_errors++;
327 dev->stats.rx_frame_errors++;
328 return;
329 }

--- 142 unchanged lines hidden (view full) ---

472{
473 struct arcnet_local *lp = netdev_priv(dev);
474 const int maxsegsize = XMTU - RFC1201_HDR_SIZE;
475 struct Outgoing *out;
476
477 arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n",
478 lp->next_tx, lp->cur_tx, bufnum);
479
326 /* harmless duplicate? ignore. */
327 if (packetnum <= in->lastpacket - 1) {
328 arc_printk(D_EXTRA, dev, "duplicate splitpacket ignored! (splitflag=%d)\n",
329 soft->split_flag);
330 dev->stats.rx_errors++;
331 dev->stats.rx_frame_errors++;
332 return;
333 }

--- 142 unchanged lines hidden (view full) ---

476{
477 struct arcnet_local *lp = netdev_priv(dev);
478 const int maxsegsize = XMTU - RFC1201_HDR_SIZE;
479 struct Outgoing *out;
480
481 arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n",
482 lp->next_tx, lp->cur_tx, bufnum);
483
480 length -= ARC_HDR_SIZE; /* hard header is not included in packet length */
484 /* hard header is not included in packet length */
485 length -= ARC_HDR_SIZE;
481 pkt->soft.rfc1201.split_flag = 0;
482
483 /* need to do a split packet? */
484 if (length > XMTU) {
485 out = &lp->outgoing;
486
487 out->length = length - RFC1201_HDR_SIZE;
488 out->dataleft = lp->outgoing.length;

--- 53 unchanged lines hidden ---
486 pkt->soft.rfc1201.split_flag = 0;
487
488 /* need to do a split packet? */
489 if (length > XMTU) {
490 out = &lp->outgoing;
491
492 out->length = length - RFC1201_HDR_SIZE;
493 out->dataleft = lp->outgoing.length;

--- 53 unchanged lines hidden ---