Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: nsp_cs: Move the SCSI pointer to private command data

Set .cmd_size in the SCSI host template instead of using the SCSI pointer
in struct scsi_cmnd.
This patch prepares for removal of the SCSI pointer from struct scsi_cmnd.

Link: https://lore.kernel.org/r/20220218195117.25689-39-bvanassche@acm.org
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
ea39700f 195771c5

+114 -90
+112 -88
drivers/scsi/pcmcia/nsp_cs.c
··· 70 70 module_param(free_ports, bool, 0); 71 71 MODULE_PARM_DESC(free_ports, "Release IO ports after configuration? (default: 0 (=no))"); 72 72 73 + static struct scsi_pointer *nsp_priv(struct scsi_cmnd *cmd) 74 + { 75 + return scsi_cmd_priv(cmd); 76 + } 77 + 73 78 static struct scsi_host_template nsp_driver_template = { 74 79 .proc_name = "nsp_cs", 75 80 .show_info = nsp_show_info, ··· 88 83 .this_id = NSP_INITIATOR_ID, 89 84 .sg_tablesize = SG_ALL, 90 85 .dma_boundary = PAGE_SIZE - 1, 86 + .cmd_size = sizeof(struct scsi_pointer), 91 87 }; 92 88 93 89 static nsp_hw_data nsp_data_base; /* attach <-> detect glue */ ··· 186 180 scsi_done(SCpnt); 187 181 } 188 182 189 - static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt) 183 + static int nsp_queuecommand_lck(struct scsi_cmnd *const SCpnt) 190 184 { 185 + struct scsi_pointer *scsi_pointer = nsp_priv(SCpnt); 191 186 #ifdef NSP_DEBUG 192 187 /*unsigned int host_id = SCpnt->device->host->this_id;*/ 193 188 /*unsigned int base = SCpnt->device->host->io_port;*/ ··· 224 217 225 218 data->CurrentSC = SCpnt; 226 219 227 - SCpnt->SCp.Status = SAM_STAT_CHECK_CONDITION; 228 - SCpnt->SCp.Message = 0; 229 - SCpnt->SCp.have_data_in = IO_UNKNOWN; 230 - SCpnt->SCp.sent_command = 0; 231 - SCpnt->SCp.phase = PH_UNDETERMINED; 220 + scsi_pointer->Status = SAM_STAT_CHECK_CONDITION; 221 + scsi_pointer->Message = 0; 222 + scsi_pointer->have_data_in = IO_UNKNOWN; 223 + scsi_pointer->sent_command = 0; 224 + scsi_pointer->phase = PH_UNDETERMINED; 232 225 scsi_set_resid(SCpnt, scsi_bufflen(SCpnt)); 233 226 234 227 /* setup scratch area ··· 238 231 SCp.buffers_residual : left buffers in list 239 232 SCp.phase : current state of the command */ 240 233 if (scsi_bufflen(SCpnt)) { 241 - SCpnt->SCp.buffer = scsi_sglist(SCpnt); 242 - SCpnt->SCp.ptr = BUFFER_ADDR; 243 - SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length; 244 - SCpnt->SCp.buffers_residual = scsi_sg_count(SCpnt) - 1; 234 + scsi_pointer->buffer = scsi_sglist(SCpnt); 235 + scsi_pointer->ptr = BUFFER_ADDR(SCpnt); 236 + scsi_pointer->this_residual = scsi_pointer->buffer->length; 237 + scsi_pointer->buffers_residual = scsi_sg_count(SCpnt) - 1; 245 238 } else { 246 - SCpnt->SCp.ptr = NULL; 247 - SCpnt->SCp.this_residual = 0; 248 - SCpnt->SCp.buffer = NULL; 249 - SCpnt->SCp.buffers_residual = 0; 239 + scsi_pointer->ptr = NULL; 240 + scsi_pointer->this_residual = 0; 241 + scsi_pointer->buffer = NULL; 242 + scsi_pointer->buffers_residual = 0; 250 243 } 251 244 252 245 if (!nsphw_start_selection(SCpnt)) { ··· 360 353 /* 361 354 * Start selection phase 362 355 */ 363 - static bool nsphw_start_selection(struct scsi_cmnd *SCpnt) 356 + static bool nsphw_start_selection(struct scsi_cmnd *const SCpnt) 364 357 { 358 + struct scsi_pointer *scsi_pointer = nsp_priv(SCpnt); 365 359 unsigned int host_id = SCpnt->device->host->this_id; 366 360 unsigned int base = SCpnt->device->host->io_port; 367 361 unsigned char target = scmd_id(SCpnt); ··· 380 372 381 373 /* start arbitration */ 382 374 //nsp_dbg(NSP_DEBUG_RESELECTION, "start arbit"); 383 - SCpnt->SCp.phase = PH_ARBSTART; 375 + scsi_pointer->phase = PH_ARBSTART; 384 376 nsp_index_write(base, SETARBIT, ARBIT_GO); 385 377 386 378 time_out = 1000; ··· 400 392 401 393 /* assert select line */ 402 394 //nsp_dbg(NSP_DEBUG_RESELECTION, "assert SEL line"); 403 - SCpnt->SCp.phase = PH_SELSTART; 395 + scsi_pointer->phase = PH_SELSTART; 404 396 udelay(3); /* wait 2.4us */ 405 397 nsp_index_write(base, SCSIDATALATCH, BIT(host_id) | BIT(target)); 406 398 nsp_index_write(base, SCSIBUSCTRL, SCSI_SEL | SCSI_BSY | SCSI_ATN); ··· 576 568 /* 577 569 * transfer SCSI message 578 570 */ 579 - static int nsp_xfer(struct scsi_cmnd *SCpnt, int phase) 571 + static int nsp_xfer(struct scsi_cmnd *const SCpnt, int phase) 580 572 { 573 + struct scsi_pointer *scsi_pointer = nsp_priv(SCpnt); 581 574 unsigned int base = SCpnt->device->host->io_port; 582 575 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; 583 576 char *buf = data->MsgBuffer; ··· 596 587 } 597 588 598 589 /* if last byte, negate ATN */ 599 - if (len == 1 && SCpnt->SCp.phase == PH_MSG_OUT) { 590 + if (len == 1 && scsi_pointer->phase == PH_MSG_OUT) { 600 591 nsp_index_write(base, SCSIBUSCTRL, AUTODIRECTION | ACKENB); 601 592 } 602 593 ··· 617 608 /* 618 609 * get extra SCSI data from fifo 619 610 */ 620 - static int nsp_dataphase_bypass(struct scsi_cmnd *SCpnt) 611 + static int nsp_dataphase_bypass(struct scsi_cmnd *const SCpnt) 621 612 { 613 + struct scsi_pointer *scsi_pointer = nsp_priv(SCpnt); 622 614 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; 623 615 unsigned int count; 624 616 625 617 //nsp_dbg(NSP_DEBUG_DATA_IO, "in"); 626 618 627 - if (SCpnt->SCp.have_data_in != IO_IN) { 619 + if (scsi_pointer->have_data_in != IO_IN) { 628 620 return 0; 629 621 } 630 622 ··· 640 630 * data phase skip only occures in case of SCSI_LOW_READ 641 631 */ 642 632 nsp_dbg(NSP_DEBUG_DATA_IO, "use bypass quirk"); 643 - SCpnt->SCp.phase = PH_DATA; 633 + scsi_pointer->phase = PH_DATA; 644 634 nsp_pio_read(SCpnt); 645 635 nsp_setup_fifo(data, false); 646 636 ··· 714 704 /* 715 705 * read data in DATA IN phase 716 706 */ 717 - static void nsp_pio_read(struct scsi_cmnd *SCpnt) 707 + static void nsp_pio_read(struct scsi_cmnd *const SCpnt) 718 708 { 709 + struct scsi_pointer *scsi_pointer = nsp_priv(SCpnt); 719 710 unsigned int base = SCpnt->device->host->io_port; 720 711 unsigned long mmio_base = SCpnt->device->host->base; 721 712 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; ··· 727 716 ocount = data->FifoCount; 728 717 729 718 nsp_dbg(NSP_DEBUG_DATA_IO, "in SCpnt=0x%p resid=%d ocount=%d ptr=0x%p this_residual=%d buffers=0x%p nbuf=%d", 730 - SCpnt, scsi_get_resid(SCpnt), ocount, SCpnt->SCp.ptr, 731 - SCpnt->SCp.this_residual, SCpnt->SCp.buffer, 732 - SCpnt->SCp.buffers_residual); 719 + SCpnt, scsi_get_resid(SCpnt), ocount, scsi_pointer->ptr, 720 + scsi_pointer->this_residual, scsi_pointer->buffer, 721 + scsi_pointer->buffers_residual); 733 722 734 723 time_out = 1000; 735 724 736 725 while ((time_out-- != 0) && 737 - (SCpnt->SCp.this_residual > 0 || SCpnt->SCp.buffers_residual > 0 ) ) { 726 + (scsi_pointer->this_residual > 0 || 727 + scsi_pointer->buffers_residual > 0)) { 738 728 739 729 stat = nsp_index_read(base, SCSIBUSMON); 740 730 stat &= BUSMON_PHASE_MASK; 741 731 742 732 743 733 res = nsp_fifo_count(SCpnt) - ocount; 744 - //nsp_dbg(NSP_DEBUG_DATA_IO, "ptr=0x%p this=0x%x ocount=0x%x res=0x%x", SCpnt->SCp.ptr, SCpnt->SCp.this_residual, ocount, res); 734 + //nsp_dbg(NSP_DEBUG_DATA_IO, "ptr=0x%p this=0x%x ocount=0x%x res=0x%x", scsi_pointer->ptr, scsi_pointer->this_residual, ocount, res); 745 735 if (res == 0) { /* if some data available ? */ 746 736 if (stat == BUSPHASE_DATA_IN) { /* phase changed? */ 747 - //nsp_dbg(NSP_DEBUG_DATA_IO, " wait for data this=%d", SCpnt->SCp.this_residual); 737 + //nsp_dbg(NSP_DEBUG_DATA_IO, " wait for data this=%d", scsi_pointer->this_residual); 748 738 continue; 749 739 } else { 750 740 nsp_dbg(NSP_DEBUG_DATA_IO, "phase changed stat=0x%x", stat); ··· 759 747 continue; 760 748 } 761 749 762 - res = min(res, SCpnt->SCp.this_residual); 750 + res = min(res, scsi_pointer->this_residual); 763 751 764 752 switch (data->TransferMode) { 765 753 case MODE_IO32: 766 754 res &= ~(BIT(1)|BIT(0)); /* align 4 */ 767 - nsp_fifo32_read(base, SCpnt->SCp.ptr, res >> 2); 755 + nsp_fifo32_read(base, scsi_pointer->ptr, res >> 2); 768 756 break; 769 757 case MODE_IO8: 770 - nsp_fifo8_read (base, SCpnt->SCp.ptr, res ); 758 + nsp_fifo8_read(base, scsi_pointer->ptr, res); 771 759 break; 772 760 773 761 case MODE_MEM32: 774 762 res &= ~(BIT(1)|BIT(0)); /* align 4 */ 775 - nsp_mmio_fifo32_read(mmio_base, SCpnt->SCp.ptr, res >> 2); 763 + nsp_mmio_fifo32_read(mmio_base, scsi_pointer->ptr, 764 + res >> 2); 776 765 break; 777 766 778 767 default: ··· 782 769 } 783 770 784 771 nsp_inc_resid(SCpnt, -res); 785 - SCpnt->SCp.ptr += res; 786 - SCpnt->SCp.this_residual -= res; 772 + scsi_pointer->ptr += res; 773 + scsi_pointer->this_residual -= res; 787 774 ocount += res; 788 - //nsp_dbg(NSP_DEBUG_DATA_IO, "ptr=0x%p this_residual=0x%x ocount=0x%x", SCpnt->SCp.ptr, SCpnt->SCp.this_residual, ocount); 775 + //nsp_dbg(NSP_DEBUG_DATA_IO, "ptr=0x%p this_residual=0x%x ocount=0x%x", scsi_pointer->ptr, scsi_pointer->this_residual, ocount); 789 776 790 777 /* go to next scatter list if available */ 791 - if (SCpnt->SCp.this_residual == 0 && 792 - SCpnt->SCp.buffers_residual != 0 ) { 778 + if (scsi_pointer->this_residual == 0 && 779 + scsi_pointer->buffers_residual != 0 ) { 793 780 //nsp_dbg(NSP_DEBUG_DATA_IO, "scatterlist next timeout=%d", time_out); 794 - SCpnt->SCp.buffers_residual--; 795 - SCpnt->SCp.buffer = sg_next(SCpnt->SCp.buffer); 796 - SCpnt->SCp.ptr = BUFFER_ADDR; 797 - SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length; 781 + scsi_pointer->buffers_residual--; 782 + scsi_pointer->buffer = sg_next(scsi_pointer->buffer); 783 + scsi_pointer->ptr = BUFFER_ADDR(SCpnt); 784 + scsi_pointer->this_residual = 785 + scsi_pointer->buffer->length; 798 786 time_out = 1000; 799 787 800 - //nsp_dbg(NSP_DEBUG_DATA_IO, "page: 0x%p, off: 0x%x", SCpnt->SCp.buffer->page, SCpnt->SCp.buffer->offset); 788 + //nsp_dbg(NSP_DEBUG_DATA_IO, "page: 0x%p, off: 0x%x", scsi_pointer->buffer->page, scsi_pointer->buffer->offset); 801 789 } 802 790 } 803 791 ··· 806 792 807 793 if (time_out < 0) { 808 794 nsp_msg(KERN_DEBUG, "pio read timeout resid=%d this_residual=%d buffers_residual=%d", 809 - scsi_get_resid(SCpnt), SCpnt->SCp.this_residual, 810 - SCpnt->SCp.buffers_residual); 795 + scsi_get_resid(SCpnt), scsi_pointer->this_residual, 796 + scsi_pointer->buffers_residual); 811 797 } 812 798 nsp_dbg(NSP_DEBUG_DATA_IO, "read ocount=0x%x", ocount); 813 799 nsp_dbg(NSP_DEBUG_DATA_IO, "r cmd=%d resid=0x%x\n", data->CmdId, ··· 819 805 */ 820 806 static void nsp_pio_write(struct scsi_cmnd *SCpnt) 821 807 { 808 + struct scsi_pointer *scsi_pointer = nsp_priv(SCpnt); 822 809 unsigned int base = SCpnt->device->host->io_port; 823 810 unsigned long mmio_base = SCpnt->device->host->base; 824 811 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; ··· 830 815 ocount = data->FifoCount; 831 816 832 817 nsp_dbg(NSP_DEBUG_DATA_IO, "in fifocount=%d ptr=0x%p this_residual=%d buffers=0x%p nbuf=%d resid=0x%x", 833 - data->FifoCount, SCpnt->SCp.ptr, SCpnt->SCp.this_residual, 834 - SCpnt->SCp.buffer, SCpnt->SCp.buffers_residual, 818 + data->FifoCount, scsi_pointer->ptr, scsi_pointer->this_residual, 819 + scsi_pointer->buffer, scsi_pointer->buffers_residual, 835 820 scsi_get_resid(SCpnt)); 836 821 837 822 time_out = 1000; 838 823 839 824 while ((time_out-- != 0) && 840 - (SCpnt->SCp.this_residual > 0 || SCpnt->SCp.buffers_residual > 0)) { 825 + (scsi_pointer->this_residual > 0 || 826 + scsi_pointer->buffers_residual > 0)) { 841 827 stat = nsp_index_read(base, SCSIBUSMON); 842 828 stat &= BUSMON_PHASE_MASK; 843 829 ··· 848 832 nsp_dbg(NSP_DEBUG_DATA_IO, "phase changed stat=0x%x, res=%d\n", stat, res); 849 833 /* Put back pointer */ 850 834 nsp_inc_resid(SCpnt, res); 851 - SCpnt->SCp.ptr -= res; 852 - SCpnt->SCp.this_residual += res; 853 - ocount -= res; 835 + scsi_pointer->ptr -= res; 836 + scsi_pointer->this_residual += res; 837 + ocount -= res; 854 838 855 839 break; 856 840 } ··· 861 845 continue; 862 846 } 863 847 864 - res = min(SCpnt->SCp.this_residual, WFIFO_CRIT); 848 + res = min(scsi_pointer->this_residual, WFIFO_CRIT); 865 849 866 - //nsp_dbg(NSP_DEBUG_DATA_IO, "ptr=0x%p this=0x%x res=0x%x", SCpnt->SCp.ptr, SCpnt->SCp.this_residual, res); 850 + //nsp_dbg(NSP_DEBUG_DATA_IO, "ptr=0x%p this=0x%x res=0x%x", scsi_pointer->ptr, scsi_pointer->this_residual, res); 867 851 switch (data->TransferMode) { 868 852 case MODE_IO32: 869 853 res &= ~(BIT(1)|BIT(0)); /* align 4 */ 870 - nsp_fifo32_write(base, SCpnt->SCp.ptr, res >> 2); 854 + nsp_fifo32_write(base, scsi_pointer->ptr, res >> 2); 871 855 break; 872 856 case MODE_IO8: 873 - nsp_fifo8_write (base, SCpnt->SCp.ptr, res ); 857 + nsp_fifo8_write(base, scsi_pointer->ptr, res); 874 858 break; 875 859 876 860 case MODE_MEM32: 877 861 res &= ~(BIT(1)|BIT(0)); /* align 4 */ 878 - nsp_mmio_fifo32_write(mmio_base, SCpnt->SCp.ptr, res >> 2); 862 + nsp_mmio_fifo32_write(mmio_base, scsi_pointer->ptr, 863 + res >> 2); 879 864 break; 880 865 881 866 default: ··· 885 868 } 886 869 887 870 nsp_inc_resid(SCpnt, -res); 888 - SCpnt->SCp.ptr += res; 889 - SCpnt->SCp.this_residual -= res; 890 - ocount += res; 871 + scsi_pointer->ptr += res; 872 + scsi_pointer->this_residual -= res; 873 + ocount += res; 891 874 892 875 /* go to next scatter list if available */ 893 - if (SCpnt->SCp.this_residual == 0 && 894 - SCpnt->SCp.buffers_residual != 0 ) { 876 + if (scsi_pointer->this_residual == 0 && 877 + scsi_pointer->buffers_residual != 0 ) { 895 878 //nsp_dbg(NSP_DEBUG_DATA_IO, "scatterlist next"); 896 - SCpnt->SCp.buffers_residual--; 897 - SCpnt->SCp.buffer = sg_next(SCpnt->SCp.buffer); 898 - SCpnt->SCp.ptr = BUFFER_ADDR; 899 - SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length; 879 + scsi_pointer->buffers_residual--; 880 + scsi_pointer->buffer = sg_next(scsi_pointer->buffer); 881 + scsi_pointer->ptr = BUFFER_ADDR(SCpnt); 882 + scsi_pointer->this_residual = 883 + scsi_pointer->buffer->length; 900 884 time_out = 1000; 901 885 } 902 886 } ··· 965 947 unsigned int base; 966 948 unsigned char irq_status, irq_phase, phase; 967 949 struct scsi_cmnd *tmpSC; 950 + struct scsi_pointer *scsi_pointer; 968 951 unsigned char target, lun; 969 952 unsigned int *sync_neg; 970 953 int i, tmp; ··· 1044 1025 1045 1026 if(data->CurrentSC != NULL) { 1046 1027 tmpSC = data->CurrentSC; 1047 - tmpSC->result = (DID_RESET << 16) | 1048 - ((tmpSC->SCp.Message & 0xff) << 8) | 1049 - ((tmpSC->SCp.Status & 0xff) << 0); 1028 + scsi_pointer = nsp_priv(tmpSC); 1029 + tmpSC->result = (DID_RESET << 16) | 1030 + ((scsi_pointer->Message & 0xff) << 8) | 1031 + ((scsi_pointer->Status & 0xff) << 0); 1050 1032 nsp_scsi_done(tmpSC); 1051 1033 } 1052 1034 return IRQ_HANDLED; ··· 1061 1041 } 1062 1042 1063 1043 tmpSC = data->CurrentSC; 1044 + scsi_pointer = nsp_priv(tmpSC); 1064 1045 target = tmpSC->device->id; 1065 1046 lun = tmpSC->device->lun; 1066 1047 sync_neg = &(data->Sync[target].SyncNegotiation); ··· 1084 1063 1085 1064 //show_phase(tmpSC); 1086 1065 1087 - switch(tmpSC->SCp.phase) { 1066 + switch (scsi_pointer->phase) { 1088 1067 case PH_SELSTART: 1089 1068 // *sync_neg = SYNC_NOT_YET; 1090 1069 if ((phase & BUSMON_BSY) == 0) { ··· 1107 1086 /* attention assert */ 1108 1087 //nsp_dbg(NSP_DEBUG_INTR, "attention assert"); 1109 1088 data->SelectionTimeOut = 0; 1110 - tmpSC->SCp.phase = PH_SELECTED; 1089 + scsi_pointer->phase = PH_SELECTED; 1111 1090 nsp_index_write(base, SCSIBUSCTRL, SCSI_ATN); 1112 1091 udelay(1); 1113 1092 nsp_index_write(base, SCSIBUSCTRL, SCSI_ATN | AUTODIRECTION | ACKENB); ··· 1136 1115 //nsp_dbg(NSP_DEBUG_INTR, "start scsi seq"); 1137 1116 1138 1117 /* normal disconnect */ 1139 - if (((tmpSC->SCp.phase == PH_MSG_IN) || (tmpSC->SCp.phase == PH_MSG_OUT)) && 1140 - (irq_phase & LATCHED_BUS_FREE) != 0 ) { 1118 + if ((scsi_pointer->phase == PH_MSG_IN || 1119 + scsi_pointer->phase == PH_MSG_OUT) && 1120 + (irq_phase & LATCHED_BUS_FREE) != 0) { 1141 1121 nsp_dbg(NSP_DEBUG_INTR, "normal disconnect irq_status=0x%x, phase=0x%x, irq_phase=0x%x", irq_status, phase, irq_phase); 1142 1122 1143 1123 //*sync_neg = SYNC_NOT_YET; 1144 1124 1145 1125 /* all command complete and return status */ 1146 - if (tmpSC->SCp.Message == COMMAND_COMPLETE) { 1147 - tmpSC->result = (DID_OK << 16) | 1148 - ((tmpSC->SCp.Message & 0xff) << 8) | 1149 - ((tmpSC->SCp.Status & 0xff) << 0); 1126 + if (scsi_pointer->Message == COMMAND_COMPLETE) { 1127 + tmpSC->result = (DID_OK << 16) | 1128 + ((scsi_pointer->Message & 0xff) << 8) | 1129 + ((scsi_pointer->Status & 0xff) << 0); 1150 1130 nsp_dbg(NSP_DEBUG_INTR, "command complete result=0x%x", tmpSC->result); 1151 1131 nsp_scsi_done(tmpSC); 1152 1132 ··· 1176 1154 return IRQ_HANDLED; 1177 1155 } 1178 1156 1179 - tmpSC->SCp.phase = PH_COMMAND; 1157 + scsi_pointer->phase = PH_COMMAND; 1180 1158 1181 1159 nsp_nexus(tmpSC); 1182 1160 ··· 1192 1170 case BUSPHASE_DATA_OUT: 1193 1171 nsp_dbg(NSP_DEBUG_INTR, "BUSPHASE_DATA_OUT"); 1194 1172 1195 - tmpSC->SCp.phase = PH_DATA; 1196 - tmpSC->SCp.have_data_in = IO_OUT; 1173 + scsi_pointer->phase = PH_DATA; 1174 + scsi_pointer->have_data_in = IO_OUT; 1197 1175 1198 1176 nsp_pio_write(tmpSC); 1199 1177 ··· 1202 1180 case BUSPHASE_DATA_IN: 1203 1181 nsp_dbg(NSP_DEBUG_INTR, "BUSPHASE_DATA_IN"); 1204 1182 1205 - tmpSC->SCp.phase = PH_DATA; 1206 - tmpSC->SCp.have_data_in = IO_IN; 1183 + scsi_pointer->phase = PH_DATA; 1184 + scsi_pointer->have_data_in = IO_IN; 1207 1185 1208 1186 nsp_pio_read(tmpSC); 1209 1187 ··· 1213 1191 nsp_dataphase_bypass(tmpSC); 1214 1192 nsp_dbg(NSP_DEBUG_INTR, "BUSPHASE_STATUS"); 1215 1193 1216 - tmpSC->SCp.phase = PH_STATUS; 1194 + scsi_pointer->phase = PH_STATUS; 1217 1195 1218 - tmpSC->SCp.Status = nsp_index_read(base, SCSIDATAWITHACK); 1219 - nsp_dbg(NSP_DEBUG_INTR, "message=0x%x status=0x%x", tmpSC->SCp.Message, tmpSC->SCp.Status); 1196 + scsi_pointer->Status = nsp_index_read(base, SCSIDATAWITHACK); 1197 + nsp_dbg(NSP_DEBUG_INTR, "message=0x%x status=0x%x", 1198 + scsi_pointer->Message, scsi_pointer->Status); 1220 1199 1221 1200 break; 1222 1201 ··· 1227 1204 goto timer_out; 1228 1205 } 1229 1206 1230 - tmpSC->SCp.phase = PH_MSG_OUT; 1207 + scsi_pointer->phase = PH_MSG_OUT; 1231 1208 1232 1209 //*sync_neg = SYNC_NOT_YET; 1233 1210 ··· 1260 1237 goto timer_out; 1261 1238 } 1262 1239 1263 - tmpSC->SCp.phase = PH_MSG_IN; 1240 + scsi_pointer->phase = PH_MSG_IN; 1264 1241 nsp_message_in(tmpSC); 1265 1242 1266 1243 /**/ ··· 1292 1269 i += (1 + data->MsgBuffer[i+1]); 1293 1270 } 1294 1271 } 1295 - tmpSC->SCp.Message = tmp; 1272 + scsi_pointer->Message = tmp; 1296 1273 1297 - nsp_dbg(NSP_DEBUG_INTR, "message=0x%x len=%d", tmpSC->SCp.Message, data->MsgLen); 1274 + nsp_dbg(NSP_DEBUG_INTR, "message=0x%x len=%d", 1275 + scsi_pointer->Message, data->MsgLen); 1298 1276 show_message(data); 1299 1277 1300 1278 break;
+1 -1
drivers/scsi/pcmcia/nsp_cs.h
··· 371 371 }; 372 372 373 373 /* scatter-gather table */ 374 - # define BUFFER_ADDR ((char *)((sg_virt(SCpnt->SCp.buffer)))) 374 + #define BUFFER_ADDR(SCpnt) ((char *)(sg_virt(nsp_priv(SCpnt)->buffer))) 375 375 376 376 #endif /*__nsp_cs__*/ 377 377 /* end */
+1 -1
drivers/scsi/pcmcia/nsp_debug.c
··· 145 145 146 146 static void show_phase(struct scsi_cmnd *SCpnt) 147 147 { 148 - int i = SCpnt->SCp.phase; 148 + int i = nsp_scsi_pointer(SCpnt)->phase; 149 149 150 150 char *ph[] = { 151 151 "PH_UNDETERMINED",