aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/networking/caif
diff options
context:
space:
mode:
authorSjur Brændeland <sjur.brandeland@stericsson.com>2012-06-25 03:49:40 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-25 19:44:12 -0400
commit5051c94bb3998ff24bf07ae3b72dca30f85962f8 (patch)
tree1a30dfbb97180b40e6a666def4dbee874fb42cac /Documentation/networking/caif
parentb42f7b5cfda6f7dac298da2d9a8855f6364e35d9 (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.txt91
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.
19Architecture: 19Architecture:
20------------ 20------------
21The implementation of CAIF is divided into: 21The 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
47Using the Kernel API
48----------------------
49The Kernel API is used for accessing CAIF channels from the
50kernel.
51The user of the API has to implement two callbacks for receive
52and control.
53The receive callback gives a CAIF packet as a SKB. The control
54callback will
55notify of channel initialization complete, and flow-on/flow-
56off.
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
70See the caif_kernel.h for details about the CAIF kernel API.
71 47
72 48
73I M P L E M E N T A T I O N 49I M P L E M E N T A T I O N
74=========================== 50===========================
75=========================== 51
76 52
77CAIF Core Protocol Layer 53CAIF 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
103Layered Architecture 75Layered 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
117The CAIF Protocol implementation contains: 84The 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
189Linux Driver Implementation 156CAIF Socket and IP interface
190=========================== 157===========================
191 158
192Linux GPRS Net Device and CAIF socket are implemented on top of the 159The IP interface and CAIF socket API are implemented on top of the
193CAIF Core protocol. The Net device and CAIF socket have an instance of 160CAIF 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.
195Net device and Socket implement the 'receive()' function defined by 162Net 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
197receive of packets is handled as by the rest of the layers: the 'dn->transmit()' 164receive of packets is handled as by the rest of the layers: the 'dn->transmit()'
198function is called in order to transmit data. 165function is called in order to transmit data.
199 166
200The layer on top of the CAIF Core implementation is
201sometimes referred to as the "Client layer".
202
203
204Configuration of Link Layer 167Configuration of Link Layer
205--------------------------- 168---------------------------
206The Link Layer is implemented as Linux net devices (struct net_device). 169The Link Layer is implemented as Linux network devices (struct net_device).
207Payload handling and registration is done using standard Linux mechanisms. 170Payload handling and registration is done using standard Linux mechanisms.
208 171
209The CAIF Protocol relies on a loss-less link layer without implementing 172The CAIF Protocol relies on a loss-less link layer without implementing