PERFORCE change 155906 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Sat Jan 10 04:17:06 PST 2009
http://perforce.freebsd.org/chv.cgi?CH=155906
Change 155906 by hselasky at hselasky_laptop001 on 2009/01/10 12:16:21
Remove "vbus_interrupt" method from bus methods and use
a global function instead for the various drivers using it.
The reason for the removal is to simplify the code.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb2/controller/at91dci.c#22 edit
.. //depot/projects/usb/src/sys/dev/usb2/controller/at91dci.h#8 edit
.. //depot/projects/usb/src/sys/dev/usb2/controller/at91dci_atmelarm.c#17 edit
.. //depot/projects/usb/src/sys/dev/usb2/controller/musb2_otg.c#23 edit
.. //depot/projects/usb/src/sys/dev/usb2/controller/musb2_otg.h#12 edit
.. //depot/projects/usb/src/sys/dev/usb2/controller/musb2_otg_atmelarm.c#14 edit
.. //depot/projects/usb/src/sys/dev/usb2/controller/usb2_controller.h#9 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb2/controller/at91dci.c#22 (text+ko) ====
@@ -729,11 +729,9 @@
}
}
-static void
-at91dci_vbus_interrupt(struct usb2_bus *bus, uint8_t is_on)
+void
+at91dci_vbus_interrupt(struct at91dci_softc *sc, uint8_t is_on)
{
- struct at91dci_softc *sc = AT9100_DCI_BUS2SC(bus);
-
DPRINTFN(5, "vbus = %u\n", is_on);
USB_BUS_LOCK(&sc->sc_bus);
@@ -760,7 +758,6 @@
&at91dci_root_intr_done);
}
}
-
USB_BUS_UNLOCK(&sc->sc_bus);
}
@@ -2466,6 +2463,5 @@
.get_hw_ep_profile = &at91dci_get_hw_ep_profile,
.set_stall = &at91dci_set_stall,
.clear_stall = &at91dci_clear_stall,
- .vbus_interrupt = &at91dci_vbus_interrupt,
.roothub_exec = &at91dci_root_ctrl_task,
};
==== //depot/projects/usb/src/sys/dev/usb2/controller/at91dci.h#8 (text+ko) ====
@@ -240,5 +240,6 @@
void at91dci_suspend(struct at91dci_softc *sc);
void at91dci_resume(struct at91dci_softc *sc);
void at91dci_interrupt(struct at91dci_softc *sc);
+void at91dci_vbus_interrupt(struct at91dci_softc *sc, uint8_t is_on);
#endif /* _AT9100_DCI_H_ */
==== //depot/projects/usb/src/sys/dev/usb2/controller/at91dci_atmelarm.c#17 (text+ko) ====
@@ -72,7 +72,7 @@
};
static void
-at91_vbus_interrupt(struct at91_udp_softc *sc)
+at91_vbus_poll(struct at91_udp_softc *sc)
{
uint32_t temp;
uint8_t vbus_val;
@@ -84,8 +84,7 @@
/* just forward it */
vbus_val = at91_pio_gpio_get(VBUS_BASE, VBUS_MASK);
- (sc->sc_dci.sc_bus.methods->vbus_interrupt)
- (&sc->sc_dci.sc_bus, vbus_val);
+ at91dci_vbus_interrupt(&sc->sc_dci, vbus_val);
}
static void
@@ -220,10 +219,10 @@
}
#if (__FreeBSD_version >= 700031)
err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
- NULL, (void *)at91_vbus_interrupt, sc, &sc->sc_vbus_intr_hdl);
+ NULL, (void *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl);
#else
err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
- (void *)at91_vbus_interrupt, sc, &sc->sc_vbus_intr_hdl);
+ (void *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl);
#endif
if (err) {
sc->sc_vbus_intr_hdl = NULL;
@@ -237,7 +236,7 @@
goto error;
} else {
/* poll VBUS one time */
- at91_vbus_interrupt(sc);
+ at91_vbus_poll(sc);
}
return (0);
==== //depot/projects/usb/src/sys/dev/usb2/controller/musb2_otg.c#23 (text+ko) ====
@@ -954,11 +954,9 @@
}
}
-static void
-musbotg_vbus_interrupt(struct usb2_bus *bus, uint8_t is_on)
+void
+musbotg_vbus_interrupt(struct musbotg_softc *sc, uint8_t is_on)
{
- struct musbotg_softc *sc = MUSBOTG_BUS2SC(bus);
-
DPRINTFN(4, "vbus = %u\n", is_on);
USB_BUS_LOCK(&sc->sc_bus);
@@ -2873,6 +2871,5 @@
.get_hw_ep_profile = &musbotg_get_hw_ep_profile,
.set_stall = &musbotg_set_stall,
.clear_stall = &musbotg_clear_stall,
- .vbus_interrupt = &musbotg_vbus_interrupt,
.roothub_exec = &musbotg_root_ctrl_task,
};
==== //depot/projects/usb/src/sys/dev/usb2/controller/musb2_otg.h#12 (text+ko) ====
@@ -402,5 +402,6 @@
void musbotg_suspend(struct musbotg_softc *sc);
void musbotg_resume(struct musbotg_softc *sc);
void musbotg_interrupt(struct musbotg_softc *sc);
+void musbotg_vbus_interrupt(struct musbotg_softc *sc, uint8_t is_on);
#endif /* _MUSB2_OTG_H_ */
==== //depot/projects/usb/src/sys/dev/usb2/controller/musb2_otg_atmelarm.c#14 (text+ko) ====
@@ -50,14 +50,12 @@
};
static void
-musbotg_vbus_interrupt(struct musbotg_super_softc *sc)
+musbotg_vbus_poll(struct musbotg_super_softc *sc)
{
uint8_t vbus_val = 1; /* fake VBUS on - TODO */
/* just forward it */
-
- (sc->sc_otg.sc_bus.methods->vbus_interrupt)
- (&sc->sc_otg.sc_bus, vbus_val);
+ musbotg_vbus_interrupt(&sc->sc_otg, vbus_val);
}
static void
@@ -154,7 +152,7 @@
goto error;
} else {
/* poll VBUS one time */
- musbotg_vbus_interrupt(sc);
+ musbotg_vbus_poll(sc);
}
return (0);
==== //depot/projects/usb/src/sys/dev/usb2/controller/usb2_controller.h#9 (text+ko) ====
@@ -91,10 +91,6 @@
void (*set_stall) (struct usb2_device *udev, struct usb2_xfer *xfer, struct usb2_pipe *pipe);
void (*clear_stall) (struct usb2_device *udev, struct usb2_pipe *pipe);
- /* USB Device mode only - Optional */
-
- void (*vbus_interrupt) (struct usb2_bus *, uint8_t is_on);
-
/* USB Device and Host mode - Optional */
void (*roothub_exec) (struct usb2_bus *);
More information about the p4-projects
mailing list