diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2014-10-31 15:11:42 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-10-31 15:11:42 -0700 |
commit | 4ed262a2076a1c4573984d8fa944916c1a572400 (patch) | |
tree | 82a4578f4e76a854c9021849f26276038bf42470 | |
parent | 46be11c24a439d29402ba44406720db41fba09ca (diff) | |
parent | 8dbdbff2791ffc9f657f5e281b166791d0550048 (diff) | |
download | android_hardware_qcom_wlan-staging/cm-12.0-caf.tar.gz android_hardware_qcom_wlan-staging/cm-12.0-caf.tar.bz2 android_hardware_qcom_wlan-staging/cm-12.0-caf.zip |
Merge "Wifihal fixes for country change event and reset iface event API"staging/cm-12.0-caf
-rw-r--r-- | qcwcn/wifi_hal/ifaceeventhandler.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/qcwcn/wifi_hal/ifaceeventhandler.cpp b/qcwcn/wifi_hal/ifaceeventhandler.cpp index 3556450..39f5710 100644 --- a/qcwcn/wifi_hal/ifaceeventhandler.cpp +++ b/qcwcn/wifi_hal/ifaceeventhandler.cpp @@ -90,6 +90,7 @@ wifi_error wifi_reset_iface_event_handler(wifi_request_id id, if (id == mwifiEventHandler->get_request_id()) { ALOGI("Delete Object mwifiEventHandler for id = %d", id); delete mwifiEventHandler; + mwifiEventHandler = NULL; } else { ALOGE("%s: Iface Event Handler Set for a different Request " "Id:%d is requested. Not supported. Exit", __func__, id); @@ -117,13 +118,14 @@ int IfaceEventHandlerCommand::handleEvent(WifiEvent &event) { case NL80211_CMD_REG_CHANGE: { - if(!tb[NL80211_ATTR_REG_ALPHA2]) + char code[2]; + memset(&code[0], 0, 2); + if(tb[NL80211_ATTR_REG_ALPHA2]) { + memcpy(&code[0], (char *) nla_data(tb[NL80211_ATTR_REG_ALPHA2]), 2); + } else { ALOGE("%s: NL80211_ATTR_REG_ALPHA2 not found", __func__); - return WIFI_ERROR_INVALID_ARGS; } - char code[2]; - memcpy(&code[0], (char *) nla_data(tb[NL80211_ATTR_REG_ALPHA2]), 2); //nla_len(tb[NL80211_ATTR_REG_ALPHA2]) ALOGI("Country : %c%c", code[0], code[1]); if(mHandler.on_country_code_changed) { @@ -172,10 +174,10 @@ int IfaceEventHandlerCommand::get_request_id() wifiEventHandler::wifiEventHandler(wifi_handle handle, int id, u32 subcmd) : WifiCommand(handle, id) { - ALOGD("wifiEventHandler %p constructed", this); - registerHandler(mSubcmd); mRequestId = id; mSubcmd = subcmd; + registerHandler(mSubcmd); + ALOGD("wifiEventHandler %p constructed", this); } wifiEventHandler::~wifiEventHandler() |