1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef LNN_LANE_DEF_H
17 #define LNN_LANE_DEF_H
18 
19 #include <stdint.h>
20 #include "lnn_lane_interface.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #define LNN_LANE_P2P_MAX_NUM 4
27 
28 typedef enum {
29     LANE_BW_RANDOM = 0x0,
30     LANE_BW_20M,
31     LANE_BW_40M,
32     LANE_BW_80M,
33     LANE_BW_80P80M,
34     LANE_BW_160M,
35     LANE_BW_BUTT = 0xFF,
36 } LaneBandwidth;
37 
38 typedef enum {
39     LANE_TS_RANDOM = 0x0,
40     LANE_TS_BUTT = 0xFF,
41 } LaneTimeSlotPolicy;
42 
43 typedef enum {
44     LANE_POWER_RANDOM = 0x0,
45     LANE_POWER_SMART,
46     LANE_POWER_VSR,
47     LANE_POWER_BUTT = 0xFF,
48 } LanePowerType;
49 
50 typedef enum {
51     LANE_PRI_LOW = 0x0,
52     LANE_PRI_HIGH,
53     LANE_PRI_BUTT = 0xFF,
54 } LaneTransPriority;
55 
56 typedef struct {
57     uint32_t serialNum;
58     LaneLinkType linkType;
59     int32_t phyChannel;
60     LaneBandwidth bw;
61     LaneTimeSlotPolicy ts;
62     LanePowerType energy;
63     LaneTransType content;
64     LaneTransPriority priority;
65     uint16_t baseProfileNum;
66     uint32_t maxSpeed;
67 } LaneProfile;
68 
69 typedef struct {
70     char localIp[IP_LEN];
71     char peerIp[IP_LEN];
72 } LnnLaneP2pInfo;
73 
74 typedef enum {
75     LNN_LINK_TYPE_WLAN_5G = 0x0,
76     LNN_LINK_TYPE_WLAN_2P4G,
77     LNN_LINK_TYPE_BR,
78     LNN_LINK_TYPE_P2P,
79     LNN_LINK_TYPE_P2P_MAX = LNN_LINK_TYPE_P2P + LNN_LANE_P2P_MAX_NUM,
80     LNN_LINK_TYPE_BUTT,
81 } LnnLaneLinkType;
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 #endif // LNN_LANE_DEF_H