summaryrefslogtreecommitdiff
path: root/sys/dev/usb/uvscom.c
diff options
context:
space:
mode:
authorMarc Balmer <mbalmer@cvs.openbsd.org>2007-06-10 14:49:02 +0000
committerMarc Balmer <mbalmer@cvs.openbsd.org>2007-06-10 14:49:02 +0000
commitb36c9f662da72870bf22394171cf74a54a7f8e39 (patch)
tree2641ee87f027aa978ea64bc95fe33bcf03d1d500 /sys/dev/usb/uvscom.c
parent2bca40ff67d19c516b42ca70c28870f34f7388dc (diff)
Remove the definition and use of the USBDEVNAME macro.
(This might look easy, but it was a big diff. Thanks to dlg and especially jsg for looking over it; we found at least four mistakes in the initial diff.) ok jsg.
Diffstat (limited to 'sys/dev/usb/uvscom.c')
-rw-r--r--sys/dev/usb/uvscom.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/sys/dev/usb/uvscom.c b/sys/dev/usb/uvscom.c
index b05eb731c92..4c11affacad 100644
--- a/sys/dev/usb/uvscom.c
+++ b/sys/dev/usb/uvscom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvscom.c,v 1.14 2007/06/10 10:53:49 mbalmer Exp $ */
+/* $OpenBSD: uvscom.c,v 1.15 2007/06/10 14:49:01 mbalmer Exp $ */
/* $NetBSD: uvscom.c,v 1.9 2003/02/12 15:36:20 ichiro Exp $ */
/*-
* Copyright (c) 2001-2002, Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
@@ -231,7 +231,7 @@ uvscom_attach(struct device *parent, struct device *self, void *aux)
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
char *devinfop;
- const char *devname = USBDEVNAME(sc->sc_dev);
+ const char *devname = sc->sc_dev.dv_xname;
usbd_status err;
int i;
struct ucom_attach_args uca;
@@ -263,7 +263,7 @@ uvscom_attach(struct device *parent, struct device *self, void *aux)
if (cdesc == NULL) {
printf("%s: failed to get configuration descriptor\n",
- USBDEVNAME(sc->sc_dev));
+ sc->sc_dev.dv_xname);
sc->sc_dying = 1;
return;
}
@@ -286,7 +286,7 @@ uvscom_attach(struct device *parent, struct device *self, void *aux)
ed = usbd_interface2endpoint_descriptor(sc->sc_iface, i);
if (ed == NULL) {
printf("%s: no endpoint descriptor for %d\n",
- USBDEVNAME(sc->sc_dev), i);
+ sc->sc_dev.dv_xname, i);
sc->sc_dying = 1;
return;
}
@@ -306,19 +306,19 @@ uvscom_attach(struct device *parent, struct device *self, void *aux)
if (uca.bulkin == -1) {
printf("%s: Could not find data bulk in\n",
- USBDEVNAME(sc->sc_dev));
+ sc->sc_dev.dv_xname);
sc->sc_dying = 1;
return;
}
if (uca.bulkout == -1) {
printf("%s: Could not find data bulk out\n",
- USBDEVNAME(sc->sc_dev));
+ sc->sc_dev.dv_xname);
sc->sc_dying = 1;
return;
}
if (sc->sc_intr_number == -1) {
printf("%s: Could not find interrupt in\n",
- USBDEVNAME(sc->sc_dev));
+ sc->sc_dev.dv_xname);
sc->sc_dying = 1;
return;
}
@@ -341,7 +341,7 @@ uvscom_attach(struct device *parent, struct device *self, void *aux)
err = uvscom_reset(sc);
if (err) {
- printf("%s: reset failed, %s\n", USBDEVNAME(sc->sc_dev),
+ printf("%s: reset failed, %s\n", sc->sc_dev.dv_xname,
usbd_errstr(err));
sc->sc_dying = 1;
return;
@@ -413,7 +413,7 @@ uvscom_readstat(struct uvscom_softc *sc)
usbd_status err;
uint16_t r;
- DPRINTF(("%s: send readstat\n", USBDEVNAME(sc->sc_dev)));
+ DPRINTF(("%s: send readstat\n", sc->sc_dev.dv_xname));
req.bmRequestType = UT_READ_VENDOR_DEVICE;
req.bRequest = UVSCOM_READ_STATUS;
@@ -424,12 +424,12 @@ uvscom_readstat(struct uvscom_softc *sc)
err = usbd_do_request(sc->sc_udev, &req, &r);
if (err) {
printf("%s: uvscom_readstat: %s\n",
- USBDEVNAME(sc->sc_dev), usbd_errstr(err));
+ sc->sc_dev.dv_xname, usbd_errstr(err));
return (err);
}
DPRINTF(("%s: uvscom_readstat: r = %d\n",
- USBDEVNAME(sc->sc_dev), r));
+ sc->sc_dev.dv_xname, r));
return (USBD_NORMAL_COMPLETION);
}
@@ -440,7 +440,7 @@ uvscom_shutdown(struct uvscom_softc *sc)
usb_device_request_t req;
usbd_status err;
- DPRINTF(("%s: send shutdown\n", USBDEVNAME(sc->sc_dev)));
+ DPRINTF(("%s: send shutdown\n", sc->sc_dev.dv_xname));
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
req.bRequest = UVSCOM_SHUTDOWN;
@@ -451,7 +451,7 @@ uvscom_shutdown(struct uvscom_softc *sc)
err = usbd_do_request(sc->sc_udev, &req, NULL);
if (err) {
printf("%s: uvscom_shutdown: %s\n",
- USBDEVNAME(sc->sc_dev), usbd_errstr(err));
+ sc->sc_dev.dv_xname, usbd_errstr(err));
return (err);
}
@@ -461,7 +461,7 @@ uvscom_shutdown(struct uvscom_softc *sc)
usbd_status
uvscom_reset(struct uvscom_softc *sc)
{
- DPRINTF(("%s: uvscom_reset\n", USBDEVNAME(sc->sc_dev)));
+ DPRINTF(("%s: uvscom_reset\n", sc->sc_dev.dv_xname));
return (USBD_NORMAL_COMPLETION);
}
@@ -469,7 +469,7 @@ uvscom_reset(struct uvscom_softc *sc)
usbd_status
uvscom_set_crtscts(struct uvscom_softc *sc)
{
- DPRINTF(("%s: uvscom_set_crtscts\n", USBDEVNAME(sc->sc_dev)));
+ DPRINTF(("%s: uvscom_set_crtscts\n", sc->sc_dev.dv_xname));
return (USBD_NORMAL_COMPLETION);
}
@@ -481,7 +481,7 @@ uvscom_set_line(struct uvscom_softc *sc, uint16_t line)
usbd_status err;
DPRINTF(("%s: uvscom_set_line: %04x\n",
- USBDEVNAME(sc->sc_dev), line));
+ sc->sc_dev.dv_xname, line));
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
req.bRequest = UVSCOM_LINE_CTL;
@@ -492,7 +492,7 @@ uvscom_set_line(struct uvscom_softc *sc, uint16_t line)
err = usbd_do_request(sc->sc_udev, &req, NULL);
if (err) {
printf("%s: uvscom_set_line: %s\n",
- USBDEVNAME(sc->sc_dev), usbd_errstr(err));
+ sc->sc_dev.dv_xname, usbd_errstr(err));
return (err);
}
@@ -506,7 +506,7 @@ uvscom_set_line_coding(struct uvscom_softc *sc, uint16_t lsp, uint16_t ls)
usbd_status err;
DPRINTF(("%s: uvscom_set_line_coding: %02x %02x\n",
- USBDEVNAME(sc->sc_dev), lsp, ls));
+ sc->sc_dev.dv_xname, lsp, ls));
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
req.bRequest = UVSCOM_SET_SPEED;
@@ -517,7 +517,7 @@ uvscom_set_line_coding(struct uvscom_softc *sc, uint16_t lsp, uint16_t ls)
err = usbd_do_request(sc->sc_udev, &req, NULL);
if (err) {
printf("%s: uvscom_set_line_coding: %s\n",
- USBDEVNAME(sc->sc_dev), usbd_errstr(err));
+ sc->sc_dev.dv_xname, usbd_errstr(err));
return (err);
}
@@ -530,7 +530,7 @@ uvscom_set_line_coding(struct uvscom_softc *sc, uint16_t lsp, uint16_t ls)
err = usbd_do_request(sc->sc_udev, &req, NULL);
if (err) {
printf("%s: uvscom_set_line_coding: %s\n",
- USBDEVNAME(sc->sc_dev), usbd_errstr(err));
+ sc->sc_dev.dv_xname, usbd_errstr(err));
return (err);
}
@@ -541,7 +541,7 @@ void
uvscom_dtr(struct uvscom_softc *sc, int onoff)
{
DPRINTF(("%s: uvscom_dtr: onoff = %d\n",
- USBDEVNAME(sc->sc_dev), onoff));
+ sc->sc_dev.dv_xname, onoff));
if (sc->sc_dtr == onoff)
return; /* no change */
@@ -560,7 +560,7 @@ void
uvscom_rts(struct uvscom_softc *sc, int onoff)
{
DPRINTF(("%s: uvscom_rts: onoff = %d\n",
- USBDEVNAME(sc->sc_dev), onoff));
+ sc->sc_dev.dv_xname, onoff));
if (sc->sc_rts == onoff)
return; /* no change */
@@ -579,7 +579,7 @@ void
uvscom_break(struct uvscom_softc *sc, int onoff)
{
DPRINTF(("%s: uvscom_break: onoff = %d\n",
- USBDEVNAME(sc->sc_dev), onoff));
+ sc->sc_dev.dv_xname, onoff));
if (onoff)
uvscom_set_line(sc, SET(sc->sc_lcr, UVSCOM_BREAK));
@@ -614,7 +614,7 @@ uvscom_param(void *addr, int portno, struct termios *t)
uint16_t ls;
DPRINTF(("%s: uvscom_param: sc = %p\n",
- USBDEVNAME(sc->sc_dev), sc));
+ sc->sc_dev.dv_xname, sc));
ls = 0;
@@ -719,7 +719,7 @@ uvscom_open(void *addr, int portno)
err = uvscom_readstat(sc);
if (err) {
DPRINTF(("%s: uvscom_open: readstat faild\n",
- USBDEVNAME(sc->sc_dev)));
+ sc->sc_dev.dv_xname));
return (EIO);
}
@@ -735,7 +735,7 @@ uvscom_open(void *addr, int portno)
UVSCOM_INTR_INTERVAL);
if (err) {
printf("%s: cannot open interrupt pipe (addr %d)\n",
- USBDEVNAME(sc->sc_dev),
+ sc->sc_dev.dv_xname,
sc->sc_intr_number);
return (EIO);
}
@@ -753,14 +753,14 @@ uvscom_open(void *addr, int portno)
}
if (i == 0) {
DPRINTF(("%s: unit is not ready\n",
- USBDEVNAME(sc->sc_dev)));
+ sc->sc_dev.dv_xname));
return (EIO);
}
/* check PC card was inserted */
if (ISSET(sc->sc_usr, UVSCOM_NOCARD)) {
DPRINTF(("%s: no card\n",
- USBDEVNAME(sc->sc_dev)));
+ sc->sc_dev.dv_xname));
return (EIO);
}
}
@@ -785,12 +785,12 @@ uvscom_close(void *addr, int portno)
err = usbd_abort_pipe(sc->sc_intr_pipe);
if (err)
printf("%s: abort interrupt pipe failed: %s\n",
- USBDEVNAME(sc->sc_dev),
+ sc->sc_dev.dv_xname,
usbd_errstr(err));
err = usbd_close_pipe(sc->sc_intr_pipe);
if (err)
printf("%s: close interrupt pipe failed: %s\n",
- USBDEVNAME(sc->sc_dev),
+ sc->sc_dev.dv_xname,
usbd_errstr(err));
free(sc->sc_intr_buf, M_USBDEV);
sc->sc_intr_pipe = NULL;
@@ -812,14 +812,14 @@ uvscom_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
return;
printf("%s: uvscom_intr: abnormal status: %s\n",
- USBDEVNAME(sc->sc_dev),
+ sc->sc_dev.dv_xname,
usbd_errstr(status));
usbd_clear_endpoint_stall_async(sc->sc_intr_pipe);
return;
}
DPRINTFN(2, ("%s: uvscom status = %02x %02x\n",
- USBDEVNAME(sc->sc_dev), buf[0], buf[1]));
+ sc->sc_dev.dv_xname, buf[0], buf[1]));
sc->sc_lsr = sc->sc_msr = 0;
sc->sc_usr = buf[1];