[GitHub] [nuttx] masayuki2009 commented on pull request #7706: Fix devif/ipv4_input.c:405:1: warning: label ‘done’ defined but not used [-Wunused-label]
masayuki2009 commented on PR #7706: URL: https://github.com/apache/nuttx/pull/7706#issuecomment-1328185591 @xiaoxiang781216 Should we need to fix the CI as well? -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7678: drivers/segger: Add Segger RTT stream support
xiaoxiang781216 commented on code in PR #7678: URL: https://github.com/apache/nuttx/pull/7678#discussion_r1032878323 ## drivers/segger/stream_rtt.c: ## @@ -0,0 +1,192 @@ +/ + * drivers/segger/stream_rtt.c + * + * 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. + * + / + +/ + * Included Files + / + +#include +#include + +#include +#include +#include +#include + +#include + +/ + * Private Functions + / + +/ + * Name: rttstream_putc + / + +static void rttstream_putc(FAR struct lib_outstream_s *this, int ch) +{ + FAR struct lib_rttoutstream_s *stream = + (FAR struct lib_rttoutstream_s *)this; + stream->public.nput += SEGGER_RTT_PutChar(stream->channel, ch); +} + +/ + * Name: rttstream_puts + / + +static int rttstream_puts(FAR struct lib_outstream_s *this, + FAR const void *buf, int len) +{ + FAR struct lib_rttoutstream_s *stream = +(FAR struct lib_rttoutstream_s *)this; + int ret = SEGGER_RTT_Write(stream->channel, buf, len); + stream->public.nput += ret; + return ret; +} + +/ + * Name: rttstream_getc + / + +static int rttstream_getc(FAR struct lib_instream_s *this) +{ + FAR struct lib_rttinstream_s *stream = +(FAR struct lib_rttinstream_s *)this; + int ch = -1; + + DEBUGASSERT(stream); + stream->public.nget += SEGGER_RTT_Read(stream->channel, , 1); + return ch; +} + +/ + * Name: rttstream_gets + / + +static int rttstream_gets(FAR struct lib_instream_s *this, + FAR void * buffer, int size) +{ + FAR struct lib_rttinstream_s *stream = +(FAR struct lib_rttinstream_s *)this; + int ret; + + DEBUGASSERT(stream); + ret = SEGGER_RTT_Read(stream->channel, buffer, size); + stream->public.nget += ret; + return ret; +} + +/ + * Public Functions + / + +/ + * Name: lib_rttoutstream_open + * + * Description: + * Initializes a stream for use with the configured RTT interface. + * + * Input Parameters: + * stream - User allocated, uninitialized instance of struct + *lib_rttoutstream_s to be initialized. + * channel - SEGGER RTT channel number + * bufsize - Size of the RTT buffer + * + * Returned Value: + * None (User allocated instance initialized). + * + / + +void lib_rttoutstream_open(FAR struct lib_rttoutstream_s *stream, + int channel, size_t bufsize) +{ + if (channel) +{ + stream->buffer = (FAR char *)kmm_malloc(bufsize); + DEBUGASSERT(stream->buffer); + sprintf(stream->name, "rtt%d", channel); + SEGGER_RTT_ConfigUpBuffer(channel, stream->name, stream->buffer, +bufsize, SEGGER_RTT_MODE_DEFAULT); +} + + stream->public.put = rttstream_putc; + stream->public.puts = rttstream_puts; + stream->public.flush =
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7678: drivers/segger: Add Segger RTT stream support
xiaoxiang781216 commented on code in PR #7678: URL: https://github.com/apache/nuttx/pull/7678#discussion_r1032878286 ## drivers/segger/stream_rtt.c: ## @@ -0,0 +1,192 @@ +/ + * drivers/segger/stream_rtt.c + * + * 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. + * + / + +/ + * Included Files + / + +#include +#include + +#include +#include +#include +#include + +#include + +/ + * Private Functions + / + +/ + * Name: rttstream_putc + / + +static void rttstream_putc(FAR struct lib_outstream_s *this, int ch) +{ + FAR struct lib_rttoutstream_s *stream = + (FAR struct lib_rttoutstream_s *)this; + stream->public.nput += SEGGER_RTT_PutChar(stream->channel, ch); +} + +/ + * Name: rttstream_puts + / + +static int rttstream_puts(FAR struct lib_outstream_s *this, + FAR const void *buf, int len) +{ + FAR struct lib_rttoutstream_s *stream = +(FAR struct lib_rttoutstream_s *)this; + int ret = SEGGER_RTT_Write(stream->channel, buf, len); + stream->public.nput += ret; + return ret; +} + +/ + * Name: rttstream_getc + / + +static int rttstream_getc(FAR struct lib_instream_s *this) +{ + FAR struct lib_rttinstream_s *stream = +(FAR struct lib_rttinstream_s *)this; + int ch = -1; + + DEBUGASSERT(stream); + stream->public.nget += SEGGER_RTT_Read(stream->channel, , 1); + return ch; +} + +/ + * Name: rttstream_gets + / + +static int rttstream_gets(FAR struct lib_instream_s *this, + FAR void * buffer, int size) +{ + FAR struct lib_rttinstream_s *stream = +(FAR struct lib_rttinstream_s *)this; + int ret; + + DEBUGASSERT(stream); + ret = SEGGER_RTT_Read(stream->channel, buffer, size); + stream->public.nget += ret; + return ret; +} + +/ + * Public Functions + / + +/ + * Name: lib_rttoutstream_open + * + * Description: + * Initializes a stream for use with the configured RTT interface. + * + * Input Parameters: + * stream - User allocated, uninitialized instance of struct + *lib_rttoutstream_s to be initialized. + * channel - SEGGER RTT channel number + * bufsize - Size of the RTT buffer + * + * Returned Value: + * None (User allocated instance initialized). + * + / + +void lib_rttoutstream_open(FAR struct lib_rttoutstream_s *stream, + int channel, size_t bufsize) Review Comment: or add below before line 122: bufsize = bufsize ? bufsize : SEGGER_BUFFER_SIZE_UP; -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 opened a new pull request, #7706: Fix devif/ipv4_input.c:405:1: warning: label ‘done’ defined but not used [-Wunused-label]
xiaoxiang781216 opened a new pull request, #7706: URL: https://github.com/apache/nuttx/pull/7706 ## Summary ## Impact ## Testing -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 opened a new pull request, #7705: Don't download tarballs if a local git repo found
xiaoxiang781216 opened a new pull request, #7705: URL: https://github.com/apache/nuttx/pull/7705 ## Summary ## Impact Fix warning ## Testing Pass CI -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 opened a new pull request, #7704: drivers/segger: Refine Kconfig option
xiaoxiang781216 opened a new pull request, #7704: URL: https://github.com/apache/nuttx/pull/7704 ## Summary 1. Add SEGGER_SYSVIEW_RTT_CHANNEL option 2. SEGGER_RTT_BUFFER_SIZE_UP always default to 1KB 3. SEGGER_SYSVIEW_RTT_BUFFER_SIZE default to SEGGER_RTT_BUFFER_SIZE_UP ## Impact segger config ## Testing Pass CI -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7678: drivers/segger: Add Segger RTT stream support
xiaoxiang781216 commented on code in PR #7678: URL: https://github.com/apache/nuttx/pull/7678#discussion_r1032870655 ## drivers/segger/stream_rtt.c: ## @@ -0,0 +1,192 @@ +/ + * drivers/segger/stream_rtt.c + * + * 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. + * + / + +/ + * Included Files + / + +#include +#include + +#include +#include +#include +#include + +#include + +/ + * Private Functions + / + +/ + * Name: rttstream_putc + / + +static void rttstream_putc(FAR struct lib_outstream_s *this, int ch) +{ + FAR struct lib_rttoutstream_s *stream = + (FAR struct lib_rttoutstream_s *)this; + stream->public.nput += SEGGER_RTT_PutChar(stream->channel, ch); +} + +/ + * Name: rttstream_puts + / + +static int rttstream_puts(FAR struct lib_outstream_s *this, + FAR const void *buf, int len) +{ + FAR struct lib_rttoutstream_s *stream = +(FAR struct lib_rttoutstream_s *)this; + int ret = SEGGER_RTT_Write(stream->channel, buf, len); + stream->public.nput += ret; + return ret; +} + +/ + * Name: rttstream_getc + / + +static int rttstream_getc(FAR struct lib_instream_s *this) +{ + FAR struct lib_rttinstream_s *stream = +(FAR struct lib_rttinstream_s *)this; + int ch = -1; + + DEBUGASSERT(stream); + stream->public.nget += SEGGER_RTT_Read(stream->channel, , 1); + return ch; +} + +/ + * Name: rttstream_gets + / + +static int rttstream_gets(FAR struct lib_instream_s *this, + FAR void * buffer, int size) +{ + FAR struct lib_rttinstream_s *stream = +(FAR struct lib_rttinstream_s *)this; + int ret; + + DEBUGASSERT(stream); + ret = SEGGER_RTT_Read(stream->channel, buffer, size); + stream->public.nget += ret; + return ret; +} + +/ + * Public Functions + / + +/ + * Name: lib_rttoutstream_open + * + * Description: + * Initializes a stream for use with the configured RTT interface. + * + * Input Parameters: + * stream - User allocated, uninitialized instance of struct + *lib_rttoutstream_s to be initialized. + * channel - SEGGER RTT channel number + * bufsize - Size of the RTT buffer + * + * Returned Value: + * None (User allocated instance initialized). + * + / + +void lib_rttoutstream_open(FAR struct lib_rttoutstream_s *stream, + int channel, size_t bufsize) +{ + if (channel) +{ + stream->buffer = (FAR char *)kmm_malloc(bufsize); + DEBUGASSERT(stream->buffer); + sprintf(stream->name, "rtt%d", channel); + SEGGER_RTT_ConfigUpBuffer(channel, stream->name, stream->buffer, +bufsize, SEGGER_RTT_MODE_DEFAULT); +} + + stream->public.put = rttstream_putc; + stream->public.puts = rttstream_puts; + stream->public.flush =
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7678: drivers/segger: Add Segger RTT stream support
xiaoxiang781216 commented on code in PR #7678: URL: https://github.com/apache/nuttx/pull/7678#discussion_r1032870628 ## drivers/segger/stream_rtt.c: ## @@ -0,0 +1,192 @@ +/ + * drivers/segger/stream_rtt.c + * + * 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. + * + / + +/ + * Included Files + / + +#include +#include + +#include +#include +#include +#include + +#include + +/ + * Private Functions + / + +/ + * Name: rttstream_putc + / + +static void rttstream_putc(FAR struct lib_outstream_s *this, int ch) +{ + FAR struct lib_rttoutstream_s *stream = + (FAR struct lib_rttoutstream_s *)this; + stream->public.nput += SEGGER_RTT_PutChar(stream->channel, ch); +} + +/ + * Name: rttstream_puts + / + +static int rttstream_puts(FAR struct lib_outstream_s *this, + FAR const void *buf, int len) +{ + FAR struct lib_rttoutstream_s *stream = +(FAR struct lib_rttoutstream_s *)this; + int ret = SEGGER_RTT_Write(stream->channel, buf, len); + stream->public.nput += ret; + return ret; +} + +/ + * Name: rttstream_getc + / + +static int rttstream_getc(FAR struct lib_instream_s *this) +{ + FAR struct lib_rttinstream_s *stream = +(FAR struct lib_rttinstream_s *)this; + int ch = -1; + + DEBUGASSERT(stream); + stream->public.nget += SEGGER_RTT_Read(stream->channel, , 1); + return ch; +} + +/ + * Name: rttstream_gets + / + +static int rttstream_gets(FAR struct lib_instream_s *this, + FAR void * buffer, int size) +{ + FAR struct lib_rttinstream_s *stream = +(FAR struct lib_rttinstream_s *)this; + int ret; + + DEBUGASSERT(stream); + ret = SEGGER_RTT_Read(stream->channel, buffer, size); + stream->public.nget += ret; + return ret; +} + +/ + * Public Functions + / + +/ + * Name: lib_rttoutstream_open + * + * Description: + * Initializes a stream for use with the configured RTT interface. + * + * Input Parameters: + * stream - User allocated, uninitialized instance of struct + *lib_rttoutstream_s to be initialized. + * channel - SEGGER RTT channel number + * bufsize - Size of the RTT buffer + * + * Returned Value: + * None (User allocated instance initialized). + * + / + +void lib_rttoutstream_open(FAR struct lib_rttoutstream_s *stream, + int channel, size_t bufsize) Review Comment: should we use SEGGER_BUFFER_SIZE_UP directly? -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7678: drivers/segger: Add Segger RTT stream support
xiaoxiang781216 commented on code in PR #7678: URL: https://github.com/apache/nuttx/pull/7678#discussion_r1032868682 ## drivers/segger/stream_rtt.c: ## @@ -0,0 +1,192 @@ +/ + * drivers/segger/stream_rtt.c + * + * 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. + * + / + +/ + * Included Files + / + +#include +#include + +#include +#include +#include +#include + +#include + +/ + * Private Functions + / + +/ + * Name: rttstream_putc + / + +static void rttstream_putc(FAR struct lib_outstream_s *this, int ch) +{ + FAR struct lib_rttoutstream_s *stream = + (FAR struct lib_rttoutstream_s *)this; + stream->public.nput += SEGGER_RTT_PutChar(stream->channel, ch); +} + +/ + * Name: rttstream_puts + / + +static int rttstream_puts(FAR struct lib_outstream_s *this, + FAR const void *buf, int len) +{ + FAR struct lib_rttoutstream_s *stream = +(FAR struct lib_rttoutstream_s *)this; + int ret = SEGGER_RTT_Write(stream->channel, buf, len); + stream->public.nput += ret; + return ret; +} + +/ + * Name: rttstream_getc + / + +static int rttstream_getc(FAR struct lib_instream_s *this) +{ + FAR struct lib_rttinstream_s *stream = +(FAR struct lib_rttinstream_s *)this; + int ch = -1; + + DEBUGASSERT(stream); + stream->public.nget += SEGGER_RTT_Read(stream->channel, , 1); + return ch; +} + +/ + * Name: rttstream_gets + / + +static int rttstream_gets(FAR struct lib_instream_s *this, + FAR void * buffer, int size) +{ + FAR struct lib_rttinstream_s *stream = +(FAR struct lib_rttinstream_s *)this; + int ret; + + DEBUGASSERT(stream); + ret = SEGGER_RTT_Read(stream->channel, buffer, size); + stream->public.nget += ret; + return ret; +} + +/ + * Public Functions + / + +/ + * Name: lib_rttoutstream_open + * + * Description: + * Initializes a stream for use with the configured RTT interface. + * + * Input Parameters: + * stream - User allocated, uninitialized instance of struct + *lib_rttoutstream_s to be initialized. + * channel - SEGGER RTT channel number + * bufsize - Size of the RTT buffer + * + * Returned Value: + * None (User allocated instance initialized). + * + / + +void lib_rttoutstream_open(FAR struct lib_rttoutstream_s *stream, + int channel, size_t bufsize) +{ + if (channel) +{ + stream->buffer = (FAR char *)kmm_malloc(bufsize); + DEBUGASSERT(stream->buffer); + sprintf(stream->name, "rtt%d", channel); + SEGGER_RTT_ConfigUpBuffer(channel, stream->name, stream->buffer, +bufsize, SEGGER_RTT_MODE_DEFAULT); +} + + stream->public.put = rttstream_putc; + stream->public.puts = rttstream_puts; + stream->public.flush =
[nuttx] 02/02: net/devif/ip: build l2 header on the IP layer
This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git commit 6fa60627ebea4a8028190fc6a2e05e1c13c03b47 Author: chao an AuthorDate: Sun Nov 27 02:13:21 2022 +0800 net/devif/ip: build l2 header on the IP layer Signed-off-by: chao an --- arch/arm/src/c5471/c5471_ethernet.c | 35 +--- arch/arm/src/gd32f4/gd32f4xx_enet.c | 9 +- arch/arm/src/imx6/imx_enet.c | 35 +--- arch/arm/src/imxrt/imxrt_enet.c | 35 +--- arch/arm/src/kinetis/kinetis_enet.c | 35 +--- arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c | 35 +--- arch/arm/src/lpc43xx/lpc43_ethernet.c | 35 +--- arch/arm/src/lpc54xx/lpc54_ethernet.c | 27 +--- arch/arm/src/rtl8720c/amebaz_netdev.c | 15 - arch/arm/src/s32k1xx/s32k1xx_enet.c | 35 +--- arch/arm/src/s32k3xx/s32k3xx_emac.c | 35 +--- arch/arm/src/sam34/sam_emac.c | 35 +--- arch/arm/src/sama5/sam_emaca.c| 35 +--- arch/arm/src/sama5/sam_emacb.c| 35 +--- arch/arm/src/sama5/sam_gmac.c | 35 +--- arch/arm/src/samd5e5/sam_gmac.c | 35 +--- arch/arm/src/samv7/sam_emac.c | 35 +--- arch/arm/src/stm32/stm32_eth.c| 35 +--- arch/arm/src/stm32f7/stm32_ethernet.c | 35 +--- arch/arm/src/stm32h7/stm32_ethernet.c | 35 +--- arch/arm/src/tiva/lm/lm3s_ethernet.c | 38 ++ arch/arm/src/tiva/tm4c/tm4c_ethernet.c| 35 +--- arch/hc/src/m9s12/m9s12_ethernet.c| 35 +--- arch/mips/src/pic32mx/pic32mx_ethernet.c | 37 ++--- arch/mips/src/pic32mz/pic32mz_ethernet.c | 39 +-- arch/misoc/src/common/misoc_net.c | 35 +--- arch/renesas/src/rx65n/rx65n_eth.c| 37 ++--- arch/risc-v/src/bl602/bl602_netdev.c | 29 + arch/risc-v/src/esp32c3/esp32c3_wlan.c| 35 +--- arch/risc-v/src/litex/litex_emac.c| 35 +--- arch/risc-v/src/mpfs/mpfs_ethernet.c | 33 +-- arch/sim/src/sim/sim_netdriver.c | 27 +--- arch/xtensa/src/esp32/esp32_emac.c| 35 +--- arch/xtensa/src/esp32/esp32_wlan.c| 35 +--- arch/z80/src/ez80/ez80_emac.c | 35 +--- drivers/net/dm90x0.c | 37 ++--- drivers/net/enc28j60.c| 35 +--- drivers/net/encx24j600.c | 35 +--- drivers/net/ftmac100.c| 35 +--- drivers/net/lan91c111.c | 21 +--- drivers/net/rpmsgdrv.c| 21 +--- drivers/net/skeleton.c| 29 + drivers/net/tun.c | 18 +-- drivers/net/w5500.c | 21 +--- drivers/usbdev/cdcecm.c | 29 + drivers/usbdev/rndis.c| 36 + drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c | 35 +--- net/devif/ipv4_input.c| 22 ++--- net/devif/ipv6_input.c| 10 +- 49 files changed, 77 insertions(+), 1473 deletions(-) diff --git a/arch/arm/src/c5471/c5471_ethernet.c b/arch/arm/src/c5471/c5471_ethernet.c index b7de3b93b1..cb7db0b215 100644 --- a/arch/arm/src/c5471/c5471_ethernet.c +++ b/arch/arm/src/c5471/c5471_ethernet.c @@ -1290,11 +1290,8 @@ static void c5471_receive(struct c5471_driver_s *priv) { ninfo("IPv4 frame\n"); - /* Handle ARP on input then give the IPv4 packet to the network - * layer - */ + /* Receive an IPv4 packet from the network device */ - arp_ipin(dev); ipv4_input(dev); /* If the above function invocation resulted in data that should be @@ -1306,21 +1303,6 @@ static void c5471_receive(struct c5471_driver_s *priv) if (dev->d_len > 0 && (EIM_TXDESC_OWN_HOST & getreg32(priv->c_rxcpudesc)) == 0) { - /* Update the Ethernet header
[nuttx] 01/02: net/arp: add link layer check for arp_out/arp_ipin
This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git commit 81325a8a3d45fedcc03dce97c88ff99945ba9f7f Author: chao an AuthorDate: Sun Nov 27 03:11:22 2022 +0800 net/arp: add link layer check for arp_out/arp_ipin ARP support is only built if the Ethernet link layer is supported. Continue and send the ARP request only if this device uses the Ethernet link layer protocol. Signed-off-by: chao an --- net/arp/arp_ipin.c | 11 +++ net/arp/arp_out.c | 11 +++ 2 files changed, 22 insertions(+) diff --git a/net/arp/arp_ipin.c b/net/arp/arp_ipin.c index 893f80327a..8803301e28 100644 --- a/net/arp/arp_ipin.c +++ b/net/arp/arp_ipin.c @@ -76,6 +76,17 @@ void arp_ipin(FAR struct net_driver_s *dev) { in_addr_t srcipaddr; + /* ARP support is only built if the Ethernet link layer is supported. + * Continue and send the ARP request only if this device uses the + * Ethernet link layer protocol. + */ + + if (dev->d_lltype != NET_LL_ETHERNET && + dev->d_lltype != NET_LL_IEEE80211) +{ + return; +} + /* Only insert/update an entry if the source IP address of the incoming IP * packet comes from a host on the local network. */ diff --git a/net/arp/arp_out.c b/net/arp/arp_out.c index a6dba47420..cf4b57b465 100644 --- a/net/arp/arp_out.c +++ b/net/arp/arp_out.c @@ -137,6 +137,17 @@ void arp_out(FAR struct net_driver_s *dev) in_addr_t destipaddr; int ret; + /* ARP support is only built if the Ethernet link layer is supported. + * Continue and send the ARP request only if this device uses the + * Ethernet link layer protocol. + */ + + if (dev->d_lltype != NET_LL_ETHERNET && + dev->d_lltype != NET_LL_IEEE80211) +{ + return; +} + #if defined(CONFIG_NET_PKT) || defined(CONFIG_NET_ARP_SEND) /* Skip sending ARP requests when the frame to be transmitted was * written into a packet socket.
[nuttx] branch master updated (8850dee746 -> 6fa60627eb)
This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git from 8850dee746 net/devif: move preprocess of txpoll into common code new 81325a8a3d net/arp: add link layer check for arp_out/arp_ipin new 6fa60627eb net/devif/ip: build l2 header on the IP layer The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: arch/arm/src/c5471/c5471_ethernet.c | 35 +--- arch/arm/src/gd32f4/gd32f4xx_enet.c | 9 +- arch/arm/src/imx6/imx_enet.c | 35 +--- arch/arm/src/imxrt/imxrt_enet.c | 35 +--- arch/arm/src/kinetis/kinetis_enet.c | 35 +--- arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c | 35 +--- arch/arm/src/lpc43xx/lpc43_ethernet.c | 35 +--- arch/arm/src/lpc54xx/lpc54_ethernet.c | 27 +--- arch/arm/src/rtl8720c/amebaz_netdev.c | 15 - arch/arm/src/s32k1xx/s32k1xx_enet.c | 35 +--- arch/arm/src/s32k3xx/s32k3xx_emac.c | 35 +--- arch/arm/src/sam34/sam_emac.c | 35 +--- arch/arm/src/sama5/sam_emaca.c| 35 +--- arch/arm/src/sama5/sam_emacb.c| 35 +--- arch/arm/src/sama5/sam_gmac.c | 35 +--- arch/arm/src/samd5e5/sam_gmac.c | 35 +--- arch/arm/src/samv7/sam_emac.c | 35 +--- arch/arm/src/stm32/stm32_eth.c| 35 +--- arch/arm/src/stm32f7/stm32_ethernet.c | 35 +--- arch/arm/src/stm32h7/stm32_ethernet.c | 35 +--- arch/arm/src/tiva/lm/lm3s_ethernet.c | 38 ++ arch/arm/src/tiva/tm4c/tm4c_ethernet.c| 35 +--- arch/hc/src/m9s12/m9s12_ethernet.c| 35 +--- arch/mips/src/pic32mx/pic32mx_ethernet.c | 37 ++--- arch/mips/src/pic32mz/pic32mz_ethernet.c | 39 +-- arch/misoc/src/common/misoc_net.c | 35 +--- arch/renesas/src/rx65n/rx65n_eth.c| 37 ++--- arch/risc-v/src/bl602/bl602_netdev.c | 29 + arch/risc-v/src/esp32c3/esp32c3_wlan.c| 35 +--- arch/risc-v/src/litex/litex_emac.c| 35 +--- arch/risc-v/src/mpfs/mpfs_ethernet.c | 33 +-- arch/sim/src/sim/sim_netdriver.c | 27 +--- arch/xtensa/src/esp32/esp32_emac.c| 35 +--- arch/xtensa/src/esp32/esp32_wlan.c| 35 +--- arch/z80/src/ez80/ez80_emac.c | 35 +--- drivers/net/dm90x0.c | 37 ++--- drivers/net/enc28j60.c| 35 +--- drivers/net/encx24j600.c | 35 +--- drivers/net/ftmac100.c| 35 +--- drivers/net/lan91c111.c | 21 +--- drivers/net/rpmsgdrv.c| 21 +--- drivers/net/skeleton.c| 29 + drivers/net/tun.c | 18 +-- drivers/net/w5500.c | 21 +--- drivers/usbdev/cdcecm.c | 29 + drivers/usbdev/rndis.c| 36 + drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c | 35 +--- net/arp/arp_ipin.c| 11 +++ net/arp/arp_out.c | 11 +++ net/devif/ipv4_input.c| 22 ++--- net/devif/ipv6_input.c| 10 +- 51 files changed, 99 insertions(+), 1473 deletions(-)
[GitHub] [nuttx] xiaoxiang781216 merged pull request #7703: net/devif/ip: build l2 header on the IP layer
xiaoxiang781216 merged PR #7703: URL: https://github.com/apache/nuttx/pull/7703 -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[nuttx] branch master updated (03802dad13 -> 8850dee746)
This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git from 03802dad13 NuttX graduated the Incubator; update repository links add db88554d7d net/devif: add common funtion to build L2 headers before sending add 8850dee746 net/devif: move preprocess of txpoll into common code No new revisions were added by this update. Summary of changes: arch/arm/src/c5471/c5471_ethernet.c | 50 +++- arch/arm/src/gd32f4/gd32f4xx_enet.c | 76 +++ arch/arm/src/imx6/imx_enet.c | 54 +++-- arch/arm/src/imxrt/imxrt_enet.c | 52 +++-- arch/arm/src/imxrt/imxrt_flexcan.c| 23 +++--- arch/arm/src/kinetis/kinetis_enet.c | 52 +++-- arch/arm/src/kinetis/kinetis_flexcan.c| 27 +++ arch/arm/src/lpc17xx_40xx/lpc17_40_can.c | 19 ++--- arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c | 51 ++--- arch/arm/src/lpc43xx/lpc43_ethernet.c | 92 +++ arch/arm/src/lpc54xx/lpc54_ethernet.c | 90 +++--- arch/arm/src/rtl8720c/amebaz_netdev.c | 55 -- arch/arm/src/s32k1xx/s32k1xx_enet.c | 52 +++-- arch/arm/src/s32k1xx/s32k1xx_flexcan.c| 27 +++ arch/arm/src/s32k3xx/s32k3xx_emac.c | 89 -- arch/arm/src/s32k3xx/s32k3xx_flexcan.c| 27 +++ arch/arm/src/sam34/sam_emac.c | 52 +++-- arch/arm/src/sama5/sam_emaca.c| 52 +++-- arch/arm/src/sama5/sam_emacb.c| 52 +++-- arch/arm/src/sama5/sam_gmac.c | 52 +++-- arch/arm/src/samd5e5/sam_gmac.c | 52 +++-- arch/arm/src/samv7/sam_emac.c | 52 +++-- arch/arm/src/stm32/stm32_can_sock.c | 21 +++--- arch/arm/src/stm32/stm32_eth.c| 88 +++--- arch/arm/src/stm32/stm32_fdcan_sock.c | 21 +++--- arch/arm/src/stm32f7/stm32_can_sock.c | 21 +++--- arch/arm/src/stm32f7/stm32_ethernet.c | 88 +++--- arch/arm/src/stm32h7/stm32_ethernet.c | 89 -- arch/arm/src/stm32h7/stm32_fdcan_sock.c | 19 ++--- arch/arm/src/tiva/lm/lm3s_ethernet.c | 48 +--- arch/arm/src/tiva/tm4c/tm4c_ethernet.c| 88 +++--- arch/hc/src/m9s12/m9s12_ethernet.c| 40 +- arch/mips/src/pic32mx/pic32mx_ethernet.c | 77 ++- arch/mips/src/pic32mz/pic32mz_ethernet.c | 77 ++- arch/misoc/src/common/misoc_net.c | 40 +- arch/renesas/src/rx65n/rx65n_eth.c| 88 +++--- arch/risc-v/src/bl602/bl602_netdev.c | 63 +++- arch/risc-v/src/esp32c3/esp32c3_wlan.c| 43 ++- arch/risc-v/src/litex/litex_emac.c| 36 + arch/risc-v/src/mpfs/mpfs_ethernet.c | 52 +++-- arch/sim/src/sim/sim_netdriver.c | 51 + arch/xtensa/src/esp32/esp32_emac.c| 66 arch/xtensa/src/esp32/esp32_wlan.c| 43 ++- arch/z80/src/ez80/ez80_emac.c | 46 +--- drivers/net/dm90x0.c | 56 +++--- drivers/net/enc28j60.c| 47 +--- drivers/net/encx24j600.c | 45 +-- drivers/net/ftmac100.c| 40 +- drivers/net/lan91c111.c | 44 ++- drivers/net/rpmsgdrv.c| 56 +++--- drivers/net/skeleton.c| 45 +-- drivers/net/slip.c| 12 +-- drivers/net/tun.c | 66 ++-- drivers/net/w5500.c | 52 ++--- drivers/usbdev/cdcecm.c | 48 ++-- drivers/usbdev/rndis.c| 42 +-- drivers/usbhost/usbhost_cdcmbim.c | 10 +-- drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c | 50 ++-- include/nuttx/net/netdev.h| 17 - net/arp/arp_poll.c| 2 +- net/devif/devif.h | 32 net/devif/devif_poll.c| 69 +++-- 62 files changed, 743 insertions(+), 2343 deletions(-)
[GitHub] [nuttx] xiaoxiang781216 merged pull request #7701: net/devif: add common funtion to build L2 headers before sending
xiaoxiang781216 merged PR #7701: URL: https://github.com/apache/nuttx/pull/7701 -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on pull request #7702: Fix SAMA5D2 ADC and TSD problems
xiaoxiang781216 commented on PR #7702: URL: https://github.com/apache/nuttx/pull/7702#issuecomment-1328166358 > > @TimJTi it's better to squash the style fix into the first patch > > Ok! Thought it might be better to wait for any other comments. > > Do I still need to do this? You don't need split the change into two patches, since it can be very easy to compare the delta from this button: https://user-images.githubusercontent.com/18066964/204118690-d209b004-191a-4f7c-8416-ef429b4ea666.png;> https://github.com/apache/nuttx/pull/7702/files/248072e02c04a7b0332e3f43c176204f1f2d9076..HEAD -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] TimJTi commented on pull request #7702: Fix SAMA5D2 ADC and TSD problems
TimJTi commented on PR #7702: URL: https://github.com/apache/nuttx/pull/7702#issuecomment-1328120305 > @TimJTi it's better to squash the style fix into the first patch Ok! Thought it might be better to wait for any other comments. Do I still need to do this? -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on pull request #7702: Fix SAMA5D2 ADC and TSD problems
xiaoxiang781216 commented on PR #7702: URL: https://github.com/apache/nuttx/pull/7702#issuecomment-1328115856 @TimJTi it's better to squash the style fix into the first patch -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7678: drivers/segger: Add Segger RTT stream support
xiaoxiang781216 commented on code in PR #7678: URL: https://github.com/apache/nuttx/pull/7678#discussion_r1032831794 ## include/nuttx/segger/rtt.h: ## @@ -0,0 +1,94 @@ +/ + * include/nuttx/segger/rtt.h + * + * 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. + * + / + +#ifndef __INCLUDE_NUTTX_SEGGER_RTT_H +#define __INCLUDE_NUTTX_SEGGER_RTT_H + +/ + * Included Files + / + +#include +#include + +/ + * Pre-processor Definitions + / + +/ + * Type Declarations + / + +struct lib_rttoutstream_s +{ + struct lib_outstream_s public; + char name[32]; + char *buffer; + int channel; +}; + +struct lib_rttinstream_s +{ + struct lib_instream_s public; + char name[32]; + char *buffer; + int channel; +}; + +/ + * Public Function Prototypes + / + +#ifdef __cplusplus +extern "C" +{ +#endif + +/ +* Name: lib_rttoutstream_open +*/ + +void lib_rttoutstream_open(FAR struct lib_rttoutstream_s *stream, + int channel, size_t bufsize); + +/ +* Name: lib_rttinstream_open +*/ + +void lib_rttinstream_open(FAR struct lib_rttinstream_s *stream, + int channel, size_t size); + +/ + * Name: lib_rttoutstream_close + / + +void lib_rttoutstream_close(FAR struct lib_rttoutstream_s *stream); Review Comment: move before line 70 ## include/nuttx/segger/rtt.h: ## @@ -0,0 +1,94 @@ +/ + * include/nuttx/segger/rtt.h + * + * 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. + * + / + +#ifndef __INCLUDE_NUTTX_SEGGER_RTT_H +#define __INCLUDE_NUTTX_SEGGER_RTT_H + +/ + * Included Files + / + +#include +#include + +/ + * Pre-processor Definitions + / + +/ + * Type Declarations + / +
[nuttx-apps] branch master updated: NuttX graduated the Incubator; update repository links
This is an automated email from the ASF dual-hosted git repository. btashton pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git The following commit(s) were added to refs/heads/master by this push: new e4376a0e6 NuttX graduated the Incubator; update repository links e4376a0e6 is described below commit e4376a0e60c24a834d49013ccbc126dd061e54d2 Author: Nathan Hartman <59230071+hartmannat...@users.noreply.github.com> AuthorDate: Tue Nov 22 14:00:54 2022 -0500 NuttX graduated the Incubator; update repository links --- .github/workflows/build.yml | 10 +- .github/workflows/check.yml | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb6d20c80..db3b97e8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,13 +62,13 @@ jobs: # Determine the repo and leave that unset to use the normal checkout behavior # of using the merge commit instead of HEAD case $GITHUB_REPOSITORY in - "apache/incubator-nuttx") + "apache/nuttx") # OS echo "Triggered by change in OS" APPS_REF=$REF_NAME ;; - "apache/incubator-nuttx-apps" ) + "apache/nuttx-apps" ) # APPS OS_REF=$REF_NAME echo "Triggered by change in APPS" @@ -86,7 +86,7 @@ jobs: - name: Checkout nuttx repo uses: actions/checkout@v3 with: - repository: apache/incubator-nuttx + repository: apache/nuttx ref: ${{ steps.gittargets.outputs.os_ref }} path: sources/nuttx fetch-depth: 1 @@ -96,7 +96,7 @@ jobs: - name: Checkout apps repo uses: actions/checkout@v3 with: - repository: apache/incubator-nuttx-apps + repository: apache/nuttx-apps ref: ${{ steps.gittargets.outputs.apps_ref }} path: sources/apps fetch-depth: 1 @@ -135,7 +135,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Docker Pull -run: docker pull ghcr.io/apache/incubator-nuttx/apache-nuttx-ci-linux +run: docker pull ghcr.io/apache/nuttx/apache-nuttx-ci-linux - name: Export NuttX Repo SHA run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV - name: Run builds diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 19f65eb19..b7f935197 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -30,14 +30,14 @@ jobs: - name: Checkout nuttx repo uses: actions/checkout@v3 with: - repository: apache/incubator-nuttx + repository: apache/nuttx path: nuttx fetch-depth: 0 - name: Checkout apps repo uses: actions/checkout@v3 with: - repository: apache/incubator-nuttx-apps + repository: apache/nuttx-apps path: apps fetch-depth: 0
[GitHub] [nuttx-apps] btashton merged pull request #1437: NuttX graduated the Incubator; update repository links
btashton merged PR #1437: URL: https://github.com/apache/nuttx-apps/pull/1437 -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[nuttx] branch master updated (83a4b45dd4 -> 03802dad13)
This is an automated email from the ASF dual-hosted git repository. btashton pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git from 83a4b45dd4 boards/esp32-wrover-kit: Fix GPIO conflicts add 03802dad13 NuttX graduated the Incubator; update repository links No new revisions were added by this update. Summary of changes: .github/actions/ci-container/action.yaml |2 +- .github/workflows/build.yml| 10 +- .github/workflows/check.yml|2 +- Documentation/applications/index.rst |2 +- Documentation/applications/nsh/login.rst |6 +- .../components/drivers/character/timer.rst |2 +- .../components/drivers/character/watchdog.rst |2 +- Documentation/components/nxflat.rst|6 +- Documentation/components/nxgraphics/appendix.rst |2 +- Documentation/contributing/making-changes.rst | 18 +- Documentation/introduction/detailed_support.rst| 180 +- Documentation/platforms/arm/rp2040/index.rst |4 +- Documentation/platforms/risc-v/esp32c3/index.rst |2 +- Documentation/platforms/xtensa/esp32/index.rst |2 +- .../esp32s2/boards/esp32s2-saola-1/index.rst |2 +- Documentation/platforms/xtensa/esp32s2/index.rst |2 +- Documentation/quickstart/debugging.rst |4 +- Documentation/quickstart/install.rst | 16 +- Documentation/quickstart/organization.rst |2 +- README.md | 32 +- ReleaseNotes | 6568 ++-- arch/arm/src/common/Toolchain.defs |4 +- .../arm/rp2040/adafruit-feather-rp2040/README.txt |4 +- boards/arm/rp2040/adafruit-kb2040/README.txt |4 +- boards/arm/rp2040/adafruit-qt-py-rp2040/README.txt |4 +- boards/arm/rp2040/pimoroni-tiny2040/README.txt |4 +- boards/arm/rp2040/raspberrypi-pico-w/README.txt|4 +- boards/arm/rp2040/raspberrypi-pico/README.txt |4 +- boards/risc-v/fe310/hifive1-revb/README-qemu.txt |4 +- boards/risc-v/fe310/hifive1-revb/README.txt|4 +- boards/risc-v/k210/maix-bit/README-qemu.txt|4 +- boards/risc-v/k210/maix-bit/README.txt |4 +- boards/risc-v/litex/arty_a7/README.txt |4 +- boards/risc-v/qemu-rv/rv-virt/README.txt |8 +- tools/ci/cibuild.sh|4 +- tools/ci/docker/linux/Dockerfile |2 +- 36 files changed, 3464 insertions(+), 3464 deletions(-)
[GitHub] [nuttx] btashton merged pull request #7669: NuttX graduated the Incubator; update repository links
btashton merged PR #7669: URL: https://github.com/apache/nuttx/pull/7669 -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7701: net/devif: add common funtion to build L2 headers before sending
xiaoxiang781216 commented on code in PR #7701: URL: https://github.com/apache/nuttx/pull/7701#discussion_r1032825238 ## drivers/usbhost/usbhost_cdcmbim.c: ## @@ -2279,12 +2279,9 @@ static int cdcmbim_txpoll(struct net_driver_s *dev) if (priv->netdev.d_len > 0) Review Comment: remove the check -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7701: net/devif: add common funtion to build L2 headers before sending
xiaoxiang781216 commented on code in PR #7701: URL: https://github.com/apache/nuttx/pull/7701#discussion_r1032824576 ## include/nuttx/net/netdev.h: ## @@ -564,6 +564,20 @@ int sixlowpan_input(FAR struct radio_driver_s *ieee, int devif_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback); +/ + * Name: devif_out + * + * Description: + * Generic callback before device output to build L2 headers before sending + * + * Assumptions: + * This function is called from the MAC device driver with the network + * locked. + * + / + +int devif_out(FAR struct net_driver_s *dev, devif_poll_callback_t callback); Review Comment: let's move to devif/devif.h -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] anchao commented on a diff in pull request #7701: net/devif: add common funtion to build L2 headers before sending
anchao commented on code in PR #7701: URL: https://github.com/apache/nuttx/pull/7701#discussion_r1032824254 ## arch/arm/src/c5471/c5471_ethernet.c: ## @@ -1015,51 +1015,19 @@ static int c5471_txpoll(struct net_driver_s *dev) { struct c5471_driver_s *priv = (struct c5471_driver_s *)dev->d_private; - /* If the polling resulted in data that should be sent out on the network, - * the field d_len is set to a value > 0. - */ - - if (priv->c_dev.d_len > 0) -{ - /* Look up the destination MAC address and add it to the Ethernet - * header. - */ - -#ifdef CONFIG_NET_IPv4 -#ifdef CONFIG_NET_IPv6 - if (IFF_IS_IPv4(priv->c_dev.d_flags)) -#endif -{ - arp_out(>c_dev); -} -#endif /* CONFIG_NET_IPv4 */ - -#ifdef CONFIG_NET_IPv6 -#ifdef CONFIG_NET_IPv4 - else -#endif -{ - neighbor_out(>c_dev); -} -#endif /* CONFIG_NET_IPv6 */ + /* Send the packet */ - if (!devif_loopback(>c_dev)) Review Comment: Done -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] anchao commented on a diff in pull request #7703: net/devif/ip: build l2 header on the IP layer
anchao commented on code in PR #7703: URL: https://github.com/apache/nuttx/pull/7703#discussion_r1032824000 ## arch/arm/src/c5471/c5471_ethernet.c: ## @@ -1338,21 +1338,6 @@ static void c5471_receive(struct c5471_driver_s *priv) if (dev->d_len > 0 && (EIM_TXDESC_OWN_HOST & getreg32(priv->c_rxcpudesc)) == 0) { - /* Update the Ethernet header with the correct MAC address */ Review Comment: Done -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] btashton commented on pull request #7669: NuttX graduated the Incubator; update repository links
btashton commented on PR #7669: URL: https://github.com/apache/nuttx/pull/7669#issuecomment-1328098155 @hartmannathan I think we should be good now (no changes to this PR required) long as the test pass. I have restarted CI for both this PR and the on in nuttx-apps. They are now able to pull the new image. This build container is not associated with the repo right now (just Apache and me), but we can fix that in a follow on PR if it does not get fixed by the push action when the CI runs on trunk with this change. -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] anchao commented on a diff in pull request #7703: net/devif/ip: build l2 header on the IP layer
anchao commented on code in PR #7703: URL: https://github.com/apache/nuttx/pull/7703#discussion_r1032822109 ## arch/arm/src/gd32f4/gd32f4xx_enet.c: ## @@ -1718,10 +1718,6 @@ static void gd32_receive(struct gd32_enet_mac_s *priv) if (priv->dev.d_len > 0) { - /* Update the Ethernet header with the correct MAC address */ - - arp_out(>dev); Review Comment: Depends on https://github.com/apache/nuttx/pull/7701 -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7703: net/devif/ip: build l2 header on the IP layer
xiaoxiang781216 commented on code in PR #7703: URL: https://github.com/apache/nuttx/pull/7703#discussion_r1032821895 ## arch/arm/src/c5471/c5471_ethernet.c: ## @@ -1338,21 +1338,6 @@ static void c5471_receive(struct c5471_driver_s *priv) if (dev->d_len > 0 && (EIM_TXDESC_OWN_HOST & getreg32(priv->c_rxcpudesc)) == 0) { - /* Update the Ethernet header with the correct MAC address */ Review Comment: let's move arp_ipin at line 1320 into to ipv4_input -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7701: net/devif: add common funtion to build L2 headers before sending
xiaoxiang781216 commented on code in PR #7701: URL: https://github.com/apache/nuttx/pull/7701#discussion_r1032821737 ## arch/arm/src/c5471/c5471_ethernet.c: ## @@ -1015,51 +1015,19 @@ static int c5471_txpoll(struct net_driver_s *dev) { struct c5471_driver_s *priv = (struct c5471_driver_s *)dev->d_private; - /* If the polling resulted in data that should be sent out on the network, - * the field d_len is set to a value > 0. - */ - - if (priv->c_dev.d_len > 0) -{ - /* Look up the destination MAC address and add it to the Ethernet - * header. - */ - -#ifdef CONFIG_NET_IPv4 -#ifdef CONFIG_NET_IPv6 - if (IFF_IS_IPv4(priv->c_dev.d_flags)) -#endif -{ - arp_out(>c_dev); -} -#endif /* CONFIG_NET_IPv4 */ - -#ifdef CONFIG_NET_IPv6 -#ifdef CONFIG_NET_IPv4 - else -#endif -{ - neighbor_out(>c_dev); -} -#endif /* CONFIG_NET_IPv6 */ + /* Send the packet */ - if (!devif_loopback(>c_dev)) Review Comment: let's move devif_loopback to net/devif/devif.h -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7703: net/devif/ip: build l2 header on the IP layer
xiaoxiang781216 commented on code in PR #7703: URL: https://github.com/apache/nuttx/pull/7703#discussion_r1032821656 ## arch/arm/src/gd32f4/gd32f4xx_enet.c: ## @@ -1718,10 +1718,6 @@ static void gd32_receive(struct gd32_enet_mac_s *priv) if (priv->dev.d_len > 0) { - /* Update the Ethernet header with the correct MAC address */ - - arp_out(>dev); Review Comment: let's move arp_out/neighbor_out prototype to net/arp/arp.h and net/neighbor/neighbor.h -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] Gary-Hobson commented on pull request #7678: drivers/segger: Add Segger RTT stream support
Gary-Hobson commented on PR #7678: URL: https://github.com/apache/nuttx/pull/7678#issuecomment-1328095141 done~ it feels so much better now -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] TimJTi commented on a diff in pull request #7702: Fix SAMA5D2 ADC and TSD problems
TimJTi commented on code in PR #7702: URL: https://github.com/apache/nuttx/pull/7702#discussion_r1032816407 ## arch/arm/src/sama5/sam_tsd.c: ## @@ -630,7 +680,7 @@ static void sam_tsd_bottomhalf(void *arg) pressr = sam_adc_getreg(priv->adc, SAM_ADC_PRESSR); #endif /* Discard any bad readings. This check may not be necessary. */ - +#if 1 Review Comment: done -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] TimJTi commented on pull request #7702: Fix SAMA5D2 ADC and TSD problems
TimJTi commented on PR #7702: URL: https://github.com/apache/nuttx/pull/7702#issuecomment-1328088672 Have made this changes. Will squash after any other changes requested. -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] TimJTi commented on a diff in pull request #7702: Fix SAMA5D2 ADC and TSD problems
TimJTi commented on code in PR #7702: URL: https://github.com/apache/nuttx/pull/7702#discussion_r1032815460 ## arch/arm/src/sama5/sam_tsd.h: ## @@ -36,10 +36,15 @@ /* Configuration / -#ifdef CONFIG_SAMA_TSD_RXP +#ifndef CONFIG_SAMA_TSD_RXP # define CONFIG_SAMA_TSD_RXP 6 #endif +/* Only allow Pendet triggering in limited circumstances */ Review Comment: Surprised that checkpatch.sh missed that, but OK, of course -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] TimJTi commented on a diff in pull request #7702: Fix SAMA5D2 ADC and TSD problems
TimJTi commented on code in PR #7702: URL: https://github.com/apache/nuttx/pull/7702#discussion_r1032815416 ## arch/arm/src/sama5/sam_tsd.c: ## @@ -1551,21 +1628,44 @@ static void sam_tsd_initialize(struct sam_tsd_s *priv) /* Enable pen contact detection */ + regval = sam_adc_getreg(priv->adc, SAM_ADC_TSMR); regval |= ADC_TSMR_PENDET; sam_adc_putreg(priv->adc, SAM_ADC_TSMR, regval); /* Set up pen debounce time */ sam_tsd_debounce(priv, BOARD_TSD_DEBOUNCE); + /* configure pen sensitivity */ + + regval = sam_adc_getreg(priv->adc, SAM_ADC_ACR); + regval &= ~ADC_ACR_PENDETSENS_MASK; + regval |= ADC_ACR_PENDETSENS(BOARD_TSD_PENDETSENS); +#if defined(ATSAMA5D2) + regval &= ~ADC_ACR_IBCTL_MASK; + regval |= ADC_ACR_IBCTL(BOARD_TSD_IBCTL); +#endif + sam_adc_putreg(priv->adc, SAM_ADC_ACR, regval); + +#ifdef SAMA5_TSD_PENDET_TRIG_ALLOWED /* Configure pen interrupt generation */ regval = sam_adc_getreg(priv->adc, SAM_ADC_TRGR); regval &= ~ADC_TRGR_TRGMOD_MASK; regval |= ADC_TRGR_TRGMOD_PEN; sam_adc_putreg(priv->adc, SAM_ADC_TRGR, regval); +#endif sam_adc_putreg(priv->adc, SAM_ADC_IER, ADC_INT_PEN); + +#ifdef CONFIG_SAMA5_TSD_AUTOCALIB + /* perform a ts calibration */ Review Comment: OK -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] TimJTi commented on a diff in pull request #7702: Fix SAMA5D2 ADC and TSD problems
TimJTi commented on code in PR #7702: URL: https://github.com/apache/nuttx/pull/7702#discussion_r1032815391 ## arch/arm/src/sama5/sam_tsd.c: ## @@ -630,7 +680,7 @@ static void sam_tsd_bottomhalf(void *arg) pressr = sam_adc_getreg(priv->adc, SAM_ADC_PRESSR); #endif /* Discard any bad readings. This check may not be necessary. */ - +#if 1 Review Comment: I forgot, yes - I always search for the #if 0 I use when I'm suspicious of a bit of code being a problem, but will add a search for #if 1 in future! ## arch/arm/src/sama5/sam_tsd.c: ## @@ -1551,21 +1628,44 @@ static void sam_tsd_initialize(struct sam_tsd_s *priv) /* Enable pen contact detection */ + regval = sam_adc_getreg(priv->adc, SAM_ADC_TSMR); regval |= ADC_TSMR_PENDET; sam_adc_putreg(priv->adc, SAM_ADC_TSMR, regval); /* Set up pen debounce time */ sam_tsd_debounce(priv, BOARD_TSD_DEBOUNCE); + /* configure pen sensitivity */ Review Comment: OK -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7678: drivers/segger: Add Segger RTT stream support
xiaoxiang781216 commented on code in PR #7678: URL: https://github.com/apache/nuttx/pull/7678#discussion_r1032814848 ## drivers/segger/rtt_stream.c: ## @@ -0,0 +1,203 @@ +/ + * drivers/segger/rtt_stream.c + * + * 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. + * + / + +/ + * Included Files + / + +#include +#include + +#include +#include +#include +#include + +#include + +/ + * Private Functions + / + +/ + * Name: rttstream_putc + / + +static void rttstream_putc(FAR struct lib_outstream_s *this, int ch) +{ + FAR struct lib_rttoutstream_s *stream = + (FAR struct lib_rttoutstream_s *)this; + stream->public.nput += SEGGER_RTT_PutChar(stream->channel, ch); +} + +/ + * Name: rttstream_puts + / + +static int rttstream_puts(FAR struct lib_outstream_s *this, + FAR const void *buf, int len) +{ + FAR struct lib_rttoutstream_s *stream = +(FAR struct lib_rttoutstream_s *)this; + int ret = SEGGER_RTT_Write(stream->channel, buf, len); + stream->public.nput += ret; + return ret; +} + +/ + * Name: rttstream_getc + / + +static int rttstream_getc(FAR struct lib_instream_s *this) +{ + FAR struct lib_rttinstream_s *stream = +(FAR struct lib_rttinstream_s *)this; + int ch = -1; + + DEBUGASSERT(stream); + stream->public.nget += SEGGER_RTT_Read(stream->channel, , 1); + return ch; +} + +/ + * Name: rttstream_gets + / + +static int rttstream_gets(FAR struct lib_instream_s *this, + FAR void * buffer, int size) +{ + FAR struct lib_rttinstream_s *stream = +(FAR struct lib_rttinstream_s *)this; + int ret; + + DEBUGASSERT(stream); + ret = SEGGER_RTT_Read(stream->channel, buffer, size); + stream->public.nget += ret; + return ret; +} + +/ + * Public Functions + / + +/ + * Name: lib_rttoutstream + * + * Description: + * Initializes a stream for use with the configured RTT interface. + * + * Input Parameters: + * stream - User allocated, uninitialized instance of struct + *lib_rttoutstream_s to be initialized. + * channel - SEGGER RTT channel number + * bufsize - Size of the RTT channel buffer + * + * Returned Value: + * None (User allocated instance initialized). + * + / + +void lib_rttoutstream(FAR struct lib_rttoutstream_s *stream, int channel, + size_t bufsize) +{ + FAR char *name = (FAR char *)kmm_malloc(32); + FAR char *upbuf = (FAR char *)kmm_malloc(bufsize); + + DEBUGASSERT(upbuf); + DEBUGASSERT(name); + sprintf(name, "rtt%d", channel); + SEGGER_RTT_ConfigUpBuffer(channel, name, upbuf, +bufsize, SEGGER_RTT_MODE_NO_BLOCK_SKIP); + + stream->public.put = rttstream_putc; + stream->public.puts = rttstream_puts; + stream->public.flush = lib_noflush; +
[GitHub] [nuttx] xiaoxiang781216 commented on pull request #7678: drivers/segger: Add Segger RTT stream support
xiaoxiang781216 commented on PR #7678: URL: https://github.com/apache/nuttx/pull/7678#issuecomment-1328085547 > I have changed to initializing the RTT buffer in lib_rttoutstream, but I still feel like this is not a good design. > > This can cause some unnecessary troubles: When calling lib_rttinstream to initialize channel 0, it will cause an internal static buffer leak, which we cannot release or use > Since channel 0 is initialized by RTT internally, you can just skip the stream initialization code for channel 0. > We need to get some internal data structures of Segger RTT in the code, its style is not compatible with nuttx > you can simply save fields in lib_rttoutstream_s: ``` struct lib_rttoutstream_s { struct lib_outstream_s public; char name[32]; int channel; FAR void *buffer; }; ``` > The initialization of the segger RTT channel is a very independent thing that only needs to be done once. There is no need to process it once in different codes, and there is no need for uninitialization -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] acassis commented on a diff in pull request #7702: Fix SAMA5D2 ADC and TSD problems
acassis commented on code in PR #7702: URL: https://github.com/apache/nuttx/pull/7702#discussion_r1032808973 ## arch/arm/src/sama5/sam_tsd.c: ## @@ -1551,21 +1628,44 @@ static void sam_tsd_initialize(struct sam_tsd_s *priv) /* Enable pen contact detection */ + regval = sam_adc_getreg(priv->adc, SAM_ADC_TSMR); regval |= ADC_TSMR_PENDET; sam_adc_putreg(priv->adc, SAM_ADC_TSMR, regval); /* Set up pen debounce time */ sam_tsd_debounce(priv, BOARD_TSD_DEBOUNCE); + /* configure pen sensitivity */ + + regval = sam_adc_getreg(priv->adc, SAM_ADC_ACR); + regval &= ~ADC_ACR_PENDETSENS_MASK; + regval |= ADC_ACR_PENDETSENS(BOARD_TSD_PENDETSENS); +#if defined(ATSAMA5D2) + regval &= ~ADC_ACR_IBCTL_MASK; + regval |= ADC_ACR_IBCTL(BOARD_TSD_IBCTL); +#endif + sam_adc_putreg(priv->adc, SAM_ADC_ACR, regval); + +#ifdef SAMA5_TSD_PENDET_TRIG_ALLOWED /* Configure pen interrupt generation */ regval = sam_adc_getreg(priv->adc, SAM_ADC_TRGR); regval &= ~ADC_TRGR_TRGMOD_MASK; regval |= ADC_TRGR_TRGMOD_PEN; sam_adc_putreg(priv->adc, SAM_ADC_TRGR, regval); +#endif sam_adc_putreg(priv->adc, SAM_ADC_IER, ADC_INT_PEN); + +#ifdef CONFIG_SAMA5_TSD_AUTOCALIB + /* perform a ts calibration */ Review Comment: ditto ## arch/arm/src/sama5/sam_tsd.c: ## @@ -1551,21 +1628,44 @@ static void sam_tsd_initialize(struct sam_tsd_s *priv) /* Enable pen contact detection */ + regval = sam_adc_getreg(priv->adc, SAM_ADC_TSMR); regval |= ADC_TSMR_PENDET; sam_adc_putreg(priv->adc, SAM_ADC_TSMR, regval); /* Set up pen debounce time */ sam_tsd_debounce(priv, BOARD_TSD_DEBOUNCE); + /* configure pen sensitivity */ Review Comment: Please capitalized text as all other comments on this file ## arch/arm/src/sama5/sam_tsd.h: ## @@ -36,10 +36,15 @@ /* Configuration / -#ifdef CONFIG_SAMA_TSD_RXP +#ifndef CONFIG_SAMA_TSD_RXP # define CONFIG_SAMA_TSD_RXP 6 #endif +/* Only allow Pendet triggering in limited circumstances */ Review Comment: Add space after comment ## arch/arm/src/sama5/sam_tsd.c: ## @@ -630,7 +680,7 @@ static void sam_tsd_bottomhalf(void *arg) pressr = sam_adc_getreg(priv->adc, SAM_ADC_PRESSR); #endif /* Discard any bad readings. This check may not be necessary. */ - +#if 1 Review Comment: Why to keep this "#if 1" ? Was it a test that succeed and you forgot to remove of #if 1? -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] Gary-Hobson commented on pull request #7678: drivers/segger: Add Segger RTT stream support
Gary-Hobson commented on PR #7678: URL: https://github.com/apache/nuttx/pull/7678#issuecomment-1328076571 I have changed to initializing the RTT buffer in lib_rttoutstream, but I still feel like this is not a good design. This can cause some unnecessary troubles: When calling lib_rttinstream to initialize channel 0, it will cause an internal static buffer leak, which we cannot release or use We need to get some internal data structures of Segger RTT in the code, its style is not compatible with nuttx The initialization of the segger RTT channel is a very independent thing that only needs to be done once. There is no need to process it once in different codes, and there is no need for uninitialization -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7525: Improvements in TCP connections allocation.
xiaoxiang781216 commented on code in PR #7525: URL: https://github.com/apache/nuttx/pull/7525#discussion_r1032806288 ## net/tcp/tcp_conn.c: ## @@ -586,16 +586,32 @@ FAR struct tcp_conn_s *tcp_alloc_conn(void) void tcp_initialize(void) { -#ifndef CONFIG_NET_ALLOC_CONNS int i; +#ifndef CONFIG_NET_ALLOC_CONNS for (i = 0; i < CONFIG_NET_TCP_CONNS; i++) { /* Mark the connection closed and move it to the free list */ g_tcp_connections[i].tcpstateflags = TCP_CLOSED; dq_addlast(_tcp_connections[i].sconn.node, _free_tcp_connections); } +#else + FAR struct tcp_conn_s *conn; + + for (i = 0; i < CONFIG_NET_TCP_PREALLOC_CONNS; i++) +{ + conn = kmm_zalloc(sizeof(struct tcp_conn_s)); Review Comment: If you really want to allocate and free conn dynamically, it could be achieved simply by: Set CONFIG_NET_CONNS to 1 and kmm_free conn in case CONFIG_NET_CONNS equals 1 instead put it into free list. -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] anchao opened a new pull request, #7703: net/devif: add common funtion to handle L2 packet
anchao opened a new pull request, #7703: URL: https://github.com/apache/nuttx/pull/7703 ## Summary net/devif: add common funtion to handle L2 packet Handle an L2 packet from the network device. Verify and forward to L3 packet handling logic if the packet is destined for us. ## Impact N/A ## Testing ci check -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7525: Improvements in TCP connections allocation.
xiaoxiang781216 commented on code in PR #7525: URL: https://github.com/apache/nuttx/pull/7525#discussion_r1032804993 ## net/tcp/tcp_conn.c: ## @@ -586,16 +586,32 @@ FAR struct tcp_conn_s *tcp_alloc_conn(void) void tcp_initialize(void) { -#ifndef CONFIG_NET_ALLOC_CONNS int i; +#ifndef CONFIG_NET_ALLOC_CONNS for (i = 0; i < CONFIG_NET_TCP_CONNS; i++) { /* Mark the connection closed and move it to the free list */ g_tcp_connections[i].tcpstateflags = TCP_CLOSED; dq_addlast(_tcp_connections[i].sconn.node, _free_tcp_connections); } +#else + FAR struct tcp_conn_s *conn; + + for (i = 0; i < CONFIG_NET_TCP_PREALLOC_CONNS; i++) +{ + conn = kmm_zalloc(sizeof(struct tcp_conn_s)); Review Comment: > When using `CONFIG_NET_ALLOC_CONNS` connections are dynamically allocated in the heap. I believe it is much better to have everything in the heap, than scattering things around. kmm_malloc has the 8bytes overhead for each allocation. If you will always allocate something initially, it's better to either define a global array or allocate in a batch. > > It also keeps code simpler I think, But not, now we have two code path to initialize conn. Even worse, we have two option to CONFIG_NET_TCP_PREALLOC_CONNS and NET_TCP_CONNS for the similar config. > and I don't see any drawbacks this way. -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7525: Improvements in TCP connections allocation.
xiaoxiang781216 commented on code in PR #7525: URL: https://github.com/apache/nuttx/pull/7525#discussion_r1032804993 ## net/tcp/tcp_conn.c: ## @@ -586,16 +586,32 @@ FAR struct tcp_conn_s *tcp_alloc_conn(void) void tcp_initialize(void) { -#ifndef CONFIG_NET_ALLOC_CONNS int i; +#ifndef CONFIG_NET_ALLOC_CONNS for (i = 0; i < CONFIG_NET_TCP_CONNS; i++) { /* Mark the connection closed and move it to the free list */ g_tcp_connections[i].tcpstateflags = TCP_CLOSED; dq_addlast(_tcp_connections[i].sconn.node, _free_tcp_connections); } +#else + FAR struct tcp_conn_s *conn; + + for (i = 0; i < CONFIG_NET_TCP_PREALLOC_CONNS; i++) +{ + conn = kmm_zalloc(sizeof(struct tcp_conn_s)); Review Comment: > When using `CONFIG_NET_ALLOC_CONNS` connections are dynamically allocated in the heap. I believe it is much better to have everything in the heap, than scattering things around. kmm_malloc has the 8bytes overhead for each allocation. If you will always allocate something initially, it's better to either define a global array or allocate in a batch. > > It also keeps code simpler I think, But not, now we have two code path to initialize conn. Even worse, we have two option to CONFIG_NET_TCP_PREALLOC_CONNS and CONFIG_NET_TCP_ALLOC_CONNS for the similar config. > and I don't see any drawbacks this way. -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] fjpanag commented on a diff in pull request #7525: Improvements in TCP connections allocation.
fjpanag commented on code in PR #7525: URL: https://github.com/apache/nuttx/pull/7525#discussion_r1032802330 ## net/tcp/tcp_conn.c: ## @@ -586,16 +586,32 @@ FAR struct tcp_conn_s *tcp_alloc_conn(void) void tcp_initialize(void) { -#ifndef CONFIG_NET_ALLOC_CONNS int i; +#ifndef CONFIG_NET_ALLOC_CONNS for (i = 0; i < CONFIG_NET_TCP_CONNS; i++) { /* Mark the connection closed and move it to the free list */ g_tcp_connections[i].tcpstateflags = TCP_CLOSED; dq_addlast(_tcp_connections[i].sconn.node, _free_tcp_connections); } +#else + FAR struct tcp_conn_s *conn; + + for (i = 0; i < CONFIG_NET_TCP_PREALLOC_CONNS; i++) +{ + conn = kmm_zalloc(sizeof(struct tcp_conn_s)); Review Comment: When using `CONFIG_NET_ALLOC_CONNS` connections are dynamically allocated in the heap. I believe it is much better to have everything in the heap, than scattering things around. It also keeps code simpler I think, and I don't see any drawbacks this way. -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] fjpanag commented on a diff in pull request #7525: Improvements in TCP connections allocation.
fjpanag commented on code in PR #7525: URL: https://github.com/apache/nuttx/pull/7525#discussion_r1032802136 ## net/tcp/tcp_conn.c: ## @@ -836,10 +865,25 @@ void tcp_free(FAR struct tcp_conn_s *conn) } #endif - /* Mark the connection available and put it into the free list */ + /* Mark the connection available. */ conn->tcpstateflags = TCP_CLOSED; - dq_addlast(>sconn.node, _free_tcp_connections); + + /* Check if this is a preallocated connection to store it in the free + * connections list, else deallocate it. + */ + +#ifdef CONFIG_NET_ALLOC_CONNS + if ((conn->flags & TCP_PREALLOC) == 0) +{ + free(conn); Review Comment: Done. ## include/nuttx/net/netconfig.h: ## @@ -457,7 +457,7 @@ */ #ifndef CONFIG_NET_TCP_CONNS -# ifdef CONFIG_NET_TCP +# if defined CONFIG_NET_TCP && !defined CONFIG_NET_ALLOC_CONNS Review Comment: Done. -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] anchao commented on a diff in pull request #7701: net/devif: add common funtion to build L2 headers before sending
anchao commented on code in PR #7701: URL: https://github.com/apache/nuttx/pull/7701#discussion_r1032796955 ## net/devif/devif_poll.c: ## @@ -181,6 +181,63 @@ static void devif_packet_conversion(FAR struct net_driver_s *dev, # define devif_packet_conversion(dev,pkttype) #endif /* CONFIG_NET_6LOWPAN */ + +/ + * Name: devif_out + * + * Description: + * Generic callback before device output to build L2 headers before sending + * + * Assumptions: + * This function is called from the MAC device driver with the network + * locked. + * + / + +static int devif_out(FAR struct net_driver_s *dev, + devif_poll_callback_t callback) +{ + FAR struct iob_s *frag; + int bstop; + + if (dev->d_len == 0) +{ + return 0; +} + + bstop = devif_loopback(dev); Review Comment: Done ## net/devif/devif_poll.c: ## @@ -181,6 +181,63 @@ static void devif_packet_conversion(FAR struct net_driver_s *dev, # define devif_packet_conversion(dev,pkttype) #endif /* CONFIG_NET_6LOWPAN */ + +/ + * Name: devif_out + * + * Description: + * Generic callback before device output to build L2 headers before sending + * + * Assumptions: + * This function is called from the MAC device driver with the network + * locked. + * + / + +static int devif_out(FAR struct net_driver_s *dev, + devif_poll_callback_t callback) +{ + FAR struct iob_s *frag; Review Comment: Done -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] TimJTi opened a new pull request, #7702: Fix SAMA5D2 ADC and TSD problems
TimJTi opened a new pull request, #7702: URL: https://github.com/apache/nuttx/pull/7702 ## Summary Ensures ADC and TSD work together. TSD now works on SAMA5D2 and should still be OK for other SAMA5Dx family members ## Impact None expected ## Testing Custom board with ATSAMA5D2-D1M + 5" resistive TSD. Kconfig checked out for SAMA5D3 and SAMA5D4 families but no hardware to check these -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7701: net/devif: add common funtion to build L2 headers before sending
xiaoxiang781216 commented on code in PR #7701: URL: https://github.com/apache/nuttx/pull/7701#discussion_r1032795827 ## net/devif/devif_poll.c: ## @@ -181,6 +181,63 @@ static void devif_packet_conversion(FAR struct net_driver_s *dev, # define devif_packet_conversion(dev,pkttype) #endif /* CONFIG_NET_6LOWPAN */ + +/ + * Name: devif_out + * + * Description: + * Generic callback before device output to build L2 headers before sending + * + * Assumptions: + * This function is called from the MAC device driver with the network + * locked. + * + / + +static int devif_out(FAR struct net_driver_s *dev, + devif_poll_callback_t callback) +{ + FAR struct iob_s *frag; Review Comment: not use? ## net/devif/devif_poll.c: ## @@ -181,6 +181,63 @@ static void devif_packet_conversion(FAR struct net_driver_s *dev, # define devif_packet_conversion(dev,pkttype) #endif /* CONFIG_NET_6LOWPAN */ + +/ + * Name: devif_out + * + * Description: + * Generic callback before device output to build L2 headers before sending + * + * Assumptions: + * This function is called from the MAC device driver with the network + * locked. + * + / + +static int devif_out(FAR struct net_driver_s *dev, + devif_poll_callback_t callback) +{ + FAR struct iob_s *frag; + int bstop; + + if (dev->d_len == 0) +{ + return 0; +} + + bstop = devif_loopback(dev); Review Comment: move to next patch -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] anchao opened a new pull request, #7701: net/devif: add common funtion to build L2 headers before sending
anchao opened a new pull request, #7701: URL: https://github.com/apache/nuttx/pull/7701 ## Summary net/devif: add common funtion to build L2 headers before sending net/devif: move preprocess of txpoll into common code ## Impact N/A ## Testing ci-check -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #7525: Improvements in TCP connections allocation.
xiaoxiang781216 commented on code in PR #7525: URL: https://github.com/apache/nuttx/pull/7525#discussion_r1032793402 ## net/tcp/tcp_conn.c: ## @@ -586,16 +586,32 @@ FAR struct tcp_conn_s *tcp_alloc_conn(void) void tcp_initialize(void) { -#ifndef CONFIG_NET_ALLOC_CONNS int i; +#ifndef CONFIG_NET_ALLOC_CONNS for (i = 0; i < CONFIG_NET_TCP_CONNS; i++) { /* Mark the connection closed and move it to the free list */ g_tcp_connections[i].tcpstateflags = TCP_CLOSED; dq_addlast(_tcp_connections[i].sconn.node, _free_tcp_connections); } +#else + FAR struct tcp_conn_s *conn; + + for (i = 0; i < CONFIG_NET_TCP_PREALLOC_CONNS; i++) +{ + conn = kmm_zalloc(sizeof(struct tcp_conn_s)); Review Comment: why not reuse g_tcp_connections? ## include/nuttx/net/netconfig.h: ## @@ -457,7 +457,7 @@ */ #ifndef CONFIG_NET_TCP_CONNS -# ifdef CONFIG_NET_TCP +# if defined CONFIG_NET_TCP && !defined CONFIG_NET_ALLOC_CONNS Review Comment: ```suggestion # if defined(CONFIG_NET_TCP) && !defined(CONFIG_NET_ALLOC_CONNS) ``` ## net/tcp/tcp_conn.c: ## @@ -836,10 +865,25 @@ void tcp_free(FAR struct tcp_conn_s *conn) } #endif - /* Mark the connection available and put it into the free list */ + /* Mark the connection available. */ conn->tcpstateflags = TCP_CLOSED; - dq_addlast(>sconn.node, _free_tcp_connections); + + /* Check if this is a preallocated connection to store it in the free + * connections list, else deallocate it. + */ + +#ifdef CONFIG_NET_ALLOC_CONNS + if ((conn->flags & TCP_PREALLOC) == 0) +{ + free(conn); Review Comment: kmm_free -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] fjpanag commented on pull request #7525: Improvements in TCP connections allocation.
fjpanag commented on PR #7525: URL: https://github.com/apache/nuttx/pull/7525#issuecomment-1328052351 Everything seems fine now. Tested on a custom server with a few dozens of connections. It seems stable, and no memory leaks were observed. -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] fjpanag commented on issue #5973: CONFIG_NET_TCP_WRITE_BUFFERS=y lead to deadlock
fjpanag commented on issue #5973: URL: https://github.com/apache/nuttx/issues/5973#issuecomment-1328047885 I am hitting the exact same issue with a custom server, on high load. TCP deadlocks during send when it tries to allocate an iob. -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[nuttx-apps] branch master updated: apps/ltr308: add simple application to test ltr308 sensor
This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git The following commit(s) were added to refs/heads/master by this push: new e517dfd67 apps/ltr308: add simple application to test ltr308 sensor e517dfd67 is described below commit e517dfd672b0c7c30d08627c610bf8bbafb18d04 Author: Robert-Ionut Alexa AuthorDate: Sun Oct 9 16:20:29 2022 +0300 apps/ltr308: add simple application to test ltr308 sensor Signed-off-by: Robert-Ionut Alexa --- examples/ltr308/Kconfig | 30 ++ examples/ltr308/Make.defs | 23 +++ examples/ltr308/Makefile | 34 examples/ltr308/ltr308_main.c | 92 +++ 4 files changed, 179 insertions(+) diff --git a/examples/ltr308/Kconfig b/examples/ltr308/Kconfig new file mode 100644 index 0..05148af33 --- /dev/null +++ b/examples/ltr308/Kconfig @@ -0,0 +1,30 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_LTR308 + tristate "LTR308 ambient light sensor example" + default n + depends on SENSORS_LTR308 + ---help--- + Enable the LTR308 example + +if EXAMPLES_LTR308 + +config EXAMPLES_LTR308_PROGNAME + string "Program name" + default "ltr308" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config EXAMPLES_LTR308_PRIORITY + int "LTR308 task priority" + default 100 + +config EXAMPLES_LTR308_STACKSIZE + int "LTR308 stack size" + default DEFAULT_TASK_STACKSIZE + +endif diff --git a/examples/ltr308/Make.defs b/examples/ltr308/Make.defs new file mode 100644 index 0..6fc8ea336 --- /dev/null +++ b/examples/ltr308/Make.defs @@ -0,0 +1,23 @@ + +# apps/examples/ltr308/Make.defs +# +# 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. +# + + +ifneq ($(CONFIG_EXAMPLES_LTR308),) +CONFIGURED_APPS += $(APPDIR)/examples/ltr308 +endif diff --git a/examples/ltr308/Makefile b/examples/ltr308/Makefile new file mode 100644 index 0..3eef9a3fc --- /dev/null +++ b/examples/ltr308/Makefile @@ -0,0 +1,34 @@ + +# apps/examples/ltr308/Makefile +# +# 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. +# + + +include $(APPDIR)/Make.defs + +# LTR308 ambient light sensor example built-in application info + +PROGNAME = $(CONFIG_EXAMPLES_LTR308_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_LTR308_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_LTR308_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_LTR308) + +# LTR308 ambient light sensor example + +MAINSRC = ltr308_main.c + +include $(APPDIR)/Application.mk diff --git a/examples/ltr308/ltr308_main.c b/examples/ltr308/ltr308_main.c new file mode 100644 index 0..43b9bc153 --- /dev/null +++ b/examples/ltr308/ltr308_main.c @@ -0,0 +1,92 @@ +/ + * apps/examples/ltr308/ltr308_main.c + * + * Licensed to the Apache Software Foundation (ASF) under one
[GitHub] [nuttx-apps] xiaoxiang781216 merged pull request #1438: apps/ltr308: add simple application to test ltr308 sensor
xiaoxiang781216 merged PR #1438: URL: https://github.com/apache/nuttx-apps/pull/1438 -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx] SuGlider commented on pull request #7693: Adds ESP32-WroverKit LUA config and fixes LEDs setup
SuGlider commented on PR #7693: URL: https://github.com/apache/nuttx/pull/7693#issuecomment-1328034545 Thank you guys! -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nuttx-apps] robertalexa2000 opened a new pull request, #1438: apps/ltr308: add simple application to test ltr308 sensor
robertalexa2000 opened a new pull request, #1438: URL: https://github.com/apache/nuttx-apps/pull/1438 Signed-off-by: Robert-Ionut Alexa ## Summary ## Impact ## Testing -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org