Bugzilla – Attachment 64267 Details for
Bug 141228
scsi generic devices needed in hal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
add scsi.type, scsi.vendor, scsi.model
hal-scsi-type-01.patch (text/plain), 2.80 KB, created by
Kay Sievers
on 2006-01-20 14:16:57 UTC
(
hide
)
Description:
add scsi.type, scsi.vendor, scsi.model
Filename:
MIME Type:
Creator:
Kay Sievers
Created:
2006-01-20 14:16:57 UTC
Size:
2.80 KB
patch
obsolete
>Index: ChangeLog >=================================================================== >RCS file: /cvs/hal/hal/ChangeLog,v >retrieving revision 1.749 >diff -u -r1.749 ChangeLog >--- ChangeLog 18 Jan 2006 23:22:33 -0000 1.749 >+++ ChangeLog 20 Jan 2006 14:06:53 -0000 >@@ -1,3 +1,8 @@ >+2006-01-20 Kay Sievers <kay.sievers@vrfy.org> >+ >+ * hald/linux2/physdev.c: (scsi_add): Add scsi.type, scsi.vendor, >+ scsi.model for the scsi device. >+ > 2006-01-18 David Zeuthen <david@fubar.dk> > > * hald/linux2/addons/addon-pmu.c (main): Use a direct connection to >Index: hald/device_info.c >=================================================================== >RCS file: /cvs/hal/hal/hald/device_info.c,v >retrieving revision 1.30 >diff -u -r1.30 device_info.c >--- hald/device_info.c 12 Jan 2006 17:48:44 -0000 1.30 >+++ hald/device_info.c 20 Jan 2006 14:06:54 -0000 >@@ -190,7 +190,6 @@ > goto out; > } > >- > /* Start with the source udi */ > strncpy (udi_result, source_udi, udi_result_size); > >@@ -232,7 +231,7 @@ > strncpy (udi_result, newudi, udi_result_size); > } else { > /*HAL_INFO (("new_udi = '%s'", curtoken));*/ >- strncpy (udi_result, curtoken, udi_result_size); >+ strncpy (udi_result, curtoken, udi_result_size); > } > > } >@@ -528,7 +527,6 @@ > > /*HAL_INFO (("is_absolute=%d, should_be=%d, path='%s'", is_absolute_path, should_be_absolute_path, path));*/ > >- > if (should_be_absolute_path) { > if (is_absolute_path) > return TRUE; >Index: hald/linux2/physdev.c >=================================================================== >RCS file: /cvs/hal/hal/hald/linux2/physdev.c,v >retrieving revision 1.23 >diff -u -r1.23 physdev.c >--- hald/linux2/physdev.c 2 Nov 2005 15:38:14 -0000 1.23 >+++ hald/linux2/physdev.c 20 Jan 2006 14:06:54 -0000 >@@ -681,6 +681,7 @@ > HalDevice *d; > const gchar *bus_id; > gint host_num, bus_num, target_num, lun_num; >+ int type; > > if (parent == NULL) { > d = NULL; >@@ -702,9 +703,35 @@ > > hal_util_set_driver (d, "info.linux.driver", sysfs_path); > >- /* guestimate product name */ > hal_device_property_set_string (d, "info.product", "SCSI Device"); > >+ hal_util_set_string_from_file (d, "scsi.model", sysfs_path, "model"); >+ hal_util_set_string_from_file (d, "scsi.vendor", sysfs_path, "vendor"); >+ hal_util_get_int_from_file (sysfs_path, "type", &type, 0); >+ switch (type) { >+ case 0: >+ /* Disk */ >+ case 14: >+ /* TYPE_RBC (Reduced Block Commands) >+ * Simple Direct Access Device, set it to disk >+ * (some Firewire Disks use it) >+ */ >+ hal_device_property_set_string (d, "scsi.type", "disk"); >+ break; >+ case 1: >+ /* Tape */ >+ hal_device_property_set_string (d, "scsi.type", "tape"); >+ break; >+ case 4: >+ /* WORM */ >+ case 5: >+ /* CD-ROM */ >+ hal_device_property_set_string (d, "scsi.type", "cdrom"); >+ break; >+ default: >+ hal_device_property_set_string (d, "scsi.type", "unknown"); >+ } >+ > out: > return d; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 141228
:
62018
| 64267