summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Binkert <nate@cvs.openbsd.org>2002-05-02 20:12:08 +0000
committerNathan Binkert <nate@cvs.openbsd.org>2002-05-02 20:12:08 +0000
commitf07d7c31ba96273b45789c7dc139aa7f7949c5b7 (patch)
treebc509479859adb833173f259e27a8359bc66a627
parent587cdcf5ce16c5aed5152f0f3d18dd160f0b0298 (diff)
userland portion of prefixing usb structure members to avoid name clashes.
From NetBSD
-rw-r--r--lib/libusbhid/descr.c6
-rw-r--r--usr.bin/usbhidctl/usbhid.c14
-rw-r--r--usr.sbin/usbdevs/usbdevs.c28
3 files changed, 24 insertions, 24 deletions
diff --git a/lib/libusbhid/descr.c b/lib/libusbhid/descr.c
index e6bb8c4f2a1..7366784338b 100644
--- a/lib/libusbhid/descr.c
+++ b/lib/libusbhid/descr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: descr.c,v 1.1 2001/12/30 07:04:38 pvalchev Exp $ */
+/* $OpenBSD: descr.c,v 1.2 2002/05/02 20:12:07 nate Exp $ */
/* $NetBSD: descr.c,v 1.9 2000/09/24 02:13:24 augustss Exp $ */
/*
@@ -45,11 +45,11 @@ hid_get_report_desc(int fd)
{
struct usb_ctl_report_desc rep;
- rep.size = 0;
+ rep.ucrd_size = 0;
if (ioctl(fd, USB_GET_REPORT_DESC, &rep) < 0)
return (NULL);
- return hid_use_report_desc(rep.data, (unsigned int)rep.size);
+ return hid_use_report_desc(rep.ucrd_data, (unsigned int)rep.ucrd_size);
}
report_desc_t
diff --git a/usr.bin/usbhidctl/usbhid.c b/usr.bin/usbhidctl/usbhid.c
index 6630ad8f156..1751eb8d1ea 100644
--- a/usr.bin/usbhidctl/usbhid.c
+++ b/usr.bin/usbhidctl/usbhid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbhid.c,v 1.2 2001/12/30 07:10:42 pvalchev Exp $ */
+/* $OpenBSD: usbhid.c,v 1.3 2002/05/02 20:12:07 nate Exp $ */
/* $NetBSD: usbhid.c,v 1.17 2001/03/28 03:17:42 simonb Exp $ */
/*
@@ -274,7 +274,7 @@ allocreport(struct Sreport *report, report_desc_t rd, int repindex)
* report in the variable-sized data field.
*/
report->buffer = malloc(sizeof(*report->buffer) -
- sizeof(report->buffer->data) +
+ sizeof(report->buffer->ucr_data) +
report->size);
if (report->buffer == NULL)
err(1, NULL);
@@ -300,7 +300,7 @@ getreport(struct Sreport *report, int hidfd, report_desc_t rd, int repindex)
if (report->size == 0)
return;
- report->buffer->report = reptoparam[repindex].uhid_report;
+ report->buffer->ucr_report = reptoparam[repindex].uhid_report;
if (ioctl(hidfd, USB_GET_REPORT, report->buffer) < 0)
err(1, "USB_GET_REPORT");
}
@@ -310,7 +310,7 @@ static void
setreport(struct Sreport *report, int hidfd, int repindex)
{
if (report->status == srs_dirty) {
- report->buffer->report = reptoparam[repindex].uhid_report;
+ report->buffer->ucr_report = reptoparam[repindex].uhid_report;
if (ioctl(hidfd, USB_SET_REPORT, report->buffer) < 0)
err(1, "USB_SET_REPORT(%s)",
@@ -440,7 +440,7 @@ devloop(int hidfd, report_desc_t rd, struct Susbvar *varlist, size_t vlsize)
errx(1, "Input report descriptor invalid length");
dlen = inreport.size;
- dbuf = inreport.buffer->data;
+ dbuf = inreport.buffer->ucr_data;
for (;;) {
ssize_t readlen;
@@ -482,7 +482,7 @@ devloop(int hidfd, report_desc_t rd, struct Susbvar *varlist, size_t vlsize)
if (matchvar != NULL)
matchvar->opfunc(&hitem, matchvar,
colls, collind,
- inreport.buffer->data);
+ inreport.buffer->ucr_data);
}
hid_end_parse(hdata);
printf("\n");
@@ -560,7 +560,7 @@ devshow(int hidfd, report_desc_t rd, struct Susbvar *varlist, size_t vlsize,
getreport(repptr, hidfd, rd, repindex);
bufdata = (repptr == NULL || repptr->buffer == NULL) ?
- NULL : repptr->buffer->data;
+ NULL : repptr->buffer->ucr_data;
if (matchvar->opfunc(&hitem, matchvar, colls, collind,
bufdata))
diff --git a/usr.sbin/usbdevs/usbdevs.c b/usr.sbin/usbdevs/usbdevs.c
index 6fa3d0d4e51..8a07c829b4f 100644
--- a/usr.sbin/usbdevs/usbdevs.c
+++ b/usr.sbin/usbdevs/usbdevs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdevs.c,v 1.3 2002/02/16 21:28:10 millert Exp $ */
+/* $OpenBSD: usbdevs.c,v 1.4 2002/05/02 20:12:07 nate Exp $ */
/* $NetBSD: usbdevs.c,v 1.11 1999/09/08 02:39:36 augustss Exp $ */
/*
@@ -80,7 +80,7 @@ usbdev(f, a, rec)
struct usb_device_info di;
int e, p, i;
- di.addr = a;
+ di.udi_addr = a;
e = ioctl(f, USB_DEVICEINFO, &di);
if (e) {
if (errno != ENXIO)
@@ -90,34 +90,34 @@ usbdev(f, a, rec)
printf("addr %d: ", a);
done[a] = 1;
if (verbose) {
- if (di.lowspeed)
+ if (di.udi_lowspeed)
printf("low speed, ");
- if (di.power)
- printf("power %d mA, ", di.power);
+ if (di.udi_power)
+ printf("power %d mA, ", di.udi_power);
else
printf("self powered, ");
- if (di.config)
- printf("config %d, ", di.config);
+ if (di.udi_config)
+ printf("config %d, ", di.udi_config);
else
printf("unconfigured, ");
}
if (verbose) {
printf("%s(0x%04x), %s(0x%04x), rev %s",
- di.product, di.productNo,
- di.vendor, di.vendorNo, di.release);
+ di.udi_product, di.udi_productNo,
+ di.udi_vendor, di.udi_vendorNo, di.udi_release);
} else
- printf("%s, %s", di.product, di.vendor);
+ printf("%s, %s", di.udi_product, di.udi_vendor);
printf("\n");
if (showdevs) {
for (i = 0; i< USB_MAX_DEVNAMES; i++)
- if (di.devnames[i][0])
+ if (di.udi_devnames[i][0])
printf("%*s %s\n", indent, "",
- di.devnames[i]);
+ di.udi_devnames[i]);
}
if (!rec)
return;
- for (p = 0; p < di.nports; p++) {
- int s = di.ports[p];
+ for (p = 0; p < di.udi_nports; p++) {
+ int s = di.udi_ports[p];
if (s >= USB_MAX_DEVICES) {
if (verbose) {
printf("%*sport %d %s\n", indent+1, "", p+1,