diff options
author | Paul Fulghum <paulkf@microgate.com> | 2005-09-09 16:02:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 16:57:33 -0400 |
commit | 9661239f7f698ba3a79db5e8ab5bb2f4090663d9 (patch) | |
tree | a26280d642eef11d3034a832e21072b1d453a803 /drivers/char | |
parent | 4a918bc233c8b9537fbc05a8bbb33928a4980cc5 (diff) |
[PATCH] synclink.c: add clear stats
Add the 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>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/synclink.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 747eb8d18166..26b421b74bb6 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c | |||
@@ -1814,6 +1814,8 @@ static int startup(struct mgsl_struct * info) | |||
1814 | 1814 | ||
1815 | info->pending_bh = 0; | 1815 | info->pending_bh = 0; |
1816 | 1816 | ||
1817 | memset(&info->icount, 0, sizeof(info->icount)); | ||
1818 | |||
1817 | init_timer(&info->tx_timer); | 1819 | init_timer(&info->tx_timer); |
1818 | info->tx_timer.data = (unsigned long)info; | 1820 | info->tx_timer.data = (unsigned long)info; |
1819 | info->tx_timer.function = mgsl_tx_timeout; | 1821 | info->tx_timer.function = mgsl_tx_timeout; |
@@ -2470,12 +2472,12 @@ static int mgsl_get_stats(struct mgsl_struct * info, struct mgsl_icount __user * | |||
2470 | printk("%s(%d):mgsl_get_params(%s)\n", | 2472 | printk("%s(%d):mgsl_get_params(%s)\n", |
2471 | __FILE__,__LINE__, info->device_name); | 2473 | __FILE__,__LINE__, info->device_name); |
2472 | 2474 | ||
2473 | COPY_TO_USER(err,user_icount, &info->icount, sizeof(struct mgsl_icount)); | 2475 | if (!user_icount) { |
2474 | if (err) { | 2476 | memset(&info->icount, 0, sizeof(info->icount)); |
2475 | if ( debug_level >= DEBUG_LEVEL_INFO ) | 2477 | } else { |
2476 | printk( "%s(%d):mgsl_get_stats(%s) user buffer copy failed\n", | 2478 | COPY_TO_USER(err, user_icount, &info->icount, sizeof(struct mgsl_icount)); |
2477 | __FILE__,__LINE__,info->device_name); | 2479 | if (err) |
2478 | return -EFAULT; | 2480 | return -EFAULT; |
2479 | } | 2481 | } |
2480 | 2482 | ||
2481 | return 0; | 2483 | return 0; |