Deleted Added
full compact
dump.c (185087) dump.c (188622)
1/* $FreeBSD: head/usr.sbin/usbconfig/dump.c 185087 2008-11-19 08:56:35Z alfred $ */
1/* $FreeBSD: head/usr.sbin/usbconfig/dump.c 188622 2009-02-14 23:20:00Z thompsa $ */
2/*-
3 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.

--- 161 unchanged lines hidden (view full) ---

171 for (z = 0; z != iface->num_endpoints; z++) {
172 printf("\n Endpoint %u\n", z);
173 dump_endpoint(pdev, iface->endpoints + z);
174 }
175 return;
176}
177
178void
2/*-
3 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.

--- 161 unchanged lines hidden (view full) ---

171 for (z = 0; z != iface->num_endpoints; z++) {
172 printf("\n Endpoint %u\n", z);
173 dump_endpoint(pdev, iface->endpoints + z);
174 }
175 return;
176}
177
178void
179dump_device_info(struct libusb20_device *pdev)
179dump_device_info(struct libusb20_device *pdev, uint8_t show_ifdrv)
180{
180{
181 char buf[128];
182 uint8_t n;
183
181 printf("%s, cfg=%u md=%s spd=%s pwr=%s\n",
182 libusb20_dev_get_desc(pdev),
183 libusb20_dev_get_config_index(pdev),
184 dump_mode(libusb20_dev_get_mode(pdev)),
185 dump_speed(libusb20_dev_get_speed(pdev)),
186 dump_power_mode(libusb20_dev_get_power_mode(pdev)));
184 printf("%s, cfg=%u md=%s spd=%s pwr=%s\n",
185 libusb20_dev_get_desc(pdev),
186 libusb20_dev_get_config_index(pdev),
187 dump_mode(libusb20_dev_get_mode(pdev)),
188 dump_speed(libusb20_dev_get_speed(pdev)),
189 dump_power_mode(libusb20_dev_get_power_mode(pdev)));
187 return;
190
191 if (!show_ifdrv)
192 return;
193
194 for (n = 0; n != 255; n++) {
195 if (libusb20_dev_get_iface_desc(pdev, n, buf, sizeof(buf)))
196 break;
197 if (buf[0] == 0)
198 continue;
199 printf("ugen%u.%u.%u: %s\n",
200 libusb20_dev_get_bus_number(pdev),
201 libusb20_dev_get_address(pdev), n, buf);
202 }
188}
189
190void
191dump_be_quirk_names(struct libusb20_backend *pbe)
192{
193 struct libusb20_quirk q;
194 uint16_t x;
195 int error;

--- 138 unchanged lines hidden (view full) ---

334 if ((error = libusb20_dev_get_iface_perm(pdev, iface, &mode))) {
335 return (error);
336 }
337 if (mode) {
338
339 owner = (pw = getpwuid(uid)) ? pw->pw_name : "UNKNOWN";
340 group = (gr = getgrgid(gid)) ? gr->gr_name : "UNKNOWN";
341
203}
204
205void
206dump_be_quirk_names(struct libusb20_backend *pbe)
207{
208 struct libusb20_quirk q;
209 uint16_t x;
210 int error;

--- 138 unchanged lines hidden (view full) ---

349 if ((error = libusb20_dev_get_iface_perm(pdev, iface, &mode))) {
350 return (error);
351 }
352 if (mode) {
353
354 owner = (pw = getpwuid(uid)) ? pw->pw_name : "UNKNOWN";
355 group = (gr = getgrgid(gid)) ? gr->gr_name : "UNKNOWN";
356
342 printf(" " "Interface %u Access: %s:%s 0%o\n", iface, owner, group, mode);
357 printf(" " "Interface %u Access: %s:%s 0%o\n",
358 iface, owner, group, mode);
343 } else {
344 printf(" " "Interface %u Access: <not set>\n", iface);
345 }
346
347 return (0);
348}
349
350void

--- 57 unchanged lines hidden ---
359 } else {
360 printf(" " "Interface %u Access: <not set>\n", iface);
361 }
362
363 return (0);
364}
365
366void

--- 57 unchanged lines hidden ---