Currently watchdog functionality for urndis driver is disabled
(commented), I've tested it and it works properly - reset messages are
correctly sent and cmplt packets are received according to RNDIS spec (I
patched the driver to forcedly send reset message and act on it with
device reset every 5 seconds). I suggest to uncomment it.
The hardware is Megafon 4G МM200-1:
urndis0 at uhub3 port 2 configuration 1 interface 0 "Qualcomm MM200-1" rev
2.00/3.18 addr 5
Tests, comments or objections?
diff --git sys/dev/usb/if_urndis.c sys/dev/usb/if_urndis.c
index 551197fbfc3..7347712f282 100644
--- sys/dev/usb/if_urndis.c
+++ sys/dev/usb/if_urndis.c
@@ -64,9 +64,7 @@
int urndis_newbuf(struct urndis_softc *, struct urndis_chain *);
int urndis_ioctl(struct ifnet *, u_long, caddr_t);
-#if 0
void urndis_watchdog(struct ifnet *);
-#endif
void urndis_start(struct ifnet *);
void urndis_rxeof(struct usbd_xfer *, void *, usbd_status);
@@ -100,10 +98,8 @@ u_int32_t urndis_ctrl_query(struct urndis_softc *,
u_int32_t, void *, size_t,
u_int32_t urndis_ctrl_set(struct urndis_softc *, u_int32_t, void *, size_t);
u_int32_t urndis_ctrl_set_param(struct urndis_softc *, const char *, u_int32_t,
void *, size_t);
-#if 0
u_int32_t urndis_ctrl_reset(struct urndis_softc *);
u_int32_t urndis_ctrl_keepalive(struct urndis_softc *);
-#endif
int urndis_encap(struct urndis_softc *, struct mbuf *, int);
void urndis_decap(struct urndis_softc *, struct urndis_chain *, u_int32_t);
@@ -680,7 +676,6 @@ urndis_ctrl_set_param(struct urndis_softc *sc,
return rval;
}
-#if 0
/* XXX : adrreset, get it from response */
u_int32_t
urndis_ctrl_reset(struct urndis_softc *sc)
@@ -765,7 +760,6 @@ urndis_ctrl_keepalive(struct urndis_softc *sc)
return rval;
}
-#endif
int
urndis_encap(struct urndis_softc *sc, struct mbuf *m, int idx)
@@ -1048,7 +1042,6 @@ urndis_ioctl(struct ifnet *ifp, u_long command, caddr_t
data)
return (error);
}
-#if 0
void
urndis_watchdog(struct ifnet *ifp)
{
@@ -1064,7 +1057,6 @@ urndis_watchdog(struct ifnet *ifp)
urndis_ctrl_keepalive(sc);
}
-#endif
void
urndis_init(struct urndis_softc *sc)
@@ -1451,9 +1443,7 @@ urndis_attach(struct device *parent, struct device *self,
void *aux)
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_start = urndis_start;
ifp->if_ioctl = urndis_ioctl;
-#if 0
ifp->if_watchdog = urndis_watchdog;
-#endif
strlcpy(ifp->if_xname, DEVNAME(sc), IFNAMSIZ);