Hi Johan, > When powering off and disconnecting devices we should also consider > connections which have not yet reached the BT_CONNECTED state. They may > not have a valid handle yet and simply sending a HCI_Disconnect will not > work. > > This patch updates the code to either disconnect, cancel connection > creation or reject incoming connection creation based on the current > conn->state value as well as the link type in question. > > When the power off procedure results in canceling connection attempts > instead of disconnecting connections we get a connection failed event > instead of a disconnection event. Therefore, we also need to have extra > code in the mgmt_connect_failed function to check if we should proceed > with the power off or not. > > Signed-off-by: Johan Hedberg <johan.hedberg@xxxxxxxxx> > --- > net/bluetooth/mgmt.c | 44 ++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 40 insertions(+), 4 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel -- 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