With the new Documentation/hid directory, it makes sense to have
hiddev.txt here as well.
Signed-off-by: Alan Ott <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Add a new binary sysfs entry called report_descriptor which contains
the HID report descriptor.
Signed-off-by: Alan Ott <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
This patch adds support or getting and setting feature reports for bluetooth
HID devices from HIDRAW.
Signed-off-by: Alan Ott <[email protected]>
Acked-by: Gustavo F. Padovan <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Per the HID Specification, Feature reports must be sent and received on
the Configuration endpoint (EP 0) through the Set_Report/Get_Report
interfaces. This patch adds two ioctls to hidraw to set and get feature
reports to and from the device. Modifications were made to hidraw and
usbhid.
New hidraw ioctls:
HIDIOCSFEATURE - Perform a Set_Report transfer of a Feature report.
HIDIOCGFEATURE - Perform a Get_Report transfer of a Feature report.
Signed-off-by: Alan Ott <[email protected]>
Signed-off-by: Antonio Ospite <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Wait for an ACK from the device before returning from
hidp_output_raw_report(). This way, failures can be returned to the user
application. Also, it prevents ACK/NAK packets from an output packet from
being confused with ACK/NAK packets from an input request packet.
Signed-off-by: Alan Ott <[email protected]>
Acked-by: Gustavo F. Padovan <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Move the call to hid_add_device() (which calls a device's probe() function)
to after the kernel_thread() call which starts the hidp_session() thread.
This ensures the Bluetooth receive socket is fully running by the time a
device's probe() function is called. This way, a device can communicate
(send and receive) with the Bluetooth device from its probe() function.
Signed-off-by: Alan Ott <[email protected]>
Acked-by: Gustavo F. Padovan <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Setting of the return value of hidraw_read() uses the += operator when
= is more appropriate. There is no case where ret can be anything
other than zero when the assignment is made, making = equivalent to
+= and much more clear.
Signed-off-by: Alan Ott <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Added the ioctl function to the compat_ioctl pointer in the file_operations
struct. Before this, some ioctls would fail for 32-bit apps on 64-bit systems.
Signed-off-by: Alan Ott <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Feature reports should only be sent on the control endpoint.
The USB HID standard is unclear and confusing on this issue. It seems to
suggest that Feature reports can be sent on a HID device's Interrupt OUT
endpoint. This cannot be the case because the report type is not encoded in
transfers sent out the Interrput OUT endpoint. If Feature reports were sent on
the Interrupt OUT endpint, they would be indistinguishable from Output reports
in the case where Report IDs were not used.
Further, Windows and Mac OS X do not send Feature reports out the interrupt OUT
Endpoint. They will only go out the Control Endpoint.
In addition, many devices simply do not hande Feature reports sent out the
Interrupt OUT endpoint.
Reported-by: [email protected]
Signed-off-by: Alan Ott <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
When I made commit 29129a98e6 ("HID: Send Report ID when numbered
reports are sent over the control endpoint"), I didn't account for *buf
not being the report ID anymore, as buf is incremented.
Signed-off-by: Alan Ott <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
The Report ID wasn't sent as part of the payload for reports which were sent
over the control endpoint. This is required by section 8.1 of the HID spec.
Signed-off-by: Alan Ott <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
This patch makes the hidraw driver use the first Interrupt OUT endpoint for
HID transfers to the device if such an endpoint exists. This is consistent
with the behavior of the hiddev driver, and the logic is similar.
From the USB HID specification:
The Interrupt Out pipe is optional. If a device declares an Interrupt Out
endpoint then Output reports are transmitted by the host to the device
through the Interrupt Out endpoint. If no Interrupt Out endpoint is
declared then Output reports are transmitted to a device through the
Control endpoint, using Set_Report(Output) requests.
Signed-off-by: Alan Ott <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Make hidraw not stick an extra byte on the beginning of an IN transfer
when a HID device contains multiple reports.
Signed-off-by: Alan Ott <[email protected]>
Acked-by: Jiri Slaby <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>