Query about creating sysfs directory under device driver


 
Thread Tools Search this Thread
Operating Systems Linux Query about creating sysfs directory under device driver
# 1  
Old 02-18-2009
CPU & Memory Query about creating sysfs directory under device driver

Hi all,

Currently i am involved in developing a device driver for a custom hardware.

My linux stack already has the sysfs directory structure

/sys/class/hwmon/

My need is that, while loading my device driver i need to create a "xyz" sysfs directory inside hwmon sysfs directory as shown below

/sys/class/hwmon/xyz/

I came across a function called class_create_file call using which we can able to create a sysfs file. But, I don't know about a way to create sysfs directory. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. What is on Your Mind?

Device driver programming

I want to work one day as a device driver programmer, OS I'm in love is Solaris :D I am learning C in my free time which I don't have because college took my life and I need to study to pass. In college we work in C++ / Java. These languages aren't inteded for device driver programming , saying... (0 Replies)
Discussion started by: solaris_user
0 Replies

2. Programming

regarding device driver

Hi All, I have a device driver that uses UARTserial port to write/read to-from a device. That device driver is working fine on FC3 machine( kernel version 2.6.12)... Now I am switching to FC9 (kernel version 2.6.25.11-97).I have changed the interrupt flag SA_INTERRUPT to IRQF_DISABLED... (0 Replies)
Discussion started by: rajuprade
0 Replies

3. UNIX for Advanced & Expert Users

help regarding device driver

Hi All, I have a device driver that uses UARTserial port to write/read to-from a device. That device driver is working fine on FC3 machine( kernel version 2.6.12)... Now I am switching to FC9 (kernel version 2.6.25.11-97).I have changed the interrupt flag SA_INTERRUPT to IRQF_DISABLED... (0 Replies)
Discussion started by: rajuprade
0 Replies

4. Programming

Network device driver

HI, I am writing a network device driver for RTL8139c card on 2.6.18 kernel ... I am facing few queries listed below 1. Can i able to at all write a driver for RTL8139C or Realtek had designed new chip for 2.6 series kernel? 2. If no then which driver file 2.6.18 uses .. Is it 8139too.c or... (1 Reply)
Discussion started by: niketan
1 Replies

5. Solaris

SUNWglmr -- rasctrl environment monitoring driver for i2c or SCSI device driver ?

I've been researching minimizeing Solaris 8 and found that on the web page http://www.sun.com/bigadmin/content/packagelist/s8u7PkgList/p2.html the package SUNWglmr is listed as "rasctrl environment monitoring driver for i2c, (Root) (32-bit)" while in the document "Solaris 8 minimize-updt1.pdf"... (1 Reply)
Discussion started by: roygoodwin
1 Replies
Login or Register to Ask a Question
sysfs(2)							   System Calls 							  sysfs(2)

NAME
sysfs - get file system type information SYNOPSIS
#include <sys/fstyp.h> #include <sys/fsid.h> int sysfs(int opcode, const char *fsname); int sysfs(int opcode, int fs_index, char *buf); int sysfs(int opcode); DESCRIPTION
The sysfs() function returns information about the file system types configured in the system. The number of arguments accepted by sysfs() depends on the opcode argument, which can take the following values: GETFSIND Translate fsname, a null-terminated file-system type identifier, into a file-system type index. GETFSTYP Translate fs_index, a file-system type index, into a null-terminated file-system type identifier and write it into the buf- fer pointed to by buf, which must be at least of size FSTYPSZ as defined in <sys/fstyp.h>. GETNFSTYP Return the total number of file system types configured in the system. RETURN VALUES
Upon successful completion, the value returned depends upon the opcode argument as follows: GETFSIND the file-system type index GETFSTYP 0 GETNFSTYP the number of file system types configured Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The sysfs() function will fail if: EFAULT The buf or fsname argument points to an illegal address. EINVAL The fsname argument points to an invalid file-system identifier; the fs_index argument is 0 or invalid; or the opcode argu- ment is invalid. SunOS 5.10 5 Jul 1990 sysfs(2)