Commit f2f0a16b authored by Joe Perches's avatar Joe Perches Committed by Michael Grzeschik

arcnet: Use network block comment style

Conformity can be useful.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
parent 5e7ef913
...@@ -123,8 +123,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -123,8 +123,7 @@ static void rx(struct net_device *dev, int bufnum,
netif_rx(skb); netif_rx(skb);
} }
/* /* Create the ARCnet hard/soft headers for raw mode.
* Create the ARCnet hard/soft headers for raw mode.
* There aren't any soft headers in raw mode - not even the protocol id. * There aren't any soft headers in raw mode - not even the protocol id.
*/ */
static int build_header(struct sk_buff *skb, struct net_device *dev, static int build_header(struct sk_buff *skb, struct net_device *dev,
...@@ -133,21 +132,19 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, ...@@ -133,21 +132,19 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
int hdr_size = ARC_HDR_SIZE; int hdr_size = ARC_HDR_SIZE;
struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size); struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size);
/* /* Set the source hardware address.
* Set the source hardware address.
* *
* This is pretty pointless for most purposes, but it can help in * This is pretty pointless for most purposes, but it can help in
* debugging. ARCnet does not allow us to change the source address in * debugging. ARCnet does not allow us to change the source address
* the actual packet sent) * in the actual packet sent.
*/ */
pkt->hard.source = *dev->dev_addr; pkt->hard.source = *dev->dev_addr;
/* see linux/net/ethernet/eth.c to see where I got the following */ /* see linux/net/ethernet/eth.c to see where I got the following */
if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) { if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) {
/* /* FIXME: fill in the last byte of the dest ipaddr here
* FIXME: fill in the last byte of the dest ipaddr here to better * to better comply with RFC1051 in "noarp" mode.
* comply with RFC1051 in "noarp" mode.
*/ */
pkt->hard.dest = 0; pkt->hard.dest = 0;
return hdr_size; return hdr_size;
......
...@@ -76,8 +76,7 @@ static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offse ...@@ -76,8 +76,7 @@ static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offse
#define AINTMASK(msk) writeb((msk), _INTMASK) #define AINTMASK(msk) writeb((msk), _INTMASK)
#define SETCONF() writeb(lp->config, _CONFIG) #define SETCONF() writeb(lp->config, _CONFIG)
/* /* We cannot probe for a RIM I card; one reason is I don't know how to reset
* We cannot probe for a RIM I card; one reason is I don't know how to reset
* them. In fact, we can't even get their node ID automatically. So, we * them. In fact, we can't even get their node ID automatically. So, we
* need to be passed a specific shmem address, IRQ, and node ID. * need to be passed a specific shmem address, IRQ, and node ID.
*/ */
...@@ -97,8 +96,7 @@ static int __init arcrimi_probe(struct net_device *dev) ...@@ -97,8 +96,7 @@ static int __init arcrimi_probe(struct net_device *dev)
BUGLVL(D_NORMAL) printk("You need to specify your card's station ID!\n"); BUGLVL(D_NORMAL) printk("You need to specify your card's station ID!\n");
return -ENODEV; return -ENODEV;
} }
/* /* Grab the memory region at mem_start for MIRROR_SIZE bytes.
* Grab the memory region at mem_start for MIRROR_SIZE bytes.
* Later in arcrimi_found() the real size will be determined * Later in arcrimi_found() the real size will be determined
* and this reserve will be released and the correct size * and this reserve will be released and the correct size
* will be taken. * will be taken.
...@@ -131,9 +129,8 @@ static int check_mirror(unsigned long addr, size_t size) ...@@ -131,9 +129,8 @@ static int check_mirror(unsigned long addr, size_t size)
return res; return res;
} }
/* /* Set up the struct net_device associated with this card.
* Set up the struct net_device associated with this card. Called after * Called after probing succeeds.
* probing succeeds.
*/ */
static int __init arcrimi_found(struct net_device *dev) static int __init arcrimi_found(struct net_device *dev)
{ {
...@@ -199,8 +196,7 @@ static int __init arcrimi_found(struct net_device *dev) ...@@ -199,8 +196,7 @@ static int __init arcrimi_found(struct net_device *dev)
lp->hw.copy_to_card = arcrimi_copy_to_card; lp->hw.copy_to_card = arcrimi_copy_to_card;
lp->hw.copy_from_card = arcrimi_copy_from_card; lp->hw.copy_from_card = arcrimi_copy_from_card;
/* /* re-reserve the memory region - arcrimi_probe() alloced this reqion
* re-reserve the memory region - arcrimi_probe() alloced this reqion
* but didn't know the real size. Free that region and then re-get * but didn't know the real size. Free that region and then re-get
* with the correct size. There is a VERY slim chance this could * with the correct size. There is a VERY slim chance this could
* fail. * fail.
...@@ -243,8 +239,7 @@ static int __init arcrimi_found(struct net_device *dev) ...@@ -243,8 +239,7 @@ static int __init arcrimi_found(struct net_device *dev)
return -EIO; return -EIO;
} }
/* /* Do a hardware reset on the card, and set up necessary registers.
* Do a hardware reset on the card, and set up necessary registers.
* *
* This should be called as little as possible, because it disrupts the * This should be called as little as possible, because it disrupts the
* token on the network (causes a RECON) and requires a significant delay. * token on the network (causes a RECON) and requires a significant delay.
......
...@@ -63,8 +63,7 @@ static int null_prepare_tx(struct net_device *dev, struct archdr *pkt, ...@@ -63,8 +63,7 @@ static int null_prepare_tx(struct net_device *dev, struct archdr *pkt,
static void arcnet_rx(struct net_device *dev, int bufnum); static void arcnet_rx(struct net_device *dev, int bufnum);
/* /* one ArcProto per possible proto ID. None of the elements of
* one ArcProto per possible proto ID. None of the elements of
* arc_proto_map are allowed to be NULL; they will get set to * arc_proto_map are allowed to be NULL; they will get set to
* arc_proto_default instead. It also must not be NULL; if you would like * arc_proto_default instead. It also must not be NULL; if you would like
* to set it to NULL, set it to &arc_proto_null instead. * to set it to NULL, set it to &arc_proto_null instead.
...@@ -149,9 +148,7 @@ static void __exit arcnet_exit(void) ...@@ -149,9 +148,7 @@ static void __exit arcnet_exit(void)
module_init(arcnet_init); module_init(arcnet_init);
module_exit(arcnet_exit); module_exit(arcnet_exit);
/* /* Dump the contents of an sk_buff */
* Dump the contents of an sk_buff
*/
#if ARCNET_DEBUG_MAX & D_SKB #if ARCNET_DEBUG_MAX & D_SKB
void arcnet_dump_skb(struct net_device *dev, void arcnet_dump_skb(struct net_device *dev,
struct sk_buff *skb, char *desc) struct sk_buff *skb, char *desc)
...@@ -167,9 +164,7 @@ void arcnet_dump_skb(struct net_device *dev, ...@@ -167,9 +164,7 @@ void arcnet_dump_skb(struct net_device *dev,
EXPORT_SYMBOL(arcnet_dump_skb); EXPORT_SYMBOL(arcnet_dump_skb);
#endif #endif
/* /* Dump the contents of an ARCnet buffer */
* Dump the contents of an ARCnet buffer
*/
#if (ARCNET_DEBUG_MAX & (D_RX | D_TX)) #if (ARCNET_DEBUG_MAX & (D_RX | D_TX))
static void arcnet_dump_packet(struct net_device *dev, int bufnum, static void arcnet_dump_packet(struct net_device *dev, int bufnum,
char *desc, int take_arcnet_lock) char *desc, int take_arcnet_lock)
...@@ -181,7 +176,8 @@ static void arcnet_dump_packet(struct net_device *dev, int bufnum, ...@@ -181,7 +176,8 @@ static void arcnet_dump_packet(struct net_device *dev, int bufnum,
char hdr[32]; char hdr[32];
/* hw.copy_from_card expects IRQ context so take the IRQ lock /* hw.copy_from_card expects IRQ context so take the IRQ lock
to keep it single threaded */ * to keep it single threaded
*/
if (take_arcnet_lock) if (take_arcnet_lock)
spin_lock_irqsave(&lp->lock, flags); spin_lock_irqsave(&lp->lock, flags);
...@@ -204,8 +200,7 @@ static void arcnet_dump_packet(struct net_device *dev, int bufnum, ...@@ -204,8 +200,7 @@ static void arcnet_dump_packet(struct net_device *dev, int bufnum,
#endif #endif
/* /* Unregister a protocol driver from the arc_proto_map. Protocol drivers
* Unregister a protocol driver from the arc_proto_map. Protocol drivers
* are responsible for registering themselves, but the unregister routine * are responsible for registering themselves, but the unregister routine
* is pretty generic so we'll do it here. * is pretty generic so we'll do it here.
*/ */
...@@ -226,8 +221,7 @@ void arcnet_unregister_proto(struct ArcProto *proto) ...@@ -226,8 +221,7 @@ void arcnet_unregister_proto(struct ArcProto *proto)
} }
} }
/* /* Add a buffer to the queue. Only the interrupt handler is allowed to do
* Add a buffer to the queue. Only the interrupt handler is allowed to do
* this, unless interrupts are disabled. * this, unless interrupts are disabled.
* *
* Note: we don't check for a full queue, since there aren't enough buffers * Note: we don't check for a full queue, since there aren't enough buffers
...@@ -250,9 +244,8 @@ static void release_arcbuf(struct net_device *dev, int bufnum) ...@@ -250,9 +244,8 @@ static void release_arcbuf(struct net_device *dev, int bufnum)
} }
} }
/* /* Get a buffer from the queue.
* Get a buffer from the queue. If this returns -1, there are no buffers * If this returns -1, there are no buffers available.
* available.
*/ */
static int get_arcbuf(struct net_device *dev) static int get_arcbuf(struct net_device *dev)
{ {
...@@ -346,8 +339,7 @@ struct net_device *alloc_arcdev(const char *name) ...@@ -346,8 +339,7 @@ struct net_device *alloc_arcdev(const char *name)
return dev; return dev;
} }
/* /* Open/initialize the board. This is called sometime after booting when
* Open/initialize the board. This is called sometime after booting when
* the 'ifconfig' program is run. * the 'ifconfig' program is run.
* *
* This routine should set everything up anew at each open, even registers * This routine should set everything up anew at each open, even registers
...@@ -490,15 +482,13 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev, ...@@ -490,15 +482,13 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev,
BUGMSG(D_DEBUG, "arc_raw_proto used. proto='%c'\n", proto->suffix); BUGMSG(D_DEBUG, "arc_raw_proto used. proto='%c'\n", proto->suffix);
_daddr = daddr ? *(uint8_t *)daddr : 0; _daddr = daddr ? *(uint8_t *)daddr : 0;
} else if (!daddr) { } else if (!daddr) {
/* /* if the dest addr isn't provided, we can't choose an
* if the dest addr isn't provided, we can't choose an encapsulation! * encapsulation! Store the packet type (eg. ETH_P_IP)
* Store the packet type (eg. ETH_P_IP) for now, and we'll push on a * for now, and we'll push on a real header when we do
* real header when we do rebuild_header. * rebuild_header.
*/ */
*(uint16_t *)skb_push(skb, 2) = type; *(uint16_t *)skb_push(skb, 2) = type;
/* /* XXX: Why not use skb->mac_len? */
* XXX: Why not use skb->mac_len?
*/
if (skb->network_header - skb->mac_header != 2) if (skb->network_header - skb->mac_header != 2)
BUGMSG(D_NORMAL, "arcnet_header: Yikes! diff (%d) is not 2!\n", BUGMSG(D_NORMAL, "arcnet_header: Yikes! diff (%d) is not 2!\n",
(int)(skb->network_header - skb->mac_header)); (int)(skb->network_header - skb->mac_header));
...@@ -564,7 +554,8 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb, ...@@ -564,7 +554,8 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb,
if (proto->prepare_tx(dev, pkt, skb->len, txbuf) && if (proto->prepare_tx(dev, pkt, skb->len, txbuf) &&
!proto->ack_tx) { !proto->ack_tx) {
/* done right away and we don't want to acknowledge /* done right away and we don't want to acknowledge
the package later - forget about it now */ * the package later - forget about it now
*/
dev->stats.tx_bytes += skb->len; dev->stats.tx_bytes += skb->len;
freeskb = 1; freeskb = 1;
} else { } else {
...@@ -605,8 +596,7 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb, ...@@ -605,8 +596,7 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb,
return retval; /* no need to try again */ return retval; /* no need to try again */
} }
/* /* Actually start transmitting a packet that was loaded into a buffer
* Actually start transmitting a packet that was loaded into a buffer
* by prepare_tx. This should _only_ be called by the interrupt handler. * by prepare_tx. This should _only_ be called by the interrupt handler.
*/ */
static int go_tx(struct net_device *dev) static int go_tx(struct net_device *dev)
...@@ -672,8 +662,7 @@ void arcnet_timeout(struct net_device *dev) ...@@ -672,8 +662,7 @@ void arcnet_timeout(struct net_device *dev)
netif_wake_queue(dev); netif_wake_queue(dev);
} }
/* /* The typical workload of the driver: Handle the network interface
* The typical workload of the driver: Handle the network interface
* interrupts. Establish which device needs attention, and call the correct * interrupts. Establish which device needs attention, and call the correct
* chipset interrupt handler. * chipset interrupt handler.
*/ */
...@@ -693,9 +682,8 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) ...@@ -693,9 +682,8 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
spin_lock(&lp->lock); spin_lock(&lp->lock);
/* /* RESET flag was enabled - if device is not running, we must
* RESET flag was enabled - if device is not running, we must clear it right * clear it right away (but nothing else).
* away (but nothing else).
*/ */
if (!netif_running(dev)) { if (!netif_running(dev)) {
if (ASTATUS() & RESETflag) if (ASTATUS() & RESETflag)
...@@ -717,11 +705,11 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) ...@@ -717,11 +705,11 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
__FILE__, __LINE__, __func__, status); __FILE__, __LINE__, __func__, status);
didsomething = 0; didsomething = 0;
/* /* RESET flag was enabled - card is resetting and if RX is
* RESET flag was enabled - card is resetting and if RX is
* disabled, it's NOT because we just got a packet. * disabled, it's NOT because we just got a packet.
* *
* The card is in an undefined state. Clear it out and start over. * The card is in an undefined state.
* Clear it out and start over.
*/ */
if (status & RESETflag) { if (status & RESETflag) {
BUGMSG(D_NORMAL, "spurious reset (status=%Xh)\n", status); BUGMSG(D_NORMAL, "spurious reset (status=%Xh)\n", status);
...@@ -731,14 +719,13 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) ...@@ -731,14 +719,13 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
/* get out of the interrupt handler! */ /* get out of the interrupt handler! */
break; break;
} }
/* /* RX is inhibited - we must have received something.
* RX is inhibited - we must have received something. Prepare to * Prepare to receive into the next buffer.
* receive into the next buffer.
* *
* We don't actually copy the received packet from the card until * We don't actually copy the received packet from the card
* after the transmit handler runs (and possibly launches the next * until after the transmit handler runs (and possibly
* tx); this should improve latency slightly if we get both types * launches the next tx); this should improve latency slightly
* of interrupts at once. * if we get both types of interrupts at once.
*/ */
recbuf = -1; recbuf = -1;
if (status & lp->intmask & NORXflag) { if (status & lp->intmask & NORXflag) {
...@@ -914,8 +901,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) ...@@ -914,8 +901,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
return retval; return retval;
} }
/* /* This is a generic packet receiver that calls arcnet??_rx depending on the
* This is a generic packet receiver that calls arcnet??_rx depending on the
* protocol ID found. * protocol ID found.
*/ */
static void arcnet_rx(struct net_device *dev, int bufnum) static void arcnet_rx(struct net_device *dev, int bufnum)
......
...@@ -66,11 +66,11 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -66,11 +66,11 @@ static void rx(struct net_device *dev, int bufnum,
pkt = (struct archdr *)skb_mac_header(skb); pkt = (struct archdr *)skb_mac_header(skb);
skb_pull(skb, ARC_HDR_SIZE); skb_pull(skb, ARC_HDR_SIZE);
/* up to sizeof(pkt->soft) has already been copied from the card */ /* up to sizeof(pkt->soft) has already been copied from the card
/* squeeze in an int for the cap encapsulation */ * squeeze in an int for the cap encapsulation
* use these variables to be sure we count in bytes, not in
/* use these variables to be sure we count in bytes, not in * sizeof(struct archdr)
sizeof(struct archdr) */ */
pktbuf = (char *)pkt; pktbuf = (char *)pkt;
pkthdrbuf = (char *)pkthdr; pkthdrbuf = (char *)pkthdr;
memcpy(pktbuf, pkthdrbuf, ARC_HDR_SIZE + sizeof(pkt->soft.cap.proto)); memcpy(pktbuf, pkthdrbuf, ARC_HDR_SIZE + sizeof(pkt->soft.cap.proto));
...@@ -90,8 +90,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -90,8 +90,7 @@ static void rx(struct net_device *dev, int bufnum,
netif_rx(skb); netif_rx(skb);
} }
/* /* Create the ARCnet hard/soft headers for cap mode.
* Create the ARCnet hard/soft headers for cap mode.
* There aren't any soft headers in cap mode - not even the protocol id. * There aren't any soft headers in cap mode - not even the protocol id.
*/ */
static int build_header(struct sk_buff *skb, static int build_header(struct sk_buff *skb,
...@@ -104,8 +103,8 @@ static int build_header(struct sk_buff *skb, ...@@ -104,8 +103,8 @@ static int build_header(struct sk_buff *skb,
BUGMSG(D_PROTO, "Preparing header for cap packet %x.\n", BUGMSG(D_PROTO, "Preparing header for cap packet %x.\n",
*((int *)&pkt->soft.cap.cookie[0])); *((int *)&pkt->soft.cap.cookie[0]));
/*
* Set the source hardware address. /* Set the source hardware address.
* *
* This is pretty pointless for most purposes, but it can help in * This is pretty pointless for most purposes, but it can help in
* debugging. ARCnet does not allow us to change the source address in * debugging. ARCnet does not allow us to change the source address in
...@@ -116,9 +115,8 @@ static int build_header(struct sk_buff *skb, ...@@ -116,9 +115,8 @@ static int build_header(struct sk_buff *skb,
/* see linux/net/ethernet/eth.c to see where I got the following */ /* see linux/net/ethernet/eth.c to see where I got the following */
if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) { if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) {
/* /* FIXME: fill in the last byte of the dest ipaddr here to
* FIXME: fill in the last byte of the dest ipaddr here to better * better comply with RFC1051 in "noarp" mode.
* comply with RFC1051 in "noarp" mode.
*/ */
pkt->hard.dest = 0; pkt->hard.dest = 0;
return hdr_size; return hdr_size;
...@@ -172,7 +170,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, ...@@ -172,7 +170,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
sizeof(pkt->soft.cap.proto)); sizeof(pkt->soft.cap.proto));
/* Skip the extra integer we have written into it as a cookie /* Skip the extra integer we have written into it as a cookie
but write the rest of the message: */ * but write the rest of the message:
*/
lp->hw.copy_to_card(dev, bufnum, ofs + 1, lp->hw.copy_to_card(dev, bufnum, ofs + 1,
((unsigned char *)&pkt->soft.cap.mes), length - 1); ((unsigned char *)&pkt->soft.cap.mes), length - 1);
......
...@@ -43,8 +43,7 @@ ...@@ -43,8 +43,7 @@
#define VERSION "arcnet: COM20020 ISA support (by David Woodhouse et al.)\n" #define VERSION "arcnet: COM20020 ISA support (by David Woodhouse et al.)\n"
/* /* We cannot (yet) probe for an IO mapped card, although we can check that
* We cannot (yet) probe for an IO mapped card, although we can check that
* it's where we were told it was, and even do autoirq. * it's where we were told it was, and even do autoirq.
*/ */
static int __init com20020isa_probe(struct net_device *dev) static int __init com20020isa_probe(struct net_device *dev)
......
...@@ -239,8 +239,7 @@ int com20020_found(struct net_device *dev, int shared) ...@@ -239,8 +239,7 @@ int com20020_found(struct net_device *dev, int shared)
return 0; return 0;
} }
/* /* Do a hardware reset on the card, and set up necessary registers.
* Do a hardware reset on the card, and set up necessary registers.
* *
* This should be called as little as possible, because it disrupts the * This should be called as little as possible, because it disrupts the
* token on the network (causes a RECON) and requires a significant delay. * token on the network (causes a RECON) and requires a significant delay.
......
...@@ -162,8 +162,7 @@ static void com20020_detach(struct pcmcia_device *link) ...@@ -162,8 +162,7 @@ static void com20020_detach(struct pcmcia_device *link)
unregister_netdev(dev); unregister_netdev(dev);
/* /* this is necessary because we register our IRQ separately
* this is necessary because we register our IRQ separately
* from card services. * from card services.
*/ */
if (dev->irq) if (dev->irq)
......
...@@ -137,8 +137,7 @@ static void put_whole_buffer(struct net_device *dev, unsigned offset, unsigned l ...@@ -137,8 +137,7 @@ static void put_whole_buffer(struct net_device *dev, unsigned offset, unsigned l
#endif #endif
} }
/* /* We cannot probe for an IO mapped card either, although we can check that
* We cannot probe for an IO mapped card either, although we can check that
* it's where we were told it was, and even autoirq * it's where we were told it was, and even autoirq
*/ */
static int __init com90io_probe(struct net_device *dev) static int __init com90io_probe(struct net_device *dev)
...@@ -196,8 +195,7 @@ static int __init com90io_probe(struct net_device *dev) ...@@ -196,8 +195,7 @@ static int __init com90io_probe(struct net_device *dev)
goto err_out; goto err_out;
} }
if (!dev->irq) { if (!dev->irq) {
/* /* if we do this, we're sure to get an IRQ since the
* if we do this, we're sure to get an IRQ since the
* card has just reset and the NORXflag is on until * card has just reset and the NORXflag is on until
* we tell it to start receiving. * we tell it to start receiving.
*/ */
...@@ -272,8 +270,7 @@ static int __init com90io_found(struct net_device *dev) ...@@ -272,8 +270,7 @@ static int __init com90io_found(struct net_device *dev)
return 0; return 0;
} }
/* /* Do a hardware reset on the card, and set up necessary registers.
* Do a hardware reset on the card, and set up necessary registers.
* *
* This should be called as little as possible, because it disrupts the * This should be called as little as possible, because it disrupts the
* token on the network (causes a RECON) and requires a significant delay. * token on the network (causes a RECON) and requires a significant delay.
......
...@@ -568,8 +568,7 @@ static void com90xx_setmask(struct net_device *dev, int mask) ...@@ -568,8 +568,7 @@ static void com90xx_setmask(struct net_device *dev, int mask)
AINTMASK(mask); AINTMASK(mask);
} }
/* /* Do a hardware reset on the card, and set up necessary registers.
* Do a hardware reset on the card, and set up necessary registers.
* *
* This should be called as little as possible, because it disrupts the * This should be called as little as possible, because it disrupts the
* token on the network (causes a RECON) and requires a significant delay. * token on the network (causes a RECON) and requires a significant delay.
......
...@@ -78,8 +78,7 @@ module_exit(arcnet_rfc1051_exit); ...@@ -78,8 +78,7 @@ module_exit(arcnet_rfc1051_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* /* Determine a packet's protocol ID.
* Determine a packet's protocol ID.
* *
* With ARCnet we have to convert everything to Ethernet-style stuff. * With ARCnet we have to convert everything to Ethernet-style stuff.
*/ */
...@@ -156,9 +155,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -156,9 +155,7 @@ static void rx(struct net_device *dev, int bufnum,
netif_rx(skb); netif_rx(skb);
} }
/* /* Create the ARCnet hard/soft headers for RFC1051 */
* Create the ARCnet hard/soft headers for RFC1051.
*/
static int build_header(struct sk_buff *skb, struct net_device *dev, static int build_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, uint8_t daddr) unsigned short type, uint8_t daddr)
{ {
...@@ -182,21 +179,19 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, ...@@ -182,21 +179,19 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
return 0; return 0;
} }
/* /* Set the source hardware address.
* Set the source hardware address.
* *
* This is pretty pointless for most purposes, but it can help in * This is pretty pointless for most purposes, but it can help in
* debugging. ARCnet does not allow us to change the source address in * debugging. ARCnet does not allow us to change the source address
* the actual packet sent) * in the actual packet sent.
*/ */
pkt->hard.source = *dev->dev_addr; pkt->hard.source = *dev->dev_addr;
/* see linux/net/ethernet/eth.c to see where I got the following */ /* see linux/net/ethernet/eth.c to see where I got the following */
if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) { if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) {
/* /* FIXME: fill in the last byte of the dest ipaddr here to
* FIXME: fill in the last byte of the dest ipaddr here to better * better comply with RFC1051 in "noarp" mode.
* comply with RFC1051 in "noarp" mode.
*/ */
pkt->hard.dest = 0; pkt->hard.dest = 0;
return hdr_size; return hdr_size;
......
...@@ -81,8 +81,7 @@ static void __exit arcnet_rfc1201_exit(void) ...@@ -81,8 +81,7 @@ static void __exit arcnet_rfc1201_exit(void)
module_init(arcnet_rfc1201_init); module_init(arcnet_rfc1201_init);
module_exit(arcnet_rfc1201_exit); module_exit(arcnet_rfc1201_exit);
/* /* Determine a packet's protocol ID.
* Determine a packet's protocol ID.
* *
* With ARCnet we have to convert everything to Ethernet-style stuff. * With ARCnet we have to convert everything to Ethernet-style stuff.
*/ */
...@@ -193,10 +192,10 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -193,10 +192,10 @@ static void rx(struct net_device *dev, int bufnum,
pkt->soft.raw + sizeof(pkt->soft), pkt->soft.raw + sizeof(pkt->soft),
length - sizeof(pkt->soft)); length - sizeof(pkt->soft));
/* /* ARP packets have problems when sent from some DOS systems:
* ARP packets have problems when sent from some DOS systems: the * the source address is always 0!
* source address is always 0! So we take the hardware source addr * So we take the hardware source addr (which is impossible
* (which is impossible to fumble) and insert it ourselves. * to fumble) and insert it ourselves.
*/ */
if (soft->proto == ARC_P_ARP) { if (soft->proto == ARC_P_ARP) {
struct arphdr *arp = (struct arphdr *)soft->payload; struct arphdr *arp = (struct arphdr *)soft->payload;
...@@ -227,21 +226,22 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -227,21 +226,22 @@ static void rx(struct net_device *dev, int bufnum,
skb->protocol = type_trans(skb, dev); skb->protocol = type_trans(skb, dev);
netif_rx(skb); netif_rx(skb);
} else { /* split packet */ } else { /* split packet */
/* /* NOTE: MSDOS ARP packet correction should only need to
* NOTE: MSDOS ARP packet correction should only need to apply to * apply to unsplit packets, since ARP packets are so short.
* unsplit packets, since ARP packets are so short.
* *
* My interpretation of the RFC1201 document is that if a packet is * My interpretation of the RFC1201 document is that if a
* received out of order, the entire assembly process should be * packet is received out of order, the entire assembly
* aborted. * process should be aborted.
* *
* The RFC also mentions "it is possible for successfully received * The RFC also mentions "it is possible for successfully
* packets to be retransmitted." As of 0.40 all previously received * received packets to be retransmitted." As of 0.40 all
* packets are allowed, not just the most recent one. * previously received packets are allowed, not just the
* most recent one.
* *
* We allow multiple assembly processes, one for each ARCnet card * We allow multiple assembly processes, one for each
* possible on the network. Seems rather like a waste of memory, * ARCnet card possible on the network.
* but there's no other way to be reliable. * Seems rather like a waste of memory, but there's no
* other way to be reliable.
*/ */
BUGMSG(D_RX, "packet is split (splitflag=%d, seq=%d)\n", BUGMSG(D_RX, "packet is split (splitflag=%d, seq=%d)\n",
...@@ -299,8 +299,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -299,8 +299,7 @@ static void rx(struct net_device *dev, int bufnum,
} else { /* not first packet */ } else { /* not first packet */
int packetnum = ((unsigned)soft->split_flag >> 1) + 1; int packetnum = ((unsigned)soft->split_flag >> 1) + 1;
/* /* if we're not assembling, there's no point trying to
* if we're not assembling, there's no point trying to
* continue. * continue.
*/ */
if (!in->skb) { if (!in->skb) {
...@@ -401,12 +400,11 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, ...@@ -401,12 +400,11 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
return 0; return 0;
} }
/* /* Set the source hardware address.
* Set the source hardware address.
* *
* This is pretty pointless for most purposes, but it can help in * This is pretty pointless for most purposes, but it can help in
* debugging. ARCnet does not allow us to change the source address in * debugging. ARCnet does not allow us to change the source address
* the actual packet sent) * in the actual packet sent.
*/ */
pkt->hard.source = *dev->dev_addr; pkt->hard.source = *dev->dev_addr;
...@@ -416,10 +414,10 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, ...@@ -416,10 +414,10 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
/* see linux/net/ethernet/eth.c to see where I got the following */ /* see linux/net/ethernet/eth.c to see where I got the following */
if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) { if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) {
/* /* FIXME: fill in the last byte of the dest ipaddr here
* FIXME: fill in the last byte of the dest ipaddr here to better * to better comply with RFC1051 in "noarp" mode.
* comply with RFC1051 in "noarp" mode. For now, always broadcasting * For now, always broadcasting will probably at least get
* will probably at least get packets sent out :) * packets sent out :)
*/ */
pkt->hard.dest = 0; pkt->hard.dest = 0;
return hdr_size; return hdr_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment