/***************************************************************************
*
* devinfo.c : main file for libdevinfo-based device enumeration
*
* Copyright 2013 Garrett D'Amore <garrett@damore.org>
*
* Licensed under the Academic Free License version 2.1
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <string.h>
#include <libdevinfo.h>
#include "../osspec.h"
#include "../logger.h"
#include "../hald.h"
#include "../hald_dbus.h"
#include "../device_info.h"
#include "../util.h"
#include "../hald_runner.h"
#include "osspec_solaris.h"
#include "hotplug.h"
#include "devinfo.h"
#include "devinfo_pci.h"
#include "devinfo_storage.h"
#include "devinfo_ieee1394.h"
#include "devinfo_usb.h"
#include "devinfo_misc.h"
#include "devinfo_acpi.h"
#include "devinfo_cpu.h"
void
{
return;
}
} else {
return;
}
}
}
void
{
HalDevice *d;
do {
if ((d != NULL) &&
}
} while ((node != DI_NODE_NIL) &&
}
void
{
char *driver_name, *s;
const char *s1;
} else {
}
"/org/freedesktop/Hal/devices%s_%d",
di_instance (node));
hal_device_set_udi (d, udi);
hal_device_property_set_string (d, "info.product", s);
} else {
}
hal_device_property_set_string (d, "info.solaris.driver",
}
/* inherit parent's claim attributes */
}
}
}
/* device handlers, ordered specific to generic */
};
{
char *devfs_path;
int i;
&device_type);
handler = devinfo_handlers[i];
}
return (d);
}
void
devinfo_hotplug_enqueue(HalDevice *d, gchar *devfs_path, DevinfoDevHandler *handler, int action, int front)
{
hotplug_event->d = d;
}
void
{
}
void
{
}
void
{
}
void
{
/* Move from temporary to global device store */
hal_device_store_remove (hald_get_tdl (), d);
hal_device_store_add (hald_get_gdl (), d);
}
void
devinfo_callouts_probing_done (HalDevice *d, guint32 exit_type, gint return_code, char **error, gpointer userdata1, gpointer userdata2)
{
/* Discard device if probing reports failure */
hal_device_store_remove (hald_get_tdl (), d);
g_object_unref (d);
return;
}
/* Merge properties from .fdi files */
}
void
{
int prober_timeout;
if (hal_device_property_get_bool (d, "info.ignore")) {
HAL_INFO (("Preprobing merged info.ignore==TRUE"));
/* Leave device with info.ignore==TRUE so we won't pick up children */
hal_device_property_remove (d, "info.category");
hal_device_property_remove (d, "info.capabilities");
hal_device_store_remove (hald_get_tdl (), d);
hal_device_store_add (hald_get_gdl (), d);
return;
}
} else {
}
} else {
}
/* probe the device */
hald_runner_run (d,
} else {
}
}
/* This is the beginning of hotplug even handling */
void
hotplug_event_begin_add_devinfo (HalDevice *d, HalDevice *parent, DevinfoDevHandler *handler, void *end_token)
{
goto skip;
}
HAL_INFO (("Ignoring device since parent has info.ignore==TRUE"));
goto skip;
}
/* add to TDL so preprobing callouts and prober can access it */
hal_device_store_add (hald_get_tdl (), d);
}
/* Process preprobe fdi files */
/* Run preprobe callouts */
return;
skip:
hal_device_store_remove (hald_get_tdl (), d);
g_object_unref (d);
return;
}
void
{
}
/* generate hotplug event for each device in this branch */
void
{
GSList *i;
char *child_devfs_path;
if (d == NULL) {
"solaris.devfs_path", devfs_path);
if (d == NULL)
return;
}
/* first remove children */
"info.parent", hal_device_get_udi (d));
devinfo_remove_branch ((gchar *)hal_device_property_get_string (child, "solaris.devfs_path"), child);
}
HAL_INFO (("remove_branch: done with children"));
/* then remove self */
}
void
{
if (!hal_device_store_remove (hald_get_gdl (), d)) {
HAL_WARNING (("Error removing device"));
}
g_object_unref (d);
}
void
{
if (hal_device_has_capability (d, "volume")) {
} else {
}
}
{
if (hal_device_has_capability (d, "block")) {
return (devinfo_storage_device_rescan (d));
} else if (hal_device_has_capability (d, "button")) {
return (devinfo_lid_rescan (d));
} else {
return (FALSE);
}
}
static int
{
return (DI_WALK_TERMINATE);
}
char *
{
return (devlink_path);
}