diff options
author | gautam <gautam.shukla@broadcom.com> | 2016-03-29 20:17:42 +0530 |
---|---|---|
committer | Wei Wang <weiwa@google.com> | 2016-04-07 16:35:16 -0700 |
commit | d122c5c4cbdb8fdee2576789733e42ea0ecb9d9c (patch) | |
tree | d7525dc82f421af9a8c9172b82114296ded8484d | |
parent | bb2ab0009b8d53baa1a183bfd11aede65e511491 (diff) | |
download | platform_hardware_broadcom_wlan-d122c5c4cbdb8fdee2576789733e42ea0ecb9d9c.tar.gz platform_hardware_broadcom_wlan-d122c5c4cbdb8fdee2576789733e42ea0ecb9d9c.tar.bz2 platform_hardware_broadcom_wlan-d122c5c4cbdb8fdee2576789733e42ea0ecb9d9c.zip |
Wifi-HAL: Adding preamble for RTT API
Adding preamble support in capabilities of
responder.
Change-Id: I2107f9f71717e69bc2a90967aec4f33a205e90af
Signed-off-by: gautam <gautam.shukla@broadcom.com>
-rw-r--r-- | bcmdhd/wifi_hal/rtt.cpp | 43 | ||||
-rw-r--r-- | bcmdhd/wifi_hal/wifi_hal.cpp | 2 |
2 files changed, 23 insertions, 22 deletions
diff --git a/bcmdhd/wifi_hal/rtt.cpp b/bcmdhd/wifi_hal/rtt.cpp index 2ecb4e9..d88bc61 100644 --- a/bcmdhd/wifi_hal/rtt.cpp +++ b/bcmdhd/wifi_hal/rtt.cpp @@ -160,19 +160,19 @@ protected: }; -class GetRttAvailableChannelCommand : public WifiCommand +class GetRttResponderInfoCommand : public WifiCommand { - wifi_channel_info* mChannelInfo; + wifi_rtt_responder* mResponderInfo; public: - GetRttAvailableChannelCommand(wifi_interface_handle iface, wifi_channel_info *channel) - : WifiCommand("GetRttAvailableChannelCommand", iface, 0), mChannelInfo(channel) + GetRttResponderInfoCommand(wifi_interface_handle iface, wifi_rtt_responder *responderInfo) + : WifiCommand("GetRttResponderInfoCommand", iface, 0), mResponderInfo(responderInfo) { - memset(mChannelInfo, 0 , sizeof(*mChannelInfo)); + memset(mResponderInfo, 0 , sizeof(*mResponderInfo)); } virtual int create() { - ALOGD("Creating message to get available channel ; iface = %d", mIfaceInfo->id); + ALOGD("Creating message to get responder info ; iface = %d", mIfaceInfo->id); int ret = mMsg.create(GOOGLE_OUI, RTT_SUBCMD_GETAVAILCHANNEL); if (ret < 0) { @@ -185,7 +185,7 @@ public: protected: virtual int handleResponse(WifiEvent& reply) { - ALOGD("In GetRttAvailableChannelCommand::handleResponse"); + ALOGD("In GetRttResponderInfoCommand::handleResponse"); if (reply.get_cmd() != NL80211_CMD_VENDOR) { ALOGD("Ignoring reply with cmd = %d", reply.get_cmd()); @@ -199,9 +199,9 @@ protected: int len = reply.get_vendor_data_len(); ALOGD("Id = %0x, subcmd = %d, len = %d, expected len = %d", id, subcmd, len, - sizeof(*mChannelInfo)); + sizeof(*mResponderInfo)); - memcpy(mChannelInfo, data, min(len, (int) sizeof(*mChannelInfo))); + memcpy(mResponderInfo, data, min(len, (int) sizeof(*mResponderInfo))); return NL_OK; } @@ -211,15 +211,15 @@ protected: class EnableResponderCommand : public WifiCommand { wifi_channel_info mChannelInfo; - wifi_channel_info* mChannelUsed; + wifi_rtt_responder* mResponderInfo; unsigned m_max_duration_sec; public: EnableResponderCommand(wifi_interface_handle iface, int id, wifi_channel_info channel_hint, - unsigned max_duration_seconds, wifi_channel_info *channel_used) + unsigned max_duration_seconds, wifi_rtt_responder *responderInfo) : WifiCommand("EnableResponderCommand", iface, 0), mChannelInfo(channel_hint), - m_max_duration_sec(max_duration_seconds), mChannelUsed(channel_used) + m_max_duration_sec(max_duration_seconds), mResponderInfo(responderInfo) { - memset(mChannelUsed, 0 , sizeof(*mChannelUsed)); + memset(mResponderInfo, 0 , sizeof(*mResponderInfo)); } @@ -251,9 +251,9 @@ protected: int len = reply.get_vendor_data_len(); ALOGD("Id = %0x, subcmd = %d, len = %d, expected len = %d", id, subcmd, len, - sizeof(*mChannelUsed)); + sizeof(*mResponderInfo)); - memcpy(mChannelUsed, data, min(len, (int) sizeof(*mChannelUsed))); + memcpy(mResponderInfo, data, min(len, (int) sizeof(*mResponderInfo))); return NL_OK; } @@ -641,10 +641,11 @@ wifi_error wifi_get_rtt_capabilities(wifi_interface_handle iface, return (wifi_error) command.requestResponse(); } -/* API to get the channel */ -wifi_error wifi_rtt_get_available_channel(wifi_interface_handle iface, wifi_channel_info* channel) +/* API to get the responder information */ +wifi_error wifi_rtt_get_responder_info(wifi_interface_handle iface, + wifi_rtt_responder* responderInfo) { - GetRttAvailableChannelCommand command(iface, channel); + GetRttResponderInfoCommand command(iface, responderInfo); return (wifi_error) command.requestResponse(); } @@ -653,13 +654,13 @@ wifi_error wifi_rtt_get_available_channel(wifi_interface_handle iface, wifi_chan * Enable RTT responder mode. * channel_hint - hint of the channel information where RTT responder should be enabled on. * max_duration_seconds - timeout of responder mode. - * channel_used - channel used for RTT responder, NULL if responder is not enabled. + * wifi_rtt_responder - information for RTT responder e.g. channel used and preamble supported. */ wifi_error wifi_enable_responder(wifi_request_id id, wifi_interface_handle iface, wifi_channel_info channel_hint, unsigned max_duration_seconds, - wifi_channel_info* channel_used ) + wifi_rtt_responder* responderInfo) { - EnableResponderCommand command(iface, id, channel_hint, max_duration_seconds, channel_used); + EnableResponderCommand command(iface, id, channel_hint, max_duration_seconds, responderInfo); return (wifi_error) command.requestResponse(); } diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp index 718a322..b925778 100644 --- a/bcmdhd/wifi_hal/wifi_hal.cpp +++ b/bcmdhd/wifi_hal/wifi_hal.cpp @@ -153,7 +153,7 @@ wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn) fn->wifi_rtt_range_request = wifi_rtt_range_request; fn->wifi_rtt_range_cancel = wifi_rtt_range_cancel; fn->wifi_get_rtt_capabilities = wifi_get_rtt_capabilities; - fn->wifi_rtt_get_available_channel = wifi_rtt_get_available_channel; + fn->wifi_rtt_get_responder_info = wifi_rtt_get_responder_info; fn->wifi_enable_responder = wifi_enable_responder; fn->wifi_disable_responder = wifi_disable_responder; fn->wifi_set_nodfs_flag = wifi_set_nodfs_flag; |