trm290: add IDE_HFLAG_TRM290 host flag
[safe/jmp/linux-2.6] / drivers / ide / ide-proc.c
1 /*
2  *  Copyright (C) 1997-1998     Mark Lord
3  *  Copyright (C) 2003          Red Hat
4  *
5  *  Some code was moved here from ide.c, see it for original copyrights.
6  */
7
8 /*
9  * This is the /proc/ide/ filesystem implementation.
10  *
11  * Drive/Driver settings can be retrieved by reading the drive's
12  * "settings" files.  e.g.    "cat /proc/ide0/hda/settings"
13  * To write a new value "val" into a specific setting "name", use:
14  *   echo "name:val" >/proc/ide/ide0/hda/settings
15  */
16
17 #include <linux/module.h>
18
19 #include <asm/uaccess.h>
20 #include <linux/errno.h>
21 #include <linux/proc_fs.h>
22 #include <linux/stat.h>
23 #include <linux/mm.h>
24 #include <linux/pci.h>
25 #include <linux/ctype.h>
26 #include <linux/ide.h>
27 #include <linux/seq_file.h>
28
29 #include <asm/io.h>
30
31 static struct proc_dir_entry *proc_ide_root;
32
33 static int proc_ide_read_imodel
34         (char *page, char **start, off_t off, int count, int *eof, void *data)
35 {
36         ide_hwif_t      *hwif = (ide_hwif_t *) data;
37         int             len;
38         const char      *name;
39
40         switch (hwif->chipset) {
41         case ide_generic:       name = "generic";       break;
42         case ide_pci:           name = "pci";           break;
43         case ide_cmd640:        name = "cmd640";        break;
44         case ide_dtc2278:       name = "dtc2278";       break;
45         case ide_ali14xx:       name = "ali14xx";       break;
46         case ide_qd65xx:        name = "qd65xx";        break;
47         case ide_umc8672:       name = "umc8672";       break;
48         case ide_ht6560b:       name = "ht6560b";       break;
49         case ide_cy82c693:      name = "cy82c693";      break;
50         case ide_4drives:       name = "4drives";       break;
51         case ide_pmac:          name = "mac-io";        break;
52         case ide_au1xxx:        name = "au1xxx";        break;
53         case ide_palm3710:      name = "palm3710";      break;
54         case ide_acorn:         name = "acorn";         break;
55         default:                name = "(unknown)";     break;
56         }
57         len = sprintf(page, "%s\n", name);
58         PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
59 }
60
61 static int proc_ide_read_mate
62         (char *page, char **start, off_t off, int count, int *eof, void *data)
63 {
64         ide_hwif_t      *hwif = (ide_hwif_t *) data;
65         int             len;
66
67         if (hwif && hwif->mate)
68                 len = sprintf(page, "%s\n", hwif->mate->name);
69         else
70                 len = sprintf(page, "(none)\n");
71         PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
72 }
73
74 static int proc_ide_read_channel
75         (char *page, char **start, off_t off, int count, int *eof, void *data)
76 {
77         ide_hwif_t      *hwif = (ide_hwif_t *) data;
78         int             len;
79
80         page[0] = hwif->channel ? '1' : '0';
81         page[1] = '\n';
82         len = 2;
83         PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
84 }
85
86 static int proc_ide_read_identify
87         (char *page, char **start, off_t off, int count, int *eof, void *data)
88 {
89         ide_drive_t     *drive = (ide_drive_t *)data;
90         int             len = 0, i = 0;
91         int             err = 0;
92
93         len = sprintf(page, "\n");
94
95         if (drive) {
96                 __le16 *val = (__le16 *)page;
97
98                 err = taskfile_lib_get_identify(drive, page);
99                 if (!err) {
100                         char *out = (char *)page + SECTOR_SIZE;
101
102                         page = out;
103                         do {
104                                 out += sprintf(out, "%04x%c",
105                                         le16_to_cpup(val), (++i & 7) ? ' ' : '\n');
106                                 val += 1;
107                         } while (i < SECTOR_SIZE / 2);
108                         len = out - page;
109                 }
110         }
111         PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
112 }
113
114 /**
115  *      ide_find_setting        -       find a specific setting
116  *      @st: setting table pointer
117  *      @name: setting name
118  *
119  *      Scan's the setting table for a matching entry and returns
120  *      this or NULL if no entry is found. The caller must hold the
121  *      setting semaphore
122  */
123
124 static
125 const struct ide_proc_devset *ide_find_setting(const struct ide_proc_devset *st,
126                                                char *name)
127 {
128         while (st->name) {
129                 if (strcmp(st->name, name) == 0)
130                         break;
131                 st++;
132         }
133         return st->name ? st : NULL;
134 }
135
136 /**
137  *      ide_read_setting        -       read an IDE setting
138  *      @drive: drive to read from
139  *      @setting: drive setting
140  *
141  *      Read a drive setting and return the value. The caller
142  *      must hold the ide_setting_mtx when making this call.
143  *
144  *      BUGS: the data return and error are the same return value
145  *      so an error -EINVAL and true return of the same value cannot
146  *      be told apart
147  */
148
149 static int ide_read_setting(ide_drive_t *drive,
150                             const struct ide_proc_devset *setting)
151 {
152         const struct ide_devset *ds = setting->setting;
153         int val = -EINVAL;
154
155         if (ds->get)
156                 val = ds->get(drive);
157
158         return val;
159 }
160
161 /**
162  *      ide_write_setting       -       read an IDE setting
163  *      @drive: drive to read from
164  *      @setting: drive setting
165  *      @val: value
166  *
167  *      Write a drive setting if it is possible. The caller
168  *      must hold the ide_setting_mtx when making this call.
169  *
170  *      BUGS: the data return and error are the same return value
171  *      so an error -EINVAL and true return of the same value cannot
172  *      be told apart
173  *
174  *      FIXME:  This should be changed to enqueue a special request
175  *      to the driver to change settings, and then wait on a sema for completion.
176  *      The current scheme of polling is kludgy, though safe enough.
177  */
178
179 static int ide_write_setting(ide_drive_t *drive,
180                              const struct ide_proc_devset *setting, int val)
181 {
182         const struct ide_devset *ds = setting->setting;
183
184         if (!capable(CAP_SYS_ADMIN))
185                 return -EACCES;
186         if (!ds->set)
187                 return -EPERM;
188         if ((ds->flags & DS_SYNC)
189             && (val < setting->min || val > setting->max))
190                 return -EINVAL;
191         return ide_devset_execute(drive, ds, val);
192 }
193
194 ide_devset_get(xfer_rate, current_speed);
195
196 static int set_xfer_rate (ide_drive_t *drive, int arg)
197 {
198         ide_task_t task;
199         int err;
200
201         if (arg < XFER_PIO_0 || arg > XFER_UDMA_6)
202                 return -EINVAL;
203
204         memset(&task, 0, sizeof(task));
205         task.tf.command = ATA_CMD_SET_FEATURES;
206         task.tf.feature = SETFEATURES_XFER;
207         task.tf.nsect   = (u8)arg;
208         task.tf_flags = IDE_TFLAG_OUT_FEATURE | IDE_TFLAG_OUT_NSECT |
209                         IDE_TFLAG_IN_NSECT;
210
211         err = ide_no_data_taskfile(drive, &task);
212
213         if (!err) {
214                 ide_set_xfer_rate(drive, (u8) arg);
215                 ide_driveid_update(drive);
216         }
217         return err;
218 }
219
220 ide_devset_rw(current_speed, xfer_rate);
221 ide_devset_rw_field(init_speed, init_speed);
222 ide_devset_rw_flag(nice1, IDE_DFLAG_NICE1);
223 ide_devset_rw_field(number, dn);
224
225 static const struct ide_proc_devset ide_generic_settings[] = {
226         IDE_PROC_DEVSET(current_speed, 0, 70),
227         IDE_PROC_DEVSET(init_speed, 0, 70),
228         IDE_PROC_DEVSET(io_32bit,  0, 1 + (SUPPORT_VLB_SYNC << 1)),
229         IDE_PROC_DEVSET(keepsettings, 0, 1),
230         IDE_PROC_DEVSET(nice1, 0, 1),
231         IDE_PROC_DEVSET(number, 0, 3),
232         IDE_PROC_DEVSET(pio_mode, 0, 255),
233         IDE_PROC_DEVSET(unmaskirq, 0, 1),
234         IDE_PROC_DEVSET(using_dma, 0, 1),
235         { 0 },
236 };
237
238 static void proc_ide_settings_warn(void)
239 {
240         static int warned;
241
242         if (warned)
243                 return;
244
245         printk(KERN_WARNING "Warning: /proc/ide/hd?/settings interface is "
246                             "obsolete, and will be removed soon!\n");
247         warned = 1;
248 }
249
250 static int proc_ide_read_settings
251         (char *page, char **start, off_t off, int count, int *eof, void *data)
252 {
253         const struct ide_proc_devset *setting, *g, *d;
254         const struct ide_devset *ds;
255         ide_drive_t     *drive = (ide_drive_t *) data;
256         char            *out = page;
257         int             len, rc, mul_factor, div_factor;
258
259         proc_ide_settings_warn();
260
261         mutex_lock(&ide_setting_mtx);
262         g = ide_generic_settings;
263         d = drive->settings;
264         out += sprintf(out, "name\t\t\tvalue\t\tmin\t\tmax\t\tmode\n");
265         out += sprintf(out, "----\t\t\t-----\t\t---\t\t---\t\t----\n");
266         while (g->name || (d && d->name)) {
267                 /* read settings in the alphabetical order */
268                 if (g->name && d && d->name) {
269                         if (strcmp(d->name, g->name) < 0)
270                                 setting = d++;
271                         else
272                                 setting = g++;
273                 } else if (d && d->name) {
274                         setting = d++;
275                 } else
276                         setting = g++;
277                 mul_factor = setting->mulf ? setting->mulf(drive) : 1;
278                 div_factor = setting->divf ? setting->divf(drive) : 1;
279                 out += sprintf(out, "%-24s", setting->name);
280                 rc = ide_read_setting(drive, setting);
281                 if (rc >= 0)
282                         out += sprintf(out, "%-16d", rc * mul_factor / div_factor);
283                 else
284                         out += sprintf(out, "%-16s", "write-only");
285                 out += sprintf(out, "%-16d%-16d", (setting->min * mul_factor + div_factor - 1) / div_factor, setting->max * mul_factor / div_factor);
286                 ds = setting->setting;
287                 if (ds->get)
288                         out += sprintf(out, "r");
289                 if (ds->set)
290                         out += sprintf(out, "w");
291                 out += sprintf(out, "\n");
292         }
293         len = out - page;
294         mutex_unlock(&ide_setting_mtx);
295         PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
296 }
297
298 #define MAX_LEN 30
299
300 static int proc_ide_write_settings(struct file *file, const char __user *buffer,
301                                    unsigned long count, void *data)
302 {
303         ide_drive_t     *drive = (ide_drive_t *) data;
304         char            name[MAX_LEN + 1];
305         int             for_real = 0, mul_factor, div_factor;
306         unsigned long   n;
307
308         const struct ide_proc_devset *setting;
309         char *buf, *s;
310
311         if (!capable(CAP_SYS_ADMIN))
312                 return -EACCES;
313
314         proc_ide_settings_warn();
315
316         if (count >= PAGE_SIZE)
317                 return -EINVAL;
318
319         s = buf = (char *)__get_free_page(GFP_USER);
320         if (!buf)
321                 return -ENOMEM;
322
323         if (copy_from_user(buf, buffer, count)) {
324                 free_page((unsigned long)buf);
325                 return -EFAULT;
326         }
327
328         buf[count] = '\0';
329
330         /*
331          * Skip over leading whitespace
332          */
333         while (count && isspace(*s)) {
334                 --count;
335                 ++s;
336         }
337         /*
338          * Do one full pass to verify all parameters,
339          * then do another to actually write the new settings.
340          */
341         do {
342                 char *p = s;
343                 n = count;
344                 while (n > 0) {
345                         unsigned val;
346                         char *q = p;
347
348                         while (n > 0 && *p != ':') {
349                                 --n;
350                                 p++;
351                         }
352                         if (*p != ':')
353                                 goto parse_error;
354                         if (p - q > MAX_LEN)
355                                 goto parse_error;
356                         memcpy(name, q, p - q);
357                         name[p - q] = 0;
358
359                         if (n > 0) {
360                                 --n;
361                                 p++;
362                         } else
363                                 goto parse_error;
364
365                         val = simple_strtoul(p, &q, 10);
366                         n -= q - p;
367                         p = q;
368                         if (n > 0 && !isspace(*p))
369                                 goto parse_error;
370                         while (n > 0 && isspace(*p)) {
371                                 --n;
372                                 ++p;
373                         }
374
375                         mutex_lock(&ide_setting_mtx);
376                         /* generic settings first, then driver specific ones */
377                         setting = ide_find_setting(ide_generic_settings, name);
378                         if (!setting) {
379                                 if (drive->settings)
380                                         setting = ide_find_setting(drive->settings, name);
381                                 if (!setting) {
382                                         mutex_unlock(&ide_setting_mtx);
383                                         goto parse_error;
384                                 }
385                         }
386                         if (for_real) {
387                                 mul_factor = setting->mulf ? setting->mulf(drive) : 1;
388                                 div_factor = setting->divf ? setting->divf(drive) : 1;
389                                 ide_write_setting(drive, setting, val * div_factor / mul_factor);
390                         }
391                         mutex_unlock(&ide_setting_mtx);
392                 }
393         } while (!for_real++);
394         free_page((unsigned long)buf);
395         return count;
396 parse_error:
397         free_page((unsigned long)buf);
398         printk("proc_ide_write_settings(): parse error\n");
399         return -EINVAL;
400 }
401
402 int proc_ide_read_capacity
403         (char *page, char **start, off_t off, int count, int *eof, void *data)
404 {
405         int len = sprintf(page, "%llu\n", (long long)0x7fffffff);
406         PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
407 }
408
409 EXPORT_SYMBOL_GPL(proc_ide_read_capacity);
410
411 int proc_ide_read_geometry
412         (char *page, char **start, off_t off, int count, int *eof, void *data)
413 {
414         ide_drive_t     *drive = (ide_drive_t *) data;
415         char            *out = page;
416         int             len;
417
418         out += sprintf(out, "physical     %d/%d/%d\n",
419                         drive->cyl, drive->head, drive->sect);
420         out += sprintf(out, "logical      %d/%d/%d\n",
421                         drive->bios_cyl, drive->bios_head, drive->bios_sect);
422
423         len = out - page;
424         PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
425 }
426
427 EXPORT_SYMBOL(proc_ide_read_geometry);
428
429 static int proc_ide_read_dmodel
430         (char *page, char **start, off_t off, int count, int *eof, void *data)
431 {
432         ide_drive_t     *drive = (ide_drive_t *) data;
433         char            *m = (char *)&drive->id[ATA_ID_PROD];
434         int             len;
435
436         len = sprintf(page, "%.40s\n", m[0] ? m : "(none)");
437         PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
438 }
439
440 static int proc_ide_read_driver
441         (char *page, char **start, off_t off, int count, int *eof, void *data)
442 {
443         ide_drive_t     *drive = (ide_drive_t *) data;
444         struct device   *dev = &drive->gendev;
445         ide_driver_t    *ide_drv;
446         int             len;
447
448         if (dev->driver) {
449                 ide_drv = container_of(dev->driver, ide_driver_t, gen_driver);
450                 len = sprintf(page, "%s version %s\n",
451                                 dev->driver->name, ide_drv->version);
452         } else
453                 len = sprintf(page, "ide-default version 0.9.newide\n");
454         PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
455 }
456
457 static int ide_replace_subdriver(ide_drive_t *drive, const char *driver)
458 {
459         struct device *dev = &drive->gendev;
460         int ret = 1;
461         int err;
462
463         device_release_driver(dev);
464         /* FIXME: device can still be in use by previous driver */
465         strlcpy(drive->driver_req, driver, sizeof(drive->driver_req));
466         err = device_attach(dev);
467         if (err < 0)
468                 printk(KERN_WARNING "IDE: %s: device_attach error: %d\n",
469                         __func__, err);
470         drive->driver_req[0] = 0;
471         if (dev->driver == NULL) {
472                 err = device_attach(dev);
473                 if (err < 0)
474                         printk(KERN_WARNING
475                                 "IDE: %s: device_attach(2) error: %d\n",
476                                 __func__, err);
477         }
478         if (dev->driver && !strcmp(dev->driver->name, driver))
479                 ret = 0;
480
481         return ret;
482 }
483
484 static int proc_ide_write_driver
485         (struct file *file, const char __user *buffer, unsigned long count, void *data)
486 {
487         ide_drive_t     *drive = (ide_drive_t *) data;
488         char name[32];
489
490         if (!capable(CAP_SYS_ADMIN))
491                 return -EACCES;
492         if (count > 31)
493                 count = 31;
494         if (copy_from_user(name, buffer, count))
495                 return -EFAULT;
496         name[count] = '\0';
497         if (ide_replace_subdriver(drive, name))
498                 return -EINVAL;
499         return count;
500 }
501
502 static int proc_ide_read_media
503         (char *page, char **start, off_t off, int count, int *eof, void *data)
504 {
505         ide_drive_t     *drive = (ide_drive_t *) data;
506         const char      *media;
507         int             len;
508
509         switch (drive->media) {
510         case ide_disk:          media = "disk\n";       break;
511         case ide_cdrom:         media = "cdrom\n";      break;
512         case ide_tape:          media = "tape\n";       break;
513         case ide_floppy:        media = "floppy\n";     break;
514         case ide_optical:       media = "optical\n";    break;
515         default:                media = "UNKNOWN\n";    break;
516         }
517         strcpy(page, media);
518         len = strlen(media);
519         PROC_IDE_READ_RETURN(page, start, off, count, eof, len);
520 }
521
522 static ide_proc_entry_t generic_drive_entries[] = {
523         { "driver",     S_IFREG|S_IRUGO,         proc_ide_read_driver,
524                                                  proc_ide_write_driver },
525         { "identify",   S_IFREG|S_IRUSR,         proc_ide_read_identify, NULL },
526         { "media",      S_IFREG|S_IRUGO,         proc_ide_read_media,    NULL },
527         { "model",      S_IFREG|S_IRUGO,         proc_ide_read_dmodel,   NULL },
528         { "settings",   S_IFREG|S_IRUSR|S_IWUSR, proc_ide_read_settings,
529                                                  proc_ide_write_settings },
530         { NULL, 0, NULL, NULL }
531 };
532
533 static void ide_add_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p, void *data)
534 {
535         struct proc_dir_entry *ent;
536
537         if (!dir || !p)
538                 return;
539         while (p->name != NULL) {
540                 ent = create_proc_entry(p->name, p->mode, dir);
541                 if (!ent) return;
542                 ent->data = data;
543                 ent->read_proc = p->read_proc;
544                 ent->write_proc = p->write_proc;
545                 p++;
546         }
547 }
548
549 static void ide_remove_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p)
550 {
551         if (!dir || !p)
552                 return;
553         while (p->name != NULL) {
554                 remove_proc_entry(p->name, dir);
555                 p++;
556         }
557 }
558
559 void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver)
560 {
561         mutex_lock(&ide_setting_mtx);
562         drive->settings = driver->proc_devsets(drive);
563         mutex_unlock(&ide_setting_mtx);
564
565         ide_add_proc_entries(drive->proc, driver->proc_entries(drive), drive);
566 }
567
568 EXPORT_SYMBOL(ide_proc_register_driver);
569
570 /**
571  *      ide_proc_unregister_driver      -       remove driver specific data
572  *      @drive: drive
573  *      @driver: driver
574  *
575  *      Clean up the driver specific /proc files and IDE settings
576  *      for a given drive.
577  *
578  *      Takes ide_setting_mtx.
579  */
580
581 void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver)
582 {
583         ide_remove_proc_entries(drive->proc, driver->proc_entries(drive));
584
585         mutex_lock(&ide_setting_mtx);
586         /*
587          * ide_setting_mtx protects both the settings list and the use
588          * of settings (we cannot take a setting out that is being used).
589          */
590         drive->settings = NULL;
591         mutex_unlock(&ide_setting_mtx);
592 }
593 EXPORT_SYMBOL(ide_proc_unregister_driver);
594
595 void ide_proc_port_register_devices(ide_hwif_t *hwif)
596 {
597         int     d;
598         struct proc_dir_entry *ent;
599         struct proc_dir_entry *parent = hwif->proc;
600         char name[64];
601
602         for (d = 0; d < MAX_DRIVES; d++) {
603                 ide_drive_t *drive = &hwif->drives[d];
604
605                 if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0 || drive->proc)
606                         continue;
607
608                 drive->proc = proc_mkdir(drive->name, parent);
609                 if (drive->proc)
610                         ide_add_proc_entries(drive->proc, generic_drive_entries, drive);
611                 sprintf(name, "ide%d/%s", (drive->name[2]-'a')/2, drive->name);
612                 ent = proc_symlink(drive->name, proc_ide_root, name);
613                 if (!ent) return;
614         }
615 }
616
617 void ide_proc_unregister_device(ide_drive_t *drive)
618 {
619         if (drive->proc) {
620                 ide_remove_proc_entries(drive->proc, generic_drive_entries);
621                 remove_proc_entry(drive->name, proc_ide_root);
622                 remove_proc_entry(drive->name, drive->hwif->proc);
623                 drive->proc = NULL;
624         }
625 }
626
627 static ide_proc_entry_t hwif_entries[] = {
628         { "channel",    S_IFREG|S_IRUGO,        proc_ide_read_channel,  NULL },
629         { "mate",       S_IFREG|S_IRUGO,        proc_ide_read_mate,     NULL },
630         { "model",      S_IFREG|S_IRUGO,        proc_ide_read_imodel,   NULL },
631         { NULL, 0, NULL, NULL }
632 };
633
634 void ide_proc_register_port(ide_hwif_t *hwif)
635 {
636         if (!hwif->proc) {
637                 hwif->proc = proc_mkdir(hwif->name, proc_ide_root);
638
639                 if (!hwif->proc)
640                         return;
641
642                 ide_add_proc_entries(hwif->proc, hwif_entries, hwif);
643         }
644 }
645
646 void ide_proc_unregister_port(ide_hwif_t *hwif)
647 {
648         if (hwif->proc) {
649                 ide_remove_proc_entries(hwif->proc, hwif_entries);
650                 remove_proc_entry(hwif->name, proc_ide_root);
651                 hwif->proc = NULL;
652         }
653 }
654
655 static int proc_print_driver(struct device_driver *drv, void *data)
656 {
657         ide_driver_t *ide_drv = container_of(drv, ide_driver_t, gen_driver);
658         struct seq_file *s = data;
659
660         seq_printf(s, "%s version %s\n", drv->name, ide_drv->version);
661
662         return 0;
663 }
664
665 static int ide_drivers_show(struct seq_file *s, void *p)
666 {
667         int err;
668
669         err = bus_for_each_drv(&ide_bus_type, NULL, s, proc_print_driver);
670         if (err < 0)
671                 printk(KERN_WARNING "IDE: %s: bus_for_each_drv error: %d\n",
672                         __func__, err);
673         return 0;
674 }
675
676 static int ide_drivers_open(struct inode *inode, struct file *file)
677 {
678         return single_open(file, &ide_drivers_show, NULL);
679 }
680
681 static const struct file_operations ide_drivers_operations = {
682         .owner          = THIS_MODULE,
683         .open           = ide_drivers_open,
684         .read           = seq_read,
685         .llseek         = seq_lseek,
686         .release        = single_release,
687 };
688
689 void proc_ide_create(void)
690 {
691         proc_ide_root = proc_mkdir("ide", NULL);
692
693         if (!proc_ide_root)
694                 return;
695
696         proc_create("drivers", 0, proc_ide_root, &ide_drivers_operations);
697 }
698
699 void proc_ide_destroy(void)
700 {
701         remove_proc_entry("drivers", proc_ide_root);
702         remove_proc_entry("ide", NULL);
703 }