2006-01-31 21:33:43

by Adrian Bunk

[permalink] [raw]
Subject: [2.6 patch] ISDN_CAPI_CAPIFS related cleanups

This patch contains the following cleanups:
- move the help text to the right option
- replace some #ifdef's in capi.c with dummy functions in capifs.h
- use CONFIG_ISDN_CAPI_CAPIFS_BOOL in one place in capi.c


Signed-off-by: Adrian Bunk <[email protected]>

---

drivers/isdn/capi/Kconfig | 10 +++++-----
drivers/isdn/capi/capi.c | 9 ++-------
drivers/isdn/capi/capifs.h | 9 +++++++++
3 files changed, 16 insertions(+), 12 deletions(-)

--- linux-2.6.16-rc1-mm4-full/drivers/isdn/capi/Kconfig.old 2006-01-31 20:36:44.000000000 +0100
+++ linux-2.6.16-rc1-mm4-full/drivers/isdn/capi/Kconfig 2006-01-31 20:38:10.000000000 +0100
@@ -31,17 +31,17 @@
config ISDN_CAPI_CAPIFS_BOOL
bool "CAPI2.0 filesystem support"
depends on ISDN_CAPI_MIDDLEWARE && ISDN_CAPI_CAPI20
-
-config ISDN_CAPI_CAPIFS
- tristate
- depends on ISDN_CAPI_CAPIFS_BOOL
- default ISDN_CAPI_CAPI20
help
This option provides a special file system, similar to /dev/pts with
device nodes for the special ttys established by using the
middleware extension above. If you want to use pppd with
pppdcapiplugin to dial up to your ISP, say Y here.

+config ISDN_CAPI_CAPIFS
+ tristate
+ depends on ISDN_CAPI_CAPIFS_BOOL
+ default ISDN_CAPI_CAPI20
+
config ISDN_CAPI_CAPIDRV
tristate "CAPI2.0 capidrv interface support"
depends on ISDN_CAPI && ISDN_I4L
--- linux-2.6.16-rc1-mm4-full/drivers/isdn/capi/capifs.h.old 2006-01-31 20:40:36.000000000 +0100
+++ linux-2.6.16-rc1-mm4-full/drivers/isdn/capi/capifs.h 2006-01-31 20:41:44.000000000 +0100
@@ -7,5 +7,14 @@
*
*/

+#ifdef CONFIG_ISDN_CAPI_CAPIFS_BOOL
+
void capifs_new_ncci(unsigned int num, dev_t device);
void capifs_free_ncci(unsigned int num);
+
+#else /* CONFIG_ISDN_CAPI_CAPIFS_BOOL */
+
+static inline void capifs_new_ncci(unsigned int num, dev_t device) {}
+static inline void capifs_free_ncci(unsigned int num) {}
+
+#endif /* CONFIG_ISDN_CAPI_CAPIFS_BOOL */
--- linux-2.6.16-rc1-mm4-full/drivers/isdn/capi/capi.c.old 2006-01-31 20:38:53.000000000 +0100
+++ linux-2.6.16-rc1-mm4-full/drivers/isdn/capi/capi.c 2006-01-31 20:40:24.000000000 +0100
@@ -42,9 +42,8 @@
#include <linux/devfs_fs_kernel.h>
#include <linux/isdn/capiutil.h>
#include <linux/isdn/capicmd.h>
-#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
+
#include "capifs.h"
-#endif

static char *revision = "$Revision: 1.1.2.7 $";

@@ -311,9 +310,7 @@
#ifdef _DEBUG_REFCOUNT
printk(KERN_DEBUG "set mp->nccip\n");
#endif
-#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
capifs_new_ncci(mp->minor, MKDEV(capi_ttymajor, mp->minor));
-#endif
}
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
for (pp=&cdev->nccis; *pp; pp = &(*pp)->next)
@@ -336,9 +333,7 @@
*pp = (*pp)->next;
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
if ((mp = np->minorp) != 0) {
-#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
capifs_free_ncci(mp->minor);
-#endif
if (mp->tty) {
mp->nccip = NULL;
#ifdef _DEBUG_REFCOUNT
@@ -1520,7 +1515,7 @@
proc_init();

#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
-#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
+#ifdef CONFIG_ISDN_CAPI_CAPIFS_BOOL
compileinfo = " (middleware+capifs)";
#else
compileinfo = " (no capifs)";


2006-01-31 21:42:45

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [2.6 patch] ISDN_CAPI_CAPIFS related cleanups

Hi Adrian,

> This patch contains the following cleanups:
> - move the help text to the right option
> - replace some #ifdef's in capi.c with dummy functions in capifs.h
> - use CONFIG_ISDN_CAPI_CAPIFS_BOOL in one place in capi.c

I actually still like to see capifs removed completely. It is not really
needed if you gonna use udev. The only thing that it is doing, is to set
the correct permissions and make sure that the device nodes are created.
And with a 2.6 kernel this can be all done by udev.

Regards

Marcel


2006-02-01 08:44:01

by Armin Schindler

[permalink] [raw]
Subject: Re: [2.6 patch] ISDN_CAPI_CAPIFS related cleanups

On Tue, 31 Jan 2006, Adrian Bunk wrote:
> This patch contains the following cleanups:
> - move the help text to the right option

where did you move it to? I just see the removal of the help text.

Armin

> - replace some #ifdef's in capi.c with dummy functions in capifs.h
> - use CONFIG_ISDN_CAPI_CAPIFS_BOOL in one place in capi.c
>
>
> Signed-off-by: Adrian Bunk <[email protected]>
>
> ---
>
> drivers/isdn/capi/Kconfig | 10 +++++-----
> drivers/isdn/capi/capi.c | 9 ++-------
> drivers/isdn/capi/capifs.h | 9 +++++++++
> 3 files changed, 16 insertions(+), 12 deletions(-)
>
> --- linux-2.6.16-rc1-mm4-full/drivers/isdn/capi/Kconfig.old 2006-01-31 20:36:44.000000000 +0100
> +++ linux-2.6.16-rc1-mm4-full/drivers/isdn/capi/Kconfig 2006-01-31 20:38:10.000000000 +0100
> @@ -31,17 +31,17 @@
> config ISDN_CAPI_CAPIFS_BOOL
> bool "CAPI2.0 filesystem support"
> depends on ISDN_CAPI_MIDDLEWARE && ISDN_CAPI_CAPI20
> -
> -config ISDN_CAPI_CAPIFS
> - tristate
> - depends on ISDN_CAPI_CAPIFS_BOOL
> - default ISDN_CAPI_CAPI20
> help
> This option provides a special file system, similar to /dev/pts with
> device nodes for the special ttys established by using the
> middleware extension above. If you want to use pppd with
> pppdcapiplugin to dial up to your ISP, say Y here.
>
> +config ISDN_CAPI_CAPIFS
> + tristate
> + depends on ISDN_CAPI_CAPIFS_BOOL
> + default ISDN_CAPI_CAPI20
> +
> config ISDN_CAPI_CAPIDRV
> tristate "CAPI2.0 capidrv interface support"
> depends on ISDN_CAPI && ISDN_I4L
> --- linux-2.6.16-rc1-mm4-full/drivers/isdn/capi/capifs.h.old 2006-01-31 20:40:36.000000000 +0100
> +++ linux-2.6.16-rc1-mm4-full/drivers/isdn/capi/capifs.h 2006-01-31 20:41:44.000000000 +0100
> @@ -7,5 +7,14 @@
> *
> */
>
> +#ifdef CONFIG_ISDN_CAPI_CAPIFS_BOOL
> +
> void capifs_new_ncci(unsigned int num, dev_t device);
> void capifs_free_ncci(unsigned int num);
> +
> +#else /* CONFIG_ISDN_CAPI_CAPIFS_BOOL */
> +
> +static inline void capifs_new_ncci(unsigned int num, dev_t device) {}
> +static inline void capifs_free_ncci(unsigned int num) {}
> +
> +#endif /* CONFIG_ISDN_CAPI_CAPIFS_BOOL */
> --- linux-2.6.16-rc1-mm4-full/drivers/isdn/capi/capi.c.old 2006-01-31 20:38:53.000000000 +0100
> +++ linux-2.6.16-rc1-mm4-full/drivers/isdn/capi/capi.c 2006-01-31 20:40:24.000000000 +0100
> @@ -42,9 +42,8 @@
> #include <linux/devfs_fs_kernel.h>
> #include <linux/isdn/capiutil.h>
> #include <linux/isdn/capicmd.h>
> -#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
> +
> #include "capifs.h"
> -#endif
>
> static char *revision = "$Revision: 1.1.2.7 $";
>
> @@ -311,9 +310,7 @@
> #ifdef _DEBUG_REFCOUNT
> printk(KERN_DEBUG "set mp->nccip\n");
> #endif
> -#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
> capifs_new_ncci(mp->minor, MKDEV(capi_ttymajor, mp->minor));
> -#endif
> }
> #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
> for (pp=&cdev->nccis; *pp; pp = &(*pp)->next)
> @@ -336,9 +333,7 @@
> *pp = (*pp)->next;
> #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
> if ((mp = np->minorp) != 0) {
> -#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
> capifs_free_ncci(mp->minor);
> -#endif
> if (mp->tty) {
> mp->nccip = NULL;
> #ifdef _DEBUG_REFCOUNT
> @@ -1520,7 +1515,7 @@
> proc_init();
>
> #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
> -#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
> +#ifdef CONFIG_ISDN_CAPI_CAPIFS_BOOL
> compileinfo = " (middleware+capifs)";
> #else
> compileinfo = " (no capifs)";
>
> _______________________________________________
> isdn4linux mailing list
> [email protected]
> https://www.isdn4linux.de/mailman/listinfo/isdn4linux
>

2006-02-01 10:44:26

by Adrian Bunk

[permalink] [raw]
Subject: Re: [2.6 patch] ISDN_CAPI_CAPIFS related cleanups

On Wed, Feb 01, 2006 at 09:43:48AM +0100, Armin Schindler wrote:
> On Tue, 31 Jan 2006, Adrian Bunk wrote:
> > This patch contains the following cleanups:
> > - move the help text to the right option
>
> where did you move it to? I just see the removal of the help text.

I moved it from ISDN_CAPI_CAPIFS to ISDN_CAPI_CAPIFS_BOOL (diff displays
this a bit strange).

> Armin
>...
> > config ISDN_CAPI_CAPIFS_BOOL
> > bool "CAPI2.0 filesystem support"
> > depends on ISDN_CAPI_MIDDLEWARE && ISDN_CAPI_CAPI20
> > -
> > -config ISDN_CAPI_CAPIFS
> > - tristate
> > - depends on ISDN_CAPI_CAPIFS_BOOL
> > - default ISDN_CAPI_CAPI20
> > help
> > This option provides a special file system, similar to /dev/pts with
> > device nodes for the special ttys established by using the
> > middleware extension above. If you want to use pppd with
> > pppdcapiplugin to dial up to your ISP, say Y here.
> >
> > +config ISDN_CAPI_CAPIFS
> > + tristate
> > + depends on ISDN_CAPI_CAPIFS_BOOL
> > + default ISDN_CAPI_CAPI20
> > +
>...

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2006-02-01 11:01:17

by Armin Schindler

[permalink] [raw]
Subject: Re: [2.6 patch] ISDN_CAPI_CAPIFS related cleanups

On Wed, 1 Feb 2006, Adrian Bunk wrote:
> On Wed, Feb 01, 2006 at 09:43:48AM +0100, Armin Schindler wrote:
> > On Tue, 31 Jan 2006, Adrian Bunk wrote:
> > > This patch contains the following cleanups:
> > > - move the help text to the right option
> >
> > where did you move it to? I just see the removal of the help text.
>
> I moved it from ISDN_CAPI_CAPIFS to ISDN_CAPI_CAPIFS_BOOL (diff displays
> this a bit strange).

Yes, sorry. I didn't look close enough. I should wait a bit after wake up...

Armin

> > Armin
> >...
> > > config ISDN_CAPI_CAPIFS_BOOL
> > > bool "CAPI2.0 filesystem support"
> > > depends on ISDN_CAPI_MIDDLEWARE && ISDN_CAPI_CAPI20
> > > -
> > > -config ISDN_CAPI_CAPIFS
> > > - tristate
> > > - depends on ISDN_CAPI_CAPIFS_BOOL
> > > - default ISDN_CAPI_CAPI20
> > > help
> > > This option provides a special file system, similar to /dev/pts with
> > > device nodes for the special ttys established by using the
> > > middleware extension above. If you want to use pppd with
> > > pppdcapiplugin to dial up to your ISP, say Y here.
> > >
> > > +config ISDN_CAPI_CAPIFS
> > > + tristate
> > > + depends on ISDN_CAPI_CAPIFS_BOOL
> > > + default ISDN_CAPI_CAPI20
> > > +
> >...
>
> cu
> Adrian
>
> --
>
> "Is there not promise of rain?" Ling Tan asked suddenly out
> of the darkness. There had been need of rain for many days.
> "Only a promise," Lao Er said.
> Pearl S. Buck - Dragon Seed
>
> _______________________________________________
> isdn4linux mailing list
> [email protected]
> https://www.isdn4linux.de/mailman/listinfo/isdn4linux
>

2006-02-02 21:41:08

by Adrian Bunk

[permalink] [raw]
Subject: Re: [2.6 patch] ISDN_CAPI_CAPIFS related cleanups

On Tue, Jan 31, 2006 at 10:44:04PM +0100, Marcel Holtmann wrote:

> Hi Adrian,

Hi Marcel,

> > This patch contains the following cleanups:
> > - move the help text to the right option
> > - replace some #ifdef's in capi.c with dummy functions in capifs.h
> > - use CONFIG_ISDN_CAPI_CAPIFS_BOOL in one place in capi.c
>
> I actually still like to see capifs removed completely. It is not really
> needed if you gonna use udev. The only thing that it is doing, is to set
> the correct permissions and make sure that the device nodes are created.
> And with a 2.6 kernel this can be all done by udev.

udev is not mandatory.

Static /dev is still 100% supported and working fine.

> Regards
>
> Marcel

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2006-02-02 23:55:37

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [2.6 patch] ISDN_CAPI_CAPIFS related cleanups

Hi Adrian,

> > > This patch contains the following cleanups:
> > > - move the help text to the right option
> > > - replace some #ifdef's in capi.c with dummy functions in capifs.h
> > > - use CONFIG_ISDN_CAPI_CAPIFS_BOOL in one place in capi.c
> >
> > I actually still like to see capifs removed completely. It is not really
> > needed if you gonna use udev. The only thing that it is doing, is to set
> > the correct permissions and make sure that the device nodes are created.
> > And with a 2.6 kernel this can be all done by udev.
>
> udev is not mandatory.
>
> Static /dev is still 100% supported and working fine.

and if you have static /dev then you can use mknod and chown by
yourself. If you use CAPI on any newer distribution with the latest 2.6
kernel you will have udev anyway and so no static /dev at all.

Regards

Marcel


2006-02-03 08:46:16

by Armin Schindler

[permalink] [raw]
Subject: Re: [2.6 patch] ISDN_CAPI_CAPIFS related cleanups

On Fri, 3 Feb 2006, Marcel Holtmann wrote:
> Hi Adrian,
>
> > > > This patch contains the following cleanups:
> > > > - move the help text to the right option
> > > > - replace some #ifdef's in capi.c with dummy functions in capifs.h
> > > > - use CONFIG_ISDN_CAPI_CAPIFS_BOOL in one place in capi.c
> > >
> > > I actually still like to see capifs removed completely. It is not really
> > > needed if you gonna use udev. The only thing that it is doing, is to set
> > > the correct permissions and make sure that the device nodes are created.
> > > And with a 2.6 kernel this can be all done by udev.
> >
> > udev is not mandatory.
> >
> > Static /dev is still 100% supported and working fine.
>
> and if you have static /dev then you can use mknod and chown by
> yourself. If you use CAPI on any newer distribution with the latest 2.6
> kernel you will have udev anyway and so no static /dev at all.

Sorry for my ignorance, but I think capifs was introduced to have own
dynamic 'files' like pts and not to have the restrictions of character
devices and the needed major/minor numbers.

So changing this to character device nodes may break applications
out there.

Armin

2006-02-03 08:52:20

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [2.6 patch] ISDN_CAPI_CAPIFS related cleanups

Hi Armin,

> > > > > This patch contains the following cleanups:
> > > > > - move the help text to the right option
> > > > > - replace some #ifdef's in capi.c with dummy functions in capifs.h
> > > > > - use CONFIG_ISDN_CAPI_CAPIFS_BOOL in one place in capi.c
> > > >
> > > > I actually still like to see capifs removed completely. It is not really
> > > > needed if you gonna use udev. The only thing that it is doing, is to set
> > > > the correct permissions and make sure that the device nodes are created.
> > > > And with a 2.6 kernel this can be all done by udev.
> > >
> > > udev is not mandatory.
> > >
> > > Static /dev is still 100% supported and working fine.
> >
> > and if you have static /dev then you can use mknod and chown by
> > yourself. If you use CAPI on any newer distribution with the latest 2.6
> > kernel you will have udev anyway and so no static /dev at all.
>
> Sorry for my ignorance, but I think capifs was introduced to have own
> dynamic 'files' like pts and not to have the restrictions of character
> devices and the needed major/minor numbers.

I am under the impression that it was introduced to change the ownership
of the device node the current process. Nothing more, nothing less.
Please correct me if I am wrong here.

> So changing this to character device nodes may break applications
> out there.

Actually I stopped compiling in and using capifs over a year ago and I
never had any problems with it. However you must ensure that the device
has been created by udev, nut nowadays this is no problem.

Regards

Marcel


2006-02-03 10:19:15

by Armin Schindler

[permalink] [raw]
Subject: Re: [2.6 patch] ISDN_CAPI_CAPIFS related cleanups

On Fri, 3 Feb 2006, Marcel Holtmann wrote:
> Hi Armin,
>
> > > > > > This patch contains the following cleanups:
> > > > > > - move the help text to the right option
> > > > > > - replace some #ifdef's in capi.c with dummy functions in capifs.h
> > > > > > - use CONFIG_ISDN_CAPI_CAPIFS_BOOL in one place in capi.c
> > > > >
> > > > > I actually still like to see capifs removed completely. It is not really
> > > > > needed if you gonna use udev. The only thing that it is doing, is to set
> > > > > the correct permissions and make sure that the device nodes are created.
> > > > > And with a 2.6 kernel this can be all done by udev.
> > > >
> > > > udev is not mandatory.
> > > >
> > > > Static /dev is still 100% supported and working fine.
> > >
> > > and if you have static /dev then you can use mknod and chown by
> > > yourself. If you use CAPI on any newer distribution with the latest 2.6
> > > kernel you will have udev anyway and so no static /dev at all.
> >
> > Sorry for my ignorance, but I think capifs was introduced to have own
> > dynamic 'files' like pts and not to have the restrictions of character
> > devices and the needed major/minor numbers.
>
> I am under the impression that it was introduced to change the ownership
> of the device node the current process. Nothing more, nothing less.
> Please correct me if I am wrong here.

I really don't know. Calle should be asked, I think he did that.

> > So changing this to character device nodes may break applications
> > out there.
>
> Actually I stopped compiling in and using capifs over a year ago and I
> never had any problems with it. However you must ensure that the device
> has been created by udev, nut nowadays this is no problem.

I use capi-ppp connections with capifs. If you don't use capifs, how do you
do ppp over CAPI?

What about the major number? Wouldn't we need a major number then?

If udev is creating the device, it may be not existent when the application
expects it. E.g. the application is doing the ioctl to retreive the
connection number (filename) and expects to be able to open it. But in case
of udev, it might be not done in that time. So the application needs to wait
for some time..., but how long? I don't like this idea.

Armin

2006-02-03 19:55:58

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [2.6 patch] ISDN_CAPI_CAPIFS related cleanups

Hi Armin,

> > > > > > > This patch contains the following cleanups:
> > > > > > > - move the help text to the right option
> > > > > > > - replace some #ifdef's in capi.c with dummy functions in capifs.h
> > > > > > > - use CONFIG_ISDN_CAPI_CAPIFS_BOOL in one place in capi.c
> > > > > >
> > > > > > I actually still like to see capifs removed completely. It is not really
> > > > > > needed if you gonna use udev. The only thing that it is doing, is to set
> > > > > > the correct permissions and make sure that the device nodes are created.
> > > > > > And with a 2.6 kernel this can be all done by udev.
> > > > >
> > > > > udev is not mandatory.
> > > > >
> > > > > Static /dev is still 100% supported and working fine.
> > > >
> > > > and if you have static /dev then you can use mknod and chown by
> > > > yourself. If you use CAPI on any newer distribution with the latest 2.6
> > > > kernel you will have udev anyway and so no static /dev at all.
> > >
> > > Sorry for my ignorance, but I think capifs was introduced to have own
> > > dynamic 'files' like pts and not to have the restrictions of character
> > > devices and the needed major/minor numbers.
> >
> > I am under the impression that it was introduced to change the ownership
> > of the device node the current process. Nothing more, nothing less.
> > Please correct me if I am wrong here.
>
> I really don't know. Calle should be asked, I think he did that.

I asked him some time ago, but never got a final feedback for it.

> > > So changing this to character device nodes may break applications
> > > out there.
> >
> > Actually I stopped compiling in and using capifs over a year ago and I
> > never had any problems with it. However you must ensure that the device
> > has been created by udev, nut nowadays this is no problem.
>
> I use capi-ppp connections with capifs. If you don't use capifs, how do you
> do ppp over CAPI?
>
> What about the major number? Wouldn't we need a major number then?

It has already a major number.

> If udev is creating the device, it may be not existent when the application
> expects it. E.g. the application is doing the ioctl to retreive the
> connection number (filename) and expects to be able to open it. But in case
> of udev, it might be not done in that time. So the application needs to wait
> for some time..., but how long? I don't like this idea.

This is a small race condition that existed with the original udev, but
it was easy to work around it. Adding a simple sleep is enough and I did
the same with Bluetooth RFCOMM. However it should be work nowadays, but
I am not 100% sure. We should check this with the udev guys.

Regards

Marcel


2006-02-12 11:20:20

by Carsten Paeth

[permalink] [raw]
Subject: Re: [2.6 patch] ISDN_CAPI_CAPIFS related cleanups

Hello,

I have no problems, when capifs is removed, but the pppdcapiplugin
has to work without it.
So if you want to remove capifs make sure pppdcapiplugin is
working without problems together with udev ...

I'm too busy to check pppdcapiplugin together with udev ....

regards,

calle

Fri, Feb 03, 2006 at 08:57:20PM +0100, Marcel Holtmann schrieb:
> Hi Armin,
>
> > > > > > > > This patch contains the following cleanups:
> > > > > > > > - move the help text to the right option
> > > > > > > > - replace some #ifdef's in capi.c with dummy functions in capifs.h
> > > > > > > > - use CONFIG_ISDN_CAPI_CAPIFS_BOOL in one place in capi.c
> > > > > > >
> > > > > > > I actually still like to see capifs removed completely. It is not really
> > > > > > > needed if you gonna use udev. The only thing that it is doing, is to set
> > > > > > > the correct permissions and make sure that the device nodes are created.
> > > > > > > And with a 2.6 kernel this can be all done by udev.
> > > > > >
> > > > > > udev is not mandatory.
> > > > > >
> > > > > > Static /dev is still 100% supported and working fine.
> > > > >
> > > > > and if you have static /dev then you can use mknod and chown by
> > > > > yourself. If you use CAPI on any newer distribution with the latest 2.6
> > > > > kernel you will have udev anyway and so no static /dev at all.
> > > >
> > > > Sorry for my ignorance, but I think capifs was introduced to have own
> > > > dynamic 'files' like pts and not to have the restrictions of character
> > > > devices and the needed major/minor numbers.
> > >
> > > I am under the impression that it was introduced to change the ownership
> > > of the device node the current process. Nothing more, nothing less.
> > > Please correct me if I am wrong here.
> >
> > I really don't know. Calle should be asked, I think he did that.
>
> I asked him some time ago, but never got a final feedback for it.
>
> > > > So changing this to character device nodes may break applications
> > > > out there.
> > >
> > > Actually I stopped compiling in and using capifs over a year ago and I
> > > never had any problems with it. However you must ensure that the device
> > > has been created by udev, nut nowadays this is no problem.
> >
> > I use capi-ppp connections with capifs. If you don't use capifs, how do you
> > do ppp over CAPI?
> >
> > What about the major number? Wouldn't we need a major number then?
>
> It has already a major number.
>
> > If udev is creating the device, it may be not existent when the application
> > expects it. E.g. the application is doing the ioctl to retreive the
> > connection number (filename) and expects to be able to open it. But in case
> > of udev, it might be not done in that time. So the application needs to wait
> > for some time..., but how long? I don't like this idea.
>
> This is a small race condition that existed with the original udev, but
> it was easy to work around it. Adding a simple sleep is enough and I did
> the same with Bluetooth RFCOMM. However it should be work nowadays, but
> I am not 100% sure. We should check this with the udev guys.
>
> Regards
>
> Marcel
>

2006-02-12 11:36:28

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [2.6 patch] ISDN_CAPI_CAPIFS related cleanups

Hi Calle,

> I have no problems, when capifs is removed, but the pppdcapiplugin
> has to work without it.
> So if you want to remove capifs make sure pppdcapiplugin is
> working without problems together with udev ...
>
> I'm too busy to check pppdcapiplugin together with udev ....

I posted this patch some time ago (actually April 2004) which made pppd
wait for the device node to be created before failing. I used it since
then and it still works fine for me.

Regards

Marcel


Attachments:
patch-pppdcapiplugin-wait-for-dev (743.00 B)

2006-02-18 16:00:21

by Carsten Paeth

[permalink] [raw]
Subject: Re: [2.6 patch] ISDN_CAPI_CAPIFS related cleanups

Sun, Feb 12, 2006 at 12:36:15PM +0100, Marcel Holtmann schrieb:
> Hi Calle,
>
> > I have no problems, when capifs is removed, but the pppdcapiplugin
> > has to work without it.
> > So if you want to remove capifs make sure pppdcapiplugin is
> > working without problems together with udev ...
> >
> > I'm too busy to check pppdcapiplugin together with udev ....
>
> I posted this patch some time ago (actually April 2004) which made pppd
> wait for the device node to be created before failing. I used it since
> then and it still works fine for me.

Oh, I missed that patch. So check it in und remove capifs :-)

calle

>
> Regards
>
> Marcel
>

> Index: capiplugin.c
> ===================================================================
> RCS file: /i4ldev/isdn4k-utils/pppdcapiplugin/capiplugin.c,v
> retrieving revision 1.33
> diff -u -r1.33 capiplugin.c
> --- capiplugin.c 16 Jan 2004 15:27:13 -0000 1.33
> +++ capiplugin.c 12 Apr 2004 13:20:50 -0000
> @@ -1413,6 +1413,11 @@
> fatal("capiplugin: failed to get tty devname - %s (%d)",
> strerror(serrno), serrno);
> }
> + retry = 0;
> + while (access(tty, 0) != 0 && (retry++ < 4)) {
> + dbglog("capiplugin: capitty not available, waiting for device ...");
> + sleep(1);
> + }
> if (access(tty, 0) != 0 && errno == ENOENT) {
> fatal("capiplugin: tty %s doesn't exist - CAPI Filesystem Support not enabled in kernel or not mounted ?", tty);
> }