Skip to contentSkip to conversation

: [ioctl][1/8] move vcc_ioctl() to ioctl.c (from [email protected])

PATCH chas williams 3 participants 5 messages Sep 25, 2003 – Sep 26, 2003 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 1 line · In message <[email protected]>,John Levon writes:

atm-ioctl6.diff isn't applying properly now for some reason though.

it applies to a bk pull from this morning w/o any trouble afaict.

Quoted 3 lines

I guess it's fine to apply the old patchset anyway, it should be pretty easy for Mitchell to add a diff before his stuff that represents the changes between my two sets of patches.

i redid your patch set a bit to just get from point a to b w/o the phantom ioctl.h and with the ATM_VF_IS_CLIP change discussed earlier.

#2 lore raw
Quoted 2 lines · chas williams

i redid your patch set a bit to just get from point a to b w/o the phantom ioctl.h and with the ATM_VF_IS_CLIP change discussed earlier.

If you merge my patches the vcc->clip would go away on its own (its not needed once CLIP gets a atm_backend->decribe_vcc() method)

-Mitch

#3 lore raw

What I'm going to do is just merge in all of what Chas posted today, you can send me new patches to update this to John's latest code.

Thanks.

#4 lore raw
Quoted 3 lines · In message <[email protected]>,"David S. Miller" writes:

What I'm going to do is just merge in all of what Chas posted today, you can send me new patches to update this to John's latest code.

that seems very reasonable. i believe the following attached patch will provide the initial backend interface that mitch's patchset depends on (its really just name changes). mitch, perhaps you could just submit this as patch 0/N when you are ready to submit your atm_backend changes.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:

#	           ChangeSet	1.1458  -> 1.1459 
#	    net/atm/br2684.c	1.12    -> 1.13   
#	       net/atm/lec.c	1.41    -> 1.42   
#	     net/atm/ioctl.c	1.7     -> 1.8    
#	drivers/atm/atmtcp.c	1.20    -> 1.21   
#	   net/atm/pppoatm.c	1.15    -> 1.16   
#	       net/atm/mpc.c	1.29    -> 1.30   

# include/linux/atmdev.h 1.32 -> 1.33
# net/atm/clip.c 1.29 -> 1.30
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/09/26 [email protected] 1.1459
# [ATM]: initial backend support (from [email protected]) # --------------------------------------------
#

drivers/atm/atmtcp.c +3 -3
diff -Nru a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c
@@ -460,21 +460,21 @@
 	return err;
 }
 
-static struct atm_ioctl atmtcp_ioctl_ops = {
+static struct atm_backend atmtcp_ops = {
 	.owner 	= THIS_MODULE,
 	.ioctl	= atmtcp_ioctl,
 };
 
 static __init int atmtcp_init(void)
 {
-	register_atm_ioctl(&atmtcp_ioctl_ops);
+	register_atm_backend(&atmtcp_ops);
 	return 0;
 }
 
 
 static void __exit atmtcp_exit(void)
 {
-	deregister_atm_ioctl(&atmtcp_ioctl_ops);
+	deregister_atm_backend(&atmtcp_ops);
 }
 
 MODULE_LICENSE("GPL");
include/linux/atmdev.h +5 -9
diff -Nru a/include/linux/atmdev.h b/include/linux/atmdev.h
@@ -448,7 +448,7 @@
 
 void vcc_release_async(struct atm_vcc *vcc, int reply);
 
-struct atm_ioctl {
+struct atm_backend {
 	struct module *owner;
 	/* A module reference is kept if appropriate over this call.
 	 * Return -ENOIOCTLCMD if you don't handle it. */
@@ -457,18 +457,14 @@
 };
 
 /**
- * register_atm_ioctl - register handler for ioctl operations
- *
- * Special (non-device) handlers of ioctl's should
- * register here. If you're a normal device, you should
- * set .ioctl in your atmdev_ops instead.
+ * register_atm_backend - register an ATM backend
  */
-void register_atm_ioctl(struct atm_ioctl *);
+void register_atm_backend(struct atm_backend *);
 
 /**
- * deregister_atm_ioctl - remove the ioctl handler
+ * deregister_atm_backend - remove a backend
  */
-void deregister_atm_ioctl(struct atm_ioctl *);
+void deregister_atm_backend(struct atm_backend *);
 
 #endif /* __KERNEL__ */
 
net/atm/br2684.c +3 -3
diff -Nru a/net/atm/br2684.c b/net/atm/br2684.c
@@ -669,7 +669,7 @@
 	return -ENOIOCTLCMD;
 }
 
-static struct atm_ioctl br2684_ioctl_ops = {
+static struct atm_backend br2684_ops = {
 	.owner	= THIS_MODULE,
 	.ioctl	= br2684_ioctl,
 };
@@ -782,7 +782,7 @@
 		return -ENOMEM;
 	p->proc_fops = &br2684_proc_ops;
 #endif
-	register_atm_ioctl(&br2684_ioctl_ops);
+	register_atm_backend(&br2684_ops);
 	return 0;
 }
 
@@ -791,7 +791,7 @@
 	struct net_device *net_dev;
 	struct br2684_dev *brdev;
 	struct br2684_vcc *brvcc;
-	deregister_atm_ioctl(&br2684_ioctl_ops);
+	deregister_atm_backend(&br2684_ops);
 
 #ifdef CONFIG_PROC_FS
 	remove_proc_entry("br2684", atm_proc_root);
net/atm/clip.c +3 -3
diff -Nru a/net/atm/clip.c b/net/atm/clip.c
@@ -804,7 +804,7 @@
 	return err;
 }
 
-static struct atm_ioctl clip_ioctl_ops = {
+static struct atm_backend clip_ops = {
 	.owner 	= THIS_MODULE,
 	.ioctl	= clip_ioctl,
 };
@@ -1035,7 +1035,7 @@
 	skb_queue_head_init(&clip_tbl.proxy_queue);
 
 	clip_tbl_hook = &clip_tbl;
-	register_atm_ioctl(&clip_ioctl_ops);
+	register_atm_backend(&clip_ops);
 
 	return 0;
 }
@@ -1046,7 +1046,7 @@
 
 	remove_proc_entry("arp", atm_proc_root);
 
-	deregister_atm_ioctl(&clip_ioctl_ops);
+	deregister_atm_backend(&clip_ops);
 
 	neigh_ifdown(&clip_tbl, NULL);
 	dev = clip_devs;
net/atm/ioctl.c +16 -16
diff -Nru a/net/atm/ioctl.c b/net/atm/ioctl.c
@@ -23,26 +23,26 @@
 #include "signaling.h"		/* for WAITING and sigd_attach */
 
 
-static DECLARE_MUTEX(ioctl_mutex);
-static LIST_HEAD(ioctl_list);
+static DECLARE_MUTEX(backend_mutex);
+static LIST_HEAD(backend_list);
 
 
-void register_atm_ioctl(struct atm_ioctl *ioctl)
+void register_atm_backend(struct atm_backend *backend)
 {
-	down(&ioctl_mutex);
-	list_add_tail(&ioctl->list, &ioctl_list);
-	up(&ioctl_mutex);
+	down(&backend_mutex);
+	list_add_tail(&backend->list, &backend_list);
+	up(&backend_mutex);
 }
 
-void deregister_atm_ioctl(struct atm_ioctl *ioctl)
+void deregister_atm_backend(struct atm_backend *backend)
 {
-	down(&ioctl_mutex);
-	list_del(&ioctl->list);
-	up(&ioctl_mutex);
+	down(&backend_mutex);
+	list_del(&backend->list);
+	up(&backend_mutex);
 }
 
-EXPORT_SYMBOL(register_atm_ioctl);
-EXPORT_SYMBOL(deregister_atm_ioctl);
+EXPORT_SYMBOL(register_atm_backend);
+EXPORT_SYMBOL(deregister_atm_backend);
 
 int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
@@ -120,9 +120,9 @@
 
 	error = -ENOIOCTLCMD;
 
