diff --git a/bochs/bochs.h b/bochs/bochs.h index 656728917..3000b6c4d 100644 --- a/bochs/bochs.h +++ b/bochs/bochs.h @@ -125,7 +125,7 @@ void bx_set_log_actions_by_device(bool panic_flag); void bx_init_std_nic_options(const char *name, bx_list_c *menu); #endif #if BX_SUPPORT_PCIUSB -void bx_init_usb_options(const char *usb_name, const char *pname, int maxports); +void bx_init_usb_options(const char *usb_name, const char *pname, int maxports, int param0); #endif int bx_parse_param_from_list(const char *context, const char *input, bx_list_c *list); int bx_parse_nic_params(const char *context, const char *param, bx_list_c *base); diff --git a/bochs/config.cc b/bochs/config.cc index 7552b6cab..8d32fc554 100644 --- a/bochs/config.cc +++ b/bochs/config.cc @@ -213,7 +213,7 @@ void bx_init_std_nic_options(const char *name, bx_list_c *menu) #endif #if BX_SUPPORT_PCIUSB -void bx_init_usb_options(const char *usb_name, const char *pname, int maxports) +void bx_init_usb_options(const char *usb_name, const char *pname, int maxports, int param0) { char group[16], name[8], descr[512], label[512]; bx_list_c *usb, *usbrt, *deplist, *deplist2; @@ -267,9 +267,18 @@ void bx_init_usb_options(const char *usb_name, const char *pname, int maxports) bx_usbdev_ctl.get_device_names(), 0, 0); sprintf(descr, "Options for device connected to %s port #%u", usb_name, i+1); +#if BX_SUPPORT_USB_XHCI + if (!strcmp(usb_name, "xHCI")) { + if (i < (param0 / 2)) + strcpy(label, "Options: (Must be super-speed)"); + else + strcpy(label, "Options: (Must NOT be super-speed)"); + } else +#endif + strcpy(label, "Options"); bx_param_string_c *options = new bx_param_string_c(port, "options", - "Options", + label, descr, "", BX_PATHNAME_LEN); bx_param_bool_c *overcurrent = new bx_param_bool_c(port, diff --git a/bochs/gui/siminterface.cc b/bochs/gui/siminterface.cc index d30ffae00..f36b5d2a5 100644 --- a/bochs/gui/siminterface.cc +++ b/bochs/gui/siminterface.cc @@ -217,7 +217,7 @@ public: virtual void init_std_nic_options(const char *name, bx_list_c *menu); #endif #if BX_SUPPORT_PCIUSB - virtual void init_usb_options(const char *usb_name, const char *pname, int maxports); + virtual void init_usb_options(const char *usb_name, const char *pname, int maxports, int param0); #endif virtual int parse_param_from_list(const char *context, const char *param, bx_list_c *base); virtual int parse_nic_params(const char *context, const char *param, bx_list_c *base); @@ -1490,9 +1490,9 @@ void bx_real_sim_c::init_std_nic_options(const char *name, bx_list_c *menu) #endif #if BX_SUPPORT_PCIUSB -void bx_real_sim_c::init_usb_options(const char *usb_name, const char *pname, int maxports) +void bx_real_sim_c::init_usb_options(const char *usb_name, const char *pname, int maxports, int param0) { - bx_init_usb_options(usb_name, pname, maxports); + bx_init_usb_options(usb_name, pname, maxports, param0); } #endif diff --git a/bochs/gui/siminterface.h b/bochs/gui/siminterface.h index 670d2f3c0..83526a935 100644 --- a/bochs/gui/siminterface.h +++ b/bochs/gui/siminterface.h @@ -743,7 +743,7 @@ public: // special config parameter and options functions for plugins virtual bool opt_plugin_ctrl(const char *plugname, bool load) {return 0;} virtual void init_std_nic_options(const char *name, bx_list_c *menu) {} - virtual void init_usb_options(const char *usb_name, const char *pname, int maxports) {} + virtual void init_usb_options(const char *usb_name, const char *pname, int maxports, int param0) {} virtual int parse_param_from_list(const char *context, const char *param, bx_list_c *base) {return 0;} virtual int parse_nic_params(const char *context, const char *param, bx_list_c *base) {return 0;} virtual int parse_usb_port_params(const char *context, const char *param, diff --git a/bochs/iodev/usb/usb_ehci.cc b/bochs/iodev/usb/usb_ehci.cc index a6c4a67f6..ea540533c 100644 --- a/bochs/iodev/usb/usb_ehci.cc +++ b/bochs/iodev/usb/usb_ehci.cc @@ -161,7 +161,7 @@ PLUGIN_ENTRY_FOR_MODULE(usb_ehci) theUSB_EHCI = new bx_usb_ehci_c(); BX_REGISTER_DEVICE_DEVMODEL(plugin, type, theUSB_EHCI, BX_PLUGIN_USB_EHCI); // add new configuration parameter for the config interface - SIM->init_usb_options("EHCI", "ehci", USB_EHCI_PORTS); + SIM->init_usb_options("EHCI", "ehci", USB_EHCI_PORTS, 0); // register add-on option for bochsrc and command line SIM->register_addon_option("usb_ehci", usb_ehci_options_parser, usb_ehci_options_save); } else if (mode == PLUGIN_FINI) { diff --git a/bochs/iodev/usb/usb_ohci.cc b/bochs/iodev/usb/usb_ohci.cc index 649c99dca..768e9ddbf 100644 --- a/bochs/iodev/usb/usb_ohci.cc +++ b/bochs/iodev/usb/usb_ohci.cc @@ -109,7 +109,7 @@ PLUGIN_ENTRY_FOR_MODULE(usb_ohci) theUSB_OHCI = new bx_usb_ohci_c(); BX_REGISTER_DEVICE_DEVMODEL(plugin, type, theUSB_OHCI, BX_PLUGIN_USB_OHCI); // add new configuration parameter for the config interface - SIM->init_usb_options("OHCI", "ohci", USB_OHCI_PORTS); + SIM->init_usb_options("OHCI", "ohci", USB_OHCI_PORTS, 0); // register add-on option for bochsrc and command line SIM->register_addon_option("usb_ohci", usb_ohci_options_parser, usb_ohci_options_save); } else if (mode == PLUGIN_FINI) { diff --git a/bochs/iodev/usb/usb_uhci.cc b/bochs/iodev/usb/usb_uhci.cc index 335a507ca..395a47dad 100644 --- a/bochs/iodev/usb/usb_uhci.cc +++ b/bochs/iodev/usb/usb_uhci.cc @@ -81,7 +81,7 @@ PLUGIN_ENTRY_FOR_MODULE(usb_uhci) theUSB_UHCI = new bx_usb_uhci_c(); BX_REGISTER_DEVICE_DEVMODEL(plugin, type, theUSB_UHCI, BX_PLUGIN_USB_UHCI); // add new configuration parameter for the config interface - SIM->init_usb_options("UHCI", "uhci", USB_UHCI_PORTS); + SIM->init_usb_options("UHCI", "uhci", USB_UHCI_PORTS, 0); // register add-on option for bochsrc and command line SIM->register_addon_option("usb_uhci", usb_uhci_options_parser, usb_uhci_options_save); } else if (mode == PLUGIN_FINI) { diff --git a/bochs/iodev/usb/usb_xhci.cc b/bochs/iodev/usb/usb_xhci.cc index c5fa770f6..2ed9339ad 100644 --- a/bochs/iodev/usb/usb_xhci.cc +++ b/bochs/iodev/usb/usb_xhci.cc @@ -195,7 +195,7 @@ PLUGIN_ENTRY_FOR_MODULE(usb_xhci) theUSB_XHCI = new bx_usb_xhci_c(); BX_REGISTER_DEVICE_DEVMODEL(plugin, type, theUSB_XHCI, BX_PLUGIN_USB_XHCI); // add new configuration parameter for the config interface - SIM->init_usb_options("xHCI", "xhci", USB_XHCI_PORTS_MAX); + SIM->init_usb_options("xHCI", "xhci", USB_XHCI_PORTS_MAX, USB_XHCI_PORTS); // register add-on option for bochsrc and command line SIM->register_addon_option("usb_xhci", usb_xhci_options_parser, usb_xhci_options_save); } else if (mode == PLUGIN_FINI) {