From: Andrew Lunn <andrew@lunn.ch>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Salil Mehta <salil.mehta@huawei.com>,
davem@davemloft.net, yisen.zhuang@huawei.com,
huangdaode@hisilicon.com, lipeng321@huawei.com,
mehta.salil.lnk@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linuxarm@huawei.com
Subject: Re: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC
Date: Sun, 11 Jun 2017 04:43:14 +0200 [thread overview]
Message-ID: <20170611024314.GD26740@lunn.ch> (raw)
In-Reply-To: <ba416774-9ccc-e6b6-3518-fb492b8b2858@gmail.com>
> > +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
next prev parent reply other threads:[~2017-06-11 2:43 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-10 3:46 [PATCH net-next 0/9] Hisilicon Network Subsystem 3 Ethernet Driver Salil Mehta
2017-06-10 3:46 ` [PATCH net-next 1/9] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC Salil Mehta
2017-06-10 12:43 ` Mintz, Yuval
2017-06-13 17:08 ` Salil Mehta
2017-06-14 8:04 ` Mintz, Yuval
2017-06-17 12:00 ` Salil Mehta
2017-06-10 3:46 ` [PATCH net-next 2/9] net: hns3: Add support of the HNAE3 framework Salil Mehta
2017-06-10 3:46 ` [PATCH net-next 3/9] net: hns3: Add HNS3 IMP(Integrated Mgmt Proc) Cmd Interface Support Salil Mehta
2017-06-10 3:46 ` [PATCH net-next 4/9] net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support Salil Mehta
2017-06-10 3:46 ` [PATCH net-next 5/9] net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver Salil Mehta
2017-06-10 3:46 ` [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC Salil Mehta
2017-06-10 19:04 ` Florian Fainelli
2017-06-11 2:43 ` Andrew Lunn [this message]
2017-06-13 20:47 ` Salil Mehta
2017-06-13 21:15 ` Andrew Lunn
2017-06-13 21:37 ` Salil Mehta
2017-06-13 22:40 ` Andrew Lunn
2017-06-13 23:01 ` Salil Mehta
2017-06-14 1:10 ` Andrew Lunn
2017-06-17 11:10 ` Salil Mehta
2017-06-10 3:46 ` [PATCH net-next 7/9] net: hns3: Add Ethtool support to HNS3 driver Salil Mehta
2017-06-10 3:46 ` [PATCH net-next 8/9] net: hns3: Add support of debugfs interface " Salil Mehta
2017-06-10 12:51 ` Mintz, Yuval
2017-06-10 16:35 ` Andrew Lunn
2017-06-13 17:16 ` Salil Mehta
2017-06-13 17:14 ` Salil Mehta
2017-06-10 3:46 ` [PATCH net-next 9/9] net: hns3: Add HNS3 driver to kernel build framework & MAINTAINERS Salil Mehta
2017-06-11 13:41 ` kbuild test robot
2017-06-11 13:41 ` kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170611024314.GD26740@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=huangdaode@hisilicon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=lipeng321@huawei.com \
--cc=mehta.salil.lnk@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.com \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.