Loading drivers/net/wan/c101.c +15 −15 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ * Moxa C101 User's Manual */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/kernel.h> #include <linux/capability.h> Loading Loading @@ -313,44 +315,44 @@ static int __init c101_run(unsigned long irq, unsigned long winbase) int result; if (irq<3 || irq>15 || irq == 6) /* FIXME */ { printk(KERN_ERR "c101: invalid IRQ value\n"); pr_err("invalid IRQ value\n"); return -ENODEV; } if (winbase < 0xC0000 || winbase > 0xDFFFF || (winbase & 0x3FFF) !=0) { printk(KERN_ERR "c101: invalid RAM value\n"); pr_err("invalid RAM value\n"); return -ENODEV; } card = kzalloc(sizeof(card_t), GFP_KERNEL); if (card == NULL) { printk(KERN_ERR "c101: unable to allocate memory\n"); pr_err("unable to allocate memory\n"); return -ENOBUFS; } card->dev = alloc_hdlcdev(card); if (!card->dev) { printk(KERN_ERR "c101: unable to allocate memory\n"); pr_err("unable to allocate memory\n"); kfree(card); return -ENOBUFS; } if (request_irq(irq, sca_intr, 0, devname, card)) { printk(KERN_ERR "c101: could not allocate IRQ\n"); pr_err("could not allocate IRQ\n"); c101_destroy_card(card); return -EBUSY; } card->irq = irq; if (!request_mem_region(winbase, C101_MAPPED_RAM_SIZE, devname)) { printk(KERN_ERR "c101: could not request RAM window\n"); pr_err("could not request RAM window\n"); c101_destroy_card(card); return -EBUSY; } card->phy_winbase = winbase; card->win0base = ioremap(winbase, C101_MAPPED_RAM_SIZE); if (!card->win0base) { printk(KERN_ERR "c101: could not map I/O address\n"); pr_err("could not map I/O address\n"); c101_destroy_card(card); return -EFAULT; } Loading Loading @@ -381,7 +383,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase) result = register_hdlc_device(dev); if (result) { printk(KERN_WARNING "c101: unable to register hdlc device\n"); pr_warn("unable to register hdlc device\n"); c101_destroy_card(card); return result; } Loading @@ -389,10 +391,8 @@ static int __init c101_run(unsigned long irq, unsigned long winbase) sca_init_port(card); /* Set up C101 memory */ set_carrier(card); printk(KERN_INFO "%s: Moxa C101 on IRQ%u," " using %u TX + %u RX packets rings\n", dev->name, card->irq, card->tx_ring_buffers, card->rx_ring_buffers); netdev_info(dev, "Moxa C101 on IRQ%u, using %u TX + %u RX packets rings\n", card->irq, card->tx_ring_buffers, card->rx_ring_buffers); *new_card = card; new_card = &card->next_card; Loading @@ -405,12 +405,12 @@ static int __init c101_init(void) { if (hw == NULL) { #ifdef MODULE printk(KERN_INFO "c101: no card initialized\n"); pr_info("no card initialized\n"); #endif return -EINVAL; /* no parameters specified, abort */ } printk(KERN_INFO "%s\n", version); pr_info("%s\n", version); do { unsigned long irq, ram; Loading @@ -428,7 +428,7 @@ static int __init c101_init(void) return first_card ? 0 : -EINVAL; }while(*hw++ == ':'); printk(KERN_ERR "c101: invalid hardware parameters\n"); pr_err("invalid hardware parameters\n"); return first_card ? 0 : -EINVAL; } Loading drivers/net/wan/hd64570.c +4 −4 Original line number Diff line number Diff line Loading @@ -582,8 +582,8 @@ static void sca_dump_rings(struct net_device *dev) sca_in(DSR_RX(phy_node(port)), card), port->rxin, sca_in(DSR_RX(phy_node(port)), card) & DSR_DE ? "" : "in"); for (cnt = 0; cnt < port_to_card(port)->rx_ring_buffers; cnt++) printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); printk(KERN_CONT "\n"); pr_cont(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); pr_cont("\n"); printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " "last=%u %sactive", Loading @@ -593,8 +593,8 @@ static void sca_dump_rings(struct net_device *dev) sca_in(DSR_TX(phy_node(port)), card) & DSR_DE ? "" : "in"); for (cnt = 0; cnt < port_to_card(port)->tx_ring_buffers; cnt++) printk(" %02X", readb(&(desc_address(port, cnt, 1)->stat))); printk("\n"); pr_cont(" %02X", readb(&(desc_address(port, cnt, 1)->stat))); pr_cont("\n"); printk(KERN_DEBUG "MSCI: MD: %02x %02x %02x, ST: %02x %02x %02x %02x," " FST: %02x CST: %02x %02x\n", Loading drivers/net/wan/hd64572.c +4 −4 Original line number Diff line number Diff line Loading @@ -530,8 +530,8 @@ static void sca_dump_rings(struct net_device *dev) sca_in(DSR_RX(port->chan), card), port->rxin, sca_in(DSR_RX(port->chan), card) & DSR_DE ? "" : "in"); for (cnt = 0; cnt < port->card->rx_ring_buffers; cnt++) printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); printk(KERN_CONT "\n"); pr_cont(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); pr_cont("\n"); printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " "last=%u %sactive", Loading @@ -541,8 +541,8 @@ static void sca_dump_rings(struct net_device *dev) sca_in(DSR_TX(port->chan), card) & DSR_DE ? "" : "in"); for (cnt = 0; cnt < port->card->tx_ring_buffers; cnt++) printk(" %02X", readb(&(desc_address(port, cnt, 1)->stat))); printk("\n"); pr_cont(" %02X", readb(&(desc_address(port, cnt, 1)->stat))); pr_cont("\n"); printk(KERN_DEBUG "MSCI: MD: %02x %02x %02x," " ST: %02x %02x %02x %02x %02x, FST: %02x CST: %02x %02x\n", Loading drivers/net/wan/hdlc.c +9 −7 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ * - proto->start() and stop() are called with spin_lock_irq held. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/errno.h> #include <linux/hdlc.h> #include <linux/if_arp.h> Loading Loading @@ -130,10 +132,10 @@ static int hdlc_device_event(struct notifier_block *this, unsigned long event, goto carrier_exit; if (hdlc->carrier) { printk(KERN_INFO "%s: Carrier detected\n", dev->name); netdev_info(dev, "Carrier detected\n"); hdlc_proto_start(dev); } else { printk(KERN_INFO "%s: Carrier lost\n", dev->name); netdev_info(dev, "Carrier lost\n"); hdlc_proto_stop(dev); } Loading Loading @@ -165,10 +167,10 @@ int hdlc_open(struct net_device *dev) spin_lock_irq(&hdlc->state_lock); if (hdlc->carrier) { printk(KERN_INFO "%s: Carrier detected\n", dev->name); netdev_info(dev, "Carrier detected\n"); hdlc_proto_start(dev); } else printk(KERN_INFO "%s: No carrier\n", dev->name); netdev_info(dev, "No carrier\n"); hdlc->open = 1; Loading Loading @@ -281,8 +283,8 @@ int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, if (size) if ((dev_to_hdlc(dev)->state = kmalloc(size, GFP_KERNEL)) == NULL) { printk(KERN_WARNING "Memory squeeze on" " hdlc_proto_attach()\n"); netdev_warn(dev, "Memory squeeze on hdlc_proto_attach()\n"); module_put(proto->module); return -ENOBUFS; } Loading Loading @@ -363,7 +365,7 @@ static int __init hdlc_module_init(void) { int result; printk(KERN_INFO "%s\n", version); pr_info("%s\n", version); if ((result = register_netdevice_notifier(&hdlc_notifier)) != 0) return result; dev_add_pack(&hdlc_packet_type); Loading drivers/net/wan/hdlc_cisco.c +8 −13 Original line number Diff line number Diff line Loading @@ -103,9 +103,7 @@ static void cisco_keepalive_send(struct net_device *dev, u32 type, skb = dev_alloc_skb(sizeof(struct hdlc_header) + sizeof(struct cisco_packet)); if (!skb) { printk(KERN_WARNING "%s: Memory squeeze on cisco_keepalive_send()\n", dev->name); netdev_warn(dev, "Memory squeeze on cisco_keepalive_send()\n"); return; } skb_reserve(skb, 4); Loading Loading @@ -181,8 +179,8 @@ static int cisco_rx(struct sk_buff *skb) CISCO_PACKET_LEN) && (skb->len != sizeof(struct hdlc_header) + CISCO_BIG_PACKET_LEN)) { printk(KERN_INFO "%s: Invalid length of Cisco control" " packet (%d bytes)\n", dev->name, skb->len); netdev_info(dev, "Invalid length of Cisco control packet (%d bytes)\n", skb->len); goto rx_error; } Loading Loading @@ -217,8 +215,7 @@ static int cisco_rx(struct sk_buff *skb) return NET_RX_SUCCESS; case CISCO_ADDR_REPLY: printk(KERN_INFO "%s: Unexpected Cisco IP address " "reply\n", dev->name); netdev_info(dev, "Unexpected Cisco IP address reply\n"); goto rx_error; case CISCO_KEEPALIVE_REQ: Loading @@ -235,9 +232,8 @@ static int cisco_rx(struct sk_buff *skb) min = sec / 60; sec -= min * 60; hrs = min / 60; min -= hrs * 60; days = hrs / 24; hrs -= days * 24; printk(KERN_INFO "%s: Link up (peer " "uptime %ud%uh%um%us)\n", dev->name, days, hrs, min, sec); netdev_info(dev, "Link up (peer uptime %ud%uh%um%us)\n", days, hrs, min, sec); netif_dormant_off(dev); st->up = 1; } Loading @@ -249,8 +245,7 @@ static int cisco_rx(struct sk_buff *skb) } /* switch (keepalive type) */ } /* switch (protocol) */ printk(KERN_INFO "%s: Unsupported protocol %x\n", dev->name, ntohs(data->protocol)); netdev_info(dev, "Unsupported protocol %x\n", ntohs(data->protocol)); dev_kfree_skb_any(skb); return NET_RX_DROP; Loading @@ -272,7 +267,7 @@ static void cisco_timer(unsigned long arg) if (st->up && time_after(jiffies, st->last_poll + st->settings.timeout * HZ)) { st->up = 0; printk(KERN_INFO "%s: Link down\n", dev->name); netdev_info(dev, "Link down\n"); netif_dormant_on(dev); } Loading Loading
drivers/net/wan/c101.c +15 −15 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ * Moxa C101 User's Manual */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/kernel.h> #include <linux/capability.h> Loading Loading @@ -313,44 +315,44 @@ static int __init c101_run(unsigned long irq, unsigned long winbase) int result; if (irq<3 || irq>15 || irq == 6) /* FIXME */ { printk(KERN_ERR "c101: invalid IRQ value\n"); pr_err("invalid IRQ value\n"); return -ENODEV; } if (winbase < 0xC0000 || winbase > 0xDFFFF || (winbase & 0x3FFF) !=0) { printk(KERN_ERR "c101: invalid RAM value\n"); pr_err("invalid RAM value\n"); return -ENODEV; } card = kzalloc(sizeof(card_t), GFP_KERNEL); if (card == NULL) { printk(KERN_ERR "c101: unable to allocate memory\n"); pr_err("unable to allocate memory\n"); return -ENOBUFS; } card->dev = alloc_hdlcdev(card); if (!card->dev) { printk(KERN_ERR "c101: unable to allocate memory\n"); pr_err("unable to allocate memory\n"); kfree(card); return -ENOBUFS; } if (request_irq(irq, sca_intr, 0, devname, card)) { printk(KERN_ERR "c101: could not allocate IRQ\n"); pr_err("could not allocate IRQ\n"); c101_destroy_card(card); return -EBUSY; } card->irq = irq; if (!request_mem_region(winbase, C101_MAPPED_RAM_SIZE, devname)) { printk(KERN_ERR "c101: could not request RAM window\n"); pr_err("could not request RAM window\n"); c101_destroy_card(card); return -EBUSY; } card->phy_winbase = winbase; card->win0base = ioremap(winbase, C101_MAPPED_RAM_SIZE); if (!card->win0base) { printk(KERN_ERR "c101: could not map I/O address\n"); pr_err("could not map I/O address\n"); c101_destroy_card(card); return -EFAULT; } Loading Loading @@ -381,7 +383,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase) result = register_hdlc_device(dev); if (result) { printk(KERN_WARNING "c101: unable to register hdlc device\n"); pr_warn("unable to register hdlc device\n"); c101_destroy_card(card); return result; } Loading @@ -389,10 +391,8 @@ static int __init c101_run(unsigned long irq, unsigned long winbase) sca_init_port(card); /* Set up C101 memory */ set_carrier(card); printk(KERN_INFO "%s: Moxa C101 on IRQ%u," " using %u TX + %u RX packets rings\n", dev->name, card->irq, card->tx_ring_buffers, card->rx_ring_buffers); netdev_info(dev, "Moxa C101 on IRQ%u, using %u TX + %u RX packets rings\n", card->irq, card->tx_ring_buffers, card->rx_ring_buffers); *new_card = card; new_card = &card->next_card; Loading @@ -405,12 +405,12 @@ static int __init c101_init(void) { if (hw == NULL) { #ifdef MODULE printk(KERN_INFO "c101: no card initialized\n"); pr_info("no card initialized\n"); #endif return -EINVAL; /* no parameters specified, abort */ } printk(KERN_INFO "%s\n", version); pr_info("%s\n", version); do { unsigned long irq, ram; Loading @@ -428,7 +428,7 @@ static int __init c101_init(void) return first_card ? 0 : -EINVAL; }while(*hw++ == ':'); printk(KERN_ERR "c101: invalid hardware parameters\n"); pr_err("invalid hardware parameters\n"); return first_card ? 0 : -EINVAL; } Loading
drivers/net/wan/hd64570.c +4 −4 Original line number Diff line number Diff line Loading @@ -582,8 +582,8 @@ static void sca_dump_rings(struct net_device *dev) sca_in(DSR_RX(phy_node(port)), card), port->rxin, sca_in(DSR_RX(phy_node(port)), card) & DSR_DE ? "" : "in"); for (cnt = 0; cnt < port_to_card(port)->rx_ring_buffers; cnt++) printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); printk(KERN_CONT "\n"); pr_cont(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); pr_cont("\n"); printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " "last=%u %sactive", Loading @@ -593,8 +593,8 @@ static void sca_dump_rings(struct net_device *dev) sca_in(DSR_TX(phy_node(port)), card) & DSR_DE ? "" : "in"); for (cnt = 0; cnt < port_to_card(port)->tx_ring_buffers; cnt++) printk(" %02X", readb(&(desc_address(port, cnt, 1)->stat))); printk("\n"); pr_cont(" %02X", readb(&(desc_address(port, cnt, 1)->stat))); pr_cont("\n"); printk(KERN_DEBUG "MSCI: MD: %02x %02x %02x, ST: %02x %02x %02x %02x," " FST: %02x CST: %02x %02x\n", Loading
drivers/net/wan/hd64572.c +4 −4 Original line number Diff line number Diff line Loading @@ -530,8 +530,8 @@ static void sca_dump_rings(struct net_device *dev) sca_in(DSR_RX(port->chan), card), port->rxin, sca_in(DSR_RX(port->chan), card) & DSR_DE ? "" : "in"); for (cnt = 0; cnt < port->card->rx_ring_buffers; cnt++) printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); printk(KERN_CONT "\n"); pr_cont(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); pr_cont("\n"); printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " "last=%u %sactive", Loading @@ -541,8 +541,8 @@ static void sca_dump_rings(struct net_device *dev) sca_in(DSR_TX(port->chan), card) & DSR_DE ? "" : "in"); for (cnt = 0; cnt < port->card->tx_ring_buffers; cnt++) printk(" %02X", readb(&(desc_address(port, cnt, 1)->stat))); printk("\n"); pr_cont(" %02X", readb(&(desc_address(port, cnt, 1)->stat))); pr_cont("\n"); printk(KERN_DEBUG "MSCI: MD: %02x %02x %02x," " ST: %02x %02x %02x %02x %02x, FST: %02x CST: %02x %02x\n", Loading
drivers/net/wan/hdlc.c +9 −7 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ * - proto->start() and stop() are called with spin_lock_irq held. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/errno.h> #include <linux/hdlc.h> #include <linux/if_arp.h> Loading Loading @@ -130,10 +132,10 @@ static int hdlc_device_event(struct notifier_block *this, unsigned long event, goto carrier_exit; if (hdlc->carrier) { printk(KERN_INFO "%s: Carrier detected\n", dev->name); netdev_info(dev, "Carrier detected\n"); hdlc_proto_start(dev); } else { printk(KERN_INFO "%s: Carrier lost\n", dev->name); netdev_info(dev, "Carrier lost\n"); hdlc_proto_stop(dev); } Loading Loading @@ -165,10 +167,10 @@ int hdlc_open(struct net_device *dev) spin_lock_irq(&hdlc->state_lock); if (hdlc->carrier) { printk(KERN_INFO "%s: Carrier detected\n", dev->name); netdev_info(dev, "Carrier detected\n"); hdlc_proto_start(dev); } else printk(KERN_INFO "%s: No carrier\n", dev->name); netdev_info(dev, "No carrier\n"); hdlc->open = 1; Loading Loading @@ -281,8 +283,8 @@ int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, if (size) if ((dev_to_hdlc(dev)->state = kmalloc(size, GFP_KERNEL)) == NULL) { printk(KERN_WARNING "Memory squeeze on" " hdlc_proto_attach()\n"); netdev_warn(dev, "Memory squeeze on hdlc_proto_attach()\n"); module_put(proto->module); return -ENOBUFS; } Loading Loading @@ -363,7 +365,7 @@ static int __init hdlc_module_init(void) { int result; printk(KERN_INFO "%s\n", version); pr_info("%s\n", version); if ((result = register_netdevice_notifier(&hdlc_notifier)) != 0) return result; dev_add_pack(&hdlc_packet_type); Loading
drivers/net/wan/hdlc_cisco.c +8 −13 Original line number Diff line number Diff line Loading @@ -103,9 +103,7 @@ static void cisco_keepalive_send(struct net_device *dev, u32 type, skb = dev_alloc_skb(sizeof(struct hdlc_header) + sizeof(struct cisco_packet)); if (!skb) { printk(KERN_WARNING "%s: Memory squeeze on cisco_keepalive_send()\n", dev->name); netdev_warn(dev, "Memory squeeze on cisco_keepalive_send()\n"); return; } skb_reserve(skb, 4); Loading Loading @@ -181,8 +179,8 @@ static int cisco_rx(struct sk_buff *skb) CISCO_PACKET_LEN) && (skb->len != sizeof(struct hdlc_header) + CISCO_BIG_PACKET_LEN)) { printk(KERN_INFO "%s: Invalid length of Cisco control" " packet (%d bytes)\n", dev->name, skb->len); netdev_info(dev, "Invalid length of Cisco control packet (%d bytes)\n", skb->len); goto rx_error; } Loading Loading @@ -217,8 +215,7 @@ static int cisco_rx(struct sk_buff *skb) return NET_RX_SUCCESS; case CISCO_ADDR_REPLY: printk(KERN_INFO "%s: Unexpected Cisco IP address " "reply\n", dev->name); netdev_info(dev, "Unexpected Cisco IP address reply\n"); goto rx_error; case CISCO_KEEPALIVE_REQ: Loading @@ -235,9 +232,8 @@ static int cisco_rx(struct sk_buff *skb) min = sec / 60; sec -= min * 60; hrs = min / 60; min -= hrs * 60; days = hrs / 24; hrs -= days * 24; printk(KERN_INFO "%s: Link up (peer " "uptime %ud%uh%um%us)\n", dev->name, days, hrs, min, sec); netdev_info(dev, "Link up (peer uptime %ud%uh%um%us)\n", days, hrs, min, sec); netif_dormant_off(dev); st->up = 1; } Loading @@ -249,8 +245,7 @@ static int cisco_rx(struct sk_buff *skb) } /* switch (keepalive type) */ } /* switch (protocol) */ printk(KERN_INFO "%s: Unsupported protocol %x\n", dev->name, ntohs(data->protocol)); netdev_info(dev, "Unsupported protocol %x\n", ntohs(data->protocol)); dev_kfree_skb_any(skb); return NET_RX_DROP; Loading @@ -272,7 +267,7 @@ static void cisco_timer(unsigned long arg) if (st->up && time_after(jiffies, st->last_poll + st->settings.timeout * HZ)) { st->up = 0; printk(KERN_INFO "%s: Link down\n", dev->name); netdev_info(dev, "Link down\n"); netif_dormant_on(dev); } Loading