staging: rtl8192u: remove redundant assignment to pointer crypt
[linux/fpc-iii.git] / tools / testing / selftests / drivers / net / netdevsim / devlink.sh
blob9d8baf5d14b39a64eab598ff9909a6eb5fff3d4c
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0
4 lib_dir=$(dirname $0)/../../../net/forwarding
6 ALL_TESTS="fw_flash_test"
7 NUM_NETIFS=0
8 source $lib_dir/lib.sh
10 BUS_ADDR=10
11 PORT_COUNT=4
12 DEV_NAME=netdevsim$BUS_ADDR
13 SYSFS_NET_DIR=/sys/bus/netdevsim/devices/$DEV_NAME/net/
14 DEBUGFS_DIR=/sys/kernel/debug/netdevsim/$DEV_NAME/
15 DL_HANDLE=netdevsim/$DEV_NAME
17 fw_flash_test()
19 RET=0
21 devlink dev flash $DL_HANDLE file dummy
22 check_err $? "Failed to flash with status updates on"
24 echo "n"> $DEBUGFS_DIR/fw_update_status
25 check_err $? "Failed to disable status updates"
27 devlink dev flash $DL_HANDLE file dummy
28 check_err $? "Failed to flash with status updates off"
30 log_test "fw flash test"
33 setup_prepare()
35 modprobe netdevsim
36 echo "$BUS_ADDR $PORT_COUNT" > /sys/bus/netdevsim/new_device
37 while [ ! -d $SYSFS_NET_DIR ] ; do :; done
40 cleanup()
42 pre_cleanup
43 echo "$BUS_ADDR" > /sys/bus/netdevsim/del_device
44 modprobe -r netdevsim
47 trap cleanup EXIT
49 setup_prepare
51 tests_run
53 exit $EXIT_STATUS