mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Change hadling of the Rev. A packetized lun output bug
to be more efficient by having the sequencer copy the single byte of valid lun data into the long lun field. aic79xx.c: Memset our hardware SCB to 0 so that untouched fields don't confuse diagnostic output. With the old method for handling the Rev A bug, if the long lun field was not 0, this could result in bogus lun information being sent to drives. Use the same SCB transfer size for all chip types now that the long lun is not DMA'ed to the chip. aic79xx.seq: Add code to copy lun information for Rev.A hardware. aic79xx_inline.h: Remove host update of the long_lun field on every packetized command.
This commit is contained in:
parent
197696e939
commit
a3f571b832
3 changed files with 13 additions and 9 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue