2 * linux/drivers/block/ide-proc.c Version 1.03 January 2, 1998
4 * Copyright (C) 1997-1998 Mark Lord
8 * This is the /proc/ide/ filesystem implementation.
10 * The major reason this exists is to provide sufficient access
11 * to driver and config data, such that user-mode programs can
12 * be developed to handle chipset tuning for most PCI interfaces.
13 * This should provide better utilities, and less kernel bloat.
15 * The entire pci config space for a PCI interface chipset can be
16 * retrieved by just reading it. e.g. "cat /proc/ide3/config"
18 * To modify registers *safely*, do something like:
19 * echo "P40:88" >/proc/ide/ide3/config
20 * That expression writes 0x88 to pci config register 0x40
21 * on the chip which controls ide3. Multiple tuples can be issued,
22 * and the writes will be completed as an atomic set:
23 * echo "P40:88 P41:35 P42:00 P43:00" >/proc/ide/ide3/config
25 * All numbers must be specified using pairs of ascii hex digits.
26 * It is important to note that these writes will be performed
27 * after waiting for the IDE controller (both interfaces)
28 * to be completely idle, to ensure no corruption of I/O in progress.
30 * Non-PCI registers can also be written, using "R" in place of "P"
31 * in the above examples. The size of the port transfer is determined
32 * by the number of pairs of hex digits given for the data. If a two
33 * digit value is given, the write will be a byte operation; if four
34 * digits are used, the write will be performed as a 16-bit operation;
35 * and if eight digits are specified, a 32-bit "dword" write will be
36 * performed. Odd numbers of digits are not permitted.
38 * If there is an error *anywhere* in the string of registers/data
39 * then *none* of the writes will be performed.
41 * Drive/Driver settings can be retrieved by reading the drive's
42 * "settings" files. e.g. "cat /proc/ide0/hda/settings"
43 * To write a new value "val" into a specific setting "name", use:
44 * echo "name:val" >/proc/ide/ide0/hda/settings
46 * Also useful, "cat /proc/ide0/hda/[identify, smart_values,
47 * smart_thresholds, capabilities]" will issue an IDENTIFY /
48 * PACKET_IDENTIFY / SMART_READ_VALUES / SMART_READ_THRESHOLDS /
49 * SENSE CAPABILITIES command to /dev/hda, and then dump out the
50 * returned data as 256 16-bit words. The "hdparm" utility will
51 * be updated someday soon to use this mechanism.
53 * Feel free to develop and distribute fancy GUI configuration
54 * utilities for you favorite PCI chipsets. I'll be working on
55 * one for the Promise 20246 someday soon. -ml
59 #include <linux/config.h>
60 #include <asm/uaccess.h>
61 #include <linux/errno.h>
62 #include <linux/sched.h>
63 #include <linux/proc_fs.h>
64 #include <linux/stat.h>
66 #include <linux/pci.h>
67 #include <linux/ctype.h>
68 #include <linux/ide.h>
73 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
76 #ifdef CONFIG_BLK_DEV_ALI15X3
78 int (*ali_display_info
)(char *, char **, off_t
, int, int) = NULL
;
79 #endif /* CONFIG_BLK_DEV_ALI15X3 */
81 #ifdef CONFIG_BLK_DEV_SIS5513
83 int (*sis_display_info
)(char *, char **, off_t
, int, int) = NULL
;
84 #endif /* CONFIG_BLK_DEV_SIS5513 */
86 #ifdef CONFIG_BLK_DEV_VIA82CXXX
88 int (*via_display_info
)(char *, char **, off_t
, int, int) = NULL
;
89 #endif /* CONFIG_BLK_DEV_VIA82CXXX */
91 static int ide_getxdigit(char c
)
97 digit
= tolower(c
) - 'a' + 10;
103 static int xx_xx_parse_error (const char *data
, unsigned long len
, const char *msg
)
107 if (len
>= sizeof(errbuf
))
108 len
= sizeof(errbuf
) - 1;
109 for (i
= 0; i
< len
; ++i
) {
118 printk("proc_ide: error: %s: '%s'\n", msg
, errbuf
);
122 static struct proc_dir_entry
* proc_ide_root
= NULL
;
124 static int proc_ide_write_config
125 (struct file
*file
, const char *buffer
, unsigned long count
, void *data
)
127 ide_hwif_t
*hwif
= (ide_hwif_t
*)data
;
129 unsigned long startn
= 0, n
, flags
;
130 const char *start
= NULL
, *msg
= NULL
;
132 if (!capable(CAP_SYS_ADMIN
))
135 * Skip over leading whitespace
137 while (count
&& isspace(*buffer
)) {
142 * Do one full pass to verify all parameters,
143 * then do another to actually write the regs.
145 save_flags(flags
); /* all CPUs */
149 unsigned long timeout
= jiffies
+ (3 * HZ
);
150 ide_hwgroup_t
*mygroup
= (ide_hwgroup_t
*)(hwif
->hwgroup
);
151 ide_hwgroup_t
*mategroup
= NULL
;
152 if (hwif
->mate
&& hwif
->mate
->hwgroup
)
153 mategroup
= (ide_hwgroup_t
*)(hwif
->mate
->hwgroup
);
154 cli(); /* all CPUs; ensure all writes are done together */
155 while (mygroup
->busy
|| (mategroup
&& mategroup
->busy
)) {
156 sti(); /* all CPUs */
157 if (0 < (signed long)(jiffies
- timeout
)) {
158 printk("/proc/ide/%s/config: channel(s) busy, cannot write\n", hwif
->name
);
159 restore_flags(flags
); /* all CPUs */
162 cli(); /* all CPUs */
169 unsigned int reg
= 0, val
= 0, is_pci
;
173 case 'R': is_pci
= 0;
175 case 'P': is_pci
= 1;
176 #ifdef CONFIG_BLK_DEV_IDEPCI
177 if (hwif
->pci_dev
&& !IDE_PCI_DEVID_EQ(hwif
->pci_devid
, IDE_PCI_DEVID_NULL
))
179 #endif /* CONFIG_BLK_DEV_IDEPCI */
180 msg
= "not a PCI device";
182 default: msg
= "expected 'R' or 'P'";
186 while (n
> 0 && (d
= ide_getxdigit(*p
)) >= 0) {
187 reg
= (reg
<< 4) | d
;
192 if (!digits
|| (digits
> 4) || (is_pci
&& reg
> 0xff)) {
193 msg
= "bad/missing register number";
196 if (n
-- == 0 || *p
++ != ':') {
201 while (n
> 0 && (d
= ide_getxdigit(*p
)) >= 0) {
202 val
= (val
<< 4) | d
;
207 if (digits
!= 2 && digits
!= 4 && digits
!= 8) {
208 msg
= "bad data, 2/4/8 digits required";
211 if (n
> 0 && !isspace(*p
)) {
212 msg
= "expected whitespace after data";
215 while (n
> 0 && isspace(*p
)) {
219 #ifdef CONFIG_BLK_DEV_IDEPCI
220 if (is_pci
&& (reg
& ((digits
>> 1) - 1))) {
221 msg
= "misaligned access";
224 #endif /* CONFIG_BLK_DEV_IDEPCI */
227 printk("proc_ide_write_config: type=%c, reg=0x%x, val=0x%x, digits=%d\n", is_pci
? 'PCI' : 'non-PCI', reg
, val
, digits
);
230 #ifdef CONFIG_BLK_DEV_IDEPCI
232 struct pci_dev
*dev
= hwif
->pci_dev
;
234 case 2: msg
= "byte";
235 rc
= pci_write_config_byte(dev
, reg
, val
);
237 case 4: msg
= "word";
238 rc
= pci_write_config_word(dev
, reg
, val
);
240 case 8: msg
= "dword";
241 rc
= pci_write_config_dword(dev
, reg
, val
);
245 restore_flags(flags
); /* all CPUs */
246 printk("proc_ide_write_config: error writing %s at bus %02x dev %02x reg 0x%x value 0x%x\n",
247 msg
, dev
->bus
->number
, dev
->devfn
, reg
, val
);
248 printk("proc_ide_write_config: error %d\n", rc
);
251 #endif /* CONFIG_BLK_DEV_IDEPCI */
252 } else { /* not pci */
253 #if !defined(__mc68000__) && !defined(CONFIG_APUS)
258 * unless you can explain me what it really does.
259 * On m68k, we don't have outw() and outl() yet,
260 * and I need a good reason to implement it.
262 * BTW, IMHO the main remaining portability problem with the IDE driver
263 * is that it mixes IO (ioport) and MMIO (iomem) access on different platforms.
265 * I think all accesses should be done using
267 * ide_in[bwl](ide_device_instance, offset)
268 * ide_out[bwl](ide_device_instance, value, offset)
270 * so the architecture specific code can #define ide_{in,out}[bwl] to the
271 * appropriate function.
275 case 2: outb(val
, reg
);
277 case 4: outw(val
, reg
);
279 case 8: outl(val
, reg
);
282 #endif /* !__mc68000__ && !CONFIG_APUS */
286 } while (!for_real
++);
287 restore_flags(flags
); /* all CPUs */
290 restore_flags(flags
); /* all CPUs */
291 printk("parse error\n");
292 return xx_xx_parse_error(start
, startn
, msg
);
295 static int proc_ide_read_config
296 (char *page
, char **start
, off_t off
, int count
, int *eof
, void *data
)
301 #ifdef CONFIG_BLK_DEV_IDEPCI
302 ide_hwif_t
*hwif
= (ide_hwif_t
*)data
;
303 struct pci_dev
*dev
= hwif
->pci_dev
;
304 if (!IDE_PCI_DEVID_EQ(hwif
->pci_devid
, IDE_PCI_DEVID_NULL
) && dev
&& dev
->bus
) {
307 out
+= sprintf(out
, "pci bus %02x device %02x vid %04x did %04x channel %d\n",
308 dev
->bus
->number
, dev
->devfn
, hwif
->pci_devid
.vid
, hwif
->pci_devid
.did
, hwif
->channel
);
311 int rc
= pci_read_config_byte(dev
, reg
, &val
);
313 printk("proc_ide_read_config: error %d reading bus %02x dev %02x reg 0x%02x\n",
314 rc
, dev
->bus
->number
, dev
->devfn
, reg
);
315 out
+= sprintf(out
, "??%c", (++reg
& 0xf) ? ' ' : '\n');
317 out
+= sprintf(out
, "%02x%c", val
, (++reg
& 0xf) ? ' ' : '\n');
318 } while (reg
< 0x100);
320 #endif /* CONFIG_BLK_DEV_IDEPCI */
321 out
+= sprintf(out
, "(none)\n");
323 PROC_IDE_READ_RETURN(page
,start
,off
,count
,eof
,len
);
327 static int ide_getdigit(char c
)
337 static int proc_ide_read_drivers
338 (char *page
, char **start
, off_t off
, int count
, int *eof
, void *data
)
342 ide_module_t
*p
= ide_modules
;
343 ide_driver_t
*driver
;
346 driver
= (ide_driver_t
*) p
->info
;
347 if (p
->type
== IDE_DRIVER_MODULE
&& driver
)
348 out
+= sprintf(out
, "%s version %s\n", driver
->name
, driver
->version
);
352 PROC_IDE_READ_RETURN(page
,start
,off
,count
,eof
,len
);
355 static int proc_ide_read_imodel
356 (char *page
, char **start
, off_t off
, int count
, int *eof
, void *data
)
358 ide_hwif_t
*hwif
= (ide_hwif_t
*) data
;
362 switch (hwif
->chipset
) {
363 case ide_unknown
: name
= "(none)"; break;
364 case ide_generic
: name
= "generic"; break;
365 case ide_pci
: name
= "pci"; break;
366 case ide_cmd640
: name
= "cmd640"; break;
367 case ide_dtc2278
: name
= "dtc2278"; break;
368 case ide_ali14xx
: name
= "ali14xx"; break;
369 case ide_qd6580
: name
= "qd6580"; break;
370 case ide_umc8672
: name
= "umc8672"; break;
371 case ide_ht6560b
: name
= "ht6560b"; break;
372 case ide_pdc4030
: name
= "pdc4030"; break;
373 case ide_rz1000
: name
= "rz1000"; break;
374 case ide_trm290
: name
= "trm290"; break;
375 case ide_4drives
: name
= "4drives"; break;
376 default: name
= "(unknown)"; break;
378 len
= sprintf(page
, "%s\n", name
);
379 PROC_IDE_READ_RETURN(page
,start
,off
,count
,eof
,len
);
382 static int proc_ide_read_mate
383 (char *page
, char **start
, off_t off
, int count
, int *eof
, void *data
)
385 ide_hwif_t
*hwif
= (ide_hwif_t
*) data
;
388 if (hwif
&& hwif
->mate
&& hwif
->mate
->present
)
389 len
= sprintf(page
, "%s\n", hwif
->mate
->name
);
391 len
= sprintf(page
, "(none)\n");
392 PROC_IDE_READ_RETURN(page
,start
,off
,count
,eof
,len
);
395 static int proc_ide_read_channel
396 (char *page
, char **start
, off_t off
, int count
, int *eof
, void *data
)
398 ide_hwif_t
*hwif
= (ide_hwif_t
*) data
;
401 page
[0] = hwif
->channel
? '1' : '0';
404 PROC_IDE_READ_RETURN(page
,start
,off
,count
,eof
,len
);
407 static int proc_ide_get_identify(ide_drive_t
*drive
, byte
*buf
)
409 return ide_wait_cmd(drive
, (drive
->media
== ide_disk
) ? WIN_IDENTIFY
: WIN_PIDENTIFY
, 0, 0, 1, buf
);
412 static int proc_ide_read_identify
413 (char *page
, char **start
, off_t off
, int count
, int *eof
, void *data
)
415 ide_drive_t
*drive
= (ide_drive_t
*)data
;
418 if (drive
&& !proc_ide_get_identify(drive
, page
)) {
419 unsigned short *val
= ((unsigned short *)page
) + 2;
420 char *out
= ((char *)val
) + (SECTOR_WORDS
* 4);
423 out
+= sprintf(out
, "%04x%c", le16_to_cpu(*val
), (++i
& 7) ? ' ' : '\n');
425 } while (i
< (SECTOR_WORDS
* 2));
429 len
= sprintf(page
, "\n");
430 PROC_IDE_READ_RETURN(page
,start
,off
,count
,eof
,len
);
433 static int proc_ide_read_settings
434 (char *page
, char **start
, off_t off
, int count
, int *eof
, void *data
)
436 ide_drive_t
*drive
= (ide_drive_t
*) data
;
437 ide_settings_t
*setting
= (ide_settings_t
*) drive
->settings
;
439 int len
, rc
, mul_factor
, div_factor
;
441 out
+= sprintf(out
, "name\t\t\tvalue\t\tmin\t\tmax\t\tmode\n");
442 out
+= sprintf(out
, "----\t\t\t-----\t\t---\t\t---\t\t----\n");
444 mul_factor
= setting
->mul_factor
;
445 div_factor
= setting
->div_factor
;
446 out
+= sprintf(out
, "%-24s", setting
->name
);
447 if ((rc
= ide_read_setting(drive
, setting
)) >= 0)
448 out
+= sprintf(out
, "%-16d", rc
* mul_factor
/ div_factor
);
450 out
+= sprintf(out
, "%-16s", "write-only");
451 out
+= sprintf(out
, "%-16d%-16d", (setting
->min
* mul_factor
+ div_factor
- 1) / div_factor
, setting
->max
* mul_factor
/ div_factor
);
452 if (setting
->rw
& SETTING_READ
)
453 out
+= sprintf(out
, "r");
454 if (setting
->rw
& SETTING_WRITE
)
455 out
+= sprintf(out
, "w");
456 out
+= sprintf(out
, "\n");
457 setting
= setting
->next
;
460 PROC_IDE_READ_RETURN(page
,start
,off
,count
,eof
,len
);
465 static int proc_ide_write_settings
466 (struct file
*file
, const char *buffer
, unsigned long count
, void *data
)
468 ide_drive_t
*drive
= (ide_drive_t
*) data
;
469 char name
[MAX_LEN
+ 1];
470 int for_real
= 0, len
;
472 const char *start
= NULL
;
473 ide_settings_t
*setting
;
475 if (!capable(CAP_SYS_ADMIN
))
478 * Skip over leading whitespace
480 while (count
&& isspace(*buffer
)) {
485 * Do one full pass to verify all parameters,
486 * then do another to actually write the new settings.
494 unsigned int val
= 0;
497 while (n
> 0 && *p
!= ':') {
503 len
= IDE_MIN(p
- start
, MAX_LEN
);
504 strncpy(name
, start
, IDE_MIN(len
, MAX_LEN
));
514 while (n
> 0 && (d
= ide_getdigit(*p
)) >= 0) {
515 val
= (val
* 10) + d
;
520 if (n
> 0 && !isspace(*p
))
522 while (n
> 0 && isspace(*p
)) {
526 setting
= ide_find_setting_by_name(drive
, name
);
531 ide_write_setting(drive
, setting
, val
* setting
->div_factor
/ setting
->mul_factor
);
533 } while (!for_real
++);
536 printk("proc_ide_write_settings(): parse error\n");
540 int proc_ide_read_capacity
541 (char *page
, char **start
, off_t off
, int count
, int *eof
, void *data
)
543 ide_drive_t
*drive
= (ide_drive_t
*) data
;
544 ide_driver_t
*driver
= (ide_driver_t
*) drive
->driver
;
548 len
= sprintf(page
, "(none)\n");
550 len
= sprintf(page
,"%li\n", ((ide_driver_t
*)drive
->driver
)->capacity(drive
));
551 PROC_IDE_READ_RETURN(page
,start
,off
,count
,eof
,len
);
554 int proc_ide_read_geometry
555 (char *page
, char **start
, off_t off
, int count
, int *eof
, void *data
)
557 ide_drive_t
*drive
= (ide_drive_t
*) data
;
561 out
+= sprintf(out
,"physical %d/%d/%d\n", drive
->cyl
, drive
->head
, drive
->sect
);
562 out
+= sprintf(out
,"logical %d/%d/%d\n", drive
->bios_cyl
, drive
->bios_head
, drive
->bios_sect
);
564 PROC_IDE_READ_RETURN(page
,start
,off
,count
,eof
,len
);
567 static int proc_ide_read_dmodel
568 (char *page
, char **start
, off_t off
, int count
, int *eof
, void *data
)
570 ide_drive_t
*drive
= (ide_drive_t
*) data
;
571 struct hd_driveid
*id
= drive
->id
;
574 len
= sprintf(page
, "%.40s\n", (id
&& id
->model
[0]) ? (char *)id
->model
: "(none)");
575 PROC_IDE_READ_RETURN(page
,start
,off
,count
,eof
,len
);
578 static int proc_ide_read_driver
579 (char *page
, char **start
, off_t off
, int count
, int *eof
, void *data
)
581 ide_drive_t
*drive
= (ide_drive_t
*) data
;
582 ide_driver_t
*driver
= (ide_driver_t
*) drive
->driver
;
586 len
= sprintf(page
, "(none)\n");
588 len
= sprintf(page
, "%s version %s\n", driver
->name
, driver
->version
);
589 PROC_IDE_READ_RETURN(page
,start
,off
,count
,eof
,len
);
592 static int proc_ide_write_driver
593 (struct file
*file
, const char *buffer
, unsigned long count
, void *data
)
595 ide_drive_t
*drive
= (ide_drive_t
*) data
;
597 if (!capable(CAP_SYS_ADMIN
))
599 if (ide_replace_subdriver(drive
, buffer
))
604 static int proc_ide_read_media
605 (char *page
, char **start
, off_t off
, int count
, int *eof
, void *data
)
607 ide_drive_t
*drive
= (ide_drive_t
*) data
;
611 switch (drive
->media
) {
612 case ide_disk
: media
= "disk\n";
614 case ide_cdrom
: media
= "cdrom\n";
616 case ide_tape
: media
= "tape\n";
618 case ide_floppy
:media
= "floppy\n";
620 default: media
= "UNKNOWN\n";
625 PROC_IDE_READ_RETURN(page
,start
,off
,count
,eof
,len
);
628 static ide_proc_entry_t generic_drive_entries
[] = {
629 { "driver", S_IFREG
|S_IRUGO
, proc_ide_read_driver
, proc_ide_write_driver
},
630 { "identify", S_IFREG
|S_IRUSR
, proc_ide_read_identify
, NULL
},
631 { "media", S_IFREG
|S_IRUGO
, proc_ide_read_media
, NULL
},
632 { "model", S_IFREG
|S_IRUGO
, proc_ide_read_dmodel
, NULL
},
633 { "settings", S_IFREG
|S_IRUSR
|S_IWUSR
,proc_ide_read_settings
, proc_ide_write_settings
},
634 { NULL
, 0, NULL
, NULL
}
637 void ide_add_proc_entries(struct proc_dir_entry
*dir
, ide_proc_entry_t
*p
, void *data
)
639 struct proc_dir_entry
*ent
;
643 while (p
->name
!= NULL
) {
644 ent
= create_proc_entry(p
->name
, p
->mode
, dir
);
648 ent
->read_proc
= p
->read_proc
;
649 ent
->write_proc
= p
->write_proc
;
654 void ide_remove_proc_entries(struct proc_dir_entry
*dir
, ide_proc_entry_t
*p
)
658 while (p
->name
!= NULL
) {
659 remove_proc_entry(p
->name
, dir
);
664 static int proc_ide_readlink(struct proc_dir_entry
*de
, char *page
)
666 int n
= (de
->name
[2] - 'a') / 2;
667 return sprintf(page
, "ide%d/%s", n
, de
->name
);
670 static void create_proc_ide_drives(ide_hwif_t
*hwif
)
673 struct proc_dir_entry
*ent
;
674 struct proc_dir_entry
*parent
= hwif
->proc
;
676 for (d
= 0; d
< MAX_DRIVES
; d
++) {
677 ide_drive_t
*drive
= &hwif
->drives
[d
];
678 ide_driver_t
*driver
= drive
->driver
;
685 drive
->proc
= create_proc_entry(drive
->name
, S_IFDIR
, parent
);
687 ide_add_proc_entries(drive
->proc
, generic_drive_entries
, drive
);
689 ide_add_proc_entries(drive
->proc
, generic_subdriver_entries
, drive
);
690 ide_add_proc_entries(drive
->proc
, driver
->proc
, drive
);
693 ent
= create_proc_entry(drive
->name
, S_IFLNK
| S_IRUGO
| S_IWUGO
| S_IXUGO
, proc_ide_root
);
696 ent
->readlink_proc
= proc_ide_readlink
;
701 void destroy_proc_ide_drives(ide_hwif_t
*hwif
)
705 for (d
= 0; d
< MAX_DRIVES
; d
++) {
706 ide_drive_t
*drive
= &hwif
->drives
[d
];
707 ide_driver_t
*driver
= drive
->driver
;
712 ide_remove_proc_entries(drive
->proc
, driver
->proc
);
713 ide_remove_proc_entries(drive
->proc
, generic_drive_entries
);
714 remove_proc_entry(drive
->name
, proc_ide_root
);
715 remove_proc_entry(drive
->name
, hwif
->proc
);
720 static ide_proc_entry_t hwif_entries
[] = {
721 { "channel", S_IFREG
|S_IRUGO
, proc_ide_read_channel
, NULL
},
722 { "config", S_IFREG
|S_IRUGO
|S_IWUSR
,proc_ide_read_config
, proc_ide_write_config
},
723 { "mate", S_IFREG
|S_IRUGO
, proc_ide_read_mate
, NULL
},
724 { "model", S_IFREG
|S_IRUGO
, proc_ide_read_imodel
, NULL
},
725 { NULL
, 0, NULL
, NULL
}
728 void create_proc_ide_interfaces(void)
732 for (h
= 0; h
< MAX_HWIFS
; h
++) {
733 ide_hwif_t
*hwif
= &ide_hwifs
[h
];
734 int exist
= (hwif
->proc
!= NULL
);
739 hwif
->proc
= create_proc_entry(hwif
->name
, S_IFDIR
, proc_ide_root
);
743 ide_add_proc_entries(hwif
->proc
, hwif_entries
, hwif
);
744 create_proc_ide_drives(hwif
);
748 static void destroy_proc_ide_interfaces(void)
752 for (h
= 0; h
< MAX_HWIFS
; h
++) {
753 ide_hwif_t
*hwif
= &ide_hwifs
[h
];
754 int exist
= (hwif
->proc
!= NULL
);
761 destroy_proc_ide_drives(hwif
);
762 ide_remove_proc_entries(hwif
->proc
, hwif_entries
);
763 remove_proc_entry(hwif
->name
, proc_ide_root
);
770 void proc_ide_create(void)
772 proc_ide_root
= create_proc_entry("ide", S_IFDIR
, 0);
773 if (!proc_ide_root
) return;
775 create_proc_ide_interfaces();
777 create_proc_read_entry("drivers",0,proc_ide_root
,
778 proc_ide_read_drivers
, NULL
);
780 #ifdef CONFIG_BLK_DEV_ALI15X3
781 if ((ali_display_info
) && (ali_proc
))
782 create_proc_info_entry("ali", 0, proc_ide_root
, ali_display_info
);
783 #endif /* CONFIG_BLK_DEV_ALI15X3 */
784 #ifdef CONFIG_BLK_DEV_SIS5513
785 if ((sis_display_info
) && (sis_proc
))
786 create_proc_info_entry("sis", 0, proc_ide_root
, sis_display_info
);
787 #endif /* CONFIG_BLK_DEV_SIS5513 */
788 #ifdef CONFIG_BLK_DEV_VIA82CXXX
789 if ((via_display_info
) && (via_proc
))
790 create_proc_info_entry("via", 0, proc_ide_root
, via_display_info
);
791 #endif /* CONFIG_BLK_DEV_VIA82CXXX */
794 void proc_ide_destroy(void)
797 * Mmmm.. does this free up all resources,
798 * or do we need to do a more proper cleanup here ??
800 #ifdef CONFIG_BLK_DEV_ALI15X3
801 if ((ali_display_info
) && (ali_proc
))
802 remove_proc_entry("ide/ali",0);
803 #endif /* CONFIG_BLK_DEV_ALI15X3 */
804 #ifdef CONFIG_BLK_DEV_SIS5513
805 if ((sis_display_info
) && (sis_proc
))
806 remove_proc_entry("ide/sis", 0);
807 #endif /* CONFIG_BLK_DEV_SIS5513 */
808 #ifdef CONFIG_BLK_DEV_VIA82CXXX
809 if ((via_display_info
) && (via_proc
))
810 remove_proc_entry("ide/via",0);
811 #endif /* CONFIG_BLK_DEV_VIA82CXXX */
812 remove_proc_entry("ide/drivers", 0);
813 destroy_proc_ide_interfaces();
814 remove_proc_entry("ide", 0);