[U-Boot] [PATCH v2 00/19] Improve env var handling for net stack

Joe Hershberger joe.hershberger at ni.com
Wed Apr 29 07:50:47 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.

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 (19):
  sandbox: Enable some ENV commands
  kconfig: Move REGEX to Kconfig
  sandbox: Enable regex support
  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
  test: Generalize the unit test framework
  test: dm: Don't bail on all tests if one test fails
  test: Return values from the asserts compatible with cmds
  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: Cleanup order and extra defines in defconfig
  sandbox: Enable env unit tests

 Makefile                           |   1 +
 README                             |   8 ++
 common/cmd_nvedit.c                |  46 +++++++---
 common/env_attr.c                  | 181 ++++++++++++++++++++++++++++---------
 common/env_callback.c              |   6 +-
 common/env_flags.c                 |   6 +-
 configs/acadia_defconfig           |   1 +
 configs/bamboo_defconfig           |   1 +
 configs/bubinga_defconfig          |   1 +
 configs/canyonlands_defconfig      |   1 +
 configs/dlvision-10g_defconfig     |   1 +
 configs/dlvision_defconfig         |   1 +
 configs/ebony_defconfig            |   1 +
 configs/gdppc440etx_defconfig      |   1 +
 configs/icon_defconfig             |   1 +
 configs/intip_defconfig            |   1 +
 configs/io64_defconfig             |   1 +
 configs/io_defconfig               |   1 +
 configs/iocon_defconfig            |   1 +
 configs/katmai_defconfig           |   1 +
 configs/kilauea_defconfig          |   1 +
 configs/luan_defconfig             |   1 +
 configs/m28evk_defconfig           |   1 +
 configs/m53evk_defconfig           |   1 +
 configs/makalu_defconfig           |   1 +
 configs/neo_defconfig              |   1 +
 configs/novena_defconfig           |   1 +
 configs/ocotea_defconfig           |   1 +
 configs/redwood_defconfig          |   1 +
 configs/sandbox_defconfig          |  38 ++++----
 configs/sequoia_defconfig          |   1 +
 configs/socfpga_arria5_defconfig   |   1 +
 configs/socfpga_cyclone5_defconfig |   1 +
 configs/t3corp_defconfig           |   1 +
 configs/taihu_defconfig            |   1 +
 configs/taishan_defconfig          |   1 +
 configs/walnut_defconfig           |   1 +
 configs/yosemite_defconfig         |   1 +
 configs/yucca_defconfig            |   1 +
 include/configs/amcc-common.h      |   1 -
 include/configs/m28evk.h           |   1 -
 include/configs/m53evk.h           |   1 -
 include/configs/novena.h           |   1 -
 include/configs/sandbox.h          |   5 +
 include/configs/socfpga_arria5.h   |   1 -
 include/configs/socfpga_cyclone5.h |   1 -
 include/dm/test.h                  |  35 ++-----
 include/env_attr.h                 |  10 +-
 include/env_callback.h             |  32 ++++++-
 include/env_flags.h                |  23 ++++-
 include/env_test.h                 |  18 ++++
 include/search.h                   |   2 +
 include/test/test.h                |  47 ++++++++++
 include/{dm => test}/ut.h          |  40 ++++----
 lib/Kconfig                        |   8 ++
 net/net.c                          | 105 +++++++++++++++++----
 test/Kconfig                       |   4 +
 test/Makefile                      |   1 +
 test/dm/Kconfig                    |   1 +
 test/dm/Makefile                   |   2 -
 test/dm/bus.c                      |  39 ++++----
 test/dm/core.c                     |  74 ++++++++-------
 test/dm/eth.c                      |  17 ++--
 test/dm/gpio.c                     |  22 ++---
 test/dm/i2c.c                      |  20 ++--
 test/dm/pci.c                      |   6 +-
 test/dm/sf.c                       |   4 +-
 test/dm/spi.c                      |   8 +-
 test/dm/test-driver.c              |   6 +-
 test/dm/test-fdt.c                 |  16 ++--
 test/dm/test-main.c                |  37 ++++----
 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_env_test.c            |  36 ++++++++
 test/{dm => }/ut.c                 |  16 ++--
 78 files changed, 780 insertions(+), 296 deletions(-)
 create mode 100644 include/env_test.h
 create mode 100644 include/test/test.h
 rename include/{dm => test}/ut.h (73%)
 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_env_test.c
 rename test/{dm => }/ut.c (59%)

-- 
1.7.11.5



More information about the U-Boot mailing list