xref: /OK3568_Linux_fs/kernel/Documentation/ABI/testing/sysfs-class-pktcdvd (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyunsysfs interface
2*4882a593Smuzhiyun---------------
3*4882a593SmuzhiyunThe pktcdvd module (packet writing driver) creates the following files in the
4*4882a593Smuzhiyunsysfs: (<devid> is in the format major:minor)
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunWhat:		/sys/class/pktcdvd/add
7*4882a593SmuzhiyunWhat:		/sys/class/pktcdvd/remove
8*4882a593SmuzhiyunWhat:		/sys/class/pktcdvd/device_map
9*4882a593SmuzhiyunDate:		Oct. 2006
10*4882a593SmuzhiyunKernelVersion:	2.6.20
11*4882a593SmuzhiyunContact:	Thomas Maier <balagi@justmail.de>
12*4882a593SmuzhiyunDescription:
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun		==========	==============================================
15*4882a593Smuzhiyun		add		(WO) Write a block device id (major:minor) to
16*4882a593Smuzhiyun				create a new pktcdvd device and map it to the
17*4882a593Smuzhiyun				block device.
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun		remove		(WO) Write the pktcdvd device id (major:minor)
20*4882a593Smuzhiyun				to remove the pktcdvd device.
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun		device_map	(RO) Shows the device mapping in format:
23*4882a593Smuzhiyun				pktcdvd[0-7] <pktdevid> <blkdevid>
24*4882a593Smuzhiyun		==========	==============================================
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun
27*4882a593SmuzhiyunWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/dev
28*4882a593SmuzhiyunWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/uevent
29*4882a593SmuzhiyunDate:		Oct. 2006
30*4882a593SmuzhiyunKernelVersion:	2.6.20
31*4882a593SmuzhiyunContact:	Thomas Maier <balagi@justmail.de>
32*4882a593SmuzhiyunDescription:
33*4882a593Smuzhiyun		dev:	(RO) Device id
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun		uevent:	(WO) To send a uevent
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun
38*4882a593SmuzhiyunWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_started
39*4882a593SmuzhiyunWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_finished
40*4882a593SmuzhiyunWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_written
41*4882a593SmuzhiyunWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read
42*4882a593SmuzhiyunWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read_gather
43*4882a593SmuzhiyunWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/reset
44*4882a593SmuzhiyunDate:		Oct. 2006
45*4882a593SmuzhiyunKernelVersion:	2.6.20
46*4882a593SmuzhiyunContact:	Thomas Maier <balagi@justmail.de>
47*4882a593SmuzhiyunDescription:
48*4882a593Smuzhiyun		packets_started:	(RO) Number of started packets.
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun		packets_finished:	(RO) Number of finished packets.
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun		kb_written:		(RO) kBytes written.
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun		kb_read:		(RO) kBytes read.
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun		kb_read_gather:		(RO) kBytes read to fill write packets.
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun		reset:			(WO) Write any value to it to reset
59*4882a593Smuzhiyun					pktcdvd device statistic values, like
60*4882a593Smuzhiyun					bytes read/written.
61*4882a593Smuzhiyun
62*4882a593Smuzhiyun
63*4882a593SmuzhiyunWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/write_queue/size
64*4882a593SmuzhiyunWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_off
65*4882a593SmuzhiyunWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_on
66*4882a593SmuzhiyunDate:		Oct. 2006
67*4882a593SmuzhiyunKernelVersion:	2.6.20
68*4882a593SmuzhiyunContact:	Thomas Maier <balagi@justmail.de>
69*4882a593SmuzhiyunDescription:
70*4882a593Smuzhiyun		==============	================================================
71*4882a593Smuzhiyun		size		(RO) Contains the size of the bio write queue.
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun		congestion_off	(RW) If bio write queue size is below this mark,
74*4882a593Smuzhiyun				accept new bio requests from the block layer.
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun		congestion_on	(RW) If bio write queue size is higher as this
77*4882a593Smuzhiyun				mark, do no longer accept bio write requests
78*4882a593Smuzhiyun				from the block layer and wait till the pktcdvd
79*4882a593Smuzhiyun				device has processed enough bio's so that bio
80*4882a593Smuzhiyun				write queue size is below congestion off mark.
81*4882a593Smuzhiyun				A value of <= 0 disables congestion control.
82*4882a593Smuzhiyun		==============	================================================
83*4882a593Smuzhiyun
84*4882a593Smuzhiyun
85*4882a593SmuzhiyunExample:
86*4882a593Smuzhiyun--------
87*4882a593SmuzhiyunTo use the pktcdvd sysfs interface directly, you can do::
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun    # create a new pktcdvd device mapped to /dev/hdc
90*4882a593Smuzhiyun    echo "22:0" >/sys/class/pktcdvd/add
91*4882a593Smuzhiyun    cat /sys/class/pktcdvd/device_map
92*4882a593Smuzhiyun    # assuming device pktcdvd0 was created, look at stat's
93*4882a593Smuzhiyun    cat /sys/class/pktcdvd/pktcdvd0/stat/kb_written
94*4882a593Smuzhiyun    # print the device id of the mapped block device
95*4882a593Smuzhiyun    fgrep pktcdvd0 /sys/class/pktcdvd/device_map
96*4882a593Smuzhiyun    # remove device, using pktcdvd0 device id   253:0
97*4882a593Smuzhiyun    echo "253:0" >/sys/class/pktcdvd/remove
98