[U-Boot] [PATCH v5 00/26] Improve env var handling for net stack

Joe Hershberger joe.hershberger at ni.com
Wed May 20 21:27:13 CEST 2015


This includes moving CONFIG_REGEX to Kconfig and adding support for
regex to the env_attr lists (when CONFIG_REGEX is enabled).

This allows ethaddrs to all be checked for access and format by default.
Also use callbacks to keep network stack variables up to date instead of
polling them on each call to net_loop.

This is a step in the right direction to refactoring the network stack
to be similar to that of barebox.

Also added a test command to host unit tests for the env functions.

2015-05-20 - Rebased on latest master.

Changes in v5:
-Move the new time test to the common ut command
-Rebased and reran savedefconfig
-Time unit tests now depend on UNIT_TEST
-Updated to rework the 3 new tests in master

Changes in v4:
-Fixed bisectability issue
-New for version 4

Changes in v3:
-Moved test from env subcommand to ut subcommand
-New for version 3

Changes in v2:
-Added comments about the use of .flags in the dm eth test
-Added description to README
-Fix bisectability issue
-Fix corner case in reverse_name_search() where searched starts with ' '
-New for version 2
-Simplified test for H_PROGRAMMATIC

Joe Hershberger (26):
  sandbox: Cleanup order and extra defines in defconfig
  sandbox: Use defconfig to enable features
  sandbox: Enable some ENV commands
  env: Fix return values in env_attr_lookup()
  env: Simplify the reverse_strstr() interface
  env: Allow env_attr_walk to pass a priv * to callback
  env: Add regex support to env_attrs
  env: Distinguish finer between source of env change
  net: Apply default format rules to all ethaddr
  net: Use env callbacks for net variables
  net: Add default flags for common net env vars
  net: Remove duplicate bootfile syncing functionality
  net: Handle ethaddr changes as an env callback
  test: Generalize the unit test framework
  test: Add a common unit test command
  test: dm: Move the dm tests over to the ut command
  test: dm: Move the time test over to the ut command
  test: Move the unit tests to their own menu
  test: dm: Don't bail on all tests if one test fails
  test: dm: eth: Handle failed test env cleanup
  test: Return values from the asserts compatible with cmds
  test: dm: Recover the driver model tree after tests
  test: env: Add test framework for env
  test: env: Add test for verifying env attrs
  test: env: Add a test of the new regex behavior for attrs
  sandbox: Enable env unit tests

 Makefile                  |   1 +
 README                    |   8 ++
 arch/sandbox/Kconfig      |  15 ----
 common/cmd_nvedit.c       |  36 ++++++---
 common/env_attr.c         | 181 +++++++++++++++++++++++++++++++++++-----------
 common/env_callback.c     |   6 +-
 common/env_flags.c        |   6 +-
 configs/sandbox_defconfig |  20 +++--
 include/configs/sandbox.h |   5 ++
 include/dm/test.h         |  46 ++----------
 include/env_attr.h        |  10 +--
 include/env_callback.h    |  33 ++++++++-
 include/env_flags.h       |  23 +++++-
 include/search.h          |   2 +
 include/test/env.h        |  16 ++++
 include/test/suites.h     |  15 ++++
 include/test/test.h       |  47 ++++++++++++
 include/{dm => test}/ut.h |  40 +++++-----
 net/Kconfig               |   1 +
 net/eth.c                 |  95 +++++++++++++++---------
 net/net.c                 | 105 +++++++++++++++++++++++----
 test/Kconfig              |  14 +++-
 test/Makefile             |   4 +-
 test/cmd_ut.c             |  80 ++++++++++++++++++++
 test/dm/Kconfig           |   8 +-
 test/dm/Makefile          |  14 ++--
 test/dm/bus.c             |  39 +++++-----
 test/dm/cmd_dm.c          |  21 ------
 test/dm/core.c            |  74 ++++++++++---------
 test/dm/eth.c             |  88 +++++++++++++++-------
 test/dm/gpio.c            |  22 +++---
 test/dm/i2c.c             |  20 ++---
 test/dm/pci.c             |   6 +-
 test/dm/pmic.c            |   6 +-
 test/dm/regulator.c       |  16 ++--
 test/dm/rtc.c             |  12 +--
 test/dm/sf.c              |   4 +-
 test/dm/spi.c             |   8 +-
 test/dm/test-dm.sh        |   2 +-
 test/dm/test-driver.c     |   6 +-
 test/dm/test-fdt.c        |  16 ++--
 test/dm/test-main.c       |  55 +++++++++-----
 test/dm/test-uclass.c     |   7 +-
 test/dm/usb.c             |   6 +-
 test/env/Kconfig          |   8 ++
 test/env/Makefile         |   8 ++
 test/env/attr.c           |  89 +++++++++++++++++++++++
 test/env/cmd_ut_env.c     |  37 ++++++++++
 test/time_ut.c            |   8 +-
 test/{dm => }/ut.c        |  16 ++--
 50 files changed, 986 insertions(+), 419 deletions(-)
 create mode 100644 include/test/env.h
 create mode 100644 include/test/suites.h
 create mode 100644 include/test/test.h
 rename include/{dm => test}/ut.h (73%)
 create mode 100644 test/cmd_ut.c
 create mode 100644 test/env/Kconfig
 create mode 100644 test/env/Makefile
 create mode 100644 test/env/attr.c
 create mode 100644 test/env/cmd_ut_env.c
 rename test/{dm => }/ut.c (59%)

-- 
1.7.11.5



More information about the U-Boot mailing list