]> git.neil.brown.name Git - history.git/commitdiff
ISDN: Convert remaining users of the old slave list
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Sat, 5 Oct 2002 13:36:50 +0000 (08:36 -0500)
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Sat, 5 Oct 2002 13:36:50 +0000 (08:36 -0500)
->slave and ->master have been superseded, remove remaining traces.

drivers/isdn/i4l/isdn_net.c
drivers/isdn/i4l/isdn_net_lib.c
include/linux/isdn.h

index 71a7d94b466673980f43d1b9126a889c3f5add49..8ffcd83f3d780302bc276e51d3e03d6bde2bee7c 100644 (file)
@@ -571,16 +571,6 @@ isdn_net_hangup(isdn_net_dev *idev)
        if (!isdn_net_bound(idev))
                return;
 
-       // FIXME ugly and recursive
-       if (idev->slave) {
-               isdn_net_dev *sdev = idev->slave;
-               if (isdn_net_bound(sdev)) {
-                       printk(KERN_INFO
-                              "isdn_net: hang up slave %s before %s\n",
-                              sdev->name, idev->name);
-                       isdn_net_hangup(sdev);
-               }
-       }
        printk(KERN_INFO "isdn_net: local hangup %s\n", idev->name);
        if (mlp->ops->disconnected)
                mlp->ops->disconnected(idev);
@@ -748,6 +738,18 @@ void isdn_net_writebuf_skb(isdn_net_dev *idev, struct sk_buff *skb)
        mlp->stats.tx_errors++;
 }
 
+static void
+isdn_net_dial_slave(isdn_net_local *mlp)
+{
+       isdn_net_dev *idev;
+
+       list_for_each_entry(idev, &mlp->slaves, slaves) {
+               if (!isdn_net_bound(idev)) {
+                       isdn_net_dev_dial(idev);
+                       break;
+               }
+       }
+}
 
 /*
  *  Based on cps-calculation, check if device is overloaded.
@@ -761,7 +763,7 @@ void isdn_net_writebuf_skb(isdn_net_dev *idev, struct sk_buff *skb)
 int
 isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 {
-       isdn_net_dev *idev, *sdev;
+       isdn_net_dev *idev;
        isdn_net_local *mlp = ndev->priv;
 
        ndev->trans_start = jiffies;
@@ -796,19 +798,14 @@ isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
                printk(KERN_DEBUG "%s: %d bogocps\n", idev->name, idev->cps);
 
        if (idev->cps > mlp->triggercps) {
-               if (idev->slave) {
-                       if (!idev->sqfull) {
-                               /* First time overload: set timestamp only */
-                               idev->sqfull = 1;
-                               idev->sqfull_stamp = jiffies;
-                       } else {
-                               /* subsequent overload: if slavedelay exceeded, start dialing */
-                               if (time_after(jiffies, idev->sqfull_stamp + mlp->slavedelay)) {
-                                       sdev = idev->slave;
-                                       if (!isdn_net_bound(sdev)) {
-                                               isdn_net_dev_dial(sdev);
-                                       }
-                               }
+               if (!idev->sqfull) {
+                       /* First time overload: set timestamp only */
+                       idev->sqfull = 1;
+                       idev->sqfull_stamp = jiffies;
+               } else {
+                       /* subsequent overload: if slavedelay exceeded, start dialing */
+                       if (time_after(jiffies, idev->sqfull_stamp + mlp->slavedelay)) {
+                               isdn_net_dial_slave(mlp);
                        }
                }
        } else {
index 3185a86156ea7d684c6d1551828cd918f20e3d05..026d4d3a6631c38a8e5bf80f13a47b24cea70a1c 100644 (file)
@@ -692,7 +692,6 @@ static int
 isdn_net_force_hangup(char *name) // FIXME rename?
 {
        isdn_net_dev *idev = isdn_net_findif(name);
-       isdn_net_dev *p;
 
        if (!idev)
                return -ENODEV;
@@ -700,12 +699,6 @@ isdn_net_force_hangup(char *name) // FIXME rename?
        if (idev->isdn_slot < 0)
                return -ENOTCONN;
 
-       p = idev->slave;
-       /* If this interface has slaves, do a hangup for them also. */
-       while (p) {
-               isdn_net_hangup(p);
-               p = p->slave;
-       }
        isdn_net_hangup(idev);
        return 0;
 }
index 2571ec195463535099c6a3796f3c8ccd09a30830..664f2d471fd6ddb73111daf44daeaf2b9b3cdf55 100644 (file)
@@ -401,7 +401,6 @@ typedef struct isdn_net_dev_s {
   struct tasklet_struct  tlet;
 
   isdn_net_local        *mlp;          /* Ptr to master device for all devs*/
-  struct isdn_net_dev_s *slave;        /* Ptr to Slave device for masters  */ // FIXME kill
 
   struct list_head       slaves;       /* Members of local->slaves         */
   struct list_head       online;       /* Members of local->online         */