* Frank Pavlic (pavlic@de.ibm.com) and
* Martin Schwidefsky <schwidefsky@de.ibm.com>
*
- * $Revision: 1.61 $ $Date: 2003/12/02 15:18:50 $
+ * $Revision: 1.66 $ $Date: 2004/02/19 13:46:01 $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/**
* initialization string for output
*/
-#define VERSION_LCS_C "$Revision: 1.61 $"
+#define VERSION_LCS_C "$Revision: 1.66 $"
static char version[] __initdata = "LCS driver ("VERSION_LCS_C "/" VERSION_LCS_H ")";
debug_register_view(lcs_dbf_setup, &debug_hex_ascii_view);
debug_set_level(lcs_dbf_setup, 5);
debug_register_view(lcs_dbf_trace, &debug_hex_ascii_view);
- debug_set_level(lcs_dbf_trace, 3);
+ debug_set_level(lcs_dbf_trace, 5);
return 0;
}
int cnt;
LCS_DBF_TEXT(3, setup, "ichfree");
- for (cnt = 0; cnt < LCS_NUM_BUFFS; cnt++)
- kfree(channel->iob[cnt].data);
+ for (cnt = 0; cnt < LCS_NUM_BUFFS; cnt++) {
+ if (channel->iob[cnt].data != NULL)
+ kfree(channel->iob[cnt].data);
+ channel->iob[cnt].data = NULL;
+ }
}
/**
kfree(ipm_list);
}
#endif
- free_netdev(card->dev);
+ if (card->dev != NULL)
+ free_netdev(card->dev);
/* Cleanup channels. */
lcs_cleanup_channel(&card->write);
lcs_cleanup_channel(&card->read);
struct lcs_cmd *cmd;
struct timer_list timer;
int rc;
+ char buf[16];
cmd = (struct lcs_cmd *) buffer->data;
cmd->sequence_no = ++card->sequence_no;
add_timer(&timer);
wait_event(reply.wait_q, reply.received);
del_timer(&timer);
+ LCS_DBF_TEXT(5, trace, "sendcmd");
+ sprintf(buf, "rc:%d", reply.rc);
+ LCS_DBF_TEXT(5, trace, buf);
return reply.rc ? -EIO : 0;
}
struct lcs_buffer *buffer;
struct lcs_cmd *cmd;
- LCS_DBF_TEXT(2, trace, "cmdstpln");
+ LCS_DBF_TEXT(2, trace, "cmdstaln");
buffer = lcs_get_lancmd(card, LCS_STD_CMD_SIZE);
cmd = (struct lcs_cmd *) buffer->data;
cmd->cmd_code = LCS_CMD_STARTLAN;
LCS_DBF_TEXT(5, trace, dbf_text);
/* How far in the ccw chain have we processed? */
- if (channel->state != CH_STATE_INIT) {
+ if ((channel->state != CH_STATE_INIT) &&
+ (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) {
index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa)
- channel->ccws;
if ((irb->scsw.actl & SCSW_ACTL_SUSPENDED) ||
/* CCW execution stopped on a suspend bit. */
channel->state = CH_STATE_SUSPENDED;
- if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC)
+ if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC) {
+ if (irb->scsw.cc != 0) {
+ ccw_device_halt(channel->ccwdev, (addr_t) channel);
+ return;
+ }
/* The channel has been stopped by halt_IO. */
channel->state = CH_STATE_HALTED;
+ }
/* Do the rest in the tasklet. */
tasklet_schedule(&channel->irq_tasklet);
else
rc = lcs_send_startlan(card, LCS_INITIATOR_TCPIP);
} else {
- for (i = 0; i <= card->max_port_no; i++) {
+ for (i = 0; i <= 16; i++) {
card->portno = i;
if (card->lan_type != LCS_FRAME_TYPE_AUTO)
rc = lcs_send_startlan(card,
static int
lcs_detect(struct lcs_card *card)
{
- int rc;
+ int rc = 0;
LCS_DBF_TEXT(3, setup," lcsdetct");
/* start/reset card */
if (rc) {
LCS_DBF_TEXT(3, setup, "errinit");
PRINT_ERR("LCS card Initialization failed\n");
- lcs_free_card(card);
return rc;
}
if (rc) {
lcs_stopcard(card);
lcs_cleanup_card(card);
- lcs_free_card(card);
return -ENODEV;
}
switch (card->lan_type) {
return 0;
out:
lcs_cleanup_card(card);
- lcs_free_card(card);
return -ENODEV;
}
{
int rc;
- LCS_DBF_TEXT(0, setup, "lcsinit");
PRINT_INFO("Loading %s\n",version);
rc = lcs_register_debug_facility();
+ LCS_DBF_TEXT(0, setup, "lcsinit");
if (rc) {
PRINT_ERR("Initialization failed\n");
return rc;