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

Joe Hershberger joe.hershberger at ni.com
Sun May 3 22:12:36 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 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: 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
  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: 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
  test: dm: Move the dm tests over to the ut command
  sandbox: Cleanup order and extra defines in defconfig
  sandbox: Enable env unit tests

 Makefile                           |   1 +
 README                             |   8 ++
 arch/sandbox/Kconfig               |   5 +-
 common/cmd_nvedit.c                |  36 +++++---
 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          |  37 ++++----
 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                  |  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              |  14 +++
 include/test/test.h                |  47 ++++++++++
 include/{dm => test}/ut.h          |  40 ++++----
 lib/Kconfig                        |   8 ++
 net/Kconfig                        |   1 +
 net/eth.c                          |  95 ++++++++++++-------
 net/net.c                          | 105 +++++++++++++++++----
 test/Kconfig                       |   7 ++
 test/Makefile                      |   2 +
 test/cmd_ut.c                      |  74 +++++++++++++++
 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                      |  86 ++++++++++++------
 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-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/{dm => }/ut.c                 |  16 ++--
 85 files changed, 1004 insertions(+), 394 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