Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c0c8e9a authored by Roshan Pius's avatar Roshan Pius
Browse files

wifi: Few minor interface changes

Changes in the CL:
1. Add the buckets scanned bitmask to bgscan.
2. exposed the legacy HAL constants for Bgscan in the HIDL interface.
3. Add a stop method for ring buffer logging.

Bug: 35752950
Bug: 33194311
Test: Compiles
Change-Id: Idb2031c33c5a237d7447410fb733f8e408a17288
parent b541affa
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -628,6 +628,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
+4 −1
Original line number Diff line number Diff line
@@ -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
+0 −2
Original line number Diff line number Diff line
@@ -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;
    }
+14 −0
Original line number Diff line number Diff line
@@ -317,6 +317,14 @@ Return<void> WifiChip::forceDumpToDebugRingBuffer(
                         ring_name);
}

Return<void> WifiChip::stopLoggingToDebugRingBuffer(
    stopLoggingToDebugRingBuffer_cb hidl_status_cb) {
  return validateAndCall(this,
                         WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
                         &WifiChip::stopLoggingToDebugRingBufferInternal,
                         hidl_status_cb);
}

Return<void> 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<WifiStatus, WifiDebugHostWakeReasonStats>
WifiChip::getDebugHostWakeReasonStatsInternal() {
  legacy_hal::wifi_error legacy_status;
+3 −0
Original line number Diff line number Diff line
@@ -119,6 +119,8 @@ class WifiChip : public IWifiChip {
  Return<void> forceDumpToDebugRingBuffer(
      const hidl_string& ring_name,
      forceDumpToDebugRingBuffer_cb hidl_status_cb) override;
  Return<void> stopLoggingToDebugRingBuffer(
      stopLoggingToDebugRingBuffer_cb hidl_status_cb) override;
  Return<void> getDebugHostWakeReasonStats(
      getDebugHostWakeReasonStats_cb hidl_status_cb) override;
  Return<void> 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<WifiStatus, WifiDebugHostWakeReasonStats>
  getDebugHostWakeReasonStatsInternal();
  WifiStatus enableDebugErrorAlertsInternal(bool enable);
Loading