瀏覽代碼

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>
Ben Hutchings 13 年之前
父節點
當前提交
9c717758c9
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. 1 0
      include/linux/Kbuild
  2. 4 5
      include/linux/mdio.h

+ 1 - 0
include/linux/Kbuild

@@ -238,6 +238,7 @@ header-y += magic.h
 header-y += major.h
 header-y += major.h
 header-y += map_to_7segment.h
 header-y += map_to_7segment.h
 header-y += matroxfb.h
 header-y += matroxfb.h
+header-y += mdio.h
 header-y += media.h
 header-y += media.h
 header-y += mempolicy.h
 header-y += mempolicy.h
 header-y += meye.h
 header-y += meye.h

+ 4 - 5
include/linux/mdio.h

@@ -273,6 +273,8 @@ static inline __u16 mdio_phy_id_c45(int prtad, int devad)
 	return MDIO_PHY_ID_C45 | (prtad << 5) | devad;
 	return MDIO_PHY_ID_C45 | (prtad << 5) | devad;
 }
 }
 
 
+#ifdef __KERNEL__
+
 static inline bool mdio_phy_id_is_c45(int phy_id)
 static inline bool mdio_phy_id_is_c45(int phy_id)
 {
 {
 	return (phy_id & MDIO_PHY_ID_C45) && !(phy_id & ~MDIO_PHY_ID_C45_MASK);
 	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)
 	return phy_id & MDIO_PHY_ID_DEVAD;
 	return phy_id & MDIO_PHY_ID_DEVAD;
 }
 }
 
 
-#define MDIO_SUPPORTS_C22		1
-#define MDIO_SUPPORTS_C45		2
-
-#ifdef __KERNEL__ 
-
 /**
 /**
  * struct mdio_if_info - Ethernet controller MDIO interface
  * struct mdio_if_info - Ethernet controller MDIO interface
  * @prtad: PRTAD of the PHY (%MDIO_PRTAD_NONE if not present/unknown)
  * @prtad: PRTAD of the PHY (%MDIO_PRTAD_NONE if not present/unknown)
@@ -321,6 +318,8 @@ struct mdio_if_info {
 
 
 #define MDIO_PRTAD_NONE			(-1)
 #define MDIO_PRTAD_NONE			(-1)
 #define MDIO_DEVAD_NONE			(-1)
 #define MDIO_DEVAD_NONE			(-1)
+#define MDIO_SUPPORTS_C22		1
+#define MDIO_SUPPORTS_C45		2
 #define MDIO_EMULATE_C22		4
 #define MDIO_EMULATE_C22		4
 
 
 struct ethtool_cmd;
 struct ethtool_cmd;