[patch] 2.3.99-pre2-3: fix PPPIOCGUNIT

From: Tim Waugh (tim@cyberelk.demon.co.uk)
Date: Fri Mar 17 2000 - 16:10:27 EST


I needed this patch in order to get diald working (which uses PPPIOCGUNIT
to figure out which ppp unit it's connected to).

Can whoever changed this code in 2.3.99-pre1 look this over to check that
this is correct before I send it to Linus?

Tim.
*/

Index: linux/include/linux/ppp_channel.h
diff -u linux/include/linux/ppp_channel.h:1.1.1.4 linux/include/linux/ppp_channel.h:1.2
--- linux/include/linux/ppp_channel.h:1.1.1.4 Tue Mar 14 11:35:09 2000
+++ linux/include/linux/ppp_channel.h Fri Mar 17 21:05:54 2000
@@ -61,8 +61,8 @@
 /* Detach a channel from its PPP unit (e.g. on hangup). */
 extern void ppp_unregister_channel(struct ppp_channel *);
 
-/* Get the channel number for a channel */
-extern int ppp_channel_index(struct ppp_channel *);
+/* Get the unit number associated with a channel */
+extern int ppp_unit_number(struct ppp_channel *);
 
 /*
  * SMP locking notes:
Index: linux/drivers/net/ppp_generic.c
diff -u linux/drivers/net/ppp_generic.c:1.1.1.10 linux/drivers/net/ppp_generic.c:1.2
--- linux/drivers/net/ppp_generic.c:1.1.1.10 Tue Mar 14 11:35:33 2000
+++ linux/drivers/net/ppp_generic.c Fri Mar 17 21:05:54 2000
@@ -1653,13 +1653,13 @@
 }
 
 /*
- * Return the index of a channel.
+ * Return the unit number associated with a channel.
  */
-int ppp_channel_index(struct ppp_channel *chan)
+int ppp_unit_number(struct ppp_channel *chan)
 {
         struct channel *pch = chan->ppp;
 
- return pch->file.index;
+ return pch->ppp->file.index;
 }
 
 /*
@@ -2319,7 +2319,7 @@
 
 EXPORT_SYMBOL(ppp_register_channel);
 EXPORT_SYMBOL(ppp_unregister_channel);
-EXPORT_SYMBOL(ppp_channel_index);
+EXPORT_SYMBOL(ppp_unit_number);
 EXPORT_SYMBOL(ppp_input);
 EXPORT_SYMBOL(ppp_input_error);
 EXPORT_SYMBOL(ppp_output_wakeup);
Index: linux/drivers/net/ppp_async.c
diff -u linux/drivers/net/ppp_async.c:1.1.1.4 linux/drivers/net/ppp_async.c:1.2
--- linux/drivers/net/ppp_async.c:1.1.1.4 Wed Mar 15 08:55:10 2000
+++ linux/drivers/net/ppp_async.c Fri Mar 17 21:05:54 2000
@@ -220,7 +220,7 @@
                 if (ap == 0)
                         break;
                 err = -EFAULT;
- if (put_user(ppp_channel_index(&ap->chan), (int *) arg))
+ if (put_user(ppp_unit_number(&ap->chan), (int *) arg))
                         break;
                 err = 0;
                 break;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:23 EST