There are Logitech Wireless devices similar to Unifying ones with the
difference that device is paired with single dongle and dongle doesn't
support pairing multiple devices.
Add support for these. Tested with Wireless Mouse M187 and M185/M225.
Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Richard Hughes <richard@hughsie.com>
Set proper vendor via udev rules for unifying devices and handle
that in code.
Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Richard Hughes <richard@hughsie.com>
Add support for checking device model name for hid++ v1 protocol
version.
Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Richard Hughes <richard@hughsie.com>
Version 1 hid++ HIDPP_REFRESH_FLAGS_BATTERY packets were incorrect.
Response packets were incorrectly thrown away as invalid. These
packets have HIDPP_HEADER_REQUEST (and not HIDPP_HEADER_RESPONSE as code
expexted). Fix that by allowing both types.
Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Richard Hughes <richard@hughsie.com>
HIDPP_REFRESH_FLAGS_KIND action puts result into 7 bytes buffer and
later tries to access 8th element (with index 7). Make buffer bigger,
so 8th element will fit.
Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Richard Hughes <richard@hughsie.com>
HID++ version 1 was properly detected but that information wasn't
reaching caller.
Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Richard Hughes <richard@hughsie.com>
udev v196 libraries changed behaviour of g_udev_device_get_sysfs_attr()
by stopping following symlinks for "device" attribute [1]. That change
broke hiddev finding for unifying devices. Fix that by getting sysfs
path from parent hiddev device.
1. http://cgit.freedesktop.org/systemd/systemd/commit/?id=5ae18ddc0d86673520c0dd6b59ccac8afc8aa605
Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Richard Hughes <richard@hughsie.com>
logind is now being detected at runtime (see previous commit ff39d23), so we do
not need to link against libsystemd-daemon any more. Drop --enable-systemd
configure option as well.
Drop the two modes depending on whether or not the test gets run as root or
not. Set up a fake system bus and always use that. This also eliminates the
need for upowerd's --test option.
Drop usage of dbus-launch, as this leaves dbus-daemon running after the tests.
Use GioTestDBus instead, which cleans up properly.
Setting $SYSFS_PATH does not work any more with recent libudev versions, our
homwbrew sysfs sandbox building limits us to coldplug tests only. umockdev
works with both old and new libudevs and can also emulate uevents for future
hotplugging tests.
Skip the test if umockdev is not available, so that check and distcheck don't
bail out.
Over the years we've moved all the quirks to the kernel (and fixed most of the
issues properly) so on Fedora we've not actually been shipping any rules in
pm-utils for a couple of releaes now.
Dropping this functionality allows us to finally drop the pm-utils dep for upower.
This is turned off by default. If this is not set, then any calls to Suspend(),
SuspendAllowed(), Hibernate() or HibernateAllowed() will fail with an error.
The error mesage tells the user what new method to port to in logind.
I'm expecting to set --enable-deprecated for Fedora 17 and 18, but turn it off
for Fedora 19, so other distributions probably want to follow suit to find out
what other stuff needs to be ported to the new APIs early. GNOME should already
be fine, but KDE will need some solid porting as I understand it.
See http://lists.freedesktop.org/archives/devkit-devel/2013-January/001339.html
for more information on future plans and for rationale.
This can easily be done by doing #define UPOWER_ENABLE_DEPRECATED before
"#include <upower.h>" or adding -DUPOWER_ENABLE_DEPRECATED to the cflags line in
Makefile.am
See http://lists.freedesktop.org/archives/devkit-devel/2013-January/001339.html
for more information on future plans and for rationale.
In the days of low-power ARM devices and large laptop batteries, imposing a 20
hour plausibility limit on "time to full" is not appropriate any more. Bump it
to 240 hours to still keep a plausibility check against "factor 1000" errors.
https://bugs.freedesktop.org/show_bug.cgi?id=60110
The condition should be for energy_full, not energy, since we aim to find some
way of finding energy_full and energy_full_design irrespective of the way we
find energy.
https://bugs.freedesktop.org/show_bug.cgi?id=60104
Signed-off-by: Alex Hornung <alex@alexhornung.com>
I've recently got access to some spec on this, so I'm now able to document
his a bit better. Also, change the 0x78 value for the function sending
BattLightMeasureBroadcastEvent to 0x1 since this is the number of event we
want, and one is enough.
Signed-off-by: Julien Danjou <julien@danjou.info>
Signed-off-by: Richard Hughes <richard@hughsie.com>
In recent kernels, hiddev* devices now have class "usbmisc", rather
than "usb" (see http://www.spinics.net/lists/linux-usb/msg62276.html).
This change translates into a change in SUBSYSTEM matching for hiddev*
devices. This fix addresses this for recent kernels while retaining
existing behavior. For reference, here is an attribute-walk for a
CyberPower CPS 1500C on kernel 3.7.0:
[Ubuntu bug #1091702: udev rules fail to match hid devices with new kernels]
udevadm info --attribute-walk --path=/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/usbmisc/hiddev0
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/usbmisc/hiddev0':
KERNEL=="hiddev0"
SUBSYSTEM=="usbmisc"
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0':
KERNELS=="4-1:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="usbhid"
ATTRS{bInterfaceClass}=="03"
ATTRS{bInterfaceSubClass}=="00"
ATTRS{bInterfaceProtocol}=="00"
ATTRS{bNumEndpoints}=="01"
ATTRS{supports_autosuspend}=="1"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bInterfaceNumber}=="00"
looking at parent device '/devices/pci0000:00/0000:00:1d.2/usb4/4-1':
KERNELS=="4-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{devpath}=="1"
ATTRS{idVendor}=="0764"
ATTRS{speed}=="1.5"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="8"
ATTRS{busnum}=="4"
ATTRS{devnum}=="2"
ATTRS{configuration}==""
ATTRS{bMaxPower}==" 50mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="c0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="0"
ATTRS{bcdDevice}=="0001"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{version}==" 1.10"
ATTRS{urbnum}=="36"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="CPS"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="0501"
ATTRS{bDeviceClass}=="00"
ATTRS{product}==" CP 1500C"
looking at parent device '/devices/pci0000:00/0000:00:1d.2/usb4':
KERNELS=="usb4"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{devpath}=="0"
ATTRS{idVendor}=="1d6b"
ATTRS{speed}=="12"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{authorized_default}=="1"
ATTRS{busnum}=="4"
ATTRS{devnum}=="1"
ATTRS{configuration}==""
ATTRS{bMaxPower}==" 0mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="2"
ATTRS{bcdDevice}=="0307"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{serial}=="0000:00:1d.2"
ATTRS{version}==" 1.10"
ATTRS{urbnum}=="50"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Linux 3.7.0-030700-generic uhci_hcd"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="0001"
ATTRS{bDeviceClass}=="09"
ATTRS{product}=="UHCI Host Controller"
looking at parent device '/devices/pci0000:00/0000:00:1d.2':
KERNELS=="0000:00:1d.2"
SUBSYSTEMS=="pci"
DRIVERS=="uhci_hcd"
ATTRS{irq}=="18"
ATTRS{subsystem_vendor}=="0x1028"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x0c0300"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{dma_mask_bits}=="32"
ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff"
ATTRS{device}=="0x268a"
ATTRS{msi_bus}==""
ATTRS{local_cpulist}=="0-7"
ATTRS{vendor}=="0x8086"
ATTRS{subsystem_device}=="0x021e"
ATTRS{numa_node}=="-1"
ATTRS{d3cold_allowed}=="0"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Richard Hughes <richard@hughsie.com>
This had support for Logitech devices working with an USB Unifying receiver.
This has been tested for at least the Logitech K750 solar keyboard, the M705
and the M505 mouses. Multiple receivers are also supported.
Signed-off-by: Julien Danjou <julien@danjou.info>
Signed-off-by: Richard Hughes <richard@hughsie.com>
This adds the luminosity property for devices able to recharge using light.
Signed-off-by: Julien Danjou <julien@danjou.info>
Signed-off-by: Richard Hughes <richard@hughsie.com>
This case was apparently overlooked when adding systemd support.
Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Signed-off-by: Richard Hughes <richard@hughsie.com>
When running under systemd, call into systemd for suspend and
hibernate instead of pm-utils. To capture resume events, install
a small script that gets executed by systemd after resume and
sends a dbus signal back to upower.
To make this work, the upower backends gain a new signal, ::resuming,
that they can optionally emit to signal that a resume happened.
Backends opt in to this by returning TRUE from up_backend_emits_resuming().
In this case, upower doesn't assume the sleep command to block until
resume, but instead waits for the ::resuming signal from the backend.
The only backend that uses this mechanism is the linux backend when
built with systemd support.
Signed-off-by: Richard Hughes <richard@hughsie.com>