Hi Johan,
quoted
quoted
If either one of the HCI_SETUP or HCI_USER_CHANNEL flags is set the
device is not considered valid for mgmt. By having these checks inside
the mgmt_valid_hdev function the a couple of places using it can be
simplified.
I looked at doing this and decided not to. Reason was that the device
gets removed from mgmt anyway.
I'm not sure what significance you think "device gets removed from mgmt"
has. All that is is a mgmt event saying that index has been removed. In
addition to that we need to ensure that we don't send any more mgmt
events for such devices and that we don't include such devices in the
response to mgmt_read_index list.
These are the two places of the code that my patch simplifies, one is
the check for whether to send a "power on" mgmt event and the other the
response handling of read_index_list.
I have taken care of that part. It is done inside mgmt_control() and in case of a controller in user channel mode it returns invalid index.
For the events, I have no idea on how we would generate events if we are not going through hci_event.c when the user channel is active.
Regards
Marcel