Coding problem with sysfs
From: Christian Gmeiner
Date: Tue Jun 01 2004 - 17:18:45 EST
Hi Mailling list.
i have tried to wirte a sysfs patch for the dvb-driver. It seems very nice,
but i am _not_ able
to access and work with the devices.
Now i have run some tests:
1. Only register the adapter, the other functions are commented out
vdr root # ls -R /sys/class/dvb
/sys/class/dvb:
adapter0
/sys/class/dvb/adapter0:
frontend name
And i can access the infos:
vdr root # cat /sys/class/dvb/adapter0/frontend
STV0299/TSA5059/SL1935 based
vdr root # cat /sys/class/dvb/adapter0/name
KNC1 DVB-S
Looks nice....
2. Enabled full sysfs support
vdr root # ls -R /sys/class/dvb
/sys/class/dvb:
adapter0
/sys/class/dvb/adapter0:
demux0 dvr0 frontend frontend0 name net0
/sys/class/dvb/adapter0/demux0:
adap dev
/sys/class/dvb/adapter0/dvr0:
adap dev
/sys/class/dvb/adapter0/frontend0:
adap dev
/sys/class/dvb/adapter0/net0:
adap dev
vdr root # ls -Rl /dev/dvb
/dev/dvb:
total 0
drwxr-xr-x 2 root root 0 Jun 1 00:10 adapter0
/dev/dvb/adapter0:
total 0
crw-rw---- 1 root video 250, 7 Jun 1 00:10 adapter0
crw-rw---- 1 root video 250, 4 Jun 1 00:10 demux0
crw-rw---- 1 root video 250, 5 Jun 1 00:10 dvr0
crw-rw---- 1 root video 250, 3 Jun 1 00:10 frontend0
crw-rw---- 1 root video 250, 7 Jun 1 00:10 net0
Ok... /dev/dvb/adapter0/adapter0 shouldn't exist and i have an other problem
vdr root # ls /dev/dvb/adapter0/frontend0
/dev/dvb/adapter0/frontend0
vdr root # cat /dev/dvb/adapter0/frontend0
cat: /dev/dvb/adapter0/frontend0: No such device or address
If i am using devfs i get here:
vdr root # cat /dev/dvb/adapter0/frontend0
cat: /dev/dvb/adapter0/frontend0: invalid arguments
Maybe somebody can help me.
Atteched are the needed sysfs files.
Thanks,
Christian Gmeiner
Attachment:
dvbdev.h
Description: Binary data
Attachment:
dvb_sysfs.c
Description: Binary data