openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

udf.c (2623B)


      1 /*
      2  * 
      3  *
      4  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      5  * 
      6  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
      7  */
      8 /*
      9  * UDF initializers
     10  */
     11 
     12 #include <sal/core/libc.h>
     13  
     14 #include <bcm/udf.h>
     15 
     16 /* 
     17  * Function:
     18  *      bcm_udf_info_t_init
     19  * Purpose:
     20  *      Initialize UDF Info struct
     21  * Parameters: 
     22  *      udf_info - Pointer to the struct to be init'ed
     23  */
     24 void
     25 bcm_udf_t_init(bcm_udf_t *udf_info)
     26 {
     27     if (udf_info != NULL) {
     28         sal_memset(udf_info, 0, sizeof(*udf_info));
     29     }
     30     return;
     31 }
     32 
     33 
     34 /* 
     35  * Function:
     36  *      bcm_udf_alloc_hints_t_init
     37  * Purpose:
     38  *      Initialize UDF alloc hints struct
     39  * Parameters: 
     40  *      udf_hints - Pointer to the struct to be init'ed
     41  */
     42 void
     43 bcm_udf_alloc_hints_t_init(bcm_udf_alloc_hints_t *udf_hints)
     44 {
     45     if (udf_hints != NULL) {
     46         sal_memset(udf_hints, 0, sizeof(*udf_hints));
     47     }
     48     return;
     49 }
     50 
     51 
     52 /*
     53  * Function:
     54  *      bcm_udf_pkt_format_info_t_init
     55  * Purpose:
     56  *      Initialize UDF packet format struct
     57  * Parameters:
     58  *      udf_format - Pointer to the struct to be init'ed
     59  */
     60 void
     61 bcm_udf_pkt_format_info_t_init(bcm_udf_pkt_format_info_t *pkt_format)
     62 {
     63     if (pkt_format != NULL) {
     64         sal_memset(pkt_format, 0, sizeof(*pkt_format));
     65 
     66 #if 0
     67         /* Will not be required with updated proposal - ANY -> 0 */
     68         udf_format->l2  = BCM_PKT_FORMAT_L2_ANY;
     69         udf_format->vlan_tag  = BCM_PKT_FORMAT_VLAN_TAG_ANY;
     70         udf_format->outer_ip  = BCM_PKT_FORMAT_IP_ANY;
     71         udf_format->inner_ip  = BCM_PKT_FORMAT_IP_ANY;
     72         udf_format->tunnel  = BCM_PKT_FORMAT_TUNNEL_ANY;
     73         udf_format->mpls  = BCM_PKT_FORMAT_MPLS_ANY;
     74         udf_format->fibre_chan_outer  = BCM_PKT_FORMAT_FIBRE_CHAN_ANY;
     75         udf_format->fibre_chan_inner  = BCM_PKT_FORMAT_FIBRE_CHAN_ANY;
     76 
     77         
     78 #endif /* 0 */
     79 
     80     }
     81 
     82     return;
     83 }
     84 
     85 /* 
     86  * Function:
     87  *      bcm_udf_hash_config_t_init
     88  * Purpose:
     89  *      Initialize UDF hashing configuration structure
     90  * Parameters: 
     91  *      info - Pointer to the struct to be init'ed
     92  */
     93 void
     94 bcm_udf_hash_config_t_init(bcm_udf_hash_config_t *info)
     95 {
     96     if (info != NULL) {
     97         sal_memset(info, 0, sizeof(*info));
     98     }
     99     return;
    100 }
    101 
    102 /* 
    103  * Function:
    104  *      bcm_udf_chunk_info_t_init
    105  * Purpose:
    106  *      Initialize UDF Chunk Info struct
    107  * Parameters: 
    108  *      udf_chunk_info - Pointer to the struct to be init'ed
    109  */
    110 void
    111 bcm_udf_chunk_info_t_init(bcm_udf_chunk_info_t *udf_chunk_info)
    112 {
    113     if (udf_chunk_info != NULL) {
    114         sal_memset(udf_chunk_info, 0, sizeof(bcm_udf_chunk_info_t));
    115     }
    116     return;
    117 }