Module Name: src Committed By: tsutsui Date: Wed Aug 25 12:43:56 UTC 2010
Modified Files: src/sys/dev/usb: if_upgt.c Log Message: If firmware_load() returns ENOENT (i.e. No such file or directory), explicitly mention that firmware file is not in the default distribution. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/usb/if_upgt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/usb/if_upgt.c diff -u src/sys/dev/usb/if_upgt.c:1.2 src/sys/dev/usb/if_upgt.c:1.3 --- src/sys/dev/usb/if_upgt.c:1.2 Mon Jul 5 14:27:26 2010 +++ src/sys/dev/usb/if_upgt.c Wed Aug 25 12:43:56 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: if_upgt.c,v 1.2 2010/07/05 14:27:26 tsutsui Exp $ */ +/* $NetBSD: if_upgt.c,v 1.3 2010/08/25 12:43:56 tsutsui Exp $ */ /* $OpenBSD: if_upgt.c,v 1.49 2010/04/20 22:05:43 tedu Exp $ */ /* @@ -18,7 +18,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_upgt.c,v 1.2 2010/07/05 14:27:26 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_upgt.c,v 1.3 2010/08/25 12:43:56 tsutsui Exp $"); #include <sys/param.h> #include <sys/callout.h> @@ -664,10 +664,26 @@ error = firmware_load("upgt", name, &sc->sc_fw, &sc->sc_fw_size); if (error != 0) { - aprint_error_dev(sc->sc_dev, - "could not read firmware %s\n", name); - aprint_error_dev(sc->sc_dev, - "see upgt(4) man page for details\n"); + if (error == ENOENT) { + /* + * The firmware file for upgt(4) is not in + * the default distribution due to its lisence + * so explicitly notify it if the firmware file + * is not found. + */ + aprint_error_dev(sc->sc_dev, + "firmware file %s is not installed\n", + name); + aprint_error_dev(sc->sc_dev, + "(it is not included in the default" + " distribution)\n"); + aprint_error_dev(sc->sc_dev, + "see upgt(4) man page for details about " + "firmware installation\n"); + } else { + aprint_error_dev(sc->sc_dev, + "could not read firmware %s\n", name); + } return EIO; } }