diff options
author | Joe Perches <joe@perches.com> | 2015-05-05 13:05:52 -0400 |
---|---|---|
committer | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2015-09-23 02:44:23 -0400 |
commit | f2f0a16bf89a1bbf2f774e060de85ffbd8fff162 (patch) | |
tree | c4ad5d369c053314bbe6f542dc04331518bd8b3d | |
parent | 5e7ef9134ce1b8ae8d686ce08b9746b32535964d (diff) |
arcnet: Use network block comment style
Conformity can be useful.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
-rw-r--r-- | drivers/net/arcnet/arc-rawmode.c | 15 | ||||
-rw-r--r-- | drivers/net/arcnet/arc-rimi.c | 17 | ||||
-rw-r--r-- | drivers/net/arcnet/arcnet.c | 76 | ||||
-rw-r--r-- | drivers/net/arcnet/capmode.c | 25 | ||||
-rw-r--r-- | drivers/net/arcnet/com20020-isa.c | 3 | ||||
-rw-r--r-- | drivers/net/arcnet/com20020.c | 3 | ||||
-rw-r--r-- | drivers/net/arcnet/com20020_cs.c | 3 | ||||
-rw-r--r-- | drivers/net/arcnet/com90io.c | 9 | ||||
-rw-r--r-- | drivers/net/arcnet/com90xx.c | 3 | ||||
-rw-r--r-- | drivers/net/arcnet/rfc1051.c | 19 | ||||
-rw-r--r-- | drivers/net/arcnet/rfc1201.c | 54 |
11 files changed, 95 insertions, 132 deletions
diff --git a/drivers/net/arcnet/arc-rawmode.c b/drivers/net/arcnet/arc-rawmode.c index 500b5bb2cff4..efdd8e95a2bf 100644 --- a/drivers/net/arcnet/arc-rawmode.c +++ b/drivers/net/arcnet/arc-rawmode.c | |||
@@ -123,8 +123,7 @@ static void rx(struct net_device *dev, int bufnum, | |||
123 | netif_rx(skb); | 123 | netif_rx(skb); |
124 | } | 124 | } |
125 | 125 | ||
126 | /* | 126 | /* Create the ARCnet hard/soft headers for raw mode. |
127 | * Create the ARCnet hard/soft headers for raw mode. | ||
128 | * There aren't any soft headers in raw mode - not even the protocol id. | 127 | * There aren't any soft headers in raw mode - not even the protocol id. |
129 | */ | 128 | */ |
130 | static int build_header(struct sk_buff *skb, struct net_device *dev, | 129 | 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 | int hdr_size = ARC_HDR_SIZE; | 132 | int hdr_size = ARC_HDR_SIZE; |
134 | struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size); | 133 | struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size); |
135 | 134 | ||
136 | /* | 135 | /* Set the source hardware address. |
137 | * Set the source hardware address. | ||
138 | * | 136 | * |
139 | * This is pretty pointless for most purposes, but it can help in | 137 | * This is pretty pointless for most purposes, but it can help in |
140 | * debugging. ARCnet does not allow us to change the source address in | 138 | * debugging. ARCnet does not allow us to change the source address |
141 | * the actual packet sent) | 139 | * in the actual packet sent. |
142 | */ | 140 | */ |
143 | pkt->hard.source = *dev->dev_addr; | 141 | pkt->hard.source = *dev->dev_addr; |
144 | 142 | ||
145 | /* see linux/net/ethernet/eth.c to see where I got the following */ | 143 | /* see linux/net/ethernet/eth.c to see where I got the following */ |
146 | 144 | ||
147 | if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) { | 145 | if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) { |
148 | /* | 146 | /* FIXME: fill in the last byte of the dest ipaddr here |
149 | * FIXME: fill in the last byte of the dest ipaddr here to better | 147 | * to better comply with RFC1051 in "noarp" mode. |
150 | * comply with RFC1051 in "noarp" mode. | ||
151 | */ | 148 | */ |
152 | pkt->hard.dest = 0; | 149 | pkt->hard.dest = 0; |
153 | return hdr_size; | 150 | return hdr_size; |
diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c index 88e61574931c..c7ab23e8ec6a 100644 --- a/drivers/net/arcnet/arc-rimi.c +++ b/drivers/net/arcnet/arc-rimi.c | |||
@@ -76,8 +76,7 @@ static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offse | |||
76 | #define AINTMASK(msk) writeb((msk), _INTMASK) | 76 | #define AINTMASK(msk) writeb((msk), _INTMASK) |
77 | #define SETCONF() writeb(lp->config, _CONFIG) | 77 | #define SETCONF() writeb(lp->config, _CONFIG) |
78 | 78 | ||
79 | /* | 79 | /* We cannot probe for a RIM I card; one reason is I don't know how to reset |
80 | * We cannot probe for a RIM I card; one reason is I don't know how to reset | ||
81 | * them. In fact, we can't even get their node ID automatically. So, we | 80 | * them. In fact, we can't even get their node ID automatically. So, we |
82 | * need to be passed a specific shmem address, IRQ, and node ID. | 81 | * need to be passed a specific shmem address, IRQ, and node ID. |
83 | */ | 82 | */ |
@@ -97,8 +96,7 @@ static int __init arcrimi_probe(struct net_device *dev) | |||
97 | BUGLVL(D_NORMAL) printk("You need to specify your card's station ID!\n"); | 96 | BUGLVL(D_NORMAL) printk("You need to specify your card's station ID!\n"); |
98 | return -ENODEV; | 97 | return -ENODEV; |
99 | } | 98 | } |
100 | /* | 99 | /* Grab the memory region at mem_start for MIRROR_SIZE bytes. |
101 | * Grab the memory region at mem_start for MIRROR_SIZE bytes. | ||
102 | * Later in arcrimi_found() the real size will be determined | 100 | * Later in arcrimi_found() the real size will be determined |
103 | * and this reserve will be released and the correct size | 101 | * and this reserve will be released and the correct size |
104 | * will be taken. | 102 | * will be taken. |
@@ -131,9 +129,8 @@ static int check_mirror(unsigned long addr, size_t size) | |||
131 | return res; | 129 | return res; |
132 | } | 130 | } |
133 | 131 | ||
134 | /* | 132 | /* Set up the struct net_device associated with this card. |
135 | * Set up the struct net_device associated with this card. Called after | 133 | * Called after probing succeeds. |
136 | * probing succeeds. | ||
137 | */ | 134 | */ |
138 | static int __init arcrimi_found(struct net_device *dev) | 135 | static int __init arcrimi_found(struct net_device *dev) |
139 | { | 136 | { |
@@ -199,8 +196,7 @@ static int __init arcrimi_found(struct net_device *dev) | |||
199 | lp->hw.copy_to_card = arcrimi_copy_to_card; | 196 | lp->hw.copy_to_card = arcrimi_copy_to_card; |
200 | lp->hw.copy_from_card = arcrimi_copy_from_card; | 197 | lp->hw.copy_from_card = arcrimi_copy_from_card; |
201 | 198 | ||
202 | /* | 199 | /* re-reserve the memory region - arcrimi_probe() alloced this reqion |
203 | * re-reserve the memory region - arcrimi_probe() alloced this reqion | ||
204 | * but didn't know the real size. Free that region and then re-get | 200 | * but didn't know the real size. Free that region and then re-get |
205 | * with the correct size. There is a VERY slim chance this could | 201 | * with the correct size. There is a VERY slim chance this could |
206 | * fail. | 202 | * fail. |
@@ -243,8 +239,7 @@ err_free_irq: | |||
243 | return -EIO; | 239 | return -EIO; |
244 | } | 240 | } |
245 | 241 | ||
246 | /* | 242 | /* Do a hardware reset on the card, and set up necessary registers. |
247 | * Do a hardware reset on the card, and set up necessary registers. | ||
248 | * | 243 | * |
249 | * This should be called as little as possible, because it disrupts the | 244 | * This should be called as little as possible, because it disrupts the |
250 | * token on the network (causes a RECON) and requires a significant delay. | 245 | * token on the network (causes a RECON) and requires a significant delay. |
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index d70efda777c5..605b4a7abecc 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c | |||
@@ -63,8 +63,7 @@ static int null_prepare_tx(struct net_device *dev, struct archdr *pkt, | |||
63 | 63 | ||
64 | static void arcnet_rx(struct net_device *dev, int bufnum); | 64 | static void arcnet_rx(struct net_device *dev, int bufnum); |
65 | 65 | ||
66 | /* | 66 | /* one ArcProto per possible proto ID. None of the elements of |
67 | * one ArcProto per possible proto ID. None of the elements of | ||
68 | * arc_proto_map are allowed to be NULL; they will get set to | 67 | * arc_proto_map are allowed to be NULL; they will get set to |
69 | * arc_proto_default instead. It also must not be NULL; if you would like | 68 | * arc_proto_default instead. It also must not be NULL; if you would like |
70 | * to set it to NULL, set it to &arc_proto_null instead. | 69 | * to set it to NULL, set it to &arc_proto_null instead. |
@@ -149,9 +148,7 @@ static void __exit arcnet_exit(void) | |||
149 | module_init(arcnet_init); | 148 | module_init(arcnet_init); |
150 | module_exit(arcnet_exit); | 149 | module_exit(arcnet_exit); |
151 | 150 | ||
152 | /* | 151 | /* Dump the contents of an sk_buff */ |
153 | * Dump the contents of an sk_buff | ||
154 | */ | ||
155 | #if ARCNET_DEBUG_MAX & D_SKB | 152 | #if ARCNET_DEBUG_MAX & D_SKB |
156 | void arcnet_dump_skb(struct net_device *dev, | 153 | void arcnet_dump_skb(struct net_device *dev, |
157 | struct sk_buff *skb, char *desc) | 154 | struct sk_buff *skb, char *desc) |
@@ -167,9 +164,7 @@ void arcnet_dump_skb(struct net_device *dev, | |||
167 | EXPORT_SYMBOL(arcnet_dump_skb); | 164 | EXPORT_SYMBOL(arcnet_dump_skb); |
168 | #endif | 165 | #endif |
169 | 166 | ||
170 | /* | 167 | /* Dump the contents of an ARCnet buffer */ |
171 | * Dump the contents of an ARCnet buffer | ||
172 | */ | ||
173 | #if (ARCNET_DEBUG_MAX & (D_RX | D_TX)) | 168 | #if (ARCNET_DEBUG_MAX & (D_RX | D_TX)) |
174 | static void arcnet_dump_packet(struct net_device *dev, int bufnum, | 169 | static void arcnet_dump_packet(struct net_device *dev, int bufnum, |
175 | char *desc, int take_arcnet_lock) | 170 | char *desc, int take_arcnet_lock) |
@@ -181,7 +176,8 @@ static void arcnet_dump_packet(struct net_device *dev, int bufnum, | |||
181 | char hdr[32]; | 176 | char hdr[32]; |
182 | 177 | ||
183 | /* hw.copy_from_card expects IRQ context so take the IRQ lock | 178 | /* hw.copy_from_card expects IRQ context so take the IRQ lock |
184 | to keep it single threaded */ | 179 | * to keep it single threaded |
180 | */ | ||
185 | if (take_arcnet_lock) | 181 | if (take_arcnet_lock) |
186 | spin_lock_irqsave(&lp->lock, flags); | 182 | spin_lock_irqsave(&lp->lock, flags); |
187 | 183 | ||
@@ -204,8 +200,7 @@ static void arcnet_dump_packet(struct net_device *dev, int bufnum, | |||
204 | 200 | ||
205 | #endif | 201 | #endif |
206 | 202 | ||
207 | /* | 203 | /* Unregister a protocol driver from the arc_proto_map. Protocol drivers |
208 | * Unregister a protocol driver from the arc_proto_map. Protocol drivers | ||
209 | * are responsible for registering themselves, but the unregister routine | 204 | * are responsible for registering themselves, but the unregister routine |
210 | * is pretty generic so we'll do it here. | 205 | * is pretty generic so we'll do it here. |
211 | */ | 206 | */ |
@@ -226,8 +221,7 @@ void arcnet_unregister_proto(struct ArcProto *proto) | |||
226 | } | 221 | } |
227 | } | 222 | } |
228 | 223 | ||
229 | /* | 224 | /* Add a buffer to the queue. Only the interrupt handler is allowed to do |
230 | * Add a buffer to the queue. Only the interrupt handler is allowed to do | ||
231 | * this, unless interrupts are disabled. | 225 | * this, unless interrupts are disabled. |
232 | * | 226 | * |
233 | * Note: we don't check for a full queue, since there aren't enough buffers | 227 | * 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 | } | 244 | } |
251 | } | 245 | } |
252 | 246 | ||
253 | /* | 247 | /* Get a buffer from the queue. |
254 | * Get a buffer from the queue. If this returns -1, there are no buffers | 248 | * If this returns -1, there are no buffers available. |
255 | * available. | ||
256 | */ | 249 | */ |
257 | static int get_arcbuf(struct net_device *dev) | 250 | static int get_arcbuf(struct net_device *dev) |
258 | { | 251 | { |
@@ -346,8 +339,7 @@ struct net_device *alloc_arcdev(const char *name) | |||
346 | return dev; | 339 | return dev; |
347 | } | 340 | } |
348 | 341 | ||
349 | /* | 342 | /* Open/initialize the board. This is called sometime after booting when |
350 | * Open/initialize the board. This is called sometime after booting when | ||
351 | * the 'ifconfig' program is run. | 343 | * the 'ifconfig' program is run. |
352 | * | 344 | * |
353 | * This routine should set everything up anew at each open, even registers | 345 | * 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 | BUGMSG(D_DEBUG, "arc_raw_proto used. proto='%c'\n", proto->suffix); | 482 | BUGMSG(D_DEBUG, "arc_raw_proto used. proto='%c'\n", proto->suffix); |
491 | _daddr = daddr ? *(uint8_t *)daddr : 0; | 483 | _daddr = daddr ? *(uint8_t *)daddr : 0; |
492 | } else if (!daddr) { | 484 | } else if (!daddr) { |
493 | /* | 485 | /* if the dest addr isn't provided, we can't choose an |
494 | * if the dest addr isn't provided, we can't choose an encapsulation! | 486 | * encapsulation! Store the packet type (eg. ETH_P_IP) |
495 | * Store the packet type (eg. ETH_P_IP) for now, and we'll push on a | 487 | * for now, and we'll push on a real header when we do |
496 | * real header when we do rebuild_header. | 488 | * rebuild_header. |
497 | */ | 489 | */ |
498 | *(uint16_t *)skb_push(skb, 2) = type; | 490 | *(uint16_t *)skb_push(skb, 2) = type; |
499 | /* | 491 | /* XXX: Why not use skb->mac_len? */ |
500 | * XXX: Why not use skb->mac_len? | ||
501 | */ | ||
502 | if (skb->network_header - skb->mac_header != 2) | 492 | if (skb->network_header - skb->mac_header != 2) |
503 | BUGMSG(D_NORMAL, "arcnet_header: Yikes! diff (%d) is not 2!\n", | 493 | BUGMSG(D_NORMAL, "arcnet_header: Yikes! diff (%d) is not 2!\n", |
504 | (int)(skb->network_header - skb->mac_header)); | 494 | (int)(skb->network_header - skb->mac_header)); |
@@ -564,7 +554,8 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb, | |||
564 | if (proto->prepare_tx(dev, pkt, skb->len, txbuf) && | 554 | if (proto->prepare_tx(dev, pkt, skb->len, txbuf) && |
565 | !proto->ack_tx) { | 555 | !proto->ack_tx) { |
566 | /* done right away and we don't want to acknowledge | 556 | /* done right away and we don't want to acknowledge |
567 | the package later - forget about it now */ | 557 | * the package later - forget about it now |
558 | */ | ||
568 | dev->stats.tx_bytes += skb->len; | 559 | dev->stats.tx_bytes += skb->len; |
569 | freeskb = 1; | 560 | freeskb = 1; |
570 | } else { | 561 | } else { |
@@ -605,8 +596,7 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb, | |||
605 | return retval; /* no need to try again */ | 596 | return retval; /* no need to try again */ |
606 | } | 597 | } |
607 | 598 | ||
608 | /* | 599 | /* Actually start transmitting a packet that was loaded into a buffer |
609 | * Actually start transmitting a packet that was loaded into a buffer | ||
610 | * by prepare_tx. This should _only_ be called by the interrupt handler. | 600 | * by prepare_tx. This should _only_ be called by the interrupt handler. |
611 | */ | 601 | */ |
612 | static int go_tx(struct net_device *dev) | 602 | static int go_tx(struct net_device *dev) |
@@ -672,8 +662,7 @@ void arcnet_timeout(struct net_device *dev) | |||
672 | netif_wake_queue(dev); | 662 | netif_wake_queue(dev); |
673 | } | 663 | } |
674 | 664 | ||
675 | /* | 665 | /* The typical workload of the driver: Handle the network interface |
676 | * The typical workload of the driver: Handle the network interface | ||
677 | * interrupts. Establish which device needs attention, and call the correct | 666 | * interrupts. Establish which device needs attention, and call the correct |
678 | * chipset interrupt handler. | 667 | * chipset interrupt handler. |
679 | */ | 668 | */ |
@@ -693,9 +682,8 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) | |||
693 | 682 | ||
694 | spin_lock(&lp->lock); | 683 | spin_lock(&lp->lock); |
695 | 684 | ||
696 | /* | 685 | /* RESET flag was enabled - if device is not running, we must |
697 | * RESET flag was enabled - if device is not running, we must clear it right | 686 | * clear it right away (but nothing else). |
698 | * away (but nothing else). | ||
699 | */ | 687 | */ |
700 | if (!netif_running(dev)) { | 688 | if (!netif_running(dev)) { |
701 | if (ASTATUS() & RESETflag) | 689 | if (ASTATUS() & RESETflag) |
@@ -717,11 +705,11 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) | |||
717 | __FILE__, __LINE__, __func__, status); | 705 | __FILE__, __LINE__, __func__, status); |
718 | didsomething = 0; | 706 | didsomething = 0; |
719 | 707 | ||
720 | /* | 708 | /* RESET flag was enabled - card is resetting and if RX is |
721 | * RESET flag was enabled - card is resetting and if RX is | ||
722 | * disabled, it's NOT because we just got a packet. | 709 | * disabled, it's NOT because we just got a packet. |
723 | * | 710 | * |
724 | * The card is in an undefined state. Clear it out and start over. | 711 | * The card is in an undefined state. |
712 | * Clear it out and start over. | ||
725 | */ | 713 | */ |
726 | if (status & RESETflag) { | 714 | if (status & RESETflag) { |
727 | BUGMSG(D_NORMAL, "spurious reset (status=%Xh)\n", status); | 715 | BUGMSG(D_NORMAL, "spurious reset (status=%Xh)\n", status); |
@@ -731,14 +719,13 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) | |||
731 | /* get out of the interrupt handler! */ | 719 | /* get out of the interrupt handler! */ |
732 | break; | 720 | break; |
733 | } | 721 | } |
734 | /* | 722 | /* RX is inhibited - we must have received something. |
735 | * RX is inhibited - we must have received something. Prepare to | 723 | * Prepare to receive into the next buffer. |
736 | * receive into the next buffer. | ||
737 | * | 724 | * |
738 | * We don't actually copy the received packet from the card until | 725 | * We don't actually copy the received packet from the card |
739 | * after the transmit handler runs (and possibly launches the next | 726 | * until after the transmit handler runs (and possibly |
740 | * tx); this should improve latency slightly if we get both types | 727 | * launches the next tx); this should improve latency slightly |
741 | * of interrupts at once. | 728 | * if we get both types of interrupts at once. |
742 | */ | 729 | */ |
743 | recbuf = -1; | 730 | recbuf = -1; |
744 | if (status & lp->intmask & NORXflag) { | 731 | if (status & lp->intmask & NORXflag) { |
@@ -914,8 +901,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) | |||
914 | return retval; | 901 | return retval; |
915 | } | 902 | } |
916 | 903 | ||
917 | /* | 904 | /* This is a generic packet receiver that calls arcnet??_rx depending on the |
918 | * This is a generic packet receiver that calls arcnet??_rx depending on the | ||
919 | * protocol ID found. | 905 | * protocol ID found. |
920 | */ | 906 | */ |
921 | static void arcnet_rx(struct net_device *dev, int bufnum) | 907 | static void arcnet_rx(struct net_device *dev, int bufnum) |
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c index 36648d350959..8391324f684b 100644 --- a/drivers/net/arcnet/capmode.c +++ b/drivers/net/arcnet/capmode.c | |||
@@ -66,11 +66,11 @@ static void rx(struct net_device *dev, int bufnum, | |||
66 | pkt = (struct archdr *)skb_mac_header(skb); | 66 | pkt = (struct archdr *)skb_mac_header(skb); |
67 | skb_pull(skb, ARC_HDR_SIZE); | 67 | skb_pull(skb, ARC_HDR_SIZE); |
68 | 68 | ||
69 | /* up to sizeof(pkt->soft) has already been copied from the card */ | 69 | /* up to sizeof(pkt->soft) has already been copied from the card |
70 | /* squeeze in an int for the cap encapsulation */ | 70 | * squeeze in an int for the cap encapsulation |
71 | 71 | * use these variables to be sure we count in bytes, not in | |
72 | /* use these variables to be sure we count in bytes, not in | 72 | * sizeof(struct archdr) |
73 | sizeof(struct archdr) */ | 73 | */ |
74 | pktbuf = (char *)pkt; | 74 | pktbuf = (char *)pkt; |
75 | pkthdrbuf = (char *)pkthdr; | 75 | pkthdrbuf = (char *)pkthdr; |
76 | memcpy(pktbuf, pkthdrbuf, ARC_HDR_SIZE + sizeof(pkt->soft.cap.proto)); | 76 | 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 | netif_rx(skb); | 90 | netif_rx(skb); |
91 | } | 91 | } |
92 | 92 | ||
93 | /* | 93 | /* Create the ARCnet hard/soft headers for cap mode. |
94 | * Create the ARCnet hard/soft headers for cap mode. | ||
95 | * There aren't any soft headers in cap mode - not even the protocol id. | 94 | * There aren't any soft headers in cap mode - not even the protocol id. |
96 | */ | 95 | */ |
97 | static int build_header(struct sk_buff *skb, | 96 | static int build_header(struct sk_buff *skb, |
@@ -104,8 +103,8 @@ static int build_header(struct sk_buff *skb, | |||
104 | 103 | ||
105 | BUGMSG(D_PROTO, "Preparing header for cap packet %x.\n", | 104 | BUGMSG(D_PROTO, "Preparing header for cap packet %x.\n", |
106 | *((int *)&pkt->soft.cap.cookie[0])); | 105 | *((int *)&pkt->soft.cap.cookie[0])); |
107 | /* | 106 | |
108 | * Set the source hardware address. | 107 | /* Set the source hardware address. |
109 | * | 108 | * |
110 | * This is pretty pointless for most purposes, but it can help in | 109 | * This is pretty pointless for most purposes, but it can help in |
111 | * debugging. ARCnet does not allow us to change the source address in | 110 | * 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 | /* see linux/net/ethernet/eth.c to see where I got the following */ | 115 | /* see linux/net/ethernet/eth.c to see where I got the following */ |
117 | 116 | ||
118 | if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) { | 117 | if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) { |
119 | /* | 118 | /* FIXME: fill in the last byte of the dest ipaddr here to |
120 | * FIXME: fill in the last byte of the dest ipaddr here to better | 119 | * better comply with RFC1051 in "noarp" mode. |
121 | * comply with RFC1051 in "noarp" mode. | ||
122 | */ | 120 | */ |
123 | pkt->hard.dest = 0; | 121 | pkt->hard.dest = 0; |
124 | return hdr_size; | 122 | return hdr_size; |
@@ -172,7 +170,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | |||
172 | sizeof(pkt->soft.cap.proto)); | 170 | sizeof(pkt->soft.cap.proto)); |
173 | 171 | ||
174 | /* Skip the extra integer we have written into it as a cookie | 172 | /* Skip the extra integer we have written into it as a cookie |
175 | but write the rest of the message: */ | 173 | * but write the rest of the message: |
174 | */ | ||
176 | lp->hw.copy_to_card(dev, bufnum, ofs + 1, | 175 | lp->hw.copy_to_card(dev, bufnum, ofs + 1, |
177 | ((unsigned char *)&pkt->soft.cap.mes), length - 1); | 176 | ((unsigned char *)&pkt->soft.cap.mes), length - 1); |
178 | 177 | ||
diff --git a/drivers/net/arcnet/com20020-isa.c b/drivers/net/arcnet/com20020-isa.c index d829e605470f..6e38a19d7210 100644 --- a/drivers/net/arcnet/com20020-isa.c +++ b/drivers/net/arcnet/com20020-isa.c | |||
@@ -43,8 +43,7 @@ | |||
43 | 43 | ||
44 | #define VERSION "arcnet: COM20020 ISA support (by David Woodhouse et al.)\n" | 44 | #define VERSION "arcnet: COM20020 ISA support (by David Woodhouse et al.)\n" |
45 | 45 | ||
46 | /* | 46 | /* We cannot (yet) probe for an IO mapped card, although we can check that |
47 | * We cannot (yet) probe for an IO mapped card, although we can check that | ||
48 | * it's where we were told it was, and even do autoirq. | 47 | * it's where we were told it was, and even do autoirq. |
49 | */ | 48 | */ |
50 | static int __init com20020isa_probe(struct net_device *dev) | 49 | static int __init com20020isa_probe(struct net_device *dev) |
diff --git a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c index bdf883f9870e..63697272f146 100644 --- a/drivers/net/arcnet/com20020.c +++ b/drivers/net/arcnet/com20020.c | |||
@@ -239,8 +239,7 @@ int com20020_found(struct net_device *dev, int shared) | |||
239 | return 0; | 239 | return 0; |
240 | } | 240 | } |
241 | 241 | ||
242 | /* | 242 | /* Do a hardware reset on the card, and set up necessary registers. |
243 | * Do a hardware reset on the card, and set up necessary registers. | ||
244 | * | 243 | * |
245 | * This should be called as little as possible, because it disrupts the | 244 | * This should be called as little as possible, because it disrupts the |
246 | * token on the network (causes a RECON) and requires a significant delay. | 245 | * token on the network (causes a RECON) and requires a significant delay. |
diff --git a/drivers/net/arcnet/com20020_cs.c b/drivers/net/arcnet/com20020_cs.c index 437b456afe68..13fe53864383 100644 --- a/drivers/net/arcnet/com20020_cs.c +++ b/drivers/net/arcnet/com20020_cs.c | |||
@@ -162,8 +162,7 @@ static void com20020_detach(struct pcmcia_device *link) | |||
162 | 162 | ||
163 | unregister_netdev(dev); | 163 | unregister_netdev(dev); |
164 | 164 | ||
165 | /* | 165 | /* this is necessary because we register our IRQ separately |
166 | * this is necessary because we register our IRQ separately | ||
167 | * from card services. | 166 | * from card services. |
168 | */ | 167 | */ |
169 | if (dev->irq) | 168 | if (dev->irq) |
diff --git a/drivers/net/arcnet/com90io.c b/drivers/net/arcnet/com90io.c index 32333465327a..6ec36f9975ba 100644 --- a/drivers/net/arcnet/com90io.c +++ b/drivers/net/arcnet/com90io.c | |||
@@ -137,8 +137,7 @@ static void put_whole_buffer(struct net_device *dev, unsigned offset, unsigned l | |||
137 | #endif | 137 | #endif |
138 | } | 138 | } |
139 | 139 | ||
140 | /* | 140 | /* We cannot probe for an IO mapped card either, although we can check that |
141 | * We cannot probe for an IO mapped card either, although we can check that | ||
142 | * it's where we were told it was, and even autoirq | 141 | * it's where we were told it was, and even autoirq |
143 | */ | 142 | */ |
144 | static int __init com90io_probe(struct net_device *dev) | 143 | static int __init com90io_probe(struct net_device *dev) |
@@ -196,8 +195,7 @@ static int __init com90io_probe(struct net_device *dev) | |||
196 | goto err_out; | 195 | goto err_out; |
197 | } | 196 | } |
198 | if (!dev->irq) { | 197 | if (!dev->irq) { |
199 | /* | 198 | /* if we do this, we're sure to get an IRQ since the |
200 | * if we do this, we're sure to get an IRQ since the | ||
201 | * card has just reset and the NORXflag is on until | 199 | * card has just reset and the NORXflag is on until |
202 | * we tell it to start receiving. | 200 | * we tell it to start receiving. |
203 | */ | 201 | */ |
@@ -272,8 +270,7 @@ static int __init com90io_found(struct net_device *dev) | |||
272 | return 0; | 270 | return 0; |
273 | } | 271 | } |
274 | 272 | ||
275 | /* | 273 | /* Do a hardware reset on the card, and set up necessary registers. |
276 | * Do a hardware reset on the card, and set up necessary registers. | ||
277 | * | 274 | * |
278 | * This should be called as little as possible, because it disrupts the | 275 | * This should be called as little as possible, because it disrupts the |
279 | * token on the network (causes a RECON) and requires a significant delay. | 276 | * token on the network (causes a RECON) and requires a significant delay. |
diff --git a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c index 0b7bc869db21..4781cd696dd1 100644 --- a/drivers/net/arcnet/com90xx.c +++ b/drivers/net/arcnet/com90xx.c | |||
@@ -568,8 +568,7 @@ static void com90xx_setmask(struct net_device *dev, int mask) | |||
568 | AINTMASK(mask); | 568 | AINTMASK(mask); |
569 | } | 569 | } |
570 | 570 | ||
571 | /* | 571 | /* Do a hardware reset on the card, and set up necessary registers. |
572 | * Do a hardware reset on the card, and set up necessary registers. | ||
573 | * | 572 | * |
574 | * This should be called as little as possible, because it disrupts the | 573 | * This should be called as little as possible, because it disrupts the |
575 | * token on the network (causes a RECON) and requires a significant delay. | 574 | * token on the network (causes a RECON) and requires a significant delay. |
diff --git a/drivers/net/arcnet/rfc1051.c b/drivers/net/arcnet/rfc1051.c index ed7b6459bbfa..e78b76535acc 100644 --- a/drivers/net/arcnet/rfc1051.c +++ b/drivers/net/arcnet/rfc1051.c | |||
@@ -78,8 +78,7 @@ module_exit(arcnet_rfc1051_exit); | |||
78 | 78 | ||
79 | MODULE_LICENSE("GPL"); | 79 | MODULE_LICENSE("GPL"); |
80 | 80 | ||
81 | /* | 81 | /* Determine a packet's protocol ID. |
82 | * Determine a packet's protocol ID. | ||
83 | * | 82 | * |
84 | * With ARCnet we have to convert everything to Ethernet-style stuff. | 83 | * With ARCnet we have to convert everything to Ethernet-style stuff. |
85 | */ | 84 | */ |
@@ -156,9 +155,7 @@ static void rx(struct net_device *dev, int bufnum, | |||
156 | netif_rx(skb); | 155 | netif_rx(skb); |
157 | } | 156 | } |
158 | 157 | ||
159 | /* | 158 | /* Create the ARCnet hard/soft headers for RFC1051 */ |
160 | * Create the ARCnet hard/soft headers for RFC1051. | ||
161 | */ | ||
162 | static int build_header(struct sk_buff *skb, struct net_device *dev, | 159 | static int build_header(struct sk_buff *skb, struct net_device *dev, |
163 | unsigned short type, uint8_t daddr) | 160 | unsigned short type, uint8_t daddr) |
164 | { | 161 | { |
@@ -182,21 +179,19 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, | |||
182 | return 0; | 179 | return 0; |
183 | } | 180 | } |
184 | 181 | ||
185 | /* | 182 | /* Set the source hardware address. |
186 | * Set the source hardware address. | ||
187 | * | 183 | * |
188 | * This is pretty pointless for most purposes, but it can help in | 184 | * This is pretty pointless for most purposes, but it can help in |
189 | * debugging. ARCnet does not allow us to change the source address in | 185 | * debugging. ARCnet does not allow us to change the source address |
190 | * the actual packet sent) | 186 | * in the actual packet sent. |
191 | */ | 187 | */ |
192 | pkt->hard.source = *dev->dev_addr; | 188 | pkt->hard.source = *dev->dev_addr; |
193 | 189 | ||
194 | /* see linux/net/ethernet/eth.c to see where I got the following */ | 190 | /* see linux/net/ethernet/eth.c to see where I got the following */ |
195 | 191 | ||
196 | if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) { | 192 | if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) { |
197 | /* | 193 | /* FIXME: fill in the last byte of the dest ipaddr here to |
198 | * FIXME: fill in the last byte of the dest ipaddr here to better | 194 | * better comply with RFC1051 in "noarp" mode. |
199 | * comply with RFC1051 in "noarp" mode. | ||
200 | */ | 195 | */ |
201 | pkt->hard.dest = 0; | 196 | pkt->hard.dest = 0; |
202 | return hdr_size; | 197 | return hdr_size; |
diff --git a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c index 47750173fd14..4ebfbcbe5de3 100644 --- a/drivers/net/arcnet/rfc1201.c +++ b/drivers/net/arcnet/rfc1201.c | |||
@@ -81,8 +81,7 @@ static void __exit arcnet_rfc1201_exit(void) | |||
81 | module_init(arcnet_rfc1201_init); | 81 | module_init(arcnet_rfc1201_init); |
82 | module_exit(arcnet_rfc1201_exit); | 82 | module_exit(arcnet_rfc1201_exit); |
83 | 83 | ||
84 | /* | 84 | /* Determine a packet's protocol ID. |
85 | * Determine a packet's protocol ID. | ||
86 | * | 85 | * |
87 | * With ARCnet we have to convert everything to Ethernet-style stuff. | 86 | * With ARCnet we have to convert everything to Ethernet-style stuff. |
88 | */ | 87 | */ |
@@ -193,10 +192,10 @@ static void rx(struct net_device *dev, int bufnum, | |||
193 | pkt->soft.raw + sizeof(pkt->soft), | 192 | pkt->soft.raw + sizeof(pkt->soft), |
194 | length - sizeof(pkt->soft)); | 193 | length - sizeof(pkt->soft)); |
195 | 194 | ||
196 | /* | 195 | /* ARP packets have problems when sent from some DOS systems: |
197 | * ARP packets have problems when sent from some DOS systems: the | 196 | * the source address is always 0! |
198 | * source address is always 0! So we take the hardware source addr | 197 | * So we take the hardware source addr (which is impossible |
199 | * (which is impossible to fumble) and insert it ourselves. | 198 | * to fumble) and insert it ourselves. |
200 | */ | 199 | */ |
201 | if (soft->proto == ARC_P_ARP) { | 200 | if (soft->proto == ARC_P_ARP) { |
202 | struct arphdr *arp = (struct arphdr *)soft->payload; | 201 | struct arphdr *arp = (struct arphdr *)soft->payload; |
@@ -227,21 +226,22 @@ static void rx(struct net_device *dev, int bufnum, | |||
227 | skb->protocol = type_trans(skb, dev); | 226 | skb->protocol = type_trans(skb, dev); |
228 | netif_rx(skb); | 227 | netif_rx(skb); |
229 | } else { /* split packet */ | 228 | } else { /* split packet */ |
230 | /* | 229 | /* NOTE: MSDOS ARP packet correction should only need to |
231 | * NOTE: MSDOS ARP packet correction should only need to apply to | 230 | * apply to unsplit packets, since ARP packets are so short. |
232 | * unsplit packets, since ARP packets are so short. | ||
233 | * | 231 | * |
234 | * My interpretation of the RFC1201 document is that if a packet is | 232 | * My interpretation of the RFC1201 document is that if a |
235 | * received out of order, the entire assembly process should be | 233 | * packet is received out of order, the entire assembly |
236 | * aborted. | 234 | * process should be aborted. |
237 | * | 235 | * |
238 | * The RFC also mentions "it is possible for successfully received | 236 | * The RFC also mentions "it is possible for successfully |
239 | * packets to be retransmitted." As of 0.40 all previously received | 237 | * received packets to be retransmitted." As of 0.40 all |
240 | * packets are allowed, not just the most recent one. | 238 | * previously received packets are allowed, not just the |
239 | * most recent one. | ||
241 | * | 240 | * |
242 | * We allow multiple assembly processes, one for each ARCnet card | 241 | * We allow multiple assembly processes, one for each |
243 | * possible on the network. Seems rather like a waste of memory, | 242 | * ARCnet card possible on the network. |
244 | * but there's no other way to be reliable. | 243 | * Seems rather like a waste of memory, but there's no |
244 | * other way to be reliable. | ||
245 | */ | 245 | */ |
246 | 246 | ||
247 | BUGMSG(D_RX, "packet is split (splitflag=%d, seq=%d)\n", | 247 | 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 | } else { /* not first packet */ | 299 | } else { /* not first packet */ |
300 | int packetnum = ((unsigned)soft->split_flag >> 1) + 1; | 300 | int packetnum = ((unsigned)soft->split_flag >> 1) + 1; |
301 | 301 | ||
302 | /* | 302 | /* if we're not assembling, there's no point trying to |
303 | * if we're not assembling, there's no point trying to | ||
304 | * continue. | 303 | * continue. |
305 | */ | 304 | */ |
306 | if (!in->skb) { | 305 | if (!in->skb) { |
@@ -401,12 +400,11 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, | |||
401 | return 0; | 400 | return 0; |
402 | } | 401 | } |
403 | 402 | ||
404 | /* | 403 | /* Set the source hardware address. |
405 | * Set the source hardware address. | ||
406 | * | 404 | * |
407 | * This is pretty pointless for most purposes, but it can help in | 405 | * This is pretty pointless for most purposes, but it can help in |
408 | * debugging. ARCnet does not allow us to change the source address in | 406 | * debugging. ARCnet does not allow us to change the source address |
409 | * the actual packet sent) | 407 | * in the actual packet sent. |
410 | */ | 408 | */ |
411 | pkt->hard.source = *dev->dev_addr; | 409 | pkt->hard.source = *dev->dev_addr; |
412 | 410 | ||
@@ -416,10 +414,10 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, | |||
416 | /* see linux/net/ethernet/eth.c to see where I got the following */ | 414 | /* see linux/net/ethernet/eth.c to see where I got the following */ |
417 | 415 | ||
418 | if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) { | 416 | if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) { |
419 | /* | 417 | /* FIXME: fill in the last byte of the dest ipaddr here |
420 | * FIXME: fill in the last byte of the dest ipaddr here to better | 418 | * to better comply with RFC1051 in "noarp" mode. |
421 | * comply with RFC1051 in "noarp" mode. For now, always broadcasting | 419 | * For now, always broadcasting will probably at least get |
422 | * will probably at least get packets sent out :) | 420 | * packets sent out :) |
423 | */ | 421 | */ |
424 | pkt->hard.dest = 0; | 422 | pkt->hard.dest = 0; |
425 | return hdr_size; | 423 | return hdr_size; |