[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <000801cb0d32$24ca1360$66f8800a@maildom.okisemi.com>
Date: Wed, 16 Jun 2010 17:58:48 +0900
From: "Masayuki Ohtake" <masa-korg@....okisemi.com>
To: "Arnd Bergmann" <arnd@...db.de>
Cc: "Alan Cox" <alan@...rguk.ukuu.org.uk>,
"LKML" <linux-kernel@...r.kernel.org>,
"Andrew" <andrew.chih.howe.khor@...el.com>,
"Intel OTC" <joel.clark@...el.com>, "Wang, Qi" <qi.wang@...el.com>,
"Wang, Yong Y" <yong.y.wang@...el.com>
Subject: Re: [PATCH] Topcliff PHUB: Generate PacketHub driver
Hi Arnd,
For user useful, I have decided to implement 'pos' processing to Phub driver.
I have a question.
> Especially if you want to be able to use tools like 'cat', 'hexdump'
> or 'dd' on the file descriptor, you need to implement support for
> short reads.
I don't know how to test(short read/write access).
Could you tell me how to do the above ?
Thanks,
Ohtake.
----- Original Message -----
From: "Arnd Bergmann" <arnd@...db.de>
To: "Masayuki Ohtake" <masa-korg@....okisemi.com>
Cc: "Wang, Yong Y" <yong.y.wang@...el.com>; "Wang, Qi" <qi.wang@...el.com>; "Intel OTC" <joel.clark@...el.com>; "Andrew"
<andrew.chih.howe.khor@...el.com>; "LKML" <linux-kernel@...r.kernel.org>; "Alan Cox" <alan@...rguk.ukuu.org.uk>
Sent: Tuesday, June 15, 2010 7:37 PM
Subject: Re: [PATCH] Topcliff PHUB: Generate PacketHub driver
> On Tuesday 15 June 2010, Masayuki Ohtake wrote:
> > I have additional question.
> > > - When the user does an llseek or pread, the *pos argument is not zero,
> > > so you should return data from the middle, but you still return data
> > > from the beginning.
> >
> >
> > Must a driver read/write method support '*pos' parameter ?
> > We think PHUB doesn't have to support '*pos',
> > and ,we think, PHUB OROM R/W function supports only whole of ROM data R/W is enough.
> > Please give us your opinion.
>
> While you do not strictly need to support *pos to get the functionality
> you want, it should be easy enough to implement and it will make the
> read/write callbacks conform to the general semantics of file based
> I/O. Especially if you want to be able to use tools like 'cat', 'hexdump'
> or 'dd' on the file descriptor, you need to implement support for
> short reads. If you are unsure about how to do that correctly, I can
> help you some more. A good reference implementation is
> simple_transaction_read in fs/libfs.c, which simply returns some
> private memory.
>
> If there is a strict hardware limitation that prevents you from doing
> partial writes, you could expose that in the interface and return -EIO
> in case of invalid *pos or size arguements, but my impression was that
> the hardware can deal with bytewise access.
>
> Arnd
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists