Commit b945681e authored by Justin T. Gibbs's avatar Justin T. Gibbs

Merge http://linux.bkbits.net/linux-2.5

into overdrive.btc.adaptec.com:/usr/home/gibbs/bk/linux-2.5
parents a9ee74e7 f58eb66c
......@@ -58,6 +58,7 @@ obj-$(CONFIG_SCSI_AHA152X) += aha152x.o
obj-$(CONFIG_SCSI_AHA1542) += aha1542.o
obj-$(CONFIG_SCSI_AHA1740) += aha1740.o
obj-$(CONFIG_SCSI_AIC7XXX) += aic7xxx/
obj-$(CONFIG_SCSI_AIC79XX) += aic7xxx/
obj-$(CONFIG_SCSI_AIC7XXX_OLD) += aic7xxx_old.o
obj-$(CONFIG_SCSI_IPS) += ips.o
obj-$(CONFIG_SCSI_FD_MCS) += fd_mcs.o
......@@ -160,4 +161,4 @@ $(obj)/sim710_u.h: $(obj)/sim710_d.h
$(obj)/53c700_d.h: $(src)/53c700.scr $(src)/script_asm.pl
$(PERL) -s $(src)/script_asm.pl -ncr7x0_family $@ $(@:_d.h=_u.h) < $<
endif
\ No newline at end of file
endif
CONFIG_SCSI_AIC7XXX
This driver supports all of Adaptec's PCI based SCSI controllers
(not the hardware RAID controllers though) as well as the aic7770
based EISA and VLB SCSI controllers (the 274x and 284x series).
This is an Adaptec sponsored driver written by Justin Gibbs. It is
intended to replace the previous aic7xxx driver maintained by Doug
Ledford since Doug is no longer maintaining that driver.
This driver supports all of Adaptec's Fast through Ultra 160 PCI
based SCSI controllers as well as the aic7770 based EISA and VLB
SCSI controllers (the 274x and 284x series). For AAA and ARO based
configurations, only SCSI functionality is provided.
If you want to compile the driver as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
say M here and read <file:Documentation/modules.txt>. The module
will be called aic7xxx.o.
CONFIG_AIC7XXX_CMDS_PER_DEVICE
Specify the number of commands you would like to allocate per SCSI
......@@ -16,10 +19,17 @@ CONFIG_AIC7XXX_CMDS_PER_DEVICE
fixed maximum, the driver will eventually lock to this maximum
and display a console message inidicating this value.
Note: Unless you experience some type of device failure, the default
value, no enforced limit, should work for you.
Due to resource allocation issues in the Linux SCSI mid-layer, using
a high number of commands per device may result in memory allocation
failures when many devices are attached to the system. For this reason,
the default is set to 32. Higher values may result in higer performance
on some devices. The upper bound is 253. 0 disables tagged queueing.
Per device tag depth can be controlled via the kernel command line
"tag_info" option. See drivers/scsi/aic7xxx/README.aic7xxx
for details.
Default: 253
Default: 32
CONFIG_AIC7XXX_RESET_DELAY_MS
The number of milliseconds to delay after an initial bus reset.
......@@ -28,12 +38,112 @@ CONFIG_AIC7XXX_RESET_DELAY_MS
Default: 15000 (15 seconds)
CONFIG_AIC7XXX_ALLOW_MEMIO
Certain chipsets are not compatible with memory mapped I/O access
to aic7xxx controllers. Memory mapped I/O does provide better
performance, but enabling this option may cause the aic7xxx driver
to fail in unpredictable ways on non-compliant chipsets.
CONFIG_AIC7XXX_PROBE_EISA_VL
Probe for EISA and VLB Aic7xxx controllers. In many newer systems,
the invasive probes necessary to detect these controllers can cause
other devices to fail. For this reason, the non-PCI probe code is
disabled by default. The current value of this option can be "toggled"
via the no_probe kernel command line option.
CONFIG_AIC7XXX_BUILD_FIRMWARE
This option should only be enabled if you are modifying the firmware
source to the aic7xxx driver and wish to have the generated firmware
include files updated during a normal kernel build. The assembler
for the firmware requires lex and yacc or their equivalents, as well
as the db v1 library. You may have to install additional packages
or modify the assembler make file or the files it includes if your
or modify the assembler Makefile or the files it includes if your
build environment is different than that of the author.
CONFIG_AIC7XXX_DEBUG_ENABLE
Compile in aic7xxx debugging code that can be useful in diagnosing
driver errors.
CONFIG_AIC7XXX_DEBUG_MASK
Bit mask of debug options that is only valid if the
CONFIG_AIC7XXX_DEBUG_ENBLE option is enabled. The bits in this mask
are defined in the drivers/scsi/aic7xxx/aic7xxx.h - search for the
variable ahc_debug in that file to find them.
Default: 0
CONFIG_AIC7XXX_REG_PRETTY_PRINT
Compile in register value tables for the output of expanded register
contents in diagnostics. This make it much easier to understand debug
output without having to refer to a data book and/or the aic7xxx.reg file.
CONFIG_SCSI_AIC79XX
This driver supports all of Adaptec's Ultra 320 PCI-X based SCSI controllers.
CONFIG_AIC79XX_CMDS_PER_DEVICE 32
Specify the number of commands you would like to allocate per SCSI
device when Tagged Command Queueing (TCQ) is enabled on that device.
This is an upper bound value for the number of tagged transactions
to be used for any device. The aic7xxx driver will automatically
vary this number based on device behavior. For devices with a
fixed maximum, the driver will eventually lock to this maximum
and display a console message inidicating this value.
Due to resource allocation issues in the Linux SCSI mid-layer, using
a high number of commands per device may result in memory allocation
failures when many devices are attached to the system. For this reason,
the default is set to 32. Higher values may result in higer performance
on some devices. The upper bound is 253. 0 disables tagged queueing.
Per device tag depth can be controlled via the kernel command line
"tag_info" option. See drivers/scsi/aic7xxx/README.aic79xx
for details.
Default: 32
CONFIG_AIC79XX_RESET_DELAY_MS 15000
The number of milliseconds to delay after an initial bus reset.
The bus settle delay following all error recovery actions is
dictated by the SCSI layer and is not affected by this value.
Default: 15000 (15 seconds)
CONFIG_AIC79XX_ALLOW_MEMIO
Certain chipsets are not compatible with memory mapped I/O access
to aic79xx controllers. Memory mapped I/O does provide better
performance, but enabling this option may cause the aic79xx driver
to fail in unpredictable ways on non-compliant chipsets.
CONFIG_AIC79XX_BUILD_FIRMWARE
This option should only be enabled if you are modifying the firmware
source to the aic7xxx driver and wish to have the generated firmware
include files updated during a normal kernel build. The assembler
for the firmware requires lex and yacc or their equivalents, as well
as the db v1 library. You may have to install additional packages
or modify the assembler Makefile or the files it includes if your
build environment is different than that of the author.
CONFIG_AIC79XX_ENABLE_RD_STRM
Read Streaming is a U320 protocol option that should enhance performance.
Early U320 drive firmware actually performs slower with read streaming
enabled so it is disabled by default. Read Streaming can be configured
in much the same way as tagged queueing using the "rd_strm" command line
option. See drivers/scsi/aic7xxx/README.aic79xx for details.
CONFIG_AIC79XX_DEBUG_ENABLE
Compile in aic79xx debugging code that can be useful in diagnosing
driver errors.
CONFIG_AIC79XX_DEBUG_MASK
Bit mask of debug options that is only valid if the
CONFIG_AIC79XX_DEBUG_ENBLE option is enabled. The bits in this mask
are defined in the drivers/scsi/aic7xxx/aic79xx.h - search for the
variable ahd_debug in that file to find them.
Default: 0
CONFIG_AIC79XX_REG_PRETTY_PRINT
Compile in register value tables for the output of expanded register
contents in diagnostics. This make it much easier to understand debug
output without having to refer to a data book and/or the aic7xxx.reg file.
if [ "$CONFIG_SCSI_AIC7XXX_OLD" != "y" ]; then
dep_tristate 'Adaptec AIC7xxx support' CONFIG_SCSI_AIC7XXX $CONFIG_SCSI
if [ "$CONFIG_SCSI_AIC7XXX" != "n" ]; then
int ' Maximum number of TCQ commands per device' CONFIG_AIC7XXX_CMDS_PER_DEVICE 253
int ' Initial bus reset delay in milli-seconds' CONFIG_AIC7XXX_RESET_DELAY_MS 15000
bool ' Build Adapter Firmware with Kernel Build' CONFIG_AIC7XXX_BUILD_FIRMWARE
int ' Maximum number of TCQ commands per device' \
CONFIG_AIC7XXX_CMDS_PER_DEVICE 32
int ' Initial bus reset delay in milli-seconds' \
CONFIG_AIC7XXX_RESET_DELAY_MS 15000
bool ' Allow device registers to be memory mapped' \
CONFIG_AIC7XXX_ALLOW_MEMIO
bool ' Probe for EISA and VL AIC7XXX Adapters' \
CONFIG_AIC7XXX_PROBE_EISA_VL
bool ' Build Adapter Firmware with Kernel Build' \
CONFIG_AIC7XXX_BUILD_FIRMWARE
bool ' Compile in Debugging Code' \
CONFIG_AIC7XXX_DEBUG_ENABLE
int ' Debug code enable mask (2048 for all debugging)' \
CONFIG_AIC7XXX_DEBUG_MASK 0
bool ' Decode registers during diagnostics' \
CONFIG_AIC7XXX_REG_PRETTY_PRINT
fi
fi
dep_tristate 'Adaptec AIC79xx support' CONFIG_SCSI_AIC79XX $CONFIG_SCSI
if [ "$CONFIG_SCSI_AIC79XX" != "n" ]; then
int ' Maximum number of TCQ commands per device' \
CONFIG_AIC79XX_CMDS_PER_DEVICE 32
int ' Initial bus reset delay in milli-seconds' \
CONFIG_AIC79XX_RESET_DELAY_MS 15000
bool ' Allow device registers to be memory mapped' \
CONFIG_AIC79XX_ALLOW_MEMIO
bool ' Build Adapter Firmware with Kernel Build' \
CONFIG_AIC79XX_BUILD_FIRMWARE
bool ' Enable Read Streaming for All Targets' \
CONFIG_AIC79XX_ENABLE_RD_STRM
bool ' Compile in Debugging Code' \
CONFIG_AIC79XX_DEBUG_ENABLE
int ' Debug code enable mask (16384 for all debugging)' \
CONFIG_AIC79XX_DEBUG_MASK 0
bool ' Decode registers during diagnostics' \
CONFIG_AIC79XX_REG_PRETTY_PRINT
fi
......@@ -3,41 +3,88 @@
#
obj-$(CONFIG_SCSI_AIC7XXX) += aic7xxx.o
ifeq ($(CONFIG_PCI),y)
obj-$(CONFIG_SCSI_AIC79XX) += aic79xx.o
endif
# Core files
aic7xxx-objs += aic7xxx_core.o aic7xxx_93cx6.o aic7770.o
# Platform Specific Files
aic7xxx-objs += aic7xxx_linux.o aic7xxx_proc.o aic7770_linux.o
aic7xxx-objs += aic7xxx_osm.o aic7xxx_proc.o aic7770_osm.o
ifeq ($(CONFIG_AIC7XXX_REG_PRETTY_PRINT),y)
aic7xxx-objs += aic7xxx_reg_print.o
endif
# PCI Specific Files
ifeq ($(CONFIG_PCI),y)
# Core PCI files
aic7xxx-objs += aic7xxx_pci.o
# Platform Specific PCI Files
aic7xxx-objs += aic7xxx_linux_pci.o
aic7xxx-objs += aic7xxx_osm_pci.o
endif
# Platform Specific U320 Files
aic79xx-objs = aic79xx_osm.o aic79xx_proc.o aic79xx_osm_pci.o
# Core Files
aic79xx-objs += aic79xx_core.o aic79xx_pci.o
ifeq ($(CONFIG_AIC79XX_REG_PRETTY_PRINT),y)
aic79xx-objs += aic79xx_reg_print.o
endif
#EXTRA_CFLAGS += -g
clean := aic7xxx_seq.h aic7xxx_reg.h aic7xxx_reg_print.c
clean += aic79xx_seq.h aic79xx_reg.h aic79xx_reg_print.c
#
# Can't this be done by calling into the aicasm Makefile instead
# of copying the clean target from there?
#mrproper := $(addprefix \
#aicasm/,aicasm_gram.c aicasm_scan.c y.tab.h aicdb.h y.output aicasm)
include $(TOPDIR)/Rules.make
# Dependencies for generated files need to be listed explicitly
$(obj)/aic7xxx_core.o: $(obj)/aic7xxx_seq.h
$(obj)/aic79xx_core.o: $(obj)/aic79xx_seq.h
$(addprefix $(obj)/,$(aic7xxx-objs)): $(obj)/aic7xxx_reg.h
$(addprefix $(obj)/,$(aic79xx-objs)): $(obj)/aic79xx_reg.h
ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y)
aic7xxx_gen = $(obj)/aic7xxx_seq.h $(obj)/aic7xxx_reg.h
ifeq ($(CONFIG_AIC7XXX_REG_PRETTY_PRINT),y)
aic7xxx_gen += $(obj)/aic7xxx_reg_print.c
aic7xxx_asm_cmd = $(obj)/aicasm/aicasm -I. -r $(obj)/aic7xxx_reg.h \
-p aic7xxx_reg_print.c -i aic7xxx_osm.h \
-o $(obj)/aic7xxx_seq.h $(src)/aic7xxx.seq
else
aic7xxx_asm_cmd = $(obj)/aicasm/aicasm -I. -r $(obj)/aic7xxx_reg.h \
-o $(obj)/aic7xxx_seq.h $(src)/aic7xxx.seq
endif
$(aic7xxx_gen): $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm
$(aic7xxx_asm_cmd)
endif
$(obj)/aic7xxx_seq.h $(obj)/aic7xxx_reg.h: $(src)/aic7xxx.seq \
$(src)/aic7xxx.reg \
$(obj)/aicasm/aicasm
$(obj)/aicasm/aicasm -I. -r $(obj)/aic7xxx_reg.h \
-o $(obj)/aic7xxx_seq.h $(src)/aic7xxx.seq
ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y)
aic79xx_gen = $(obj)/aic79xx_seq.h $(obj)/aic79xx_reg.h
ifeq ($(CONFIG_AIC79XX_REG_PRETTY_PRINT),y)
aic79xx_gen += $(obj)/aic79xx_reg_print.c
aic79xx_asm_cmd = $(obj)/aicasm/aicasm -I. -r $(obj)/aic79xx_reg.h \
-p aic79xx_reg_print.c -i aic79xx_osm.h \
-o $(obj)/aic79xx_seq.h $(src)/aic79xx.seq
else
aic79xx_asm_cmd = $(obj)/aicasm/aicasm -I. -r $(obj)/aic79xx_reg.h \
-o $(obj)/aic79xx_seq.h $(src)/aic79xx.seq
endif
$(aic79xx_gen): $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm
$(aic79xx_asm_cmd)
$(obj)/aicasm/aicasm: $(src)/aicasm/*.[chyl]
$(MAKE) -C $(src)/aicasm
endif
This diff is collapsed.
This diff is collapsed.
......@@ -37,21 +37,27 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: //depot/aic7xxx/aic7xxx/aic7770.c#14 $
* $Id: //depot/aic7xxx/aic7xxx/aic7770.c#25 $
*
* $FreeBSD: src/sys/dev/aic7xxx/aic7770.c,v 1.1 2000/09/16 20:02:27 gibbs Exp $
* $FreeBSD$
*/
#ifdef __linux__
#include "aic7xxx_osm.h"
#include "aic7xxx_inline.h"
#include "aic7xxx_93cx6.h"
#else
#include <dev/aic7xxx/aic7xxx_osm.h>
#include <dev/aic7xxx/aic7xxx_inline.h>
#include <dev/aic7xxx/aic7xxx_93cx6.h>
#endif
#define ID_AIC7770 0x04907770
#define ID_AHA_274x 0x04907771
#define ID_AHA_284xB 0x04907756 /* BIOS enabled */
#define ID_AHA_284x 0x04907757 /* BIOS disabled*/
static void aha2840_load_seeprom(struct ahc_softc *ahc);
static int aha2840_load_seeprom(struct ahc_softc *ahc);
static ahc_device_setup_t ahc_aic7770_VL_setup;
static ahc_device_setup_t ahc_aic7770_EISA_setup;;
static ahc_device_setup_t ahc_aic7770_setup;
......@@ -96,21 +102,32 @@ aic7770_find_device(uint32_t id)
}
int
aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry)
aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry, u_int io)
{
u_long l;
int error;
int have_seeprom;
u_int hostconf;
u_int irq;
u_int intdef;
error = entry->setup(ahc);
have_seeprom = 0;
if (error != 0)
return (error);
error = aic7770_map_registers(ahc);
error = aic7770_map_registers(ahc, io);
if (error != 0)
return (error);
/*
* Before we continue probing the card, ensure that
* its interrupts are *disabled*. We don't want
* a misstep to hang the machine in an interrupt
* storm.
*/
ahc_intr_enable(ahc, FALSE);
ahc->description = entry->name;
error = ahc_softc_init(ahc);
......@@ -168,21 +185,22 @@ aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry)
ahc->flags |= AHC_TERM_ENB_B;
}
}
/*
* We have no way to tell, so assume extended
* translation is enabled.
*/
ahc->flags |= AHC_EXTENDED_TRANS_A|AHC_EXTENDED_TRANS_B;
if ((ahc_inb(ahc, HA_274_BIOSGLOBAL) & HA_274_EXTENDED_TRANS))
ahc->flags |= AHC_EXTENDED_TRANS_A|AHC_EXTENDED_TRANS_B;
break;
}
case AHC_VL:
{
aha2840_load_seeprom(ahc);
have_seeprom = aha2840_load_seeprom(ahc);
break;
}
default:
break;
}
if (have_seeprom == 0) {
free(ahc->seep_config, M_DEVBUF);
ahc->seep_config = NULL;
}
/*
* Ensure autoflush is enabled
......@@ -201,24 +219,22 @@ aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry)
if (error != 0)
return (error);
error = aic7770_map_int(ahc, irq);
if (error != 0)
return (error);
ahc_list_lock(&l);
/*
* Link this softc in with all other ahc instances.
*/
ahc_softc_insert(ahc);
error = aic7770_map_int(ahc, irq);
if (error != 0)
return (error);
/*
* Enable the board's BUS drivers
*/
ahc_outb(ahc, BCTL, ENABLE);
/*
* Allow interrupts.
*/
ahc_intr_enable(ahc, TRUE);
ahc_list_unlock(&l);
return (0);
}
......@@ -226,14 +242,13 @@ aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry)
/*
* Read the 284x SEEPROM.
*/
static void
static int
aha2840_load_seeprom(struct ahc_softc *ahc)
{
struct seeprom_descriptor sd;
struct seeprom_config sc;
uint16_t checksum = 0;
uint8_t scsi_conf;
int have_seeprom;
struct seeprom_descriptor sd;
struct seeprom_config *sc;
int have_seeprom;
uint8_t scsi_conf;
sd.sd_ahc = ahc;
sd.sd_control_offset = SEECTL_2840;
......@@ -246,23 +261,16 @@ aha2840_load_seeprom(struct ahc_softc *ahc)
sd.sd_CK = CK_2840;
sd.sd_DO = DO_2840;
sd.sd_DI = DI_2840;
sc = ahc->seep_config;
if (bootverbose)
printf("%s: Reading SEEPROM...", ahc_name(ahc));
have_seeprom = read_seeprom(&sd,
(uint16_t *)&sc,
/*start_addr*/0,
sizeof(sc)/2);
have_seeprom = ahc_read_seeprom(&sd, (uint16_t *)&sc,
/*start_addr*/0, sizeof(sc)/2);
if (have_seeprom) {
/* Check checksum */
int i;
int maxaddr = (sizeof(sc)/2) - 1;
uint16_t *scarray = (uint16_t *)&sc;
for (i = 0; i < maxaddr; i++)
checksum = checksum + scarray[i];
if (checksum != sc.checksum) {
if (ahc_verify_cksum(sc) == 0) {
if(bootverbose)
printf ("checksum error\n");
have_seeprom = 0;
......@@ -280,41 +288,44 @@ aha2840_load_seeprom(struct ahc_softc *ahc)
* Put the data we've collected down into SRAM
* where ahc_init will find it.
*/
int i;
int max_targ = (ahc->features & AHC_WIDE) != 0 ? 16 : 8;
int i;
int max_targ;
uint16_t discenable;
max_targ = (ahc->features & AHC_WIDE) != 0 ? 16 : 8;
discenable = 0;
for (i = 0; i < max_targ; i++){
uint8_t target_settings;
target_settings = (sc.device_flags[i] & CFXFER) << 4;
if (sc.device_flags[i] & CFSYNCH)
uint8_t target_settings;
target_settings = (sc->device_flags[i] & CFXFER) << 4;
if (sc->device_flags[i] & CFSYNCH)
target_settings |= SOFS;
if (sc.device_flags[i] & CFWIDEB)
if (sc->device_flags[i] & CFWIDEB)
target_settings |= WIDEXFER;
if (sc.device_flags[i] & CFDISC)
if (sc->device_flags[i] & CFDISC)
discenable |= (0x01 << i);
ahc_outb(ahc, TARG_SCSIRATE + i, target_settings);
}
ahc_outb(ahc, DISC_DSB, ~(discenable & 0xff));
ahc_outb(ahc, DISC_DSB + 1, ~((discenable >> 8) & 0xff));
ahc->our_id = sc.brtime_id & CFSCSIID;
ahc->our_id = sc->brtime_id & CFSCSIID;
scsi_conf = (ahc->our_id & 0x7);
if (sc.adapter_control & CFSPARITY)
if (sc->adapter_control & CFSPARITY)
scsi_conf |= ENSPCHK;
if (sc.adapter_control & CFRESETB)
if (sc->adapter_control & CFRESETB)
scsi_conf |= RESET_SCSI;
if (sc.bios_control & CF284XEXTEND)
if (sc->bios_control & CF284XEXTEND)
ahc->flags |= AHC_EXTENDED_TRANS_A;
/* Set SCSICONF info */
ahc_outb(ahc, SCSICONF, scsi_conf);
if (sc.adapter_control & CF284XSTERM)
if (sc->adapter_control & CF284XSTERM)
ahc->flags |= AHC_TERM_ENB_A;
}
return (have_seeprom);
}
static int
......
......@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7770_linux.c#9 $
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7770_osm.c#11 $
*/
#include "aic7xxx_osm.h"
......@@ -55,9 +55,6 @@ aic7770_linux_probe(Scsi_Host_Template *template)
int eisaBase;
int found;
if (aic7xxx_no_probe)
return (0);
eisaBase = 0x1000 + AHC_EISA_SLOT_OFFSET;
found = 0;
for (slot = 1; slot < NUMSLOTS; eisaBase+=0x1000, slot++) {
......@@ -103,10 +100,9 @@ aic7770_linux_probe(Scsi_Host_Template *template)
*/
break;
}
ahc->tag = BUS_SPACE_PIO;
ahc->bsh.ioport = eisaBase;
error = aic7770_config(ahc, entry);
error = aic7770_config(ahc, entry, eisaBase);
if (error != 0) {
ahc->bsh.ioport = 0;
ahc_free(ahc);
continue;
}
......@@ -120,18 +116,19 @@ aic7770_linux_probe(Scsi_Host_Template *template)
}
int
aic7770_map_registers(struct ahc_softc *ahc)
aic7770_map_registers(struct ahc_softc *ahc, u_int port)
{
/*
* Lock out other contenders for our i/o space.
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
request_region(ahc->bsh.ioport, AHC_EISA_IOSIZE, "aic7xxx");
request_region(port, AHC_EISA_IOSIZE, "aic7xxx");
#else
if (request_region(ahc->bsh.ioport, AHC_EISA_IOSIZE, "aic7xxx") == 0)
if (request_region(port, AHC_EISA_IOSIZE, "aic7xxx") == 0)
return (ENOMEM);
#endif
ahc->tag = BUS_SPACE_PIO;
ahc->bsh.ioport = port;
return (0);
}
......@@ -145,9 +142,9 @@ aic7770_map_int(struct ahc_softc *ahc, u_int irq)
if ((ahc->flags & AHC_EDGE_INTERRUPT) == 0)
shared = SA_SHIRQ;
ahc->platform_data->irq = irq;
error = request_irq(ahc->platform_data->irq, ahc_linux_isr,
shared, "aic7xxx", ahc);
error = request_irq(irq, ahc_linux_isr, shared, "aic7xxx", ahc);
if (error == 0)
ahc->platform_data->irq = irq;
return (-error);
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Adaptec AIC79xx device driver host template for Linux.
*
* Copyright (c) 2000-2001 Adaptec Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_host.h#7 $
*/
#ifndef _AIC79XX_LINUX_HOST_H_
#define _AIC79XX_LINUX_HOST_H_
int ahd_linux_proc_info(char *, char **, off_t, int, int, int);
int ahd_linux_queue(Scsi_Cmnd *, void (*)(Scsi_Cmnd *));
int ahd_linux_detect(Scsi_Host_Template *);
int ahd_linux_release(struct Scsi_Host *);
const char *ahd_linux_info(struct Scsi_Host *);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
int ahd_linux_biosparam(Disk *, struct block_device *, int[]);
#else
int ahd_linux_biosparam(Disk *, kdev_t, int[]);
#endif
int ahd_linux_bus_reset(Scsi_Cmnd *);
int ahd_linux_dev_reset(Scsi_Cmnd *);
int ahd_linux_abort(Scsi_Cmnd *);
#if defined(__i386__)
# define AIC79XX_BIOSPARAM ahd_linux_biosparam
#else
# define AIC79XX_BIOSPARAM NULL
#endif
/*
* Scsi_Host_Template (see hosts.h) for AIC-79xx - some fields
* to do with card config are filled in after the card is detected.
*/
#define AIC79XX_TEMPLATE_CORE \
next: NULL, \
module: NULL, \
proc_dir: NULL, \
proc_info: ahd_linux_proc_info, \
name: NULL, \
detect: ahd_linux_detect, \
release: ahd_linux_release, \
info: ahd_linux_info, \
command: NULL, \
queuecommand: ahd_linux_queue, \
eh_strategy_handler: NULL, \
eh_abort_handler: ahd_linux_abort, \
eh_device_reset_handler: ahd_linux_dev_reset, \
eh_bus_reset_handler: ahd_linux_bus_reset, \
eh_host_reset_handler: NULL, \
abort: NULL, \
reset: NULL, \
slave_attach: NULL, \
bios_param: AIC79XX_BIOSPARAM, \
can_queue: AHD_MAX_QUEUE,/* max simultaneous cmds */\
this_id: -1, /* scsi id of host adapter */\
sg_tablesize: AHD_NSEG, /* max scatter-gather cmds */\
cmd_per_lun: 2, /* cmds per lun */\
present: 0, /* number of 7xxx's present */\
unchecked_isa_dma: 0, /* no memory DMA restrictions*/\
use_clustering: ENABLE_CLUSTERING
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#define AIC79XX { \
AIC79XX_TEMPLATE_CORE \
}
#else
#define AIC79XX { \
AIC79XX_TEMPLATE_CORE, \
use_new_eh_code: 1 \
}
#endif
#endif /* _AIC79XX_LINUX_HOST_H_ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -37,9 +37,9 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.h#34 $
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.h#51 $
*
* $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.h,v 1.30 2000/11/10 20:13:40 gibbs Exp $
* $FreeBSD$
*/
#ifndef _AIC7XXX_H_
......@@ -51,6 +51,7 @@
/************************* Forward Declarations *******************************/
struct ahc_platform_data;
struct scb_platform_data;
struct seeprom_descriptor;
/****************************** Useful Macros *********************************/
#ifndef MAX
......@@ -170,7 +171,7 @@ struct scb_platform_data;
#define AHC_TMODE_CMDS 256
/* Reset line assertion time in us */
#define AHC_BUSRESET_DELAY 250
#define AHC_BUSRESET_DELAY 25
/******************* Chip Characteristics/Operating Settings *****************/
/*
......@@ -350,9 +351,11 @@ typedef enum {
*/
AHC_BIOS_ENABLED = 0x80000,
AHC_ALL_INTERRUPTS = 0x100000,
AHC_PAGESCBS = 0x400000, /* Enable SCB paging */
AHC_EDGE_INTERRUPT = 0x800000, /* Device uses edge triggered ints */
AHC_39BIT_ADDRESSING = 0x1000000 /* Use 39 bit addressing scheme. */
AHC_PAGESCBS = 0x400000, /* Enable SCB paging */
AHC_EDGE_INTERRUPT = 0x800000, /* Device uses edge triggered ints */
AHC_39BIT_ADDRESSING = 0x1000000, /* Use 39 bit addressing scheme. */
AHC_LSCBS_ENABLED = 0x2000000, /* 64Byte SCBs enabled */
AHC_SCB_CONFIG_USED = 0x4000000 /* No SEEPROM but SCB2 had info. */
} ahc_flag;
/************************* Hardware SCB Definition ***************************/
......@@ -713,11 +716,6 @@ struct ahc_syncrate {
char *rate;
};
/*
* The synchronouse transfer rate table.
*/
extern struct ahc_syncrate ahc_syncrates[];
/*
* Indexes into our table of syncronous transfer rates.
*/
......@@ -941,6 +939,7 @@ struct ahc_softc {
ahc_feature features;
ahc_bug bugs;
ahc_flag flags;
struct seeprom_config *seep_config;
/* Values to store in the SEQCTL register for pause and unpause */
uint8_t unpause;
......@@ -1093,7 +1092,8 @@ int ahc_pci_config(struct ahc_softc *,
/*************************** EISA/VL Front End ********************************/
struct aic7770_identity *aic7770_find_device(uint32_t);
int aic7770_config(struct ahc_softc *ahc,
struct aic7770_identity *);
struct aic7770_identity *,
u_int port);
/************************** SCB and SCB queue management **********************/
int ahc_probe_scbs(struct ahc_softc *);
......@@ -1116,6 +1116,7 @@ void ahc_pause_and_flushwork(struct ahc_softc *ahc);
int ahc_suspend(struct ahc_softc *ahc);
int ahc_resume(struct ahc_softc *ahc);
void ahc_softc_insert(struct ahc_softc *);
struct ahc_softc *ahc_find_softc(struct ahc_softc *ahc);
void ahc_set_unit(struct ahc_softc *, int);
void ahc_set_name(struct ahc_softc *, char *);
void ahc_alloc_scbs(struct ahc_softc *ahc);
......@@ -1146,6 +1147,11 @@ int ahc_search_qinfifo(struct ahc_softc *ahc, int target,
char channel, int lun, u_int tag,
role_t role, uint32_t status,
ahc_search_action action);
int ahc_search_untagged_queues(struct ahc_softc *ahc,
ahc_io_ctx_t ctx,
int target, char channel,
int lun, uint32_t status,
ahc_search_action action);
int ahc_search_disc_list(struct ahc_softc *ahc, int target,
char channel, int lun, u_int tag,
int stop_on_first, int remove,
......@@ -1157,7 +1163,8 @@ int ahc_abort_scbs(struct ahc_softc *ahc, int target,
char channel, int lun, u_int tag,
role_t role, uint32_t status);
void ahc_restart(struct ahc_softc *ahc);
void ahc_calc_residual(struct scb *scb);
void ahc_calc_residual(struct ahc_softc *ahc,
struct scb *scb);
/*************************** Utility Functions ********************************/
struct ahc_phase_table_entry*
ahc_lookup_phase_entry(int phase);
......@@ -1219,6 +1226,31 @@ cam_status ahc_find_tmode_devs(struct ahc_softc *ahc,
#endif
#endif
/******************************* Debug ***************************************/
#ifdef AHC_DEBUG
extern uint32_t ahc_debug;
#define AHC_SHOW_MISC 0x0001
#define AHC_SHOW_SENSE 0x0002
#define AHC_DUMP_SEEPROM 0x0004
#define AHC_SHOW_TERMCTL 0x0008
#define AHC_SHOW_MEMORY 0x0010
#define AHC_SHOW_MESSAGES 0x0020
#define AHC_SHOW_SELTO 0x0080
#define AHC_SHOW_QFULL 0x0200
#define AHC_SHOW_QUEUE 0x0400
#define AHC_SHOW_TQIN 0x0800
#define AHC_DEBUG_SEQUENCER 0x1000
#endif
void ahc_print_scb(struct scb *scb);
void ahc_dump_card_state(struct ahc_softc *ahc);
int ahc_print_register(ahc_reg_parse_entry_t *table,
u_int num_entries,
const char *name,
u_int address,
u_int value,
u_int *cur_column,
u_int wrap_point);
/******************************* SEEPROM *************************************/
int ahc_acquire_seeprom(struct ahc_softc *ahc,
struct seeprom_descriptor *sd);
void ahc_release_seeprom(struct seeprom_descriptor *sd);
#endif /* _AIC7XXX_H_ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -38,9 +38,9 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx_93cx6.h#7 $
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx_93cx6.h#12 $
*
* $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_93cx6.h,v 1.8 2000/11/10 20:13:41 gibbs Exp $
* $FreeBSD$
*/
#ifndef _AIC7XXX_93CX6_H_
#define _AIC7XXX_93CX6_H_
......@@ -93,8 +93,10 @@ do { \
#define SEEPROM_DATA_INB(sd) \
ahc_inb(sd->sd_ahc, sd->sd_dataout_offset)
int read_seeprom(struct seeprom_descriptor *sd, uint16_t *buf,
u_int start_addr, u_int count);
int verify_cksum(struct seeprom_config *sc);
int ahc_read_seeprom(struct seeprom_descriptor *sd, uint16_t *buf,
u_int start_addr, u_int count);
int ahc_write_seeprom(struct seeprom_descriptor *sd, uint16_t *buf,
u_int start_addr, u_int count);
int ahc_verify_cksum(struct seeprom_config *sc);
#endif /* _AIC7XXX_93CX6_H_ */
This diff is collapsed.
......@@ -36,18 +36,22 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_linux_host.h#5 $
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_host.h#10 $
*/
#ifndef _AIC7XXX_LINUX_HOST_H_
#define _AIC7XXX_LINUX_HOST_H_
#ifndef _AIC7XXX_HOST_H_
#define _AIC7XXX_HOST_H_
int ahc_linux_proc_info(char *, char **, off_t, int, int, int);
int ahc_linux_queue(Scsi_Cmnd *, void (*)(Scsi_Cmnd *));
int ahc_linux_detect(Scsi_Host_Template *);
int ahc_linux_release(struct Scsi_Host *);
const char *ahc_linux_info(struct Scsi_Host *);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
int ahc_linux_biosparam(Disk *, struct block_device *, int[]);
#else
int ahc_linux_biosparam(Disk *, kdev_t, int[]);
#endif
int ahc_linux_bus_reset(Scsi_Cmnd *);
int ahc_linux_dev_reset(Scsi_Cmnd *);
int ahc_linux_abort(Scsi_Cmnd *);
......@@ -62,7 +66,7 @@ int ahc_linux_abort(Scsi_Cmnd *);
* Scsi_Host_Template (see hosts.h) for AIC-7xxx - some fields
* to do with card config are filled in after the card is detected.
*/
#define AIC7XXX { \
#define AIC7XXX_TEMPLATE_CORE \
next: NULL, \
module: NULL, \
proc_dir: NULL, \
......@@ -82,14 +86,23 @@ int ahc_linux_abort(Scsi_Cmnd *);
reset: NULL, \
slave_attach: NULL, \
bios_param: AIC7XXX_BIOSPARAM, \
can_queue: 253, /* max simultaneous cmds */\
this_id: -1, /* scsi id of host adapter */\
sg_tablesize: 0, /* max scatter-gather cmds */\
cmd_per_lun: 2, /* cmds per lun */\
present: 0, /* number of 7xxx's present */\
unchecked_isa_dma: 0, /* no memory DMA restrictions */\
use_clustering: ENABLE_CLUSTERING, \
highmem_io: 1 \
can_queue: AHC_MAX_QUEUE,/* max simultaneous cmds */\
this_id: -1, /* scsi id of host adapter */\
sg_tablesize: AHC_NSEG, /* max scatter-gather cmds */\
cmd_per_lun: 2, /* cmds per lun */\
present: 0, /* number of 7xxx's present */\
unchecked_isa_dma: 0, /* no memory DMA restrictions*/\
use_clustering: ENABLE_CLUSTERING
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#define AIC7XXX { \
AIC7XXX_TEMPLATE_CORE \
}
#else
#define AIC7XXX { \
AIC7XXX_TEMPLATE_CORE, \
use_new_eh_code: 1 \
}
#endif
#endif /* _AIC7XXX_LINUX_HOST_H_ */
#endif /* _AIC7XXX_HOST_H_ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment