Hi, On Tue, Aug 23, 2011, Luiz Augusto von Dentz wrote: > On Tue, Aug 23, 2011 at 11:54 AM, shy <shyboysby@xxxxxxxxx> wrote: > > Hi Marcel, > > According to connection_disconnect in input/device.c(Bluez version > > 4.93), it would disconnect INTR and CONTROL L2cap link and then send > > HIDP_CTRL_VIRTUAL_CABLE_UNPLUG message by the process sequence. > > That seems it doesn't comply to the spec Page120, HID version 1.0. > > Could you please confirm this case? If so, I would submit a patch. > > You mean that the disconnect sequence is wrong? Note that we only send > virtual cable unplug in case the device is being removed, otherwise it > is just a regular disconnect. I'm not really an expert with the HID implementation, but I think what's causing confusion here are the close() (g_io_channel_shutdown) calls in user-space code. Since the kernel keeps its own socket references (created through HIDPCONNADD) this will not actually disconnect the L2CAP channels and so it's still safe to send the unplug command (triggered by the HIDPCONNDEL ioctl) and wait for the remote side to disconnect. So unless you've got actual traces (air or HCI) showing an incorrect sequence I don't think there's anything wrong with the code. Johan -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html