aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrakash, Sathya <sathya.prakash@lsi.com>2007-07-17 04:48:41 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-07-18 12:17:25 -0400
commitef1d8df72fce074584244a8e3c4ae91606ccd784 (patch)
tree83bead6af09d0d3222459b971bb60de04be05a02
parent57ce21bfccaf3b24296f1e097682177e49017a57 (diff)
[SCSI] mpt fusion: add support for Brocade branded LSI FC HBA
Add support for Brocade 410/420 4Gbit FC HBAs. They are re-branded LSI HBAs [LSI7104EP-LC/LSI7204EP-LC] Signed-off-by: Sathya Prakash <sathya.prakash@lsi.com> Acked-by: "Moore, Eric" <Eric.Moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r--drivers/message/fusion/mptbase.c337
-rw-r--r--drivers/message/fusion/mptbase.h2
-rw-r--r--drivers/message/fusion/mptfc.c2
3 files changed, 278 insertions, 63 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 9d29ee62b6eb..04f75e24dcec 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1132,6 +1132,248 @@ mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp)
1132 return -1; 1132 return -1;
1133} 1133}
1134 1134
1135/**
1136 * mpt_get_product_name - returns product string
1137 * @vendor: pci vendor id
1138 * @device: pci device id
1139 * @revision: pci revision id
1140 * @prod_name: string returned
1141 *
1142 * Returns product string displayed when driver loads,
1143 * in /proc/mpt/summary and /sysfs/class/scsi_host/host<X>/version_product
1144 *
1145 **/
1146static void
1147mpt_get_product_name(u16 vendor, u16 device, u8 revision, char *prod_name)
1148{
1149 char *product_str = NULL;
1150
1151 if (vendor == PCI_VENDOR_ID_BROCADE) {
1152 switch (device)
1153 {
1154 case MPI_MANUFACTPAGE_DEVICEID_FC949E:
1155 switch (revision)
1156 {
1157 case 0x00:
1158 product_str = "BRE040 A0";
1159 break;
1160 case 0x01:
1161 product_str = "BRE040 A1";
1162 break;
1163 default:
1164 product_str = "BRE040";
1165 break;
1166 }
1167 break;
1168 }
1169 goto out;
1170 }
1171
1172 switch (device)
1173 {
1174 case MPI_MANUFACTPAGE_DEVICEID_FC909:
1175 product_str = "LSIFC909 B1";
1176 break;
1177 case MPI_MANUFACTPAGE_DEVICEID_FC919:
1178 product_str = "LSIFC919 B0";
1179 break;
1180 case MPI_MANUFACTPAGE_DEVICEID_FC929:
1181 product_str = "LSIFC929 B0";
1182 break;
1183 case MPI_MANUFACTPAGE_DEVICEID_FC919X:
1184 if (revision < 0x80)
1185 product_str = "LSIFC919X A0";
1186 else
1187 product_str = "LSIFC919XL A1";
1188 break;
1189 case MPI_MANUFACTPAGE_DEVICEID_FC929X:
1190 if (revision < 0x80)
1191 product_str = "LSIFC929X A0";
1192 else
1193 product_str = "LSIFC929XL A1";
1194 break;
1195 case MPI_MANUFACTPAGE_DEVICEID_FC939X:
1196 product_str = "LSIFC939X A1";
1197 break;
1198 case MPI_MANUFACTPAGE_DEVICEID_FC949X:
1199 product_str = "LSIFC949X A1";
1200 break;
1201 case MPI_MANUFACTPAGE_DEVICEID_FC949E:
1202 switch (revision)
1203 {
1204 case 0x00:
1205 product_str = "LSIFC949E A0";
1206 break;
1207 case 0x01:
1208 product_str = "LSIFC949E A1";
1209 break;
1210 default:
1211 product_str = "LSIFC949E";
1212 break;
1213 }
1214 break;
1215 case MPI_MANUFACTPAGE_DEVID_53C1030:
1216 switch (revision)
1217 {
1218 case 0x00:
1219 product_str = "LSI53C1030 A0";
1220 break;
1221 case 0x01:
1222 product_str = "LSI53C1030 B0";
1223 break;
1224 case 0x03:
1225 product_str = "LSI53C1030 B1";
1226 break;
1227 case 0x07:
1228 product_str = "LSI53C1030 B2";
1229 break;
1230 case 0x08:
1231 product_str = "LSI53C1030 C0";
1232 break;
1233 case 0x80:
1234 product_str = "LSI53C1030T A0";
1235 break;
1236 case 0x83:
1237 product_str = "LSI53C1030T A2";
1238 break;
1239 case 0x87:
1240 product_str = "LSI53C1030T A3";
1241 break;
1242 case 0xc1:
1243 product_str = "LSI53C1020A A1";
1244 break;
1245 default:
1246 product_str = "LSI53C1030";
1247 break;
1248 }
1249 break;
1250 case MPI_MANUFACTPAGE_DEVID_1030_53C1035:
1251 switch (revision)
1252 {
1253 case 0x03:
1254 product_str = "LSI53C1035 A2";
1255 break;
1256 case 0x04:
1257 product_str = "LSI53C1035 B0";
1258 break;
1259 default:
1260 product_str = "LSI53C1035";
1261 break;
1262 }
1263 break;
1264 case MPI_MANUFACTPAGE_DEVID_SAS1064:
1265 switch (revision)
1266 {
1267 case 0x00:
1268 product_str = "LSISAS1064 A1";
1269 break;
1270 case 0x01:
1271 product_str = "LSISAS1064 A2";
1272 break;
1273 case 0x02:
1274 product_str = "LSISAS1064 A3";
1275 break;
1276 case 0x03:
1277 product_str = "LSISAS1064 A4";
1278 break;
1279 default:
1280 product_str = "LSISAS1064";
1281 break;
1282 }
1283 break;
1284 case MPI_MANUFACTPAGE_DEVID_SAS1064E:
1285 switch (revision)
1286 {
1287 case 0x00:
1288 product_str = "LSISAS1064E A0";
1289 break;
1290 case 0x01:
1291 product_str = "LSISAS1064E B0";
1292 break;
1293 case 0x02:
1294 product_str = "LSISAS1064E B1";
1295 break;
1296 case 0x04:
1297 product_str = "LSISAS1064E B2";
1298 break;
1299 case 0x08:
1300 product_str = "LSISAS1064E B3";
1301 break;
1302 default:
1303 product_str = "LSISAS1064E";
1304 break;
1305 }
1306 break;
1307 case MPI_MANUFACTPAGE_DEVID_SAS1068:
1308 switch (revision)
1309 {
1310 case 0x00:
1311 product_str = "LSISAS1068 A0";
1312 break;
1313 case 0x01:
1314 product_str = "LSISAS1068 B0";
1315 break;
1316 case 0x02:
1317 product_str = "LSISAS1068 B1";
1318 break;
1319 default:
1320 product_str = "LSISAS1068";
1321 break;
1322 }
1323 break;
1324 case MPI_MANUFACTPAGE_DEVID_SAS1068E:
1325 switch (revision)
1326 {
1327 case 0x00:
1328 product_str = "LSISAS1068E A0";
1329 break;
1330 case 0x01:
1331 product_str = "LSISAS1068E B0";
1332 break;
1333 case 0x02:
1334 product_str = "LSISAS1068E B1";
1335 break;
1336 case 0x04:
1337 product_str = "LSISAS1068E B2";
1338 break;
1339 case 0x08:
1340 product_str = "LSISAS1068E B3";
1341 break;
1342 default:
1343 product_str = "LSISAS1068E";
1344 break;
1345 }
1346 break;
1347 case MPI_MANUFACTPAGE_DEVID_SAS1078:
1348 switch (revision)
1349 {
1350 case 0x00:
1351 product_str = "LSISAS1078 A0";
1352 break;
1353 case 0x01:
1354 product_str = "LSISAS1078 B0";
1355 break;
1356 case 0x02:
1357 product_str = "LSISAS1078 C0";
1358 break;
1359 case 0x03:
1360 product_str = "LSISAS1078 C1";
1361 break;
1362 case 0x04:
1363 product_str = "LSISAS1078 C2";
1364 break;
1365 default:
1366 product_str = "LSISAS1078";
1367 break;
1368 }
1369 break;
1370 }
1371
1372 out:
1373 if (product_str)
1374 sprintf(prod_name, "%s", product_str);
1375}
1376
1135/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1377/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1136/** 1378/**
1137 * mpt_attach - Install a PCI intelligent MPT adapter. 1379 * mpt_attach - Install a PCI intelligent MPT adapter.
@@ -1275,23 +1517,23 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1275 ioc->pio_chip = (SYSIF_REGS __iomem *)pmem; 1517 ioc->pio_chip = (SYSIF_REGS __iomem *)pmem;
1276 } 1518 }
1277 1519
1278 if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC909) { 1520 pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
1279 ioc->prod_name = "LSIFC909"; 1521 mpt_get_product_name(pdev->vendor, pdev->device, revision, ioc->prod_name);
1280 ioc->bus_type = FC; 1522
1281 } 1523 switch (pdev->device)
1282 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC929) { 1524 {
1283 ioc->prod_name = "LSIFC929"; 1525 case MPI_MANUFACTPAGE_DEVICEID_FC939X:
1284 ioc->bus_type = FC; 1526 case MPI_MANUFACTPAGE_DEVICEID_FC949X:
1285 } 1527 ioc->errata_flag_1064 = 1;
1286 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC919) { 1528 case MPI_MANUFACTPAGE_DEVICEID_FC909:
1287 ioc->prod_name = "LSIFC919"; 1529 case MPI_MANUFACTPAGE_DEVICEID_FC929:
1288 ioc->bus_type = FC; 1530 case MPI_MANUFACTPAGE_DEVICEID_FC919:
1289 } 1531 case MPI_MANUFACTPAGE_DEVICEID_FC949E:
1290 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC929X) {
1291 pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
1292 ioc->bus_type = FC; 1532 ioc->bus_type = FC;
1533 break;
1534
1535 case MPI_MANUFACTPAGE_DEVICEID_FC929X:
1293 if (revision < XL_929) { 1536 if (revision < XL_929) {
1294 ioc->prod_name = "LSIFC929X";
1295 /* 929X Chip Fix. Set Split transactions level 1537 /* 929X Chip Fix. Set Split transactions level
1296 * for PCIX. Set MOST bits to zero. 1538 * for PCIX. Set MOST bits to zero.
1297 */ 1539 */
@@ -1299,75 +1541,46 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1299 pcixcmd &= 0x8F; 1541 pcixcmd &= 0x8F;
1300 pci_write_config_byte(pdev, 0x6a, pcixcmd); 1542 pci_write_config_byte(pdev, 0x6a, pcixcmd);
1301 } else { 1543 } else {
1302 ioc->prod_name = "LSIFC929XL";
1303 /* 929XL Chip Fix. Set MMRBC to 0x08. 1544 /* 929XL Chip Fix. Set MMRBC to 0x08.
1304 */ 1545 */
1305 pci_read_config_byte(pdev, 0x6a, &pcixcmd); 1546 pci_read_config_byte(pdev, 0x6a, &pcixcmd);
1306 pcixcmd |= 0x08; 1547 pcixcmd |= 0x08;
1307 pci_write_config_byte(pdev, 0x6a, pcixcmd); 1548 pci_write_config_byte(pdev, 0x6a, pcixcmd);
1308 } 1549 }
1309 }
1310 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC919X) {
1311 ioc->prod_name = "LSIFC919X";
1312 ioc->bus_type = FC; 1550 ioc->bus_type = FC;
1551 break;
1552
1553 case MPI_MANUFACTPAGE_DEVICEID_FC919X:
1313 /* 919X Chip Fix. Set Split transactions level 1554 /* 919X Chip Fix. Set Split transactions level
1314 * for PCIX. Set MOST bits to zero. 1555 * for PCIX. Set MOST bits to zero.
1315 */ 1556 */
1316 pci_read_config_byte(pdev, 0x6a, &pcixcmd); 1557 pci_read_config_byte(pdev, 0x6a, &pcixcmd);
1317 pcixcmd &= 0x8F; 1558 pcixcmd &= 0x8F;
1318 pci_write_config_byte(pdev, 0x6a, pcixcmd); 1559 pci_write_config_byte(pdev, 0x6a, pcixcmd);
1319 }
1320 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC939X) {
1321 ioc->prod_name = "LSIFC939X";
1322 ioc->bus_type = FC;
1323 ioc->errata_flag_1064 = 1;
1324 }
1325 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC949X) {
1326 ioc->prod_name = "LSIFC949X";
1327 ioc->bus_type = FC; 1560 ioc->bus_type = FC;
1328 ioc->errata_flag_1064 = 1; 1561 break;
1329 } 1562
1330 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC949E) { 1563 case MPI_MANUFACTPAGE_DEVID_53C1030:
1331 ioc->prod_name = "LSIFC949E";
1332 ioc->bus_type = FC;
1333 }
1334 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_53C1030) {
1335 ioc->prod_name = "LSI53C1030";
1336 ioc->bus_type = SPI;
1337 /* 1030 Chip Fix. Disable Split transactions 1564 /* 1030 Chip Fix. Disable Split transactions
1338 * for PCIX. Set MOST bits to zero if Rev < C0( = 8). 1565 * for PCIX. Set MOST bits to zero if Rev < C0( = 8).
1339 */ 1566 */
1340 pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
1341 if (revision < C0_1030) { 1567 if (revision < C0_1030) {
1342 pci_read_config_byte(pdev, 0x6a, &pcixcmd); 1568 pci_read_config_byte(pdev, 0x6a, &pcixcmd);
1343 pcixcmd &= 0x8F; 1569 pcixcmd &= 0x8F;
1344 pci_write_config_byte(pdev, 0x6a, pcixcmd); 1570 pci_write_config_byte(pdev, 0x6a, pcixcmd);
1345 } 1571 }
1346 } 1572
1347 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_1030_53C1035) { 1573 case MPI_MANUFACTPAGE_DEVID_1030_53C1035:
1348 ioc->prod_name = "LSI53C1035";
1349 ioc->bus_type = SPI; 1574 ioc->bus_type = SPI;
1350 } 1575 break;
1351 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1064) { 1576
1352 ioc->prod_name = "LSISAS1064"; 1577 case MPI_MANUFACTPAGE_DEVID_SAS1064:
1353 ioc->bus_type = SAS; 1578 case MPI_MANUFACTPAGE_DEVID_SAS1068:
1354 ioc->errata_flag_1064 = 1;
1355 }
1356 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068) {
1357 ioc->prod_name = "LSISAS1068";
1358 ioc->bus_type = SAS;
1359 ioc->errata_flag_1064 = 1; 1579 ioc->errata_flag_1064 = 1;
1360 } 1580
1361 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1064E) { 1581 case MPI_MANUFACTPAGE_DEVID_SAS1064E:
1362 ioc->prod_name = "LSISAS1064E"; 1582 case MPI_MANUFACTPAGE_DEVID_SAS1068E:
1363 ioc->bus_type = SAS; 1583 case MPI_MANUFACTPAGE_DEVID_SAS1078:
1364 }
1365 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068E) {
1366 ioc->prod_name = "LSISAS1068E";
1367 ioc->bus_type = SAS;
1368 }
1369 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) {
1370 ioc->prod_name = "LSISAS1078";
1371 ioc->bus_type = SAS; 1584 ioc->bus_type = SAS;
1372 } 1585 }
1373 1586
@@ -2140,8 +2353,8 @@ MptDisplayIocCapabilities(MPT_ADAPTER *ioc)
2140 int i = 0; 2353 int i = 0;
2141 2354
2142 printk(KERN_INFO "%s: ", ioc->name); 2355 printk(KERN_INFO "%s: ", ioc->name);
2143 if (ioc->prod_name && strlen(ioc->prod_name) > 3) 2356 if (ioc->prod_name)
2144 printk("%s: ", ioc->prod_name+3); 2357 printk("%s: ", ioc->prod_name);
2145 printk("Capabilities={"); 2358 printk("Capabilities={");
2146 2359
2147 if (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR) { 2360 if (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR) {
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index 959d24372d03..98eb9c688e17 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -537,7 +537,7 @@ typedef struct _MPT_ADAPTER
537 int id; /* Unique adapter id N {0,1,2,...} */ 537 int id; /* Unique adapter id N {0,1,2,...} */
538 int pci_irq; /* This irq */ 538 int pci_irq; /* This irq */
539 char name[MPT_NAME_LENGTH]; /* "iocN" */ 539 char name[MPT_NAME_LENGTH]; /* "iocN" */
540 char *prod_name; /* "LSIFC9x9" */ 540 char prod_name[MPT_NAME_LENGTH]; /* "LSIFC9x9" */
541 char board_name[16]; 541 char board_name[16];
542 char board_assembly[16]; 542 char board_assembly[16];
543 char board_tracer[16]; 543 char board_tracer[16];
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index d2db93b8aa99..f2ebaa9992fe 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -154,6 +154,8 @@ static struct pci_device_id mptfc_pci_table[] = {
154 PCI_ANY_ID, PCI_ANY_ID }, 154 PCI_ANY_ID, PCI_ANY_ID },
155 { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC949E, 155 { PCI_VENDOR_ID_LSI_LOGIC, MPI_MANUFACTPAGE_DEVICEID_FC949E,
156 PCI_ANY_ID, PCI_ANY_ID }, 156 PCI_ANY_ID, PCI_ANY_ID },
157 { PCI_VENDOR_ID_BROCADE, MPI_MANUFACTPAGE_DEVICEID_FC949E,
158 PCI_ANY_ID, PCI_ANY_ID },
157 {0} /* Terminating entry */ 159 {0} /* Terminating entry */
158}; 160};
159MODULE_DEVICE_TABLE(pci, mptfc_pci_table); 161MODULE_DEVICE_TABLE(pci, mptfc_pci_table);