]> git.sur5r.net Git - u-boot/blobdiff - drivers/net/npe/IxQMgrQCfg.c
SPDX-License-Identifier: convert BSD-3-Clause files
[u-boot] / drivers / net / npe / IxQMgrQCfg.c
index ec7d837c38c81019d46cfd1c41ec30a31c4e2375..b64bb2dd9099368d211089ad6c3eb8cee904a7dd 100644 (file)
  * All rights reserved.
  * 
  * @par
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the Intel Corporation nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * 
- * @par
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * 
+ * SPDX-License-Identifier:    BSD-3-Clause
  * @par
  * -- End of Copyright Notice --
 */
@@ -94,7 +70,7 @@ typedef struct
     char qName[IX_QMGR_MAX_QNAME_LEN+1];       /* Textual description of a queue*/
     IxQMgrQSizeInWords qSizeInWords;           /* The number of words in the queue */
     IxQMgrQEntrySizeInWords qEntrySizeInWords; /* Number of words per queue entry*/
-    BOOL isConfigured;                         /* This flag is TRUE if the queue has
+    BOOL isConfigured;                         /* This flag is true if the queue has
                                                 *   been configured
                                                 */
 } IxQMgrCfgQ;
@@ -120,7 +96,7 @@ static UINT32 freeSramAddress=0;
 /* 4 words of zeroed memory for inline access */
 static UINT32 zeroedPlaceHolder[4] = { 0, 0, 0, 0 };
 
-static BOOL cfgInitialized = FALSE;
+static BOOL cfgInitialized = false;
 
 static IxOsalMutex ixQMgrQCfgMutex;
 
@@ -177,10 +153,10 @@ ixQMgrQCfgInit (void)
        strcpy (cfgQueueInfo[loopIndex].qName, "");
        cfgQueueInfo[loopIndex].qSizeInWords = 0;
        cfgQueueInfo[loopIndex].qEntrySizeInWords = 0;
-       cfgQueueInfo[loopIndex].isConfigured = FALSE;
+       cfgQueueInfo[loopIndex].isConfigured = false;
 
        /* Statistics */
-       stats.qStats[loopIndex].isConfigured = FALSE;
+       stats.qStats[loopIndex].isConfigured = false;
        stats.qStats[loopIndex].qName = cfgQueueInfo[loopIndex].qName;
     }
 
@@ -191,13 +167,13 @@ ixQMgrQCfgInit (void)
     
     ixOsalMutexInit(&ixQMgrQCfgMutex);
 
-    cfgInitialized = TRUE;
+    cfgInitialized = true;
 }
 
 void
 ixQMgrQCfgUninit (void)
 {
-    cfgInitialized = FALSE;
+    cfgInitialized = false;
 
     /* Uninitialise the AqmIf component */
     ixQMgrAqmIfUninit ();
@@ -281,13 +257,13 @@ ixQMgrQConfig (char *qName,
              IX_QMGR_QUE_BUFFER_SPACE_SIZE);
 
     /* The queue is now configured */
-    cfgQueueInfo[qId].isConfigured = TRUE;
+    cfgQueueInfo[qId].isConfigured = true;
 
     ixOsalMutexUnlock(&ixQMgrQCfgMutex);
 
 #ifndef NDEBUG
     /* Update statistics */
-    stats.qStats[qId].isConfigured = TRUE;
+    stats.qStats[qId].isConfigured = true;
     stats.qStats[qId].qName = cfgQueueInfo[qId].qName;
 #endif
     return IX_SUCCESS;
@@ -417,7 +393,7 @@ ixQMgrQIsConfigured (IxQMgrQId qId)
 {
     if (!IX_QMGR_QID_IS_VALID(qId))
     {
-       return FALSE;
+       return false;
     }
 
     return cfgQueueInfo[qId].isConfigured;
@@ -487,7 +463,7 @@ watermarkLevelIsOk (IxQMgrQId qId, IxQMgrWMLevel level)
        case IX_QMGR_Q_WM_LEVEL64:
            break;
        default:
-           return FALSE;
+           return false;
     }
 
     /* Check watermark is not bigger than the qSizeInEntries */
@@ -495,10 +471,10 @@ watermarkLevelIsOk (IxQMgrQId qId, IxQMgrWMLevel level)
 
     if ((unsigned)level > qSizeInEntries)
     {
-       return FALSE;
+       return false;
     }
 
-    return TRUE;
+    return true;
 }
 
 PRIVATE BOOL
@@ -512,10 +488,10 @@ qSizeInWordsIsOk (IxQMgrQSizeInWords qSize)
        case IX_QMGR_Q_SIZE32:
        case IX_QMGR_Q_SIZE64:
        case IX_QMGR_Q_SIZE128:
-           status = TRUE;
+           status = true;
            break;
        default:
-           status = FALSE;
+           status = false;
            break;
     }
 
@@ -532,10 +508,10 @@ qEntrySizeInWordsIsOk (IxQMgrQEntrySizeInWords entrySize)
        case IX_QMGR_Q_ENTRY_SIZE1:
        case IX_QMGR_Q_ENTRY_SIZE2:
        case IX_QMGR_Q_ENTRY_SIZE4:
-           status = TRUE;
+           status = true;
            break;
        default:
-           status = FALSE;
+           status = false;
            break;
     }