55 #include <linux/device.h>
56 #include <linux/slab.h>
61 #define AHD_LINUX_ERR_THRESH 1000
69 #ifdef CONFIG_AIC79XX_RESET_DELAY_MS
70 #define AIC79XX_RESET_DELAY CONFIG_AIC79XX_RESET_DELAY_MS
72 #define AIC79XX_RESET_DELAY 5000
133 #ifdef CONFIG_AIC79XX_CMDS_PER_DEVICE
134 #define AIC79XX_CMDS_PER_DEVICE CONFIG_AIC79XX_CMDS_PER_DEVICE
136 #define AIC79XX_CMDS_PER_DEVICE AHD_MAX_QUEUE
139 #define AIC79XX_CONFIGED_TAG_COMMANDS { \
140 AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE, \
141 AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE, \
142 AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE, \
143 AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE, \
144 AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE, \
145 AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE, \
146 AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE, \
147 AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE \
185 #define AIC79XX_DEFAULT_PRECOMP 0xFF
186 #define AIC79XX_DEFAULT_SLEWRATE 0xFF
187 #define AIC79XX_DEFAULT_AMPLITUDE 0xFF
188 #define AIC79XX_DEFAULT_IOOPTS \
190 AIC79XX_DEFAULT_PRECOMP, \
191 AIC79XX_DEFAULT_SLEWRATE, \
192 AIC79XX_DEFAULT_AMPLITUDE \
194 #define AIC79XX_PRECOMP_INDEX 0
195 #define AIC79XX_SLEWRATE_INDEX 1
196 #define AIC79XX_AMPLITUDE_INDEX 2
214 AIC79XX_DEFAULT_IOOPTS
221 #define DID_UNDERFLOW DID_ERROR
226 printk(
"(scsi%d:%c:%d:%d): ",
267 static uint32_t aic79xx_pci_parity = ~0;
297 static uint32_t aic79xx_periodic_otag;
317 static char *aic79xx =
NULL;
325 "period-delimited options string:\n"
326 " verbose Enable verbose/diagnostic logging\n"
327 " allow_memio Allow device registers to be memory mapped\n"
328 " debug Bitmask of debug values to enable\n"
329 " no_reset Suppress initial bus resets\n"
330 " extended Enable extended geometry on all controllers\n"
331 " periodic_otag Send an ordered tagged transaction\n"
332 " periodically to prevent tag starvation.\n"
333 " This may be required by some older disk\n"
334 " or drives/RAID arrays.\n"
335 " tag_info:<tag_str> Set per-target tag depth\n"
336 " global_tag_depth:<int> Global tag depth for all targets on all buses\n"
337 " slewrate:<slewrate_list>Set the signal slew rate (0-15).\n"
338 " precomp:<pcomp_list> Set the signal precompensation (0-7).\n"
339 " amplitude:<int> Set the signal amplitude (0-7).\n"
340 " seltime:<int> Selection Timeout:\n"
341 " (0/256ms,1/128ms,2/64ms,3/32ms)\n"
342 " slowcrc Turn on the SLOWCRC bit (Rev B only)\n"
344 " Sample modprobe configuration file:\n"
345 " # Enable verbose logging\n"
346 " # Set tag depth on Controller 2/Target 2 to 10 tags\n"
347 " # Shorten the selection timeout to 128ms\n"
349 " options aic79xx 'aic79xx=verbose.tag_info:{{}.{}.{..10}}.seltime:1'\n"
352 static void ahd_linux_handle_scsi_status(
struct ahd_softc *,
355 static void ahd_linux_queue_cmd_complete(
struct ahd_softc *ahd,
357 static int ahd_linux_queue_abort_cmd(
struct scsi_cmnd *
cmd);
358 static void ahd_linux_initialize_scsi_bus(
struct ahd_softc *ahd);
361 static void ahd_linux_device_queue_depth(
struct scsi_device *);
362 static int ahd_linux_run_command(
struct ahd_softc*,
365 static void ahd_linux_setup_tag_info_global(
char *
p);
366 static int aic79xx_setup(
char *
c);
367 static void ahd_freeze_simq(
struct ahd_softc *ahd);
368 static void ahd_release_simq(
struct ahd_softc *ahd);
370 static int ahd_linux_unit;
462 for (i = 0; i <
count; i++)
476 for (i = 0; i <
count; i++)
489 pci_read_config_byte(pci, reg, &retval);
495 pci_read_config_word(pci, reg, &retval);
501 pci_read_config_dword(pci, reg, &retval);
505 panic(
"ahd_pci_read_config: Read size too big");
516 pci_write_config_byte(pci, reg, value);
519 pci_write_config_word(pci, reg, value);
522 pci_write_config_dword(pci, reg, value);
525 panic(
"ahd_pci_write_config: Write size too big");
531 static void ahd_linux_unmap_scb(
struct ahd_softc*,
struct scb*);
544 #define BUILD_SCSIID(ahd, cmd) \
545 (((scmd_id(cmd) << TID_SHIFT) & TID) | (ahd)->our_id)
559 ahd = *(
struct ahd_softc **)host->hostdata;
560 memset(bp, 0,
sizeof(buffer));
586 rtn = ahd_linux_run_command(ahd, dev, cmd);
597 *((
struct ahd_softc **)dev_to_shost(&starget->dev)->hostdata);
598 unsigned int target_offset;
600 target_offset = starget->id;
601 if (starget->channel != 0)
608 ahd_linux_target_alloc(
struct scsi_target *starget)
611 *((
struct ahd_softc **)dev_to_shost(&starget->
dev)->hostdata);
614 struct scsi_target **ahd_targp = ahd_linux_target_in_softc(starget);
620 ahd_lock(ahd, &flags);
624 *ahd_targp = starget;
630 starget->
id, &tstate);
640 if ((flags &
CFQAS) == 0)
650 starget->
id, &tstate);
658 ahd_unlock(ahd, &flags);
664 ahd_linux_target_destroy(
struct scsi_target *starget)
666 struct scsi_target **ahd_targp = ahd_linux_target_in_softc(starget);
679 printk(
"%s: Slave Alloc %d\n", ahd_name(ahd), sdev->
id);
681 dev = scsi_transport_device_data(sdev);
682 memset(dev, 0,
sizeof(*dev));
701 ahd_linux_slave_configure(
struct scsi_device *sdev)
709 ahd_linux_device_queue_depth(sdev);
718 #if defined(__i386__)
739 &geom[2], &geom[0], &geom[1]);
746 cylinders = aic_sector_div(capacity, heads, sectors);
748 if (aic79xx_extended != 0)
752 if (extended && cylinders >= 1024) {
755 cylinders = aic_sector_div(capacity, heads, sectors);
772 error = ahd_linux_queue_abort_cmd(cmd);
781 ahd_linux_dev_reset(
struct scsi_cmnd *cmd)
785 struct scb *reset_scb;
801 "Attempting to queue a TARGET RESET message:");
804 for (cdb_byte = 0; cdb_byte < cmd->
cmd_len; cdb_byte++)
811 dev = scsi_transport_device_data(cmd->
device);
832 cmd->
device->id, &tstate);
836 ahd_set_residual(reset_scb, 0);
837 ahd_set_sense_residual(reset_scb, 0);
839 reset_scb->
hscb->control = 0;
842 reset_scb->
hscb->cdb_len = 0;
854 ahd_lock(ahd, &flags);
860 ahd_unlock(ahd, &flags);
862 printk(
"%s: Device reset code sleeping\n", ahd_name(ahd));
864 ahd_lock(ahd, &flags);
866 ahd_unlock(ahd, &flags);
867 printk(
"%s: Device reset timer expired (active %d)\n",
868 ahd_name(ahd), dev->
active);
871 printk(
"%s: Device reset returning 0x%x\n", ahd_name(ahd), retval);
880 ahd_linux_bus_reset(
struct scsi_cmnd *cmd)
888 if ((ahd_debug & AHD_SHOW_RECOVERY) != 0)
889 printk(
"%s: Bus reset called for cmd %p\n",
892 ahd_lock(ahd, &flags);
896 ahd_unlock(ahd, &flags);
899 printk(
"%s: SCSI bus reset delivered. "
900 "%d SCBs aborted.\n", ahd_name(ahd), found);
908 .proc_name =
"aic79xx",
910 .info = ahd_linux_info,
911 .queuecommand = ahd_linux_queue,
912 .eh_abort_handler = ahd_linux_abort,
913 .eh_device_reset_handler = ahd_linux_dev_reset,
914 .eh_bus_reset_handler = ahd_linux_bus_reset,
915 #if defined(__i386__)
916 .bios_param = ahd_linux_biosparam,
923 .slave_alloc = ahd_linux_slave_alloc,
924 .slave_configure = ahd_linux_slave_configure,
925 .target_alloc = ahd_linux_target_alloc,
926 .target_destroy = ahd_linux_target_destroy,
986 void *cb_arg,
int flags)
996 cb(cb_arg, &stack_sg, 1, 0);
1018 && (instance <
ARRAY_SIZE(aic79xx_iocell_info))) {
1021 iocell_info = (
uint8_t*)&aic79xx_iocell_info[instance];
1022 iocell_info[
index] = value & 0xFFFF;
1024 printk(
"iocell[%d:%ld] = %d\n", instance, index, value);
1029 ahd_linux_setup_tag_info_global(
char *
p)
1034 printk(
"Setting Global Tags= %d\n", tags);
1036 for (i = 0; i <
ARRAY_SIZE(aic79xx_tag_info); i++) {
1044 ahd_linux_setup_tag_info(
u_long arg,
int instance,
int targ,
int32_t value)
1047 if ((instance >= 0) && (targ >= 0)
1050 aic79xx_tag_info[instance].
tag_commands[targ] = value & 0x1FF;
1052 printk(
"tag_info[%d:%d] = %d\n", instance, targ, value);
1057 ahd_parse_brace_option(
char *opt_name,
char *opt_arg,
char *
end,
int depth,
1067 char tok_list[] = {
'.',
',',
'{',
'}',
'\0'};
1070 if (*opt_arg !=
':')
1080 tok_end =
strchr(opt_arg,
'\0');
1086 if (instance == -1) {
1093 printk(
"Malformed Option %s\n",
1103 else if (instance != -1)
1113 else if (instance >= 0)
1122 for (i = 0; tok_list[
i]; i++) {
1123 tok_end2 =
strchr(opt_arg, tok_list[i]);
1124 if ((tok_end2) && (tok_end2 < tok_end))
1127 callback(callback_arg, instance, targ,
1142 aic79xx_setup(
char *
s)
1148 static const struct {
1152 {
"extended", &aic79xx_extended },
1153 {
"no_reset", &aic79xx_no_reset },
1157 {
"debug", &ahd_debug },
1159 {
"periodic_otag", &aic79xx_periodic_otag },
1160 {
"pci_parity", &aic79xx_pci_parity },
1161 {
"seltime", &aic79xx_seltime },
1162 {
"tag_info",
NULL },
1163 {
"global_tag_depth",
NULL},
1164 {
"slewrate",
NULL },
1165 {
"precomp",
NULL },
1166 {
"amplitude",
NULL },
1190 if (
strncmp(p,
"global_tag_depth", n) == 0) {
1191 ahd_linux_setup_tag_info_global(p + n);
1192 }
else if (
strncmp(p,
"tag_info", n) == 0) {
1193 s = ahd_parse_brace_option(
"tag_info", p + n, end,
1194 2, ahd_linux_setup_tag_info, 0);
1195 }
else if (
strncmp(p,
"slewrate", n) == 0) {
1196 s = ahd_parse_brace_option(
"slewrate",
1197 p + n, end, 1, ahd_linux_setup_iocell_info,
1199 }
else if (
strncmp(p,
"precomp", n) == 0) {
1200 s = ahd_parse_brace_option(
"precomp",
1201 p + n, end, 1, ahd_linux_setup_iocell_info,
1203 }
else if (
strncmp(p,
"amplitude", n) == 0) {
1204 s = ahd_parse_brace_option(
"amplitude",
1205 p + n, end, 1, ahd_linux_setup_iocell_info,
1207 }
else if (p[n] ==
':') {
1209 }
else if (!
strncmp(p,
"verbose", n)) {
1218 __setup(
"aic79xx=", aic79xx_setup);
1236 *((
struct ahd_softc **)host->hostdata) = ahd;
1249 ahd_unlock(ahd, &s);
1252 if (new_name !=
NULL) {
1257 ahd_linux_initialize_scsi_bus(ahd);
1260 host->
transportt = ahd_linux_transport_template;
1279 ahd_linux_initialize_scsi_bus(
struct ahd_softc *ahd)
1288 if (aic79xx_no_reset != 0)
1302 for (; target_id < numtarg; target_id++) {
1308 target_id, &tstate);
1314 ahd_unlock(ahd, &s);
1317 ahd_freeze_simq(ahd);
1319 ahd_release_simq(ahd);
1333 ahd->
seltime = (aic79xx_seltime & 0x3) << 4;
1347 if (starget !=
NULL) {
1382 iocell_opts = &aic79xx_iocell_info[ahd->
unit];
1413 dev = scsi_transport_device_data(sdev);
1431 && (was_queuing != now_queuing)
1441 usertags = ahd_linux_user_tagdepth(ahd, devinfo);
1458 if (aic79xx_periodic_otag != 0)
1484 scsi_deactivate_tcq(sdev, 1);
1499 static int warned_user;
1506 if (warned_user == 0) {
1508 "aic79xx: WARNING: Insufficient tag_info instances\n"
1509 "aic79xx: for installed controllers. Using defaults\n"
1510 "aic79xx: Please update the aic79xx_tag_info array in\n"
1511 "aic79xx: the aic79xx_osm.c source file.\n");
1518 tag_info = &aic79xx_tag_info[ahd->
unit];
1531 ahd_linux_device_queue_depth(
struct scsi_device *sdev)
1542 tags = ahd_linux_user_tagdepth(ahd, &devinfo);
1549 printk(
"Tagged Queuing enabled. Depth %d\n", tags);
1567 unsigned long flags;
1574 ahd_lock(ahd, &flags);
1580 cmd->
device->id, &tstate);
1590 ahd_unlock(ahd, &flags);
1606 scb->
hscb->task_management = 0;
1624 msg_bytes = scsi_populate_tag_msg(cmd, tag_msgs);
1643 ahd_set_residual(scb, 0);
1644 ahd_set_sense_residual(scb, 0);
1676 ahd_unlock(ahd, &flags);
1692 ahd_lock(ahd, &flags);
1694 ahd_unlock(ahd, &flags);
1710 unsigned int target_ppr_options;
1725 if (tinfo->
curr.period != tinfo->
goal.period
1726 || tinfo->
curr.width != tinfo->
goal.width
1727 || tinfo->
curr.offset != tinfo->
goal.offset
1728 || tinfo->
curr.ppr_options != tinfo->
goal.ppr_options)
1737 if (starget ==
NULL)
1740 target_ppr_options =
1753 && tinfo->
curr.ppr_options == target_ppr_options)
1775 channel -
'A', target);
1785 panic(
"ahd_send_async: Unexpected async event");
1801 panic(
"Stopping for safety");
1812 ahd_linux_unmap_scb(ahd, scb);
1825 ahd_get_transfer_length(scb) - ahd_get_residual(scb);
1828 if ((ahd_debug & AHD_SHOW_MISC) != 0) {
1830 printk(
"Set CAM_UNCOR_PARITY\n");
1834 #ifdef AHD_REPORT_UNDERFLOWS
1844 }
else if (amount_xferred < scb->io_ctx->underflow) {
1853 printk(
"Saw underflow (%ld of %ld bytes). "
1854 "Treated as error\n",
1855 ahd_get_residual(scb),
1856 ahd_get_transfer_length(scb));
1863 ahd_linux_handle_scsi_status(ahd, cmd->
device, scb);
1886 printk(
"Recovery SCB completes\n");
1896 ahd_linux_queue_cmd_complete(ahd, cmd);
1900 ahd_linux_handle_scsi_status(
struct ahd_softc *ahd,
1922 switch (ahd_get_scsi_status(scb)) {
1942 - ahd_get_sense_residual(scb),
1952 sense_size =
min_t(
size_t,
1960 ahd_get_sense_buf(ahd, scb)
1961 + sense_offset, sense_size);
1965 if (ahd_debug & AHD_SHOW_SENSE) {
1968 printk(
"Copied %d bytes of sense data at %d:",
1969 sense_size, sense_offset);
1970 for (i = 0; i < sense_size; i++) {
1998 if ((ahd_debug & AHD_SHOW_QFULL) != 0) {
2000 printk(
"Dropping tag count to %d\n",
2019 printk(
"Locking max tag count at %d\n",
2050 int do_fallback = 0;
2060 status = ahd_cmd_get_transaction_status(cmd);
2070 scsi_status = ahd_cmd_get_scsi_status(cmd);
2072 switch(scsi_status) {
2143 printk(
"%s: device overrun (status %x) on %d:%d:%d\n",
2144 ahd_name(ahd), status, cmd->
device->channel,
2148 ahd_cmd_set_transaction_status(cmd, new_status);
2166 ahd_linux_queue_abort_cmd(
struct scsi_cmnd *cmd)
2170 struct scb *pending_scb;
2172 u_int active_scbptr;
2182 unsigned long flags;
2190 "Attempting to queue an ABORT message:");
2193 for (cdb_byte = 0; cdb_byte < cmd->
cmd_len; cdb_byte++)
2197 ahd_lock(ahd, &flags);
2206 dev = scsi_transport_device_data(cmd->
device);
2222 if (pending_scb->
io_ctx == cmd)
2226 if (pending_scb ==
NULL) {
2254 printk(
"%s: At time of recovery, card was %spaused\n",
2255 ahd_name(ahd), was_paused ?
"" :
"not ");
2258 disconnected =
TRUE;
2260 cmd->
device->channel +
'A',
2262 pending_scb->
hscb->tag,
2265 printk(
"%s:%d:%d:%d: Cmd aborted from QINFIFO\n",
2266 ahd_name(ahd), cmd->
device->channel,
2276 active_scbptr = saved_scbptr;
2278 struct scb *bus_scb;
2281 if (bus_scb == pending_scb)
2282 disconnected =
FALSE;
2290 saved_scsiid =
ahd_inb(ahd, SAVED_SCSIID);
2304 }
else if (disconnected) {
2312 pending_scb->
hscb->cdb_len = 0;
2313 pending_scb->
hscb->task_attribute = 0;
2325 pending_scb->
hscb->task_management);
2360 printk(
"Device is disconnected, re-queuing SCB\n");
2383 ahd_unlock(ahd, &flags);
2385 printk(
"%s: Recovery code sleeping\n", ahd_name(ahd));
2387 ahd_lock(ahd, &flags);
2389 ahd_unlock(ahd, &flags);
2390 printk(
"%s: Timer Expired (active %d)\n",
2391 ahd_name(ahd), dev->
active);
2394 printk(
"Recovery code awake\n");
2396 ahd_unlock(ahd, &flags);
2399 printk(
"%s: Command abort returning 0x%x\n",
2400 ahd_name(ahd), retval);
2410 unsigned long flags;
2414 ahd_lock(ahd, &flags);
2416 ahd_unlock(ahd, &flags);
2429 unsigned int ppr_options = tinfo->
goal.ppr_options;
2431 unsigned long flags;
2435 if ((ahd_debug & AHD_SHOW_DV) != 0)
2436 printk(
"%s: set period to %d\n", ahd_name(ahd), period);
2466 ahd_lock(ahd, &flags);
2469 ahd_unlock(ahd, &flags);
2472 static void ahd_linux_set_offset(
struct scsi_target *starget,
int offset)
2474 struct Scsi_Host *shost = dev_to_shost(starget->
dev.parent);
2482 unsigned int ppr_options = 0;
2483 unsigned int period = 0;
2485 unsigned long flags;
2488 if ((ahd_debug & AHD_SHOW_DV) != 0)
2489 printk(
"%s: set offset to %d\n", ahd_name(ahd), offset);
2495 period = tinfo->
goal.period;
2496 ppr_options = tinfo->
goal.ppr_options;
2501 ahd_lock(ahd, &flags);
2504 ahd_unlock(ahd, &flags);
2507 static void ahd_linux_set_dt(
struct scsi_target *starget,
int dt)
2509 struct Scsi_Host *shost = dev_to_shost(starget->
dev.parent);
2517 unsigned int ppr_options = tinfo->
goal.ppr_options
2518 & ~MSG_EXT_PPR_DT_REQ;
2519 unsigned int period = tinfo->
goal.period;
2521 unsigned long flags;
2524 if ((ahd_debug & AHD_SHOW_DV) != 0)
2525 printk(
"%s: %s DT\n", ahd_name(ahd),
2526 dt ?
"enabling" :
"disabling");
2531 ahd_linux_set_width(starget, 1);
2543 ahd_lock(ahd, &flags);
2546 ahd_unlock(ahd, &flags);
2549 static void ahd_linux_set_qas(
struct scsi_target *starget,
int qas)
2551 struct Scsi_Host *shost = dev_to_shost(starget->
dev.parent);
2559 unsigned int ppr_options = tinfo->
goal.ppr_options
2561 unsigned int period = tinfo->
goal.period;
2563 unsigned long flags;
2566 if ((ahd_debug & AHD_SHOW_DV) != 0)
2567 printk(
"%s: %s QAS\n", ahd_name(ahd),
2568 qas ?
"enabling" :
"disabling");
2582 ahd_lock(ahd, &flags);
2585 ahd_unlock(ahd, &flags);
2588 static void ahd_linux_set_iu(
struct scsi_target *starget,
int iu)
2590 struct Scsi_Host *shost = dev_to_shost(starget->
dev.parent);
2598 unsigned int ppr_options = tinfo->
goal.ppr_options
2600 unsigned int period = tinfo->
goal.period;
2602 unsigned long flags;
2605 if ((ahd_debug & AHD_SHOW_DV) != 0)
2606 printk(
"%s: %s IU\n", ahd_name(ahd),
2607 iu ?
"enabling" :
"disabling");
2622 ahd_lock(ahd, &flags);
2625 ahd_unlock(ahd, &flags);
2628 static void ahd_linux_set_rd_strm(
struct scsi_target *starget,
int rdstrm)
2630 struct Scsi_Host *shost = dev_to_shost(starget->
dev.parent);
2638 unsigned int ppr_options = tinfo->
goal.ppr_options
2640 unsigned int period = tinfo->
goal.period;
2642 unsigned long flags;
2645 if ((ahd_debug & AHD_SHOW_DV) != 0)
2646 printk(
"%s: %s Read Streaming\n", ahd_name(ahd),
2647 rdstrm ?
"enabling" :
"disabling");
2658 ahd_lock(ahd, &flags);
2661 ahd_unlock(ahd, &flags);
2664 static void ahd_linux_set_wr_flow(
struct scsi_target *starget,
int wrflow)
2666 struct Scsi_Host *shost = dev_to_shost(starget->
dev.parent);
2674 unsigned int ppr_options = tinfo->
goal.ppr_options
2676 unsigned int period = tinfo->
goal.period;
2678 unsigned long flags;
2681 if ((ahd_debug & AHD_SHOW_DV) != 0)
2682 printk(
"%s: %s Write Flow Control\n", ahd_name(ahd),
2683 wrflow ?
"enabling" :
"disabling");
2694 ahd_lock(ahd, &flags);
2697 ahd_unlock(ahd, &flags);
2700 static void ahd_linux_set_rti(
struct scsi_target *starget,
int rti)
2702 struct Scsi_Host *shost = dev_to_shost(starget->
dev.parent);
2710 unsigned int ppr_options = tinfo->
goal.ppr_options
2712 unsigned int period = tinfo->
goal.period;
2714 unsigned long flags;
2718 if ((ahd_debug & AHD_SHOW_DV) != 0)
2719 printk(
"%s: RTI not available\n", ahd_name(ahd));
2725 if ((ahd_debug & AHD_SHOW_DV) != 0)
2726 printk(
"%s: %s RTI\n", ahd_name(ahd),
2727 rti ?
"enabling" :
"disabling");
2738 ahd_lock(ahd, &flags);
2741 ahd_unlock(ahd, &flags);
2744 static void ahd_linux_set_pcomp_en(
struct scsi_target *starget,
int pcomp)
2746 struct Scsi_Host *shost = dev_to_shost(starget->
dev.parent);
2754 unsigned int ppr_options = tinfo->
goal.ppr_options
2756 unsigned int period = tinfo->
goal.period;
2758 unsigned long flags;
2761 if ((ahd_debug & AHD_SHOW_DV) != 0)
2762 printk(
"%s: %s Precompensation\n", ahd_name(ahd),
2763 pcomp ?
"Enable" :
"Disable");
2772 iocell_opts = &aic79xx_iocell_info[ahd->
unit];
2773 precomp = iocell_opts->
precomp;
2788 ahd_lock(ahd, &flags);
2791 ahd_unlock(ahd, &flags);
2794 static void ahd_linux_set_hold_mcs(
struct scsi_target *starget,
int hold)
2796 struct Scsi_Host *shost = dev_to_shost(starget->
dev.parent);
2804 unsigned int ppr_options = tinfo->
goal.ppr_options
2806 unsigned int period = tinfo->
goal.period;
2808 unsigned long flags;
2818 ahd_lock(ahd, &flags);
2821 ahd_unlock(ahd, &flags);
2824 static void ahd_linux_get_signalling(
struct Scsi_Host *shost)
2827 unsigned long flags;
2830 ahd_lock(ahd, &flags);
2834 ahd_unlock(ahd, &flags);
2845 .set_offset = ahd_linux_set_offset,
2847 .set_period = ahd_linux_set_period,
2849 .set_width = ahd_linux_set_width,
2851 .set_dt = ahd_linux_set_dt,
2853 .set_iu = ahd_linux_set_iu,
2855 .set_qas = ahd_linux_set_qas,
2857 .set_rd_strm = ahd_linux_set_rd_strm,
2859 .set_wr_flow = ahd_linux_set_wr_flow,
2861 .set_rti = ahd_linux_set_rti,
2863 .set_pcomp_en = ahd_linux_set_pcomp_en,
2865 .set_hold_mcs = ahd_linux_set_hold_mcs,
2867 .get_signalling = ahd_linux_get_signalling,
2871 ahd_linux_init(
void)
2879 aic79xx_setup(aic79xx);
2881 ahd_linux_transport_template =
2883 if (!ahd_linux_transport_template)
2886 scsi_transport_reserve_device(ahd_linux_transport_template,
2896 ahd_linux_exit(
void)