patch-2.1.67 linux/drivers/net/ltpc.c
Next file: linux/drivers/net/mace.c
Previous file: linux/drivers/net/loopback.c
Back to the patch index
Back to the overall index
- Lines: 75
- Date:
Sat Nov 29 10:33:19 1997
- Orig file:
v2.1.66/linux/drivers/net/ltpc.c
- Orig date:
Mon Nov 3 13:04:26 1997
diff -u --recursive --new-file v2.1.66/linux/drivers/net/ltpc.c linux/drivers/net/ltpc.c
@@ -249,6 +249,12 @@
static unsigned char *ltdmabuf;
static unsigned char *ltdmacbuf;
+struct ltpc_private
+{
+ struct net_device_stats stats;
+ struct at_addr my_addr;
+};
+
struct xmitQel {
struct xmitQel *next;
unsigned char *cbuf;
@@ -650,7 +656,7 @@
static struct timer_list ltpc_timer;
static int ltpc_xmit(struct sk_buff *skb, struct device *dev);
-static struct enet_statistics *ltpc_get_stats(struct device *dev);
+static struct net_device_stats *ltpc_get_stats(struct device *dev);
static int ltpc_open(struct device *dev)
{
@@ -691,7 +697,7 @@
int dnode, snode, llaptype, len;
int sklen;
struct sk_buff *skb;
- struct net_device_stats *stats = (struct enet_statistics *)dev->priv;
+ struct net_device_stats *stats = &((struct ltpc_private *)dev->priv)->stats;
struct lt_rcvlap *ltc = (struct lt_rcvlap *) ltdmacbuf;
if (ltc->command != LT_RCVLAP) {
@@ -786,7 +792,7 @@
{
struct sockaddr_at *sa = (struct sockaddr_at *) &ifr->ifr_addr;
/* we'll keep the localtalk node address in dev->pa_addr */
- struct at_addr *aa = (struct at_addr *) &dev->pa_addr;
+ struct at_addr *aa = &((struct ltpc_private *)dev->priv)->my_addr;
struct lt_init c;
int ltflags;
@@ -851,14 +857,14 @@
dev->hard_start_xmit = ltpc_xmit;
dev->hard_header = ltpc_hard_header;
- dev->priv = kmalloc(sizeof(struct net_device_stats), GFP_KERNEL);
+ dev->priv = kmalloc(sizeof(struct ltpc_private), GFP_KERNEL);
if(!dev->priv)
{
printk(KERN_INFO "%s: could not allocate statistics buffer\n", dev->name);
return -ENOMEM;
}
- memset(dev->priv, 0, sizeof(struct net_device_stats));
+ memset(dev->priv, 0, sizeof(struct ltpc_private));
dev->get_stats = ltpc_get_stats;
dev->open = ltpc_open;
@@ -915,7 +921,7 @@
* and skb->len is the length of the ddp data + ddp header
*/
- struct net_device_stats *stats = (struct enet_statistics *)dev->priv;
+ struct net_device_stats *stats = &((struct ltpc_private *)dev->priv)->stats;
int i;
struct lt_sendlap cbuf;
@@ -951,7 +957,7 @@
static struct net_device_stats *ltpc_get_stats(struct device *dev)
{
- struct net_device_stats *stats = (struct net_device_stats *) dev->priv;
+ struct net_device_stats *stats = &((struct ltpc_private *) dev->priv)->stats;
return stats;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov