diff --git a/sys/dev/aic7xxx/aic79xx.c b/sys/dev/aic7xxx/aic79xx.c index 9d7bfe238ee..c1fc26b3b0e 100644 --- a/sys/dev/aic7xxx/aic79xx.c +++ b/sys/dev/aic7xxx/aic79xx.c @@ -37,7 +37,7 @@ * 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#191 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#192 $ * * $FreeBSD$ */ @@ -5722,6 +5722,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) next_scb->sg_list = segs; next_scb->sense_data = sense_data; next_scb->sense_busaddr = sense_busaddr; + memset(hscb, 0, sizeof(*hscb)); next_scb->hscb = hscb; hscb->hscb_busaddr = ahd_htole32(hscb_busaddr); @@ -8279,8 +8280,6 @@ ahd_loadseq(struct ahd_softc *ahd) download_consts[PKT_OVERRUN_BUFOFFSET] = (ahd->overrun_buf - (uint8_t *)ahd->qoutfifo) / 256; download_consts[SCB_TRANSFER_SIZE] = SCB_TRANSFER_SIZE_1BYTE_LUN; - if ((ahd->bugs & AHD_PKT_LUN_BUG) != 0) - download_consts[SCB_TRANSFER_SIZE] = SCB_TRANSFER_SIZE_FULL_LUN; cur_patch = patches; downloaded = 0; skip_addr = 0; diff --git a/sys/dev/aic7xxx/aic79xx.seq b/sys/dev/aic7xxx/aic79xx.seq index 7bab878267e..86116a34e16 100644 --- a/sys/dev/aic7xxx/aic79xx.seq +++ b/sys/dev/aic7xxx/aic79xx.seq @@ -40,7 +40,7 @@ * $FreeBSD$ */ -VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#92 $" +VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#93 $" PATCH_ARG_LIST = "struct ahd_softc *ahd" PREFIX = "ahd_" @@ -261,6 +261,15 @@ fetch_new_scb_done: clr A; add CMDS_PENDING, 1; adc CMDS_PENDING[1], A; + if ((ahd->bugs & AHD_PKT_LUN_BUG) != 0) { + /* + * "Short Luns" are not placed into outgoing LQ + * packets in the correct byte order. Use a full + * sized lun field instead and fill it with the + * one byte of lun information we support. + */ + mov SCB_PKT_LUN[6], SCB_LUN; + } /* * The FIFO use count field is shared with the * tag set by the host so that our SCB dma engine diff --git a/sys/dev/aic7xxx/aic79xx_inline.h b/sys/dev/aic7xxx/aic79xx_inline.h index 94c8f4afb22..686053ea437 100644 --- a/sys/dev/aic7xxx/aic79xx_inline.h +++ b/sys/dev/aic7xxx/aic79xx_inline.h @@ -37,7 +37,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aic79xx_inline.h#48 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx_inline.h#49 $ * * $FreeBSD$ */ @@ -272,10 +272,6 @@ ahd_setup_scb_common(struct ahd_softc *ahd, struct scb *scb) if ((scb->flags & SCB_PACKETIZED) != 0) { /* XXX what about ACA?? It is type 4, but TAG_TYPE == 0x3. */ scb->hscb->task_attribute= scb->hscb->control & SCB_TAG_TYPE; - /* - * For Rev A short lun workaround. - */ - scb->hscb->pkt_long_lun[6] = scb->hscb->lun; } if (scb->hscb->cdb_len <= MAX_CDB_LEN_WITH_SENSE_ADDR