Commit Graph

54 Commits

Author SHA1 Message Date
chao.an 56b5ae0640 net/tcp/netdev/mld: correct the netlock handling
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-02-03 11:09:18 -03:00
Petro Karashchenko 8d3bf05fd2 include: fix double include pre-processor guards
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-16 11:11:14 -03:00
Petro Karashchenko 3ccb657dc2 nuttx: remove space befone newline in logs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-27 21:01:19 -06:00
Juha Niskanen 422ceec99b Fix typos in comments and Kconfig files
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2021-12-21 03:26:16 -06:00
Xiang Xiao 2e54df0f35 Don't include assert.h from public header file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-03 08:36:03 -07:00
Gustavo Henrique Nihei 330eff36d7 sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
Xiang Xiao 8d0fd4038b Remove the empty xxx_initialize functions
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I63cb6b37f78e910663724659e11f53e3335d419f
2021-03-03 08:21:04 +00:00
Alin Jerpelea 37d5c1b0d9 net: Author Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-20 00:38:18 -08:00
Alin Jerpelea 7dc7ef45f1 net: nxstyle fixes
Nxstyle fixes to pass CI.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-20 00:38:18 -08:00
Nathan Hartman 80ce7800a9 Sources and Docs: Fix typos and nxstyle issues
Documentation/contributing/coding_style.rst:

    * Fix repeated words: ("this this").
    * Remove trailing spaces.

boards/z80/z80/z80sim/README.txt:

    * Fix repeated words: ("this this") and rewrap lines.

graphics/Kconfig,
libs/libc/math/Kconfig:

    * Fix repeated words: ("this this").

arch/arm/src/armv7-a/arm_assert.c,
arch/arm/src/armv7-r/arm_assert.c,
arch/arm/src/imxrt/imxrt_enet.c,
arch/arm/src/kinetis/kinetis_enet.c,
arch/arm/src/kinetis/kinetis_flexcan.c,
arch/arm/src/s32k1xx/s32k1xx_enet.c,
arch/arm/src/s32k1xx/s32k1xx_flexcan.c,
arch/arm/src/stm32/stm32_pwm.c,
arch/arm/src/stm32h7/stm32_pwm.c,
arch/arm/src/stm32l4/stm32l4_pwm.c,
arch/renesas/src/rx65n/rx65n_usbdev.c,
binfmt/libnxflat/libnxflat_bind.c,
drivers/pipes/pipe_common.c,
net/igmp/igmp_input.c,
net/tcp/tcp_conn.c,
sched/sched/sched_roundrobin.c:

    * Fix typo in comment ("this this").

arch/arm/src/cxd56xx/cxd56_usbdev.c,
arch/arm/src/lc823450/lc823450_usbdev.c:

    * Fix typo in comment and rewrap lines.

arch/arm/src/imxrt/imxrt_usbdev.c,
arch/arm/src/stm32/stm32_dac.c,
arch/arm/src/stm32f0l0g0/stm32_pwm.c,
arch/arm/src/stm32f7/stm32_pwm.c,
arch/arm/src/tiva/lm/lm4f_gpio.h,
fs/nxffs/nxffs_write.c,
include/nuttx/analog/pga11x.h,
include/nuttx/usb/usbdev.h,
net/mld/mld_join.c:

    * Fix typo in comment ("this this").
    * Fix nxstyle issues.
2020-10-02 04:54:52 +02:00
Bhindhiya d7aec84dbe Resolve build warnings in file mld_group.c 2020-09-04 21:16:00 +08:00
Xiang Xiao acca9fcc3b sched/wdog: Remove MAX_WDOGPARMS and related stuff
since the variable arguments are error prone and seldom used.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-14 08:19:50 -06:00
Xiang Xiao a0ce81d659 sched/wdog: Don't dynamically allocate wdog_s
to save the preserved space(1KB) and also avoid the heap overhead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I694073f68e1bd63960cedeea1ddec441437be025
2020-08-11 12:28:55 -06:00
Xiang Xiao f618de9c97 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-08 17:30:26 -03:00
Xiang Xiao 4c706771c3 sched/wdog: Replace all callback argument from uint32_t to wdparm_t
and alwasy cast the argument of wd_start to wdparm_t

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-08 17:30:26 -03:00
Gregory Nutt a569006fd8 sched/: Make more naming consistent
Rename various functions per the quidelines of https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions

    nxsem_setprotocol -> nxsem_set_protocol
    nxsem_getprotocol -> nxsem_get_protocol
    nxsem_getvalue -> nxsem_get_value
