Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / sys / net / i4b / capi / README
1 $FreeBSD: src/sys/i4b/capi/README,v 1.1.2.1 2001/08/10 14:08:34 obrien Exp $
2 $DragonFly: src/sys/net/i4b/capi/README,v 1.2 2003/06/17 04:28:39 dillon Exp $
3
4 Message-ID: <3AF56886.7D92609A@cubical.fi>
5 Date: Sun, 06 May 2001 18:06:47 +0300
6 From: Juha-Matti Liukkonen <jml@cubical.fi>
7 Organization: Cubical Solutions Ltd
8
9 Please find the attached diff and tarball for our support software for
10 CAPI 2.0 and AVM's active T1 and T1-B (primary rate) and B1 (basic rate)
11 ISDN adapters for isdn4bsd. The implementation has been made from
12 scratch by us, based on reverse engineering of the Linux driver provided
13 by AVM GmbH and available in ftp.avm.de. Cubical Solutions Ltd offers
14 this implementation for the BSD community free of charge and assuming
15 absolutely no liabilities whatsoever. Feel free to modify the
16 implementation any way you see fit, but please retain our one-liner
17 copyright statement somewhere in the comment headers in the capi and
18 iavc driver modules.
19
20 That said, the attached tarball is i4b-00.96.00-beta with our
21 modifications integrated, and the diff contains all modifications we
22 have made to the original (including the new capi files). Our mods add
23 pseudo-device i4bcapi, which attaches to i4b layer 4, and device iavc0,
24 which implements a link layer driver for AVM's active B1 and T1 adapters
25 for i4bcapi. There are also a couple of related improvements to isdnd,
26 and a number of modifications to isdnd and layer 4 to implement support
27 for up to 30 channels per adapter (for primary rate use).
28
29 We have developed the software explicitly for our telephony application,
30 to be used with AVM's T1 adapters, and the implementation has been
31 tested primarily with this functionality in mind. There may be
32 interesting side effects with eg. the ipr and isppp drivers; we do not
33 use them and therefore their testing has been cursory at best. The
34 i4btel driver works well with the T1 (our primary use), and the i4brbch
35 driver has been verified to work with T1, T1-B and B1 adapters (ftp'd
36 some files over a dialup PPP connection with each adapter). Only the PCI
37 versions of the adapters (equipped with the AMCC DMA controller) are
38 supported, although the basics (PIO mode communication) for the older
39 ISA model support is in place, so only the bus attachment modules should
40 be required to support the older hardware.
41
42 All of the AVM active adapters use downloadable firmware, which is not
43 included in the attached package. The firmware files (t1.t4, t1b.t4,
44 b1.t4) can be found from ftp.avm.de in adapter specific subdirectories,
45 or from the CDs provided with the adapters (in directory
46 'cardware/firmware').
47
48 Our primary development platform is our own embedded build (we call it
49 'ebsd') based on FreeBSD 4.2-RELEASE. The implementation has also been
50 tested on standard FreeBSD 4.2-RELEASE system. The implementation should
51 not contain any FreeBSD (or even FreeBSD release) specific issues, but
52 it has not been tested or even compiled on any other platforms;
53 specifically, only the FreeBSD overinstall.sh script is modified to
54 install the capi/iavc support in the kernel source tree.
55
56 This code is not under active development here since the functionality
57 we use (i4btel, T1) has been working since the beginning of March. We
58 are also not planning on any further development (no need seen at this
59 point), but I am naturally interested on whatever bugs and development
60 ideas pop up on the community and will keep a keen eye on the isdn
61 mailing list. I personally may be available for consultation, debugging
62 and possibly development projects, but with notable reservations on my
63 time (the current IT industry recession seems to be pushing even more
64 work for us, which tends to keep us pretty busy these days).
65
66 Here are some specific technical notes:
67
68 * isdnd supports new keyword 'firmware=</path/to/file>' in section
69 'controller'. This keyword is supported for all controller types, and
70 causes I4B_CTRL_DOWNLOAD ioctl to be invoked with the specified file as
71 an argument. In systems equipped with both active and passive adapters,
72 and the passive cards being detected first, dummy 'controller' entries
73 are required for the passive cards to get the correct firmwares to
74 correct adapters. (I hope you did not have other uses for this ioctl in
75 mind?)
76
77 * isdnd supports new keyword 'clone=<entry name>' in section 'entry'.
78 This causes the entry to be copied from the existing named entry. At
79 least entry specific 'name' and 'usrdeviceunit' values should be
80 specified after a 'clone'. (Makes configuring 30 or 60 entries way much
81 easier.)
82
83 * a bug in i4btel driver read routine corrected. The conditions in the
84 while() clause caused the receive queue to be referenced before checking
85 if a channel is connected, leading to kernel panic (do a 'dd
86 if=/dev/i4btel0 of=/dev/null' on an unconnected tel device, panic will
87 follow). Correction was to reorder the while clause conditions to check
88 for connectedness first.
89
90 * isdnd and i4b layer 4 support up to CHANNELS_MAX (=30) channels per
91 adapter. The msg_ctrl_info_req_t message reports the number of channels
92 provided by the adapter, the number is stored in the nbchan field of the
93 controller state structure. The fixed stateb1 and stateb2 entries in
94 controller state stuctures are replaced with an array, and all fixed
95 references there are replaced with loops up to nbchan. Passive stack
96 layer 1 and 2 are not modified, layer 3 sets this field to fixed value 2
97 for all adapters (but it could be delegated to the layer 1 driver's
98 attach request).
99
100 * the i4bcapi driver maps i4b channels to logical channels identified
101 with PLCI/NCCI values in the CAPI protocol using the sc_bchan[] array.
102 The PLCI/NCCI handling is merged in the channel mapping and is greatly
103 simplified from the reference state machine model, because in practice
104 there can be only one PLCI/NCCI per channel active at any given time.
105
106 * the i4bcapi driver does not provide any kind of user level interface
107 (such as the /dev/capi20 interface provided by the linux driver), but
108 could relatively easily be extended to do so (and if done, interface
109 compatibility with the linux implementation would probably be a good
110 goal).
111
112 * there are some gritty details in the iavc driver, inherited from the
113 linux code. Despite us being a legitimate company in the telecom
114 business, AVM failed to produce any programming reference material for
115 us (at least in a reasonable time frame), so some guesswork remains due
116 to classic reverse engineering process (particularly there are a few
117 magic numbers in the card initialization sequence whose meaning I do not
118 know).
119
120 * pseudo-devices i4bq931, i4bq921 and some passive stack layer 1 driver
121 (such as iwic) are required to compile, as the required ctrl_desc[]
122 array is in layer 3, which requires layer 2, which requires layer 1.
123 Some architectural cleanup would come in handy here, but we did not want
124 to start making any major changes (and we use iwic in test setups
125 anyway, so we simply always compile it in).
126
127 To summarize: unpack, overinstall, add the following lines (with the
128 usual passive stack configuration including at least one L1 driver) to
129 your kernel configuration file:
130
131 pseudo-device   "i4bcapi"
132 device          iavc0
133
134 ...and the following to your isdnd.rc:
135
136 controller
137 firmware = /usr/lib/isdn/b1.t4
138
139 ...compile your new kernel, make sure the firmware file is in
140 /usr/lib/isdn, and your B1 adapter should boot up and Just Work (tm). If
141 you have multiple adapters, you need a 'controller' section for each to
142 have them loaded and booted on isdnd startup.
143
144 Have fun -- and let me know if there are any complications, or if I can
145 be of further assistance,
146
147         - Juha
148 --
149 Juha-Matti Liukkonen, Cubical Solutions Ltd
150 Phone: +358(0)405280142
151 Email: jml@cubical.fi