* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#148 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#150 $
*
* $FreeBSD$
*/
/* Skip all PACED only entries if IU is not available */
if ((*ppr_options & MSG_EXT_PPR_IU_REQ) == 0
- && maxsync < AHD_SYNCRATE_DT)
- maxsync = AHD_SYNCRATE_DT;
+ && *period < AHD_SYNCRATE_DT)
+ *period = AHD_SYNCRATE_DT;
/* Skip all DT only entries if DT is not available */
if ((*ppr_options & MSG_EXT_PPR_DT_REQ) == 0
- && maxsync < AHD_SYNCRATE_ULTRA2)
- maxsync = AHD_SYNCRATE_ULTRA2;
+ && *period < AHD_SYNCRATE_ULTRA2)
+ *period = AHD_SYNCRATE_ULTRA2;
}
/*
/*lowaddr*/BUS_SPACE_MAXADDR,
/*highaddr*/BUS_SPACE_MAXADDR,
/*filter*/NULL, /*filterarg*/NULL,
- /*maxsize*/MAXBSIZE, /*nsegments*/AHD_NSEG,
+ /*maxsize*/(AHD_NSEG - 1) * PAGE_SIZE,
+ /*nsegments*/AHD_NSEG,
/*maxsegsz*/AHD_MAXTRANSFER_SIZE,
/*flags*/BUS_DMA_ALLOCNOW,
&ahd->buffer_dmat) != 0) {
#ifdef AHD_DEBUG
if ((ahd_debug & AHD_SHOW_MISC) != 0) {
ahd_print_path(ahd, scb);
- printf("Handled Residual of %d bytes\n", resid);
+ printf("Handled %sResidual of %d bytes\n",
+ (scb->flags & SCB_SENSE) ? "Sense " : "", resid);
}
#endif
}
/*
* Adaptec AIC79xx device driver for Linux.
*
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#103 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#104 $
*
* --------------------------------------------------------------------------
* Copyright (c) 1994-2000 Justin T. Gibbs.
* negotiation will occur for the first command, and DV
* will comence should that first command be successful.
*/
- for (target = 0; target < AHD_NUM_TARGETS; target++)
+ for (target = 0; target < host->max_id; target++)
ahd_linux_alloc_target(ahd, 0, target);
ahd_intr_enable(ahd, TRUE);
ahd_linux_start_dv(ahd);
break;
}
+#ifdef AHD_DEBUG
+ if (ahd_debug & AHD_SHOW_DV) {
+ int i;
+
+ ahd_print_devinfo(ahd, devinfo);
+ printf("Inquiry buffer mismatch:");
+ for (i = 0; i < AHD_LINUX_DV_INQ_LEN; i++) {
+ if ((i & 0xF) == 0)
+ printf("\n ");
+ printf("0x%x:0x0%x ",
+ ((uint8_t *)targ->inq_data)[i],
+ targ->dv_buffer[i]);
+ }
+ printf("\n");
+ }
+#endif
+
if (ahd_linux_dv_fallback(ahd, devinfo) != 0) {
AHD_SET_DV_STATE(ahd, targ, AHD_DV_STATE_EXIT);
break;
targ->dv_next_narrow_period = MAX(period, AHD_SYNCRATE_ULTRA2);
if (targ->dv_next_wide_period == 0)
targ->dv_next_wide_period = period;
+ if (targ->dv_max_width == 0)
+ targ->dv_max_width = width;
if (targ->dv_max_ppr_options == 0)
targ->dv_max_ppr_options = ppr_options;
if (targ->dv_last_ppr_options == 0)
period++;
}
} else if ((ahd->features & AHD_WIDE) != 0
- && tinfo->user.width != 0
+ && targ->dv_max_width != 0
&& wide_speed >= fallback_speed
&& (targ->dv_next_wide_period <= AHD_ASYNC_XFER_PERIOD
|| period >= AHD_ASYNC_XFER_PERIOD)) {
* 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_osm.h#99 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#100 $
*
*/
#ifndef _AIC79XX_LINUX_H_
/*
* The next "fallback" period to use for narrow/wide transfers.
*/
- u_int dv_next_narrow_period;
- u_int dv_next_wide_period;
- u_int dv_max_ppr_options;
- u_int dv_last_ppr_options;
+ uint8_t dv_next_narrow_period;
+ uint8_t dv_next_wide_period;
+ uint8_t dv_max_width;
+ uint8_t dv_max_ppr_options;
+ uint8_t dv_last_ppr_options;
u_int dv_echo_size;
ahd_dv_state dv_state;
u_int dv_state_retry;
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#105 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#107 $
*
* $FreeBSD$
*/
/*lowaddr*/BUS_SPACE_MAXADDR,
/*highaddr*/BUS_SPACE_MAXADDR,
/*filter*/NULL, /*filterarg*/NULL,
- /*maxsize*/MAXBSIZE, /*nsegments*/AHC_NSEG,
+ /*maxsize*/(AHC_NSEG - 1) * PAGE_SIZE,
+ /*nsegments*/AHC_NSEG,
/*maxsegsz*/AHC_MAXTRANSFER_SIZE,
/*flags*/BUS_DMA_ALLOCNOW,
&ahc->buffer_dmat) != 0) {
#ifdef AHC_DEBUG
if ((ahc_debug & AHC_SHOW_MISC) != 0) {
ahc_print_path(ahc, scb);
- printf("Handled Residual of %d bytes\n", resid);
+ printf("Handled %sResidual of %d bytes\n",
+ (scb->flags & SCB_SENSE) ? "Sense " : "", resid);
}
#endif
}
/*
* Adaptec AIC7xxx device driver for Linux.
*
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#166 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#167 $
*
* Copyright (c) 1994 John Aycock
* The University of Calgary Department of Computer Science.
*/
.max_sectors = 8192,
#endif
+#if defined CONFIG_HIGHIO || LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
/* Assume RedHat Distribution with its different HIGHIO conventions. */
.can_dma_32 = 1,
#else
.highmem_io = 1,
#endif
+#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
.name = "aic7xxx",
.slave_alloc = ahc_linux_slave_alloc,
* negotiation will occur for the first command, and DV
* will comence should that first command be successful.
*/
- for (target = 0; target < AHC_NUM_TARGETS; target++) {
+ for (target = 0; target < host->max_id; target++) {
u_int channel;
channel = 0;
AHC_SET_DV_STATE(ahc, targ, AHC_DV_STATE_EXIT);
break;
}
+#ifdef AHC_DEBUG
+ if (ahc_debug & AHC_SHOW_DV) {
+ int i;
+
+ ahc_print_devinfo(ahc, devinfo);
+ printf("Inquiry buffer mismatch:");
+ for (i = 0; i < AHC_LINUX_DV_INQ_LEN; i++) {
+ if ((i & 0xF) == 0)
+ printf("\n ");
+ printf("0x%x:0x0%x ",
+ ((uint8_t *)targ->inq_data)[i],
+ targ->dv_buffer[i]);
+ }
+ printf("\n");
+ }
+#endif
if (ahc_linux_fallback(ahc, devinfo) != 0) {
AHC_SET_DV_STATE(ahc, targ, AHC_DV_STATE_EXIT);
targ->dv_next_narrow_period = MAX(period, AHC_SYNCRATE_ULTRA2);
if (targ->dv_next_wide_period == 0)
targ->dv_next_wide_period = period;
+ if (targ->dv_max_width == 0)
+ targ->dv_max_width = width;
if (targ->dv_max_ppr_options == 0)
targ->dv_max_ppr_options = ppr_options;
if (targ->dv_last_ppr_options == 0)
period++;
}
} else if ((ahc->features & AHC_WIDE) != 0
- && tinfo->user.width != 0
+ && targ->dv_max_width != 0
&& wide_speed >= fallback_speed
&& (targ->dv_next_wide_period <= AHC_ASYNC_XFER_PERIOD
|| period >= AHC_ASYNC_XFER_PERIOD)) {
* 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_osm.h#114 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#115 $
*
*/
#ifndef _AIC7XXX_LINUX_H_
#endif
#include <linux/module.h>
#include <asm/byteorder.h>
-#include <asm/io.h>
#ifndef KERNEL_VERSION
#define KERNEL_VERSION(x,y,z) (((x)<<16)+((y)<<8)+(z))
/*
* The next "fallback" period to use for narrow/wide transfers.
*/
- u_int dv_next_narrow_period;
- u_int dv_next_wide_period;
- u_int dv_max_ppr_options;
- u_int dv_last_ppr_options;
+ uint8_t dv_next_narrow_period;
+ uint8_t dv_next_wide_period;
+ uint8_t dv_max_width;
+ uint8_t dv_max_ppr_options;
+ uint8_t dv_last_ppr_options;
u_int dv_echo_size;
ahc_dv_state dv_state;
u_int dv_state_retry;