qcacmn: Add new HAL API to get SRNG descriptor which is pending reap

To release/flush buffers from source SRNGs which have not been reaped yet,
add a new HAL API to get next descriptor which is pending reap

Change-Id: Ibe490d8f8667ed046beb98fe19bfd7feb31aa286
CRs-Fixed: 2165595
This commit is contained in:
Pamidipati, Vijay
2017-07-05 05:20:17 +05:30
committed by snandini
parent 0dca5c06e2
commit 980ceb9cb9

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -579,6 +579,33 @@ static inline void *hal_srng_src_get_next_reaped(void *hal_soc, void *hal_ring)
return NULL;
}
/**
* hal_srng_src_pending_reap_next - Reap next entry from a source ring and
* move reap pointer. This API is used in detach path to release any buffers
* associated with ring entries which are pending reap.
*
* @hal_soc: Opaque HAL SOC handle
* @hal_ring: Source ring pointer
*
* Return: Opaque pointer for next ring entry; NULL on failire
*/
static inline void *hal_srng_src_pending_reap_next(void *hal_soc, void *hal_ring)
{
struct hal_srng *srng = (struct hal_srng *)hal_ring;
uint32_t *desc;
uint32_t next_reap_hp = (srng->u.src_ring.reap_hp + srng->entry_size) %
srng->ring_size;
if (next_reap_hp != srng->u.src_ring.hp) {
desc = &(srng->ring_base_vaddr[next_reap_hp]);
srng->u.src_ring.reap_hp = next_reap_hp;
return (void *)desc;
}
return NULL;
}
/**
* hal_srng_src_done_val -
*