Re: [PATCH v3] Bluetooth: vhci: Add support for setting msft_opcode and aosp_capable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Marcel,

On Thu, Oct 14, 2021 at 5:39 AM Marcel Holtmann <marcel@xxxxxxxxxxxx> wrote:
>
> Hi Luiz,
>
> > This adds a debugfs entries to set msft_opcode and aosp_capable enabling
> > vhci to emulate controllers with MSFT/AOSP extension support.
> >
> > Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
> > ---
> > v2: Fix typos: s/extention/extension/g
> > v3: Remove checks for HCI_SETUP, merge changes to introduce MSFT/AOSP support
> > at the same time.
> >
> > drivers/bluetooth/hci_vhci.c | 92 ++++++++++++++++++++++++++++++++++++
> > 1 file changed, 92 insertions(+)
>
> patch has been applied to bluetooth-next tree (with slight modifications).

++<<<<<<< HEAD
 +      hci_set_msft_opcode(hdev, vhci->msft_opcode);
 +      hci_set_aosp_capable(hdev);
++=======
+       if (vhci->msft_opcode)
+               hci_set_msft_opcode(hdev, vhci->msft_opcode);
+
+       if (vhci->aosp_capable)
+               hci_set_aosp_capable(hdev);
++>>>>>>> 9bbbb6a7ad09 (Bluetooth: vhci: Add support for setting
msft_opcode and aosp_capable)

I suspect the above changes won't work if we don't init the fields in
the vhci_data, msft_opcode would be set to 0x0000 so it won't be
enabled anyway but aosp_capable would be enabled which would be out of
sync with vhci->aosp_capable, so perhaps we want to change
hci_set_aosp_capable to take a parameter:

diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 74c0eb28c422..9e67517b6cef 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -264,7 +264,7 @@ static int vhci_setup(struct hci_dev *hdev)
        struct vhci_data *vhci = hci_get_drvdata(hdev);

        hci_set_msft_opcode(hdev, vhci->msft_opcode);
-       hci_set_aosp_capable(hdev);
+       hci_set_aosp_capable(hdev, vhci->aosp_capable);

        return 0;
 }

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index dd8840e70e25..d007b487d4c1 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1279,10 +1279,10 @@ static inline void hci_set_msft_opcode(struct
hci_dev *hdev, __u16 opcode)
 #endif
 }

-static inline void hci_set_aosp_capable(struct hci_dev *hdev)
+static inline void hci_set_aosp_capable(struct hci_dev *hdev, bool enable)
 {
 #if IS_ENABLED(CONFIG_BT_AOSPEXT)
-       hdev->aosp_capable = true;
+       hdev->aosp_capable = enable;
 #endif
 }


> Regards
>
> Marcel
>


-- 
Luiz Augusto von Dentz



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux