[SCSI] lpfc 8.3.24: Extended hardware support and support dump images
Extended hardware support and support dump images: - Make the size to be MAILBOX_SYSFS_MAX (4096) so that it allows the maximum sysfs binary access interface possible. - Add ids and model names for new hardware - Add capability of inducing SLI4 firmware dump obj file Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <jbottomley@parallels.com>
This commit is contained in:
parent
0558056c1e
commit
c0c1151276
@ -754,6 +754,61 @@ lpfc_issue_reset(struct device *dev, struct device_attribute *attr,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* lpfc_sli4_fw_dump_request - Request firmware to perform a firmware dump
|
||||||
|
* @phba: lpfc_hba pointer.
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Request SLI4 interface type-2 device to perform a dump of firmware dump
|
||||||
|
* object into it's /dbg directory of the flash file system.
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* zero for success
|
||||||
|
**/
|
||||||
|
static ssize_t
|
||||||
|
lpfc_sli4_fw_dump_request(struct lpfc_hba *phba)
|
||||||
|
{
|
||||||
|
struct completion online_compl;
|
||||||
|
uint32_t reg_val;
|
||||||
|
int status = 0;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
if (!phba->cfg_enable_hba_reset)
|
||||||
|
return -EIO;
|
||||||
|
|
||||||
|
status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE);
|
||||||
|
|
||||||
|
if (status != 0)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
/* wait for the device to be quiesced before firmware reset */
|
||||||
|
msleep(100);
|
||||||
|
|
||||||
|
reg_val = readl(phba->sli4_hba.conf_regs_memmap_p +
|
||||||
|
LPFC_CTL_PDEV_CTL_OFFSET);
|
||||||
|
reg_val |= LPFC_FW_DUMP_REQUEST;
|
||||||
|
writel(reg_val, phba->sli4_hba.conf_regs_memmap_p +
|
||||||
|
LPFC_CTL_PDEV_CTL_OFFSET);
|
||||||
|
/* flush */
|
||||||
|
readl(phba->sli4_hba.conf_regs_memmap_p + LPFC_CTL_PDEV_CTL_OFFSET);
|
||||||
|
|
||||||
|
/* delay driver action following IF_TYPE_2 reset */
|
||||||
|
msleep(100);
|
||||||
|
|
||||||
|
init_completion(&online_compl);
|
||||||
|
rc = lpfc_workq_post_event(phba, &status, &online_compl,
|
||||||
|
LPFC_EVT_ONLINE);
|
||||||
|
if (rc == 0)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
wait_for_completion(&online_compl);
|
||||||
|
|
||||||
|
if (status != 0)
|
||||||
|
return -EIO;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* lpfc_nport_evt_cnt_show - Return the number of nport events
|
* lpfc_nport_evt_cnt_show - Return the number of nport events
|
||||||
* @dev: class device that is converted into a Scsi_host.
|
* @dev: class device that is converted into a Scsi_host.
|
||||||
@ -848,6 +903,13 @@ lpfc_board_mode_store(struct device *dev, struct device_attribute *attr,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
else
|
else
|
||||||
status = lpfc_do_offline(phba, LPFC_EVT_KILL);
|
status = lpfc_do_offline(phba, LPFC_EVT_KILL);
|
||||||
|
else if (strncmp(buf, "dump", sizeof("dump") - 1) == 0)
|
||||||
|
if ((phba->sli_rev < LPFC_SLI_REV4) ||
|
||||||
|
(bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) !=
|
||||||
|
LPFC_SLI_INTF_IF_TYPE_2))
|
||||||
|
return -EPERM;
|
||||||
|
else
|
||||||
|
status = lpfc_sli4_fw_dump_request(phba);
|
||||||
else
|
else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@ -3961,7 +4023,7 @@ static struct bin_attribute sysfs_mbox_attr = {
|
|||||||
.name = "mbox",
|
.name = "mbox",
|
||||||
.mode = S_IRUSR | S_IWUSR,
|
.mode = S_IRUSR | S_IWUSR,
|
||||||
},
|
},
|
||||||
.size = MAILBOX_CMD_SIZE,
|
.size = MAILBOX_SYSFS_MAX,
|
||||||
.read = sysfs_mbox_read,
|
.read = sysfs_mbox_read,
|
||||||
.write = sysfs_mbox_write,
|
.write = sysfs_mbox_write,
|
||||||
};
|
};
|
||||||
|
@ -1199,7 +1199,9 @@ typedef struct {
|
|||||||
#define PCI_DEVICE_ID_BALIUS 0xe131
|
#define PCI_DEVICE_ID_BALIUS 0xe131
|
||||||
#define PCI_DEVICE_ID_PROTEUS_PF 0xe180
|
#define PCI_DEVICE_ID_PROTEUS_PF 0xe180
|
||||||
#define PCI_DEVICE_ID_LANCER_FC 0xe200
|
#define PCI_DEVICE_ID_LANCER_FC 0xe200
|
||||||
|
#define PCI_DEVICE_ID_LANCER_FC_VF 0xe208
|
||||||
#define PCI_DEVICE_ID_LANCER_FCOE 0xe260
|
#define PCI_DEVICE_ID_LANCER_FCOE 0xe260
|
||||||
|
#define PCI_DEVICE_ID_LANCER_FCOE_VF 0xe268
|
||||||
#define PCI_DEVICE_ID_SAT_SMB 0xf011
|
#define PCI_DEVICE_ID_SAT_SMB 0xf011
|
||||||
#define PCI_DEVICE_ID_SAT_MID 0xf015
|
#define PCI_DEVICE_ID_SAT_MID 0xf015
|
||||||
#define PCI_DEVICE_ID_RFLY 0xf095
|
#define PCI_DEVICE_ID_RFLY 0xf095
|
||||||
@ -3021,7 +3023,7 @@ typedef struct {
|
|||||||
#define MAILBOX_EXT_SIZE (MAILBOX_EXT_WSIZE * sizeof(uint32_t))
|
#define MAILBOX_EXT_SIZE (MAILBOX_EXT_WSIZE * sizeof(uint32_t))
|
||||||
#define MAILBOX_HBA_EXT_OFFSET 0x100
|
#define MAILBOX_HBA_EXT_OFFSET 0x100
|
||||||
/* max mbox xmit size is a page size for sysfs IO operations */
|
/* max mbox xmit size is a page size for sysfs IO operations */
|
||||||
#define MAILBOX_MAX_XMIT_SIZE PAGE_SIZE
|
#define MAILBOX_SYSFS_MAX 4096
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
uint32_t varWords[MAILBOX_CMD_WSIZE - 1]; /* first word is type/
|
uint32_t varWords[MAILBOX_CMD_WSIZE - 1]; /* first word is type/
|
||||||
|
@ -170,6 +170,25 @@ struct lpfc_sli_intf {
|
|||||||
#define LPFC_PCI_FUNC3 3
|
#define LPFC_PCI_FUNC3 3
|
||||||
#define LPFC_PCI_FUNC4 4
|
#define LPFC_PCI_FUNC4 4
|
||||||
|
|
||||||
|
/* SLI4 interface type-2 control register offsets */
|
||||||
|
#define LPFC_CTL_PORT_SEM_OFFSET 0x400
|
||||||
|
#define LPFC_CTL_PORT_STA_OFFSET 0x404
|
||||||
|
#define LPFC_CTL_PORT_CTL_OFFSET 0x408
|
||||||
|
#define LPFC_CTL_PORT_ER1_OFFSET 0x40C
|
||||||
|
#define LPFC_CTL_PORT_ER2_OFFSET 0x410
|
||||||
|
#define LPFC_CTL_PDEV_CTL_OFFSET 0x414
|
||||||
|
|
||||||
|
/* Some SLI4 interface type-2 PDEV_CTL register bits */
|
||||||
|
#define LPFC_CTL_PDEV_CTL_DRST 0x00000001
|
||||||
|
#define LPFC_CTL_PDEV_CTL_FRST 0x00000002
|
||||||
|
#define LPFC_CTL_PDEV_CTL_DD 0x00000004
|
||||||
|
#define LPFC_CTL_PDEV_CTL_LC 0x00000008
|
||||||
|
#define LPFC_CTL_PDEV_CTL_FRL_ALL 0x00
|
||||||
|
#define LPFC_CTL_PDEV_CTL_FRL_FC_FCOE 0x10
|
||||||
|
#define LPFC_CTL_PDEV_CTL_FRL_NIC 0x20
|
||||||
|
|
||||||
|
#define LPFC_FW_DUMP_REQUEST (LPFC_CTL_PDEV_CTL_DD | LPFC_CTL_PDEV_CTL_FRST)
|
||||||
|
|
||||||
/* Active interrupt test count */
|
/* Active interrupt test count */
|
||||||
#define LPFC_ACT_INTR_CNT 4
|
#define LPFC_ACT_INTR_CNT 4
|
||||||
|
|
||||||
|
@ -1784,7 +1784,9 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp)
|
|||||||
&& descp && descp[0] != '\0')
|
&& descp && descp[0] != '\0')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (phba->lmt & LMT_10Gb)
|
if (phba->lmt & LMT_16Gb)
|
||||||
|
max_speed = 16;
|
||||||
|
else if (phba->lmt & LMT_10Gb)
|
||||||
max_speed = 10;
|
max_speed = 10;
|
||||||
else if (phba->lmt & LMT_8Gb)
|
else if (phba->lmt & LMT_8Gb)
|
||||||
max_speed = 8;
|
max_speed = 8;
|
||||||
@ -1951,12 +1953,13 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp)
|
|||||||
"Fibre Channel Adapter"};
|
"Fibre Channel Adapter"};
|
||||||
break;
|
break;
|
||||||
case PCI_DEVICE_ID_LANCER_FC:
|
case PCI_DEVICE_ID_LANCER_FC:
|
||||||
oneConnect = 1;
|
case PCI_DEVICE_ID_LANCER_FC_VF:
|
||||||
m = (typeof(m)){"Undefined", "PCIe", "Fibre Channel Adapter"};
|
m = (typeof(m)){"LPe16000", "PCIe", "Fibre Channel Adapter"};
|
||||||
break;
|
break;
|
||||||
case PCI_DEVICE_ID_LANCER_FCOE:
|
case PCI_DEVICE_ID_LANCER_FCOE:
|
||||||
|
case PCI_DEVICE_ID_LANCER_FCOE_VF:
|
||||||
oneConnect = 1;
|
oneConnect = 1;
|
||||||
m = (typeof(m)){"Undefined", "PCIe", "FCoE"};
|
m = (typeof(m)){"OCe50100", "PCIe", "FCoE"};
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
m = (typeof(m)){"Unknown", "", ""};
|
m = (typeof(m)){"Unknown", "", ""};
|
||||||
@ -1965,7 +1968,8 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp)
|
|||||||
|
|
||||||
if (mdp && mdp[0] == '\0')
|
if (mdp && mdp[0] == '\0')
|
||||||
snprintf(mdp, 79,"%s", m.name);
|
snprintf(mdp, 79,"%s", m.name);
|
||||||
/* oneConnect hba requires special processing, they are all initiators
|
/*
|
||||||
|
* oneConnect hba requires special processing, they are all initiators
|
||||||
* and we put the port number on the end
|
* and we put the port number on the end
|
||||||
*/
|
*/
|
||||||
if (descp && descp[0] == '\0') {
|
if (descp && descp[0] == '\0') {
|
||||||
@ -9580,6 +9584,10 @@ static struct pci_device_id lpfc_id_table[] = {
|
|||||||
PCI_ANY_ID, PCI_ANY_ID, },
|
PCI_ANY_ID, PCI_ANY_ID, },
|
||||||
{PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LANCER_FCOE,
|
{PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LANCER_FCOE,
|
||||||
PCI_ANY_ID, PCI_ANY_ID, },
|
PCI_ANY_ID, PCI_ANY_ID, },
|
||||||
|
{PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LANCER_FC_VF,
|
||||||
|
PCI_ANY_ID, PCI_ANY_ID, },
|
||||||
|
{PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LANCER_FCOE_VF,
|
||||||
|
PCI_ANY_ID, PCI_ANY_ID, },
|
||||||
{ 0 }
|
{ 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user