#define AOE_PARTITIONS (16)
#endif
-#define xprintk(L, fmt, arg...) printk(L "aoe: " "%s: " fmt, __func__, ## arg)
-#define iprintk(fmt, arg...) xprintk(KERN_INFO, fmt, ## arg)
-#define eprintk(fmt, arg...) xprintk(KERN_ERR, fmt, ## arg)
-#define dprintk(fmt, arg...) xprintk(KERN_DEBUG, fmt, ## arg)
-
#define SYSMINOR(aoemajor, aoeminor) ((aoemajor) * NPERSHELF + (aoeminor))
#define AOEMAJOR(sysminor) ((sysminor) / NPERSHELF)
#define AOEMINOR(sysminor) ((sysminor) % NPERSHELF)
d = bio->bi_bdev->bd_disk->private_data;
buf = mempool_alloc(d->bufpool, GFP_NOIO);
if (buf == NULL) {
- iprintk("buf allocation failure\n");
+ printk(KERN_INFO "aoe: buf allocation failure\n");
bio_endio(bio, bio->bi_size, -ENOMEM);
return 0;
}
spin_lock_irqsave(&d->lock, flags);
if ((d->flags & DEVFL_UP) == 0) {
- iprintk("device %ld.%ld is not up\n", d->aoemajor, d->aoeminor);
+ printk(KERN_INFO "aoe: device %ld.%ld is not up\n",
+ d->aoemajor, d->aoeminor);
spin_unlock_irqrestore(&d->lock, flags);
mempool_free(buf, d->bufpool);
bio_endio(bio, bio->bi_size, -ENXIO);
struct aoedev *d = bdev->bd_disk->private_data;
if ((d->flags & DEVFL_UP) == 0) {
- eprintk("disk not up\n");
+ printk(KERN_ERR "aoe: disk not up\n");
return -ENODEV;
}
gd = alloc_disk(AOE_PARTITIONS);
if (gd == NULL) {
- eprintk("cannot allocate disk structure for %ld.%ld\n",
+ printk(KERN_ERR "aoe: cannot allocate disk structure for %ld.%ld\n",
d->aoemajor, d->aoeminor);
spin_lock_irqsave(&d->lock, flags);
d->flags &= ~DEVFL_GDALLOC;
d->bufpool = mempool_create_slab_pool(MIN_BUFS, buf_pool_cache);
if (d->bufpool == NULL) {
- eprintk("cannot allocate bufpool for %ld.%ld\n",
+ printk(KERN_ERR "aoe: cannot allocate bufpool for %ld.%ld\n",
d->aoemajor, d->aoeminor);
put_disk(gd);
spin_lock_irqsave(&d->lock, flags);
interfaces(const char __user *str, size_t size)
{
if (set_aoe_iflist(str, size)) {
- eprintk("could not set interface list: too many interfaces\n");
+ printk(KERN_ERR
+ "aoe: could not set interface list: too many interfaces\n");
return -EINVAL;
}
return 0;
/* should be e%d.%d format */
n = sscanf(buf, "e%d.%d", &major, &minor);
if (n != 2) {
- eprintk("invalid device specification\n");
+ printk(KERN_ERR "aoe: invalid device specification\n");
return -EINVAL;
}
d = aoedev_by_aoeaddr(major, minor);
mp = kmalloc(n, GFP_ATOMIC);
if (mp == NULL) {
- eprintk("allocation failure, len=%ld\n", n);
+ printk(KERN_ERR "aoe: allocation failure, len=%ld\n", n);
goto bail;
}
switch ((unsigned long) filp->private_data) {
default:
- iprintk("can't write to that file.\n");
+ printk(KERN_INFO "aoe: can't write to that file.\n");
break;
case MINOR_DISCOVER:
ret = discover();
n = register_chrdev(AOE_MAJOR, "aoechr", &aoe_fops);
if (n < 0) {
- eprintk("can't register char device\n");
+ printk(KERN_ERR "aoe: can't register char device\n");
return n;
}
sema_init(&emsgs_sema, 0);
buf->nframesout += 1;
buf->bufaddr += bcnt;
buf->bv_resid -= bcnt;
-/* dprintk("bv_resid=%ld\n", buf->bv_resid); */
+/* printk(KERN_DEBUG "aoe: bv_resid=%ld\n", buf->bv_resid); */
buf->resid -= bcnt;
buf->sector += bcnt >> 9;
if (buf->resid == 0) {
skb = new_skb(sizeof *h + sizeof *ch);
if (skb == NULL) {
- iprintk("skb alloc failure\n");
+ printk(KERN_INFO "aoe: skb alloc failure\n");
continue;
}
skb->dev = ifp;
return;
buf = container_of(d->bufq.next, struct buf, bufs);
list_del(d->bufq.next);
-/*dprintk("bi_size=%ld\n", buf->bio->bi_size); */
+/*printk(KERN_DEBUG "aoe: bi_size=%ld\n", buf->bio->bi_size); */
d->inprocess = buf;
}
aoecmd_ata_rw(d, f);
}
if (++d->lostjumbo > (d->nframes << 1))
if (d->maxbcnt != DEFAULTBCNT) {
- iprintk("e%ld.%ld: too many lost jumbo on %s - using 1KB frames.\n",
+ printk(KERN_INFO "aoe: e%ld.%ld: too many lost jumbo on %s - using 1KB frames.\n",
d->aoemajor, d->aoeminor, d->ifp->name);
d->maxbcnt = DEFAULTBCNT;
d->flags |= DEVFL_MAXBCNT;
}
if (d->ssize != ssize)
- iprintk("%012llx e%lu.%lu v%04x has %llu sectors\n",
+ printk(KERN_INFO "aoe: %012llx e%lu.%lu v%04x has %llu sectors\n",
(unsigned long long)mac_addr(d->addr),
d->aoemajor, d->aoeminor,
d->fw_ver, (long long)ssize);
d->flags |= DEVFL_NEWSIZE;
} else {
if (d->flags & DEVFL_GDALLOC) {
- eprintk("can't schedule work for e%lu.%lu, %s\n",
+ printk(KERN_ERR "aoe: can't schedule work for e%lu.%lu, %s\n",
d->aoemajor, d->aoeminor,
"it's already on! This shouldn't happen.\n");
return;
if (ahout->cmdstat == WIN_IDENTIFY)
d->flags &= ~DEVFL_PAUSE;
if (ahin->cmdstat & 0xa9) { /* these bits cleared on success */
- eprintk("ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%ld\n",
+ printk(KERN_ERR
+ "aoe: ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%ld\n",
ahout->cmdstat, ahin->cmdstat,
d->aoemajor, d->aoeminor);
if (buf)
case WIN_READ:
case WIN_READ_EXT:
if (skb->len - sizeof *hin - sizeof *ahin < n) {
- eprintk("runt data size in read. skb->len=%d\n",
+ printk(KERN_ERR
+ "aoe: runt data size in read. skb->len=%d\n",
skb->len);
/* fail frame f? just returning will rexmit. */
spin_unlock_irqrestore(&d->lock, flags);
break;
case WIN_IDENTIFY:
if (skb->len - sizeof *hin - sizeof *ahin < 512) {
- iprintk("runt data size in ataid. skb->len=%d\n",
+ printk(KERN_INFO
+ "aoe: runt data size in ataid. skb->len=%d\n",
skb->len);
spin_unlock_irqrestore(&d->lock, flags);
return;
ataid_complete(d, (char *) (ahin+1));
break;
default:
- iprintk("unrecognized ata command %2.2Xh for %d.%d\n",
+ printk(KERN_INFO
+ "aoe: unrecognized ata command %2.2Xh for %d.%d\n",
ahout->cmdstat,
be16_to_cpu(hin->major),
hin->minor);
f = freeframe(d);
if (f == NULL) {
- eprintk("can't get a frame. This shouldn't happen.\n");
+ printk(KERN_ERR "aoe: can't get a frame. This shouldn't happen.\n");
return NULL;
}
*/
aoemajor = be16_to_cpu(h->major);
if (aoemajor == 0xfff) {
- eprintk("Warning: shelf address is all ones. "
+ printk(KERN_ERR "aoe: Warning: shelf address is all ones. "
"Check shelf dip switches.\n");
return;
}
sysminor = SYSMINOR(aoemajor, h->minor);
if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) {
- iprintk("e%ld.%d: minor number too large\n",
+ printk(KERN_INFO "aoe: e%ld.%d: minor number too large\n",
aoemajor, (int) h->minor);
return;
}
d = aoedev_by_sysminor_m(sysminor, n);
if (d == NULL) {
- iprintk("device sysminor_m failure\n");
+ printk(KERN_INFO "aoe: device sysminor_m failure\n");
return;
}
n = ch->scnt;
n = n ? n * 512 : DEFAULTBCNT;
if (n != d->maxbcnt) {
- iprintk("e%ld.%ld: setting %d byte data frames on %s\n",
+ printk(KERN_INFO
+ "aoe: e%ld.%ld: setting %d byte data frames on %s\n",
d->aoemajor, d->aoeminor, n, d->ifp->name);
d->maxbcnt = n;
}
d = aoedev_newdev(bufcnt);
if (d == NULL) {
spin_unlock_irqrestore(&devlist_lock, flags);
- iprintk("aoedev_newdev failure.\n");
+ printk(KERN_INFO "aoe: aoedev_newdev failure.\n");
return NULL;
}
d->sysminor = sysminor;
goto net_fail;
ret = register_blkdev(AOE_MAJOR, DEVICE_NAME);
if (ret < 0) {
- eprintk("can't register major\n");
+ printk(KERN_ERR "aoe: can't register major\n");
goto blkreg_fail;
}
- iprintk("AoE v%s initialised.\n", VERSION);
+ printk(KERN_INFO "aoe: AoE v%s initialised.\n", VERSION);
discover_timer(TINIT);
return 0;
chr_fail:
aoedev_exit();
- iprintk("initialisation failure.\n");
+ printk(KERN_INFO "aoe: initialisation failure.\n");
return ret;
}
return -EINVAL;
if (copy_from_user(aoe_iflist, user_str, size)) {
- iprintk("copy from user failed\n");
+ printk(KERN_INFO "aoe: copy from user failed\n");
return -EFAULT;
}
aoe_iflist[size] = 0x00;
if (n > NECODES)
n = 0;
if (net_ratelimit())
- eprintk("error packet from %d.%d; ecode=%d '%s'\n",
+ printk(KERN_ERR "aoe: error packet from %d.%d; ecode=%d '%s'\n",
be16_to_cpu(h->major), h->minor,
h->err, aoe_errlist[n]);
goto exit;
aoecmd_cfg_rsp(skb);
break;
default:
- iprintk("unknown cmd %d\n", h->cmd);
+ printk(KERN_INFO "aoe: unknown cmd %d\n", h->cmd);
}
exit:
dev_kfree_skb(skb);