* [PATCH net-next] mdio: Export mdio.h to userland
@ 2012-02-29 19:02 Ben Hutchings
2012-02-29 19:12 ` Ben Hutchings
0 siblings, 1 reply; 7+ messages in thread
From: Ben Hutchings @ 2012-02-29 19:02 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers
The ID packing/unpacking functions are needed by userland and the
register definitions may also be useful there.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
include/linux/Kbuild | 1 +
1 files changed, 1 insertions(+), 0 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
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net-next] mdio: Export mdio.h to userland
2012-02-29 19:02 [PATCH net-next] mdio: Export mdio.h to userland Ben Hutchings
@ 2012-02-29 19:12 ` Ben Hutchings
2012-02-29 20:42 ` David Miller
0 siblings, 1 reply; 7+ messages in thread
From: Ben Hutchings @ 2012-02-29 19:12 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers
On Wed, 2012-02-29 at 19:02 +0000, Ben Hutchings wrote:
> The ID packing/unpacking functions are needed by userland and the
> register definitions may also be useful there.
Minor issue with this: mdio_phy_id_is_c45() returns bool, and that's not
defined by default. Should I add #include <stdbool.h> or change the
return type to int for maximum compatibility?
Ben.
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
> include/linux/Kbuild | 1 +
> 1 files changed, 1 insertions(+), 0 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
> --
> 1.7.7.6
>
>
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next] mdio: Export mdio.h to userland
2012-02-29 19:12 ` Ben Hutchings
@ 2012-02-29 20:42 ` David Miller
2012-02-29 22:43 ` Ben Hutchings
0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2012-02-29 20:42 UTC (permalink / raw)
To: bhutchings; +Cc: netdev, linux-net-drivers
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Wed, 29 Feb 2012 19:12:34 +0000
> On Wed, 2012-02-29 at 19:02 +0000, Ben Hutchings wrote:
>> The ID packing/unpacking functions are needed by userland and the
>> register definitions may also be useful there.
>
> Minor issue with this: mdio_phy_id_is_c45() returns bool, and that's not
> defined by default. Should I add #include <stdbool.h> or change the
> return type to int for maximum compatibility?
I do not see any precedence for including stdbool.h in a kernel header
file. And I sure as hell am not going to compromise using a correct
type just to make this usable by userspace.
I think this is of dubious value, and combined with the bool
complication I'm not going to apply this, sorry.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next] mdio: Export mdio.h to userland
2012-02-29 20:42 ` David Miller
@ 2012-02-29 22:43 ` Ben Hutchings
2012-02-29 23:02 ` David Miller
0 siblings, 1 reply; 7+ messages in thread
From: Ben Hutchings @ 2012-02-29 22:43 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers
On Wed, 2012-02-29 at 15:42 -0500, David Miller wrote:
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Wed, 29 Feb 2012 19:12:34 +0000
>
> > On Wed, 2012-02-29 at 19:02 +0000, Ben Hutchings wrote:
> >> The ID packing/unpacking functions are needed by userland and the
> >> register definitions may also be useful there.
> >
> > Minor issue with this: mdio_phy_id_is_c45() returns bool, and that's not
> > defined by default. Should I add #include <stdbool.h> or change the
> > return type to int for maximum compatibility?
>
> I do not see any precedence for including stdbool.h in a kernel header
> file. And I sure as hell am not going to compromise using a correct
> type just to make this usable by userspace.
>
> I think this is of dubious value, and combined with the bool
> complication I'm not going to apply this, sorry.
Without this, userland doing clause 45 MDIO has to duplicate the ID
packing definitions. I intended to export these to userland in the
first place; that's why the header already has an #ifdef __KERNEL__.
I was about to get rid of the duplicate definitions in our utilities
when I realised I hadn't exported them.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next] mdio: Export mdio.h to userland
2012-02-29 22:43 ` Ben Hutchings
@ 2012-02-29 23:02 ` David Miller
2012-02-29 23:09 ` Ben Hutchings
0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2012-02-29 23:02 UTC (permalink / raw)
To: bhutchings; +Cc: netdev, linux-net-drivers
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Wed, 29 Feb 2012 22:43:48 +0000
> On Wed, 2012-02-29 at 15:42 -0500, David Miller wrote:
>> From: Ben Hutchings <bhutchings@solarflare.com>
>> Date: Wed, 29 Feb 2012 19:12:34 +0000
>>
>> > On Wed, 2012-02-29 at 19:02 +0000, Ben Hutchings wrote:
>> >> The ID packing/unpacking functions are needed by userland and the
>> >> register definitions may also be useful there.
>> >
>> > Minor issue with this: mdio_phy_id_is_c45() returns bool, and that's not
>> > defined by default. Should I add #include <stdbool.h> or change the
>> > return type to int for maximum compatibility?
>>
>> I do not see any precedence for including stdbool.h in a kernel header
>> file. And I sure as hell am not going to compromise using a correct
>> type just to make this usable by userspace.
>>
>> I think this is of dubious value, and combined with the bool
>> complication I'm not going to apply this, sorry.
>
> Without this, userland doing clause 45 MDIO has to duplicate the ID
> packing definitions.
Then come up with a real solution to the bool issue.
But note that changing the bool to an int is not a solution, neither
is #include <stdbool.h> unless we can reach consensus on lkml that
this is OK.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next] mdio: Export mdio.h to userland
2012-02-29 23:02 ` David Miller
@ 2012-02-29 23:09 ` Ben Hutchings
2012-02-29 23:31 ` David Miller
0 siblings, 1 reply; 7+ messages in thread
From: Ben Hutchings @ 2012-02-29 23:09 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers
On Wed, 2012-02-29 at 18:02 -0500, David Miller wrote:
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Wed, 29 Feb 2012 22:43:48 +0000
>
> > On Wed, 2012-02-29 at 15:42 -0500, David Miller wrote:
> >> From: Ben Hutchings <bhutchings@solarflare.com>
> >> Date: Wed, 29 Feb 2012 19:12:34 +0000
> >>
> >> > On Wed, 2012-02-29 at 19:02 +0000, Ben Hutchings wrote:
> >> >> The ID packing/unpacking functions are needed by userland and the
> >> >> register definitions may also be useful there.
> >> >
> >> > Minor issue with this: mdio_phy_id_is_c45() returns bool, and that's not
> >> > defined by default. Should I add #include <stdbool.h> or change the
> >> > return type to int for maximum compatibility?
> >>
> >> I do not see any precedence for including stdbool.h in a kernel header
> >> file. And I sure as hell am not going to compromise using a correct
> >> type just to make this usable by userspace.
> >>
> >> I think this is of dubious value, and combined with the bool
> >> complication I'm not going to apply this, sorry.
> >
> > Without this, userland doing clause 45 MDIO has to duplicate the ID
> > packing definitions.
>
> Then come up with a real solution to the bool issue.
>
> But note that changing the bool to an int is not a solution, neither
> is #include <stdbool.h> unless we can reach consensus on lkml that
> this is OK.
I could just move the mdio_phy_id_is_c45(), mdio_phy_id_prtad(),
mdio_phy_id_devad() functions inside #ifdef __KERNEL__ since userland
shouldn't need to unpack PHY IDs.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-02-29 23:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-29 19:02 [PATCH net-next] mdio: Export mdio.h to userland Ben Hutchings
2012-02-29 19:12 ` Ben Hutchings
2012-02-29 20:42 ` David Miller
2012-02-29 22:43 ` Ben Hutchings
2012-02-29 23:02 ` David Miller
2012-02-29 23:09 ` Ben Hutchings
2012-02-29 23:31 ` David Miller
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).