wifi(implementation): Create 1.1 interface package

1. Move the implementation in 1.0/default to 1.1/default.
2. Move all of the implementation to
android::hardware::V1_1::implementation namespace.
3. All of the header files include the android::hardware::V1_0 namespace
so that it can access the types from 1.0 package. ("using namespace" is
against Google style guide though :().
The other option to prefix each 1.0 type with the namespace name.
For example: V1_0::WifiStatus.
4. Added the implementation of the new 1.1 method
IWifiChip.setTxPowerLimit().
4. The executable name and the .rc still has 1.0 name in it to avoid
changing all the device.mk files.

TODO: Hookup to the new legacy HAL API.

Bug: 62437848
Test: mmm -j128 hardware/interfaces/wifi/1.1/default/
Test: Device boots up and able to connect to wifi networks.
Test: New VTS tests passes
Change-Id: Ib36282939e70b064f246041a03d8870f5cb6410e
diff --git a/wifi/1.0/vts/functional/Android.bp b/wifi/1.0/vts/functional/Android.bp
index b454a06..2d6679f 100644
--- a/wifi/1.0/vts/functional/Android.bp
+++ b/wifi/1.0/vts/functional/Android.bp
@@ -17,10 +17,12 @@
 cc_library_static {
     name: "VtsHalWifiV1_0TargetTestUtil",
     srcs: [
-
         "wifi_hidl_call_util_selftest.cpp",
         "wifi_hidl_test.cpp",
         "wifi_hidl_test_utils.cpp"],
+    export_include_dirs: [
+        "."
+    ],
     shared_libs: [
         "libbase",
         "liblog",
diff --git a/wifi/1.0/default/Android.mk b/wifi/1.1/default/Android.mk
similarity index 97%
rename from wifi/1.0/default/Android.mk
rename to wifi/1.1/default/Android.mk
index fe33e08..5758422 100644
--- a/wifi/1.0/default/Android.mk
+++ b/wifi/1.1/default/Android.mk
@@ -38,6 +38,7 @@
     wifi_status_util.cpp
 LOCAL_SHARED_LIBRARIES := \
     android.hardware.wifi@1.0 \
+    android.hardware.wifi@1.1 \
     libbase \
     libcutils \
     libhidlbase \
diff --git a/wifi/1.0/default/THREADING.README b/wifi/1.1/default/THREADING.README
similarity index 100%
rename from wifi/1.0/default/THREADING.README
rename to wifi/1.1/default/THREADING.README
diff --git a/wifi/1.0/default/android.hardware.wifi@1.0-service.rc b/wifi/1.1/default/android.hardware.wifi@1.0-service.rc
similarity index 100%
rename from wifi/1.0/default/android.hardware.wifi@1.0-service.rc
rename to wifi/1.1/default/android.hardware.wifi@1.0-service.rc
diff --git a/wifi/1.0/default/hidl_callback_util.h b/wifi/1.1/default/hidl_callback_util.h
similarity index 98%
rename from wifi/1.0/default/hidl_callback_util.h
rename to wifi/1.1/default/hidl_callback_util.h
index b7100c8..fb13622 100644
--- a/wifi/1.0/default/hidl_callback_util.h
+++ b/wifi/1.1/default/hidl_callback_util.h
@@ -51,7 +51,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 namespace hidl_callback_util {
 template <typename CallbackType>
@@ -114,7 +114,7 @@
 
 }  // namespace hidl_callback_util
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/hidl_return_util.h b/wifi/1.1/default/hidl_return_util.h
similarity index 97%
rename from wifi/1.0/default/hidl_return_util.h
rename to wifi/1.1/default/hidl_return_util.h
index 3f6364b..2f95c23 100644
--- a/wifi/1.0/default/hidl_return_util.h
+++ b/wifi/1.1/default/hidl_return_util.h
@@ -23,9 +23,10 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 namespace hidl_return_util {
+using namespace android::hardware::wifi::V1_0;
 
 /**
  * These utility functions are used to invoke a method on the provided
@@ -106,7 +107,7 @@
 
 }  // namespace hidl_util
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.1/default/hidl_struct_util.cpp
similarity index 99%
rename from wifi/1.0/default/hidl_struct_util.cpp
rename to wifi/1.1/default/hidl_struct_util.cpp
index fa0279b..e40a7d8 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.1/default/hidl_struct_util.cpp
@@ -22,7 +22,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 namespace hidl_struct_util {
 
@@ -2177,7 +2177,7 @@
 }
 }  // namespace hidl_struct_util
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/hidl_struct_util.h b/wifi/1.1/default/hidl_struct_util.h
similarity index 98%
rename from wifi/1.0/default/hidl_struct_util.h
rename to wifi/1.1/default/hidl_struct_util.h
index c04d92f..a04f636 100644
--- a/wifi/1.0/default/hidl_struct_util.h
+++ b/wifi/1.1/default/hidl_struct_util.h
@@ -32,9 +32,10 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 namespace hidl_struct_util {
+using namespace android::hardware::wifi::V1_0;
 
 // Chip conversion methods.
 bool convertLegacyFeaturesToHidlChipCapabilities(
@@ -161,7 +162,7 @@
     std::vector<RttResult>* hidl_results);
 }  // namespace hidl_struct_util
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/hidl_sync_util.cpp b/wifi/1.1/default/hidl_sync_util.cpp
similarity index 96%
rename from wifi/1.0/default/hidl_sync_util.cpp
rename to wifi/1.1/default/hidl_sync_util.cpp
index 7d47f2f..ba18e34 100644
--- a/wifi/1.0/default/hidl_sync_util.cpp
+++ b/wifi/1.1/default/hidl_sync_util.cpp
@@ -23,7 +23,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 namespace hidl_sync_util {
 
@@ -33,7 +33,7 @@
 
 }  // namespace hidl_sync_util
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/hidl_sync_util.h b/wifi/1.1/default/hidl_sync_util.h
similarity index 96%
rename from wifi/1.0/default/hidl_sync_util.h
rename to wifi/1.1/default/hidl_sync_util.h
index 6631e55..0e882df 100644
--- a/wifi/1.0/default/hidl_sync_util.h
+++ b/wifi/1.1/default/hidl_sync_util.h
@@ -24,13 +24,13 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 namespace hidl_sync_util {
 std::unique_lock<std::recursive_mutex> acquireGlobalLock();
 }  // namespace hidl_sync_util
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/service.cpp b/wifi/1.1/default/service.cpp
similarity index 91%
rename from wifi/1.0/default/service.cpp
rename to wifi/1.1/default/service.cpp
index 059304e..b3fcd50 100644
--- a/wifi/1.0/default/service.cpp
+++ b/wifi/1.1/default/service.cpp
@@ -32,8 +32,8 @@
   configureRpcThreadpool(1, true /* callerWillJoin */);
 
   // Setup hwbinder service
-  android::sp<android::hardware::wifi::V1_0::IWifi> service =
-      new android::hardware::wifi::V1_0::implementation::Wifi();
+  android::sp<android::hardware::wifi::V1_1::IWifi> service =
+      new android::hardware::wifi::V1_1::implementation::Wifi();
   CHECK_EQ(service->registerAsService(), android::NO_ERROR)
       << "Failed to register wifi HAL";
 
diff --git a/wifi/1.0/default/wifi.cpp b/wifi/1.1/default/wifi.cpp
similarity index 99%
rename from wifi/1.0/default/wifi.cpp
rename to wifi/1.1/default/wifi.cpp
index b48844e..4ed1f55 100644
--- a/wifi/1.0/default/wifi.cpp
+++ b/wifi/1.1/default/wifi.cpp
@@ -28,7 +28,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 using hidl_return_util::validateAndCall;
 
@@ -195,7 +195,7 @@
   return createWifiStatus(WifiStatusCode::SUCCESS);
 }
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi.h b/wifi/1.1/default/wifi.h
similarity index 93%
rename from wifi/1.0/default/wifi.h
rename to wifi/1.1/default/wifi.h
index c6fa84c..1ade2d8 100644
--- a/wifi/1.0/default/wifi.h
+++ b/wifi/1.1/default/wifi.h
@@ -20,7 +20,7 @@
 #include <functional>
 
 #include <android-base/macros.h>
-#include <android/hardware/wifi/1.0/IWifi.h>
+#include <android/hardware/wifi/1.1/IWifi.h>
 #include <utils/Looper.h>
 
 #include "hidl_callback_util.h"
@@ -31,13 +31,14 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
+using namespace android::hardware::wifi::V1_0;
 
 /**
  * Root HIDL interface object used to control the Wifi HAL.
  */
-class Wifi : public IWifi {
+class Wifi : public V1_1::IWifi {
  public:
   Wifi();
 
@@ -79,7 +80,7 @@
 };
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_ap_iface.cpp b/wifi/1.1/default/wifi_ap_iface.cpp
similarity index 98%
rename from wifi/1.0/default/wifi_ap_iface.cpp
rename to wifi/1.1/default/wifi_ap_iface.cpp
index e2beec2..150a6cc 100644
--- a/wifi/1.0/default/wifi_ap_iface.cpp
+++ b/wifi/1.1/default/wifi_ap_iface.cpp
@@ -24,7 +24,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 using hidl_return_util::validateAndCall;
 
@@ -100,7 +100,7 @@
   return {createWifiStatusFromLegacyError(legacy_status), valid_frequencies};
 }
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_ap_iface.h b/wifi/1.1/default/wifi_ap_iface.h
similarity index 94%
rename from wifi/1.0/default/wifi_ap_iface.h
rename to wifi/1.1/default/wifi_ap_iface.h
index efc168a..608fe6b 100644
--- a/wifi/1.0/default/wifi_ap_iface.h
+++ b/wifi/1.1/default/wifi_ap_iface.h
@@ -25,13 +25,14 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
+using namespace android::hardware::wifi::V1_0;
 
 /**
  * HIDL interface object used to control a AP Iface instance.
  */
-class WifiApIface : public IWifiApIface {
+class WifiApIface : public V1_0::IWifiApIface {
  public:
   WifiApIface(const std::string& ifname,
               const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
@@ -63,7 +64,7 @@
 };
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_chip.cpp b/wifi/1.1/default/wifi_chip.cpp
similarity index 96%
rename from wifi/1.0/default/wifi_chip.cpp
rename to wifi/1.1/default/wifi_chip.cpp
index 770c83f..87985c0 100644
--- a/wifi/1.0/default/wifi_chip.cpp
+++ b/wifi/1.1/default/wifi_chip.cpp
@@ -46,7 +46,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 using hidl_return_util::validateAndCall;
 
@@ -343,6 +343,23 @@
                          enable);
 }
 
+Return<void> WifiChip::setTxPowerLimit(
+    int32_t powerInDbm, setTxPowerLimit_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+                         &WifiChip::setTxPowerLimitInternal,
+                         hidl_status_cb,
+                         powerInDbm);
+}
+
+Return<void> WifiChip::resetTxPowerLimit(
+    resetTxPowerLimit_cb hidl_status_cb) {
+  return validateAndCall(this,
+                         WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+                         &WifiChip::resetTxPowerLimitInternal,
+                         hidl_status_cb);
+}
+
 void WifiChip::invalidateAndRemoveAllIfaces() {
   invalidateAndClear(ap_iface_);
   invalidateAndClear(nan_iface_);
@@ -801,6 +818,18 @@
   return createWifiStatusFromLegacyError(legacy_status);
 }
 
+WifiStatus WifiChip::setTxPowerLimitInternal(int32_t /* powerInDbm */) {
+  // TODO(b/62437848): Implement this method once we are ready with the
+  // header changes in legacy HAL.
+  return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
+}
+
+WifiStatus WifiChip::resetTxPowerLimitInternal() {
+  // TODO(b/62437848): Implement this method once we are ready with the
+  // header changes in legacy HAL.
+  return createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED);
+}
+
 WifiStatus WifiChip::handleChipConfiguration(ChipModeId mode_id) {
   // If the chip is already configured in a different mode, stop
   // the legacy HAL and then start it after firmware mode change.
@@ -869,7 +898,7 @@
 }
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_chip.h b/wifi/1.1/default/wifi_chip.h
similarity index 95%
rename from wifi/1.0/default/wifi_chip.h
rename to wifi/1.1/default/wifi_chip.h
index 406938c..b7dde50 100644
--- a/wifi/1.0/default/wifi_chip.h
+++ b/wifi/1.1/default/wifi_chip.h
@@ -20,7 +20,7 @@
 #include <map>
 
 #include <android-base/macros.h>
