summaryrefslogtreecommitdiffstats
path: root/halimpl
diff options
context:
space:
mode:
authoranil.hiranniah <anil.hiranniah@nxp.com>2018-05-25 18:50:31 +0530
committerRuchi Kandoi <kandoiruchi@google.com>2018-05-29 22:36:01 +0000
commit4dd54bfb848dec6ef0a2693e5f1579ab157691bd (patch)
treef5ca36d1ff0ff17998906d05d97760b5478ea9c4 /halimpl
parent6787f8dacad14dfee27d49585e493a293f14972e (diff)
downloadandroid_hardware_nxp_nfc-4dd54bfb848dec6ef0a2693e5f1579ab157691bd.tar.gz
android_hardware_nxp_nfc-4dd54bfb848dec6ef0a2693e5f1579ab157691bd.tar.bz2
android_hardware_nxp_nfc-4dd54bfb848dec6ef0a2693e5f1579ab157691bd.zip
Enable CE-PhoneOff feature during NFC Enable
Commands to enable CE-PhoneOff can't be sent while powering off phone, as, in case of force-shutdown, services are killed abruptly. So commands to Enable/Disable CE-PhoneOff feature are sent during NFC Enable/Disable. Bug: 69876039 Bug: 79954924 Test: NFC Enable/Disable, Test CE-eSE in Phone Off state. Change-Id: I0489463d56c74ce8e4511fff011afb3bba91f0fc (cherry picked from commit 4ce359eec443343ba928b41dd69f894601cb09ee)
Diffstat (limited to 'halimpl')
-rwxr-xr-xhalimpl/hal/phNxpNciHal.cc56
1 files changed, 12 insertions, 44 deletions
diff --git a/halimpl/hal/phNxpNciHal.cc b/halimpl/hal/phNxpNciHal.cc
index 60d6f8f..6a487fe 100755
--- a/halimpl/hal/phNxpNciHal.cc
+++ b/halimpl/hal/phNxpNciHal.cc
@@ -1177,8 +1177,8 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
uint8_t swp_full_pwr_mode_on_cmd[] = {0x20, 0x02, 0x05, 0x01,
0xA0, 0xF1, 0x01, 0x01};
- static uint8_t cmd_ven_enable[] = {0x20, 0x02, 0x05, 0x01,
- 0xA0, 0x07, 0x01, 0x01};
+ static uint8_t cmd_ven_pulld_enable_nci[] = {0x20, 0x02, 0x05, 0x01,
+ 0xA0, 0x07, 0x01, 0x03};
static uint8_t android_l_aid_matching_mode_on_cmd[] = {
0x20, 0x02, 0x05, 0x01, 0xA0, 0x91, 0x01, 0x01};
@@ -1282,16 +1282,17 @@ int phNxpNciHal_core_initialized(uint8_t* p_core_init_rsp_params) {
}
}
- status = phNxpNciHal_send_ext_cmd(sizeof(cmd_ven_enable), cmd_ven_enable);
- if (status != NFCSTATUS_SUCCESS) {
- NXPLOG_NCIHAL_E("CMD_VEN_ENABLE: Failed");
- retry_core_init_cnt++;
- goto retry_core_init;
- }
+ status = phNxpNciHal_send_ext_cmd(sizeof(cmd_ven_pulld_enable_nci),
+ cmd_ven_pulld_enable_nci);
+ if (status != NFCSTATUS_SUCCESS) {
+ NXPLOG_NCIHAL_E("cmd_ven_pulld_enable_nci: Failed");
+ retry_core_init_cnt++;
+ goto retry_core_init;
+ }
- if (fw_download_success == 1) {
- phNxpNciHal_hci_network_reset();
- }
+ if (fw_download_success == 1) {
+ phNxpNciHal_hci_network_reset();
+ }
// Check if firmware download success
status = phNxpNciHal_get_mw_eeprom();
@@ -2088,39 +2089,6 @@ void phNxpNciHal_close_complete(NFCSTATUS status) {
******************************************************************************/
int phNxpNciHal_configDiscShutdown(void) {
NFCSTATUS status;
- /*NCI_RESET_CMD*/
- static uint8_t cmd_reset_nci[] = {0x20, 0x00, 0x01, 0x00};
-
- static uint8_t cmd_disable_disc[] = {0x21, 0x06, 0x01, 0x00};
-
- static uint8_t cmd_ce_disc_nci[] = {0x21, 0x03, 0x07, 0x03, 0x80,
- 0x01, 0x81, 0x01, 0x82, 0x01};
-
- static uint8_t cmd_ven_pulld_enable_nci[] = {0x20, 0x02, 0x05, 0x01,
- 0xA0, 0x07, 0x01, 0x03};
-
- CONCURRENCY_LOCK();
-
- status = phNxpNciHal_send_ext_cmd(sizeof(cmd_disable_disc), cmd_disable_disc);
- if (status != NFCSTATUS_SUCCESS) {
- NXPLOG_NCIHAL_E("CMD_DISABLE_DISCOVERY: Failed");
- }
-
- status = phNxpNciHal_send_ext_cmd(sizeof(cmd_ven_pulld_enable_nci), cmd_ven_pulld_enable_nci);
- if (status != NFCSTATUS_SUCCESS) {
- NXPLOG_NCIHAL_E("CMD_VEN_PULLD_ENABLE_NCI: Failed");
- }
-
- status = phNxpNciHal_send_ext_cmd(sizeof(cmd_ce_disc_nci), cmd_ce_disc_nci);
- if (status != NFCSTATUS_SUCCESS) {
- NXPLOG_NCIHAL_E("CMD_CE_DISC_NCI: Failed");
- }
-
- status = phNxpNciHal_send_ext_cmd(sizeof(cmd_reset_nci), cmd_reset_nci);
- if (status != NFCSTATUS_SUCCESS) {
- NXPLOG_NCIHAL_E("NCI_CORE_RESET: Failed");
- }
- CONCURRENCY_UNLOCK();
status = phNxpNciHal_close(true);
if(status != NFCSTATUS_SUCCESS) {