xiaoxiang781216 commented on code in PR #20751: URL: https://github.com/apache/nuttx/pull/20751#discussion_r4305493451
########## arch/arm/src/common/Make.defs: ########## @@ -74,3 +74,10 @@ endif CMN_ASRCS += fork.S + +# Morse Micro Wi-Fi HaLow host library (pre-built, Cortex-M only) + +ifeq ($(CONFIG_IEEE80211_MORSE),y) + include $(TOPDIR)$(DELIM)drivers$(DELIM)wireless$(DELIM)ieee80211$(DELIM)morse$(DELIM)Sdk.mk Review Comment: why add a special wifi driver in the common makefile ########## drivers/wireless/ieee80211/morse/mmport.h: ########## @@ -0,0 +1,37 @@ +/**************************************************************************** + * drivers/wireless/ieee80211/morse/mmport.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/* Port definitions required by the Morse Micro mmosal.h header */ + +#ifndef __DRIVERS_WIRELESS_IEEE80211_MORSE_MMPORT_H +#define __DRIVERS_WIRELESS_IEEE80211_MORSE_MMPORT_H + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define MMPORT_BREAKPOINT() __asm volatile ("bkpt 0\n\t") +#define MMPORT_GET_LR() __builtin_return_address(0) Review Comment: map to return_address ########## drivers/wireless/ieee80211/morse/morse_pktmem.c: ########## @@ -0,0 +1,40 @@ +/**************************************************************************** + * drivers/wireless/ieee80211/morse/morse_pktmem.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/* Build the MM-IoT-SDK heap based packet memory + * allocator (mmpktmem_heap.c, Apache-2.0) as part of the + * driver. The SDK source is located through the include path. + */ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include "mmpktmem_heap.c" Review Comment: why not build mmpktmem_heap.c directly ########## drivers/wireless/ieee80211/morse/morse_mmhal.c: ########## @@ -0,0 +1,439 @@ +/**************************************************************************** + * drivers/wireless/ieee80211/morse/morse_mmhal.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/* Implementation of the Morse Micro Hardware Abstraction Layer (mmhal) used + * by libmorse: SPI transport, control GPIOs, interrupts and access to the + * chip firmware and board configuration file (BCF). + */ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <assert.h> +#include <debug.h> +#include <errno.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include <sys/param.h> + +#include <nuttx/irq.h> +#include <nuttx/spi/spi.h> +#include <nuttx/wireless/morse.h> + +#include "mmhal_core.h" +#include "mmhal_wlan.h" +#include "mmosal.h" +#include "morse.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#if !defined(CONFIG_DEV_RANDOM) && !defined(CONFIG_DEV_URANDOM) +# warning "No random device: WPA3-SAE requires a good entropy source" +#endif + +/* Number of 0xff bytes clocked with CS high to put the chip SPI interface + * in a known state (>= 74 clocks, SD specification 6.4.1.1). + */ + +#define MORSE_TRAINING_BYTES 16 + +#define MORSE_STR_(x) #x +#define MORSE_STR(x) MORSE_STR_(x) Review Comment: use macro from nuttx/macro.h ########## drivers/wireless/ieee80211/morse/morse_regdb.c: ########## @@ -0,0 +1,40 @@ +/**************************************************************************** + * drivers/wireless/ieee80211/morse/morse_regdb.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/* Build the MM-IoT-SDK regulatory database (channel lists per + * country) (mmregdb.c, Apache-2.0) as part of the + * driver. The SDK source is located through the include path. + */ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include "mmregdb.c" Review Comment: why not build mmregdb.c directly ########## drivers/wireless/ieee80211/morse/Sdk.mk: ########## @@ -0,0 +1,48 @@ +############################################################################ +# drivers/wireless/ieee80211/morse/Sdk.mk Review Comment: why not merge into Make.defs ########## drivers/wireless/ieee80211/morse/morse_compat.c: ########## @@ -0,0 +1,99 @@ +/**************************************************************************** + * drivers/wireless/ieee80211/morse/morse_compat.c Review Comment: why not move to libc? so, other similar prebuilt libraries could fix the same problem too. ########## drivers/wireless/ieee80211/morse/morse_mmhal.c: ########## @@ -0,0 +1,439 @@ +/**************************************************************************** + * drivers/wireless/ieee80211/morse/morse_mmhal.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/* Implementation of the Morse Micro Hardware Abstraction Layer (mmhal) used + * by libmorse: SPI transport, control GPIOs, interrupts and access to the + * chip firmware and board configuration file (BCF). + */ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <assert.h> +#include <debug.h> +#include <errno.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include <sys/param.h> + +#include <nuttx/irq.h> +#include <nuttx/spi/spi.h> +#include <nuttx/wireless/morse.h> + +#include "mmhal_core.h" +#include "mmhal_wlan.h" +#include "mmosal.h" +#include "morse.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#if !defined(CONFIG_DEV_RANDOM) && !defined(CONFIG_DEV_URANDOM) Review Comment: why not change to dependence -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
