nci_hmsgs.c revision 26620e3108f6a0f32f5f0a0725e28e5ae66017d6
1/***************************************************************************** 2** 3** Name: nci_hmsgs.c 4** 5** Description: This file contains function of the NCI unit to 6** format and send NCI commands (for DH). 7** 8** 9** Copyright (c) 2010-2012, Broadcom Corp., All Rights Reserved. 10** Broadcom Bluetooth Core. Proprietary and confidential. 11** 12******************************************************************************/ 13#include <string.h> 14#include "nfc_target.h" 15 16#if NFC_INCLUDED == TRUE 17#include "nci_defs.h" 18#include "nci_hmsgs.h" 19#include "nfc_api.h" 20#include "nfc_int.h" 21 22/******************************************************************************* 23** 24** Function nci_snd_core_reset 25** 26** Description compose and send CORE RESET command to command queue 27** 28** Returns status 29** 30*******************************************************************************/ 31UINT8 nci_snd_core_reset (UINT8 reset_type) 32{ 33 BT_HDR *p; 34 UINT8 *pp; 35 36 if ((p = NCI_GET_CMD_BUF(NCI_CORE_PARAM_SIZE_RESET)) == NULL) 37 return (NCI_STATUS_FAILED); 38 39 p->event = BT_EVT_TO_NFC_NCI; 40 p->len = NCI_MSG_HDR_SIZE + NCI_CORE_PARAM_SIZE_RESET; 41 p->offset = NCI_MSG_OFFSET_SIZE; 42 p->layer_specific = 0; 43 pp = (UINT8 *)(p + 1) + p->offset; 44 45 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_CORE); 46 NCI_MSG_BLD_HDR1(pp, NCI_MSG_CORE_RESET); 47 UINT8_TO_STREAM (pp, NCI_CORE_PARAM_SIZE_RESET); 48 UINT8_TO_STREAM (pp, reset_type); 49 50 nfc_ncif_send_cmd (p); 51 return (NCI_STATUS_OK); 52} 53 54/******************************************************************************* 55** 56** Function nci_snd_core_init 57** 58** Description compose and send CORE INIT command to command queue 59** 60** Returns status 61** 62*******************************************************************************/ 63UINT8 nci_snd_core_init (void) 64{ 65 BT_HDR *p; 66 UINT8 *pp; 67 68 if ((p = NCI_GET_CMD_BUF(NCI_CORE_PARAM_SIZE_INIT)) == NULL) 69 return (NCI_STATUS_FAILED); 70 71 p->event = BT_EVT_TO_NFC_NCI; 72 p->len = NCI_MSG_HDR_SIZE + NCI_CORE_PARAM_SIZE_INIT; 73 p->offset = NCI_MSG_OFFSET_SIZE; 74 p->layer_specific = 0; 75 pp = (UINT8 *)(p + 1) + p->offset; 76 77 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_CORE); 78 NCI_MSG_BLD_HDR1(pp, NCI_MSG_CORE_INIT); 79 UINT8_TO_STREAM (pp, NCI_CORE_PARAM_SIZE_INIT); 80 81 nfc_ncif_send_cmd (p); 82 return (NCI_STATUS_OK); 83} 84 85/******************************************************************************* 86** 87** Function nci_snd_core_get_config 88** 89** Description compose and send CORE GET_CONFIG command to command queue 90** 91** Returns status 92** 93*******************************************************************************/ 94UINT8 nci_snd_core_get_config (UINT8 *param_ids, UINT8 num_ids) 95{ 96 BT_HDR *p; 97 UINT8 *pp; 98 99 if ((p = NCI_GET_CMD_BUF(num_ids)) == NULL) 100 return (NCI_STATUS_FAILED); 101 102 p->event = BT_EVT_TO_NFC_NCI; 103 p->len = NCI_MSG_HDR_SIZE + num_ids + 1; 104 p->offset = NCI_MSG_OFFSET_SIZE; 105 p->layer_specific = 0; 106 pp = (UINT8 *)(p + 1) + p->offset; 107 108 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_CORE); 109 NCI_MSG_BLD_HDR1(pp, NCI_MSG_CORE_GET_CONFIG); 110 UINT8_TO_STREAM (pp, (UINT8)(num_ids + 1)); 111 UINT8_TO_STREAM (pp, num_ids); 112 ARRAY_TO_STREAM (pp, param_ids, num_ids); 113 114 nfc_ncif_send_cmd (p); 115 return (NCI_STATUS_OK); 116} 117 118/******************************************************************************* 119** 120** Function nci_snd_core_set_config 121** 122** Description compose and send CORE SET_CONFIG command to command queue 123** 124** Returns status 125** 126*******************************************************************************/ 127UINT8 nci_snd_core_set_config (UINT8 *p_param_tlvs, UINT8 tlv_size) 128{ 129 BT_HDR *p; 130 UINT8 *pp; 131 UINT8 num = 0, ulen, len, *pt; 132 133 if ((p = NCI_GET_CMD_BUF(tlv_size + 1)) == NULL) 134 return (NCI_STATUS_FAILED); 135 136 p->event = BT_EVT_TO_NFC_NCI; 137 p->len = NCI_MSG_HDR_SIZE + tlv_size + 1; 138 p->offset = NCI_MSG_OFFSET_SIZE; 139 pp = (UINT8 *)(p + 1) + p->offset; 140 141 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_CORE); 142 NCI_MSG_BLD_HDR1(pp, NCI_MSG_CORE_SET_CONFIG); 143 UINT8_TO_STREAM (pp, (UINT8)(tlv_size + 1)); 144 len = tlv_size; 145 pt = p_param_tlvs; 146 while (len > 1) 147 { 148 len -= 2; 149 pt++; 150 num++; 151 ulen = *pt++; 152 pt += ulen; 153 if (len >= ulen) 154 { 155 len -= ulen; 156 } 157 else 158 { 159 GKI_freebuf (p); 160 return NCI_STATUS_FAILED; 161 } 162 } 163 164 UINT8_TO_STREAM (pp, num); 165 ARRAY_TO_STREAM (pp, p_param_tlvs, tlv_size); 166 nfc_ncif_send_cmd (p); 167 168 return (NCI_STATUS_OK); 169} 170 171/******************************************************************************* 172** 173** Function nci_snd_core_conn_create 174** 175** Description compose and send CORE CONN_CREATE command to command queue 176** 177** Returns status 178** 179*******************************************************************************/ 180UINT8 nci_snd_core_conn_create (UINT8 dest_type, UINT8 num_tlv, UINT8 tlv_size, UINT8 *p_param_tlvs) 181{ 182 BT_HDR *p; 183 UINT8 *pp; 184 UINT8 size = NCI_CORE_PARAM_SIZE_CON_CREATE+tlv_size; 185 186 if ((p = NCI_GET_CMD_BUF(size)) == NULL) 187 return (NCI_STATUS_FAILED); 188 189 p->event = BT_EVT_TO_NFC_NCI; 190 p->len = NCI_MSG_HDR_SIZE + NCI_CORE_PARAM_SIZE_CON_CREATE; 191 p->offset = NCI_MSG_OFFSET_SIZE; 192 p->layer_specific = 0; 193 pp = (UINT8 *)(p + 1) + p->offset; 194 195 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_CORE); 196 NCI_MSG_BLD_HDR1(pp, NCI_MSG_CORE_CONN_CREATE); 197 UINT8_TO_STREAM (pp, size); 198 UINT8_TO_STREAM (pp, dest_type); 199 UINT8_TO_STREAM (pp, num_tlv); 200 if (tlv_size) 201 { 202 ARRAY_TO_STREAM (pp, p_param_tlvs, tlv_size); 203 p->len += tlv_size; 204 } 205 206 nfc_ncif_send_cmd (p); 207 return (NCI_STATUS_OK); 208} 209 210/******************************************************************************* 211** 212** Function nci_snd_core_conn_close 213** 214** Description compose and send CORE CONN_CLOSE command to command queue 215** 216** Returns status 217** 218*******************************************************************************/ 219UINT8 nci_snd_core_conn_close (UINT8 conn_id) 220{ 221 BT_HDR *p; 222 UINT8 *pp; 223 224 if ((p = NCI_GET_CMD_BUF(NCI_CORE_PARAM_SIZE_CON_CLOSE)) == NULL) 225 return (NCI_STATUS_FAILED); 226 227 p->event = BT_EVT_TO_NFC_NCI; 228 p->len = NCI_MSG_HDR_SIZE + NCI_CORE_PARAM_SIZE_CON_CLOSE; 229 p->offset = NCI_MSG_OFFSET_SIZE; 230 p->layer_specific = 0; 231 pp = (UINT8 *)(p + 1) + p->offset; 232 233 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_CORE); 234 NCI_MSG_BLD_HDR1(pp, NCI_MSG_CORE_CONN_CLOSE); 235 UINT8_TO_STREAM (pp, NCI_CORE_PARAM_SIZE_CON_CLOSE); 236 UINT8_TO_STREAM (pp, conn_id); 237 238 nfc_ncif_send_cmd (p); 239 return (NCI_STATUS_OK); 240} 241 242 243#if (NFC_NFCEE_INCLUDED == TRUE) 244#if (NFC_RW_ONLY == FALSE) 245/******************************************************************************* 246** 247** Function nci_snd_nfcee_discover 248** 249** Description compose and send NFCEE Management NFCEE_DISCOVER command 250** to command queue 251** 252** Returns status 253** 254*******************************************************************************/ 255UINT8 nci_snd_nfcee_discover (UINT8 discover_action) 256{ 257 BT_HDR *p; 258 UINT8 *pp; 259 260 if ((p = NCI_GET_CMD_BUF(NCI_PARAM_SIZE_DISCOVER_NFCEE)) == NULL) 261 return (NCI_STATUS_FAILED); 262 263 p->event = BT_EVT_TO_NFC_NCI; 264 p->len = NCI_MSG_HDR_SIZE + NCI_PARAM_SIZE_DISCOVER_NFCEE; 265 p->offset = NCI_MSG_OFFSET_SIZE; 266 p->layer_specific = 0; 267 pp = (UINT8 *)(p + 1) + p->offset; 268 269 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_EE_MANAGE); 270 NCI_MSG_BLD_HDR1(pp, NCI_MSG_NFCEE_DISCOVER); 271 UINT8_TO_STREAM (pp, NCI_PARAM_SIZE_DISCOVER_NFCEE); 272 UINT8_TO_STREAM (pp, discover_action); 273 274 nfc_ncif_send_cmd (p); 275 return (NCI_STATUS_OK); 276} 277 278/******************************************************************************* 279** 280** Function nci_snd_nfcee_mode_set 281** 282** Description compose and send NFCEE Management NFCEE MODE SET command 283** to command queue 284** 285** Returns status 286** 287*******************************************************************************/ 288UINT8 nci_snd_nfcee_mode_set (UINT8 nfcee_id, UINT8 nfcee_mode) 289{ 290 BT_HDR *p; 291 UINT8 *pp; 292 293 if ((p = NCI_GET_CMD_BUF(NCI_CORE_PARAM_SIZE_NFCEE_MODE_SET)) == NULL) 294 return (NCI_STATUS_FAILED); 295 296 p->event = BT_EVT_TO_NFC_NCI; 297 p->len = NCI_MSG_HDR_SIZE + NCI_CORE_PARAM_SIZE_NFCEE_MODE_SET; 298 p->offset = NCI_MSG_OFFSET_SIZE; 299 p->layer_specific = 0; 300 pp = (UINT8 *)(p + 1) + p->offset; 301 302 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_EE_MANAGE); 303 NCI_MSG_BLD_HDR1(pp, NCI_MSG_NFCEE_MODE_SET); 304 UINT8_TO_STREAM (pp, NCI_CORE_PARAM_SIZE_NFCEE_MODE_SET); 305 UINT8_TO_STREAM (pp, nfcee_id); 306 UINT8_TO_STREAM (pp, nfcee_mode); 307 308 nfc_ncif_send_cmd (p); 309 return (NCI_STATUS_OK); 310} 311#endif 312#endif 313 314/******************************************************************************* 315** 316** Function nci_snd_discover_cmd 317** 318** Description compose and send RF Management DISCOVER command to command queue 319** 320** Returns status 321** 322*******************************************************************************/ 323UINT8 nci_snd_discover_cmd (UINT8 num, tNCI_DISCOVER_PARAMS *p_param) 324{ 325 BT_HDR *p; 326 UINT8 *pp, *p_size, *p_start; 327 int xx; 328 int size; 329 330 size = num * sizeof(tNCI_DISCOVER_PARAMS) + 1; 331 if ((p = NCI_GET_CMD_BUF(size)) == NULL) 332 return (NCI_STATUS_FAILED); 333 334 p->event = BT_EVT_TO_NFC_NCI; 335 p->offset = NCI_MSG_OFFSET_SIZE; 336 p->layer_specific = 0; 337 pp = (UINT8 *)(p + 1) + p->offset; 338 339 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_RF_MANAGE); 340 NCI_MSG_BLD_HDR1(pp, NCI_MSG_RF_DISCOVER); 341 p_size = pp; 342 pp++; 343 p_start = pp; 344 UINT8_TO_STREAM (pp, num); 345 for (xx=0; xx<num; xx++) 346 { 347 UINT8_TO_STREAM (pp, p_param[xx].type); 348 UINT8_TO_STREAM (pp, p_param[xx].frequency); 349 } 350 *p_size = (UINT8)(pp - p_start); 351 p->len = NCI_MSG_HDR_SIZE + *p_size; 352 353 nfc_ncif_send_cmd (p); 354 return (NCI_STATUS_OK); 355} 356 357/******************************************************************************* 358** 359** Function nci_snd_discover_select_cmd 360** 361** Description compose and send RF Management DISCOVER SELECT command 362** to command queue 363** 364** Returns status 365** 366*******************************************************************************/ 367UINT8 nci_snd_discover_select_cmd (UINT8 rf_disc_id, UINT8 protocol, UINT8 rf_interface) 368{ 369 BT_HDR *p; 370 UINT8 *pp; 371 372 if ((p = NCI_GET_CMD_BUF(NCI_DISCOVER_PARAM_SIZE_SELECT)) == NULL) 373 return (NCI_STATUS_FAILED); 374 375 p->event = BT_EVT_TO_NFC_NCI; 376 p->len = NCI_MSG_HDR_SIZE + NCI_DISCOVER_PARAM_SIZE_SELECT; 377 p->offset = NCI_MSG_OFFSET_SIZE; 378 p->layer_specific = 0; 379 pp = (UINT8 *)(p + 1) + p->offset; 380 381 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_RF_MANAGE); 382 NCI_MSG_BLD_HDR1(pp, NCI_MSG_RF_DISCOVER_SELECT); 383 UINT8_TO_STREAM (pp, NCI_DISCOVER_PARAM_SIZE_SELECT); 384 UINT8_TO_STREAM (pp, rf_disc_id); 385 UINT8_TO_STREAM (pp, protocol); 386 UINT8_TO_STREAM (pp, rf_interface); 387 388 nfc_ncif_send_cmd (p); 389 return (NCI_STATUS_OK); 390} 391 392/******************************************************************************* 393** 394** Function nci_snd_deactivate_cmd 395** 396** Description compose and send RF Management DEACTIVATE command 397** to command queue 398** 399** Returns status 400** 401*******************************************************************************/ 402UINT8 nci_snd_deactivate_cmd (UINT8 de_act_type ) 403{ 404 BT_HDR *p; 405 UINT8 *pp; 406 407 if ((p = NCI_GET_CMD_BUF(NCI_DISCOVER_PARAM_SIZE_DEACT)) == NULL) 408 return (NCI_STATUS_FAILED); 409 410 p->event = BT_EVT_TO_NFC_NCI; 411 p->len = NCI_MSG_HDR_SIZE + NCI_DISCOVER_PARAM_SIZE_DEACT; 412 p->offset = NCI_MSG_OFFSET_SIZE; 413 p->layer_specific = 0; 414 pp = (UINT8 *)(p + 1) + p->offset; 415 416 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_RF_MANAGE); 417 NCI_MSG_BLD_HDR1(pp, NCI_MSG_RF_DEACTIVATE); 418 UINT8_TO_STREAM (pp, NCI_DISCOVER_PARAM_SIZE_DEACT); 419 UINT8_TO_STREAM (pp, de_act_type); 420 421 nfc_ncif_send_cmd (p); 422 return (NCI_STATUS_OK); 423} 424 425/******************************************************************************* 426** 427** Function nci_snd_discover_map_cmd 428** 429** Description compose and send RF Management DISCOVER MAP command 430** to command queue 431** 432** Returns status 433** 434*******************************************************************************/ 435UINT8 nci_snd_discover_map_cmd (UINT8 num, tNCI_DISCOVER_MAPS *p_maps) 436{ 437 BT_HDR *p; 438 UINT8 *pp, *p_size, *p_start; 439 int xx; 440 int size; 441 442 size = num * sizeof(tNCI_DISCOVER_MAPS) + 1; 443 444 if ((p = NCI_GET_CMD_BUF(size)) == NULL) 445 return (NCI_STATUS_FAILED); 446 447 p->event = BT_EVT_TO_NFC_NCI; 448 p->offset = NCI_MSG_OFFSET_SIZE; 449 p->layer_specific = 0; 450 pp = (UINT8 *)(p + 1) + p->offset; 451 452 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_RF_MANAGE); 453 NCI_MSG_BLD_HDR1(pp, NCI_MSG_RF_DISCOVER_MAP); 454 p_size = pp; 455 pp++; 456 p_start = pp; 457 UINT8_TO_STREAM (pp, num); 458 for (xx=0; xx<num; xx++) 459 { 460 UINT8_TO_STREAM (pp, p_maps[xx].protocol); 461 UINT8_TO_STREAM (pp, p_maps[xx].mode); 462 UINT8_TO_STREAM (pp, p_maps[xx].intf_type); 463 } 464 *p_size = (UINT8)(pp - p_start); 465 p->len = NCI_MSG_HDR_SIZE + *p_size; 466 nfc_ncif_send_cmd (p); 467 return (NCI_STATUS_OK); 468} 469/******************************************************************************* 470** 471** Function nci_snd_t3t_polling 472** 473** Description compose and send RF Management T3T POLLING command 474** to command queue 475** 476** Returns status 477** 478*******************************************************************************/ 479UINT8 nci_snd_t3t_polling (UINT16 system_code, UINT8 rc, UINT8 tsn) 480{ 481 BT_HDR *p; 482 UINT8 *pp; 483 484 if ((p = NCI_GET_CMD_BUF(NCI_RF_PARAM_SIZE_T3T_POLLING)) == NULL) 485 return (NCI_STATUS_FAILED); 486 487 p->event = BT_EVT_TO_NFC_NCI; 488 p->len = NCI_MSG_HDR_SIZE + NCI_RF_PARAM_SIZE_T3T_POLLING; 489 p->offset = NCI_MSG_OFFSET_SIZE; 490 p->layer_specific = 0; 491 pp = (UINT8 *)(p + 1) + p->offset; 492 493 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_RF_MANAGE); 494 NCI_MSG_BLD_HDR1(pp, NCI_MSG_RF_T3T_POLLING); 495 UINT8_TO_STREAM (pp, NCI_RF_PARAM_SIZE_T3T_POLLING); 496 UINT16_TO_BE_STREAM (pp, system_code); 497 UINT8_TO_STREAM (pp, rc); 498 UINT8_TO_STREAM (pp, tsn); 499 500 nfc_ncif_send_cmd (p); 501 return (NCI_STATUS_OK); 502} 503 504/******************************************************************************* 505** 506** Function nci_snd_parameter_update_cmd 507** 508** Description compose and send RF Management RF Communication Parameter 509** Update commandto command queue 510** 511** Returns status 512** 513*******************************************************************************/ 514UINT8 nci_snd_parameter_update_cmd (UINT8 *p_param_tlvs, UINT8 tlv_size) 515{ 516 BT_HDR *p; 517 UINT8 *pp; 518 UINT8 num = 0, ulen, len, *pt; 519 520 if ((p = NCI_GET_CMD_BUF(tlv_size + 1)) == NULL) 521 return (NCI_STATUS_FAILED); 522 523 p->event = BT_EVT_TO_NFC_NCI; 524 p->len = NCI_MSG_HDR_SIZE + tlv_size + 1; 525 p->offset = NCI_MSG_OFFSET_SIZE; 526 pp = (UINT8 *)(p + 1) + p->offset; 527 528 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_RF_MANAGE); 529 NCI_MSG_BLD_HDR1(pp, NCI_MSG_RF_PARAMETER_UPDATE); 530 UINT8_TO_STREAM (pp, (UINT8)(tlv_size + 1)); 531 len = tlv_size; 532 pt = p_param_tlvs; 533 while (len > 1) 534 { 535 len -= 2; 536 pt++; 537 num++; 538 ulen = *pt++; 539 pt += ulen; 540 if (len >= ulen) 541 { 542 len -= ulen; 543 } 544 else 545 { 546 GKI_freebuf (p); 547 return NCI_STATUS_FAILED; 548 } 549 } 550 551 UINT8_TO_STREAM (pp, num); 552 ARRAY_TO_STREAM (pp, p_param_tlvs, tlv_size); 553 nfc_ncif_send_cmd (p); 554 555 return (NCI_STATUS_OK); 556} 557 558#if (NFC_NFCEE_INCLUDED == TRUE) 559#if (NFC_RW_ONLY == FALSE) 560/******************************************************************************* 561** 562** Function nci_snd_set_routing_cmd 563** 564** Description compose and send RF Management SET_LISTEN_MODE_ROUTING command 565** to command queue 566** 567** Returns status 568** 569*******************************************************************************/ 570UINT8 nci_snd_set_routing_cmd (BOOLEAN more, UINT8 target_handle, UINT8 num_tlv, UINT8 tlv_size, UINT8 *p_param_tlvs) 571{ 572 BT_HDR *p; 573 UINT8 *pp; 574 UINT8 size = tlv_size + 2; 575 576 if (tlv_size == 0) 577 { 578 /* just to terminate routing table 579 * 2 bytes (more=FALSE and num routing entries=0) */ 580 size = 2; 581 } 582 583 if ((p = NCI_GET_CMD_BUF(size)) == NULL) 584 return (NCI_STATUS_FAILED); 585 586 p->event = BT_EVT_TO_NFC_NCI; 587 p->offset = NCI_MSG_OFFSET_SIZE; 588 p->len = NCI_MSG_HDR_SIZE + size; 589 p->layer_specific = 0; 590 pp = (UINT8 *)(p + 1) + p->offset; 591 592 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_RF_MANAGE); 593 NCI_MSG_BLD_HDR1(pp, NCI_MSG_RF_SET_ROUTING); 594 UINT8_TO_STREAM (pp, size); 595 UINT8_TO_STREAM (pp, more); 596 if (size == 2) 597 { 598 UINT8_TO_STREAM (pp, 0); 599 } 600 else 601 { 602 UINT8_TO_STREAM (pp, num_tlv); 603 ARRAY_TO_STREAM (pp, p_param_tlvs, tlv_size); 604 } 605 nfc_ncif_send_cmd (p); 606 607 return (NCI_STATUS_OK); 608} 609 610/******************************************************************************* 611** 612** Function nci_snd_get_routing_cmd 613** 614** Description compose and send RF Management GET_LISTEN_MODE_ROUTING command 615** to command queue 616** 617** Returns status 618** 619*******************************************************************************/ 620UINT8 nci_snd_get_routing_cmd(void) 621{ 622 BT_HDR *p; 623 UINT8 *pp; 624 UINT8 param_size = 0; 625 626 if ((p = NCI_GET_CMD_BUF(param_size)) == NULL) 627 return (NCI_STATUS_FAILED); 628 629 p->event = BT_EVT_TO_NFC_NCI; 630 p->len = NCI_MSG_HDR_SIZE + param_size; 631 p->offset = NCI_MSG_OFFSET_SIZE; 632 p->layer_specific = 0; 633 pp = (UINT8 *)(p + 1) + p->offset; 634 635 NCI_MSG_BLD_HDR0(pp, NCI_MT_CMD, NCI_GID_RF_MANAGE); 636 NCI_MSG_BLD_HDR1(pp, NCI_MSG_RF_GET_ROUTING); 637 UINT8_TO_STREAM (pp, param_size); 638 639 nfc_ncif_send_cmd (p); 640 return (NCI_STATUS_OK); 641} 642#endif 643#endif 644 645 646#endif /* NFC_INCLUDED == TRUE*/ 647