RE: [PATCH] Topcliff PHUB: Generate PacketHub driver

From: Wang, Qi
Date: Tue Jun 08 2010 - 20:14:27 EST


Let me explain what Arnd means.

Writing the all the registers with ioctl is discouraged. For this case, what you need is writing/updating or reading some registers, not all the registers of Topcliff. It's better that you implement as the following example.

For example, you want to update MAC register with 'aaaa'.
It's not a better way to pass the register of mac address and aaaa via the ioctl routine. It's better only pass the aaaa with the 'update mac address command' (update aaaa to mac register). Actually it's discouraged to pass the address information with ioctl routine, because it'll bring the security issue even if you check the address-range.

It's better to pass the command and relative argument to implement something, not 'the address', 'read/write register command' and 'the value to read/write'.

Any question, please let me know.

Best Regards,

-----Original Message-----
From: Masayuki Ohtake [mailto:masa-korg@xxxxxxxxxxxxxxx]
Sent: Tuesday, June 08, 2010 4:49 PM
To: Arnd Bergmann
Cc: LKML; Khor, Andrew Chih Howe; Clark, Joel; Wang, Qi; Wang, Yong Y
Subject: Re: [PATCH] Topcliff PHUB: Generate PacketHub driver

Hi Arnd

We are studying your indication.
> My feeling is that this ioctl interface is too
> low-level in general. You only export access to specific
> registers, not to functionality exposed by them.
> The best kernel interfaces are defined in a way that
> is independent of the underlying hardware and
> convert generic commands into device specific commands.

I have a question.
We don't know 'generic commands' concretely.
Let me know 'generic commands' in detail.

Thanks. Ohtake.

----- Original Message -----
From: "Arnd Bergmann" <arnd@xxxxxxxx>
To: "Masayuki Ohtake" <masa-korg@xxxxxxxxxxxxxxx>
Cc: "LKML" <linux-kernel@xxxxxxxxxxxxxxx>; "Andrew" <andrew.chih.howe.khor@xxxxxxxxx>; "Intel OTC"
<joel.clark@xxxxxxxxx>; "Wang, Qi" <>; "Wang, Yong Y" <>
Sent: Monday, June 07, 2010 10:37 PM
Subject: Re: [PATCH] Topcliff PHUB: Generate PacketHub driver

> On Friday 04 June 2010, Masayuki Ohtake wrote:
> > From: Masayuki Ohtake <masa-korg@xxxxxxxxxxxxxxx>
> >
> > This patch adds the Packet Hub driver for Topcliff.
> > Patch created against
> >
> > Signed-off-by: Masayuki Ohtake <masa-korg@xxxxxxxxxxxxxxx>
> Most of the comments from my first review still apply to
> this version, please have another look at what I wrote
> back in april, see
> Note also that patch submissions should be against the latest
> development kernel, in this case 2.6.35-rc2, not against stable
> kernel releases like
> Arnd

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at