Commit 5051c94b authored by Sjur Brændeland's avatar Sjur Brændeland Committed by David S. Miller

Documentation/networking/caif: Update documentation

Update drawing and remove description of old features.
Add HSI and USB link layers to the drawing.
Reported-by: default avatarJoerg Reisenweber <joerg.reisenweber@stericssion.com>
Signed-off-by: default avatarSjur Brændeland <sjur.brandeland@stericssion.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b42f7b5c
...@@ -19,60 +19,36 @@ and host. Currently, UART and Loopback are available for Linux. ...@@ -19,60 +19,36 @@ and host. Currently, UART and Loopback are available for Linux.
Architecture: Architecture:
------------ ------------
The implementation of CAIF is divided into: The implementation of CAIF is divided into:
* CAIF Socket Layer, Kernel API, and Net Device. * CAIF Socket Layer and GPRS IP Interface.
* CAIF Core Protocol Implementation * CAIF Core Protocol Implementation
* CAIF Link Layer, implemented as NET devices. * CAIF Link Layer, implemented as NET devices.
RTNL RTNL
! !
! +------+ +------+ +------+ ! +------+ +------+
! +------+! +------+! +------+! ! +------+! +------+!
! ! Sock !! !Kernel!! ! Net !! ! ! IP !! !Socket!!
! ! API !+ ! API !+ ! Dev !+ <- CAIF Client APIs +-------> !interf!+ ! API !+ <- CAIF Client APIs
! +------+ +------! +------+ ! +------+ +------!
! ! ! ! ! ! !
! +----------!----------+ ! +-----------+
! +------+ <- CAIF Protocol Implementation ! !
+-------> ! CAIF ! ! +------+ <- CAIF Core Protocol
! Core ! ! ! CAIF !
+------+ ! ! Core !
+--------!--------+ ! +------+
! ! ! +----------!---------+
+------+ +-----+ ! ! ! !
! ! ! TTY ! <- Link Layer (Net Devices) ! +------+ +-----+ +------+
+------+ +-----+ +--> ! HSI ! ! TTY ! ! USB ! <- Link Layer (Net Devices)
+------+ +-----+ +------+
Using the Kernel API
----------------------
The Kernel API is used for accessing CAIF channels from the
kernel.
The user of the API has to implement two callbacks for receive
and control.
The receive callback gives a CAIF packet as a SKB. The control
callback will
notify of channel initialization complete, and flow-on/flow-
off.
struct caif_device caif_dev = {
.caif_config = {
.name = "MYDEV"
.type = CAIF_CHTY_AT
}
.receive_cb = my_receive,
.control_cb = my_control,
};
caif_add_device(&caif_dev);
caif_transmit(&caif_dev, skb);
See the caif_kernel.h for details about the CAIF kernel API.
I M P L E M E N T A T I O N I M P L E M E N T A T I O N
=========================== ===========================
===========================
CAIF Core Protocol Layer CAIF Core Protocol Layer
========================================= =========================================
...@@ -88,17 +64,13 @@ The Core CAIF implementation contains: ...@@ -88,17 +64,13 @@ The Core CAIF implementation contains:
- Simple implementation of CAIF. - Simple implementation of CAIF.
- Layered architecture (a la Streams), each layer in the CAIF - Layered architecture (a la Streams), each layer in the CAIF
specification is implemented in a separate c-file. specification is implemented in a separate c-file.
- Clients must implement PHY layer to access physical HW
with receive and transmit functions.
- Clients must call configuration function to add PHY layer. - Clients must call configuration function to add PHY layer.
- Clients must implement CAIF layer to consume/produce - Clients must implement CAIF layer to consume/produce
CAIF payload with receive and transmit functions. CAIF payload with receive and transmit functions.
- Clients must call configuration function to add and connect the - Clients must call configuration function to add and connect the
Client layer. Client layer.
- When receiving / transmitting CAIF Packets (cfpkt), ownership is passed - When receiving / transmitting CAIF Packets (cfpkt), ownership is passed
to the called function (except for framing layers' receive functions to the called function (except for framing layers' receive function)
or if a transmit function returns an error, in which case the caller
must free the packet).
Layered Architecture Layered Architecture
-------------------- --------------------
...@@ -109,11 +81,6 @@ Implementation. The support functions include: ...@@ -109,11 +81,6 @@ Implementation. The support functions include:
CAIF Packet has functions for creating, destroying and adding content CAIF Packet has functions for creating, destroying and adding content
and for adding/extracting header and trailers to protocol packets. and for adding/extracting header and trailers to protocol packets.
- CFLST CAIF list implementation.
- CFGLUE CAIF Glue. Contains OS Specifics, such as memory
allocation, endianness, etc.
The CAIF Protocol implementation contains: The CAIF Protocol implementation contains:
- CFCNFG CAIF Configuration layer. Configures the CAIF Protocol - CFCNFG CAIF Configuration layer. Configures the CAIF Protocol
...@@ -128,7 +95,7 @@ The CAIF Protocol implementation contains: ...@@ -128,7 +95,7 @@ The CAIF Protocol implementation contains:
control and remote shutdown requests. control and remote shutdown requests.
- CFVEI CAIF VEI layer. Handles CAIF AT Channels on VEI (Virtual - CFVEI CAIF VEI layer. Handles CAIF AT Channels on VEI (Virtual
External Interface). This layer encodes/decodes VEI frames. External Interface). This layer encodes/decodes VEI frames.
- CFDGML CAIF Datagram layer. Handles CAIF Datagram layer (IP - CFDGML CAIF Datagram layer. Handles CAIF Datagram layer (IP
traffic), encodes/decodes Datagram frames. traffic), encodes/decodes Datagram frames.
...@@ -170,7 +137,7 @@ The CAIF Protocol implementation contains: ...@@ -170,7 +137,7 @@ The CAIF Protocol implementation contains:
+---------+ +---------+ +---------+ +---------+
! ! ! !
+---------+ +---------+ +---------+ +---------+
| | | Serial | | | | Serial |
| | | CFSERL | | | | CFSERL |
+---------+ +---------+ +---------+ +---------+
...@@ -186,24 +153,20 @@ In this layered approach the following "rules" apply. ...@@ -186,24 +153,20 @@ In this layered approach the following "rules" apply.
layer->dn->transmit(layer->dn, packet); layer->dn->transmit(layer->dn, packet);
Linux Driver Implementation CAIF Socket and IP interface
=========================== ===========================
Linux GPRS Net Device and CAIF socket are implemented on top of the The IP interface and CAIF socket API are implemented on top of the
CAIF Core protocol. The Net device and CAIF socket have an instance of CAIF Core protocol. The IP Interface and CAIF socket have an instance of
'struct cflayer', just like the CAIF Core protocol stack. 'struct cflayer', just like the CAIF Core protocol stack.
Net device and Socket implement the 'receive()' function defined by Net device and Socket implement the 'receive()' function defined by
'struct cflayer', just like the rest of the CAIF stack. In this way, transmit and 'struct cflayer', just like the rest of the CAIF stack. In this way, transmit and
receive of packets is handled as by the rest of the layers: the 'dn->transmit()' receive of packets is handled as by the rest of the layers: the 'dn->transmit()'
function is called in order to transmit data. function is called in order to transmit data.
The layer on top of the CAIF Core implementation is
sometimes referred to as the "Client layer".
Configuration of Link Layer Configuration of Link Layer
--------------------------- ---------------------------
The Link Layer is implemented as Linux net devices (struct net_device). The Link Layer is implemented as Linux network devices (struct net_device).
Payload handling and registration is done using standard Linux mechanisms. Payload handling and registration is done using standard Linux mechanisms.
The CAIF Protocol relies on a loss-less link layer without implementing The CAIF Protocol relies on a loss-less link layer without implementing
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment