aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/hcd-ehci.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2024-02-22 12:42:52 +0000
committerPeter Maydell <peter.maydell@linaro.org>2024-02-22 12:42:52 +0000
commit6630bc04bccadcf868165ad6bca5a964bb69b067 (patch)
tree59c4c5667b7c4731d4d96dcab194232b5e768fc8 /hw/usb/hcd-ehci.c
parent5cd3ae4903e33982e7a9bbd04674af517e796d6e (diff)
parent185311130f54ead75c407cdf83004d575829b5d2 (diff)
Merge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into staging
trivial patches for 2024-02-22 # -----BEGIN PGP SIGNATURE----- # # iQFDBAABCAAtFiEEe3O61ovnosKJMUsicBtPaxppPlkFAmXXLtwPHG1qdEB0bHMu # bXNrLnJ1AAoJEHAbT2saaT5ZKH0H/0qdQXdoc/ZTdAtUPFJGhEc6KMeOO1w9928w # OSOB7w4dJiKt6I53WtmY9f2+7/CMJHyscV3xlClRaaZeJVFzgwOo8Wjqkmwa8uOw # Nl5GcL2egBPuY7Ucc1eNIj/I4RbS1pX5vURkUfTG3AH1SEbFAv9Gk6qBtrmer2YA # hg2DdCskvPd8EOovx3sWQRH+Ra4w3hxaAELS9sa9ZKLBAaYvucYan9IjLaJqSY84 # b441QXu3ht/DpLw6d/HDWUqwYUOJD0HUhPSvba1xCsrzQVXFE7VhR5O/cDrqs2qm # 2fcMW6j62raPdK1u77WaRdslPy34YUmjk7lwZ8wiS7fmDx0Aqcg= # =0va1 # -----END PGP SIGNATURE----- # gpg: Signature made Thu 22 Feb 2024 11:24:12 GMT # gpg: using RSA key 7B73BAD68BE7A2C289314B22701B4F6B1A693E59 # gpg: issuer "mjt@tls.msk.ru" # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" [full] # gpg: aka "Michael Tokarev <mjt@corpit.ru>" [full] # gpg: aka "Michael Tokarev <mjt@debian.org>" [full] # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 # Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931 4B22 701B 4F6B 1A69 3E59 * tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu: (34 commits) system/vl: Update description for input grab key docs/system: Update description for input grab key hw/hppa/Kconfig: Fix building with "configure --without-default-devices" target/sparc: correct typos s390x: correct typos m68k: correct typos hexagon: correct typos ci/gitlab-pipeline-status: correct typos qemu-options.hx: correct typos qapi/ui: correct typos pc-bios/README: correct typos hw/riscv/virt.h: correct typos hw/net/npcm_gmac.h: correct typos hw/cxl/cxl_device.h: correct typos hw/arm/omap.h: correct typos include/exec/memory.h: correct typos sh4: correct typos ppc: correct typos loongson3: correct typos accel/tcg: correct typos ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/usb/hcd-ehci.c')
-rw-r--r--hw/usb/hcd-ehci.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 870c72cb59..01864d4649 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -783,9 +783,9 @@ static void ehci_register_companion(USBBus *bus, USBPort *ports[],
EHCIState *s = container_of(bus, EHCIState, bus);
uint32_t i;
- if (firstport + portcount > NB_PORTS) {
+ if (firstport + portcount > EHCI_PORTS) {
error_setg(errp, "firstport must be between 0 and %u",
- NB_PORTS - portcount);
+ EHCI_PORTS - portcount);
return;
}
@@ -831,7 +831,7 @@ static USBDevice *ehci_find_device(EHCIState *ehci, uint8_t addr)
USBPort *port;
int i;
- for (i = 0; i < NB_PORTS; i++) {
+ for (i = 0; i < EHCI_PORTS; i++) {
port = &ehci->ports[i];
if (!(ehci->portsc[i] & PORTSC_PED)) {
DPRINTF("Port %d not enabled\n", i);
@@ -850,7 +850,7 @@ void ehci_reset(void *opaque)
{
EHCIState *s = opaque;
int i;
- USBDevice *devs[NB_PORTS];
+ USBDevice *devs[EHCI_PORTS];
trace_usb_ehci_reset();
@@ -858,7 +858,7 @@ void ehci_reset(void *opaque)
* Do the detach before touching portsc, so that it correctly gets send to
* us or to our companion based on PORTSC_POWNER before the reset.
*/
- for(i = 0; i < NB_PORTS; i++) {
+ for(i = 0; i < EHCI_PORTS; i++) {
devs[i] = s->ports[i].dev;
if (devs[i] && devs[i]->attached) {
usb_detach(&s->ports[i]);
@@ -877,7 +877,7 @@ void ehci_reset(void *opaque)
s->astate = EST_INACTIVE;
s->pstate = EST_INACTIVE;
- for(i = 0; i < NB_PORTS; i++) {
+ for(i = 0; i < EHCI_PORTS; i++) {
if (s->companion_ports[i]) {
s->portsc[i] = PORTSC_POWNER | PORTSC_PPOWER;
} else {
@@ -1086,8 +1086,9 @@ static void ehci_opreg_write(void *ptr, hwaddr addr,
case CONFIGFLAG:
val &= 0x1;
if (val) {
- for(i = 0; i < NB_PORTS; i++)
+ for (i = 0; i < EHCI_PORTS; i++) {
handle_port_owner_write(s, i, 0);
+ }
}
break;
@@ -2426,7 +2427,7 @@ static int usb_ehci_post_load(void *opaque, int version_id)
EHCIState *s = opaque;
int i;
- for (i = 0; i < NB_PORTS; i++) {
+ for (i = 0; i < EHCI_PORTS; i++) {
USBPort *companion = s->companion_ports[i];
if (companion == NULL) {
continue;
@@ -2508,9 +2509,9 @@ void usb_ehci_realize(EHCIState *s, DeviceState *dev, Error **errp)
{
int i;
- if (s->portnr > NB_PORTS) {
+ if (s->portnr > EHCI_PORTS) {
error_setg(errp, "Too many ports! Max. port number is %d.",
- NB_PORTS);
+ EHCI_PORTS);
return;
}
if (s->maxframes < 8 || s->maxframes > 512) {