diff --git a/wifi/hostapd/1.3/IHostapd.hal b/wifi/hostapd/1.3/IHostapd.hal
index 0309f3b..be6fe59 100644
--- a/wifi/hostapd/1.3/IHostapd.hal
+++ b/wifi/hostapd/1.3/IHostapd.hal
@@ -26,6 +26,53 @@
  * Top-level object for managing SoftAPs.
  */
 interface IHostapd extends @1.2::IHostapd {
+
+    /**
+     * Parameters to control the channel selection for the interface.
+     */
+    struct ChannelParams {
+        /**
+         * Baseline information as defined in HAL 1.2.
+         *
+         * Includes bandMask and acsChannelFreqRangesMhz
+         */
+        @1.2::IHostapd.ChannelParams V1_2;
+
+        /**
+         * Whether to enable ACS (Automatic Channel Selection) or not.
+         * The channel can be selected automatically at run time by setting
+         * this flag, which must enable the ACS survey based algorithm.
+         *
+         * Note: It is used instead of V1_0::ChannelParams.enableAcs inside
+         * V1_3::IfaceParams.V1_2.V1_1.V1_0.
+         */
+        bool enableAcs;
+
+        /**
+         * Channel number (IEEE 802.11) to use for the interface.
+         * If ACS is enabled, this field is ignored.
+         *
+         * Note: It is used instead of V1_0::ChannelParams.channel inside
+         * V1_3::IfaceParams.V1_2.V1_1.V1_0.
+         */
+        uint32_t channel;
+    };
+
+    /**
+     * Parameters to use for setting up the dual access point interfaces.
+     */
+    struct IfaceParams {
+        /**
+         * Baseline information as defined in HAL 1.2.
+         */
+        @1.2::IHostapd.IfaceParams V1_2;
+
+        /**
+         * The list of the channel params for the dual interfaces.
+         */
+        vec<ChannelParams> channelParamsList;
+    };
+
     /**
      * Parameters to use for setting up the access point network.
      */
@@ -57,7 +104,7 @@
      *         |HostapdStatusCode.FAILURE_UNKNOWN|,
      *         |HostapdStatusCode.FAILURE_IFACE_EXISTS|
      */
-    addAccessPoint_1_3(@1.2::IHostapd.IfaceParams ifaceParams, NetworkParams nwParams)
+    addAccessPoint_1_3(IfaceParams ifaceParams, NetworkParams nwParams)
         generates (HostapdStatus status);
 
     /**
diff --git a/wifi/hostapd/1.3/vts/functional/hostapd_hidl_test.cpp b/wifi/hostapd/1.3/vts/functional/hostapd_hidl_test.cpp
index d6c750f..9234a5b 100644
--- a/wifi/hostapd/1.3/vts/functional/hostapd_hidl_test.cpp
+++ b/wifi/hostapd/1.3/vts/functional/hostapd_hidl_test.cpp
@@ -95,7 +95,16 @@
             iface_params;
         ::android::hardware::wifi::hostapd::V1_1::IHostapd::IfaceParams
             iface_params_1_1;
-        IHostapd::IfaceParams iface_params_1_2;
+        ::android::hardware::wifi::hostapd::V1_2::IHostapd::IfaceParams
+            iface_params_1_2;
+        IHostapd::IfaceParams iface_params_1_3;
+
+        std::vector<
+            ::android::hardware::wifi::hostapd::V1_3::IHostapd::ChannelParams>
+            vec_channelParams;
+
+        ::android::hardware::wifi::hostapd::V1_3::IHostapd::ChannelParams
+            channelParams_1_3;
 
         iface_params.ifaceName = getPrimaryWlanIfaceName();
         iface_params.hwModeParams.enable80211N = true;
@@ -111,23 +120,39 @@
         iface_params_1_2.channelParams.bandMask = 0;
         iface_params_1_2.channelParams.bandMask |=
             IHostapd::BandMask::BAND_2_GHZ;
-        return iface_params_1_2;
+
+        // Newly added attributes in V1_3
+        channelParams_1_3.channel = iface_params.channelParams.channel;
+        channelParams_1_3.enableAcs = iface_params.channelParams.enableAcs;
+        channelParams_1_3.V1_2 = iface_params_1_2.channelParams;
+
+        vec_channelParams.push_back(channelParams_1_3);
+        iface_params_1_3.V1_2 = iface_params_1_2;
+        iface_params_1_3.channelParamsList = vec_channelParams;
+        return iface_params_1_3;
     }
 
     IHostapd::IfaceParams getIfaceParamsWithAcs() {
         // First get the settings for WithoutAcs and then make changes
-        IHostapd::IfaceParams iface_params_1_2 = getIfaceParamsWithoutAcs();
-        iface_params_1_2.V1_1.V1_0.channelParams.enableAcs = true;
-        iface_params_1_2.V1_1.V1_0.channelParams.acsShouldExcludeDfs = true;
-        iface_params_1_2.V1_1.V1_0.channelParams.channel = 0;
-        iface_params_1_2.channelParams.bandMask |=
+        IHostapd::IfaceParams iface_params_1_3 = getIfaceParamsWithoutAcs();
+        iface_params_1_3.V1_2.V1_1.V1_0.channelParams.enableAcs = true;
+        iface_params_1_3.V1_2.V1_1.V1_0.channelParams.acsShouldExcludeDfs =
+            true;
+        iface_params_1_3.V1_2.V1_1.V1_0.channelParams.channel = 0;
+        iface_params_1_3.V1_2.channelParams.bandMask |=
             IHostapd::BandMask::BAND_5_GHZ;
+        iface_params_1_3.channelParamsList[0].channel =
+            iface_params_1_3.V1_2.V1_1.V1_0.channelParams.channel;
+        iface_params_1_3.channelParamsList[0].enableAcs =
+            iface_params_1_3.V1_2.V1_1.V1_0.channelParams.enableAcs;
+        iface_params_1_3.channelParamsList[0].V1_2 =
+            iface_params_1_3.V1_2.channelParams;
 
-        return iface_params_1_2;
+        return iface_params_1_3;
     }
 
     IHostapd::IfaceParams getIfaceParamsWithAcsAndFreqRange() {
-        IHostapd::IfaceParams iface_params_1_2 = getIfaceParamsWithAcs();
+        IHostapd::IfaceParams iface_params_1_3 = getIfaceParamsWithAcs();
         ::android::hardware::wifi::hostapd::V1_2::IHostapd::AcsFrequencyRange
             acsFrequencyRange;
         acsFrequencyRange.start = 2412;
@@ -136,17 +161,23 @@
                         AcsFrequencyRange>
             vec_acsFrequencyRange;
         vec_acsFrequencyRange.push_back(acsFrequencyRange);
-        iface_params_1_2.channelParams.acsChannelFreqRangesMhz =
+        iface_params_1_3.V1_2.channelParams.acsChannelFreqRangesMhz =
             vec_acsFrequencyRange;
-        return iface_params_1_2;
+        iface_params_1_3.channelParamsList[0].V1_2 =
+            iface_params_1_3.V1_2.channelParams;
+        return iface_params_1_3;
     }
 
     IHostapd::IfaceParams getIfaceParamsWithAcsAndInvalidFreqRange() {
-        IHostapd::IfaceParams iface_params_1_2 =
+        IHostapd::IfaceParams iface_params_1_3 =
             getIfaceParamsWithAcsAndFreqRange();
-        iface_params_1_2.channelParams.acsChannelFreqRangesMhz[0].start = 222;
-        iface_params_1_2.channelParams.acsChannelFreqRangesMhz[0].end = 999;
-        return iface_params_1_2;
+        iface_params_1_3.V1_2.channelParams.acsChannelFreqRangesMhz[0].start =
+            222;
+        iface_params_1_3.V1_2.channelParams.acsChannelFreqRangesMhz[0].end =
+            999;
+        iface_params_1_3.channelParamsList[0].V1_2 =
+            iface_params_1_3.V1_2.channelParams;
+        return iface_params_1_3;
     }
 
     IHostapd::NetworkParams getOpenNwParams() {
@@ -218,9 +249,12 @@
     }
 
     IHostapd::IfaceParams getIfaceParamsWithInvalidChannel() {
-        IHostapd::IfaceParams iface_params_1_2 = getIfaceParamsWithoutAcs();
-        iface_params_1_2.V1_1.V1_0.channelParams.channel = kIfaceInvalidChannel;
-        return iface_params_1_2;
+        IHostapd::IfaceParams iface_params_1_3 = getIfaceParamsWithoutAcs();
+        iface_params_1_3.V1_2.V1_1.V1_0.channelParams.channel =
+            kIfaceInvalidChannel;
+        iface_params_1_3.channelParamsList[0].channel =
+            iface_params_1_3.V1_2.V1_1.V1_0.channelParams.channel;
+        return iface_params_1_3;
     }
 
     // IHostapd object used for all tests in this fixture.
@@ -422,6 +456,11 @@
     EXPECT_EQ(HostapdStatusCode::FAILURE_CLIENT_UNKNOWN, status_1_2.code);
 }
 
+/**
+ * AddAccessPointWithDualBandConfig should pass
+ */
+// TODO: Add it after VendorHal ready & add feature support check.
+
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(HostapdHidlTest);
 INSTANTIATE_TEST_CASE_P(
     PerInstance, HostapdHidlTest,
