Tue Dec 18 18:32:00 2018 UTC ()
Pull up following revision(s) (requested by msaitoh in ticket #1140):
	share/man/man4/urtwn.4: revision 1.16
	sys/dev/usb/if_urtwn.c: revision 1.66

Add IO-DATA WN-G150UMW.

 -

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
   value is taken from Linux.


(martin)
diff -r1.15 -r1.15.6.1 src/share/man/man4/urtwn.4
diff -r1.53.2.4 -r1.53.2.5 src/sys/dev/usb/if_urtwn.c

cvs diff -r1.15 -r1.15.6.1 src/share/man/man4/urtwn.4 (expand / switch to unified diff)

--- src/share/man/man4/urtwn.4 2016/10/12 03:23:29 1.15
+++ src/share/man/man4/urtwn.4 2018/12/18 18:32:00 1.15.6.1
@@ -1,31 +1,31 @@ @@ -1,31 +1,31 @@
1.\" $NetBSD: urtwn.4,v 1.15 2016/10/12 03:23:29 nat Exp $ 1.\" $NetBSD: urtwn.4,v 1.15.6.1 2018/12/18 18:32:00 martin Exp $
2.\" $OpenBSD: urtwn.4,v 1.15 2011/11/26 06:39:33 ckuethe Exp $ 2.\" $OpenBSD: urtwn.4,v 1.15 2011/11/26 06:39:33 ckuethe Exp $
3.\" 3.\"
4.\" Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> 4.\" Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
5.\" 5.\"
6.\" Permission to use, copy, modify, and distribute this software for any 6.\" Permission to use, copy, modify, and distribute this software for any
7.\" purpose with or without fee is hereby granted, provided that the above 7.\" purpose with or without fee is hereby granted, provided that the above
8.\" copyright notice and this permission notice appear in all copies. 8.\" copyright notice and this permission notice appear in all copies.
9.\" 9.\"
10.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17.\" 17.\"
18.Dd July 25, 2014 18.Dd December 17, 2018
19.Dt URTWN 4 19.Dt URTWN 4
20.Os 20.Os
21.Sh NAME 21.Sh NAME
22.Nm urtwn 22.Nm urtwn
23.Nd Realtek RTL8188CU/RTL8188EU/RTL8192CU/RTL8192EU USB IEEE 802.11b/g/n wireless network device 23.Nd Realtek RTL8188CU/RTL8188EU/RTL8192CU/RTL8192EU USB IEEE 802.11b/g/n wireless network device
24.Sh SYNOPSIS 24.Sh SYNOPSIS
25.Cd "urtwn* at uhub? port ?" 25.Cd "urtwn* at uhub? port ?"
26.Sh DESCRIPTION 26.Sh DESCRIPTION
27The 27The
28.Nm 28.Nm
29driver supports USB 2.0 wireless network devices based on Realtek 29driver supports USB 2.0 wireless network devices based on Realtek
30RTL8188CUS, RTL8188CE-VAU, RTL8188EUS, RTL8188RU, RTL8192CU and RTL8192EU 30RTL8188CUS, RTL8188CE-VAU, RTL8188EUS, RTL8188RU, RTL8192CU and RTL8192EU
31chipsets. 31chipsets.
@@ -107,26 +107,27 @@ The following adapters should work: @@ -107,26 +107,27 @@ The following adapters should work:
107.It Aus. Linx AL-9604R1S 107.It Aus. Linx AL-9604R1S
108.It ASUSTeK USB-N10 NANO 108.It ASUSTeK USB-N10 NANO
109.It B-Link BL-LW05-5R 109.It B-Link BL-LW05-5R
110.It Belkin F7D1102 Surf Wireless Micro 110.It Belkin F7D1102 Surf Wireless Micro
111.It D-Link DWA-121 111.It D-Link DWA-121
112.It D-Link DWA-133 112.It D-Link DWA-133
113.It D-Link DWA-135 113.It D-Link DWA-135
114.It Digitus DN-7042 114.It Digitus DN-7042
115.It Edimax EW-7811Un 115.It Edimax EW-7811Un
116.It EDUP EP-N8508 116.It EDUP EP-N8508
117.It ELECOM WDC-150SU2M 117.It ELECOM WDC-150SU2M
118.It Full River FR-W100NUL 118.It Full River FR-W100NUL
119.It Hercules Wireless N USB Pico HWNUp-150 119.It Hercules Wireless N USB Pico HWNUp-150
 120.It IO-DATA WN-G150UMW
120.It Netgear WNA1000A 121.It Netgear WNA1000A
121.It Planex GW-USEco300 122.It Planex GW-USEco300
122.It Planex GW-USNano2 123.It Planex GW-USNano2
123.It Planex GW-USValue-EZ 124.It Planex GW-USValue-EZ
124.It Planex GW-USWExtreme 125.It Planex GW-USWExtreme
125.It POWCHIP POW-N18 126.It POWCHIP POW-N18
126.It Sitecom N300 USB (WLA-2102 v1) 127.It Sitecom N300 USB (WLA-2102 v1)
127.It Sitecom WL-365 128.It Sitecom WL-365
128.It Solwise NET-WL-UMD-606N 129.It Solwise NET-WL-UMD-606N
129.It TP-LINK TL-WN723N v3 130.It TP-LINK TL-WN723N v3
130.It TP-LINK TL-WN725N v2 131.It TP-LINK TL-WN725N v2
131.It TRENDnet TEW-648UBM 132.It TRENDnet TEW-648UBM
132.El 133.El

cvs diff -r1.53.2.4 -r1.53.2.5 src/sys/dev/usb/if_urtwn.c (expand / switch to unified diff)

--- src/sys/dev/usb/if_urtwn.c 2018/08/08 10:28:35 1.53.2.4
+++ src/sys/dev/usb/if_urtwn.c 2018/12/18 18:32:00 1.53.2.5
@@ -1,41 +1,41 @@ @@ -1,41 +1,41 @@
1/* $NetBSD: if_urtwn.c,v 1.53.2.4 2018/08/08 10:28:35 martin Exp $ */ 1/* $NetBSD: if_urtwn.c,v 1.53.2.5 2018/12/18 18:32:00 martin Exp $ */
2/* $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $ */ 2/* $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $ */
3 3
4/*- 4/*-
5 * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> 5 * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
6 * Copyright (c) 2014 Kevin Lo <kevlo@FreeBSD.org> 6 * Copyright (c) 2014 Kevin Lo <kevlo@FreeBSD.org>
7 * Copyright (c) 2016 Nathanial Sloss <nathanialsloss@yahoo.com.au> 7 * Copyright (c) 2016 Nathanial Sloss <nathanialsloss@yahoo.com.au>
8 * 8 *
9 * Permission to use, copy, modify, and distribute this software for any 9 * Permission to use, copy, modify, and distribute this software for any
10 * purpose with or without fee is hereby granted, provided that the above 10 * purpose with or without fee is hereby granted, provided that the above
11 * copyright notice and this permission notice appear in all copies. 11 * copyright notice and this permission notice appear in all copies.
12 * 12 *
13 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 15 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 */ 20 */
21 21
22/*- 22/*-
23 * Driver for Realtek RTL8188CE-VAU/RTL8188CUS/RTL8188EU/RTL8188RU/RTL8192CU 23 * Driver for Realtek RTL8188CE-VAU/RTL8188CUS/RTL8188EU/RTL8188RU/RTL8192CU
24 * RTL8192EU. 24 * RTL8192EU.
25 */ 25 */
26 26
27#include <sys/cdefs.h> 27#include <sys/cdefs.h>
28__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.53.2.4 2018/08/08 10:28:35 martin Exp $"); 28__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.53.2.5 2018/12/18 18:32:00 martin Exp $");
29 29
30#ifdef _KERNEL_OPT 30#ifdef _KERNEL_OPT
31#include "opt_inet.h" 31#include "opt_inet.h"
32#include "opt_usb.h" 32#include "opt_usb.h"
33#endif 33#endif
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/sockio.h> 36#include <sys/sockio.h>
37#include <sys/sysctl.h> 37#include <sys/sysctl.h>
38#include <sys/mbuf.h> 38#include <sys/mbuf.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/socket.h> 40#include <sys/socket.h>
41#include <sys/systm.h> 41#include <sys/systm.h>
@@ -1020,27 +1020,27 @@ urtwn_fw_cmd(struct urtwn_softc *sc, uin @@ -1020,27 +1020,27 @@ urtwn_fw_cmd(struct urtwn_softc *sc, uin
1020 device_xname(sc->sc_dev), __func__, id, buf, len)); 1020 device_xname(sc->sc_dev), __func__, id, buf, len));
1021 1021
1022 KASSERT(mutex_owned(&sc->sc_write_mtx)); 1022 KASSERT(mutex_owned(&sc->sc_write_mtx));
1023 1023
1024 mutex_enter(&sc->sc_fwcmd_mtx); 1024 mutex_enter(&sc->sc_fwcmd_mtx);
1025 fwcur = sc->fwcur; 1025 fwcur = sc->fwcur;
1026 sc->fwcur = (sc->fwcur + 1) % R92C_H2C_NBOX; 1026 sc->fwcur = (sc->fwcur + 1) % R92C_H2C_NBOX;
1027 mutex_exit(&sc->sc_fwcmd_mtx); 1027 mutex_exit(&sc->sc_fwcmd_mtx);
1028 1028
1029 /* Wait for current FW box to be empty. */ 1029 /* Wait for current FW box to be empty. */
1030 for (ntries = 0; ntries < 100; ntries++) { 1030 for (ntries = 0; ntries < 100; ntries++) {
1031 if (!(urtwn_read_1(sc, R92C_HMETFR) & (1 << fwcur))) 1031 if (!(urtwn_read_1(sc, R92C_HMETFR) & (1 << fwcur)))
1032 break; 1032 break;
1033 DELAY(10); 1033 DELAY(2000);
1034 } 1034 }
1035 if (ntries == 100) { 1035 if (ntries == 100) {
1036 aprint_error_dev(sc->sc_dev, 1036 aprint_error_dev(sc->sc_dev,
1037 "could not send firmware command %d\n", id); 1037 "could not send firmware command %d\n", id);
1038 return ETIMEDOUT; 1038 return ETIMEDOUT;
1039 } 1039 }
1040 1040
1041 memset(&cmd, 0, sizeof(cmd)); 1041 memset(&cmd, 0, sizeof(cmd));
1042 KASSERT(len <= sizeof(cmd.msg)); 1042 KASSERT(len <= sizeof(cmd.msg));
1043 memcpy(cmd.msg, buf, len); 1043 memcpy(cmd.msg, buf, len);
1044 1044
1045 /* Write the first word last since that will trigger the FW. */ 1045 /* Write the first word last since that will trigger the FW. */
1046 cp = (uint8_t *)&cmd; 1046 cp = (uint8_t *)&cmd;
@@ -3464,32 +3464,32 @@ urtwn_load_firmware(struct urtwn_softc * @@ -3464,32 +3464,32 @@ urtwn_load_firmware(struct urtwn_softc *
3464 aprint_error_dev(sc->sc_dev, 3464 aprint_error_dev(sc->sc_dev,
3465 "timeout waiting for checksum report\n"); 3465 "timeout waiting for checksum report\n");
3466 error = ETIMEDOUT; 3466 error = ETIMEDOUT;
3467 goto fail; 3467 goto fail;
3468 } 3468 }
3469 3469
3470 /* Wait for firmware readiness. */ 3470 /* Wait for firmware readiness. */
3471 reg = urtwn_read_4(sc, R92C_MCUFWDL); 3471 reg = urtwn_read_4(sc, R92C_MCUFWDL);
3472 reg = (reg & ~R92C_MCUFWDL_WINTINI_RDY) | R92C_MCUFWDL_RDY; 3472 reg = (reg & ~R92C_MCUFWDL_WINTINI_RDY) | R92C_MCUFWDL_RDY;
3473 urtwn_write_4(sc, R92C_MCUFWDL, reg); 3473 urtwn_write_4(sc, R92C_MCUFWDL, reg);
3474 if (ISSET(sc->chip, URTWN_CHIP_88E) || 3474 if (ISSET(sc->chip, URTWN_CHIP_88E) ||
3475 ISSET(sc->chip, URTWN_CHIP_92EU)) 3475 ISSET(sc->chip, URTWN_CHIP_92EU))
3476 urtwn_r88e_fw_reset(sc); 3476 urtwn_r88e_fw_reset(sc);
3477 for (ntries = 0; ntries < 1000; ntries++) { 3477 for (ntries = 0; ntries < 6000; ntries++) {
3478 if (urtwn_read_4(sc, R92C_MCUFWDL) & R92C_MCUFWDL_WINTINI_RDY) 3478 if (urtwn_read_4(sc, R92C_MCUFWDL) & R92C_MCUFWDL_WINTINI_RDY)
3479 break; 3479 break;
3480 DELAY(5); 3480 DELAY(5);
3481 } 3481 }
3482 if (ntries == 1000) { 3482 if (ntries == 6000) {
3483 aprint_error_dev(sc->sc_dev, 3483 aprint_error_dev(sc->sc_dev,
3484 "timeout waiting for firmware readiness\n"); 3484 "timeout waiting for firmware readiness\n");
3485 error = ETIMEDOUT; 3485 error = ETIMEDOUT;
3486 goto fail; 3486 goto fail;
3487 } 3487 }
3488 fail: 3488 fail:
3489 firmware_free(fw, fwlen); 3489 firmware_free(fw, fwlen);
3490 return error; 3490 return error;
3491} 3491}
3492 3492
3493static __inline int 3493static __inline int
3494urtwn_dma_init(struct urtwn_softc *sc) 3494urtwn_dma_init(struct urtwn_softc *sc)
3495{ 3495{