Skip to content

Commit a5b168e

Browse files
bgrovemartinkpetersen
authored andcommitted
scsi: lpfc: Add support for ATTO Fibre Channel devices
Update pci_device_id table and generate reporting strings for ATTO Celerity and ThunderLink Fibre Channel devices. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: James Smart <[email protected]> Co-developed-by: Jason Seba <[email protected]> Signed-off-by: Jason Seba <[email protected]> Signed-off-by: Bradley Grove <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent b3bc1a8 commit a5b168e

File tree

3 files changed

+141
-0
lines changed

3 files changed

+141
-0
lines changed

drivers/scsi/lpfc/lpfc_hw.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,28 @@ struct lpfc_fdmi_reg_portattr {
17361736
#define PCI_DEVICE_ID_TOMCAT 0x0714
17371737
#define PCI_DEVICE_ID_SKYHAWK 0x0724
17381738
#define PCI_DEVICE_ID_SKYHAWK_VF 0x072c
1739+
#define PCI_VENDOR_ID_ATTO 0x117c
1740+
#define PCI_DEVICE_ID_CLRY_16XE 0x0064
1741+
#define PCI_DEVICE_ID_CLRY_161E 0x0063
1742+
#define PCI_DEVICE_ID_CLRY_162E 0x0064
1743+
#define PCI_DEVICE_ID_CLRY_164E 0x0065
1744+
#define PCI_DEVICE_ID_CLRY_16XP 0x0094
1745+
#define PCI_DEVICE_ID_CLRY_161P 0x00a0
1746+
#define PCI_DEVICE_ID_CLRY_162P 0x0094
1747+
#define PCI_DEVICE_ID_CLRY_164P 0x00a1
1748+
#define PCI_DEVICE_ID_CLRY_32XE 0x0094
1749+
#define PCI_DEVICE_ID_CLRY_321E 0x00a2
1750+
#define PCI_DEVICE_ID_CLRY_322E 0x00a3
1751+
#define PCI_DEVICE_ID_CLRY_324E 0x00ac
1752+
#define PCI_DEVICE_ID_CLRY_32XP 0x00bb
1753+
#define PCI_DEVICE_ID_CLRY_321P 0x00bc
1754+
#define PCI_DEVICE_ID_CLRY_322P 0x00bd
1755+
#define PCI_DEVICE_ID_CLRY_324P 0x00be
1756+
#define PCI_DEVICE_ID_TLFC_2 0x0064
1757+
#define PCI_DEVICE_ID_TLFC_2XX2 0x4064
1758+
#define PCI_DEVICE_ID_TLFC_3 0x0094
1759+
#define PCI_DEVICE_ID_TLFC_3162 0x40a6
1760+
#define PCI_DEVICE_ID_TLFC_3322 0x40a7
17391761

17401762
#define JEDEC_ID_ADDRESS 0x0080001c
17411763
#define FIREFLY_JEDEC_ID 0x1ACC

drivers/scsi/lpfc/lpfc_ids.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,35 @@ const struct pci_device_id lpfc_id_table[] = {
124124
PCI_ANY_ID, PCI_ANY_ID, },
125125
{PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_SKYHAWK_VF,
126126
PCI_ANY_ID, PCI_ANY_ID, },
127+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_16XE,
128+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_161E, },
129+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_16XE,
130+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_162E, },
131+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_16XE,
132+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_164E, },
133+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_16XP,
134+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_161P, },
135+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_16XP,
136+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_162P, },
137+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_16XP,
138+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_164P, },
139+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_32XE,
140+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_321E, },
141+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_32XE,
142+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_322E, },
143+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_32XE,
144+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_324E, },
145+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_32XP,
146+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_321P, },
147+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_32XP,
148+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_322P, },
149+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_32XP,
150+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_CLRY_324P, },
151+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_TLFC_2,
152+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_TLFC_2XX2, },
153+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_TLFC_3,
154+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_TLFC_3162, },
155+
{PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_TLFC_3,
156+
PCI_VENDOR_ID_ATTO, PCI_DEVICE_ID_TLFC_3322, },
127157
{ 0 }
128158
};

