[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1411340326.20019.32.camel@decadent.org.uk>
Date: Sun, 21 Sep 2014 23:58:46 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: Mugunthan V N <mugunthanvnm@...com>
Cc: netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [ethtool PATCH 1/1] ethtool: Support cpsw ale-table registers
in -d
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.
[...]
> +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.
Ben.
--
Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
- Albert Camus
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)
Powered by blists - more mailing lists