diff options
author | Andre Eisenbach <andre@broadcom.com> | 2012-09-18 01:35:44 -0700 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2012-09-18 16:26:28 -0700 |
commit | 6ef101187774e30ddba6b46bbedef549a42196ad (patch) | |
tree | f36eb347f03083671640fbc750171e3b951e0082 /stack/pan | |
parent | f80d3d045eab5f002be4b5e8a3d2d376fdf7581a (diff) | |
download | external_bluetooth_bluedroid-6ef101187774e30ddba6b46bbedef549a42196ad.zip external_bluetooth_bluedroid-6ef101187774e30ddba6b46bbedef549a42196ad.tar.gz external_bluetooth_bluedroid-6ef101187774e30ddba6b46bbedef549a42196ad.tar.bz2 |
Initual Bluetooth open source release
First release under Apache source license with updated header files
and whitespace cleanups. Also fixed file permission to remove executable
bit from source files.
Change-Id: I7155903edfc2f491c1cbbd0db108f207852caaa0
Diffstat (limited to 'stack/pan')
-rw-r--r-- | stack/pan/pan_api.c | 59 | ||||
-rw-r--r-- | stack/pan/pan_int.h | 35 | ||||
-rw-r--r-- | stack/pan/pan_main.c | 39 | ||||
-rw-r--r-- | stack/pan/pan_utils.c | 69 |
4 files changed, 127 insertions, 75 deletions
diff --git a/stack/pan/pan_api.c b/stack/pan/pan_api.c index 3cc6dec..6aa24b9 100644 --- a/stack/pan/pan_api.c +++ b/stack/pan/pan_api.c @@ -1,14 +1,27 @@ -/****************************************************************************/ -/* */ -/* Name: pan_api.c */ -/* */ -/* Function: this file contains main functions to support PAN profile */ -/* commands and events. */ -/* */ -/* Copyright (c) 1999-2011, Broadcom Corp., All Rights Reserved. */ -/* Broadcom Bluetooth Core. Proprietary and confidential. */ -/* */ -/****************************************************************************/ +/****************************************************************************** + * + * Copyright (C) 1999-2012 Broadcom Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ + +/***************************************************************************** + * + * This file contains main functions to support PAN profile + * commands and events. + * + *****************************************************************************/ #include <string.h> #include "gki.h" @@ -32,7 +45,7 @@ ** should set the PAN role explicitly. ** ** Parameters: p_register - contains all callback function pointers -** +** ** ** Returns none ** @@ -70,7 +83,7 @@ void PAN_Register (tPAN_REGISTER *p_register) ** and close all active connections ** ** Parameters: none -** +** ** ** Returns none ** @@ -112,7 +125,7 @@ void PAN_Deregister (void) ** p_gn_name - Service name for GN role ** p_nap_name - Service name for NAP role ** Can be NULL if user wants it to be default -** +** ** Returns PAN_SUCCESS - if the role is set successfully ** PAN_FAILURE - if the role is not valid ** @@ -261,7 +274,7 @@ tPAN_RESULT PAN_SetRole (UINT8 role, ** ** Function PAN_Connect ** -** Description This function is called by the application to initiate a +** Description This function is called by the application to initiate a ** connection to the remote device ** ** Parameters: rem_bda - BD Addr of the remote device @@ -271,7 +284,7 @@ tPAN_RESULT PAN_SetRole (UINT8 role, ** PAN_ROLE_GN_SERVER is for GN role ** PAN_ROLE_NAP_SERVER is for NAP role ** *handle - Pointer for returning Handle to the connection -** +** ** Returns PAN_SUCCESS - if the connection is initiated successfully ** PAN_NO_RESOURCES - resources are not sufficent ** PAN_FAILURE - if the connection cannot be initiated @@ -429,10 +442,10 @@ tPAN_RESULT PAN_Connect (BD_ADDR rem_bda, UINT8 src_role, UINT8 dst_role, UINT16 ** ** Function PAN_Disconnect ** -** Description This is used to disconnect the connection +** Description This is used to disconnect the connection ** ** Parameters: handle - handle for the connection -** +** ** Returns PAN_SUCCESS - if the connection is closed successfully ** PAN_FAILURE - if the connection is not found or ** there is an error in disconnecting @@ -489,7 +502,7 @@ tPAN_RESULT PAN_Disconnect (UINT16 handle) ** p_data - pointer to the data ** len - length of the data ** ext - to indicate that extension headers present -** +** ** Returns PAN_SUCCESS - if the data is sent successfully ** PAN_FAILURE - if the connection is not found or ** there is an error in sending data @@ -598,7 +611,7 @@ tPAN_RESULT PAN_Write (UINT16 handle, BD_ADDR dst, BD_ADDR src, UINT16 protocol, ** protocol - protocol of the ethernet packet like IP or ARP ** p_buf - pointer to the data buffer ** ext - to indicate that extension headers present -** +** ** Returns PAN_SUCCESS - if the data is sent successfully ** PAN_FAILURE - if the connection is not found or ** there is an error in sending data @@ -707,7 +720,7 @@ tPAN_RESULT PAN_WriteBuf (UINT16 handle, BD_ADDR dst, BD_ADDR src, UINT16 protoc ** num_filters - number of protocol filter ranges ** start - array of starting protocol numbers ** end - array of ending protocol numbers -** +** ** ** Returns PAN_SUCCESS if protocol filters are set successfully ** PAN_FAILURE if connection not found or error in setting @@ -756,7 +769,7 @@ tPAN_RESULT PAN_SetProtocolFilters (UINT16 handle, ** num_filters - number of multicast filter ranges ** start - array of starting multicast filter addresses ** end - array of ending multicast filter addresses -** +** ** ** Returns PAN_SUCCESS if multicast filters are set successfully ** PAN_FAILURE if connection not found or error in setting @@ -822,7 +835,7 @@ UINT8 PAN_SetTraceLevel (UINT8 new_level) ** Description This function initializes the PAN module variables ** ** Parameters: none -** +** ** Returns none ** *******************************************************************************/ diff --git a/stack/pan/pan_int.h b/stack/pan/pan_int.h index 3c24d08..4e02236 100644 --- a/stack/pan/pan_int.h +++ b/stack/pan/pan_int.h @@ -1,14 +1,27 @@ -/****************************************************************************/ -/* */ -/* Name: pan_int.h */ -/* */ -/* Function this file contains internally used PAN definitions */ -/* */ -/* */ -/* Copyright (c) 2001-2004, WIDCOMM Inc., All Rights Reserved. */ -/* WIDCOMM Bluetooth Core. Proprietary and confidential. */ -/* */ -/****************************************************************************/ +/****************************************************************************** + * + * Copyright (C) 2001-2012 Broadcom Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ + +/****************************************************************************** + * + * This file contains internally used PAN definitions + * + ******************************************************************************/ + #ifndef PAN_INT_H #define PAN_INT_H diff --git a/stack/pan/pan_main.c b/stack/pan/pan_main.c index 36d7a8c..6cbe1ce 100644 --- a/stack/pan/pan_main.c +++ b/stack/pan/pan_main.c @@ -1,14 +1,27 @@ -/****************************************************************************/ -/* */ -/* Name: pan_main.c */ -/* */ -/* Function: this file contains main functions to support PAN profile */ -/* commands and events. */ -/* */ -/* Copyright (c) 1999-2004, WIDCOMM Inc., All Rights Reserved. */ -/* WIDCOMM Bluetooth Core. Proprietary and confidential. */ -/* */ -/****************************************************************************/ +/****************************************************************************** + * + * Copyright (C) 1999-2012 Broadcom Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ + +/****************************************************************************** + * + * This file contains main functions to support PAN profile + * commands and events. + * + ******************************************************************************/ #include <string.h> #include "gki.h" @@ -37,7 +50,7 @@ UINT8 constant_pan_uuid[UUID_CONSTANT_PART] = {0, 0, 0x10, 0, 0x80, 0x00, 0x00, ** Description This function registers PAN profile with BNEP ** ** Parameters: none -** +** ** Returns none ** *******************************************************************************/ @@ -73,7 +86,7 @@ void pan_register_with_bnep (void) ** remote_uuid - UUID of the source role (peer device role) ** local_uuid - UUID of the destination role (local device role) ** is_role_change - Flag to indicate that it is a role change -** +** ** Returns none ** *******************************************************************************/ diff --git a/stack/pan/pan_utils.c b/stack/pan/pan_utils.c index 33cd151..9ebbb75 100644 --- a/stack/pan/pan_utils.c +++ b/stack/pan/pan_utils.c @@ -1,14 +1,27 @@ -/****************************************************************************/ -/* */ -/* Name: pan_utils.c */ -/* */ -/* Function: this file contains main functions to support PAN profile */ -/* commands and events. */ -/* */ -/* Copyright (c) 1999-2004, WIDCOMM Inc., All Rights Reserved. */ -/* WIDCOMM Bluetooth Core. Proprietary and confidential. */ -/* */ -/****************************************************************************/ +/****************************************************************************** + * + * Copyright (C) 1999-2012 Broadcom Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ + +/***************************************************************************** + * + * This file contains main functions to support PAN profile + * commands and events. + * + *****************************************************************************/ #include <string.h> #include <stdio.h> @@ -40,9 +53,9 @@ static const UINT8 pan_proto_elem_data[] = { ** ** Function pan_register_with_sdp ** -** Description +** Description ** -** Returns +** Returns ** *******************************************************************************/ UINT32 pan_register_with_sdp (UINT16 uuid, UINT8 sec_mask, char *p_name, char *p_desc) @@ -73,7 +86,7 @@ UINT32 pan_register_with_sdp (UINT16 uuid, UINT8 sec_mask, char *p_name, char *p #if 0 availability = 0xFF; SDP_AddAttribute (sdp_handle, ATTR_ID_SERVICE_AVAILABILITY, UINT_DESC_TYPE, 1, &availability); -#endif +#endif // btla-specific -- /* Language base */ @@ -91,7 +104,7 @@ UINT32 pan_register_with_sdp (UINT16 uuid, UINT8 sec_mask, char *p_name, char *p (UINT8) (strlen(p_desc) + 1), (UINT8 *)p_desc); /* Security description */ - if (sec_mask) + if (sec_mask) { UINT16_TO_BE_FIELD(&security, 0x0001); } @@ -115,9 +128,9 @@ UINT32 pan_register_with_sdp (UINT16 uuid, UINT8 sec_mask, char *p_name, char *p SDP_AddAttribute (sdp_handle, ATTR_ID_MAX_NET_ACCESS_RATE, UINT_DESC_TYPE, 4, array); /* Register with Security Manager for the specific security level */ - if ((!BTM_SetSecurityLevel (TRUE, p_name, BTM_SEC_SERVICE_BNEP_NAP, + if ((!BTM_SetSecurityLevel (TRUE, p_name, BTM_SEC_SERVICE_BNEP_NAP, sec_mask, BT_PSM_BNEP, BTM_SEC_PROTO_BNEP, UUID_SERVCLASS_NAP)) - || (!BTM_SetSecurityLevel (FALSE, p_name, BTM_SEC_SERVICE_BNEP_NAP, + || (!BTM_SetSecurityLevel (FALSE, p_name, BTM_SEC_SERVICE_BNEP_NAP, sec_mask, BT_PSM_BNEP, BTM_SEC_PROTO_BNEP, UUID_SERVCLASS_NAP))) { PAN_TRACE_ERROR0 ("PAN Security Registration failed for PANU"); @@ -127,9 +140,9 @@ UINT32 pan_register_with_sdp (UINT16 uuid, UINT8 sec_mask, char *p_name, char *p #if (defined (PAN_SUPPORTS_ROLE_GN) && PAN_SUPPORTS_ROLE_GN == TRUE) if (uuid == UUID_SERVCLASS_GN) { - if ((!BTM_SetSecurityLevel (TRUE, p_name, BTM_SEC_SERVICE_BNEP_GN, + if ((!BTM_SetSecurityLevel (TRUE, p_name, BTM_SEC_SERVICE_BNEP_GN, sec_mask, BT_PSM_BNEP, BTM_SEC_PROTO_BNEP, UUID_SERVCLASS_GN)) - || (!BTM_SetSecurityLevel (FALSE, p_name, BTM_SEC_SERVICE_BNEP_GN, + || (!BTM_SetSecurityLevel (FALSE, p_name, BTM_SEC_SERVICE_BNEP_GN, sec_mask, BT_PSM_BNEP, BTM_SEC_PROTO_BNEP, UUID_SERVCLASS_GN))) { PAN_TRACE_ERROR0 ("PAN Security Registration failed for GN"); @@ -139,9 +152,9 @@ UINT32 pan_register_with_sdp (UINT16 uuid, UINT8 sec_mask, char *p_name, char *p #if (defined (PAN_SUPPORTS_ROLE_PANU) && PAN_SUPPORTS_ROLE_PANU == TRUE) if (uuid == UUID_SERVCLASS_PANU) { - if ((!BTM_SetSecurityLevel (TRUE, p_name, BTM_SEC_SERVICE_BNEP_PANU, + if ((!BTM_SetSecurityLevel (TRUE, p_name, BTM_SEC_SERVICE_BNEP_PANU, sec_mask, BT_PSM_BNEP, BTM_SEC_PROTO_BNEP, UUID_SERVCLASS_PANU)) - || (!BTM_SetSecurityLevel (FALSE, p_name, BTM_SEC_SERVICE_BNEP_PANU, + || (!BTM_SetSecurityLevel (FALSE, p_name, BTM_SEC_SERVICE_BNEP_PANU, sec_mask, BT_PSM_BNEP, BTM_SEC_PROTO_BNEP, UUID_SERVCLASS_PANU))) { PAN_TRACE_ERROR0 ("PAN Security Registration failed for PANU"); @@ -162,9 +175,9 @@ UINT32 pan_register_with_sdp (UINT16 uuid, UINT8 sec_mask, char *p_name, char *p ** ** Function pan_allocate_pcb ** -** Description +** Description ** -** Returns +** Returns ** *******************************************************************************/ tPAN_CONN *pan_allocate_pcb (BD_ADDR p_bda, UINT16 handle) @@ -203,9 +216,9 @@ tPAN_CONN *pan_allocate_pcb (BD_ADDR p_bda, UINT16 handle) ** ** Function pan_get_pcb_by_handle ** -** Description +** Description ** -** Returns +** Returns ** *******************************************************************************/ tPAN_CONN *pan_get_pcb_by_handle (UINT16 handle) @@ -227,9 +240,9 @@ tPAN_CONN *pan_get_pcb_by_handle (UINT16 handle) ** ** Function pan_get_pcb_by_addr ** -** Description +** Description ** -** Returns +** Returns ** *******************************************************************************/ tPAN_CONN *pan_get_pcb_by_addr (BD_ADDR p_bda) @@ -261,7 +274,7 @@ tPAN_CONN *pan_get_pcb_by_addr (BD_ADDR p_bda) ** ** Function pan_close_all_connections ** -** Description +** Description ** ** Returns void ** |