summaryrefslogtreecommitdiffstats
path: root/net/wanrouter
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-18 00:24:27 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-18 00:24:27 +0000
commitb9558d5f86c471a125abf1fb3a3882fb053b1f8c (patch)
tree707b53ec64e740a7da87d5f36485e3cd9b1c794e /net/wanrouter
parentb3ac367c7a3e6047abe74817db27e34e759f279f (diff)
Merge with Linux 2.3.41.
Diffstat (limited to 'net/wanrouter')
-rw-r--r--net/wanrouter/wanmain.c213
-rw-r--r--net/wanrouter/wanproc.c142
2 files changed, 188 insertions, 167 deletions
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index ae365edaa..af7191563 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -9,15 +9,16 @@
* o Logical connection management (switched virtual circuits)
* o Protocol encapsulation/decapsulation
*
-* Author: Gene Kozin <genek@compuserve.com>
+* Author: Gideon Hack
*
-* Copyright: (c) 1995-1997 Sangoma Technologies Inc.
+* Copyright: (c) 1995-1999 Sangoma Technologies Inc.
*
* 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 the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* ============================================================================
+* Oct 01, 1999 Gideon Hack Update for s514 PCI card
* Dec 27, 1996 Gene Kozin Initial version (based on Sangoma's WANPIPE)
* Jan 16, 1997 Gene Kozin router_devlist made public
* Jan 31, 1997 Alan Cox Hacked it about a bit for 2.1
@@ -31,8 +32,10 @@
* kernel memory and copy configuration data to
* kernel space (for big firmwares)
* May 19, 1999 Arnaldo Melo __init in wanrouter_init
+* Jun 02, 1999 Gideon Hack Updates for Linux 2.0.X and 2.2.X kernels.
*****************************************************************************/
+#include <linux/version.h>
#include <linux/config.h>
#include <linux/stddef.h> /* offsetof(), etc. */
#include <linux/errno.h> /* return codes */
@@ -48,7 +51,11 @@
#include <linux/wanrouter.h> /* WAN router API definitions */
#include <linux/init.h> /* __init et al. */
-/****** Defines and Macros **************************************************/
+
+
+/*
+ * Defines and Macros
+ */
#ifndef min
#define min(a,b) (((a)<(b))?(a):(b))
@@ -57,48 +64,49 @@
#define max(a,b) (((a)>(b))?(a):(b))
#endif
-/****** Function Prototypes *************************************************/
-
/*
- * Kernel loadable module interface.
+ * Function Prototypes
*/
+/*
+ * Kernel loadable module interface.
+ */
#ifdef MODULE
int init_module (void);
void cleanup_module (void);
#endif
-/*
+/*
* WAN device IOCTL handlers
*/
-static int device_setup (wan_device_t* wandev, wandev_conf_t* u_conf);
-static int device_stat (wan_device_t* wandev, wandev_stat_t* u_stat);
-static int device_shutdown (wan_device_t* wandev);
-static int device_new_if (wan_device_t* wandev, wanif_conf_t* u_conf);
-static int device_del_if (wan_device_t* wandev, char* u_name);
-
-/*
+static int device_setup(wan_device_t *wandev, wandev_conf_t *u_conf);
+static int device_stat(wan_device_t *wandev, wandev_stat_t *u_stat);
+static int device_shutdown(wan_device_t *wandev);
+static int device_new_if(wan_device_t *wandev, wanif_conf_t *u_conf);
+static int device_del_if(wan_device_t *wandev, char *u_name);
+
+/*
* Miscellaneous
*/
-static wan_device_t* find_device (char* name);
-static int delete_interface (wan_device_t* wandev, char* name, int forse);
+static wan_device_t *find_device (char *name);
+static int delete_interface (wan_device_t *wandev, char *name, int force);
/*
* Global Data
*/
static char fullname[] = "WAN Router";
-static char copyright[] = "(c) 1995-1997 Sangoma Technologies Inc.";
+static char copyright[] = "(c) 1995-1999 Sangoma Technologies Inc.";
static char modname[] = ROUTER_NAME; /* short module name */
-wan_device_t * router_devlist = NULL; /* list of registered devices */
-static int devcnt = 0;
+wan_device_t* router_devlist = NULL; /* list of registered devices */
+static int devcnt = 0;
-/*
- * Organizationally Unique Identifiers for encapsulation/decapsulation
+/*
+ * Organize Unique Identifiers for encapsulation/decapsulation
*/
-
+
static unsigned char oui_ether[] = { 0x00, 0x00, 0x00 };
#if 0
static unsigned char oui_802_2[] = { 0x00, 0x80, 0xC2 };
@@ -115,8 +123,7 @@ int __init wanrouter_init(void)
fullname, ROUTER_VERSION, ROUTER_RELEASE, copyright);
err = wanrouter_proc_init();
if (err)
- printk(KERN_ERR "%s: can't create entry in proc filesystem!\n",
- modname);
+ printk(KERN_ERR "%s: can't create entry in proc filesystem!\n", modname);
/*
* Initialise compiled in boards
@@ -138,14 +145,14 @@ int __init wanrouter_init(void)
*/
/*
- * Module 'insert' entry point.
- * o print announcement
- * o initialize static data
- * o create /proc/net/router directory and static entries
+ * Module 'insert' entry point.
+ * o print announcement
+ * o initialize static data
+ * o create /proc/net/router directory and static entries
*
- * Return: 0 Ok
+ * Return: 0 Ok
* < 0 error.
- * Context: process
+ * Context: process
*/
int init_module (void)
@@ -161,10 +168,10 @@ int init_module (void)
}
/*
- * Module 'remove' entry point.
- * o delete /proc/net/router directory and static entries.
+ * Module 'remove' entry point.
+ * o delete /proc/net/router directory and static entries.
*/
-
+
void cleanup_module (void)
{
wanrouter_proc_cleanup();
@@ -173,33 +180,34 @@ void cleanup_module (void)
#endif
/*
- * Kernel APIs
+ * Kernel APIs
*/
/*
- * Register WAN device.
- * o verify device credentials
- * o create an entry for the device in the /proc/net/router directory
- * o initialize internally maintained fields of the wan_device structure
- * o link device data space to a singly-linked list
- * o if it's the first device, then start kernel 'thread'
- * o increment module use count
+ * Register WAN device.
+ * o verify device credentials
+ * o create an entry for the device in the /proc/net/router directory
+ * o initialize internally maintained fields of the wan_device structure
+ * o link device data space to a singly-linked list
+ * o if it's the first device, then start kernel 'thread'
+ * o increment module use count
*
- * Return:
- * 0 Ok
- * < 0 error.
+ * Return:
+ * 0 Ok
+ * < 0 error.
*
- * Context: process
+ * Context: process
*/
-int register_wan_device(wan_device_t* wandev)
+
+int register_wan_device(wan_device_t *wandev)
{
int err, namelen;
if ((wandev == NULL) || (wandev->magic != ROUTER_MAGIC) ||
(wandev->name == NULL))
return -EINVAL;
-
+
namelen = strlen(wandev->name);
if (!namelen || (namelen > WAN_DRVNAME_SZ))
return -EINVAL;
@@ -215,12 +223,10 @@ int register_wan_device(wan_device_t* wandev)
* Register /proc directory entry
*/
err = wanrouter_proc_add(wandev);
- if (err)
- {
+ if (err) {
printk(KERN_ERR
"%s: can't create /proc/net/router/%s entry!\n",
- modname, wandev->name)
- ;
+ modname, wandev->name);
return err;
}
@@ -250,8 +256,8 @@ int register_wan_device(wan_device_t* wandev)
* Context: process
*/
-
-int unregister_wan_device(char* name)
+
+int unregister_wan_device(char *name)
{
wan_device_t *wandev, *prev;
@@ -269,8 +275,7 @@ int unregister_wan_device(char* name)
printk(KERN_INFO "%s: unregistering WAN device %s\n", modname, name);
#endif
- if (wandev->state != WAN_UNCONFIGURED)
- {
+ if (wandev->state != WAN_UNCONFIGURED) {
while(wandev->dev)
delete_interface(wandev, wandev->dev->name, 1);
if (wandev->shutdown)
@@ -359,7 +364,6 @@ unsigned short wanrouter_type_trans (struct sk_buff* skb, struct net_device* dev
"on interface %s!\n", modname,
skb->data[cnt+1], skb->data[cnt+2],
skb->data[cnt+3], dev->name);
- ;
return 0;
}
ethertype = *((unsigned short*)&skb->data[cnt+4]);
@@ -371,8 +375,7 @@ unsigned short wanrouter_type_trans (struct sk_buff* skb, struct net_device* dev
default:
printk(KERN_INFO
"%s: unsupported NLPID 0x%02X on interface %s!\n",
- modname, skb->data[cnt], dev->name)
- ;
+ modname, skb->data[cnt], dev->name);
return 0;
}
skb->protocol = ethertype;
@@ -382,18 +385,19 @@ unsigned short wanrouter_type_trans (struct sk_buff* skb, struct net_device* dev
return ethertype;
}
+
/*
* WAN device IOCTL.
* o find WAN device associated with this node
* o execute requested action or pass command to the device driver
*/
-int wanrouter_ioctl(struct inode* inode, struct file* file,
+int wanrouter_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
int err = 0;
- struct proc_dir_entry* dent;
- wan_device_t* wandev;
+ struct proc_dir_entry *dent;
+ wan_device_t *wandev;
if (!capable(CAP_NET_ADMIN)){
return -EPERM;
@@ -410,8 +414,7 @@ int wanrouter_ioctl(struct inode* inode, struct file* file,
if (wandev->magic != ROUTER_MAGIC)
return -EINVAL;
- switch (cmd)
- {
+ switch (cmd) {
case ROUTER_SETUP:
err = device_setup(wandev, (void*)arg);
break;
@@ -439,8 +442,7 @@ int wanrouter_ioctl(struct inode* inode, struct file* file,
if ((cmd >= ROUTER_USER) &&
(cmd <= ROUTER_USER_MAX) &&
wandev->ioctl)
- err = wandev->ioctl(wandev, cmd, arg)
- ;
+ err = wandev->ioctl(wandev, cmd, arg);
else err = -EINVAL;
}
return err;
@@ -458,51 +460,52 @@ int wanrouter_ioctl(struct inode* inode, struct file* file,
* o call driver's setup() entry point
*/
-static int device_setup (wan_device_t* wandev, wandev_conf_t* u_conf)
+static int device_setup (wan_device_t *wandev, wandev_conf_t *u_conf)
{
- void* data;
+ void *data = NULL;
wandev_conf_t *conf;
- int err= -EINVAL;
+ int err = -EINVAL;
if (wandev->setup == NULL) /* Nothing to do ? */
return 0;
-
+
conf = kmalloc(sizeof(wandev_conf_t), GFP_KERNEL);
if (conf == NULL)
return -ENOBUFS;
-
- if(copy_from_user(conf, u_conf, sizeof(wandev_conf_t)))
- {
+
+ if(copy_from_user(conf, u_conf, sizeof(wandev_conf_t))) {
kfree(conf);
return -EFAULT;
}
- if (conf->magic != ROUTER_MAGIC)
- goto bail;
+ if (conf->magic != ROUTER_MAGIC) {
+ kfree(conf);
+ return -EINVAL;
+ }
- if (conf->data_size && conf->data)
- {
- if(conf->data_size > 128000 || conf->data_size < 0){
- goto bail;
+ if (conf->data_size && conf->data) {
+ if(conf->data_size > 128000 || conf->data_size < 0) {
+ kfree(conf);
+ return -EINVAL;;
}
+
data = vmalloc(conf->data_size);
- if (data)
- {
- if(!copy_from_user(data, conf->data, conf->data_size))
- {
+ if (data) {
+ if(!copy_from_user(data, conf->data, conf->data_size)){
conf->data=data;
err = wandev->setup(wandev,conf);
}
else
err = -EFAULT;
}
- else
+ else
err = -ENOBUFS;
-
+
if (data)
vfree(data);
+
}
-bail:
+
kfree(conf);
return err;
}
@@ -537,7 +540,7 @@ static int device_shutdown (wan_device_t* wandev)
* Get WAN device status & statistics.
*/
-static int device_stat (wan_device_t* wandev, wandev_stat_t* u_stat)
+static int device_stat (wan_device_t *wandev, wandev_stat_t *u_stat)
{
wandev_stat_t stat;
@@ -553,6 +556,7 @@ static int device_stat (wan_device_t* wandev, wandev_stat_t* u_stat)
if(copy_to_user(u_stat, &stat, sizeof(stat)))
return -EFAULT;
+
return 0;
}
@@ -569,7 +573,7 @@ static int device_stat (wan_device_t* wandev, wandev_stat_t* u_stat)
static int device_new_if (wan_device_t* wandev, wanif_conf_t* u_conf)
{
wanif_conf_t conf;
- struct net_device* dev;
+ struct net_device *dev;
int err;
if ((wandev->state == WAN_UNCONFIGURED) || (wandev->new_if == NULL))
@@ -587,8 +591,7 @@ static int device_new_if (wan_device_t* wandev, wanif_conf_t* u_conf)
memset(dev, 0, sizeof(struct net_device));
err = wandev->new_if(wandev, dev, &conf);
- if (!err)
- {
+ if (!err) {
/* Register network interface. This will invoke init()
* function supplied by the driver. If device registered
* successfully, add it to the interface list.
@@ -598,15 +601,13 @@ static int device_new_if (wan_device_t* wandev, wanif_conf_t* u_conf)
else if (dev_get(dev->name))
err = -EEXIST; /* name already exists */
- else
- {
+ else {
#ifdef WANDEBUG
printk(KERN_INFO "%s: registering interface %s...\n",
modname, dev->name);
#endif
err = register_netdev(dev);
- if (!err)
- {
+ if (!err) {
cli(); /***** critical section start *****/
dev->slave = wandev->dev;
wandev->dev = dev;
@@ -622,25 +623,28 @@ static int device_new_if (wan_device_t* wandev, wanif_conf_t* u_conf)
return err;
}
+
/*
* Delete WAN logical channel.
* o verify user address space
* o copy configuration data to kernel address space
*/
-static int device_del_if (wan_device_t* wandev, char* u_name)
+static int device_del_if (wan_device_t *wandev, char *u_name)
{
char name[WAN_IFNAME_SZ + 1];
if (wandev->state == WAN_UNCONFIGURED)
return -ENODEV;
-
+
memset(name, 0, sizeof(name));
+
if(copy_from_user(name, u_name, WAN_IFNAME_SZ))
return -EFAULT;
return delete_interface(wandev, name, 0);
}
+
/*
* Miscellaneous Functions
*/
@@ -650,9 +654,9 @@ static int device_del_if (wan_device_t* wandev, char* u_name)
* Return pointer to the WAN device data space or NULL if device not found.
*/
-static wan_device_t* find_device (char* name)
+static wan_device_t *find_device(char *name)
{
- wan_device_t* wandev;
+ wan_device_t *wandev;
for (wandev = router_devlist;wandev && strcmp(wandev->name, name);
wandev = wandev->next);
@@ -676,7 +680,7 @@ static wan_device_t* find_device (char* name)
* sure that opened interfaces are not removed!
*/
-static int delete_interface (wan_device_t* wandev, char* name, int force)
+static int delete_interface (wan_device_t *wandev, char *name, int force)
{
struct net_device *dev, *prev;
@@ -687,16 +691,16 @@ static int delete_interface (wan_device_t* wandev, char* name, int force)
if (dev == NULL)
return -ENODEV; /* interface not found */
- if (dev->start)
- {
- if (force)
- {
+ if (dev->start) {
+ if (force) {
printk(KERN_WARNING
- "%s: deleting opened interface %s!\n",modname, name);
+ "%s: deleting opened interface %s!\n",
+ modname, name);
}
else
return -EBUSY; /* interface in use */
}
+
if (wandev->del_if)
wandev->del_if(wandev, dev);
@@ -708,7 +712,7 @@ static int delete_interface (wan_device_t* wandev, char* name, int force)
--wandev->ndev;
sti(); /****** critical section end ******/
- printk("Unregistering '%s'\n", dev->name);
+ printk("Unregistering '%s'\n", dev->name);
unregister_netdev(dev);
kfree(dev);
return 0;
@@ -722,4 +726,3 @@ EXPORT_SYMBOL(wanrouter_type_trans);
/*
* End
*/
-
diff --git a/net/wanrouter/wanproc.c b/net/wanrouter/wanproc.c
index f895fc58b..91696d57e 100644
--- a/net/wanrouter/wanproc.c
+++ b/net/wanrouter/wanproc.c
@@ -4,21 +4,23 @@
* This module is completely hardware-independent and provides
* access to the router using Linux /proc filesystem.
*
-* Author: Gene Kozin <genek@compuserve.com>
+* Author: Gideon Hack
*
-* Copyright: (c) 1995-1997 Sangoma Technologies Inc.
+* Copyright: (c) 1995-1999 Sangoma Technologies Inc.
*
* 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 the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* ============================================================================
+* Jun 02, 1999 Gideon Hack Updates for Linux 2.2.X kernels.
* Jun 29, 1997 Alan Cox Merged with 1.0.3 vendor code
* Jan 29, 1997 Gene Kozin v1.0.1. Implemented /proc read routines
* Jan 30, 1997 Alan Cox Hacked around for 2.1
* Dec 13, 1996 Gene Kozin Initial version (based on Sangoma's WANPIPE)
*****************************************************************************/
+#include <linux/version.h>
#include <linux/config.h>
#include <linux/stddef.h> /* offsetof(), etc. */
#include <linux/errno.h> /* return codes */
@@ -36,6 +38,8 @@
/****** Defines and Macros **************************************************/
+#define PROC_STATS_FORMAT "%30s: %12lu\n"
+
#ifndef min
#define min(a,b) (((a)<(b))?(a):(b))
#endif
@@ -45,11 +49,12 @@
#define PROC_BUFSZ 4000 /* buffer size for printing proc info */
+
/****** Data Types **********************************************************/
typedef struct wan_stat_entry
{
- struct wan_stat_entry * next;
+ struct wan_stat_entry *next;
char *description; /* description string */
void *data; /* -> data */
unsigned data_type; /* data type */
@@ -83,7 +88,6 @@ static int wandev_get_info(char* buf, char** start, off_t offs, int len);
/*
* Generic /proc/net/router/<file> file and inode operations
*/
-
static struct file_operations router_fops =
{
NULL, /* lseek */
@@ -266,7 +270,7 @@ static int router_proc_perms (struct inode* inode, int op)
/*
* Read router proc directory entry.
- * This is universal routine for reading all entries in /proc/net/router
+ * This is universal routine for reading all entries in /proc/net/wanrouter
* directory. Each directory entry contains a pointer to the 'method' for
* preparing data for that entry.
* o verify arguments
@@ -300,8 +304,7 @@ static ssize_t router_proc_read(struct file* file, char* buf, size_t count,
pos = dent->get_info(page, dent->data, 0, 0);
offs = file->f_pos;
- if (offs < pos)
- {
+ if (offs < pos) {
len = min(pos - offs, count);
if(copy_to_user(buf, (page + offs), len))
return -EFAULT;
@@ -325,15 +328,14 @@ static int config_get_info(char* buf, char** start, off_t offs, int len)
strcpy(buf, conf_hdr);
for (wandev = router_devlist;
wandev && (cnt < (PROC_BUFSZ - 120));
- wandev = wandev->next)
- {
+ wandev = wandev->next) {
if (wandev->state) cnt += sprintf(&buf[cnt],
"%-15s|0x%-4X|%3u|%3u| 0x%-8lX |0x%-6X|%7u|%7u|%7u|%7u\n",
wandev->name,
wandev->ioport,
wandev->irq,
wandev->dma,
- virt_to_phys(wandev->maddr),
+ wandev->maddr,
wandev->msize,
wandev->hw_opt[0],
wandev->hw_opt[1],
@@ -351,13 +353,16 @@ static int config_get_info(char* buf, char** start, off_t offs, int len)
static int status_get_info(char* buf, char** start, off_t offs, int len)
{
- int cnt = sizeof(stat_hdr) - 1;
+ int cnt = 0;
wan_device_t* wandev;
- strcpy(buf, stat_hdr);
+
+ cnt += sprintf(&buf[cnt], "\nSTATUS FOR PORT 0\n\n");
+ strcpy(&buf[cnt], stat_hdr);
+ cnt += sizeof(stat_hdr) - 1;
+
for (wandev = router_devlist;
wandev && (cnt < (PROC_BUFSZ - 80));
- wandev = wandev->next)
- {
+ wandev = wandev->next) {
if (!wandev->state) continue;
cnt += sprintf(&buf[cnt],
"%-15s|%-7s|%-9s|%-8s|%9u|%5u|%3u |",
@@ -367,10 +372,10 @@ static int status_get_info(char* buf, char** start, off_t offs, int len)
wandev->clocking ? "internal" : "external",
wandev->bps,
wandev->mtu,
- wandev->ndev)
- ;
- switch (wandev->state)
- {
+ wandev->ndev);
+
+ switch (wandev->state) {
+
case WAN_UNCONFIGURED:
cnt += sprintf(&buf[cnt], "%-12s\n", "unconfigured");
break;
@@ -407,56 +412,64 @@ static int wandev_get_info(char* buf, char** start, off_t offs, int len)
{
wan_device_t* wandev = (void*)start;
int cnt = 0;
+ int rslt = 0;
if ((wandev == NULL) || (wandev->magic != ROUTER_MAGIC))
return 0;
if (!wandev->state)
- return sprintf(&buf[cnt], "device is not configured!\n")
- ;
+ return sprintf(&buf[cnt], "device is not configured!\n");
/* Update device statistics */
- if (wandev->update) wandev->update(wandev);
-
- cnt += sprintf(&buf[cnt], "%30s: %12lu\n",
- "total frames received", wandev->stats.rx_packets)
- ;
- cnt += sprintf(&buf[cnt], "%30s: %12lu\n",
- "receiver overrun errors", wandev->stats.rx_over_errors)
- ;
- cnt += sprintf(&buf[cnt], "%30s: %12lu\n",
- "CRC errors", wandev->stats.rx_crc_errors)
- ;
- cnt += sprintf(&buf[cnt], "%30s: %12lu\n",
- "frame length errors", wandev->stats.rx_length_errors)
- ;
- cnt += sprintf(&buf[cnt], "%30s: %12lu\n",
- "frame format errors", wandev->stats.rx_frame_errors)
- ;
- cnt += sprintf(&buf[cnt], "%30s: %12lu\n",
- "aborted frames received", wandev->stats.rx_missed_errors)
- ;
- cnt += sprintf(&buf[cnt], "%30s: %12lu\n",
- "reveived frames dropped", wandev->stats.rx_dropped)
- ;
- cnt += sprintf(&buf[cnt], "%30s: %12lu\n",
- "other receive errors", wandev->stats.rx_errors)
- ;
- cnt += sprintf(&buf[cnt], "\n%30s: %12lu\n",
- "total frames transmitted", wandev->stats.tx_packets)
- ;
- cnt += sprintf(&buf[cnt], "%30s: %12lu\n",
- "aborted frames transmitted", wandev->stats.tx_aborted_errors)
- ;
- cnt += sprintf(&buf[cnt], "%30s: %12lu\n",
- "transmit frames dropped", wandev->stats.tx_dropped)
- ;
- cnt += sprintf(&buf[cnt], "%30s: %12lu\n",
- "transmit collisions", wandev->stats.collisions)
- ;
- cnt += sprintf(&buf[cnt], "%30s: %12lu\n",
- "other transmit errors", wandev->stats.tx_errors)
- ;
- return cnt;
+ if (wandev->update) {
+
+ rslt = wandev->update(wandev);
+ if(rslt) {
+ switch (rslt) {
+ case -EAGAIN:
+ return sprintf(&buf[cnt], "Device is busy!\n");
+
+ default:
+ return sprintf(&buf[cnt],
+ "Device is not configured!\n");
+ }
+ }
+ }
+
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "total packets received", wandev->stats.rx_packets);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "total packets transmitted", wandev->stats.tx_packets);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "total bytes received", wandev->stats.rx_bytes);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "total bytes transmitted", wandev->stats.tx_bytes);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "bad packets received", wandev->stats.rx_errors);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "packet transmit problems", wandev->stats.tx_errors);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "received frames dropped", wandev->stats.rx_dropped);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "transmit frames dropped", wandev->stats.tx_dropped);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "multicast packets received", wandev->stats.multicast);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "transmit collisions", wandev->stats.collisions);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "receive length errors", wandev->stats.rx_length_errors);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "receiver overrun errors", wandev->stats.rx_over_errors);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "CRC errors", wandev->stats.rx_crc_errors);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "frame format errors (aborts)", wandev->stats.rx_frame_errors);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "receiver fifo overrun", wandev->stats.rx_fifo_errors);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "receiver missed packet", wandev->stats.rx_missed_errors);
+ cnt += sprintf(&buf[cnt], PROC_STATS_FORMAT,
+ "aborted frames transmitted", wandev->stats.tx_aborted_errors);
+ return cnt;
}
/*
@@ -490,3 +503,8 @@ int wanrouter_proc_delete(wan_device_t *wandev)
}
#endif
+
+/*
+ * End
+ */
+