Lines Matching refs:l2sock
72 int32_t unsock, l2sock;
122 l2sock = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BLUETOOTH_PROTO_L2CAP);
123 if (l2sock < 0) {
131 if (getsockopt(l2sock, SOL_L2CAP, SO_L2CAP_IMTU, &imtu, &size) < 0) {
135 close(l2sock);
145 if (bind(l2sock, (struct sockaddr *) &l2, sizeof(l2)) < 0) {
149 close(l2sock);
153 if (listen(l2sock, 10) < 0) {
157 close(l2sock);
167 close(l2sock);
177 close(l2sock);
187 close(l2sock);
197 srv->maxfd = (unsock > l2sock)? unsock : l2sock;
210 FD_SET(l2sock, &srv->fdset);
211 srv->fdidx[l2sock].valid = 1;
212 srv->fdidx[l2sock].server = 1;
213 srv->fdidx[l2sock].control = 0;
214 srv->fdidx[l2sock].priv = 0;
215 srv->fdidx[l2sock].rsp_cs = 0;
216 srv->fdidx[l2sock].rsp_size = 0;
217 srv->fdidx[l2sock].rsp_limit = 0;
218 srv->fdidx[l2sock].omtu = 0; /* unknown */
219 srv->fdidx[l2sock].rsp = NULL;