Commit 25609258 authored by Chas Williams's avatar Chas Williams Committed by David S. Miller

[ATM]: [ioctl][5/8] Change ncc clip info handling (from levon@movementarian.org)

parent 1c306ffb
......@@ -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 */
};
......
......@@ -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;
......
......@@ -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 @@ static int __vcc_seq_open(struct inode *inode, struct file *file,
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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment