* GNU General Public License for more details.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/slab.h>
#include <asm/io.h>
#include <asm/byteorder.h>
if (drvr_state != SBE_DRVR_AVAILABLE)
{
if (log_level >= LOG_MONITOR)
- printk (KERN_WARNING "watchdog_func: drvr not available (%x)\n", drvr_state);
+ pr_warning("%s: drvr not available (%x)\n", __func__, drvr_state);
return;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
* GNU General Public License for more details.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/netdevice.h>
#include <linux/hdlc.h>
#include <linux/if_arp.h>
/* our MUSYCC chip supports two functions, 0 & 1 */
if ((fun = PCI_FUNC (pdev->devfn)) > 1)
{
- printk (KERN_WARNING "%s: unexpected devfun: 0x%x\n", THIS_MODULE->name, pdev->devfn);
+ pr_warning("unexpected devfun: 0x%x\n", pdev->devfn);
return 0;
}
if (pdev->bus) /* obtain bus number */
if (i == MAX_BOARDS) /* no match in above loop means MAX
* exceeded */
{
- printk (KERN_WARNING "%s: exceeded number of allowed devices (>%d)?\n",
- THIS_MODULE->name, MAX_BOARDS);
+ pr_warning("exceeded number of allowed devices (>%d)?\n", MAX_BOARDS);
return 0;
}
if (pdev->bus)
}
if (!found)
{
- printk (KERN_WARNING "%s: No boards found.\n", THIS_MODULE->name);
+ pr_warning("No boards found\n");
return ENODEV;
}
/* sanity check for consistant hardware found */
{
if (hi->pci_slot != 0xff && (!hi->addr[0] || !hi->addr[1]))
{
- printk (KERN_WARNING "%s: something very wrong with pci_get_device.\n", hi->devname);
+ pr_warning("%s: something very wrong with pci_get_device\n",
+ hi->devname);
return EIO;
}
}
{
if (request_mem_region (hi->addr[j], hi->len[j], hi->devname) == 0)
{
- printk (KERN_WARNING "%s: memory in use, addr=0x%lx, len=0x%lx ?\n",
- hi->devname, hi->addr[j], hi->len[j]);
+ pr_warning("%s: memory in use, addr=0x%lx, len=0x%lx ?\n",
+ hi->devname, hi->addr[j], hi->len[j]);
cleanup_ioremap ();
return ENOMEM;
}
hi->addr_mapped[j] = (unsigned long) ioremap (hi->addr[j], hi->len[j]);
if (!hi->addr_mapped[j])
{
- printk (KERN_WARNING "%s: ioremap fails, addr=0x%lx, len=0x%lx ?\n",
- hi->devname, hi->addr[j], hi->len[j]);
+ pr_warning("%s: ioremap fails, addr=0x%lx, len=0x%lx ?\n",
+ hi->devname, hi->addr[j], hi->len[j]);
cleanup_ioremap ();
return ENOMEM;
}
#ifdef SBE_MAP_DEBUG
- printk (KERN_WARNING "%s: io remapped from phys %x to virt %x\n",
- hi->devname, (u_int32_t) hi->addr[j], (u_int32_t) hi->addr_mapped[j]);
+ pr_warning("%s: io remapped from phys %x to virt %x\n",
+ hi->devname, (u_int32_t) hi->addr[j], (u_int32_t) hi->addr_mapped[j]);
#endif
}
}
pci_enable_device (hi->pdev[1]))
{
drvr_state = SBE_DRVR_DOWN;
- printk (KERN_WARNING "%s: failed to enable card %d slot %d\n",
- hi->devname, i, hi->pci_slot);
+ pr_warning("%s: failed to enable card %d slot %d\n",
+ hi->devname, i, hi->pci_slot);
cleanup_devs ();
cleanup_ioremap ();
return EIO;
* GNU General Public License for more details.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/types.h>
#include <linux/netdevice.h>
#include <linux/hdlc.h>
priv = OS_kmalloc (sizeof (struct c4_priv));
if (!priv)
{
- printk (KERN_WARNING "%s: no memory for net_device !\n", ci->devname);
+ pr_warning("%s: no memory for net_device !\n", ci->devname);
return 0;
}
dev = alloc_hdlcdev (priv);
if (!dev)
{
- printk (KERN_WARNING "%s: no memory for hdlc_device !\n", ci->devname);
+ pr_warning("%s: no memory for hdlc_device !\n", ci->devname);
OS_kfree (priv);
return 0;
}
ndev = alloc_netdev(sizeof(ci_t), SBE_IFACETMPL, c4_setup);
if (!ndev)
{
- printk (KERN_WARNING "%s: no memory for struct net_device !\n", hi->devname);
+ pr_warning("%s: no memory for struct net_device !\n", hi->devname);
error_flag = ENOMEM;
return 0;
}
#endif
ndev->name, ndev))
{
- printk (KERN_WARNING "%s: MUSYCC could not get irq: %d\n",
- ndev->name, irq0);
+ pr_warning("%s: MUSYCC could not get irq: %d\n", ndev->name, irq0);
unregister_netdev (ndev);
OS_kfree (netdev_priv(ndev));
OS_kfree (ndev);
#ifdef CONFIG_SBE_PMCC4_NCOMM
if (request_irq (irq1, &c4_ebus_interrupt, IRQF_SHARED, ndev->name, ndev))
{
- printk (KERN_WARNING "%s: EBUS could not get irq: %d\n",
- hi->devname, irq1);
+ pr_warning("%s: EBUS could not get irq: %d\n", hi->devname, irq1);
unregister_netdev (ndev);
free_irq (irq0, ndev);
OS_kfree (netdev_priv(ndev));
{
int rtn;
- printk (KERN_WARNING "%s: %s\n", THIS_MODULE->name, pmcc4_OSSI_release);
+ pr_warning("%s\n", pmcc4_OSSI_release);
if ((rtn = c4hw_attach_all ()))
return -rtn; /* installation failure - see system log */
/* housekeeping notifications */
if (log_level != log_level_default)
- printk (KERN_INFO "%s NOTE: driver parameter <log_level> changed from default %d to %d.\n",
- THIS_MODULE->name, log_level_default, log_level);
+ pr_info("NOTE: driver parameter <log_level> changed from default %d to %d.\n",
+ log_level_default, log_level);
if (max_mru != max_mru_default)
- printk (KERN_INFO "%s NOTE: driver parameter <max_mru> changed from default %d to %d.\n",
- THIS_MODULE->name, max_mru_default, max_mru);
+ pr_info("NOTE: driver parameter <max_mru> changed from default %d to %d.\n",
+ max_mru_default, max_mru);
if (max_mtu != max_mtu_default)
- printk (KERN_INFO "%s NOTE: driver parameter <max_mtu> changed from default %d to %d.\n",
- THIS_MODULE->name, max_mtu_default, max_mtu);
+ pr_info("NOTE: driver parameter <max_mtu> changed from default %d to %d.\n",
+ max_mtu_default, max_mtu);
if (max_rxdesc_used != max_rxdesc_default)
{
if (max_rxdesc_used > 2000)
max_rxdesc_used = 2000; /* out-of-bounds reset */
- printk (KERN_INFO "%s NOTE: driver parameter <max_rxdesc_used> changed from default %d to %d.\n",
- THIS_MODULE->name, max_rxdesc_default, max_rxdesc_used);
+ pr_info("NOTE: driver parameter <max_rxdesc_used> changed from default %d to %d.\n",
+ max_rxdesc_default, max_rxdesc_used);
}
if (max_txdesc_used != max_txdesc_default)
{
if (max_txdesc_used > 1000)
max_txdesc_used = 1000; /* out-of-bounds reset */
- printk (KERN_INFO "%s NOTE: driver parameter <max_txdesc_used> changed from default %d to %d.\n",
- THIS_MODULE->name, max_txdesc_default, max_txdesc_used);
+ pr_info("NOTE: driver parameter <max_txdesc_used> changed from default %d to %d.\n",
+ max_txdesc_default, max_txdesc_used);
}
return 0; /* installation success */
}
cleanup_devs ();
c4_cleanup ();
cleanup_ioremap ();
- printk (KERN_INFO "SBE %s - driver removed.\n", THIS_MODULE->name);
+ pr_info("SBE - driver removed.\n");
}
module_init (c4_mod_init);
char SBEid_pmcc4_musyccc[] =
"@(#)musycc.c - $Revision: 2.1 $ (c) Copyright 2004-2006 SBE, Inc.";
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/types.h>
#include "pmcc4_sysdep.h"
}
if (rcnt > MUSYCC_SR_RETRY_CNT)
{
- printk (KERN_WARNING "%s: failed service request (#%d)= %x, group %d.\n",
- pi->up->devname, MUSYCC_SR_RETRY_CNT, req, pi->portnum);
+ pr_warning("%s: failed service request (#%d)= %x, group %d.\n",
+ pi->up->devname, MUSYCC_SR_RETRY_CNT, req, pi->portnum);
SD_SEM_GIVE (&pi->sr_sem_busy); /* allow any next request */
return;
}
if (max_mru > 0xffe)
{
- printk (KERN_WARNING "%s: Maximum allowed MRU exceeded, resetting %d to %d.\n",
- THIS_MODULE->name, max_mru, 0xffe);
+ pr_warning("Maximum allowed MRU exceeded, resetting %d to %d.\n",
+ max_mru, 0xffe);
max_mru = 0xffe;
}
if (max_mtu > 0xffe)
{
- printk (KERN_WARNING "%s: Maximum allowed MTU exceeded, resetting %d to %d.\n",
- THIS_MODULE->name, max_mtu, 0xffe);
+ pr_warning("Maximum allowed MTU exceeded, resetting %d to %d.\n",
+ max_mtu, 0xffe);
max_mtu = 0xffe;
}
#ifdef SBE_WAN256T3_ENABLE
char OSSIid_pmcc4_drvc[] =
"@(#)pmcc4_drv.c - $Revision: 3.1 $ (c) Copyright 2002-2007 One Stop Systems, Inc.";
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#if defined (__FreeBSD__) || defined (__NetBSD__)
#include <sys/param.h>
ci_t *ci;
#ifdef SBE_MAP_DEBUG
- printk (KERN_WARNING "%s: c4_new() entered, ci needs %u.\n",
- THIS_MODULE->name, (unsigned int) sizeof (ci_t));
+ pr_warning("c4_new() entered, ci needs %u.\n",
+ (unsigned int) sizeof (ci_t));
#endif
ci = (ci_t *) OS_kmalloc (sizeof (ci_t));
c4_list = ci;
ci->brdno = ci->next ? ci->next->brdno + 1 : 0;
} else
- printk (KERN_WARNING "%s: failed CI malloc, size %u.\n",
- THIS_MODULE->name, (unsigned int) sizeof (ci_t));
+ pr_warning("failed CI malloc, size %u.\n",
+ (unsigned int) sizeof (ci_t));
if (CI == 0)
CI = ci; /* DEBUG, only board 0 usage */
break;
default:
ci->max_port = 0;
- printk (KERN_WARNING "%s: illegal port configuration (%x)\n", ci->devname, pmsk);
+ pr_warning("%s: illegal port configuration (%x)\n",
+ ci->devname, pmsk);
return SBE_DRVR_FAIL;
}
#ifdef SBE_MAP_DEBUG
ch->p.mode_56k = 0; /* default is 64kbps mode */
} else
{
- printk (KERN_WARNING "%s: failed mch_t malloc, port %d channel %d size %u.\n",
- THIS_MODULE->name, portnum, j, (unsigned int) sizeof (mch_t));
+ pr_warning("failed mch_t malloc, port %d channel %d size %u.\n",
+ portnum, j, (unsigned int) sizeof (mch_t));
break;
}
}
skb = dev_alloc_skb (size);
if (!skb)
{
- //printk (KERN_WARNING "no mem in OS_mem_token_alloc !");
+ //pr_warning("no mem in OS_mem_token_alloc !\n");
return 0;
}
return skb;
* GNU General Public License for more details.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/types.h>
#include <linux/module.h>
#include <linux/errno.h>
ci->dir_dev = proc_mkdir(dir, NULL);
if (!ci->dir_dev)
{
- printk (KERN_ERR "%s: Unable to create directory /proc/driver/%s\n",
- THIS_MODULE->name, ci->devname);
+ pr_err("Unable to create directory /proc/driver/%s\n", ci->devname);
goto fail;
}
e = create_proc_read_entry ("info", S_IFREG | S_IRUGO,
ci->dir_dev, sbecom_proc_get_sbe_info, ci);
if (!e)
{
- printk (KERN_ERR "%s: Unable to create entry /proc/driver/%s/info\n",
- THIS_MODULE->name, ci->devname);
+ pr_err("Unable to create entry /proc/driver/%s/info\n", ci->devname);
goto fail;
}
return 0;