Deleted Added
full compact
29c29
< * $FreeBSD: head/sys/dev/aac/aac.c 108329 2002-12-27 17:52:16Z rwatson $
---
> * $FreeBSD: head/sys/dev/aac/aac.c 109088 2003-01-11 01:59:21Z scottl $
626a627
> u_int32_t *resp_queue;
632c633,645
< reason = AAC_GET_ISTATUS(sc);
---
> /*
> * Optimize the common case of adapter response interrupts.
> * We must read from the card prior to processing the responses
> * to ensure the clear is flushed prior to accessing the queues.
> * Reading the queues from local memory might save us a PCI read.
> */
> resp_queue = sc->aac_queues->qt_qindex[AAC_HOST_NORM_RESP_QUEUE];
> if (resp_queue[AAC_PRODUCER_INDEX] != resp_queue[AAC_CONSUMER_INDEX])
> reason = AAC_DB_RESPONSE_READY;
> else
> reason = AAC_GET_ISTATUS(sc);
> AAC_CLEAR_ISTATUS(sc, reason);
> (void)AAC_GET_ISTATUS(sc);
633a647,650
> /* It's not ok to return here because of races with the previous step */
> if (reason & AAC_DB_RESPONSE_READY)
> aac_host_response(sc);
>
635,636c652
< if (reason & AAC_DB_PRINTF) {
< AAC_CLEAR_ISTATUS(sc, AAC_DB_PRINTF);
---
> if (reason & AAC_DB_PRINTF)
638d653
< }
642d656
< AAC_CLEAR_ISTATUS(sc, AAC_DB_COMMAND_READY);
649,654c663
<
< /* controller has a response for us? */
< if (reason & AAC_DB_RESPONSE_READY) {
< AAC_CLEAR_ISTATUS(sc, AAC_DB_RESPONSE_READY);
< aac_host_response(sc);
< }
---
> }
656,666d664
< /*
< * spurious interrupts that we don't use - reset the mask and clear the
< * interrupts
< */
< if (reason & (AAC_DB_COMMAND_NOT_FULL | AAC_DB_RESPONSE_NOT_FULL)) {
< AAC_UNMASK_INTERRUPTS(sc);
< AAC_CLEAR_ISTATUS(sc, AAC_DB_COMMAND_NOT_FULL |
< AAC_DB_RESPONSE_NOT_FULL);
< }
< };
<
732d729
<
931,935c928,935
< AAC_FIBSTATE_HOSTOWNED |
< AAC_FIBSTATE_INITIALISED |
< AAC_FIBSTATE_FROMHOST |
< AAC_FIBSTATE_REXPECTED |
< AAC_FIBSTATE_NORM;
---
> AAC_FIBSTATE_HOSTOWNED |
> AAC_FIBSTATE_INITIALISED |
> AAC_FIBSTATE_EMPTY |
> AAC_FIBSTATE_FROMHOST |
> AAC_FIBSTATE_REXPECTED |
> AAC_FIBSTATE_NORM |
> AAC_FIBSTATE_ASYNC |
> AAC_FIBSTATE_FAST_RESPONSE;
1084c1084,1085
< cm->cm_fib->Header.ReceiverFibAddress = cm->cm_fibphys;
---
> cm->cm_fib->Header.ReceiverFibAddress = (u_int32_t)cm->cm_fibphys;
> cm->cm_fib->Header.SenderData = 0;
1124c1125
<
---
> bzero(sc->aac_fibs, AAC_FIB_COUNT * sizeof(struct aac_fib));
1209,1214c1210,1215
< if (cm->cm_flags & AAC_CMD_DATAIN)
< bus_dmamap_sync(sc->aac_buffer_dmat, cm->cm_datamap,
< BUS_DMASYNC_PREREAD);
< if (cm->cm_flags & AAC_CMD_DATAOUT)
< bus_dmamap_sync(sc->aac_buffer_dmat, cm->cm_datamap,
< BUS_DMASYNC_PREWRITE);
---
> if (cm->cm_flags & AAC_CMD_DATAIN)
> bus_dmamap_sync(sc->aac_buffer_dmat, cm->cm_datamap,
> BUS_DMASYNC_PREREAD);
> if (cm->cm_flags & AAC_CMD_DATAOUT)
> bus_dmamap_sync(sc->aac_buffer_dmat, cm->cm_datamap,
> BUS_DMASYNC_PREWRITE);
1364a1366
> ip->MiniPortRevision = AAC_INIT_STRUCT_MINIPORT_REVISION;
1368c1370
< ip->AdapterFibsVirtualAddress = &sc->aac_common->ac_fibs[0];
---
> ip->AdapterFibsVirtualAddress = (u_int32_t)&sc->aac_common->ac_fibs[0];
1376c1378,1379
< ip->HostPhysMemPages = 0; /* not used? */
---
> /* The adapter assumes that pages are 4K in size */
> ip->HostPhysMemPages = ctob(physmem) / AAC_PAGE_SIZE;
1401d1403
< bzero(sc->aac_queues, sizeof(struct aac_queue_table));
1706a1709,1717
> /*
> * Is this a fast response? If it is, update the fib fields in
> * local memory so the whole fib doesn't have to be DMA'd back up.
> */
> if (*(uintptr_t *)fib_addr & 0x01) {
> *(uintptr_t *)fib_addr &= ~0x01;
> (*fib_addr)->Header.XferState |= AAC_FIBSTATE_DONEADAP;
> *((u_int32_t*)((*fib_addr)->data)) = AAC_ERROR_NORMAL;
> }