patch-2.1.77 linux/drivers/isdn/isdn_net.c

Next file: linux/drivers/isdn/isdn_tty.c
Previous file: linux/drivers/char/wdt.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.76/linux/drivers/isdn/isdn_net.c linux/drivers/isdn/isdn_net.c
@@ -194,14 +194,19 @@
 #define __NO_VERSION__
 #include <linux/module.h>
 #include <linux/isdn.h>
-#include <linux/if_arp.h>
 #include <net/arp.h>
 #include <net/icmp.h>
+#if (LINUX_VERSION_CODE >= 0x020117)
+#include <linux/poll.h>
+#endif
 #include "isdn_common.h"
 #include "isdn_net.h"
 #ifdef CONFIG_ISDN_PPP
 #include "isdn_ppp.h"
 #endif
+#ifndef DEV_NUMBUFFS
+#include <net/pkt_sched.h>
+#endif
 
 /* Prototypes */
 
@@ -209,7 +214,9 @@
 static int isdn_net_wildmat(char *s, char *p);
 static int isdn_net_start_xmit(struct sk_buff *, struct device *);
 static int isdn_net_xmit(struct device *, isdn_net_local *, struct sk_buff *);
+#ifdef DEV_NUMBUFFS
 static void dev_purge_queues(struct device *dev);	/* move this to net/core/dev.c */
+#endif
 
 char *isdn_net_revision = "$Revision: 1.44 $";
 
@@ -253,7 +260,7 @@
 	/* Fill in the MAC-level header. */
 	for (i = 0; i < ETH_ALEN - sizeof(u32); i++)
 		dev->dev_addr[i] = 0xfc;
-	memcpy(&(dev->dev_addr[i]), &dev->pa_addr, sizeof(u32));
+	memset(&(dev->dev_addr[i]), 0, sizeof(u32));
 
 	/* If this interface has slaves, start them also */
 
@@ -303,8 +310,18 @@
 		dev_kfree_skb(lp->sav_skb, FREE_WRITE);
 		lp->sav_skb = NULL;
 	}
+#ifdef DEV_NUMBUFFS
 	if (!lp->master)        /* purge only for master device */
 		dev_purge_queues(&lp->netdev->dev);
+#else
+	if (!lp->master) {	/* reset only master device */
+		/* Moral equivalent of dev_purge_queues():
+		   BEWARE! This chunk of code cannot be called from hardware
+		   interrupt handler. I hope it is true. --ANK
+		 */
+		qdisc_reset(lp->netdev->dev.qdisc);
+	}
+#endif
 	lp->dialstate = 0;
 	dev->rx_netdev[isdn_dc2minor(lp->isdn_device, lp->isdn_channel)] = NULL;
 	dev->st_netdev[isdn_dc2minor(lp->isdn_device, lp->isdn_channel)] = NULL;
@@ -990,7 +1007,6 @@
 		ndev->trans_start = jiffies;
 	}
 	if (skb == NULL) {
-		dev_tint(ndev);
 		return 0;
 	}
 	/* Avoid timer-based retransmission conflicts. */
@@ -1466,20 +1482,17 @@
 #endif
 	ndev->header_cache_update = NULL;
 	ndev->mtu = 1500;
-	ndev->flags = IFF_NOARP;
-	ndev->family = AF_INET;
+	ndev->flags = IFF_NOARP|IFF_POINTOPOINT;
 	ndev->type = ARPHRD_ETHER;
 	ndev->addr_len = ETH_ALEN;
-	ndev->pa_addr = 0;
-	ndev->pa_brdaddr = 0;
-	ndev->pa_mask = 0;
-	ndev->pa_alen = 4;
 
 	for (i = 0; i < ETH_ALEN; i++)
 		ndev->broadcast[i] = 0xff;
 
+#ifdef DEV_NUMBUFFS
 	for (i = 0; i < DEV_NUMBUFFS; i++)
 		skb_queue_head_init(&ndev->buffs[i]);
+#endif
 
 	/* The ISDN-specific entries in the device structure. */
 	ndev->open = &isdn_net_open;
@@ -2247,7 +2260,7 @@
 				p->dev.hard_header_cache = NULL;
 #endif
 				p->dev.header_cache_update = NULL;
-				p->dev.flags = IFF_NOARP;
+				p->dev.flags = IFF_NOARP|IFF_POINTOPOINT;
 			} else {
 				p->dev.hard_header = isdn_net_header;
 				if (cfg->p_encap == ISDN_NET_ENCAP_ETHER) {
@@ -2265,7 +2278,7 @@
 					p->dev.hard_header_cache = NULL;
 #endif
 					p->dev.header_cache_update = NULL;
-					p->dev.flags = IFF_NOARP;
+					p->dev.flags = IFF_NOARP|IFF_POINTOPOINT;
 				}
 			}
 		}
@@ -2585,6 +2598,7 @@
 	return 0;
 }
 
+#ifdef DEV_NUMBUFFS
 /*
  * helper function to flush device queues
  * the better place would be net/core/dev.c
@@ -2600,3 +2614,4 @@
 	}
 
 }
+#endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov