diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-06 20:48:34 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-06 20:48:34 -0400 |
| commit | bced13738405b62c8203df9c103d4ba63d747872 (patch) | |
| tree | 566795dc7493591182668a94855487dff034a2b3 /drivers/scsi/ibmvscsi/ibmvscsi.c | |
| parent | 21f16289270447673a7263ccc0b22d562fb01ecb (diff) | |
| parent | 2b053729a84b6aac197df51b8729bc9fec743bff (diff) | |
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: (32 commits)
[SCSI] aacraid: prevent panic on adapter resource failure
[SCSI] aha152x: use data accessors and !use_sg cleanup
[SCSI] aha152x: Fix check_condition code-path
[SCSI] aha152x: Clean Reset path
[SCSI] aha152x: preliminary fixes and some comments
[SCSI] aha152x: use bounce buffer
[SCSI] aha152x: fix debug mode symbol conflict
[SCSI] sd: disentangle barriers in SCSI
[SCSI] lpfc : scsi command accessor fix for 8.2.2
[SCSI] qlogicpti: Some cosmetic changes
[SCSI] lpfc 8.2.2 : Change version number to 8.2.2
[SCSI] lpfc 8.2.2 : Style cleanups
[SCSI] lpfc 8.2.2 : Miscellaneous Bug Fixes
[SCSI] lpfc 8.2.2 : Miscellaneous management and logging mods
[SCSI] lpfc 8.2.2 : Rework the lpfc_printf_log() macro
[SCSI] lpfc 8.2.2 : Attribute and Parameter splits for vport and physical port
[SCSI] lpfc 8.2.2 : Fix locking around HBA's port_list
[SCSI] lpfc 8.2.2 : Error messages and debugfs updates
[SCSI] initialize shost_data to zero
[SCSI] mptsas: add SMP passthrough support via bsg
...
Diffstat (limited to 'drivers/scsi/ibmvscsi/ibmvscsi.c')
| -rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 5870866abc99..5ecc63d1b436 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
| @@ -393,12 +393,6 @@ static int map_sg_data(struct scsi_cmnd *cmd, | |||
| 393 | return 1; | 393 | return 1; |
| 394 | else if (sg_mapped < 0) | 394 | else if (sg_mapped < 0) |
| 395 | return 0; | 395 | return 0; |
| 396 | else if (sg_mapped > SG_ALL) { | ||
| 397 | printk(KERN_ERR | ||
| 398 | "ibmvscsi: More than %d mapped sg entries, got %d\n", | ||
| 399 | SG_ALL, sg_mapped); | ||
| 400 | return 0; | ||
| 401 | } | ||
| 402 | 396 | ||
| 403 | set_srp_direction(cmd, srp_cmd, sg_mapped); | 397 | set_srp_direction(cmd, srp_cmd, sg_mapped); |
| 404 | 398 | ||
| @@ -708,8 +702,7 @@ static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd, | |||
| 708 | struct srp_cmd *srp_cmd; | 702 | struct srp_cmd *srp_cmd; |
| 709 | struct srp_event_struct *evt_struct; | 703 | struct srp_event_struct *evt_struct; |
| 710 | struct srp_indirect_buf *indirect; | 704 | struct srp_indirect_buf *indirect; |
| 711 | struct ibmvscsi_host_data *hostdata = | 705 | struct ibmvscsi_host_data *hostdata = shost_priv(cmnd->device->host); |
| 712 | (struct ibmvscsi_host_data *)&cmnd->device->host->hostdata; | ||
| 713 | u16 lun = lun_from_dev(cmnd->device); | 706 | u16 lun = lun_from_dev(cmnd->device); |
| 714 | u8 out_fmt, in_fmt; | 707 | u8 out_fmt, in_fmt; |
| 715 | 708 | ||
| @@ -960,8 +953,7 @@ static void sync_completion(struct srp_event_struct *evt_struct) | |||
| 960 | */ | 953 | */ |
| 961 | static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) | 954 | static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) |
| 962 | { | 955 | { |
| 963 | struct ibmvscsi_host_data *hostdata = | 956 | struct ibmvscsi_host_data *hostdata = shost_priv(cmd->device->host); |
| 964 | (struct ibmvscsi_host_data *)cmd->device->host->hostdata; | ||
| 965 | struct srp_tsk_mgmt *tsk_mgmt; | 957 | struct srp_tsk_mgmt *tsk_mgmt; |
| 966 | struct srp_event_struct *evt; | 958 | struct srp_event_struct *evt; |
| 967 | struct srp_event_struct *tmp_evt, *found_evt; | 959 | struct srp_event_struct *tmp_evt, *found_evt; |
| @@ -1084,9 +1076,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) | |||
| 1084 | */ | 1076 | */ |
| 1085 | static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd) | 1077 | static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd) |
| 1086 | { | 1078 | { |
| 1087 | struct ibmvscsi_host_data *hostdata = | 1079 | struct ibmvscsi_host_data *hostdata = shost_priv(cmd->device->host); |
| 1088 | (struct ibmvscsi_host_data *)cmd->device->host->hostdata; | ||
| 1089 | |||
| 1090 | struct srp_tsk_mgmt *tsk_mgmt; | 1080 | struct srp_tsk_mgmt *tsk_mgmt; |
| 1091 | struct srp_event_struct *evt; | 1081 | struct srp_event_struct *evt; |
| 1092 | struct srp_event_struct *tmp_evt, *pos; | 1082 | struct srp_event_struct *tmp_evt, *pos; |
| @@ -1183,8 +1173,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd) | |||
| 1183 | static int ibmvscsi_eh_host_reset_handler(struct scsi_cmnd *cmd) | 1173 | static int ibmvscsi_eh_host_reset_handler(struct scsi_cmnd *cmd) |
| 1184 | { | 1174 | { |
| 1185 | unsigned long wait_switch = 0; | 1175 | unsigned long wait_switch = 0; |
| 1186 | struct ibmvscsi_host_data *hostdata = | 1176 | struct ibmvscsi_host_data *hostdata = shost_priv(cmd->device->host); |
| 1187 | (struct ibmvscsi_host_data *)cmd->device->host->hostdata; | ||
| 1188 | 1177 | ||
| 1189 | dev_err(hostdata->dev, "Resetting connection due to error recovery\n"); | 1178 | dev_err(hostdata->dev, "Resetting connection due to error recovery\n"); |
| 1190 | 1179 | ||
| @@ -1412,8 +1401,7 @@ static int ibmvscsi_change_queue_depth(struct scsi_device *sdev, int qdepth) | |||
| 1412 | static ssize_t show_host_srp_version(struct class_device *class_dev, char *buf) | 1401 | static ssize_t show_host_srp_version(struct class_device *class_dev, char *buf) |
| 1413 | { | 1402 | { |
| 1414 | struct Scsi_Host *shost = class_to_shost(class_dev); | 1403 | struct Scsi_Host *shost = class_to_shost(class_dev); |
| 1415 | struct ibmvscsi_host_data *hostdata = | 1404 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); |
| 1416 | (struct ibmvscsi_host_data *)shost->hostdata; | ||
| 1417 | int len; | 1405 | int len; |
| 1418 | 1406 | ||
| 1419 | len = snprintf(buf, PAGE_SIZE, "%s\n", | 1407 | len = snprintf(buf, PAGE_SIZE, "%s\n", |
| @@ -1433,8 +1421,7 @@ static ssize_t show_host_partition_name(struct class_device *class_dev, | |||
| 1433 | char *buf) | 1421 | char *buf) |
| 1434 | { | 1422 | { |
| 1435 | struct Scsi_Host *shost = class_to_shost(class_dev); | 1423 | struct Scsi_Host *shost = class_to_shost(class_dev); |
| 1436 | struct ibmvscsi_host_data *hostdata = | 1424 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); |
| 1437 | (struct ibmvscsi_host_data *)shost->hostdata; | ||
| 1438 | int len; | 1425 | int len; |
| 1439 | 1426 | ||
| 1440 | len = snprintf(buf, PAGE_SIZE, "%s\n", | 1427 | len = snprintf(buf, PAGE_SIZE, "%s\n", |
| @@ -1454,8 +1441,7 @@ static ssize_t show_host_partition_number(struct class_device *class_dev, | |||
| 1454 | char *buf) | 1441 | char *buf) |
| 1455 | { | 1442 | { |
| 1456 | struct Scsi_Host *shost = class_to_shost(class_dev); | 1443 | struct Scsi_Host *shost = class_to_shost(class_dev); |
| 1457 | struct ibmvscsi_host_data *hostdata = | 1444 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); |
| 1458 | (struct ibmvscsi_host_data *)shost->hostdata; | ||
| 1459 | int len; | 1445 | int len; |
| 1460 | 1446 | ||
| 1461 | len = snprintf(buf, PAGE_SIZE, "%d\n", | 1447 | len = snprintf(buf, PAGE_SIZE, "%d\n", |
| @@ -1474,8 +1460,7 @@ static struct class_device_attribute ibmvscsi_host_partition_number = { | |||
| 1474 | static ssize_t show_host_mad_version(struct class_device *class_dev, char *buf) | 1460 | static ssize_t show_host_mad_version(struct class_device *class_dev, char *buf) |
| 1475 | { | 1461 | { |
| 1476 | struct Scsi_Host *shost = class_to_shost(class_dev); | 1462 | struct Scsi_Host *shost = class_to_shost(class_dev); |
| 1477 | struct ibmvscsi_host_data *hostdata = | 1463 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); |
| 1478 | (struct ibmvscsi_host_data *)shost->hostdata; | ||
| 1479 | int len; | 1464 | int len; |
| 1480 | 1465 | ||
| 1481 | len = snprintf(buf, PAGE_SIZE, "%d\n", | 1466 | len = snprintf(buf, PAGE_SIZE, "%d\n", |
| @@ -1494,8 +1479,7 @@ static struct class_device_attribute ibmvscsi_host_mad_version = { | |||
| 1494 | static ssize_t show_host_os_type(struct class_device *class_dev, char *buf) | 1479 | static ssize_t show_host_os_type(struct class_device *class_dev, char *buf) |
| 1495 | { | 1480 | { |
| 1496 | struct Scsi_Host *shost = class_to_shost(class_dev); | 1481 | struct Scsi_Host *shost = class_to_shost(class_dev); |
| 1497 | struct ibmvscsi_host_data *hostdata = | 1482 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); |
| 1498 | (struct ibmvscsi_host_data *)shost->hostdata; | ||
| 1499 | int len; | 1483 | int len; |
| 1500 | 1484 | ||
| 1501 | len = snprintf(buf, PAGE_SIZE, "%d\n", hostdata->madapter_info.os_type); | 1485 | len = snprintf(buf, PAGE_SIZE, "%d\n", hostdata->madapter_info.os_type); |
| @@ -1513,8 +1497,7 @@ static struct class_device_attribute ibmvscsi_host_os_type = { | |||
| 1513 | static ssize_t show_host_config(struct class_device *class_dev, char *buf) | 1497 | static ssize_t show_host_config(struct class_device *class_dev, char *buf) |
| 1514 | { | 1498 | { |
| 1515 | struct Scsi_Host *shost = class_to_shost(class_dev); | 1499 | struct Scsi_Host *shost = class_to_shost(class_dev); |
| 1516 | struct ibmvscsi_host_data *hostdata = | 1500 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); |
| 1517 | (struct ibmvscsi_host_data *)shost->hostdata; | ||
| 1518 | 1501 | ||
| 1519 | /* returns null-terminated host config data */ | 1502 | /* returns null-terminated host config data */ |
| 1520 | if (ibmvscsi_do_host_config(hostdata, buf, PAGE_SIZE) == 0) | 1503 | if (ibmvscsi_do_host_config(hostdata, buf, PAGE_SIZE) == 0) |
| @@ -1582,7 +1565,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) | |||
| 1582 | goto scsi_host_alloc_failed; | 1565 | goto scsi_host_alloc_failed; |
| 1583 | } | 1566 | } |
| 1584 | 1567 | ||
| 1585 | hostdata = (struct ibmvscsi_host_data *)host->hostdata; | 1568 | hostdata = shost_priv(host); |
| 1586 | memset(hostdata, 0x00, sizeof(*hostdata)); | 1569 | memset(hostdata, 0x00, sizeof(*hostdata)); |
| 1587 | INIT_LIST_HEAD(&hostdata->sent); | 1570 | INIT_LIST_HEAD(&hostdata->sent); |
| 1588 | hostdata->host = host; | 1571 | hostdata->host = host; |
