Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290527
b: refs/heads/master
c: 9c4df53
h: refs/heads/master
i:
  290525: 3ef9549
  290523: b86d233
  290519: 1d3a802
  290511: 29ef279
  290495: f59afb8
v: v3
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Mar 1, 2012
1 parent 74706e8 commit 91ea476
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9c717758c9289331e22c88ef69d8c248def9cd29
refs/heads/master: 9c4df53bc3f9c72d7f1f1226927f456d46412381
3 changes: 3 additions & 0 deletions trunk/drivers/net/mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio,
int reg;
u32 speed;

BUILD_BUG_ON(MDIO_SUPPORTS_C22 != ETH_MDIO_SUPPORTS_C22);
BUILD_BUG_ON(MDIO_SUPPORTS_C45 != ETH_MDIO_SUPPORTS_C45);

ecmd->transceiver = XCVR_INTERNAL;
ecmd->phy_address = mdio->prtad;
ecmd->mdio_support =
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/mii.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/ethtool.h>
#include <linux/mdio.h>
#include <linux/mii.h>

static u32 mii_get_an(struct mii_if_info *mii, u16 addr)
{
Expand Down Expand Up @@ -74,7 +74,7 @@ int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)

/* this isn't fully supported at higher layers */
ecmd->phy_address = mii->phy_id;
ecmd->mdio_support = MDIO_SUPPORTS_C22;
ecmd->mdio_support = ETH_MDIO_SUPPORTS_C22;

ecmd->advertising = ADVERTISED_TP | ADVERTISED_MII;

Expand Down
23 changes: 21 additions & 2 deletions trunk/include/linux/ethtool.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ struct ethtool_cmd {
* access it */
__u8 duplex; /* Duplex, half or full */
__u8 port; /* Which connector port */
__u8 phy_address;
__u8 phy_address; /* MDIO PHY address (PRTAD for clause 45).
* May be read-only or read-write
* depending on the driver.
*/
__u8 transceiver; /* Which transceiver to use */
__u8 autoneg; /* Enable or disable autonegotiation */
__u8 mdio_support;
__u8 mdio_support; /* MDIO protocols supported. Read-only.
* Not set by all drivers.
*/
__u32 maxtxpkt; /* Tx pkts before generating tx int */
__u32 maxrxpkt; /* Rx pkts before generating rx int */
__u16 speed_hi; /* The forced speed (upper
Expand All @@ -59,6 +64,20 @@ static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
return (ep->speed_hi << 16) | ep->speed;
}

/* Device supports clause 22 register access to PHY or peripherals
* using the interface defined in <linux/mii.h>. This should not be
* set if there are known to be no such peripherals present or if
* the driver only emulates clause 22 registers for compatibility.
*/
#define ETH_MDIO_SUPPORTS_C22 1

/* Device supports clause 45 register access to PHY or peripherals
* using the interface defined in <linux/mii.h> and <linux/mdio.h>.
* This should not be set if there are known to be no such peripherals
* present.
*/
#define ETH_MDIO_SUPPORTS_C45 2

#define ETHTOOL_FWVERS_LEN 32
#define ETHTOOL_BUSINFO_LEN 32
/* these strings are set to whatever the driver author decides... */
Expand Down

0 comments on commit 91ea476

Please sign in to comment.