From 8d6a55f3048d415b621436b54018ee1f41cfbe94 Mon Sep 17 00:00:00 2001 From: mananth Date: Mon, 15 Mar 2004 09:05:59 +0000 Subject: Updated docs/libsysfs.txt --- ChangeLog | 3 + docs/libsysfs.txt | 308 ++++++++++++++++++++++++++---------------------------- 2 files changed, 151 insertions(+), 160 deletions(-) diff --git a/ChangeLog b/ChangeLog index 42a75de..8d97dda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ +03/15/2004 - Ananth Mavinakayanahalli + * Updated docs/libsysfs.txt for release 1.1.0 + 03/12/2004 - Ananth Mavinakayanahalli * Modified string functions to use wrappers to take care of potential buffer overflow issues diff --git a/docs/libsysfs.txt b/docs/libsysfs.txt index 6001495..7427794 100644 --- a/docs/libsysfs.txt +++ b/docs/libsysfs.txt @@ -2,8 +2,8 @@ System Utilities sysfs Library - libsysfs ========================================= -Version: 1.0.0 -February 10, 2004 +Version: 1.1.0 +March 15, 2004 Contents -------- @@ -178,9 +178,9 @@ read only, write only, or read and write. File data can be ASCII and binary. The library has the following structure to represent files: struct sysfs_attribute { - unsigned char name[SYSFS_NAME_LEN]; - unsigned char path[SYSFS_PATH_MAX]; - unsigned char *value; + char name[SYSFS_NAME_LEN]; + char path[SYSFS_PATH_MAX]; + char *value; unsigned short len; /* value length */ unsigned short method; /* show and store */ }; @@ -198,9 +198,9 @@ Symbolic links are used in sysfs to link bus or class views with particular devices. struct sysfs_link { - unsigned char name[SYSFS_NAME_LEN]; - unsigned char path[SYSFS_PATH_MAX]; - unsigned char target[SYSFS_PATH_MAX]; + char name[SYSFS_NAME_LEN]; + char path[SYSFS_PATH_MAX]; + char target[SYSFS_PATH_MAX]; }; Link's name is stored in "name' and it's target stored in "target". Absolute @@ -213,8 +213,8 @@ path to the link is stored in "path". The directory structure represents a sysfs directory: struct sysfs_directory { - unsigned char name[SYSFS_NAME_LEN]; - unsigned char path[SYSFS_PATH_MAX]; + char name[SYSFS_NAME_LEN]; + char path[SYSFS_PATH_MAX]; /* Private: for internal use only */ struct dlist *subdirs; @@ -236,8 +236,8 @@ All buses look similar in sysfs including lists of devices and drivers, therefore we use the following structure to represent all sysfs buses: struct sysfs_bus { - unsigned char name[SYSFS_NAME_LEN]; - unsigned char path[SYSFS_PATH_MAX]; + char name[SYSFS_NAME_LEN]; + char path[SYSFS_PATH_MAX]; /* Private: for internal use only */ struct dlist *drivers; @@ -255,7 +255,7 @@ applications to retrieve data from the sysfs_directory structure: struct dlist *sysfs_get_bus_attributes(struct sysfs_bus *bus) struct sysfs_attribute *sysfs_get_bus_attribute(struct sysfs_bus *bus, - unsigned char *attrname) + char *attrname) 5.3 Class Data Structures @@ -266,8 +266,8 @@ classes contains a class directory like "net" or "scsi_host" and then class devices like "eth0", "lo", or "eth1" for the "net" class. struct sysfs_class { - unsigned char name[SYSFS_NAME_LEN]; - unsigned char path[SYSFS_PATH_MAX]; + char name[SYSFS_NAME_LEN]; + char path[SYSFS_PATH_MAX]; /* Private: for internal use only */ struct dlist *devices; @@ -279,9 +279,9 @@ the class "name", "path" to the class, a list of class devices and the directory representation (for internal use only). struct sysfs_class_device { - unsigned char name[SYSFS_NAME_LEN]; - unsigned char path[SYSFS_PATH_MAX]; - unsigned char classname[SYSFS_NAME_LEN]; + char name[SYSFS_NAME_LEN]; + char path[SYSFS_PATH_MAX]; + char classname[SYSFS_NAME_LEN]; /* Private: for internal use only */ struct sysfs_class_device *parent; @@ -310,8 +310,8 @@ structure. Sysfs devices typically spawn off from base devices which are represented by a sysfs_root_device. struct sysfs_root_device { - unsigned char name[SYSFS_NAME_LEN]; - unsigned char path[SYSFS_PATH_MAX]; + char name[SYSFS_NAME_LEN]; + char path[SYSFS_PATH_MAX]; /* Private: for internal use only */ struct dlist *devices; @@ -331,11 +331,11 @@ The sysfs_device structure represents a system device that's exposed in sysfs under the /sys/devices directory structure. struct sysfs_device { - unsigned char name[SYSFS_NAME_LEN]; - unsigned char path[SYSFS_PATH_MAX]; - unsigned char bus_id[SYSFS_NAME_LEN]; - unsigned char bus[SYSFS_NAME_LEN]; - unsigned char driver_name[SYSFS_NAME_LEN]; + char name[SYSFS_NAME_LEN]; + char path[SYSFS_PATH_MAX]; + char bus_id[SYSFS_NAME_LEN]; + char bus[SYSFS_NAME_LEN]; + char driver_name[SYSFS_NAME_LEN]; /* Private: for internal use only */ struct sysfs_device *parent; @@ -352,7 +352,7 @@ device's attributes (for internal use only). The following functions may be used to obtain information from sysfs_directory structure: struct sysfs_attribute *sysfs_get_device_attribute(struct sysfs_device *dev, - const unsigned char *name) + const char *name) struct dlist *sysfs_get_device_attributes(struct sysfs_device *device) @@ -362,8 +362,8 @@ struct dlist *sysfs_get_device_attributes(struct sysfs_device *device) The sysfs_driver structure represents a device driver. struct sysfs_driver { - unsigned char name[SYSFS_NAME_LEN]; - unsigned char path[SYSFS_PATH_MAX]; + char name[SYSFS_NAME_LEN]; + char path[SYSFS_PATH_MAX]; /* Private: for internal use only */ struct dlist *devices; @@ -398,15 +398,15 @@ Name: sysfs_get_mnt_path Description: Function finds the mount path for filesystem type "sysfs". -Arguments: unsigned char *mnt_path Mount path buffer - size_t len Size of mount path buffer +Arguments: char *mnt_path Mount path buffer + size_t len Size of mount path buffer Returns: Zero with success. -1 with error. Errno will be set with error: - EINVAL for invalid argument, if buffer is NULL or if len is zero -Prototype: sysfs_get_mnt_path(unsigned char *mnt_path, size_t len); +Prototype: sysfs_get_mnt_path(char *mnt_path, size_t len); ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -415,16 +415,16 @@ Name: sysfs_get_name_from_path Description: Function returns the last directory or file name from the included path. -Arguments: const unsigned char *path Path to parse name from - unsigned char *name Buffer to put parsed name into - size_t *len Size of name buffer +Arguments: const char *path Path to parse name from + char *name Buffer to put parsed name into + size_t *len Size of name buffer Returns: 0 with success. -1 on Error. Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: int sysfs_get_name_from_path(const unsigned char *path, - unsigned char *name, size_t *len) +Prototype: int sysfs_get_name_from_path(const char *path, + char *name, size_t *len) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -433,16 +433,15 @@ Name: sysfs_get_link Description: Sysfs readlink function, reads the link at supplied path and returns its target path. -Arguments: const unsigned char *path Link's path - unsigned char *target Buffer to place link's target - size_t len Size of target buffer +Arguments: const char *path Link's path + char *target Buffer to place link's target + size_t len Size of target buffer Returns: 0 with success -1 with error. Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: int sysfs_get_link(const unsigned char *path, - unsigned char *target, size_t len) +Prototype: int sysfs_get_link(const char *path, char *target, size_t len) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -455,12 +454,12 @@ Description: Function returns the list of entries for the given subsystem. If sysfs_close_list() has to be called to free the list obtained from this call. -Arguments: unsigned char *name Subsystem to open, like "bus".. +Arguments: char *name Subsystem to open, like "bus".. Returns: dlist of entries for the subsystem on success NULL with error indicating the "name" subsystem is invalid. -Prototype: struct dlist *sysfs_open_subsystem_list(unsigned char *name) +Prototype: struct dlist *sysfs_open_subsystem_list(char *name) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -471,12 +470,12 @@ Description: Function returns the list of devices on the given bus. sysfs_close_list() has to be called to free the list obtained from this call. -Arguments: unsigned char *name Bus name to open "pci"/"scsi"/"usb".. +Arguments: char *name Bus name to open "pci"/"scsi"/"usb".. Returns: dlist of device names for the given bus on success NULL with error indicating the bus is not supported. -Prototype: struct dlist *sysfs_open_bus_devices_list(unsigned char *name) +Prototype: struct dlist *sysfs_open_bus_devices_list(char *name) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -485,7 +484,7 @@ Name: sysfs_close_list Description: Closes a given dlist. This can be used as a generic list close routine. -Arguments: struct dlist *list List to be closed +Arguments: struct dlist *list List to be closed Prototype: void sysfs_close_list(struct dlist *list) ------------------------------------------------------------------------------- @@ -495,12 +494,12 @@ Name: sysfs_path_is_dir Description: Utility function to verify if a given path is to a directory. -Arguments: const unsigned char *path Path to verify +Arguments: const char *path Path to verify Returns: 0 on success, 1 on error - EINVAL for invalid arguments -Prototype: int sysfs_path_is_dir(const unsigned char *path) +Prototype: int sysfs_path_is_dir(const char *path) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -508,12 +507,12 @@ Name: sysfs_path_is_file Description: Utility function to verify if a given path is to a file. -Arguments: const unsigned char *path Path to verify +Arguments: const char *path Path to verify Returns: 0 on success, 1 on error - EINVAL for invalid arguments -Prototype: int sysfs_path_is_file(const unsigned char *path) +Prototype: int sysfs_path_is_file(const char *path) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -521,12 +520,12 @@ Name: sysfs_path_is_link Description: Utility function to verify if a given path is to a link. -Arguments: const unsigned char *path Path to verify +Arguments: const char *path Path to verify Returns: 0 on success, 1 on error - EINVAL for invalid arguments -Prototype: int sysfs_path_is_link(const unsigned char *path) +Prototype: int sysfs_path_is_link(const char *path) ------------------------------------------------------------------------------- @@ -550,14 +549,13 @@ Name: sysfs_open_attribute Description: Opens up a file in sysfs and creates a sysfs_attribute structure. File isn't read with this function. -Arguments: const unsigned char *path File/Attribute's path +Arguments: const char *path File/Attribute's path Returns: struct sysfs_attribute * with success. NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: struct sysfs_attribute *sysfs_open_attribute - (const unsigned char *path) +Prototype: struct sysfs_attribute *sysfs_open_attribute(const char *path) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -626,7 +624,7 @@ Description: Reads the supplied attribute. Since the maximum transfer up to a page from the file and stores it in the "value" field in the attribute. -Arguments: struct sysfs_attribute *sysattr Attribute to read +Arguments: struct sysfs_attribute *sysattr Attribute to read Returns: 0 with success. -1 with error. Errno will be set with error, returning @@ -646,7 +644,7 @@ Description: Writes to the supplied attribute. Function validates if the restored and an error is returned. Arguments: struct sysfs_attribute *sysattr Attribute to write to - const unsigned char *new_value New value for the attribute + const char *new_value sysattr's new value size_t len Length of "new_value" Returns: 0 with success. @@ -654,7 +652,7 @@ Returns: 0 with success. - EINVAL for invalid arguments Prototype: int sysfs_write_attribute(struct sysfs_attribute *sysattr, - const unsigned char *new_value, size_t len) + const char *new_value, size_t len) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -663,17 +661,16 @@ Name: sysfs_read_attribute_value Description: Given a path to a specific attribute, function reads and returns its value to the supplied value buffer. -Arguments: const unsigned char *attrpath Attribute path to read - unsigned char *value Buffer to read in attribute's - value - size_t vsize Size of buffer +Arguments: const char *attrpath Attribute path to read + char *value Buffer to read in attribute's value + size_t vsize Size of buffer Returns: 0 with success. -1 with error. Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: int sysfs_read_attribute_value(const unsigned char *attrpath, - unsigned char *value, size_t vsize) +Prototype: int sysfs_read_attribute_value(const char *attrpath, + char *value, size_t vsize) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -683,16 +680,16 @@ Description: Function takes a single or linked list of sysfs attribute structures and returns the value of the specified attribute name. -Arguments: struct dlist *attr Attribute list to search through - const unsigned char *name Name of attribute whose value - to retrieve +Arguments: struct dlist *attr Attribute list to search through + const char *name Name of attribute whose value + to retrieve -Returns: unsigned char * attribute value with success. +Returns: char * attribute value with success. NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: unsigned char *sysfs_get_value_from_attributes - (struct sysfs_attribute *attr, const unsigned char *name) +Prototype: char *sysfs_get_value_from_attributes + (struct sysfs_attribute *attr, const char *name) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -703,14 +700,14 @@ Description: Function walks the list of attributes for the given sysfs the specified attribute name. Arguments: struct sysfs_directory *dir Directory in which to search - unsigned char *attrname Attribute name to look for + char *attrname Attribute name to look for Returns: struct sysfs_attribute on success. NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_attribute *sysfs_get_directory_attribute - (struct sysfs_directory *dir, unsigned char *attrname) + (struct sysfs_directory *dir, char *attrname) ------------------------------------------------------------------------------- @@ -728,14 +725,13 @@ Name: sysfs_open_link Description: Opens a directory link. -Arguments: const unsigned char *linkpath Path to link +Arguments: const char *linkpath Path to link Returns: struct sysfs_link * with success. NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: struct sysfs_link *sysfs_open_link - (const unsigned char *linkpath) +Prototype: struct sysfs_link *sysfs_open_link(const char *linkpath) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -743,7 +739,7 @@ Name: sysfs_close_link Description: Closes a directory link structure. -Arguments: struct sysfs_link *ln Link to close +Arguments: struct sysfs_link *ln Link to close Prototype: void sysfs_close_link(struct sysfs_link *ln) ------------------------------------------------------------------------------- @@ -788,14 +784,14 @@ Description: Function walks the list of links for the given sysfs directory name. Arguments: struct sysfs_directory *dir Directory in which to search - unsigned char *linkname Link name to look for + char *linkname Link name to look for Returns: struct sysfs_link * with success. NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_link *sysfs_get_directory_link - (struct sysfs_directory *dir, unsigned char *linkname) + (struct sysfs_directory *dir, char *linkname) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -806,14 +802,14 @@ Description: Function walks the list of links for the given sysfs directory the specified link name. Arguments: struct sysfs_directory *dir Directory in which to search - unsigned char *linkname Link name to look for + char *linkname Link name to look for Returns: struct sysfs_link * with success. NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_link *sysfs_get_subdirectory_link - (struct sysfs_directory *dir, unsigned char *linkname) + (struct sysfs_directory *dir, char *linkname) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -848,14 +844,13 @@ Name: sysfs_open_directory Description: Opens a sysfs directory at a specific path -Arguments: const unsigned char *path Directory path to open +Arguments: const char *path Directory path to open Returns: struct sysfs_directory * with success. NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: struct sysfs_directory *sysfs_open_directory - (const unsigned char *path) +Prototype: struct sysfs_directory *sysfs_open_directory(const char *path) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -922,11 +917,14 @@ Description: Function walks the directory tree for the given directory and name. Arguments: struct sysfs_directory *dir Directory in which to search - unsigned char *subname Name of directory to look for + char *subname Name of directory to look for Returns: struct sysfs_directory with success. NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments + +Prototype: struct sysfs_directory *sysfs_get_subdirectory + (struct sysfs_directory *dir, char *subname) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -979,13 +977,13 @@ Description: Function opens up one of the buses represented in sysfs in the /sys/bus directory. It returns a sysfs_bus structure that includes a list of bus devices and drivers. -Arguments: const unsigned char *name Bus name to open, like "pci"... +Arguments: const char *name Bus name to open, like "pci"... Returns: struct sysfs_bus * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: struct sysfs_bus *sysfs_open_bus(const unsigned char *name) +Prototype: struct sysfs_bus *sysfs_open_bus(const char *name) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1038,14 +1036,14 @@ Description: Function takes a sysfs_bus structure(obtained on a successful structure corresponding to the device. Arguments: struct sysfs_bus *bus Bus structure on which to search - unsigned char *id Device to look for + char *id Device to look for Returns: struct sysfs_device * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_device *sysfs_get_bus_device - (struct sysfs_bus *bus, unsigned char *id) + (struct sysfs_bus *bus, char *id) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1057,14 +1055,14 @@ Description: Function takes a sysfs_bus structure (obtained on a successful structure corresponding to the driver. Arguments: struct sysfs_bus *bus Bus structure on which to search - unsigned char *drvname Driver to look for + char *drvname Driver to look for Returns: struct sysfs_driver * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_device *sysfs_get_bus_driver - (struct sysfs_bus *bus, unsigned char *drvname) + (struct sysfs_bus *bus, char *drvname) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1090,14 +1088,14 @@ Description: Function takes a sysfs_bus structure and looks for the required structure corresponding to the given attribute. Arguments: struct sysfs_bus *bus Bus structure on which to search - unsigned char *attrname Attribute to look for + char *attrname Attribute to look for Returns: struct sysfs_attribute * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_attribute *sysfs_get_bus_attribute - (struct sysfs_bus *bus, unsigned char *attrname) + (struct sysfs_bus *bus, char *attrname) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1120,16 +1118,16 @@ Name: sysfs_find_driver_bus Description: Given the name of a driver, this function finds the name of the bus the driver is on -Arguments: const unsigned char *driver Name of the driver to look for - unsigned char *busname Buffer to return the bus name - size_t bsize Size of the "busname" buffer +Arguments: const char *driver Name of the driver to look for + char *busname Buffer to return the bus name + size_t bsize Size of the "busname" buffer Returns: 0 with success. -1 with error. Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: int sysfs_find_driver_bus(const unsigned char *driver, - unsigned char *busname, size_t bsize) +Prototype: int sysfs_find_driver_bus(const char *driver, + char *busname, size_t bsize) ------------------------------------------------------------------------------- @@ -1151,13 +1149,13 @@ Description: Function opens up one of the classes represented in sysfs in the /sys/class directory. It returns a sysfs_class structure that includes a list of class devices. -Arguments: const unsigned char *name Class name to open, like "net".. +Arguments: const char *name Class name to open, like "net".. Returns: struct sysfs_class * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: struct sysfs_class *sysfs_open_class(const unsigned char *name) +Prototype: struct sysfs_class *sysfs_open_class(const char *name) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1166,9 +1164,9 @@ Name: sysfs_close_class Description: Function closes up the sysfs_class structure including its class devices. -Arguments: sysfs_class *class Class structure to close +Arguments: sysfs_class *cls Class structure to close -Prototype: void sysfs_close_class(struct sysfs_class *class); +Prototype: void sysfs_close_class(struct sysfs_class *cls); ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1178,14 +1176,14 @@ Description: Function opens up one of the class devices represented in sysfs in sysfs/class/"class"/ directory. It returns a sysfs_class_device structure. -Arguments: const unsigned char *path Path to class device +Arguments: const char *path Path to class device Returns: struct sysfs_class_device * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_class_device *sysfs_open_class_device_path - (const unsigned char *path) + (const char *path) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1206,15 +1204,15 @@ Description: Function takes a sysfs_class structure(obtained on a successful device in this class. On success, it returns a sysfs_class_device structure corresponding to the class device. -Arguments: struct sysfs_class *class Class on which to search - unsigned_char *name Class device "name" to look for +Arguments: struct sysfs_class *cls Class on which to search + char *name Class device "name" to look for Returns: struct sysfs_class_device * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_class_device *sysfs_get_class_device - (struct sysfs_class *class, unsigned char *name) + (struct sysfs_class *cls, char *name) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1246,15 +1244,15 @@ Description: Given the name of the class on which to look for, this function 2. Class this device belongs to must be known prior to calling this function. -Arguments: const unsigned char *classname Class on which to search - unsigned char *name Class device "name" to open +Arguments: const char *classname Class on which to search + char *name Class device "name" to open Returns: struct sysfs_class_device * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_class_device *sysfs_open_class_device - (const unsigned char *classname, unsigned char *class) + (const char *classname, char *name) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1278,8 +1276,8 @@ Prototype: struct sysfs_device *sysfs_get_classdev_device ------------------------------------------------------------------------------- Name: sysfs_get_classdev_driver -Description: Function returns the sysfs_driver reference (if present) for the - given class device. +Description: Function returns the sysfs_driver reference (if present) for + the given class device. Arguments: struct sysfs_class_device *clsdev Class device whose sysfs_driver reference @@ -1335,14 +1333,14 @@ Description: Searches supplied class device's attributes by name and returns the attribute. Arguments: struct sysfs_class_device *clsdev Device to search - const unsigned char *name Attribute name to find + const char *name Attribute name to find Returns: struct sysfs_attribute * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_attribute *sysfs_get_classdev_attr - (struct sysfs_class_device *clsdev, const unsigned char *name) + (struct sysfs_class_device *clsdev, const char *name) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1373,18 +1371,17 @@ Description: Function takes as arguments, a the name of the class, the class return from this function has to be closed by making a call to sysfs_close_attribute() -Arguments: unsigned char *classname Class name on which to search - unsigned char *dev Name of the class device - unsigned char *attrib Attribute to open +Arguments: char *classname Class name on which to search + char *dev Name of the class device + char *attrib Attribute to open Returns: struct sysfs_attribute * with success. NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_attribute *sysfs_write_classdev_attr - (const unsigned char *classname, - const unsigned char *dev, - const unsigned char *attrib) + (const char *classname, const char *dev, + const char *attrib) ------------------------------------------------------------------------------- @@ -1404,14 +1401,13 @@ Description: Opens up a device at a specific path. It opens the device's directory, reads the directory, and returns a sysfs_device structure. -Arguments: const unsigned char *path Path to device +Arguments: const char *path Path to device Returns: struct sysfs_device * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: struct sysfs_device *sysfs_open_device_path - (const unsigned char *path) +Prototype: struct sysfs_device *sysfs_open_device_path(const char *path) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1431,14 +1427,13 @@ Description: Function opens up one of the root devices represented in sysfs in the /sys/devices directory. It returns a sysfs_root_device structure that includes a list of devices in the tree. -Arguments: const unsigned char *name Name of the root device to open +Arguments: const char *name Name of the root device to open Returns: struct sysfs_root_device * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: struct sysfs_device *sysfs_open_root_device - (const unsigned char *name) +Prototype: struct sysfs_device *sysfs_open_root_device(const char *name) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1457,15 +1452,13 @@ Name: sysfs_open_device_tree Description: Function opens up the device tree at the specified path. -Arguments: const unsigned char *path Path at which to open the - device tree +Arguments: const char *path Path at which to open the device tree Returns: struct sysfs_device * with success NULL with error, Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: struct sysfs_device *sysfs_open_device_tree - (const unsigned char *path) +Prototype: struct sysfs_device *sysfs_open_device_tree(const char *path) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1494,7 +1487,7 @@ Returns: struct sysfs_device * on success - EINVAL for invalid arguments Prototype: struct sysfs_device *sysfs_get_device_parent - (struct sysfs_device *dev) + (struct sysfs_device *dev) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1520,14 +1513,14 @@ Description: Searches supplied device's attributes by name and returns the attribute. Arguments: struct sysfs_device *dev Device to search - const unsigned char *name Attribute name to find + const char *name Attribute name to find Returns: struct sysfs_attribute * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_attribute *sysfs_get_device_attr - (struct sysfs_device *dev, const unsigned char *name) + (struct sysfs_device *dev, const char *name) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1536,8 +1529,8 @@ Name: sysfs_get_device_attributes Description: Function takes a sysfs_device structure and returns a list of attributes for the device. -Arguments: struct sysfs_device *device Device for which - attributes are required +Arguments: struct sysfs_device *device Device for which + attributes are required Returns: struct dlist * of attributes with success NULL with error. Errno will be set with error, returning @@ -1571,15 +1564,15 @@ Description: Given the name of the bus on which to look for, this function locates a given device and returns a sysfs_device structure corresponding to the requested device. -Arguments: const unsigned char *bus_id Device to look for - const unsigned char *bus Bus on which to search +Arguments: const char *bus Bus on which to search + const char *bus_id Device to look for Returns: struct sysfs_device * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_device *sysfs_open_device - (const unsigned char *bus_id, const unsigned char *bus) + (const char *bus, const char *bus_id) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1608,17 +1601,16 @@ Description: Function takes as arguments, the bus on which to search for a return from this function has to be closed by making a call to sysfs_close_attribute() -Arguments: unsigned char *bus Bus on which to search - unsigned char *bus_id Device to look for - unsigned char *attrib Name of the attribute to open +Arguments: char *bus Bus on which to search + char *bus_id Device to look for + char *attrib Name of the attribute to open Returns: struct sysfs_attribute * with success. NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_attribute *sysfs_open_device_attr - (const unsigned char *bus, const unsigned char *bus_id, - const unsigned char *attrib) + (const char *bus, const char *bus_id, const char *attrib) ------------------------------------------------------------------------------- @@ -1634,14 +1626,13 @@ Name: sysfs_open_driver_path Description: Opens driver at specific path. -Arguments: const unsigned char *path Path to driver +Arguments: const char *path Path to driver Returns: struct sysfs_driver * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: struct sysfs_driver *sysfs_open_driver_path - (const unsigned char *path) +Prototype: struct sysfs_driver *sysfs_open_driver_path(const char *path) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1693,14 +1684,14 @@ Description: Function returns a sysfs_device reference for the device with "name" that uses this driver Arguments: struct sysfs_driver *driver Driver on which to search - const unsigned char *name Name of the device to look for + const char *name Name of the device to look for Returns: struct sysfs_device * corresponding to "name" on success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct dlist *sysfs_get_driver_device - (struct sysfs_driver *driver, const unsigned char *name) + (struct sysfs_driver *driver, const char *name) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1710,14 +1701,14 @@ Description: Searches supplied driver's attributes by name and returns the attribute. Arguments: struct sysfs_driver *drv Driver to search - const unsigned char *name Attribute name to find + const char *name Attribute name to find Returns: struct sysfs_attribute * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_attribute *sysfs_get_driver_attr - (struct sysfs_driver *drv, const unsigned char *name) + (struct sysfs_driver *drv, const char *name) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1769,17 +1760,15 @@ Description: Given the name of the bus on which to look for, this function to calling this function. Use sysfs_find_driver_bus() to determine this. -Arguments: const unsigned char *drv_name Driver to look for - const unsigned char *bus Bus on which to search - size_t bsize Size of "bus" +Arguments: const char *bus_name Bus on which to search + const char *drv_name Driver name to look for Returns: struct sysfs_driver * with success NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments -Prototype: struct sysfs_driver *sysfs_open_driver - (const unsigned char *drv_name, - const unsigned char *bus, size_t bsize) +Prototype: struct sysfs_driver *sysfs_open_driver(const char *bus_name, + const char *drv_name) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- @@ -1807,17 +1796,16 @@ Description: Function takes as arguments, the bus the driver is registered return from this function has to be closed by making a call to sysfs_close_attribute() -Arguments: unsigned char *bus Bus on which driver is present - unsigned char *drv Driver to look for - unsigned char *attrib Name of the attribute to open +Arguments: char *bus Bus on which driver is present + char *drv Driver to look for + char *attrib Name of the attribute to open Returns: struct sysfs_attribute * with success. NULL with error. Errno will be set with error, returning - EINVAL for invalid arguments Prototype: struct sysfs_attribute *sysfs_open_driver_attr - (const unsigned char *bus, const unsigned char *drv, - const unsigned char *attrib) + (const char *bus, const char *drv, const char *attrib) ------------------------------------------------------------------------------- -- cgit v1.2.1