Lines Matching +full:firmware +full:- +full:name

2 # SPDX-License-Identifier: GPL-2.0
4 # to load firmware it can't find on disk itself. We must request a firmware
7 set -e
23 local name="$1"
27 echo -n "$name" >"$DIR"/trigger_request &
31 while [ ! -e "$DIR"/"$name"/loading ]; do
33 timeout=$(( $timeout - 1 ))
34 if [ "$timeout" -eq 0 ]; then
35 echo "$0: firmware interface never appeared" >&2
40 echo 1 >"$DIR"/"$name"/loading
41 cat "$file" >"$DIR"/"$name"/data
42 echo 0 >"$DIR"/"$name"/loading
50 local name="$1"
54 echo -n "$name" >"$DIR"/trigger_request 2>/dev/null &
58 while [ ! -e "$DIR"/"$name"/loading ]; do
60 timeout=$(( $timeout - 1 ))
61 if [ "$timeout" -eq 0 ]; then
62 echo "$0: firmware interface never appeared" >&2
67 echo -1 >"$DIR"/"$name"/loading
75 if [ ! -e "$DIR"/trigger_custom_fallback ]; then
80 local name="$1"
83 echo -n "$name" >"$DIR"/trigger_custom_fallback 2>/dev/null &
87 while [ ! -e "$DIR"/"$name"/loading ]; do
89 timeout=$(( $timeout - 1 ))
90 if [ "$timeout" -eq 0 ]; then
91 echo "$0: firmware interface never appeared" >&2
96 echo 1 >"$DIR"/"$name"/loading
97 cat "$file" >"$DIR"/"$name"/data
98 echo 0 >"$DIR"/"$name"/loading
108 if [ ! -e "$DIR"/trigger_custom_fallback ]; then
113 local name="$1"
116 echo -n "$name" >"$DIR"/trigger_custom_fallback 2>/dev/null &
120 while [ ! -e "$DIR"/"$name"/loading ]; do
122 timeout=$(( $timeout - 1 ))
123 if [ "$timeout" -eq 0 ]; then
124 echo "$0: firmware interface never appeared" >&2
129 echo -1 >"$DIR"/"$name"/loading
138 local name="$1"
142 echo 4 >/sys/class/firmware/timeout
146 echo -n "$name" >"$DIR"/trigger_request 2>/dev/null
148 SECONDS_DELTA=$(($SECONDS_AFTER - $SECONDS_BEFORE))
149 if [ "$SECONDS_DELTA" -lt 4 ]; then
160 DEVPATH="$DIR"/"nope-$NAME"/loading
163 echo -n 2 >/sys/class/firmware/timeout
164 echo -n "nope-$NAME" >"$DIR"/trigger_request 2>/dev/null &
169 if [ ! -f $DEVPATH ]; then
177 echo "a firmware rule like /lib/udev/rules.d/50-firmware.rules"
180 echo "SUBSYSTEM==\"firmware\", ACTION==\"add\", ATTR{loading}=\"-1\""
187 if diff -q "$FW" /dev/test_firmware >/dev/null ; then
188 echo "$0: firmware was not expected to match" >&2
200 echo 4 >/sys/class/firmware/timeout
202 # Load this script instead of the desired firmware.
203 load_fw "$NAME" "$0"
204 if diff -q "$FW" /dev/test_firmware >/dev/null ; then
205 echo "$0: firmware was not expected to match" >&2
208 echo "$0: firmware comparison works"
212 load_fw "$NAME" "$FW"
213 if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
214 echo "$0: firmware was not loaded" >&2
220 load_fw_cancel "nope-$NAME" "$FW"
221 if diff -q "$FW" /dev/test_firmware >/dev/null ; then
222 echo "$0: firmware was expected to be cancelled" >&2
229 load_fw_fallback_with_child "nope-signal-$NAME" "$FW"
230 if [ "$?" -eq 0 ]; then
233 echo "$0: error - sync firmware request cancelled due to SIGCHLD" >&2
236 set -e
244 if ! diff -q "$RANDOM_FILE_PATH" /dev/test_firmware >/dev/null ; then
245 echo "$0: firmware was not loaded" >&2
255 if ! diff -q "$RANDOM_FILE_PATH" /dev/test_firmware >/dev/null ; then
256 echo "$0: firmware was not loaded" >&2
268 if diff -q "$RANDOM_FILE_PATH" /dev/test_firmware >/dev/null ; then
269 echo "$0: firmware was expected to be cancelled" >&2