[lkml]   [2005]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject2.6: how do I this in sysfs?
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?

> 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?
> typedef struct _COMMAND_HEADER {
> __u32 IOControllerNumber;
> __u32 Length;
> __u32 ReturnCode;
> __u32 Timeout;
> __u16 Direction;
> 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];
> typedef struct _CSMI_SAS_PHY_ENTITY {
> __u8 bPortIdentifier;
> __u8 bNegotiatedLinkRate;
> __u8 bMinimumLinkRate;
> __u8 bMaximumLinkRate;
> __u8 bPhyChangeCount;
> __u8 bAutoDiscover;
> __u8 bReserved[2];
> typedef struct _CSMI_SAS_PHY_INFO {
> __u8 bNumberOfPhys;
> __u8 bReserved[3];
> typedef struct _CSMI_SAS_PHY_INFO_BUFFER {
> CSMI_SAS_PHY_INFO Information;
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-08-25 20:54    [W:0.019 / U:9.636 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site