diff options
author | Rémi Denis-Courmont <remi.denis-courmont@nokia.com> | 2011-03-08 22:44:12 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-09 11:59:33 -0800 |
commit | 297edb6003268c1d60da8c21eb76bf39b6428213 (patch) | |
tree | b17c7544eed3430ed89a56e54a3de14fe9755c3c /Documentation/networking/phonet.txt | |
parent | acaf7df610ff3faf1778ce40d601fc3dd4a41b40 (diff) | |
download | linux-297edb6003268c1d60da8c21eb76bf39b6428213.tar.bz2 |
Phonet: support active connection without pipe controller on modem
This provides support for newer ISI modems with no need for the
earlier experimental compile-time alternative choice. With this,
we can now use the same kernel and userspace with both types of
modems.
This also avoids confusing two different and incompatible state
machines, actively connected vs accepted sockets, and adds
connection response error handling (processing "SYN/RST" of sorts).
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/networking/phonet.txt')
-rw-r--r-- | Documentation/networking/phonet.txt | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/Documentation/networking/phonet.txt b/Documentation/networking/phonet.txt index cacac968c1c3..3d127791cb06 100644 --- a/Documentation/networking/phonet.txt +++ b/Documentation/networking/phonet.txt @@ -154,9 +154,28 @@ connections, one per accept()'d socket. write(cfd, msg, msglen); } -Connections are established between two endpoints by a "third party" -application. This means that both endpoints are passive; so connect() -is not possible. +Connections are traditionally established between two endpoints by a +"third party" application. This means that both endpoints are passive. + + +As of Linux kernel version 2.6.39, it is also possible to connect +two endpoints directly, using connect() on the active side. This is +intended to support the newer Nokia Wireless Modem API, as found in +e.g. the Nokia Slim Modem in the ST-Ericsson U8500 platform: + + struct sockaddr_spn spn; + int fd; + + fd = socket(PF_PHONET, SOCK_SEQPACKET, PN_PROTO_PIPE); + memset(&spn, 0, sizeof(spn)); + spn.spn_family = AF_PHONET; + spn.spn_obj = ...; + spn.spn_dev = ...; + spn.spn_resource = 0xD9; + connect(fd, (struct sockaddr *)&spn, sizeof(spn)); + /* normal I/O here ... */ + close(fd); + WARNING: When polling a connected pipe socket for writability, there is an @@ -189,17 +208,8 @@ The pipe protocol provides two socket options at the SOL_PNPIPE level: Phonet Pipe-controller Implementation ------------------------------------- -Phonet Pipe-controller is enabled by selecting the CONFIG_PHONET_PIPECTRLR Kconfig -option. It is useful when communicating with those Nokia Modems which do not -implement Pipe controller in them e.g. Nokia Slim Modem used in ST-Ericsson -U8500 platform. - -The implementation is based on the Data Connection Establishment Sequence -depicted in 'Nokia Wireless Modem API - Wireless_modem_user_guide.pdf' -document. - -It allows a phonet sequenced socket (host-pep) to initiate a Pipe connection -between itself and a remote pipe-end point (e.g. modem). +Phonet Pipe-controller is enabled by selecting the CONFIG_PHONET_PIPECTRLR +Kconfig option. The implementation adds socket options at SOL_PNPIPE level: @@ -207,21 +217,6 @@ The implementation adds socket options at SOL_PNPIPE level: is disabled. If the value is non-zero, the pipe is enabled. If the pipe is not (yet) connected, ENOTCONN is error is returned. -The implementation also adds socket 'connect'. On calling the 'connect', pipe -will be created between the source socket and the destination, and the pipe -state will be set to PIPE_DISABLED. - -After a pipe has been created and enabled successfully, the Pipe data can be -exchanged between the host-pep and remote-pep (modem). - -User-space would typically follow below sequence with Pipe controller:- --socket --bind --setsockopt for PNPIPE_PIPE_HANDLE --connect --setsockopt for PNPIPE_ENCAP_IP --setsockopt for PNPIPE_ENABLE - Authors ------- |