[PATCH] synclink_cs add statistics clear
Add ability to clear statistics. Signed-off-by: Paul Fulghum <paulkf@microgate.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Родитель
4247bdc600
Коммит
a7482a2e77
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* linux/drivers/char/pcmcia/synclink_cs.c
|
* linux/drivers/char/pcmcia/synclink_cs.c
|
||||||
*
|
*
|
||||||
* $Id: synclink_cs.c,v 4.26 2004/08/11 19:30:02 paulkf Exp $
|
* $Id: synclink_cs.c,v 4.34 2005/09/08 13:20:54 paulkf Exp $
|
||||||
*
|
*
|
||||||
* Device driver for Microgate SyncLink PC Card
|
* Device driver for Microgate SyncLink PC Card
|
||||||
* multiprotocol serial adapter.
|
* multiprotocol serial adapter.
|
||||||
|
@ -472,7 +472,7 @@ module_param_array(dosyncppp, int, NULL, 0);
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
|
|
||||||
static char *driver_name = "SyncLink PC Card driver";
|
static char *driver_name = "SyncLink PC Card driver";
|
||||||
static char *driver_version = "$Revision: 4.26 $";
|
static char *driver_version = "$Revision: 4.34 $";
|
||||||
|
|
||||||
static struct tty_driver *serial_driver;
|
static struct tty_driver *serial_driver;
|
||||||
|
|
||||||
|
@ -1457,6 +1457,8 @@ static int startup(MGSLPC_INFO * info)
|
||||||
|
|
||||||
info->pending_bh = 0;
|
info->pending_bh = 0;
|
||||||
|
|
||||||
|
memset(&info->icount, 0, sizeof(info->icount));
|
||||||
|
|
||||||
init_timer(&info->tx_timer);
|
init_timer(&info->tx_timer);
|
||||||
info->tx_timer.data = (unsigned long)info;
|
info->tx_timer.data = (unsigned long)info;
|
||||||
info->tx_timer.function = tx_timeout;
|
info->tx_timer.function = tx_timeout;
|
||||||
|
@ -1946,9 +1948,13 @@ static int get_stats(MGSLPC_INFO * info, struct mgsl_icount __user *user_icount)
|
||||||
int err;
|
int err;
|
||||||
if (debug_level >= DEBUG_LEVEL_INFO)
|
if (debug_level >= DEBUG_LEVEL_INFO)
|
||||||
printk("get_params(%s)\n", info->device_name);
|
printk("get_params(%s)\n", info->device_name);
|
||||||
COPY_TO_USER(err,user_icount, &info->icount, sizeof(struct mgsl_icount));
|
if (!user_icount) {
|
||||||
if (err)
|
memset(&info->icount, 0, sizeof(info->icount));
|
||||||
return -EFAULT;
|
} else {
|
||||||
|
COPY_TO_USER(err, user_icount, &info->icount, sizeof(struct mgsl_icount));
|
||||||
|
if (err)
|
||||||
|
return -EFAULT;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче