From: Roshan Pius Date: Wed, 1 Mar 2017 01:26:20 +0000 (+0000) Subject: wifi: Few minor interface changes am: 8c0c8e9aa0 am: 90cc1c0869 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e52533b0d5643b67f05dad22fc255e424779a926;hp=101f022ba7835166123694291fa6f108ad0c9bf8;p=android-x86%2Fhardware-interfaces.git wifi: Few minor interface changes am: 8c0c8e9aa0 am: 90cc1c0869 am: 32c94ad54e Change-Id: I13522129a19e643688ac235c935fc6ffd66ce15c --- diff --git a/wifi/1.0/IWifiChip.hal b/wifi/1.0/IWifiChip.hal index b0598a4f..611c4497 100644 --- a/wifi/1.0/IWifiChip.hal +++ b/wifi/1.0/IWifiChip.hal @@ -629,6 +629,19 @@ interface IWifiChip { forceDumpToDebugRingBuffer(string ringName) generates (WifiStatus status); /** + * API to stop the debug data collection for all ring buffers. + * + * @return status WifiStatus of the operation. + * Possible status codes: + * |WifiStatusCode.SUCCESS|, + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.NOT_AVAILABLE|, + * |WifiStatusCode.UNKNOWN| + */ + stopLoggingToDebugRingBuffer() generates (WifiStatus status); + + /** * API to retrieve the wifi wake up reason stats for debugging. * The driver is expected to start maintaining these stats once the chip * is configured using |configureChip|. These stats must be reset whenever diff --git a/wifi/1.0/IWifiStaIfaceEventCallback.hal b/wifi/1.0/IWifiStaIfaceEventCallback.hal index e8df4c27..e51ea6db 100644 --- a/wifi/1.0/IWifiStaIfaceEventCallback.hal +++ b/wifi/1.0/IWifiStaIfaceEventCallback.hal @@ -31,9 +31,12 @@ interface IWifiStaIfaceEventCallback { * |StaBackgroundScanBucketParameters.eventReportScheme|. * * @param cmdId command ID corresponding to the request. + * @param bucketsScanned Bitset where each bit indicates if the bucket with + * that index (starting at 0) was scanned. * @parm result Full scan result for an AP. */ - oneway onBackgroundFullScanResult(CommandId cmdId, StaScanResult result); + oneway onBackgroundFullScanResult( + CommandId cmdId, uint32_t bucketsScanned, StaScanResult result); /** * Called when the |StaBackgroundScanBucketParameters.eventReportScheme| flags diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp index 726f0119..82364cbe 100644 --- a/wifi/1.0/default/hidl_struct_util.cpp +++ b/wifi/1.0/default/hidl_struct_util.cpp @@ -338,7 +338,6 @@ bool convertHidlGscanParamsToLegacy( hidl_scan_params.reportThresholdPercent; legacy_scan_params->report_threshold_num_scans = hidl_scan_params.reportThresholdNumScans; - // TODO(b/33194311): Expose these max limits in the HIDL interface. if (hidl_scan_params.buckets.size() > MAX_BUCKETS) { return false; } @@ -366,7 +365,6 @@ bool convertHidlGscanParamsToLegacy( convertHidlGscanReportEventFlagToLegacy(flag); } } - // TODO(b/33194311): Expose these max limits in the HIDL interface. if (hidl_bucket_spec.frequencies.size() > MAX_CHANNELS) { return false; } diff --git a/wifi/1.0/default/wifi_chip.cpp b/wifi/1.0/default/wifi_chip.cpp index 6aeedf82..6f980c04 100644 --- a/wifi/1.0/default/wifi_chip.cpp +++ b/wifi/1.0/default/wifi_chip.cpp @@ -317,6 +317,14 @@ Return WifiChip::forceDumpToDebugRingBuffer( ring_name); } +Return WifiChip::stopLoggingToDebugRingBuffer( + stopLoggingToDebugRingBuffer_cb hidl_status_cb) { + return validateAndCall(this, + WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::stopLoggingToDebugRingBufferInternal, + hidl_status_cb); +} + Return WifiChip::getDebugHostWakeReasonStats( getDebugHostWakeReasonStats_cb hidl_status_cb) { return validateAndCall(this, @@ -735,6 +743,12 @@ WifiStatus WifiChip::forceDumpToDebugRingBufferInternal( return createWifiStatusFromLegacyError(legacy_status); } +WifiStatus WifiChip::stopLoggingToDebugRingBufferInternal() { + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->deregisterRingBufferCallbackHandler(); + return createWifiStatusFromLegacyError(legacy_status); +} + std::pair WifiChip::getDebugHostWakeReasonStatsInternal() { legacy_hal::wifi_error legacy_status; diff --git a/wifi/1.0/default/wifi_chip.h b/wifi/1.0/default/wifi_chip.h index e1c23441..406938c3 100644 --- a/wifi/1.0/default/wifi_chip.h +++ b/wifi/1.0/default/wifi_chip.h @@ -119,6 +119,8 @@ class WifiChip : public IWifiChip { Return forceDumpToDebugRingBuffer( const hidl_string& ring_name, forceDumpToDebugRingBuffer_cb hidl_status_cb) override; + Return stopLoggingToDebugRingBuffer( + stopLoggingToDebugRingBuffer_cb hidl_status_cb) override; Return getDebugHostWakeReasonStats( getDebugHostWakeReasonStats_cb hidl_status_cb) override; Return enableDebugErrorAlerts( @@ -170,6 +172,7 @@ class WifiChip : public IWifiChip { uint32_t max_interval_in_sec, uint32_t min_data_size_in_bytes); WifiStatus forceDumpToDebugRingBufferInternal(const hidl_string& ring_name); + WifiStatus stopLoggingToDebugRingBufferInternal(); std::pair getDebugHostWakeReasonStatsInternal(); WifiStatus enableDebugErrorAlertsInternal(bool enable); diff --git a/wifi/1.0/default/wifi_sta_iface.cpp b/wifi/1.0/default/wifi_sta_iface.cpp index 0c841026..626b195b 100644 --- a/wifi/1.0/default/wifi_sta_iface.cpp +++ b/wifi/1.0/default/wifi_sta_iface.cpp @@ -415,7 +415,7 @@ WifiStatus WifiStaIface::startBackgroundScanInternal( const auto& on_full_result_callback = [weak_ptr_this]( legacy_hal::wifi_request_id id, const legacy_hal::wifi_scan_result* result, - uint32_t /* buckets_scanned */) { + uint32_t buckets_scanned) { const auto shared_ptr_this = weak_ptr_this.promote(); if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { LOG(ERROR) << "Callback invoked on an invalid object"; @@ -428,7 +428,8 @@ WifiStatus WifiStaIface::startBackgroundScanInternal( return; } for (const auto& callback : shared_ptr_this->getEventCallbacks()) { - if (!callback->onBackgroundFullScanResult(id, hidl_scan_result).isOk()) { + if (!callback->onBackgroundFullScanResult( + id, buckets_scanned, hidl_scan_result).isOk()) { LOG(ERROR) << "Failed to invoke onBackgroundFullScanResult callback"; } } diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal index 3b2f25bf..83e66604 100644 --- a/wifi/1.0/types.hal +++ b/wifi/1.0/types.hal @@ -306,6 +306,15 @@ enum StaBackgroundScanBucketEventReportSchemeMask : uint32_t { }; /** + * Max limits for background scan. + */ +enum StaScanLimits : uint32_t { + MAX_CHANNELS = 16, + MAX_BUCKETS = 16, + MAX_AP_CACHE_PER_SCAN = 32 +}; + +/** * Background Scan parameters per bucket that can be specified in background * scan requests. */ @@ -318,6 +327,7 @@ struct StaBackgroundScanBucketParameters { /** * Channel frequencies (in Mhz) to scan if |band| is set to * |BAND_UNSPECIFIED|. + * Max length: |StaScanLimits.MAX_CHANNELS|. */ vec frequencies; /** @@ -361,6 +371,7 @@ struct StaBackgroundScanParameters { /** * Maximum number of APs that must be stored for each scan. If the maximum * is reached the highest RSSI results must be returned. + * Max length: |StaScanLimits.MAX_AP_CACHE_PER_SCAN|. */ uint32_t maxApPerScan; /** @@ -374,6 +385,7 @@ struct StaBackgroundScanParameters { uint32_t reportThresholdNumScans; /** * List of buckets to be scheduled. + * Max length: |StaScanLimits.MAX_BUCKETS|. */ vec buckets; }; @@ -506,8 +518,8 @@ struct StaScanData { */ bitfield flags; /** - * Bitset where each bit indicates if the bucket with that index was - * scanned. + * Bitset where each bit indicates if the bucket with that index (starting at + * 0) was scanned. */ uint32_t bucketsScanned; /**