mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
linux-can-fixes-for-6.16-20250725
-----BEGIN PGP SIGNATURE----- iQFHBAABCgAxFiEEn/sM2K9nqF/8FWzzDHRl3/mQkZwFAmiDWKITHG1rbEBwZW5n dXRyb25peC5kZQAKCRAMdGXf+ZCRnNZIB/9J/BEgGSc64qbh9rIEdGr1Tgv4SQW1 yvVbcoGOby6l9RosZV1reM7qD+LAnaujWggMyqN48X9QHY5TlkYDZQrLpfK37ju5 ZQS7PSpXuN5qleU1LJyi9qG3X7rJFWeBbLyjtNauJKGZ8XpE8u/LL74w3u/CKFmq NwUkjRkAGwW7LHihB1H4WPZFzvnnYAfnltpSXfI7ao9uoNvceC0OhMa4RgTsCSOH 3cb5/vhu7YoUGd1UJP1AYYjGLITdyd6W19Vg2KIyxOuN605O0OG1ZUinqu9ZM17U xzTcZwngFhR5fKm6fx09Vn0osmVYLmfc0TnuYmJvLSQh9aONtb/FJLyt =tQ5R -----END PGP SIGNATURE----- Merge tag 'linux-can-fixes-for-6.16-20250725' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2025-07-25 The patch is by Stephane Grosjean and adds support the recent firmware of USB CAN FD interfaces to the peak_usb driver. * tag 'linux-can-fixes-for-6.16-20250725' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: peak_usb: fix USB FD devices potential malfunction ==================== Link: https://patch.msgid.link/20250725101619.4095105-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
eccf7a3480
|
|
@ -49,7 +49,7 @@ struct __packed pcan_ufd_fw_info {
|
|||
__le32 ser_no; /* S/N */
|
||||
__le32 flags; /* special functions */
|
||||
|
||||
/* extended data when type == PCAN_USBFD_TYPE_EXT */
|
||||
/* extended data when type >= PCAN_USBFD_TYPE_EXT */
|
||||
u8 cmd_out_ep; /* ep for cmd */
|
||||
u8 cmd_in_ep; /* ep for replies */
|
||||
u8 data_out_ep[2]; /* ep for CANx TX */
|
||||
|
|
@ -982,10 +982,11 @@ static int pcan_usb_fd_init(struct peak_usb_device *dev)
|
|||
dev->can.ctrlmode |= CAN_CTRLMODE_FD_NON_ISO;
|
||||
}
|
||||
|
||||
/* if vendor rsp is of type 2, then it contains EP numbers to
|
||||
* use for cmds pipes. If not, then default EP should be used.
|
||||
/* if vendor rsp type is greater than or equal to 2, then it
|
||||
* contains EP numbers to use for cmds pipes. If not, then
|
||||
* default EP should be used.
|
||||
*/
|
||||
if (fw_info->type != cpu_to_le16(PCAN_USBFD_TYPE_EXT)) {
|
||||
if (le16_to_cpu(fw_info->type) < PCAN_USBFD_TYPE_EXT) {
|
||||
fw_info->cmd_out_ep = PCAN_USBPRO_EP_CMDOUT;
|
||||
fw_info->cmd_in_ep = PCAN_USBPRO_EP_CMDIN;
|
||||
}
|
||||
|
|
@ -1018,11 +1019,11 @@ static int pcan_usb_fd_init(struct peak_usb_device *dev)
|
|||
dev->can_channel_id =
|
||||
le32_to_cpu(pdev->usb_if->fw_info.dev_id[dev->ctrl_idx]);
|
||||
|
||||
/* if vendor rsp is of type 2, then it contains EP numbers to
|
||||
* use for data pipes. If not, then statically defined EP are used
|
||||
* (see peak_usb_create_dev()).
|
||||
/* if vendor rsp type is greater than or equal to 2, then it contains EP
|
||||
* numbers to use for data pipes. If not, then statically defined EP are
|
||||
* used (see peak_usb_create_dev()).
|
||||
*/
|
||||
if (fw_info->type == cpu_to_le16(PCAN_USBFD_TYPE_EXT)) {
|
||||
if (le16_to_cpu(fw_info->type) >= PCAN_USBFD_TYPE_EXT) {
|
||||
dev->ep_msg_in = fw_info->data_in_ep;
|
||||
dev->ep_msg_out = fw_info->data_out_ep[dev->ctrl_idx];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user