blob: db74e625c49f93bc23f679ed441dba4217ad11f8 [file] [log] [blame]
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +05301/*
2** Copyright 2017-present Open Networking Foundation
3**
4** Licensed under the Apache License, Version 2.0 (the "License");
5** you may not use this file except in compliance with the License.
6** You may obtain a copy of the License at
7**
8** http://www.apache.org/licenses/LICENSE-2.0
9**
10** Unless required by applicable law or agreed to in writing, software
11** distributed under the License is distributed on an "AS IS" BASIS,
12** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13** See the License for the specific language governing permissions and
14** limitations under the License.
15*/
16
17#ifndef DRIVERAPP_ASFVOLT16_DRIVER
18#define DRIVERAPP_ASFVOLT16_DRIVER
19
20/* Includes related to proto buf */
21#include "bal_msg_type.grpc-c.h"
22#include "bal_osmsg.grpc-c.h"
23#include "bal_model_ids.grpc-c.h"
24#include "bal_obj.grpc-c.h"
25#include "bal_model_types.grpc-c.h"
26#include "bal_errno.grpc-c.h"
27#include "bal.grpc-c.h"
28
29#define ASFVOLT_ERROR 1
30#define ASFVOLT_INFO 2
31#define ASFVOLT_DEBUG 3
32#define ASFVOLT_MAX_PKT_SIZE 500
33#define ASFVOLT_MAX_DEVICE_ID_SIZE 50
34#define MAX_CHAR_LENGTH 20
35#define MAX_OMCI_MSG_LENGTH 44
36
37char voltha_device_id[ASFVOLT_MAX_DEVICE_ID_SIZE];
38
39typedef struct BalCoreIpInfo
40{
41 char bal_core_arg1[4];
42 char bal_core_ip_port[24];
43 char bal_core_arg2[4];
44 char bal_shared_lib_ip_port[24];
45}balCoreIpInfo;
46
47#define ASFVOLT_LOG(log_type, args...) \
48 if(log_type) \
49 {\
50 printf("File(%s): Line(%d): ", __FUNCTION__, __LINE__);\
51 printf(args);\
52 }
53
54
55#define ASFVOLT_CFG_PROP_SET(cfg, obj, param, pram_prst, param_val) \
56 if(pram_prst)\
57 {\
58 BCMBAL_CFG_PROP_SET(&cfg, obj, param, param_val);\
59 }
60
61/***************************************************************
62* *
63* Function Declarations *
64* *
65****************************************************************/
66extern uint32_t asfvolt16_bal_init(BalInit *bal_init, balCoreIpInfo *coreInfo);
67extern uint32_t asfvolt16_bal_finish(void);
68extern uint32_t bal_register_indication_cbs(void);
69extern uint32_t asfvolt16_bal_cfg_set(BalCfg *cfg);
70extern uint32_t asfvolt16_bal_cfg_clear(BalKey *key);
71extern uint32_t asfvolt16_bal_cfg_get(BalKey *key, BalCfg *cfg);
72extern void asfvolt16_send_omci_msg(uint16_t olt_no, uint32_t onu_nu, char* packet_to_send);
73extern uint32_t asfvolt16_bal_stats_get(BalIntfType intf_type, uint32_t intf_id, BalInterfaceStatData *statData);
74grpc_c_client_t *client;
75
76#endif /* DRIVERAPP_ASFVOLT16_DRIVER */