forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/scsi/aic7xxx/aic7xxx_osm.c
....@@ -564,8 +564,6 @@
564564 struct scsi_target **ahc_targp = ahc_linux_target_in_softc(starget);
565565 unsigned short scsirate;
566566 struct ahc_devinfo devinfo;
567
- struct ahc_initiator_tinfo *tinfo;
568
- struct ahc_tmode_tstate *tstate;
569567 char channel = starget->channel + 'A';
570568 unsigned int our_id = ahc->our_id;
571569 unsigned int target_offset;
....@@ -612,9 +610,6 @@
612610 spi_max_offset(starget) = 0;
613611 spi_min_period(starget) =
614612 ahc_find_period(ahc, scsirate, maxsync);
615
-
616
- tinfo = ahc_fetch_transinfo(ahc, channel, ahc->our_id,
617
- starget->id, &tstate);
618613 }
619614 ahc_compile_devinfo(&devinfo, our_id, starget->id,
620615 CAM_LUN_WILDCARD, channel,
....@@ -671,10 +666,6 @@
671666 static int
672667 ahc_linux_slave_configure(struct scsi_device *sdev)
673668 {
674
- struct ahc_softc *ahc;
675
-
676
- ahc = *((struct ahc_softc **)sdev->host->hostdata);
677
-
678669 if (bootverbose)
679670 sdev_printk(KERN_INFO, sdev, "Slave Configure\n");
680671
....@@ -695,11 +686,9 @@
695686 ahc_linux_biosparam(struct scsi_device *sdev, struct block_device *bdev,
696687 sector_t capacity, int geom[])
697688 {
698
- uint8_t *bh;
699689 int heads;
700690 int sectors;
701691 int cylinders;
702
- int ret;
703692 int extended;
704693 struct ahc_softc *ahc;
705694 u_int channel;
....@@ -707,14 +696,9 @@
707696 ahc = *((struct ahc_softc **)sdev->host->hostdata);
708697 channel = sdev_channel(sdev);
709698
710
- bh = scsi_bios_ptable(bdev);
711
- if (bh) {
712
- ret = scsi_partsize(bh, capacity,
713
- &geom[2], &geom[0], &geom[1]);
714
- kfree(bh);
715
- if (ret != -1)
716
- return (ret);
717
- }
699
+ if (scsi_partsize(bdev, capacity, geom))
700
+ return 0;
701
+
718702 heads = 64;
719703 sectors = 32;
720704 cylinders = aic_sector_div(capacity, heads, sectors);
....@@ -746,7 +730,7 @@
746730 int error;
747731
748732 error = ahc_linux_queue_recovery_cmd(cmd, SCB_ABORT);
749
- if (error != 0)
733
+ if (error != SUCCESS)
750734 printk("aic7xxx_abort returns 0x%x\n", error);
751735 return (error);
752736 }
....@@ -760,7 +744,7 @@
760744 int error;
761745
762746 error = ahc_linux_queue_recovery_cmd(cmd, SCB_DEVICE_RESET);
763
- if (error != 0)
747
+ if (error != SUCCESS)
764748 printk("aic7xxx_dev_reset returns 0x%x\n", error);
765749 return (error);
766750 }
....@@ -807,7 +791,6 @@
807791 .this_id = -1,
808792 .max_sectors = 8192,
809793 .cmd_per_lun = 2,
810
- .use_clustering = ENABLE_CLUSTERING,
811794 .slave_alloc = ahc_linux_slave_alloc,
812795 .slave_configure = ahc_linux_slave_configure,
813796 .target_alloc = ahc_linux_target_alloc,
....@@ -1609,7 +1592,6 @@
16091592 case AC_TRANSFER_NEG:
16101593 {
16111594 struct scsi_target *starget;
1612
- struct ahc_linux_target *targ;
16131595 struct ahc_initiator_tinfo *tinfo;
16141596 struct ahc_tmode_tstate *tstate;
16151597 int target_offset;
....@@ -1643,7 +1625,6 @@
16431625 starget = ahc->platform_data->starget[target_offset];
16441626 if (starget == NULL)
16451627 break;
1646
- targ = scsi_transport_target_data(starget);
16471628
16481629 target_ppr_options =
16491630 (spi_dt(starget) ? MSG_EXT_PPR_DT_REQ : 0)
....@@ -1730,10 +1711,12 @@
17301711 */
17311712 cmd->sense_buffer[0] = 0;
17321713 if (ahc_get_transaction_status(scb) == CAM_REQ_INPROG) {
1714
+#ifdef AHC_REPORT_UNDERFLOWS
17331715 uint32_t amount_xferred;
17341716
17351717 amount_xferred =
17361718 ahc_get_transfer_length(scb) - ahc_get_residual(scb);
1719
+#endif
17371720 if ((scb->flags & SCB_TRANSMISSION_ERROR) != 0) {
17381721 #ifdef AHC_DEBUG
17391722 if ((ahc_debug & AHC_SHOW_MISC) != 0) {