Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / Documentation / isdn / gigaset.rst
1 ==========================
2 GigaSet 307x Device Driver
3 ==========================
4
5 1.   Requirements
6 =================
7
8 1.1. Hardware
9 -------------
10
11      This driver supports the connection of the Gigaset 307x/417x family of
12      ISDN DECT bases via Gigaset M101 Data, Gigaset M105 Data or direct USB
13      connection. The following devices are reported to be compatible:
14
15      Bases:
16        - Siemens Gigaset 3070/3075 isdn
17        - Siemens Gigaset 4170/4175 isdn
18        - Siemens Gigaset SX205/255
19        - Siemens Gigaset SX353
20        - T-Com Sinus 45 [AB] isdn
21        - T-Com Sinus 721X[A] [SE]
22        - Vox Chicago 390 ISDN (KPN Telecom)
23
24      RS232 data boxes:
25        - Siemens Gigaset M101 Data
26        - T-Com Sinus 45 Data 1
27
28      USB data boxes:
29        - Siemens Gigaset M105 Data
30        - Siemens Gigaset USB Adapter DECT
31        - T-Com Sinus 45 Data 2
32        - T-Com Sinus 721 data
33        - Chicago 390 USB (KPN)
34
35      See also http://www.erbze.info/sinus_gigaset.htm
36        (archived at https://web.archive.org/web/20100717020421/http://www.erbze.info:80/sinus_gigaset.htm ) and
37         http://gigaset307x.sourceforge.net/
38
39      We had also reports from users of Gigaset M105 who could use the drivers
40      with SX 100 and CX 100 ISDN bases (only in unimodem mode, see section 2.5.)
41      If you have another device that works with our driver, please let us know.
42
43      Chances of getting an USB device to work are good if the output of::
44
45         lsusb
46
47      at the command line contains one of the following::
48
49         ID 0681:0001
50         ID 0681:0002
51         ID 0681:0009
52         ID 0681:0021
53         ID 0681:0022
54
55 1.2. Software
56 -------------
57
58      The driver works with the Kernel CAPI subsystem and can be used with any
59      software which is able to use CAPI 2.0 for ISDN connections (voice or data).
60
61      There are some user space tools available at
62      https://sourceforge.net/projects/gigaset307x/
63      which provide access to additional device specific functions like SMS,
64      phonebook or call journal.
65
66
67 2.   How to use the driver
68 ==========================
69
70 2.1. Modules
71 ------------
72
73      For the devices to work, the proper kernel modules have to be loaded.
74      This normally happens automatically when the system detects the USB
75      device (base, M105) or when the line discipline is attached (M101). It
76      can also be triggered manually using the modprobe(8) command, for example
77      for troubleshooting or to pass module parameters.
78
79      The module ser_gigaset provides a serial line discipline N_GIGASET_M101
80      which uses the regular serial port driver to access the device, and must
81      therefore be attached to the serial device to which the M101 is connected.
82      The ldattach(8) command (included in util-linux-ng release 2.14 or later)
83      can be used for that purpose, for example::
84
85         ldattach GIGASET_M101 /dev/ttyS1
86
87      This will open the device file, attach the line discipline to it, and
88      then sleep in the background, keeping the device open so that the line
89      discipline remains active. To deactivate it, kill the daemon, for example
90      with::
91
92         killall ldattach
93
94      before disconnecting the device. To have this happen automatically at
95      system startup/shutdown on an LSB compatible system, create and activate
96      an appropriate LSB startup script /etc/init.d/gigaset. (The init name
97      'gigaset' is officially assigned to this project by LANANA.)
98      Alternatively, just add the 'ldattach' command line to /etc/rc.local.
99
100      The modules accept the following parameters:
101
102         =============== ========== ==========================================
103         Module          Parameter  Meaning
104
105         gigaset         debug      debug level (see section 3.2.)
106
107                         startmode  initial operation mode (see section 2.5.):
108         bas_gigaset )              1=CAPI (default), 0=Unimodem
109         ser_gigaset )
110         usb_gigaset )   cidmode    initial Call-ID mode setting (see section
111                                    2.5.): 1=on (default), 0=off
112
113         =============== ========== ==========================================
114
115      Depending on your distribution you may want to create a separate module
116      configuration file like /etc/modprobe.d/gigaset.conf for these.
117
118 2.2. Device nodes for user space programs
119 -----------------------------------------
120
121      The device can be accessed from user space (eg. by the user space tools
122      mentioned in 1.2.) through the device nodes:
123
124      - /dev/ttyGS0 for M101 (RS232 data boxes)
125      - /dev/ttyGU0 for M105 (USB data boxes)
126      - /dev/ttyGB0 for the base driver (direct USB connection)
127
128      If you connect more than one device of a type, they will get consecutive
129      device nodes, eg. /dev/ttyGU1 for a second M105.
130
131      You can also set a "default device" for the user space tools to use when
132      no device node is given as parameter, by creating a symlink /dev/ttyG to
133      one of them, eg.::
134
135         ln -s /dev/ttyGB0 /dev/ttyG
136
137      The devices accept the following device specific ioctl calls
138      (defined in gigaset_dev.h):
139
140      ``ioctl(int fd, GIGASET_REDIR, int *cmd);``
141
142      If cmd==1, the device is set to be controlled exclusively through the
143      character device node; access from the ISDN subsystem is blocked.
144
145      If cmd==0, the device is set to be used from the ISDN subsystem and does
146      not communicate through the character device node.
147
148      ``ioctl(int fd, GIGASET_CONFIG, int *cmd);``
149
150      (ser_gigaset and usb_gigaset only)
151
152      If cmd==1, the device is set to adapter configuration mode where commands
153      are interpreted by the M10x DECT adapter itself instead of being
154      forwarded to the base station. In this mode, the device accepts the
155      commands described in Siemens document "AT-Kommando Alignment M10x Data"
156      for setting the operation mode, associating with a base station and
157      querying parameters like field strengh and signal quality.
158
159      Note that there is no ioctl command for leaving adapter configuration
160      mode and returning to regular operation. In order to leave adapter
161      configuration mode, write the command ATO to the device.
162
163      ``ioctl(int fd, GIGASET_BRKCHARS, unsigned char brkchars[6]);``
164
165      (usb_gigaset only)
166
167      Set the break characters on an M105's internal serial adapter to the six
168      bytes stored in brkchars[]. Unused bytes should be set to zero.
169
170      ioctl(int fd, GIGASET_VERSION, unsigned version[4]);
171      Retrieve version information from the driver. version[0] must be set to
172      one of:
173
174      - GIGVER_DRIVER: retrieve driver version
175      - GIGVER_COMPAT: retrieve interface compatibility version
176      - GIGVER_FWBASE: retrieve the firmware version of the base
177
178      Upon return, version[] is filled with the requested version information.
179
180 2.3. CAPI
181 ---------
182
183      The devices will show up as CAPI controllers as soon as the
184      corresponding driver module is loaded, and can then be used with
185      CAPI 2.0 kernel and user space applications. For user space access,
186      the module capi.ko must be loaded.
187
188      Most distributions handle loading and unloading of the various CAPI
189      modules automatically via the command capiinit(1) from the capi4k-utils
190      package or a similar mechanism. Note that capiinit(1) cannot unload the
191      Gigaset drivers because it doesn't support more than one module per
192      driver.
193
194 2.5. Unimodem mode
195 ------------------
196
197      In this mode the device works like a modem connected to a serial port
198      (the /dev/ttyGU0, ... mentioned above) which understands the commands::
199
200          ATZ                 init, reset
201              => OK or ERROR
202          ATD
203          ATDT                dial
204              => OK, CONNECT,
205                 BUSY,
206                 NO DIAL TONE,
207                 NO CARRIER,
208                 NO ANSWER
209          <pause>+++<pause>   change to command mode when connected
210          ATH                 hangup
211
212      You can use some configuration tool of your distribution to configure this
213      "modem" or configure pppd/wvdial manually. There are some example ppp
214      configuration files and chat scripts in the gigaset-VERSION/ppp directory
215      in the driver packages from https://sourceforge.net/projects/gigaset307x/.
216      Please note that the USB drivers are not able to change the state of the
217      control lines. This means you must use "Stupid Mode" if you are using
218      wvdial or you should use the nocrtscts option of pppd.
219      You must also assure that the ppp_async module is loaded with the parameter
220      flag_time=0. You can do this e.g. by adding a line like::
221
222         options ppp_async flag_time=0
223
224      to an appropriate module configuration file, like::
225
226         /etc/modprobe.d/gigaset.conf.
227
228      Unimodem mode is needed for making some devices [e.g. SX100] work which
229      do not support the regular Gigaset command set. If debug output (see
230      section 3.2.) shows something like this when dialing::
231
232          CMD Received: ERROR
233          Available Params: 0
234          Connection State: 0, Response: -1
235          gigaset_process_response: resp_code -1 in ConState 0 !
236          Timeout occurred
237
238      then switching to unimodem mode may help.
239
240      If you have installed the command line tool gigacontr, you can enter
241      unimodem mode using::
242
243          gigacontr --mode unimodem
244
245      You can switch back using::
246
247          gigacontr --mode isdn
248
249      You can also put the driver directly into Unimodem mode when it's loaded,
250      by passing the module parameter startmode=0 to the hardware specific
251      module, e.g.::
252
253         modprobe usb_gigaset startmode=0
254
255      or by adding a line like::
256
257         options usb_gigaset startmode=0
258
259      to an appropriate module configuration file, like::
260
261         /etc/modprobe.d/gigaset.conf
262
263 2.6. Call-ID (CID) mode
264 -----------------------
265
266      Call-IDs are numbers used to tag commands to, and responses from, the
267      Gigaset base in order to support the simultaneous handling of multiple
268      ISDN calls. Their use can be enabled ("CID mode") or disabled ("Unimodem
269      mode"). Without Call-IDs (in Unimodem mode), only a very limited set of
270      functions is available. It allows outgoing data connections only, but
271      does not signal incoming calls or other base events.
272
273      DECT cordless data devices (M10x) permanently occupy the cordless
274      connection to the base while Call-IDs are activated. As the Gigaset
275      bases only support one DECT data connection at a time, this prevents
276      other DECT cordless data devices from accessing the base.
277
278      During active operation, the driver switches to the necessary mode
279      automatically. However, for the reasons above, the mode chosen when
280      the device is not in use (idle) can be selected by the user.
281
282      - If you want to receive incoming calls, you can use the default
283        settings (CID mode).
284      - If you have several DECT data devices (M10x) which you want to use
285        in turn, select Unimodem mode by passing the parameter "cidmode=0" to
286        the appropriate driver module (ser_gigaset or usb_gigaset).
287
288      If you want both of these at once, you are out of luck.
289
290      You can also use the tty class parameter "cidmode" of the device to
291      change its CID mode while the driver is loaded, eg.::
292
293         echo 0 > /sys/class/tty/ttyGU0/cidmode
294
295 2.7. Dialing Numbers
296 --------------------
297 provided by an application for dialing out must
298      be a public network number according to the local dialing plan, without
299      any dial prefix for getting an outside line.
300
301      Internal calls can be made by providing an internal extension number
302      prefixed with ``**`` (two asterisks) as the called party number. So to dial
303      eg. the first registered DECT handset, give ``**11`` as the called party
304      number. Dialing ``***`` (three asterisks) calls all extensions
305      simultaneously (global call).
306
307      Unimodem mode does not support internal calls.
308
309 2.8. Unregistered Wireless Devices (M101/M105)
310 ----------------------------------------------
311
312      The main purpose of the ser_gigaset and usb_gigaset drivers is to allow
313      the M101 and M105 wireless devices to be used as ISDN devices for ISDN
314      connections through a Gigaset base. Therefore they assume that the device
315      is registered to a DECT base.
316
317      If the M101/M105 device is not registered to a base, initialization of
318      the device fails, and a corresponding error message is logged by the
319      driver. In that situation, a restricted set of functions is available
320      which includes, in particular, those necessary for registering the device
321      to a base or for switching it between Fixed Part and Portable Part
322      modes. See the gigacontr(8) manpage for details.
323
324 3.   Troubleshooting
325 ====================
326
327 3.1. Solutions to frequently reported problems
328 ----------------------------------------------
329
330      Problem:
331         You have a slow provider and isdn4linux gives up dialing too early.
332      Solution:
333         Load the isdn module using the dialtimeout option. You can do this e.g.
334         by adding a line like::
335
336            options isdn dialtimeout=15
337
338         to /etc/modprobe.d/gigaset.conf or a similar file.
339
340      Problem:
341         The isdnlog program emits error messages or just doesn't work.
342      Solution:
343         Isdnlog supports only the HiSax driver. Do not attempt to use it with
344         other drivers such as Gigaset.
345
346      Problem:
347         You have two or more DECT data adapters (M101/M105) and only the
348         first one you turn on works.
349      Solution:
350         Select Unimodem mode for all DECT data adapters. (see section 2.5.)
351
352      Problem:
353         Messages like this::
354
355             usb_gigaset 3-2:1.0: Could not initialize the device.
356
357         appear in your syslog.
358      Solution:
359         Check whether your M10x wireless device is correctly registered to the
360         Gigaset base. (see section 2.7.)
361
362 3.2. Telling the driver to provide more information
363 ---------------------------------------------------
364      Building the driver with the "Gigaset debugging" kernel configuration
365      option (CONFIG_GIGASET_DEBUG) gives it the ability to produce additional
366      information useful for debugging.
367
368      You can control the amount of debugging information the driver produces by
369      writing an appropriate value to /sys/module/gigaset/parameters/debug,
370      e.g.::
371
372         echo 0 > /sys/module/gigaset/parameters/debug
373
374      switches off debugging output completely,
375
376      ::
377
378         echo 0x302020 > /sys/module/gigaset/parameters/debug
379
380      enables a reasonable set of debugging output messages. These values are
381      bit patterns where every bit controls a certain type of debugging output.
382      See the constants DEBUG_* in the source file gigaset.h for details.
383
384      The initial value can be set using the debug parameter when loading the
385      module "gigaset", e.g. by adding a line::
386
387         options gigaset debug=0
388
389      to your module configuration file, eg. /etc/modprobe.d/gigaset.conf
390
391      Generated debugging information can be found
392      - as output of the command::
393
394          dmesg
395
396      - in system log files written by your syslog daemon, usually
397        in /var/log/, e.g. /var/log/messages.
398
399 3.3. Reporting problems and bugs
400 --------------------------------
401      If you can't solve problems with the driver on your own, feel free to
402      use one of the forums, bug trackers, or mailing lists on
403
404          https://sourceforge.net/projects/gigaset307x
405
406      or write an electronic mail to the maintainers.
407
408      Try to provide as much information as possible, such as
409
410      - distribution
411      - kernel version (uname -r)
412      - gcc version (gcc --version)
413      - hardware architecture (uname -m, ...)
414      - type and firmware version of your device (base and wireless module,
415        if any)
416      - output of "lsusb -v" (if using an USB device)
417      - error messages
418      - relevant system log messages (it would help if you activate debug
419        output as described in 3.2.)
420
421      For help with general configuration problems not specific to our driver,
422      such as isdn4linux and network configuration issues, please refer to the
423      appropriate forums and newsgroups.
424
425 3.4. Reporting problem solutions
426 --------------------------------
427      If you solved a problem with our drivers, wrote startup scripts for your
428      distribution, ... feel free to contact us (using one of the places
429      mentioned in 3.3.). We'd like to add scripts, hints, documentation
430      to the driver and/or the project web page.
431
432
433 4.   Links, other software
434 ==========================
435
436      - Sourceforge project developing this driver and associated tools
437          https://sourceforge.net/projects/gigaset307x
438      - Yahoo! Group on the Siemens Gigaset family of devices
439          https://de.groups.yahoo.com/group/Siemens-Gigaset
440      - Siemens Gigaset/T-Sinus compatibility table
441          http://www.erbze.info/sinus_gigaset.htm
442             (archived at https://web.archive.org/web/20100717020421/http://www.erbze.info:80/sinus_gigaset.htm )
443
444
445 5.   Credits
446 ============
447
448      Thanks to
449
450      Karsten Keil
451         for his help with isdn4linux
452      Deti Fliegl
453         for his base driver code
454      Dennis Dietrich
455         for his kernel 2.6 patches
456      Andreas Rummel
457         for his work and logs to get unimodem mode working
458      Andreas Degert
459         for his logs and patches to get cx 100 working
460      Dietrich Feist
461         for his generous donation of one M105 and two M101 cordless adapters
462      Christoph Schweers
463         for his generous donation of a M34 device
464
465      and all the other people who sent logs and other information.