From: Domen Puncer <domen.puncer@telargo.com>
To: netdev@vger.kernel.org
Cc: macro@linux-mips.org
Subject: phy_mii_ioctl - phydev->advertising ethtool.h vs. mii.h
Date: Mon, 6 Aug 2007 10:45:26 +0200 [thread overview]
Message-ID: <20070806084526.GO4529@moe.telargo.com> (raw)
Hi!
I've noticed mii-tool doesn't work right for a driver I'm just
developing (it uses generic phy layer).
Driver's ioctl is wired directly to phy_mii_ioctl().
"mii-tool -A something" shows the problem is in
phy_mii_ioctl -> SIOCSMIIREG:
392 case MII_ADVERTISE:
393 phydev->advertising = val;
394 break;
phydev->advertising value should be combined with ones from
ethtool.h (at least in other usages it is):
437 #define ADVERTISED_10baseT_Half (1 << 0)
438 #define ADVERTISED_10baseT_Full (1 << 1)
439 #define ADVERTISED_100baseT_Half (1 << 2)
440 #define ADVERTISED_100baseT_Full (1 << 3)
but mii-tool sends a mask with values from mii.h:
70 #define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
71 #define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */
72 #define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
73 #define ADVERTISE_1000XHALF 0x0040 /* Try for 1000BASE-X half-duplex */
74 #define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */
...
I'm I right that this is a bug?
Comments, suggestions how to fix it?
Domen
reply other threads:[~2007-08-06 8:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20070806084526.GO4529@moe.telargo.com \
--to=domen.puncer@telargo.com \
--cc=macro@linux-mips.org \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).