| /****************************************************************************** |
| * |
| * <:copyright-BRCM:2016:DUAL/GPL:standard |
| * |
| * Copyright (c) 2016 Broadcom |
| * All Rights Reserved |
| * |
| * Unless you and Broadcom execute a separate written software license |
| * agreement governing use of this software, this software is licensed |
| * to you under the terms of the GNU General Public License version 2 |
| * (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, |
| * with the following added to such license: |
| * |
| * As a special exception, the copyright holders of this software give |
| * you permission to link this software with independent modules, and |
| * to copy and distribute the resulting executable under terms of your |
| * choice, provided that you also meet, for each linked independent |
| * module, the terms and conditions of the license of that module. |
| * An independent module is a module which is not derived from this |
| * software. The special exception does not apply to any modifications |
| * of the software. |
| * |
| * Not withstanding the above, under no circumstances may you combine |
| * this software in any way with any other Broadcom software provided |
| * under a license other than the GPL, without Broadcom's express prior |
| * written consent. |
| * |
| * :> |
| * |
| *****************************************************************************/ |
| |
| /****************************************************************************** |
| The message format will look like the following |
| |
| ----------------------------------------------------------------------------------- |
| | BAL Header | | Payload Data | |
| ----------------------------------|------------------------------------------------ |
| | *bcmos_header | | App Header | | |
| ----------------------------------------------------------------------------------- |
| | | | version | | |
| | type | msg_type | obj_key | bal_util_ind_flow_t | |
| | | msg_id | status | | |
| ----------------------------------------------------------------------------------- |
| |
| *The bcmos Header is actually the first field of BAL Header structure (bal_comm_msg_hdr_t) |
| |
| type can be: |
| BCMBAL_SWITCH_UTIL_MSG |
| BCMBAL_MAC_UTIL_MSG |
| |
| msg_type can be: |
| BAL_MSG_IND, |
| BAL_MSG_AUTO_IND |
| |
| msg_id is module specific, but contains two 16 bits fields (OBJECT_ID, OPERATION_ID) |
| see bal_objs.h for OBJECT_ID details |
| The OPERATION_ID should be unique within the OBJECT - see example below |
| bal_msg.h |
| |
| status is for indication message to show general results. The value is bcmos_errno. |
| |
| *********************************************************************************/ |
| |
| /** |
| * @file bal_utils_msg.h |
| * |
| * @brief Common header for messages sent between Utils and Core |
| * |
| * @ingroup apps |
| */ |
| |
| #ifndef _BAL_UTIL_MSG_H_ |
| #define _BAL_UTIL_MSG_H_ |
| |
| /*@{*/ |
| |
| #include <bal_msg.h> |
| #include <stdint.h> |
| |
| #define BAL_UTIL_MSG_VERSION 1 |
| |
| /* access terminal request list, |
| */ |
| typedef enum |
| { |
| BAL_UTIL_OPER_ACC_TERM_CONNECT, |
| BAL_UTIL_OPER_ACC_TERM_DISCONNECT |
| } bal_util_oper_acc_term; |
| |
| /* subscriber terminal request list, |
| */ |
| typedef enum |
| { |
| BAL_UTIL_OPER_SUB_TERM_ADD, |
| BAL_UTIL_OPER_SUB_TERM_REMOVE, |
| BAL_UTIL_OPER_SUB_TERM_CLEAR, |
| BAL_UTIL_OPER_SUB_TERM_DISCOVERY |
| } bal_util_oper_sub_term; |
| |
| /* interface request list, |
| */ |
| typedef enum |
| { |
| BAL_UTIL_OPER_IF_UP, |
| BAL_UTIL_OPER_IF_DOWN |
| } bal_util_oper_if; |
| |
| /* flow request list, |
| */ |
| typedef enum |
| { |
| BAL_UTIL_OPER_FLOW_ADD, |
| BAL_UTIL_OPER_FLOW_REMOVE, |
| BAL_UTIL_OPER_FLOW_CLEAR |
| } bal_util_oper_flow; |
| |
| typedef enum |
| { |
| BAL_UTIL_FLOW_IND_SEND_NONE, |
| BAL_UTIL_FLOW_IND_SEND_SUCCESS, |
| BAL_UTIL_FLOW_IND_SEND_FAIL |
| } bal_util_flow_ind; |
| |
| /* group request list, |
| */ |
| typedef enum |
| { |
| BAL_UTIL_OPER_GROUP_CREATE, |
| BAL_UTIL_OPER_GROUP_ADD, |
| BAL_UTIL_OPER_GROUP_REMOVE, |
| BAL_UTIL_OPER_GROUP_SET, |
| BAL_UTIL_OPER_GROUP_DESTROY |
| } bal_util_oper_group; |
| |
| typedef enum |
| { |
| BAL_UTIL_OPER_AGG_PORT_ADD, |
| BAL_UTIL_OPER_AGG_PORT_REMOVE, |
| BAL_UTIL_OPER_AGG_PORT_CLEAR |
| } bal_util_oper_agg_port; |
| |
| /* Macro to retrieve the name string of the GROUP oper */ |
| #define BCMBAL_UTIL_GROUP_OPER_STR_GET(__op_type__) \ |
| ( BAL_UTIL_OPER_GROUP_CREATE == __op_type__ ) ? "create" : \ |
| ( BAL_UTIL_OPER_GROUP_ADD == __op_type__ ) ? "add" : \ |
| ( BAL_UTIL_OPER_GROUP_REMOVE == __op_type__ ) ? "remove" : \ |
| ( BAL_UTIL_OPER_GROUP_SET == __op_type__ ) ? "set" : \ |
| ( BAL_UTIL_OPER_GROUP_DESTROY == __op_type__ ) ? "destroy" : \ |
| "unknown" |
| |
| /* bal_app_msg_obj_key_t allow applications to id which instance of object |
| * this message should be processed |
| */ |
| typedef union bal_util_msg_obj_key |
| { |
| bcmbal_access_terminal_key acc_term_key; |
| bcmbal_interface_key if_key; |
| bcmbal_subscriber_terminal_key sub_term_key; |
| bcmbal_flow_key flow_key; |
| bcmbal_group_key group_key; |
| bcmbal_tm_sched_key tm_sched_key; |
| } bal_util_msg_obj_key; |
| |
| #define BCMBAL_INVALID_TUNNEL_ID 0xffffffff |
| |
| /* indication message header */ |
| typedef struct bal_util_msg_ind |
| { |
| bal_comm_msg_hdr comm_hdr; /* Communication header */ |
| uint32_t version; /* version of the app message format */ |
| bal_util_msg_obj_key obj_key; |
| int32_t status; /* bcmos_errno */ |
| /* Optional custom BAL MAC/SWITCH UTIL indication data follows */ |
| char data[0]; |
| } bal_util_msg_ind; |
| |
| /* auto indication message header */ |
| typedef bal_util_msg_ind bal_util_msg_auto_ind; |
| |
| #endif /* _BAL_UTIL_MSG_H */ |