Commit 545166dc authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Linus Torvalds

[PATCH] PPC64 iSeries kernel messages cleanup

This patch cleans up and makes more consistent the messages produced by
some of the iSeries virtual device drivers.  It also make them less
verbose.
parent b1230d43
...@@ -105,6 +105,9 @@ EXPORT_SYMBOL(viopath_ourLp); ...@@ -105,6 +105,9 @@ EXPORT_SYMBOL(viopath_ourLp);
*/ */
static vio_event_handler_t *vio_handler[VIO_MAX_SUBTYPES]; static vio_event_handler_t *vio_handler[VIO_MAX_SUBTYPES];
#define VIOPATH_KERN_WARN KERN_WARNING "viopath: "
#define VIOPATH_KERN_INFO KERN_INFO "viopath: "
static unsigned char e2a(unsigned char x) static unsigned char e2a(unsigned char x)
{ {
switch (x) { switch (x) {
...@@ -209,7 +212,7 @@ static int proc_viopath_show(struct seq_file *m, void *v) ...@@ -209,7 +212,7 @@ static int proc_viopath_show(struct seq_file *m, void *v)
((u64)handle) << 32, PAGE_SIZE, 0, 0); ((u64)handle) << 32, PAGE_SIZE, 0, 0);
if (hvrc != HvLpEvent_Rc_Good) if (hvrc != HvLpEvent_Rc_Good)
printk("viopath hv error on op %d\n", (int)hvrc); printk(VIOPATH_KERN_WARN "hv error on op %d\n", (int)hvrc);
down(&Semaphore); down(&Semaphore);
...@@ -318,7 +321,7 @@ static void sendMonMsg(HvLpIndex remoteLp) ...@@ -318,7 +321,7 @@ static void sendMonMsg(HvLpIndex remoteLp)
if (hvrc == HvLpEvent_Rc_Good) if (hvrc == HvLpEvent_Rc_Good)
viopathStatus[remoteLp].isActive = 1; viopathStatus[remoteLp].isActive = 1;
else { else {
printk(KERN_WARNING_VIO "could not connect to partition %d\n", printk(VIOPATH_KERN_WARN "could not connect to partition %d\n",
remoteLp); remoteLp);
viopathStatus[remoteLp].isActive = 0; viopathStatus[remoteLp].isActive = 0;
} }
...@@ -355,11 +358,11 @@ static void handleMonitorEvent(struct HvLpEvent *event) ...@@ -355,11 +358,11 @@ static void handleMonitorEvent(struct HvLpEvent *event)
remoteLp = event->xTargetLp; remoteLp = event->xTargetLp;
if ((event->xSourceInstanceId != viopathStatus[remoteLp].mSourceInst) || if ((event->xSourceInstanceId != viopathStatus[remoteLp].mSourceInst) ||
(event->xTargetInstanceId != viopathStatus[remoteLp].mTargetInst)) { (event->xTargetInstanceId != viopathStatus[remoteLp].mTargetInst)) {
printk(KERN_WARNING_VIO "ignoring ack....mismatched instances\n"); printk(VIOPATH_KERN_WARN "ignoring ack....mismatched instances\n");
return; return;
} }
printk(KERN_WARNING_VIO "partition %d ended\n", remoteLp); printk(VIOPATH_KERN_WARN "partition %d ended\n", remoteLp);
viopathStatus[remoteLp].isActive = 0; viopathStatus[remoteLp].isActive = 0;
...@@ -403,7 +406,7 @@ static void handleConfig(struct HvLpEvent *event) ...@@ -403,7 +406,7 @@ static void handleConfig(struct HvLpEvent *event)
if (!event) if (!event)
return; return;
if (event->xFlags.xFunction == HvLpEvent_Function_Int) { if (event->xFlags.xFunction == HvLpEvent_Function_Int) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"unexpected config request from partition %d", "unexpected config request from partition %d",
event->xSourceLp); event->xSourceLp);
...@@ -461,7 +464,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) ...@@ -461,7 +464,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
if (viopathStatus[remoteLp].isActive if (viopathStatus[remoteLp].isActive
&& (event->xSourceInstanceId != && (event->xSourceInstanceId !=
viopathStatus[remoteLp].mTargetInst)) { viopathStatus[remoteLp].mTargetInst)) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"message from invalid partition. " "message from invalid partition. "
"int msg rcvd, source inst (%d) doesnt match (%d)\n", "int msg rcvd, source inst (%d) doesnt match (%d)\n",
viopathStatus[remoteLp].mTargetInst, viopathStatus[remoteLp].mTargetInst,
...@@ -472,7 +475,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) ...@@ -472,7 +475,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
if (viopathStatus[remoteLp].isActive if (viopathStatus[remoteLp].isActive
&& (event->xTargetInstanceId != && (event->xTargetInstanceId !=
viopathStatus[remoteLp].mSourceInst)) { viopathStatus[remoteLp].mSourceInst)) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"message from invalid partition. " "message from invalid partition. "
"int msg rcvd, target inst (%d) doesnt match (%d)\n", "int msg rcvd, target inst (%d) doesnt match (%d)\n",
viopathStatus[remoteLp].mSourceInst, viopathStatus[remoteLp].mSourceInst,
...@@ -483,7 +486,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) ...@@ -483,7 +486,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
remoteLp = event->xTargetLp; remoteLp = event->xTargetLp;
if (event->xSourceInstanceId != if (event->xSourceInstanceId !=
viopathStatus[remoteLp].mSourceInst) { viopathStatus[remoteLp].mSourceInst) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"message from invalid partition. " "message from invalid partition. "
"ack msg rcvd, source inst (%d) doesnt match (%d)\n", "ack msg rcvd, source inst (%d) doesnt match (%d)\n",
viopathStatus[remoteLp].mSourceInst, viopathStatus[remoteLp].mSourceInst,
...@@ -493,7 +496,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) ...@@ -493,7 +496,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
if (event->xTargetInstanceId != if (event->xTargetInstanceId !=
viopathStatus[remoteLp].mTargetInst) { viopathStatus[remoteLp].mTargetInst) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"message from invalid partition. " "message from invalid partition. "
"viopath: ack msg rcvd, target inst (%d) doesnt match (%d)\n", "viopath: ack msg rcvd, target inst (%d) doesnt match (%d)\n",
viopathStatus[remoteLp].mTargetInst, viopathStatus[remoteLp].mTargetInst,
...@@ -503,7 +506,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) ...@@ -503,7 +506,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
} }
if (vio_handler[subtype] == NULL) { if (vio_handler[subtype] == NULL) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"unexpected virtual io event subtype %d from partition %d\n", "unexpected virtual io event subtype %d from partition %d\n",
event->xSubtype, remoteLp); event->xSubtype, remoteLp);
/* No handler. Ack if necessary */ /* No handler. Ack if necessary */
...@@ -608,8 +611,8 @@ int viopath_open(HvLpIndex remoteLp, int subtype, int numReq) ...@@ -608,8 +611,8 @@ int viopath_open(HvLpIndex remoteLp, int subtype, int numReq)
HvLpEvent_registerHandler(HvLpEvent_Type_VirtualIo, HvLpEvent_registerHandler(HvLpEvent_Type_VirtualIo,
&vio_handleEvent); &vio_handleEvent);
sendMonMsg(remoteLp); sendMonMsg(remoteLp);
printk(KERN_INFO_VIO printk(VIOPATH_KERN_INFO "opening connection to partition %d, "
"Opening connection to partition %d, setting sinst %d, tinst %d\n", "setting sinst %d, tinst %d\n",
remoteLp, viopathStatus[remoteLp].mSourceInst, remoteLp, viopathStatus[remoteLp].mSourceInst,
viopathStatus[remoteLp].mTargetInst); viopathStatus[remoteLp].mTargetInst);
} }
...@@ -662,7 +665,7 @@ int viopath_close(HvLpIndex remoteLp, int subtype, int numReq) ...@@ -662,7 +665,7 @@ int viopath_close(HvLpIndex remoteLp, int subtype, int numReq)
numOpen += viopathStatus[remoteLp].users[i]; numOpen += viopathStatus[remoteLp].users[i];
if ((viopathStatus[remoteLp].isOpen) && (numOpen == 0)) { if ((viopathStatus[remoteLp].isOpen) && (numOpen == 0)) {
printk(KERN_INFO_VIO "Closing connection to partition %d", printk(VIOPATH_KERN_INFO "closing connection to partition %d",
remoteLp); remoteLp);
HvCallEvent_closeLpEventPath(remoteLp, HvCallEvent_closeLpEventPath(remoteLp,
...@@ -696,23 +699,21 @@ void vio_free_event_buffer(int subtype, void *buffer) ...@@ -696,23 +699,21 @@ void vio_free_event_buffer(int subtype, void *buffer)
{ {
subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT; subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT;
if ((subtype < 0) || (subtype >= VIO_MAX_SUBTYPES)) { if ((subtype < 0) || (subtype >= VIO_MAX_SUBTYPES)) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"unexpected subtype %d freeing event buffer\n", "unexpected subtype %d freeing event buffer\n", subtype);
subtype);
return; return;
} }
if (atomic_read(&event_buffer_available[subtype]) != 0) { if (atomic_read(&event_buffer_available[subtype]) != 0) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"freeing unallocated event buffer, subtype %d\n", "freeing unallocated event buffer, subtype %d\n",
subtype); subtype);
return; return;
} }
if (buffer != &event_buffer[subtype * 256]) { if (buffer != &event_buffer[subtype * 256]) {
printk(KERN_WARNING_VIO printk(VIOPATH_KERN_WARN
"freeing invalid event buffer, subtype %d\n", "freeing invalid event buffer, subtype %d\n", subtype);
subtype);
} }
atomic_set(&event_buffer_available[subtype], 1); atomic_set(&event_buffer_available[subtype], 1);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Colin Devilbiss <devilbis@us.ibm.com> * Colin Devilbiss <devilbis@us.ibm.com>
* Stephen Rothwell <sfr@au1.ibm.com> * Stephen Rothwell <sfr@au1.ibm.com>
* *
* (C) Copyright 2000, 2001, 2002, 2003 IBM Corporation * (C) Copyright 2000, 2001, 2002, 2003, 2004 IBM Corporation
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
#define VTTY_PORTS 10 #define VTTY_PORTS 10
#define VIOTTY_SERIAL_START 65 #define VIOTTY_SERIAL_START 65
#define VIOCONS_KERN_WARN KERN_WARNING "viocons: "
#define VIOCONS_KERN_INFO KERN_INFO "viocons: "
static spinlock_t consolelock = SPIN_LOCK_UNLOCKED; static spinlock_t consolelock = SPIN_LOCK_UNLOCKED;
static spinlock_t consoleloglock = SPIN_LOCK_UNLOCKED; static spinlock_t consoleloglock = SPIN_LOCK_UNLOCKED;
...@@ -189,10 +192,10 @@ void hvlogOutput(const char *buf, int count) ...@@ -189,10 +192,10 @@ void hvlogOutput(const char *buf, int count)
static inline int viotty_paranoia_check(struct port_info *pi, static inline int viotty_paranoia_check(struct port_info *pi,
char *name, const char *routine) char *name, const char *routine)
{ {
static const char *bad_pi_addr = KERN_WARNING_VIO static const char *bad_pi_addr = VIOCONS_KERN_WARN
"Warning: bad address for port_info struct (%s) in %s\n"; "warning: bad address for port_info struct (%s) in %s\n";
static const char *badmagic = KERN_WARNING_VIO static const char *badmagic = VIOCONS_KERN_WARN
"Warning: bad magic number for port_info struct (%s) in %s\n"; "warning: bad magic number for port_info struct (%s) in %s\n";
if ((pi < &port_info[0]) || (viochar_port(pi) > VTTY_PORTS)) { if ((pi < &port_info[0]) || (viochar_port(pi) > VTTY_PORTS)) {
printk(bad_pi_addr, name, routine); printk(bad_pi_addr, name, routine);
...@@ -395,8 +398,8 @@ static void send_buffers(struct port_info *pi) ...@@ -395,8 +398,8 @@ static void send_buffers(struct port_info *pi)
vio_free_event_buffer(viomajorsubtype_chario, viochar); vio_free_event_buffer(viomajorsubtype_chario, viochar);
spin_unlock_irqrestore(&consolelock, flags); spin_unlock_irqrestore(&consolelock, flags);
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"console error sending event! return code %d\n", "error sending event! return code %d\n",
(int)hvrc); (int)hvrc);
return; return;
} }
...@@ -692,8 +695,8 @@ static int viotty_open(struct tty_struct *tty, struct file *filp) ...@@ -692,8 +695,8 @@ static int viotty_open(struct tty_struct *tty, struct file *filp)
/* If some other TTY is already connected here, reject the open */ /* If some other TTY is already connected here, reject the open */
if ((pi->tty) && (pi->tty != tty)) { if ((pi->tty) && (pi->tty != tty)) {
spin_unlock_irqrestore(&consolelock, flags); spin_unlock_irqrestore(&consolelock, flags);
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"console attempt to open device twice from different ttys\n"); "attempt to open device twice from different ttys\n");
return -EBUSY; return -EBUSY;
} }
tty->driver_data = pi; tty->driver_data = pi;
...@@ -964,23 +967,22 @@ static void vioHandleOpenEvent(struct HvLpEvent *event) ...@@ -964,23 +967,22 @@ static void vioHandleOpenEvent(struct HvLpEvent *event)
spin_unlock_irqrestore(&consolelock, flags); spin_unlock_irqrestore(&consolelock, flags);
if (event->xRc != HvLpEvent_Rc_Good) if (event->xRc != HvLpEvent_Rc_Good)
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"viocons: event->xRc != HvLpEvent_Rc_Good, event->xRc == (%d).\n", "handle_open_event: event->xRc == (%d).\n",
event->xRc); event->xRc);
if (event->xCorrelationToken != 0) { if (event->xCorrelationToken != 0) {
atomic_t *aptr= (atomic_t *)event->xCorrelationToken; atomic_t *aptr= (atomic_t *)event->xCorrelationToken;
atomic_set(aptr, 1); atomic_set(aptr, 1);
} else } else
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"viocons: wierd...got open ack without atomic\n"); "wierd...got open ack without atomic\n");
return; return;
} }
/* This had better require an ack, otherwise complain */ /* This had better require an ack, otherwise complain */
if (event->xFlags.xAckInd != HvLpEvent_AckInd_DoAck) { if (event->xFlags.xAckInd != HvLpEvent_AckInd_DoAck) {
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN "viocharopen without ack bit!\n");
"console: viocharopen without ack bit!\n");
return; return;
} }
...@@ -1019,11 +1021,10 @@ static void vioHandleOpenEvent(struct HvLpEvent *event) ...@@ -1019,11 +1021,10 @@ static void vioHandleOpenEvent(struct HvLpEvent *event)
spin_unlock_irqrestore(&consolelock, flags); spin_unlock_irqrestore(&consolelock, flags);
if (reject == 1) if (reject == 1)
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN "open rejected: bad virtual tty.\n");
"viocons: console open rejected : bad virtual tty.\n");
else if (reject == 2) else if (reject == 2)
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"viocons: console open rejected : console in exclusive use by another partition.\n"); "open rejected: console in exclusive use by another partition.\n");
/* Return the acknowledgement */ /* Return the acknowledgement */
HvCallEvent_ackLpEvent(event); HvCallEvent_ackLpEvent(event);
...@@ -1050,7 +1051,8 @@ static void vioHandleCloseEvent(struct HvLpEvent *event) ...@@ -1050,7 +1051,8 @@ static void vioHandleCloseEvent(struct HvLpEvent *event)
if (event->xFlags.xFunction == HvLpEvent_Function_Int) { if (event->xFlags.xFunction == HvLpEvent_Function_Int) {
if (port >= VTTY_PORTS) { if (port >= VTTY_PORTS) {
printk(KERN_WARNING_VIO "viocons: close message from invalid virtual device.\n"); printk(VIOCONS_KERN_WARN
"close message from invalid virtual device.\n");
return; return;
} }
...@@ -1062,11 +1064,10 @@ static void vioHandleCloseEvent(struct HvLpEvent *event) ...@@ -1062,11 +1064,10 @@ static void vioHandleCloseEvent(struct HvLpEvent *event)
port_info[port].lp = HvLpIndexInvalid; port_info[port].lp = HvLpIndexInvalid;
spin_unlock_irqrestore(&consolelock, flags); spin_unlock_irqrestore(&consolelock, flags);
printk(KERN_INFO_VIO printk(VIOCONS_KERN_INFO "close from %d\n", event->xSourceLp);
"console close from %d\n", event->xSourceLp);
} else } else
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"console got unexpected close acknowlegement\n"); "got unexpected close acknowlegement\n");
} }
/* /*
...@@ -1079,12 +1080,11 @@ static void vioHandleConfig(struct HvLpEvent *event) ...@@ -1079,12 +1080,11 @@ static void vioHandleConfig(struct HvLpEvent *event)
HvCall_writeLogBuffer(cevent->data, cevent->len); HvCall_writeLogBuffer(cevent->data, cevent->len);
if (cevent->data[0] == 0x01) if (cevent->data[0] == 0x01)
printk(KERN_INFO_VIO printk(VIOCONS_KERN_INFO "window resized to %d: %d: %d: %d\n",
"console window resized to %d: %d: %d: %d\n",
cevent->data[1], cevent->data[2], cevent->data[1], cevent->data[2],
cevent->data[3], cevent->data[4]); cevent->data[3], cevent->data[4]);
else else
printk(KERN_WARNING_VIO "console unknown config event\n"); printk(VIOCONS_KERN_WARN "unknown config event\n");
} }
/* /*
...@@ -1100,8 +1100,8 @@ static void vioHandleData(struct HvLpEvent *event) ...@@ -1100,8 +1100,8 @@ static void vioHandleData(struct HvLpEvent *event)
u8 port = cevent->virtual_device; u8 port = cevent->virtual_device;
if (port >= VTTY_PORTS) { if (port >= VTTY_PORTS) {
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN "data on invalid virtual device %d\n",
"console data on invalid virtual device %d\n", port); port);
return; return;
} }
...@@ -1130,13 +1130,14 @@ static void vioHandleData(struct HvLpEvent *event) ...@@ -1130,13 +1130,14 @@ static void vioHandleData(struct HvLpEvent *event)
tty = pi->tty; tty = pi->tty;
if (tty == NULL) { if (tty == NULL) {
spin_unlock_irqrestore(&consolelock, flags); spin_unlock_irqrestore(&consolelock, flags);
printk(KERN_WARNING_VIO "no tty for virtual device %d\n", port); printk(VIOCONS_KERN_WARN "no tty for virtual device %d\n",
port);
return; return;
} }
if (tty->magic != TTY_MAGIC) { if (tty->magic != TTY_MAGIC) {
spin_unlock_irqrestore(&consolelock, flags); spin_unlock_irqrestore(&consolelock, flags);
printk(KERN_WARNING_VIO "tty bad magic\n"); printk(VIOCONS_KERN_WARN "tty bad magic\n");
return; return;
} }
...@@ -1186,8 +1187,7 @@ static void vioHandleData(struct HvLpEvent *event) ...@@ -1186,8 +1187,7 @@ static void vioHandleData(struct HvLpEvent *event)
* have room for because it would fail without indication. * have room for because it would fail without indication.
*/ */
if ((tty->flip.count + 1) > TTY_FLIPBUF_SIZE) { if ((tty->flip.count + 1) > TTY_FLIPBUF_SIZE) {
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN "input buffer overflow!\n");
"console input buffer overflow!\n");
break; break;
} }
tty_insert_flip_char(tty, cevent->data[index], TTY_NORMAL); tty_insert_flip_char(tty, cevent->data[index], TTY_NORMAL);
...@@ -1209,8 +1209,7 @@ static void vioHandleAck(struct HvLpEvent *event) ...@@ -1209,8 +1209,7 @@ static void vioHandleAck(struct HvLpEvent *event)
u8 port = cevent->virtual_device; u8 port = cevent->virtual_device;
if (port >= VTTY_PORTS) { if (port >= VTTY_PORTS) {
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN "data on invalid virtual device\n");
"viocons: data on invalid virtual device\n");
return; return;
} }
...@@ -1299,14 +1298,11 @@ static int __init viocons_init2(void) ...@@ -1299,14 +1298,11 @@ static int __init viocons_init2(void)
atomic_t wait_flag; atomic_t wait_flag;
int rc; int rc;
/* Now open to the primary LP */
printk(KERN_INFO_VIO "console open path to primary\n");
/* +2 for fudge */ /* +2 for fudge */
rc = viopath_open(HvLpConfig_getPrimaryLpIndex(), rc = viopath_open(HvLpConfig_getPrimaryLpIndex(),
viomajorsubtype_chario, VIOCHAR_WINDOW + 2); viomajorsubtype_chario, VIOCHAR_WINDOW + 2);
if (rc) if (rc)
printk(KERN_WARNING_VIO "console error opening to primary %d\n", printk(VIOCONS_KERN_WARN "error opening to primary %d\n", rc);
rc);
if (viopath_hostLp == HvLpIndexInvalid) if (viopath_hostLp == HvLpIndexInvalid)
vio_set_hostlp(); vio_set_hostlp();
...@@ -1317,30 +1313,28 @@ static int __init viocons_init2(void) ...@@ -1317,30 +1313,28 @@ static int __init viocons_init2(void)
*/ */
if ((viopath_hostLp != HvLpIndexInvalid) && if ((viopath_hostLp != HvLpIndexInvalid) &&
(viopath_hostLp != HvLpConfig_getPrimaryLpIndex())) { (viopath_hostLp != HvLpConfig_getPrimaryLpIndex())) {
printk(KERN_INFO_VIO "console open path to hosting (%d)\n", printk(VIOCONS_KERN_INFO "open path to hosting (%d)\n",
viopath_hostLp); viopath_hostLp);
rc = viopath_open(viopath_hostLp, viomajorsubtype_chario, rc = viopath_open(viopath_hostLp, viomajorsubtype_chario,
VIOCHAR_WINDOW + 2); /* +2 for fudge */ VIOCHAR_WINDOW + 2); /* +2 for fudge */
if (rc) if (rc)
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"console error opening to partition %d: %d\n", "error opening to partition %d: %d\n",
viopath_hostLp, rc); viopath_hostLp, rc);
} }
if (vio_setHandler(viomajorsubtype_chario, vioHandleCharEvent) < 0) if (vio_setHandler(viomajorsubtype_chario, vioHandleCharEvent) < 0)
printk(KERN_WARNING_VIO printk(VIOCONS_KERN_WARN
"Error seting handler for console events!\n"); "error seting handler for console events!\n");
printk(KERN_INFO_VIO "console major number is %d\n", TTY_MAJOR);
/* First, try to open the console to the hosting lp. /*
* First, try to open the console to the hosting lp.
* Wait on a semaphore for the response. * Wait on a semaphore for the response.
*/ */
atomic_set(&wait_flag, 0); atomic_set(&wait_flag, 0);
if ((viopath_isactive(viopath_hostLp)) && if ((viopath_isactive(viopath_hostLp)) &&
(send_open(viopath_hostLp, (void *)&wait_flag) == 0)) { (send_open(viopath_hostLp, (void *)&wait_flag) == 0)) {
printk(KERN_INFO_VIO printk(VIOCONS_KERN_INFO "hosting partition %d\n",
"opening console to hosting partition %d\n",
viopath_hostLp); viopath_hostLp);
while (atomic_read(&wait_flag) == 0) while (atomic_read(&wait_flag) == 0)
mb(); mb();
...@@ -1354,7 +1348,7 @@ static int __init viocons_init2(void) ...@@ -1354,7 +1348,7 @@ static int __init viocons_init2(void)
(viopath_isactive(HvLpConfig_getPrimaryLpIndex())) && (viopath_isactive(HvLpConfig_getPrimaryLpIndex())) &&
(send_open(HvLpConfig_getPrimaryLpIndex(), (void *)&wait_flag) (send_open(HvLpConfig_getPrimaryLpIndex(), (void *)&wait_flag)
== 0)) { == 0)) {
printk(KERN_INFO_VIO "opening console to primary partition\n"); printk(VIOCONS_KERN_INFO "opening console to primary partition\n");
while (atomic_read(&wait_flag) == 0) while (atomic_read(&wait_flag) == 0)
mb(); mb();
} }
...@@ -1388,13 +1382,13 @@ static int __init viocons_init2(void) ...@@ -1388,13 +1382,13 @@ static int __init viocons_init2(void)
tty_set_operations(viottyS_driver, &serial_ops); tty_set_operations(viottyS_driver, &serial_ops);
if (tty_register_driver(viotty_driver)) { if (tty_register_driver(viotty_driver)) {
printk(KERN_WARNING_VIO "Couldn't register console driver\n"); printk(VIOCONS_KERN_WARN "couldn't register console driver\n");
put_tty_driver(viotty_driver); put_tty_driver(viotty_driver);
viotty_driver = NULL; viotty_driver = NULL;
} }
if (tty_register_driver(viottyS_driver)) { if (tty_register_driver(viottyS_driver)) {
printk(KERN_WARNING_VIO "Couldn't register console S driver\n"); printk(VIOCONS_KERN_WARN "couldn't register console S driver\n");
put_tty_driver(viottyS_driver); put_tty_driver(viottyS_driver);
viottyS_driver = NULL; viottyS_driver = NULL;
} }
...@@ -1411,7 +1405,7 @@ static int __init viocons_init(void) ...@@ -1411,7 +1405,7 @@ static int __init viocons_init(void)
{ {
int i; int i;
printk(KERN_INFO_VIO "registering console\n"); printk(VIOCONS_KERN_INFO "registering console\n");
for (i = 0; i < VTTY_PORTS; i++) { for (i = 0; i < VTTY_PORTS; i++) {
port_info[i].lp = HvLpIndexInvalid; port_info[i].lp = HvLpIndexInvalid;
port_info[i].magic = VIOTTY_MAGIC; port_info[i].magic = VIOTTY_MAGIC;
......
...@@ -913,8 +913,6 @@ int __init viotap_init(void) ...@@ -913,8 +913,6 @@ int __init viotap_init(void)
char tapename[32]; char tapename[32];
int i; int i;
printk(VIOTAPE_KERN_INFO "driver version " VIOTAPE_VERSION "\n");
op_struct_list = NULL; op_struct_list = NULL;
if ((ret = add_op_structs(VIOTAPE_MAXREQ)) < 0) { if ((ret = add_op_structs(VIOTAPE_MAXREQ)) < 0) {
printk(VIOTAPE_KERN_WARN "couldn't allocate op structs\n"); printk(VIOTAPE_KERN_WARN "couldn't allocate op structs\n");
...@@ -932,8 +930,6 @@ int __init viotap_init(void) ...@@ -932,8 +930,6 @@ int __init viotap_init(void)
} }
} }
printk(VIOTAPE_KERN_INFO "init - open path to hosting (%d)\n",
viopath_hostLp);
ret = viopath_open(viopath_hostLp, viomajorsubtype_tape, ret = viopath_open(viopath_hostLp, viomajorsubtype_tape,
VIOTAPE_MAXREQ + 2); VIOTAPE_MAXREQ + 2);
if (ret) { if (ret) {
...@@ -943,6 +939,9 @@ int __init viotap_init(void) ...@@ -943,6 +939,9 @@ int __init viotap_init(void)
goto clear_op; goto clear_op;
} }
printk(VIOTAPE_KERN_INFO "vers " VIOTAPE_VERSION
", hosting partition %d\n", viopath_hostLp);
vio_setHandler(viomajorsubtype_tape, vioHandleTapeEvent); vio_setHandler(viomajorsubtype_tape, vioHandleTapeEvent);
ret = register_chrdev(VIOTAPE_MAJOR, "viotape", &viotap_fops); ret = register_chrdev(VIOTAPE_MAJOR, "viotape", &viotap_fops);
......
...@@ -70,11 +70,6 @@ void vio_free_event_buffer(int subtype, void *buffer); ...@@ -70,11 +70,6 @@ void vio_free_event_buffer(int subtype, void *buffer);
extern HvLpIndex viopath_hostLp; extern HvLpIndex viopath_hostLp;
extern HvLpIndex viopath_ourLp; extern HvLpIndex viopath_ourLp;
#define VIO_MESSAGE "iSeries virtual I/O: "
#define KERN_DEBUG_VIO KERN_DEBUG VIO_MESSAGE
#define KERN_INFO_VIO KERN_INFO VIO_MESSAGE
#define KERN_WARNING_VIO KERN_WARNING VIO_MESSAGE
#define VIOCHAR_MAX_DATA 200 #define VIOCHAR_MAX_DATA 200
#define VIOMAJOR_SUBTYPE_MASK 0xff00 #define VIOMAJOR_SUBTYPE_MASK 0xff00
...@@ -84,11 +79,11 @@ extern HvLpIndex viopath_ourLp; ...@@ -84,11 +79,11 @@ extern HvLpIndex viopath_ourLp;
#define VIOVERSION 0x0101 #define VIOVERSION 0x0101
/* /*
This is the general structure for VIO errors; each module should have a table * This is the general structure for VIO errors; each module should have
of them, and each table should be terminated by an entry of { 0, 0, NULL }. * a table of them, and each table should be terminated by an entry of
Then, to find a specific error message, a module should pass its local table * { 0, 0, NULL }. Then, to find a specific error message, a module
and the return code. * should pass its local table and the return code.
*/ */
struct vio_error_entry { struct vio_error_entry {
u16 rc; u16 rc;
int errno; int errno;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment