aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-02-29 09:23:27 -0500
committerDavid S. Miller <davem@davemloft.net>2012-03-01 16:41:22 -0500
commit9c717758c9289331e22c88ef69d8c248def9cd29 (patch)
tree316ed50fa343cb22f55a507dc2324d8287c4b673
parent48752f6513012a1b078da08b145d5c40a644f058 (diff)
mdio: Export mdio.h to userland
The ID packing definitions are needed by userland and the register definitions may also be useful there. Do not export mdio_phy_id_{is_c45,prtad,devad}() as the use of bool is problematic and it's not that useful to export only a subset of these. Do not export MDIO_SUPPORTS_{C22,C45} directly; these flags are only exposed to userland through struct ethtool_cmd so they should be defined alongside that with appropriate names. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/mdio.h9
2 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index c94e71781b79..4b0b7ed4a999 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -238,6 +238,7 @@ header-y += magic.h
238header-y += major.h 238header-y += major.h
239header-y += map_to_7segment.h 239header-y += map_to_7segment.h
240header-y += matroxfb.h 240header-y += matroxfb.h
241header-y += mdio.h
241header-y += media.h 242header-y += media.h
242header-y += mempolicy.h 243header-y += mempolicy.h
243header-y += meye.h 244header-y += meye.h
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index b1494aced217..ec90da7232cc 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -273,6 +273,8 @@ static inline __u16 mdio_phy_id_c45(int prtad, int devad)
273 return MDIO_PHY_ID_C45 | (prtad << 5) | devad; 273 return MDIO_PHY_ID_C45 | (prtad << 5) | devad;
274} 274}
275 275
276#ifdef __KERNEL__
277
276static inline bool mdio_phy_id_is_c45(int phy_id) 278static inline bool mdio_phy_id_is_c45(int phy_id)
277{ 279{
278 return (phy_id & MDIO_PHY_ID_C45) && !(phy_id & ~MDIO_PHY_ID_C45_MASK); 280 return (phy_id & MDIO_PHY_ID_C45) && !(phy_id & ~MDIO_PHY_ID_C45_MASK);
@@ -288,11 +290,6 @@ static inline __u16 mdio_phy_id_devad(int phy_id)
288 return phy_id & MDIO_PHY_ID_DEVAD; 290 return phy_id & MDIO_PHY_ID_DEVAD;
289} 291}
290 292
291#define MDIO_SUPPORTS_C22 1
292#define MDIO_SUPPORTS_C45 2
293
294#ifdef __KERNEL__
295
296/** 293/**
297 * struct mdio_if_info - Ethernet controller MDIO interface 294 * struct mdio_if_info - Ethernet controller MDIO interface
298 * @prtad: PRTAD of the PHY (%MDIO_PRTAD_NONE if not present/unknown) 295 * @prtad: PRTAD of the PHY (%MDIO_PRTAD_NONE if not present/unknown)
@@ -321,6 +318,8 @@ struct mdio_if_info {
321 318
322#define MDIO_PRTAD_NONE (-1) 319#define MDIO_PRTAD_NONE (-1)
323#define MDIO_DEVAD_NONE (-1) 320#define MDIO_DEVAD_NONE (-1)
321#define MDIO_SUPPORTS_C22 1
322#define MDIO_SUPPORTS_C45 2
324#define MDIO_EMULATE_C22 4 323#define MDIO_EMULATE_C22 4
325 324
326struct ethtool_cmd; 325struct ethtool_cmd;