|
Lines 681-686
Link Here
|
| 681 |
HalDevice *d; |
681 |
HalDevice *d; |
| 682 |
const gchar *bus_id; |
682 |
const gchar *bus_id; |
| 683 |
gint host_num, bus_num, target_num, lun_num; |
683 |
gint host_num, bus_num, target_num, lun_num; |
|
|
684 |
int type; |
| 684 |
|
685 |
|
| 685 |
if (parent == NULL) { |
686 |
if (parent == NULL) { |
| 686 |
d = NULL; |
687 |
d = NULL; |
|
Lines 702-710
Link Here
|
| 702 |
|
703 |
|
| 703 |
hal_util_set_driver (d, "info.linux.driver", sysfs_path); |
704 |
hal_util_set_driver (d, "info.linux.driver", sysfs_path); |
| 704 |
|
705 |
|
| 705 |
/* guestimate product name */ |
|
|
| 706 |
hal_device_property_set_string (d, "info.product", "SCSI Device"); |
706 |
hal_device_property_set_string (d, "info.product", "SCSI Device"); |
| 707 |
|
707 |
|
|
|
708 |
hal_util_set_string_from_file (d, "scsi.model", sysfs_path, "model"); |
| 709 |
hal_util_set_string_from_file (d, "scsi.vendor", sysfs_path, "vendor"); |
| 710 |
hal_util_get_int_from_file (sysfs_path, "type", &type, 0); |
| 711 |
switch (type) { |
| 712 |
case 0: |
| 713 |
/* Disk */ |
| 714 |
case 14: |
| 715 |
/* TYPE_RBC (Reduced Block Commands) |
| 716 |
* Simple Direct Access Device, set it to disk |
| 717 |
* (some Firewire Disks use it) |
| 718 |
*/ |
| 719 |
hal_device_property_set_string (d, "scsi.type", "disk"); |
| 720 |
break; |
| 721 |
case 1: |
| 722 |
/* Tape */ |
| 723 |
hal_device_property_set_string (d, "scsi.type", "tape"); |
| 724 |
break; |
| 725 |
case 4: |
| 726 |
/* WORM */ |
| 727 |
case 5: |
| 728 |
/* CD-ROM */ |
| 729 |
hal_device_property_set_string (d, "scsi.type", "cdrom"); |
| 730 |
break; |
| 731 |
default: |
| 732 |
hal_device_property_set_string (d, "scsi.type", "unknown"); |
| 733 |
} |
| 734 |
|
| 708 |
out: |
735 |
out: |
| 709 |
return d; |
736 |
return d; |
| 710 |
} |
737 |
} |