diff options
Diffstat (limited to 'drivers/scsi/qla1280.c')
| -rw-r--r-- | drivers/scsi/qla1280.c | 311 |
1 files changed, 23 insertions, 288 deletions
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index 0878f95b5449..e0230249fa0f 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c | |||
| @@ -17,9 +17,11 @@ | |||
| 17 | * General Public License for more details. | 17 | * General Public License for more details. |
| 18 | * | 18 | * |
| 19 | ******************************************************************************/ | 19 | ******************************************************************************/ |
| 20 | #define QLA1280_VERSION "3.25" | 20 | #define QLA1280_VERSION "3.26" |
| 21 | /***************************************************************************** | 21 | /***************************************************************************** |
| 22 | Revision History: | 22 | Revision History: |
| 23 | Rev 3.26, January 16, 2006 Jes Sorensen | ||
| 24 | - Ditch all < 2.6 support | ||
| 23 | Rev 3.25.1, February 10, 2005 Christoph Hellwig | 25 | Rev 3.25.1, February 10, 2005 Christoph Hellwig |
| 24 | - use pci_map_single to map non-S/G requests | 26 | - use pci_map_single to map non-S/G requests |
| 25 | - remove qla1280_proc_info | 27 | - remove qla1280_proc_info |
| @@ -356,25 +358,18 @@ | |||
| 356 | #include <asm/types.h> | 358 | #include <asm/types.h> |
| 357 | #include <asm/system.h> | 359 | #include <asm/system.h> |
| 358 | 360 | ||
| 359 | #if LINUX_VERSION_CODE >= 0x020545 | ||
| 360 | #include <scsi/scsi.h> | 361 | #include <scsi/scsi.h> |
| 361 | #include <scsi/scsi_cmnd.h> | 362 | #include <scsi/scsi_cmnd.h> |
| 362 | #include <scsi/scsi_device.h> | 363 | #include <scsi/scsi_device.h> |
| 363 | #include <scsi/scsi_host.h> | 364 | #include <scsi/scsi_host.h> |
| 364 | #include <scsi/scsi_tcq.h> | 365 | #include <scsi/scsi_tcq.h> |
| 365 | #else | ||
| 366 | #include <linux/blk.h> | ||
| 367 | #include "scsi.h" | ||
| 368 | #include <scsi/scsi_host.h> | ||
| 369 | #include "sd.h" | ||
| 370 | #endif | ||
| 371 | 366 | ||
| 372 | #if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2) | 367 | #if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2) |
| 373 | #include <asm/sn/io.h> | 368 | #include <asm/sn/io.h> |
| 374 | #endif | 369 | #endif |
| 375 | 370 | ||
| 376 | #if LINUX_VERSION_CODE < 0x020407 | 371 | #if LINUX_VERSION_CODE < 0x020600 |
| 377 | #error "Kernels older than 2.4.7 are no longer supported" | 372 | #error "Kernels older than 2.6.0 are no longer supported" |
| 378 | #endif | 373 | #endif |
| 379 | 374 | ||
| 380 | 375 | ||
| @@ -441,52 +436,6 @@ | |||
| 441 | 436 | ||
| 442 | #define NVRAM_DELAY() udelay(500) /* 2 microseconds */ | 437 | #define NVRAM_DELAY() udelay(500) /* 2 microseconds */ |
| 443 | 438 | ||
| 444 | #if LINUX_VERSION_CODE < 0x020500 | ||
| 445 | #define HOST_LOCK &io_request_lock | ||
| 446 | #define irqreturn_t void | ||
| 447 | #define IRQ_RETVAL(foo) | ||
| 448 | #define MSG_ORDERED_TAG 1 | ||
| 449 | |||
| 450 | #define DMA_BIDIRECTIONAL SCSI_DATA_UNKNOWN | ||
| 451 | #define DMA_TO_DEVICE SCSI_DATA_WRITE | ||
| 452 | #define DMA_FROM_DEVICE SCSI_DATA_READ | ||
| 453 | #define DMA_NONE SCSI_DATA_NONE | ||
| 454 | |||
| 455 | #ifndef HAVE_SECTOR_T | ||
| 456 | typedef unsigned int sector_t; | ||
| 457 | #endif | ||
| 458 | |||
| 459 | static inline void | ||
| 460 | scsi_adjust_queue_depth(struct scsi_device *device, int tag, int depth) | ||
| 461 | { | ||
| 462 | if (tag) { | ||
| 463 | device->tagged_queue = tag; | ||
| 464 | device->current_tag = 0; | ||
| 465 | } | ||
| 466 | device->queue_depth = depth; | ||
| 467 | } | ||
| 468 | static inline struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *t, size_t s) | ||
| 469 | { | ||
| 470 | return scsi_register(t, s); | ||
| 471 | } | ||
| 472 | static inline void scsi_host_put(struct Scsi_Host *h) | ||
| 473 | { | ||
| 474 | scsi_unregister(h); | ||
| 475 | } | ||
| 476 | #else | ||
| 477 | #define HOST_LOCK ha->host->host_lock | ||
| 478 | #endif | ||
| 479 | #if LINUX_VERSION_CODE < 0x020600 | ||
| 480 | #define DEV_SIMPLE_TAGS(device) device->tagged_queue | ||
| 481 | /* | ||
| 482 | * Hack around that qla1280_remove_one is called from | ||
| 483 | * qla1280_release in 2.4 | ||
| 484 | */ | ||
| 485 | #undef __devexit | ||
| 486 | #define __devexit | ||
| 487 | #else | ||
| 488 | #define DEV_SIMPLE_TAGS(device) device->simple_tags | ||
| 489 | #endif | ||
| 490 | #if defined(__ia64__) && !defined(ia64_platform_is) | 439 | #if defined(__ia64__) && !defined(ia64_platform_is) |
| 491 | #define ia64_platform_is(foo) (!strcmp(x, platform_name)) | 440 | #define ia64_platform_is(foo) (!strcmp(x, platform_name)) |
| 492 | #endif | 441 | #endif |
| @@ -506,9 +455,6 @@ static void qla1280_remove_one(struct pci_dev *); | |||
| 506 | * QLogic Driver Support Function Prototypes. | 455 | * QLogic Driver Support Function Prototypes. |
| 507 | */ | 456 | */ |
| 508 | static void qla1280_done(struct scsi_qla_host *); | 457 | static void qla1280_done(struct scsi_qla_host *); |
| 509 | #if LINUX_VERSION_CODE < 0x020545 | ||
| 510 | static void qla1280_get_target_options(struct scsi_cmnd *, struct scsi_qla_host *); | ||
| 511 | #endif | ||
| 512 | static int qla1280_get_token(char *); | 458 | static int qla1280_get_token(char *); |
| 513 | static int qla1280_setup(char *s) __init; | 459 | static int qla1280_setup(char *s) __init; |
| 514 | 460 | ||
| @@ -610,11 +556,7 @@ __setup("qla1280=", qla1280_setup); | |||
| 610 | #define CMD_SNSLEN(Cmnd) sizeof(Cmnd->sense_buffer) | 556 | #define CMD_SNSLEN(Cmnd) sizeof(Cmnd->sense_buffer) |
| 611 | #define CMD_RESULT(Cmnd) Cmnd->result | 557 | #define CMD_RESULT(Cmnd) Cmnd->result |
| 612 | #define CMD_HANDLE(Cmnd) Cmnd->host_scribble | 558 | #define CMD_HANDLE(Cmnd) Cmnd->host_scribble |
| 613 | #if LINUX_VERSION_CODE < 0x020545 | ||
| 614 | #define CMD_REQUEST(Cmnd) Cmnd->request.cmd | ||
| 615 | #else | ||
| 616 | #define CMD_REQUEST(Cmnd) Cmnd->request->cmd | 559 | #define CMD_REQUEST(Cmnd) Cmnd->request->cmd |
| 617 | #endif | ||
| 618 | 560 | ||
| 619 | #define CMD_HOST(Cmnd) Cmnd->device->host | 561 | #define CMD_HOST(Cmnd) Cmnd->device->host |
| 620 | #define SCSI_BUS_32(Cmnd) Cmnd->device->channel | 562 | #define SCSI_BUS_32(Cmnd) Cmnd->device->channel |
| @@ -1064,10 +1006,10 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action) | |||
| 1064 | add_timer(&timer); | 1006 | add_timer(&timer); |
| 1065 | 1007 | ||
| 1066 | /* wait for the action to complete (or the timer to expire) */ | 1008 | /* wait for the action to complete (or the timer to expire) */ |
| 1067 | spin_unlock_irq(HOST_LOCK); | 1009 | spin_unlock_irq(ha->host->host_lock); |
| 1068 | wait_for_completion(&wait); | 1010 | wait_for_completion(&wait); |
| 1069 | del_timer_sync(&timer); | 1011 | del_timer_sync(&timer); |
| 1070 | spin_lock_irq(HOST_LOCK); | 1012 | spin_lock_irq(ha->host->host_lock); |
| 1071 | sp->wait = NULL; | 1013 | sp->wait = NULL; |
| 1072 | 1014 | ||
| 1073 | /* the only action we might get a fail for is abort */ | 1015 | /* the only action we might get a fail for is abort */ |
| @@ -1173,96 +1115,6 @@ qla1280_biosparam(struct scsi_device *sdev, struct block_device *bdev, | |||
| 1173 | return 0; | 1115 | return 0; |
| 1174 | } | 1116 | } |
| 1175 | 1117 | ||
| 1176 | #if LINUX_VERSION_CODE < 0x020600 | ||
| 1177 | static int | ||
| 1178 | qla1280_detect(struct scsi_host_template *template) | ||
| 1179 | { | ||
| 1180 | struct pci_device_id *id = &qla1280_pci_tbl[0]; | ||
| 1181 | struct pci_dev *pdev = NULL; | ||
| 1182 | int num_hosts = 0; | ||
| 1183 | |||
| 1184 | if (sizeof(struct srb) > sizeof(Scsi_Pointer)) { | ||
| 1185 | printk(KERN_WARNING | ||
| 1186 | "qla1280: struct srb too big, aborting\n"); | ||
| 1187 | return 0; | ||
| 1188 | } | ||
| 1189 | |||
| 1190 | if ((DMA_BIDIRECTIONAL != PCI_DMA_BIDIRECTIONAL) || | ||
| 1191 | (DMA_TO_DEVICE != PCI_DMA_TODEVICE) || | ||
| 1192 | (DMA_FROM_DEVICE != PCI_DMA_FROMDEVICE) || | ||
| 1193 | (DMA_NONE != PCI_DMA_NONE)) { | ||
| 1194 | printk(KERN_WARNING | ||
| 1195 | "qla1280: dma direction bits don't match\n"); | ||
| 1196 | return 0; | ||
| 1197 | } | ||
| 1198 | |||
| 1199 | #ifdef MODULE | ||
| 1200 | /* | ||
| 1201 | * If we are called as a module, the qla1280 pointer may not be null | ||
| 1202 | * and it would point to our bootup string, just like on the lilo | ||
| 1203 | * command line. IF not NULL, then process this config string with | ||
| 1204 | * qla1280_setup | ||
| 1205 | * | ||
| 1206 | * Boot time Options | ||
| 1207 | * To add options at boot time add a line to your lilo.conf file like: | ||
| 1208 | * append="qla1280=verbose,max_tags:{{255,255,255,255},{255,255,255,255}}" | ||
| 1209 | * which will result in the first four devices on the first two | ||
| 1210 | * controllers being set to a tagged queue depth of 32. | ||
| 1211 | */ | ||
| 1212 | if (qla1280) | ||
| 1213 | qla1280_setup(qla1280); | ||
| 1214 | #endif | ||
| 1215 | |||
| 1216 | /* First Initialize QLA12160 on PCI Bus 1 Dev 2 */ | ||
| 1217 | while ((pdev = pci_find_device(id->vendor, id->device, pdev))) { | ||
| 1218 | if (pdev->bus->number == 1 && PCI_SLOT(pdev->devfn) == 2) { | ||
| 1219 | if (!qla1280_probe_one(pdev, id)) | ||
| 1220 | num_hosts++; | ||
| 1221 | } | ||
| 1222 | } | ||
| 1223 | |||
| 1224 | pdev = NULL; | ||
| 1225 | /* Try and find each different type of adapter we support */ | ||
| 1226 | for (id = &qla1280_pci_tbl[0]; id->device; id++) { | ||
| 1227 | while ((pdev = pci_find_device(id->vendor, id->device, pdev))) { | ||
| 1228 | /* | ||
| 1229 | * skip QLA12160 already initialized on | ||
| 1230 | * PCI Bus 1 Dev 2 since we already initialized | ||
| 1231 | * and presented it | ||
| 1232 | */ | ||
| 1233 | if (id->device == PCI_DEVICE_ID_QLOGIC_ISP12160 && | ||
| 1234 | pdev->bus->number == 1 && | ||
| 1235 | PCI_SLOT(pdev->devfn) == 2) | ||
| 1236 | continue; | ||
| 1237 | |||
| 1238 | if (!qla1280_probe_one(pdev, id)) | ||
| 1239 | num_hosts++; | ||
| 1240 | } | ||
| 1241 | } | ||
| 1242 | |||
| 1243 | return num_hosts; | ||
| 1244 | } | ||
| 1245 | |||
| 1246 | /* | ||
| 1247 | * This looks a bit ugly as we could just pass down host to | ||
| 1248 | * qla1280_remove_one, but I want to keep qla1280_release purely a wrapper | ||
| 1249 | * around pci_driver::remove as used from 2.6 onwards. | ||
| 1250 | */ | ||
| 1251 | static int | ||
| 1252 | qla1280_release(struct Scsi_Host *host) | ||
| 1253 | { | ||
| 1254 | struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; | ||
| 1255 | |||
| 1256 | qla1280_remove_one(ha->pdev); | ||
| 1257 | return 0; | ||
| 1258 | } | ||
| 1259 | |||
| 1260 | static int | ||
| 1261 | qla1280_biosparam_old(Disk * disk, kdev_t dev, int geom[]) | ||
| 1262 | { | ||
| 1263 | return qla1280_biosparam(disk->device, NULL, disk->capacity, geom); | ||
| 1264 | } | ||
| 1265 | #endif | ||
| 1266 | 1118 | ||
| 1267 | /* disable risc and host interrupts */ | 1119 | /* disable risc and host interrupts */ |
| 1268 | static inline void | 1120 | static inline void |
| @@ -1295,7 +1147,7 @@ qla1280_intr_handler(int irq, void *dev_id, struct pt_regs *regs) | |||
| 1295 | ENTER_INTR ("qla1280_intr_handler"); | 1147 | ENTER_INTR ("qla1280_intr_handler"); |
| 1296 | ha = (struct scsi_qla_host *)dev_id; | 1148 | ha = (struct scsi_qla_host *)dev_id; |
| 1297 | 1149 | ||
| 1298 | spin_lock(HOST_LOCK); | 1150 | spin_lock(ha->host->host_lock); |
| 1299 | 1151 | ||
| 1300 | ha->isr_count++; | 1152 | ha->isr_count++; |
| 1301 | reg = ha->iobase; | 1153 | reg = ha->iobase; |
| @@ -1311,7 +1163,7 @@ qla1280_intr_handler(int irq, void *dev_id, struct pt_regs *regs) | |||
| 1311 | if (!list_empty(&ha->done_q)) | 1163 | if (!list_empty(&ha->done_q)) |
| 1312 | qla1280_done(ha); | 1164 | qla1280_done(ha); |
| 1313 | 1165 | ||
| 1314 | spin_unlock(HOST_LOCK); | 1166 | spin_unlock(ha->host->host_lock); |
| 1315 | 1167 | ||
| 1316 | qla1280_enable_intrs(ha); | 1168 | qla1280_enable_intrs(ha); |
| 1317 | 1169 | ||
| @@ -1411,11 +1263,9 @@ qla1280_slave_configure(struct scsi_device *device) | |||
| 1411 | scsi_adjust_queue_depth(device, 0, default_depth); | 1263 | scsi_adjust_queue_depth(device, 0, default_depth); |
| 1412 | } | 1264 | } |
| 1413 | 1265 | ||
| 1414 | #if LINUX_VERSION_CODE > 0x020500 | ||
| 1415 | nv->bus[bus].target[target].parameter.enable_sync = device->sdtr; | 1266 | nv->bus[bus].target[target].parameter.enable_sync = device->sdtr; |
| 1416 | nv->bus[bus].target[target].parameter.enable_wide = device->wdtr; | 1267 | nv->bus[bus].target[target].parameter.enable_wide = device->wdtr; |
| 1417 | nv->bus[bus].target[target].ppr_1x160.flags.enable_ppr = device->ppr; | 1268 | nv->bus[bus].target[target].ppr_1x160.flags.enable_ppr = device->ppr; |
| 1418 | #endif | ||
| 1419 | 1269 | ||
| 1420 | if (driver_setup.no_sync || | 1270 | if (driver_setup.no_sync || |
| 1421 | (driver_setup.sync_mask && | 1271 | (driver_setup.sync_mask && |
| @@ -1432,38 +1282,14 @@ qla1280_slave_configure(struct scsi_device *device) | |||
| 1432 | nv->bus[bus].target[target].ppr_1x160.flags.enable_ppr = 0; | 1282 | nv->bus[bus].target[target].ppr_1x160.flags.enable_ppr = 0; |
| 1433 | } | 1283 | } |
| 1434 | 1284 | ||
| 1435 | spin_lock_irqsave(HOST_LOCK, flags); | 1285 | spin_lock_irqsave(ha->host->host_lock, flags); |
| 1436 | if (nv->bus[bus].target[target].parameter.enable_sync) | 1286 | if (nv->bus[bus].target[target].parameter.enable_sync) |
| 1437 | status = qla1280_set_target_parameters(ha, bus, target); | 1287 | status = qla1280_set_target_parameters(ha, bus, target); |
| 1438 | qla1280_get_target_parameters(ha, device); | 1288 | qla1280_get_target_parameters(ha, device); |
| 1439 | spin_unlock_irqrestore(HOST_LOCK, flags); | 1289 | spin_unlock_irqrestore(ha->host->host_lock, flags); |
| 1440 | return status; | 1290 | return status; |
| 1441 | } | 1291 | } |
| 1442 | 1292 | ||
| 1443 | #if LINUX_VERSION_CODE < 0x020545 | ||
| 1444 | /************************************************************************** | ||
| 1445 | * qla1280_select_queue_depth | ||
| 1446 | * | ||
| 1447 | * Sets the queue depth for each SCSI device hanging off the input | ||
| 1448 | * host adapter. We use a queue depth of 2 for devices that do not | ||
| 1449 | * support tagged queueing. | ||
| 1450 | **************************************************************************/ | ||
| 1451 | static void | ||
| 1452 | qla1280_select_queue_depth(struct Scsi_Host *host, struct scsi_device *sdev_q) | ||
| 1453 | { | ||
| 1454 | struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; | ||
| 1455 | struct scsi_device *sdev; | ||
| 1456 | |||
| 1457 | ENTER("qla1280_select_queue_depth"); | ||
| 1458 | for (sdev = sdev_q; sdev; sdev = sdev->next) | ||
| 1459 | if (sdev->host == host) | ||
| 1460 | qla1280_slave_configure(sdev); | ||
| 1461 | |||
| 1462 | if (sdev_q) | ||
| 1463 | qla1280_check_for_dead_scsi_bus(ha, sdev_q->channel); | ||
| 1464 | LEAVE("qla1280_select_queue_depth"); | ||
| 1465 | } | ||
| 1466 | #endif | ||
| 1467 | 1293 | ||
| 1468 | /* | 1294 | /* |
| 1469 | * qla1280_done | 1295 | * qla1280_done |
| @@ -1523,10 +1349,6 @@ qla1280_done(struct scsi_qla_host *ha) | |||
| 1523 | CMD_HANDLE(sp->cmd) = (unsigned char *)INVALID_HANDLE; | 1349 | CMD_HANDLE(sp->cmd) = (unsigned char *)INVALID_HANDLE; |
| 1524 | ha->actthreads--; | 1350 | ha->actthreads--; |
| 1525 | 1351 | ||
| 1526 | #if LINUX_VERSION_CODE < 0x020500 | ||
| 1527 | if (cmd->cmnd[0] == INQUIRY) | ||
| 1528 | qla1280_get_target_options(cmd, ha); | ||
| 1529 | #endif | ||
| 1530 | (*(cmd)->scsi_done)(cmd); | 1352 | (*(cmd)->scsi_done)(cmd); |
| 1531 | 1353 | ||
| 1532 | if(sp->wait != NULL) | 1354 | if(sp->wait != NULL) |
| @@ -1655,9 +1477,7 @@ qla1280_initialize_adapter(struct scsi_qla_host *ha) | |||
| 1655 | struct device_reg __iomem *reg; | 1477 | struct device_reg __iomem *reg; |
| 1656 | int status; | 1478 | int status; |
| 1657 | int bus; | 1479 | int bus; |
| 1658 | #if LINUX_VERSION_CODE > 0x020500 | ||
| 1659 | unsigned long flags; | 1480 | unsigned long flags; |
| 1660 | #endif | ||
| 1661 | 1481 | ||
| 1662 | ENTER("qla1280_initialize_adapter"); | 1482 | ENTER("qla1280_initialize_adapter"); |
| 1663 | 1483 | ||
| @@ -1695,15 +1515,12 @@ qla1280_initialize_adapter(struct scsi_qla_host *ha) | |||
| 1695 | "NVRAM\n"); | 1515 | "NVRAM\n"); |
| 1696 | } | 1516 | } |
| 1697 | 1517 | ||
| 1698 | #if LINUX_VERSION_CODE >= 0x020500 | ||
| 1699 | /* | 1518 | /* |
| 1700 | * It's necessary to grab the spin here as qla1280_mailbox_command | 1519 | * It's necessary to grab the spin here as qla1280_mailbox_command |
| 1701 | * needs to be able to drop the lock unconditionally to wait | 1520 | * needs to be able to drop the lock unconditionally to wait |
| 1702 | * for completion. | 1521 | * for completion. |
| 1703 | * In 2.4 ->detect is called with the io_request_lock held. | ||
| 1704 | */ | 1522 | */ |
| 1705 | spin_lock_irqsave(HOST_LOCK, flags); | 1523 | spin_lock_irqsave(ha->host->host_lock, flags); |
| 1706 | #endif | ||
| 1707 | 1524 | ||
| 1708 | status = qla1280_load_firmware(ha); | 1525 | status = qla1280_load_firmware(ha); |
| 1709 | if (status) { | 1526 | if (status) { |
| @@ -1735,9 +1552,8 @@ qla1280_initialize_adapter(struct scsi_qla_host *ha) | |||
| 1735 | 1552 | ||
| 1736 | ha->flags.online = 1; | 1553 | ha->flags.online = 1; |
| 1737 | out: | 1554 | out: |
| 1738 | #if LINUX_VERSION_CODE >= 0x020500 | 1555 | spin_unlock_irqrestore(ha->host->host_lock, flags); |
| 1739 | spin_unlock_irqrestore(HOST_LOCK, flags); | 1556 | |
| 1740 | #endif | ||
| 1741 | if (status) | 1557 | if (status) |
| 1742 | dprintk(2, "qla1280_initialize_adapter: **** FAILED ****\n"); | 1558 | dprintk(2, "qla1280_initialize_adapter: **** FAILED ****\n"); |
| 1743 | 1559 | ||
| @@ -2650,14 +2466,14 @@ qla1280_mailbox_command(struct scsi_qla_host *ha, uint8_t mr, uint16_t *mb) | |||
| 2650 | timer.function = qla1280_mailbox_timeout; | 2466 | timer.function = qla1280_mailbox_timeout; |
| 2651 | add_timer(&timer); | 2467 | add_timer(&timer); |
| 2652 | 2468 | ||
| 2653 | spin_unlock_irq(HOST_LOCK); | 2469 | spin_unlock_irq(ha->host->host_lock); |
| 2654 | WRT_REG_WORD(®->host_cmd, HC_SET_HOST_INT); | 2470 | WRT_REG_WORD(®->host_cmd, HC_SET_HOST_INT); |
| 2655 | data = qla1280_debounce_register(®->istatus); | 2471 | data = qla1280_debounce_register(®->istatus); |
| 2656 | 2472 | ||
| 2657 | wait_for_completion(&wait); | 2473 | wait_for_completion(&wait); |
| 2658 | del_timer_sync(&timer); | 2474 | del_timer_sync(&timer); |
| 2659 | 2475 | ||
| 2660 | spin_lock_irq(HOST_LOCK); | 2476 | spin_lock_irq(ha->host->host_lock); |
| 2661 | 2477 | ||
| 2662 | ha->mailbox_wait = NULL; | 2478 | ha->mailbox_wait = NULL; |
| 2663 | 2479 | ||
| @@ -2770,9 +2586,9 @@ qla1280_bus_reset(struct scsi_qla_host *ha, int bus) | |||
| 2770 | ha->bus_settings[bus].scsi_bus_dead = 1; | 2586 | ha->bus_settings[bus].scsi_bus_dead = 1; |
| 2771 | ha->bus_settings[bus].failed_reset_count++; | 2587 | ha->bus_settings[bus].failed_reset_count++; |
| 2772 | } else { | 2588 | } else { |
| 2773 | spin_unlock_irq(HOST_LOCK); | 2589 | spin_unlock_irq(ha->host->host_lock); |
| 2774 | ssleep(reset_delay); | 2590 | ssleep(reset_delay); |
| 2775 | spin_lock_irq(HOST_LOCK); | 2591 | spin_lock_irq(ha->host->host_lock); |
| 2776 | 2592 | ||
| 2777 | ha->bus_settings[bus].scsi_bus_dead = 0; | 2593 | ha->bus_settings[bus].scsi_bus_dead = 0; |
| 2778 | ha->bus_settings[bus].failed_reset_count = 0; | 2594 | ha->bus_settings[bus].failed_reset_count = 0; |
| @@ -3078,7 +2894,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp) | |||
| 3078 | (SCSI_TCN_32(cmd) | BIT_7) : SCSI_TCN_32(cmd); | 2894 | (SCSI_TCN_32(cmd) | BIT_7) : SCSI_TCN_32(cmd); |
| 3079 | 2895 | ||
| 3080 | /* Enable simple tag queuing if device supports it. */ | 2896 | /* Enable simple tag queuing if device supports it. */ |
| 3081 | if (DEV_SIMPLE_TAGS(cmd->device)) | 2897 | if (cmd->device->simple_tags) |
| 3082 | pkt->control_flags |= cpu_to_le16(BIT_3); | 2898 | pkt->control_flags |= cpu_to_le16(BIT_3); |
| 3083 | 2899 | ||
| 3084 | /* Load SCSI command packet. */ | 2900 | /* Load SCSI command packet. */ |
| @@ -3377,7 +3193,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp) | |||
| 3377 | (SCSI_TCN_32(cmd) | BIT_7) : SCSI_TCN_32(cmd); | 3193 | (SCSI_TCN_32(cmd) | BIT_7) : SCSI_TCN_32(cmd); |
| 3378 | 3194 | ||
| 3379 | /* Enable simple tag queuing if device supports it. */ | 3195 | /* Enable simple tag queuing if device supports it. */ |
| 3380 | if (DEV_SIMPLE_TAGS(cmd->device)) | 3196 | if (cmd->device->simple_tags) |
| 3381 | pkt->control_flags |= cpu_to_le16(BIT_3); | 3197 | pkt->control_flags |= cpu_to_le16(BIT_3); |
| 3382 | 3198 | ||
| 3383 | /* Load SCSI command packet. */ | 3199 | /* Load SCSI command packet. */ |
| @@ -3889,50 +3705,6 @@ qla1280_rst_aen(struct scsi_qla_host *ha) | |||
| 3889 | } | 3705 | } |
| 3890 | 3706 | ||
| 3891 | 3707 | ||
| 3892 | #if LINUX_VERSION_CODE < 0x020500 | ||
| 3893 | /* | ||
| 3894 | * | ||
| 3895 | */ | ||
| 3896 | static void | ||
| 3897 | qla1280_get_target_options(struct scsi_cmnd *cmd, struct scsi_qla_host *ha) | ||
| 3898 | { | ||
| 3899 | unsigned char *result; | ||
| 3900 | struct nvram *n; | ||
| 3901 | int bus, target, lun; | ||
| 3902 | |||
| 3903 | bus = SCSI_BUS_32(cmd); | ||
| 3904 | target = SCSI_TCN_32(cmd); | ||
| 3905 | lun = SCSI_LUN_32(cmd); | ||
| 3906 | |||
| 3907 | /* | ||
| 3908 | * Make sure to not touch anything if someone is using the | ||
| 3909 | * sg interface. | ||
| 3910 | */ | ||
| 3911 | if (cmd->use_sg || (CMD_RESULT(cmd) >> 16) != DID_OK || lun) | ||
| 3912 | return; | ||
| 3913 | |||
| 3914 | result = cmd->request_buffer; | ||
| 3915 | n = &ha->nvram; | ||
| 3916 | |||
| 3917 | n->bus[bus].target[target].parameter.enable_wide = 0; | ||
| 3918 | n->bus[bus].target[target].parameter.enable_sync = 0; | ||
| 3919 | n->bus[bus].target[target].ppr_1x160.flags.enable_ppr = 0; | ||
| 3920 | |||
| 3921 | if (result[7] & 0x60) | ||
| 3922 | n->bus[bus].target[target].parameter.enable_wide = 1; | ||
| 3923 | if (result[7] & 0x10) | ||
| 3924 | n->bus[bus].target[target].parameter.enable_sync = 1; | ||
| 3925 | if ((result[2] >= 3) && (result[4] + 5 > 56) && | ||
| 3926 | (result[56] & 0x4)) | ||
| 3927 | n->bus[bus].target[target].ppr_1x160.flags.enable_ppr = 1; | ||
| 3928 | |||
| 3929 | dprintk(2, "get_target_options(): wide %i, sync %i, ppr %i\n", | ||
| 3930 | n->bus[bus].target[target].parameter.enable_wide, | ||
| 3931 | n->bus[bus].target[target].parameter.enable_sync, | ||
| 3932 | n->bus[bus].target[target].ppr_1x160.flags.enable_ppr); | ||
| 3933 | } | ||
| 3934 | #endif | ||
| 3935 | |||
| 3936 | /* | 3708 | /* |
| 3937 | * qla1280_status_entry | 3709 | * qla1280_status_entry |
| 3938 | * Processes received ISP status entry. | 3710 | * Processes received ISP status entry. |
| @@ -4271,7 +4043,7 @@ qla1280_get_target_parameters(struct scsi_qla_host *ha, | |||
| 4271 | } else | 4043 | } else |
| 4272 | printk(" Async"); | 4044 | printk(" Async"); |
| 4273 | 4045 | ||
| 4274 | if (DEV_SIMPLE_TAGS(device)) | 4046 | if (device->simple_tags) |
| 4275 | printk(", Tagged queuing: depth %d", device->queue_depth); | 4047 | printk(", Tagged queuing: depth %d", device->queue_depth); |
| 4276 | printk("\n"); | 4048 | printk("\n"); |
| 4277 | } | 4049 | } |
| @@ -4485,7 +4257,7 @@ qla1280_get_token(char *str) | |||
| 4485 | return ret; | 4257 | return ret; |
| 4486 | } | 4258 | } |
| 4487 | 4259 | ||
| 4488 | #if LINUX_VERSION_CODE >= 0x020600 | 4260 | |
| 4489 | static struct scsi_host_template qla1280_driver_template = { | 4261 | static struct scsi_host_template qla1280_driver_template = { |
| 4490 | .module = THIS_MODULE, | 4262 | .module = THIS_MODULE, |
| 4491 | .proc_name = "qla1280", | 4263 | .proc_name = "qla1280", |
| @@ -4504,27 +4276,7 @@ static struct scsi_host_template qla1280_driver_template = { | |||
| 4504 | .cmd_per_lun = 1, | 4276 | .cmd_per_lun = 1, |
| 4505 | .use_clustering = ENABLE_CLUSTERING, | 4277 | .use_clustering = ENABLE_CLUSTERING, |
| 4506 | }; | 4278 | }; |
| 4507 | #else | 4279 | |
| 4508 | static struct scsi_host_template qla1280_driver_template = { | ||
| 4509 | .proc_name = "qla1280", | ||
| 4510 | .name = "Qlogic ISP 1280/12160", | ||
| 4511 | .detect = qla1280_detect, | ||
| 4512 | .release = qla1280_release, | ||
| 4513 | .info = qla1280_info, | ||
| 4514 | .queuecommand = qla1280_queuecommand, | ||
| 4515 | .eh_abort_handler = qla1280_eh_abort, | ||
| 4516 | .eh_device_reset_handler= qla1280_eh_device_reset, | ||
| 4517 | .eh_bus_reset_handler = qla1280_eh_bus_reset, | ||
| 4518 | .eh_host_reset_handler = qla1280_eh_adapter_reset, | ||
| 4519 | .bios_param = qla1280_biosparam_old, | ||
| 4520 | .can_queue = 0xfffff, | ||
| 4521 | .this_id = -1, | ||
| 4522 | .sg_tablesize = SG_ALL, | ||
| 4523 | .cmd_per_lun = 1, | ||
| 4524 | .use_clustering = ENABLE_CLUSTERING, | ||
| 4525 | .use_new_eh_code = 1, | ||
| 4526 | }; | ||
| 4527 | #endif | ||
| 4528 | 4280 | ||
| 4529 | static int __devinit | 4281 | static int __devinit |
| 4530 | qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | 4282 | qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) |
| @@ -4615,10 +4367,6 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 4615 | host->max_sectors = 1024; | 4367 | host->max_sectors = 1024; |
| 4616 | host->unique_id = host->host_no; | 4368 | host->unique_id = host->host_no; |
| 4617 | 4369 | ||
| 4618 | #if LINUX_VERSION_CODE < 0x020545 | ||
| 4619 | host->select_queue_depths = qla1280_select_queue_depth; | ||
| 4620 | #endif | ||
| 4621 | |||
| 4622 | error = -ENODEV; | 4370 | error = -ENODEV; |
| 4623 | 4371 | ||
| 4624 | #if MEMORY_MAPPED_IO | 4372 | #if MEMORY_MAPPED_IO |
| @@ -4666,21 +4414,15 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 4666 | 4414 | ||
| 4667 | pci_set_drvdata(pdev, host); | 4415 | pci_set_drvdata(pdev, host); |
| 4668 | 4416 | ||
| 4669 | #if LINUX_VERSION_CODE >= 0x020600 | ||
| 4670 | error = scsi_add_host(host, &pdev->dev); | 4417 | error = scsi_add_host(host, &pdev->dev); |
| 4671 | if (error) | 4418 | if (error) |
| 4672 | goto error_disable_adapter; | 4419 | goto error_disable_adapter; |
| 4673 | scsi_scan_host(host); | 4420 | scsi_scan_host(host); |
| 4674 | #else | ||
| 4675 | scsi_set_pci_device(host, pdev); | ||
| 4676 | #endif | ||
| 4677 | 4421 | ||
| 4678 | return 0; | 4422 | return 0; |
| 4679 | 4423 | ||
| 4680 | #if LINUX_VERSION_CODE >= 0x020600 | ||
| 4681 | error_disable_adapter: | 4424 | error_disable_adapter: |
| 4682 | qla1280_disable_intrs(ha); | 4425 | qla1280_disable_intrs(ha); |
| 4683 | #endif | ||
| 4684 | error_free_irq: | 4426 | error_free_irq: |
| 4685 | free_irq(pdev->irq, ha); | 4427 | free_irq(pdev->irq, ha); |
| 4686 | error_release_region: | 4428 | error_release_region: |
| @@ -4712,9 +4454,7 @@ qla1280_remove_one(struct pci_dev *pdev) | |||
| 4712 | struct Scsi_Host *host = pci_get_drvdata(pdev); | 4454 | struct Scsi_Host *host = pci_get_drvdata(pdev); |
| 4713 | struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; | 4455 | struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; |
| 4714 | 4456 | ||
| 4715 | #if LINUX_VERSION_CODE >= 0x020600 | ||
| 4716 | scsi_remove_host(host); | 4457 | scsi_remove_host(host); |
| 4717 | #endif | ||
| 4718 | 4458 | ||
| 4719 | qla1280_disable_intrs(ha); | 4459 | qla1280_disable_intrs(ha); |
| 4720 | 4460 | ||
| @@ -4738,7 +4478,6 @@ qla1280_remove_one(struct pci_dev *pdev) | |||
| 4738 | scsi_host_put(host); | 4478 | scsi_host_put(host); |
| 4739 | } | 4479 | } |
| 4740 | 4480 | ||
| 4741 | #if LINUX_VERSION_CODE >= 0x020600 | ||
| 4742 | static struct pci_driver qla1280_pci_driver = { | 4481 | static struct pci_driver qla1280_pci_driver = { |
| 4743 | .name = "qla1280", | 4482 | .name = "qla1280", |
| 4744 | .id_table = qla1280_pci_tbl, | 4483 | .id_table = qla1280_pci_tbl, |
| @@ -4784,10 +4523,6 @@ qla1280_exit(void) | |||
| 4784 | module_init(qla1280_init); | 4523 | module_init(qla1280_init); |
| 4785 | module_exit(qla1280_exit); | 4524 | module_exit(qla1280_exit); |
| 4786 | 4525 | ||
| 4787 | #else | ||
| 4788 | # define driver_template qla1280_driver_template | ||
| 4789 | # include "scsi_module.c" | ||
| 4790 | #endif | ||
| 4791 | 4526 | ||
| 4792 | MODULE_AUTHOR("Qlogic & Jes Sorensen"); | 4527 | MODULE_AUTHOR("Qlogic & Jes Sorensen"); |
| 4793 | MODULE_DESCRIPTION("Qlogic ISP SCSI (qla1x80/qla1x160) driver"); | 4528 | MODULE_DESCRIPTION("Qlogic ISP SCSI (qla1x80/qla1x160) driver"); |
