net: sh-eth: Add support R8A7790
[oweals/u-boot.git] / drivers / net / npe / IxEthDBAPI.c
index b2bfb72606e1e1f67c78ada3ee1dc009de10c33e..023cf50248707fb99330c4c5e3b646b5834199be 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 --
  */
@@ -60,7 +36,7 @@ IxEthDBStatus ixEthDBFilteringStaticEntryProvision(IxEthDBPortId portID, IxEthDB
     
     IX_ETH_DB_CHECK_FEATURE(portID, IX_ETH_DB_LEARNING);
 
-    return ixEthDBTriggerAddPortUpdate(macAddr, portID, TRUE);
+    return ixEthDBTriggerAddPortUpdate(macAddr, portID, true);
 }
     
 IX_ETH_DB_PUBLIC
@@ -74,7 +50,7 @@ IxEthDBStatus ixEthDBFilteringDynamicEntryProvision(IxEthDBPortId portID, IxEthD
 
     IX_ETH_DB_CHECK_FEATURE(portID, IX_ETH_DB_LEARNING);
 
-    return ixEthDBTriggerAddPortUpdate(macAddr, portID, FALSE);
+    return ixEthDBTriggerAddPortUpdate(macAddr, portID, false);
 }
 
 IX_ETH_DB_PUBLIC
@@ -102,7 +78,7 @@ void ixEthDBDatabaseMaintenance()
 {
     HashIterator iterator;
     UINT32 portIndex;
-    BOOL agingRequired = FALSE;
+    BOOL agingRequired = false;
 
     /* ports who will have deleted records and therefore will need updating */
     IxEthDBPortMap triggerPorts;
@@ -120,7 +96,7 @@ void ixEthDBDatabaseMaintenance()
     {
         if (ixEthDBPortInfo[portIndex].agingEnabled && ixEthDBPortInfo[portIndex].enabled)
         {
-            agingRequired = TRUE;
+            agingRequired = true;
         }
     }
 
@@ -152,9 +128,9 @@ void ixEthDBDatabaseMaintenance()
                 }
                 else
                 {
-                    ixEthDBPortInfo[portIndex].agingEnabled                = FALSE;
-                    ixEthDBPortInfo[portIndex].updateMethod.updateEnabled  = FALSE;
-                    ixEthDBPortInfo[portIndex].updateMethod.userControlled = TRUE;
+                    ixEthDBPortInfo[portIndex].agingEnabled                = false;
+                    ixEthDBPortInfo[portIndex].updateMethod.updateEnabled  = false;
+                    ixEthDBPortInfo[portIndex].updateMethod.userControlled = true;
 
                     ixOsalLog(IX_OSAL_LOG_LVL_FATAL,
                         IX_OSAL_LOG_DEV_STDOUT, 
@@ -173,7 +149,7 @@ void ixEthDBDatabaseMaintenance()
         {
             MacDescriptor *descriptor = (MacDescriptor *) iterator.node->data;
             UINT32 *age               = NULL;
-            BOOL staticEntry          = TRUE;
+            BOOL staticEntry          = true;
 
             if (descriptor->type == IX_ETH_DB_FILTERING_RECORD)
             {
@@ -187,10 +163,10 @@ void ixEthDBDatabaseMaintenance()
             }
             else
             {
-                staticEntry = TRUE;
+                staticEntry = true;
             }
 
-            if (ixEthDBPortInfo[descriptor->portID].agingEnabled && (staticEntry == FALSE))
+            if (ixEthDBPortInfo[descriptor->portID].agingEnabled && (staticEntry == false))
             {
                 /* manually increment the age if the port has no such capability */
                 if ((ixEthDBPortDefinitions[descriptor->portID].capabilities & IX_ETH_ENTRY_AGING) == 0)
@@ -341,7 +317,7 @@ IxEthDBStatus ixEthDBPortAgingDisable(IxEthDBPortId portID)
 
     IX_ETH_DB_CHECK_FEATURE(portID, IX_ETH_DB_LEARNING);
 
-    ixEthDBPortInfo[portID].agingEnabled = FALSE;
+    ixEthDBPortInfo[portID].agingEnabled = false;
 
     return IX_ETH_DB_SUCCESS;
 }
@@ -355,7 +331,7 @@ IxEthDBStatus ixEthDBPortAgingEnable(IxEthDBPortId portID)
 
     IX_ETH_DB_CHECK_FEATURE(portID, IX_ETH_DB_LEARNING);
 
-    ixEthDBPortInfo[portID].agingEnabled = TRUE;
+    ixEthDBPortInfo[portID].agingEnabled = true;
 
     return IX_ETH_DB_SUCCESS;
 }
@@ -442,7 +418,7 @@ IxEthDBStatus ixEthDBPortUpdateEnableSet(IxEthDBPortId portID, BOOL enableUpdate
     IX_ETH_DB_CHECK_FEATURE(portID, IX_ETH_DB_FILTERING);
 
     ixEthDBPortInfo[portID].updateMethod.updateEnabled  = enableUpdate;
-    ixEthDBPortInfo[portID].updateMethod.userControlled = TRUE;
+    ixEthDBPortInfo[portID].updateMethod.userControlled = true;
 
     return IX_ETH_DB_SUCCESS;
 }