diff options
| author | Joe Perches <joe@perches.com> | 2015-05-05 13:05:49 -0400 |
|---|---|---|
| committer | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2015-09-23 02:44:23 -0400 |
| commit | 7f5e760c1b269044a4ba1b269263beca80ae2741 (patch) | |
| tree | 0dd375faf8641f80967c456e1ff3fbdda86c1771 /drivers/net/arcnet | |
| parent | 01a1d5ac4e1a5890fd6c0d0ae900e1b6e4f851d6 (diff) | |
arcnet: Use normal kernel brace style
Move braces normal kernel locations.
Add missing braces.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Diffstat (limited to 'drivers/net/arcnet')
| -rw-r--r-- | drivers/net/arcnet/arc-rawmode.c | 6 | ||||
| -rw-r--r-- | drivers/net/arcnet/arcnet.c | 38 | ||||
| -rw-r--r-- | drivers/net/arcnet/capmode.c | 6 | ||||
| -rw-r--r-- | drivers/net/arcnet/com20020.c | 15 | ||||
| -rw-r--r-- | drivers/net/arcnet/com20020_cs.c | 31 | ||||
| -rw-r--r-- | drivers/net/arcnet/com90xx.c | 3 | ||||
| -rw-r--r-- | drivers/net/arcnet/rfc1051.c | 10 | ||||
| -rw-r--r-- | drivers/net/arcnet/rfc1201.c | 14 |
8 files changed, 52 insertions, 71 deletions
diff --git a/drivers/net/arcnet/arc-rawmode.c b/drivers/net/arcnet/arc-rawmode.c index 251a98b0bf78..500b5bb2cff4 100644 --- a/drivers/net/arcnet/arc-rawmode.c +++ b/drivers/net/arcnet/arc-rawmode.c | |||
| @@ -42,8 +42,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, | |||
| 42 | static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | 42 | static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, |
| 43 | int bufnum); | 43 | int bufnum); |
| 44 | 44 | ||
| 45 | static struct ArcProto rawmode_proto = | 45 | static struct ArcProto rawmode_proto = { |
| 46 | { | ||
| 47 | .suffix = 'r', | 46 | .suffix = 'r', |
| 48 | .mtu = XMTU, | 47 | .mtu = XMTU, |
| 49 | .rx = rx, | 48 | .rx = rx, |
| @@ -183,8 +182,9 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | |||
| 183 | } else if (length > MTU) { | 182 | } else if (length > MTU) { |
| 184 | hard->offset[0] = 0; | 183 | hard->offset[0] = 0; |
| 185 | hard->offset[1] = ofs = 512 - length - 3; | 184 | hard->offset[1] = ofs = 512 - length - 3; |
| 186 | } else | 185 | } else { |
| 187 | hard->offset[0] = ofs = 256 - length; | 186 | hard->offset[0] = ofs = 256 - length; |
| 187 | } | ||
| 188 | 188 | ||
| 189 | BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n", | 189 | BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n", |
| 190 | length, ofs); | 190 | length, ofs); |
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index bb49753f8203..24c0a6415023 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c | |||
| @@ -72,8 +72,7 @@ static void arcnet_rx(struct net_device *dev, int bufnum); | |||
| 72 | struct ArcProto *arc_proto_map[256], *arc_proto_default, | 72 | struct ArcProto *arc_proto_map[256], *arc_proto_default, |
| 73 | *arc_bcast_proto, *arc_raw_proto; | 73 | *arc_bcast_proto, *arc_raw_proto; |
| 74 | 74 | ||
| 75 | static struct ArcProto arc_proto_null = | 75 | static struct ArcProto arc_proto_null = { |
| 76 | { | ||
| 77 | .suffix = '?', | 76 | .suffix = '?', |
| 78 | .mtu = XMTU, | 77 | .mtu = XMTU, |
| 79 | .is_ip = 0, | 78 | .is_ip = 0, |
| @@ -264,14 +263,13 @@ static int get_arcbuf(struct net_device *dev) | |||
| 264 | /* already in this function */ | 263 | /* already in this function */ |
| 265 | BUGMSG(D_NORMAL, "get_arcbuf: overlap (%d)!\n", | 264 | BUGMSG(D_NORMAL, "get_arcbuf: overlap (%d)!\n", |
| 266 | lp->buf_lock.counter); | 265 | lp->buf_lock.counter); |
| 267 | } | 266 | } else { /* we can continue */ |
| 268 | else { /* we can continue */ | ||
| 269 | if (lp->next_buf >= 5) | 267 | if (lp->next_buf >= 5) |
| 270 | lp->next_buf -= 5; | 268 | lp->next_buf -= 5; |
| 271 | 269 | ||
| 272 | if (lp->next_buf == lp->first_free_buf) | 270 | if (lp->next_buf == lp->first_free_buf) { |
| 273 | BUGMSG(D_NORMAL, "get_arcbuf: BUG: no buffers are available??\n"); | 271 | BUGMSG(D_NORMAL, "get_arcbuf: BUG: no buffers are available??\n"); |
| 274 | else { | 272 | } else { |
| 275 | buf = lp->buf_queue[lp->next_buf++]; | 273 | buf = lp->buf_queue[lp->next_buf++]; |
| 276 | lp->next_buf %= 5; | 274 | lp->next_buf %= 5; |
| 277 | } | 275 | } |
| @@ -330,7 +328,6 @@ static void arcdev_setup(struct net_device *dev) | |||
| 330 | 328 | ||
| 331 | /* New-style flags. */ | 329 | /* New-style flags. */ |
| 332 | dev->flags = IFF_BROADCAST; | 330 | dev->flags = IFF_BROADCAST; |
| 333 | |||
| 334 | } | 331 | } |
| 335 | 332 | ||
| 336 | struct net_device *alloc_arcdev(const char *name) | 333 | struct net_device *alloc_arcdev(const char *name) |
| @@ -494,8 +491,7 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev, | |||
| 494 | proto = arc_raw_proto; | 491 | proto = arc_raw_proto; |
| 495 | BUGMSG(D_DEBUG, "arc_raw_proto used. proto='%c'\n", proto->suffix); | 492 | BUGMSG(D_DEBUG, "arc_raw_proto used. proto='%c'\n", proto->suffix); |
| 496 | _daddr = daddr ? *(uint8_t *)daddr : 0; | 493 | _daddr = daddr ? *(uint8_t *)daddr : 0; |
| 497 | } | 494 | } else if (!daddr) { |
| 498 | else if (!daddr) { | ||
| 499 | /* | 495 | /* |
| 500 | * if the dest addr isn't provided, we can't choose an encapsulation! | 496 | * if the dest addr isn't provided, we can't choose an encapsulation! |
| 501 | * Store the packet type (eg. ETH_P_IP) for now, and we'll push on a | 497 | * Store the packet type (eg. ETH_P_IP) for now, and we'll push on a |
| @@ -509,8 +505,7 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev, | |||
| 509 | BUGMSG(D_NORMAL, "arcnet_header: Yikes! diff (%d) is not 2!\n", | 505 | BUGMSG(D_NORMAL, "arcnet_header: Yikes! diff (%d) is not 2!\n", |
| 510 | (int)(skb->network_header - skb->mac_header)); | 506 | (int)(skb->network_header - skb->mac_header)); |
| 511 | return -2; /* return error -- can't transmit yet! */ | 507 | return -2; /* return error -- can't transmit yet! */ |
| 512 | } | 508 | } else { |
| 513 | else { | ||
| 514 | /* otherwise, we can just add the header as usual. */ | 509 | /* otherwise, we can just add the header as usual. */ |
| 515 | _daddr = *(uint8_t *)daddr; | 510 | _daddr = *(uint8_t *)daddr; |
| 516 | proto_num = lp->default_proto[_daddr]; | 511 | proto_num = lp->default_proto[_daddr]; |
| @@ -564,9 +559,9 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb, | |||
| 564 | AINTMASK(0); | 559 | AINTMASK(0); |
| 565 | if (lp->next_tx == -1) | 560 | if (lp->next_tx == -1) |
| 566 | txbuf = get_arcbuf(dev); | 561 | txbuf = get_arcbuf(dev); |
| 567 | else { | 562 | else |
| 568 | txbuf = -1; | 563 | txbuf = -1; |
| 569 | } | 564 | |
| 570 | if (txbuf != -1) { | 565 | if (txbuf != -1) { |
| 571 | if (proto->prepare_tx(dev, pkt, skb->len, txbuf) && | 566 | if (proto->prepare_tx(dev, pkt, skb->len, txbuf) && |
| 572 | !proto->ack_tx) { | 567 | !proto->ack_tx) { |
| @@ -606,9 +601,9 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb, | |||
| 606 | BUGMSG(D_DEBUG, "%s: %d: %s, status: %x\n", __FILE__, __LINE__, __func__, ASTATUS()); | 601 | BUGMSG(D_DEBUG, "%s: %d: %s, status: %x\n", __FILE__, __LINE__, __func__, ASTATUS()); |
| 607 | 602 | ||
| 608 | spin_unlock_irqrestore(&lp->lock, flags); | 603 | spin_unlock_irqrestore(&lp->lock, flags); |
| 609 | if (freeskb) { | 604 | if (freeskb) |
| 610 | dev_kfree_skb(skb); | 605 | dev_kfree_skb(skb); |
| 611 | } | 606 | |
| 612 | return retval; /* no need to try again */ | 607 | return retval; /* no need to try again */ |
| 613 | } | 608 | } |
| 614 | 609 | ||
| @@ -830,8 +825,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) | |||
| 830 | if (lp->outgoing.proto->continue_tx(dev, txbuf)) { | 825 | if (lp->outgoing.proto->continue_tx(dev, txbuf)) { |
| 831 | /* that was the last segment */ | 826 | /* that was the last segment */ |
| 832 | dev->stats.tx_bytes += lp->outgoing.skb->len; | 827 | dev->stats.tx_bytes += lp->outgoing.skb->len; |
| 833 | if (!lp->outgoing.proto->ack_tx) | 828 | if (!lp->outgoing.proto->ack_tx) { |
| 834 | { | ||
| 835 | dev_kfree_skb_irq(lp->outgoing.skb); | 829 | dev_kfree_skb_irq(lp->outgoing.skb); |
| 836 | lp->outgoing.proto = NULL; | 830 | lp->outgoing.proto = NULL; |
| 837 | } | 831 | } |
| @@ -908,11 +902,9 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) | |||
| 908 | BUGMSG(D_DURING, "not recon: clearing counters anyway.\n"); | 902 | BUGMSG(D_DURING, "not recon: clearing counters anyway.\n"); |
| 909 | } | 903 | } |
| 910 | 904 | ||
| 911 | if (didsomething) { | 905 | if (didsomething) |
| 912 | retval |= IRQ_HANDLED; | 906 | retval |= IRQ_HANDLED; |
| 913 | } | 907 | } while (--boguscount && didsomething); |
| 914 | } | ||
| 915 | while (--boguscount && didsomething); | ||
| 916 | 908 | ||
| 917 | BUGMSG(D_DURING, "arcnet_interrupt complete (status=%Xh, count=%d)\n", | 909 | BUGMSG(D_DURING, "arcnet_interrupt complete (status=%Xh, count=%d)\n", |
| 918 | ASTATUS(), boguscount); | 910 | ASTATUS(), boguscount); |
| @@ -949,9 +941,9 @@ static void arcnet_rx(struct net_device *dev, int bufnum) | |||
| 949 | } | 941 | } |
| 950 | 942 | ||
| 951 | /* get the full header, if possible */ | 943 | /* get the full header, if possible */ |
| 952 | if (sizeof(pkt.soft) <= length) | 944 | if (sizeof(pkt.soft) <= length) { |
| 953 | lp->hw.copy_from_card(dev, bufnum, ofs, soft, sizeof(pkt.soft)); | 945 | lp->hw.copy_from_card(dev, bufnum, ofs, soft, sizeof(pkt.soft)); |
| 954 | else { | 946 | } else { |
| 955 | memset(&pkt.soft, 0, sizeof(pkt.soft)); | 947 | memset(&pkt.soft, 0, sizeof(pkt.soft)); |
| 956 | lp->hw.copy_from_card(dev, bufnum, ofs, soft, length); | 948 | lp->hw.copy_from_card(dev, bufnum, ofs, soft, length); |
| 957 | } | 949 | } |
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c index 02815ff891f2..36648d350959 100644 --- a/drivers/net/arcnet/capmode.c +++ b/drivers/net/arcnet/capmode.c | |||
| @@ -159,8 +159,9 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | |||
| 159 | } else if (length > MTU) { | 159 | } else if (length > MTU) { |
| 160 | hard->offset[0] = 0; | 160 | hard->offset[0] = 0; |
| 161 | hard->offset[1] = ofs = 512 - length - 3; | 161 | hard->offset[1] = ofs = 512 - length - 3; |
| 162 | } else | 162 | } else { |
| 163 | hard->offset[0] = ofs = 256 - length; | 163 | hard->offset[0] = ofs = 256 - length; |
| 164 | } | ||
| 164 | 165 | ||
| 165 | BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n", | 166 | BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n", |
| 166 | length, ofs); | 167 | length, ofs); |
| @@ -226,8 +227,7 @@ free_outskb: | |||
| 226 | return 0; | 227 | return 0; |
| 227 | } | 228 | } |
| 228 | 229 | ||
| 229 | static struct ArcProto capmode_proto = | 230 | static struct ArcProto capmode_proto = { |
| 230 | { | ||
| 231 | 'r', | 231 | 'r', |
| 232 | XMTU, | 232 | XMTU, |
| 233 | 0, | 233 | 0, |
diff --git a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c index c749af6db94e..48a45d30b2e5 100644 --- a/drivers/net/arcnet/com20020.c +++ b/drivers/net/arcnet/com20020.c | |||
| @@ -41,10 +41,11 @@ | |||
| 41 | 41 | ||
| 42 | #define VERSION "arcnet: COM20020 chipset support (by David Woodhouse et al.)\n" | 42 | #define VERSION "arcnet: COM20020 chipset support (by David Woodhouse et al.)\n" |
| 43 | 43 | ||
| 44 | static char *clockrates[] = | 44 | static char *clockrates[] = { |
| 45 | {"10 Mb/s", "Reserved", "5 Mb/s", | 45 | "XXXXXXX", "XXXXXXXX", "XXXXXX", |
| 46 | "2.5 Mb/s", "1.25Mb/s", "625 Kb/s", "312.5 Kb/s", | 46 | "2.5 Mb/s", "1.25Mb/s", "625 Kb/s", "312.5 Kb/s", |
| 47 | "156.25 Kb/s", "Reserved", "Reserved", "Reserved"}; | 47 | "156.25 Kb/s", "Reserved", "Reserved", "Reserved" |
| 48 | }; | ||
| 48 | 49 | ||
| 49 | static void com20020_command(struct net_device *dev, int command); | 50 | static void com20020_command(struct net_device *dev, int command); |
| 50 | static int com20020_status(struct net_device *dev); | 51 | static int com20020_status(struct net_device *dev); |
| @@ -102,8 +103,7 @@ int com20020_check(struct net_device *dev) | |||
| 102 | SET_SUBADR(SUB_SETUP1); | 103 | SET_SUBADR(SUB_SETUP1); |
| 103 | outb(lp->setup, _XREG); | 104 | outb(lp->setup, _XREG); |
| 104 | 105 | ||
| 105 | if (lp->clockm != 0) | 106 | if (lp->clockm != 0) { |
| 106 | { | ||
| 107 | SET_SUBADR(SUB_SETUP2); | 107 | SET_SUBADR(SUB_SETUP2); |
| 108 | outb(lp->setup2, _XREG); | 108 | outb(lp->setup2, _XREG); |
| 109 | 109 | ||
| @@ -196,8 +196,7 @@ int com20020_found(struct net_device *dev, int shared) | |||
| 196 | SET_SUBADR(SUB_SETUP1); | 196 | SET_SUBADR(SUB_SETUP1); |
| 197 | outb(lp->setup, _XREG); | 197 | outb(lp->setup, _XREG); |
| 198 | 198 | ||
| 199 | if (lp->card_flags & ARC_CAN_10MBIT) | 199 | if (lp->card_flags & ARC_CAN_10MBIT) { |
| 200 | { | ||
| 201 | SET_SUBADR(SUB_SETUP2); | 200 | SET_SUBADR(SUB_SETUP2); |
| 202 | outb(lp->setup2, _XREG); | 201 | outb(lp->setup2, _XREG); |
| 203 | 202 | ||
diff --git a/drivers/net/arcnet/com20020_cs.c b/drivers/net/arcnet/com20020_cs.c index 2eafb298626b..532410bb3dd8 100644 --- a/drivers/net/arcnet/com20020_cs.c +++ b/drivers/net/arcnet/com20020_cs.c | |||
| @@ -56,8 +56,7 @@ static void regdump(struct net_device *dev) | |||
| 56 | int count; | 56 | int count; |
| 57 | 57 | ||
| 58 | netdev_dbg(dev, "register dump:\n"); | 58 | netdev_dbg(dev, "register dump:\n"); |
| 59 | for (count = ioaddr; count < ioaddr + 16; count++) | 59 | for (count = ioaddr; count < ioaddr + 16; count++) { |
| 60 | { | ||
| 61 | if (!(count % 16)) | 60 | if (!(count % 16)) |
| 62 | pr_cont("%04X:", count); | 61 | pr_cont("%04X:", count); |
| 63 | pr_cont(" %02X", inb(count)); | 62 | pr_cont(" %02X", inb(count)); |
| @@ -70,8 +69,7 @@ static void regdump(struct net_device *dev) | |||
| 70 | outb((count >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI); | 69 | outb((count >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI); |
| 71 | outb(count & 0xff, _ADDR_LO); | 70 | outb(count & 0xff, _ADDR_LO); |
| 72 | 71 | ||
| 73 | for (count = 0; count < 256 + 32; count++) | 72 | for (count = 0; count < 256 + 32; count++) { |
| 74 | { | ||
| 75 | if (!(count % 16)) | 73 | if (!(count % 16)) |
| 76 | pr_cont("%04X:", count); | 74 | pr_cont("%04X:", count); |
| 77 | 75 | ||
| @@ -175,11 +173,9 @@ static void com20020_detach(struct pcmcia_device *link) | |||
| 175 | 173 | ||
| 176 | /* Unlink device structure, free bits */ | 174 | /* Unlink device structure, free bits */ |
| 177 | dev_dbg(&link->dev, "unlinking...\n"); | 175 | dev_dbg(&link->dev, "unlinking...\n"); |
| 178 | if (link->priv) | 176 | if (link->priv) { |
| 179 | { | ||
| 180 | dev = info->dev; | 177 | dev = info->dev; |
| 181 | if (dev) | 178 | if (dev) { |
| 182 | { | ||
| 183 | dev_dbg(&link->dev, "kfree...\n"); | 179 | dev_dbg(&link->dev, "kfree...\n"); |
| 184 | free_netdev(dev); | 180 | free_netdev(dev); |
| 185 | } | 181 | } |
| @@ -210,21 +206,18 @@ static int com20020_config(struct pcmcia_device *link) | |||
| 210 | i = -ENODEV; | 206 | i = -ENODEV; |
| 211 | link->io_lines = 16; | 207 | link->io_lines = 16; |
| 212 | 208 | ||
| 213 | if (!link->resource[0]->start) | 209 | if (!link->resource[0]->start) { |
| 214 | { | 210 | for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) { |
| 215 | for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) | ||
| 216 | { | ||
| 217 | link->resource[0]->start = ioaddr; | 211 | link->resource[0]->start = ioaddr; |
| 218 | i = pcmcia_request_io(link); | 212 | i = pcmcia_request_io(link); |
| 219 | if (i == 0) | 213 | if (i == 0) |
| 220 | break; | 214 | break; |
| 221 | } | 215 | } |
| 222 | } | 216 | } else { |
| 223 | else | ||
| 224 | i = pcmcia_request_io(link); | 217 | i = pcmcia_request_io(link); |
| 218 | } | ||
| 225 | 219 | ||
| 226 | if (i != 0) | 220 | if (i != 0) { |
| 227 | { | ||
| 228 | dev_dbg(&link->dev, "requestIO failed totally!\n"); | 221 | dev_dbg(&link->dev, "requestIO failed totally!\n"); |
| 229 | goto failed; | 222 | goto failed; |
| 230 | } | 223 | } |
| @@ -234,8 +227,7 @@ static int com20020_config(struct pcmcia_device *link) | |||
| 234 | 227 | ||
| 235 | dev_dbg(&link->dev, "request IRQ %d\n", | 228 | dev_dbg(&link->dev, "request IRQ %d\n", |
| 236 | link->irq); | 229 | link->irq); |
| 237 | if (!link->irq) | 230 | if (!link->irq) { |
| 238 | { | ||
| 239 | dev_dbg(&link->dev, "requestIRQ failed totally!\n"); | 231 | dev_dbg(&link->dev, "requestIRQ failed totally!\n"); |
| 240 | goto failed; | 232 | goto failed; |
| 241 | } | 233 | } |
| @@ -246,8 +238,7 @@ static int com20020_config(struct pcmcia_device *link) | |||
| 246 | if (ret) | 238 | if (ret) |
| 247 | goto failed; | 239 | goto failed; |
| 248 | 240 | ||
| 249 | if (com20020_check(dev)) | 241 | if (com20020_check(dev)) { |
| 250 | { | ||
| 251 | regdump(dev); | 242 | regdump(dev); |
| 252 | goto failed; | 243 | goto failed; |
| 253 | } | 244 | } |
diff --git a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c index f0f06a274045..c16bfde97fbe 100644 --- a/drivers/net/arcnet/com90xx.c +++ b/drivers/net/arcnet/com90xx.c | |||
| @@ -112,8 +112,7 @@ static void __init com90xx_probe(void) | |||
| 112 | { | 112 | { |
| 113 | int count, status, ioaddr, numprint, airq, openparen = 0; | 113 | int count, status, ioaddr, numprint, airq, openparen = 0; |
| 114 | unsigned long airqmask; | 114 | unsigned long airqmask; |
| 115 | int ports[(0x3f0 - 0x200) / 16 + 1] = | 115 | int ports[(0x3f0 - 0x200) / 16 + 1] = { 0 }; |
| 116 | {0}; | ||
| 117 | unsigned long *shmems; | 116 | unsigned long *shmems; |
| 118 | void __iomem **iomem; | 117 | void __iomem **iomem; |
| 119 | int numports, numshmems, *port; | 118 | int numports, numshmems, *port; |
diff --git a/drivers/net/arcnet/rfc1051.c b/drivers/net/arcnet/rfc1051.c index 49d35c972bca..ed7b6459bbfa 100644 --- a/drivers/net/arcnet/rfc1051.c +++ b/drivers/net/arcnet/rfc1051.c | |||
| @@ -42,8 +42,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, | |||
| 42 | static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | 42 | static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, |
| 43 | int bufnum); | 43 | int bufnum); |
| 44 | 44 | ||
| 45 | static struct ArcProto rfc1051_proto = | 45 | static struct ArcProto rfc1051_proto = { |
| 46 | { | ||
| 47 | .suffix = 's', | 46 | .suffix = 's', |
| 48 | .mtu = XMTU - RFC1051_HDR_SIZE, | 47 | .mtu = XMTU - RFC1051_HDR_SIZE, |
| 49 | .is_ip = 1, | 48 | .is_ip = 1, |
| @@ -94,9 +93,9 @@ static __be16 type_trans(struct sk_buff *skb, struct net_device *dev) | |||
| 94 | skb_reset_mac_header(skb); | 93 | skb_reset_mac_header(skb); |
| 95 | skb_pull(skb, hdr_size); | 94 | skb_pull(skb, hdr_size); |
| 96 | 95 | ||
| 97 | if (pkt->hard.dest == 0) | 96 | if (pkt->hard.dest == 0) { |
| 98 | skb->pkt_type = PACKET_BROADCAST; | 97 | skb->pkt_type = PACKET_BROADCAST; |
| 99 | else if (dev->flags & IFF_PROMISC) { | 98 | } else if (dev->flags & IFF_PROMISC) { |
| 100 | /* if we're not sending to ourselves :) */ | 99 | /* if we're not sending to ourselves :) */ |
| 101 | if (pkt->hard.dest != dev->dev_addr[0]) | 100 | if (pkt->hard.dest != dev->dev_addr[0]) |
| 102 | skb->pkt_type = PACKET_OTHERHOST; | 101 | skb->pkt_type = PACKET_OTHERHOST; |
| @@ -232,8 +231,9 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | |||
| 232 | } else if (length > MTU) { | 231 | } else if (length > MTU) { |
| 233 | hard->offset[0] = 0; | 232 | hard->offset[0] = 0; |
| 234 | hard->offset[1] = ofs = 512 - length - 3; | 233 | hard->offset[1] = ofs = 512 - length - 3; |
| 235 | } else | 234 | } else { |
| 236 | hard->offset[0] = ofs = 256 - length; | 235 | hard->offset[0] = ofs = 256 - length; |
| 236 | } | ||
| 237 | 237 | ||
| 238 | lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE); | 238 | lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE); |
| 239 | lp->hw.copy_to_card(dev, bufnum, ofs, &pkt->soft, length); | 239 | lp->hw.copy_to_card(dev, bufnum, ofs, &pkt->soft, length); |
diff --git a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c index 15f103a8a9db..4abb20e26ead 100644 --- a/drivers/net/arcnet/rfc1201.c +++ b/drivers/net/arcnet/rfc1201.c | |||
| @@ -43,8 +43,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, | |||
| 43 | int bufnum); | 43 | int bufnum); |
| 44 | static int continue_tx(struct net_device *dev, int bufnum); | 44 | static int continue_tx(struct net_device *dev, int bufnum); |
| 45 | 45 | ||
| 46 | static struct ArcProto rfc1201_proto = | 46 | static struct ArcProto rfc1201_proto = { |
| 47 | { | ||
| 48 | .suffix = 'a', | 47 | .suffix = 'a', |
| 49 | .mtu = 1500, /* could be more, but some receivers can't handle it... */ | 48 | .mtu = 1500, /* could be more, but some receivers can't handle it... */ |
| 50 | .is_ip = 1, /* This is for sending IP and ARP packages */ | 49 | .is_ip = 1, /* This is for sending IP and ARP packages */ |
| @@ -97,9 +96,9 @@ static __be16 type_trans(struct sk_buff *skb, struct net_device *dev) | |||
| 97 | skb_reset_mac_header(skb); | 96 | skb_reset_mac_header(skb); |
| 98 | skb_pull(skb, hdr_size); | 97 | skb_pull(skb, hdr_size); |
| 99 | 98 | ||
| 100 | if (pkt->hard.dest == 0) | 99 | if (pkt->hard.dest == 0) { |
| 101 | skb->pkt_type = PACKET_BROADCAST; | 100 | skb->pkt_type = PACKET_BROADCAST; |
| 102 | else if (dev->flags & IFF_PROMISC) { | 101 | } else if (dev->flags & IFF_PROMISC) { |
| 103 | /* if we're not sending to ourselves :) */ | 102 | /* if we're not sending to ourselves :) */ |
| 104 | if (pkt->hard.dest != dev->dev_addr[0]) | 103 | if (pkt->hard.dest != dev->dev_addr[0]) |
| 105 | skb->pkt_type = PACKET_OTHERHOST; | 104 | skb->pkt_type = PACKET_OTHERHOST; |
| @@ -146,9 +145,9 @@ static void rx(struct net_device *dev, int bufnum, | |||
| 146 | ofs = 256 - length; | 145 | ofs = 256 - length; |
| 147 | 146 | ||
| 148 | if (soft->split_flag == 0xFF) { /* Exception Packet */ | 147 | if (soft->split_flag == 0xFF) { /* Exception Packet */ |
| 149 | if (length >= 4 + RFC1201_HDR_SIZE) | 148 | if (length >= 4 + RFC1201_HDR_SIZE) { |
| 150 | BUGMSG(D_DURING, "compensating for exception packet\n"); | 149 | BUGMSG(D_DURING, "compensating for exception packet\n"); |
| 151 | else { | 150 | } else { |
| 152 | BUGMSG(D_EXTRA, "short RFC1201 exception packet from %02Xh", | 151 | BUGMSG(D_EXTRA, "short RFC1201 exception packet from %02Xh", |
| 153 | saddr); | 152 | saddr); |
| 154 | return; | 153 | return; |
| @@ -456,8 +455,9 @@ static void load_pkt(struct net_device *dev, struct arc_hardware *hard, | |||
| 456 | hard->offset[1] = ofs - RFC1201_HDR_SIZE; | 455 | hard->offset[1] = ofs - RFC1201_HDR_SIZE; |
| 457 | lp->hw.copy_to_card(dev, bufnum, ofs - RFC1201_HDR_SIZE, | 456 | lp->hw.copy_to_card(dev, bufnum, ofs - RFC1201_HDR_SIZE, |
| 458 | &excsoft, RFC1201_HDR_SIZE); | 457 | &excsoft, RFC1201_HDR_SIZE); |
| 459 | } else | 458 | } else { |
| 460 | hard->offset[0] = ofs = 256 - softlen; | 459 | hard->offset[0] = ofs = 256 - softlen; |
| 460 | } | ||
| 461 | 461 | ||
| 462 | lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE); | 462 | lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE); |
| 463 | lp->hw.copy_to_card(dev, bufnum, ofs, soft, softlen); | 463 | lp->hw.copy_to_card(dev, bufnum, ofs, soft, softlen); |
