RE: [PATCH v1] Bluetooth: btintel: Print Firmware Sequencer information

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

 



Hi Luiz,

> -----Original Message-----
> From: Luiz Augusto von Dentz <luiz.dentz@xxxxxxxxx>
> Sent: Tuesday, February 13, 2024 9:40 PM
> To: K, Kiran <kiran.k@xxxxxxxxx>
> Cc: linux-bluetooth@xxxxxxxxxxxxxxx; Srivatsa, Ravishankar
> <ravishankar.srivatsa@xxxxxxxxx>; Tumkur Narayan, Chethan
> <chethan.tumkur.narayan@xxxxxxxxx>
> Subject: Re: [PATCH v1] Bluetooth: btintel: Print Firmware Sequencer
> information
> 
> Hi Kiran,
> 
> On Tue, Feb 13, 2024 at 10:51 AM Kiran K <kiran.k@xxxxxxxxx> wrote:
> >
> > Firmware sequencer(FSEQ) is a common code shared across Bluetooth and
> > Wifi. Printing FSEQ will help to debug if there is any mismatch
> > between Bluetooth and Wifi FSEQ.
> >
> > Signed-off-by: Kiran K <kiran.k@xxxxxxxxx>
> > ---
> >  drivers/bluetooth/btintel.c | 106
> > ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 106 insertions(+)
> >
> > diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
> > index e5b043d96207..0d067ee39408 100644
> > --- a/drivers/bluetooth/btintel.c
> > +++ b/drivers/bluetooth/btintel.c
> > @@ -2670,6 +2670,111 @@ static void btintel_set_msft_opcode(struct
> hci_dev *hdev, u8 hw_variant)
> >         }
> >  }
> >
> > +static void btintel_print_fseq_info(struct hci_dev *hdev) {
> > +       struct sk_buff *skb;
> > +       u8 *p;
> > +       const char *str;
> > +
> > +       skb = __hci_cmd_sync(hdev, 0xfcb3, 0, NULL, HCI_CMD_TIMEOUT);
> > +       if (IS_ERR(skb)) {
> > +               bt_dev_dbg(hdev, "Reading fseq status command failed (%ld)",
> > +                          PTR_ERR(skb));
> > +               return;
> > +       }
> > +
> > +       if (skb->len < (sizeof(u32) * 16 + 2)) {
> > +               bt_dev_dbg(hdev, "Malformed packet");
> > +               kfree_skb(skb);
> > +               return;
> > +       }
> > +
> > +       if (skb->data[0]) {
> > +               bt_dev_dbg(hdev, "Failed to get fseq status (0x%2.2x)",
> > +                          skb->data[0]);
> > +               kfree_skb(skb);
> > +               return;
> > +       }
> > +
> > +       p = skb->data;
> > +       /* skip status */
> > +       p = p + 1;
> 
> How about we use skb_pull_data instead of accessing these fields with a
> pointer cursor?

I will fix it in v2 version of patch.

> 
> > +       switch (*p) {

Thanks,
Kiran





[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