lkml.org 
[lkml]   [2005]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: 2.6: how do I this in sysfs?
From
Date
On Thu, 2005-08-25 at 13:52 -0500, Miller, Mike (OS Dev) wrote:
> I've been asked to pass this on for some kind of clarification.
> We have management apps requiring specific information from the Smart
> Array controller. We're trying to use sysfs to accomplish the task. An
> example of what we need to do is below. I'm sure some of you will
> recognize this as CSMI.
> The basic question is this: how do you pass complex data structures back
> and forth between user/kernelspace and still abide by the rules around
> sysfs like: one attribute per file, text files only, etc?

Wouldn't you be able to post these items in sysfs attributes in the SAS
transport layer, assuming the cciss driver used the SAS transport layer.
Then the LLDD would be responsible for retrieving/setting the attribute
using whatever method is appropriate (dma, request queues, etc).

I was hoping to start work on adding SDI operations to Christoph
Hellwig's SAS transport layer sometime next week.

Andrew

>
> Thanks,
> mikem
> >
> > We have a storage controller which has some features which
> > Work more or less as follows, but are not really "regular i/o"
> > In the sense that they are used for configuration or
> > management Of devices rather than being the primary purpose
> > of the devices.
> >
> > The host constructs a somewhat complex data buffer according
> > to a predefined convention, And fills out certain parts of
> > the buffer to formulate what could be a query, or perhaps
> > configuration data.
> > It then constructs a command which includes scatter gather
> > elements Which reference this data buffer, and writes the bus
> > address of the Command to a register on the controller.
> >
> > The controller reads the command and data buffer from host
> > memory, And DMAs the results of the query into the same data
> > buffer, and issues An interrupt to the host. So there's a
> > bidirectional transfer Of data to/from the data buffer.
> >
> > For example, one the data buffers the controller understands
> > looks like what's below:
> >
> > User applications need to be able to use this interface to
> > talk To the controller. What's the recommended way to
> > implement such An interface?
> >
> > // CC_CSMI_SAS_GET_PHY_INFO
> > typedef struct _COMMAND_HEADER {
> > __u32 IOControllerNumber;
> > __u32 Length;
> > __u32 ReturnCode;
> > __u32 Timeout;
> > __u16 Direction;
> > } COMMAND_HEADER, *PCOMMAND_HEADER;
> >
> > typedef struct _CSMI_SAS_IDENTIFY {
> > __u8 bDeviceType;
> > __u8 bRestricted;
> > __u8 bInitiatorPortProtocol;
> > __u8 bTargetPortProtocol;
> > __u8 bRestricted2[8];
> > __u8 bSASAddress[8];
> > __u8 bPhyIdentifier;
> > __u8 bSignalClass;
> > __u8 bReserved[6];
> > } CSMI_SAS_IDENTIFY,
> > *PCSMI_SAS_IDENTIFY;
> >
> > typedef struct _CSMI_SAS_PHY_ENTITY {
> > CSMI_SAS_IDENTIFY Identify;
> > __u8 bPortIdentifier;
> > __u8 bNegotiatedLinkRate;
> > __u8 bMinimumLinkRate;
> > __u8 bMaximumLinkRate;
> > __u8 bPhyChangeCount;
> > __u8 bAutoDiscover;
> > __u8 bReserved[2];
> > CSMI_SAS_IDENTIFY Attached;
> > } CSMI_SAS_PHY_ENTITY,
> > *PCSMI_SAS_PHY_ENTITY;
> >
> > typedef struct _CSMI_SAS_PHY_INFO {
> > __u8 bNumberOfPhys;
> > __u8 bReserved[3];
> > CSMI_SAS_PHY_ENTITY Phy[32];
> > } CSMI_SAS_PHY_INFO,
> > *PCSMI_SAS_PHY_INFO;
> >
> > typedef struct _CSMI_SAS_PHY_INFO_BUFFER {
> > COMMAND_HEADER IoctlHeader;
> > CSMI_SAS_PHY_INFO Information;
> > } CSMI_SAS_PHY_INFO_BUFFER,
> > *PCSMI_SAS_PHY_INFO_BUFFER;
> >
>
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-08-25 21:05    [W:2.845 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site