Commit 7bb5fdc2 authored by Tilman Schmidt's avatar Tilman Schmidt Committed by David S. Miller
Browse files

gigaset: add Kernel CAPI interface (v3)



Add a Kernel CAPI interface to the Gigaset driver.

Impact: optional new functionality
Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aaba2b3f
Loading
Loading
Loading
Loading
+21 −13
Original line number Original line Diff line number Diff line
@@ -5,7 +5,7 @@ GigaSet 307x Device Driver
     ------------
     ------------
1.1. Hardware
1.1. Hardware
     --------
     --------
     This release supports the connection of the Gigaset 307x/417x family of
     This driver supports the connection of the Gigaset 307x/417x family of
     ISDN DECT bases via Gigaset M101 Data, Gigaset M105 Data or direct USB
     ISDN DECT bases via Gigaset M101 Data, Gigaset M105 Data or direct USB
     connection. The following devices are reported to be compatible:
     connection. The following devices are reported to be compatible:


@@ -33,7 +33,7 @@ GigaSet 307x Device Driver
              http://gigaset307x.sourceforge.net/
              http://gigaset307x.sourceforge.net/


     We had also reports from users of Gigaset M105 who could use the drivers
     We had also reports from users of Gigaset M105 who could use the drivers
     with SX 100 and CX 100 ISDN bases (only in unimodem mode, see section 2.4.)
     with SX 100 and CX 100 ISDN bases (only in unimodem mode, see section 2.5.)
     If you have another device that works with our driver, please let us know.
     If you have another device that works with our driver, please let us know.


     Chances of getting an USB device to work are good if the output of
     Chances of getting an USB device to work are good if the output of
@@ -49,7 +49,7 @@ GigaSet 307x Device Driver
     --------
     --------
     The driver works with ISDN4linux and so can be used with any software
     The driver works with ISDN4linux and so can be used with any software
     which is able to use ISDN4linux for ISDN connections (voice or data).
     which is able to use ISDN4linux for ISDN connections (voice or data).
     CAPI4Linux support is planned but not yet available.
     Experimental Kernel CAPI support is available as a compilation option.


     There are some user space tools available at
     There are some user space tools available at
     http://sourceforge.net/projects/gigaset307x/
     http://sourceforge.net/projects/gigaset307x/
@@ -102,20 +102,28 @@ GigaSet 307x Device Driver
2.3. ISDN4linux
2.3. ISDN4linux
     ----------
     ----------
     This is the "normal" mode of operation. After loading the module you can
     This is the "normal" mode of operation. After loading the module you can
     set up the ISDN system just as you'd do with any ISDN card.
     set up the ISDN system just as you'd do with any ISDN card supported by
     Your distribution should provide some configuration utility.
     the ISDN4Linux subsystem. Most distributions provide some configuration
     If not, you can use some HOWTOs like
     utility. If not, you can use some HOWTOs like
         http://www.linuxhaven.de/dlhp/HOWTO/DE-ISDN-HOWTO-5.html
         http://www.linuxhaven.de/dlhp/HOWTO/DE-ISDN-HOWTO-5.html
     If this doesn't work, because you have some recent device like SX100 where
     If this doesn't work, because you have some device like SX100 where
     debug output (see section 3.2.) shows something like this when dialing
     debug output (see section 3.2.) shows something like this when dialing
         CMD Received: ERROR
         CMD Received: ERROR
         Available Params: 0
         Available Params: 0
         Connection State: 0, Response: -1
         Connection State: 0, Response: -1
         gigaset_process_response: resp_code -1 in ConState 0 !
         gigaset_process_response: resp_code -1 in ConState 0 !
         Timeout occurred
         Timeout occurred
     you might need to use unimodem mode:
     you might need to use unimodem mode. (see section 2.5.)


2.4. Unimodem mode
2.4. CAPI
     ----
     If the driver is compiled with CAPI support (kernel configuration option
     GIGASET_CAPI, experimental) it can also be used with CAPI 2.0 kernel and
     user space applications.  ISDN4Linux is supported in this configuration
     via the capidrv compatibility driver. The kernel module capidrv.ko must
     be loaded explicitly ("modprobe capidrv") if needed.

2.5. Unimodem mode
     -------------
     -------------
     This is needed for some devices [e.g. SX100] as they have problems with
     This is needed for some devices [e.g. SX100] as they have problems with
     the "normal" commands.
     the "normal" commands.
@@ -160,7 +168,7 @@ GigaSet 307x Device Driver
     configuration file like /etc/modprobe.conf.local,
     configuration file like /etc/modprobe.conf.local,
     using that should be preferred.
     using that should be preferred.


2.5. Call-ID (CID) mode
2.6. Call-ID (CID) mode
     ------------------
     ------------------
     Call-IDs are numbers used to tag commands to, and responses from, the
     Call-IDs are numbers used to tag commands to, and responses from, the
     Gigaset base in order to support the simultaneous handling of multiple
     Gigaset base in order to support the simultaneous handling of multiple
@@ -188,7 +196,7 @@ GigaSet 307x Device Driver
     You can also use /sys/class/tty/ttyGxy/cidmode for changing the CID mode
     You can also use /sys/class/tty/ttyGxy/cidmode for changing the CID mode
     setting (ttyGxy is ttyGU0 or ttyGB0).
     setting (ttyGxy is ttyGU0 or ttyGB0).


