18c2ecf20Sopenharmony_cisysfs interface
28c2ecf20Sopenharmony_ci---------------
38c2ecf20Sopenharmony_ciThe pktcdvd module (packet writing driver) creates the following files in the
48c2ecf20Sopenharmony_cisysfs: (<devid> is in the format major:minor)
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ciWhat:		/sys/class/pktcdvd/add
78c2ecf20Sopenharmony_ciWhat:		/sys/class/pktcdvd/remove
88c2ecf20Sopenharmony_ciWhat:		/sys/class/pktcdvd/device_map
98c2ecf20Sopenharmony_ciDate:		Oct. 2006
108c2ecf20Sopenharmony_ciKernelVersion:	2.6.20
118c2ecf20Sopenharmony_ciContact:	Thomas Maier <balagi@justmail.de>
128c2ecf20Sopenharmony_ciDescription:
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci		==========	==============================================
158c2ecf20Sopenharmony_ci		add		(WO) Write a block device id (major:minor) to
168c2ecf20Sopenharmony_ci				create a new pktcdvd device and map it to the
178c2ecf20Sopenharmony_ci				block device.
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci		remove		(WO) Write the pktcdvd device id (major:minor)
208c2ecf20Sopenharmony_ci				to remove the pktcdvd device.
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci		device_map	(RO) Shows the device mapping in format:
238c2ecf20Sopenharmony_ci				pktcdvd[0-7] <pktdevid> <blkdevid>
248c2ecf20Sopenharmony_ci		==========	==============================================
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ciWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/dev
288c2ecf20Sopenharmony_ciWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/uevent
298c2ecf20Sopenharmony_ciDate:		Oct. 2006
308c2ecf20Sopenharmony_ciKernelVersion:	2.6.20
318c2ecf20Sopenharmony_ciContact:	Thomas Maier <balagi@justmail.de>
328c2ecf20Sopenharmony_ciDescription:
338c2ecf20Sopenharmony_ci		dev:	(RO) Device id
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci		uevent:	(WO) To send a uevent
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ciWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_started
398c2ecf20Sopenharmony_ciWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_finished
408c2ecf20Sopenharmony_ciWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_written
418c2ecf20Sopenharmony_ciWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read
428c2ecf20Sopenharmony_ciWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read_gather
438c2ecf20Sopenharmony_ciWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/reset
448c2ecf20Sopenharmony_ciDate:		Oct. 2006
458c2ecf20Sopenharmony_ciKernelVersion:	2.6.20
468c2ecf20Sopenharmony_ciContact:	Thomas Maier <balagi@justmail.de>
478c2ecf20Sopenharmony_ciDescription:
488c2ecf20Sopenharmony_ci		packets_started:	(RO) Number of started packets.
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci		packets_finished:	(RO) Number of finished packets.
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci		kb_written:		(RO) kBytes written.
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci		kb_read:		(RO) kBytes read.
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci		kb_read_gather:		(RO) kBytes read to fill write packets.
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci		reset:			(WO) Write any value to it to reset
598c2ecf20Sopenharmony_ci					pktcdvd device statistic values, like
608c2ecf20Sopenharmony_ci					bytes read/written.
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ciWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/write_queue/size
648c2ecf20Sopenharmony_ciWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_off
658c2ecf20Sopenharmony_ciWhat:		/sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_on
668c2ecf20Sopenharmony_ciDate:		Oct. 2006
678c2ecf20Sopenharmony_ciKernelVersion:	2.6.20
688c2ecf20Sopenharmony_ciContact:	Thomas Maier <balagi@justmail.de>
698c2ecf20Sopenharmony_ciDescription:
708c2ecf20Sopenharmony_ci		==============	================================================
718c2ecf20Sopenharmony_ci		size		(RO) Contains the size of the bio write queue.
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci		congestion_off	(RW) If bio write queue size is below this mark,
748c2ecf20Sopenharmony_ci				accept new bio requests from the block layer.
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci		congestion_on	(RW) If bio write queue size is higher as this
778c2ecf20Sopenharmony_ci				mark, do no longer accept bio write requests
788c2ecf20Sopenharmony_ci				from the block layer and wait till the pktcdvd
798c2ecf20Sopenharmony_ci				device has processed enough bio's so that bio
808c2ecf20Sopenharmony_ci				write queue size is below congestion off mark.
818c2ecf20Sopenharmony_ci				A value of <= 0 disables congestion control.
828c2ecf20Sopenharmony_ci		==============	================================================
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ciExample:
868c2ecf20Sopenharmony_ci--------
878c2ecf20Sopenharmony_ciTo use the pktcdvd sysfs interface directly, you can do::
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci    # create a new pktcdvd device mapped to /dev/hdc
908c2ecf20Sopenharmony_ci    echo "22:0" >/sys/class/pktcdvd/add
918c2ecf20Sopenharmony_ci    cat /sys/class/pktcdvd/device_map
928c2ecf20Sopenharmony_ci    # assuming device pktcdvd0 was created, look at stat's
938c2ecf20Sopenharmony_ci    cat /sys/class/pktcdvd/pktcdvd0/stat/kb_written
948c2ecf20Sopenharmony_ci    # print the device id of the mapped block device
958c2ecf20Sopenharmony_ci    fgrep pktcdvd0 /sys/class/pktcdvd/device_map
968c2ecf20Sopenharmony_ci    # remove device, using pktcdvd0 device id   253:0
978c2ecf20Sopenharmony_ci    echo "253:0" >/sys/class/pktcdvd/remove
98