diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/if_urndis.c | 68 | ||||
-rw-r--r-- | sys/dev/usb/if_urndisreg.h | 50 |
2 files changed, 55 insertions, 63 deletions
diff --git a/sys/dev/usb/if_urndis.c b/sys/dev/usb/if_urndis.c index 7021df46ca0..07310b954ac 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.4 2010/03/03 18:44:30 mk Exp $ */ +/* $OpenBSD: if_urndis.c,v 1.5 2010/03/03 19:01:03 mk Exp $ */ /* * Copyright (c) 2010 Jonathan Armani <dbd@asystant.net> @@ -88,24 +88,24 @@ usbd_status urndis_ctrl_msg(struct urndis_softc *, uint8_t, uint8_t, usbd_status urndis_ctrl_send(struct urndis_softc *, void *, size_t); struct urndis_comp_hdr *urndis_ctrl_recv(struct urndis_softc *); -urndis_status urndis_ctrl_handle(struct urndis_softc *, +u_int32_t urndis_ctrl_handle(struct urndis_softc *, struct urndis_comp_hdr *, void **, size_t *); -urndis_status urndis_ctrl_handle_init(struct urndis_softc *, +u_int32_t urndis_ctrl_handle_init(struct urndis_softc *, const struct urndis_comp_hdr *); -urndis_status urndis_ctrl_handle_query(struct urndis_softc *, +u_int32_t urndis_ctrl_handle_query(struct urndis_softc *, const struct urndis_comp_hdr *, void **, size_t *); -urndis_status urndis_ctrl_handle_reset(struct urndis_softc *, +u_int32_t urndis_ctrl_handle_reset(struct urndis_softc *, const struct urndis_comp_hdr *); -urndis_status urndis_ctrl_init(struct urndis_softc *); -urndis_status urndis_ctrl_halt(struct urndis_softc *); -urndis_status urndis_ctrl_query(struct urndis_softc *, urndis_oid, void *, size_t, +u_int32_t urndis_ctrl_init(struct urndis_softc *); +u_int32_t urndis_ctrl_halt(struct urndis_softc *); +u_int32_t urndis_ctrl_query(struct urndis_softc *, u_int32_t, void *, size_t, void **, size_t *); -urndis_status urndis_ctrl_set(struct urndis_softc *, urndis_oid, void *, size_t); -urndis_status urndis_ctrl_set_param(struct urndis_softc *, const char *, u_int32_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); -urndis_status urndis_ctrl_reset(struct urndis_softc *); -urndis_status urndis_ctrl_keepalive(struct urndis_softc *); +u_int32_t urndis_ctrl_reset(struct urndis_softc *); +u_int32_t urndis_ctrl_keepalive(struct urndis_softc *); int urndis_encap(struct urndis_softc *, struct mbuf *, int); void urndis_decap(struct urndis_softc *, struct urndis_chain *, size_t); @@ -215,11 +215,11 @@ urndis_ctrl_recv(struct urndis_softc *sc) return pkt; } -urndis_status +u_int32_t urndis_ctrl_handle(struct urndis_softc *sc, struct urndis_comp_hdr *hdr, void **buf, size_t *bufsz) { - urndis_status rval; + u_int32_t rval; DPRINTF(("%s: urndis_ctrl_handle\n", DEVNAME(sc))); @@ -257,7 +257,7 @@ urndis_ctrl_handle(struct urndis_softc *sc, struct urndis_comp_hdr *hdr, return rval; } -urndis_status +u_int32_t urndis_ctrl_handle_init(struct urndis_softc *sc, const struct urndis_comp_hdr *hdr) { const struct urndis_init_comp *msg; @@ -311,7 +311,7 @@ urndis_ctrl_handle_init(struct urndis_softc *sc, const struct urndis_comp_hdr *h return letoh32(msg->rm_status); } -urndis_status +u_int32_t urndis_ctrl_handle_query(struct urndis_softc *sc, const struct urndis_comp_hdr *hdr, void **buf, size_t *bufsz) { @@ -374,12 +374,12 @@ urndis_ctrl_handle_query(struct urndis_softc *sc, return letoh32(msg->rm_status); } -urndis_status +u_int32_t urndis_ctrl_handle_reset(struct urndis_softc *sc, const struct urndis_comp_hdr *hdr) { const struct urndis_reset_comp *msg; - urndis_status rval; + u_int32_t rval; msg = (struct urndis_reset_comp *) hdr; @@ -413,11 +413,11 @@ urndis_ctrl_handle_reset(struct urndis_softc *sc, return rval; } -urndis_status +u_int32_t urndis_ctrl_init(struct urndis_softc *sc) { struct urndis_init_req *msg; - urndis_status rval; + u_int32_t rval; struct urndis_comp_hdr *hdr; msg = malloc(sizeof(*msg), M_TEMP, M_WAITOK); @@ -460,11 +460,11 @@ urndis_ctrl_init(struct urndis_softc *sc) return rval; } -urndis_status +u_int32_t urndis_ctrl_halt(struct urndis_softc *sc) { struct urndis_halt_req *msg; - urndis_status rval; + u_int32_t rval; msg = malloc(sizeof(*msg), M_TEMP, M_WAITOK); if (msg == NULL) { @@ -491,13 +491,13 @@ urndis_ctrl_halt(struct urndis_softc *sc) return rval; } -urndis_status -urndis_ctrl_query(struct urndis_softc *sc, urndis_oid oid, +u_int32_t +urndis_ctrl_query(struct urndis_softc *sc, u_int32_t oid, void *qbuf, size_t qlen, void **rbuf, size_t *rbufsz) { struct urndis_query_req *msg; - urndis_status rval; + u_int32_t rval; struct urndis_comp_hdr *hdr; msg = malloc(sizeof(*msg) + qlen, M_TEMP, M_WAITOK); @@ -546,11 +546,11 @@ urndis_ctrl_query(struct urndis_softc *sc, urndis_oid oid, return rval; } -urndis_status -urndis_ctrl_set(struct urndis_softc *sc, urndis_oid oid, void *buf, size_t len) +u_int32_t +urndis_ctrl_set(struct urndis_softc *sc, u_int32_t oid, void *buf, size_t len) { struct urndis_set_req *msg; - urndis_status rval; + u_int32_t rval; struct urndis_comp_hdr *hdr; msg = malloc(sizeof(*msg) + len, M_TEMP, M_WAITOK); @@ -601,12 +601,12 @@ urndis_ctrl_set(struct urndis_softc *sc, urndis_oid oid, void *buf, size_t len) return rval; } -urndis_status +u_int32_t urndis_ctrl_set_param(struct urndis_softc *sc, const char *name, u_int32_t type, void *buf, size_t len) { struct urndis_set_parameter *param; - urndis_status rval; + u_int32_t rval; size_t namelen, tlen; if (name) @@ -652,11 +652,11 @@ urndis_ctrl_set_param(struct urndis_softc *sc, const char *name, u_int32_t type, } /* XXX : adrreset, get it from response */ -urndis_status +u_int32_t urndis_ctrl_reset(struct urndis_softc *sc) { struct urndis_reset_req *reset; - urndis_status rval; + u_int32_t rval; struct urndis_comp_hdr *hdr; reset = malloc(sizeof(*reset), M_TEMP, M_WAITOK); @@ -692,11 +692,11 @@ urndis_ctrl_reset(struct urndis_softc *sc) return rval; } -urndis_status +u_int32_t urndis_ctrl_keepalive(struct urndis_softc *sc) { struct urndis_keepalive_req *keep; - urndis_status rval; + u_int32_t rval; struct urndis_comp_hdr *hdr; keep = malloc(sizeof(*keep), M_TEMP, M_WAITOK); diff --git a/sys/dev/usb/if_urndisreg.h b/sys/dev/usb/if_urndisreg.h index ace3482b9fe..a5b9134c82c 100644 --- a/sys/dev/usb/if_urndisreg.h +++ b/sys/dev/usb/if_urndisreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urndisreg.h,v 1.5 2010/03/02 20:54:27 mk Exp $ */ +/* $OpenBSD: if_urndisreg.h,v 1.6 2010/03/03 19:01:03 mk Exp $ */ /* * Copyright (c) 2010 Jonathan Armani <dbd@asystant.net> @@ -68,8 +68,6 @@ struct urndis_softc { struct urndis_cdata sc_data; }; -typedef u_int32_t urndis_status; - #define RNDIS_STATUS_BUFFER_OVERFLOW 0x80000005L #define RNDIS_STATUS_FAILURE 0xC0000001L #define RNDIS_STATUS_INVALID_DATA 0xC0010015L @@ -80,10 +78,6 @@ typedef u_int32_t urndis_status; #define RNDIS_STATUS_RESOURCES 0xC000009AL #define RNDIS_STATUS_SUCCESS 0x00000000L -typedef u_int32_t urndis_req_id; /* seq nr. */ - -typedef u_int32_t urndis_oid; - #define OID_GEN_SUPPORTED_LIST 0x00010101 #define OID_GEN_HARDWARE_STATUS 0x00010102 #define OID_GEN_MEDIA_SUPPORTED 0x00010103 @@ -113,7 +107,6 @@ typedef u_int32_t urndis_oid; #define OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B #define OID_GEN_VLAN_ID 0x0001021C - #define OID_802_3_PERMANENT_ADDRESS 0x01010101 #define OID_802_3_CURRENT_ADDRESS 0x01010102 #define OID_802_3_MULTICAST_LIST 0x01010103 @@ -130,7 +123,6 @@ typedef u_int32_t urndis_oid; #define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206 #define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207 -typedef u_int32_t urndis_medium; #define RNDIS_MEDIUM_802_3 0x00000000 /* Device flags */ @@ -162,8 +154,8 @@ struct urndis_packet_msg { struct urndis_comp_hdr { u_int32_t rm_type; u_int32_t rm_len; - urndis_req_id rm_rid; - urndis_status rm_status; + u_int32_t rm_rid; + u_int32_t rm_status; }; /* Initialize the device. */ @@ -173,7 +165,7 @@ struct urndis_comp_hdr { struct urndis_init_req { u_int32_t rm_type; u_int32_t rm_len; - urndis_req_id rm_rid; + u_int32_t rm_rid; u_int32_t rm_ver_major; u_int32_t rm_ver_minor; u_int32_t rm_max_xfersz; @@ -182,12 +174,12 @@ struct urndis_init_req { struct urndis_init_comp { u_int32_t rm_type; u_int32_t rm_len; - urndis_req_id rm_rid; - urndis_status rm_status; + u_int32_t rm_rid; + u_int32_t rm_status; u_int32_t rm_ver_major; u_int32_t rm_ver_minor; u_int32_t rm_devflags; - urndis_medium rm_medium; + u_int32_t rm_medium; u_int32_t rm_pktmaxcnt; u_int32_t rm_pktmaxsz; u_int32_t rm_align; @@ -201,7 +193,7 @@ struct urndis_init_comp { struct urndis_halt_req { u_int32_t rm_type; u_int32_t rm_len; - urndis_req_id rm_rid; + u_int32_t rm_rid; }; /* Send a query object. */ @@ -211,8 +203,8 @@ struct urndis_halt_req { struct urndis_query_req { u_int32_t rm_type; u_int32_t rm_len; - urndis_req_id rm_rid; - urndis_oid rm_oid; + u_int32_t rm_rid; + u_int32_t rm_oid; u_int32_t rm_infobuflen; u_int32_t rm_infobufoffset; u_int32_t rm_devicevchdl; @@ -221,8 +213,8 @@ struct urndis_query_req { struct urndis_query_comp { u_int32_t rm_type; u_int32_t rm_len; - urndis_req_id rm_rid; - urndis_status rm_status; + u_int32_t rm_rid; + u_int32_t rm_status; u_int32_t rm_infobuflen; u_int32_t rm_infobufoffset; }; @@ -234,8 +226,8 @@ struct urndis_query_comp { struct urndis_set_req { u_int32_t rm_type; u_int32_t rm_len; - urndis_req_id rm_rid; - urndis_oid rm_oid; + u_int32_t rm_rid; + u_int32_t rm_oid; u_int32_t rm_infobuflen; u_int32_t rm_infobufoffset; u_int32_t rm_devicevchdl; @@ -244,8 +236,8 @@ struct urndis_set_req { struct urndis_set_comp { u_int32_t rm_type; u_int32_t rm_len; - urndis_req_id rm_rid; - urndis_status rm_status; + u_int32_t rm_rid; + u_int32_t rm_status; }; #define REMOTE_NDIS_SET_PARAM_NUMERIC 0x00000000 @@ -266,13 +258,13 @@ struct urndis_set_parameter { struct urndis_reset_req { u_int32_t rm_type; u_int32_t rm_len; - urndis_req_id rm_rid; + u_int32_t rm_rid; }; struct urndis_reset_comp { u_int32_t rm_type; u_int32_t rm_len; - urndis_status rm_status; + u_int32_t rm_status; u_int32_t rm_adrreset; }; @@ -286,14 +278,14 @@ struct urndis_reset_comp { struct urndis_keepalive_req { u_int32_t rm_type; u_int32_t rm_len; - urndis_req_id rm_rid; + u_int32_t rm_rid; }; struct urndis_keepalive_comp { u_int32_t rm_type; u_int32_t rm_len; - urndis_req_id rm_rid; - urndis_status rm_status; + u_int32_t rm_rid; + u_int32_t rm_status; }; /* packet filter bits used by OID_GEN_CURRENT_PACKET_FILTER */ |