Skip to content

Commit

Permalink
NRC7292 Standalone SDK v1.3.4 rev06
Browse files Browse the repository at this point in the history
- Update APIs and related samples : SPI, I2C, UART
- Added standalone board data
- Added API to set or get scan frequency list
- Exception handling of IP length mismatch
- Update Update an ATCMD host application
  • Loading branch information
Aaron J. Lee committed Apr 5, 2022
1 parent dee282c commit d0ba3f1
Show file tree
Hide file tree
Showing 373 changed files with 9,372 additions and 10,182 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Notice
### Release roadmap
- v1.3.4_rev06 (2022.04.05)
- v1.3.4_rev05 (2022.03.16)
- v1.3.4_rev04 (2022.03.02)
- v1.3.4_rev03 (2021.12.08)
Expand All @@ -14,7 +15,7 @@
- v1.3.0 (2020.07.19)

### Latest release
- [NRC7292_Standalone_SDK_v1.3.4_rev05](https://github.com/newracom/nrc7292_sdk/releases/tag/v1.3.4_rev05)
- [NRC7292_Standalone_SDK_v1.3.4_rev06](https://github.com/newracom/nrc7292_sdk/releases/tag/v1.3.4_rev06)

### Release package contents
- standalone: NRC7292 standalone SDK package for global regulatory domains
Expand Down
81 changes: 10 additions & 71 deletions package/standalone/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PREFIX = make -j4 -f make/Makefile
FILENAME = .build-target
USERMAKE = makefile.me
FUNCMAKE = makefile.func
PARAM =

BDFDATA := ./bdf/nrc7292_bd.dat
BDFHDR := ./bdf/nrc7292_bd.h

.PHONY : all lib
.PHONY : all bdf

-include $(FILENAME)
ifneq ($(ALIAS), )
Expand All @@ -15,53 +15,13 @@ endif
split = $(word $2, $(subst +, , $1))
param = $(strip $(subst target=$(target), , $(MAKEFLAGS)))

# UCODE PARAM
ifneq ($(MAKEFILE), )
USYSTEM := $(word 1, $(subst ., ,$(MAKEFILE)))
UTARGET := $(word 2, $(subst ., ,$(MAKEFILE)))
UCODEBIN := ./out/$(USYSTEM)/ucode/$(USYSTEM)_ucode.bin
UCODEHDR := ./system/$(USYSTEM)/ucode.h
#UCODE ALIAS (cm0 or cm3)
ifneq ($(ALIAS), )
ifneq (,$(findstring cm3, $(ALIAS)))
UPARAM = ALIAS=$(ALIAS)
else
ifneq (,$(findstring cm0, $(ALIAS)))
UPARAM = ALIAS=$(ALIAS)
else
ifeq ($(UTARGET), $(filter $(UTARGET),standalone))
UPARAM = ALIAS=$(ALIAS)+cm0
else
UPARAM = ALIAS=$(ALIAS)
endif
endif
endif
else
# Standalone (CM0 build if no alias)
ifeq ($(UTARGET), $(filter $(UTARGET),standalone))
UPARAM = ALIAS=cm0
endif
endif
UMAKEFILE := $(USYSTEM).ucode
#remove lib in ALIAS for UCODE Build
UPARAM := $(subst lib,,$(UPARAM))
endif

######### BUILD ########################################################
all: ucode
all: bdf
$(PREFIX).$(MAKEFILE) $(PARAM)
lib:
$(PREFIX).$(MAKEFILE) $(PARAM) lib

pkg:
$(PREFIX).$(MAKEFILE) $(PARAM) pkg

clean: ucodeclean
clean:
$(PREFIX).$(MAKEFILE) $(PARAM) ALIAS=$(ALIAS) clean

distclean: ucodeclean
$(PREFIX).$(MAKEFILE) clean
@rm $(FILENAME)
rm -f $(BDFHDR)

select::
@echo "MAKEFILE = $(call split, $(target), 1)" > $(FILENAME)
Expand All @@ -80,30 +40,9 @@ endif
@echo "" >> $(FILENAME)
@echo "PARAM := $(param)" >> $(FILENAME)

ucode:
ifeq ($(USYSTEM), $(filter $(USYSTEM),nrc7292 nrc7392 nrc4791))
ifeq ($(UTARGET), $(filter $(UTARGET),cspi standalone))
ifeq ($(findstring noucode, $(ALIAS)), )
ifeq ($(findstring halow, $(ALIAS)), )
$(PREFIX).$(UMAKEFILE) $(UPARAM)
@xxd --include $(UCODEBIN) > $(UCODEHDR)
@sed -i '1i const' $(UCODEHDR)
endif
endif
endif
endif

ucodeclean:
ifeq ($(USYSTEM), $(filter $(USYSTEM),nrc7292 nrc7392 nrc4791))
ifeq ($(UTARGET), $(filter $(UTARGET),cspi standalone))
ifeq ($(findstring noucode, $(ALIAS)), )
ifeq ($(findstring halow, $(ALIAS)), )
$(PREFIX).$(UMAKEFILE) $(UPARAM) clean
@rm -f $(UCODEHDR)
endif
endif
endif
endif

bdf:
@xxd --include $(BDFDATA) > $(BDFHDR)
@sed -i '1i const' $(BDFHDR)
@sed -i '/unsigned int/i const' $(BDFHDR)

##############################################################################################
Binary file not shown.
2 changes: 1 addition & 1 deletion package/standalone/VERSION-SDK
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_MAJOR 1
VERSION_MINOR 3
VERSION_REVISION 4
rev05
rev06

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added package/standalone/bdf/nrc7292_bd.dat
Binary file not shown.
Binary file modified package/standalone/doc/UG-7292-005-Standalone SDK API.pdf
Binary file not shown.
Binary file modified package/standalone/doc/UG-7292-006-AT_Command.pdf
Binary file not shown.
23 changes: 22 additions & 1 deletion package/standalone/lib/hostap/src/drivers/driver_nrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ struct nrc_wpa;
#define WLAN_ACTION_S1G_TWT_TEARDOWN 7
#define WLAN_ACTION_S1G_TWT_INFO 11

#if defined(INCLUDE_BD_SUPPORT)
#define NRC_WPA_BD_HEADER_LENGTH 16
#define NRC_WPA_BD_MAX_DATA_LENGTH 546
#endif /* defined(INCLUDE_BD_SUPPORT) */


extern uint8_t g_standalone_addr[6];

Expand Down Expand Up @@ -180,17 +183,35 @@ struct nrc_wpa_log_event {
int level;
};

#if defined(INCLUDE_BD_SUPPORT_TARGET_VERSION)
#define NRC_DRIVER_BD_MAX_CH_LIST 45
struct wpa_bd_ch_table {
uint16_t s1g_freq;
uint16_t nons1g_freq;
uint8_t s1g_freq_index;
uint16_t nons1g_freq_index;
};

struct wpa_bd_supp_param {
uint8_t num_ch;
uint8_t s1g_ch_index[NRC_DRIVER_BD_MAX_CH_LIST];
uint16_t nons1g_ch_freq[NRC_DRIVER_BD_MAX_CH_LIST];
};
#endif /* defined(INCLUDE_BD_SUPPORT_TARGET_VERSION) */

#if defined(INCLUDE_BD_SUPPORT)
struct nrc_wpa_bdf {
uint8_t ver_major;
uint8_t ver_minor;
uint16_t total_len;

uint16_t num_country;
uint16_t num_data_groups;
uint16_t reserved[4];
uint16_t checksum_data;

uint8_t data[NRC_WPA_BD_MAX_DATA_LENGTH];
};
#endif /* defined(INCLUDE_BD_SUPPORT) */

SYS_BUF * alloc_sys_buf_try(int hif_len, int nTry);

Expand Down
2 changes: 1 addition & 1 deletion package/standalone/lib/hostap/src/drivers/driver_nrc_tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
struct nrc_wpa_key;

int nrc_transmit_from_8023(uint8_t vif_id,uint8_t *frame, const uint16_t len);
int nrc_transmit_from_8023_mb(uint8_t vif_id, uint8_t **frames, const uint16_t len[], int n_frames);
int nrc_transmit_from_8023_mb(uint8_t vif_id, uint8_t **frames, uint16_t len[], int n_frames);
int nrc_add_sec_hdr(struct nrc_wpa_key *key, uint8_t *pos);

#endif // _DRIVER_NRC_TX_H_
167 changes: 89 additions & 78 deletions package/standalone/lib/hostap/wpa_supplicant/ctrl_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -10050,94 +10050,105 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
reply_len = 3;

#ifdef NRC_WPA_SUPP
if (os_strncmp(buf, "STATUS", 6) == 0) {
reply_len = wpa_supplicant_ctrl_iface_status(
if (os_strncmp(buf, "STATUS", 6) == 0) {
reply_len = wpa_supplicant_ctrl_iface_status(
wpa_s, buf + 6, reply, reply_size);
} else if (os_strncmp(buf, "SET ", 4) == 0) {
if (wpa_supplicant_ctrl_iface_set(wpa_s, buf + 4))
reply_len = -1;
} else if (os_strncmp(buf, "GET ", 4) == 0) {
reply_len = wpa_supplicant_ctrl_iface_get(wpa_s, buf + 4,
reply, reply_size);
} else if (os_strcmp(buf, "REASSOCIATE") == 0) {
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED)
reply_len = -1;
else
wpas_request_connection(wpa_s);
} else if (os_strcmp(buf, "RECONNECT") == 0) {
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED)
reply_len = -1;
else if (wpa_s->disconnected)
wpas_request_connection(wpa_s);
} else if (os_strcmp(buf, "DISCONNECT") == 0) {
wpas_request_disconnection(wpa_s);
} else if (os_strcmp(buf, "SCAN") == 0) {
wpas_ctrl_scan(wpa_s, NULL, reply, reply_size, &reply_len);
} else if (os_strncmp(buf, "SCAN ", 5) == 0) {
wpas_ctrl_scan(wpa_s, buf + 5, reply, reply_size, &reply_len);
} else if (os_strcmp(buf, "SCAN_RESULTS") == 0) {
reply_len = wpa_supplicant_ctrl_iface_scan_results(
} else if (os_strncmp(buf, "SET ", 4) == 0) {
if (wpa_supplicant_ctrl_iface_set(wpa_s, buf + 4))
reply_len = -1;
} else if (os_strncmp(buf, "GET ", 4) == 0) {
reply_len = wpa_supplicant_ctrl_iface_get(wpa_s, buf + 4,
reply, reply_size);
} else if (os_strcmp(buf, "REASSOCIATE") == 0) {
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED)
reply_len = -1;
else
wpas_request_connection(wpa_s);
} else if (os_strcmp(buf, "RECONNECT") == 0) {
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED)
reply_len = -1;
else if (wpa_s->disconnected)
wpas_request_connection(wpa_s);
} else if (os_strcmp(buf, "DISCONNECT") == 0) {
wpas_request_disconnection(wpa_s);
} else if (os_strcmp(buf, "SCAN") == 0) {
wpas_ctrl_scan(wpa_s, NULL, reply, reply_size, &reply_len);
} else if (os_strncmp(buf, "SCAN ", 5) == 0) {
wpas_ctrl_scan(wpa_s, buf + 5, reply, reply_size, &reply_len);
} else if (os_strcmp(buf, "SCAN_RESULTS") == 0) {
reply_len = wpa_supplicant_ctrl_iface_scan_results(
wpa_s, reply, reply_size);
} else if (os_strcmp(buf, "ABORT_SCAN") == 0) {
if (wpas_abort_ongoing_scan(wpa_s) < 0)
reply_len = -1;
} else if (os_strncmp(buf, "SELECT_NETWORK ", 15) == 0) {
if (wpa_supplicant_ctrl_iface_select_network(wpa_s, buf + 15))
reply_len = -1;
} else if (os_strncmp(buf, "ENABLE_NETWORK ", 15) == 0) {
if (wpa_supplicant_ctrl_iface_enable_network(wpa_s, buf + 15))
reply_len = -1;
} else if (os_strncmp(buf, "DISABLE_NETWORK ", 16) == 0) {
if (wpa_supplicant_ctrl_iface_disable_network(wpa_s, buf + 16))
reply_len = -1;
} else if (os_strcmp(buf, "ADD_NETWORK") == 0) {
reply_len = wpa_supplicant_ctrl_iface_add_network(
} else if (os_strcmp(buf, "ABORT_SCAN") == 0) {
if (wpas_abort_ongoing_scan(wpa_s) < 0)
reply_len = -1;
} else if (os_strncmp(buf, "SELECT_NETWORK ", 15) == 0) {
if (wpa_supplicant_ctrl_iface_select_network(wpa_s, buf + 15))
reply_len = -1;
} else if (os_strncmp(buf, "ENABLE_NETWORK ", 15) == 0) {
if (wpa_supplicant_ctrl_iface_enable_network(wpa_s, buf + 15))
reply_len = -1;
} else if (os_strncmp(buf, "DISABLE_NETWORK ", 16) == 0) {
if (wpa_supplicant_ctrl_iface_disable_network(wpa_s, buf + 16))
reply_len = -1;
} else if (os_strcmp(buf, "ADD_NETWORK") == 0) {
reply_len = wpa_supplicant_ctrl_iface_add_network(
wpa_s, reply, reply_size);
} else if (os_strncmp(buf, "REMOVE_NETWORK ", 15) == 0) {
if (wpa_supplicant_ctrl_iface_remove_network(wpa_s, buf + 15))
reply_len = -1;
} else if (os_strncmp(buf, "SET_NETWORK ", 12) == 0) {
if (wpa_supplicant_ctrl_iface_set_network(wpa_s, buf + 12))
reply_len = -1;
} else if (os_strncmp(buf, "GET_NETWORK ", 12) == 0) {
reply_len = wpa_supplicant_ctrl_iface_get_network(
} else if (os_strncmp(buf, "REMOVE_NETWORK ", 15) == 0) {
if (wpa_supplicant_ctrl_iface_remove_network(wpa_s, buf + 15))
reply_len = -1;
} else if (os_strncmp(buf, "SET_NETWORK ", 12) == 0) {
if (wpa_supplicant_ctrl_iface_set_network(wpa_s, buf + 12))
reply_len = -1;
} else if (os_strncmp(buf, "GET_NETWORK ", 12) == 0) {
reply_len = wpa_supplicant_ctrl_iface_get_network(
wpa_s, buf + 12, reply, reply_size);
} else if (os_strncmp(buf, "SCAN_SSID ", 10) == 0) {
if (wpa_supplicant_ctrl_iface_scan_ssid(wpa_s, buf + 10) < 0)
reply_len = -1;
} else if (os_strncmp(buf, "NDP_PREQ ", 9) == 0) {
if (wpa_supplicant_ctrl_iface_ndp_preq(wpa_s, buf + 9) < 0)
reply_len = -1;
} else if (os_strncmp(buf, "SCAN_SSID ", 10) == 0) {
if (wpa_supplicant_ctrl_iface_scan_ssid(wpa_s, buf + 10) < 0)
reply_len = -1;
} else if (os_strncmp(buf, "NDP_PREQ ", 9) == 0) {
if (wpa_supplicant_ctrl_iface_ndp_preq(wpa_s, buf + 9) < 0)
reply_len = -1;
#if defined(SOFT_AP_BSS_MAX_IDLE)
} else if (os_strncmp(buf, "BSS_MAX_IDLE ", 13) == 0) {
if (wpa_supplicant_ctrl_iface_bss_max_idle(wpa_s, buf + 13) < 0)
reply_len = -1;
} else if (os_strncmp(buf, "BSS_MAX_IDLE ", 13) == 0) {
if (wpa_supplicant_ctrl_iface_bss_max_idle(wpa_s, buf + 13) < 0)
reply_len = -1;
#endif /* defined(SOFT_AP_BSS_MAX_IDLE) */
#ifdef CONFIG_AP
} else if (os_strncmp(buf, "DEAUTHENTICATE ", 15) == 0) {
if (ap_ctrl_iface_sta_deauthenticate(wpa_s, buf + 15))
reply_len = -1;
} else if (os_strncmp(buf, "DISASSOCIATE ", 13) == 0) {
if (ap_ctrl_iface_sta_disassociate(wpa_s, buf + 13))
reply_len = -1;
} else if (os_strncmp(buf, "DEAUTHENTICATE ", 15) == 0) {
if (ap_ctrl_iface_sta_deauthenticate(wpa_s, buf + 15))
reply_len = -1;
} else if (os_strncmp(buf, "DISASSOCIATE ", 13) == 0) {
if (ap_ctrl_iface_sta_disassociate(wpa_s, buf + 13))
reply_len = -1;
#endif /* CONFIG_AP */
#ifdef CONFIG_WPS
} else if (os_strcmp(buf, "WPS_PBC") == 0) {
int res = wpa_supplicant_ctrl_iface_wps_pbc(wpa_s, NULL);
if (res == -2) {
os_memcpy(reply, "FAIL-PBC-OVERLAP\n", 17);
reply_len = 17;
} else if (res)
reply_len = -1;
} else if (os_strcmp(buf, "WPS_PBC") == 0) {
int res = wpa_supplicant_ctrl_iface_wps_pbc(wpa_s, NULL);
if (res == -2) {
os_memcpy(reply, "FAIL-PBC-OVERLAP\n", 17);
reply_len = 17;
} else if (res)
reply_len = -1;
#endif
} else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
reply_len = wpa_supplicant_vendor_cmd(wpa_s, buf + 7, reply,
reply_size);
} else {
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
}
#else
} else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
reply_len = wpa_supplicant_vendor_cmd(wpa_s, buf + 7, reply,
reply_size);
} else if (os_strncmp(buf, "BSS_EXPIRE_AGE ", 15) == 0) {
if (wpa_supplicant_ctrl_iface_bss_expire_age(wpa_s, buf + 15))
reply_len = -1;
} else if (os_strncmp(buf, "BSS_EXPIRE_COUNT ", 17) == 0) {
if (wpa_supplicant_ctrl_iface_bss_expire_count(wpa_s,
buf + 17))
reply_len = -1;
} else if (os_strncmp(buf, "BSS_FLUSH ", 10) == 0) {
wpa_supplicant_ctrl_iface_bss_flush(wpa_s, buf + 10);
} else {
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
}

#else /* !NRC_WPA_SUPP */

if (os_strcmp(buf, "PING") == 0) {
os_memcpy(reply, "PONG\n", 5);
reply_len = 5;
Expand Down

0 comments on commit d0ba3f1

Please sign in to comment.