From: Mugunthan V N <mugunthanvnm@ti.com>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: <netdev@vger.kernel.org>, <davem@davemloft.net>
Subject: Re: [ethtool PATCH 1/1] ethtool: Support cpsw ale-table registers in -d
Date: Wed, 24 Sep 2014 11:02:22 +0530 [thread overview]
Message-ID: <54225766.5020407@ti.com> (raw)
In-Reply-To: <1411340326.20019.32.camel@decadent.org.uk>
On Monday 22 September 2014 04:28 AM, Ben Hutchings wrote:
> Sorry I didn't respond to this earlier.
>
> On Wed, 2014-07-23 at 14:59 +0530, Mugunthan V N wrote:
> [...]
>> --- /dev/null
>> +++ b/cpsw.c
> [...]
>> +static inline void cpsw_ale_set_field(u32 *ale_entry, u32 start, u32 bits,
>> + u32 value)
>> +{
>> + int idx;
>> +
>> + value &= BITMASK(bits);
>> + idx = start / 32;
>> + start -= idx * 32;
>> + idx = 2 - idx; /* flip */
>> + ale_entry[idx] &= ~(BITMASK(bits) << start);
>> + ale_entry[idx] |= (value << start);
>> +}
>> +
>> +#define DEFINE_ALE_FIELD(name, start, bits) \
>> +static inline int cpsw_ale_get_##name(u32 *ale_entry) \
>> +{ \
>> + return cpsw_ale_get_field(ale_entry, start, bits); \
>> +} \
>> +static inline void cpsw_ale_set_##name(u32 *ale_entry, u32 value) \
>> +{ \
>> + cpsw_ale_set_field(ale_entry, start, bits, value); \
>> +}
>
> The setter functions are unused.
Will fis this in next version
>
> [...]
>> +int cpsw_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
>> +{
>> + u32 *reg = (u8 *)regs->data;
>> + u32 len = regs->len / 3;
>> + int i;
>> +
>> + fprintf(stdout, "cpsw hw version %d.%d (%d)\n",
>> + CPSW_MAJOR_VERSION(regs->version),
>> + CPSW_MINOR_VERSION(regs->version),
>> + CPSW_RTL_VERSION(regs->version));
> [...]
>
> There needs to be a version check here. Some future version of the
> hardware or driver may introduce an incompatible dump format.
>
Will check the hardware version in v2.
Regards
Mugunthan V N
prev parent reply other threads:[~2014-09-24 5:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-23 9:29 [ethtool PATCH 1/1] ethtool: Support cpsw ale-table registers in -d Mugunthan V N
2014-07-23 9:35 ` Mugunthan V N
2014-09-21 22:58 ` Ben Hutchings
2014-09-24 5:32 ` Mugunthan V N [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54225766.5020407@ti.com \
--to=mugunthanvnm@ti.com \
--cc=ben@decadent.org.uk \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.