Lines Matching +full:queue +full:- +full:pkt +full:- +full:rx
2 * Linux ARCnet driver - device-independent routines
5 * Written 1994-1999 by Avery Pennarun.
6 * Written 1999-2000 by Martin Mares <mj@ucw.cz>.
27 * - Crynwr arcnet.com/arcether.com packet drivers.
28 * - arcnet.c v0.00 dated 1/1/94 and apparently by
29 * Donald Becker - it didn't work :)
30 * - skeleton.c v0.05 dated 11/16/93 by Donald Becker
32 * - RFC's 1201 and 1051 - re: TCP/IP over ARCnet
33 * - The official ARCnet COM9026 data sheets (!) thanks to
35 * - The official ARCnet COM20020 data sheets.
36 * - Information on some more obscure ARCnet controller chips, thanks
38 * - net/inet/eth.c (from kernel 1.1.50) for header-building info.
39 * - Alternate Linux ARCnet source by V.Shergin <vsher@sao.stavropol.su>
40 * - Textual information and more alternate source from Joachim Koenig
66 static int null_prepare_tx(struct net_device *dev, struct archdr *pkt,
92 .rx = null_rx,
152 snprintf(hdr, sizeof(hdr), "%6s:%s skb->data:", dev->name, desc); in arcnet_dump_skb()
154 16, 1, skb->data, skb->len, true); in arcnet_dump_skb()
174 spin_lock_irqsave(&lp->lock, flags); in arcnet_dump_packet()
176 lp->hw.copy_from_card(dev, bufnum, 0, buf, 512); in arcnet_dump_packet()
178 spin_unlock_irqrestore(&lp->lock, flags); in arcnet_dump_packet()
180 /* if the offset[0] byte is nonzero, this is a 256-byte packet */ in arcnet_dump_packet()
184 snprintf(hdr, sizeof(hdr), "%6s:%s packet dump:", dev->name, desc); in arcnet_dump_packet()
202 led_trigger_blink_oneshot(lp->recon_led_trig, 350, 350, 0); in arcnet_led_event()
205 led_trigger_event(lp->tx_led_trig, LED_OFF); in arcnet_led_event()
206 led_trigger_event(lp->recon_led_trig, LED_OFF); in arcnet_led_event()
209 led_trigger_event(lp->tx_led_trig, LED_OFF); in arcnet_led_event()
210 led_trigger_event(lp->recon_led_trig, LED_OFF); in arcnet_led_event()
213 led_trigger_blink_oneshot(lp->tx_led_trig, 50, 50, 0); in arcnet_led_event()
223 led_trigger_unregister_simple(lp->tx_led_trig); in arcnet_led_release()
224 led_trigger_unregister_simple(lp->recon_led_trig); in arcnet_led_release()
242 snprintf(lp->tx_led_trig_name, sizeof(lp->tx_led_trig_name), in devm_arcnet_led_init()
243 "arc%d-%d-tx", index, subid); in devm_arcnet_led_init()
244 snprintf(lp->recon_led_trig_name, sizeof(lp->recon_led_trig_name), in devm_arcnet_led_init()
245 "arc%d-%d-recon", index, subid); in devm_arcnet_led_init()
247 led_trigger_register_simple(lp->tx_led_trig_name, in devm_arcnet_led_init()
248 &lp->tx_led_trig); in devm_arcnet_led_init()
249 led_trigger_register_simple(lp->recon_led_trig_name, in devm_arcnet_led_init()
250 &lp->recon_led_trig); in devm_arcnet_led_init()
252 devres_add(&netdev->dev, res); in devm_arcnet_led_init()
278 /* Add a buffer to the queue. Only the interrupt handler is allowed to do
281 * Note: we don't check for a full queue, since there aren't enough buffers
289 lp->buf_queue[lp->first_free_buf++] = bufnum; in release_arcbuf()
290 lp->first_free_buf %= 5; in release_arcbuf()
293 arc_printk(D_DURING, dev, "release_arcbuf: freed #%d; buffer queue is now: ", in release_arcbuf()
295 for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5) in release_arcbuf()
296 arc_cont(D_DURING, "#%d ", lp->buf_queue[i]); in release_arcbuf()
301 /* Get a buffer from the queue.
302 * If this returns -1, there are no buffers available.
307 int buf = -1, i; in get_arcbuf()
309 if (!atomic_dec_and_test(&lp->buf_lock)) { in get_arcbuf()
312 lp->buf_lock.counter); in get_arcbuf()
314 if (lp->next_buf >= 5) in get_arcbuf()
315 lp->next_buf -= 5; in get_arcbuf()
317 if (lp->next_buf == lp->first_free_buf) { in get_arcbuf()
320 buf = lp->buf_queue[lp->next_buf++]; in get_arcbuf()
321 lp->next_buf %= 5; in get_arcbuf()
326 arc_printk(D_DURING, dev, "get_arcbuf: got #%d; buffer queue is now: ", in get_arcbuf()
328 for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5) in get_arcbuf()
329 arc_cont(D_DURING, "#%d ", lp->buf_queue[i]); in get_arcbuf()
333 atomic_inc(&lp->buf_lock); in get_arcbuf()
344 arc_proto_map[count]->mtu < mtu) { in choose_mtu()
345 mtu = arc_proto_map[count]->mtu; in choose_mtu()
366 dev->type = ARPHRD_ARCNET; in arcdev_setup()
367 dev->netdev_ops = &arcnet_netdev_ops; in arcdev_setup()
368 dev->header_ops = &arcnet_header_ops; in arcdev_setup()
369 dev->hard_header_len = sizeof(struct arc_hardware); in arcdev_setup()
370 dev->mtu = choose_mtu(); in arcdev_setup()
372 dev->addr_len = ARCNET_ALEN; in arcdev_setup()
373 dev->tx_queue_len = 100; in arcdev_setup()
374 dev->broadcast[0] = 0x00; /* for us, broadcasts are address 0 */ in arcdev_setup()
375 dev->watchdog_timeo = TX_TIMEOUT; in arcdev_setup()
377 /* New-style flags. */ in arcdev_setup()
378 dev->flags = IFF_BROADCAST; in arcdev_setup()
384 struct net_device *dev = lp->dev; in arcnet_timer()
386 spin_lock_irq(&lp->lock); in arcnet_timer()
388 if (!lp->reset_in_progress && !netif_carrier_ok(dev)) { in arcnet_timer()
393 spin_unlock_irq(&lp->lock); in arcnet_timer()
402 dev = lp->dev; in reset_device_work()
407 if (!netif_running(dev) || !lp->reset_in_progress) in reset_device_work()
416 if (!netif_running(dev) || !lp->reset_in_progress) in reset_device_work()
436 skb = lp->outgoing.skb; in arcnet_reply_tasklet()
437 if (!skb || !skb->sk) { in arcnet_reply_tasklet()
442 sock_hold(skb->sk); in arcnet_reply_tasklet()
443 sk = skb->sk; in arcnet_reply_tasklet()
445 sock_put(skb->sk); in arcnet_reply_tasklet()
454 serr->ee.ee_errno = ENOMSG; in arcnet_reply_tasklet()
455 serr->ee.ee_origin = SO_EE_ORIGIN_TXSTATUS; in arcnet_reply_tasklet()
456 serr->ee.ee_data = skb_shinfo(skb)->tskey; in arcnet_reply_tasklet()
457 serr->ee.ee_info = lp->reply_status; in arcnet_reply_tasklet()
460 dev_kfree_skb(lp->outgoing.skb); in arcnet_reply_tasklet()
461 lp->outgoing.skb = NULL; in arcnet_reply_tasklet()
463 ackskb->dev = lp->dev; in arcnet_reply_tasklet()
482 lp->dev = dev; in alloc_arcdev()
483 spin_lock_init(&lp->lock); in alloc_arcdev()
484 timer_setup(&lp->timer, arcnet_timer, 0); in alloc_arcdev()
485 INIT_WORK(&lp->reset_work, reset_device_work); in alloc_arcdev()
496 /* Do not cancel this at ->ndo_close(), as the workqueue itself in free_arcdev()
499 cancel_work_sync(&lp->reset_work); in free_arcdev()
509 * non-reboot way to recover if something goes wrong.
518 if (!try_module_get(lp->hw.owner)) in arcnet_open()
519 return -ENODEV; in arcnet_open()
523 arc_proto_default->suffix); in arcnet_open()
525 arc_cont(D_PROTO, "%c", arc_proto_map[count]->suffix); in arcnet_open()
529 tasklet_setup(&lp->reply_tasklet, arcnet_reply_tasklet); in arcnet_open()
533 /* try to put the card in a defined state - if it fails the first in arcnet_open()
536 error = -ENODEV; in arcnet_open()
537 if (lp->hw.reset(dev, 0) && lp->hw.reset(dev, 1)) in arcnet_open()
541 if (newmtu < dev->mtu) in arcnet_open()
542 dev->mtu = newmtu; in arcnet_open()
544 arc_printk(D_INIT, dev, "arcnet_open: mtu: %d.\n", dev->mtu); in arcnet_open()
547 memset(lp->default_proto, 0, sizeof(lp->default_proto)); in arcnet_open()
549 /* the broadcast address is special - use the 'bcast' protocol */ in arcnet_open()
552 lp->default_proto[0] = count; in arcnet_open()
558 atomic_set(&lp->buf_lock, 1); in arcnet_open()
560 lp->next_buf = lp->first_free_buf = 0; in arcnet_open()
565 lp->cur_tx = lp->next_tx = -1; in arcnet_open()
566 lp->cur_rx = -1; in arcnet_open()
568 lp->rfc1201.sequence = 1; in arcnet_open()
571 if (lp->hw.open) in arcnet_open()
572 lp->hw.open(dev); in arcnet_open()
574 if (dev->dev_addr[0] == 0) in arcnet_open()
576 else if (dev->dev_addr[0] == 255) in arcnet_open()
580 if (lp->hw.status(dev) & RESETflag) { in arcnet_open()
583 lp->hw.command(dev, CFLAGScmd | RESETclear); in arcnet_open()
588 lp->hw.intmask(dev, 0); in arcnet_open()
594 lp->intmask = NORXflag | RECONflag; in arcnet_open()
595 lp->hw.intmask(dev, lp->intmask); in arcnet_open()
600 mod_timer(&lp->timer, jiffies + msecs_to_jiffies(1000)); in arcnet_open()
606 module_put(lp->hw.owner); in arcnet_open()
611 /* The inverse routine to arcnet_open - shuts down the card. */
617 del_timer_sync(&lp->timer); in arcnet_close()
622 tasklet_kill(&lp->reply_tasklet); in arcnet_close()
624 /* flush TX and disable RX */ in arcnet_close()
625 lp->hw.intmask(dev, 0); in arcnet_close()
626 lp->hw.command(dev, NOTXcmd); /* stop transmit */ in arcnet_close()
627 lp->hw.command(dev, NORXcmd); /* disable receive */ in arcnet_close()
631 lp->hw.close(dev); in arcnet_close()
634 lp->reset_in_progress = 0; in arcnet_close()
636 module_put(lp->hw.owner); in arcnet_close()
651 saddr ? *(uint8_t *)saddr : -1, in arcnet_header()
652 daddr ? *(uint8_t *)daddr : -1, in arcnet_header()
655 if (skb->len != 0 && len != skb->len) in arcnet_header()
656 arc_printk(D_NORMAL, dev, "arcnet_header: Yikes! skb->len(%d) != len(%d)!\n", in arcnet_header()
657 skb->len, len); in arcnet_header()
659 /* Type is host order - ? */ in arcnet_header()
663 proto->suffix); in arcnet_header()
672 /* XXX: Why not use skb->mac_len? */ in arcnet_header()
673 if (skb->network_header - skb->mac_header != 2) in arcnet_header()
675 skb->network_header - skb->mac_header); in arcnet_header()
676 return -2; /* return error -- can't transmit yet! */ in arcnet_header()
680 proto_num = lp->default_proto[_daddr]; in arcnet_header()
683 proto_num, proto->suffix); in arcnet_header()
686 arc_bcast_proto->suffix); in arcnet_header()
690 return proto->build_header(skb, dev, type, _daddr); in arcnet_header()
698 struct archdr *pkt; in arcnet_send_packet() local
707 lp->hw.status(dev), lp->cur_tx, lp->next_tx, skb->len, skb->protocol); in arcnet_send_packet()
709 pkt = (struct archdr *)skb->data; in arcnet_send_packet()
710 soft = &pkt->soft.rfc1201; in arcnet_send_packet()
711 proto = arc_proto_map[soft->proto]; in arcnet_send_packet()
714 skb->len, pkt->hard.dest); in arcnet_send_packet()
719 if (skb->len - ARC_HDR_SIZE > XMTU && !proto->continue_tx) { in arcnet_send_packet()
728 spin_lock_irqsave(&lp->lock, flags); in arcnet_send_packet()
729 lp->hw.intmask(dev, 0); in arcnet_send_packet()
730 if (lp->next_tx == -1) in arcnet_send_packet()
733 txbuf = -1; in arcnet_send_packet()
735 if (txbuf != -1) { in arcnet_send_packet()
736 lp->outgoing.skb = skb; in arcnet_send_packet()
737 if (proto->prepare_tx(dev, pkt, skb->len, txbuf) && in arcnet_send_packet()
738 !proto->ack_tx) { in arcnet_send_packet()
740 * the package later - forget about it now in arcnet_send_packet()
742 dev->stats.tx_bytes += skb->len; in arcnet_send_packet()
745 lp->outgoing.proto = proto; in arcnet_send_packet()
746 lp->outgoing.skb = skb; in arcnet_send_packet()
747 lp->outgoing.pkt = pkt; in arcnet_send_packet()
749 if (proto->continue_tx && in arcnet_send_packet()
750 proto->continue_tx(dev, txbuf)) { in arcnet_send_packet()
753 proto->suffix); in arcnet_send_packet()
757 lp->next_tx = txbuf; in arcnet_send_packet()
763 __FILE__, __LINE__, __func__, lp->hw.status(dev)); in arcnet_send_packet()
765 lp->hw.intmask(dev, 0); in arcnet_send_packet()
768 lp->intmask |= TXFREEflag | EXCNAKflag; in arcnet_send_packet()
769 lp->hw.intmask(dev, lp->intmask); in arcnet_send_packet()
771 __FILE__, __LINE__, __func__, lp->hw.status(dev)); in arcnet_send_packet()
775 spin_unlock_irqrestore(&lp->lock, flags); in arcnet_send_packet()
788 lp->hw.status(dev), lp->intmask, lp->next_tx, lp->cur_tx); in go_tx()
790 if (lp->cur_tx != -1 || lp->next_tx == -1) in go_tx()
794 arcnet_dump_packet(dev, lp->next_tx, "go_tx", 0); in go_tx()
796 lp->cur_tx = lp->next_tx; in go_tx()
797 lp->next_tx = -1; in go_tx()
800 lp->hw.command(dev, TXcmd | (lp->cur_tx << 3)); in go_tx()
802 dev->stats.tx_packets++; in go_tx()
803 lp->lasttrans_dest = lp->lastload_dest; in go_tx()
804 lp->lastload_dest = 0; in go_tx()
805 lp->excnak_pending = 0; in go_tx()
806 lp->intmask |= TXFREEflag | EXCNAKflag; in go_tx()
816 int status = lp->hw.status(dev); in arcnet_timeout()
819 spin_lock_irqsave(&lp->lock, flags); in arcnet_timeout()
821 msg = " - missed IRQ?"; in arcnet_timeout()
824 dev->stats.tx_aborted_errors++; in arcnet_timeout()
825 lp->timed_out = 1; in arcnet_timeout()
826 lp->hw.command(dev, NOTXcmd | (lp->cur_tx << 3)); in arcnet_timeout()
828 dev->stats.tx_errors++; in arcnet_timeout()
831 lp->hw.intmask(dev, 0); in arcnet_timeout()
832 lp->intmask |= TXFREEflag | EXCNAKflag; in arcnet_timeout()
833 lp->hw.intmask(dev, lp->intmask); in arcnet_timeout()
835 spin_unlock_irqrestore(&lp->lock, flags); in arcnet_timeout()
837 if (time_after(jiffies, lp->last_timeout + 10 * HZ)) { in arcnet_timeout()
839 msg, status, lp->intmask, lp->lasttrans_dest); in arcnet_timeout()
840 lp->last_timeout = jiffies; in arcnet_timeout()
843 if (lp->cur_tx == -1) in arcnet_timeout()
867 spin_lock_irqsave(&lp->lock, flags); in arcnet_interrupt()
869 if (lp->reset_in_progress) in arcnet_interrupt()
872 /* RESET flag was enabled - if device is not running, we must in arcnet_interrupt()
876 if (lp->hw.status(dev) & RESETflag) in arcnet_interrupt()
877 lp->hw.command(dev, CFLAGScmd | RESETclear); in arcnet_interrupt()
878 lp->hw.intmask(dev, 0); in arcnet_interrupt()
879 spin_unlock_irqrestore(&lp->lock, flags); in arcnet_interrupt()
884 lp->hw.status(dev), lp->intmask); in arcnet_interrupt()
888 status = lp->hw.status(dev); in arcnet_interrupt()
895 /* RESET flag was enabled - card is resetting and if RX is in arcnet_interrupt()
905 lp->reset_in_progress = 1; in arcnet_interrupt()
908 schedule_work(&lp->reset_work); in arcnet_interrupt()
913 /* RX is inhibited - we must have received something. in arcnet_interrupt()
921 recbuf = -1; in arcnet_interrupt()
922 if (status & lp->intmask & NORXflag) { in arcnet_interrupt()
923 recbuf = lp->cur_rx; in arcnet_interrupt()
927 lp->cur_rx = get_arcbuf(dev); in arcnet_interrupt()
928 if (lp->cur_rx != -1) { in arcnet_interrupt()
930 lp->cur_rx); in arcnet_interrupt()
931 lp->hw.command(dev, RXcmd | (lp->cur_rx << 3) | RXbcasts); in arcnet_interrupt()
940 lp->hw.command(dev, NOTXcmd); /* disable transmit */ in arcnet_interrupt()
941 lp->excnak_pending = 1; in arcnet_interrupt()
943 lp->hw.command(dev, EXCNAKclear); in arcnet_interrupt()
944 lp->intmask &= ~(EXCNAKflag); in arcnet_interrupt()
949 if ((status & lp->intmask & TXFREEflag) || lp->timed_out) { in arcnet_interrupt()
951 lp->intmask &= ~(TXFREEflag | EXCNAKflag); in arcnet_interrupt()
955 else if (lp->excnak_pending) in arcnet_interrupt()
963 if (lp->cur_tx != -1 && !lp->timed_out) { in arcnet_interrupt()
965 if (lp->lasttrans_dest != 0) { in arcnet_interrupt()
969 lp->lasttrans_dest); in arcnet_interrupt()
970 dev->stats.tx_errors++; in arcnet_interrupt()
971 dev->stats.tx_carrier_errors++; in arcnet_interrupt()
976 lp->lasttrans_dest); in arcnet_interrupt()
980 if (lp->outgoing.proto && in arcnet_interrupt()
981 lp->outgoing.proto->ack_tx) { in arcnet_interrupt()
982 lp->outgoing.proto in arcnet_interrupt()
983 ->ack_tx(dev, ackstatus); in arcnet_interrupt()
985 lp->reply_status = ackstatus; in arcnet_interrupt()
986 tasklet_hi_schedule(&lp->reply_tasklet); in arcnet_interrupt()
988 if (lp->cur_tx != -1) in arcnet_interrupt()
989 release_arcbuf(dev, lp->cur_tx); in arcnet_interrupt()
991 lp->cur_tx = -1; in arcnet_interrupt()
992 lp->timed_out = 0; in arcnet_interrupt()
999 if (lp->outgoing.proto && in arcnet_interrupt()
1000 lp->outgoing.proto->continue_tx) { in arcnet_interrupt()
1003 if (txbuf != -1) { in arcnet_interrupt()
1004 if (lp->outgoing.proto->continue_tx(dev, txbuf)) { in arcnet_interrupt()
1006 dev->stats.tx_bytes += lp->outgoing.skb->len; in arcnet_interrupt()
1007 if (!lp->outgoing.proto->ack_tx) { in arcnet_interrupt()
1008 dev_kfree_skb_irq(lp->outgoing.skb); in arcnet_interrupt()
1009 lp->outgoing.proto = NULL; in arcnet_interrupt()
1012 lp->next_tx = txbuf; in arcnet_interrupt()
1016 if (lp->cur_tx == -1) in arcnet_interrupt()
1020 if (recbuf != -1) { in arcnet_interrupt()
1022 arcnet_dump_packet(dev, recbuf, "rx irq", 0); in arcnet_interrupt()
1029 if (status & lp->intmask & RECONflag) { in arcnet_interrupt()
1030 lp->hw.command(dev, CFLAGScmd | CONFIGclear); in arcnet_interrupt()
1031 dev->stats.tx_carrier_errors++; in arcnet_interrupt()
1039 mod_timer(&lp->timer, jiffies + msecs_to_jiffies(1000)); in arcnet_interrupt()
1047 if (!lp->first_recon || !lp->last_recon || in arcnet_interrupt()
1048 time_after(jiffies, lp->last_recon + HZ * 10)) { in arcnet_interrupt()
1049 if (lp->network_down) in arcnet_interrupt()
1051 lp->first_recon = lp->last_recon = jiffies; in arcnet_interrupt()
1052 lp->num_recons = lp->network_down = 0; in arcnet_interrupt()
1056 lp->last_recon = jiffies; in arcnet_interrupt()
1057 lp->num_recons++; in arcnet_interrupt()
1060 lp->num_recons, in arcnet_interrupt()
1061 (lp->last_recon - lp->first_recon) / HZ, in arcnet_interrupt()
1062 lp->network_down); in arcnet_interrupt()
1070 if (!lp->network_down && in arcnet_interrupt()
1071 (lp->last_recon - lp->first_recon) <= HZ * 60 && in arcnet_interrupt()
1072 lp->num_recons >= RECON_THRESHOLD) { in arcnet_interrupt()
1073 lp->network_down = 1; in arcnet_interrupt()
1075 } else if (!lp->network_down && in arcnet_interrupt()
1076 lp->last_recon - lp->first_recon > HZ * 60) { in arcnet_interrupt()
1080 lp->first_recon = lp->last_recon; in arcnet_interrupt()
1081 lp->num_recons = 1; in arcnet_interrupt()
1084 } else if (lp->network_down && in arcnet_interrupt()
1085 time_after(jiffies, lp->last_recon + HZ * 10)) { in arcnet_interrupt()
1086 if (lp->network_down) in arcnet_interrupt()
1088 lp->first_recon = lp->last_recon = 0; in arcnet_interrupt()
1089 lp->num_recons = lp->network_down = 0; in arcnet_interrupt()
1097 } while (--boguscount && didsomething); in arcnet_interrupt()
1100 lp->hw.status(dev), boguscount); in arcnet_interrupt()
1103 lp->hw.intmask(dev, 0); in arcnet_interrupt()
1105 lp->hw.intmask(dev, lp->intmask); in arcnet_interrupt()
1108 spin_unlock_irqrestore(&lp->lock, flags); in arcnet_interrupt()
1120 struct archdr pkt; in arcnet_rx() member
1126 soft = &rxdata.pkt.soft.rfc1201; in arcnet_rx()
1128 lp->hw.copy_from_card(dev, bufnum, 0, &rxdata.pkt, ARC_HDR_SIZE); in arcnet_rx()
1129 if (rxdata.pkt.hard.offset[0]) { in arcnet_rx()
1130 ofs = rxdata.pkt.hard.offset[0]; in arcnet_rx()
1131 length = 256 - ofs; in arcnet_rx()
1133 ofs = rxdata.pkt.hard.offset[1]; in arcnet_rx()
1134 length = 512 - ofs; in arcnet_rx()
1138 if (sizeof(rxdata.pkt.soft) <= length) { in arcnet_rx()
1139 lp->hw.copy_from_card(dev, bufnum, ofs, soft, sizeof(rxdata.pkt.soft)); in arcnet_rx()
1141 memset(&rxdata.pkt.soft, 0, sizeof(rxdata.pkt.soft)); in arcnet_rx()
1142 lp->hw.copy_from_card(dev, bufnum, ofs, soft, length); in arcnet_rx()
1146 bufnum, rxdata.pkt.hard.source, rxdata.pkt.hard.dest, length); in arcnet_rx()
1148 dev->stats.rx_packets++; in arcnet_rx()
1149 dev->stats.rx_bytes += length + ARC_HDR_SIZE; in arcnet_rx()
1152 if (arc_proto_map[soft->proto]->is_ip) { in arcnet_rx()
1155 *oldp = arc_proto_map[lp->default_proto[rxdata.pkt.hard.source]], in arcnet_rx()
1156 *newp = arc_proto_map[soft->proto]; in arcnet_rx()
1161 soft->proto, rxdata.pkt.hard.source, in arcnet_rx()
1162 newp->suffix, oldp->suffix); in arcnet_rx()
1166 /* broadcasts will always be done with the last-used encap. */ in arcnet_rx()
1167 lp->default_proto[0] = soft->proto; in arcnet_rx()
1170 lp->default_proto[rxdata.pkt.hard.source] = soft->proto; in arcnet_rx()
1172 /* call the protocol-specific receiver. */ in arcnet_rx()
1173 arc_proto_map[soft->proto]->rx(dev, bufnum, &rxdata.pkt, length); in arcnet_rx()
1180 "rx: don't know how to deal with proto %02Xh from host %02Xh.\n", in null_rx()
1181 pkthdr->soft.rfc1201.proto, pkthdr->hard.source); in null_rx()
1191 lp->default_proto[daddr]); in null_build_header()
1198 static int null_prepare_tx(struct net_device *dev, struct archdr *pkt, in null_prepare_tx() argument
1206 /* send a packet to myself -- will never get received, of course */ in null_prepare_tx()
1207 newpkt.source = newpkt.dest = dev->dev_addr[0]; in null_prepare_tx()
1212 lp->hw.copy_to_card(dev, bufnum, 0, &newpkt, ARC_HDR_SIZE); in null_prepare_tx()