USB: use opaque parameter passing for monitor handle
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
1e43a8e4d2
commit
179da8afe6
@ -552,13 +552,12 @@ static const char *usb_class_str(uint8_t class)
|
|||||||
return p->class_name;
|
return p->class_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void usb_info_device(int bus_num, int addr, int class_id,
|
static void usb_info_device(Monitor *mon, int bus_num, int addr, int class_id,
|
||||||
int vendor_id, int product_id,
|
int vendor_id, int product_id,
|
||||||
const char *product_name,
|
const char *product_name,
|
||||||
int speed)
|
int speed)
|
||||||
{
|
{
|
||||||
const char *class_str, *speed_str;
|
const char *class_str, *speed_str;
|
||||||
Monitor *mon = cur_mon;
|
|
||||||
|
|
||||||
switch(speed) {
|
switch(speed) {
|
||||||
case USB_SPEED_LOW:
|
case USB_SPEED_LOW:
|
||||||
@ -595,14 +594,16 @@ static int usb_host_info_device(void *opaque,
|
|||||||
const char *product_name,
|
const char *product_name,
|
||||||
int speed)
|
int speed)
|
||||||
{
|
{
|
||||||
usb_info_device(bus_num, addr, class_id, vendor_id, product_id,
|
Monitor *mon = opaque;
|
||||||
|
|
||||||
|
usb_info_device(mon, bus_num, addr, class_id, vendor_id, product_id,
|
||||||
product_name, speed);
|
product_name, speed);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void usb_host_info(Monitor *mon)
|
void usb_host_info(Monitor *mon)
|
||||||
{
|
{
|
||||||
usb_host_scan(NULL, usb_host_info_device);
|
usb_host_scan(mon, usb_host_info_device);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX add this */
|
/* XXX add this */
|
||||||
|
@ -1605,12 +1605,11 @@ static const char *usb_class_str(uint8_t class)
|
|||||||
return p->class_name;
|
return p->class_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void usb_info_device(int bus_num, int addr, int class_id,
|
static void usb_info_device(Monitor *mon, int bus_num, int addr, int class_id,
|
||||||
int vendor_id, int product_id,
|
int vendor_id, int product_id,
|
||||||
const char *product_name,
|
const char *product_name,
|
||||||
int speed)
|
int speed)
|
||||||
{
|
{
|
||||||
Monitor *mon = cur_mon;
|
|
||||||
const char *class_str, *speed_str;
|
const char *class_str, *speed_str;
|
||||||
|
|
||||||
switch(speed) {
|
switch(speed) {
|
||||||
@ -1647,7 +1646,9 @@ static int usb_host_info_device(void *opaque, int bus_num, int addr,
|
|||||||
const char *product_name,
|
const char *product_name,
|
||||||
int speed)
|
int speed)
|
||||||
{
|
{
|
||||||
usb_info_device(bus_num, addr, class_id, vendor_id, product_id,
|
Monitor *mon = opaque;
|
||||||
|
|
||||||
|
usb_info_device(mon, bus_num, addr, class_id, vendor_id, product_id,
|
||||||
product_name, speed);
|
product_name, speed);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1672,7 +1673,7 @@ void usb_host_info(Monitor *mon)
|
|||||||
{
|
{
|
||||||
struct USBAutoFilter *f;
|
struct USBAutoFilter *f;
|
||||||
|
|
||||||
usb_host_scan(NULL, usb_host_info_device);
|
usb_host_scan(mon, usb_host_info_device);
|
||||||
|
|
||||||
if (usb_auto_filter)
|
if (usb_auto_filter)
|
||||||
monitor_printf(mon, " Auto filters:\n");
|
monitor_printf(mon, " Auto filters:\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user