Merge "[qca-ssdk] fix malibu phy wol and phy_id get operation"
diff --git a/include/api/api_desc.h b/include/api/api_desc.h
index 47e339b..09531ec 100755
--- a/include/api/api_desc.h
+++ b/include/api/api_desc.h
@@ -358,18 +358,18 @@
 #define SW_API_PT_MAGIC_FRAME_MAC_SET_DESC \
     SW_PARAM_DEF(SW_API_PT_MAGIC_FRAME_MAC_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \
     SW_PARAM_DEF(SW_API_PT_MAGIC_FRAME_MAC_SET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \
-    SW_PARAM_DEF(SW_API_PT_MAGIC_FRAME_MAC_SET, SW_MACADDR, sizeof(fal_mac_addr_t), SW_PARAM_PTR|SW_PARAM_IN, "Magic mac"),
+    SW_PARAM_DEF(SW_API_PT_MAGIC_FRAME_MAC_SET, SW_MACADDR, sizeof(fal_mac_addr_t), SW_PARAM_PTR|SW_PARAM_IN, "[Magic mac]"),
 
 #define SW_API_PT_MAGIC_FRAME_MAC_GET_DESC \
     SW_PARAM_DEF(SW_API_PT_MAGIC_FRAME_MAC_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \
     SW_PARAM_DEF(SW_API_PT_MAGIC_FRAME_MAC_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \
-    SW_PARAM_DEF(SW_API_PT_MAGIC_FRAME_MAC_GET, SW_MACADDR, sizeof(fal_mac_addr_t), SW_PARAM_PTR|SW_PARAM_OUT, "Magic mac"),
+    SW_PARAM_DEF(SW_API_PT_MAGIC_FRAME_MAC_GET, SW_MACADDR, sizeof(fal_mac_addr_t), SW_PARAM_PTR|SW_PARAM_OUT, "[Magic mac]"),
 
 #define SW_API_PT_PHY_ID_GET_DESC \
     SW_PARAM_DEF(SW_API_PT_PHY_ID_GET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \
     SW_PARAM_DEF(SW_API_PT_PHY_ID_GET, SW_UINT32, 4, SW_PARAM_IN, "Port ID"), \
-    SW_PARAM_DEF(SW_API_PT_PHY_ID_GET, SW_UINT16, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Org ID"), \
-    SW_PARAM_DEF(SW_API_PT_PHY_ID_GET, SW_UINT16, 4, SW_PARAM_PTR|SW_PARAM_OUT, "Rev ID"),
+    SW_PARAM_DEF(SW_API_PT_PHY_ID_GET, SW_UINT16, 2, SW_PARAM_PTR|SW_PARAM_OUT, "Org ID"), \
+    SW_PARAM_DEF(SW_API_PT_PHY_ID_GET, SW_UINT16, 2, SW_PARAM_PTR|SW_PARAM_OUT, "Rev ID"),
 
 #define SW_API_PT_WOL_STATUS_SET_DESC \
     SW_PARAM_DEF(SW_API_PT_WOL_STATUS_SET, SW_UINT32, 4, SW_PARAM_IN, "Dev ID"), \
diff --git a/src/hsl/phy/malibu_phy.c b/src/hsl/phy/malibu_phy.c
index c74f1c9..ee746d4 100755
--- a/src/hsl/phy/malibu_phy.c
+++ b/src/hsl/phy/malibu_phy.c
@@ -270,6 +270,26 @@
 
 /******************************************************************************
 *
+* malibu_phy_reset - reset the phy
+*
+* reset the phy
+*/
+sw_error_t malibu_phy_reset(a_uint32_t dev_id, a_uint32_t phy_id)
+{
+	a_uint16_t phy_data;
+
+	if (phy_id == COMBO_PHY_ID)
+		__phy_reg_pages_sel_by_active_medium(dev_id, phy_id);
+
+	phy_data = malibu_phy_reg_read(dev_id, phy_id, MALIBU_PHY_CONTROL);
+	malibu_phy_reg_write(dev_id, phy_id, MALIBU_PHY_CONTROL,
+			     phy_data | MALIBU_CTRL_SOFTWARE_RESET);
+
+	return SW_OK;
+}
+
+/******************************************************************************
+*
 * malibu_phy_set_powersave - set power saving status
 *
 * set power saving status
@@ -591,6 +611,7 @@
 
 	malibu_phy_reg_write(dev_id, phy_id, MALIBU_PHY_SPEC_CONTROL, phy_data);
 
+	malibu_phy_reset(dev_id, phy_id);
 	return SW_OK;
 }
 
@@ -732,7 +753,7 @@
 {
 	a_uint16_t phy_data;
 
-	phy_data == malibu_phy_mmd_read(dev_id, phy_id, MALIBU_PHY_MMD3_NUM,
+	phy_data = malibu_phy_mmd_read(dev_id, phy_id, MALIBU_PHY_MMD3_NUM,
 					MALIBU_PHY_MMD3_ADDR_REMOTE_LOOPBACK_CTRL);
 
 	if (enable == A_TRUE) {
@@ -760,7 +781,7 @@
 {
 	a_uint16_t phy_data;
 
-	phy_data == malibu_phy_mmd_read(dev_id, phy_id, MALIBU_PHY_MMD3_NUM,
+	phy_data = malibu_phy_mmd_read(dev_id, phy_id, MALIBU_PHY_MMD3_NUM,
 					MALIBU_PHY_MMD3_ADDR_REMOTE_LOOPBACK_CTRL);
 
 	if (phy_data & 0x0001) {
@@ -1065,26 +1086,6 @@
 
 /******************************************************************************
 *
-* malibu_phy_reset - reset the phy
-*
-* reset the phy
-*/
-sw_error_t malibu_phy_reset(a_uint32_t dev_id, a_uint32_t phy_id)
-{
-	a_uint16_t phy_data;
-
-	if (phy_id == COMBO_PHY_ID)
-		__phy_reg_pages_sel_by_active_medium(dev_id, phy_id);
-
-	phy_data = malibu_phy_reg_read(dev_id, phy_id, MALIBU_PHY_CONTROL);
-	malibu_phy_reg_write(dev_id, phy_id, MALIBU_PHY_CONTROL,
-			     phy_data | MALIBU_CTRL_SOFTWARE_RESET);
-
-	return SW_OK;
-}
-
-/******************************************************************************
-*
 * malibu_phy_off - power off the phy 
 *
 * Power off the phy
@@ -2254,7 +2255,7 @@
 	malibu_phy_api_ops.phy_powersave_get = malibu_phy_get_powersave;
 	malibu_phy_api_ops.phy_cdt = malibu_phy_cdt;
 	malibu_phy_api_ops.phy_link_status_get = malibu_phy_get_link_status;
-       malibu_phy_api_ops.phy_mdix_set = malibu_phy_set_mdix;
+        malibu_phy_api_ops.phy_mdix_set = malibu_phy_set_mdix;
 	malibu_phy_api_ops.phy_mdix_get = malibu_phy_get_mdix;
 	malibu_phy_api_ops.phy_mdix_status_get = malibu_phy_get_mdix_status;
 	malibu_phy_api_ops.phy_8023az_set = malibu_phy_set_8023az;
@@ -2281,7 +2282,7 @@
 	malibu_phy_api_ops.phy_magic_frame_mac_set = malibu_phy_set_magic_frame_mac;
 	malibu_phy_api_ops.phy_magic_frame_mac_get = malibu_phy_get_magic_frame_mac;
 	malibu_phy_api_ops.phy_wol_status_set = malibu_phy_set_wol_status;
-	malibu_phy_api_ops.phy_wol_status_get = malibu_phy_set_wol_status;
+	malibu_phy_api_ops.phy_wol_status_get = malibu_phy_get_wol_status;
 	malibu_phy_api_ops.phy_interface_mode_set = malibu_phy_interface_set_mode;
 	malibu_phy_api_ops.phy_interface_mode_get = malibu_phy_interface_get_mode;
 	malibu_phy_api_ops.phy_interface_mode_status_get = malibu_phy_interface_get_mode_status;