Prepare v2014.04-rc1
[oweals/u-boot.git] / drivers / net / npe / IxEthAccCommon.c
index 211203dffd512e3a9b6d04ceeafe245d59b3833c..8249737b0c2c2c80d0e587a964ae8cbd19a3d133 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 --
  */
@@ -102,7 +78,7 @@ IxEthAccQregInfo ixEthAccQmgrRxDefaultTemplate =
     (IxQMgrCallbackId) 0,           /**< Callback tag        */
     IX_QMGR_Q_SIZE128,              /**< Allocate Max Size Q */
     IX_QMGR_Q_ENTRY_SIZE1,          /**< Queue Entry Sizes - all Q entries are single word entries   */
-    TRUE,                           /**< Enable Q notification at startup */
+    true,                           /**< Enable Q notification at startup */
     IX_ETH_ACC_RX_FRAME_ETH_Q_SOURCE,/**< Q Condition to drive callback   */
     IX_QMGR_Q_WM_LEVEL0,            /**< Q Low water mark */
     IX_QMGR_Q_WM_LEVEL1,            /**< Q High water mark - needed by NPE */
@@ -122,7 +98,7 @@ IxEthAccQregInfo ixEthAccQmgrRxSmallTemplate =
     (IxQMgrCallbackId) 0,           /**< Callback tag        */
     IX_QMGR_Q_SIZE64,               /**< Allocate Smaller Q */
     IX_QMGR_Q_ENTRY_SIZE1,          /**< Queue Entry Sizes - all Q entries are single word entries   */
-    TRUE,                           /**< Enable Q notification at startup */
+    true,                           /**< Enable Q notification at startup */
     IX_ETH_ACC_RX_FRAME_ETH_Q_SOURCE,/**< Q Condition to drive callback   */
     IX_QMGR_Q_WM_LEVEL0,            /**< Q Low water mark */
     IX_QMGR_Q_WM_LEVEL1,            /**< Q High water mark - needed by NPE */
@@ -144,7 +120,7 @@ IxEthAccQregInfo ixEthAccQmgrStaticInfo[]=
     (IxQMgrCallbackId) IX_ETH_PORT_1,
     IX_QMGR_Q_SIZE128,              /**< Allocate Max Size Q */
     IX_QMGR_Q_ENTRY_SIZE1,          /**< Queue Entry Sizes - all Q entries are single word entries   */
-    FALSE,                          /**< Disable Q notification at startup */
+    false,                          /**< Disable Q notification at startup */
     IX_ETH_ACC_RX_FREE_BUFF_ENET0_Q_SOURCE, /**< Q Condition to drive callback  */
     IX_QMGR_Q_WM_LEVEL0,            /***< Q Low water mark */
     IX_QMGR_Q_WM_LEVEL64,           /**< Q High water mark */
@@ -157,7 +133,7 @@ IxEthAccQregInfo ixEthAccQmgrStaticInfo[]=
     (IxQMgrCallbackId) IX_ETH_PORT_2,
     IX_QMGR_Q_SIZE128,              /**< Allocate Max Size Q */
     IX_QMGR_Q_ENTRY_SIZE1,          /**< Queue Entry Sizes - all Q entries are single word entries   */
-    FALSE,                          /**< Disable Q notification at startup */
+    false,                          /**< Disable Q notification at startup */
     IX_ETH_ACC_RX_FREE_BUFF_ENET1_Q_SOURCE,  /**< Q Condition to drive callback  */
     IX_QMGR_Q_WM_LEVEL0,            /**< Q Low water mark */
     IX_QMGR_Q_WM_LEVEL64,           /**< Q High water mark */
@@ -170,7 +146,7 @@ IxEthAccQregInfo ixEthAccQmgrStaticInfo[]=
     (IxQMgrCallbackId) IX_ETH_PORT_3,
     IX_QMGR_Q_SIZE128,              /**< Allocate Max Size Q */
     IX_QMGR_Q_ENTRY_SIZE1,          /**< Queue Entry Sizes - all Q entries are single word entries   */
-    FALSE,                          /**< Disable Q notification at startup */
+    false,                          /**< Disable Q notification at startup */
     IX_ETH_ACC_RX_FREE_BUFF_ENET2_Q_SOURCE,  /**< Q Condition to drive callback  */
     IX_QMGR_Q_WM_LEVEL0,            /**< Q Low water mark */
     IX_QMGR_Q_WM_LEVEL64,           /**< Q High water mark */
@@ -183,7 +159,7 @@ IxEthAccQregInfo ixEthAccQmgrStaticInfo[]=
      (IxQMgrCallbackId) IX_ETH_PORT_1,
     IX_QMGR_Q_SIZE128,              /**< Allocate Max Size Q */
     IX_QMGR_Q_ENTRY_SIZE1,          /**< Queue Entry Sizes - all Q entries are single word entries   */
