--- zzzz-none-000/linux-3.10.107/drivers/scsi/t128.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/scsi/t128.c 2021-02-04 17:41:59.000000000 +0000 @@ -1,4 +1,3 @@ -#define AUTOSENSE #define PSEUDO_DMA /* @@ -12,8 +11,6 @@ * drew@colorado.edu * +1 (303) 440-4894 * - * DISTRIBUTION RELEASE 3. - * * For more information, please consult * * Trantor Systems, Ltd. @@ -24,40 +21,9 @@ * 5415 Randall Place * Fremont, CA 94538 * 1+ (415) 770-1400, FAX 1+ (415) 770-9910 - * - * and - * - * NCR 5380 Family - * SCSI Protocol Controller - * Databook - * - * NCR Microelectronics - * 1635 Aeroplaza Drive - * Colorado Springs, CO 80916 - * 1+ (719) 578-3400 - * 1+ (800) 334-5454 */ /* - * Options : - * AUTOSENSE - if defined, REQUEST SENSE will be performed automatically - * for commands that return with a CHECK CONDITION status. - * - * PSEUDO_DMA - enables PSEUDO-DMA hardware, should give a 3-4X performance - * increase compared to polled I/O. - * - * PARITY - enable parity checking. Not supported. - * - * SCSI2 - enable support for SCSI-II tagged queueing. Untested. - * - * - * UNSAFE - leave interrupts enabled during pseudo-DMA transfers. You - * only really want to use this if you're having a problem with - * dropped characters during high speed communications, and even - * then, you're going to be better off twiddling with transfersize. - * - * USLEEP - enable support for devices that don't disconnect. Untested. - * * The card is detected and initialized in one of several ways : * 1. Autoprobe (default) - since the board is memory mapped, * a BIOS signature is scanned for to locate the registers. @@ -102,10 +68,6 @@ * 15 9-11 */ -/* - * $Log: t128.c,v $ - */ - #include #include #include @@ -115,7 +77,6 @@ #include #include -#include "scsi.h" #include #include "t128.h" #define AUTOPROBE_IRQ @@ -152,6 +113,7 @@ #define NO_SIGNATURES ARRAY_SIZE(signatures) +#ifndef MODULE /* * Function : t128_setup(char *str, int *ints) * @@ -162,9 +124,13 @@ * */ -void __init t128_setup(char *str, int *ints){ +static int __init t128_setup(char *str) +{ static int commandline_current = 0; int i; + int ints[10]; + + get_options(str, ARRAY_SIZE(ints), ints); if (ints[0] != 2) printk("t128_setup : usage t128=address,irq\n"); else @@ -178,8 +144,12 @@ } ++commandline_current; } + return 1; } +__setup("t128=", t128_setup); +#endif + /* * Function : int t128_detect(struct scsi_host_template * tpnt) * @@ -193,17 +163,14 @@ * */ -int __init t128_detect(struct scsi_host_template * tpnt){ +static int __init t128_detect(struct scsi_host_template *tpnt) +{ static int current_override = 0, current_base = 0; struct Scsi_Host *instance; unsigned long base; void __iomem *p; int sig, count; - tpnt->proc_name = "t128"; - tpnt->show_info = t128_show_info; - tpnt->write_info = t128_write_info; - for (count = 0; current_override < NO_OVERRIDES; ++current_override) { base = 0; p = NULL; @@ -258,15 +225,19 @@ else instance->irq = NCR5380_probe_irq(instance, T128_IRQS); - if (instance->irq != SCSI_IRQ_NONE) - if (request_irq(instance->irq, t128_intr, IRQF_DISABLED, "t128", + /* Compatibility with documented NCR5380 kernel parameters */ + if (instance->irq == 255) + instance->irq = NO_IRQ; + + if (instance->irq != NO_IRQ) + if (request_irq(instance->irq, t128_intr, 0, "t128", instance)) { printk("scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); - instance->irq = SCSI_IRQ_NONE; + instance->irq = NO_IRQ; } - if (instance->irq == SCSI_IRQ_NONE) { + if (instance->irq == NO_IRQ) { printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no); printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no); } @@ -275,16 +246,6 @@ printk("scsi%d : irq = %d\n", instance->host_no, instance->irq); #endif - printk("scsi%d : at 0x%08lx", instance->host_no, instance->base); - if (instance->irq == SCSI_IRQ_NONE) - printk (" interrupts disabled"); - else - printk (" irq %d", instance->irq); - printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d", - CAN_QUEUE, CMD_PER_LUN, T128_PUBLIC_RELEASE); - NCR5380_print_options(instance); - printk("\n"); - ++current_override; ++count; } @@ -295,7 +256,7 @@ { NCR5380_local_declare(); NCR5380_setup(shost); - if (shost->irq) + if (shost->irq != NO_IRQ) free_irq(shost->irq, shost); NCR5380_exit(shost); if (shost->io_port && shost->n_io_port) @@ -325,8 +286,8 @@ * and matching the H_C_S coordinates to what DOS uses. */ -int t128_biosparam(struct scsi_device *sdev, struct block_device *bdev, - sector_t capacity, int * ip) +static int t128_biosparam(struct scsi_device *sdev, struct block_device *bdev, + sector_t capacity, int *ip) { ip[0] = 64; ip[1] = 32; @@ -434,6 +395,10 @@ .name = "Trantor T128/T128F/T228", .detect = t128_detect, .release = t128_release, + .proc_name = "t128", + .show_info = t128_show_info, + .write_info = t128_write_info, + .info = t128_info, .queuecommand = t128_queue_command, .eh_abort_handler = t128_abort, .eh_bus_reset_handler = t128_bus_reset,