mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-24 12:44:19 +08:00
android/hid: Fix get report buffer size variable name
This commit is contained in:
parent
9af81f5b9e
commit
b8bc9c1b27
@ -261,7 +261,7 @@ static bt_status_t hh_get_report(bt_bdaddr_t *bd_addr,
|
||||
|
||||
memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
|
||||
cmd.id = report_id;
|
||||
cmd.buf = buffer_size;
|
||||
cmd.buf_size = buffer_size;
|
||||
|
||||
switch (report_type) {
|
||||
case BTHH_INPUT_REPORT:
|
||||
|
@ -285,7 +285,7 @@ struct hal_cmd_hid_get_report {
|
||||
uint8_t bdaddr[6];
|
||||
uint8_t type;
|
||||
uint8_t id;
|
||||
uint16_t buf;
|
||||
uint16_t buf_size;
|
||||
} __attribute__((packed));
|
||||
|
||||
#define HAL_OP_HID_SET_REPORT 0x08
|
||||
|
@ -850,20 +850,20 @@ static uint8_t bt_hid_get_report(struct hal_cmd_hid_get_report *cmd,
|
||||
return HAL_STATUS_FAILED;
|
||||
|
||||
dev = l->data;
|
||||
req_size = (cmd->buf > 0) ? 4 : 2;
|
||||
req_size = (cmd->buf_size > 0) ? 4 : 2;
|
||||
req = g_try_malloc0(req_size);
|
||||
if (!req)
|
||||
return HAL_STATUS_NOMEM;
|
||||
|
||||
req[0] = HID_MSG_GET_REPORT | cmd->type;
|
||||
|
||||
if (cmd->buf > 0)
|
||||
if (cmd->buf_size > 0)
|
||||
req[0] = req[0] | HID_GET_REPORT_SIZE_FIELD;
|
||||
|
||||
req[1] = cmd->id;
|
||||
|
||||
if (cmd->buf > 0)
|
||||
bt_put_le16(cmd->buf, (req + 2));
|
||||
if (cmd->buf_size > 0)
|
||||
bt_put_le16(cmd->buf_size, (req + 2));
|
||||
|
||||
fd = g_io_channel_unix_get_fd(dev->ctrl_io);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user