Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 309263
Collapse All | Expand All

(-)a/hald/freebsd/hf-usb2.c (-11 / +36 lines)
Lines 98-107 hf_usb2_probe_interfaces(HalDevice *parent) Link Here
98
	  if (driver)
98
	  if (driver)
99
            {
99
            {
100
	      if (! strcmp(driver, "ukbd"))
100
	      if (! strcmp(driver, "ukbd"))
101
                hf_device_set_input(device, "keyboard", NULL);
101
                hf_device_set_input(device, "keyboard", "keys", devname);
102
	      else if (! strcmp(driver, "ums"))
102
	      else if (! strcmp(driver, "ums") || ! strcmp(driver, "atp"))
103
                {
103
                {
104
                  hf_device_set_input(device, "mouse", devname);
104
                  hf_device_set_input(device, "mouse", NULL, devname);
105
	          hf_runner_run_sync(device, 0, "hald-probe-mouse", NULL);
105
	          hf_runner_run_sync(device, 0, "hald-probe-mouse", NULL);
106
	        }
106
	        }
107
	      else if (! strcmp(driver, "uhid"))
107
	      else if (! strcmp(driver, "uhid"))
Lines 192-202 hf_usb2_probe (void) Link Here
192
      addr = libusb20_dev_get_address(pdev);
192
      addr = libusb20_dev_get_address(pdev);
193
193
194
      if (addr == 1)
194
      if (addr == 1)
195
        parent = hf_devtree_find_parent_from_info(hald_get_gdl(), "usbus", bus);
195
        parent = hf_devtree_find_from_info(hald_get_gdl(), "usbus", bus);
196
      else
196
      else
197
        parent = hf_device_store_match(hald_get_gdl(), "usb_device.bus_number",
197
        parent = hf_device_store_match(hald_get_gdl(), "usb_device.bus_number",
198
          HAL_PROPERTY_TYPE_INT32, bus, "usb_device.port_number",
198
          HAL_PROPERTY_TYPE_INT32, bus, "usb_device.port_number",
199
	  HAL_PROPERTY_TYPE_INT32, addr - 1, NULL);
199
	  HAL_PROPERTY_TYPE_INT32, addr - 1, "info.bus",
200
	  HAL_PROPERTY_TYPE_STRING, "usb_device", NULL);
200
      if (! parent || hal_device_property_get_bool(parent, "info.ignore"))
201
      if (! parent || hal_device_property_get_bool(parent, "info.ignore"))
201
        continue;
202
        continue;
202
203
Lines 216-222 hf_usb2_devd_add (const char *name, Link Here
216
  HalDevice *parent_device;
217
  HalDevice *parent_device;
217
  int bus, addr, pbus, paddr;
218
  int bus, addr, pbus, paddr;
218
219
219
  if (strncmp(name, "ugen", strlen("ugen")))
220
  if (! parent)
221
    return FALSE;
222
223
  if (strncmp(name, "ugen", strlen("ugen")) &&
224
      ! strncmp(parent, "uhub", strlen("uhub")))
225
    return TRUE;
226
  else if (strncmp(name, "ugen", strlen("ugen")))
220
    return FALSE;
227
    return FALSE;
221
  else if (strncmp(parent, "ugen", strlen("ugen")))
228
  else if (strncmp(parent, "ugen", strlen("ugen")))
222
    return TRUE;
229
    return TRUE;
Lines 232-238 hf_usb2_devd_add (const char *name, Link Here
232
239
233
  parent_device = hf_device_store_match(hald_get_gdl(),
240
  parent_device = hf_device_store_match(hald_get_gdl(),
234
    "usb_device.bus_number", HAL_PROPERTY_TYPE_INT32, pbus,
241
    "usb_device.bus_number", HAL_PROPERTY_TYPE_INT32, pbus,
235
    "usb_device.port_number", HAL_PROPERTY_TYPE_INT32, paddr, NULL);
242
    "usb_device.port_number", HAL_PROPERTY_TYPE_INT32, paddr, "info.bus",
243
    HAL_PROPERTY_TYPE_STRING, "usb_device", NULL);
236
244
237
  if (parent_device && ! hal_device_property_get_bool(parent_device,
245
  if (parent_device && ! hal_device_property_get_bool(parent_device,
238
      "info.ignore"))
246
      "info.ignore"))
Lines 255-262 hf_usb2_devd_remove (const char *name, Link Here
255
263
256
  if (strncmp(name, "ugen", strlen("ugen")))
264
  if (strncmp(name, "ugen", strlen("ugen")))
257
    return FALSE;
265
    return FALSE;
258
  else if (strncmp(parent, "ugen", strlen("ugen")))
259
    return TRUE;
260
266
261
  if (sscanf(name, "ugen%i.%i", &bus, &addr) != 2)
267
  if (sscanf(name, "ugen%i.%i", &bus, &addr) != 2)
262
    return FALSE;
268
    return FALSE;
Lines 265-271 hf_usb2_devd_remove (const char *name, Link Here
265
271
266
  device = hf_device_store_match(hald_get_gdl(), "usb_device.bus_number",
272
  device = hf_device_store_match(hald_get_gdl(), "usb_device.bus_number",
267
    HAL_PROPERTY_TYPE_INT32, bus, "usb_device.port_number",
273
    HAL_PROPERTY_TYPE_INT32, bus, "usb_device.port_number",
268
    HAL_PROPERTY_TYPE_INT32, addr, NULL);
274
    HAL_PROPERTY_TYPE_INT32, addr, "info.bus",
275
    HAL_PROPERTY_TYPE_STRING, "usb_device", NULL);
269
276
270
  if (device)
277
  if (device)
271
    {
278
    {
Lines 276-281 hf_usb2_devd_remove (const char *name, Link Here
276
  return FALSE;
283
  return FALSE;
277
}
284
}
278
285
286
static gboolean
287
hf_usb2_devd_notify (const char *system,
288
		     const char *subsystem,
289
		     const char *type,
290
		     const char *data)
291
{
292
  if (! data || strcmp(system, "DEVFS") || strcmp(subsystem, "CDEV") ||
293
      (strcmp(type, "CREATE") && strcmp(type, "DESTROY")))
294
    return FALSE;
295
296
  if (! strncmp(data, "cdev=ugen", strlen("cdev=ugen")) ||
297
      ! strncmp(data, "cdev=usb", strlen("cdev=usb")))
298
    return TRUE;
299
300
  return FALSE;
301
}
302
279
HFHandler hf_usb2_handler = {
303
HFHandler hf_usb2_handler = {
280
  .privileged_init	= hf_usb2_privileged_init,
304
  .privileged_init	= hf_usb2_privileged_init,
281
  .probe		= hf_usb2_probe
305
  .probe		= hf_usb2_probe
Lines 283-287 HFHandler hf_usb2_handler = { Link Here
283
307
284
HFDevdHandler hf_usb2_devd_handler = {
308
HFDevdHandler hf_usb2_devd_handler = {
285
  .add =	hf_usb2_devd_add,
309
  .add =	hf_usb2_devd_add,
286
  .remove =	hf_usb2_devd_remove
310
  .remove =	hf_usb2_devd_remove,
311
  .notify =     hf_usb2_devd_notify
287
};
312
};

Return to bug 309263