15d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*
25d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Copyright (C) 2010 NXP Semiconductors
35d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
45d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Licensed under the Apache License, Version 2.0 (the "License");
55d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * you may not use this file except in compliance with the License.
65d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * You may obtain a copy of the License at
75d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
85d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *      http://www.apache.org/licenses/LICENSE-2.0
95d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Unless required by applicable law or agreed to in writing, software
115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * distributed under the License is distributed on an "AS IS" BASIS,
125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * See the License for the specific language governing permissions and
145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * limitations under the License.
155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \file phOsalNfc.c
195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief OSAL Implementation for linux
205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Project: Trusted NFC Linux Light
225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * $Date: 03 aug 2009
245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * $Author: Jérémie Corbier
255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * $Revision: 1.0
265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <stddef.h>
305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <stdlib.h>
315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <stdio.h>
325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <signal.h>
335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <unistd.h>
345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phOsalNfc.h>
365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifdef ANDROID
385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define LOG_TAG "NFC-HCI"
395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <utils/Log.h>
415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyphOsalNfc_Exception_t phOsalNfc_Exception;
435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif
445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifdef DEBUG
465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define MAX_PRINT_BUFSIZE (0x450U)
475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellychar phOsalNfc_DbgTraceBuffer[MAX_PRINT_BUFSIZE];
485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif
495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
508206325bc6b3a60aed3c5cce157369ec2989437aSunil Jogivoid phLibNfc_Mgt_Recovery();
518206325bc6b3a60aed3c5cce157369ec2989437aSunil Jogi
525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*!
535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Allocates memory.
545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *        This function attempts to allocate \a size bytes on the heap and
555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *        returns a pointer to the allocated block.
565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param size size of the memory block to be allocated on the heap.
585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \return pointer to allocated memory block or NULL in case of error.
605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellyvoid *phOsalNfc_GetMemory(uint32_t size)
625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{
635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void *pMem = (void *)malloc(size);
645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   return pMem;
655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}
665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*!
685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Frees allocated memory block.
695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *        This function deallocates memory region pointed to by \a pMem.
705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param pMem pointer to memory block to be freed.
725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellyvoid phOsalNfc_FreeMemory(void *pMem)
745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{
755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   if(NULL !=  pMem)
765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      free(pMem);
775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}
785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellyvoid phOsalNfc_DbgString(const char *pString)
805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{
815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifdef DEBUG
825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   if(pString != NULL)
835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef ANDROID
845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      printf(pString);
855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#else
861f23e48e59a9d8ba8bfd60c4a4de4fb656651200Steve Block      ALOGD("%s", pString);
875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif
885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif
895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}
905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellyvoid phOsalNfc_DbgTrace(uint8_t data[], uint32_t size)
925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{
935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifdef DEBUG
945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint32_t i;
955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifdef ANDROID
965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   char buf[10];
975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif
985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   if(size == 0)
1005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      return;
1015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef ANDROID
1035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   for(i = 0; i < size; i++)
1045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   {
1055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      if((i % 10) == 0)
1065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly         printf("\n\t\t\t");
1075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      printf("%02X ", data[i]);
1085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   }
1095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   printf("\n\tBlock size is: %d\n", size);
1105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#else
1115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phOsalNfc_DbgTraceBuffer[0] = '\0';
1125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   for(i = 0; i < size; i++)
1135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   {
1145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      if((i % 10) == 0)
1155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      {
1161f23e48e59a9d8ba8bfd60c4a4de4fb656651200Steve Block         ALOGD("%s", phOsalNfc_DbgTraceBuffer);
1175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly         phOsalNfc_DbgTraceBuffer[0] = '\0';
1185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      }
1195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      snprintf(buf, 10, "%02X ", data[i]);
1215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      strncat(phOsalNfc_DbgTraceBuffer, buf, 10);
1225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   }
1231f23e48e59a9d8ba8bfd60c4a4de4fb656651200Steve Block   ALOGD("%s", phOsalNfc_DbgTraceBuffer);
1241f23e48e59a9d8ba8bfd60c4a4de4fb656651200Steve Block   ALOGD("Block size is: %d", size);
1255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif
1265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif
1275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}
1285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*!
1305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Raises exception.
1315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *        This function raises an exception of type \a eExceptionType with
1325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *        reason \a reason to stack clients.
1335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
1345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param eExceptionType exception type.
1355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param reason reason for this exception.
1365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
1375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \note Clients willing to catch exceptions are to handle the SIGABRT signal.
1385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *       On Linux, exception type and reason are passed to the signal handler as
1395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *       a pointer to a phOsalNfc_Exception_t structure.
1405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *       As sigqueue is not available in Android, exception information are
1415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *       stored in the phOsalNfc_Exception global.
1425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
1435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellyvoid phOsalNfc_RaiseException(phOsalNfc_ExceptionType_t eExceptionType, uint16_t reason)
1445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{
145bad5c194e18faa70ceb9608019d3c2cfa0d4f10cDaniel Tomas    if(eExceptionType == phOsalNfc_e_UnrecovFirmwareErr)
146bad5c194e18faa70ceb9608019d3c2cfa0d4f10cDaniel Tomas    {
1476141c4b7a438cacda2a54aa20c83700cd6f314a7Martijn Coenen        ALOGE("HCI Timeout - Exception raised - Force restart of NFC service");
1488206325bc6b3a60aed3c5cce157369ec2989437aSunil Jogi        phLibNfc_Mgt_Recovery();
149bad5c194e18faa70ceb9608019d3c2cfa0d4f10cDaniel Tomas        abort();
1506141c4b7a438cacda2a54aa20c83700cd6f314a7Martijn Coenen    } else {
1516141c4b7a438cacda2a54aa20c83700cd6f314a7Martijn Coenen        ALOGD("phOsalNfc_RaiseException() called");
152bad5c194e18faa70ceb9608019d3c2cfa0d4f10cDaniel Tomas    }
1535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}
1545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
155c1f33130d9d2100e6232f8f3c782949c75205be6Daniel Tomas/*!
156c1f33130d9d2100e6232f8f3c782949c75205be6Daniel Tomas * \brief display data bytes.
157c1f33130d9d2100e6232f8f3c782949c75205be6Daniel Tomas *        This function displays data bytes for debug purpose
158c1f33130d9d2100e6232f8f3c782949c75205be6Daniel Tomas * \param[in] pString pointer to string to be displayed.
159c1f33130d9d2100e6232f8f3c782949c75205be6Daniel Tomas * \param[in] length number of bytes to be displayed.
160c1f33130d9d2100e6232f8f3c782949c75205be6Daniel Tomas * \param[in] pBuffer pointer to data bytes to be displayed.
161c1f33130d9d2100e6232f8f3c782949c75205be6Daniel Tomas *
162c1f33130d9d2100e6232f8f3c782949c75205be6Daniel Tomas */
1635ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pellyvoid phOsalNfc_PrintData(const char *pString, uint32_t length, uint8_t *pBuffer,
1645ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly        int verbosity)
165c1f33130d9d2100e6232f8f3c782949c75205be6Daniel Tomas{
166fafed3cea5231f76bcebbe95b9d3b7c2ca69483dNick Pelly    char print_buffer[length * 3 + 1];
1675ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly    unsigned int i;
168c1f33130d9d2100e6232f8f3c782949c75205be6Daniel Tomas
169fafed3cea5231f76bcebbe95b9d3b7c2ca69483dNick Pelly    if (pString == NULL) {
170fafed3cea5231f76bcebbe95b9d3b7c2ca69483dNick Pelly        pString = "";
171fafed3cea5231f76bcebbe95b9d3b7c2ca69483dNick Pelly    }
172fafed3cea5231f76bcebbe95b9d3b7c2ca69483dNick Pelly    print_buffer[0] = '\0';
173fafed3cea5231f76bcebbe95b9d3b7c2ca69483dNick Pelly    for (i = 0; i < length; i++) {
174fafed3cea5231f76bcebbe95b9d3b7c2ca69483dNick Pelly        snprintf(&print_buffer[i*3], 4, " %02X", pBuffer[i]);
175c1f33130d9d2100e6232f8f3c782949c75205be6Daniel Tomas    }
1765ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly
1775ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly    char llc[40] = "";
1785ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly
1795ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly    if (verbosity >= 2) {
1805ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly        uint8_t llc_header = 0;
1815ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly        if (!strcmp(pString, "SEND") && length >= 2) {
1825ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            llc_header = pBuffer[1];
1835ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly        } else if (!strcmp(pString, "RECV") && length >= 2) {
1845ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            llc_header = pBuffer[0];
1855ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly        }
1865ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly
1875ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly        if ((llc_header & 0xC0) == 0x80) {
1885ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            // I
1895ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            uint8_t ns = (llc_header & 0x38) >> 3;
1905ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            uint8_t nr = llc_header & 0x07;
1915ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            snprintf(&llc[0], sizeof(llc), "I %d (%d)", ns, nr);
1925ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly        } else if ((llc_header & 0xE0) == 0xC0) {
1935ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            // S
1945ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            uint8_t t = (llc_header & 0x18) >> 3;
1955ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            uint8_t nr = llc_header & 0x07;
1965ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            char *type;
1975ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            switch (t) {
1985ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            case 0x00: type = "RR "; break;
1995ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            case 0x01: type = "REJ"; break;
2005ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            case 0x02: type = "RNR"; break;
2015ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            case 0x03: type = "SREJ"; break;
2025ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            default: type = "???"; break;
2035ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            }
2045ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            snprintf(&llc[0], sizeof(llc), "S %s (%d)", type, nr);
2055ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly        } else if ((llc_header & 0xE0) == 0xE0) {
2065ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            // U
2075ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            snprintf(&llc[0], sizeof(llc), "U");
2085ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly        } else if (length > 1) {
2095ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly            snprintf(&llc[0], sizeof(llc), "???");
2105ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly        }
2115ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly    }
2125ea62ad25e2050f543d8e2104f5ffc1bb2c1ef28Nick Pelly
2131f23e48e59a9d8ba8bfd60c4a4de4fb656651200Steve Block    ALOGD("> %s:%s\t%s", pString, print_buffer, llc);
214c1f33130d9d2100e6232f8f3c782949c75205be6Daniel Tomas}
215