Lines 105-111
Link Here
|
105 |
} while (0) |
105 |
} while (0) |
106 |
#endif /* __GNUC__ */ |
106 |
#endif /* __GNUC__ */ |
107 |
|
107 |
|
108 |
|
|
|
109 |
/* print_usb_usermap |
108 |
/* print_usb_usermap |
110 |
* |
109 |
* |
111 |
* Print out lines that can be included into usb.usermap |
110 |
* Print out lines that can be included into usb.usermap |
Lines 262-274
Link Here
|
262 |
|
261 |
|
263 |
|
262 |
|
264 |
static int |
263 |
static int |
265 |
udev_begin_func (const func_params_t *params) |
264 |
udev_098_begin_func (const func_params_t *params) |
266 |
{ |
265 |
{ |
267 |
printf ("# udev rules file for libgphoto2\n#\n"); |
266 |
printf ("# udev rules file for libgphoto2 devices (udev >= 0.98)\n#\n"); |
268 |
printf ("BUS!=\"usb\", ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n\n"); |
267 |
printf ("ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n"); |
|
|
268 |
printf ("SUBSYSTEM!=\"usb*\", GOTO=\"libgphoto2_rules_end\"\n\n"); |
269 |
return 0; |
269 |
return 0; |
270 |
} |
270 |
} |
271 |
|
271 |
|
272 |
static int |
272 |
static int |
273 |
udev_end_func (const func_params_t *params) |
273 |
udev_end_func (const func_params_t *params) |
274 |
{ |
274 |
{ |
Lines 280-286
Link Here
|
280 |
|
280 |
|
281 |
|
281 |
|
282 |
static int |
282 |
static int |
283 |
udev_camera_func (const func_params_t *params, |
283 |
udev_098_camera_func (const func_params_t *params, |
284 |
const int i, |
284 |
const int i, |
285 |
const CameraAbilities *a) |
285 |
const CameraAbilities *a) |
286 |
{ |
286 |
{ |
Lines 324-345
Link Here
|
324 |
} |
324 |
} |
325 |
|
325 |
|
326 |
if (flags & GP_USB_HOTPLUG_MATCH_INT_CLASS) { |
326 |
if (flags & GP_USB_HOTPLUG_MATCH_INT_CLASS) { |
327 |
printf("SYSFS{bInterfaceClass}==\"%02x\", ", class); |
327 |
if ((flags & (GP_USB_HOTPLUG_MATCH_INT_CLASS|GP_USB_HOTPLUG_MATCH_INT_SUBCLASS|GP_USB_HOTPLUG_MATCH_INT_PROTOCOL)) == (GP_USB_HOTPLUG_MATCH_INT_CLASS|GP_USB_HOTPLUG_MATCH_INT_SUBCLASS|GP_USB_HOTPLUG_MATCH_INT_PROTOCOL)) |
328 |
if (flags & GP_USB_HOTPLUG_MATCH_INT_SUBCLASS) { |
328 |
printf("PROGRAM=\"check_ptp_camera %02d/%02d/%02d\", ", class, subclass, proto); |
329 |
printf("SYSFS{bInterfaceSubClass}==\"%02x\", ", subclass); |
329 |
else |
330 |
} |
330 |
fprintf(stderr,"unhandled interface match flags %x\n", flags); |
331 |
if (flags & GP_USB_HOTPLUG_MATCH_INT_PROTOCOL) { |
|
|
332 |
printf("SYSFS{bInterfaceProtocol}==\"%02x\", ", proto); |
333 |
} |
334 |
} else { |
331 |
} else { |
335 |
printf ("SYSFS{idVendor}==\"%04x\", SYSFS{idProduct}==\"%04x\", ", |
332 |
printf ("ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\", ", |
336 |
a->usb_vendor, a->usb_product); |
333 |
a->usb_vendor, a->usb_product); |
337 |
} |
334 |
} |
338 |
printf("RUN+=\"%s\"\n", hotplug_script); |
335 |
printf("MODE=\"660\", GROUP=\"plugdev\"\n"); |
339 |
return 0; |
336 |
return 0; |
340 |
} |
337 |
} |
341 |
|
338 |
|
342 |
|
|
|
343 |
static int |
339 |
static int |
344 |
empty_begin_func (const func_params_t *params) |
340 |
empty_begin_func (const func_params_t *params) |
345 |
{ |
341 |
{ |
Lines 647-658
Link Here
|
647 |
camera_func: fdi_device_camera_func, |
643 |
camera_func: fdi_device_camera_func, |
648 |
end_func: fdi_device_end_func |
644 |
end_func: fdi_device_end_func |
649 |
}, |
645 |
}, |
650 |
{name: "udev-rules", |
646 |
{name: "udev-rules-0.98", |
651 |
descr: "udev rules file", |
647 |
descr: "udev >= 0.98 rules file", |
652 |
help: "Put it into /etc/udev/libgphoto2.rules", |
648 |
help: "Put it into /etc/udev/libgphoto2.rules, for udev >= 0.98", |
653 |
paramdescr: "<PATH_TO_HOTPLUG_SCRIPT>", |
649 |
paramdescr: "( <PATH_TO_SCRIPT> | [mode <mode>|owner <owner>|group <group>]* ) ", |
654 |
begin_func: udev_begin_func, |
650 |
begin_func: udev_098_begin_func, |
655 |
camera_func: udev_camera_func, |
651 |
camera_func: udev_098_camera_func, |
656 |
end_func: udev_end_func |
652 |
end_func: udev_end_func |
657 |
}, |
653 |
}, |
658 |
{name: "idlist", |
654 |
{name: "idlist", |