Hi Marcel, On Fri, Dec 19, 2014, Marcel Holtmann wrote: > >>> + err = hci_req_run(&req, add_device_complete); > >>> + if (err < 0) { > >>> + if (err == -ENODATA) { > >>> + cmd->cmd_complete(cmd, MGMT_STATUS_SUCCESS); > >>> + err = 0; > >>> + } > >>> + mgmt_pending_remove(cmd); > >>> + } > >> > >> But this command should also work when the controller is powered down. > >> Who is doing these checks now? > > > > That's covered by the ENODATA check. hci_update_background_scan() bails > > out without doing anything if the hdev is powered off, leaving the > > hci_request empty. > > we have never done it like that in mgmt commands, or have we? > > I think a shortcut check with is_powered and leaving the function > might be a bit more clearer to understand. Or at least a command that > explain this. Since I clearly missed it. It'd need to be a code comment since we do still have to call hci_conn_params_set() which may or may not end up adding something to the hci_request. Or then we need to completely redesign these functions to clearly split the various list updates from code that may send HCI commands (but the amount of needed patches is already exploding so I'd rather not go there yet). 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