/* Returns pointer to current request descriptor to produce  */
STATIC PVSCSI_RING_REQ_DESC* PvScsiGetCurrentRequest(IN CONST PVSCSI_DEV *Dev)
/* Returns pointer to current request descriptor to produce  */
STATIC PVSCSI_RING_REQ_DESC* PvScsiGetCurrentRequest(IN CONST PVSCSI_DEV *Dev)
{
  PVSCSI_RINGS_STATE  *RingState;
  UINT32              ReqNumEntries;
  RingState     = Dev->RingDesc.RingState;
  ReqNumEntries = 1U << RingState->ReqNumEntriesLog2;
  return Dev->RingDesc.RingReqs +
         (RingState->ReqProdIdx & (ReqNumEntries - 1));
}