mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
risc-v/bl602: Support AP and STA as independent network interface device
Signed-off-by: Virus.V <virusv@live.com>
This commit is contained in:
@@ -92,11 +92,14 @@ config BL602_WIRELESS_CONTRY_CODE
|
||||
depends on BL602_WIRELESS
|
||||
default "CN"
|
||||
|
||||
config BL602_NET_MULTI_INTERFACE
|
||||
bool "STA and AP as independent interfaces"
|
||||
depends on BL602_WIRELESS
|
||||
default n
|
||||
|
||||
config BL602_BLE_CONTROLLER
|
||||
bool "ble controller support"
|
||||
default n
|
||||
depends on PSEUDOTERM
|
||||
depends on PSEUDOTERM_SUSV1
|
||||
depends on !DISABLE_MQUEUE
|
||||
depends on SCHED_HPWORK
|
||||
depends on BL602_WIRELESS
|
||||
|
||||
@@ -83,10 +83,9 @@ CHIP_CSRCS += bl602_glb.c bl602_gpio.c bl602_hbn.c bl602_systemreset.c
|
||||
|
||||
ifeq ($(CONFIG_BL602_WIRELESS),y)
|
||||
WIRELESS_DRV_UNPACK = bl_blob
|
||||
WIRELESS_DRV_VERSION = v1.6.19
|
||||
WIRELESS_DRV_ID = dev_irq
|
||||
WIRELESS_DRV_ZIP = $(WIRELESS_DRV_ID).zip
|
||||
WIRELESS_DRV_URL = https://github.com/bouffalolab/bl_blob/archive
|
||||
WIRELESS_DRV_VERSION = 1.6.20
|
||||
WIRELESS_DRV_ZIP = v$(WIRELESS_DRV_VERSION).zip
|
||||
WIRELESS_DRV_URL = https://github.com/bouffalolab/bl_blob/archive/refs/heads
|
||||
|
||||
$(WIRELESS_DRV_ZIP):
|
||||
$(Q) echo "Downloading: BL602 Wireless Drivers"
|
||||
@@ -96,7 +95,7 @@ chip/$(WIRELESS_DRV_UNPACK): $(WIRELESS_DRV_ZIP)
|
||||
$(Q) echo "Unpacking: BL602 Wireless Drivers"
|
||||
$(Q) mkdir -p chip/$(WIRELESS_DRV_UNPACK)
|
||||
$(Q) unzip -oqq chip/$(WIRELESS_DRV_ZIP) -d chip/
|
||||
$(Q) mv chip/$(WIRELESS_DRV_UNPACK)-$(WIRELESS_DRV_ID)/* chip/$(WIRELESS_DRV_UNPACK)
|
||||
$(Q) mv chip/$(WIRELESS_DRV_UNPACK)-$(WIRELESS_DRV_VERSION)/* chip/$(WIRELESS_DRV_UNPACK)
|
||||
$(Q) touch chip/$(WIRELESS_DRV_UNPACK)
|
||||
|
||||
context:: chip/$(WIRELESS_DRV_UNPACK)
|
||||
@@ -105,10 +104,10 @@ clean_context::
|
||||
$(call DELFILE, chip/$(WIRELESS_DRV_ZIP))
|
||||
$(call DELDIR, chip/$(WIRELESS_DRV_UNPACK))
|
||||
|
||||
INCLUDES += $(shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)$(WIRELESS_DRV_UNPACK)$(DELIM)includes$(DELIM)$(WIRELESS_DRV_VERSION)$(DELIM)BL602$(DELIM)nuttx)
|
||||
INCLUDES += $(shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)$(WIRELESS_DRV_UNPACK)$(DELIM)includes$(DELIM)BL602$(DELIM)nuttx)
|
||||
CHIP_CSRCS += bl602_netdev.c
|
||||
|
||||
EXTRA_LIBPATHS += -L $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)$(WIRELESS_DRV_UNPACK)$(DELIM)libs$(DELIM)$(WIRELESS_DRV_VERSION)$(DELIM)BL602$(DELIM)nuttx
|
||||
EXTRA_LIBPATHS += -L $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)$(WIRELESS_DRV_UNPACK)$(DELIM)libs$(DELIM)BL602$(DELIM)nuttx
|
||||
EXTRA_LIBS += -lbl602_wifi -lblecontroller
|
||||
|
||||
# Due to some Wi-Fi related libraries, the option is need to avoid linking too much
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -100,13 +100,14 @@ void bl602_netdev_free_txbuf(uint8_t *buf);
|
||||
* event: notify type, tx done or received new data
|
||||
* data: The data of the event, may be NULL
|
||||
* len: data length
|
||||
* opaque: customer data
|
||||
*
|
||||
* Returned Value:
|
||||
* OK on success; a negated errno on failure
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int bl602_net_notify(uint32_t event, uint8_t *data, int len);
|
||||
int bl602_net_notify(uint32_t event, uint8_t *data, int len, void *opaque);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: bl602_net_event
|
||||
|
||||
@@ -3,6 +3,10 @@ OUTPUT_ARCH( "riscv" )
|
||||
ENTRY( bl602_start )
|
||||
|
||||
__EM_SIZE = DEFINED(ble_controller_init) ? 8K : 0K;
|
||||
__RFTLV_SIZE_OFFSET = 1K;
|
||||
__RFTLV_SIZE_HOLE = 2K;
|
||||
__RFTLV_HEAD1_H = (0x46524C42); /* BLRF */
|
||||
__RFTLV_HEAD1_L = (0x41524150); /* PAPA */
|
||||
|
||||
MEMORY
|
||||
{
|
||||
@@ -23,6 +27,17 @@ SECTIONS
|
||||
KEEP (*(SORT_NONE(.init)))
|
||||
} > flash
|
||||
|
||||
/* value for rftlv */
|
||||
|
||||
.rftlv.tool :
|
||||
{
|
||||
. = ORIGIN(flash) + __RFTLV_SIZE_OFFSET;
|
||||
PROVIDE( _ld_symbol_rftlv_address = . );
|
||||
LONG(__RFTLV_HEAD1_H);
|
||||
LONG(__RFTLV_HEAD1_L);
|
||||
. = ORIGIN(flash) + __RFTLV_SIZE_OFFSET + __RFTLV_SIZE_HOLE;
|
||||
} > flash
|
||||
|
||||
.text :
|
||||
{
|
||||
PROVIDE(_stext = .);
|
||||
|
||||
@@ -94,7 +94,7 @@ static struct work_s g_ble_hci_rx_work;
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_BL602_WIRELESS)
|
||||
extern int bl602_net_initialize(int intf);
|
||||
extern int bl602_net_initialize(void);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BL602_BLE_CONTROLLER)
|
||||
@@ -274,7 +274,7 @@ int bl602_bringup(void)
|
||||
#ifdef CONFIG_BL602_WIRELESS
|
||||
bl602_set_em_sel(BL602_GLB_EM_8KB);
|
||||
|
||||
bl602_net_initialize(0);
|
||||
bl602_net_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTC_DRIVER
|
||||
|
||||
Reference in New Issue
Block a user