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

Aic7xxx and Aic79xx Driver Updates

 o Correct type safty of option parsing logic
 o Make option toggling work correctly
 o Add "probe_eisa_vlb" as an alias for the "no_probe" option so
   that there is a clearly defined name associated with the command
   line feature that allows eisa_vlb probes to be enabled/disabled
   in the aic7xxx driver.
 o PCI parity error checking defaults to being enabled.
parent 8f7e2dea
/* /*
* Adaptec AIC79xx device driver for Linux. * Adaptec AIC79xx device driver for Linux.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#153 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#154 $
* *
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Copyright (c) 1994-2000 Justin T. Gibbs. * Copyright (c) 1994-2000 Justin T. Gibbs.
...@@ -357,14 +357,14 @@ static uint32_t aic79xx_no_reset; ...@@ -357,14 +357,14 @@ static uint32_t aic79xx_no_reset;
* disabled at the very end. That should fix everyone up unless there are * disabled at the very end. That should fix everyone up unless there are
* really strange cirumstances. * really strange cirumstances.
*/ */
static int aic79xx_reverse_scan = 0; static uint32_t aic79xx_reverse_scan;
/* /*
* Should we force EXTENDED translation on a controller. * Should we force EXTENDED translation on a controller.
* 0 == Use whatever is in the SEEPROM or default to off * 0 == Use whatever is in the SEEPROM or default to off
* 1 == Use whatever is in the SEEPROM or default to on * 1 == Use whatever is in the SEEPROM or default to on
*/ */
static uint32_t aic79xx_extended = 0; static uint32_t aic79xx_extended;
/* /*
* PCI bus parity checking of the Adaptec controllers. This is somewhat * PCI bus parity checking of the Adaptec controllers. This is somewhat
...@@ -373,15 +373,14 @@ static uint32_t aic79xx_extended = 0; ...@@ -373,15 +373,14 @@ static uint32_t aic79xx_extended = 0;
* chipset configurations, it can generate tons of false error messages. * chipset configurations, it can generate tons of false error messages.
* It's included in the driver for completeness. * It's included in the driver for completeness.
* 0 = Shut off PCI parity check * 0 = Shut off PCI parity check
* -1 = Normal polarity pci parity checking * non-0 = Enable PCI parity check
* 1 = reverse polarity pci parity checking
* *
* NOTE: you can't actually pass -1 on the lilo prompt. So, to set this * NOTE: you can't actually pass -1 on the lilo prompt. So, to set this
* variable to -1 you would actually want to simply pass the variable * variable to -1 you would actually want to simply pass the variable
* name without a number. That will invert the 0 which will result in * name without a number. That will invert the 0 which will result in
* -1. * -1.
*/ */
static int aic79xx_pci_parity = 0; static uint32_t aic79xx_pci_parity = ~0;
/* /*
* There are lots of broken chipsets in the world. Some of them will * There are lots of broken chipsets in the world. Some of them will
...@@ -389,7 +388,7 @@ static int aic79xx_pci_parity = 0; ...@@ -389,7 +388,7 @@ static int aic79xx_pci_parity = 0;
* controller. I/O mapped register access, if allowed by the given * controller. I/O mapped register access, if allowed by the given
* platform, will work in almost all cases. * platform, will work in almost all cases.
*/ */
int aic79xx_allow_memio = 1; uint32_t aic79xx_allow_memio = ~0;
/* /*
* aic79xx_detect() has been run, so register all device arrivals * aic79xx_detect() has been run, so register all device arrivals
...@@ -408,7 +407,7 @@ int aic79xx_detect_complete; ...@@ -408,7 +407,7 @@ int aic79xx_detect_complete;
* We default to 256ms because some older devices need a longer time * We default to 256ms because some older devices need a longer time
* to respond to initial selection. * to respond to initial selection.
*/ */
static int aic79xx_seltime = 0x00; static uint32_t aic79xx_seltime;
/* /*
* Certain devices do not perform any aging on commands. Should the * Certain devices do not perform any aging on commands. Should the
...@@ -418,7 +417,7 @@ static int aic79xx_seltime = 0x00; ...@@ -418,7 +417,7 @@ static int aic79xx_seltime = 0x00;
* force all outstanding transactions to be serviced prior to a new * force all outstanding transactions to be serviced prior to a new
* transaction. * transaction.
*/ */
int aic79xx_periodic_otag; uint32_t aic79xx_periodic_otag;
/* /*
* Module information and settable options. * Module information and settable options.
...@@ -2094,7 +2093,7 @@ aic79xx_setup(char *s) ...@@ -2094,7 +2093,7 @@ aic79xx_setup(char *s)
} else if (!strncmp(p, "verbose", n)) { } else if (!strncmp(p, "verbose", n)) {
*(options[i].flag) = 1; *(options[i].flag) = 1;
} else { } else {
*(options[i].flag) = ~(*(options[i].flag)); *(options[i].flag) ^= 0xFFFFFFFF;
} }
} }
return 1; return 1;
...@@ -2104,7 +2103,7 @@ aic79xx_setup(char *s) ...@@ -2104,7 +2103,7 @@ aic79xx_setup(char *s)
__setup("aic79xx=", aic79xx_setup); __setup("aic79xx=", aic79xx_setup);
#endif #endif
int aic79xx_verbose; uint32_t aic79xx_verbose;
int int
ahd_linux_register_host(struct ahd_softc *ahd, Scsi_Host_Template *template) ahd_linux_register_host(struct ahd_softc *ahd, Scsi_Host_Template *template)
......
...@@ -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#124 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#126 $
* *
*/ */
#ifndef _AIC79XX_LINUX_H_ #ifndef _AIC79XX_LINUX_H_
...@@ -139,7 +139,7 @@ typedef Scsi_Cmnd *ahd_io_ctx_t; ...@@ -139,7 +139,7 @@ typedef Scsi_Cmnd *ahd_io_ctx_t;
#endif /* BYTE_ORDER */ #endif /* BYTE_ORDER */
/************************* Configuration Data *********************************/ /************************* Configuration Data *********************************/
extern int aic79xx_allow_memio; extern uint32_t aic79xx_allow_memio;
extern int aic79xx_detect_complete; extern int aic79xx_detect_complete;
extern Scsi_Host_Template aic79xx_driver_template; extern Scsi_Host_Template aic79xx_driver_template;
...@@ -293,7 +293,7 @@ ahd_scb_timer_reset(struct scb *scb, u_int usec) ...@@ -293,7 +293,7 @@ ahd_scb_timer_reset(struct scb *scb, u_int usec)
#define AHD_SCSI_HAS_HOST_LOCK 0 #define AHD_SCSI_HAS_HOST_LOCK 0
#endif #endif
#define AIC79XX_DRIVER_VERSION "1.3.6" #define AIC79XX_DRIVER_VERSION "1.3.7"
/**************************** Front End Queues ********************************/ /**************************** Front End Queues ********************************/
/* /*
...@@ -1296,5 +1296,5 @@ void ahd_platform_dump_card_state(struct ahd_softc *ahd); ...@@ -1296,5 +1296,5 @@ void ahd_platform_dump_card_state(struct ahd_softc *ahd);
#define AHD_PCI_CONFIG 0 #define AHD_PCI_CONFIG 0
#endif #endif
#define bootverbose aic79xx_verbose #define bootverbose aic79xx_verbose
extern int aic79xx_verbose; extern uint32_t aic79xx_verbose;
#endif /* _AIC79XX_LINUX_H_ */ #endif /* _AIC79XX_LINUX_H_ */
/* /*
* Adaptec AIC7xxx device driver for Linux. * Adaptec AIC7xxx device driver for Linux.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#215 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#216 $
* *
* 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.
...@@ -366,31 +366,26 @@ static uint32_t aic7xxx_no_reset; ...@@ -366,31 +366,26 @@ static uint32_t aic7xxx_no_reset;
* disabled at the very end. That should fix everyone up unless there are * disabled at the very end. That should fix everyone up unless there are
* really strange cirumstances. * really strange cirumstances.
*/ */
static int aic7xxx_reverse_scan = 0; static uint32_t aic7xxx_reverse_scan;
/* /*
* Should we force EXTENDED translation on a controller. * Should we force EXTENDED translation on a controller.
* 0 == Use whatever is in the SEEPROM or default to off * 0 == Use whatever is in the SEEPROM or default to off
* 1 == Use whatever is in the SEEPROM or default to on * 1 == Use whatever is in the SEEPROM or default to on
*/ */
static uint32_t aic7xxx_extended = 0; static uint32_t aic7xxx_extended;
/* /*
* PCI bus parity checking of the Adaptec controllers. This is somewhat * PCI bus parity checking of the Adaptec controllers. This is somewhat
* dubious at best. To my knowledge, this option has never actually * dubious at best. To my knowledge, this option has never actually
* solved a PCI parity problem, but on certain machines with broken PCI * solved a PCI parity problem, but on certain machines with broken PCI
* chipset configurations, it can generate tons of false error messages. * chipset configurations where stray PCI transactions with bad parity are
* the norm rather than the exception, the error messages can be overwelming.
* It's included in the driver for completeness. * It's included in the driver for completeness.
* 0 = Shut off PCI parity check * 0 = Shut off PCI parity check
* -1 = Normal polarity pci parity checking * non-0 = reverse polarity pci parity checking
* 1 = reverse polarity pci parity checking
*
* NOTE: you can't actually pass -1 on the lilo prompt. So, to set this
* variable to -1 you would actually want to simply pass the variable
* name without a number. That will invert the 0 which will result in
* -1.
*/ */
static int aic7xxx_pci_parity = 0; static uint32_t aic7xxx_pci_parity = ~0;
/* /*
* Certain newer motherboards have put new PCI based devices into the * Certain newer motherboards have put new PCI based devices into the
...@@ -406,9 +401,9 @@ static int aic7xxx_pci_parity = 0; ...@@ -406,9 +401,9 @@ static int aic7xxx_pci_parity = 0;
#define CONFIG_AIC7XXX_PROBE_EISA_VL n #define CONFIG_AIC7XXX_PROBE_EISA_VL n
#endif #endif
#if CONFIG_AIC7XXX_PROBE_EISA_VL == n #if CONFIG_AIC7XXX_PROBE_EISA_VL == n
static int aic7xxx_no_probe = 1; static uint32_t aic7xxx_probe_eisa_vl;
#else #else
static int aic7xxx_no_probe; static uint32_t aic7xxx_probe_eisa_vl = ~0;
#endif #endif
/* /*
...@@ -417,7 +412,7 @@ static int aic7xxx_no_probe; ...@@ -417,7 +412,7 @@ static int aic7xxx_no_probe;
* controller. I/O mapped register access, if allowed by the given * controller. I/O mapped register access, if allowed by the given
* platform, will work in almost all cases. * platform, will work in almost all cases.
*/ */
int aic7xxx_allow_memio = 1; uint32_t aic7xxx_allow_memio = ~0;
/* /*
* aic7xxx_detect() has been run, so register all device arrivals * aic7xxx_detect() has been run, so register all device arrivals
...@@ -436,7 +431,7 @@ int aic7xxx_detect_complete; ...@@ -436,7 +431,7 @@ int aic7xxx_detect_complete;
* We default to 256ms because some older devices need a longer time * We default to 256ms because some older devices need a longer time
* to respond to initial selection. * to respond to initial selection.
*/ */
static int aic7xxx_seltime = 0x00; static uint32_t aic7xxx_seltime;
/* /*
* Certain devices do not perform any aging on commands. Should the * Certain devices do not perform any aging on commands. Should the
...@@ -446,7 +441,7 @@ static int aic7xxx_seltime = 0x00; ...@@ -446,7 +441,7 @@ static int aic7xxx_seltime = 0x00;
* force all outstanding transactions to be serviced prior to a new * force all outstanding transactions to be serviced prior to a new
* transaction. * transaction.
*/ */
int aic7xxx_periodic_otag; uint32_t aic7xxx_periodic_otag;
/* /*
* Module information and settable options. * Module information and settable options.
...@@ -471,7 +466,8 @@ MODULE_PARM_DESC(aic7xxx, ...@@ -471,7 +466,8 @@ MODULE_PARM_DESC(aic7xxx,
" verbose Enable verbose/diagnostic logging\n" " verbose Enable verbose/diagnostic logging\n"
" allow_memio Allow device registers to be memory mapped\n" " allow_memio Allow device registers to be memory mapped\n"
" debug Bitmask of debug values to enable\n" " debug Bitmask of debug values to enable\n"
" no_probe Disable EISA/VLB controller probing\n" " no_probe Toggle EISA/VLB controller probing\n"
" eisa_vl_probe Toggle EISA/VLB controller probing\n"
" no_reset Supress initial bus resets\n" " no_reset Supress initial bus resets\n"
" extended Enable extended geometry on all controllers\n" " extended Enable extended geometry on all controllers\n"
" periodic_otag Send an ordered tagged transaction\n" " periodic_otag Send an ordered tagged transaction\n"
...@@ -488,10 +484,10 @@ MODULE_PARM_DESC(aic7xxx, ...@@ -488,10 +484,10 @@ MODULE_PARM_DESC(aic7xxx,
"\n" "\n"
" Sample /etc/modules.conf line:\n" " Sample /etc/modules.conf line:\n"
" Toggle EISA/VLB probing\n" " Toggle EISA/VLB probing\n"
" Set tag depth on Controller 1/Target 2 to 10 tags\n" " Set tag depth on Controller 1/Target 1 to 10 tags\n"
" Shorten the selection timeout to 128ms\n" " Shorten the selection timeout to 128ms\n"
"\n" "\n"
" options aic7xxx 'aic7xxx=no_probe.tag_info:{{}.{..10}}.seltime:1'\n" " options aic7xxx 'aic7xxx=eisa_vl_probe.tag_info:{{}.{.10}}.seltime:1'\n"
); );
#endif #endif
...@@ -926,7 +922,7 @@ ahc_linux_detect(Scsi_Host_Template *template) ...@@ -926,7 +922,7 @@ ahc_linux_detect(Scsi_Host_Template *template)
ahc_linux_pci_init(); ahc_linux_pci_init();
#endif #endif
if (aic7xxx_no_probe == 0) if (aic7xxx_probe_eisa_vl != 0)
aic7770_linux_probe(template); aic7770_linux_probe(template);
/* /*
...@@ -1687,7 +1683,8 @@ aic7xxx_setup(char *s) ...@@ -1687,7 +1683,8 @@ aic7xxx_setup(char *s)
{ "debug", &ahc_debug }, { "debug", &ahc_debug },
#endif #endif
{ "reverse_scan", &aic7xxx_reverse_scan }, { "reverse_scan", &aic7xxx_reverse_scan },
{ "no_probe", &aic7xxx_no_probe }, { "no_probe", &aic7xxx_probe_eisa_vl },
{ "probe_eisa_vlb", &aic7xxx_probe_eisa_vl },
{ "periodic_otag", &aic7xxx_periodic_otag }, { "periodic_otag", &aic7xxx_periodic_otag },
{ "pci_parity", &aic7xxx_pci_parity }, { "pci_parity", &aic7xxx_pci_parity },
{ "seltime", &aic7xxx_seltime }, { "seltime", &aic7xxx_seltime },
...@@ -1729,7 +1726,7 @@ aic7xxx_setup(char *s) ...@@ -1729,7 +1726,7 @@ aic7xxx_setup(char *s)
} else if (strncmp(p, "verbose", n) == 0) { } else if (strncmp(p, "verbose", n) == 0) {
*(options[i].flag) = 1; *(options[i].flag) = 1;
} else { } else {
*(options[i].flag) = ~(*(options[i].flag)); *(options[i].flag) ^= 0xFFFFFFFF;
} }
} }
return 1; return 1;
...@@ -1739,7 +1736,7 @@ aic7xxx_setup(char *s) ...@@ -1739,7 +1736,7 @@ aic7xxx_setup(char *s)
__setup("aic7xxx=", aic7xxx_setup); __setup("aic7xxx=", aic7xxx_setup);
#endif #endif
int aic7xxx_verbose; uint32_t aic7xxx_verbose;
int int
ahc_linux_register_host(struct ahc_softc *ahc, Scsi_Host_Template *template) ahc_linux_register_host(struct ahc_softc *ahc, Scsi_Host_Template *template)
......
...@@ -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#134 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#135 $
* *
*/ */
#ifndef _AIC7XXX_LINUX_H_ #ifndef _AIC7XXX_LINUX_H_
...@@ -150,8 +150,8 @@ typedef Scsi_Cmnd *ahc_io_ctx_t; ...@@ -150,8 +150,8 @@ typedef Scsi_Cmnd *ahc_io_ctx_t;
#endif /* BYTE_ORDER */ #endif /* BYTE_ORDER */
/************************* Configuration Data *********************************/ /************************* Configuration Data *********************************/
extern int aic7xxx_no_probe; extern u_int aic7xxx_no_probe;
extern int aic7xxx_allow_memio; extern u_int aic7xxx_allow_memio;
extern int aic7xxx_detect_complete; extern int aic7xxx_detect_complete;
extern Scsi_Host_Template aic7xxx_driver_template; extern Scsi_Host_Template aic7xxx_driver_template;
...@@ -1250,5 +1250,5 @@ void ahc_platform_dump_card_state(struct ahc_softc *ahc); ...@@ -1250,5 +1250,5 @@ void ahc_platform_dump_card_state(struct ahc_softc *ahc);
#define AHC_PCI_CONFIG 0 #define AHC_PCI_CONFIG 0
#endif #endif
#define bootverbose aic7xxx_verbose #define bootverbose aic7xxx_verbose
extern int aic7xxx_verbose; extern u_int aic7xxx_verbose;
#endif /* _AIC7XXX_LINUX_H_ */ #endif /* _AIC7XXX_LINUX_H_ */
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