385
* proc_scsi_show - show contents of /proc/scsi/scsi (attached devices)
386
* @s: output goes here
389
static int proc_scsi_show(struct seq_file *s, void *p)
391
seq_printf(s, "Attached devices:\n");
392
bus_for_each_dev(&scsi_bus_type, NULL, s, proc_print_scsidevice);
384
static int always_match(struct device *dev, void *data)
389
static inline struct device *next_scsi_device(struct device *start)
391
struct device *next = bus_find_device(&scsi_bus_type, start, NULL,
397
static void *scsi_seq_start(struct seq_file *sfile, loff_t *pos)
399
struct device *dev = NULL;
402
while ((dev = next_scsi_device(dev))) {
410
static void *scsi_seq_next(struct seq_file *sfile, void *v, loff_t *pos)
414
return next_scsi_device(v);
417
static void scsi_seq_stop(struct seq_file *sfile, void *v)
422
static int scsi_seq_show(struct seq_file *sfile, void *dev)
425
seq_puts(sfile, "Attached devices:\n");
427
return proc_print_scsidevice(dev, sfile);
430
static const struct seq_operations scsi_seq_ops = {
431
.start = scsi_seq_start,
432
.next = scsi_seq_next,
433
.stop = scsi_seq_stop,
434
.show = scsi_seq_show
397
438
* proc_scsi_open - glue function
406
447
* We don't really need this for the write case but it doesn't
409
return single_open(file, proc_scsi_show, NULL);
450
return seq_open(file, &scsi_seq_ops);
412
453
static const struct file_operations proc_scsi_operations = {