Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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