ng_btsocket_hci_raw.c (121054) | ng_btsocket_hci_raw.c (123812) |
---|---|
1/* 2 * ng_btsocket_hci_raw.c 3 * 4 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 12 unchanged lines hidden (view full) --- 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * $Id: ng_btsocket_hci_raw.c,v 1.14 2003/09/14 23:29:06 max Exp $ | 1/* 2 * ng_btsocket_hci_raw.c 3 * 4 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 12 unchanged lines hidden (view full) --- 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * $Id: ng_btsocket_hci_raw.c,v 1.14 2003/09/14 23:29:06 max Exp $ |
29 * $FreeBSD: head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c 121054 2003-10-12 22:04:24Z emax $ | 29 * $FreeBSD: head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c 123812 2003-12-24 18:51:01Z alfred $ |
30 */ 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/bitstring.h> 35#include <sys/domain.h> 36#include <sys/endian.h> 37#include <sys/errno.h> --- 347 unchanged lines hidden (view full) --- 385 386 NG_MKMESSAGE(msg, NGM_HCI_COOKIE, cmd, arglen, M_NOWAIT); 387 if (msg == NULL) 388 return (ENOMEM); 389 390 if (arg != NULL && arglen > 0) 391 bcopy(arg, msg->data, arglen); 392 | 30 */ 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/bitstring.h> 35#include <sys/domain.h> 36#include <sys/endian.h> 37#include <sys/errno.h> --- 347 unchanged lines hidden (view full) --- 385 386 NG_MKMESSAGE(msg, NGM_HCI_COOKIE, cmd, arglen, M_NOWAIT); 387 if (msg == NULL) 388 return (ENOMEM); 389 390 if (arg != NULL && arglen > 0) 391 bcopy(arg, msg->data, arglen); 392 |
393 NG_SEND_MSG_PATH(error, ng_btsocket_hci_raw_node, msg, path, NULL); | 393 NG_SEND_MSG_PATH(error, ng_btsocket_hci_raw_node, msg, path, 0); |
394 395 return (error); 396} /* ng_btsocket_hci_raw_send_ngmsg */ 397 398/* 399 * Send Netgraph message to the node (no data) and wait for reply 400 */ 401 --- 9 unchanged lines hidden (view full) --- 411 NG_MKMESSAGE(msg, NGM_HCI_COOKIE, cmd, 0, M_NOWAIT); 412 if (msg == NULL) 413 return (ENOMEM); 414 415 ng_btsocket_hci_raw_get_token(&msg->header.token); 416 pcb->token = msg->header.token; 417 pcb->msg = NULL; 418 | 394 395 return (error); 396} /* ng_btsocket_hci_raw_send_ngmsg */ 397 398/* 399 * Send Netgraph message to the node (no data) and wait for reply 400 */ 401 --- 9 unchanged lines hidden (view full) --- 411 NG_MKMESSAGE(msg, NGM_HCI_COOKIE, cmd, 0, M_NOWAIT); 412 if (msg == NULL) 413 return (ENOMEM); 414 415 ng_btsocket_hci_raw_get_token(&msg->header.token); 416 pcb->token = msg->header.token; 417 pcb->msg = NULL; 418 |
419 NG_SEND_MSG_PATH(error, ng_btsocket_hci_raw_node, msg, path, NULL); | 419 NG_SEND_MSG_PATH(error, ng_btsocket_hci_raw_node, msg, path, 0); |
420 if (error != 0) { 421 pcb->token = 0; 422 return (error); 423 } 424 425 error = msleep(&pcb->msg, &pcb->pcb_mtx, PZERO|PCATCH, "hcictl", 426 ng_btsocket_hci_raw_ioctl_timeout * hz); 427 pcb->token = 0; --- 716 unchanged lines hidden (view full) --- 1144 if (msg == NULL) { 1145 error = ENOMEM; 1146 break; 1147 } 1148 ng_btsocket_hci_raw_get_token(&msg->header.token); 1149 pcb->token = msg->header.token; 1150 pcb->msg = NULL; 1151 | 420 if (error != 0) { 421 pcb->token = 0; 422 return (error); 423 } 424 425 error = msleep(&pcb->msg, &pcb->pcb_mtx, PZERO|PCATCH, "hcictl", 426 ng_btsocket_hci_raw_ioctl_timeout * hz); 427 pcb->token = 0; --- 716 unchanged lines hidden (view full) --- 1144 if (msg == NULL) { 1145 error = ENOMEM; 1146 break; 1147 } 1148 ng_btsocket_hci_raw_get_token(&msg->header.token); 1149 pcb->token = msg->header.token; 1150 pcb->msg = NULL; 1151 |
1152 NG_SEND_MSG_PATH(error,ng_btsocket_hci_raw_node,msg,path,NULL); | 1152 NG_SEND_MSG_PATH(error, ng_btsocket_hci_raw_node, msg, path, 0); |
1153 if (error != 0) { 1154 pcb->token = 0; 1155 break; 1156 } 1157 1158 error = msleep(&pcb->msg, &pcb->pcb_mtx, 1159 PZERO|PCATCH, "hcictl", 1160 ng_btsocket_hci_raw_ioctl_timeout * hz); --- 39 unchanged lines hidden (view full) --- 1200 if (msg == NULL) { 1201 error = ENOMEM; 1202 break; 1203 } 1204 ng_btsocket_hci_raw_get_token(&msg->header.token); 1205 pcb->token = msg->header.token; 1206 pcb->msg = NULL; 1207 | 1153 if (error != 0) { 1154 pcb->token = 0; 1155 break; 1156 } 1157 1158 error = msleep(&pcb->msg, &pcb->pcb_mtx, 1159 PZERO|PCATCH, "hcictl", 1160 ng_btsocket_hci_raw_ioctl_timeout * hz); --- 39 unchanged lines hidden (view full) --- 1200 if (msg == NULL) { 1201 error = ENOMEM; 1202 break; 1203 } 1204 ng_btsocket_hci_raw_get_token(&msg->header.token); 1205 pcb->token = msg->header.token; 1206 pcb->msg = NULL; 1207 |
1208 NG_SEND_MSG_PATH(error,ng_btsocket_hci_raw_node,msg,path,NULL); | 1208 NG_SEND_MSG_PATH(error, ng_btsocket_hci_raw_node, msg, path, 0); |
1209 if (error != 0) { 1210 pcb->token = 0; 1211 break; 1212 } 1213 1214 error = msleep(&pcb->msg, &pcb->pcb_mtx, 1215 PZERO|PCATCH, "hcictl", 1216 ng_btsocket_hci_raw_ioctl_timeout * hz); --- 351 unchanged lines hidden --- | 1209 if (error != 0) { 1210 pcb->token = 0; 1211 break; 1212 } 1213 1214 error = msleep(&pcb->msg, &pcb->pcb_mtx, 1215 PZERO|PCATCH, "hcictl", 1216 ng_btsocket_hci_raw_ioctl_timeout * hz); --- 351 unchanged lines hidden --- |