aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/dtc.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2014-11-12 00:11:59 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-20 03:11:09 -0500
commita9c2dc43c14cc9e9333d451bc4db8a827a695332 (patch)
tree70e239cb8ebf6f09fa6d4c37cb3cc2884a37d144 /drivers/scsi/dtc.c
parent8c32513bd395dc5d382e4883097482567cf8bbc5 (diff)
ncr5380: Move static PDMA spin counters to host data
Static variables from dtc.c and pas16.c should not appear in the core NCR5380.c driver. Aside from being a layering issue this worsens the divergence between the three core driver variants (atari_NCR5380.c and sun3_NCR5380.c don't support PSEUDO_DMA) and it can mean multiple hosts share the same counters. Fix this by making the pseudo DMA spin counters in the core more generic. This also avoids the abuse of the {DTC,PAS16}_PUBLIC_RELEASE macros, so they can be removed. oak.c doesn't use PDMA and hence it doesn't use the counters and hence it needs no write_info() method. Remove it. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Hannes Reinecke <hare@suse.de> Tested-by: Michael Schmitz <schmitzmic@gmail.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/dtc.c')
-rw-r--r--drivers/scsi/dtc.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/scsi/dtc.c b/drivers/scsi/dtc.c
index 2dacf2833b64..62b8de67f65f 100644
--- a/drivers/scsi/dtc.c
+++ b/drivers/scsi/dtc.c
@@ -332,13 +332,11 @@ static int dtc_biosparam(struct scsi_device *sdev, struct block_device *dev,
332 * timeout. 332 * timeout.
333*/ 333*/
334 334
335static int dtc_maxi = 0;
336static int dtc_wmaxi = 0;
337
338static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst, int len) 335static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst, int len)
339{ 336{
340 unsigned char *d = dst; 337 unsigned char *d = dst;
341 int i; /* For counting time spent in the poll-loop */ 338 int i; /* For counting time spent in the poll-loop */
339 struct NCR5380_hostdata *hostdata = shost_priv(instance);
342 NCR5380_local_declare(); 340 NCR5380_local_declare();
343 NCR5380_setup(instance); 341 NCR5380_setup(instance);
344 342
@@ -369,8 +367,8 @@ static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst,
369 NCR5380_write(MODE_REG, 0); /* Clear the operating mode */ 367 NCR5380_write(MODE_REG, 0); /* Clear the operating mode */
370 rtrc(0); 368 rtrc(0);
371 NCR5380_read(RESET_PARITY_INTERRUPT_REG); 369 NCR5380_read(RESET_PARITY_INTERRUPT_REG);
372 if (i > dtc_maxi) 370 if (i > hostdata->spin_max_r)
373 dtc_maxi = i; 371 hostdata->spin_max_r = i;
374 return (0); 372 return (0);
375} 373}
376 374
@@ -390,6 +388,7 @@ static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst,
390static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *src, int len) 388static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *src, int len)
391{ 389{
392 int i; 390 int i;
391 struct NCR5380_hostdata *hostdata = shost_priv(instance);
393 NCR5380_local_declare(); 392 NCR5380_local_declare();
394 NCR5380_setup(instance); 393 NCR5380_setup(instance);
395 394
@@ -422,8 +421,8 @@ static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *src,
422 /* Check for parity error here. fixme. */ 421 /* Check for parity error here. fixme. */
423 NCR5380_write(MODE_REG, 0); /* Clear the operating mode */ 422 NCR5380_write(MODE_REG, 0); /* Clear the operating mode */
424 rtrc(0); 423 rtrc(0);
425 if (i > dtc_wmaxi) 424 if (i > hostdata->spin_max_w)
426 dtc_wmaxi = i; 425 hostdata->spin_max_w = i;
427 return (0); 426 return (0);
428} 427}
429 428