Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255943
b: refs/heads/master
c: 12a3bfe
h: refs/heads/master
i:
  255941: 143ab93
  255939: cb8714d
  255935: c6762d8
v: v3
  • Loading branch information
Joe Perches authored and David S. Miller committed Jun 27, 2011
1 parent 6e80e5a commit 6b49def
Show file tree
Hide file tree
Showing 13 changed files with 187 additions and 212 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2903dd654d8788425a9523959b02933ea6555229
refs/heads/master: 12a3bfefc8c1e43ddb50950cb74f8a11d680567a
30 changes: 15 additions & 15 deletions trunk/drivers/net/wan/c101.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -381,18 +383,16 @@ 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;
}

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;
Expand All @@ -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;
Expand All @@ -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;
}

Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/wan/hd64570.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/wan/hd64572.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
16 changes: 9 additions & 7 deletions trunk/drivers/net/wan/hdlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down
21 changes: 8 additions & 13 deletions trunk/drivers/net/wan/hdlc_cisco.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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:
Expand All @@ -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;
}
Expand All @@ -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;

Expand All @@ -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);
}

Expand Down
Loading

0 comments on commit 6b49def

Please sign in to comment.