diff options
author | Sjur Brændeland <sjur.brandeland@stericsson.com> | 2012-06-25 03:49:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-25 19:44:12 -0400 |
commit | 5051c94bb3998ff24bf07ae3b72dca30f85962f8 (patch) | |
tree | 1a30dfbb97180b40e6a666def4dbee874fb42cac /Documentation/networking/caif | |
parent | b42f7b5cfda6f7dac298da2d9a8855f6364e35d9 (diff) |
Documentation/networking/caif: Update documentation
Update drawing and remove description of old features.
Add HSI and USB link layers to the drawing.
Reported-by: Joerg Reisenweber <joerg.reisenweber@stericssion.com>
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericssion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/networking/caif')
-rw-r--r-- | Documentation/networking/caif/Linux-CAIF.txt | 91 |
1 files changed, 27 insertions, 64 deletions
diff --git a/Documentation/networking/caif/Linux-CAIF.txt b/Documentation/networking/caif/Linux-CAIF.txt index e52fd62bef3a..0aa4bd381bec 100644 --- a/Documentation/networking/caif/Linux-CAIF.txt +++ b/Documentation/networking/caif/Linux-CAIF.txt | |||
@@ -19,60 +19,36 @@ and host. Currently, UART and Loopback are available for Linux. | |||
19 | Architecture: | 19 | Architecture: |
20 | ------------ | 20 | ------------ |
21 | The implementation of CAIF is divided into: | 21 | The implementation of CAIF is divided into: |
22 | * CAIF Socket Layer, Kernel API, and Net Device. | 22 | * CAIF Socket Layer and GPRS IP Interface. |
23 | * CAIF Core Protocol Implementation | 23 | * CAIF Core Protocol Implementation |
24 | * CAIF Link Layer, implemented as NET devices. | 24 | * CAIF Link Layer, implemented as NET devices. |
25 | 25 | ||
26 | 26 | ||
27 | RTNL | 27 | RTNL |
28 | ! | 28 | ! |
29 | ! +------+ +------+ +------+ | 29 | ! +------+ +------+ |
30 | ! +------+! +------+! +------+! | 30 | ! +------+! +------+! |
31 | ! ! Sock !! !Kernel!! ! Net !! | 31 | ! ! IP !! !Socket!! |
32 | ! ! API !+ ! API !+ ! Dev !+ <- CAIF Client APIs | 32 | +-------> !interf!+ ! API !+ <- CAIF Client APIs |
33 | ! +------+ +------! +------+ | 33 | ! +------+ +------! |
34 | ! ! ! ! | 34 | ! ! ! |
35 | ! +----------!----------+ | 35 | ! +-----------+ |
36 | ! +------+ <- CAIF Protocol Implementation | 36 | ! ! |
37 | +-------> ! CAIF ! | 37 | ! +------+ <- CAIF Core Protocol |
38 | ! Core ! | 38 | ! ! CAIF ! |
39 | +------+ | 39 | ! ! Core ! |
40 | +--------!--------+ | 40 | ! +------+ |
41 | ! ! | 41 | ! +----------!---------+ |
42 | +------+ +-----+ | 42 | ! ! ! ! |
43 | ! ! ! TTY ! <- Link Layer (Net Devices) | 43 | ! +------+ +-----+ +------+ |
44 | +------+ +-----+ | 44 | +--> ! HSI ! ! TTY ! ! USB ! <- Link Layer (Net Devices) |
45 | 45 | +------+ +-----+ +------+ | |
46 | 46 | ||
47 | Using the Kernel API | ||
48 | ---------------------- | ||
49 | The Kernel API is used for accessing CAIF channels from the | ||
50 | kernel. | ||
51 | The user of the API has to implement two callbacks for receive | ||
52 | and control. | ||
53 | The receive callback gives a CAIF packet as a SKB. The control | ||
54 | callback will | ||
55 | notify of channel initialization complete, and flow-on/flow- | ||
56 | off. | ||
57 | |||
58 | |||
59 | struct caif_device caif_dev = { | ||
60 | .caif_config = { | ||
61 | .name = "MYDEV" | ||
62 | .type = CAIF_CHTY_AT | ||
63 | } | ||
64 | .receive_cb = my_receive, | ||
65 | .control_cb = my_control, | ||
66 | }; | ||
67 | caif_add_device(&caif_dev); | ||
68 | caif_transmit(&caif_dev, skb); | ||
69 | |||
70 | See the caif_kernel.h for details about the CAIF kernel API. | ||
71 | 47 | ||
72 | 48 | ||
73 | I M P L E M E N T A T I O N | 49 | I M P L E M E N T A T I O N |
74 | =========================== | 50 | =========================== |
75 | =========================== | 51 | |
76 | 52 | ||
77 | CAIF Core Protocol Layer | 53 | CAIF Core Protocol Layer |
78 | ========================================= | 54 | ========================================= |
@@ -88,17 +64,13 @@ The Core CAIF implementation contains: | |||
88 | - Simple implementation of CAIF. | 64 | - Simple implementation of CAIF. |
89 | - Layered architecture (a la Streams), each layer in the CAIF | 65 | - Layered architecture (a la Streams), each layer in the CAIF |
90 | specification is implemented in a separate c-file. | 66 | specification is implemented in a separate c-file. |
91 | - Clients must implement PHY layer to access physical HW | ||
92 | with receive and transmit functions. | ||
93 | - Clients must call configuration function to add PHY layer. | 67 | - Clients must call configuration function to add PHY layer. |
94 | - Clients must implement CAIF layer to consume/produce | 68 | - Clients must implement CAIF layer to consume/produce |
95 | CAIF payload with receive and transmit functions. | 69 | CAIF payload with receive and transmit functions. |
96 | - Clients must call configuration function to add and connect the | 70 | - Clients must call configuration function to add and connect the |
97 | Client layer. | 71 | Client layer. |
98 | - When receiving / transmitting CAIF Packets (cfpkt), ownership is passed | 72 | - When receiving / transmitting CAIF Packets (cfpkt), ownership is passed |
99 | to the called function (except for framing layers' receive functions | 73 | to the called function (except for framing layers' receive function) |
100 | or if a transmit function returns an error, in which case the caller | ||
101 | must free the packet). | ||
102 | 74 | ||
103 | Layered Architecture | 75 | Layered Architecture |
104 | -------------------- | 76 | -------------------- |
@@ -109,11 +81,6 @@ Implementation. The support functions include: | |||
109 | CAIF Packet has functions for creating, destroying and adding content | 81 | CAIF Packet has functions for creating, destroying and adding content |
110 | and for adding/extracting header and trailers to protocol packets. | 82 | and for adding/extracting header and trailers to protocol packets. |
111 | 83 | ||
112 | - CFLST CAIF list implementation. | ||
113 | |||
114 | - CFGLUE CAIF Glue. Contains OS Specifics, such as memory | ||
115 | allocation, endianness, etc. | ||
116 | |||
117 | The CAIF Protocol implementation contains: | 84 | The CAIF Protocol implementation contains: |
118 | 85 | ||
119 | - CFCNFG CAIF Configuration layer. Configures the CAIF Protocol | 86 | - CFCNFG CAIF Configuration layer. Configures the CAIF Protocol |
@@ -128,7 +95,7 @@ The CAIF Protocol implementation contains: | |||
128 | control and remote shutdown requests. | 95 | control and remote shutdown requests. |
129 | 96 | ||
130 | - CFVEI CAIF VEI layer. Handles CAIF AT Channels on VEI (Virtual | 97 | - CFVEI CAIF VEI layer. Handles CAIF AT Channels on VEI (Virtual |
131 | External Interface). This layer encodes/decodes VEI frames. | 98 | External Interface). This layer encodes/decodes VEI frames. |
132 | 99 | ||
133 | - CFDGML CAIF Datagram layer. Handles CAIF Datagram layer (IP | 100 | - CFDGML CAIF Datagram layer. Handles CAIF Datagram layer (IP |
134 | traffic), encodes/decodes Datagram frames. | 101 | traffic), encodes/decodes Datagram frames. |
@@ -170,7 +137,7 @@ The CAIF Protocol implementation contains: | |||
170 | +---------+ +---------+ | 137 | +---------+ +---------+ |
171 | ! ! | 138 | ! ! |
172 | +---------+ +---------+ | 139 | +---------+ +---------+ |
173 | | | | Serial | | 140 | | | | Serial | |
174 | | | | CFSERL | | 141 | | | | CFSERL | |
175 | +---------+ +---------+ | 142 | +---------+ +---------+ |
176 | 143 | ||
@@ -186,24 +153,20 @@ In this layered approach the following "rules" apply. | |||
186 | layer->dn->transmit(layer->dn, packet); | 153 | layer->dn->transmit(layer->dn, packet); |
187 | 154 | ||
188 | 155 | ||
189 | Linux Driver Implementation | 156 | CAIF Socket and IP interface |
190 | =========================== | 157 | =========================== |
191 | 158 | ||
192 | Linux GPRS Net Device and CAIF socket are implemented on top of the | 159 | The IP interface and CAIF socket API are implemented on top of the |
193 | CAIF Core protocol. The Net device and CAIF socket have an instance of | 160 | CAIF Core protocol. The IP Interface and CAIF socket have an instance of |
194 | 'struct cflayer', just like the CAIF Core protocol stack. | 161 | 'struct cflayer', just like the CAIF Core protocol stack. |
195 | Net device and Socket implement the 'receive()' function defined by | 162 | Net device and Socket implement the 'receive()' function defined by |
196 | 'struct cflayer', just like the rest of the CAIF stack. In this way, transmit and | 163 | 'struct cflayer', just like the rest of the CAIF stack. In this way, transmit and |
197 | receive of packets is handled as by the rest of the layers: the 'dn->transmit()' | 164 | receive of packets is handled as by the rest of the layers: the 'dn->transmit()' |
198 | function is called in order to transmit data. | 165 | function is called in order to transmit data. |
199 | 166 | ||
200 | The layer on top of the CAIF Core implementation is | ||
201 | sometimes referred to as the "Client layer". | ||
202 | |||
203 | |||
204 | Configuration of Link Layer | 167 | Configuration of Link Layer |
205 | --------------------------- | 168 | --------------------------- |
206 | The Link Layer is implemented as Linux net devices (struct net_device). | 169 | The Link Layer is implemented as Linux network devices (struct net_device). |
207 | Payload handling and registration is done using standard Linux mechanisms. | 170 | Payload handling and registration is done using standard Linux mechanisms. |
208 | 171 | ||
209 | The CAIF Protocol relies on a loss-less link layer without implementing | 172 | The CAIF Protocol relies on a loss-less link layer without implementing |