Commit 0bab3fa4 authored by Justin T. Gibbs's avatar Justin T. Gibbs

Complete Aic7xxx and Aic79xx driver merge with Linux 2.5.X mainline.

parent 14686d42
# #
# AIC79XX 2.5.X Kernel configuration File. # AIC79XX 2.5.X Kernel configuration File.
# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Kconfig.aic79xx#3 $ # $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Kconfig.aic79xx#4 $
# #
config SCSI_AIC79XX config SCSI_AIC79XX
tristate "Adaptec AIC79xx U320 support" tristate "Adaptec AIC79xx U320 support"
...@@ -59,6 +59,7 @@ config AIC79XX_BUILD_FIRMWARE ...@@ -59,6 +59,7 @@ config AIC79XX_BUILD_FIRMWARE
config AIC79XX_ENABLE_RD_STRM config AIC79XX_ENABLE_RD_STRM
bool "Enable Read Streaming for All Targets" bool "Enable Read Streaming for All Targets"
depends on SCSI_AIC79XX depends on SCSI_AIC79XX
default n
help help
Read Streaming is a U320 protocol option that should enhance Read Streaming is a U320 protocol option that should enhance
performance. Early U320 drive firmware actually performs slower performance. Early U320 drive firmware actually performs slower
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#85 $ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#86 $
* *
* $FreeBSD$ * $FreeBSD$
*/ */
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#172 $ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#174 $
* *
* $FreeBSD$ * $FreeBSD$
*/ */
......
/* /*
* Adaptec AIC79xx device driver for Linux. * Adaptec AIC79xx device driver for Linux.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#128 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#130 $
* *
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Copyright (c) 1994-2000 Justin T. Gibbs. * Copyright (c) 1994-2000 Justin T. Gibbs.
...@@ -2391,7 +2391,7 @@ ahd_linux_register_host(struct ahd_softc *ahd, Scsi_Host_Template *template) ...@@ -2391,7 +2391,7 @@ ahd_linux_register_host(struct ahd_softc *ahd, Scsi_Host_Template *template)
} }
host->unique_id = ahd->unit; host->unique_id = ahd->unit;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,4) && \ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,4) && \
LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0) LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
scsi_set_pci_device(host, ahd->dev_softc); scsi_set_pci_device(host, ahd->dev_softc);
#endif #endif
ahd_linux_initialize_scsi_bus(ahd); ahd_linux_initialize_scsi_bus(ahd);
...@@ -2421,9 +2421,9 @@ ahd_linux_register_host(struct ahd_softc *ahd, Scsi_Host_Template *template) ...@@ -2421,9 +2421,9 @@ ahd_linux_register_host(struct ahd_softc *ahd, Scsi_Host_Template *template)
* single bit selection (i.e. selecting ourselves). * single bit selection (i.e. selecting ourselves).
* It is expected that either an external application * It is expected that either an external application
* or a modified kernel will be used to probe this * or a modified kernel will be used to probe this
* ID if it is appropriate. To accomodate these installations, * ID if it is appropriate. To accommodate these
* ahc_linux_alloc_target() will allocate for our ID if * installations, ahc_linux_alloc_target() will allocate
* asked to do so. * for our ID if asked to do so.
*/ */
if (target == ahd->our_id) if (target == ahd->our_id)
continue; continue;
...@@ -2434,7 +2434,7 @@ ahd_linux_register_host(struct ahd_softc *ahd, Scsi_Host_Template *template) ...@@ -2434,7 +2434,7 @@ ahd_linux_register_host(struct ahd_softc *ahd, Scsi_Host_Template *template)
ahd_linux_start_dv(ahd); ahd_linux_start_dv(ahd);
ahd_unlock(ahd, &s); ahd_unlock(ahd, &s);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
scsi_add_host(host, &ahd->dev_softc->dev); scsi_add_host(host, &ahd->dev_softc->dev);
#endif #endif
return (0); return (0);
...@@ -2584,7 +2584,7 @@ ahd_platform_free(struct ahd_softc *ahd) ...@@ -2584,7 +2584,7 @@ ahd_platform_free(struct ahd_softc *ahd)
} }
ahd_teardown_runq_tasklet(ahd); ahd_teardown_runq_tasklet(ahd);
if (ahd->platform_data->host != NULL) { if (ahd->platform_data->host != NULL) {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
scsi_remove_host(ahd->platform_data->host); scsi_remove_host(ahd->platform_data->host);
#endif #endif
scsi_unregister(ahd->platform_data->host); scsi_unregister(ahd->platform_data->host);
...@@ -2627,10 +2627,12 @@ ahd_platform_free(struct ahd_softc *ahd) ...@@ -2627,10 +2627,12 @@ ahd_platform_free(struct ahd_softc *ahd)
#endif #endif
} }
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) && \ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) && \
LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0) LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
/* /*
* In 2.4 we detach from the scsi midlayer before the PCI * In 2.4 we detach from the scsi midlayer before the PCI
* layer invokes our remove callback. * layer invokes our remove callback. No per-instance
* detach is provided, so we must reach inside the PCI
* subsystem's internals and detach our driver manually.
*/ */
if (ahd->dev_softc != NULL) if (ahd->dev_softc != NULL)
ahd->dev_softc->driver = NULL; ahd->dev_softc->driver = NULL;
...@@ -5348,9 +5350,10 @@ ahd_platform_dump_card_state(struct ahd_softc *ahd) ...@@ -5348,9 +5350,10 @@ ahd_platform_dump_card_state(struct ahd_softc *ahd)
} }
} }
static int __init ahd_linux_init(void) static int __init
ahd_linux_init(void)
{ {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
return (ahd_linux_detect(&aic79xx_driver_template) ? 0 : -ENODEV); return (ahd_linux_detect(&aic79xx_driver_template) ? 0 : -ENODEV);
#else #else
scsi_register_module(MODULE_SCSI_HA, &aic79xx_driver_template); scsi_register_module(MODULE_SCSI_HA, &aic79xx_driver_template);
...@@ -5364,9 +5367,15 @@ static int __init ahd_linux_init(void) ...@@ -5364,9 +5367,15 @@ static int __init ahd_linux_init(void)
#endif #endif
} }
static void __exit ahd_linux_exit(void) static void __exit
ahd_linux_exit(void)
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
/*
* In 2.4 we have to unregister from the PCI core _after_
* unregistering from the scsi midlayer to avoid dangling
* references.
*/
scsi_unregister_module(MODULE_SCSI_HA, &aic79xx_driver_template); scsi_unregister_module(MODULE_SCSI_HA, &aic79xx_driver_template);
#endif #endif
ahd_linux_pci_exit(); ahd_linux_pci_exit();
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#117 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#118 $
* *
*/ */
#ifndef _AIC79XX_LINUX_H_ #ifndef _AIC79XX_LINUX_H_
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c#20 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c#21 $
*/ */
#include "aic79xx_osm.h" #include "aic79xx_osm.h"
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.h#73 $ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.h#74 $
* *
* $FreeBSD$ * $FreeBSD$
*/ */
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#121 $ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#123 $
* *
* $FreeBSD$ * $FreeBSD$
*/ */
......
/* /*
* Adaptec AIC7xxx device driver for Linux. * Adaptec AIC7xxx device driver for Linux.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#192 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#194 $
* *
* Copyright (c) 1994 John Aycock * Copyright (c) 1994 John Aycock
* The University of Calgary Department of Computer Science. * The University of Calgary Department of Computer Science.
...@@ -1864,7 +1864,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, Scsi_Host_Template *template) ...@@ -1864,7 +1864,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, Scsi_Host_Template *template)
} }
host->unique_id = ahc->unit; host->unique_id = ahc->unit;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,4) && \ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,4) && \
LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0) LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
scsi_set_pci_device(host, ahc->dev_softc); scsi_set_pci_device(host, ahc->dev_softc);
#endif #endif
ahc_linux_initialize_scsi_bus(ahc); ahc_linux_initialize_scsi_bus(ahc);
...@@ -1900,9 +1900,9 @@ ahc_linux_register_host(struct ahc_softc *ahc, Scsi_Host_Template *template) ...@@ -1900,9 +1900,9 @@ ahc_linux_register_host(struct ahc_softc *ahc, Scsi_Host_Template *template)
* single bit selection (i.e. selecting ourselves). * single bit selection (i.e. selecting ourselves).
* It is expected that either an external application * It is expected that either an external application
* or a modified kernel will be used to probe this * or a modified kernel will be used to probe this
* ID if it is appropriate. To accomodate these installations, * ID if it is appropriate. To accommodate these
* ahc_linux_alloc_target() will allocate for our ID if * installations, ahc_linux_alloc_target() will allocate
* asked to do so. * for our ID if asked to do so.
*/ */
if ((channel == 0 && target == ahc->our_id) if ((channel == 0 && target == ahc->our_id)
|| (channel == 1 && target == ahc->our_id_b)) || (channel == 1 && target == ahc->our_id_b))
...@@ -1914,7 +1914,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, Scsi_Host_Template *template) ...@@ -1914,7 +1914,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, Scsi_Host_Template *template)
ahc_linux_start_dv(ahc); ahc_linux_start_dv(ahc);
ahc_unlock(ahc, &s); ahc_unlock(ahc, &s);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
scsi_add_host(host, (ahc->dev_softc ? &ahc->dev_softc->dev : NULL)); scsi_add_host(host, (ahc->dev_softc ? &ahc->dev_softc->dev : NULL));
#endif #endif
return (0); return (0);
...@@ -2096,7 +2096,7 @@ ahc_platform_free(struct ahc_softc *ahc) ...@@ -2096,7 +2096,7 @@ ahc_platform_free(struct ahc_softc *ahc)
tasklet_kill(&ahc->platform_data->runq_tasklet); tasklet_kill(&ahc->platform_data->runq_tasklet);
#endif #endif
if (ahc->platform_data->host != NULL) { if (ahc->platform_data->host != NULL) {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
scsi_remove_host(ahc->platform_data->host); scsi_remove_host(ahc->platform_data->host);
#endif #endif
scsi_unregister(ahc->platform_data->host); scsi_unregister(ahc->platform_data->host);
...@@ -2135,15 +2135,16 @@ ahc_platform_free(struct ahc_softc *ahc) ...@@ -2135,15 +2135,16 @@ ahc_platform_free(struct ahc_softc *ahc)
0x1000); 0x1000);
#endif #endif
} }
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) && \
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
/* /*
* In 2.4 we detach from the scsi midlayer before the PCI * In 2.4 we detach from the scsi midlayer before the PCI
* layer invokes our remove callback. * layer invokes our remove callback. No per-instance
* detach is provided, so we must reach inside the PCI
* subsystem's internals and detach our driver manually.
*/ */
if (ahc->dev_softc != NULL) if (ahc->dev_softc != NULL)
ahc->dev_softc->driver = NULL; ahc->dev_softc->driver = NULL;
#endif
#endif #endif
free(ahc->platform_data, M_DEVBUF); free(ahc->platform_data, M_DEVBUF);
} }
...@@ -5220,9 +5221,10 @@ ahc_platform_dump_card_state(struct ahc_softc *ahc) ...@@ -5220,9 +5221,10 @@ ahc_platform_dump_card_state(struct ahc_softc *ahc)
} }
} }
static int __init ahc_linux_init(void) static int __init
ahc_linux_init(void)
{ {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
return (ahc_linux_detect(&aic7xxx_driver_template) ? 0 : -ENODEV); return (ahc_linux_detect(&aic7xxx_driver_template) ? 0 : -ENODEV);
#else #else
scsi_register_module(MODULE_SCSI_HA, &aic7xxx_driver_template); scsi_register_module(MODULE_SCSI_HA, &aic7xxx_driver_template);
...@@ -5236,9 +5238,10 @@ static int __init ahc_linux_init(void) ...@@ -5236,9 +5238,10 @@ static int __init ahc_linux_init(void)
#endif #endif
} }
static void __exit ahc_linux_exit(void) static void __exit
ahc_linux_exit(void)
{ {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
struct ahc_softc *ahc; struct ahc_softc *ahc;
ahc_linux_pci_exit(); ahc_linux_pci_exit();
...@@ -5255,9 +5258,8 @@ static void __exit ahc_linux_exit(void) ...@@ -5255,9 +5258,8 @@ static void __exit ahc_linux_exit(void)
/* /*
* In 2.4 we have to unregister from the PCI core _after_ * In 2.4 we have to unregister from the PCI core _after_
* unregistering from the scsi midlayer to avoid danling references. * unregistering from the scsi midlayer to avoid dangling
* * references.
* The 2.4 scsi midlayer is so f***ed..
*/ */
ahc_linux_pci_exit(); ahc_linux_pci_exit();
#endif #endif
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#128 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#129 $
* *
*/ */
#ifndef _AIC7XXX_LINUX_H_ #ifndef _AIC7XXX_LINUX_H_
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c#43 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c#44 $
*/ */
#include "aic7xxx_osm.h" #include "aic7xxx_osm.h"
......
...@@ -46,7 +46,6 @@ aicdb.h: ...@@ -46,7 +46,6 @@ aicdb.h:
echo "*** Install db development libraries"; \ echo "*** Install db development libraries"; \
fi fi
clean-files := $(CLEANFILES) $(PROG)
clean: clean:
rm -f $(clean-files) rm -f $(clean-files)
......
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