2.6. Unregistered Wireless Devices (M101/M105)
2.7. Unregistered Wireless Devices (M101/M105)
     -----------------------------------------
     -----------------------------------------
     The main purpose of the ser_gigaset and usb_gigaset drivers is to allow
     The main purpose of the ser_gigaset and usb_gigaset drivers is to allow
     the M101 and M105 wireless devices to be used as ISDN devices for ISDN
     the M101 and M105 wireless devices to be used as ISDN devices for ISDN
@@ -228,7 +236,7 @@ GigaSet 307x Device Driver
        You have two or more DECT data adapters (M101/M105) and only the
        You have two or more DECT data adapters (M101/M105) and only the
        first one you turn on works.
        first one you turn on works.
     Solution:
     Solution:
        Select Unimodem mode for all DECT data adapters. (see section 2.4.)
        Select Unimodem mode for all DECT data adapters. (see section 2.5.)


     Problem:
     Problem:
	Messages like this:
	Messages like this:
@@ -236,7 +244,7 @@ GigaSet 307x Device Driver
	appear in your syslog.
	appear in your syslog.
     Solution:
     Solution:
	Check whether your M10x wireless device is correctly registered to the
	Check whether your M10x wireless device is correctly registered to the
	Gigaset base. (see section 2.6.)
	Gigaset base. (see section 2.7.)


3.2. Telling the driver to provide more information
3.2. Telling the driver to provide more information
     ----------------------------------------------
     ----------------------------------------------
+15 −3
Original line number Original line Diff line number Diff line
@@ -10,20 +10,32 @@ menuconfig ISDN_DRV_GIGASET
	  If you have one of these devices, say M here and for at least
	  If you have one of these devices, say M here and for at least
	  one of the connection specific parts that follow.
	  one of the connection specific parts that follow.
	  This will build a module called "gigaset".
	  This will build a module called "gigaset".
	  Note: If you build the ISDN4Linux subsystem (ISDN_I4L)
	  Note: If you build your ISDN subsystem (ISDN_CAPI or ISDN_I4L)
	  as a module, you have to build this driver as a module too,
	  as a module, you have to build this driver as a module too,
	  otherwise the Gigaset device won't show up as an ISDN device.
	  otherwise the Gigaset device won't show up as an ISDN device.


if ISDN_DRV_GIGASET
if ISDN_DRV_GIGASET


config GIGASET_CAPI
	bool "Gigaset CAPI support (EXPERIMENTAL)"
	depends on EXPERIMENTAL
	depends on ISDN_CAPI='y'||(ISDN_CAPI='m'&&ISDN_DRV_GIGASET='m')
	default ISDN_I4L='n'
	help
	  Build the Gigaset driver as a CAPI 2.0 driver interfacing with
	  the Kernel CAPI subsystem. To use it with the old ISDN4Linux
	  subsystem you'll have to enable the capidrv glue driver.
	  (select ISDN_CAPI_CAPIDRV.)
	  Say N to build the old native ISDN4Linux variant.

config GIGASET_I4L
config GIGASET_I4L
	bool
	bool
	depends on ISDN_I4L='y'||(ISDN_I4L='m'&&ISDN_DRV_GIGASET='m')
	depends on ISDN_I4L='y'||(ISDN_I4L='m'&&ISDN_DRV_GIGASET='m')
	default y
	default !GIGASET_CAPI


config GIGASET_DUMMYLL
config GIGASET_DUMMYLL
	bool
	bool
	default !GIGASET_I4L
	default !GIGASET_CAPI&&!GIGASET_I4L


config GIGASET_BASE
config GIGASET_BASE
	tristate "Gigaset base station support"
	tristate "Gigaset base station support"
+1 −0
Original line number Original line Diff line number Diff line
gigaset-y := common.o interface.o proc.o ev-layer.o asyncdata.o
gigaset-y := common.o interface.o proc.o ev-layer.o asyncdata.o
gigaset-$(CONFIG_GIGASET_CAPI) += capi.o
gigaset-$(CONFIG_GIGASET_I4L) += i4l.o
gigaset-$(CONFIG_GIGASET_I4L) += i4l.o
gigaset-$(CONFIG_GIGASET_DUMMYLL) += dummyll.o
gigaset-$(CONFIG_GIGASET_DUMMYLL) += dummyll.o
usb_gigaset-y := usb-gigaset.o
usb_gigaset-y := usb-gigaset.o
+2273 −0

File added.

Preview size limit exceeded, changes collapsed.

+26 −0
Original line number Original line Diff line number Diff line
@@ -207,6 +207,32 @@ int gigaset_get_channel(struct bc_state *bcs)
	return 1;
	return 1;
}
}


struct bc_state *gigaset_get_free_channel(struct cardstate *cs)
{
	unsigned long flags;
	int i;

	spin_lock_irqsave(&cs->lock, flags);
	if (!try_module_get(cs->driver->owner)) {
		gig_dbg(DEBUG_ANY,
			"could not get module for allocating channel");
		spin_unlock_irqrestore(&cs->lock, flags);
		return NULL;
	}
	for (i = 0; i < cs->channels; ++i)
		if (!cs->bcs[i].use_count) {
			++cs->bcs[i].use_count;
			cs->bcs[i].busy = 1;
			spin_unlock_irqrestore(&cs->lock, flags);
			gig_dbg(DEBUG_ANY, "allocated channel %d", i);
			return cs->bcs + i;
		}
	module_put(cs->driver->owner);
	spin_unlock_irqrestore(&cs->lock, flags);
	gig_dbg(DEBUG_ANY, "no free channel");
	return NULL;
}

void gigaset_free_channel(struct bc_state *bcs)
void gigaset_free_channel(struct bc_state *bcs)
{
{
	unsigned long flags;
	unsigned long flags;
Loading