Skip to content

Commit cc97054

Browse files
Juha HeiskanenMika Leppänen
authored andcommitted
Unicast Shedule update
Store neighbor unicast channel count which enable that EAPOL tarffic works. Change-Id: I0e0f163f822718c66393f683c7905efe2c0ab381
1 parent a099524 commit cc97054

File tree

2 files changed

+68
-1
lines changed

2 files changed

+68
-1
lines changed

source/6LoWPAN/ws/ws_neighbor_class.c

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "fhss_config.h"
2525
#include "6LoWPAN/ws/ws_config.h"
2626
#include "6LoWPAN/ws/ws_neighbor_class.h"
27+
#include "ws_management_api.h"
2728

2829
#ifdef HAVE_WS
2930

@@ -92,11 +93,75 @@ void ws_neighbor_class_neighbor_unicast_time_info_update(ws_neighbor_class_entry
9293
ws_neighbor->fhss_data.uc_timing_info.ufsi = ws_utt->ufsi;
9394
}
9495

96+
static uint16_t ws_common_channel_number_calc(uint8_t regulatory_domain, uint8_t operating_class)
97+
{
98+
if (regulatory_domain == REG_DOMAIN_KR) {
99+
if (operating_class == 1) {
100+
return 32;
101+
} else if (operating_class == 2) {
102+
return 16;
103+
} else {
104+
return 0;
105+
}
106+
} else if (regulatory_domain == REG_DOMAIN_EU) {
107+
if (operating_class == 1) {
108+
return 69;
109+
} else if (operating_class == 2) {
110+
return 35;
111+
} else if (operating_class == 3) {
112+
return 59;
113+
} else if (operating_class == 4) {
114+
return 30;
115+
} else {
116+
return 0;
117+
}
118+
} else if (regulatory_domain == REG_DOMAIN_NA) {
119+
if (operating_class == 1) {
120+
return 129;
121+
} else if (operating_class == 2) {
122+
return 64;
123+
} else if (operating_class == 3) {
124+
return 42;
125+
} else {
126+
return 0;
127+
}
128+
} else if (regulatory_domain == REG_DOMAIN_JP) {
129+
if (operating_class == 1) {
130+
return 38;
131+
} else if (operating_class == 2) {
132+
return 18;
133+
} else if (operating_class == 3) {
134+
return 12;
135+
} else {
136+
return 0;
137+
}
138+
} else if (regulatory_domain == REG_DOMAIN_WW) {
139+
if (operating_class == 1) {
140+
return 416;
141+
} else if (operating_class == 2) {
142+
return 207;
143+
} else {
144+
return 0;
145+
}
146+
} else {
147+
return 0;
148+
}
149+
}
150+
95151
void ws_neighbor_class_neighbor_unicast_schedule_set(ws_neighbor_class_entry_t *ws_neighbor, ws_us_ie_t *ws_us)
96152
{
97153
ws_neighbor->fhss_data.uc_timing_info.unicast_channel_function = ws_us->channel_function;
98154
if (ws_us->channel_function == WS_FIXED_CHANNEL) {
99155
ws_neighbor->fhss_data.uc_timing_info.fixed_channel = ws_us->function.zero.fixed_channel;
156+
ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels = 1;
157+
} else {
158+
if (ws_us->channel_plan == 0) {
159+
ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels = ws_common_channel_number_calc(ws_us->plan.zero.regulator_domain, ws_us->plan.zero.operation_class);
160+
} else if (ws_us->channel_plan == 1) {
161+
ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels = ws_us->plan.one.number_of_channel;
162+
} else {
163+
ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels = 0;
164+
}
100165
}
101166
ws_neighbor->fhss_data.uc_timing_info.unicast_dwell_interval = ws_us->dwell_interval;
102167
}

source/Service_Libs/fhss/fhss_ws.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,9 @@ static int fhss_ws_tx_handle_callback(const fhss_api_t *api, bool is_broadcast_a
449449
return -2;
450450
}
451451
// TODO: WS bootstrap has to store neighbors number of channels
452-
neighbor_timing_info->uc_timing_info.unicast_number_of_channels = fhss_structure->number_of_channels;
452+
if (neighbor_timing_info->uc_timing_info.unicast_number_of_channels == 0) {
453+
neighbor_timing_info->uc_timing_info.unicast_number_of_channels = fhss_structure->number_of_channels;
454+
}
453455
uint16_t destination_slot = fhss_ws_calculate_destination_slot(neighbor_timing_info, tx_time);
454456
int32_t tx_channel = neighbor_timing_info->uc_timing_info.fixed_channel;
455457
if (neighbor_timing_info->uc_timing_info.unicast_channel_function == WS_TR51CF) {

0 commit comments

Comments
 (0)