Lines Matching +full:queue +full:- +full:pkt +full:- +full:tx
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
67 static int null_prepare_tx(struct net_device *dev, struct archdr *pkt,
154 snprintf(hdr, sizeof(hdr), "%6s:%s skb->data:", dev->name, desc); in arcnet_dump_skb()
156 16, 1, skb->data, skb->len, true); in arcnet_dump_skb()
176 spin_lock_irqsave(&lp->lock, flags); in arcnet_dump_packet()
178 lp->hw.copy_from_card(dev, bufnum, 0, buf, 512); in arcnet_dump_packet()
180 spin_unlock_irqrestore(&lp->lock, flags); in arcnet_dump_packet()
182 /* if the offset[0] byte is nonzero, this is a 256-byte packet */ in arcnet_dump_packet()
186 snprintf(hdr, sizeof(hdr), "%6s:%s packet dump:", dev->name, desc); in arcnet_dump_packet()
204 led_trigger_blink_oneshot(lp->recon_led_trig, 350, 350, 0); in arcnet_led_event()
207 led_trigger_event(lp->tx_led_trig, LED_OFF); in arcnet_led_event()
208 led_trigger_event(lp->recon_led_trig, LED_OFF); in arcnet_led_event()
211 led_trigger_event(lp->tx_led_trig, LED_OFF); in arcnet_led_event()
212 led_trigger_event(lp->recon_led_trig, LED_OFF); in arcnet_led_event()
215 led_trigger_blink_oneshot(lp->tx_led_trig, 50, 50, 0); in arcnet_led_event()
225 led_trigger_unregister_simple(lp->tx_led_trig); in arcnet_led_release()
226 led_trigger_unregister_simple(lp->recon_led_trig); in arcnet_led_release()
244 snprintf(lp->tx_led_trig_name, sizeof(lp->tx_led_trig_name), in devm_arcnet_led_init()
245 "arc%d-%d-tx", index, subid); in devm_arcnet_led_init()
246 snprintf(lp->recon_led_trig_name, sizeof(lp->recon_led_trig_name), in devm_arcnet_led_init()
247 "arc%d-%d-recon", index, subid); in devm_arcnet_led_init()
249 led_trigger_register_simple(lp->tx_led_trig_name, in devm_arcnet_led_init()
250 &lp->tx_led_trig); in devm_arcnet_led_init()
251 led_trigger_register_simple(lp->recon_led_trig_name, in devm_arcnet_led_init()
252 &lp->recon_led_trig); in devm_arcnet_led_init()
254 devres_add(&netdev->dev, res); in devm_arcnet_led_init()
280 /* Add a buffer to the queue. Only the interrupt handler is allowed to do
283 * Note: we don't check for a full queue, since there aren't enough buffers
291 lp->buf_queue[lp->first_free_buf++] = bufnum; in release_arcbuf()
292 lp->first_free_buf %= 5; in release_arcbuf()
295 arc_printk(D_DURING, dev, "release_arcbuf: freed #%d; buffer queue is now: ", in release_arcbuf()
297 for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5) in release_arcbuf()
298 arc_cont(D_DURING, "#%d ", lp->buf_queue[i]); in release_arcbuf()
303 /* Get a buffer from the queue.
304 * If this returns -1, there are no buffers available.
309 int buf = -1, i; in get_arcbuf()
311 if (!atomic_dec_and_test(&lp->buf_lock)) { in get_arcbuf()
314 lp->buf_lock.counter); in get_arcbuf()
316 if (lp->next_buf >= 5) in get_arcbuf()
317 lp->next_buf -= 5; in get_arcbuf()
319 if (lp->next_buf == lp->first_free_buf) { in get_arcbuf()
322 buf = lp->buf_queue[lp->next_buf++]; in get_arcbuf()
323 lp->next_buf %= 5; in get_arcbuf()
328 arc_printk(D_DURING, dev, "get_arcbuf: got #%d; buffer queue is now: ", in get_arcbuf()
330 for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5) in get_arcbuf()
331 arc_cont(D_DURING, "#%d ", lp->buf_queue[i]); in get_arcbuf()
335 atomic_inc(&lp->buf_lock); in get_arcbuf()
346 arc_proto_map[count]->mtu < mtu) { in choose_mtu()
347 mtu = arc_proto_map[count]->mtu; in choose_mtu()
368 dev->type = ARPHRD_ARCNET; in arcdev_setup()
369 dev->netdev_ops = &arcnet_netdev_ops; in arcdev_setup()
370 dev->header_ops = &arcnet_header_ops; in arcdev_setup()
371 dev->hard_header_len = sizeof(struct arc_hardware); in arcdev_setup()
372 dev->mtu = choose_mtu(); in arcdev_setup()
374 dev->addr_len = ARCNET_ALEN; in arcdev_setup()
375 dev->tx_queue_len = 100; in arcdev_setup()
376 dev->broadcast[0] = 0x00; /* for us, broadcasts are address 0 */ in arcdev_setup()
377 dev->watchdog_timeo = TX_TIMEOUT; in arcdev_setup()
379 /* New-style flags. */ in arcdev_setup()
380 dev->flags = IFF_BROADCAST; in arcdev_setup()
386 struct net_device *dev = lp->dev; in arcnet_timer()
388 spin_lock_irq(&lp->lock); in arcnet_timer()
390 if (!lp->reset_in_progress && !netif_carrier_ok(dev)) { in arcnet_timer()
395 spin_unlock_irq(&lp->lock); in arcnet_timer()
404 dev = lp->dev; in reset_device_work()
409 if (!netif_running(dev) || !lp->reset_in_progress) in reset_device_work()
418 if (!netif_running(dev) || !lp->reset_in_progress) in reset_device_work()
438 skb = lp->outgoing.skb; in arcnet_reply_work()
439 if (!skb || !skb->sk) { in arcnet_reply_work()
444 sock_hold(skb->sk); in arcnet_reply_work()
445 sk = skb->sk; in arcnet_reply_work()
447 sock_put(skb->sk); in arcnet_reply_work()
456 serr->ee.ee_errno = ENOMSG; in arcnet_reply_work()
457 serr->ee.ee_origin = SO_EE_ORIGIN_TXSTATUS; in arcnet_reply_work()
458 serr->ee.ee_data = skb_shinfo(skb)->tskey; in arcnet_reply_work()
459 serr->ee.ee_info = lp->reply_status; in arcnet_reply_work()
462 dev_kfree_skb(lp->outgoing.skb); in arcnet_reply_work()
463 lp->outgoing.skb = NULL; in arcnet_reply_work()
465 ackskb->dev = lp->dev; in arcnet_reply_work()
484 lp->dev = dev; in alloc_arcdev()
485 spin_lock_init(&lp->lock); in alloc_arcdev()
486 timer_setup(&lp->timer, arcnet_timer, 0); in alloc_arcdev()
487 INIT_WORK(&lp->reset_work, reset_device_work); in alloc_arcdev()
498 /* Do not cancel this at ->ndo_close(), as the workqueue itself in free_arcdev()
501 cancel_work_sync(&lp->reset_work); in free_arcdev()
511 * non-reboot way to recover if something goes wrong.
520 if (!try_module_get(lp->hw.owner)) in arcnet_open()
521 return -ENODEV; in arcnet_open()
525 arc_proto_default->suffix); in arcnet_open()
527 arc_cont(D_PROTO, "%c", arc_proto_map[count]->suffix); in arcnet_open()
531 INIT_WORK(&lp->reply_work, arcnet_reply_work); in arcnet_open()
535 /* try to put the card in a defined state - if it fails the first in arcnet_open()
538 error = -ENODEV; in arcnet_open()
539 if (lp->hw.reset(dev, 0) && lp->hw.reset(dev, 1)) in arcnet_open()
543 if (newmtu < dev->mtu) in arcnet_open()
544 dev->mtu = newmtu; in arcnet_open()
546 arc_printk(D_INIT, dev, "arcnet_open: mtu: %d.\n", dev->mtu); in arcnet_open()
549 memset(lp->default_proto, 0, sizeof(lp->default_proto)); in arcnet_open()
551 /* the broadcast address is special - use the 'bcast' protocol */ in arcnet_open()
554 lp->default_proto[0] = count; in arcnet_open()
560 atomic_set(&lp->buf_lock, 1); in arcnet_open()
562 lp->next_buf = lp->first_free_buf = 0; in arcnet_open()
567 lp->cur_tx = lp->next_tx = -1; in arcnet_open()
568 lp->cur_rx = -1; in arcnet_open()
570 lp->rfc1201.sequence = 1; in arcnet_open()
573 if (lp->hw.open) in arcnet_open()
574 lp->hw.open(dev); in arcnet_open()
576 if (dev->dev_addr[0] == 0) in arcnet_open()
578 else if (dev->dev_addr[0] == 255) in arcnet_open()
582 if (lp->hw.status(dev) & RESETflag) { in arcnet_open()
585 lp->hw.command(dev, CFLAGScmd | RESETclear); in arcnet_open()
590 lp->hw.intmask(dev, 0); in arcnet_open()
596 lp->intmask = NORXflag | RECONflag; in arcnet_open()
597 lp->hw.intmask(dev, lp->intmask); in arcnet_open()
602 mod_timer(&lp->timer, jiffies + msecs_to_jiffies(1000)); in arcnet_open()
608 module_put(lp->hw.owner); in arcnet_open()
613 /* The inverse routine to arcnet_open - shuts down the card. */
619 del_timer_sync(&lp->timer); in arcnet_close()
624 cancel_work_sync(&lp->reply_work); in arcnet_close()
626 /* flush TX and disable RX */ in arcnet_close()
627 lp->hw.intmask(dev, 0); in arcnet_close()
628 lp->hw.command(dev, NOTXcmd); /* stop transmit */ in arcnet_close()
629 lp->hw.command(dev, NORXcmd); /* disable receive */ in arcnet_close()
633 lp->hw.close(dev); in arcnet_close()
636 lp->reset_in_progress = 0; in arcnet_close()
638 module_put(lp->hw.owner); in arcnet_close()
653 saddr ? *(uint8_t *)saddr : -1, in arcnet_header()
654 daddr ? *(uint8_t *)daddr : -1, in arcnet_header()
657 if (skb->len != 0 && len != skb->len) in arcnet_header()
658 arc_printk(D_NORMAL, dev, "arcnet_header: Yikes! skb->len(%d) != len(%d)!\n", in arcnet_header()
659 skb->len, len); in arcnet_header()
661 /* Type is host order - ? */ in arcnet_header()
665 proto->suffix); in arcnet_header()
674 /* XXX: Why not use skb->mac_len? */ in arcnet_header()
675 if (skb->network_header - skb->mac_header != 2) in arcnet_header()
677 skb->network_header - skb->mac_header); in arcnet_header()
678 return -2; /* return error -- can't transmit yet! */ in arcnet_header()
682 proto_num = lp->default_proto[_daddr]; in arcnet_header()
685 proto_num, proto->suffix); in arcnet_header()
688 arc_bcast_proto->suffix); in arcnet_header()
692 return proto->build_header(skb, dev, type, _daddr); in arcnet_header()
700 struct archdr *pkt; in arcnet_send_packet() local
709 lp->hw.status(dev), lp->cur_tx, lp->next_tx, skb->len, skb->protocol); in arcnet_send_packet()
711 pkt = (struct archdr *)skb->data; in arcnet_send_packet()
712 soft = &pkt->soft.rfc1201; in arcnet_send_packet()
713 proto = arc_proto_map[soft->proto]; in arcnet_send_packet()
716 skb->len, pkt->hard.dest); in arcnet_send_packet()
718 arcnet_dump_skb(dev, skb, "tx"); in arcnet_send_packet()
721 if (skb->len - ARC_HDR_SIZE > XMTU && !proto->continue_tx) { in arcnet_send_packet()
730 spin_lock_irqsave(&lp->lock, flags); in arcnet_send_packet()
731 lp->hw.intmask(dev, 0); in arcnet_send_packet()
732 if (lp->next_tx == -1) in arcnet_send_packet()
735 txbuf = -1; in arcnet_send_packet()
737 if (txbuf != -1) { in arcnet_send_packet()
738 lp->outgoing.skb = skb; in arcnet_send_packet()
739 if (proto->prepare_tx(dev, pkt, skb->len, txbuf) && in arcnet_send_packet()
740 !proto->ack_tx) { in arcnet_send_packet()
742 * the package later - forget about it now in arcnet_send_packet()
744 dev->stats.tx_bytes += skb->len; in arcnet_send_packet()
747 lp->outgoing.proto = proto; in arcnet_send_packet()
748 lp->outgoing.skb = skb; in arcnet_send_packet()
749 lp->outgoing.pkt = pkt; in arcnet_send_packet()
751 if (proto->continue_tx && in arcnet_send_packet()
752 proto->continue_tx(dev, txbuf)) { in arcnet_send_packet()
755 proto->suffix); in arcnet_send_packet()
759 lp->next_tx = txbuf; in arcnet_send_packet()
765 __FILE__, __LINE__, __func__, lp->hw.status(dev)); in arcnet_send_packet()
766 /* make sure we didn't ignore a TX IRQ while we were in here */ in arcnet_send_packet()
767 lp->hw.intmask(dev, 0); in arcnet_send_packet()
770 lp->intmask |= TXFREEflag | EXCNAKflag; in arcnet_send_packet()
771 lp->hw.intmask(dev, lp->intmask); in arcnet_send_packet()
773 __FILE__, __LINE__, __func__, lp->hw.status(dev)); in arcnet_send_packet()
777 spin_unlock_irqrestore(&lp->lock, flags); in arcnet_send_packet()
790 lp->hw.status(dev), lp->intmask, lp->next_tx, lp->cur_tx); in go_tx()
792 if (lp->cur_tx != -1 || lp->next_tx == -1) in go_tx()
796 arcnet_dump_packet(dev, lp->next_tx, "go_tx", 0); in go_tx()
798 lp->cur_tx = lp->next_tx; in go_tx()
799 lp->next_tx = -1; in go_tx()
802 lp->hw.command(dev, TXcmd | (lp->cur_tx << 3)); in go_tx()
804 dev->stats.tx_packets++; in go_tx()
805 lp->lasttrans_dest = lp->lastload_dest; in go_tx()
806 lp->lastload_dest = 0; in go_tx()
807 lp->excnak_pending = 0; in go_tx()
808 lp->intmask |= TXFREEflag | EXCNAKflag; in go_tx()
818 int status = lp->hw.status(dev); in arcnet_timeout()
821 spin_lock_irqsave(&lp->lock, flags); in arcnet_timeout()
823 msg = " - missed IRQ?"; in arcnet_timeout()
826 dev->stats.tx_aborted_errors++; in arcnet_timeout()
827 lp->timed_out = 1; in arcnet_timeout()
828 lp->hw.command(dev, NOTXcmd | (lp->cur_tx << 3)); in arcnet_timeout()
830 dev->stats.tx_errors++; in arcnet_timeout()
832 /* make sure we didn't miss a TX or a EXC NAK IRQ */ in arcnet_timeout()
833 lp->hw.intmask(dev, 0); in arcnet_timeout()
834 lp->intmask |= TXFREEflag | EXCNAKflag; in arcnet_timeout()
835 lp->hw.intmask(dev, lp->intmask); in arcnet_timeout()
837 spin_unlock_irqrestore(&lp->lock, flags); in arcnet_timeout()
839 if (time_after(jiffies, lp->last_timeout + 10 * HZ)) { in arcnet_timeout()
840 arc_printk(D_EXTRA, dev, "tx timed out%s (status=%Xh, intmask=%Xh, dest=%02Xh)\n", in arcnet_timeout()
841 msg, status, lp->intmask, lp->lasttrans_dest); in arcnet_timeout()
842 lp->last_timeout = jiffies; in arcnet_timeout()
845 if (lp->cur_tx == -1) in arcnet_timeout()
869 spin_lock_irqsave(&lp->lock, flags); in arcnet_interrupt()
871 if (lp->reset_in_progress) in arcnet_interrupt()
874 /* RESET flag was enabled - if device is not running, we must in arcnet_interrupt()
878 if (lp->hw.status(dev) & RESETflag) in arcnet_interrupt()
879 lp->hw.command(dev, CFLAGScmd | RESETclear); in arcnet_interrupt()
880 lp->hw.intmask(dev, 0); in arcnet_interrupt()
881 spin_unlock_irqrestore(&lp->lock, flags); in arcnet_interrupt()
886 lp->hw.status(dev), lp->intmask); in arcnet_interrupt()
890 status = lp->hw.status(dev); in arcnet_interrupt()
897 /* RESET flag was enabled - card is resetting and if RX is in arcnet_interrupt()
907 lp->reset_in_progress = 1; in arcnet_interrupt()
910 schedule_work(&lp->reset_work); in arcnet_interrupt()
915 /* RX is inhibited - we must have received something. in arcnet_interrupt()
920 * launches the next tx); this should improve latency slightly in arcnet_interrupt()
923 recbuf = -1; in arcnet_interrupt()
924 if (status & lp->intmask & NORXflag) { in arcnet_interrupt()
925 recbuf = lp->cur_rx; in arcnet_interrupt()
929 lp->cur_rx = get_arcbuf(dev); in arcnet_interrupt()
930 if (lp->cur_rx != -1) { in arcnet_interrupt()
932 lp->cur_rx); in arcnet_interrupt()
933 lp->hw.command(dev, RXcmd | (lp->cur_rx << 3) | RXbcasts); in arcnet_interrupt()
942 lp->hw.command(dev, NOTXcmd); /* disable transmit */ in arcnet_interrupt()
943 lp->excnak_pending = 1; in arcnet_interrupt()
945 lp->hw.command(dev, EXCNAKclear); in arcnet_interrupt()
946 lp->intmask &= ~(EXCNAKflag); in arcnet_interrupt()
951 if ((status & lp->intmask & TXFREEflag) || lp->timed_out) { in arcnet_interrupt()
953 lp->intmask &= ~(TXFREEflag | EXCNAKflag); in arcnet_interrupt()
957 else if (lp->excnak_pending) in arcnet_interrupt()
962 arc_printk(D_DURING, dev, "TX IRQ (stat=%Xh)\n", in arcnet_interrupt()
965 if (lp->cur_tx != -1 && !lp->timed_out) { in arcnet_interrupt()
967 if (lp->lasttrans_dest != 0) { in arcnet_interrupt()
971 lp->lasttrans_dest); in arcnet_interrupt()
972 dev->stats.tx_errors++; in arcnet_interrupt()
973 dev->stats.tx_carrier_errors++; in arcnet_interrupt()
978 lp->lasttrans_dest); in arcnet_interrupt()
982 if (lp->outgoing.proto && in arcnet_interrupt()
983 lp->outgoing.proto->ack_tx) { in arcnet_interrupt()
984 lp->outgoing.proto in arcnet_interrupt()
985 ->ack_tx(dev, ackstatus); in arcnet_interrupt()
987 lp->reply_status = ackstatus; in arcnet_interrupt()
988 queue_work(system_bh_highpri_wq, &lp->reply_work); in arcnet_interrupt()
990 if (lp->cur_tx != -1) in arcnet_interrupt()
991 release_arcbuf(dev, lp->cur_tx); in arcnet_interrupt()
993 lp->cur_tx = -1; in arcnet_interrupt()
994 lp->timed_out = 0; in arcnet_interrupt()
1001 if (lp->outgoing.proto && in arcnet_interrupt()
1002 lp->outgoing.proto->continue_tx) { in arcnet_interrupt()
1005 if (txbuf != -1) { in arcnet_interrupt()
1006 if (lp->outgoing.proto->continue_tx(dev, txbuf)) { in arcnet_interrupt()
1008 dev->stats.tx_bytes += lp->outgoing.skb->len; in arcnet_interrupt()
1009 if (!lp->outgoing.proto->ack_tx) { in arcnet_interrupt()
1010 dev_kfree_skb_irq(lp->outgoing.skb); in arcnet_interrupt()
1011 lp->outgoing.proto = NULL; in arcnet_interrupt()
1014 lp->next_tx = txbuf; in arcnet_interrupt()
1018 if (lp->cur_tx == -1) in arcnet_interrupt()
1022 if (recbuf != -1) { in arcnet_interrupt()
1031 if (status & lp->intmask & RECONflag) { in arcnet_interrupt()
1032 lp->hw.command(dev, CFLAGScmd | CONFIGclear); in arcnet_interrupt()
1033 dev->stats.tx_carrier_errors++; in arcnet_interrupt()
1041 mod_timer(&lp->timer, jiffies + msecs_to_jiffies(1000)); in arcnet_interrupt()
1049 if (!lp->first_recon || !lp->last_recon || in arcnet_interrupt()
1050 time_after(jiffies, lp->last_recon + HZ * 10)) { in arcnet_interrupt()
1051 if (lp->network_down) in arcnet_interrupt()
1053 lp->first_recon = lp->last_recon = jiffies; in arcnet_interrupt()
1054 lp->num_recons = lp->network_down = 0; in arcnet_interrupt()
1058 lp->last_recon = jiffies; in arcnet_interrupt()
1059 lp->num_recons++; in arcnet_interrupt()
1062 lp->num_recons, in arcnet_interrupt()
1063 (lp->last_recon - lp->first_recon) / HZ, in arcnet_interrupt()
1064 lp->network_down); in arcnet_interrupt()
1072 if (!lp->network_down && in arcnet_interrupt()
1073 (lp->last_recon - lp->first_recon) <= HZ * 60 && in arcnet_interrupt()
1074 lp->num_recons >= RECON_THRESHOLD) { in arcnet_interrupt()
1075 lp->network_down = 1; in arcnet_interrupt()
1077 } else if (!lp->network_down && in arcnet_interrupt()
1078 lp->last_recon - lp->first_recon > HZ * 60) { in arcnet_interrupt()
1082 lp->first_recon = lp->last_recon; in arcnet_interrupt()
1083 lp->num_recons = 1; in arcnet_interrupt()
1086 } else if (lp->network_down && in arcnet_interrupt()
1087 time_after(jiffies, lp->last_recon + HZ * 10)) { in arcnet_interrupt()
1088 if (lp->network_down) in arcnet_interrupt()
1090 lp->first_recon = lp->last_recon = 0; in arcnet_interrupt()
1091 lp->num_recons = lp->network_down = 0; in arcnet_interrupt()
1099 } while (--boguscount && didsomething); in arcnet_interrupt()
1102 lp->hw.status(dev), boguscount); in arcnet_interrupt()
1105 lp->hw.intmask(dev, 0); in arcnet_interrupt()
1107 lp->hw.intmask(dev, lp->intmask); in arcnet_interrupt()
1110 spin_unlock_irqrestore(&lp->lock, flags); in arcnet_interrupt()
1122 struct archdr pkt; in arcnet_rx() member
1128 soft = &rxdata.pkt.soft.rfc1201; in arcnet_rx()
1130 lp->hw.copy_from_card(dev, bufnum, 0, &rxdata.pkt, ARC_HDR_SIZE); in arcnet_rx()
1131 if (rxdata.pkt.hard.offset[0]) { in arcnet_rx()
1132 ofs = rxdata.pkt.hard.offset[0]; in arcnet_rx()
1133 length = 256 - ofs; in arcnet_rx()
1135 ofs = rxdata.pkt.hard.offset[1]; in arcnet_rx()
1136 length = 512 - ofs; in arcnet_rx()
1140 if (sizeof(rxdata.pkt.soft) <= length) { in arcnet_rx()
1141 lp->hw.copy_from_card(dev, bufnum, ofs, soft, sizeof(rxdata.pkt.soft)); in arcnet_rx()
1143 memset(&rxdata.pkt.soft, 0, sizeof(rxdata.pkt.soft)); in arcnet_rx()
1144 lp->hw.copy_from_card(dev, bufnum, ofs, soft, length); in arcnet_rx()
1148 bufnum, rxdata.pkt.hard.source, rxdata.pkt.hard.dest, length); in arcnet_rx()
1150 dev->stats.rx_packets++; in arcnet_rx()
1151 dev->stats.rx_bytes += length + ARC_HDR_SIZE; in arcnet_rx()
1154 if (arc_proto_map[soft->proto]->is_ip) { in arcnet_rx()
1157 *oldp = arc_proto_map[lp->default_proto[rxdata.pkt.hard.source]], in arcnet_rx()
1158 *newp = arc_proto_map[soft->proto]; in arcnet_rx()
1163 soft->proto, rxdata.pkt.hard.source, in arcnet_rx()
1164 newp->suffix, oldp->suffix); in arcnet_rx()
1168 /* broadcasts will always be done with the last-used encap. */ in arcnet_rx()
1169 lp->default_proto[0] = soft->proto; in arcnet_rx()
1172 lp->default_proto[rxdata.pkt.hard.source] = soft->proto; in arcnet_rx()
1174 /* call the protocol-specific receiver. */ in arcnet_rx()
1175 arc_proto_map[soft->proto]->rx(dev, bufnum, &rxdata.pkt, length); in arcnet_rx()
1183 pkthdr->soft.rfc1201.proto, pkthdr->hard.source); in null_rx()
1192 "tx: can't build header for encap %02Xh; load a protocol driver.\n", in null_build_header()
1193 lp->default_proto[daddr]); in null_build_header()
1200 static int null_prepare_tx(struct net_device *dev, struct archdr *pkt, in null_prepare_tx() argument
1206 arc_printk(D_PROTO, dev, "tx: no encap for this host; load a protocol driver.\n"); in null_prepare_tx()
1208 /* send a packet to myself -- will never get received, of course */ in null_prepare_tx()
1209 newpkt.source = newpkt.dest = dev->dev_addr[0]; in null_prepare_tx()
1214 lp->hw.copy_to_card(dev, bufnum, 0, &newpkt, ARC_HDR_SIZE); in null_prepare_tx()