]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
usb: f_sdp: Update SDP driver to support PQC container
authorYe Li <ye.li@nxp.com>
Tue, 28 Oct 2025 02:46:26 +0000 (10:46 +0800)
committerFabio Estevam <festevam@nabladev.com>
Tue, 4 Nov 2025 15:39:46 +0000 (12:39 -0300)
Since PQC container has changed version to 0x2 in container header,
update the header's check.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
drivers/usb/gadget/f_sdp.c

index 647001d8dd0c9c843e6a4f34934c28bdbc13315c..f72e27028b7c6c41757fcc1573a06953804a6fab 100644 (file)
@@ -765,7 +765,7 @@ static ulong search_container_header(ulong p, int size)
 
        for (i = 0; i < size; i += 4) {
                hdr = (u8 *)(p + i);
-               if (*(hdr + 3) == 0x87 && *hdr == 0)
+               if (*(hdr + 3) == 0x87 && (*hdr == 0 || *hdr == 2))
                        if (*(hdr + 1) != 0 || *(hdr + 2) != 0)
                                return p + i;
        }