162306a36Sopenharmony_cisysfs interface 262306a36Sopenharmony_ci--------------- 362306a36Sopenharmony_ciThe pktcdvd module (packet writing driver) creates the following files in the 462306a36Sopenharmony_cisysfs: (<devid> is in the format major:minor) 562306a36Sopenharmony_ci 662306a36Sopenharmony_ciWhat: /sys/class/pktcdvd/add 762306a36Sopenharmony_ciWhat: /sys/class/pktcdvd/remove 862306a36Sopenharmony_ciWhat: /sys/class/pktcdvd/device_map 962306a36Sopenharmony_ciDate: Oct. 2006 1062306a36Sopenharmony_ciKernelVersion: 2.6.20 1162306a36Sopenharmony_ciContact: Thomas Maier <balagi@justmail.de> 1262306a36Sopenharmony_ciDescription: 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci ========== ============================================== 1562306a36Sopenharmony_ci add (WO) Write a block device id (major:minor) to 1662306a36Sopenharmony_ci create a new pktcdvd device and map it to the 1762306a36Sopenharmony_ci block device. 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_ci remove (WO) Write the pktcdvd device id (major:minor) 2062306a36Sopenharmony_ci to remove the pktcdvd device. 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci device_map (RO) Shows the device mapping in format: 2362306a36Sopenharmony_ci pktcdvd[0-7] <pktdevid> <blkdevid> 2462306a36Sopenharmony_ci ========== ============================================== 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ciWhat: /sys/class/pktcdvd/pktcdvd[0-7]/dev 2862306a36Sopenharmony_ciWhat: /sys/class/pktcdvd/pktcdvd[0-7]/uevent 2962306a36Sopenharmony_ciDate: Oct. 2006 3062306a36Sopenharmony_ciKernelVersion: 2.6.20 3162306a36Sopenharmony_ciContact: Thomas Maier <balagi@justmail.de> 3262306a36Sopenharmony_ciDescription: 3362306a36Sopenharmony_ci dev: (RO) Device id 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ci uevent: (WO) To send a uevent 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ciWhat: /sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_started 3962306a36Sopenharmony_ciWhat: /sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_finished 4062306a36Sopenharmony_ciWhat: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_written 4162306a36Sopenharmony_ciWhat: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read 4262306a36Sopenharmony_ciWhat: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read_gather 4362306a36Sopenharmony_ciWhat: /sys/class/pktcdvd/pktcdvd[0-7]/stat/reset 4462306a36Sopenharmony_ciDate: Oct. 2006 4562306a36Sopenharmony_ciKernelVersion: 2.6.20 4662306a36Sopenharmony_ciContact: Thomas Maier <balagi@justmail.de> 4762306a36Sopenharmony_ciDescription: 4862306a36Sopenharmony_ci packets_started: (RO) Number of started packets. 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ci packets_finished: (RO) Number of finished packets. 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ci kb_written: (RO) kBytes written. 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci kb_read: (RO) kBytes read. 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ci kb_read_gather: (RO) kBytes read to fill write packets. 5762306a36Sopenharmony_ci 5862306a36Sopenharmony_ci reset: (WO) Write any value to it to reset 5962306a36Sopenharmony_ci pktcdvd device statistic values, like 6062306a36Sopenharmony_ci bytes read/written. 6162306a36Sopenharmony_ci 6262306a36Sopenharmony_ci 6362306a36Sopenharmony_ciWhat: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/size 6462306a36Sopenharmony_ciWhat: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_off 6562306a36Sopenharmony_ciWhat: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_on 6662306a36Sopenharmony_ciDate: Oct. 2006 6762306a36Sopenharmony_ciKernelVersion: 2.6.20 6862306a36Sopenharmony_ciContact: Thomas Maier <balagi@justmail.de> 6962306a36Sopenharmony_ciDescription: 7062306a36Sopenharmony_ci ============== ================================================ 7162306a36Sopenharmony_ci size (RO) Contains the size of the bio write queue. 7262306a36Sopenharmony_ci 7362306a36Sopenharmony_ci congestion_off (RW) If bio write queue size is below this mark, 7462306a36Sopenharmony_ci accept new bio requests from the block layer. 7562306a36Sopenharmony_ci 7662306a36Sopenharmony_ci congestion_on (RW) If bio write queue size is higher as this 7762306a36Sopenharmony_ci mark, do no longer accept bio write requests 7862306a36Sopenharmony_ci from the block layer and wait till the pktcdvd 7962306a36Sopenharmony_ci device has processed enough bio's so that bio 8062306a36Sopenharmony_ci write queue size is below congestion off mark. 8162306a36Sopenharmony_ci A value of <= 0 disables congestion control. 8262306a36Sopenharmony_ci ============== ================================================ 8362306a36Sopenharmony_ci 8462306a36Sopenharmony_ci 8562306a36Sopenharmony_ciExample: 8662306a36Sopenharmony_ci-------- 8762306a36Sopenharmony_ciTo use the pktcdvd sysfs interface directly, you can do:: 8862306a36Sopenharmony_ci 8962306a36Sopenharmony_ci # create a new pktcdvd device mapped to /dev/hdc 9062306a36Sopenharmony_ci echo "22:0" >/sys/class/pktcdvd/add 9162306a36Sopenharmony_ci cat /sys/class/pktcdvd/device_map 9262306a36Sopenharmony_ci # assuming device pktcdvd0 was created, look at stat's 9362306a36Sopenharmony_ci cat /sys/class/pktcdvd/pktcdvd0/stat/kb_written 9462306a36Sopenharmony_ci # print the device id of the mapped block device 9562306a36Sopenharmony_ci fgrep pktcdvd0 /sys/class/pktcdvd/device_map 9662306a36Sopenharmony_ci # remove device, using pktcdvd0 device id 253:0 9762306a36Sopenharmony_ci echo "253:0" >/sys/class/pktcdvd/remove 98