Xhci options (#92)
This adds a "hint" to the xHCI port configuration "option" entries, hinting that the port number must or must not be super-speed.
This commit is contained in:
parent
8316d7698f
commit
e7910a30a0
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user