]> git.hungrycats.org Git - linux/commitdiff
[ATM]: [ioctl][5/8] Change ncc clip info handling (from levon@movementarian.org)
authorChas Williams <chas@cmf.nrl.navy.mil>
Thu, 25 Sep 2003 14:13:32 +0000 (07:13 -0700)
committerDavid S. Miller <davem@nuts.ninka.net>
Thu, 25 Sep 2003 14:13:32 +0000 (07:13 -0700)
include/linux/atmdev.h
net/atm/clip.c
net/atm/proc.c

index d4617e465c60d7b4181035429bed093c48e91c19..c5b18d7fe830cef1db278f39989ab18c7627c423 100644 (file)
@@ -253,6 +253,7 @@ enum {
        ATM_VF_HASSAP,          /* SAP has been set */
        ATM_VF_CLOSE,           /* asynchronous close - treat like VF_RELEASED*/
        ATM_VF_WAITING,         /* waiting for reply from sigd */
+       ATM_VF_IS_CLIP,         /* in use by CLIP protocol */
 };
 
 
index 5f8139b157a8d40ef91e6b9d46280b353b39cbda..a52e0739ba3ff3b66b7b388fa30b3b349f9ba498 100644 (file)
@@ -488,6 +488,7 @@ static int clip_mkip(struct atm_vcc *vcc,int timeout)
        DPRINTK("mkip clip_vcc %p vcc %p\n",clip_vcc,vcc);
        clip_vcc->vcc = vcc;
        vcc->user_back = clip_vcc;
+       set_bit(ATM_VF_IS_CLIP, &vcc->flags);
        clip_vcc->entry = NULL;
        clip_vcc->xoff = 0;
        clip_vcc->encap = 1;
index 62810f5ea86d15eaeedd86913eda1e65ec038949..4abbb74fe41351aec046d3aa937d0745aa9cd1ac 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/atmarp.h>
 #include <linux/if_arp.h>
 #include <linux/init.h> /* for __init */
+#include <net/atmclip.h>
 #include <asm/uaccess.h>
 #include <asm/atomic.h>
 #include <asm/param.h> /* for HZ */
@@ -32,9 +33,6 @@
 #include "common.h" /* atm_proc_init prototype */
 #include "signaling.h" /* to get sigd - ugly too */
 
-#include <net/atmclip.h>
-#include "ipcommon.h"
-
 #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
 #include "lec.h"
 #include "lec_arpc.h"
@@ -139,7 +137,6 @@ static void atmarp_info(struct seq_file *seq, struct net_device *dev,
 struct vcc_state {
        struct sock *sk;
        int family;
-       int clip_info;
 };
 
 static inline int compare_family(struct sock *sk, int family)
@@ -190,7 +187,6 @@ static int __vcc_seq_open(struct inode *inode, struct file *file,
                goto out_kfree;
 
        state->family = family;
-       state->clip_info = try_atm_clip_ops();
 
        seq = file->private_data;
        seq->private = state;
@@ -203,13 +199,6 @@ out_kfree:
 
 static int vcc_seq_release(struct inode *inode, struct file *file)
 {
-#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE)
-       struct seq_file *seq = file->private_data;
-       struct vcc_state *state = seq->private;
-
-       if (state->clip_info)
-               module_put(atm_clip_ops->owner);
-#endif
        return seq_release_private(inode, file);
 }
 
@@ -237,7 +226,7 @@ static void *vcc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
        return v;
 }
 
-static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc, int clip_info)
+static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc)
 {
        static const char *class_name[] = { "off","UBR","CBR","VBR","ABR" };
        static const char *aal_name[] = {
@@ -252,8 +241,7 @@ static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc, int clip_info)
            aal_name[vcc->qos.aal],vcc->qos.rxtp.min_pcr,
            class_name[vcc->qos.rxtp.traffic_class],vcc->qos.txtp.min_pcr,
            class_name[vcc->qos.txtp.traffic_class]);
-#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE)
-       if (clip_info && (vcc->push == atm_clip_ops->clip_push)) {
+       if (test_bit(ATM_VF_IS_CLIP, &vcc->flags)) {
                struct clip_vcc *clip_vcc = CLIP_VCC(vcc);
                struct net_device *dev;
 
@@ -262,7 +250,6 @@ static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc, int clip_info)
                    dev ? dev->name : "none?");
                seq_printf(seq, "%s", clip_vcc->encap ? "LLC/SNAP" : "None");
        }
-#endif
        seq_putc(seq, '\n');
 }
 
@@ -405,7 +392,7 @@ static int pvc_seq_show(struct seq_file *seq, void *v)
                struct vcc_state *state = seq->private;
                struct atm_vcc *vcc = atm_sk(state->sk);
 
-               pvc_info(seq, vcc, state->clip_info);
+               pvc_info(seq, vcc);
        }
        return 0;
 }