From patchwork Thu Mar 1 00:23:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Hutchings X-Patchwork-Id: 143866 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 2C5D7B6EEA for ; Thu, 1 Mar 2012 11:23:35 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757766Ab2CAAXd (ORCPT ); Wed, 29 Feb 2012 19:23:33 -0500 Received: from mail.solarflare.com ([216.237.3.220]:14637 "EHLO ocex02.SolarFlarecom.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757693Ab2CAAXc (ORCPT ); Wed, 29 Feb 2012 19:23:32 -0500 Received: from [10.17.20.137] (10.17.20.137) by ocex02.SolarFlarecom.com (10.20.40.31) with Microsoft SMTP Server (TLS) id 14.1.355.2; Wed, 29 Feb 2012 16:23:29 -0800 Message-ID: <1330561407.5881.13.camel@bwh-desktop> Subject: [PATCHv2 net-next 1/2] mdio: Export mdio.h to userland From: Ben Hutchings To: David Miller CC: , Date: Thu, 1 Mar 2012 00:23:27 +0000 Organization: Solarflare Communications X-Mailer: Evolution 3.2.3 (3.2.3-1.fc16) MIME-Version: 1.0 X-Originating-IP: [10.17.20.137] X-TM-AS-Product-Ver: SMEX-10.0.0.1412-6.800.1017-18742.005 X-TM-AS-Result: No--6.217800-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- include/linux/Kbuild | 1 + include/linux/mdio.h | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/Kbuild b/include/linux/Kbuild index c94e717..4b0b7ed 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild @@ -238,6 +238,7 @@ header-y += magic.h header-y += major.h header-y += map_to_7segment.h header-y += matroxfb.h +header-y += mdio.h header-y += media.h header-y += mempolicy.h header-y += meye.h diff --git a/include/linux/mdio.h b/include/linux/mdio.h index b1494ac..dec1e87 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) return MDIO_PHY_ID_C45 | (prtad << 5) | devad; } +#ifdef __KERNEL__ + 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); @@ -288,11 +290,6 @@ static inline __u16 mdio_phy_id_devad(int phy_id) 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 * @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_DEVAD_NONE (-1) +#define MDIO_SUPPORTS_C22 1 +#define MDIO_SUPPORTS_C45 2 #define MDIO_EMULATE_C22 4 struct ethtool_cmd;