2020-05-17 14:01:00 -03:00
Xiang Xiao d9d2fc0d0a debug: Reduce CONFIG_CPP_HAVE_VARARGS usage
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-05 08:27:58 -06:00
ligd cbf31bca5c global change: fix tools/checkpatch.sh warnnings
Change-Id: I88cfa979c44bcaf3a8f6e036c6bfccd3402ca85a
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
ligd 231ad202ee global change: repace sched_xfree() to kxmm_free()
Changes:
sched_xfree() => kxmm_free()
remove garbage related APIs
remove ARCH_HAVE_GARBAGE

Cause garbage feature move to mm_heap, then don't need
garbage anymore.

Change-Id: If310790a3208155ca8ab319e8d038cb6ff92c518
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
Xiang Xiao 5c80b94820 Replace #include <semaphore.h> to #include <nuttx/semaphore.h>
Since the kernel side should call nxsem_xxx instead and remove the unused inclusion
2020-02-01 08:27:30 -06:00
Xiang Xiao 6a3c2aded6 Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* Unify the void cast usage

1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
2020-01-02 10:54:43 -06:00
Gregory Nutt 3b275fcf4e net/: Run nxstyle against all C files. 2019-10-25 11:31:42 -06:00
Gregory Nutt f6b00e1966 tools/nxstyle.c: Fix logic error that prevent detecion of '/' and '/=' as operators. net/: Minor updates resulting from testing tools/nxstyle. 2019-03-11 12:48:39 -06:00
Gregory Nutt d94bd49b78 net/mld: Fix a typo in conditional compilation. Clean up return values from mld_ngroups(). 2018-11-11 16:23:18 -06:00
Gregory Nutt 9b1025ca1b net/mld/mld_group.c: Fixed failure to stop queries. This turned out to be an uninitialized variable. I wonder why there was no warning from GCC? 2018-11-11 15:25:16 -06:00
Gregory Nutt 002f09f2da net/mld: Fix logic error when testing for the case where all members have left. Still does not work. The end result is that the query timer no longer stops. Not when another another querier with a lower IP is present or when all of the members have left. Basically just can't stop querying under any condition. 2018-11-11 12:43:12 -06:00
Gregory Nutt 8a3fc26b74 Squashed commit of the following:
The MLD implementation did not follow the RFC correctly when it is the Querier.  The Querier should use a general query and get query messages from all members of all groups.  This would be driven by a single timer per sub-nset since all groups are queried at once. Instead, the design used a Multicast Address Specific Query with one timer per group and ignores groups that we are not members of.

    Similary, the MLDv1 compatibility timer should be a single, separate timer, not a per-group timer.

    net/mld: Group may be NULL when sending a general query
2018-11-11 11:38:29 -06:00
Gregory Nutt 591b03aa7d net/mld/mld_query.c: Eliminate a warning: implicit definitino of memcmp. 2018-11-11 07:36:52 -06:00
Gregory Nutt 1a56229386 net/mld: Resolve and issue with sending reports from multiple groups in the same polling cycle. 2018-11-11 07:31:59 -06:00
Gregory Nutt 8cfb376f81 net/mld: There is an issue with the general query timer design. There should be a single instance, not a per-group instance of the timer (ditto for the v1 compatibility timer). Fall back for now and use the per-group MAX query. 2018-11-10 12:13:54 -06:00
Gregory Nutt f8d39e2c84 net/MLD: The MAS query should be sent on the group multicast address. 2018-11-10 11:41:50 -06:00
Gregory Nutt 854046a931 /net/devif/ipv6_input.c: Correct handling of IPv6 extension headers. The main confusion was that the payload length in the IPv6 header does not include its extension headers.
net/icmpv6/icmpv6_input.c:  Correct caculation of the ICMPv6 header address
    net/mld/mld_query.c:  Correct back test for group found.
    net/mld/mld_report.c: Fix host vs. network order problem.
    net/mld/mld_send.c: Correct the address used in sending the General Query.  It should be the unspecified address in that case.
    net/mld:  Querying workaround.  The MLD implementation does not follow the RFC correct when it is the Querier.  The Querier should use a general query and get query messages from all members of all groups.  This would be driven by a single timer since all groups are queried at once.  Instead, the design currently uses a Multicast Address Specific Query with one timer per group and ignores groups that we are not members of.
2018-11-10 11:29:02 -06:00
Gregory Nutt 5340016104 net/mld: Very that the address of the group that we join is a valid IPv6 multicast address. 2018-11-08 06:37:46 -06:00
Gregory Nutt 9c3e65f15f net/mld: Fix a few compilation problems that cropped up in a different network configuration. Fix a logic error in setting the 'Other Querier Present' timer. Various cosmetic improvements. 2018-11-07 18:21:21 -06:00
Gregory Nutt 02f83334d5 Squashed commit of the following:
net/mld:  Fix a couple of places where I forgot to unlock the network in the previous commit.

    net/mld:  Implement 'Other Querier Present Timer'.  This timer is used to revert to Querier mode if there is no other querier on the network.  Also, fix some naming:  The Done message is not just Version 1 but is used with Version 2 as well.

    net/igmp:  Back out some blind, backported improvements to IGMP from MLD.  There are too many subtle differences in the protocols for this to be safe.
