kmsg: convert claw printk messages
claw printks are converted to dev_xxx and pr_xxx macros. Signed-off-by: Andy Richter <richtera@us.ibm.com> Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
150a7fcc5c
commit
4811fcb79c
@@ -60,6 +60,9 @@
|
|||||||
* 1.25 Added Packing support
|
* 1.25 Added Packing support
|
||||||
* 1.5
|
* 1.5
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define KMSG_COMPONENT "claw"
|
||||||
|
|
||||||
#include <asm/ccwdev.h>
|
#include <asm/ccwdev.h>
|
||||||
#include <asm/ccwgroup.h>
|
#include <asm/ccwgroup.h>
|
||||||
#include <asm/debug.h>
|
#include <asm/debug.h>
|
||||||
@@ -94,7 +97,7 @@
|
|||||||
CLAW uses the s390dbf file system see claw_trace and claw_setup
|
CLAW uses the s390dbf file system see claw_trace and claw_setup
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static char version[] __initdata = "CLAW driver";
|
||||||
static char debug_buffer[255];
|
static char debug_buffer[255];
|
||||||
/**
|
/**
|
||||||
* Debug Facility Stuff
|
* Debug Facility Stuff
|
||||||
@@ -206,20 +209,30 @@ static struct net_device_stats *claw_stats(struct net_device *dev);
|
|||||||
static int pages_to_order_of_mag(int num_of_pages);
|
static int pages_to_order_of_mag(int num_of_pages);
|
||||||
static struct sk_buff *claw_pack_skb(struct claw_privbk *privptr);
|
static struct sk_buff *claw_pack_skb(struct claw_privbk *privptr);
|
||||||
/* sysfs Functions */
|
/* sysfs Functions */
|
||||||
static ssize_t claw_hname_show(struct device *dev, struct device_attribute *attr, char *buf);
|
static ssize_t claw_hname_show(struct device *dev,
|
||||||
static ssize_t claw_hname_write(struct device *dev, struct device_attribute *attr,
|
struct device_attribute *attr, char *buf);
|
||||||
|
static ssize_t claw_hname_write(struct device *dev,
|
||||||
|
struct device_attribute *attr,
|
||||||
const char *buf, size_t count);
|
const char *buf, size_t count);
|
||||||
static ssize_t claw_adname_show(struct device *dev, struct device_attribute *attr, char *buf);
|
static ssize_t claw_adname_show(struct device *dev,
|
||||||
static ssize_t claw_adname_write(struct device *dev, struct device_attribute *attr,
|
struct device_attribute *attr, char *buf);
|
||||||
|
static ssize_t claw_adname_write(struct device *dev,
|
||||||
|
struct device_attribute *attr,
|
||||||
const char *buf, size_t count);
|
const char *buf, size_t count);
|
||||||
static ssize_t claw_apname_show(struct device *dev, struct device_attribute *attr, char *buf);
|
static ssize_t claw_apname_show(struct device *dev,
|
||||||
static ssize_t claw_apname_write(struct device *dev, struct device_attribute *attr,
|
struct device_attribute *attr, char *buf);
|
||||||
|
static ssize_t claw_apname_write(struct device *dev,
|
||||||
|
struct device_attribute *attr,
|
||||||
const char *buf, size_t count);
|
const char *buf, size_t count);
|
||||||
static ssize_t claw_wbuff_show(struct device *dev, struct device_attribute *attr, char *buf);
|
static ssize_t claw_wbuff_show(struct device *dev,
|
||||||
static ssize_t claw_wbuff_write(struct device *dev, struct device_attribute *attr,
|
struct device_attribute *attr, char *buf);
|
||||||
|
static ssize_t claw_wbuff_write(struct device *dev,
|
||||||
|
struct device_attribute *attr,
|
||||||
const char *buf, size_t count);
|
const char *buf, size_t count);
|
||||||
static ssize_t claw_rbuff_show(struct device *dev, struct device_attribute *attr, char *buf);
|
static ssize_t claw_rbuff_show(struct device *dev,
|
||||||
static ssize_t claw_rbuff_write(struct device *dev, struct device_attribute *attr,
|
struct device_attribute *attr, char *buf);
|
||||||
|
static ssize_t claw_rbuff_write(struct device *dev,
|
||||||
|
struct device_attribute *attr,
|
||||||
const char *buf, size_t count);
|
const char *buf, size_t count);
|
||||||
static int claw_add_files(struct device *dev);
|
static int claw_add_files(struct device *dev);
|
||||||
static void claw_remove_files(struct device *dev);
|
static void claw_remove_files(struct device *dev);
|
||||||
@@ -298,8 +311,8 @@ claw_probe(struct ccwgroup_device *cgdev)
|
|||||||
if (rc) {
|
if (rc) {
|
||||||
probe_error(cgdev);
|
probe_error(cgdev);
|
||||||
put_device(&cgdev->dev);
|
put_device(&cgdev->dev);
|
||||||
printk(KERN_WARNING "add_files failed %s %s Exit Line %d \n",
|
dev_err(&cgdev->dev, "Creating the /proc files for a new"
|
||||||
dev_name(&cgdev->cdev[0]->dev), __func__, __LINE__);
|
" CLAW device failed\n");
|
||||||
CLAW_DBF_TEXT_(2, setup, "probex%d", rc);
|
CLAW_DBF_TEXT_(2, setup, "probex%d", rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -496,7 +509,8 @@ claw_open(struct net_device *dev)
|
|||||||
~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) != 0x00) ||
|
~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) != 0x00) ||
|
||||||
(((privptr->channel[READ].flag |
|
(((privptr->channel[READ].flag |
|
||||||
privptr->channel[WRITE].flag) & CLAW_TIMER) != 0x00)) {
|
privptr->channel[WRITE].flag) & CLAW_TIMER) != 0x00)) {
|
||||||
printk(KERN_INFO "%s: remote side is not ready\n", dev->name);
|
dev_info(&privptr->channel[READ].cdev->dev,
|
||||||
|
"%s: remote side is not ready\n", dev->name);
|
||||||
CLAW_DBF_TEXT(2, trace, "notrdy");
|
CLAW_DBF_TEXT(2, trace, "notrdy");
|
||||||
|
|
||||||
for ( i = 0; i < 2; i++) {
|
for ( i = 0; i < 2; i++) {
|
||||||
@@ -582,10 +596,9 @@ claw_irq_handler(struct ccw_device *cdev,
|
|||||||
CLAW_DBF_TEXT(4, trace, "clawirq");
|
CLAW_DBF_TEXT(4, trace, "clawirq");
|
||||||
/* Bypass all 'unsolicited interrupts' */
|
/* Bypass all 'unsolicited interrupts' */
|
||||||
if (!cdev->dev.driver_data) {
|
if (!cdev->dev.driver_data) {
|
||||||
printk(KERN_WARNING "claw: unsolicited interrupt for device:"
|
dev_warn(&cdev->dev, "An uninitialized CLAW device received an"
|
||||||
"%s received c-%02x d-%02x\n",
|
" IRQ, c-%02x d-%02x\n",
|
||||||
dev_name(&cdev->dev), irb->scsw.cmd.cstat,
|
irb->scsw.cmd.cstat, irb->scsw.cmd.dstat);
|
||||||
irb->scsw.cmd.dstat);
|
|
||||||
CLAW_DBF_TEXT(2, trace, "badirq");
|
CLAW_DBF_TEXT(2, trace, "badirq");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -597,8 +610,7 @@ claw_irq_handler(struct ccw_device *cdev,
|
|||||||
else if (privptr->channel[WRITE].cdev == cdev)
|
else if (privptr->channel[WRITE].cdev == cdev)
|
||||||
p_ch = &privptr->channel[WRITE];
|
p_ch = &privptr->channel[WRITE];
|
||||||
else {
|
else {
|
||||||
printk(KERN_WARNING "claw: Can't determine channel for "
|
dev_warn(&cdev->dev, "The device is not a CLAW device\n");
|
||||||
"interrupt, device %s\n", dev_name(&cdev->dev));
|
|
||||||
CLAW_DBF_TEXT(2, trace, "badchan");
|
CLAW_DBF_TEXT(2, trace, "badchan");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -612,7 +624,8 @@ claw_irq_handler(struct ccw_device *cdev,
|
|||||||
|
|
||||||
/* Check for good subchannel return code, otherwise info message */
|
/* Check for good subchannel return code, otherwise info message */
|
||||||
if (irb->scsw.cmd.cstat && !(irb->scsw.cmd.cstat & SCHN_STAT_PCI)) {
|
if (irb->scsw.cmd.cstat && !(irb->scsw.cmd.cstat & SCHN_STAT_PCI)) {
|
||||||
printk(KERN_INFO "%s: subchannel check for device: %04x -"
|
dev_info(&cdev->dev,
|
||||||
|
"%s: subchannel check for device: %04x -"
|
||||||
" Sch Stat %02x Dev Stat %02x CPA - %04x\n",
|
" Sch Stat %02x Dev Stat %02x CPA - %04x\n",
|
||||||
dev->name, p_ch->devno,
|
dev->name, p_ch->devno,
|
||||||
irb->scsw.cmd.cstat, irb->scsw.cmd.dstat,
|
irb->scsw.cmd.cstat, irb->scsw.cmd.dstat,
|
||||||
@@ -659,10 +672,9 @@ claw_irq_handler(struct ccw_device *cdev,
|
|||||||
p_env->host_name,
|
p_env->host_name,
|
||||||
p_env->adapter_name);
|
p_env->adapter_name);
|
||||||
} else {
|
} else {
|
||||||
printk(KERN_WARNING "claw: unsolicited "
|
dev_warn(&cdev->dev, "The CLAW device received"
|
||||||
"interrupt for device:"
|
" an unexpected IRQ, "
|
||||||
"%s received c-%02x d-%02x\n",
|
"c-%02x d-%02x\n",
|
||||||
dev_name(&cdev->dev),
|
|
||||||
irb->scsw.cmd.cstat,
|
irb->scsw.cmd.cstat,
|
||||||
irb->scsw.cmd.dstat);
|
irb->scsw.cmd.dstat);
|
||||||
return;
|
return;
|
||||||
@@ -677,8 +689,8 @@ claw_irq_handler(struct ccw_device *cdev,
|
|||||||
(p_ch->irb->ecw[0] & 0x40) == 0x40 ||
|
(p_ch->irb->ecw[0] & 0x40) == 0x40 ||
|
||||||
(p_ch->irb->ecw[0]) == 0) {
|
(p_ch->irb->ecw[0]) == 0) {
|
||||||
privptr->stats.rx_errors++;
|
privptr->stats.rx_errors++;
|
||||||
printk(KERN_INFO "%s: Restart is "
|
dev_info(&cdev->dev,
|
||||||
"required after remote "
|
"%s: Restart is required after remote "
|
||||||
"side recovers \n",
|
"side recovers \n",
|
||||||
dev->name);
|
dev->name);
|
||||||
}
|
}
|
||||||
@@ -713,11 +725,13 @@ claw_irq_handler(struct ccw_device *cdev,
|
|||||||
return;
|
return;
|
||||||
case CLAW_START_WRITE:
|
case CLAW_START_WRITE:
|
||||||
if (p_ch->irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) {
|
if (p_ch->irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) {
|
||||||
printk(KERN_INFO "%s: Unit Check Occured in "
|
dev_info(&cdev->dev,
|
||||||
|
"%s: Unit Check Occured in "
|
||||||
"write channel\n", dev->name);
|
"write channel\n", dev->name);
|
||||||
clear_bit(0, (void *)&p_ch->IO_active);
|
clear_bit(0, (void *)&p_ch->IO_active);
|
||||||
if (p_ch->irb->ecw[0] & 0x80) {
|
if (p_ch->irb->ecw[0] & 0x80) {
|
||||||
printk(KERN_INFO "%s: Resetting Event "
|
dev_info(&cdev->dev,
|
||||||
|
"%s: Resetting Event "
|
||||||
"occurred:\n", dev->name);
|
"occurred:\n", dev->name);
|
||||||
init_timer(&p_ch->timer);
|
init_timer(&p_ch->timer);
|
||||||
p_ch->timer.function =
|
p_ch->timer.function =
|
||||||
@@ -725,7 +739,8 @@ claw_irq_handler(struct ccw_device *cdev,
|
|||||||
p_ch->timer.data = (unsigned long)p_ch;
|
p_ch->timer.data = (unsigned long)p_ch;
|
||||||
p_ch->timer.expires = jiffies + 10*HZ;
|
p_ch->timer.expires = jiffies + 10*HZ;
|
||||||
add_timer(&p_ch->timer);
|
add_timer(&p_ch->timer);
|
||||||
printk(KERN_INFO "%s: write connection "
|
dev_info(&cdev->dev,
|
||||||
|
"%s: write connection "
|
||||||
"restarting\n", dev->name);
|
"restarting\n", dev->name);
|
||||||
}
|
}
|
||||||
CLAW_DBF_TEXT(4, trace, "rstrtwrt");
|
CLAW_DBF_TEXT(4, trace, "rstrtwrt");
|
||||||
@@ -733,8 +748,9 @@ claw_irq_handler(struct ccw_device *cdev,
|
|||||||
}
|
}
|
||||||
if (p_ch->irb->scsw.cmd.dstat & DEV_STAT_UNIT_EXCEP) {
|
if (p_ch->irb->scsw.cmd.dstat & DEV_STAT_UNIT_EXCEP) {
|
||||||
clear_bit(0, (void *)&p_ch->IO_active);
|
clear_bit(0, (void *)&p_ch->IO_active);
|
||||||
printk(KERN_INFO "%s: Unit Exception "
|
dev_info(&cdev->dev,
|
||||||
"Occured in write channel\n",
|
"%s: Unit Exception "
|
||||||
|
"occurred in write channel\n",
|
||||||
dev->name);
|
dev->name);
|
||||||
}
|
}
|
||||||
if (!((p_ch->irb->scsw.cmd.stctl & SCSW_STCTL_SEC_STATUS) ||
|
if (!((p_ch->irb->scsw.cmd.stctl & SCSW_STCTL_SEC_STATUS) ||
|
||||||
@@ -757,8 +773,9 @@ claw_irq_handler(struct ccw_device *cdev,
|
|||||||
CLAW_DBF_TEXT(4, trace, "StWtExit");
|
CLAW_DBF_TEXT(4, trace, "StWtExit");
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
printk(KERN_WARNING "%s: wrong selection code - irq "
|
dev_warn(&cdev->dev,
|
||||||
"state=%d\n", dev->name, p_ch->claw_state);
|
"The CLAW device for %s received an unexpected IRQ\n",
|
||||||
|
dev->name);
|
||||||
CLAW_DBF_TEXT(2, trace, "badIRQ");
|
CLAW_DBF_TEXT(2, trace, "badIRQ");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -910,8 +927,10 @@ claw_release(struct net_device *dev)
|
|||||||
if (((privptr->channel[READ].last_dstat |
|
if (((privptr->channel[READ].last_dstat |
|
||||||
privptr->channel[WRITE].last_dstat) &
|
privptr->channel[WRITE].last_dstat) &
|
||||||
~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) != 0x00) {
|
~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) != 0x00) {
|
||||||
printk(KERN_WARNING "%s: channel problems during close - "
|
dev_warn(&privptr->channel[READ].cdev->dev,
|
||||||
"read: %02x - write: %02x\n",
|
"Deactivating %s completed with incorrect"
|
||||||
|
" subchannel status "
|
||||||
|
"(read %02x, write %02x)\n",
|
||||||
dev->name,
|
dev->name,
|
||||||
privptr->channel[READ].last_dstat,
|
privptr->channel[READ].last_dstat,
|
||||||
privptr->channel[WRITE].last_dstat);
|
privptr->channel[WRITE].last_dstat);
|
||||||
@@ -1135,20 +1154,17 @@ ccw_check_return_code(struct ccw_device *cdev, int return_code)
|
|||||||
case -EBUSY: /* BUSY is a transient state no action needed */
|
case -EBUSY: /* BUSY is a transient state no action needed */
|
||||||
break;
|
break;
|
||||||
case -ENODEV:
|
case -ENODEV:
|
||||||
printk(KERN_EMERG "%s: Missing device called "
|
dev_err(&cdev->dev, "The remote channel adapter is not"
|
||||||
"for IO ENODEV\n", dev_name(&cdev->dev));
|
" available\n");
|
||||||
break;
|
|
||||||
case -EIO:
|
|
||||||
printk(KERN_EMERG "%s: Status pending... EIO \n",
|
|
||||||
dev_name(&cdev->dev));
|
|
||||||
break;
|
break;
|
||||||
case -EINVAL:
|
case -EINVAL:
|
||||||
printk(KERN_EMERG "%s: Invalid Dev State EINVAL \n",
|
dev_err(&cdev->dev,
|
||||||
dev_name(&cdev->dev));
|
"The status of the remote channel adapter"
|
||||||
|
" is not valid\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printk(KERN_EMERG "%s: Unknown error in "
|
dev_err(&cdev->dev, "The common device layer"
|
||||||
"Do_IO %d\n", dev_name(&cdev->dev),
|
" returned error code %d\n",
|
||||||
return_code);
|
return_code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1163,40 +1179,41 @@ static void
|
|||||||
ccw_check_unit_check(struct chbk * p_ch, unsigned char sense )
|
ccw_check_unit_check(struct chbk * p_ch, unsigned char sense )
|
||||||
{
|
{
|
||||||
struct net_device *ndev = p_ch->ndev;
|
struct net_device *ndev = p_ch->ndev;
|
||||||
|
struct device *dev = &p_ch->cdev->dev;
|
||||||
|
|
||||||
CLAW_DBF_TEXT(4, trace, "unitchek");
|
CLAW_DBF_TEXT(4, trace, "unitchek");
|
||||||
printk(KERN_INFO "%s: Unit Check with sense byte:0x%04x\n",
|
dev_warn(dev, "The communication peer of %s disconnected\n",
|
||||||
ndev->name, sense);
|
ndev->name);
|
||||||
|
|
||||||
if (sense & 0x40) {
|
if (sense & 0x40) {
|
||||||
if (sense & 0x01) {
|
if (sense & 0x01) {
|
||||||
printk(KERN_WARNING "%s: Interface disconnect or "
|
dev_warn(dev, "The remote channel adapter for"
|
||||||
"Selective reset "
|
" %s has been reset\n",
|
||||||
"occurred (remote side)\n", ndev->name);
|
ndev->name);
|
||||||
}
|
|
||||||
else {
|
|
||||||
printk(KERN_WARNING "%s: System reset occured"
|
|
||||||
" (remote side)\n", ndev->name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sense & 0x20) {
|
else if (sense & 0x20) {
|
||||||
if (sense & 0x04) {
|
if (sense & 0x04) {
|
||||||
printk(KERN_WARNING "%s: Data-streaming "
|
dev_warn(dev, "A data streaming timeout occurred"
|
||||||
"timeout)\n", ndev->name);
|
" for %s\n",
|
||||||
|
ndev->name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printk(KERN_WARNING "%s: Data-transfer parity"
|
dev_warn(dev, "A data transfer parity error occurred"
|
||||||
" error\n", ndev->name);
|
" for %s\n",
|
||||||
|
ndev->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sense & 0x10) {
|
else if (sense & 0x10) {
|
||||||
if (sense & 0x20) {
|
if (sense & 0x20) {
|
||||||
printk(KERN_WARNING "%s: Hardware malfunction "
|
dev_warn(dev, "The remote channel adapter for %s"
|
||||||
"(remote side)\n", ndev->name);
|
" is faulty\n",
|
||||||
|
ndev->name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printk(KERN_WARNING "%s: read-data parity error "
|
dev_warn(dev, "A read data parity error occurred"
|
||||||
"(remote side)\n", ndev->name);
|
" for %s\n",
|
||||||
|
ndev->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1697,7 +1714,8 @@ init_ccw_bk(struct net_device *dev)
|
|||||||
p_buf-> w_TIC_1.flags = 0;
|
p_buf-> w_TIC_1.flags = 0;
|
||||||
p_buf-> w_TIC_1.count = 0;
|
p_buf-> w_TIC_1.count = 0;
|
||||||
|
|
||||||
if (((unsigned long)p_buff+privptr->p_env->write_size) >=
|
if (((unsigned long)p_buff +
|
||||||
|
privptr->p_env->write_size) >=
|
||||||
((unsigned long)(p_buff+2*
|
((unsigned long)(p_buff+2*
|
||||||
(privptr->p_env->write_size) - 1) & PAGE_MASK)) {
|
(privptr->p_env->write_size) - 1) & PAGE_MASK)) {
|
||||||
p_buff = p_buff+privptr->p_env->write_size;
|
p_buff = p_buff+privptr->p_env->write_size;
|
||||||
@@ -1841,7 +1859,8 @@ init_ccw_bk(struct net_device *dev)
|
|||||||
p_buf->header.flag=CLAW_PENDING;
|
p_buf->header.flag=CLAW_PENDING;
|
||||||
|
|
||||||
if (((unsigned long)p_buff+privptr->p_env->read_size) >=
|
if (((unsigned long)p_buff+privptr->p_env->read_size) >=
|
||||||
((unsigned long)(p_buff+2*(privptr->p_env->read_size) -1)
|
((unsigned long)(p_buff+2*(privptr->p_env->read_size)
|
||||||
|
-1)
|
||||||
& PAGE_MASK)) {
|
& PAGE_MASK)) {
|
||||||
p_buff= p_buff+privptr->p_env->read_size;
|
p_buff= p_buff+privptr->p_env->read_size;
|
||||||
}
|
}
|
||||||
@@ -1856,14 +1875,17 @@ init_ccw_bk(struct net_device *dev)
|
|||||||
else { /* read Size >= PAGE_SIZE */
|
else { /* read Size >= PAGE_SIZE */
|
||||||
for (i=0 ; i< privptr->p_env->read_buffers ; i++) {
|
for (i=0 ; i< privptr->p_env->read_buffers ; i++) {
|
||||||
p_buff = (void *)__get_free_pages(__GFP_DMA,
|
p_buff = (void *)__get_free_pages(__GFP_DMA,
|
||||||
(int)pages_to_order_of_mag(privptr->p_buff_pages_perread) );
|
(int)pages_to_order_of_mag(
|
||||||
|
privptr->p_buff_pages_perread));
|
||||||
if (p_buff==NULL) {
|
if (p_buff==NULL) {
|
||||||
free_pages((unsigned long)privptr->p_buff_ccw,
|
free_pages((unsigned long)privptr->p_buff_ccw,
|
||||||
(int)pages_to_order_of_mag(privptr->p_buff_ccw_num));
|
(int)pages_to_order_of_mag(privptr->
|
||||||
|
p_buff_ccw_num));
|
||||||
/* free the write pages */
|
/* free the write pages */
|
||||||
p_buf=privptr->p_buff_write;
|
p_buf=privptr->p_buff_write;
|
||||||
while (p_buf!=NULL) {
|
while (p_buf!=NULL) {
|
||||||
free_pages((unsigned long)p_buf->p_buffer,
|
free_pages(
|
||||||
|
(unsigned long)p_buf->p_buffer,
|
||||||
(int)pages_to_order_of_mag(
|
(int)pages_to_order_of_mag(
|
||||||
privptr->p_buff_pages_perwrite));
|
privptr->p_buff_pages_perwrite));
|
||||||
p_buf=p_buf->next;
|
p_buf=p_buf->next;
|
||||||
@@ -1871,7 +1893,8 @@ init_ccw_bk(struct net_device *dev)
|
|||||||
/* free any read pages already alloc */
|
/* free any read pages already alloc */
|
||||||
p_buf=privptr->p_buff_read;
|
p_buf=privptr->p_buff_read;
|
||||||
while (p_buf!=NULL) {
|
while (p_buf!=NULL) {
|
||||||
free_pages((unsigned long)p_buf->p_buffer,
|
free_pages(
|
||||||
|
(unsigned long)p_buf->p_buffer,
|
||||||
(int)pages_to_order_of_mag(
|
(int)pages_to_order_of_mag(
|
||||||
privptr->p_buff_pages_perread));
|
privptr->p_buff_pages_perread));
|
||||||
p_buf=p_buf->next;
|
p_buf=p_buf->next;
|
||||||
@@ -2003,7 +2026,7 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw)
|
|||||||
tdev = &privptr->channel[READ].cdev->dev;
|
tdev = &privptr->channel[READ].cdev->dev;
|
||||||
memcpy( &temp_host_name, p_env->host_name, 8);
|
memcpy( &temp_host_name, p_env->host_name, 8);
|
||||||
memcpy( &temp_ws_name, p_env->adapter_name , 8);
|
memcpy( &temp_ws_name, p_env->adapter_name , 8);
|
||||||
printk(KERN_INFO "%s: CLAW device %.8s: "
|
dev_info(tdev, "%s: CLAW device %.8s: "
|
||||||
"Received Control Packet\n",
|
"Received Control Packet\n",
|
||||||
dev->name, temp_ws_name);
|
dev->name, temp_ws_name);
|
||||||
if (privptr->release_pend==1) {
|
if (privptr->release_pend==1) {
|
||||||
@@ -2022,15 +2045,14 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw)
|
|||||||
if (p_ctlbk->version != CLAW_VERSION_ID) {
|
if (p_ctlbk->version != CLAW_VERSION_ID) {
|
||||||
claw_snd_sys_validate_rsp(dev, p_ctlbk,
|
claw_snd_sys_validate_rsp(dev, p_ctlbk,
|
||||||
CLAW_RC_WRONG_VERSION);
|
CLAW_RC_WRONG_VERSION);
|
||||||
printk("%s: %d is wrong version id. "
|
dev_warn(tdev, "The communication peer of %s"
|
||||||
"Expected %d\n",
|
" uses an incorrect API version %d\n",
|
||||||
dev->name, p_ctlbk->version,
|
dev->name, p_ctlbk->version);
|
||||||
CLAW_VERSION_ID);
|
|
||||||
}
|
}
|
||||||
p_sysval = (struct sysval *)&(p_ctlbk->data);
|
p_sysval = (struct sysval *)&(p_ctlbk->data);
|
||||||
printk("%s: Recv Sys Validate Request: "
|
dev_info(tdev, "%s: Recv Sys Validate Request: "
|
||||||
"Vers=%d,link_id=%d,Corr=%d,WS name=%."
|
"Vers=%d,link_id=%d,Corr=%d,WS name=%.8s,"
|
||||||
"8s,Host name=%.8s\n",
|
"Host name=%.8s\n",
|
||||||
dev->name, p_ctlbk->version,
|
dev->name, p_ctlbk->version,
|
||||||
p_ctlbk->linkid,
|
p_ctlbk->linkid,
|
||||||
p_ctlbk->correlator,
|
p_ctlbk->correlator,
|
||||||
@@ -2042,12 +2064,11 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw)
|
|||||||
CLAW_DBF_TEXT(2, setup, "HSTBAD");
|
CLAW_DBF_TEXT(2, setup, "HSTBAD");
|
||||||
CLAW_DBF_TEXT_(2, setup, "%s", p_sysval->host_name);
|
CLAW_DBF_TEXT_(2, setup, "%s", p_sysval->host_name);
|
||||||
CLAW_DBF_TEXT_(2, setup, "%s", temp_host_name);
|
CLAW_DBF_TEXT_(2, setup, "%s", temp_host_name);
|
||||||
printk(KERN_INFO "%s: Host name mismatch\n",
|
dev_warn(tdev,
|
||||||
dev->name);
|
"Host name %s for %s does not match the"
|
||||||
printk(KERN_INFO "%s: Received :%s: "
|
" remote adapter name %s\n",
|
||||||
"expected :%s: \n",
|
|
||||||
dev->name,
|
|
||||||
p_sysval->host_name,
|
p_sysval->host_name,
|
||||||
|
dev->name,
|
||||||
temp_host_name);
|
temp_host_name);
|
||||||
}
|
}
|
||||||
if (memcmp(temp_ws_name, p_sysval->WS_name, 8)) {
|
if (memcmp(temp_ws_name, p_sysval->WS_name, 8)) {
|
||||||
@@ -2056,35 +2077,38 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw)
|
|||||||
CLAW_DBF_TEXT(2, setup, "WSNBAD");
|
CLAW_DBF_TEXT(2, setup, "WSNBAD");
|
||||||
CLAW_DBF_TEXT_(2, setup, "%s", p_sysval->WS_name);
|
CLAW_DBF_TEXT_(2, setup, "%s", p_sysval->WS_name);
|
||||||
CLAW_DBF_TEXT_(2, setup, "%s", temp_ws_name);
|
CLAW_DBF_TEXT_(2, setup, "%s", temp_ws_name);
|
||||||
printk(KERN_INFO "%s: WS name mismatch\n",
|
dev_warn(tdev, "Adapter name %s for %s does not match"
|
||||||
dev->name);
|
" the remote host name %s\n",
|
||||||
printk(KERN_INFO "%s: Received :%s: "
|
|
||||||
"expected :%s: \n",
|
|
||||||
dev->name,
|
|
||||||
p_sysval->WS_name,
|
p_sysval->WS_name,
|
||||||
|
dev->name,
|
||||||
temp_ws_name);
|
temp_ws_name);
|
||||||
}
|
}
|
||||||
if ((p_sysval->write_frame_size < p_env->write_size) &&
|
if ((p_sysval->write_frame_size < p_env->write_size) &&
|
||||||
(p_env->packing == 0)) {
|
(p_env->packing == 0)) {
|
||||||
claw_snd_sys_validate_rsp(dev, p_ctlbk,
|
claw_snd_sys_validate_rsp(dev, p_ctlbk,
|
||||||
CLAW_RC_HOST_RCV_TOO_SMALL);
|
CLAW_RC_HOST_RCV_TOO_SMALL);
|
||||||
printk(KERN_INFO "%s: host write size is too "
|
dev_warn(tdev,
|
||||||
"small\n", dev->name);
|
"The local write buffer is smaller than the"
|
||||||
|
" remote read buffer\n");
|
||||||
CLAW_DBF_TEXT(2, setup, "wrtszbad");
|
CLAW_DBF_TEXT(2, setup, "wrtszbad");
|
||||||
}
|
}
|
||||||
if ((p_sysval->read_frame_size < p_env->read_size) &&
|
if ((p_sysval->read_frame_size < p_env->read_size) &&
|
||||||
(p_env->packing == 0)) {
|
(p_env->packing == 0)) {
|
||||||
claw_snd_sys_validate_rsp(dev, p_ctlbk,
|
claw_snd_sys_validate_rsp(dev, p_ctlbk,
|
||||||
CLAW_RC_HOST_RCV_TOO_SMALL);
|
CLAW_RC_HOST_RCV_TOO_SMALL);
|
||||||
printk(KERN_INFO "%s: host read size is too "
|
dev_warn(tdev,
|
||||||
"small\n", dev->name);
|
"The local read buffer is smaller than the"
|
||||||
|
" remote write buffer\n");
|
||||||
CLAW_DBF_TEXT(2, setup, "rdsizbad");
|
CLAW_DBF_TEXT(2, setup, "rdsizbad");
|
||||||
}
|
}
|
||||||
claw_snd_sys_validate_rsp(dev, p_ctlbk, 0);
|
claw_snd_sys_validate_rsp(dev, p_ctlbk, 0);
|
||||||
printk(KERN_INFO "%s: CLAW device %.8s: System validate "
|
dev_info(tdev,
|
||||||
"completed.\n", dev->name, temp_ws_name);
|
"CLAW device %.8s: System validate"
|
||||||
printk("%s: sys Validate Rsize:%d Wsize:%d\n", dev->name,
|
" completed.\n", temp_ws_name);
|
||||||
p_sysval->read_frame_size, p_sysval->write_frame_size);
|
dev_info(tdev,
|
||||||
|
"%s: sys Validate Rsize:%d Wsize:%d\n",
|
||||||
|
dev->name, p_sysval->read_frame_size,
|
||||||
|
p_sysval->write_frame_size);
|
||||||
privptr->system_validate_comp = 1;
|
privptr->system_validate_comp = 1;
|
||||||
if (strncmp(p_env->api_type, WS_APPL_NAME_PACKED, 6) == 0)
|
if (strncmp(p_env->api_type, WS_APPL_NAME_PACKED, 6) == 0)
|
||||||
p_env->packing = PACKING_ASK;
|
p_env->packing = PACKING_ASK;
|
||||||
@@ -2092,8 +2116,10 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw)
|
|||||||
break;
|
break;
|
||||||
case SYSTEM_VALIDATE_RESPONSE:
|
case SYSTEM_VALIDATE_RESPONSE:
|
||||||
p_sysval = (struct sysval *)&(p_ctlbk->data);
|
p_sysval = (struct sysval *)&(p_ctlbk->data);
|
||||||
printk("%s: Recv Sys Validate Resp: Vers=%d,Corr=%d,RC=%d,"
|
dev_info(tdev,
|
||||||
"WS name=%.8s,Host name=%.8s\n",
|
"Settings for %s validated (version=%d, "
|
||||||
|
"remote device=%d, rc=%d, adapter name=%.8s, "
|
||||||
|
"host name=%.8s)\n",
|
||||||
dev->name,
|
dev->name,
|
||||||
p_ctlbk->version,
|
p_ctlbk->version,
|
||||||
p_ctlbk->correlator,
|
p_ctlbk->correlator,
|
||||||
@@ -2102,41 +2128,39 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw)
|
|||||||
p_sysval->host_name);
|
p_sysval->host_name);
|
||||||
switch (p_ctlbk->rc) {
|
switch (p_ctlbk->rc) {
|
||||||
case 0:
|
case 0:
|
||||||
printk(KERN_INFO "%s: CLAW device "
|
dev_info(tdev, "%s: CLAW device "
|
||||||
"%.8s: System validate "
|
"%.8s: System validate completed.\n",
|
||||||
"completed.\n",
|
|
||||||
dev->name, temp_ws_name);
|
dev->name, temp_ws_name);
|
||||||
if (privptr->system_validate_comp == 0)
|
if (privptr->system_validate_comp == 0)
|
||||||
claw_strt_conn_req(dev);
|
claw_strt_conn_req(dev);
|
||||||
privptr->system_validate_comp = 1;
|
privptr->system_validate_comp = 1;
|
||||||
break;
|
break;
|
||||||
case CLAW_RC_NAME_MISMATCH:
|
case CLAW_RC_NAME_MISMATCH:
|
||||||
printk(KERN_INFO "%s: Sys Validate "
|
dev_warn(tdev, "Validating %s failed because of"
|
||||||
"Resp : Host, WS name is "
|
" a host or adapter name mismatch\n",
|
||||||
"mismatch\n",
|
|
||||||
dev->name);
|
dev->name);
|
||||||
break;
|
break;
|
||||||
case CLAW_RC_WRONG_VERSION:
|
case CLAW_RC_WRONG_VERSION:
|
||||||
printk(KERN_INFO "%s: Sys Validate "
|
dev_warn(tdev, "Validating %s failed because of a"
|
||||||
"Resp : Wrong version\n",
|
" version conflict\n",
|
||||||
dev->name);
|
dev->name);
|
||||||
break;
|
break;
|
||||||
case CLAW_RC_HOST_RCV_TOO_SMALL:
|
case CLAW_RC_HOST_RCV_TOO_SMALL:
|
||||||
printk(KERN_INFO "%s: Sys Validate "
|
dev_warn(tdev, "Validating %s failed because of a"
|
||||||
"Resp : bad frame size\n",
|
" frame size conflict\n",
|
||||||
dev->name);
|
dev->name);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printk(KERN_INFO "%s: Sys Validate "
|
dev_warn(tdev, "The communication peer of %s rejected"
|
||||||
"error code=%d \n",
|
" the connection\n",
|
||||||
dev->name, p_ctlbk->rc);
|
dev->name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CONNECTION_REQUEST:
|
case CONNECTION_REQUEST:
|
||||||
p_connect = (struct conncmd *)&(p_ctlbk->data);
|
p_connect = (struct conncmd *)&(p_ctlbk->data);
|
||||||
printk(KERN_INFO "%s: Recv Conn Req: Vers=%d,link_id=%d,"
|
dev_info(tdev, "%s: Recv Conn Req: Vers=%d,link_id=%d,"
|
||||||
"Corr=%d,HOST appl=%.8s,WS appl=%.8s\n",
|
"Corr=%d,HOST appl=%.8s,WS appl=%.8s\n",
|
||||||
dev->name,
|
dev->name,
|
||||||
p_ctlbk->version,
|
p_ctlbk->version,
|
||||||
@@ -2146,21 +2170,21 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw)
|
|||||||
p_connect->WS_name);
|
p_connect->WS_name);
|
||||||
if (privptr->active_link_ID != 0) {
|
if (privptr->active_link_ID != 0) {
|
||||||
claw_snd_disc(dev, p_ctlbk);
|
claw_snd_disc(dev, p_ctlbk);
|
||||||
printk(KERN_INFO "%s: Conn Req error : "
|
dev_info(tdev, "%s rejected a connection request"
|
||||||
"already logical link is active \n",
|
" because it is already active\n",
|
||||||
dev->name);
|
dev->name);
|
||||||
}
|
}
|
||||||
if (p_ctlbk->linkid != 1) {
|
if (p_ctlbk->linkid != 1) {
|
||||||
claw_snd_disc(dev, p_ctlbk);
|
claw_snd_disc(dev, p_ctlbk);
|
||||||
printk(KERN_INFO "%s: Conn Req error : "
|
dev_info(tdev, "%s rejected a request to open multiple"
|
||||||
"req logical link id is not 1\n",
|
" connections\n",
|
||||||
dev->name);
|
dev->name);
|
||||||
}
|
}
|
||||||
rc = find_link(dev, p_connect->host_name, p_connect->WS_name);
|
rc = find_link(dev, p_connect->host_name, p_connect->WS_name);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
claw_snd_disc(dev, p_ctlbk);
|
claw_snd_disc(dev, p_ctlbk);
|
||||||
printk(KERN_INFO "%s: Conn Resp error: "
|
dev_info(tdev, "%s rejected a connection request"
|
||||||
"req appl name does not match\n",
|
" because of a type mismatch\n",
|
||||||
dev->name);
|
dev->name);
|
||||||
}
|
}
|
||||||
claw_send_control(dev,
|
claw_send_control(dev,
|
||||||
@@ -2172,7 +2196,7 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw)
|
|||||||
p_env->packing = PACK_SEND;
|
p_env->packing = PACK_SEND;
|
||||||
claw_snd_conn_req(dev, 0);
|
claw_snd_conn_req(dev, 0);
|
||||||
}
|
}
|
||||||
printk(KERN_INFO "%s: CLAW device %.8s: Connection "
|
dev_info(tdev, "%s: CLAW device %.8s: Connection "
|
||||||
"completed link_id=%d.\n",
|
"completed link_id=%d.\n",
|
||||||
dev->name, temp_ws_name,
|
dev->name, temp_ws_name,
|
||||||
p_ctlbk->linkid);
|
p_ctlbk->linkid);
|
||||||
@@ -2182,7 +2206,7 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw)
|
|||||||
break;
|
break;
|
||||||
case CONNECTION_RESPONSE:
|
case CONNECTION_RESPONSE:
|
||||||
p_connect = (struct conncmd *)&(p_ctlbk->data);
|
p_connect = (struct conncmd *)&(p_ctlbk->data);
|
||||||
printk(KERN_INFO "%s: Revc Conn Resp: Vers=%d,link_id=%d,"
|
dev_info(tdev, "%s: Recv Conn Resp: Vers=%d,link_id=%d,"
|
||||||
"Corr=%d,RC=%d,Host appl=%.8s, WS appl=%.8s\n",
|
"Corr=%d,RC=%d,Host appl=%.8s, WS appl=%.8s\n",
|
||||||
dev->name,
|
dev->name,
|
||||||
p_ctlbk->version,
|
p_ctlbk->version,
|
||||||
@@ -2193,16 +2217,18 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw)
|
|||||||
p_connect->WS_name);
|
p_connect->WS_name);
|
||||||
|
|
||||||
if (p_ctlbk->rc != 0) {
|
if (p_ctlbk->rc != 0) {
|
||||||
printk(KERN_INFO "%s: Conn Resp error: rc=%d \n",
|
dev_warn(tdev, "The communication peer of %s rejected"
|
||||||
dev->name, p_ctlbk->rc);
|
" a connection request\n",
|
||||||
|
dev->name);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
rc = find_link(dev,
|
rc = find_link(dev,
|
||||||
p_connect->host_name, p_connect->WS_name);
|
p_connect->host_name, p_connect->WS_name);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
claw_snd_disc(dev, p_ctlbk);
|
claw_snd_disc(dev, p_ctlbk);
|
||||||
printk(KERN_INFO "%s: Conn Resp error: "
|
dev_warn(tdev, "The communication peer of %s"
|
||||||
"req appl name does not match\n",
|
" rejected a connection "
|
||||||
|
"request because of a type mismatch\n",
|
||||||
dev->name);
|
dev->name);
|
||||||
}
|
}
|
||||||
/* should be until CONNECTION_CONFIRM */
|
/* should be until CONNECTION_CONFIRM */
|
||||||
@@ -2210,7 +2236,8 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw)
|
|||||||
break;
|
break;
|
||||||
case CONNECTION_CONFIRM:
|
case CONNECTION_CONFIRM:
|
||||||
p_connect = (struct conncmd *)&(p_ctlbk->data);
|
p_connect = (struct conncmd *)&(p_ctlbk->data);
|
||||||
printk(KERN_INFO "%s: Recv Conn Confirm:Vers=%d,link_id=%d,"
|
dev_info(tdev,
|
||||||
|
"%s: Recv Conn Confirm:Vers=%d,link_id=%d,"
|
||||||
"Corr=%d,Host appl=%.8s,WS appl=%.8s\n",
|
"Corr=%d,Host appl=%.8s,WS appl=%.8s\n",
|
||||||
dev->name,
|
dev->name,
|
||||||
p_ctlbk->version,
|
p_ctlbk->version,
|
||||||
@@ -2221,21 +2248,21 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw)
|
|||||||
if (p_ctlbk->linkid == -(privptr->active_link_ID)) {
|
if (p_ctlbk->linkid == -(privptr->active_link_ID)) {
|
||||||
privptr->active_link_ID = p_ctlbk->linkid;
|
privptr->active_link_ID = p_ctlbk->linkid;
|
||||||
if (p_env->packing > PACKING_ASK) {
|
if (p_env->packing > PACKING_ASK) {
|
||||||
printk(KERN_INFO "%s: Confirmed Now packing\n",
|
dev_info(tdev,
|
||||||
dev->name);
|
"%s: Confirmed Now packing\n", dev->name);
|
||||||
p_env->packing = DO_PACKED;
|
p_env->packing = DO_PACKED;
|
||||||
}
|
}
|
||||||
p_ch = &privptr->channel[WRITE];
|
p_ch = &privptr->channel[WRITE];
|
||||||
wake_up(&p_ch->wait);
|
wake_up(&p_ch->wait);
|
||||||
} else {
|
} else {
|
||||||
printk(KERN_INFO "%s: Conn confirm: "
|
dev_warn(tdev, "Activating %s failed because of"
|
||||||
"unexpected linkid=%d \n",
|
" an incorrect link ID=%d\n",
|
||||||
dev->name, p_ctlbk->linkid);
|
dev->name, p_ctlbk->linkid);
|
||||||
claw_snd_disc(dev, p_ctlbk);
|
claw_snd_disc(dev, p_ctlbk);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DISCONNECT:
|
case DISCONNECT:
|
||||||
printk(KERN_INFO "%s: Disconnect: "
|
dev_info(tdev, "%s: Disconnect: "
|
||||||
"Vers=%d,link_id=%d,Corr=%d\n",
|
"Vers=%d,link_id=%d,Corr=%d\n",
|
||||||
dev->name, p_ctlbk->version,
|
dev->name, p_ctlbk->version,
|
||||||
p_ctlbk->linkid, p_ctlbk->correlator);
|
p_ctlbk->linkid, p_ctlbk->correlator);
|
||||||
@@ -2247,12 +2274,13 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw)
|
|||||||
privptr->active_link_ID = 0;
|
privptr->active_link_ID = 0;
|
||||||
break;
|
break;
|
||||||
case CLAW_ERROR:
|
case CLAW_ERROR:
|
||||||
printk(KERN_INFO "%s: CLAW ERROR detected\n",
|
dev_warn(tdev, "The communication peer of %s failed\n",
|
||||||
dev->name);
|
dev->name);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printk(KERN_INFO "%s: Unexpected command code=%d \n",
|
dev_warn(tdev, "The communication peer of %s sent"
|
||||||
dev->name, p_ctlbk->command);
|
" an unknown command code\n",
|
||||||
|
dev->name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2298,8 +2326,10 @@ claw_send_control(struct net_device *dev, __u8 type, __u8 link,
|
|||||||
p_sysval->write_frame_size = DEF_PACK_BUFSIZE;
|
p_sysval->write_frame_size = DEF_PACK_BUFSIZE;
|
||||||
} else {
|
} else {
|
||||||
/* how big is the biggest group of packets */
|
/* how big is the biggest group of packets */
|
||||||
p_sysval->read_frame_size=privptr->p_env->read_size;
|
p_sysval->read_frame_size =
|
||||||
p_sysval->write_frame_size=privptr->p_env->write_size;
|
privptr->p_env->read_size;
|
||||||
|
p_sysval->write_frame_size =
|
||||||
|
privptr->p_env->write_size;
|
||||||
}
|
}
|
||||||
memset(&p_sysval->reserved, 0x00, 4);
|
memset(&p_sysval->reserved, 0x00, 4);
|
||||||
break;
|
break;
|
||||||
@@ -2511,8 +2541,10 @@ unpack_read(struct net_device *dev )
|
|||||||
mtc_this_frm=1;
|
mtc_this_frm=1;
|
||||||
if (p_this_ccw->header.length!=
|
if (p_this_ccw->header.length!=
|
||||||
privptr->p_env->read_size ) {
|
privptr->p_env->read_size ) {
|
||||||
printk(KERN_INFO " %s: Invalid frame detected "
|
dev_warn(p_dev,
|
||||||
"length is %02x\n" ,
|
"The communication peer of %s"
|
||||||
|
" sent a faulty"
|
||||||
|
" frame of length %02x\n",
|
||||||
dev->name, p_this_ccw->header.length);
|
dev->name, p_this_ccw->header.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2544,7 +2576,7 @@ unpack_next:
|
|||||||
goto NextFrame;
|
goto NextFrame;
|
||||||
p_packd = p_this_ccw->p_buffer+pack_off;
|
p_packd = p_this_ccw->p_buffer+pack_off;
|
||||||
p_packh = (struct clawph *) p_packd;
|
p_packh = (struct clawph *) p_packd;
|
||||||
if ((p_packh->len == 0) || /* all done with this frame? */
|
if ((p_packh->len == 0) || /* done with this frame? */
|
||||||
(p_packh->flag != 0))
|
(p_packh->flag != 0))
|
||||||
goto NextFrame;
|
goto NextFrame;
|
||||||
bytes_to_mov = p_packh->len;
|
bytes_to_mov = p_packh->len;
|
||||||
@@ -2594,9 +2626,9 @@ unpack_next:
|
|||||||
netif_rx(skb);
|
netif_rx(skb);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
dev_info(p_dev, "Allocating a buffer for"
|
||||||
|
" incoming data failed\n");
|
||||||
privptr->stats.rx_dropped++;
|
privptr->stats.rx_dropped++;
|
||||||
printk(KERN_WARNING "%s: %s() low on memory\n",
|
|
||||||
dev->name,__func__);
|
|
||||||
}
|
}
|
||||||
privptr->mtc_offset=0;
|
privptr->mtc_offset=0;
|
||||||
privptr->mtc_logical_link=-1;
|
privptr->mtc_logical_link=-1;
|
||||||
@@ -2884,7 +2916,7 @@ claw_new_device(struct ccwgroup_device *cgdev)
|
|||||||
int ret;
|
int ret;
|
||||||
struct ccw_dev_id dev_id;
|
struct ccw_dev_id dev_id;
|
||||||
|
|
||||||
printk(KERN_INFO "claw: add for %s\n",
|
dev_info(&cgdev->dev, "add for %s\n",
|
||||||
dev_name(&cgdev->cdev[READ]->dev));
|
dev_name(&cgdev->cdev[READ]->dev));
|
||||||
CLAW_DBF_TEXT(2, setup, "new_dev");
|
CLAW_DBF_TEXT(2, setup, "new_dev");
|
||||||
privptr = cgdev->dev.driver_data;
|
privptr = cgdev->dev.driver_data;
|
||||||
@@ -2901,29 +2933,28 @@ claw_new_device(struct ccwgroup_device *cgdev)
|
|||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = add_channel(cgdev->cdev[1],1,privptr);
|
ret = add_channel(cgdev->cdev[1],1,privptr);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
printk(KERN_WARNING
|
dev_warn(&cgdev->dev, "Creating a CLAW group device"
|
||||||
"add channel failed with ret = %d\n", ret);
|
" failed with error code %d\n", ret);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
ret = ccw_device_set_online(cgdev->cdev[READ]);
|
ret = ccw_device_set_online(cgdev->cdev[READ]);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
printk(KERN_WARNING
|
dev_warn(&cgdev->dev,
|
||||||
"claw: ccw_device_set_online %s READ failed "
|
"Setting the read subchannel online"
|
||||||
"with ret = %d\n", dev_name(&cgdev->cdev[READ]->dev),
|
" failed with error code %d\n", ret);
|
||||||
ret);
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
ret = ccw_device_set_online(cgdev->cdev[WRITE]);
|
ret = ccw_device_set_online(cgdev->cdev[WRITE]);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
printk(KERN_WARNING
|
dev_warn(&cgdev->dev,
|
||||||
"claw: ccw_device_set_online %s WRITE failed "
|
"Setting the write subchannel online "
|
||||||
"with ret = %d\n", dev_name(&cgdev->cdev[WRITE]->dev),
|
"failed with error code %d\n", ret);
|
||||||
ret);
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
dev = alloc_netdev(0,"claw%d",claw_init_netdevice);
|
dev = alloc_netdev(0,"claw%d",claw_init_netdevice);
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
printk(KERN_WARNING "%s:alloc_netdev failed\n",__func__);
|
dev_warn(&cgdev->dev,
|
||||||
|
"Activating the CLAW device failed\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
dev->ml_priv = privptr;
|
dev->ml_priv = privptr;
|
||||||
@@ -2951,13 +2982,13 @@ claw_new_device(struct ccwgroup_device *cgdev)
|
|||||||
privptr->channel[WRITE].ndev = dev;
|
privptr->channel[WRITE].ndev = dev;
|
||||||
privptr->p_env->ndev = dev;
|
privptr->p_env->ndev = dev;
|
||||||
|
|
||||||
printk(KERN_INFO "%s:readsize=%d writesize=%d "
|
dev_info(&cgdev->dev, "%s:readsize=%d writesize=%d "
|
||||||
"readbuffer=%d writebuffer=%d read=0x%04x write=0x%04x\n",
|
"readbuffer=%d writebuffer=%d read=0x%04x write=0x%04x\n",
|
||||||
dev->name, p_env->read_size,
|
dev->name, p_env->read_size,
|
||||||
p_env->write_size, p_env->read_buffers,
|
p_env->write_size, p_env->read_buffers,
|
||||||
p_env->write_buffers, p_env->devno[READ],
|
p_env->write_buffers, p_env->devno[READ],
|
||||||
p_env->devno[WRITE]);
|
p_env->devno[WRITE]);
|
||||||
printk(KERN_INFO "%s:host_name:%.8s, adapter_name "
|
dev_info(&cgdev->dev, "%s:host_name:%.8s, adapter_name "
|
||||||
":%.8s api_type: %.8s\n",
|
":%.8s api_type: %.8s\n",
|
||||||
dev->name, p_env->host_name,
|
dev->name, p_env->host_name,
|
||||||
p_env->adapter_name , p_env->api_type);
|
p_env->adapter_name , p_env->api_type);
|
||||||
@@ -3001,8 +3032,8 @@ claw_shutdown_device(struct ccwgroup_device *cgdev)
|
|||||||
ndev = priv->channel[READ].ndev;
|
ndev = priv->channel[READ].ndev;
|
||||||
if (ndev) {
|
if (ndev) {
|
||||||
/* Close the device */
|
/* Close the device */
|
||||||
printk(KERN_INFO
|
dev_info(&cgdev->dev, "%s: shutting down \n",
|
||||||
"%s: shuting down \n",ndev->name);
|
ndev->name);
|
||||||
if (ndev->flags & IFF_RUNNING)
|
if (ndev->flags & IFF_RUNNING)
|
||||||
ret = claw_release(ndev);
|
ret = claw_release(ndev);
|
||||||
ndev->flags &=~IFF_RUNNING;
|
ndev->flags &=~IFF_RUNNING;
|
||||||
@@ -3027,8 +3058,7 @@ claw_remove_device(struct ccwgroup_device *cgdev)
|
|||||||
CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev));
|
CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev));
|
||||||
priv = cgdev->dev.driver_data;
|
priv = cgdev->dev.driver_data;
|
||||||
BUG_ON(!priv);
|
BUG_ON(!priv);
|
||||||
printk(KERN_INFO "claw: %s() called %s will be removed.\n",
|
dev_info(&cgdev->dev, " will be removed.\n");
|
||||||
__func__, dev_name(&cgdev->cdev[0]->dev));
|
|
||||||
if (cgdev->state == CCWGROUP_ONLINE)
|
if (cgdev->state == CCWGROUP_ONLINE)
|
||||||
claw_shutdown_device(cgdev);
|
claw_shutdown_device(cgdev);
|
||||||
claw_remove_files(&cgdev->dev);
|
claw_remove_files(&cgdev->dev);
|
||||||
@@ -3067,7 +3097,8 @@ claw_hname_show(struct device *dev, struct device_attribute *attr, char *buf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
claw_hname_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
|
claw_hname_write(struct device *dev, struct device_attribute *attr,
|
||||||
|
const char *buf, size_t count)
|
||||||
{
|
{
|
||||||
struct claw_privbk *priv;
|
struct claw_privbk *priv;
|
||||||
struct claw_env * p_env;
|
struct claw_env * p_env;
|
||||||
@@ -3104,7 +3135,8 @@ claw_adname_show(struct device *dev, struct device_attribute *attr, char *buf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
claw_adname_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
|
claw_adname_write(struct device *dev, struct device_attribute *attr,
|
||||||
|
const char *buf, size_t count)
|
||||||
{
|
{
|
||||||
struct claw_privbk *priv;
|
struct claw_privbk *priv;
|
||||||
struct claw_env * p_env;
|
struct claw_env * p_env;
|
||||||
@@ -3142,7 +3174,8 @@ claw_apname_show(struct device *dev, struct device_attribute *attr, char *buf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
claw_apname_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
|
claw_apname_write(struct device *dev, struct device_attribute *attr,
|
||||||
|
const char *buf, size_t count)
|
||||||
{
|
{
|
||||||
struct claw_privbk *priv;
|
struct claw_privbk *priv;
|
||||||
struct claw_env * p_env;
|
struct claw_env * p_env;
|
||||||
@@ -3189,7 +3222,8 @@ claw_wbuff_show(struct device *dev, struct device_attribute *attr, char *buf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
claw_wbuff_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
|
claw_wbuff_write(struct device *dev, struct device_attribute *attr,
|
||||||
|
const char *buf, size_t count)
|
||||||
{
|
{
|
||||||
struct claw_privbk *priv;
|
struct claw_privbk *priv;
|
||||||
struct claw_env * p_env;
|
struct claw_env * p_env;
|
||||||
@@ -3230,7 +3264,8 @@ claw_rbuff_show(struct device *dev, struct device_attribute *attr, char *buf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
claw_rbuff_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
|
claw_rbuff_write(struct device *dev, struct device_attribute *attr,
|
||||||
|
const char *buf, size_t count)
|
||||||
{
|
{
|
||||||
struct claw_privbk *priv;
|
struct claw_privbk *priv;
|
||||||
struct claw_env *p_env;
|
struct claw_env *p_env;
|
||||||
@@ -3293,7 +3328,7 @@ claw_cleanup(void)
|
|||||||
{
|
{
|
||||||
unregister_cu3088_discipline(&claw_group_driver);
|
unregister_cu3088_discipline(&claw_group_driver);
|
||||||
claw_unregister_debug_facility();
|
claw_unregister_debug_facility();
|
||||||
printk(KERN_INFO "claw: Driver unloaded\n");
|
pr_info("Driver unloaded\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3307,12 +3342,12 @@ static int __init
|
|||||||
claw_init(void)
|
claw_init(void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
printk(KERN_INFO "claw: starting driver\n");
|
|
||||||
|
|
||||||
|
pr_info("Loading %s\n", version);
|
||||||
ret = claw_register_debug_facility();
|
ret = claw_register_debug_facility();
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printk(KERN_WARNING "claw: %s() debug_register failed %d\n",
|
pr_err("Registering with the S/390 debug feature"
|
||||||
__func__,ret);
|
" failed with error code %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
CLAW_DBF_TEXT(2, setup, "init_mod");
|
CLAW_DBF_TEXT(2, setup, "init_mod");
|
||||||
@@ -3320,8 +3355,8 @@ claw_init(void)
|
|||||||
if (ret) {
|
if (ret) {
|
||||||
CLAW_DBF_TEXT(2, setup, "init_bad");
|
CLAW_DBF_TEXT(2, setup, "init_bad");
|
||||||
claw_unregister_debug_facility();
|
claw_unregister_debug_facility();
|
||||||
printk(KERN_WARNING "claw; %s() cu3088 register failed %d\n",
|
pr_err("Registering with the cu3088 device driver failed "
|
||||||
__func__,ret);
|
"with error code %d\n", ret);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user