summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/usb/if_urndis.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/sys/dev/usb/if_urndis.c b/sys/dev/usb/if_urndis.c
index 4af6b55cf05..5d148da4ab5 100644
--- a/sys/dev/usb/if_urndis.c
+++ b/sys/dev/usb/if_urndis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urndis.c,v 1.66 2017/06/10 12:58:37 kevlo Exp $ */
+/* $OpenBSD: if_urndis.c,v 1.67 2017/07/19 16:31:56 mikeb Exp $ */
/*
* Copyright (c) 2010 Jonathan Armani <armani@openbsd.org>
@@ -90,6 +90,8 @@ u_int32_t urndis_ctrl_handle_query(struct urndis_softc *,
const struct rndis_comp_hdr *, void **, size_t *);
u_int32_t urndis_ctrl_handle_reset(struct urndis_softc *,
const struct rndis_comp_hdr *);
+u_int32_t urndis_ctrl_handle_status(struct urndis_softc *,
+ const struct rndis_comp_hdr *);
u_int32_t urndis_ctrl_init(struct urndis_softc *);
u_int32_t urndis_ctrl_halt(struct urndis_softc *);
@@ -235,6 +237,10 @@ urndis_ctrl_handle(struct urndis_softc *sc, struct rndis_comp_hdr *hdr,
rval = letoh32(hdr->rm_status);
break;
+ case REMOTE_NDIS_INDICATE_STATUS_MSG:
+ rval = urndis_ctrl_handle_status(sc, hdr);
+ break;
+
default:
printf("%s: ctrl message error: unknown event 0x%x\n",
DEVNAME(sc), letoh32(hdr->rm_type));
@@ -402,6 +408,38 @@ urndis_ctrl_handle_reset(struct urndis_softc *sc,
}
u_int32_t
+urndis_ctrl_handle_status(struct urndis_softc *sc,
+ const struct rndis_comp_hdr *hdr)
+{
+ const struct rndis_status_msg *msg;
+ u_int32_t rval;
+
+ msg = (struct rndis_status_msg *)hdr;
+
+ rval = letoh32(msg->rm_status);
+
+ DPRINTF(("%s: urndis_ctrl_handle_status: len %u status 0x%x "
+ "stbuflen %u\n",
+ DEVNAME(sc),
+ letoh32(msg->rm_len),
+ rval,
+ letoh32(msg->rm_stbuflen)));
+
+ switch (rval) {
+ case RNDIS_STATUS_MEDIA_CONNECT:
+ case RNDIS_STATUS_MEDIA_DISCONNECT:
+ case RNDIS_STATUS_OFFLOAD_CURRENT_CONFIG:
+ rval = RNDIS_STATUS_SUCCESS;
+ break;
+
+ default:
+ printf("%s: status 0x%x\n", DEVNAME(sc), rval);
+ }
+
+ return rval;
+}
+
+u_int32_t
urndis_ctrl_init(struct urndis_softc *sc)
{
struct rndis_init_req *msg;