From d345eaf21d8c9b032d8e9d6facf316a2b2b90ef5 Mon Sep 17 00:00:00 2001 From: Mandy Lavi Date: Wed, 6 May 2015 21:16:54 +0900 Subject: fmd: fix total-fifo-size related error messages Change-Id: Ibb15bb7b55678030e577c7ec6e0f0980b49e985b Signed-off-by: Mandy Lavi Reviewed-on: http://git.am.freescale.net:8181/36009 Reviewed-by: Eyal Harari Reviewed-by: Honghua Yin Tested-by: Honghua Yin diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c index 16dd8aa..fe05428 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/fm.c @@ -153,7 +153,7 @@ static t_Error CheckFmParameters(t_Fm *p_Fm) if (!p_Fm->p_FmStateStruct->totalFifoSize || (p_Fm->p_FmStateStruct->totalFifoSize > BMI_MAX_FIFO_SIZE)) RETURN_ERROR(MAJOR, E_INVALID_VALUE, - ("totalFifoSize (curr - %d) has to be in the range 256 - %d", + ("totalFifoSize (currently defined as %d) has to be in the range of 256 to %d", p_Fm->p_FmStateStruct->totalFifoSize, BMI_MAX_FIFO_SIZE)); if (!p_Fm->p_FmStateStruct->totalNumOfTasks || @@ -2637,8 +2637,15 @@ t_Error FmSetSizeOfFifo(t_Handle h_Fm, /* check that there are enough uncommitted fifo size */ if ((p_Fm->p_FmStateStruct->accumulatedFifoSize - currentVal + sizeOfFifo) > - (p_Fm->p_FmStateStruct->totalFifoSize - p_Fm->p_FmStateStruct->extraFifoPoolSize)) - RETURN_ERROR(MAJOR, E_NOT_AVAILABLE, ("Requested fifo size and extra size exceed total FIFO size.")); + (p_Fm->p_FmStateStruct->totalFifoSize - p_Fm->p_FmStateStruct->extraFifoPoolSize)){ + REPORT_ERROR(MAJOR, E_INVALID_VALUE, + ("Port request fifo size + accumulated size > total FIFO size:")); + RETURN_ERROR(MAJOR, E_INVALID_VALUE, + ("port 0x%x requested %d bytes, extra size = %d, accumulated size = %d total size = %d", + hardwarePortId, sizeOfFifo, p_Fm->p_FmStateStruct->extraFifoPoolSize, + p_Fm->p_FmStateStruct->accumulatedFifoSize, + p_Fm->p_FmStateStruct->totalFifoSize)); + } else { /* update accumulated */ -- cgit v0.10.2