Shad Ansari | 2f7f9be | 2017-06-07 13:34:53 -0700 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * <:copyright-BRCM:2016:DUAL/GPL:standard |
| 4 | * |
| 5 | * Copyright (c) 2016 Broadcom |
| 6 | * All Rights Reserved |
| 7 | * |
| 8 | * Unless you and Broadcom execute a separate written software license |
| 9 | * agreement governing use of this software, this software is licensed |
| 10 | * to you under the terms of the GNU General Public License version 2 |
| 11 | * (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, |
| 12 | * with the following added to such license: |
| 13 | * |
| 14 | * As a special exception, the copyright holders of this software give |
| 15 | * you permission to link this software with independent modules, and |
| 16 | * to copy and distribute the resulting executable under terms of your |
| 17 | * choice, provided that you also meet, for each linked independent |
| 18 | * module, the terms and conditions of the license of that module. |
| 19 | * An independent module is a module which is not derived from this |
| 20 | * software. The special exception does not apply to any modifications |
| 21 | * of the software. |
| 22 | * |
| 23 | * Not withstanding the above, under no circumstances may you combine |
| 24 | * this software in any way with any other Broadcom software provided |
| 25 | * under a license other than the GPL, without Broadcom's express prior |
| 26 | * written consent. |
| 27 | * |
| 28 | * :> |
| 29 | * |
| 30 | *****************************************************************************/ |
| 31 | |
| 32 | /** |
| 33 | * @file bal_switch_util.c |
| 34 | * |
| 35 | * @brief Switch App interfaces definition used by Bal Core |
| 36 | * |
| 37 | * This file provides CmdSet message handler functions with relevant |
| 38 | * bal object operations of access terminal and flow. |
| 39 | * |
| 40 | * @addtogroup sw_util |
| 41 | * |
| 42 | */ |
| 43 | |
| 44 | /*@{*/ |
| 45 | |
| 46 | #include <bcm_dev_log.h> |
| 47 | #include <bal_common.h> |
| 48 | #include <bal_msg.h> |
| 49 | #include "bal_switch_util.h" |
| 50 | |
| 51 | /* |
| 52 | * Logging device id |
| 53 | */ |
| 54 | dev_log_id log_id_sw_util; |
| 55 | |
| 56 | /** |
| 57 | * @brief sw_util_init routine to initialize the switch util before any use |
| 58 | * @return bcmos_errno |
| 59 | */ |
| 60 | bcmos_errno sw_util_init(void) |
| 61 | { |
| 62 | bcmos_errno rc = BCM_ERR_OK; |
| 63 | |
| 64 | log_id_sw_util = bcm_dev_log_id_register("SW_UTIL", DEV_LOG_LEVEL_INFO, DEV_LOG_ID_TYPE_BOTH); |
| 65 | BUG_ON(log_id_sw_util== DEV_LOG_INVALID_ID); |
| 66 | |
| 67 | return rc; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * @brief sw_util_finish routine to release any resource used by the switch util before exit |
| 72 | * @return bcmos_errno |
| 73 | */ |
| 74 | bcmos_errno sw_util_finish(void) |
| 75 | { |
| 76 | bcmos_errno rc = BCM_ERR_OK; |
| 77 | |
| 78 | /* release any internal allocated DB - best effort as we are exiting anyway */ |
| 79 | /* flow */ |
| 80 | sw_util_flow_finish(); |
| 81 | |
| 82 | /* group */ |
| 83 | sw_util_group_finish(); |
| 84 | |
| 85 | return rc; |
| 86 | } |
| 87 | |
| 88 | /*@}*/ |
| 89 | |