-#include <android/hardware/wifi/1.0/IWifiChip.h>
+#include <android/hardware/wifi/1.1/IWifiChip.h>
 
 #include "hidl_callback_util.h"
 #include "wifi_ap_iface.h"
@@ -34,15 +34,16 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
+using namespace android::hardware::wifi::V1_0;
 
 /**
  * HIDL interface object used to control a Wifi HAL chip instance.
  * Since there is only a single chip instance used today, there is no
  * identifying handle information stored here.
  */
-class WifiChip : public IWifiChip {
+class WifiChip : public V1_1::IWifiChip {
  public:
   WifiChip(
       ChipId chip_id,
@@ -125,6 +126,9 @@
       getDebugHostWakeReasonStats_cb hidl_status_cb) override;
   Return<void> enableDebugErrorAlerts(
       bool enable, enableDebugErrorAlerts_cb hidl_status_cb) override;
+  Return<void> setTxPowerLimit(
+      int32_t powerInDbm, setTxPowerLimit_cb hidl_status_cb) override;
+  Return<void> resetTxPowerLimit(resetTxPowerLimit_cb hidl_status_cb) override;
 
  private:
   void invalidateAndRemoveAllIfaces();
@@ -176,6 +180,8 @@
   std::pair<WifiStatus, WifiDebugHostWakeReasonStats>
   getDebugHostWakeReasonStatsInternal();
   WifiStatus enableDebugErrorAlertsInternal(bool enable);
+  WifiStatus setTxPowerLimitInternal(int32_t powerInDbm);
+  WifiStatus resetTxPowerLimitInternal();
 
   WifiStatus handleChipConfiguration(ChipModeId mode_id);
   WifiStatus registerDebugRingBufferCallback();
@@ -201,7 +207,7 @@
 };
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_feature_flags.h b/wifi/1.1/default/wifi_feature_flags.h
similarity index 96%
rename from wifi/1.0/default/wifi_feature_flags.h
rename to wifi/1.1/default/wifi_feature_flags.h
index 3502fbd..5939ffb 100644
--- a/wifi/1.0/default/wifi_feature_flags.h
+++ b/wifi/1.1/default/wifi_feature_flags.h
@@ -20,7 +20,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 
 class WifiFeatureFlags {
@@ -33,7 +33,7 @@
 };
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_legacy_hal.cpp b/wifi/1.1/default/wifi_legacy_hal.cpp
similarity index 99%
rename from wifi/1.0/default/wifi_legacy_hal.cpp
rename to wifi/1.1/default/wifi_legacy_hal.cpp
index 3f26104..c1e1cd3 100644
--- a/wifi/1.0/default/wifi_legacy_hal.cpp
+++ b/wifi/1.1/default/wifi_legacy_hal.cpp
@@ -47,7 +47,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 namespace legacy_hal {
 // Legacy HAL functions accept "C" style function pointers, so use global
@@ -1316,7 +1316,7 @@
 
 }  // namespace legacy_hal
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_legacy_hal.h b/wifi/1.1/default/wifi_legacy_hal.h
similarity index 99%
rename from wifi/1.0/default/wifi_legacy_hal.h
rename to wifi/1.1/default/wifi_legacy_hal.h
index 962d153..fef7999 100644
--- a/wifi/1.0/default/wifi_legacy_hal.h
+++ b/wifi/1.1/default/wifi_legacy_hal.h
@@ -26,7 +26,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 // This is in a separate namespace to prevent typename conflicts between
 // the legacy HAL types and the HIDL interface types.
@@ -298,7 +298,7 @@
 
 }  // namespace legacy_hal
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_legacy_hal_stubs.cpp b/wifi/1.1/default/wifi_legacy_hal_stubs.cpp
similarity index 99%
rename from wifi/1.0/default/wifi_legacy_hal_stubs.cpp
rename to wifi/1.1/default/wifi_legacy_hal_stubs.cpp
index 2973430..a5a5d48 100644
--- a/wifi/1.0/default/wifi_legacy_hal_stubs.cpp
+++ b/wifi/1.1/default/wifi_legacy_hal_stubs.cpp
@@ -20,7 +20,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 namespace legacy_hal {
 template <typename>
@@ -136,7 +136,7 @@
 }
 }  // namespace legacy_hal
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_legacy_hal_stubs.h b/wifi/1.1/default/wifi_legacy_hal_stubs.h
similarity index 96%
rename from wifi/1.0/default/wifi_legacy_hal_stubs.h
rename to wifi/1.1/default/wifi_legacy_hal_stubs.h
index 1cb5f9d..bfc4c9b 100644
--- a/wifi/1.0/default/wifi_legacy_hal_stubs.h
+++ b/wifi/1.1/default/wifi_legacy_hal_stubs.h
@@ -20,7 +20,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 namespace legacy_hal {
 #include <hardware_legacy/wifi_hal.h>
@@ -28,7 +28,7 @@
 bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn);
 }  // namespace legacy_hal
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_mode_controller.cpp b/wifi/1.1/default/wifi_mode_controller.cpp
similarity index 98%
rename from wifi/1.0/default/wifi_mode_controller.cpp
rename to wifi/1.1/default/wifi_mode_controller.cpp
index 7e82d4c..b8a44c2 100644
--- a/wifi/1.0/default/wifi_mode_controller.cpp
+++ b/wifi/1.1/default/wifi_mode_controller.cpp
@@ -48,7 +48,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 namespace mode_controller {
 
@@ -80,7 +80,7 @@
 }
 }  // namespace mode_controller
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_mode_controller.h b/wifi/1.1/default/wifi_mode_controller.h
similarity index 95%
rename from wifi/1.0/default/wifi_mode_controller.h
rename to wifi/1.1/default/wifi_mode_controller.h
index a4147a9..6984509 100644
--- a/wifi/1.0/default/wifi_mode_controller.h
+++ b/wifi/1.1/default/wifi_mode_controller.h
@@ -24,9 +24,11 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 namespace mode_controller {
+using namespace android::hardware::wifi::V1_0;
+
 /**
  * Class that encapsulates all firmware mode configuration.
  * This class will perform the necessary firmware reloads to put the chip in the
@@ -51,7 +53,7 @@
 
 }  // namespace mode_controller
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_nan_iface.cpp b/wifi/1.1/default/wifi_nan_iface.cpp
similarity index 99%
rename from wifi/1.0/default/wifi_nan_iface.cpp
rename to wifi/1.1/default/wifi_nan_iface.cpp
index ee324ce..a111d06 100644
--- a/wifi/1.0/default/wifi_nan_iface.cpp
+++ b/wifi/1.1/default/wifi_nan_iface.cpp
@@ -24,7 +24,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 using hidl_return_util::validateAndCall;
 
@@ -763,7 +763,7 @@
 }
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_nan_iface.h b/wifi/1.1/default/wifi_nan_iface.h
similarity index 97%
rename from wifi/1.0/default/wifi_nan_iface.h
rename to wifi/1.1/default/wifi_nan_iface.h
index e1edd29..260d8ab 100644
--- a/wifi/1.0/default/wifi_nan_iface.h
+++ b/wifi/1.1/default/wifi_nan_iface.h
@@ -27,13 +27,14 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
+using namespace android::hardware::wifi::V1_0;
 
 /**
  * HIDL interface object used to control a NAN Iface instance.
  */
-class WifiNanIface : public IWifiNanIface {
+class WifiNanIface : public V1_0::IWifiNanIface {
  public:
   WifiNanIface(const std::string& ifname,
                const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
@@ -132,7 +133,7 @@
 };
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_p2p_iface.cpp b/wifi/1.1/default/wifi_p2p_iface.cpp
similarity index 97%
rename from wifi/1.0/default/wifi_p2p_iface.cpp
rename to wifi/1.1/default/wifi_p2p_iface.cpp
index 0d055f1..78e08db 100644
--- a/wifi/1.0/default/wifi_p2p_iface.cpp
+++ b/wifi/1.1/default/wifi_p2p_iface.cpp
@@ -23,7 +23,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 using hidl_return_util::validateAndCall;
 
@@ -64,7 +64,7 @@
 }
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_p2p_iface.h b/wifi/1.1/default/wifi_p2p_iface.h
similarity index 92%
rename from wifi/1.0/default/wifi_p2p_iface.h
rename to wifi/1.1/default/wifi_p2p_iface.h
index d2982db..f563a3d 100644
--- a/wifi/1.0/default/wifi_p2p_iface.h
+++ b/wifi/1.1/default/wifi_p2p_iface.h
@@ -25,13 +25,14 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
+using namespace android::hardware::wifi::V1_0;
 
 /**
  * HIDL interface object used to control a P2P Iface instance.
  */
-class WifiP2pIface : public IWifiP2pIface {
+class WifiP2pIface : public V1_0::IWifiP2pIface {
  public:
   WifiP2pIface(const std::string& ifname,
                const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
@@ -56,7 +57,7 @@
 };
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_rtt_controller.cpp b/wifi/1.1/default/wifi_rtt_controller.cpp
similarity index 99%
rename from wifi/1.0/default/wifi_rtt_controller.cpp
rename to wifi/1.1/default/wifi_rtt_controller.cpp
index f18feae..9ef702d 100644
--- a/wifi/1.0/default/wifi_rtt_controller.cpp
+++ b/wifi/1.1/default/wifi_rtt_controller.cpp
@@ -24,7 +24,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 using hidl_return_util::validateAndCall;
 
@@ -291,7 +291,7 @@
   return createWifiStatusFromLegacyError(legacy_status);
 }
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_rtt_controller.h b/wifi/1.1/default/wifi_rtt_controller.h
similarity index 97%
rename from wifi/1.0/default/wifi_rtt_controller.h
rename to wifi/1.1/default/wifi_rtt_controller.h
index 7c0abca..5437885 100644
--- a/wifi/1.0/default/wifi_rtt_controller.h
+++ b/wifi/1.1/default/wifi_rtt_controller.h
@@ -27,13 +27,13 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 
 /**
  * HIDL interface object used to control all RTT operations.
  */
-class WifiRttController : public IWifiRttController {
+class WifiRttController : public V1_0::IWifiRttController {
  public:
   WifiRttController(const sp<IWifiIface>& bound_iface,
                     const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
@@ -97,7 +97,7 @@
 };
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_sta_iface.cpp b/wifi/1.1/default/wifi_sta_iface.cpp
similarity index 99%
rename from wifi/1.0/default/wifi_sta_iface.cpp
rename to wifi/1.1/default/wifi_sta_iface.cpp
index 3c52048..28f3f02 100644
--- a/wifi/1.0/default/wifi_sta_iface.cpp
+++ b/wifi/1.1/default/wifi_sta_iface.cpp
@@ -24,7 +24,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 using hidl_return_util::validateAndCall;
 
@@ -623,7 +623,7 @@
 }
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_sta_iface.h b/wifi/1.1/default/wifi_sta_iface.h
similarity index 97%
rename from wifi/1.0/default/wifi_sta_iface.h
rename to wifi/1.1/default/wifi_sta_iface.h
index 08faa2f..587a5de 100644
--- a/wifi/1.0/default/wifi_sta_iface.h
+++ b/wifi/1.1/default/wifi_sta_iface.h
@@ -27,13 +27,14 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
+using namespace android::hardware::wifi::V1_0;
 
 /**
  * HIDL interface object used to control a STA Iface instance.
  */
-class WifiStaIface : public IWifiStaIface {
+class WifiStaIface : public V1_0::IWifiStaIface {
  public:
   WifiStaIface(const std::string& ifname,
                const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
@@ -159,7 +160,7 @@
 };
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_status_util.cpp b/wifi/1.1/default/wifi_status_util.cpp
similarity index 98%
rename from wifi/1.0/default/wifi_status_util.cpp
rename to wifi/1.1/default/wifi_status_util.cpp
index c2d0758..3a85e09 100644
--- a/wifi/1.0/default/wifi_status_util.cpp
+++ b/wifi/1.1/default/wifi_status_util.cpp
@@ -19,7 +19,7 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
 
 std::string legacyErrorToString(legacy_hal::wifi_error error) {
@@ -100,7 +100,7 @@
 }
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.0/default/wifi_status_util.h b/wifi/1.1/default/wifi_status_util.h
similarity index 94%
rename from wifi/1.0/default/wifi_status_util.h
rename to wifi/1.1/default/wifi_status_util.h
index 7f557e0..cc93d66 100644
--- a/wifi/1.0/default/wifi_status_util.h
+++ b/wifi/1.1/default/wifi_status_util.h
@@ -24,8 +24,9 @@
 namespace android {
 namespace hardware {
 namespace wifi {
-namespace V1_0 {
+namespace V1_1 {
 namespace implementation {
+using namespace android::hardware::wifi::V1_0;
 
 std::string legacyErrorToString(legacy_hal::wifi_error error);
 WifiStatus createWifiStatus(WifiStatusCode code,
@@ -36,7 +37,7 @@
 WifiStatus createWifiStatusFromLegacyError(legacy_hal::wifi_error error);
 
 }  // namespace implementation
-}  // namespace V1_0
+}  // namespace V1_1
 }  // namespace wifi
 }  // namespace hardware
 }  // namespace android
diff --git a/wifi/1.1/vts/functional/Android.bp b/wifi/1.1/vts/functional/Android.bp
new file mode 100644
index 0000000..6b0baf7
--- /dev/null
+++ b/wifi/1.1/vts/functional/Android.bp
@@ -0,0 +1,39 @@
+//
+// 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.
+//
+
+cc_test {
+    name: "VtsHalWifiV1_1TargetTest",
+    defaults: ["hidl_defaults"],
+    srcs: [
+        "VtsHalWifiV1_1TargetTest.cpp",
+        "wifi_chip_hidl_test.cpp"],
+    shared_libs: [
+        "libbase",
+        "liblog",
+        "libcutils",
+        "libhidlbase",
+        "libhidltransport",
+        "libnativehelper",
+        "libutils",
+        "android.hardware.wifi@1.0",
+        "android.hardware.wifi@1.1",
+    ],
+    static_libs: ["VtsHalWifiV1_0TargetTestUtil", "VtsHalHidlTargetTestBase"],
+    cflags: [
+        "-O0",
+        "-g",
+    ],
+}
diff --git a/wifi/1.1/vts/functional/VtsHalWifiV1_1TargetTest.cpp b/wifi/1.1/vts/functional/VtsHalWifiV1_1TargetTest.cpp
new file mode 100644
index 0000000..160fcd2
--- /dev/null
+++ b/wifi/1.1/vts/functional/VtsHalWifiV1_1TargetTest.cpp
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+
+#include <android-base/logging.h>
+
+#include <VtsHalHidlTargetTestBase.h>
+
+#include "wifi_hidl_test_utils.h"
+
+int main(int argc, char** argv) {
+    ::testing::AddGlobalTestEnvironment(new WifiHidlEnvironment);
+    ::testing::InitGoogleTest(&argc, argv);
+    int status = RUN_ALL_TESTS();
+    LOG(INFO) << "Test result = " << status;
+    return status;
+}
diff --git a/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp
new file mode 100644
index 0000000..839b6c4
--- /dev/null
+++ b/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp
@@ -0,0 +1,94 @@
+/*
+ * 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.
+ */
+
+#include <android-base/logging.h>
+
+#include <android/hardware/wifi/1.1/IWifi.h>
+#include <android/hardware/wifi/1.1/IWifiChip.h>
+
+#include <VtsHalHidlTargetTestBase.h>
+
+#include "wifi_hidl_call_util.h"
+#include "wifi_hidl_test_utils.h"
+
+using ::android::sp;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::wifi::V1_0::IfaceType;
+using ::android::hardware::wifi::V1_0::ChipId;
+using ::android::hardware::wifi::V1_0::ChipModeId;
+using ::android::hardware::wifi::V1_0::WifiStatus;
+using ::android::hardware::wifi::V1_0::WifiStatusCode;
+using ::android::hardware::wifi::V1_1::IWifi;
+using ::android::hardware::wifi::V1_1::IWifiChip;
+using ::android::hardware::wifi::V1_0::IWifiStaIface;
+
+namespace {
+constexpr int32_t kFakePowerInDbm = -56;
+}; //namespace
+
+/**
+ * Fixture to use for all Wifi chip HIDL interface tests.
+ */
+class WifiChipHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+   public:
+    virtual void SetUp() override {
+        wifi_chip_ = IWifiChip::castFrom(getWifiChip());
+        ASSERT_NE(nullptr, wifi_chip_.get());
+    }
+
+    virtual void TearDown() override { stopWifi(); }
+
+   protected:
+    uint32_t configureChipForStaIfaceAndGetCapabilities() {
+        ChipModeId mode_id;
+        EXPECT_TRUE(configureChipToSupportIfaceType(
+            wifi_chip_, IfaceType::STA, &mode_id));
+        const auto& status_and_caps = HIDL_INVOKE(wifi_chip_, getCapabilities);
+        EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code);
+        return status_and_caps.second;
+    }
+
+    sp<IWifiChip> wifi_chip_;
+};
+
+/*
+ * SetTxPowerLimit
+ */
+TEST_F(WifiChipHidlTest, SetTxPowerLimit) {
+    uint32_t caps = configureChipForStaIfaceAndGetCapabilities();
+    const auto& status =
+        HIDL_INVOKE(wifi_chip_, setTxPowerLimit, kFakePowerInDbm);
+    if (caps & IWifiChip::ChipCapabilityMask::SET_TX_POWER_LIMIT) {
+        EXPECT_EQ(WifiStatusCode::SUCCESS, status.code);
+    } else {
+        EXPECT_EQ(WifiStatusCode::ERROR_NOT_SUPPORTED, status.code);
+    }
+}
+
+/*
+ * SetTxPowerLimit
+ */
+TEST_F(WifiChipHidlTest, ResetTxPowerLimit) {
+    uint32_t caps = configureChipForStaIfaceAndGetCapabilities();
+    const auto& status =
+        HIDL_INVOKE(wifi_chip_, resetTxPowerLimit);
+    if (caps & IWifiChip::ChipCapabilityMask::SET_TX_POWER_LIMIT) {
+        EXPECT_EQ(WifiStatusCode::SUCCESS, status.code);
+    } else {
+        EXPECT_EQ(WifiStatusCode::ERROR_NOT_SUPPORTED, status.code);
+    }
+}
diff --git a/wifi/Android.bp b/wifi/Android.bp
index 230e720..b4ab98f 100644
--- a/wifi/Android.bp
+++ b/wifi/Android.bp
@@ -3,6 +3,7 @@
     "1.0",
     "1.0/vts/functional",
     "1.1",
+    "1.1/vts/functional",
     "offload/1.0",
     "offload/1.0/vts/functional",
     "supplicant/1.0",