Back to home page

OSCL-LXR

 
 

    


0001 sysfs interface
0002 ---------------
0003 The pktcdvd module (packet writing driver) creates the following files in the
0004 sysfs: (<devid> is in the format major:minor)
0005 
0006 What:           /sys/class/pktcdvd/add
0007 What:           /sys/class/pktcdvd/remove
0008 What:           /sys/class/pktcdvd/device_map
0009 Date:           Oct. 2006
0010 KernelVersion:  2.6.20
0011 Contact:        Thomas Maier <balagi@justmail.de>
0012 Description:
0013 
0014                 ==========      ==============================================
0015                 add             (WO) Write a block device id (major:minor) to
0016                                 create a new pktcdvd device and map it to the
0017                                 block device.
0018 
0019                 remove          (WO) Write the pktcdvd device id (major:minor)
0020                                 to remove the pktcdvd device.
0021 
0022                 device_map      (RO) Shows the device mapping in format:
0023                                 pktcdvd[0-7] <pktdevid> <blkdevid>
0024                 ==========      ==============================================
0025 
0026 
0027 What:           /sys/class/pktcdvd/pktcdvd[0-7]/dev
0028 What:           /sys/class/pktcdvd/pktcdvd[0-7]/uevent
0029 Date:           Oct. 2006
0030 KernelVersion:  2.6.20
0031 Contact:        Thomas Maier <balagi@justmail.de>
0032 Description:
0033                 dev:    (RO) Device id
0034 
0035                 uevent: (WO) To send a uevent
0036 
0037 
0038 What:           /sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_started
0039 What:           /sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_finished
0040 What:           /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_written
0041 What:           /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read
0042 What:           /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read_gather
0043 What:           /sys/class/pktcdvd/pktcdvd[0-7]/stat/reset
0044 Date:           Oct. 2006
0045 KernelVersion:  2.6.20
0046 Contact:        Thomas Maier <balagi@justmail.de>
0047 Description:
0048                 packets_started:        (RO) Number of started packets.
0049 
0050                 packets_finished:       (RO) Number of finished packets.
0051 
0052                 kb_written:             (RO) kBytes written.
0053 
0054                 kb_read:                (RO) kBytes read.
0055 
0056                 kb_read_gather:         (RO) kBytes read to fill write packets.
0057 
0058                 reset:                  (WO) Write any value to it to reset
0059                                         pktcdvd device statistic values, like
0060                                         bytes read/written.
0061 
0062 
0063 What:           /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/size
0064 What:           /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_off
0065 What:           /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_on
0066 Date:           Oct. 2006
0067 KernelVersion:  2.6.20
0068 Contact:        Thomas Maier <balagi@justmail.de>
0069 Description:
0070                 ==============  ================================================
0071                 size            (RO) Contains the size of the bio write queue.
0072 
0073                 congestion_off  (RW) If bio write queue size is below this mark,
0074                                 accept new bio requests from the block layer.
0075 
0076                 congestion_on   (RW) If bio write queue size is higher as this
0077                                 mark, do no longer accept bio write requests
0078                                 from the block layer and wait till the pktcdvd
0079                                 device has processed enough bio's so that bio
0080                                 write queue size is below congestion off mark.
0081                                 A value of <= 0 disables congestion control.
0082                 ==============  ================================================
0083 
0084 
0085 Example:
0086 --------
0087 To use the pktcdvd sysfs interface directly, you can do::
0088 
0089     # create a new pktcdvd device mapped to /dev/hdc
0090     echo "22:0" >/sys/class/pktcdvd/add
0091     cat /sys/class/pktcdvd/device_map
0092     # assuming device pktcdvd0 was created, look at stat's
0093     cat /sys/class/pktcdvd/pktcdvd0/stat/kb_written
0094     # print the device id of the mapped block device
0095     fgrep pktcdvd0 /sys/class/pktcdvd/device_map
0096     # remove device, using pktcdvd0 device id   253:0
0097     echo "253:0" >/sys/class/pktcdvd/remove