/*
- * $Id: ctcmain.c,v 1.63 2004/07/28 12:27:54 ptiedem Exp $
+ * $Id: ctcmain.c,v 1.68 2004/12/27 09:25:27 heicarst Exp $
*
* CTC / ESCON network driver
*
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.63 $
+ * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.68 $
*
*/
\f
#include <linux/interrupt.h>
#include <linux/timer.h>
#include <linux/sched.h>
+#include <linux/bitops.h>
#include <linux/signal.h>
#include <linux/string.h>
#include <asm/io.h>
#include <asm/ccwdev.h>
#include <asm/ccwgroup.h>
-#include <asm/bitops.h>
#include <asm/uaccess.h>
#include <asm/idals.h>
print_banner(void)
{
static int printed = 0;
- char vbuf[] = "$Revision: 1.63 $";
+ char vbuf[] = "$Revision: 1.68 $";
char *version = vbuf;
if (printed)
fsm_deltimer(&ch->timer);
fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch);
fsm_newstate(fi, CH_STATE_SETUPWAIT);
- if (event == CH_EVENT_TIMER)
+ saveflags = 0; /* avoids compiler warning with
+ spin_unlock_irqrestore */
+ if (event == CH_EVENT_TIMER) // only for timer not yet locked
spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags);
rc = ccw_device_start(ch->cdev, &ch->ccw[6], (unsigned long) ch, 0xff, 0);
if (event == CH_EVENT_TIMER)
DBF_TEXT(trace, 3, __FUNCTION__);
fsm_deltimer(&ch->timer);
fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch);
- if (event == CH_EVENT_STOP)
+ saveflags = 0; /* avoids comp warning with
+ spin_unlock_irqrestore */
+ if (event == CH_EVENT_STOP) // only for STOP not yet locked
spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags);
oldstate = fsm_getstate(fi);
fsm_newstate(fi, CH_STATE_TERM);
fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch);
oldstate = fsm_getstate(fi);
fsm_newstate(fi, CH_STATE_STARTWAIT);
- if (event == CH_EVENT_TIMER)
+ saveflags = 0; /* avoids compiler warning with
+ spin_unlock_irqrestore */
+ if (event == CH_EVENT_TIMER) // only for timer not yet locked
spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags);
rc = ccw_device_halt(ch->cdev, (unsigned long) ch);
if (event == CH_EVENT_TIMER)
return;
}
fsm_addtimer(&ch->timer, 1000, CH_EVENT_TIMER, ch);
- if (event == CH_EVENT_TIMER)
+ saveflags = 0; /* avoids compiler warning with
+ spin_unlock_irqrestore */
+ if (event == CH_EVENT_TIMER) // only for TIMER not yet locked
spin_lock_irqsave(get_ccwdev_lock(ch->cdev),
saveflags);
rc = ccw_device_start(ch->cdev, &ch->ccw[3],
ch_fsm, CH_FSM_LEN, GFP_KERNEL);
if (ch->fsm == NULL) {
ctc_pr_warn("ctc: Could not create FSM in add_channel\n");
+ kfree(ch->ccw);
kfree(ch);
return -1;
}
GFP_KERNEL)) == NULL) {
ctc_pr_warn("ctc: Out of memory in add_channel\n");
kfree_fsm(ch->fsm);
+ kfree(ch->ccw);
kfree(ch);
return -1;
}
"using old entry\n", (*c)->id);
kfree(ch->irb);
kfree_fsm(ch->fsm);
+ kfree(ch->ccw);
kfree(ch);
return 0;
}
struct net_device *ndev;
int bs1;
- DBF_TEXT(trace, 5, __FUNCTION__);
+ DBF_TEXT(trace, 3, __FUNCTION__);
priv = dev->driver_data;
if (!priv)
return -ENODEV;
static int
ctc_add_attributes(struct device *dev)
{
- device_create_file(dev, &dev_attr_buffer);
+// device_create_file(dev, &dev_attr_buffer);
device_create_file(dev, &dev_attr_loglevel);
device_create_file(dev, &dev_attr_stats);
return 0;
{
device_remove_file(dev, &dev_attr_stats);
device_remove_file(dev, &dev_attr_loglevel);
- device_remove_file(dev, &dev_attr_buffer);
+// device_remove_file(dev, &dev_attr_buffer);
}
\f
static struct attribute *ctc_attr[] = {
&dev_attr_protocol.attr,
&dev_attr_type.attr,
+ &dev_attr_buffer.attr,
NULL,
};