Loading drivers/net/arcnet/arc-rawmode.c +3 −3 Original line number Diff line number Diff line Loading @@ -42,8 +42,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, int bufnum); static struct ArcProto rawmode_proto = { static struct ArcProto rawmode_proto = { .suffix = 'r', .mtu = XMTU, .rx = rx, Loading Loading @@ -183,8 +182,9 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, } else if (length > MTU) { hard->offset[0] = 0; hard->offset[1] = ofs = 512 - length - 3; } else } else { hard->offset[0] = ofs = 256 - length; } BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n", length, ofs); Loading drivers/net/arcnet/arcnet.c +15 −23 Original line number Diff line number Diff line Loading @@ -72,8 +72,7 @@ static void arcnet_rx(struct net_device *dev, int bufnum); struct ArcProto *arc_proto_map[256], *arc_proto_default, *arc_bcast_proto, *arc_raw_proto; static struct ArcProto arc_proto_null = { static struct ArcProto arc_proto_null = { .suffix = '?', .mtu = XMTU, .is_ip = 0, Loading Loading @@ -264,14 +263,13 @@ static int get_arcbuf(struct net_device *dev) /* already in this function */ BUGMSG(D_NORMAL, "get_arcbuf: overlap (%d)!\n", lp->buf_lock.counter); } else { /* we can continue */ } else { /* we can continue */ if (lp->next_buf >= 5) lp->next_buf -= 5; if (lp->next_buf == lp->first_free_buf) if (lp->next_buf == lp->first_free_buf) { BUGMSG(D_NORMAL, "get_arcbuf: BUG: no buffers are available??\n"); else { } else { buf = lp->buf_queue[lp->next_buf++]; lp->next_buf %= 5; } Loading Loading @@ -330,7 +328,6 @@ static void arcdev_setup(struct net_device *dev) /* New-style flags. */ dev->flags = IFF_BROADCAST; } struct net_device *alloc_arcdev(const char *name) Loading Loading @@ -494,8 +491,7 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev, proto = arc_raw_proto; BUGMSG(D_DEBUG, "arc_raw_proto used. proto='%c'\n", proto->suffix); _daddr = daddr ? *(uint8_t *)daddr : 0; } else if (!daddr) { } else if (!daddr) { /* * if the dest addr isn't provided, we can't choose an encapsulation! * Store the packet type (eg. ETH_P_IP) for now, and we'll push on a Loading @@ -509,8 +505,7 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev, BUGMSG(D_NORMAL, "arcnet_header: Yikes! diff (%d) is not 2!\n", (int)(skb->network_header - skb->mac_header)); return -2; /* return error -- can't transmit yet! */ } else { } else { /* otherwise, we can just add the header as usual. */ _daddr = *(uint8_t *)daddr; proto_num = lp->default_proto[_daddr]; Loading Loading @@ -564,9 +559,9 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb, AINTMASK(0); if (lp->next_tx == -1) txbuf = get_arcbuf(dev); else { else txbuf = -1; } if (txbuf != -1) { if (proto->prepare_tx(dev, pkt, skb->len, txbuf) && !proto->ack_tx) { Loading Loading @@ -606,9 +601,9 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb, BUGMSG(D_DEBUG, "%s: %d: %s, status: %x\n", __FILE__, __LINE__, __func__, ASTATUS()); spin_unlock_irqrestore(&lp->lock, flags); if (freeskb) { if (freeskb) dev_kfree_skb(skb); } return retval; /* no need to try again */ } Loading Loading @@ -830,8 +825,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) if (lp->outgoing.proto->continue_tx(dev, txbuf)) { /* that was the last segment */ dev->stats.tx_bytes += lp->outgoing.skb->len; if (!lp->outgoing.proto->ack_tx) { if (!lp->outgoing.proto->ack_tx) { dev_kfree_skb_irq(lp->outgoing.skb); lp->outgoing.proto = NULL; } Loading Loading @@ -908,11 +902,9 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) BUGMSG(D_DURING, "not recon: clearing counters anyway.\n"); } if (didsomething) { if (didsomething) retval |= IRQ_HANDLED; } } while (--boguscount && didsomething); } while (--boguscount && didsomething); BUGMSG(D_DURING, "arcnet_interrupt complete (status=%Xh, count=%d)\n", ASTATUS(), boguscount); Loading Loading @@ -949,9 +941,9 @@ static void arcnet_rx(struct net_device *dev, int bufnum) } /* get the full header, if possible */ if (sizeof(pkt.soft) <= length) if (sizeof(pkt.soft) <= length) { lp->hw.copy_from_card(dev, bufnum, ofs, soft, sizeof(pkt.soft)); else { } else { memset(&pkt.soft, 0, sizeof(pkt.soft)); lp->hw.copy_from_card(dev, bufnum, ofs, soft, length); } Loading drivers/net/arcnet/capmode.c +3 −3 Original line number Diff line number Diff line Loading @@ -159,8 +159,9 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, } else if (length > MTU) { hard->offset[0] = 0; hard->offset[1] = ofs = 512 - length - 3; } else } else { hard->offset[0] = ofs = 256 - length; } BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n", length, ofs); Loading Loading @@ -226,8 +227,7 @@ static int ack_tx(struct net_device *dev, int acked) return 0; } static struct ArcProto capmode_proto = { static struct ArcProto capmode_proto = { 'r', XMTU, 0, Loading drivers/net/arcnet/com20020.c +7 −8 Original line number Diff line number Diff line Loading @@ -41,10 +41,11 @@ #define VERSION "arcnet: COM20020 chipset support (by David Woodhouse et al.)\n" static char *clockrates[] = {"10 Mb/s", "Reserved", "5 Mb/s", static char *clockrates[] = { "XXXXXXX", "XXXXXXXX", "XXXXXX", "2.5 Mb/s", "1.25Mb/s", "625 Kb/s", "312.5 Kb/s", "156.25 Kb/s", "Reserved", "Reserved", "Reserved"}; "156.25 Kb/s", "Reserved", "Reserved", "Reserved" }; static void com20020_command(struct net_device *dev, int command); static int com20020_status(struct net_device *dev); Loading Loading @@ -102,8 +103,7 @@ int com20020_check(struct net_device *dev) SET_SUBADR(SUB_SETUP1); outb(lp->setup, _XREG); if (lp->clockm != 0) { if (lp->clockm != 0) { SET_SUBADR(SUB_SETUP2); outb(lp->setup2, _XREG); Loading Loading @@ -196,8 +196,7 @@ int com20020_found(struct net_device *dev, int shared) SET_SUBADR(SUB_SETUP1); outb(lp->setup, _XREG); if (lp->card_flags & ARC_CAN_10MBIT) { if (lp->card_flags & ARC_CAN_10MBIT) { SET_SUBADR(SUB_SETUP2); outb(lp->setup2, _XREG); Loading drivers/net/arcnet/com20020_cs.c +11 −20 Original line number Diff line number Diff line Loading @@ -56,8 +56,7 @@ static void regdump(struct net_device *dev) int count; netdev_dbg(dev, "register dump:\n"); for (count = ioaddr; count < ioaddr + 16; count++) { for (count = ioaddr; count < ioaddr + 16; count++) { if (!(count % 16)) pr_cont("%04X:", count); pr_cont(" %02X", inb(count)); Loading @@ -70,8 +69,7 @@ static void regdump(struct net_device *dev) outb((count >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI); outb(count & 0xff, _ADDR_LO); for (count = 0; count < 256 + 32; count++) { for (count = 0; count < 256 + 32; count++) { if (!(count % 16)) pr_cont("%04X:", count); Loading Loading @@ -175,11 +173,9 @@ static void com20020_detach(struct pcmcia_device *link) /* Unlink device structure, free bits */ dev_dbg(&link->dev, "unlinking...\n"); if (link->priv) { if (link->priv) { dev = info->dev; if (dev) { if (dev) { dev_dbg(&link->dev, "kfree...\n"); free_netdev(dev); } Loading Loading @@ -210,21 +206,18 @@ static int com20020_config(struct pcmcia_device *link) i = -ENODEV; link->io_lines = 16; if (!link->resource[0]->start) { for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) { if (!link->resource[0]->start) { for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) { link->resource[0]->start = ioaddr; i = pcmcia_request_io(link); if (i == 0) break; } } else } else { i = pcmcia_request_io(link); } if (i != 0) { if (i != 0) { dev_dbg(&link->dev, "requestIO failed totally!\n"); goto failed; } Loading @@ -234,8 +227,7 @@ static int com20020_config(struct pcmcia_device *link) dev_dbg(&link->dev, "request IRQ %d\n", link->irq); if (!link->irq) { if (!link->irq) { dev_dbg(&link->dev, "requestIRQ failed totally!\n"); goto failed; } Loading @@ -246,8 +238,7 @@ static int com20020_config(struct pcmcia_device *link) if (ret) goto failed; if (com20020_check(dev)) { if (com20020_check(dev)) { regdump(dev); goto failed; } Loading Loading
drivers/net/arcnet/arc-rawmode.c +3 −3 Original line number Diff line number Diff line Loading @@ -42,8 +42,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, int bufnum); static struct ArcProto rawmode_proto = { static struct ArcProto rawmode_proto = { .suffix = 'r', .mtu = XMTU, .rx = rx, Loading Loading @@ -183,8 +182,9 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, } else if (length > MTU) { hard->offset[0] = 0; hard->offset[1] = ofs = 512 - length - 3; } else } else { hard->offset[0] = ofs = 256 - length; } BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n", length, ofs); Loading
drivers/net/arcnet/arcnet.c +15 −23 Original line number Diff line number Diff line Loading @@ -72,8 +72,7 @@ static void arcnet_rx(struct net_device *dev, int bufnum); struct ArcProto *arc_proto_map[256], *arc_proto_default, *arc_bcast_proto, *arc_raw_proto; static struct ArcProto arc_proto_null = { static struct ArcProto arc_proto_null = { .suffix = '?', .mtu = XMTU, .is_ip = 0, Loading Loading @@ -264,14 +263,13 @@ static int get_arcbuf(struct net_device *dev) /* already in this function */ BUGMSG(D_NORMAL, "get_arcbuf: overlap (%d)!\n", lp->buf_lock.counter); } else { /* we can continue */ } else { /* we can continue */ if (lp->next_buf >= 5) lp->next_buf -= 5; if (lp->next_buf == lp->first_free_buf) if (lp->next_buf == lp->first_free_buf) { BUGMSG(D_NORMAL, "get_arcbuf: BUG: no buffers are available??\n"); else { } else { buf = lp->buf_queue[lp->next_buf++]; lp->next_buf %= 5; } Loading Loading @@ -330,7 +328,6 @@ static void arcdev_setup(struct net_device *dev) /* New-style flags. */ dev->flags = IFF_BROADCAST; } struct net_device *alloc_arcdev(const char *name) Loading Loading @@ -494,8 +491,7 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev, proto = arc_raw_proto; BUGMSG(D_DEBUG, "arc_raw_proto used. proto='%c'\n", proto->suffix); _daddr = daddr ? *(uint8_t *)daddr : 0; } else if (!daddr) { } else if (!daddr) { /* * if the dest addr isn't provided, we can't choose an encapsulation! * Store the packet type (eg. ETH_P_IP) for now, and we'll push on a Loading @@ -509,8 +505,7 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev, BUGMSG(D_NORMAL, "arcnet_header: Yikes! diff (%d) is not 2!\n", (int)(skb->network_header - skb->mac_header)); return -2; /* return error -- can't transmit yet! */ } else { } else { /* otherwise, we can just add the header as usual. */ _daddr = *(uint8_t *)daddr; proto_num = lp->default_proto[_daddr]; Loading Loading @@ -564,9 +559,9 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb, AINTMASK(0); if (lp->next_tx == -1) txbuf = get_arcbuf(dev); else { else txbuf = -1; } if (txbuf != -1) { if (proto->prepare_tx(dev, pkt, skb->len, txbuf) && !proto->ack_tx) { Loading Loading @@ -606,9 +601,9 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb, BUGMSG(D_DEBUG, "%s: %d: %s, status: %x\n", __FILE__, __LINE__, __func__, ASTATUS()); spin_unlock_irqrestore(&lp->lock, flags); if (freeskb) { if (freeskb) dev_kfree_skb(skb); } return retval; /* no need to try again */ } Loading Loading @@ -830,8 +825,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) if (lp->outgoing.proto->continue_tx(dev, txbuf)) { /* that was the last segment */ dev->stats.tx_bytes += lp->outgoing.skb->len; if (!lp->outgoing.proto->ack_tx) { if (!lp->outgoing.proto->ack_tx) { dev_kfree_skb_irq(lp->outgoing.skb); lp->outgoing.proto = NULL; } Loading Loading @@ -908,11 +902,9 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id) BUGMSG(D_DURING, "not recon: clearing counters anyway.\n"); } if (didsomething) { if (didsomething) retval |= IRQ_HANDLED; } } while (--boguscount && didsomething); } while (--boguscount && didsomething); BUGMSG(D_DURING, "arcnet_interrupt complete (status=%Xh, count=%d)\n", ASTATUS(), boguscount); Loading Loading @@ -949,9 +941,9 @@ static void arcnet_rx(struct net_device *dev, int bufnum) } /* get the full header, if possible */ if (sizeof(pkt.soft) <= length) if (sizeof(pkt.soft) <= length) { lp->hw.copy_from_card(dev, bufnum, ofs, soft, sizeof(pkt.soft)); else { } else { memset(&pkt.soft, 0, sizeof(pkt.soft)); lp->hw.copy_from_card(dev, bufnum, ofs, soft, length); } Loading
drivers/net/arcnet/capmode.c +3 −3 Original line number Diff line number Diff line Loading @@ -159,8 +159,9 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, } else if (length > MTU) { hard->offset[0] = 0; hard->offset[1] = ofs = 512 - length - 3; } else } else { hard->offset[0] = ofs = 256 - length; } BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n", length, ofs); Loading Loading @@ -226,8 +227,7 @@ static int ack_tx(struct net_device *dev, int acked) return 0; } static struct ArcProto capmode_proto = { static struct ArcProto capmode_proto = { 'r', XMTU, 0, Loading
drivers/net/arcnet/com20020.c +7 −8 Original line number Diff line number Diff line Loading @@ -41,10 +41,11 @@ #define VERSION "arcnet: COM20020 chipset support (by David Woodhouse et al.)\n" static char *clockrates[] = {"10 Mb/s", "Reserved", "5 Mb/s", static char *clockrates[] = { "XXXXXXX", "XXXXXXXX", "XXXXXX", "2.5 Mb/s", "1.25Mb/s", "625 Kb/s", "312.5 Kb/s", "156.25 Kb/s", "Reserved", "Reserved", "Reserved"}; "156.25 Kb/s", "Reserved", "Reserved", "Reserved" }; static void com20020_command(struct net_device *dev, int command); static int com20020_status(struct net_device *dev); Loading Loading @@ -102,8 +103,7 @@ int com20020_check(struct net_device *dev) SET_SUBADR(SUB_SETUP1); outb(lp->setup, _XREG); if (lp->clockm != 0) { if (lp->clockm != 0) { SET_SUBADR(SUB_SETUP2); outb(lp->setup2, _XREG); Loading Loading @@ -196,8 +196,7 @@ int com20020_found(struct net_device *dev, int shared) SET_SUBADR(SUB_SETUP1); outb(lp->setup, _XREG); if (lp->card_flags & ARC_CAN_10MBIT) { if (lp->card_flags & ARC_CAN_10MBIT) { SET_SUBADR(SUB_SETUP2); outb(lp->setup2, _XREG); Loading
drivers/net/arcnet/com20020_cs.c +11 −20 Original line number Diff line number Diff line Loading @@ -56,8 +56,7 @@ static void regdump(struct net_device *dev) int count; netdev_dbg(dev, "register dump:\n"); for (count = ioaddr; count < ioaddr + 16; count++) { for (count = ioaddr; count < ioaddr + 16; count++) { if (!(count % 16)) pr_cont("%04X:", count); pr_cont(" %02X", inb(count)); Loading @@ -70,8 +69,7 @@ static void regdump(struct net_device *dev) outb((count >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI); outb(count & 0xff, _ADDR_LO); for (count = 0; count < 256 + 32; count++) { for (count = 0; count < 256 + 32; count++) { if (!(count % 16)) pr_cont("%04X:", count); Loading Loading @@ -175,11 +173,9 @@ static void com20020_detach(struct pcmcia_device *link) /* Unlink device structure, free bits */ dev_dbg(&link->dev, "unlinking...\n"); if (link->priv) { if (link->priv) { dev = info->dev; if (dev) { if (dev) { dev_dbg(&link->dev, "kfree...\n"); free_netdev(dev); } Loading Loading @@ -210,21 +206,18 @@ static int com20020_config(struct pcmcia_device *link) i = -ENODEV; link->io_lines = 16; if (!link->resource[0]->start) { for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) { if (!link->resource[0]->start) { for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) { link->resource[0]->start = ioaddr; i = pcmcia_request_io(link); if (i == 0) break; } } else } else { i = pcmcia_request_io(link); } if (i != 0) { if (i != 0) { dev_dbg(&link->dev, "requestIO failed totally!\n"); goto failed; } Loading @@ -234,8 +227,7 @@ static int com20020_config(struct pcmcia_device *link) dev_dbg(&link->dev, "request IRQ %d\n", link->irq); if (!link->irq) { if (!link->irq) { dev_dbg(&link->dev, "requestIRQ failed totally!\n"); goto failed; } Loading @@ -246,8 +238,7 @@ static int com20020_config(struct pcmcia_device *link) if (ret) goto failed; if (com20020_check(dev)) { if (com20020_check(dev)) { regdump(dev); goto failed; } Loading