2018-11-07 10:40:30 -06:00
Gregory Nutt 813f4d424c net/mld: Fix a few off-by-one alignment issues spotted by tools/nxstyle. 2018-11-06 15:08:16 -06:00
Gregory Nutt 62e4a41209 net/mld: Add reference counting on the group joins. If there are multiple joins from the same group on this, the don't really leave the group until the matching number of leaves happen. Also add to hooks for the router case: Keep track of the number members NOT on this host. Integrate this with the Leave logic to that the group structure can persist while there no non-local members of the group as well. 2018-11-06 14:46:03 -06:00
Gregory Nutt f58e7976df net/procfs: Add support to provide MLD stats at /proc/net/mld. net/mld: Fix a couple more bugs found in further MLD testing. 2018-11-06 10:42:53 -06:00
Gregory Nutt 3db3c3952b net/mld: Standard usage of debug output macros. Add configuration options to enable MLD debug even when there network debug is disabled. Add configuration option to dump the content of outgoing MLD packets. 2018-11-05 18:39:55 -06:00
Gregory Nutt f28ed5af03 net/mld/mld_group.c: Improve error handling on a failure to allocate a new group. 2018-11-05 17:51:09 -06:00
Gregory Nutt 65c74f5444 net/mld: Fix report repitition counter. One send one less reported than required. 2018-11-05 15:17:05 -06:00
Gregory Nutt 80fe482f1b net/mld/mld_leave.c: Fix a bad assertion. 2018-11-05 09:39:28 -06:00
Gregory Nutt 33ed27ae65 Squashed commit of the following:
net/mld: Checksum calculation needs to know the full size of the IPv6 header, including the size of the extension headers.  The payload size in the IPv64 header must include the extension headers (not considered part of the header in this case).  Fixes a few additional errors in size, endian-ness and checksum calculations.  Wireshark now reports the the outgoing Report has a good checksum.

    net/mld/mld_query.c:  Add a cast to assure that the left shift does not overflow.
2018-11-05 08:56:07 -06:00
Gregory Nutt c6156818b0 net/mld: Fix some compile errors fill debug info is enabled. Fix some errors in formatting the Listerner report. Still has a checksum error. 2018-11-04 18:18:14 -06:00
Gregory Nutt 9a75a14800 net/mld: Implement MLDv1 compatibility mode. This completes coding of MLD. MLD is, howeer, still completely untested. 2018-11-04 14:07:27 -06:00
Gregory Nutt b1a61834d9 net/mld: Review and update all MLD message receipt logic. Also ripple changs that are, hopefully, improvements back to IGMP. 2018-11-04 10:57:21 -06:00
Gregory Nutt a4dc759b4d net/mld: Defer all timeout-related operations to the work queue vs. handling within the timer interrupt. Need to notify the device driver for an immediate poll when there are MLD packets waiting to be sent. 2018-11-03 16:47:08 -06:00
Gregory Nutt 1c15aa3b2d Squashed commit of the following:
net/mld:  More updates from comparison with roughly leveraged code and the MDL RFCs 2710 and 3810.

    net/mld:  More updated from comparison with roughly leveraged code and the MDL RFCs 2710 and 3810.

    net/mld:  Beginning comparison with roughly leveraged code and the MDL RFCs 2710 and 3810.
2018-11-03 13:45:33 -06:00
Gregory Nutt 863f617262 net/igmp and net/mld: Fix problem when both IGMP and MLD are enabled. The cannot share the same group list in the network devices structure. 2018-11-03 07:06:30 -06:00
Gregory Nutt 6c0ab0e077 Squashed commit of the following:
include/nuttx/net/ipv6ext.h:  Fix some terminology:  Hop-by-hop, not Hop-to-hop or Hop2hop.

    net/devif/ipv6_input.c and net/icmpv6/icmpv6_input.c:  Add logic to skiip over the variable number of IPv6 extension headers that may be present between the IPv6 header and the transport layer header.  The extension headers are simply ignored.  This is necessary because with MLD, certain incoming messages may have, at a mimimum, a Router Alert Hop-by-hop extension header.

    net/inet/ipv6_setsockopt.c:  Implement the IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP socket options.
2018-11-02 12:06:57 -06:00