View | Details | Raw Unified | Return to bug 141228
Collapse All | Expand All

(-)ChangeLog (+7 lines)
Lines 1-3 Link Here
1
2006-01-05  Kay Sievers  <kay.sievers@vrfy.org>
2
3
	Add scsi_generic devices.
4
5
	* hald/linux2/classdev.c: (scsi_generic_add),
6
	(scsi_generic_compute_udi):
7
1
2005-12-21  Kay Sievers  <kay.sievers@vrfy.org>
8
2005-12-21  Kay Sievers  <kay.sievers@vrfy.org>
2
9
3
	Move callout one level up.
10
	Move callout one level up.
(-)hald/linux2/classdev.c (+48 lines)
Lines 314-319 Link Here
314
/*--------------------------------------------------------------------------------------------------------------*/
314
/*--------------------------------------------------------------------------------------------------------------*/
315
315
316
static HalDevice *
316
static HalDevice *
317
scsi_generic_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *physdev, const gchar *sysfs_path_in_devices)
318
{
319
	HalDevice *d;
320
321
	d = NULL;
322
323
	if (physdev == NULL || sysfs_path_in_devices == NULL)
324
		goto out;
325
326
	d = hal_device_new ();
327
	hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
328
	hal_device_property_set_string (d, "info.parent", physdev->udi);
329
	hal_device_property_set_string (d, "info.category", "scsi_generic");
330
	hal_device_add_capability (d, "scsi_generic");
331
	hal_device_property_set_string (d, "info.product", "SCSI Generic Interface");
332
	hal_device_property_set_string (d, "scsi_generic.device", device_file);
333
334
out:
335
	return d;
336
}
337
338
static gboolean
339
scsi_generic_compute_udi (HalDevice *d)
340
{
341
	gchar udi[256];
342
343
	hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
344
			      "%s_scsi_generic",
345
			      hal_device_property_get_string (d, "info.parent"));
346
	hal_device_set_udi (d, udi);
347
	hal_device_property_set_string (d, "info.udi", udi);
348
	return TRUE;
349
}
350
351
/*--------------------------------------------------------------------------------------------------------------*/
352
353
static HalDevice *
317
scsi_host_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *physdev, const gchar *sysfs_path_in_devices)
354
scsi_host_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *physdev, const gchar *sysfs_path_in_devices)
318
{
355
{
319
	HalDevice *d;
356
	HalDevice *d;
Lines 946-951 Link Here
946
	.remove       = classdev_remove
983
	.remove       = classdev_remove
947
};
984
};
948
985
986
static ClassDevHandler classdev_handler_scsi_generic =
987
{ 
988
	.subsystem    = "scsi_generic",
989
	.add          = scsi_generic_add,
990
	.get_prober   = NULL,
991
	.post_probing = NULL,
992
	.compute_udi  = scsi_generic_compute_udi,
993
	.remove       = classdev_remove
994
};
995
949
static ClassDevHandler classdev_handler_scsi_host = 
996
static ClassDevHandler classdev_handler_scsi_host = 
950
{ 
997
{ 
951
	.subsystem    = "scsi_host",
998
	.subsystem    = "scsi_host",
Lines 1020-1025 Link Here
1020
	&classdev_handler_input,
1067
	&classdev_handler_input,
1021
	&classdev_handler_bluetooth,
1068
	&classdev_handler_bluetooth,
1022
	&classdev_handler_net,
1069
	&classdev_handler_net,
1070
	&classdev_handler_scsi_generic,
1023
	&classdev_handler_scsi_host,
1071
	&classdev_handler_scsi_host,
1024
	&classdev_handler_usbclass,
1072
	&classdev_handler_usbclass,
1025
	&classdev_handler_sound,
1073
	&classdev_handler_sound,

Return to bug 141228