Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Enable github CI for developers forks #21

Open
wants to merge 80 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
ab23dc0
wsbrd: fix waste of CPU when 6lowpan queue is full
jerome-pouiller May 28, 2024
1926045
tbu: fix metric version in /config/borderRouter/joinMetrics
MathisMARION May 27, 2024
750611d
wsbrd: replace signal() with sigaction()
MathisMARION Feb 21, 2024
5d46665
utils: introduce uart_tx_flush()
MathisMARION Feb 21, 2024
b87e60a
rcp: flush TX queue on SIGINT
MathisMARION Feb 21, 2024
ce57d90
rcp: ignore CRC errors before IND_RESET
MathisMARION Feb 21, 2024
cfad740
hwping: fix ping requests
MathisMARION Feb 21, 2024
a5e86d3
hwping: fix hif tx traces for RCPv2
MathisMARION Feb 21, 2024
1d3ec54
hwping: trace hif during protocol detection
MathisMARION Feb 21, 2024
feb6039
hwping: trace hif in from read_data()
MathisMARION Feb 21, 2024
d61c8db
hwping: wait for reset indication before starting the test
MathisMARION Feb 21, 2024
7c18865
hwping: support IND_FATAL
MathisMARION Feb 21, 2024
d84178f
tbu: use -k instead of -d for dnsmasq
MathisMARION May 28, 2024
c71fa82
tbu: insert JM-IE in data frames
MathisMARION May 27, 2024
2939199
tbu: insert JM-IE even with no metrics
MathisMARION Jun 5, 2024
5ba1972
doc: update CHANGES with v2.1.1
MathisMARION Jun 5, 2024
fdefe9b
tbu: move up jm_list and jm_version declarations
MathisMARION Jun 13, 2024
872b6f9
tbu: make /config/borderRouter/joinMetrics idempotent
MathisMARION Jun 13, 2024
b84bbfe
tbu: make /config/borderRouter/informationElements idempotent
MathisMARION Jun 13, 2024
7091cee
utils: pass void * to iobuf_push_data()
MathisMARION May 13, 2024
1dcb2ad
15.4: add frame type definitions to specs/ieee80215.4
MathisMARION Apr 8, 2024
815f27b
15.4: introduce ieee802154_frame.[ch]
MathisMARION Apr 8, 2024
bf577dd
15.4: introduce ieee802154_frame_write_hdr()
MathisMARION May 6, 2024
e3cfd50
tbu: rework pcapng.[ch]
MathisMARION Jun 14, 2024
ff0944c
tbu: drop wsbr_data_ind_rebuild()
MathisMARION Jun 14, 2024
32784d2
tbu: include ACK frames in pcap_file
MathisMARION Jun 14, 2024
db12f2e
ipv6: do not copy hop limit when creating tunnels
MathisMARION Jun 11, 2024
5a138e3
doc: update CHANGES with v2.1.2
MathisMARION Jun 17, 2024
b8f2842
15.4: support no source address in ieee802154_frame.[ch]
MathisMARION Jun 19, 2024
a24dad0
wsbrd: fix EDFE with FAN 1.0
MathisMARION Jun 19, 2024
6fbbd7e
doc: fix link to PKI section
MathisMARION Jun 20, 2024
9f65b70
fixup! tbu: include ACK frames in pcap_file
MathisMARION Jun 21, 2024
d22dfdf
utils: fix oob read in hif_pop_str()
MathisMARION Jun 20, 2024
338aad7
rpl: rename "nvm_store"
MathisMARION Jun 21, 2024
ab18e71
rpl: introduce on_target_update() callback
MathisMARION Jun 26, 2024
325d9b8
rpl: always remove ARO if DAO indicates BR is no longer a parent
MathisMARION Jun 26, 2024
a7c8eab
rpl: introduce on_target_add() callback
MathisMARION Jun 26, 2024
f3600fa
rpl: introduce on_target_del() callback
MathisMARION Jun 26, 2024
7125a37
rpl: remove rpl.c dependency on rpl_storage.[ch]
MathisMARION Jun 27, 2024
acac7e1
ipv6: fix neighbor proxy for nodes more than 1 hop away
MathisMARION Jun 26, 2024
1ed152d
ws: do not advertise excluded channels in fixed channel
MathisMARION Jul 5, 2024
780dbaf
fixup! rpl: always remove ARO if DAO indicates BR is no longer a parent
MathisMARION Jul 5, 2024
8a90810
doc: update CHANGES with v2.1.3
MathisMARION Jul 5, 2024
3ad8901
ws: do not include base PhyModeId in POM-IE
MathisMARION Jul 8, 2024
016c230
wsbrd: write UTC time instead of RCP time in pcap_file
MathisMARION Jul 8, 2024
876f7a3
wsbrd: fix pcap time overflow on 32bit hosts
jerome-pouiller Jul 12, 2024
fd873c7
utils: FATAL on invalid FCS after init phase
Kilio22 Jul 16, 2024
66c473a
utils: trace invalid HCS during init phase, FATAL otherwise
Kilio22 Jul 17, 2024
ff64e70
doc: removed the reference to wsbrd docker container
silabs-ThibautC Apr 22, 2024
c7c4a74
legal: Add SPDX header for MSLA licensed code
rzr May 16, 2024
a3e4846
legal: Add LICENSES directory with MSLA Snapshot to comply reuse
rzr May 29, 2024
869daad
doc: update CHANGES with v2.1.4
MathisMARION Aug 6, 2024
5dc3c4b
mpl: fix use-after-free of MPL message
Kilio22 Aug 13, 2024
06921d7
log: show backtrace on segv
jerome-pouiller Aug 13, 2024
da096e5
fixup! sec: split PMK lifetime between FFN and LFN
Kilio22 Aug 20, 2024
1b79ced
log: use strsignal() instead of sigdescr_np()
MathisMARION Aug 26, 2024
e211278
sec: fix segv on receiving an unexpected frame from EAPOL target
Kilio22 Aug 26, 2024
4898656
rpl: handle multiple target for one single transit opt
Kilio22 Aug 8, 2024
7fffd5b
dbus: do not expose FFN neighbors that aren't RPL targets
Kilio22 Aug 30, 2024
10fa4d4
log: fix cpc error traces
MathisMARION Sep 5, 2024
94d1c81
dbus: only emit RoutingGraph signal on RPL transit change
MathisMARION Sep 4, 2024
4fd2e58
rpl: rework transit expiration code
MathisMARION Sep 5, 2024
1a0032e
rpl: call on_target_update() on transit expiration
MathisMARION Sep 5, 2024
f3aaf90
doc: update CHANGES with v2.1.5
MathisMARION Sep 6, 2024
0078b7a
mpl: delete messages with older sequence when increasing min sequence
MathisMARION Sep 12, 2024
5c44414
rcp: introduce rcp_set_filter_dst64()
MathisMARION Aug 28, 2024
554e3b4
conf: add mac_address parameter
MathisMARION Aug 28, 2024
c55cd0d
rpl: store MinHopRankIncrease as u16
MathisMARION Jun 19, 2024
a164218
rpl: fix typo "min_rank_hop_inc"
MathisMARION Jun 19, 2024
8e64fcd
doc: update reference to TBU spec
MathisMARION Aug 6, 2024
ac1a3e9
6lowpan: call lowpan_adaptation_data_process_clean() on frag failure
MathisMARION Sep 16, 2024
809733e
utils: Fix bounds issue on "out" variable.
Sep 8, 2024
c5eb977
doc: remove outdated TBU limitations
MathisMARION Sep 20, 2024
587ddbe
tun: fix memory leak in tun_add_node_to_proxy_neightbl()
MathisMARION Sep 23, 2024
0a3b2a7
conf: allow channel plan id 160 (CN)
Kilio22 Sep 25, 2024
c7200c1
tun: fix other memory leak in tun_add_node_to_proxy_neightbl()
MathisMARION Sep 26, 2024
49782f0
doc: update CHANGES with v2.1.6
MathisMARION Sep 24, 2024
af5b6db
build: Add helper file for CI or developers
rzr Oct 10, 2024
9718aa5
docker: Support docker for CI or dx
rzr Nov 5, 2024
b7ae1fa
github: Add action for checking PR in developers forks
rzr Nov 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# YAML -*- mode: yaml; tab-width: 2; indent-tabs-mode: nil; coding: utf-8 -*-
# SPDX-License-Identifier: LicenseRef-MSLA
# SPDX-Copyright-Text: (c) 2024 Silicon Laboratories Inc. (www.silabs.com)
---
name: Docker Image CI

