From: Andrew Lunn <andrew@lunn.ch>
To: Richard Cochran <richardcochran@gmail.com>
Cc: netdev@vger.kernel.org,
Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>,
David Miller <davem@davemloft.net>,
linux-arm-kernel@lists.infradead.org,
Michal Simek <michal.simek@xilinx.com>
Subject: Re: [PATCH net-next 3/3] net: axienet: Pass ioctls to the phy.
Date: Tue, 17 Dec 2019 11:59:45 +0100 [thread overview]
Message-ID: <20191217105945.GA17965@lunn.ch> (raw)
In-Reply-To: <361f63095be92df10e8e953af3b981cdac58d98e.1576520432.git.richardcochran@gmail.com>
> +static int axienet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
> +{
> + if (!netif_running(dev))
> + return -EINVAL;
> +
> + switch (cmd) {
> + case SIOCGMIIPHY:
> + case SIOCGMIIREG:
> + case SIOCSMIIREG:
> + case SIOCSHWTSTAMP:
> + case SIOCGHWTSTAMP:
> + return phy_mii_ioctl(dev->phydev, rq, cmd);
> + default:
> + return -EOPNOTSUPP;
> + }
> +}
Hi Richard
You don't need to be conditional. phy_mii_ioctl() and
phylink_mii_ioctl() will return -EOPNOTSUPP for anything it does not
support.
Andrew
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew@lunn.ch>
To: Richard Cochran <richardcochran@gmail.com>
Cc: netdev@vger.kernel.org,
Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>,
David Miller <davem@davemloft.net>,
linux-arm-kernel@lists.infradead.org,
Michal Simek <michal.simek@xilinx.com>
Subject: Re: [PATCH net-next 3/3] net: axienet: Pass ioctls to the phy.
Date: Tue, 17 Dec 2019 11:59:45 +0100 [thread overview]
Message-ID: <20191217105945.GA17965@lunn.ch> (raw)
In-Reply-To: <361f63095be92df10e8e953af3b981cdac58d98e.1576520432.git.richardcochran@gmail.com>
> +static int axienet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
> +{
> + if (!netif_running(dev))
> + return -EINVAL;
> +
> + switch (cmd) {
> + case SIOCGMIIPHY:
> + case SIOCGMIIREG:
> + case SIOCSMIIREG:
> + case SIOCSHWTSTAMP:
> + case SIOCGHWTSTAMP:
> + return phy_mii_ioctl(dev->phydev, rq, cmd);
> + default:
> + return -EOPNOTSUPP;
> + }
> +}
Hi Richard
You don't need to be conditional. phy_mii_ioctl() and
phylink_mii_ioctl() will return -EOPNOTSUPP for anything it does not
support.
Andrew
next prev parent reply other threads:[~2019-12-17 11:00 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-16 18:32 [PATCH net-next 0/3] net: axienet: Fix random driver issues Richard Cochran
2019-12-16 18:32 ` Richard Cochran
2019-12-16 18:32 ` [PATCH net-next 1/3] net: axienet: Propagate registration errors during probe Richard Cochran
2019-12-16 18:32 ` Richard Cochran
2019-12-17 6:19 ` Radhey Shyam Pandey
2019-12-17 6:19 ` Radhey Shyam Pandey
2019-12-17 15:49 ` Richard Cochran
2019-12-17 15:49 ` Richard Cochran
2019-12-19 18:13 ` Radhey Shyam Pandey
2019-12-19 18:13 ` Radhey Shyam Pandey
2019-12-20 5:19 ` Richard Cochran
2019-12-20 5:19 ` Richard Cochran
2019-12-20 5:51 ` Radhey Shyam Pandey
2019-12-20 5:51 ` Radhey Shyam Pandey
2019-12-16 18:32 ` [PATCH net-next 2/3] net: axienet: Support software transmit time stamping Richard Cochran
2019-12-16 18:32 ` Richard Cochran
2019-12-16 18:32 ` [PATCH net-next 3/3] net: axienet: Pass ioctls to the phy Richard Cochran
2019-12-16 18:32 ` Richard Cochran
2019-12-17 6:43 ` Radhey Shyam Pandey
2019-12-17 6:43 ` Radhey Shyam Pandey
2019-12-17 10:59 ` Andrew Lunn [this message]
2019-12-17 10:59 ` Andrew Lunn
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=20191217105945.GA17965@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=michal.simek@xilinx.com \
--cc=netdev@vger.kernel.org \
--cc=radhey.shyam.pandey@xilinx.com \
--cc=richardcochran@gmail.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.