Skip to content

Commit

Permalink
bluetooth: hidp_process_hid_control remove unnecessary parameter dealing
Browse files Browse the repository at this point in the history
According to the bluetooth HID spec v1.0 chapter 7.4.2

"This code requests a major state change in a BT-HID device.  A HID_CONTROL
request does not generate a HANDSHAKE response."

"A HID_CONTROL packet with a parameter of VIRTUAL_CABLE_UNPLUG is the only
HID_CONTROL packet a device can send to a host.  A host will ignore all other
packets."

So in the hidp_precess_hid_control function, we just need to deal with the
UNLUG packet.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dave Young authored and David S. Miller committed Feb 5, 2008
1 parent a26af1e commit eff001e
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions net/bluetooth/hidp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,30 +369,13 @@ static inline void hidp_process_hid_control(struct hidp_session *session, unsign
{
BT_DBG("session %p param 0x%02x", session, param);

switch (param) {
case HIDP_CTRL_NOP:
break;

case HIDP_CTRL_VIRTUAL_CABLE_UNPLUG:
if (param == HIDP_CTRL_VIRTUAL_CABLE_UNPLUG) {
/* Flush the transmit queues */
skb_queue_purge(&session->ctrl_transmit);
skb_queue_purge(&session->intr_transmit);

/* Kill session thread */
atomic_inc(&session->terminate);
break;

case HIDP_CTRL_HARD_RESET:
case HIDP_CTRL_SOFT_RESET:
case HIDP_CTRL_SUSPEND:
case HIDP_CTRL_EXIT_SUSPEND:
/* FIXME: We have to parse these and return no error */
break;

default:
__hidp_send_ctrl_message(session,
HIDP_TRANS_HANDSHAKE | HIDP_HSHK_ERR_INVALID_PARAMETER, NULL, 0);
break;
}
}

Expand Down

0 comments on commit eff001e

Please sign in to comment.