Skip to contentSkip to conversation

2.6.18-mm3 pktcdvd: new pkt_print_info() function

PATCH In review Thomas Maier 1 participant 1 message Oct 3, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 6/11 2.6.18-mm3 pktcdvd: new pkt_print_info() function

Hello,

this patch adds a sysfs interface to the pktcdvd driver. See the Documentation/* files in the patch for further infos.

http://people.freenet.de/BalaGi/download/pktcdvd-6-sysfs_2.6.18.patch

-Thomas Maier

Documentation/ABI/testing/debugfs-pktcdvd +20 -0
diff -urpN 5-print-info/Documentation/ABI/testing/debugfs-pktcdvd 6-sysfs/Documentation/ABI/testing/debugfs-pktcdvd
@@ -0,0 +1,20 @@
+What:           /debug/pktcdvd[0-7]
+Date:           Sep. 2006
+KernelVersion:  2.6.19
+Contact:        Thomas Maier <[email protected]>
+Description:
+
+debugfs interface
+-----------------
+
+The pktcdvd module (packet writing driver) creates
+these files in debugfs:
+
+/debug/pktcdvd[0-7]/
+    info            (0444) Lots of human readable driver
+                           statistics and infos. Multiple lines!
+
+Example:
+-------
+
+cat /debug/pktcdvd3/info
Documentation/ABI/testing/sysfs-class-pktcdvd +57 -0

57 lines not on this page · raw message

Documentation/cdrom/packet-writing.txt +39 -2

58 lines not on this page · raw message

drivers/block/pktcdvd.c +376 -6

459 lines not on this page · raw message

include/linux/pktcdvd.h +18 -0
diff -urpN 5-print-info/include/linux/pktcdvd.h 6-sysfs/include/linux/pktcdvd.h
@@ -111,6 +111,8 @@ struct pkt_ctrl_command {
 #include <linux/blkdev.h>
 #include <linux/completion.h>
 #include <linux/cdrom.h>
+#include <linux/kobject.h>
+#include <linux/sysfs.h>
 
 struct packet_settings
 {
@@ -241,6 +243,15 @@ struct packet_stacked_data
 };
 #define PSD_POOL_SIZE		64
 
+
+struct pktcdvd_kobj
+{
+	struct kobject		kobj;
+	struct pktcdvd_device	*pd;
+};
+#define to_pktcdvdkobj(_k) \
+  ((struct pktcdvd_kobj*)container_of(_k,struct pktcdvd_kobj,kobj))
+
 struct pktcdvd_device
 {
 	struct block_device	*bdev;		/* dev attached */
@@ -271,6 +282,13 @@ struct pktcdvd_device
 
 	struct packet_iosched   iosched;
 	struct gendisk		*disk;
+	
+	struct class_device	*clsdev;	/* sysfs pktcdvd[0-7] class dev */ 
+	struct pktcdvd_kobj	*kobj_stat;	/* sysfs pktcdvd[0-7]/stat/     */
+	struct pktcdvd_kobj	*kobj_wqueue;	/* sysfs pktcdvd[0-7]/write_queue/ */
+	
+	struct dentry		*dfs_d_root;	/* debugfs: devname directory */
+	struct dentry		*dfs_f_info;	/* debugfs: info file */
 };
 
 #endif /* __KERNEL__ */