mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
scsi: fnic: Add and integrate support for FDMI
Add support for Fabric-Device Management Interface (FDMI) by introducing PCI device IDs for Cisco Hardware. Introduce a module parameter to enable/disable FDMI support. Integrate support for FDMI. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202406110734.p2v8dq9v-lkp@intel.com/ Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Co-developed-by: Gian Carlo Boffa <gcboffa@cisco.com> Signed-off-by: Gian Carlo Boffa <gcboffa@cisco.com> Co-developed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Signed-off-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Co-developed-by: Arun Easi <aeasi@cisco.com> Signed-off-by: Arun Easi <aeasi@cisco.com> Co-developed-by: Karan Tilak Kumar <kartilak@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-8-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
2c77081969
commit
09c1e6ab4a
File diff suppressed because it is too large
Load Diff
@@ -205,6 +205,7 @@ static inline u64 fnic_flags_and_state(struct scsi_cmnd *cmd)
|
||||
#define fnic_clear_state_flags(fnicp, st_flags) \
|
||||
__fnic_set_state_flags(fnicp, st_flags, 1)
|
||||
|
||||
extern unsigned int fnic_fdmi_support;
|
||||
extern unsigned int fnic_log_level;
|
||||
extern unsigned int io_completions;
|
||||
extern struct workqueue_struct *fnic_event_queue;
|
||||
|
||||
@@ -64,6 +64,9 @@ unsigned int fnic_log_level;
|
||||
module_param(fnic_log_level, int, S_IRUGO|S_IWUSR);
|
||||
MODULE_PARM_DESC(fnic_log_level, "bit mask of fnic logging levels");
|
||||
|
||||
unsigned int fnic_fdmi_support = 1;
|
||||
module_param(fnic_fdmi_support, int, 0644);
|
||||
MODULE_PARM_DESC(fnic_fdmi_support, "FDMI support");
|
||||
|
||||
unsigned int io_completions = FNIC_DFLT_IO_COMPLETIONS;
|
||||
module_param(io_completions, int, S_IRUGO|S_IWUSR);
|
||||
@@ -612,6 +615,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
unsigned long flags;
|
||||
int hwq;
|
||||
char *desc, *subsys_desc;
|
||||
int len;
|
||||
|
||||
/*
|
||||
* Allocate SCSI Host and set up association between host,
|
||||
@@ -646,9 +650,17 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
fnic_stats_debugfs_init(fnic);
|
||||
|
||||
/* Find model name from PCIe subsys ID */
|
||||
if (fnic_get_desc_by_devid(pdev, &desc, &subsys_desc) == 0)
|
||||
if (fnic_get_desc_by_devid(pdev, &desc, &subsys_desc) == 0) {
|
||||
dev_info(&fnic->pdev->dev, "Model: %s\n", subsys_desc);
|
||||
else {
|
||||
|
||||
/* Update FDMI model */
|
||||
fnic->subsys_desc_len = strlen(subsys_desc);
|
||||
len = ARRAY_SIZE(fnic->subsys_desc);
|
||||
if (fnic->subsys_desc_len > len)
|
||||
fnic->subsys_desc_len = len;
|
||||
memcpy(fnic->subsys_desc, subsys_desc, fnic->subsys_desc_len);
|
||||
dev_info(&fnic->pdev->dev, "FDMI Model: %s\n", fnic->subsys_desc);
|
||||
} else {
|
||||
fnic->subsys_desc_len = 0;
|
||||
dev_info(&fnic->pdev->dev, "Model: %s subsys_id: 0x%04x\n", "Unknown",
|
||||
pdev->subsystem_device);
|
||||
@@ -1051,6 +1063,9 @@ static void fnic_remove(struct pci_dev *pdev)
|
||||
fnic_fcoe_evlist_free(fnic);
|
||||
}
|
||||
|
||||
if ((fnic_fdmi_support == 1) && (fnic->iport.fabric.fdmi_pending > 0))
|
||||
del_timer_sync(&fnic->iport.fabric.fdmi_timer);
|
||||
|
||||
/*
|
||||
* Log off the fabric. This stops all remote ports, dns port,
|
||||
* logs off the fabric. This flushes all rport, disc, lport work
|
||||
|
||||
Reference in New Issue
Block a user