-/* $OpenBSD: ufshci.c,v 1.13 2024/05/09 08:09:17 mglocker Exp $ */
+/* $OpenBSD: ufshci.c,v 1.14 2024/05/09 08:12:22 mglocker Exp $ */
/*
* Copyright (c) 2022 Marcus Glocker <mglocker@openbsd.org>
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 1) */
slot = ccb->ccb_slot;
- utrd = UFSHCI_DMA_KVA(sc->sc_dmamem_utrd) + (sizeof(*utrd) * slot);
+ utrd = UFSHCI_DMA_KVA(sc->sc_dmamem_utrd);
+ utrd += slot;
memset(utrd, 0, sizeof(*utrd));
DPRINTF("%s: slot=%d\n", __func__, slot);
utrd->dw2 = UFSHCI_UTRD_DW2_OCS_IOV;
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 2e) */
- ucd = UFSHCI_DMA_KVA(sc->sc_dmamem_ucd) + (sizeof(*ucd) * slot);
+ ucd = UFSHCI_DMA_KVA(sc->sc_dmamem_ucd);
+ ucd += slot;
memset(ucd, 0, sizeof(*ucd));
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 2f) */
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 1) */
slot = ccb->ccb_slot;
- utrd = UFSHCI_DMA_KVA(sc->sc_dmamem_utrd) + (sizeof(*utrd) * slot);
+ utrd = UFSHCI_DMA_KVA(sc->sc_dmamem_utrd);
+ utrd += slot;
memset(utrd, 0, sizeof(*utrd));
DPRINTF("%s: slot=%d\n", __func__, slot);
utrd->dw2 = UFSHCI_UTRD_DW2_OCS_IOV;
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 2e) */
- ucd = UFSHCI_DMA_KVA(sc->sc_dmamem_ucd) + (sizeof(*ucd) * slot);
+ ucd = UFSHCI_DMA_KVA(sc->sc_dmamem_ucd);
+ ucd += slot;
memset(ucd, 0, sizeof(*ucd));
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 2f) */
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 1) */
slot = ccb->ccb_slot;
- utrd = UFSHCI_DMA_KVA(sc->sc_dmamem_utrd) + (sizeof(*utrd) * slot);
+ utrd = UFSHCI_DMA_KVA(sc->sc_dmamem_utrd);
+ utrd += slot;
memset(utrd, 0, sizeof(*utrd));
DPRINTF("%s: slot=%d\n", __func__, slot);
utrd->dw2 = UFSHCI_UTRD_DW2_OCS_IOV;
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 2e) */
- ucd = UFSHCI_DMA_KVA(sc->sc_dmamem_ucd) + (sizeof(*ucd) * slot);
+ ucd = UFSHCI_DMA_KVA(sc->sc_dmamem_ucd);
+ ucd += slot;
memset(ucd, 0, sizeof(*ucd));
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 2f) */
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 1) */
slot = ccb->ccb_slot;
- utrd = UFSHCI_DMA_KVA(sc->sc_dmamem_utrd) + (sizeof(*utrd) * slot);
+ utrd = UFSHCI_DMA_KVA(sc->sc_dmamem_utrd);
+ utrd += slot;
memset(utrd, 0, sizeof(*utrd));
DPRINTF("%s: slot=%d\n", __func__, slot);
utrd->dw2 = UFSHCI_UTRD_DW2_OCS_IOV;
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 2e) */
- ucd = UFSHCI_DMA_KVA(sc->sc_dmamem_ucd) + (sizeof(*ucd) * slot);
+ ucd = UFSHCI_DMA_KVA(sc->sc_dmamem_ucd);
+ ucd += slot;
memset(ucd, 0, sizeof(*ucd));
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 2f) */
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 1) */
slot = ccb->ccb_slot;
- utrd = UFSHCI_DMA_KVA(sc->sc_dmamem_utrd) + (sizeof(*utrd) * slot);
+ utrd = UFSHCI_DMA_KVA(sc->sc_dmamem_utrd);
+ utrd += slot;
memset(utrd, 0, sizeof(*utrd));
DPRINTF("%s: slot=%d\n", __func__, slot);
utrd->dw2 = UFSHCI_UTRD_DW2_OCS_IOV;
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 2e) */
- ucd = UFSHCI_DMA_KVA(sc->sc_dmamem_ucd) + (sizeof(*ucd) * slot);
+ ucd = UFSHCI_DMA_KVA(sc->sc_dmamem_ucd);
+ ucd += slot;
memset(ucd, 0, sizeof(*ucd));
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 2f) */
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 1) */
slot = ccb->ccb_slot;
- utrd = UFSHCI_DMA_KVA(sc->sc_dmamem_utrd) + (sizeof(*utrd) * slot);
+ utrd = UFSHCI_DMA_KVA(sc->sc_dmamem_utrd);
+ utrd += slot;
memset(utrd, 0, sizeof(*utrd));
DPRINTF("%s: slot=%d\n", __func__, slot);
utrd->dw2 = UFSHCI_UTRD_DW2_OCS_IOV;
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 2e) */
- ucd = UFSHCI_DMA_KVA(sc->sc_dmamem_ucd) + (sizeof(*ucd) * slot);
+ ucd = UFSHCI_DMA_KVA(sc->sc_dmamem_ucd);
+ ucd += slot;
memset(ucd, 0, sizeof(*ucd));
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 2f) */
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 1) */
slot = ccb->ccb_slot;
- utrd = UFSHCI_DMA_KVA(sc->sc_dmamem_utrd) + (sizeof(*utrd) * slot);
+ utrd = UFSHCI_DMA_KVA(sc->sc_dmamem_utrd);
+ utrd += slot;
memset(utrd, 0, sizeof(*utrd));
DPRINTF("%s: slot=%d\n", __func__, slot);
utrd->dw2 = UFSHCI_UTRD_DW2_OCS_IOV;
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 2e) */
- ucd = UFSHCI_DMA_KVA(sc->sc_dmamem_ucd) + (sizeof(*ucd) * slot);
+ ucd = UFSHCI_DMA_KVA(sc->sc_dmamem_ucd);
+ ucd += slot;
memset(ucd, 0, sizeof(*ucd));
/* 7.2.1 Basic Steps when Building a UTP Transfer Request: 2f) */