on: # yamllint disable-line rule:truthy
push:
pull_request:

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Build Docker image from sources
run: docker build .
5 changes: 2 additions & 3 deletions 6lbr/6lowpan/lowpan_adaptation_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,9 +774,8 @@ int8_t lowpan_adaptation_interface_tx(struct net_if *cur, buffer_t *buf)
if (fragmented_needed) {
//Fragmentation init
if (lowpan_message_fragmentation_init(buf, tx_ptr, cur, interface_ptr)) {
tr_error("Fragment init fail");
tx_ptr->buf = NULL;
goto tx_error_handler;
lowpan_adaptation_data_process_clean(interface_ptr, tx_ptr);
return -1;
}

tx_ptr->tag = interface_ptr->local_frag_tag++;
Expand Down
1 change: 1 addition & 0 deletions 6lbr/6lowpan/lowpan_mtu.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2024 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down
11 changes: 11 additions & 0 deletions 6lbr/app/commandline.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2021-2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down Expand Up @@ -145,6 +146,7 @@ static const int valid_ws_chan_plan_ids[] = {
0x70, 0x71, // WW
0x80, // CN
0x90, // CN
0xa0, // CN
INT_MIN
};

Expand Down Expand Up @@ -444,6 +446,13 @@ static void conf_set_key(struct wsbrd_conf *config, const struct storage_parse_i
dest->key_len = ret;
}

static void conf_set_eui64(struct wsbrd_conf *config, const struct storage_parse_info *info, void *raw_dest, const void *raw_param)
{
BUG_ON(raw_param);
if (parse_byte_array(raw_dest, 8, info->value))
FATAL(1, "%s:%d: invalid key: %s", info->filename, info->linenr, info->value);
}

static void conf_set_allowed_macaddr(struct wsbrd_conf *config, const struct storage_parse_info *info, void *raw_dest, const void *raw_param)
{
BUG_ON(raw_param);
Expand Down Expand Up @@ -545,6 +554,7 @@ static void parse_config_line(struct wsbrd_conf *config, struct storage_parse_in
{ "lgtk_new_activation_time", &config->ws_lgtk_new_activation_time, conf_set_number, &valid_positive },
{ "lgtk_new_install_required", &config->ws_lgtk_new_install_required, conf_set_number, &valid_gtk_new_install_required },
{ "lfn_revocation_lifetime_reduction", &config->ws_lfn_revocation_lifetime_reduction, conf_set_number, &valid_unsigned },
{ "mac_address", config->ws_mac_address, conf_set_eui64, NULL },
{ "allowed_mac64", config->ws_allowed_mac_addresses, conf_set_allowed_macaddr, NULL },
{ "denied_mac64", config->ws_denied_mac_addresses, conf_set_denied_macaddr, NULL },
{ "async_frag_duration", &config->ws_async_frag_duration, conf_set_number, &valid_async_frag_duration },
Expand Down Expand Up @@ -653,6 +663,7 @@ void parse_commandline(struct wsbrd_conf *config, int argc, char *argv[],
config->rpl_compat = true;
config->rpl_rpi_ignorable = false;
strcpy(config->storage_prefix, "/var/lib/wsbrd/");
memset(config->ws_mac_address, 0xff, sizeof(config->ws_mac_address));
memset(config->ws_allowed_channels, 0xFF, sizeof(config->ws_allowed_channels));
while ((opt = getopt_long(argc, argv, opts_short, opts_long, NULL)) != -1) {
switch (opt) {
Expand Down
2 changes: 2 additions & 0 deletions 6lbr/app/commandline.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2021-2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down Expand Up @@ -98,6 +99,7 @@ struct wsbrd_conf {
bool rpl_rpi_ignorable;
unsigned int ws_join_metrics;

uint8_t ws_mac_address[8];
uint8_t ws_allowed_mac_addresses[10][8];
uint8_t ws_allowed_mac_address_count;
uint8_t ws_denied_mac_addresses[10][8];
Expand Down
1 change: 1 addition & 0 deletions 6lbr/app/commandline_values.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2021-2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down
1 change: 1 addition & 0 deletions 6lbr/app/commandline_values.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2021-2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down
7 changes: 7 additions & 0 deletions 6lbr/app/dbus.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2021-2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down Expand Up @@ -358,6 +359,7 @@ static int dbus_ie_custom_insert(sd_bus_message *m, void *userdata, sd_bus_error
case WS_FT_PA:
case WS_FT_PC:
case WS_FT_EAPOL:
case WS_FT_DATA:
case WS_FT_LPA:
case WS_FT_LPC:
break;
Expand Down Expand Up @@ -648,6 +650,7 @@ int dbus_get_routing_graph(sd_bus *bus, const char *path, const char *interface,
struct wsbr_ctxt *ctxt = userdata;
struct rpl_target target_br = { };
struct rpl_target *target;
struct ws_neigh *ws_neigh;

sd_bus_message_open_container(reply, 'a', "(aybaay)");

Expand All @@ -665,6 +668,10 @@ int dbus_get_routing_graph(sd_bus *bus, const char *path, const char *interface,
continue;
if (rpl_target_get(&ctxt->net_if.rpl_root, ipv6_neigh->ip_address))
continue;
ws_neigh = ws_neigh_get(&ctxt->net_if.ws_info.neighbor_storage,
ipv6_neighbour_eui64(&ctxt->net_if.ipv6_neighbour_cache, ipv6_neigh));
if (!ws_neigh || ws_neigh->node_role != WS_NR_ROLE_LFN)
continue;
dbus_message_append_ipv6_neigh(reply, ipv6_neigh, &ctxt->net_if.rpl_root);
}

Expand Down
1 change: 1 addition & 0 deletions 6lbr/app/dbus.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2021-2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down
1 change: 1 addition & 0 deletions 6lbr/app/drop_privileges.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down
1 change: 1 addition & 0 deletions 6lbr/app/drop_privileges.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down
63 changes: 1 addition & 62 deletions 6lbr/app/frame_helpers.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down Expand Up @@ -45,10 +46,6 @@
#define IEEE802154_SECURITY_FRAME_COUNT_SUPPR 0b00100000
#define IEEE802154_SECURITY_ASN_IN_NONCE 0b01000000

// IEEE 802.15.4-2020 Table 7-1 Values of the Frame Type field
#define IEEE802154_FRAME_TYPE_DATA 0b001
#define IEEE802154_FRAME_TYPE_ACK 0b010

// IEEE 802.15.4-2020 Figure 7-21 Format of Header IEs
#define IEEE802154_HEADER_IE_LEN_MASK 0b0000000001111111
#define IEEE802154_HEADER_IE_ID_MASK 0b0111111110000000
Expand Down Expand Up @@ -111,64 +108,6 @@ static const struct {
{ MAC_ADDR_MODE_16_BIT, MAC_ADDR_MODE_16_BIT, true, false, 1 },
};

int wsbr_data_ind_rebuild(uint8_t frame[],
const struct mcps_data_ind *ind,
const struct mcps_data_rx_ie_list *ie)
{
uint8_t *start = frame;
uint16_t fcf;
int i;

BUG_ON(ind->msduLength);
fcf = FIELD_PREP(IEEE802154_FCF_FRAME_TYPE, IEEE802154_FRAME_TYPE_DATA)
| FIELD_PREP(IEEE802154_FCF_SECURITY_ENABLED, false)
| FIELD_PREP(IEEE802154_FCF_FRAME_PENDING, ind->PendingBit)
| FIELD_PREP(IEEE802154_FCF_ACK_REQ, ind->TxAckReq)
| FIELD_PREP(IEEE802154_FCF_PAN_ID_COMPRESSION, ind->PanIdSuppressed)
| FIELD_PREP(IEEE802154_FCF_SEQ_NUM_SUPPR, ind->DSN_suppressed)
| FIELD_PREP(IEEE802154_FCF_IE_PRESENT, ie->headerIeListLength || ie->payloadIeListLength)
| FIELD_PREP(IEEE802154_FCF_DST_ADDR_MODE, ind->DstAddrMode)
| FIELD_PREP(IEEE802154_FCF_FRAME_VERSION, MAC_FRAME_VERSION_2015)
| FIELD_PREP(IEEE802154_FCF_SRC_ADDR_MODE, ind->SrcAddrMode);
frame = write_le16(frame, fcf);
if (!ind->DSN_suppressed)
*frame++ = ind->DSN;

for (i = 0; i < ARRAY_SIZE(ieee802154_table_pan_id_comp); i++)
if (ieee802154_table_pan_id_comp[i].dst_addr_mode == ind->DstAddrMode &&
ieee802154_table_pan_id_comp[i].src_addr_mode == ind->SrcAddrMode &&
ieee802154_table_pan_id_comp[i].pan_id_compression == ind->PanIdSuppressed)
break;
BUG_ON(i == ARRAY_SIZE(ieee802154_table_pan_id_comp), "invalid address mode");
if (ieee802154_table_pan_id_comp[i].dst_pan_id)
frame = write_le16(frame, ind->DstPANId);
if (ind->DstAddrMode == MAC_ADDR_MODE_64_BIT) {
memrcpy(frame, ind->DstAddr, 8);
frame += 8;
} else if (ind->DstAddrMode == MAC_ADDR_MODE_16_BIT) {
memrcpy(frame, ind->DstAddr, 2);
frame += 2;
}
if (ieee802154_table_pan_id_comp[i].src_pan_id)
frame = write_le16(frame, ind->SrcPANId);
if (ind->SrcAddrMode == MAC_ADDR_MODE_64_BIT) {
memrcpy(frame, ind->SrcAddr, 8);
frame += 8;
} else if (ind->SrcAddrMode == MAC_ADDR_MODE_16_BIT) {
memrcpy(frame, ind->SrcAddr, 2);
frame += 2;
}

memcpy(frame, ie->headerIeList, ie->headerIeListLength);
frame += ie->headerIeListLength;
if (ie->payloadIeListLength)
frame = write_le16(frame, IEEE802154_IE_HT1);
memcpy(frame, ie->payloadIeList, ie->payloadIeListLength);
frame += ie->payloadIeListLength;

return frame - start;
}

static int wsbr_data_sec_parse(struct iobuf_read *iobuf, struct mlme_security *sec)
{
uint8_t scf;
Expand Down
7 changes: 1 addition & 6 deletions 6lbr/app/frame_helpers.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand All @@ -20,16 +21,10 @@ struct iobuf_write;
struct rcp;
struct arm_15_4_mac_parameters;
struct mcps_data_cnf;
struct mcps_data_ind;
struct mcps_data_rx_ie_list;
struct mcps_data_req;
struct mcps_data_req_ie_list;

// FIXME: Unify prototypes of wsbr_data_ind_rebuild() and wsbr_data_req_rebuild()
int wsbr_data_ind_rebuild(uint8_t frame[],
const struct mcps_data_ind *ind,
const struct mcps_data_rx_ie_list *ie);

void wsbr_data_req_rebuild(struct iobuf_write *frame,
const struct rcp *rcp,
const struct mcps_data_req *req,
Expand Down
1 change: 1 addition & 0 deletions 6lbr/app/libwsbrd.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2024 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down
1 change: 1 addition & 0 deletions 6lbr/app/mbedtls_config_check.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2021-2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down
1 change: 1 addition & 0 deletions 6lbr/app/mbedtls_config_check.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2021-2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down
12 changes: 8 additions & 4 deletions 6lbr/app/rail_config.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2021-2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down Expand Up @@ -83,15 +84,17 @@ static void rail_fill_pom_auto(struct wsbr_ctxt *ctxt)
rail_fill_pom_disabled(ctxt);
return;
}
i = 1;
i = 0;
phy_config->rcp_rail_config_index = base_rail_params->index;
phy_config->phy_op_modes[0] = ctxt->config.ws_phy_mode_id;
for (rail_params = ctxt->rcp.rail_config_list; rail_params->chan0_freq; rail_params++) {
for (chan_params = chan_params_table; chan_params->chan0_freq; chan_params++) {
for (phy_mode = chan_params->valid_phy_modes; *phy_mode; phy_mode++) {
phy_params = ws_regdb_phy_params(*phy_mode, 0);
if (i >= ARRAY_SIZE(phy_config->phy_op_modes) - 1)
continue;
// Ignore base mode
if (phy_params->phy_mode_id == ctxt->config.ws_phy_mode_id)
continue;
// Ignore FAN1.0
if (!chan_params->chan_plan_id)
continue;
Expand Down Expand Up @@ -132,11 +135,12 @@ static void rail_fill_pom_manual(struct wsbr_ctxt *ctxt)
// any group
if (!base_rail_params->phy_mode_group)
continue;
i = 1;
i = 0;
phy_config->rcp_rail_config_index = base_rail_params->index;
phy_config->phy_op_modes[0] = ctxt->config.ws_phy_mode_id;
for (phy_mode = ctxt->config.ws_phy_op_modes; *phy_mode; phy_mode++) {
phy_params = ws_regdb_phy_params(*phy_mode, 0);
if (phy_params->phy_mode_id == ctxt->config.ws_phy_mode_id)
WARN("base \"phy_mode_id\" should not be present in \"phy_operating_modes\"");
found = 0;
if (base_phy_params->modulation == MODULATION_OFDM &&
base_phy_params->rail_phy_mode_id != phy_params->rail_phy_mode_id)
Expand Down
1 change: 1 addition & 0 deletions 6lbr/app/rail_config.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down
18 changes: 18 additions & 0 deletions 6lbr/app/rcp_api.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down Expand Up @@ -85,6 +86,11 @@ static void rcp_ind_fatal(struct rcp *rcp, struct iobuf_read *buf)
msg = hif_pop_str(buf);
BUG_ON(buf->err);

// CRC errors can happen during init if a previous frame transmission was
// interrupted.
if (err == HIF_ECRC && !rcp->has_reset)
return;

if (msg)
FATAL(3, "rcp error %s: %s", hif_fatal_str(err), msg);
else
Expand Down Expand Up @@ -497,6 +503,18 @@ void rcp_set_filter_src64(struct rcp *rcp, const uint8_t eui64[][8], uint8_t cou
iobuf_free(&buf);
}

void rcp_set_filter_dst64(struct rcp *rcp, const uint8_t eui64[8])
{
struct iobuf_write buf = { };

memcpy(&rcp->eui64, eui64, 8);

hif_push_u8(&buf, HIF_CMD_SET_FILTER_DST64);
hif_push_fixed_u8_array(&buf, eui64, 8);
rcp_tx(rcp, &buf);
iobuf_free(&buf);
}

struct rcp_cmd rcp_cmd_table[] = {
{ HIF_CMD_IND_NOP, rcp_ind_nop },
{ HIF_CMD_IND_RESET, rcp_ind_reset },
Expand Down
2 changes: 2 additions & 0 deletions 6lbr/app/rcp_api.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down Expand Up @@ -90,6 +91,7 @@ void rcp_set_filter_src64(struct rcp *rcp,
const uint8_t eui64[][8],
uint8_t count,
bool allow);
void rcp_set_filter_dst64(struct rcp *rcp, const uint8_t eui64[8]);

// Exported for wsbrd-fuzz
struct rcp_cmd {
Expand Down
1 change: 1 addition & 0 deletions 6lbr/app/rcp_api_legacy.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2023 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down
1 change: 1 addition & 0 deletions 6lbr/app/timers.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2024 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down
1 change: 1 addition & 0 deletions 6lbr/app/timers.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* SPDX-License-Identifier: LicenseRef-MSLA
* Copyright (c) 2024 Silicon Laboratories Inc. (www.silabs.com)
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
Expand Down
Loading