From 906b1c83689506d936822288cca464c742110bbd Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Mon, 6 Mar 2023 14:31:25 +0300 Subject: [PATCH] qla2x00t-32gbit: Port to Linux kernel v6.3 Support for the following fc changes in the Linux kernel v6.3: - 64fd2ba977b1 ("scsi: scsi_transport_fc: Add an additional flag to fc_host_fpin_rcv()") --- qla2x00t-32gbit/qla_isr.c | 2 +- scst/include/backport.h | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/qla2x00t-32gbit/qla_isr.c b/qla2x00t-32gbit/qla_isr.c index 36a3d995a..a21684057 100644 --- a/qla2x00t-32gbit/qla_isr.c +++ b/qla2x00t-32gbit/qla_isr.c @@ -57,7 +57,7 @@ qla27xx_process_purex_fpin(struct scsi_qla_host *vha, struct purex_item *item) ql_dump_buffer(ql_dbg_init + ql_dbg_verbose, vha, 0x508f, pkt, pkt_size); - fc_host_fpin_rcv(vha->host, pkt_size, (char *)pkt); + fc_host_fpin_rcv(vha->host, pkt_size, (char *)pkt, 0); } const char *const port_state_str[] = { diff --git a/scst/include/backport.h b/scst/include/backport.h index c02cf54c1..40f8f1765 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1642,17 +1642,29 @@ enum { #define wwn_to_u64(wwn) get_unaligned_be64(wwn) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) /* - * See also commit c39e0af64bce ("scsi: scsi_transport_fc: Add FPIN fc event - * codes") # v5.2 + * See also commit 64fd2ba977b1 ("scsi: scsi_transport_fc: Add an additional + * flag to fc_host_fpin_rcv()") # v6.3 */ +static inline void +fc_host_fpin_rcv_backport(struct Scsi_Host *shost, u32 fpin_len, char *fpin_buf, + u8 event_acknowledge) +{ #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0) && \ (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \ RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 2) -static inline void -fc_host_fpin_rcv(struct Scsi_Host *shost, u32 fpin_len, char *fpin_buf) -{ + /* + * See also commit c39e0af64bce ("scsi: scsi_transport_fc: Add FPIN fc event + * codes") # v5.2 + */ + return; +#else + return fc_host_fpin_rcv(shost, fpin_len, fpin_buf); +#endif } + +#define fc_host_fpin_rcv fc_host_fpin_rcv_backport #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)