From c6e2679d2701404570f4f164e09dbdab92a1dafe Mon Sep 17 00:00:00 2001 From: Vinit Deshpande Date: Tue, 7 Jul 2015 14:52:54 -0700 Subject: Fix incorrect wifi_cleanup The cleanup needs to cancel commands, not the event handlers; and needs a while loop instead of a for loop. Also added command names to identify which commands are causing problems. Bug: 22302517 Change-Id: I93c3e51f7cd3ad62c1a34eeb5708d9552e37342b --- bcmdhd/wifi_hal/cpp_bindings.h | 14 ++++++++++---- bcmdhd/wifi_hal/gscan.cpp | 34 ++++++++++++++++++---------------- bcmdhd/wifi_hal/link_layer_stats.cpp | 2 +- bcmdhd/wifi_hal/rtt.cpp | 6 +++--- bcmdhd/wifi_hal/wifi_hal.cpp | 35 +++++++++++++++++++++++++---------- bcmdhd/wifi_hal/wifi_logger.cpp | 20 +++++++++++--------- bcmdhd/wifi_hal/wifi_offload.cpp | 8 ++++---- 7 files changed, 72 insertions(+), 47 deletions(-) diff --git a/bcmdhd/wifi_hal/cpp_bindings.h b/bcmdhd/wifi_hal/cpp_bindings.h index 491c398..250976e 100644 --- a/bcmdhd/wifi_hal/cpp_bindings.h +++ b/bcmdhd/wifi_hal/cpp_bindings.h @@ -213,6 +213,7 @@ private: class WifiCommand { protected: + const char *mType; hal_info *mInfo; WifiRequest mMsg; Condition mCondition; @@ -220,16 +221,17 @@ protected: interface_info *mIfaceInfo; int mRefs; public: - WifiCommand(wifi_handle handle, wifi_request_id id) - : mMsg(getHalInfo(handle)->nl80211_family_id), mId(id), mRefs(1) + WifiCommand(const char *type, wifi_handle handle, wifi_request_id id) + : mType(type), mMsg(getHalInfo(handle)->nl80211_family_id), mId(id), mRefs(1) { mIfaceInfo = NULL; mInfo = getHalInfo(handle); // ALOGD("WifiCommand %p created, mInfo = %p, mIfaceInfo = %p", this, mInfo, mIfaceInfo); } - WifiCommand(wifi_interface_handle iface, wifi_request_id id) - : mMsg(getHalInfo(iface)->nl80211_family_id, getIfaceInfo(iface)->id), mId(id), mRefs(1) + WifiCommand(const char *type, wifi_interface_handle iface, wifi_request_id id) + : mType(type), mMsg(getHalInfo(iface)->nl80211_family_id, getIfaceInfo(iface)->id), + mId(id), mRefs(1) { mIfaceInfo = getIfaceInfo(iface); mInfo = getHalInfo(iface); @@ -244,6 +246,10 @@ public: return mId; } + const char *getType() { + return mType; + } + virtual void addRef() { int refs = __sync_add_and_fetch(&mRefs, 1); // ALOGD("addRef: WifiCommand %p has %d references", this, refs); diff --git a/bcmdhd/wifi_hal/gscan.cpp b/bcmdhd/wifi_hal/gscan.cpp index f919150..7edeb6c 100644 --- a/bcmdhd/wifi_hal/gscan.cpp +++ b/bcmdhd/wifi_hal/gscan.cpp @@ -150,7 +150,7 @@ class GetCapabilitiesCommand : public WifiCommand wifi_gscan_capabilities *mCapabilities; public: GetCapabilitiesCommand(wifi_interface_handle iface, wifi_gscan_capabilities *capabitlites) - : WifiCommand(iface, 0), mCapabilities(capabitlites) + : WifiCommand("GetGscanCapabilitiesCommand", iface, 0), mCapabilities(capabitlites) { memset(mCapabilities, 0, sizeof(*mCapabilities)); } @@ -208,8 +208,8 @@ class GetChannelListCommand : public WifiCommand public: GetChannelListCommand(wifi_interface_handle iface, wifi_channel *channel_buf, int *ch_num, int num_max_ch, int band) - : WifiCommand(iface, 0), channels(channel_buf), max_channels(num_max_ch), num_channels(ch_num), - band(band) + : WifiCommand("GetChannelListCommand", iface, 0), channels(channel_buf), + max_channels(num_max_ch), num_channels(ch_num), band(band) { memset(channels, 0, sizeof(wifi_channel) * max_channels); } @@ -351,7 +351,7 @@ class FullScanResultsCommand : public WifiCommand public: FullScanResultsCommand(wifi_interface_handle iface, int id, int *params, wifi_scan_result_handler handler) - : WifiCommand(iface, id), mParams(params), mHandler(handler) + : WifiCommand("FullScanResultsCommand", iface, id), mParams(params), mHandler(handler) { } int createRequest(WifiRequest& request, int subcmd, int enable) { @@ -453,7 +453,7 @@ class ScanCommand : public WifiCommand public: ScanCommand(wifi_interface_handle iface, int id, wifi_scan_cmd_params *params, wifi_scan_result_handler handler) - : WifiCommand(iface, id), mParams(params), mHandler(handler), + : WifiCommand("ScanCommand", iface, id), mParams(params), mHandler(handler), mLocalFullScanBuckets(0) { } @@ -758,7 +758,7 @@ wifi_error wifi_stop_gscan(wifi_request_id id, wifi_interface_handle iface) wifi_handle handle = getWifiHandle(iface); ALOGV("Stopping GScan, wifi_request_id = %d, halHandle = %p", id, handle); - if(id == -1) { + if (id == -1) { wifi_scan_result_handler handler; wifi_scan_cmd_params dummy_params; wifi_handle handle = getWifiHandle(iface); @@ -830,7 +830,7 @@ class GetScanResultsCommand : public WifiCommand { public: GetScanResultsCommand(wifi_interface_handle iface, byte flush, wifi_cached_scan_results *results, int max, int *num) - : WifiCommand(iface, -1), mScans(results), mMax(max), mNum(num), + : WifiCommand("GetScanResultsCommand", iface, -1), mScans(results), mMax(max), mNum(num), mRetrieved(0), mFlush(flush), mCompleted(0), mNextScanResult(0) { } @@ -996,7 +996,7 @@ private: public: BssidHotlistCommand(wifi_interface_handle handle, int id, wifi_bssid_hotlist_params params, wifi_hotlist_ap_found_handler handler) - : WifiCommand(handle, id), mParams(params), mHandler(handler) + : WifiCommand("BssidHotlistCommand", handle, id), mParams(params), mHandler(handler) { } int createSetupRequest(WifiRequest& request) { @@ -1164,7 +1164,7 @@ private: public: ePNOCommand(wifi_interface_handle handle, int id, int num_networks, wifi_epno_network *networks, wifi_epno_handler handler) - : WifiCommand(handle, id), mHandler(handler) + : WifiCommand("ePNOCommand", handle, id), mHandler(handler) { ssid_list = networks; num_ssid = num_networks; @@ -1359,7 +1359,8 @@ private: public: SignificantWifiChangeCommand(wifi_interface_handle handle, int id, wifi_significant_change_params params, wifi_significant_change_handler handler) - : WifiCommand(handle, id), mParams(params), mHandler(handler) + : WifiCommand("SignificantWifiChangeCommand", handle, id), mParams(params), + mHandler(handler) { } int createSetupRequest(WifiRequest& request) { @@ -1582,7 +1583,7 @@ private: public: SSIDWhitelistCommand(wifi_interface_handle handle, int id, int num_networks, wifi_ssid *ssids) - : WifiCommand(handle, id), mNumNetworks(num_networks), mSSIDs(ssids) + : WifiCommand("SSIDWhitelistCommand", handle, id), mNumNetworks(num_networks), mSSIDs(ssids) { } int createRequest(WifiRequest& request) { @@ -1671,7 +1672,7 @@ private: wifi_roam_params *mParams; public: RoamParamsCommand(wifi_interface_handle handle, int id, wifi_roam_params *params) - : WifiCommand(handle, id), mParams(params) + : WifiCommand("RoamParamsCommand", handle, id), mParams(params) { } int createRequest(WifiRequest& request) { @@ -1763,7 +1764,7 @@ private: int mEnable; public: LazyRoamCommand(wifi_interface_handle handle, int id, int enable) - : WifiCommand(handle, id), mEnable(enable) + : WifiCommand("LazyRoamCommand", handle, id), mEnable(enable) { } int createRequest(WifiRequest& request) { @@ -1829,7 +1830,7 @@ private: public: BssidBlacklistCommand(wifi_interface_handle handle, int id, wifi_bssid_params *params) - : WifiCommand(handle, id), mParams(params) + : WifiCommand("BssidBlacklistCommand", handle, id), mParams(params) { } int createRequest(WifiRequest& request) { int result = request.create(GOOGLE_OUI, WIFI_SUBCMD_SET_BSSID_BLACKLIST); @@ -1908,7 +1909,7 @@ private: public: BssidPreferenceCommand(wifi_interface_handle handle, int id, int num_bssid, wifi_bssid_preference *prefs) - : WifiCommand(handle, id), mNumBssid(num_bssid), mPrefs(prefs) + : WifiCommand("BssidPreferenceCommand", handle, id), mNumBssid(num_bssid), mPrefs(prefs) { } int createRequest(WifiRequest& request) { @@ -2008,7 +2009,8 @@ class AnqpoConfigureCommand : public WifiCommand public: AnqpoConfigureCommand(wifi_request_id id, wifi_interface_handle iface, int num, wifi_passpoint_network *hs_list, wifi_passpoint_event_handler handler) - : WifiCommand(iface, id), num_hs(num), mNetworks(hs_list), mHandler(handler) + : WifiCommand("AnqpoConfigureCommand", iface, id), num_hs(num), mNetworks(hs_list), + mHandler(handler) { } diff --git a/bcmdhd/wifi_hal/link_layer_stats.cpp b/bcmdhd/wifi_hal/link_layer_stats.cpp index 25502af..170c791 100644 --- a/bcmdhd/wifi_hal/link_layer_stats.cpp +++ b/bcmdhd/wifi_hal/link_layer_stats.cpp @@ -36,7 +36,7 @@ class GetLinkStatsCommand : public WifiCommand wifi_stats_result_handler mHandler; public: GetLinkStatsCommand(wifi_interface_handle iface, wifi_stats_result_handler handler) - : WifiCommand(iface, 0), mHandler(handler) + : WifiCommand("GetLinkStatsCommand", iface, 0), mHandler(handler) { } virtual int create() { diff --git a/bcmdhd/wifi_hal/rtt.cpp b/bcmdhd/wifi_hal/rtt.cpp index 9812fe5..f77fdb0 100644 --- a/bcmdhd/wifi_hal/rtt.cpp +++ b/bcmdhd/wifi_hal/rtt.cpp @@ -115,7 +115,7 @@ class GetRttCapabilitiesCommand : public WifiCommand wifi_rtt_capabilities *mCapabilities; public: GetRttCapabilitiesCommand(wifi_interface_handle iface, wifi_rtt_capabilities *capabitlites) - : WifiCommand(iface, 0), mCapabilities(capabitlites) + : WifiCommand("GetRttCapabilitiesCommand", iface, 0), mCapabilities(capabitlites) { memset(mCapabilities, 0, sizeof(*mCapabilities)); } @@ -170,7 +170,7 @@ class RttCommand : public WifiCommand public: RttCommand(wifi_interface_handle iface, int id, unsigned num_rtt_config, wifi_rtt_config rtt_config[], wifi_rtt_event_handler handler) - : WifiCommand(iface, id), numRttParams(num_rtt_config), rttParams(rtt_config), + : WifiCommand("RttCommand", iface, id), numRttParams(num_rtt_config), rttParams(rtt_config), rttHandler(handler) { memset(rttResults, 0, sizeof(rttResults)); @@ -180,7 +180,7 @@ public: } RttCommand(wifi_interface_handle iface, int id) - : WifiCommand(iface, id) + : WifiCommand("RttCommand", iface, id) { currentIdx = 0; mCompleted = 0; diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp index 1d02b7b..8caa1d6 100644 --- a/bcmdhd/wifi_hal/wifi_hal.cpp +++ b/bcmdhd/wifi_hal/wifi_hal.cpp @@ -292,18 +292,32 @@ void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler) pthread_mutex_lock(&info->cb_lock); - for (int i = 0; i < info->num_event_cb; i++) { - cb_info *cbi = &(info->event_cb[i]); - WifiCommand *cmd = (WifiCommand *)cbi->cb_arg; + int bad_commands = 0; + + while (info->num_cmd > bad_commands) { + int num_cmd = info->num_cmd; + cmd_info *cmdi = &(info->cmd[bad_commands]); + WifiCommand *cmd = cmdi->cmd; if (cmd != NULL) { - cmd->addRef(); + ALOGE("Cancelling command %p:%s", cmd, cmd->getType()); pthread_mutex_unlock(&info->cb_lock); cmd->cancel(); pthread_mutex_lock(&info->cb_lock); + /* release reference added when command is saved */ cmd->releaseRef(); + if (num_cmd == info->num_cmd) { + ALOGE("Cancelling command %p:%s did not work", cmd, cmd->getType()); + bad_commands++; + } } } + for (int i = 0; i < info->num_event_cb; i++) { + cb_info *cbi = &(info->event_cb[i]); + WifiCommand *cmd = (WifiCommand *)cbi->cb_arg; + ALOGE("Leaked command %p:%s", cmd, cmd->getType()); + } + pthread_mutex_unlock(&info->cb_lock); if (write(info->cleanup_socks[0], "T", 1) < 1) { @@ -459,7 +473,7 @@ private: int mId; public: GetMulticastIdCommand(wifi_handle handle, const char *name, const char *group) - : WifiCommand(handle, 0) + : WifiCommand("GetMulticastIdCommand", handle, 0) { mName = name; mGroup = group; @@ -534,7 +548,7 @@ private: int set_size_max; public: SetPnoMacAddrOuiCommand(wifi_interface_handle handle, oui scan_oui) - : WifiCommand(handle, 0) + : WifiCommand("SetPnoMacAddrOuiCommand", handle, 0) { mOui = scan_oui; } @@ -586,7 +600,7 @@ private: u32 mNoDfs; public: SetNodfsCommand(wifi_interface_handle handle, u32 nodfs) - : WifiCommand(handle, 0) { + : WifiCommand("SetNodfsCommand", handle, 0) { mNoDfs = nodfs; } virtual int create() { @@ -614,7 +628,7 @@ private: const char *mCountryCode; public: SetCountryCodeCommand(wifi_interface_handle handle, const char *country_code) - : WifiCommand(handle, 0) { + : WifiCommand("SetCountryCodeCommand", handle, 0) { mCountryCode = country_code; } virtual int create() { @@ -646,7 +660,8 @@ private: public: SetRSSIMonitorCommand(wifi_request_id id, wifi_interface_handle handle, s8 max_rssi, s8 min_rssi, wifi_rssi_event_handler eh) - : WifiCommand(handle, id), mMax_rssi(max_rssi), mMin_rssi(min_rssi), mHandler(eh) + : WifiCommand("SetRSSIMonitorCommand", handle, id), mMax_rssi(max_rssi), mMin_rssi + (min_rssi), mHandler(eh) { } int createRequest(WifiRequest& request, int enable) { @@ -764,7 +779,7 @@ private: public: GetFeatureSetCommand(wifi_interface_handle handle, int feature, feature_set *set, feature_set set_matrix[], int *size, int max_size) - : WifiCommand(handle, 0) + : WifiCommand("GetFeatureSetCommand", handle, 0) { feature_type = feature; fset = set; diff --git a/bcmdhd/wifi_hal/wifi_logger.cpp b/bcmdhd/wifi_hal/wifi_logger.cpp index 1ef307c..5d4894b 100644 --- a/bcmdhd/wifi_hal/wifi_logger.cpp +++ b/bcmdhd/wifi_hal/wifi_logger.cpp @@ -94,33 +94,34 @@ public: // constructor for get version DebugCommand(wifi_interface_handle iface, char *buffer, int *buffer_size, GetCmdType cmdType) - : WifiCommand(iface, 0), mBuff(buffer), mBuffSize(buffer_size), mType(cmdType) + : WifiCommand("DebugCommand", iface, 0), mBuff(buffer), mBuffSize(buffer_size), mType + (cmdType) { memset(mBuff, 0, *mBuffSize); } // constructor for ring data DebugCommand(wifi_interface_handle iface, char *ring_name, GetCmdType cmdType) - : WifiCommand(iface, 0), mRingName(ring_name), mType(cmdType) + : WifiCommand("DebugCommand", iface, 0), mRingName(ring_name), mType(cmdType) { } // constructor for ring status DebugCommand(wifi_interface_handle iface, u32 *num_rings, wifi_ring_buffer_status *status, GetCmdType cmdType) - : WifiCommand(iface, 0), mNumRings(num_rings), mStatus(status), mType(cmdType) + : WifiCommand("DebugCommand", iface, 0), mNumRings(num_rings), mStatus(status), mType(cmdType) { memset(mStatus, 0, sizeof(wifi_ring_buffer_status) * (*mNumRings)); } // constructor for feature set DebugCommand(wifi_interface_handle iface, unsigned int *support, GetCmdType cmdType) - : WifiCommand(iface, 0), mSupport(support), mType(cmdType) + : WifiCommand("DebugCommand", iface, 0), mSupport(support), mType(cmdType) { } // constructor for ring params DebugCommand(wifi_interface_handle iface, u32 verbose_level, u32 flags, u32 max_interval_sec, u32 min_data_size, char *ring_name, GetCmdType cmdType) - : WifiCommand(iface, 0), mVerboseLevel(verbose_level), mFlags(flags), + : WifiCommand("DebugCommand", iface, 0), mVerboseLevel(verbose_level), mFlags(flags), mMaxIntervalSec(max_interval_sec), mMinDataSize(min_data_size), mRingName(ring_name), mType(cmdType) { } @@ -444,10 +445,10 @@ class SetLogHandler : public WifiCommand public: SetLogHandler(wifi_interface_handle iface, int id, wifi_ring_buffer_data_handler handler) - : WifiCommand(iface, id), mHandler(handler) + : WifiCommand("SetLogHandler", iface, id), mHandler(handler) { } SetLogHandler(wifi_interface_handle iface, int id) - : WifiCommand(iface, id) + : WifiCommand("SetLogHandler", iface, id) { } int start() { @@ -564,7 +565,8 @@ class SetAlertHandler : public WifiCommand public: SetAlertHandler(wifi_interface_handle iface, int id, wifi_alert_handler handler) - : WifiCommand(iface, id), mHandler(handler), mBuffSize(0), mBuff(NULL), mErrCode(0) + : WifiCommand("SetAlertHandler", iface, id), mHandler(handler), mBuffSize(0), mBuff(NULL), + mErrCode(0) { } int start() { @@ -706,7 +708,7 @@ class MemoryDumpCommand: public WifiCommand public: MemoryDumpCommand(wifi_interface_handle iface, wifi_firmware_memory_dump_handler handler) - : WifiCommand(iface, 0), mHandler(handler), mBuffSize(0), mBuff(NULL) + : WifiCommand("MemoryDumpCommand", iface, 0), mHandler(handler), mBuffSize(0), mBuff(NULL) { } int start() { diff --git a/bcmdhd/wifi_hal/wifi_offload.cpp b/bcmdhd/wifi_hal/wifi_offload.cpp index 936ca40..41cc13f 100644 --- a/bcmdhd/wifi_hal/wifi_offload.cpp +++ b/bcmdhd/wifi_hal/wifi_offload.cpp @@ -63,14 +63,14 @@ public: // constructor for start sending MKeepAliveCommand(wifi_interface_handle iface, u8 index, u8 *ip_packet, u16 ip_packet_len, u8 *src_mac_addr, u8 *dst_mac_addr, u32 period_msec, GetCmdType cmdType) - : WifiCommand(iface, 0), mIndex(index), mIpPkt(ip_packet), mIpPktLen(ip_packet_len), - mSrcMacAddr(src_mac_addr), mDstMacAddr(dst_mac_addr), mPeriodMsec(period_msec), - mType(cmdType) + : WifiCommand("MKeepAliveCommand", iface, 0), mIndex(index), mIpPkt(ip_packet), + mIpPktLen(ip_packet_len), mSrcMacAddr(src_mac_addr), mDstMacAddr(dst_mac_addr), + mPeriodMsec(period_msec), mType(cmdType) { } // constructor for stop sending MKeepAliveCommand(wifi_interface_handle iface, u8 index, GetCmdType cmdType) - : WifiCommand(iface, 0), mIndex(index), mType(cmdType) + : WifiCommand("MKeepAliveCommand", iface, 0), mIndex(index), mType(cmdType) { } int createRequest(WifiRequest &request) { -- cgit v1.1 From b97f77076b76938fc4a9986f8df922f654b60961 Mon Sep 17 00:00:00 2001 From: Vinit Deshpande Date: Thu, 16 Jul 2015 11:30:21 -0700 Subject: Fix couple of issues with unregistering event handlers First, on Hammerhead, we don't unregister GOOGLE_DEBUG_RING_EVENT if driver command fails - that's not correct. Also fixed a one-off error in unregistering event handlers. Bug: 22523219 Change-Id: Idaf27bc14f13d21e18cec512db8f8c3590895c66 --- bcmdhd/wifi_hal/common.cpp | 2 +- bcmdhd/wifi_hal/wifi_logger.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bcmdhd/wifi_hal/common.cpp b/bcmdhd/wifi_hal/common.cpp index fc81d61..f0184d6 100644 --- a/bcmdhd/wifi_hal/common.cpp +++ b/bcmdhd/wifi_hal/common.cpp @@ -180,7 +180,7 @@ WifiCommand *wifi_unregister_cmd(wifi_handle handle, int id) for (int i = 0; i < info->num_cmd; i++) { if (info->cmd[i].id == id) { cmd = info->cmd[i].cmd; - memmove(&info->cmd[i], &info->cmd[i+1], (info->num_cmd - i) * sizeof(cmd_info)); + memmove(&info->cmd[i], &info->cmd[i+1], (info->num_cmd - i - 1) * sizeof(cmd_info)); info->num_cmd--; ALOGV("Successfully removed command %d: %p from %d", id, cmd, i); break; diff --git a/bcmdhd/wifi_hal/wifi_logger.cpp b/bcmdhd/wifi_hal/wifi_logger.cpp index 7f23df5..be1467f 100644 --- a/bcmdhd/wifi_hal/wifi_logger.cpp +++ b/bcmdhd/wifi_hal/wifi_logger.cpp @@ -458,9 +458,11 @@ public: /* Send a command to driver to stop generating logging events */ ALOGV("Clear loghandler"); + /* unregister event handler */ + unregisterVendorHandler(GOOGLE_OUI, GOOGLE_DEBUG_RING_EVENT); + WifiRequest request(familyId(), ifaceId()); int result = request.create(GOOGLE_OUI, LOGGER_RESET_LOGGING); - if (result != WIFI_SUCCESS) { ALOGE("failed to create reset request; result = %d", result); return result; @@ -472,8 +474,6 @@ public: return result; } - /* unregister event handler */ - unregisterVendorHandler(GOOGLE_OUI, GOOGLE_DEBUG_RING_EVENT); ALOGD("Success to clear loghandler"); return WIFI_SUCCESS; } -- cgit v1.1 From bc349f9f134cf04f4be05a4eb8094822eb45a413 Mon Sep 17 00:00:00 2001 From: Chilam Ng Date: Tue, 14 Jul 2015 18:04:02 -0700 Subject: net:wireless:bcmdhd: Update bcm4354/56 FW (7.35.79.94) Link stats: fixed on_time accuracy upon connection/disconnection Bug 21613534 Basic SVT Test STA connection test Change-Id: I40178497a5590348d77fc883e7c7d6c4042b2a89 Signed-off-by: Chilam Ng --- bcmdhd/firmware/bcm4354/fw_bcm4354.bin | Bin 639426 -> 639570 bytes bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin | Bin 547882 -> 550776 bytes bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin | Bin 587120 -> 587448 bytes bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin | Bin 670650 -> 671458 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4354/fw_bcm4354.bin b/bcmdhd/firmware/bcm4354/fw_bcm4354.bin index ccbe117..686a3f9 100644 Binary files a/bcmdhd/firmware/bcm4354/fw_bcm4354.bin and b/bcmdhd/firmware/bcm4354/fw_bcm4354.bin differ diff --git a/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin b/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin index dab10da..ff50a7c 100644 Binary files a/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin and b/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin differ diff --git a/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin b/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin index da5843d..c8e1cae 100644 Binary files a/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin and b/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin differ diff --git a/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin b/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin index 5697052..67029d8 100644 Binary files a/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin and b/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin differ -- cgit v1.1 From 340c22b114039948cbdc124797fd84d58a80462c Mon Sep 17 00:00:00 2001 From: Ashwin Date: Thu, 6 Aug 2015 12:57:31 -0700 Subject: RSSI monitor cmd cleanup Cleanup RSSI monitor cmd if it fails Bug 22826644 Change-Id: Iaca8201ea32d051bb2afd34e28257fc828908599 Signed-off-by: Ashwin --- bcmdhd/wifi_hal/wifi_hal.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp index b27bac2..09738a3 100644 --- a/bcmdhd/wifi_hal/wifi_hal.cpp +++ b/bcmdhd/wifi_hal/wifi_hal.cpp @@ -1009,7 +1009,12 @@ static wifi_error wifi_start_rssi_monitoring(wifi_request_id id, wifi_interface_ wifi_handle handle = getWifiHandle(iface); SetRSSIMonitorCommand *cmd = new SetRSSIMonitorCommand(id, iface, max_rssi, min_rssi, eh); wifi_register_cmd(handle, id, cmd); - return (wifi_error)cmd->start(); + + wifi_error result = (wifi_error)cmd->start(); + if (result != WIFI_SUCCESS) { + wifi_unregister_cmd(handle, id); + } + return result; } -- cgit v1.1 From 57ffe4477b8e4629893df5824b3982eb1b352897 Mon Sep 17 00:00:00 2001 From: Insun Song Date: Thu, 6 Aug 2015 17:01:33 -0700 Subject: net: wireless: bcmdhd: update bcm4358 FW (7.112.100.15) 1. bug : 22611777 => adding JP/991 ccode for outdoor/nonDFS/No-A-band channels of SOFTAP Change-Id: If5601c0ba7584a33da3fc336ece8a87e7a792ad2 Signed-off-by: Insun Song --- bcmdhd/firmware/bcm4358/fw_bcm4358.bin | Bin 595803 -> 632403 bytes bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin | Bin 504562 -> 549285 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin index 56cb61f..99e6f7a 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin differ diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin index ab80660..128b26d 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin differ -- cgit v1.1 From 6f153556f12809db7a8376550674f660b8060438 Mon Sep 17 00:00:00 2001 From: Ed Tam Date: Wed, 12 Aug 2015 23:14:09 -0700 Subject: Revert "net: wireless: bcmdhd: update bcm4358 FW (7.112.100.15)" This reverts commit 57ffe4477b8e4629893df5824b3982eb1b352897. Bug: 23163857 Change-Id: Ie2f1facffb162508ac32bbab96a1f3deb42379cf --- bcmdhd/firmware/bcm4358/fw_bcm4358.bin | Bin 632403 -> 595803 bytes bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin | Bin 549285 -> 504562 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin index 99e6f7a..56cb61f 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin differ diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin index 128b26d..ab80660 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin differ -- cgit v1.1 From c9a71e699e03eb1c2c9ffddafc30fc0d4f02c18e Mon Sep 17 00:00:00 2001 From: Insun Song Date: Thu, 13 Aug 2015 19:16:02 -0700 Subject: net: wireless: bcmdhd: update bcm4358 FW(7.112.100.17) 1) bug=23163857 revert logability feature due to JNI crash. Change-Id: I2f0ace60c9ac5e2dc2080d261eb1a7e711049ce3 Signed-off-by: Insun Song --- bcmdhd/firmware/bcm4358/fw_bcm4358.bin | Bin 595803 -> 620266 bytes bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin | Bin 504562 -> 549509 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin index 56cb61f..d4f83c9 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin differ diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin index ab80660..50f282b 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin differ -- cgit v1.1 From 69ef000598ac668bffd4c93c13c8fc58e8c16dd6 Mon Sep 17 00:00:00 2001 From: Insun Song Date: Thu, 13 Aug 2015 19:16:02 -0700 Subject: net: wireless: bcmdhd: update bcm4358 FW(7.112.100.17) 1) bug=23163857 revert logability feature due to JNI crash. Change-Id: I2f0ace60c9ac5e2dc2080d261eb1a7e711049ce3 Signed-off-by: Insun Song --- bcmdhd/firmware/bcm4358/fw_bcm4358.bin | Bin 595803 -> 620266 bytes bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin | Bin 504562 -> 549509 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin index 56cb61f..d4f83c9 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin differ diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin index ab80660..50f282b 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin differ -- cgit v1.1 From 992eae272b20042d1048a76a1a1b06818d65866a Mon Sep 17 00:00:00 2001 From: Insun Song Date: Tue, 25 Aug 2015 11:10:53 -0700 Subject: net: wireless: bcmdhd: update bcm4358 FW (7.112.100.26) bug=23328094 priortize EAPOL packets to avoid auth failure. Change-Id: Ife8aa41c0d6ef91d47f29a674319bdf554837e92 Signed-off-by: Insun Song --- bcmdhd/firmware/bcm4358/fw_bcm4358.bin | Bin 620266 -> 636836 bytes bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin | Bin 549509 -> 552717 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin index d4f83c9..25fd8ec 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin differ diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin index 50f282b..be4fae9 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin differ -- cgit v1.1 From 2d571e7e7a7164fd51fab006e74630f5b4c1eee5 Mon Sep 17 00:00:00 2001 From: Ritter Yeh Date: Thu, 27 Aug 2015 14:29:02 -0700 Subject: net:wireless:bcmdhd: Update bcm4354 FW(7.35.79.101) 1) Remove channel 120/124/128 from US/0 Bug: 23218044 Change-Id: I97d1095f7d38bb2e90cc241d9321603192e859c3 Signed-off-by: Ritter Yeh --- bcmdhd/firmware/bcm4354/fw_bcm4354.bin | Bin 625191 -> 625336 bytes bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin | Bin 548030 -> 548019 bytes 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bcmdhd/firmware/bcm4354/fw_bcm4354.bin mode change 100644 => 100755 bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin diff --git a/bcmdhd/firmware/bcm4354/fw_bcm4354.bin b/bcmdhd/firmware/bcm4354/fw_bcm4354.bin old mode 100644 new mode 100755 index 09eff19..d7ddd56 Binary files a/bcmdhd/firmware/bcm4354/fw_bcm4354.bin and b/bcmdhd/firmware/bcm4354/fw_bcm4354.bin differ diff --git a/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin b/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin old mode 100644 new mode 100755 index a3aedd9..e5bec53 Binary files a/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin and b/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin differ -- cgit v1.1 From e900b04a91fd87e4d706be7ae3499d5fb9995188 Mon Sep 17 00:00:00 2001 From: Kevin Cernekee Date: Sun, 30 Aug 2015 10:42:04 -0700 Subject: wifi_hal: Fix array overflow retrieving gscan results WifiNative (in frameworks) allocates a 64-element wifi_cached_scan_results array on the stack. The bcmdhd HAL can write past the end of this array if the kernel provides excess scan data. Fix the sanity check so that it terminates processing if it is out of space. Bug: chrome-os-partner:44402 Change-Id: I99a9bcb180c3aafb294b4af85727e9ec412312df --- bcmdhd/wifi_hal/gscan.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bcmdhd/wifi_hal/gscan.cpp b/bcmdhd/wifi_hal/gscan.cpp index 8a21a0d..9f5669a 100644 --- a/bcmdhd/wifi_hal/gscan.cpp +++ b/bcmdhd/wifi_hal/gscan.cpp @@ -935,6 +935,10 @@ public: num = it2.get_u32(); ALOGV("retrieved num_results: %d", num); } else if (it2.get_type() == GSCAN_ATTRIBUTE_SCAN_RESULTS) { + if (mRetrieved >= mMax) { + ALOGW("Stored %d scans, ignoring excess results", mRetrieved); + break; + } num = it2.get_len() / sizeof(wifi_scan_result); num = min(MAX_RESULTS - mNextScanResult, num); num = min((int)MAX_AP_CACHE_PER_SCAN, num); @@ -956,9 +960,6 @@ public: &(mScanResults[mNextScanResult]), num * sizeof(wifi_scan_result)); mNextScanResult += num; mRetrieved++; - if (mRetrieved >= mMax && it.has_next()) { - ALOGW("Ignoring attributes after this scan"); - } } else { ALOGW("Ignoring invalid attribute type = %d, size = %d", it.get_type(), it.get_len()); -- cgit v1.1 From de1c9aa3d3ac645f09507d1ff500fc4dc018624d Mon Sep 17 00:00:00 2001 From: Kevin Cernekee Date: Sun, 30 Aug 2015 10:49:45 -0700 Subject: Fix verbose log flag Per system/core/include/log/log.h, ALOGV is compiled out if LOG_NDEBUG is 1. Bug: chrome-os-partner:44402 Change-Id: Ib57c01a11f875376c951f21c4553ac5a33be110d --- bcmdhd/wifi_hal/gscan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bcmdhd/wifi_hal/gscan.cpp b/bcmdhd/wifi_hal/gscan.cpp index 9f5669a..31d35a1 100644 --- a/bcmdhd/wifi_hal/gscan.cpp +++ b/bcmdhd/wifi_hal/gscan.cpp @@ -19,7 +19,7 @@ #include "sync.h" #define LOG_TAG "WifiHAL" -//#define LOG_NDEBUG 1 //uncomment to enable verbose logging +//#define LOG_NDEBUG 0 //uncomment to enable verbose logging #include -- cgit v1.1 From 3559091380edc013862e07f2ee3be54ac2cb77d6 Mon Sep 17 00:00:00 2001 From: Insun Song Date: Thu, 27 Aug 2015 12:22:00 -0700 Subject: net: wireless: bcmdhd: update bcm4358 FW (7.112.100.27) bug=23590957 fix for FCC bandedge txpower measurement fail. Signed-off-by: Insun Song Change-Id: I50a0c0b1a76e37595f43373335c23eb702d1a636 --- bcmdhd/firmware/bcm4358/fw_bcm4358.bin | Bin 636836 -> 638488 bytes bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin | Bin 552717 -> 554369 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin index 25fd8ec..41b02f3 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin differ diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin index be4fae9..bc836e6 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin differ -- cgit v1.1 From c666c14fbff83afee5f9b0003c19fd38f5464e50 Mon Sep 17 00:00:00 2001 From: Navtej Singh Mann Date: Wed, 2 Sep 2015 10:43:12 -0700 Subject: manual merge for N6 FW(7.35.79.100) 1. Fix roaming failure prevents entering PS mode BUG=23218044 From: https://partner-android-review.googlesource.com/#/c/376862/ Change-Id: I9d3ff06f353828c40840bf8e11aabeb6c924e795 --- bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin | Bin 587904 -> 588177 bytes bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin | Bin 660565 -> 660986 bytes 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin mode change 100755 => 100644 bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin diff --git a/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin b/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin old mode 100755 new mode 100644 index ff38ccb..977bc79 Binary files a/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin and b/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin differ diff --git a/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin b/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin old mode 100755 new mode 100644 index 98c6c48..8184b44 Binary files a/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin and b/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin differ -- cgit v1.1 From 84b4a2539edf9414b539c3c935084df376ba2d7a Mon Sep 17 00:00:00 2001 From: Navtej Singh Mann Date: Wed, 2 Sep 2015 11:14:14 -0700 Subject: manual merge for N5 FW(6.37.32.RC23.34.40) 1. Fix roaming failure prevents entering PS mode BUG=23218044 From: https://partner-android-review.googlesource.com/#/c/376862/ Change-Id: Ifd1d5396fb6bebcb3796ad1f7432de9969571afe --- bcmdhd/firmware/bcm4339/fw_bcmdhd.bin | Bin 562183 -> 562183 bytes bcmdhd/firmware/bcm4339/fw_bcmdhd_apsta.bin | Bin 500032 -> 500031 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4339/fw_bcmdhd.bin b/bcmdhd/firmware/bcm4339/fw_bcmdhd.bin index 044f73b..69f622a 100644 Binary files a/bcmdhd/firmware/bcm4339/fw_bcmdhd.bin and b/bcmdhd/firmware/bcm4339/fw_bcmdhd.bin differ diff --git a/bcmdhd/firmware/bcm4339/fw_bcmdhd_apsta.bin b/bcmdhd/firmware/bcm4339/fw_bcmdhd_apsta.bin index 5cf5df5..4546384 100644 Binary files a/bcmdhd/firmware/bcm4339/fw_bcmdhd_apsta.bin and b/bcmdhd/firmware/bcm4339/fw_bcmdhd_apsta.bin differ -- cgit v1.1 From 2964f106e21af9ef3daed9355b0bdb6551b84707 Mon Sep 17 00:00:00 2001 From: Insun Song Date: Thu, 27 Aug 2015 12:22:00 -0700 Subject: net: wireless: bcmdhd: update bcm4358 FW (7.112.100.27) bug=23590957 fix for FCC bandedge txpower measurement fail. Signed-off-by: Insun Song Change-Id: I50a0c0b1a76e37595f43373335c23eb702d1a636 --- bcmdhd/firmware/bcm4358/fw_bcm4358.bin | Bin 636836 -> 638488 bytes bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin | Bin 552717 -> 554369 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin index 25fd8ec..41b02f3 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin differ diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin index be4fae9..bc836e6 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin differ -- cgit v1.1 From 1b166fb091b262273e129c6019c4d07a5ded665d Mon Sep 17 00:00:00 2001 From: Navtej Singh Mann Date: Wed, 2 Sep 2015 18:44:10 -0700 Subject: fix scan_id and flag for ScanData bug: 23766442 Change-Id: I4455e11e079468236800c45f98c0394f3ce26e96 --- bcmdhd/wifi_hal/gscan.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bcmdhd/wifi_hal/gscan.cpp b/bcmdhd/wifi_hal/gscan.cpp index 8a21a0d..b41c16a 100644 --- a/bcmdhd/wifi_hal/gscan.cpp +++ b/bcmdhd/wifi_hal/gscan.cpp @@ -19,7 +19,7 @@ #include "sync.h" #define LOG_TAG "WifiHAL" -//#define LOG_NDEBUG 1 //uncomment to enable verbose logging +//#define LOG_NDEBUG 0 //uncomment to enable verbose logging #include @@ -923,8 +923,8 @@ public: mCompleted = it.get_u8(); ALOGV("retrieved mCompleted flag : %d", mCompleted); } else if (it.get_type() == GSCAN_ATTRIBUTE_SCAN_RESULTS || it.get_type() == 0) { + int scan_id = 0, flags = 0, num = 0; for (nl_iterator it2(it.get()); it2.has_next(); it2.next()) { - int scan_id = 0, flags = 0, num = 0; if (it2.get_type() == GSCAN_ATTRIBUTE_SCAN_ID) { scan_id = it2.get_u32(); ALOGV("retrieved scan_id : 0x%0x", scan_id); @@ -952,6 +952,7 @@ public: mScans[mRetrieved].scan_id = scan_id; mScans[mRetrieved].flags = flags; mScans[mRetrieved].num_results = num; + ALOGV("Setting result of scan_id : 0x%0x", mScans[mRetrieved].scan_id); memcpy(mScans[mRetrieved].results, &(mScanResults[mNextScanResult]), num * sizeof(wifi_scan_result)); mNextScanResult += num; -- cgit v1.1 From 56c89ca266b11be506192f3a13a1dba3f109c2cf Mon Sep 17 00:00:00 2001 From: Ashwin Date: Fri, 28 Aug 2015 14:47:42 -0700 Subject: Modify the cleanup procedure 1. Use the cleanup sockets to communicate to the evnt thread to exit and rx a ack for the same. 2. Added some missing cleanup on error during init. Bug: 23537437 Change-Id: Iac42e28c79e5ddf8c1a6a57719c3b08904330107 Signed-off-by: Ashwin --- bcmdhd/wifi_hal/common.h | 2 +- bcmdhd/wifi_hal/wifi_hal.cpp | 57 +++++++++++++++++++++++++++++++------------- 2 files changed, 42 insertions(+), 17 deletions(-) diff --git a/bcmdhd/wifi_hal/common.h b/bcmdhd/wifi_hal/common.h index 8c09c16..118e0fc 100644 --- a/bcmdhd/wifi_hal/common.h +++ b/bcmdhd/wifi_hal/common.h @@ -154,7 +154,7 @@ typedef struct { int cleanup_socks[2]; // sockets used to implement wifi_cleanup bool in_event_loop; // Indicates that event loop is active - bool clean_up; // Indication to clean up the socket + bool clean_up; // Indication to exit since cleanup has started wifi_internal_event_handler event_handler; // default event handler wifi_cleaned_up_handler cleaned_up_handler; // socket cleaned up handler diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp index 09738a3..00f35d9 100644 --- a/bcmdhd/wifi_hal/wifi_hal.cpp +++ b/bcmdhd/wifi_hal/wifi_hal.cpp @@ -179,12 +179,14 @@ wifi_error wifi_initialize(wifi_handle *handle) ALOGI("Creating socket"); if (socketpair(AF_UNIX, SOCK_STREAM, 0, info->cleanup_socks) == -1) { ALOGE("Could not create cleanup sockets"); + free(info); return WIFI_ERROR_UNKNOWN; } struct nl_sock *cmd_sock = wifi_create_nl_socket(WIFI_HAL_CMD_SOCK_PORT); if (cmd_sock == NULL) { ALOGE("Could not create handle"); + free(info); return WIFI_ERROR_UNKNOWN; } @@ -192,12 +194,16 @@ wifi_error wifi_initialize(wifi_handle *handle) if (event_sock == NULL) { ALOGE("Could not create handle"); nl_socket_free(cmd_sock); + free(info); return WIFI_ERROR_UNKNOWN; } struct nl_cb *cb = nl_socket_get_cb(event_sock); if (cb == NULL) { ALOGE("Could not create handle"); + nl_socket_free(cmd_sock); + nl_socket_free(event_sock); + free(info); return WIFI_ERROR_UNKNOWN; } @@ -288,9 +294,28 @@ static void internal_cleaned_up_handler(wifi_handle handle) void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler) { hal_info *info = getHalInfo(handle); + char buf[64]; + info->cleaned_up_handler = handler; + if (write(info->cleanup_socks[0], "Exit", 4) < 1) { + // As a fallback set the cleanup flag to TRUE + ALOGE("could not write to the cleanup socket"); + } else { + // Listen to the response + // Hopefully we dont get errors or get hung up + // Not much can be done in that case, but assume that + // it has rx'ed the Exit message to exit the thread. + // As a fallback set the cleanup flag to TRUE + memset(buf, 0, sizeof(buf)); + int result = read(info->cleanup_socks[0], buf, sizeof(buf)); + ALOGE("%s: Read after POLL returned %d, error no = %d", __FUNCTION__, result, errno); + if (strncmp(buf, "Done", 4) == 0) { + ALOGE("Event processing terminated"); + } else { + ALOGD("Rx'ed %s", buf); + } + } info->clean_up = true; - pthread_mutex_lock(&info->cb_lock); int bad_commands = 0; @@ -324,14 +349,8 @@ void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler) WifiCommand *cmd = (WifiCommand *)cbi->cb_arg; ALOGE("Leaked command %p", cmd); } - pthread_mutex_unlock(&info->cb_lock); - - if (write(info->cleanup_socks[0], "T", 1) < 1) { - ALOGE("could not write to cleanup socket"); - } else { - ALOGI("Wifi cleanup completed"); - } + internal_cleaned_up_handler(handle); } static int internal_pollin_handler(wifi_handle handle) @@ -384,16 +403,23 @@ void wifi_event_loop(wifi_handle handle) // ALOGI("Found some events!!!"); internal_pollin_handler(handle); } else if (pfd[1].revents & POLLIN) { - ALOGI("Got a signal to exit!!!"); + memset(buf, 0, sizeof(buf)); int result2 = read(pfd[1].fd, buf, sizeof(buf)); - ALOGE("Read after POLL returned %d, error no = %d", result2, errno); + ALOGE("%s: Read after POLL returned %d, error no = %d", __FUNCTION__, result2, errno); + if (strncmp(buf, "Exit", 4) == 0) { + ALOGD("Got a signal to exit!!!"); + if (write(pfd[1].fd, "Done", 4) < 1) { + ALOGE("could not write to the cleanup socket"); + } + break; + } else { + ALOGD("Rx'ed %s on the cleanup socket\n", buf); + } } else { ALOGE("Unknown event - %0x, %0x", pfd[0].revents, pfd[1].revents); } } while (!info->clean_up); - - ALOGI("Cleaning up"); - internal_cleaned_up_handler(handle); + ALOGI("Exit %s", __FUNCTION__); } /////////////////////////////////////////////////////////////////////////////////////// @@ -454,10 +480,9 @@ static int internal_valid_message_handler(nl_msg *msg, void *arg) if (cmd != NULL) { cmd->addRef(); } - pthread_mutex_unlock(&info->cb_lock); - - (*cb_func)(msg, cb_arg); + if (cb_func) + (*cb_func)(msg, cb_arg); if (cmd != NULL) { cmd->releaseRef(); } -- cgit v1.1 From fd3dddccd6d02b258a51a9ebe3e3c92f1a52c30c Mon Sep 17 00:00:00 2001 From: Insun Song Date: Thu, 17 Sep 2015 15:14:57 -0700 Subject: net: wireless: bcmdhd: update bcm4358 FW (7.112.100.32) updating FW country code regarding 5G channel policy. Bug: 22361348 Change-Id: Ibc51e81f04bf2a8a076a531eeb375fd0886aa737 Signed-off-by: Insun Song --- bcmdhd/firmware/bcm4358/fw_bcm4358.bin | Bin 638488 -> 628263 bytes bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin | Bin 554369 -> 557076 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin index 41b02f3..3753833 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin differ diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin index bc836e6..213a8dd 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin differ -- cgit v1.1 From fa540026ea0fb0861ccdd286f75deeee32a7a470 Mon Sep 17 00:00:00 2001 From: Insun Song Date: Thu, 17 Sep 2015 15:14:57 -0700 Subject: net: wireless: bcmdhd: update bcm4358 FW (7.112.100.32) updating FW country code regarding 5G channel policy. Bug: 22361348 Change-Id: Ibc51e81f04bf2a8a076a531eeb375fd0886aa737 Signed-off-by: Insun Song --- bcmdhd/firmware/bcm4358/fw_bcm4358.bin | Bin 638488 -> 628263 bytes bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin | Bin 554369 -> 557076 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin index 41b02f3..3753833 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin differ diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin index bc836e6..213a8dd 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin differ -- cgit v1.1 From 5cbe0dca22a31ea90201e47989df44b124f6f13e Mon Sep 17 00:00:00 2001 From: Ashwin Date: Sun, 20 Sep 2015 10:32:34 -0700 Subject: Fix crash caused in wifi_cleanup Check if ptr is NULL before dereferncing in debug print statements. Bug: 24196226 Change-Id: I96e811a1628f4966c9334a83fa3514775d861cf1 Signed-off-by: Ashwin --- bcmdhd/wifi_hal/wifi_hal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp index 00f35d9..28f5565 100644 --- a/bcmdhd/wifi_hal/wifi_hal.cpp +++ b/bcmdhd/wifi_hal/wifi_hal.cpp @@ -323,7 +323,7 @@ void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler) for (int i = 0; i < info->num_event_cb; i++) { cb_info *cbi = &(info->event_cb[i]); WifiCommand *cmd = (WifiCommand *)cbi->cb_arg; - ALOGE("Command left in event_cb %p:%s", cmd, cmd->getType()); + ALOGI("Command left in event_cb %p:%s", cmd, (cmd ? cmd->getType(): "")); } while (info->num_cmd > bad_commands) { @@ -331,14 +331,14 @@ void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler) cmd_info *cmdi = &(info->cmd[bad_commands]); WifiCommand *cmd = cmdi->cmd; if (cmd != NULL) { - ALOGD("Cancelling command %p:%s", cmd, cmd->getType()); + ALOGI("Cancelling command %p:%s", cmd, cmd->getType()); pthread_mutex_unlock(&info->cb_lock); cmd->cancel(); pthread_mutex_lock(&info->cb_lock); /* release reference added when command is saved */ cmd->releaseRef(); if (num_cmd == info->num_cmd) { - ALOGE("Cancelling command %p:%s did not work", cmd, cmd->getType()); + ALOGI("Cancelling command %p:%s did not work", cmd, (cmd ? cmd->getType(): "")); bad_commands++; } } -- cgit v1.1 From 304afe28c3127e94fd8f23c559b329458123fa6d Mon Sep 17 00:00:00 2001 From: Insun Song Date: Fri, 18 Sep 2015 10:59:13 -0700 Subject: net: wireless: bcmdhd: update bcm4358 FW (7.112.100.33) 5G channel disabled in XT/993 code for universal softAP use. Bug=24044521 Change-Id: I537f22ae48b71564331ec9d1a7c91b2c1b6ccc19 Signed-off-by: Insun Song --- bcmdhd/firmware/bcm4358/fw_bcm4358.bin | Bin 628263 -> 628278 bytes bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin | Bin 557076 -> 557077 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin index 3753833..72ad8ee 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin differ diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin index 213a8dd..f888a95 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin differ -- cgit v1.1 From d8c53dd012bf58f2860a21f1d4cce36d0373a502 Mon Sep 17 00:00:00 2001 From: Insun Song Date: Wed, 23 Sep 2015 22:38:29 -0700 Subject: net: wireless: bcmdhd: update bcm4358 FW (7.112.100.34) increase TX power limit 1.5dB for all 2.4G channels. bug=24312329 Change-Id: Iac35054b1078713db413471aecd445e5980dc93f Signed-off-by: Insun Song --- bcmdhd/firmware/bcm4358/fw_bcm4358.bin | Bin 628278 -> 628375 bytes bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin | Bin 557077 -> 557189 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin index 72ad8ee..7ce4626 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin differ diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin index f888a95..63d80bd 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin differ -- cgit v1.1 From 0ad6d3d6ca2981168596743dab5e1dd2e10cf5d8 Mon Sep 17 00:00:00 2001 From: Insun Song Date: Thu, 24 Sep 2015 14:08:17 -0700 Subject: net: wireless: bcmdhd: update bcm4358 FW (7.112.100.35) increase TX power limit 1.5dB for all 2.4G channels. BUG=24312329 Change-Id: I146fece7ec59bbc9652055672aec34aace2d729f Signed-off-by: Insun Song --- bcmdhd/firmware/bcm4358/fw_bcm4358.bin | Bin 628375 -> 605493 bytes bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin | Bin 557189 -> 557349 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin index 7ce4626..1c27926 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin differ diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin index 63d80bd..1e39c4d 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin differ -- cgit v1.1 From 783daf756a44890f8bb0fba2bbeda4fcc2632a1d Mon Sep 17 00:00:00 2001 From: Ramanan Rajeswaran Date: Mon, 28 Sep 2015 03:44:38 +0000 Subject: Revert "net: wireless: bcmdhd: update bcm4358 FW (7.112.100.35)" This reverts commit 0ad6d3d6ca2981168596743dab5e1dd2e10cf5d8. Change-Id: I28d184558e3b714aa22551382a8d577242eae82f --- bcmdhd/firmware/bcm4358/fw_bcm4358.bin | Bin 605493 -> 628375 bytes bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin | Bin 557349 -> 557189 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin index 1c27926..7ce4626 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin differ diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin index 1e39c4d..63d80bd 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin differ -- cgit v1.1 From 25e0325ec11c92eeee422dac842cebafd9f7cb89 Mon Sep 17 00:00:00 2001 From: Insun Song Date: Thu, 15 Oct 2015 19:09:24 -0700 Subject: net: wireless: bcmdhd: update bcm4358 FW (7.112.100.41) revert below fixes from 100.40 ver. 1. Fix for the where host posts more ioctl/event buffers more than FW could hold. BUG=24306599 2. Fix for corner case where scan wouldn't go through. BUG=24427813 Change-Id: Ia2cd845692da82ced20658045022e7dcafb639fc --- bcmdhd/firmware/bcm4358/fw_bcm4358.bin | Bin 628375 -> 628231 bytes bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin | Bin 557189 -> 557013 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin index 7ce4626..1cb7e0a 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358.bin differ diff --git a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin index 63d80bd..28e5902 100644 Binary files a/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin and b/bcmdhd/firmware/bcm4358/fw_bcm4358_ap.bin differ -- cgit v1.1