瀏覽代碼

feat(phy): support multi ports

Signed-off-by: sakumisu <1203593632@qq.com>
sakumisu 1 月之前
父節點
當前提交
77e818a72e
共有 2 個文件被更改,包括 3 次插入0 次删除
  1. 2 0
      include/phy/chry_phy.h
  2. 1 0
      src/phy/chry_phy.c

+ 2 - 0
include/phy/chry_phy.h

@@ -19,6 +19,7 @@ struct chry_phy_config {
     bool auto_negotiation;
     bool auto_negotiation;
     bool duplex;
     bool duplex;
     uint16_t speed;
     uint16_t speed;
+    uint16_t phy_port;
 };
 };
 
 
 struct chry_phy_status {
 struct chry_phy_status {
@@ -53,6 +54,7 @@ struct chry_phy_support {
 };
 };
 
 
 struct chry_phy_device {
 struct chry_phy_device {
+    uint16_t phy_port;
     uint16_t phy_addr;
     uint16_t phy_addr;
     uint32_t phy_id;
     uint32_t phy_id;
     struct chry_phy_support support;
     struct chry_phy_support support;

+ 1 - 0
src/phy/chry_phy.c

@@ -63,6 +63,7 @@ int chry_phy_init(struct chry_phy_device *phydev, struct chry_phy_config *config
     }
     }
 
 
 phydrv_found:
 phydrv_found:
+    phydev->phy_port = config->phy_port;
     phydev->phy_id = phy_id;
     phydev->phy_id = phy_id;
     phydev->phy_addr = phy_addr;
     phydev->phy_addr = phy_addr;
     phydev->driver = phydrv;
     phydev->driver = phydrv;