Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb If firmware_load() returns ENOENT (i.e. No such ...
details: https://anonhg.NetBSD.org/src/rev/dd9e946ee668
branches: trunk
changeset: 757318:dd9e946ee668
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Wed Aug 25 12:43:56 2010 +0000
description:
If firmware_load() returns ENOENT (i.e. No such file or directory),
explicitly mention that firmware file is not in the default distribution.
diffstat:
sys/dev/usb/if_upgt.c | 28 ++++++++++++++++++++++------
1 files changed, 22 insertions(+), 6 deletions(-)
diffs (49 lines):
diff -r 01696bdc719a -r dd9e946ee668 sys/dev/usb/if_upgt.c
--- a/sys/dev/usb/if_upgt.c Wed Aug 25 07:18:01 2010 +0000
+++ b/sys/dev/usb/if_upgt.c Wed Aug 25 12:43:56 2010 +0000
@@ -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;
}
}
Home |
Main Index |
Thread Index |
Old Index