Module Name:    src
Committed By:   msaitoh
Date:           Sat Dec 15 10:30:58 UTC 2018

Modified Files:
        src/sys/dev/usb: if_urtwn.c

Log Message:
Make IODATA WN-G150UMW work:
- Increase delay to prevent "could not send firmware command". The value
  is taken from FreeBSD.
-Increase delay to prevent "timeout waiting for firmware readiness". The
  vaule is taken from Linux.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/usb/if_urtwn.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_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.65 src/sys/dev/usb/if_urtwn.c:1.66
--- src/sys/dev/usb/if_urtwn.c:1.65	Tue Nov 13 10:35:32 2018
+++ src/sys/dev/usb/if_urtwn.c	Sat Dec 15 10:30:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.65 2018/11/13 10:35:32 mlelstv Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.66 2018/12/15 10:30:58 msaitoh Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.65 2018/11/13 10:35:32 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.66 2018/12/15 10:30:58 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1035,7 +1035,7 @@ urtwn_fw_cmd(struct urtwn_softc *sc, uin
 	for (ntries = 0; ntries < 100; ntries++) {
 		if (!(urtwn_read_1(sc, R92C_HMETFR) & (1 << fwcur)))
 			break;
-		DELAY(10);
+		DELAY(2000);
 	}
 	if (ntries == 100) {
 		aprint_error_dev(sc->sc_dev,
@@ -3469,12 +3469,12 @@ urtwn_load_firmware(struct urtwn_softc *
 	if (ISSET(sc->chip, URTWN_CHIP_88E) ||
 	    ISSET(sc->chip, URTWN_CHIP_92EU))
 		urtwn_r88e_fw_reset(sc);
-	for (ntries = 0; ntries < 1000; ntries++) {
+	for (ntries = 0; ntries < 6000; ntries++) {
 		if (urtwn_read_4(sc, R92C_MCUFWDL) & R92C_MCUFWDL_WINTINI_RDY)
 			break;
 		DELAY(5);
 	}
-	if (ntries == 1000) {
+	if (ntries == 6000) {
 		aprint_error_dev(sc->sc_dev,
 		    "timeout waiting for firmware readiness\n");
 		error = ETIMEDOUT;

Reply via email to