mptbase.c (edb9068d0d7a3ba92f66b8c86cba625f3a439f64) mptbase.c (ef1d8df72fce074584244a8e3c4ae91606ccd784)
1/*
2 * linux/drivers/message/fusion/mptbase.c
3 * This is the Fusion MPT base driver which supports multiple
4 * (SCSI + LAN) specialized protocol drivers.
5 * For use with LSI Logic PCI chip/adapter(s)
6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
7 *
8 * Copyright (c) 1999-2007 LSI Logic Corporation

--- 1118 unchanged lines hidden (view full) ---

1127 return iocid;
1128 }
1129 }
1130
1131 *iocpp = NULL;
1132 return -1;
1133}
1134
1/*
2 * linux/drivers/message/fusion/mptbase.c
3 * This is the Fusion MPT base driver which supports multiple
4 * (SCSI + LAN) specialized protocol drivers.
5 * For use with LSI Logic PCI chip/adapter(s)
6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
7 *
8 * Copyright (c) 1999-2007 LSI Logic Corporation

--- 1118 unchanged lines hidden (view full) ---

1127 return iocid;
1128 }
1129 }
1130
1131 *iocpp = NULL;
1132 return -1;
1133}
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/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1136/**
1137 * mpt_attach - Install a PCI intelligent MPT adapter.
1138 * @pdev: Pointer to pci_dev structure
1139 * @id: PCI device ID information
1140 *
1141 * This routine performs all the steps necessary to bring the IOC of
1142 * a MPT adapter to a OPERATIONAL state. This includes registering

--- 127 unchanged lines hidden (view full) ---

1270
1271 /* Save Port IO values in case we need to do downloadboot */
1272 {
1273 u8 *pmem = (u8*)port;
1274 ioc->pio_mem_phys = port;
1275 ioc->pio_chip = (SYSIF_REGS __iomem *)pmem;
1276 }
1277
1377/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1378/**
1379 * mpt_attach - Install a PCI intelligent MPT adapter.
1380 * @pdev: Pointer to pci_dev structure
1381 * @id: PCI device ID information
1382 *
1383 * This routine performs all the steps necessary to bring the IOC of
1384 * a MPT adapter to a OPERATIONAL state. This includes registering

--- 127 unchanged lines hidden (view full) ---

1512
1513 /* Save Port IO values in case we need to do downloadboot */
1514 {
1515 u8 *pmem = (u8*)port;
1516 ioc->pio_mem_phys = port;
1517 ioc->pio_chip = (SYSIF_REGS __iomem *)pmem;
1518 }
1519
1278 if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC909) {
1279 ioc->prod_name = "LSIFC909";
1520 pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
1521 mpt_get_product_name(pdev->vendor, pdev->device, revision, ioc->prod_name);
1522
1523 switch (pdev->device)
1524 {
1525 case MPI_MANUFACTPAGE_DEVICEID_FC939X:
1526 case MPI_MANUFACTPAGE_DEVICEID_FC949X:
1527 ioc->errata_flag_1064 = 1;
1528 case MPI_MANUFACTPAGE_DEVICEID_FC909:
1529 case MPI_MANUFACTPAGE_DEVICEID_FC929:
1530 case MPI_MANUFACTPAGE_DEVICEID_FC919:
1531 case MPI_MANUFACTPAGE_DEVICEID_FC949E:
1280 ioc->bus_type = FC;
1532 ioc->bus_type = FC;
1281 }
1282 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC929) {
1283 ioc->prod_name = "LSIFC929";
1284 ioc->bus_type = FC;
1285 }
1286 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC919) {
1287 ioc->prod_name = "LSIFC919";
1288 ioc->bus_type = FC;
1289 }
1290 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC929X) {
1291 pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
1292 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
1296 * for PCIX. Set MOST bits to zero.
1297 */
1298 pci_read_config_byte(pdev, 0x6a, &pcixcmd);
1299 pcixcmd &= 0x8F;
1300 pci_write_config_byte(pdev, 0x6a, pcixcmd);
1301 } else {
1537 /* 929X Chip Fix. Set Split transactions level
1538 * for PCIX. Set MOST bits to zero.
1539 */
1540 pci_read_config_byte(pdev, 0x6a, &pcixcmd);
1541 pcixcmd &= 0x8F;
1542 pci_write_config_byte(pdev, 0x6a, pcixcmd);
1543 } else {
1302 ioc->prod_name = "LSIFC929XL";
1303 /* 929XL Chip Fix. Set MMRBC to 0x08.
1304 */
1305 pci_read_config_byte(pdev, 0x6a, &pcixcmd);
1306 pcixcmd |= 0x08;
1307 pci_write_config_byte(pdev, 0x6a, pcixcmd);
1308 }
1544 /* 929XL Chip Fix. Set MMRBC to 0x08.
1545 */
1546 pci_read_config_byte(pdev, 0x6a, &pcixcmd);
1547 pcixcmd |= 0x08;
1548 pci_write_config_byte(pdev, 0x6a, pcixcmd);
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
1314 * for PCIX. Set MOST bits to zero.
1315 */
1316 pci_read_config_byte(pdev, 0x6a, &pcixcmd);
1317 pcixcmd &= 0x8F;
1318 pci_write_config_byte(pdev, 0x6a, pcixcmd);
1554 /* 919X Chip Fix. Set Split transactions level
1555 * for PCIX. Set MOST bits to zero.
1556 */
1557 pci_read_config_byte(pdev, 0x6a, &pcixcmd);
1558 pcixcmd &= 0x8F;
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;
1560 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;
1328 ioc->errata_flag_1064 = 1;
1329 }
1330 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC949E) {
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;
1561 break;
1562
1563 case MPI_MANUFACTPAGE_DEVID_53C1030:
1337 /* 1030 Chip Fix. Disable Split transactions
1338 * for PCIX. Set MOST bits to zero if Rev < C0( = 8).
1339 */
1564 /* 1030 Chip Fix. Disable Split transactions
1565 * for PCIX. Set MOST bits to zero if Rev < C0( = 8).
1566 */
1340 pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
1341 if (revision < C0_1030) {
1342 pci_read_config_byte(pdev, 0x6a, &pcixcmd);
1343 pcixcmd &= 0x8F;
1344 pci_write_config_byte(pdev, 0x6a, pcixcmd);
1345 }
1567 if (revision < C0_1030) {
1568 pci_read_config_byte(pdev, 0x6a, &pcixcmd);
1569 pcixcmd &= 0x8F;
1570 pci_write_config_byte(pdev, 0x6a, pcixcmd);
1571 }
1346 }
1347 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_1030_53C1035) {
1348 ioc->prod_name = "LSI53C1035";
1572
1573 case MPI_MANUFACTPAGE_DEVID_1030_53C1035:
1349 ioc->bus_type = SPI;
1574 ioc->bus_type = SPI;
1350 }
1351 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1064) {
1352 ioc->prod_name = "LSISAS1064";
1353 ioc->bus_type = SAS;
1575 break;
1576
1577 case MPI_MANUFACTPAGE_DEVID_SAS1064:
1578 case MPI_MANUFACTPAGE_DEVID_SAS1068:
1354 ioc->errata_flag_1064 = 1;
1579 ioc->errata_flag_1064 = 1;
1355 }
1356 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068) {
1357 ioc->prod_name = "LSISAS1068";
1580
1581 case MPI_MANUFACTPAGE_DEVID_SAS1064E:
1582 case MPI_MANUFACTPAGE_DEVID_SAS1068E:
1583 case MPI_MANUFACTPAGE_DEVID_SAS1078:
1358 ioc->bus_type = SAS;
1584 ioc->bus_type = SAS;
1359 ioc->errata_flag_1064 = 1;
1360 }
1585 }
1361 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1064E) {
1362 ioc->prod_name = "LSISAS1064E";
1363 ioc->bus_type = SAS;
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;
1372 }
1373
1374 if (ioc->errata_flag_1064)
1375 pci_disable_io_access(pdev);
1376
1377 sprintf(ioc->name, "ioc%d", ioc->id);
1378
1379 spin_lock_init(&ioc->FreeQlock);
1380

