Subject: Re: How to grab a block of binary data w/out using ioctls?

From: Ben Greear <[email-masked]>
Date: Wed, 25 Oct 2006 09:30:02 -0700

Jeff Garzik wrote:
> On Tue, Oct 24, 2006 at 09:35:49PM -0700, Randy Dunlap wrote:
>   
>>> Please grep for sysfs_create_bin_file, you will find plenty of examples.
>>>       
>> Hm, I thought that sysfs binary files were supposed to be
>> for "transparent" blobs of data, not for structured data.
>> E.g., a "firmware" blob would be OK.
>>     
>
> Depends.  Normally ASCII is greatly preferred, but passing in/out big
> data structures can be a huge pain, thunking to/from ASCII.
>   
This is my scenario exactly.  It is also much easier to make sure the 
data is
coherent if I can grab it all at once.

In my case, I'm wanting to add this to the pktgen module, for reporting 
stats.  But,
it seems sysfs is designed mostly for drivers with some sort of 'object' 
behind it.

Would I need to create some faked out dummy object in order to use sysfs 
with
pktgen?

I also notice there is already a /sys/modules/pktgen node in sysfs..is 
there any easy way to
stick my binary file interface in that directory?

Thanks,
Ben

-- 
Ben Greear <[email-masked]> 
Candela Technologies Inc  http://www.candelatech.com