diff options
| author | christos <christos@NetBSD.org> | 2005-05-30 04:21:39 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2005-05-30 04:21:39 +0000 |
| commit | a9cf21849d56808807544bd5e7c3cc4494bab1d2 (patch) | |
| tree | e3a672f3d9877f04277cfab3519592a036a7df23 /sys/dev/usb | |
| parent | 2f27be7da035eb0777912478c32c391b5c3e1f37 (diff) | |
- const poisoning
- eliminate variable shadowing
Diffstat (limited to 'sys/dev/usb')
| -rw-r--r-- | sys/dev/usb/ehci.c | 14 | ||||
| -rw-r--r-- | sys/dev/usb/ezload.h | 4 | ||||
| -rw-r--r-- | sys/dev/usb/hid.h | 18 | ||||
| -rw-r--r-- | sys/dev/usb/if_aue.c | 6 | ||||
| -rw-r--r-- | sys/dev/usb/if_axe.c | 6 | ||||
| -rw-r--r-- | sys/dev/usb/if_cdce.c | 16 | ||||
| -rw-r--r-- | sys/dev/usb/if_kue.c | 13 | ||||
| -rw-r--r-- | sys/dev/usb/if_udav.c | 6 | ||||
| -rw-r--r-- | sys/dev/usb/if_url.c | 6 | ||||
| -rw-r--r-- | sys/dev/usb/uaudio.c | 72 | ||||
| -rw-r--r-- | sys/dev/usb/ucom.c | 6 | ||||
| -rw-r--r-- | sys/dev/usb/ugen.c | 40 | ||||
| -rw-r--r-- | sys/dev/usb/uhci.c | 8 | ||||
| -rw-r--r-- | sys/dev/usb/ulpt.c | 8 | ||||
| -rw-r--r-- | sys/dev/usb/umct.c | 10 | ||||
| -rw-r--r-- | sys/dev/usb/umidi_quirks.c | 6 | ||||
| -rw-r--r-- | sys/dev/usb/umodem_common.c | 10 | ||||
| -rw-r--r-- | sys/dev/usb/usbdi.c | 10 | ||||
| -rw-r--r-- | sys/dev/usb/usbdi.h | 14 | ||||
| -rw-r--r-- | sys/dev/usb/usbdi_util.h | 18 | ||||
| -rw-r--r-- | sys/dev/usb/uvisor.c | 6 | ||||
| -rw-r--r-- | sys/dev/usb/uyap_firmware.h | 4 |
22 files changed, 152 insertions, 149 deletions
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index ff6118b9799..adebaa23708 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.103 2005/05/05 20:54:34 augustss Exp $ */ +/* $NetBSD: ehci.c,v 1.104 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 2004,2005 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.103 2005/05/05 20:54:34 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.104 2005/05/30 04:21:39 christos Exp $"); #include "ohci.h" #include "uhci.h" @@ -186,7 +186,7 @@ Static void ehci_device_isoc_done(usbd_xfer_handle); Static void ehci_device_clear_toggle(usbd_pipe_handle pipe); Static void ehci_noop(usbd_pipe_handle pipe); -Static int ehci_str(usb_string_descriptor_t *, int, char *); +Static int ehci_str(usb_string_descriptor_t *, int, const char *); Static void ehci_pcd(ehci_softc_t *, usbd_xfer_handle); Static void ehci_pcd_able(ehci_softc_t *, int); Static void ehci_pcd_enable(void *); @@ -322,7 +322,7 @@ static uint8_t revbits[EHCI_MAX_POLLRATE] = { usbd_status ehci_init(ehci_softc_t *sc) { - u_int32_t version, sparams, cparams, hcr; + u_int32_t vers, sparams, cparams, hcr; u_int i; usbd_status err; ehci_soft_qh_t *sqh; @@ -335,9 +335,9 @@ ehci_init(ehci_softc_t *sc) sc->sc_offs = EREAD1(sc, EHCI_CAPLENGTH); - version = EREAD2(sc, EHCI_HCIVERSION); + vers = EREAD2(sc, EHCI_HCIVERSION); aprint_normal("%s: EHCI version %x.%x\n", USBDEVNAME(sc->sc_bus.bdev), - version >> 8, version & 0xff); + vers >> 8, vers & 0xff); sparams = EREAD4(sc, EHCI_HCSPARAMS); DPRINTF(("ehci_init: sparams=0x%x\n", sparams)); @@ -1629,7 +1629,7 @@ Static usb_hub_descriptor_t ehci_hubd = { }; Static int -ehci_str(usb_string_descriptor_t *p, int l, char *s) +ehci_str(usb_string_descriptor_t *p, int l, const char *s) { int i; diff --git a/sys/dev/usb/ezload.h b/sys/dev/usb/ezload.h index ccd17e20873..1b18f23363a 100644 --- a/sys/dev/usb/ezload.h +++ b/sys/dev/usb/ezload.h @@ -1,4 +1,4 @@ -/* $NetBSD: ezload.h,v 1.2 2001/01/18 20:28:23 jdolecek Exp $ */ +/* $NetBSD: ezload.h,v 1.3 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ struct ezdata { u_int8_t length; u_int16_t address; - u_int8_t *data; + const u_int8_t *data; }; usbd_status ezload_reset(usbd_device_handle, int); diff --git a/sys/dev/usb/hid.h b/sys/dev/usb/hid.h index 3d98f2dc620..8d527c8e794 100644 --- a/sys/dev/usb/hid.h +++ b/sys/dev/usb/hid.h @@ -1,4 +1,4 @@ -/* $NetBSD: hid.h,v 1.8 2002/07/11 21:14:25 augustss Exp $ */ +/* $NetBSD: hid.h,v 1.9 2005/05/30 04:21:39 christos Exp $ */ /* $FreeBSD: src/sys/dev/usb/hid.h,v 1.7 1999/11/17 22:33:40 n_hibma Exp $ */ /* @@ -85,11 +85,11 @@ struct hid_item { struct hid_item *next; }; -struct hid_data *hid_start_parse(void *d, int len, enum hid_kind kind); -void hid_end_parse(struct hid_data *s); -int hid_get_item(struct hid_data *s, struct hid_item *h); -int hid_report_size(void *buf, int len, enum hid_kind k, u_int8_t id); -int hid_locate(void *desc, int size, u_int32_t usage, u_int8_t id, - enum hid_kind kind, struct hid_location *loc, u_int32_t *flags); -u_long hid_get_data(u_char *buf, struct hid_location *loc); -int hid_is_collection(void *desc, int size, u_int8_t id, u_int32_t usage); +struct hid_data *hid_start_parse(void *, int, enum hid_kind); +void hid_end_parse(struct hid_data *); +int hid_get_item(struct hid_data *, struct hid_item *); +int hid_report_size(void *, int, enum hid_kind, u_int8_t); +int hid_locate(void *, int, u_int32_t, u_int8_t, enum hid_kind, + struct hid_location *, u_int32_t *); +u_long hid_get_data(u_char *, struct hid_location *); +int hid_is_collection(void *, int, u_int8_t, u_int32_t); diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index 148ab36cad7..48f04dd1f01 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_aue.c,v 1.90 2005/05/11 10:02:28 augustss Exp $ */ +/* $NetBSD: if_aue.c,v 1.91 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.90 2005/05/11 10:02:28 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.91 2005/05/30 04:21:39 christos Exp $"); #if defined(__NetBSD__) #include "opt_inet.h" @@ -230,7 +230,7 @@ Static const struct aue_type aue_devs[] = { {{ USB_VENDOR_SMC, USB_PRODUCT_SMC_2206USB}, PII }, {{ USB_VENDOR_SOHOWARE, USB_PRODUCT_SOHOWARE_NUB100}, 0 }, }; -#define aue_lookup(v, p) ((struct aue_type *)usb_lookup(aue_devs, v, p)) +#define aue_lookup(v, p) ((const struct aue_type *)usb_lookup(aue_devs, v, p)) USB_DECLARE_DRIVER(aue); diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index 6c14acfb0a9..5089e3786fc 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_axe.c,v 1.8 2005/05/11 10:02:28 augustss Exp $ */ +/* $NetBSD: if_axe.c,v 1.9 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.8 2005/05/11 10:02:28 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.9 2005/05/30 04:21:39 christos Exp $"); #if defined(__NetBSD__) #include "opt_inet.h" @@ -167,7 +167,7 @@ Static const struct axe_type axe_devs[] = { { { USB_VENDOR_SITECOM, USB_PRODUCT_SITECOM_LN029}, 0 }, { { USB_VENDOR_SYSTEMTALKS, USB_PRODUCT_SYSTEMTALKS_SGCX2UL}, 0 }, }; -#define axe_lookup(v, p) ((struct axe_type *)usb_lookup(axe_devs, v, p)) +#define axe_lookup(v, p) ((const struct axe_type *)usb_lookup(axe_devs, v, p)) USB_DECLARE_DRIVER(axe); diff --git a/sys/dev/usb/if_cdce.c b/sys/dev/usb/if_cdce.c index aeaafab976e..c2271c25824 100644 --- a/sys/dev/usb/if_cdce.c +++ b/sys/dev/usb/if_cdce.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cdce.c,v 1.6 2005/05/11 10:02:28 augustss Exp $ */ +/* $NetBSD: if_cdce.c,v 1.7 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com> @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.6 2005/05/11 10:02:28 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.7 2005/05/30 04:21:39 christos Exp $"); #include "bpfilter.h" #include <sys/param.h> @@ -184,7 +184,7 @@ USB_ATTACH(cdce) if (sc->cdce_flags & CDCE_NO_UNION) sc->cdce_data_iface = sc->cdce_ctl_iface; else { - ud = (usb_cdc_union_descriptor_t *)usb_find_desc(sc->cdce_udev, + ud = (const usb_cdc_union_descriptor_t *)usb_find_desc(sc->cdce_udev, UDESC_CS_INTERFACE, UDESCSUB_CDC_UNION); if (ud == NULL) { printf("%s: no union descriptor\n", @@ -248,7 +248,7 @@ USB_ATTACH(cdce) USB_ATTACH_ERROR_RETURN; } - ue = (usb_cdc_ethernet_descriptor_t *)usb_find_desc(dev, + ue = (const usb_cdc_ethernet_descriptor_t *)usb_find_desc(dev, UDESC_INTERFACE, UDESCSUB_CDC_ENF); if (!ue || usbd_get_string(dev, ue->iMacAddress, eaddr_str)) { printf("%s: faking address\n", USBDEVNAME(sc->cdce_dev)); @@ -256,11 +256,11 @@ USB_ATTACH(cdce) memcpy(&eaddr[1], &hardclock_ticks, sizeof(u_int32_t)); eaddr[5] = (u_int8_t)(sc->cdce_dev.dv_unit); } else { - int i; + int j; memset(eaddr, 0, ETHER_ADDR_LEN); - for (i = 0; i < ETHER_ADDR_LEN * 2; i++) { - int c = eaddr_str[i]; + for (j = 0; j < ETHER_ADDR_LEN * 2; j++) { + int c = eaddr_str[j]; if ('0' <= c && c <= '9') c -= '0'; @@ -269,7 +269,7 @@ USB_ATTACH(cdce) c &= 0xf; if (c%2 == 0) c <<= 4; - eaddr[i / 2] |= c; + eaddr[j / 2] |= c; } } diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index 0916628d179..c1ef5cd9958 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_kue.c,v 1.53 2005/05/11 10:02:28 augustss Exp $ */ +/* $NetBSD: if_kue.c,v 1.54 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. @@ -70,7 +70,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.53 2005/05/11 10:02:28 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.54 2005/05/30 04:21:39 christos Exp $"); #if defined(__NetBSD__) #include "opt_inet.h" @@ -281,8 +281,9 @@ kue_load_fw(struct kue_softc *sc) /* Load code segment */ DPRINTFN(1,("%s: kue_load_fw: download code_seg\n", USBDEVNAME(sc->kue_dev))); + /*XXXUNCONST*/ err = kue_ctl(sc, KUE_CTL_WRITE, KUE_CMD_SEND_SCAN, - 0, (void *)kue_code_seg, sizeof(kue_code_seg)); + 0, __UNCONST(kue_code_seg), sizeof(kue_code_seg)); if (err) { printf("%s: failed to load code segment: %s\n", USBDEVNAME(sc->kue_dev), usbd_errstr(err)); @@ -292,8 +293,9 @@ kue_load_fw(struct kue_softc *sc) /* Load fixup segment */ DPRINTFN(1,("%s: kue_load_fw: download fix_seg\n", USBDEVNAME(sc->kue_dev))); + /*XXXUNCONST*/ err = kue_ctl(sc, KUE_CTL_WRITE, KUE_CMD_SEND_SCAN, - 0, (void *)kue_fix_seg, sizeof(kue_fix_seg)); + 0, __UNCONST(kue_fix_seg), sizeof(kue_fix_seg)); if (err) { printf("%s: failed to load fixup segment: %s\n", USBDEVNAME(sc->kue_dev), usbd_errstr(err)); @@ -303,8 +305,9 @@ kue_load_fw(struct kue_softc *sc) /* Send trigger command. */ DPRINTFN(1,("%s: kue_load_fw: download trig_seg\n", USBDEVNAME(sc->kue_dev))); + /*XXXUNCONST*/ err = kue_ctl(sc, KUE_CTL_WRITE, KUE_CMD_SEND_SCAN, - 0, (void *)kue_trig_seg, sizeof(kue_trig_seg)); + 0, __UNCONST(kue_trig_seg), sizeof(kue_trig_seg)); if (err) { printf("%s: failed to load trigger segment: %s\n", USBDEVNAME(sc->kue_dev), usbd_errstr(err)); diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c index aeeba6f2d53..04681624b7f 100644 --- a/sys/dev/usb/if_udav.c +++ b/sys/dev/usb/if_udav.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_udav.c,v 1.6 2005/05/11 10:02:28 augustss Exp $ */ +/* $NetBSD: if_udav.c,v 1.7 2005/05/30 04:21:39 christos Exp $ */ /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ /* * Copyright (c) 2003 @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.6 2005/05/11 10:02:28 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.7 2005/05/30 04:21:39 christos Exp $"); #include "opt_inet.h" #include "opt_ns.h" @@ -162,7 +162,7 @@ static const struct udav_type { {{ 0x0a46, 0x9601 }, 0}, #endif }; -#define udav_lookup(v, p) ((struct udav_type *)usb_lookup(udav_devs, v, p)) +#define udav_lookup(v, p) ((const struct udav_type *)usb_lookup(udav_devs, v, p)) /* Probe */ diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c index 426cb4eafa6..848565d93c3 100644 --- a/sys/dev/usb/if_url.c +++ b/sys/dev/usb/if_url.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_url.c,v 1.16 2005/05/11 10:02:28 augustss Exp $ */ +/* $NetBSD: if_url.c,v 1.17 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 2001, 2002 * Shingo WATANABE <nabe@nabechan.org>. All rights reserved. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.16 2005/05/11 10:02:28 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.17 2005/05/30 04:21:39 christos Exp $"); #include "opt_inet.h" #include "opt_ns.h" @@ -167,7 +167,7 @@ static const struct url_type { /* OQO model 01 */ {{ USB_VENDOR_OQO, USB_PRODUCT_OQO_ETHER01}, 0}, }; -#define url_lookup(v, p) ((struct url_type *)usb_lookup(url_devs, v, p)) +#define url_lookup(v, p) ((const struct url_type *)usb_lookup(url_devs, v, p)) /* Probe */ diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c index 1c06cb7dccf..e0b2085783f 100644 --- a/sys/dev/usb/uaudio.c +++ b/sys/dev/usb/uaudio.c @@ -1,4 +1,4 @@ -/* $NetBSD: uaudio.c,v 1.98 2005/05/11 10:02:28 augustss Exp $ */ +/* $NetBSD: uaudio.c,v 1.99 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.98 2005/05/11 10:02:28 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.99 2005/05/30 04:21:39 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -107,7 +107,7 @@ struct mixerctl { u_int mul; uint8_t class; char ctlname[MAX_AUDIO_DEV_LEN]; - char *ctlunit; + const char *ctlunit; }; #define MAKE(h,l) (((h) << 8) | (l)) @@ -531,12 +531,12 @@ uaudio_query_encoding(void *addr, struct audio_encoding *fp) } Static const usb_interface_descriptor_t * -uaudio_find_iface(const char *buf, int size, int *offsp, int subtype) +uaudio_find_iface(const char *tbuf, int size, int *offsp, int subtype) { const usb_interface_descriptor_t *d; while (*offsp < size) { - d = (const void *)(buf + *offsp); + d = (const void *)(tbuf + *offsp); *offsp += d->bLength; if (d->bDescriptorType == UDESC_INTERFACE && d->bInterfaceClass == UICLASS_AUDIO && @@ -617,10 +617,10 @@ uaudio_mixer_add_ctl(struct uaudio_softc *sc, struct mixerctl *mc) Static char * uaudio_id_name(struct uaudio_softc *sc, const struct io_terminal *iot, int id) { - static char buf[32]; + static char tbuf[32]; - snprintf(buf, sizeof(buf), "i%d", id); - return buf; + snprintf(tbuf, sizeof(tbuf), "i%d", id); + return tbuf; } #ifdef UAUDIO_DEBUG @@ -671,7 +671,7 @@ uaudio_get_cluster(int id, const struct io_terminal *iot) id = iot[id].d.ot->bSourceId; break; case UDESCSUB_AC_MIXER: - r = *(struct usb_audio_cluster *) + r = *(const struct usb_audio_cluster *) &iot[id].d.mu->baSourceId[iot[id].d.mu->bNrInPins]; return r; case UDESCSUB_AC_SELECTOR: @@ -682,11 +682,11 @@ uaudio_get_cluster(int id, const struct io_terminal *iot) id = iot[id].d.fu->bSourceId; break; case UDESCSUB_AC_PROCESSING: - r = *(struct usb_audio_cluster *) + r = *(const struct usb_audio_cluster *) &iot[id].d.pu->baSourceId[iot[id].d.pu->bNrInPins]; return r; case UDESCSUB_AC_EXTENSION: - r = *(struct usb_audio_cluster *) + r = *(const struct usb_audio_cluster *) &iot[id].d.eu->baSourceId[iot[id].d.eu->bNrInPins]; return r; default: @@ -738,9 +738,9 @@ Static void uaudio_add_mixer(struct uaudio_softc *sc, const struct io_terminal *iot, int id) { const struct usb_audio_mixer_unit *d; - struct usb_audio_mixer_unit_1 *d1; + const struct usb_audio_mixer_unit_1 *d1; int c, chs, ichs, ochs, i, o, bno, p, mo, mc, k; - uByte *bm; + const uByte *bm; struct mixerctl mix; d = iot[id].d.mu; @@ -753,7 +753,7 @@ uaudio_add_mixer(struct uaudio_softc *sc, const struct io_terminal *iot, int id) ichs += uaudio_get_cluster(d->baSourceId[i], iot).bNrChannels; /* and the number of output channels */ - d1 = (struct usb_audio_mixer_unit_1 *)&d->baSourceId[d->bNrInPins]; + d1 = (const struct usb_audio_mixer_unit_1 *)&d->baSourceId[d->bNrInPins]; ochs = d1->bNrChannels; DPRINTFN(2,("uaudio_add_mixer: ichs=%d ochs=%d\n", ichs, ochs)); @@ -832,7 +832,7 @@ uaudio_add_selector(struct uaudio_softc *sc, const struct io_terminal *iot, int Static const char * uaudio_get_terminal_name(int terminal_type) { - static char buf[100]; + static char tbuf[100]; switch (terminal_type) { /* USB terminal types */ @@ -899,8 +899,8 @@ uaudio_get_terminal_name(int terminal_type) case UATF_MULTITRACK: return "UATF_MULTITRACK"; case UATF_SYNTHESIZER: return "UATF_SYNTHESIZER"; default: - snprintf(buf, sizeof(buf), "unknown type (0x%.4x)", terminal_type); - return buf; + snprintf(tbuf, sizeof(tbuf), "unknown type (0x%.4x)", terminal_type); + return tbuf; } } #endif @@ -1507,7 +1507,7 @@ uaudio_add_alt(struct uaudio_softc *sc, const struct as_info *ai) } Static usbd_status -uaudio_process_as(struct uaudio_softc *sc, const char *buf, int *offsp, +uaudio_process_as(struct uaudio_softc *sc, const char *tbuf, int *offsp, int size, const usb_interface_descriptor_t *id) #define offs (*offsp) { @@ -1521,7 +1521,7 @@ uaudio_process_as(struct uaudio_softc *sc, const char *buf, int *offsp, struct as_info ai; const char *format_str; - asid = (const void *)(buf + offs); + asid = (const void *)(tbuf + offs); if (asid->bDescriptorType != UDESC_CS_INTERFACE || asid->bDescriptorSubtype != AS_GENERAL) return USBD_INVAL; @@ -1531,7 +1531,7 @@ uaudio_process_as(struct uaudio_softc *sc, const char *buf, int *offsp, if (offs > size) return USBD_INVAL; - asf1d = (const void *)(buf + offs); + asf1d = (const void *)(tbuf + offs); if (asf1d->bDescriptorType != UDESC_CS_INTERFACE || asf1d->bDescriptorSubtype != FORMAT_TYPE) return USBD_INVAL; @@ -1545,7 +1545,7 @@ uaudio_process_as(struct uaudio_softc *sc, const char *buf, int *offsp, return USBD_NORMAL_COMPLETION; } - ed = (const void *)(buf + offs); + ed = (const void *)(tbuf + offs); if (ed->bDescriptorType != UDESC_ENDPOINT) return USBD_INVAL; DPRINTF(("uaudio_process_as: endpoint[0] bLength=%d bDescriptorType=%d " @@ -1585,7 +1585,7 @@ uaudio_process_as(struct uaudio_softc *sc, const char *buf, int *offsp, #endif } - sed = (const void *)(buf + offs); + sed = (const void *)(tbuf + offs); if (sed->bDescriptorType != UDESC_CS_ENDPOINT || sed->bDescriptorSubtype != AS_GENERAL) return USBD_INVAL; @@ -1606,7 +1606,7 @@ uaudio_process_as(struct uaudio_softc *sc, const char *buf, int *offsp, } epdesc1 = NULL; if (id->bNumEndpoints > 1) { - epdesc1 = (const void*)(buf + offs); + epdesc1 = (const void*)(tbuf + offs); if (epdesc1->bDescriptorType != UDESC_ENDPOINT) return USBD_INVAL; DPRINTF(("uaudio_process_as: endpoint[1] bLength=%d " @@ -1722,18 +1722,18 @@ uaudio_identify_as(struct uaudio_softc *sc, const usb_config_descriptor_t *cdesc) { const usb_interface_descriptor_t *id; - const char *buf; + const char *tbuf; struct audio_format *auf; const struct usb_audio_streaming_type1_descriptor *t1desc; int size, offs; int i, j; size = UGETW(cdesc->wTotalLength); - buf = (const char *)cdesc; + tbuf = (const char *)cdesc; /* Locate the AudioStreaming interface descriptor. */ offs = 0; - id = uaudio_find_iface(buf, size, &offs, UISUBCLASS_AUDIOSTREAM); + id = uaudio_find_iface(tbuf, size, &offs, UISUBCLASS_AUDIOSTREAM); if (id == NULL) return USBD_INVAL; @@ -1751,7 +1751,7 @@ uaudio_identify_as(struct uaudio_softc *sc, #ifdef UAUDIO_MULTIPLE_ENDPOINTS case 2: #endif - uaudio_process_as(sc, buf, &offs, size, id); + uaudio_process_as(sc, tbuf, &offs, size, id); break; default: printf("%s: ignored audio interface with %d " @@ -1759,7 +1759,7 @@ uaudio_identify_as(struct uaudio_softc *sc, USBDEVNAME(sc->sc_dev), id->bNumEndpoints); break; } - id = uaudio_find_iface(buf, size, &offs,UISUBCLASS_AUDIOSTREAM); + id = uaudio_find_iface(tbuf, size, &offs,UISUBCLASS_AUDIOSTREAM); if (id == NULL) break; } @@ -1829,15 +1829,15 @@ uaudio_identify_ac(struct uaudio_softc *sc, const usb_config_descriptor_t *cdesc const usb_descriptor_t *dp; const struct usb_audio_output_terminal *pot; struct terminal_list *tml; - const char *buf, *ibuf, *ibufend; + const char *tbuf, *ibuf, *ibufend; int size, offs, aclen, ndps, i, j; size = UGETW(cdesc->wTotalLength); - buf = (char *)cdesc; + tbuf = (const char *)cdesc; /* Locate the AudioControl interface descriptor. */ offs = 0; - id = uaudio_find_iface(buf, size, &offs, UISUBCLASS_AUDIOCONTROL); + id = uaudio_find_iface(tbuf, size, &offs, UISUBCLASS_AUDIOCONTROL); if (id == NULL) return USBD_INVAL; if (offs + sizeof *acdp > size) @@ -1846,7 +1846,7 @@ uaudio_identify_ac(struct uaudio_softc *sc, const usb_config_descriptor_t *cdesc DPRINTFN(2,("uaudio_identify_ac: AC interface is %d\n", sc->sc_ac_iface)); /* A class-specific AC interface header should follow. */ - ibuf = buf + offs; + ibuf = tbuf + offs; acdp = (const struct usb_audio_control_descriptor *)ibuf; if (acdp->bDescriptorType != UDESC_CS_INTERFACE || acdp->bDescriptorSubtype != UDESCSUB_AC_HEADER) @@ -2658,7 +2658,7 @@ Static usbd_status uaudio_chan_alloc_buffers(struct uaudio_softc *sc, struct chan *ch) { usbd_xfer_handle xfer; - void *buf; + void *tbuf; int i, size; size = (ch->bytes_per_frame + ch->sample_size) * UAUDIO_NFRAMES; @@ -2667,12 +2667,12 @@ uaudio_chan_alloc_buffers(struct uaudio_softc *sc, struct chan *ch) if (xfer == 0) goto bad; ch->chanbufs[i].xfer = xfer; - buf = usbd_alloc_buffer(xfer, size); - if (buf == 0) { + tbuf = usbd_alloc_buffer(xfer, size); + if (tbuf == 0) { i++; goto bad; } - ch->chanbufs[i].buffer = buf; + ch->chanbufs[i].buffer = tbuf; ch->chanbufs[i].chan = ch; } diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c index c0b7725554b..d4841315d59 100644 --- a/sys/dev/usb/ucom.c +++ b/sys/dev/usb/ucom.c @@ -1,4 +1,4 @@ -/* $NetBSD: ucom.c,v 1.54 2005/05/18 11:26:11 augustss Exp $ */ +/* $NetBSD: ucom.c,v 1.55 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.54 2005/05/18 11:26:11 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.55 2005/05/30 04:21:39 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1045,7 +1045,7 @@ ucomreadcb(usbd_xfer_handle xfer, usbd_private_handle p, usbd_status status) { struct ucom_softc *sc = (struct ucom_softc *)p; struct tty *tp = sc->sc_tty; - int (*rint)(int c, struct tty *tp) = tp->t_linesw->l_rint; + int (*rint)(int, struct tty *) = tp->t_linesw->l_rint; usbd_status err; u_int32_t cc; u_char *cp; diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index b4a3d9955a0..dfd80ee0f47 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -1,4 +1,4 @@ -/* $NetBSD: ugen.c,v 1.73 2005/05/17 14:53:06 augustss Exp $ */ +/* $NetBSD: ugen.c,v 1.74 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.73 2005/05/17 14:53:06 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.74 2005/05/30 04:21:39 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -322,7 +322,7 @@ ugenopen(dev_t dev, int flag, int mode, usb_proc_ptr p) int dir, isize; usbd_status err; usbd_xfer_handle xfer; - void *buf; + void *tbuf; int i, j; USB_GET_SC_OPEN(ugen, unit, sc); @@ -421,13 +421,13 @@ ugenopen(dev_t dev, int flag, int mode, usb_proc_ptr p) if (xfer == 0) goto bad; sce->isoreqs[i].xfer = xfer; - buf = usbd_alloc_buffer + tbuf = usbd_alloc_buffer (xfer, isize * UGEN_NISORFRMS); - if (buf == 0) { + if (tbuf == 0) { i++; goto bad; } - sce->isoreqs[i].dmabuf = buf; + sce->isoreqs[i].dmabuf = tbuf; for(j = 0; j < UGEN_NISORFRMS; ++j) sce->isoreqs[i].sizes[j] = isize; usbd_setup_isoc_xfer @@ -521,7 +521,7 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) { struct ugen_endpoint *sce = &sc->sc_endpoints[endpt][IN]; u_int32_t n, tn; - char buf[UGEN_BBSIZE]; + char tbuf[UGEN_BBSIZE]; usbd_xfer_handle xfer; usbd_status err; int s; @@ -596,7 +596,7 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) xfer, sce->pipeh, sce->state & UGEN_SHORT_OK ? USBD_SHORT_XFER_OK : 0, - sce->timeout, buf, &tn, "ugenrb"); + sce->timeout, tbuf, &tn, "ugenrb"); if (err) { if (err == USBD_INTERRUPTED) error = EINTR; @@ -607,7 +607,7 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) break; } DPRINTFN(1, ("ugenread: got %d bytes\n", tn)); - error = uiomove(buf, tn, uio); + error = uiomove(tbuf, tn, uio); if (error || tn < n) break; } @@ -680,7 +680,7 @@ ugen_do_write(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) struct ugen_endpoint *sce = &sc->sc_endpoints[endpt][OUT]; u_int32_t n; int error = 0; - char buf[UGEN_BBSIZE]; + char tbuf[UGEN_BBSIZE]; usbd_xfer_handle xfer; usbd_status err; @@ -709,12 +709,12 @@ ugen_do_write(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) if (xfer == 0) return (EIO); while ((n = min(UGEN_BBSIZE, uio->uio_resid)) != 0) { - error = uiomove(buf, n, uio); + error = uiomove(tbuf, n, uio); if (error) break; DPRINTFN(1, ("ugenwrite: transfer %d bytes\n", n)); err = usbd_bulk_transfer(xfer, sce->pipeh, 0, - sce->timeout, buf, &n,"ugenwb"); + sce->timeout, tbuf, &n,"ugenwb"); if (err) { if (err == USBD_INTERRUPTED) error = EINTR; @@ -733,12 +733,12 @@ ugen_do_write(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) return (EIO); while ((n = min(UGETW(sce->edesc->wMaxPacketSize), uio->uio_resid)) != 0) { - error = uiomove(buf, n, uio); + error = uiomove(tbuf, n, uio); if (error) break; DPRINTFN(1, ("ugenwrite: transfer %d bytes\n", n)); err = usbd_intr_transfer(xfer, sce->pipeh, 0, - sce->timeout, buf, &n, "ugenwi"); + sce->timeout, tbuf, &n, "ugenwi"); if (err) { if (err == USBD_INTERRUPTED) error = EINTR; @@ -913,14 +913,14 @@ ugen_isoc_rintr(usbd_xfer_handle xfer, usbd_private_handle addr, isize = UGETW(sce->edesc->wMaxPacketSize); for (i = 0; i < UGEN_NISORFRMS; i++) { u_int32_t actlen = req->sizes[i]; - char const *buf = (char const *)req->dmabuf + isize * i; + char const *tbuf = (char const *)req->dmabuf + isize * i; /* copy data to buffer */ while (actlen > 0) { n = min(actlen, sce->limit - sce->fill); - memcpy(sce->fill, buf, n); + memcpy(sce->fill, tbuf, n); - buf += n; + tbuf += n; actlen -= n; sce->fill += n; if(sce->fill == sce->limit) @@ -1250,7 +1250,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, struct iovec iov; struct uio uio; void *ptr = 0; - usbd_status err; + usbd_status xerr; int error = 0; if (!(flag & FWRITE)) @@ -1286,9 +1286,9 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, } } sce = &sc->sc_endpoints[endpt][IN]; - err = usbd_do_request_flags(sc->sc_udev, &ur->ucr_request, + xerr = usbd_do_request_flags(sc->sc_udev, &ur->ucr_request, ptr, ur->ucr_flags, &ur->ucr_actlen, sce->timeout); - if (err) { + if (xerr) { error = EIO; goto ret; } diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index ca2893700be..eebde27adbb 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -1,4 +1,4 @@ -/* $NetBSD: uhci.c,v 1.188 2005/04/30 14:38:40 augustss Exp $ */ +/* $NetBSD: uhci.c,v 1.189 2005/05/30 04:21:39 christos Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */ /* @@ -49,7 +49,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.188 2005/04/30 14:38:40 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.189 2005/05/30 04:21:39 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -198,7 +198,7 @@ Static void uhci_add_bulk(uhci_softc_t *, uhci_soft_qh_t *); Static void uhci_remove_ls_ctrl(uhci_softc_t *,uhci_soft_qh_t *); Static void uhci_remove_hs_ctrl(uhci_softc_t *,uhci_soft_qh_t *); Static void uhci_remove_bulk(uhci_softc_t *,uhci_soft_qh_t *); -Static int uhci_str(usb_string_descriptor_t *, int, char *); +Static int uhci_str(usb_string_descriptor_t *, int, const char *); Static void uhci_add_loop(uhci_softc_t *sc); Static void uhci_rem_loop(uhci_softc_t *sc); @@ -3025,7 +3025,7 @@ usb_hub_descriptor_t uhci_hubd_piix = { }; int -uhci_str(usb_string_descriptor_t *p, int l, char *s) +uhci_str(usb_string_descriptor_t *p, int l, const char *s) { int i; diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c index 6d3de337754..d17c2c13146 100644 --- a/sys/dev/usb/ulpt.c +++ b/sys/dev/usb/ulpt.c @@ -1,4 +1,4 @@ -/* $NetBSD: ulpt.c,v 1.68 2005/05/23 16:35:26 soren Exp $ */ +/* $NetBSD: ulpt.c,v 1.69 2005/05/30 04:21:39 christos Exp $ */ /* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */ /* @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ulpt.c,v 1.68 2005/05/23 16:35:26 soren Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ulpt.c,v 1.69 2005/05/30 04:21:39 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -222,7 +222,7 @@ USB_ATTACH(ulpt) usbd_device_handle dev = uaa->device; usbd_interface_handle iface = uaa->iface; usb_interface_descriptor_t *ifcd = usbd_get_interface_descriptor(iface); - usb_interface_descriptor_t *id; + const usb_interface_descriptor_t *id; usbd_status err; char *devinfop; usb_endpoint_descriptor_t *ed; @@ -241,7 +241,7 @@ USB_ATTACH(ulpt) /* Loop through descriptors looking for a bidir mode. */ usb_desc_iter_init(dev, &iter); for (altno = 0;;) { - id = (usb_interface_descriptor_t *)usb_desc_iter_next(&iter); + id = (const usb_interface_descriptor_t *)usb_desc_iter_next(&iter); if (!id) break; if (id->bDescriptorType == UDESC_INTERFACE && diff --git a/sys/dev/usb/umct.c b/sys/dev/usb/umct.c index 43c3839a74e..4bd3aa40009 100644 --- a/sys/dev/usb/umct.c +++ b/sys/dev/usb/umct.c @@ -1,4 +1,4 @@ -/* $NetBSD: umct.c,v 1.16 2005/05/11 10:02:28 augustss Exp $ */ +/* $NetBSD: umct.c,v 1.17 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: umct.c,v 1.16 2005/05/11 10:02:28 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: umct.c,v 1.17 2005/05/30 04:21:39 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -595,7 +595,7 @@ void umct_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) { struct umct_softc *sc = priv; - u_char *buf = sc->sc_intr_buf; + u_char *tbuf = sc->sc_intr_buf; u_char mstatus; if (sc->sc_dying) @@ -612,10 +612,10 @@ umct_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) } DPRINTF(("%s: umct status = MSR:%02x, LSR:%02x\n", - USBDEVNAME(sc->sc_dev), buf[0],buf[1])); + USBDEVNAME(sc->sc_dev), tbuf[0],tbuf[1])); sc->sc_lsr = sc->sc_msr = 0; - mstatus = buf[0]; + mstatus = tbuf[0]; if (ISSET(mstatus, MSR_DSR)) sc->sc_msr |= UMSR_DSR; if (ISSET(mstatus, MSR_DCD)) diff --git a/sys/dev/usb/umidi_quirks.c b/sys/dev/usb/umidi_quirks.c index 72459803876..53ae62ce364 100644 --- a/sys/dev/usb/umidi_quirks.c +++ b/sys/dev/usb/umidi_quirks.c @@ -1,4 +1,4 @@ -/* $NetBSD: umidi_quirks.c,v 1.6 2003/12/04 13:57:31 keihan Exp $ */ +/* $NetBSD: umidi_quirks.c,v 1.7 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: umidi_quirks.c,v 1.6 2003/12/04 13:57:31 keihan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: umidi_quirks.c,v 1.7 2005/05/30 04:21:39 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -424,7 +424,7 @@ umidi_search_quirk(int vendor, int product, int ifaceno) return NULL; } -static char *quirk_name[] = { +static const char *quirk_name[] = { "NULL", "Fixed Endpoint", "Yamaha Specific", diff --git a/sys/dev/usb/umodem_common.c b/sys/dev/usb/umodem_common.c index 8194562e1d3..9e09120ccff 100644 --- a/sys/dev/usb/umodem_common.c +++ b/sys/dev/usb/umodem_common.c @@ -1,4 +1,4 @@ -/* $NetBSD: umodem_common.c,v 1.4 2005/05/11 10:02:28 augustss Exp $ */ +/* $NetBSD: umodem_common.c,v 1.5 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -51,7 +51,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: umodem_common.c,v 1.4 2005/05/11 10:02:28 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: umodem_common.c,v 1.5 2005/05/30 04:21:39 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -375,7 +375,7 @@ umodem_get_caps(usbd_device_handle dev, int *cm, int *acm, *cm = *acm = 0; - cmd = (usb_cdc_cm_descriptor_t *)usb_find_desc_if(dev, + cmd = (const usb_cdc_cm_descriptor_t *)usb_find_desc_if(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM, id); if (cmd == NULL) { @@ -384,7 +384,7 @@ umodem_get_caps(usbd_device_handle dev, int *cm, int *acm, *cm = cmd->bmCapabilities; } - cad = (usb_cdc_acm_descriptor_t *)usb_find_desc_if(dev, + cad = (const usb_cdc_acm_descriptor_t *)usb_find_desc_if(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_ACM, id); @@ -394,7 +394,7 @@ umodem_get_caps(usbd_device_handle dev, int *cm, int *acm, *acm = cad->bmCapabilities; } - cud = (usb_cdc_union_descriptor_t *)usb_find_desc_if(dev, + cud = (const usb_cdc_union_descriptor_t *)usb_find_desc_if(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_UNION, id); diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index 2f5d76c14e3..c89c5a2fc87 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.107 2005/05/02 15:32:18 augustss Exp $ */ +/* $NetBSD: usbdi.c,v 1.108 2005/05/30 04:21:39 christos Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ /* @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.107 2005/05/02 15:32:18 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.108 2005/05/30 04:21:39 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1148,8 +1148,8 @@ usb_desc_iter_init(usbd_device_handle dev, usbd_desc_iter_t *iter) { const usb_config_descriptor_t *cd = usbd_get_config_descriptor(dev); - iter->cur = (uByte *)cd; - iter->end = (uByte *)cd + UGETW(cd->wTotalLength); + iter->cur = (const uByte *)cd; + iter->end = (const uByte *)cd + UGETW(cd->wTotalLength); } const usb_descriptor_t * @@ -1162,7 +1162,7 @@ usb_desc_iter_next(usbd_desc_iter_t *iter) printf("usb_desc_iter_next: bad descriptor\n"); return NULL; } - desc = (usb_descriptor_t *)iter->cur; + desc = (const usb_descriptor_t *)iter->cur; if (desc->bLength == 0) { printf("usb_desc_iter_next: descriptor length = 0\n"); return NULL; diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h index d69b0be9247..9ffce4addda 100644 --- a/sys/dev/usb/usbdi.h +++ b/sys/dev/usb/usbdi.h @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.h,v 1.66 2005/05/23 16:35:27 soren Exp $ */ +/* $NetBSD: usbdi.h,v 1.67 2005/05/30 04:21:39 christos Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.h,v 1.18 1999/11/17 22:33:49 n_hibma Exp $ */ /* @@ -165,8 +165,8 @@ const char *usbd_errstr(usbd_status); void usbd_add_dev_event(int, usbd_device_handle); void usbd_add_drv_event(int, usbd_device_handle, device_ptr_t); -char *usbd_devinfo_alloc(usbd_device_handle dev, int showclass); -void usbd_devinfo_free(char *devinfop); +char *usbd_devinfo_alloc(usbd_device_handle, int); +void usbd_devinfo_free(char *); const struct usbd_quirks *usbd_get_quirks(usbd_device_handle); usb_endpoint_descriptor_t *usbd_get_endpoint_descriptor @@ -174,17 +174,17 @@ usb_endpoint_descriptor_t *usbd_get_endpoint_descriptor usbd_status usbd_reload_device_desc(usbd_device_handle); -int usbd_ratecheck(struct timeval *last); +int usbd_ratecheck(struct timeval *); -usbd_status usbd_get_string(usbd_device_handle dev, int si, char *buf); +usbd_status usbd_get_string(usbd_device_handle, int, char *); /* An iterator for descriptors. */ typedef struct { const uByte *cur; const uByte *end; } usbd_desc_iter_t; -void usb_desc_iter_init(usbd_device_handle dev, usbd_desc_iter_t *iter); -const usb_descriptor_t *usb_desc_iter_next(usbd_desc_iter_t *iter); +void usb_desc_iter_init(usbd_device_handle, usbd_desc_iter_t *); +const usb_descriptor_t *usb_desc_iter_next(usbd_desc_iter_t *); /* * The usb_task structs form a queue of things to run in the USB event diff --git a/sys/dev/usb/usbdi_util.h b/sys/dev/usb/usbdi_util.h index d046492f63f..789c3af9771 100644 --- a/sys/dev/usb/usbdi_util.h +++ b/sys/dev/usb/usbdi_util.h @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi_util.h,v 1.33 2005/04/12 13:10:14 itohy Exp $ */ +/* $NetBSD: usbdi_util.h,v 1.34 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. @@ -74,16 +74,16 @@ usbd_status usbd_get_string_desc(usbd_device_handle dev, int sindex, void usbd_delay_ms(usbd_device_handle, u_int); -usbd_status usbd_set_config_no(usbd_device_handle dev, int no, int msg); -usbd_status usbd_set_config_index(usbd_device_handle dev, int index, int msg); +usbd_status usbd_set_config_no(usbd_device_handle, int, int); +usbd_status usbd_set_config_index(usbd_device_handle, int, int); -usbd_status usbd_bulk_transfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe, - u_int16_t flags, u_int32_t timeout, void *buf, - u_int32_t *size, char *lbl); +usbd_status usbd_bulk_transfer(usbd_xfer_handle, usbd_pipe_handle, + u_int16_t, u_int32_t, void *, + u_int32_t *, const char *); -usbd_status usbd_intr_transfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe, - u_int16_t flags, u_int32_t timeout, void *buf, - u_int32_t *size, char *lbl); +usbd_status usbd_intr_transfer(usbd_xfer_handle, usbd_pipe_handle, + u_int16_t, u_int32_t, void *, + u_int32_t *, const char *); void usb_detach_wait(device_ptr_t); void usb_detach_wakeup(device_ptr_t); diff --git a/sys/dev/usb/uvisor.c b/sys/dev/usb/uvisor.c index 8cf55d8a040..c3996743308 100644 --- a/sys/dev/usb/uvisor.c +++ b/sys/dev/usb/uvisor.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvisor.c,v 1.29 2005/05/11 10:02:29 augustss Exp $ */ +/* $NetBSD: uvisor.c,v 1.30 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvisor.c,v 1.29 2005/05/11 10:02:29 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvisor.c,v 1.30 2005/05/30 04:21:39 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -195,7 +195,7 @@ static const struct uvisor_type uvisor_devs[] = { {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_35 }, 0 }, /* {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_25 }, PALM4 },*/ }; -#define uvisor_lookup(v, p) ((struct uvisor_type *)usb_lookup(uvisor_devs, v, p)) +#define uvisor_lookup(v, p) ((const struct uvisor_type *)usb_lookup(uvisor_devs, v, p)) USB_DECLARE_DRIVER(uvisor); diff --git a/sys/dev/usb/uyap_firmware.h b/sys/dev/usb/uyap_firmware.h index f6456450081..e474546eefc 100644 --- a/sys/dev/usb/uyap_firmware.h +++ b/sys/dev/usb/uyap_firmware.h @@ -1,4 +1,4 @@ -/* $NetBSD: uyap_firmware.h,v 1.3 2002/11/03 09:57:40 augustss Exp $ */ +/* $NetBSD: uyap_firmware.h,v 1.4 2005/05/30 04:21:39 christos Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#define U (u_int8_t *) +#define U (const u_int8_t *) {0x10,0x146C, U"\xC2\x00\x90\x7F\xA5\xE0\x54\x18\xFF\x13\x13\x13\x54\x1F\x44\x50"}, {0x10,0x147C, |