-    FALSE,                          /**< Disable Q notification at startup */
+    false,                          /**< Disable Q notification at startup */
     IX_ETH_ACC_TX_FRAME_ENET0_Q_SOURCE,         /**< Q Condition to drive callback  */
     IX_QMGR_Q_WM_LEVEL0,            /**< Q Low water mark */
     IX_QMGR_Q_WM_LEVEL64,           /**< Q High water mark */
@@ -196,7 +172,7 @@ IxEthAccQregInfo ixEthAccQmgrStaticInfo[]=
      (IxQMgrCallbackId) IX_ETH_PORT_2,
     IX_QMGR_Q_SIZE128,              /**< Allocate Max Size Q */
     IX_QMGR_Q_ENTRY_SIZE1,          /**< Queue Entry Sizes - all Q entries are single word entries   */
-    FALSE,                          /**< Disable Q notification at startup */
+    false,                          /**< Disable Q notification at startup */
     IX_ETH_ACC_TX_FRAME_ENET1_Q_SOURCE,             /**< Q Condition to drive callback  */
     IX_QMGR_Q_WM_LEVEL0,            /**< Q Low water mark */
     IX_QMGR_Q_WM_LEVEL64,           /**< Q High water mark */
@@ -209,7 +185,7 @@ IxEthAccQregInfo ixEthAccQmgrStaticInfo[]=
      (IxQMgrCallbackId) IX_ETH_PORT_3,
     IX_QMGR_Q_SIZE128,              /**< Allocate Max Size Q */
     IX_QMGR_Q_ENTRY_SIZE1,          /** Queue Entry Sizes - all Q entries are single ord entries   */
-    FALSE,                          /** Disable Q notification at startup */
+    false,                          /** Disable Q notification at startup */
     IX_ETH_ACC_TX_FRAME_ENET2_Q_SOURCE,             /** Q Condition to drive callback  */
     IX_QMGR_Q_WM_LEVEL0,            /* No queues use almost empty */
     IX_QMGR_Q_WM_LEVEL64,            /** Q High water mark - needed used  */
@@ -222,7 +198,7 @@ IxEthAccQregInfo ixEthAccQmgrStaticInfo[]=
      (IxQMgrCallbackId) 0,
     IX_QMGR_Q_SIZE128,              /**< Allocate Max Size Q */
     IX_QMGR_Q_ENTRY_SIZE1,          /**< Queue Entry Sizes - all Q entries are single word entries   */
-    TRUE,                           /**< Enable Q notification at startup */
+    true,                           /**< Enable Q notification at startup */
     IX_ETH_ACC_TX_FRAME_DONE_ETH_Q_SOURCE, /**< Q Condition to drive callback  */
     IX_QMGR_Q_WM_LEVEL0,            /**< Q Low water mark */
     IX_QMGR_Q_WM_LEVEL2,            /**< Q High water mark - needed by NPE */
@@ -449,7 +425,7 @@ ixEthAccQMgrQueueSetup(IxEthAccQregInfo *qInfoDes)
     /*
      * Set notification condition for Q
      */
-    if ( qInfoDes->qNotificationEnableAtStartup == TRUE )
+    if (qInfoDes->qNotificationEnableAtStartup == true)
     {
        if (   ixQMgrNotificationEnable(qInfoDes->qId,
                                        qInfoDes->qConditionSource)
@@ -513,7 +489,7 @@ IxEthAccStatus ixEthAccQMgrQueuesConfig(void)
     IxEthDBProperty ixEthDBTrafficClass = IX_ETH_DB_QOS_TRAFFIC_CLASS_0_RX_QUEUE_PROPERTY;
     IxEthDBPropertyType ixEthDBPropertyType = IX_ETH_DB_INTEGER_PROPERTY;
     UINT32 ixEthDBParameter = 0;
-    BOOL completelySorted = FALSE;
+    BOOL completelySorted = false;
 
     /* Fill the corspondance between ports and queues
      * This defines the mapping from port to queue Ids.
@@ -706,7 +682,7 @@ IxEthAccStatus ixEthAccQMgrQueuesConfig(void)
     do
     {
        sortIterations++;
-       completelySorted = TRUE;
+       completelySorted = true;
        for (rxQueue = 0;
             rxQueue < rxQueueCount - sortIterations;
             rxQueue++)
@@ -732,7 +708,7 @@ IxEthAccStatus ixEthAccQMgrQueuesConfig(void)
                rxQueues[rxQueue+1].npeId = npeId;
                rxQueues[rxQueue+1].qId = qId;
                rxQueues[rxQueue+1].trafficClass = trafficClass;
-               completelySorted = FALSE;
+               completelySorted = false;
            }
        }
     }