-	down(&ioctl_mutex);
-	list_for_each(pos, &ioctl_list) {
-		struct atm_ioctl * ic = list_entry(pos, struct atm_ioctl, list);
+	down(&backend_mutex);
+	list_for_each(pos, &backend_list) {
+		struct atm_backend * ic = list_entry(pos, struct atm_backend, list);
 		if (try_module_get(ic->owner)) {
 			error = ic->ioctl(sock, cmd, arg);
 			module_put(ic->owner);
@@ -130,7 +130,7 @@
 				break;
 		}
 	}
-	up(&ioctl_mutex);
+	up(&backend_mutex);
 
 	if (error != -ENOIOCTLCMD)
 		goto done;
net/atm/lec.c +3 -3
diff -Nru a/net/atm/lec.c b/net/atm/lec.c
@@ -1115,7 +1115,7 @@
 	return err;
 }
 
-static struct atm_ioctl lane_ioctl_ops = {
+static struct atm_backend lec_ops = {
 	.owner  = THIS_MODULE,
 	.ioctl  = lane_ioctl,
 };
@@ -1130,7 +1130,7 @@
 		p->proc_fops = &lec_seq_fops;
 #endif
 
-	register_atm_ioctl(&lane_ioctl_ops);
+	register_atm_backend(&lec_ops);
         printk("lec.c: " __DATE__ " " __TIME__ " initialized\n");
         return 0;
 }
@@ -1142,7 +1142,7 @@
 
 	remove_proc_entry("lec", atm_proc_root);
 
-	deregister_atm_ioctl(&lane_ioctl_ops);
+	deregister_atm_backend(&lec_ops);
 
         for (i = 0; i < MAX_LEC_ITF; i++) {
                 if (dev_lec[i] != NULL) {
net/atm/mpc.c +3 -3
diff -Nru a/net/atm/mpc.c b/net/atm/mpc.c
@@ -1388,14 +1388,14 @@
 }
 
 
-static struct atm_ioctl atm_ioctl_ops = {
+static struct atm_backend mpoa_ops = {
 	.owner	= THIS_MODULE,
 	.ioctl	= atm_mpoa_ioctl,
 };
 
 static __init int atm_mpoa_init(void)
 {
-	register_atm_ioctl(&atm_ioctl_ops);
+	register_atm_backend(&mpoa_ops);
 
 #ifdef CONFIG_PROC_FS
 	if (mpc_proc_init() != 0)
@@ -1421,7 +1421,7 @@
 
 	del_timer(&mpc_timer);
 	unregister_netdevice_notifier(&mpoa_notifier);
-	deregister_atm_ioctl(&atm_ioctl_ops);
+	deregister_atm_backend(&mpoa_ops);
 
 	mpc = mpcs;
 	mpcs = NULL;
net/atm/pppoatm.c +3 -3
diff -Nru a/net/atm/pppoatm.c b/net/atm/pppoatm.c
@@ -343,20 +343,20 @@
 	return -ENOIOCTLCMD;
 }
 
-struct atm_ioctl pppoatm_ioctl_ops = {
+static struct atm_backend pppoatm_backend_ops = {
 	.owner	= THIS_MODULE,
 	.ioctl	= pppoatm_ioctl,
 };
 
 static int __init pppoatm_init(void)
 {
-	register_atm_ioctl(&pppoatm_ioctl_ops);
+	register_atm_backend(&pppoatm_backend_ops);
 	return 0;
 }
 
 static void __exit pppoatm_exit(void)
 {
-	deregister_atm_ioctl(&pppoatm_ioctl_ops);
+	deregister_atm_backend(&pppoatm_backend_ops);
 }
 
 module_init(pppoatm_init);
#5 lore raw
Quoted 5 lines · On Fri, 26 Sep 2003 09:48:03 -0400 chas williams <[email protected]> wrote:

that seems very reasonable. i believe the following attached patch will provide the initial backend interface that mitch's patchset depends on (its really just name changes). mitch, perhaps you could just submit this as patch 0/N when you are ready to submit your atm_backend changes.

Wait a bit for Linus to suck in the stuff I applied last night, then you guys can unload the next set of patches on me. :)