diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2015-02-06 17:11:25 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-04-09 21:06:22 -0400 |
commit | e98878f737293d8c43e5e5982f3cd4317c423ba5 (patch) | |
tree | 9e126a4e62a2cde10ae8012760ae33ab8eaba72b | |
parent | 10be62506f5dd8013bf76f168c89ed4f7608c4d4 (diff) |
aha1542: Remove HOSTDATA macro
Remove HOSTDATA macro and use shost_priv instead
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
-rw-r--r-- | drivers/scsi/aha1542.c | 114 |
1 files changed, 55 insertions, 59 deletions
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index 197480de2152..ebf54b5c3f2b 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c | |||
@@ -118,8 +118,6 @@ struct aha1542_hostdata { | |||
118 | struct ccb ccb[AHA1542_MAILBOXES]; | 118 | struct ccb ccb[AHA1542_MAILBOXES]; |
119 | }; | 119 | }; |
120 | 120 | ||
121 | #define HOSTDATA(host) ((struct aha1542_hostdata *) &host->hostdata) | ||
122 | |||
123 | static DEFINE_SPINLOCK(aha1542_lock); | 121 | static DEFINE_SPINLOCK(aha1542_lock); |
124 | 122 | ||
125 | 123 | ||
@@ -382,6 +380,7 @@ static irqreturn_t do_aha1542_intr_handle(int dummy, void *dev_id) | |||
382 | /* A "high" level interrupt handler */ | 380 | /* A "high" level interrupt handler */ |
383 | static void aha1542_intr_handle(struct Scsi_Host *shost) | 381 | static void aha1542_intr_handle(struct Scsi_Host *shost) |
384 | { | 382 | { |
383 | struct aha1542_hostdata *aha1542 = shost_priv(shost); | ||
385 | void (*my_done) (Scsi_Cmnd *) = NULL; | 384 | void (*my_done) (Scsi_Cmnd *) = NULL; |
386 | int errstatus, mbi, mbo, mbistatus; | 385 | int errstatus, mbi, mbo, mbistatus; |
387 | int number_serviced; | 386 | int number_serviced; |
@@ -389,11 +388,8 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) | |||
389 | Scsi_Cmnd *SCtmp; | 388 | Scsi_Cmnd *SCtmp; |
390 | int flag; | 389 | int flag; |
391 | int needs_restart; | 390 | int needs_restart; |
392 | struct mailbox *mb; | 391 | struct mailbox *mb = aha1542->mb; |
393 | struct ccb *ccb; | 392 | struct ccb *ccb = aha1542->ccb; |
394 | |||
395 | mb = HOSTDATA(shost)->mb; | ||
396 | ccb = HOSTDATA(shost)->ccb; | ||
397 | 393 | ||
398 | #ifdef DEBUG | 394 | #ifdef DEBUG |
399 | { | 395 | { |
@@ -435,7 +431,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) | |||
435 | aha1542_intr_reset(shost->io_port); | 431 | aha1542_intr_reset(shost->io_port); |
436 | 432 | ||
437 | spin_lock_irqsave(&aha1542_lock, flags); | 433 | spin_lock_irqsave(&aha1542_lock, flags); |
438 | mbi = HOSTDATA(shost)->aha1542_last_mbi_used + 1; | 434 | mbi = aha1542->aha1542_last_mbi_used + 1; |
439 | if (mbi >= 2 * AHA1542_MAILBOXES) | 435 | if (mbi >= 2 * AHA1542_MAILBOXES) |
440 | mbi = AHA1542_MAILBOXES; | 436 | mbi = AHA1542_MAILBOXES; |
441 | 437 | ||
@@ -445,7 +441,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) | |||
445 | mbi++; | 441 | mbi++; |
446 | if (mbi >= 2 * AHA1542_MAILBOXES) | 442 | if (mbi >= 2 * AHA1542_MAILBOXES) |
447 | mbi = AHA1542_MAILBOXES; | 443 | mbi = AHA1542_MAILBOXES; |
448 | } while (mbi != HOSTDATA(shost)->aha1542_last_mbi_used); | 444 | } while (mbi != aha1542->aha1542_last_mbi_used); |
449 | 445 | ||
450 | if (mb[mbi].status == 0) { | 446 | if (mb[mbi].status == 0) { |
451 | spin_unlock_irqrestore(&aha1542_lock, flags); | 447 | spin_unlock_irqrestore(&aha1542_lock, flags); |
@@ -462,7 +458,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) | |||
462 | mbo = (scsi2int(mb[mbi].ccbptr) - (isa_virt_to_bus(&ccb[0]))) / sizeof(struct ccb); | 458 | mbo = (scsi2int(mb[mbi].ccbptr) - (isa_virt_to_bus(&ccb[0]))) / sizeof(struct ccb); |
463 | mbistatus = mb[mbi].status; | 459 | mbistatus = mb[mbi].status; |
464 | mb[mbi].status = 0; | 460 | mb[mbi].status = 0; |
465 | HOSTDATA(shost)->aha1542_last_mbi_used = mbi; | 461 | aha1542->aha1542_last_mbi_used = mbi; |
466 | spin_unlock_irqrestore(&aha1542_lock, flags); | 462 | spin_unlock_irqrestore(&aha1542_lock, flags); |
467 | 463 | ||
468 | #ifdef DEBUG | 464 | #ifdef DEBUG |
@@ -480,7 +476,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) | |||
480 | printk(KERN_DEBUG "...done %d %d\n", mbo, mbi); | 476 | printk(KERN_DEBUG "...done %d %d\n", mbo, mbi); |
481 | #endif | 477 | #endif |
482 | 478 | ||
483 | SCtmp = HOSTDATA(shost)->SCint[mbo]; | 479 | SCtmp = aha1542->SCint[mbo]; |
484 | 480 | ||
485 | if (!SCtmp || !SCtmp->scsi_done) { | 481 | if (!SCtmp || !SCtmp->scsi_done) { |
486 | printk(KERN_WARNING "aha1542_intr_handle: Unexpected interrupt\n"); | 482 | printk(KERN_WARNING "aha1542_intr_handle: Unexpected interrupt\n"); |
@@ -533,8 +529,8 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) | |||
533 | } | 529 | } |
534 | DEB(if (errstatus) printk("aha1542_intr_handle: returning %6x\n", errstatus)); | 530 | DEB(if (errstatus) printk("aha1542_intr_handle: returning %6x\n", errstatus)); |
535 | SCtmp->result = errstatus; | 531 | SCtmp->result = errstatus; |
536 | HOSTDATA(shost)->SCint[mbo] = NULL; /* This effectively frees up the mailbox slot, as | 532 | aha1542->SCint[mbo] = NULL; /* This effectively frees up the mailbox slot, as |
537 | far as queuecommand is concerned */ | 533 | far as queuecommand is concerned */ |
538 | my_done(SCtmp); | 534 | my_done(SCtmp); |
539 | number_serviced++; | 535 | number_serviced++; |
540 | }; | 536 | }; |
@@ -542,6 +538,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) | |||
542 | 538 | ||
543 | static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) | 539 | static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) |
544 | { | 540 | { |
541 | struct aha1542_hostdata *aha1542 = shost_priv(SCpnt->device->host); | ||
545 | unchar ahacmd = CMD_START_SCSI; | 542 | unchar ahacmd = CMD_START_SCSI; |
546 | unchar direction; | 543 | unchar direction; |
547 | unchar *cmd = (unchar *) SCpnt->cmnd; | 544 | unchar *cmd = (unchar *) SCpnt->cmnd; |
@@ -550,14 +547,11 @@ static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd * | |||
550 | unsigned long flags; | 547 | unsigned long flags; |
551 | int bufflen = scsi_bufflen(SCpnt); | 548 | int bufflen = scsi_bufflen(SCpnt); |
552 | int mbo; | 549 | int mbo; |
553 | struct mailbox *mb; | 550 | struct mailbox *mb = aha1542->mb; |
554 | struct ccb *ccb; | 551 | struct ccb *ccb = aha1542->ccb; |
555 | 552 | ||
556 | DEB(int i); | 553 | DEB(int i); |
557 | 554 | ||
558 | mb = HOSTDATA(SCpnt->device->host)->mb; | ||
559 | ccb = HOSTDATA(SCpnt->device->host)->ccb; | ||
560 | |||
561 | DEB(if (target > 1) { | 555 | DEB(if (target > 1) { |
562 | SCpnt->result = DID_TIME_OUT << 16; | 556 | SCpnt->result = DID_TIME_OUT << 16; |
563 | done(SCpnt); return 0; | 557 | done(SCpnt); return 0; |
@@ -593,25 +587,25 @@ static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd * | |||
593 | is how the host adapter will scan for them */ | 587 | is how the host adapter will scan for them */ |
594 | 588 | ||
595 | spin_lock_irqsave(&aha1542_lock, flags); | 589 | spin_lock_irqsave(&aha1542_lock, flags); |
596 | mbo = HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used + 1; | 590 | mbo = aha1542->aha1542_last_mbo_used + 1; |
597 | if (mbo >= AHA1542_MAILBOXES) | 591 | if (mbo >= AHA1542_MAILBOXES) |
598 | mbo = 0; | 592 | mbo = 0; |
599 | 593 | ||
600 | do { | 594 | do { |
601 | if (mb[mbo].status == 0 && HOSTDATA(SCpnt->device->host)->SCint[mbo] == NULL) | 595 | if (mb[mbo].status == 0 && aha1542->SCint[mbo] == NULL) |
602 | break; | 596 | break; |
603 | mbo++; | 597 | mbo++; |
604 | if (mbo >= AHA1542_MAILBOXES) | 598 | if (mbo >= AHA1542_MAILBOXES) |
605 | mbo = 0; | 599 | mbo = 0; |
606 | } while (mbo != HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used); | 600 | } while (mbo != aha1542->aha1542_last_mbo_used); |
607 | 601 | ||
608 | if (mb[mbo].status || HOSTDATA(SCpnt->device->host)->SCint[mbo]) | 602 | if (mb[mbo].status || aha1542->SCint[mbo]) |
609 | panic("Unable to find empty mailbox for aha1542.\n"); | 603 | panic("Unable to find empty mailbox for aha1542.\n"); |
610 | 604 | ||
611 | HOSTDATA(SCpnt->device->host)->SCint[mbo] = SCpnt; /* This will effectively prevent someone else from | 605 | aha1542->SCint[mbo] = SCpnt; /* This will effectively prevent someone else from |
612 | screwing with this cdb. */ | 606 | screwing with this cdb. */ |
613 | 607 | ||
614 | HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used = mbo; | 608 | aha1542->aha1542_last_mbo_used = mbo; |
615 | spin_unlock_irqrestore(&aha1542_lock, flags); | 609 | spin_unlock_irqrestore(&aha1542_lock, flags); |
616 | 610 | ||
617 | #ifdef DEBUG | 611 | #ifdef DEBUG |
@@ -645,7 +639,7 @@ static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd * | |||
645 | cptr = (struct chain *) SCpnt->host_scribble; | 639 | cptr = (struct chain *) SCpnt->host_scribble; |
646 | if (cptr == NULL) { | 640 | if (cptr == NULL) { |
647 | /* free the claimed mailbox slot */ | 641 | /* free the claimed mailbox slot */ |
648 | HOSTDATA(SCpnt->device->host)->SCint[mbo] = NULL; | 642 | aha1542->SCint[mbo] = NULL; |
649 | return SCSI_MLQUEUE_HOST_BUSY; | 643 | return SCSI_MLQUEUE_HOST_BUSY; |
650 | } | 644 | } |
651 | scsi_for_each_sg(SCpnt, sg, sg_count, i) { | 645 | scsi_for_each_sg(SCpnt, sg, sg_count, i) { |
@@ -699,15 +693,13 @@ static DEF_SCSI_QCMD(aha1542_queuecommand) | |||
699 | /* Initialize mailboxes */ | 693 | /* Initialize mailboxes */ |
700 | static void setup_mailboxes(int bse, struct Scsi_Host *shpnt) | 694 | static void setup_mailboxes(int bse, struct Scsi_Host *shpnt) |
701 | { | 695 | { |
696 | struct aha1542_hostdata *aha1542 = shost_priv(shpnt); | ||
702 | int i; | 697 | int i; |
703 | struct mailbox *mb; | 698 | struct mailbox *mb = aha1542->mb; |
704 | struct ccb *ccb; | 699 | struct ccb *ccb = aha1542->ccb; |
705 | 700 | ||
706 | unchar cmd[5] = { CMD_MBINIT, AHA1542_MAILBOXES, 0, 0, 0}; | 701 | unchar cmd[5] = { CMD_MBINIT, AHA1542_MAILBOXES, 0, 0, 0}; |
707 | 702 | ||
708 | mb = HOSTDATA(shpnt)->mb; | ||
709 | ccb = HOSTDATA(shpnt)->ccb; | ||
710 | |||
711 | for (i = 0; i < AHA1542_MAILBOXES; i++) { | 703 | for (i = 0; i < AHA1542_MAILBOXES; i++) { |
712 | mb[i].status = mb[AHA1542_MAILBOXES + i].status = 0; | 704 | mb[i].status = mb[AHA1542_MAILBOXES + i].status = 0; |
713 | any2scsi(mb[i].ccbptr, isa_virt_to_bus(&ccb[i])); | 705 | any2scsi(mb[i].ccbptr, isa_virt_to_bus(&ccb[i])); |
@@ -951,6 +943,7 @@ static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct | |||
951 | unsigned int base_io; | 943 | unsigned int base_io; |
952 | int trans; | 944 | int trans; |
953 | struct Scsi_Host *shpnt = NULL; | 945 | struct Scsi_Host *shpnt = NULL; |
946 | struct aha1542_hostdata *aha1542; | ||
954 | 947 | ||
955 | DEB(printk("aha1542_detect: \n")); | 948 | DEB(printk("aha1542_detect: \n")); |
956 | 949 | ||
@@ -964,6 +957,7 @@ static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct | |||
964 | release_region(bases[indx], 4); | 957 | release_region(bases[indx], 4); |
965 | return NULL; | 958 | return NULL; |
966 | } | 959 | } |
960 | aha1542 = shost_priv(shpnt); | ||
967 | if (!aha1542_test_port(bases[indx], shpnt)) | 961 | if (!aha1542_test_port(bases[indx], shpnt)) |
968 | goto unregister; | 962 | goto unregister; |
969 | 963 | ||
@@ -1040,12 +1034,12 @@ fail: | |||
1040 | shpnt->n_io_port = 4; /* Number of bytes of I/O space used */ | 1034 | shpnt->n_io_port = 4; /* Number of bytes of I/O space used */ |
1041 | shpnt->dma_channel = dma_chan; | 1035 | shpnt->dma_channel = dma_chan; |
1042 | shpnt->irq = irq_level; | 1036 | shpnt->irq = irq_level; |
1043 | HOSTDATA(shpnt)->bios_translation = trans; | 1037 | aha1542->bios_translation = trans; |
1044 | if (trans == BIOS_TRANSLATION_25563) | 1038 | if (trans == BIOS_TRANSLATION_25563) |
1045 | printk(KERN_INFO "aha1542.c: Using extended bios translation\n"); | 1039 | printk(KERN_INFO "aha1542.c: Using extended bios translation\n"); |
1046 | HOSTDATA(shpnt)->aha1542_last_mbi_used = (2 * AHA1542_MAILBOXES - 1); | 1040 | aha1542->aha1542_last_mbi_used = (2 * AHA1542_MAILBOXES - 1); |
1047 | HOSTDATA(shpnt)->aha1542_last_mbo_used = (AHA1542_MAILBOXES - 1); | 1041 | aha1542->aha1542_last_mbo_used = (AHA1542_MAILBOXES - 1); |
1048 | memset(HOSTDATA(shpnt)->SCint, 0, sizeof(HOSTDATA(shpnt)->SCint)); | 1042 | memset(aha1542->SCint, 0, sizeof(aha1542->SCint)); |
1049 | spin_unlock_irqrestore(&aha1542_lock, flags); | 1043 | spin_unlock_irqrestore(&aha1542_lock, flags); |
1050 | 1044 | ||
1051 | if (scsi_add_host(shpnt, pdev)) { | 1045 | if (scsi_add_host(shpnt, pdev)) { |
@@ -1083,12 +1077,13 @@ static int aha1542_release(struct Scsi_Host *shost) | |||
1083 | 1077 | ||
1084 | static int aha1542_restart(struct Scsi_Host *shost) | 1078 | static int aha1542_restart(struct Scsi_Host *shost) |
1085 | { | 1079 | { |
1080 | struct aha1542_hostdata *aha1542 = shost_priv(shost); | ||
1086 | int i; | 1081 | int i; |
1087 | int count = 0; | 1082 | int count = 0; |
1088 | 1083 | ||
1089 | for (i = 0; i < AHA1542_MAILBOXES; i++) | 1084 | for (i = 0; i < AHA1542_MAILBOXES; i++) |
1090 | if (HOSTDATA(shost)->SCint[i] && | 1085 | if (aha1542->SCint[i] && |
1091 | !(HOSTDATA(shost)->SCint[i]->device->soft_reset)) { | 1086 | !(aha1542->SCint[i]->device->soft_reset)) { |
1092 | count++; | 1087 | count++; |
1093 | } | 1088 | } |
1094 | printk(KERN_DEBUG "Potential to restart %d stalled commands...\n", count); | 1089 | printk(KERN_DEBUG "Potential to restart %d stalled commands...\n", count); |
@@ -1102,38 +1097,36 @@ static int aha1542_restart(struct Scsi_Host *shost) | |||
1102 | */ | 1097 | */ |
1103 | static int aha1542_dev_reset(Scsi_Cmnd * SCpnt) | 1098 | static int aha1542_dev_reset(Scsi_Cmnd * SCpnt) |
1104 | { | 1099 | { |
1100 | struct aha1542_hostdata *aha1542 = shost_priv(SCpnt->device->host); | ||
1105 | unsigned long flags; | 1101 | unsigned long flags; |
1106 | struct mailbox *mb; | 1102 | struct mailbox *mb = aha1542->mb; |
1107 | unchar target = SCpnt->device->id; | 1103 | unchar target = SCpnt->device->id; |
1108 | unchar lun = SCpnt->device->lun; | 1104 | unchar lun = SCpnt->device->lun; |
1109 | int mbo; | 1105 | int mbo; |
1110 | struct ccb *ccb; | 1106 | struct ccb *ccb = aha1542->ccb; |
1111 | unchar ahacmd = CMD_START_SCSI; | 1107 | unchar ahacmd = CMD_START_SCSI; |
1112 | 1108 | ||
1113 | ccb = HOSTDATA(SCpnt->device->host)->ccb; | ||
1114 | mb = HOSTDATA(SCpnt->device->host)->mb; | ||
1115 | |||
1116 | spin_lock_irqsave(&aha1542_lock, flags); | 1109 | spin_lock_irqsave(&aha1542_lock, flags); |
1117 | mbo = HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used + 1; | 1110 | mbo = aha1542->aha1542_last_mbo_used + 1; |
1118 | if (mbo >= AHA1542_MAILBOXES) | 1111 | if (mbo >= AHA1542_MAILBOXES) |
1119 | mbo = 0; | 1112 | mbo = 0; |
1120 | 1113 | ||
1121 | do { | 1114 | do { |
1122 | if (mb[mbo].status == 0 && HOSTDATA(SCpnt->device->host)->SCint[mbo] == NULL) | 1115 | if (mb[mbo].status == 0 && aha1542->SCint[mbo] == NULL) |
1123 | break; | 1116 | break; |
1124 | mbo++; | 1117 | mbo++; |
1125 | if (mbo >= AHA1542_MAILBOXES) | 1118 | if (mbo >= AHA1542_MAILBOXES) |
1126 | mbo = 0; | 1119 | mbo = 0; |
1127 | } while (mbo != HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used); | 1120 | } while (mbo != aha1542->aha1542_last_mbo_used); |
1128 | 1121 | ||
1129 | if (mb[mbo].status || HOSTDATA(SCpnt->device->host)->SCint[mbo]) | 1122 | if (mb[mbo].status || aha1542->SCint[mbo]) |
1130 | panic("Unable to find empty mailbox for aha1542.\n"); | 1123 | panic("Unable to find empty mailbox for aha1542.\n"); |
1131 | 1124 | ||
1132 | HOSTDATA(SCpnt->device->host)->SCint[mbo] = SCpnt; /* This will effectively | 1125 | aha1542->SCint[mbo] = SCpnt; /* This will effectively |
1133 | prevent someone else from | 1126 | prevent someone else from |
1134 | screwing with this cdb. */ | 1127 | screwing with this cdb. */ |
1135 | 1128 | ||
1136 | HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used = mbo; | 1129 | aha1542->aha1542_last_mbo_used = mbo; |
1137 | spin_unlock_irqrestore(&aha1542_lock, flags); | 1130 | spin_unlock_irqrestore(&aha1542_lock, flags); |
1138 | 1131 | ||
1139 | any2scsi(mb[mbo].ccbptr, isa_virt_to_bus(&ccb[mbo])); /* This gets trashed for some reason */ | 1132 | any2scsi(mb[mbo].ccbptr, isa_virt_to_bus(&ccb[mbo])); /* This gets trashed for some reason */ |
@@ -1161,6 +1154,7 @@ static int aha1542_dev_reset(Scsi_Cmnd * SCpnt) | |||
1161 | 1154 | ||
1162 | static int aha1542_bus_reset(Scsi_Cmnd * SCpnt) | 1155 | static int aha1542_bus_reset(Scsi_Cmnd * SCpnt) |
1163 | { | 1156 | { |
1157 | struct aha1542_hostdata *aha1542 = shost_priv(SCpnt->device->host); | ||
1164 | int i; | 1158 | int i; |
1165 | 1159 | ||
1166 | /* | 1160 | /* |
@@ -1194,9 +1188,9 @@ static int aha1542_bus_reset(Scsi_Cmnd * SCpnt) | |||
1194 | printk(KERN_WARNING "Sent BUS RESET to scsi host %d\n", SCpnt->device->host->host_no); | 1188 | printk(KERN_WARNING "Sent BUS RESET to scsi host %d\n", SCpnt->device->host->host_no); |
1195 | 1189 | ||
1196 | for (i = 0; i < AHA1542_MAILBOXES; i++) { | 1190 | for (i = 0; i < AHA1542_MAILBOXES; i++) { |
1197 | if (HOSTDATA(SCpnt->device->host)->SCint[i] != NULL) { | 1191 | if (aha1542->SCint[i] != NULL) { |
1198 | Scsi_Cmnd *SCtmp; | 1192 | Scsi_Cmnd *SCtmp; |
1199 | SCtmp = HOSTDATA(SCpnt->device->host)->SCint[i]; | 1193 | SCtmp = aha1542->SCint[i]; |
1200 | 1194 | ||
1201 | 1195 | ||
1202 | if (SCtmp->device->soft_reset) { | 1196 | if (SCtmp->device->soft_reset) { |
@@ -1210,8 +1204,8 @@ static int aha1542_bus_reset(Scsi_Cmnd * SCpnt) | |||
1210 | } | 1204 | } |
1211 | kfree(SCtmp->host_scribble); | 1205 | kfree(SCtmp->host_scribble); |
1212 | SCtmp->host_scribble = NULL; | 1206 | SCtmp->host_scribble = NULL; |
1213 | HOSTDATA(SCpnt->device->host)->SCint[i] = NULL; | 1207 | aha1542->SCint[i] = NULL; |
1214 | HOSTDATA(SCpnt->device->host)->mb[i].status = 0; | 1208 | aha1542->mb[i].status = 0; |
1215 | } | 1209 | } |
1216 | } | 1210 | } |
1217 | 1211 | ||
@@ -1225,6 +1219,7 @@ fail: | |||
1225 | 1219 | ||
1226 | static int aha1542_host_reset(Scsi_Cmnd * SCpnt) | 1220 | static int aha1542_host_reset(Scsi_Cmnd * SCpnt) |
1227 | { | 1221 | { |
1222 | struct aha1542_hostdata *aha1542 = shost_priv(SCpnt->device->host); | ||
1228 | int i; | 1223 | int i; |
1229 | 1224 | ||
1230 | /* | 1225 | /* |
@@ -1263,9 +1258,9 @@ static int aha1542_host_reset(Scsi_Cmnd * SCpnt) | |||
1263 | printk(KERN_WARNING "Sent BUS RESET to scsi host %d\n", SCpnt->device->host->host_no); | 1258 | printk(KERN_WARNING "Sent BUS RESET to scsi host %d\n", SCpnt->device->host->host_no); |
1264 | 1259 | ||
1265 | for (i = 0; i < AHA1542_MAILBOXES; i++) { | 1260 | for (i = 0; i < AHA1542_MAILBOXES; i++) { |
1266 | if (HOSTDATA(SCpnt->device->host)->SCint[i] != NULL) { | 1261 | if (aha1542->SCint[i] != NULL) { |
1267 | Scsi_Cmnd *SCtmp; | 1262 | Scsi_Cmnd *SCtmp; |
1268 | SCtmp = HOSTDATA(SCpnt->device->host)->SCint[i]; | 1263 | SCtmp = aha1542->SCint[i]; |
1269 | 1264 | ||
1270 | if (SCtmp->device->soft_reset) { | 1265 | if (SCtmp->device->soft_reset) { |
1271 | /* | 1266 | /* |
@@ -1278,8 +1273,8 @@ static int aha1542_host_reset(Scsi_Cmnd * SCpnt) | |||
1278 | } | 1273 | } |
1279 | kfree(SCtmp->host_scribble); | 1274 | kfree(SCtmp->host_scribble); |
1280 | SCtmp->host_scribble = NULL; | 1275 | SCtmp->host_scribble = NULL; |
1281 | HOSTDATA(SCpnt->device->host)->SCint[i] = NULL; | 1276 | aha1542->SCint[i] = NULL; |
1282 | HOSTDATA(SCpnt->device->host)->mb[i].status = 0; | 1277 | aha1542->mb[i].status = 0; |
1283 | } | 1278 | } |
1284 | } | 1279 | } |
1285 | 1280 | ||
@@ -1294,10 +1289,11 @@ fail: | |||
1294 | static int aha1542_biosparam(struct scsi_device *sdev, | 1289 | static int aha1542_biosparam(struct scsi_device *sdev, |
1295 | struct block_device *bdev, sector_t capacity, int *ip) | 1290 | struct block_device *bdev, sector_t capacity, int *ip) |
1296 | { | 1291 | { |
1292 | struct aha1542_hostdata *aha1542 = shost_priv(sdev->host); | ||
1297 | int translation_algorithm; | 1293 | int translation_algorithm; |
1298 | int size = capacity; | 1294 | int size = capacity; |
1299 | 1295 | ||
1300 | translation_algorithm = HOSTDATA(sdev->host)->bios_translation; | 1296 | translation_algorithm = aha1542->bios_translation; |
1301 | 1297 | ||
1302 | if ((size >> 11) > 1024 && translation_algorithm == BIOS_TRANSLATION_25563) { | 1298 | if ((size >> 11) > 1024 && translation_algorithm == BIOS_TRANSLATION_25563) { |
1303 | /* Please verify that this is the same as what DOS returns */ | 1299 | /* Please verify that this is the same as what DOS returns */ |