Some work on the GTK USB debug dialogs.
- Added register view dialog support for xHCI ports. - Improved UHCI debug dialog (TODO: tree view, save to controller).
This commit is contained in:
parent
96709fbcef
commit
7260750f91
@ -47,7 +47,6 @@ const char *chkBXPN[6] = {BXPN_USB_DEBUG_RESET, BXPN_USB_DEBUG_ENABLE, BXPN_USB_
|
||||
|
||||
GtkWidget *main_dialog;
|
||||
GtkWidget *DFframe, *DFvbox, *checkbox[6];
|
||||
GtkWidget *apply_hbox, *apply_button;
|
||||
|
||||
// multithreading using pure posix threads -- not glib threads
|
||||
static void * EventLp(void *data)
|
||||
@ -177,6 +176,10 @@ static void usb_regview_dialog(GtkWidget *widget, gpointer data)
|
||||
gtk_widget_destroy(dialog);
|
||||
}
|
||||
|
||||
// Apply button support
|
||||
|
||||
GtkWidget *apply_button;
|
||||
|
||||
static void on_entry_changed(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
gtk_widget_set_sensitive(apply_button, 1);
|
||||
@ -192,17 +195,36 @@ static void apply_changes(GtkWidget *widget, gpointer data)
|
||||
gtk_widget_destroy(error);
|
||||
}
|
||||
|
||||
void usbdlg_create_apply_button(GtkWidget *vbox)
|
||||
{
|
||||
GtkWidget *apply_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), apply_hbox, FALSE, FALSE, 2);
|
||||
apply_button = gtk_button_new_with_label(g_dgettext("gtk30", "_Apply"));
|
||||
gtk_widget_set_sensitive(apply_button, 0);
|
||||
g_signal_connect(apply_button, "clicked", G_CALLBACK(apply_changes), NULL);
|
||||
gtk_box_pack_start(GTK_BOX(apply_hbox), apply_button, FALSE, FALSE, 2);
|
||||
}
|
||||
|
||||
// UHCI main dialog
|
||||
|
||||
int uhci_debug_dialog(int type, int param1)
|
||||
{
|
||||
bx_list_c *UHCI_state = NULL;
|
||||
int i, ret;
|
||||
Bit32u pci_bar_address, frame_addr, frame_num;
|
||||
char buffer[COMMON_STR_SIZE];
|
||||
GtkWidget *mainHbox, *BAhbox, *ORhbox, *PRhbox;
|
||||
GtkWidget *entry[11], *button[7];
|
||||
GtkWidget *vbox[3], *ORvbox[3], *PRvbox[3];
|
||||
GtkWidget *ORframe, *PRframe;
|
||||
usb_reg_t usb_reg_def[5];
|
||||
GtkWidget *mainVbox, *BAhbox, *hbox[2], *vbox[3], *entry[12];
|
||||
GtkWidget *ORframe, *ORhbox, *ORvbox[3];
|
||||
GtkWidget *PRframe, *PRhbox, *PRvbox[3];
|
||||
GtkWidget *TVvbox, *FNhbox;
|
||||
GtkWidget *button[8], *FNlabel, *treeview;
|
||||
usb_reg_t uhci_reg_def[5] = {
|
||||
{"Command Register", NULL, 4, attribs_u_command},
|
||||
{"Status Register", NULL, 4, attribs_u_status},
|
||||
{"Interrupt Enable Register", NULL, 4, attribs_u_interrupt},
|
||||
{"Port 0 Register", NULL, 4, attribs_u_ports},
|
||||
{"Port 1 Register", NULL, 4, attribs_u_ports}
|
||||
};
|
||||
|
||||
UHCI_state = (bx_list_c*)SIM->get_param("usb_uhci", SIM->get_bochs_root());
|
||||
if (UHCI_state == NULL)
|
||||
@ -235,18 +257,23 @@ int uhci_debug_dialog(int type, int param1)
|
||||
button[1] = gtk_dialog_add_button(GTK_DIALOG(main_dialog), "Quit", GTK_RESPONSE_CANCEL);
|
||||
gtk_dialog_set_default_response(GTK_DIALOG(main_dialog), GTK_RESPONSE_OK);
|
||||
gtk_window_set_focus(GTK_WINDOW(main_dialog), button[0]);
|
||||
mainHbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(main_dialog))), mainHbox, TRUE, TRUE, 2);
|
||||
for (i = 0; i < 3; i++) {
|
||||
vbox[i] = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(mainHbox), vbox[i], TRUE, TRUE, 2);
|
||||
}
|
||||
mainVbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(main_dialog))), mainVbox, TRUE, TRUE, 2);
|
||||
|
||||
BAhbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(vbox[0]), BAhbox, FALSE, FALSE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(mainVbox), BAhbox, FALSE, FALSE, 2);
|
||||
usbdlg_create_label(BAhbox, "UHCI at Base IO address", false);
|
||||
entry[0] = usbdlg_create_ro_entry(BAhbox, false);
|
||||
|
||||
hbox[0] = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(mainVbox), hbox[0], TRUE, TRUE, 2);
|
||||
hbox[1] = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(mainVbox), hbox[1], TRUE, TRUE, 2);
|
||||
for (i = 0; i < 3; i++) {
|
||||
vbox[i] = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(hbox[0]), vbox[i], TRUE, TRUE, 2);
|
||||
}
|
||||
|
||||
ORframe = gtk_frame_new("Operational Registers");
|
||||
gtk_box_pack_start(GTK_BOX(vbox[0]), ORframe, FALSE, FALSE, 2);
|
||||
ORhbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
@ -257,50 +284,54 @@ int uhci_debug_dialog(int type, int param1)
|
||||
}
|
||||
entry[1] = usbdlg_create_entry_with_label(ORvbox, "Command");
|
||||
button[2] = gtk_button_new_with_label("<>");
|
||||
usb_reg_def[0] = {"Command Register", entry[1], 4, attribs_u_command};
|
||||
g_signal_connect(button[2], "clicked", G_CALLBACK(usb_regview_dialog), &usb_reg_def[0]);
|
||||
uhci_reg_def[0].entry = entry[1];
|
||||
g_signal_connect(button[2], "clicked", G_CALLBACK(usb_regview_dialog), &uhci_reg_def[0]);
|
||||
gtk_box_pack_start(GTK_BOX(ORvbox[2]), button[2], FALSE, FALSE, 2);
|
||||
entry[2] = usbdlg_create_entry_with_label(ORvbox, "Status");
|
||||
button[3] = gtk_button_new_with_label("<>");
|
||||
usb_reg_def[1] = {"Status Register", entry[2], 4, attribs_u_status};
|
||||
g_signal_connect(button[3], "clicked", G_CALLBACK(usb_regview_dialog), &usb_reg_def[1]);
|
||||
uhci_reg_def[1].entry = entry[2];
|
||||
g_signal_connect(button[3], "clicked", G_CALLBACK(usb_regview_dialog), &uhci_reg_def[1]);
|
||||
gtk_box_pack_start(GTK_BOX(ORvbox[2]), button[3], FALSE, FALSE, 2);
|
||||
entry[3] = usbdlg_create_entry_with_label(ORvbox, "Interrupt Enable");
|
||||
button[4] = gtk_button_new_with_label("<>");
|
||||
usb_reg_def[2] = {"Interrupt Enable Register", entry[3], 4, attribs_u_interrupt};
|
||||
g_signal_connect(button[4], "clicked", G_CALLBACK(usb_regview_dialog), &usb_reg_def[2]);
|
||||
uhci_reg_def[2].entry = entry[3];
|
||||
g_signal_connect(button[4], "clicked", G_CALLBACK(usb_regview_dialog), &uhci_reg_def[2]);
|
||||
gtk_box_pack_start(GTK_BOX(ORvbox[2]), button[4], FALSE, FALSE, 2);
|
||||
entry[4] = usbdlg_create_ro_entry_with_label(ORvbox, "Frame Number");
|
||||
entry[5] = usbdlg_create_ro_entry_with_label(ORvbox, "Frame Address");
|
||||
entry[6] = usbdlg_create_ro_entry_with_label(ORvbox, "Start of Frame");
|
||||
entry[4] = usbdlg_create_entry_with_label(ORvbox, "Frame Number");
|
||||
entry[5] = usbdlg_create_entry_with_label(ORvbox, "Frame Address");
|
||||
entry[6] = usbdlg_create_entry_with_label(ORvbox, "Start of Frame");
|
||||
|
||||
PRframe = gtk_frame_new("Port Registers");
|
||||
gtk_box_pack_start(GTK_BOX(vbox[0]), PRframe, FALSE, FALSE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(hbox[1]), PRframe, FALSE, FALSE, 2);
|
||||
PRhbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_container_add(GTK_CONTAINER(PRframe), PRhbox);
|
||||
for (i = 0; i < 3; i++) {
|
||||
PRvbox[i] = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(PRhbox), PRvbox[i], FALSE, FALSE, 2);
|
||||
}
|
||||
usb_reg_def[3] = {"Port 0 Register", NULL, 4, attribs_u_ports};
|
||||
usb_reg_def[4] = {"Port 1 Register", NULL, 4, attribs_u_ports};
|
||||
for (i = 0; i < 2; i++) {
|
||||
sprintf(buffer, "Port %d", i);
|
||||
entry[i * 2 + 7] = usbdlg_create_entry_with_label(PRvbox, buffer);
|
||||
entry[i * 2 + 8] = usbdlg_create_ro_entry_with_label(PRvbox, "Emulation Type");
|
||||
button[i + 5] = gtk_button_new_with_label("<>");
|
||||
usb_reg_def[i + 3].entry = entry[i * 2 + 7];
|
||||
g_signal_connect(button[i + 5], "clicked", G_CALLBACK(usb_regview_dialog), &usb_reg_def[i + 3]);
|
||||
uhci_reg_def[i + 3].entry = entry[i * 2 + 7];
|
||||
g_signal_connect(button[i + 5], "clicked", G_CALLBACK(usb_regview_dialog), &uhci_reg_def[i + 3]);
|
||||
gtk_box_pack_start(GTK_BOX(PRvbox[2]), button[i + 5], FALSE, FALSE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(PRvbox[2]), gtk_label_new(" "), FALSE, FALSE, 8); // spacer
|
||||
}
|
||||
TVvbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(hbox[1]), TVvbox, TRUE, TRUE, 2);
|
||||
FNhbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(TVvbox), FNhbox, FALSE, FALSE, 2);
|
||||
FNlabel = usbdlg_create_label(FNhbox, "Frame at Address", false);
|
||||
entry[11] = usbdlg_create_ro_entry(FNhbox, false);
|
||||
button[7] = gtk_button_new_with_label("View Item");
|
||||
gtk_widget_set_sensitive(button[7], 0);
|
||||
gtk_box_pack_start(GTK_BOX(FNhbox), button[7], FALSE, FALSE, 2);
|
||||
treeview = gtk_tree_view_new();
|
||||
gtk_box_pack_start(GTK_BOX(TVvbox), treeview, TRUE, TRUE, 2);
|
||||
|
||||
apply_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(vbox[0]), apply_hbox, FALSE, FALSE, 2);
|
||||
apply_button = gtk_button_new_with_label(g_dgettext("gtk30", "_Apply"));
|
||||
gtk_widget_set_sensitive(apply_button, 0);
|
||||
g_signal_connect(apply_button, "clicked", G_CALLBACK(apply_changes), NULL);
|
||||
gtk_box_pack_start(GTK_BOX(apply_hbox), apply_button, FALSE, FALSE, 2);
|
||||
usbdlg_create_apply_button(mainVbox);
|
||||
usbdlg_create_debug_flags(vbox[2]);
|
||||
// Set values
|
||||
pci_bar_address = get_pci_bar_addr((bx_shadow_data_c*)SIM->get_param("hub.pci_conf", UHCI_state), 4);
|
||||
@ -318,11 +349,14 @@ int uhci_debug_dialog(int type, int param1)
|
||||
frame_num = usb_io_read(pci_bar_address + 6, 2);
|
||||
sprintf(buffer, "0x%04X", frame_num);
|
||||
gtk_entry_set_text(GTK_ENTRY(entry[4]), buffer);
|
||||
g_signal_connect(GTK_EDITABLE(entry[4]), "changed", G_CALLBACK(on_entry_changed), NULL);
|
||||
frame_addr = usb_io_read(pci_bar_address + 8, 4);
|
||||
sprintf(buffer, "0x%08X", frame_addr);
|
||||
gtk_entry_set_text(GTK_ENTRY(entry[5]), buffer);
|
||||
g_signal_connect(GTK_EDITABLE(entry[5]), "changed", G_CALLBACK(on_entry_changed), NULL);
|
||||
sprintf(buffer, "0x%02X", usb_io_read(pci_bar_address + 12, 1));
|
||||
gtk_entry_set_text(GTK_ENTRY(entry[6]), buffer);
|
||||
g_signal_connect(GTK_EDITABLE(entry[6]), "changed", G_CALLBACK(on_entry_changed), NULL);
|
||||
sprintf(buffer, "0x%04X", usb_io_read(pci_bar_address + 16, 2));
|
||||
gtk_entry_set_text(GTK_ENTRY(entry[7]), buffer);
|
||||
g_signal_connect(GTK_EDITABLE(entry[7]), "changed", G_CALLBACK(on_entry_changed), NULL);
|
||||
@ -333,6 +367,45 @@ int uhci_debug_dialog(int type, int param1)
|
||||
g_signal_connect(GTK_EDITABLE(entry[9]), "changed", G_CALLBACK(on_entry_changed), NULL);
|
||||
SIM->get_param_enum("port2.device", host_param)->dump_param(buffer, COMMON_STR_SIZE, 1);
|
||||
gtk_entry_set_text(GTK_ENTRY(entry[10]), buffer);
|
||||
|
||||
frame_addr += (frame_num * sizeof(Bit32u));
|
||||
sprintf(buffer, "0x%08X", frame_addr);
|
||||
gtk_entry_set_text(GTK_ENTRY(entry[11]), buffer);
|
||||
|
||||
bool valid = 0;
|
||||
switch (type) {
|
||||
// The DoTransfer() function was called
|
||||
case USB_DEBUG_COMMAND:
|
||||
// The start of a frame timer was triggered
|
||||
case USB_DEBUG_FRAME:
|
||||
gtk_label_set_text(GTK_LABEL(FNlabel), "SOF Frame Address");
|
||||
if (frame_addr != 0x00000000) {
|
||||
gtk_widget_set_sensitive(button[7], 1);
|
||||
valid = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
// an event triggered. We ignore these in the uhci
|
||||
//case USB_DEBUG_EVENT:
|
||||
// break;
|
||||
|
||||
// first byte (word, dword, qword) of first non-existant port was written to
|
||||
case USB_DEBUG_NONEXIST:
|
||||
// port reset (non-root reset)
|
||||
case USB_DEBUG_RESET:
|
||||
// enable changed
|
||||
case USB_DEBUG_ENABLE:
|
||||
gtk_label_set_text(GTK_LABEL(FNlabel), "None");
|
||||
gtk_entry_set_text(GTK_ENTRY(entry[10]), "None");
|
||||
break;
|
||||
}
|
||||
|
||||
if (!valid) {
|
||||
gtk_widget_set_sensitive(treeview, 0);
|
||||
usbdlg_create_label(TVvbox, "This trigger does not populate the tree view", false);
|
||||
} else {
|
||||
usbdlg_create_label(TVvbox, "Tree view populated", false);
|
||||
}
|
||||
// Show dialog
|
||||
gtk_widget_show_all(main_dialog);
|
||||
ret = gtk_dialog_run(GTK_DIALOG(main_dialog));
|
||||
@ -343,6 +416,8 @@ int uhci_debug_dialog(int type, int param1)
|
||||
return ret;
|
||||
}
|
||||
|
||||
// xHCI main dialog
|
||||
|
||||
int xhci_debug_dialog(int type, int param1)
|
||||
{
|
||||
bx_list_c *xHCI_state = NULL;
|
||||
@ -353,7 +428,20 @@ int xhci_debug_dialog(int type, int param1)
|
||||
GtkWidget *CRframe, *CRhbox, *CRvbox[2];
|
||||
GtkWidget *ORframe, *ORhbox, *ORvbox[2];
|
||||
GtkWidget *RTframe, *RThbox, *RTvbox[2];
|
||||
GtkWidget *PRframe, *PRhbox, *PRvbox[2];
|
||||
GtkWidget *PRframe, *PRhbox, *PRvbox[3];
|
||||
GtkWidget *button[12];
|
||||
usb_reg_t xhci_reg_def[10] = {
|
||||
{"Port 0 Register", NULL, 8, attribs_x_ports},
|
||||
{"Port 1 Register", NULL, 8, attribs_x_ports},
|
||||
{"Port 2 Register", NULL, 8, attribs_x_ports},
|
||||
{"Port 3 Register", NULL, 8, attribs_x_ports},
|
||||
{"Port 4 Register", NULL, 8, attribs_x_ports},
|
||||
{"Port 5 Register", NULL, 8, attribs_x_ports},
|
||||
{"Port 6 Register", NULL, 8, attribs_x_ports},
|
||||
{"Port 7 Register", NULL, 8, attribs_x_ports},
|
||||
{"Port 8 Register", NULL, 8, attribs_x_ports},
|
||||
{"Port 9 Register", NULL, 8, attribs_x_ports}
|
||||
};
|
||||
|
||||
xHCI_state = (bx_list_c*)SIM->get_param("usb_xhci", SIM->get_bochs_root());
|
||||
if (xHCI_state == NULL)
|
||||
@ -374,9 +462,10 @@ int xhci_debug_dialog(int type, int param1)
|
||||
gtk_window_set_title(GTK_WINDOW(main_dialog), "xHCI Debug Dialog");
|
||||
}
|
||||
gtk_window_set_default_size(GTK_WINDOW(main_dialog), 600, 500);
|
||||
gtk_dialog_add_button(GTK_DIALOG(main_dialog), "Continue", GTK_RESPONSE_OK);
|
||||
gtk_dialog_add_button(GTK_DIALOG(main_dialog), "Quit", GTK_RESPONSE_CANCEL);
|
||||
button[0] = gtk_dialog_add_button(GTK_DIALOG(main_dialog), "Continue", GTK_RESPONSE_OK);
|
||||
button[1] = gtk_dialog_add_button(GTK_DIALOG(main_dialog), "Quit", GTK_RESPONSE_CANCEL);
|
||||
gtk_dialog_set_default_response(GTK_DIALOG(main_dialog), GTK_RESPONSE_OK);
|
||||
gtk_window_set_focus(GTK_WINDOW(main_dialog), button[0]);
|
||||
mainVbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(main_dialog))), mainVbox, TRUE, TRUE, 2);
|
||||
|
||||
@ -441,16 +530,22 @@ int xhci_debug_dialog(int type, int param1)
|
||||
gtk_box_pack_start(GTK_BOX(hbox[1]), PRframe, FALSE, FALSE, 2);
|
||||
PRhbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_container_add(GTK_CONTAINER(PRframe), PRhbox);
|
||||
PRvbox[0] = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(PRhbox), PRvbox[0], FALSE, FALSE, 2);
|
||||
PRvbox[1] = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(PRhbox), PRvbox[1], FALSE, FALSE, 2);
|
||||
for (i = 0; i < 3; i++) {
|
||||
PRvbox[i] = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_box_pack_start(GTK_BOX(PRhbox), PRvbox[i], FALSE, FALSE, 2);
|
||||
}
|
||||
n_ports = SIM->get_param_num(BXPN_XHCI_N_PORTS)->get();
|
||||
for (i = 0; i < n_ports; i++) {
|
||||
sprintf(buffer, "Port %d", i);
|
||||
entry[i * 2 + 17] = usbdlg_create_entry_with_label(PRvbox, buffer);
|
||||
entry[i * 2 + 18] = usbdlg_create_ro_entry_with_label(PRvbox, "Emulation Type");
|
||||
button[i + 2] = gtk_button_new_with_label("<>");
|
||||
xhci_reg_def[i].entry = entry[i * 2 + 17];
|
||||
g_signal_connect(button[i + 2], "clicked", G_CALLBACK(usb_regview_dialog), &xhci_reg_def[i]);
|
||||
gtk_box_pack_start(GTK_BOX(PRvbox[2]), button[i + 2], FALSE, FALSE, 2);
|
||||
gtk_box_pack_start(GTK_BOX(PRvbox[2]), gtk_label_new(" "), FALSE, FALSE, 8); // spacer
|
||||
}
|
||||
usbdlg_create_apply_button(mainVbox);
|
||||
usbdlg_create_debug_flags(vbox[3]);
|
||||
// Set values
|
||||
pci_bar_address = get_pci_bar_addr((bx_shadow_data_c*)SIM->get_param("hub.pci_conf", xHCI_state), 0);
|
||||
@ -495,6 +590,7 @@ int xhci_debug_dialog(int type, int param1)
|
||||
dword = xhci_read_dword(pci_bar_address + XHCI_PORT_SET_OFFSET + (i * 16));
|
||||
sprintf(buffer, "0x%08X", dword);
|
||||
gtk_entry_set_text(GTK_ENTRY(entry[i * 2 + 17]), buffer);
|
||||
g_signal_connect(GTK_EDITABLE(entry[i * 2 + 17]), "changed", G_CALLBACK(on_entry_changed), NULL);
|
||||
sprintf(tmpbuf, "port%d.device", i + 1);
|
||||
SIM->get_param_enum(tmpbuf, host_param)->dump_param(buffer, COMMON_STR_SIZE, 1);
|
||||
gtk_entry_set_text(GTK_ENTRY(entry[i * 2 + 18]), buffer);
|
||||
@ -509,6 +605,8 @@ int xhci_debug_dialog(int type, int param1)
|
||||
return ret;
|
||||
}
|
||||
|
||||
// USB debug dialog entry point
|
||||
|
||||
int usb_debug_dialog(int type, int param1, int param2)
|
||||
{
|
||||
static bool first_call = true;
|
||||
|
@ -92,6 +92,46 @@ struct S_ATTRIBUTES attribs_u_ports[] = {
|
||||
{ 0, (Bit32u) -1, -1, "\0" , {-1, } }
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// XHCI
|
||||
//
|
||||
struct S_ATTRIBUTES attribs_x_ports[] = {
|
||||
// | 31 chars + null | <- max
|
||||
{ (1ULL<<31), (1ULL<<31), 31, "Warm Port Reset" , {-1, } },
|
||||
{ (1<<30), (1<<30), 30, "Device Removable" , {-1, } },
|
||||
{ (1<<29), (1<<29), 29, "Reserved (bit 29)" , {-1, } },
|
||||
{ (1<<28), (1<<28), 28, "Reserved (bit 28)" , {-1, } },
|
||||
{ (1<<27), (1<<27), 27, "Wake on Over-current Enable" , {-1, } },
|
||||
{ (1<<26), (1<<26), 26, "Wake on Disconnect Enable" , {-1, } },
|
||||
{ (1<<25), (1<<25), 25, "Wake on Connect Enable" , {-1, } },
|
||||
{ (1<<24), (1<<24), 24, "Cold Attach Status" , {-1, } },
|
||||
{ (1<<23), (1<<23), 23, "Port Config Error Change" , {-1, } },
|
||||
{ (1<<22), (1<<22), 22, "Port Link State Change" , {-1, } },
|
||||
{ (1<<21), (1<<21), 21, "Port Reset Change" , {-1, } },
|
||||
{ (1<<20), (1<<20), 20, "Over-current Change" , {-1, } },
|
||||
{ (1<<19), (1<<19), 19, "Warm Port Reset Change" , {-1, } },
|
||||
{ (1<<18), (1<<18), 18, "Port Enable/Disable Change" , {-1, } },
|
||||
{ (1<<17), (1<<17), 17, "Connect Status Change" , {-1, } },
|
||||
{ (1<<16), (1<<16), 16, "Port Link State Write Strobe" , {-1, } },
|
||||
{ (1<<15), (1<<15), 15, "Port Indicator (bit 1)" , {-1, } },
|
||||
{ (1<<14), (1<<14), 14, "Port Indicator (bit 0)" , {-1, } },
|
||||
{ (1<<13), (1<<13), 13, "Port Speed (bit 3)" , {-1, } },
|
||||
{ (1<<12), (1<<12), 12, "Port Speed (bit 2)" , {-1, } },
|
||||
{ (1<<11), (1<<11), 11, "Port Speed (bit 1)" , {-1, } },
|
||||
{ (1<<10), (1<<10), 10, "Port Speed (bit 0)" , {-1, } },
|
||||
{ (1<< 9), (1<< 9), 9, "Port Power" , {-1, } },
|
||||
{ (1<< 8), (1<< 8), 8, "Port Link State (bit 3)" , {-1, } },
|
||||
{ (1<< 7), (1<< 7), 7, "Port Link State (bit 2)" , {-1, } },
|
||||
{ (1<< 6), (1<< 6), 6, "Port Link State (bit 1)" , {-1, } },
|
||||
{ (1<< 5), (1<< 5), 5, "Port Link State (bit 0)" , {-1, } },
|
||||
{ (1<< 4), (1<< 4), 4, "Port Reset" , {-1, } },
|
||||
{ (1<< 3), (1<< 3), 3, "Over-current Status" , {-1, } },
|
||||
{ (1<< 2), (1<< 2), 2, "Reserved" , {-1, } },
|
||||
{ (1<< 1), (1<< 1), 1, "Port Enabled/Disabled" , {-1, } },
|
||||
{ (1<< 0), (1<< 0), 0, "Current Connect Status" , {-1, } },
|
||||
{ 0, (Bit32u) -1, -1, "\0" , {-1, } }
|
||||
};
|
||||
|
||||
int usb_debug_type = USB_DEBUG_NONE;
|
||||
bx_param_c *host_param = NULL;
|
||||
|
||||
|
@ -39,14 +39,15 @@ extern const char *hc_param_str[];
|
||||
extern int usb_debug_type;
|
||||
extern bx_param_c *host_param;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// UHCI
|
||||
//
|
||||
// UHCI
|
||||
extern struct S_ATTRIBUTES attribs_u_command[];
|
||||
extern struct S_ATTRIBUTES attribs_u_status[];
|
||||
extern struct S_ATTRIBUTES attribs_u_interrupt[];
|
||||
extern struct S_ATTRIBUTES attribs_u_ports[];
|
||||
|
||||
// xHCI
|
||||
extern struct S_ATTRIBUTES attribs_x_ports[];
|
||||
|
||||
void usb_dbg_register_type(int type);
|
||||
|
||||
int usb_dbg_interface(int type, int param1, int param2);
|
||||
|
@ -868,44 +868,6 @@ int hc_ehci_init(HWND hwnd)
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// XHCI
|
||||
//
|
||||
|
||||
struct S_ATTRIBUTES attribs_x_ports[] = {
|
||||
// | 31 chars + null | <- max
|
||||
{ (1ULL<<31), (1ULL<<31), 31, "Warm Port Reset" , {-1, } },
|
||||
{ (1<<30), (1<<30), 30, "Device Removable" , {-1, } },
|
||||
{ (1<<29), (1<<29), 29, "Reserved (bit 29)" , {-1, } },
|
||||
{ (1<<28), (1<<28), 28, "Reserved (bit 28)" , {-1, } },
|
||||
{ (1<<27), (1<<27), 27, "Wake on Over-current Enable" , {-1, } },
|
||||
{ (1<<26), (1<<26), 26, "Wake on Disconnect Enable" , {-1, } },
|
||||
{ (1<<25), (1<<25), 25, "Wake on Connect Enable" , {-1, } },
|
||||
{ (1<<24), (1<<24), 24, "Cold Attach Status" , {-1, } },
|
||||
{ (1<<23), (1<<23), 23, "Port Config Error Change" , {-1, } },
|
||||
{ (1<<22), (1<<22), 22, "Port Link State Change" , {-1, } },
|
||||
{ (1<<21), (1<<21), 21, "Port Reset Change" , {-1, } },
|
||||
{ (1<<20), (1<<20), 20, "Over-current Change" , {-1, } },
|
||||
{ (1<<19), (1<<19), 19, "Warm Port Reset Change" , {-1, } },
|
||||
{ (1<<18), (1<<18), 18, "Port Enable/Disable Change" , {-1, } },
|
||||
{ (1<<17), (1<<17), 17, "Connect Status Change" , {-1, } },
|
||||
{ (1<<16), (1<<16), 16, "Port Link State Write Strobe" , {-1, } },
|
||||
{ (1<<15), (1<<15), 15, "Port Indicator (bit 1)" , {-1, } },
|
||||
{ (1<<14), (1<<14), 14, "Port Indicator (bit 0)" , {-1, } },
|
||||
{ (1<<13), (1<<13), 13, "Port Speed (bit 3)" , {-1, } },
|
||||
{ (1<<12), (1<<12), 12, "Port Speed (bit 2)" , {-1, } },
|
||||
{ (1<<11), (1<<11), 11, "Port Speed (bit 1)" , {-1, } },
|
||||
{ (1<<10), (1<<10), 10, "Port Speed (bit 0)" , {-1, } },
|
||||
{ (1<< 9), (1<< 9), 9, "Port Power" , {-1, } },
|
||||
{ (1<< 8), (1<< 8), 8, "Port Link State (bit 3)" , {-1, } },
|
||||
{ (1<< 7), (1<< 7), 7, "Port Link State (bit 2)" , {-1, } },
|
||||
{ (1<< 6), (1<< 6), 6, "Port Link State (bit 1)" , {-1, } },
|
||||
{ (1<< 5), (1<< 5), 5, "Port Link State (bit 0)" , {-1, } },
|
||||
{ (1<< 4), (1<< 4), 4, "Port Reset" , {-1, } },
|
||||
{ (1<< 3), (1<< 3), 3, "Over-current Status" , {-1, } },
|
||||
{ (1<< 2), (1<< 2), 2, "Reserved" , {-1, } },
|
||||
{ (1<< 1), (1<< 1), 1, "Port Enabled/Disabled" , {-1, } },
|
||||
{ (1<< 0), (1<< 0), 0, "Current Connect Status" , {-1, } },
|
||||
{ 0, (DWORD) -1, -1, "\0" , {-1, } }
|
||||
};
|
||||
|
||||
static bool x_changed[IDC_X_EN_END - IDC_X_EN_START + 1];
|
||||
|
||||
// lParam: type is in low 8 bits, break_type in high 8-bits of low word
|
||||
|
Loading…
Reference in New Issue
Block a user