--- 754 unchanged lines hidden (view full) ---

2135 * @ioc: Pointer to MPT adapter structure
2136 */
2137static void
2138MptDisplayIocCapabilities(MPT_ADAPTER *ioc)
2139{
2140 int i = 0;
2141
2142 printk(KERN_INFO "%s: ", ioc->name);
1586
1587 if (ioc->errata_flag_1064)
1588 pci_disable_io_access(pdev);
1589
1590 sprintf(ioc->name, "ioc%d", ioc->id);
1591
1592 spin_lock_init(&ioc->FreeQlock);
1593

--- 754 unchanged lines hidden (view full) ---

2348 * @ioc: Pointer to MPT adapter structure
2349 */
2350static void
2351MptDisplayIocCapabilities(MPT_ADAPTER *ioc)
2352{
2353 int i = 0;
2354
2355 printk(KERN_INFO "%s: ", ioc->name);
2143 if (ioc->prod_name && strlen(ioc->prod_name) > 3)
2144 printk("%s: ", ioc->prod_name+3);
2356 if (ioc->prod_name)
2357 printk("%s: ", ioc->prod_name);
2145 printk("Capabilities={");
2146
2147 if (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR) {
2148 printk("Initiator");
2149 i++;
2150 }
2151
2152 if (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_TARGET) {

--- 4976 unchanged lines hidden ---
2358 printk("Capabilities={");
2359
2360 if (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR) {
2361 printk("Initiator");
2362 i++;
2363 }
2364
2365 if (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_TARGET) {

--- 4976 unchanged lines hidden ---