Re: [PATCH] Bluetooth: hci_event: fix MTU for BN == 0 in CIS Established

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

 



Hi,

la, 2025-08-09 kello 11:24 +0200, Paul Menzel kirjoitti:
> Dear Pauli,
> 
> 
> Thank you for the patch.
> 
> Am 09.08.25 um 10:36 schrieb Pauli Virtanen:
> > BN == 0x00 in CIS Established means no isochronous data for the
> > corresponding direction (Core v6.1 pp. 2394). In this case SDU MTU
> > should be 0.
> > 
> > However, the specification does not say the Max_PDU_C_To_P or P_To_C are
> > then zero.  Intel AX210 in Framed CIS mode sets nonzero Max_PDU for
> > direction with zero BN.  This causes failure later when we try to LE
> > Setup ISO Data Path for disabled direction, which is disallowed (Core
> > v6.1 pp. 2750).
> > 
> > Fix by setting SDU MTU to 0 if BN == 0.
> 
> Do you have command how to reproduce this on the device?

As noted in the text above, try to create framed unidirectional CIS on
this particular controller, e.g. for 44.1kHz audio.

> > Fixes: 2be22f1941d5f ("Bluetooth: hci_event: Fix parsing of CIS Established Event")
> > Signed-off-by: Pauli Virtanen <pav@xxxxxx>
> > ---
> >   net/bluetooth/hci_event.c | 8 ++++----
> >   1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> > index 4f0a6116291e..fe7cdd67ad2a 100644
> > --- a/net/bluetooth/hci_event.c
> > +++ b/net/bluetooth/hci_event.c
> > @@ -6745,8 +6745,8 @@ static void hci_le_cis_established_evt(struct hci_dev *hdev, void *data,
> >   		qos->ucast.out.latency =
> >   			DIV_ROUND_CLOSEST(get_unaligned_le24(ev->p_latency),
> >   					  1000);
> > -		qos->ucast.in.sdu = le16_to_cpu(ev->c_mtu);
> > -		qos->ucast.out.sdu = le16_to_cpu(ev->p_mtu);
> > +		qos->ucast.in.sdu = ev->c_bn ? le16_to_cpu(ev->c_mtu) : 0;
> > +		qos->ucast.out.sdu = ev->p_bn ? le16_to_cpu(ev->p_mtu) : 0;
> >   		qos->ucast.in.phy = ev->c_phy;
> >   		qos->ucast.out.phy = ev->p_phy;
> >   		break;
> > @@ -6760,8 +6760,8 @@ static void hci_le_cis_established_evt(struct hci_dev *hdev, void *data,
> >   		qos->ucast.in.latency =
> >   			DIV_ROUND_CLOSEST(get_unaligned_le24(ev->p_latency),
> >   					  1000);
> > -		qos->ucast.out.sdu = le16_to_cpu(ev->c_mtu);
> > -		qos->ucast.in.sdu = le16_to_cpu(ev->p_mtu);
> > +		qos->ucast.out.sdu = ev->c_bn ? le16_to_cpu(ev->c_mtu) : 0;
> > +		qos->ucast.in.sdu = ev->p_bn ? le16_to_cpu(ev->p_mtu) : 0;
> >   		qos->ucast.out.phy = ev->c_phy;
> >   		qos->ucast.in.phy = ev->p_phy;
> >   		break;
> 
> Reviewed-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx>
> 
> 
> Kind regards,
> 
> Paul





[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