* [PATCH] ethtool: Add version check for et131x regs
@ 2013-01-05 9:57 Mark Einon
2013-01-22 20:44 ` Ben Hutchings
0 siblings, 1 reply; 3+ messages in thread
From: Mark Einon @ 2013-01-05 9:57 UTC (permalink / raw)
To: bhutchings; +Cc: netdev, Mark Einon
Added a version check for the et131x reg dump, in case the dump format
needs to be changed later.
Signed-off-by: Mark Einon <mark.einon@gmail.com>
---
et131x.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/et131x.c b/et131x.c
index b36c184..8cdbec0 100644
--- a/et131x.c
+++ b/et131x.c
@@ -4,8 +4,12 @@
int et131x_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
{
+ u8 version = (u8)(regs->version >> 24);
u32 *reg = (u32 *)regs->data;
+ if(version != 1)
+ return -1;
+
fprintf(stdout, "PHY Registers\n");
fprintf(stdout, "0x0, Basic Control Reg = 0x%04X\n", *reg++);
fprintf(stdout, "0x1, Basic Status Reg = 0x%04X\n", *reg++);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ethtool: Add version check for et131x regs
2013-01-05 9:57 [PATCH] ethtool: Add version check for et131x regs Mark Einon
@ 2013-01-22 20:44 ` Ben Hutchings
2013-01-22 21:03 ` Mark Einon
0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2013-01-22 20:44 UTC (permalink / raw)
To: Mark Einon; +Cc: netdev
On Sat, 2013-01-05 at 09:57 +0000, Mark Einon wrote:
> Added a version check for the et131x reg dump, in case the dump format
> needs to be changed later.
>
> Signed-off-by: Mark Einon <mark.einon@gmail.com>
> ---
> et131x.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/et131x.c b/et131x.c
> index b36c184..8cdbec0 100644
> --- a/et131x.c
> +++ b/et131x.c
> @@ -4,8 +4,12 @@
>
> int et131x_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
> {
> + u8 version = (u8)(regs->version >> 24);
> u32 *reg = (u32 *)regs->data;
>
> + if(version != 1)
Needs a space before the open-parentheis.
Ben.
> + return -1;
> +
> fprintf(stdout, "PHY Registers\n");
> fprintf(stdout, "0x0, Basic Control Reg = 0x%04X\n", *reg++);
> fprintf(stdout, "0x1, Basic Status Reg = 0x%04X\n", *reg++);
--
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] 3+ messages in thread
* Re: [PATCH] ethtool: Add version check for et131x regs
2013-01-22 20:44 ` Ben Hutchings
@ 2013-01-22 21:03 ` Mark Einon
0 siblings, 0 replies; 3+ messages in thread
From: Mark Einon @ 2013-01-22 21:03 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev
On 22 January 2013 20:44, Ben Hutchings <bhutchings@solarflare.com> wrote:
> On Sat, 2013-01-05 at 09:57 +0000, Mark Einon wrote:
>> Added a version check for the et131x reg dump, in case the dump format
>> needs to be changed later.
>>
>> Signed-off-by: Mark Einon <mark.einon@gmail.com>
>> ---
>> et131x.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/et131x.c b/et131x.c
>> index b36c184..8cdbec0 100644
>> --- a/et131x.c
>> +++ b/et131x.c
>> @@ -4,8 +4,12 @@
>>
>> int et131x_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
>> {
>> + u8 version = (u8)(regs->version >> 24);
>> u32 *reg = (u32 *)regs->data;
>>
>> + if(version != 1)
>
> Needs a space before the open-parentheis.
>
> Ben.
You're right - I cut and pasted the code from another file without
checking. I'll send a separate patch for fixing them, if you want this
patch re-submitted as well, then just let me know.
cheers,
Mark
>
>> + return -1;
>> +
>> fprintf(stdout, "PHY Registers\n");
>> fprintf(stdout, "0x0, Basic Control Reg = 0x%04X\n", *reg++);
>> fprintf(stdout, "0x1, Basic Status Reg = 0x%04X\n", *reg++);
>
> --
> 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] 3+ messages in thread
end of thread, other threads:[~2013-01-22 21:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-05 9:57 [PATCH] ethtool: Add version check for et131x regs Mark Einon
2013-01-22 20:44 ` Ben Hutchings
2013-01-22 21:03 ` Mark Einon
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.