drivers/scsi/lpfc/lpfc_init.c

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2414,6 +2414,90 @@ lpfc_parse_vpd(struct lpfc_hba *phba, uint8_t *vpd, int len)
24142414
return(1);
24152415
}
24162416

2417+
/**
2418+
* lpfc_get_atto_model_desc - Retrieve ATTO HBA device model name and description
2419+
* @phba: pointer to lpfc hba data structure.
2420+
* @mdp: pointer to the data structure to hold the derived model name.
2421+
* @descp: pointer to the data structure to hold the derived description.
2422+
*
2423+
* This routine retrieves HBA's description based on its registered PCI device
2424+
* ID. The @descp passed into this function points to an array of 256 chars. It
2425+
* shall be returned with the model name, maximum speed, and the host bus type.
2426+
* The @mdp passed into this function points to an array of 80 chars. When the
2427+
* function returns, the @mdp will be filled with the model name.
2428+
**/
2429+
static void
2430+
lpfc_get_atto_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp)
2431+
{
2432+
uint16_t sub_dev_id = phba->pcidev->subsystem_device;
2433+
char *model = "<Unknown>";
2434+
int tbolt = 0;
2435+
2436+
switch (sub_dev_id) {
2437+
case PCI_DEVICE_ID_CLRY_161E:
2438+
model = "161E";
2439+
break;
2440+
case PCI_DEVICE_ID_CLRY_162E:
2441+
model = "162E";
2442+
break;
2443+
case PCI_DEVICE_ID_CLRY_164E:
2444+
model = "164E";
2445+
break;
2446+
case PCI_DEVICE_ID_CLRY_161P:
2447+
model = "161P";
2448+
break;
2449+
case PCI_DEVICE_ID_CLRY_162P:
2450+
model = "162P";
2451+
break;
2452+
case PCI_DEVICE_ID_CLRY_164P:
2453+
model = "164P";
2454+
break;
2455+
case PCI_DEVICE_ID_CLRY_321E:
2456+
model = "321E";
2457+
break;
2458+
case PCI_DEVICE_ID_CLRY_322E:
2459+
model = "322E";
2460+
break;
2461+
case PCI_DEVICE_ID_CLRY_324E:
2462+
model = "324E";
2463+
break;
2464+
case PCI_DEVICE_ID_CLRY_321P:
2465+
model = "321P";
2466+
break;
2467+
case PCI_DEVICE_ID_CLRY_322P:
2468+
model = "322P";
2469+
break;
2470+
case PCI_DEVICE_ID_CLRY_324P:
2471+
model = "324P";
2472+
break;
2473+
case PCI_DEVICE_ID_TLFC_2XX2:
2474+
model = "2XX2";
2475+
tbolt = 1;
2476+
break;
2477+
case PCI_DEVICE_ID_TLFC_3162:
2478+
model = "3162";
2479+
tbolt = 1;
2480+
break;
2481+
case PCI_DEVICE_ID_TLFC_3322:
2482+
model = "3322";
2483+
tbolt = 1;
2484+
break;
2485+
default:
2486+
model = "Unknown";
2487+
break;
2488+
}
2489+
2490+
if (mdp && mdp[0] == '\0')
2491+
snprintf(mdp, 79, "%s", model);
2492+
2493+
if (descp && descp[0] == '\0')
2494+
snprintf(descp, 255,
2495+
"ATTO %s%s, Fibre Channel Adapter Initiator, Port %s",
2496+
(tbolt) ? "ThunderLink FC " : "Celerity FC-",
2497+
model,
2498+
phba->Port);
2499+
}
2500+
24172501
/**
24182502
* lpfc_get_hba_model_desc - Retrieve HBA device model name and description
24192503
* @phba: pointer to lpfc hba data structure.
@@ -2444,6 +2528,11 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp)
24442528
&& descp && descp[0] != '\0')
24452529
return;
24462530

2531+
if (phba->pcidev->vendor == PCI_VENDOR_ID_ATTO) {
2532+
lpfc_get_atto_model_desc(phba, mdp, descp);
2533+
return;
2534+
}
2535+
24472536
if (phba->lmt & LMT_64Gb)
24482537
max_speed = 64;
24492538
else if (phba->lmt & LMT_32Gb)

0 commit comments

Comments
 (0)