2.6: how do I this in sysfs?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

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;
> 
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux