Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1663031

Re: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC

From Andrew Lunn <andrew@lunn.ch>
Newsgroups linux.kernel
Subject Re: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC
Date 2017-06-11 04:50 +0200
Message-ID <tR16V-7Lk-1@gated-at.bofh.it> (permalink)
References <tQFzr-1TZ-3@gated-at.bofh.it> <tQFzr-1TZ-11@gated-at.bofh.it> <tQTVM-2TS-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> > +int hclge_mac_mdio_config(struct hclge_dev *hdev)
> > +{
> > +	struct hclge_mac *mac = &hdev->hw.mac;
> > +	struct mii_bus *mdio_bus;
> > +	struct net_device *ndev = &mac->ndev;
> > +	struct phy_device *phy;
> > +	bool is_c45;
> > +	int ret;
> > +
> > +	if (hdev->hw.mac.phy_addr >= PHY_MAX_ADDR)
> > +		return 0;
> > +
> > +	if (hdev->hw.mac.phy_if == PHY_INTERFACE_MODE_NA)
> > +		return 0;
> > +	else if (mac->phy_if == PHY_INTERFACE_MODE_SGMII)
> > +		is_c45 = 0;
> > +	else if (mac->phy_if == PHY_INTERFACE_MODE_XGMII)
> > +		is_c45 = 1;
> > +	else
> > +		return -ENODATA;
> 
> Can you consider using a switch () case statement here?

Does this concept even make sense? The Marvell 10G phy will use SGMII
for 10/100/1000Mbs and swap to XGMII for 10Gbps. It however stays a
c45 device all the time.

In general, i don't think PHY mode is related to C22/C45.

   Andrew

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC Salil Mehta <salil.mehta@huawei.com> - 2017-06-10 05:50 +0200
  Re: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3 Ethernet  driver for hip08 SoC Florian Fainelli <f.fainelli@gmail.com> - 2017-06-10 21:10 +0200
    Re: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3  Ethernet driver for hip08 SoC Andrew Lunn <andrew@lunn.ch> - 2017-06-11 04:50 +0200
      RE: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3  Ethernet driver for hip08 SoC Salil Mehta <salil.mehta@huawei.com> - 2017-06-13 22:50 +0200
        Re: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3  Ethernet driver for hip08 SoC Andrew Lunn <andrew@lunn.ch> - 2017-06-13 23:20 +0200
    RE: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3  Ethernet driver for hip08 SoC Salil Mehta <salil.mehta@huawei.com> - 2017-06-13 23:40 +0200
      Re: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3  Ethernet driver for hip08 SoC Andrew Lunn <andrew@lunn.ch> - 2017-06-14 00:50 +0200
        RE: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3  Ethernet driver for hip08 SoC Salil Mehta <salil.mehta@huawei.com> - 2017-06-14 01:10 +0200
          Re: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3  Ethernet driver for hip08 SoC Andrew Lunn <andrew@lunn.ch> - 2017-06-14 03:20 +0200
            RE: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3  Ethernet driver for hip08 SoC Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 13:20 +0200

csiph-web