diff options
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. | |||
154 | write(cfd, msg, msglen); | 154 | write(cfd, msg, msglen); |
155 | } | 155 | } |
156 | 156 | ||
157 | Connections are established between two endpoints by a "third party" | 157 | Connections are traditionally established between two endpoints by a |
158 | application. This means that both endpoints are passive; so connect() | 158 | "third party" application. This means that both endpoints are passive. |
159 | is not possible. | 159 | |
160 | |||
161 | As of Linux kernel version 2.6.39, it is also possible to connect | ||
162 | two endpoints directly, using connect() on the active side. This is | ||
163 | intended to support the newer Nokia Wireless Modem API, as found in | ||
164 | e.g. the Nokia Slim Modem in the ST-Ericsson U8500 platform: | ||
165 | |||
166 | struct sockaddr_spn spn; | ||
167 | int fd; | ||
168 | |||
169 | fd = socket(PF_PHONET, SOCK_SEQPACKET, PN_PROTO_PIPE); | ||
170 | memset(&spn, 0, sizeof(spn)); | ||
171 | spn.spn_family = AF_PHONET; | ||
172 | spn.spn_obj = ...; | ||
173 | spn.spn_dev = ...; | ||
174 | spn.spn_resource = 0xD9; | ||
175 | connect(fd, (struct sockaddr *)&spn, sizeof(spn)); | ||
176 | /* normal I/O here ... */ | ||
177 | close(fd); | ||
178 | |||
160 | 179 | ||
161 | WARNING: | 180 | WARNING: |
162 | When polling a connected pipe socket for writability, there is an | 181 | 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: | |||
189 | Phonet Pipe-controller Implementation | 208 | Phonet Pipe-controller Implementation |
190 | ------------------------------------- | 209 | ------------------------------------- |
191 | 210 | ||
192 | Phonet Pipe-controller is enabled by selecting the CONFIG_PHONET_PIPECTRLR Kconfig | 211 | Phonet Pipe-controller is enabled by selecting the CONFIG_PHONET_PIPECTRLR |
193 | option. It is useful when communicating with those Nokia Modems which do not | 212 | Kconfig option. |
194 | implement Pipe controller in them e.g. Nokia Slim Modem used in ST-Ericsson | ||
195 | U8500 platform. | ||
196 | |||
197 | The implementation is based on the Data Connection Establishment Sequence | ||
198 | depicted in 'Nokia Wireless Modem API - Wireless_modem_user_guide.pdf' | ||
199 | document. | ||
200 | |||
201 | It allows a phonet sequenced socket (host-pep) to initiate a Pipe connection | ||
202 | between itself and a remote pipe-end point (e.g. modem). | ||
203 | 213 | ||
204 | The implementation adds socket options at SOL_PNPIPE level: | 214 | The implementation adds socket options at SOL_PNPIPE level: |
205 | 215 | ||
@@ -207,21 +217,6 @@ The implementation adds socket options at SOL_PNPIPE level: | |||
207 | is disabled. If the value is non-zero, the pipe is enabled. If the pipe | 217 | is disabled. If the value is non-zero, the pipe is enabled. If the pipe |
208 | is not (yet) connected, ENOTCONN is error is returned. | 218 | is not (yet) connected, ENOTCONN is error is returned. |
209 | 219 | ||
210 | The implementation also adds socket 'connect'. On calling the 'connect', pipe | ||
211 | will be created between the source socket and the destination, and the pipe | ||
212 | state will be set to PIPE_DISABLED. | ||
213 | |||
214 | After a pipe has been created and enabled successfully, the Pipe data can be | ||
215 | exchanged between the host-pep and remote-pep (modem). | ||
216 | |||
217 | User-space would typically follow below sequence with Pipe controller:- | ||
218 | -socket | ||
219 | -bind | ||
220 | -setsockopt for PNPIPE_PIPE_HANDLE | ||
221 | -connect | ||
222 | -setsockopt for PNPIPE_ENCAP_IP | ||
223 | -setsockopt for PNPIPE_ENABLE | ||
224 | |||
225 | 220 | ||
226 | Authors | 221 | Authors |
227 | ------- | 222 | ------- |