aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bestas <mkbestas@lineageos.org>2018-01-17 16:56:02 +0200
committerMichael Bestas <mkbestas@lineageos.org>2018-01-17 16:56:02 +0200
commit94be5171e97e34fb3b0417dd650792228cd0c8e9 (patch)
tree813d59eadc32422aefed098effabf0f0e2a5e0e6
parent52732be3d3f14f6fa55081b665eb9ed74b360ec2 (diff)
parented3002403257cf1d052ac59c4f12322c5eb5ce09 (diff)
downloadandroid_external_ant-wireless_ant_native-staging/lineage-15.1.tar.gz
android_external_ant-wireless_ant_native-staging/lineage-15.1.tar.bz2
android_external_ant-wireless_ant_native-staging/lineage-15.1.zip
Merge tag 'LA.UM.6.4.r1-05900-8x98.0' of https://source.codeaurora.org/quic/la/platform/external/ant-wireless/ant_native into HEADstaging/lineage-15.1
"LA.UM.6.4.r1-05900-8x98.0"
-rw-r--r--src/common/inc/ant_version.h2
-rw-r--r--src/qcomm-hidl/AntHidlClient.cpp67
-rw-r--r--src/qcomm-hidl/ant_rx_chardev.c11
-rw-r--r--src/vfs/ant_native_chardev.c148
-rw-r--r--src/vfs/ant_rx_chardev.c13
-rw-r--r--src/vfs/inc/ant_hci_defines.h5
-rw-r--r--src/vfs/prerelease/ant_driver_defines.h26
-rw-r--r--src/vfs/qualcomm/smd/ant_driver_defines.h16
-rw-r--r--src/vfs/ste/cg29xx/ant_driver_defines.h2
9 files changed, 185 insertions, 105 deletions
diff --git a/src/common/inc/ant_version.h b/src/common/inc/ant_version.h
index e7c3a97..0a18c35 100644
--- a/src/common/inc/ant_version.h
+++ b/src/common/inc/ant_version.h
@@ -21,7 +21,7 @@
#define LIBANT_STACK_MAJOR "1"
#define LIBANT_STACK_MINOR "9"
-#define LIBANT_STACK_INCRE "0"
+#define LIBANT_STACK_INCRE "5"
#endif // __ANT_VERSION_H
diff --git a/src/qcomm-hidl/AntHidlClient.cpp b/src/qcomm-hidl/AntHidlClient.cpp
index 37aa540..b5cf618 100644
--- a/src/qcomm-hidl/AntHidlClient.cpp
+++ b/src/qcomm-hidl/AntHidlClient.cpp
@@ -66,29 +66,30 @@ using ::android::sp;
android::sp<IAntHci> anthci;
typedef std::unique_lock<std::mutex> Lock;
-
+#define POLL_TIMEOUT_MS 100
struct ant_hci_t {
public:
std::condition_variable rx_cond;
std::condition_variable on_cond;
+ std::condition_variable data_cond;
std::mutex on_mtx;
std::mutex rx_mtx;
+ std::mutex data_mtx;
ant_power_state_t state;
- bool rx_processing;
+ volatile bool rx_processing;
};
static struct ant_hci_t ant_hci;
Return<void> initialization_complete(bool is_hci_initialize)
{
- ALOGI("%s: is_hci_initialize: %d", __func__, is_hci_initialize);
+ ALOGI("%s start ", __func__ );
Lock lk(ant_hci.on_mtx);
if (is_hci_initialize)
{
ant_hci.state = ANT_RADIO_ENABLED;
- ALOGI("%s: is_hci_initialize: %d", __func__, is_hci_initialize);
}
else
{
@@ -121,39 +122,41 @@ public:
Return<void> antControlReceived(const hidl_vec<uint8_t>& event)
{
- ALOGI("%s: Start ", __func__);
- Lock lk(ant_hci.rx_mtx);
-
+ ALOGV("%s:start ", __func__);
// Make sure we don't overwrite a message still processing.
- while(ant_hci.rx_processing)
+ Lock lk(ant_hci.rx_mtx);
+ if(ant_hci.rx_processing && ant_hci.state == ANT_RADIO_ENABLED)
{
ant_hci.rx_cond.wait(lk);
}
- ant_hci.rx_processing = true;
memcpy(&aucRxBuffer[0][0], event.data(), event.size());
iRxBufferLength[0] = event.size();
- ant_hci.rx_cond.notify_all();
- ALOGI("%s: End", __func__);
+ std::unique_lock< std::mutex> lock(ant_hci.data_mtx);
+ ALOGD("%s: notify data avail", __func__);
+ ant_hci.rx_processing = true;
+ ant_hci.data_cond.notify_all();
+ ALOGV("%s: End", __func__);
return Void();
}
Return<void> antDataReceived(const hidl_vec<uint8_t>& event)
{
- ALOGI("%s: ", __func__);
- Lock lk(ant_hci.rx_mtx);
-
+ ALOGV("%s:start ", __func__);
// Make sure we don't overwrite a message still processing.
- while(ant_hci.rx_processing)
+ Lock lk(ant_hci.rx_mtx);
+ if(ant_hci.rx_processing && ant_hci.state == ANT_RADIO_ENABLED)
{
ant_hci.rx_cond.wait(lk);
}
- ant_hci.rx_processing = true;
memcpy(&aucRxBuffer[0][0], event.data(), event.size());
iRxBufferLength[0] = event.size();
- ant_hci.rx_cond.notify_all();
- ALOGI("%s: exit", __func__);
+ std::unique_lock< std::mutex> lock(ant_hci.data_mtx);
+ ALOGD("%s: notify data avail", __func__);
+ ant_hci.rx_processing = true;
+ ant_hci.data_cond.notify_all();
+ ALOGV("%s: exit", __func__);
return Void();
}
};
@@ -170,7 +173,7 @@ bool hci_initialize()
ant_hci.rx_processing = false;
android::sp<IAntHciCallbacks> callbacks = new AntHciCallbacks();
anthci->initialize(callbacks);
- ALOGI("%s: exit", __func__);
+ ALOGV("%s: exit", __func__);
return true;
} else {
return false;
@@ -182,11 +185,13 @@ void hci_close() {
if(anthci != nullptr)
{
+ std::unique_lock< std::mutex> lock(ant_hci.data_mtx);
+ ant_hci.data_cond.notify_all();
anthci->close();
}
+ ant_hci.state = ANT_RADIO_DISABLED;
ant_rx_clear();
anthci =nullptr;
- ant_hci.state = ANT_RADIO_DISABLED;
ALOGI("%s: exit", __func__);
}
@@ -204,7 +209,7 @@ ANTStatus ant_tx_write(ANT_U8 *pucTxMessage,ANT_U8 ucMessageLength)
ALOGV("%s: proto type :%d", __func__, packet_type);
if (anthci != nullptr)
{
- data.setToExternal(pucTxMessage+1, ucMessageLength);
+ data.setToExternal(pucTxMessage+1, ucMessageLength-1);
if (packet_type == ANT_DATA_TYPE_PACKET)
{
anthci->sendAntData(data);
@@ -221,18 +226,18 @@ ANTStatus ant_tx_write(ANT_U8 *pucTxMessage,ANT_U8 ucMessageLength)
ANTStatus ant_rx_check()
{
- ALOGI("%s: start", __func__);
- Lock lk(ant_hci.rx_mtx);
- ant_hci.rx_cond.wait(lk);
- ALOGI("%s: exit", __func__);
- if (ant_hci.rx_processing)
+ ALOGV("%s: start", __func__);
+ Lock lock(ant_hci.data_mtx);
+ while (ant_hci.rx_processing == 0)
{
- return ANT_STATUS_SUCCESS;
- }
- else
- {
- return ANT_STATUS_NO_VALUE_AVAILABLE;
+ ant_hci.data_cond.wait_for(lock,std::chrono::milliseconds(POLL_TIMEOUT_MS));
+ if (ant_hci.state != ANT_RADIO_ENABLED)
+ {
+ return ANT_STATUS_NO_VALUE_AVAILABLE;
+ }
}
+ ALOGV("%s: exit rx_processing =%d", __func__,ant_hci.rx_processing);
+ return ANT_STATUS_SUCCESS;
}
void ant_rx_clear()
diff --git a/src/qcomm-hidl/ant_rx_chardev.c b/src/qcomm-hidl/ant_rx_chardev.c
index 153660c..3e102d2 100644
--- a/src/qcomm-hidl/ant_rx_chardev.c
+++ b/src/qcomm-hidl/ant_rx_chardev.c
@@ -105,6 +105,14 @@ void *fnRxThread(void *ant_rx_thread_info)
{
readChannelMsg(0, &stRxThreadInfo->astChannels[0]);
}
+ else
+ {
+ ANT_WARN("rx check failed , cleaning up");
+ break;
+ }
+ // Need to indicate that we are done handling the rx buffer and it can be
+ // overwritten again.
+ ant_rx_clear();
}
/* disable ANT radio if not already disabling */
@@ -338,9 +346,6 @@ int readChannelMsg(ant_channel_type eChannel, ant_channel_info_t *pstChnlInfo)
}
out:
- // Need to indicate that we are done handling the rx buffer and it can be
- // overwritten again.
- ant_rx_clear();
ANT_FUNC_END();
return iRet;
}
diff --git a/src/vfs/ant_native_chardev.c b/src/vfs/ant_native_chardev.c
index 759b385..2605776 100644
--- a/src/vfs/ant_native_chardev.c
+++ b/src/vfs/ant_native_chardev.c
@@ -34,6 +34,7 @@
#include <stdint.h> /* for uint64_t */
#include <sys/eventfd.h> /* For eventfd() */
#include <unistd.h> /* for read(), write(), and close() */
+#include <string.h>
#include "ant_types.h"
#include "ant_native.h"
@@ -44,6 +45,10 @@
#include "ant_hci_defines.h"
#include "ant_log.h"
+#if (ANT_HCI_CHANNEL_SIZE > 0) || !defined(ANT_DEVICE_NAME)
+#define MULTIPATH_TX
+#endif
+
#if ANT_HCI_SIZE_SIZE > 1
#include "ant_utils.h" // Put HCI Size value across multiple bytes
#endif
@@ -170,16 +175,20 @@ ANTStatus ant_deinit(void)
// Psuedocode:
/*
LOCK enable_LOCK
- State callback: STATE = ENABLING
- ant enable
- IF ant_enable success
- State callback: STATE = ENABLED
- RESULT = SUCCESS
- ELSE
- ant disable
- State callback: STATE = Current state
- RESULT = FAILURE
- ENDIF
+ IF current_state != ENABLED
+ State callback: STATE = ENABLING
+ ant enable
+ IF ant_enable success
+ State callback: STATE = ENABLED
+ RESULT = SUCCESS
+ ELSE
+ ant disable
+ State callback: STATE = Current state
+ RESULT = FAILURE
+ ENDIF
+ ELSE
+ RESULT = SUCCESS
+ ENDIF
UNLOCK
*/
////////////////////////////////////////////////////////////////////
@@ -197,23 +206,28 @@ ANTStatus ant_enable_radio(void)
}
ANT_DEBUG_V("got stEnabledStatusLock in %s", __FUNCTION__);
- if (g_fnStateCallback) {
- g_fnStateCallback(RADIO_STATUS_ENABLING);
- }
+ if (ant_radio_enabled_status() != RADIO_STATUS_ENABLED) {
+ if (g_fnStateCallback) {
+ g_fnStateCallback(RADIO_STATUS_ENABLING);
+ }
- if (ant_enable() < 0) {
- ANT_ERROR("ant enable failed: %s", strerror(errno));
+ if (ant_enable() < 0) {
+ ANT_ERROR("ant enable failed: %s", strerror(errno));
- ant_disable();
+ ant_disable();
- if (g_fnStateCallback) {
- g_fnStateCallback(ant_radio_enabled_status());
+ if (g_fnStateCallback) {
+ g_fnStateCallback(ant_radio_enabled_status());
+ }
+ } else {
+ if (g_fnStateCallback) {
+ g_fnStateCallback(RADIO_STATUS_ENABLED);
+ }
+
+ result_status = ANT_STATUS_SUCCESS;
}
} else {
- if (g_fnStateCallback) {
- g_fnStateCallback(RADIO_STATUS_ENABLED);
- }
-
+ ANT_DEBUG_D("Ignoring redundant enable call.");
result_status = ANT_STATUS_SUCCESS;
}
@@ -336,10 +350,12 @@ out:
// Psuedocode:
/*
LOCK enable_LOCK
- State callback: STATE = DISABLING
- ant disable
- State callback: STATE = Current state
- RESULT = SUCCESS
+ IF current_state != DISABLED
+ State callback: STATE = DISABLING
+ ant disable
+ State callback: STATE = Current state
+ ENDIF
+ RESULT = SUCCESS
UNLOCK
*/
////////////////////////////////////////////////////////////////////
@@ -357,14 +373,18 @@ ANTStatus ant_disable_radio(void)
}
ANT_DEBUG_V("got stEnabledStatusLock in %s", __FUNCTION__);
- if (g_fnStateCallback) {
- g_fnStateCallback(RADIO_STATUS_DISABLING);
- }
+ if (ant_radio_enabled_status() != RADIO_STATUS_DISABLED) {
+ if (g_fnStateCallback) {
+ g_fnStateCallback(RADIO_STATUS_DISABLING);
+ }
- ant_disable();
+ ant_disable();
- if (g_fnStateCallback) {
- g_fnStateCallback(ant_radio_enabled_status());
+ if (g_fnStateCallback) {
+ g_fnStateCallback(ant_radio_enabled_status());
+ }
+ } else {
+ ANT_DEBUG_D("Ignoring redundant disable call.");
}
ret = ANT_STATUS_SUCCESS;
@@ -723,6 +743,11 @@ ENDIF
////////////////////////////////////////////////////////////////////
ANTStatus ant_tx_message(ANT_U8 ucLen, ANT_U8 *pucMesg)
{
+#if defined(MULTIPATH_TX)
+ ANT_BOOL bIsData;
+#endif
+ ant_channel_type eTxChannel;
+ ant_channel_type eFlowChannel;
ANTStatus status = ANT_STATUS_FAILED;
// TODO ANT_HCI_MAX_MSG_SIZE is transport (driver) dependent.
ANT_U8 txBuffer[ANT_HCI_MAX_MSG_SIZE];
@@ -736,12 +761,37 @@ ANTStatus ant_tx_message(ANT_U8 ucLen, ANT_U8 *pucMesg)
goto out;
}
+#if defined(MULTIPATH_TX)
+switch (pucMesg[ANT_MSG_ID_OFFSET]) {
+ case MESG_BROADCAST_DATA_ID:
+ case MESG_ACKNOWLEDGED_DATA_ID:
+ case MESG_BURST_DATA_ID:
+ case MESG_EXT_BROADCAST_DATA_ID:
+ case MESG_EXT_ACKNOWLEDGED_DATA_ID:
+ case MESG_EXT_BURST_DATA_ID:
+ case MESG_ADV_BURST_DATA_ID:
+ bIsData = ANT_TRUE;
+ break;
+ default:
+ bIsData = ANT_FALSE;
+ break;
+ }
+
+ ANT_DEBUG_V("tx message: bIsData=%d", bIsData);
+#endif
+
#if ANT_HCI_OPCODE_SIZE == 1
txBuffer[ANT_HCI_OPCODE_OFFSET] = ANT_HCI_OPCODE_TX;
#elif ANT_HCI_OPCODE_SIZE > 1
#error "Specified ANT_HCI_OPCODE_SIZE not currently supported"
#endif
+#if ANT_HCI_CHANNEL_SIZE == 1
+ txBuffer[ANT_HCI_CHANNEL_OFFSET] = bIsData ? ANT_HCI_DATA_CHANNEL : ANT_HCI_COMMAND_CHANNEL;
+#elif ANT_HCI_OPCODE_SIZE > 1
+#error "Specified ANT_HCI_CHANNEL_SIZE not currently supported"
+#endif
+
#if ANT_HCI_SIZE_SIZE == 1
txBuffer[ANT_HCI_SIZE_OFFSET] = ucLen;
#elif ANT_HCI_SIZE_SIZE == 2
@@ -754,21 +804,24 @@ ANTStatus ant_tx_message(ANT_U8 ucLen, ANT_U8 *pucMesg)
ANT_SERIAL(txBuffer, txMessageLength, 'T');
-#ifdef ANT_DEVICE_NAME // Single transport path
- status = ant_tx_message_flowcontrol_wait(SINGLE_CHANNEL, SINGLE_CHANNEL, txMessageLength, txBuffer);
+#ifdef ANT_DEVICE_NAME
+ eTxChannel = SINGLE_CHANNEL;
+ eFlowChannel = SINGLE_CHANNEL;
+#else
+ eTxChannel = bIsData ? DATA_CHANNEL : COMMAND_CHANNEL;
+ eFlowChannel = COMMAND_CHANNEL;
+#endif
+
+#if !defined(MULTIPATH_TX) // Single transport path
+ status = ant_tx_message_flowcontrol_wait(eTxChannel, eFlowChannel, txMessageLength, txBuffer);
#else // Separate data/command paths
- switch (txBuffer[ANT_HCI_DATA_OFFSET + ANT_MSG_ID_OFFSET]) {
- case MESG_BROADCAST_DATA_ID:
- case MESG_ACKNOWLEDGED_DATA_ID:
- case MESG_BURST_DATA_ID:
- case MESG_EXT_BROADCAST_DATA_ID:
- case MESG_EXT_ACKNOWLEDGED_DATA_ID:
- case MESG_EXT_BURST_DATA_ID:
- case MESG_ADV_BURST_DATA_ID:
- status = ant_tx_message_flowcontrol_wait(DATA_CHANNEL, COMMAND_CHANNEL, txMessageLength, txBuffer);
- break;
- default:
- status = ant_tx_message_flowcontrol_none(COMMAND_CHANNEL, txMessageLength, txBuffer);
+ if (bIsData)
+ {
+ status = ant_tx_message_flowcontrol_wait(eTxChannel, eFlowChannel, txMessageLength, txBuffer);
+ }
+ else
+ {
+ status = ant_tx_message_flowcontrol_none(eTxChannel, txMessageLength, txBuffer);
}
#endif // Separate data/command paths
@@ -897,6 +950,9 @@ int ant_enable(void)
iRet = 0;
out:
+ if (stRxThreadInfo.stRxThread == 0) {
+ stRxThreadInfo.ucRunThread = 0;
+ }
ANT_FUNC_END();
return iRet;
}
diff --git a/src/vfs/ant_rx_chardev.c b/src/vfs/ant_rx_chardev.c
index 2a2ec7f..3876119 100644
--- a/src/vfs/ant_rx_chardev.c
+++ b/src/vfs/ant_rx_chardev.c
@@ -31,6 +31,7 @@
#include <poll.h>
#include <pthread.h>
#include <stdint.h> /* for uint64_t */
+#include <string.h>
#include "ant_types.h"
#include "antradio_power.h"
@@ -162,7 +163,8 @@ void *fnRxThread(void *ant_rx_thread_info)
} else if (areAllFlagsSet(astPollFd[eChannel].revents, EVENT_CHIP_SHUTDOWN)) {
/* chip reported it was unexpectedly disabled */
ANT_DEBUG_D(
- "poll hang-up from %s. exiting rx thread", stRxThreadInfo->astChannels[eChannel].pcDevicePath);
+ "poll hang-up from %s. Attempting recovery.",
+ stRxThreadInfo->astChannels[eChannel].pcDevicePath);
doReset(stRxThreadInfo);
goto out;
@@ -174,8 +176,9 @@ void *fnRxThread(void *ant_rx_thread_info)
stRxThreadInfo->bWaitingForKeepaliveResponse = ANT_FALSE;
if (readChannelMsg(eChannel, &stRxThreadInfo->astChannels[eChannel]) < 0) {
- // set flag to exit out of Rx Loop
- stRxThreadInfo->ucRunThread = 0;
+ ANT_ERROR("Read of data failed. Attempting recovery.");
+ doReset(stRxThreadInfo);
+ goto out;
}
} else if (areAllFlagsSet(astPollFd[eChannel].revents, POLLNVAL)) {
ANT_ERROR("poll was called on invalid file descriptor %s. Attempting recovery.",
@@ -360,7 +363,7 @@ int readChannelMsg(ant_channel_type eChannel, ant_channel_info_t *pstChnlInfo)
if (iRxLenRead < 0) {
if (errno == ENODEV) {
- ANT_ERROR("%s not enabled, exiting rx thread",
+ ANT_ERROR("%s not enabled",
pstChnlInfo->pcDevicePath);
goto out;
@@ -370,7 +373,7 @@ int readChannelMsg(ant_channel_type eChannel, ant_channel_info_t *pstChnlInfo)
goto out;
} else {
- ANT_ERROR("%s read thread exiting, unhandled error: %s",
+ ANT_ERROR("%s: unhandled error: %s",
pstChnlInfo->pcDevicePath, strerror(errno));
goto out;
diff --git a/src/vfs/inc/ant_hci_defines.h b/src/vfs/inc/ant_hci_defines.h
index 3ffe672..b51eb8a 100644
--- a/src/vfs/inc/ant_hci_defines.h
+++ b/src/vfs/inc/ant_hci_defines.h
@@ -40,11 +40,12 @@
#include "ant_driver_defines.h"
-#define ANT_HCI_HEADER_SIZE ((ANT_HCI_OPCODE_SIZE) + (ANT_HCI_SIZE_SIZE) + (ANT_HCI_SYNC_SIZE))
+#define ANT_HCI_HEADER_SIZE ((ANT_HCI_OPCODE_SIZE) + (ANT_HCI_CHANNEL_SIZE) + (ANT_HCI_SIZE_SIZE) + (ANT_HCI_SYNC_SIZE))
#define ANT_HCI_FOOTER_SIZE (ANT_HCI_CHECKSUM_SIZE)
#define ANT_HCI_OPCODE_OFFSET 0
-#define ANT_HCI_SIZE_OFFSET ((ANT_HCI_OPCODE_OFFSET) + (ANT_HCI_OPCODE_SIZE))
+#define ANT_HCI_CHANNEL_OFFSET ((ANT_HCI_OPCODE_OFFSET) + (ANT_HCI_OPCODE_SIZE))
+#define ANT_HCI_SIZE_OFFSET ((ANT_HCI_CHANNEL_OFFSET) + (ANT_HCI_CHANNEL_SIZE))
#define ANT_HCI_SYNC_OFFSET ((ANT_HCI_SIZE_OFFSET) + (ANT_HCI_SIZE_SIZE))
#define ANT_HCI_DATA_OFFSET (ANT_HCI_HEADER_SIZE)
diff --git a/src/vfs/prerelease/ant_driver_defines.h b/src/vfs/prerelease/ant_driver_defines.h
index c30c6e4..3eb5c31 100644
--- a/src/vfs/prerelease/ant_driver_defines.h
+++ b/src/vfs/prerelease/ant_driver_defines.h
@@ -34,7 +34,7 @@
// |----------------------|-----------------|
// |Optional| Data | Opt. | ... | Optional |
// | Opcode | Size | Sync | | Checksum |
-
+
// Data may include any number of ANT packets, with no sync byte or checksum.
// A read from the driver may return any number of ANT HCI packets.
@@ -46,25 +46,27 @@
// Set the file name the driver creates for the ANT device:
// If chip uses separate command and data paths:
-#define ANT_COMMANDS_DEVICE_NAME "/dev/smd5"
-#define ANT_DATA_DEVICE_NAME "/dev/smd6"
+// #define ANT_COMMANDS_DEVICE_NAME "/dev/smd5"
+// #define ANT_DATA_DEVICE_NAME "/dev/smd6"
// OR
// If chip uses one path:
-// #define ANT_DEVICE_NAME "/dev/Z"
+#define ANT_DEVICE_NAME "/dev/ant"
-
// Set to the number of bytes of header is for Opcode:
#define ANT_HCI_OPCODE_SIZE 0
-
+
+// Set to the number of bytes of header for channel ID
+#define ANT_HCI_CHANNEL_SIZE 1
+
// Set to the number of bytes of header is for Data Size:
#define ANT_HCI_SIZE_SIZE 1
-
+
// Set to the number of bytes of header is for Sync:
#define ANT_HCI_SYNC_SIZE 0
-
+
// Set to the number of bytes of footer is for Checksum:
#define ANT_HCI_CHECKSUM_SIZE 0
-
+
// ---------------------- OPTIONAL
// If hard reset is supported, define ANT_IOCTL_RESET
@@ -78,8 +80,12 @@
// define the message content:
// That signals Flow Go:
#define ANT_FLOW_GO ((ANT_U8)0x00)
-
+
// That signals Flow Stop:
#define ANT_FLOW_STOP ((ANT_U8)0x80)
+// If using a channel ID byte, define the ids.
+#define ANT_HCI_COMMAND_CHANNEL ((ANT_U8)0x0C)
+#define ANT_HCI_DATA_CHANNEL ((ANT_U8)0x0E)
+
#endif /* ifndef __VFS_PRERELEASE_H */
diff --git a/src/vfs/qualcomm/smd/ant_driver_defines.h b/src/vfs/qualcomm/smd/ant_driver_defines.h
index 273286d..948c524 100644
--- a/src/vfs/qualcomm/smd/ant_driver_defines.h
+++ b/src/vfs/qualcomm/smd/ant_driver_defines.h
@@ -34,7 +34,7 @@
// |----------------------|-----------------|
// |Optional| Data | Opt. | ... | Optional |
// | Opcode | Size | Sync | | Checksum |
-
+
// Data may include any number of ANT packets, with no sync byte or checksum.
// A read from the driver may return any number of ANT HCI packets.
@@ -52,19 +52,21 @@
// If chip uses one path:
// #define ANT_DEVICE_NAME "/dev/Z"
-
// Set to the number of bytes of header is for Opcode:
#define ANT_HCI_OPCODE_SIZE 0
-
+
+// Set to the number of bytes of header for channel ID
+#define ANT_HCI_CHANNEL_SIZE 0
+
// Set to the number of bytes of header is for Data Size:
#define ANT_HCI_SIZE_SIZE 1
-
+
// Set to the number of bytes of header is for Sync:
#define ANT_HCI_SYNC_SIZE 0
-
+
// Set to the number of bytes of footer is for Checksum:
#define ANT_HCI_CHECKSUM_SIZE 0
-
+
// ---------------------- OPTIONAL
// If hard reset is supported, define ANT_IOCTL_RESET
@@ -78,7 +80,7 @@
// define the message content:
// That signals Flow Go:
#define ANT_FLOW_GO ((ANT_U8)0x00)
-
+
// That signals Flow Stop:
#define ANT_FLOW_STOP ((ANT_U8)0x80)
diff --git a/src/vfs/ste/cg29xx/ant_driver_defines.h b/src/vfs/ste/cg29xx/ant_driver_defines.h
index c47415d..b72439f 100644
--- a/src/vfs/ste/cg29xx/ant_driver_defines.h
+++ b/src/vfs/ste/cg29xx/ant_driver_defines.h
@@ -54,6 +54,8 @@
// Set to the number of bytes of header is for Opcode:
#define ANT_HCI_OPCODE_SIZE 0
+// Set to the number of bytes of header for channel ID
+#define ANT_HCI_CHANNEL_SIZE 0
// Set to the number of bytes of header is for Data Size:
#define ANT_HCI_SIZE_SIZE 1