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

Commit 73e65983 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes from topic 'rename_wifi_hal'

* changes:
  wifi(interface): Rename interface to iface
  wifi(interface): Add/Correct docstring params
  wifi: Add implementation of driver/firmware memory dumps
  wifi: Add Implementation of IWifiChip.requestChipDebugInfo
  wifi: Use hal_tool & if_tool
  wifi: Restructure wifi legacy HAL implementation
  wifi: Change namespace
  wifi: Move legacy HAL implementation
parents 223b82a0 271f2c2d
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -28,8 +28,12 @@ interface IWifi {
  /**
   * Requests notifications of significant events for the HAL. Multiple calls to
   * this must register multiple callbacks each of which must receive all
   * events. IWifiEventCallback registration must be independent of the state
   * of the rest of the HAL and must persist though stops/starts.
   * events. |IWifiEventCallback| object registration must be independent of the
   * state of the rest of the HAL and must persist though stops/starts. These
   * objects must be deleted when the corresponding client process is dead.
   *
   * @param callback An instance of the |IWifiEventCallback| HIDL interface
   *        object.
   */
  @entry
  @callflow(next={"*"})
@@ -37,6 +41,8 @@ interface IWifi {

  /**
   * Get the current state of the HAL.
   *
   * @return started true if started, false otherwise.
   */
  isStarted() generates (bool started);

+30 −16
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import IWifiChipEventCallback;
 * to perform operations like NAN, RTT, etc.
 */
interface IWifiChip {
  enum InterfaceType : uint32_t {
  enum IfaceType : uint32_t {
    STA, AP, P2P,
    /**
     * NAN control interface. Datapath support may be queried and created
@@ -35,11 +35,11 @@ interface IWifiChip {

  /**
   * Set of interface types with the maximum number of interfaces that can have
   * one of the specified type for a given ChipInterfaceCombination. See
   * ChipInterfaceCombination for examples.
   * one of the specified type for a given ChipIfaceCombination. See
   * ChipIfaceCombination for examples.
   */
  struct ChipInterfaceCombinationLimit {
    vec<InterfaceType> types; // Each InterfaceType may occur at most once
  struct ChipIfaceCombinationLimit {
    vec<IfaceType> types; // Each IfaceType may occur at most once
    uint32_t maxIfaces;
  };

@@ -66,8 +66,8 @@ interface IWifiChip {
   *       [], [STA], [STA+NAN], [STA+STA], [NAN]
   *       Not included [STA+STA+NAN]
   */
  struct ChipInterfaceCombination {
    vec<ChipInterfaceCombinationLimit> limits;
  struct ChipIfaceCombination {
    vec<ChipIfaceCombinationLimit> limits;
  };

  /**
@@ -80,7 +80,7 @@ interface IWifiChip {
   *
   * When in a mode, it must be possible to perform any combination of creating
   * and removing interfaces as long as at least one of the
   * ChipInterfaceCombinations is satisfied. This means that if a chip has two
   * ChipIfaceCombinations is satisfied. This means that if a chip has two
   * available combinations, [{STA} <= 1] and [{AP} <= 1] then it is expected
   * that exactly one STA interface or one AP interface can be created, but it
   * is not expected that both a STA and AP interface could be created. If it
@@ -118,23 +118,30 @@ interface IWifiChip {
     * A list of the possible interface combinations that the chip can have
     * while in this mode.
     */
    vec<ChipInterfaceCombination> availableCombinations;
    vec<ChipIfaceCombination> availableCombinations;
  };

  /**
   * Requests notifications of significant events on this chip. Multiple calls
   * to this will register multiple callbacks each of which will receive all
   * events.
   *
   * @param callback An instance of the |IWifiChipEventCallback| HIDL interface
   *        object.
   */
  oneway registerEventCallback(IWifiChipEventCallback callback);

  /**
   * Get the set of operation modes that the chip supports.
   *
   * @return modes List of modes supported by the device.
   */
  getAvailableModes() generates (vec<ChipMode> modes);

  /**
   * Reconfigure the Chip. Will trigger onChipReconfigured.
   * Reconfigure the Chip.
   * Must trigger |IWifiChipEventCallback.onChipReconfigured| on sucess,
   * or |IWifiChipEventCallback.onChipReconfigureFailure| on failure.
   *
   * @param modeId The mode that the chip should switch to, corresponding to the
   *        id property of the target ChipMode.
@@ -143,23 +150,30 @@ interface IWifiChip {

  /**
   * Get the current mode that the chip is in.
   *
   * @return modeId The mode that the chip is currently configured to,
   *         corresponding to the id property of the target ChipMode.
   */
  getMode() generates (ChipModeId modeId);

  /**
   * Request information about the chip. Will trigger onChipDebugInfoAvailable.
   * Request information about the chip.
   * Must trigger |IWifiChipEventCallback.onChipDebugInfoAvailable| on sucess,
   * or |IWifiChipEventCallback.onChipDebugInfoFailure| on failure.
   */
  oneway requestChipDebugInfo();

  /**
   * Request vendor debug info from the driver. Will trigger
   * onDriverDebugDumpAvailable.
   * Request vendor debug info from the driver.
   * Must trigger |IWifiChipEventCallback.onDriverDebugDumpAvailable| on success,
   * or |IWifiChipEventCallback.onDriverDebugDumpFailure| on failure.
   */
  oneway requestDriverDebugDump();

  /**
   * Request vendor debug info from the firmware. Will trigger
   * onFirmwareDebugDumpAvailable.
   * Request vendor debug info from the firmware.
   * Must trigger |IWifiChipEventCallback.onFirmwareDebugDumpAvailable| on
   * success, or |IWifiChipEventCallback.onFirmwareDebugDumpFailure| on failure.
   */
  oneway requestFirmwareDebugDump();
};
+30 −2
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ interface IWifiChipEventCallback {
   *
   * @param modeId The mode that the chip failed switched to, corresponding to
   *        the id property of the target ChipMode.
   * @param reason Failure reason code.
   */
  oneway onChipReconfigureFailure(ChipModeId modeId, FailureReason reason);

@@ -51,18 +52,45 @@ interface IWifiChipEventCallback {

  /**
   * Callback with debug information about this chip
   *
   * @param info Instance of |ChipDebugInfo|.
   */
  oneway onChipDebugInfoAvailable(ChipDebugInfo info);

  /**
   * Callback to be invoked on failure to fetch debug info about this chip.
   *
   * @param reason Failure reason code.
   */
  oneway onChipDebugInfoFailure(FailureReason reason);

  /**
   * Callback with a vendor specific debug blob from the driver.
   * This blob will be dumped as part of the bug report.
   *
   * @param blob Vector of bytes retrieved from the driver.
   */
  oneway onDriverDebugDumpAvailable(vec<uint8_t> blob);

  /**
   * Callback to be invoked on failure to fetch debug blob from driver.
   *
   * @param reason Failure reason code.
   */
  oneway onDriverDebugDumpFailure(FailureReason reason);

  /**
   * Callback with a vendor specific debug blob from the driver.
   * This blob will be dumped as part of the bug report.
   *
   * @param blob Vector of bytes retrieved from the driver.
   */
  oneway onFirmwareDebugDumpAvailable(vec<uint8_t> blob);

  /**
   * Callback to be invoked on failure to fetch debug blob from driver.
   *
   * @param reason Failure reason code.
   */
  oneway onFirmwareDebugDumpFailure(FailureReason reason);
};
+4 −0
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ interface IWifiEventCallback {
   * failed. After this callback the HAL will be considered stopped. Another
   * call to start will attempt to reinitialize the HAL; however, there is a
   * chance it may fail again.
   *
   * @param reason Failure reason code.
   */
  oneway onStartFailure(FailureReason reason);

@@ -43,6 +45,8 @@ interface IWifiEventCallback {
   * Calling start again must restart Wi-Fi as if stop then start was called
   * (full state reset). When this event is received all IWifiChip objects
   * retrieved after the last call to start will be considered invalid.
   *
   * @param reason Failure reason code.
   */
  oneway onFailure(FailureReason reason);
};
+57 −0
Original line number Diff line number Diff line
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.wifi@1.0-impl
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_CPPFLAGS := -std=c++11 -Wall -Wno-unused-parameter -Werror -Wextra
LOCAL_SRC_FILES := \
    failure_reason_util.cpp \
    wifi_chip.cpp \
    wifi.cpp \
    wifi_legacy_hal.cpp
LOCAL_SHARED_LIBRARIES := \
    android.hardware.wifi@1.0 \
    libbase \
    libcutils \
    libhidl \
    libhwbinder \
    liblog \
    libnl \
    libutils \
    libwifi-system
LOCAL_WHOLE_STATIC_LIBRARIES := $(LIB_WIFI_HAL)
include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.wifi@1.0-service
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_CPPFLAGS := -std=c++11 -Wall -Wno-unused-parameter -Werror -Wextra
LOCAL_SRC_FILES := \
    service.cpp
LOCAL_SHARED_LIBRARIES := \
    android.hardware.wifi@1.0 \
    android.hardware.wifi@1.0-impl \
    libbase \
    libcutils \
    libhidl \
    libhwbinder \
    liblog \
    libnl \
    libutils \
    libwifi-system
LOCAL_WHOLE_STATIC_LIBRARIES := $(LIB_WIFI_HAL)
LOCAL_INIT_RC := android.hardware.wifi@1.0-service.rc
include $(BUILD_EXECUTABLE)
Loading