Bluetooth: Add basic HCI command processing
Bluetooth: Add basic HCI command processing

This patch adds basic HCI command processing into the HCI core. The
commands are passed to the registered HCI driver with the help of a
FIFO and an associated fiber which wakes up whenever there's data in
the FIFO and the controller is ready to accept new commands.

The controller readiness (i.e. the num_cmds value returned in
cmd_status & cmd_complete events) is tracked with the help of a
semaphore. We only track whether the value is > 0 or not and never
send more than one command at a time. The reason for this is to keep
the tracking of pending command parameters simple in the form of a
single variable (dev.sent_cmd) rather than a list of pending buffers.

This patch also adds a very basic HCI initialization routine which
right now only consists of a single HCI_Reset command.

Change-Id: Ic68b298e4ea41334e49c3fe6bd4012a069ef6fdc
Co-authored-by: Andrei Emeltchenko <a6565233ddc88e4fb9c66c1d70743223493f2ed4@intel.com>
Signed-off-by: Johan Hedberg <628991c7b0a19c384f9b99c21ec330ce952bb838@intel.com>

jamesonwilliams/zephyr-kernel,explora26/zephyr,tidyjiang8/zephyr-doc,finikorg/zephyr,sharronliu/zephyr,finikorg/zephyr,holtmann/zephyr,runchip/zephyr-cc3200,mirzak/zephyr-os,Vudentz/zephyr,kraj/zephyr,zephyriot/zephyr,fractalclone/zephyr-riscv,sharronliu/zephyr,pklazy/zephyr,galak/zephyr,holtmann/zephyr,nashif/zephyr,finikorg/zephyr,coldnew/zephyr-project-fork,fbsder/zephyr,fractalclone/zephyr-riscv,mbolivar/zephyr,mirzak/zephyr-os,erwango/zephyr,erwango/zephyr,coldnew/zephyr-project-fork,kraj/zephyr,explora26/zephyr,zephyrproject-rtos/zephyr,tidyjiang8/zephyr-doc,pklazy/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr,bigdinotech/zephyr,punitvara/zephyr,aceofall/zephyr-iotos,mbolivar/zephyr,punitvara/zephyr,bboozzoo/zephyr,mirzak/zephyr-os,bboozzoo/zephyr,mirzak/zephyr-os,nashif/zephyr,rsalveti/zephyr,Vudentz/zephyr,bboozzoo/zephyr,fbsder/zephyr,32bitmicro/zephyr,bigdinotech/zephyr,zephyriot/zephyr,explora26/zephyr,runchip/zephyr-cc3220,holtmann/zephyr,galak/zephyr,runchip/zephyr-cc3220,jamesonwilliams/zephyr-kernel,punitvara/zephyr,aceofall/zephyr-iotos,fbsder/zephyr,GiulianoFranchetto/zephyr,32bitmicro/zephyr,fractalclone/zephyr-riscv,explora26/zephyr,galak/zephyr,bigdinotech/zephyr,fbsder/zephyr,galak/zephyr,zephyriot/zephyr,sharronliu/zephyr,bigdinotech/zephyr,coldnew/zephyr-project-fork,runchip/zephyr-cc3200,holtmann/zephyr,nashif/zephyr,sharronliu/zephyr,erwango/zephyr,zephyrproject-rtos/zephyr,bboozzoo/zephyr,Vudentz/zephyr,pklazy/zephyr,mbolivar/zephyr,32bitmicro/zephyr,runchip/zephyr-cc3220,erwango/zephyr,explora26/zephyr,bboozzoo/zephyr,fractalclone/zephyr-riscv,tidyjiang8/zephyr-doc,zephyriot/zephyr,nashif/zephyr,coldnew/zephyr-project-fork,jamesonwilliams/zephyr-kernel,32bitmicro/zephyr,finikorg/zephyr,kraj/zephyr,mbolivar/zephyr,aceofall/zephyr-iotos,fractalclone/zephyr-riscv,erwango/zephyr,ldts/zephyr,bigdinotech/zephyr,zephyriot/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,kraj/zephyr,runchip/zephyr-cc3200,Vudentz/zephyr,Vudentz/zephyr,mirzak/zephyr-os,runchip/zephyr-cc3200,sharronliu/zephyr,runchip/zephyr-cc3220,ldts/zephyr,fbsder/zephyr,finikorg/zephyr,GiulianoFranchetto/zephyr,ldts/zephyr,rsalveti/zephyr,aceofall/zephyr-iotos,ldts/zephyr,coldnew/zephyr-project-fork,kraj/zephyr,galak/zephyr,rsalveti/zephyr,aceofall/zephyr-iotos,tidyjiang8/zephyr-doc,rsalveti/zephyr,tidyjiang8/zephyr-doc,jamesonwilliams/zephyr-kernel,rsalveti/zephyr,runchip/zephyr-cc3200,GiulianoFranchetto/zephyr,mbolivar/zephyr,punitvara/zephyr,zephyrproject-rtos/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,punitvara/zephyr,pklazy/zephyr,holtmann/zephyr,pklazy/zephyr,32bitmicro/zephyr,jamesonwilliams/zephyr-kernel,runchip/zephyr-cc3220