diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /Documentation/networking/phonet.txt | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'Documentation/networking/phonet.txt')
-rw-r--r-- | Documentation/networking/phonet.txt | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/Documentation/networking/phonet.txt b/Documentation/networking/phonet.txt index 6e8ce09f9c73..81003581f47a 100644 --- a/Documentation/networking/phonet.txt +++ b/Documentation/networking/phonet.txt | |||
@@ -112,6 +112,22 @@ However, connect() and getpeername() are not supported, as they did | |||
112 | not seem useful with Phonet usages (could be added easily). | 112 | not seem useful with Phonet usages (could be added easily). |
113 | 113 | ||
114 | 114 | ||
115 | Resource subscription | ||
116 | --------------------- | ||
117 | |||
118 | A Phonet datagram socket can be subscribed to any number of 8-bits | ||
119 | Phonet resources, as follow: | ||
120 | |||
121 | uint32_t res = 0xXX; | ||
122 | ioctl(fd, SIOCPNADDRESOURCE, &res); | ||
123 | |||
124 | Subscription is similarly cancelled using the SIOCPNDELRESOURCE I/O | ||
125 | control request, or when the socket is closed. | ||
126 | |||
127 | Note that no more than one socket can be subcribed to any given | ||
128 | resource at a time. If not, ioctl() will return EBUSY. | ||
129 | |||
130 | |||
115 | Phonet Pipe protocol | 131 | Phonet Pipe protocol |
116 | -------------------- | 132 | -------------------- |
117 | 133 | ||
@@ -138,9 +154,28 @@ connections, one per accept()'d socket. | |||
138 | write(cfd, msg, msglen); | 154 | write(cfd, msg, msglen); |
139 | } | 155 | } |
140 | 156 | ||
141 | Connections are established between two endpoints by a "third party" | 157 | Connections are traditionally established between two endpoints by a |
142 | application. This means that both endpoints are passive; so connect() | 158 | "third party" application. This means that both endpoints are passive. |
143 | 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 | |||
144 | 179 | ||
145 | WARNING: | 180 | WARNING: |
146 | When polling a connected pipe socket for writability, there is an | 181 | When polling a connected pipe socket for writability, there is an |
@@ -165,6 +200,10 @@ The pipe protocol provides two socket options at the SOL_PNPIPE level: | |||
165 | interface index of the network interface created by PNPIPE_ENCAP, | 200 | interface index of the network interface created by PNPIPE_ENCAP, |
166 | or zero if encapsulation is off. | 201 | or zero if encapsulation is off. |
167 | 202 | ||
203 | PNPIPE_HANDLE is a read-only integer value. It contains the underlying | ||
204 | identifier ("pipe handle") of the pipe. This is only defined for | ||
205 | socket descriptors that are already connected or being connected. | ||
206 | |||
168 | 207 | ||
169 | Authors | 208 | Authors |
170 | ------- | 209 | ------- |