PERFORCE change 167440 for review
Sylvestre Gallon
syl at FreeBSD.org
Mon Aug 17 10:30:59 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=167440
Change 167440 by syl at syl_atuin on 2009/08/17 10:29:58
Changes requested by Hans Petter Selasky :
- Change the fops typedef.
- Remove cast in fops initialisation.
Affected files ...
.. //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/at91dci.c#16 edit
.. //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/atmegadci.c#14 edit
.. //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/avr32dci.c#13 edit
.. //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/musb_otg.c#15 edit
.. //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/s3c24xxdci.c#22 edit
.. //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/uss820dci.c#14 edit
.. //depot/projects/soc2009/syl_usb/src/sys/dev/usb/usb_controller.h#14 edit
.. //depot/projects/soc2009/syl_usb/src/sys/dev/usb/usb_roothub_exec.c#9 edit
Differences ...
==== //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/at91dci.c#16 (text+ko) ====
@@ -207,8 +207,10 @@
}
static void
-at91dci_clocks_on(struct at91dci_softc *sc)
+at91dci_clocks_on(void *arg)
{
+ struct at91dci_softc *sc = (struct at91dci_softc *)arg;
+
if (sc->sc_flags.clocks_off &&
sc->sc_flags.port_powered) {
@@ -225,8 +227,10 @@
}
static void
-at91dci_clocks_off(struct at91dci_softc *sc)
+at91dci_clocks_off(void *arg)
{
+ struct at91dci_softc *sc = (struct at91dci_softc *)arg;
+
if (!sc->sc_flags.clocks_off) {
DPRINTFN(5, "\n");
@@ -242,8 +246,10 @@
}
static void
-at91dci_pull_up(struct at91dci_softc *sc)
+at91dci_pull_up(void *arg)
{
+ struct at91dci_softc *sc = (struct at91dci_softc *)arg;
+
/* pullup D+, if possible */
if (!sc->sc_flags.d_pulled_up &&
@@ -254,8 +260,10 @@
}
static void
-at91dci_pull_down(struct at91dci_softc *sc)
+at91dci_pull_down(void *arg)
{
+ struct at91dci_softc *sc = (struct at91dci_softc *)arg;
+
/* pulldown D+, if possible */
if (sc->sc_flags.d_pulled_up) {
@@ -265,8 +273,10 @@
}
static void
-at91dci_wakeup_peer(struct at91dci_softc *sc)
+at91dci_wakeup_peer(void *arg)
{
+ struct at91dci_softc *sc = (struct at91dci_softc *)arg;
+
if (!(sc->sc_flags.status_suspend)) {
return;
}
@@ -1643,11 +1653,11 @@
static const struct usb_roothub_fops fops = {
USB_DEFAULT_ROOTHUB,
.handle_get_port_status = &at91dci_get_port_status,
- .handle_clocks_on = (usb_clocks_fops_t)&at91dci_clocks_on,
- .handle_clocks_off = (usb_clocks_fops_t)&at91dci_clocks_off,
- .handle_pull_up = (usb_clocks_fops_t)&at91dci_pull_up,
- .handle_pull_down = (usb_clocks_fops_t)&at91dci_pull_down,
- .handle_wakeup_peer = (usb_clocks_fops_t)&at91dci_wakeup_peer,
+ .handle_clocks_on = &at91dci_clocks_on,
+ .handle_clocks_off = &at91dci_clocks_off,
+ .handle_pull_up = &at91dci_pull_up,
+ .handle_pull_down = &at91dci_pull_down,
+ .handle_wakeup_peer = &at91dci_wakeup_peer,
};
return generic_roothub_exec((struct usb_generic_softc *)sc, &fops, req,
==== //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/atmegadci.c#14 (text+ko) ====
@@ -143,8 +143,10 @@
}
static void
-atmegadci_clocks_on(struct atmegadci_softc *sc)
+atmegadci_clocks_on(void *arg)
{
+ struct atmegadci_softc *sc = (struct atmegadci_softc *)arg;
+
if (sc->sc_flags.clocks_off &&
sc->sc_flags.port_powered) {
@@ -165,8 +167,10 @@
}
static void
-atmegadci_clocks_off(struct atmegadci_softc *sc)
+atmegadci_clocks_off(void *arg)
{
+ struct atmegadci_softc *sc = (struct atmegadci_softc *)arg;
+
if (!sc->sc_flags.clocks_off) {
DPRINTFN(5, "\n");
@@ -187,8 +191,10 @@
}
static void
-atmegadci_pull_up(struct atmegadci_softc *sc)
+atmegadci_pull_up(void *arg)
{
+ struct atmegadci_softc *sc = (struct atmegadci_softc *)arg;
+
/* pullup D+, if possible */
if (!sc->sc_flags.d_pulled_up &&
@@ -199,8 +205,10 @@
}
static void
-atmegadci_pull_down(struct atmegadci_softc *sc)
+atmegadci_pull_down(void *arg)
{
+ struct atmegadci_softc *sc = (struct atmegadci_softc *)arg;
+
/* pulldown D+, if possible */
if (sc->sc_flags.d_pulled_up) {
@@ -210,8 +218,9 @@
}
static void
-atmegadci_wakeup_peer(struct atmegadci_softc *sc)
+atmegadci_wakeup_peer(void *arg)
{
+ struct atmegadci_softc *sc = (struct atmegadci_softc *)arg;
uint8_t temp;
if (!sc->sc_flags.status_suspend) {
@@ -1478,7 +1487,7 @@
static usb_error_t
atmega_clear_port_feature(struct usb_generic_softc *atsc,
- struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value,
+ const struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value,
uint16_t *index)
{
struct atmegadci_softc *sc = (struct atmegadci_softc *)atsc;
@@ -1566,11 +1575,11 @@
static const struct usb_roothub_fops fops = {
USB_DEFAULT_ROOTHUB,
.handle_clear_port_feature = &atmega_clear_port_feature,
- .handle_clocks_on = (usb_clocks_fops_t)&atmegadci_clocks_on,
- .handle_clocks_off = (usb_clocks_fops_t)&atmegadci_clocks_off,
- .handle_pull_up = (usb_clocks_fops_t)&atmegadci_pull_up,
- .handle_pull_down = (usb_clocks_fops_t)&atmegadci_pull_down,
- .handle_wakeup_peer = (usb_clocks_fops_t)&atmegadci_wakeup_peer,
+ .handle_clocks_on = &atmegadci_clocks_on,
+ .handle_clocks_off = &atmegadci_clocks_off,
+ .handle_pull_up = &atmegadci_pull_up,
+ .handle_pull_down = &atmegadci_pull_down,
+ .handle_wakeup_peer = &atmegadci_wakeup_peer,
};
return generic_roothub_exec((struct usb_generic_softc *) sc, &fops, req,
pptr, plength);
==== //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/avr32dci.c#13 (text+ko) ====
@@ -191,8 +191,10 @@
}
static void
-avr32dci_clocks_on(struct avr32dci_softc *sc)
+avr32dci_clocks_on(void *arg)
{
+ struct avr32dci_softc *sc = (struct avr32dci_softc *)arg;
+
if (sc->sc_flags.clocks_off &&
sc->sc_flags.port_powered) {
@@ -208,8 +210,10 @@
}
static void
-avr32dci_clocks_off(struct avr32dci_softc *sc)
+avr32dci_clocks_off(void *arg)
{
+ struct avr32dci_softc *sc = (struct avr32dci_softc *)arg;
+
if (!sc->sc_flags.clocks_off) {
DPRINTFN(5, "\n");
@@ -224,8 +228,10 @@
}
static void
-avr32dci_pull_up(struct avr32dci_softc *sc)
+avr32dci_pull_up(void *arg)
{
+ struct avr32dci_softc *sc = (struct avr32dci_softc *)arg;
+
/* pullup D+, if possible */
if (!sc->sc_flags.d_pulled_up &&
@@ -236,8 +242,10 @@
}
static void
-avr32dci_pull_down(struct avr32dci_softc *sc)
+avr32dci_pull_down(void *arg)
{
+ struct avr32dci_softc *sc = (struct avr32dci_softc *)arg;
+
/* pulldown D+, if possible */
if (sc->sc_flags.d_pulled_up) {
@@ -247,8 +255,10 @@
}
static void
-avr32dci_wakeup_peer(struct avr32dci_softc *sc)
+avr32dci_wakeup_peer(void *arg)
{
+ struct avr32dci_softc *sc = (struct avr32dci_softc *)arg;
+
if (!sc->sc_flags.status_suspend) {
return;
}
@@ -1552,11 +1562,11 @@
USB_DEFAULT_ROOTHUB,
.handle_clear_port_feature = &avr32dci_clear_port_feature,
.handle_get_port_status = &avr32dci_get_port_status,
- .handle_clocks_on = (usb_clocks_fops_t)&avr32dci_clocks_on,
- .handle_clocks_off = (usb_clocks_fops_t)&avr32dci_clocks_off,
- .handle_pull_up = (usb_clocks_fops_t)&avr32dci_pull_up,
- .handle_pull_down = (usb_clocks_fops_t)&avr32dci_pull_down,
- .handle_wakeup_peer = (usb_clocks_fops_t)&avr32dci_wakeup_peer,
+ .handle_clocks_on = &avr32dci_clocks_on,
+ .handle_clocks_off = &avr32dci_clocks_off,
+ .handle_pull_up = &avr32dci_pull_up,
+ .handle_pull_down = &avr32dci_pull_down,
+ .handle_wakeup_peer = &avr32dci_wakeup_peer,
};
return generic_roothub_exec((struct usb_generic_softc *) sc, &fops, req,
pptr, plength);
==== //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/musb_otg.c#15 (text+ko) ====
@@ -140,8 +140,10 @@
}
static void
-musbotg_clocks_on(struct musbotg_softc *sc)
+musbotg_clocks_on(void *arg)
{
+ struct musbotg_softc *sc = (struct musbotg_softc *)arg;
+
if (sc->sc_flags.clocks_off &&
sc->sc_flags.port_powered) {
@@ -157,8 +159,10 @@
}
static void
-musbotg_clocks_off(struct musbotg_softc *sc)
+musbotg_clocks_off(void *arg)
{
+ struct musbotg_softc *sc = (struct musbotg_softc *)arg;
+
if (!sc->sc_flags.clocks_off) {
DPRINTFN(4, "\n");
@@ -187,8 +191,10 @@
}
static void
-musbotg_pull_up(struct musbotg_softc *sc)
+musbotg_pull_up(void *arg)
{
+ struct musbotg_softc *sc = (struct musbotg_softc *)arg;
+
/* pullup D+, if possible */
if (!sc->sc_flags.d_pulled_up &&
@@ -199,8 +205,10 @@
}
static void
-musbotg_pull_down(struct musbotg_softc *sc)
+musbotg_pull_down(void *arg)
{
+ struct musbotg_softc *sc = (struct musbotg_softc *)arg;
+
/* pulldown D+, if possible */
if (sc->sc_flags.d_pulled_up) {
@@ -210,8 +218,9 @@
}
static void
-musbotg_wakeup_peer(struct musbotg_softc *sc)
+musbotg_wakeup_peer(void *arg)
{
+ struct musbotg_softc *sc = (struct musbotg_softc *)arg;
uint8_t temp;
if (!(sc->sc_flags.status_suspend)) {
@@ -2055,11 +2064,11 @@
static const struct usb_roothub_fops fops = {
USB_DEFAULT_ROOTHUB,
.handle_get_port_status = &musbotg_get_port_status,
- .handle_clocks_on = (usb_clocks_fops_t)&musbotg_clocks_on,
- .handle_clocks_off = (usb_clocks_fops_t)&musbotg_clocks_off,
- .handle_pull_up = (usb_clocks_fops_t)&musbotg_pull_up,
- .handle_pull_down = (usb_clocks_fops_t)&musbotg_pull_down,
- .handle_wakeup_peer = (usb_clocks_fops_t)&musbotg_wakeup_peer,
+ .handle_clocks_on = &musbotg_clocks_on,
+ .handle_clocks_off = &musbotg_clocks_off,
+ .handle_pull_up = &musbotg_pull_up,
+ .handle_pull_down = &musbotg_pull_down,
+ .handle_wakeup_peer = &musbotg_wakeup_peer,
};
return generic_roothub_exec((struct usb_generic_softc *)sc, &fops, req,
pptr, plength);
==== //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/s3c24xxdci.c#22 (text+ko) ====
@@ -150,8 +150,10 @@
}
static void
-s3c24dci_clocks_on(struct s3c24dci_softc *sc)
+s3c24dci_clocks_on(void *arg)
{
+ struct s3c24dci_softc *sc = (struct s3c24dci_softc *)arg;
+
if (sc->sc_flags.clocks_off &&
sc->sc_flags.port_powered) {
@@ -165,8 +167,10 @@
}
static void
-s3c24dci_clocks_off(struct s3c24dci_softc *sc)
+s3c24dci_clocks_off(void *arg)
{
+ struct s3c24dci_softc *sc = (struct s3c24dci_softc *)arg;
+
if (!sc->sc_flags.clocks_off) {
DPRINTFN(5, "\n");
@@ -179,8 +183,10 @@
}
static void
-s3c24dci_pull_up(struct s3c24dci_softc *sc)
+s3c24dci_pull_up(void *arg)
{
+ struct s3c24dci_softc *sc = (struct s3c24dci_softc *)arg;
+
/* pullup D+, if possible */
if (!sc->sc_flags.d_pulled_up &&
@@ -191,8 +197,10 @@
}
static void
-s3c24dci_pull_down(struct s3c24dci_softc *sc)
+s3c24dci_pull_down(void *arg)
{
+ struct s3c24dci_softc *sc = (struct s3c24dci_softc *)arg;
+
/* pulldown D+, if possible */
if (sc->sc_flags.d_pulled_up) {
@@ -202,8 +210,10 @@
}
static void
-s3c24dci_wakeup_peer(struct s3c24dci_softc *sc)
+s3c24dci_wakeup_peer(void *arg)
{
+ struct s3c24dci_softc *sc = (struct s3c24dci_softc *)arg;
+
if (!(sc->sc_flags.status_suspend)) {
return;
}
@@ -860,11 +870,11 @@
struct s3c24dci_softc *sc = S3C24_DCI_BUS2SC(udev->bus);
static const struct usb_roothub_fops fops = {
USB_DEFAULT_ROOTHUB,
- .handle_clocks_on = (usb_clocks_fops_t)&s3c24dci_clocks_on,
- .handle_clocks_off = (usb_clocks_fops_t)&s3c24dci_clocks_off,
- .handle_pull_up = (usb_clocks_fops_t)&s3c24dci_pull_up,
- .handle_pull_down = (usb_clocks_fops_t)&s3c24dci_pull_down,
- .handle_wakeup_peer = (usb_clocks_fops_t)&s3c24dci_wakeup_peer,
+ .handle_clocks_on = &s3c24dci_clocks_on,
+ .handle_clocks_off = &s3c24dci_clocks_off,
+ .handle_pull_up = &s3c24dci_pull_up,
+ .handle_pull_down = &s3c24dci_pull_down,
+ .handle_wakeup_peer = &s3c24dci_wakeup_peer,
};
return generic_roothub_exec((struct usb_generic_softc *)sc, &fops, req,
pptr, plength);
==== //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/uss820dci.c#14 (text+ko) ====
@@ -181,8 +181,9 @@
}
static void
-uss820dci_pull_up(struct uss820dci_softc *sc)
+uss820dci_pull_up(void *arg)
{
+ struct uss820dci_softc *sc = (struct uss820dci_softc *)arg;
uint8_t temp;
/* pullup D+, if possible */
@@ -200,8 +201,9 @@
}
static void
-uss820dci_pull_down(struct uss820dci_softc *sc)
+uss820dci_pull_down(void *arg)
{
+ struct uss820dci_softc *sc = (struct uss820dci_softc *)arg;
uint8_t temp;
/* pulldown D+, if possible */
@@ -218,8 +220,10 @@
}
static void
-uss820dci_wakeup_peer(struct uss820dci_softc *sc)
+uss820dci_wakeup_peer(void *arg)
{
+ struct uss820dci_softc *sc = (struct uss820dci_softc *)arg;
+
if (!(sc->sc_flags.status_suspend)) {
return;
}
@@ -1630,9 +1634,9 @@
struct uss820dci_softc *sc = USS820_DCI_BUS2SC(udev->bus);
static const struct usb_roothub_fops fops = {
USB_DEFAULT_ROOTHUB,
- .handle_pull_up = (usb_clocks_fops_t)&uss820dci_pull_up,
- .handle_pull_down = (usb_clocks_fops_t)&uss820dci_pull_down,
- .handle_wakeup_peer = (usb_clocks_fops_t)&uss820dci_wakeup_peer,
+ .handle_pull_up = &uss820dci_pull_up,
+ .handle_pull_down = &uss820dci_pull_down,
+ .handle_wakeup_peer = &uss820dci_wakeup_peer,
};
return generic_roothub_exec((struct usb_generic_softc *)sc, &fops, req,
pptr, plength);
==== //depot/projects/soc2009/syl_usb/src/sys/dev/usb/usb_controller.h#14 (text+ko) ====
@@ -209,34 +209,34 @@
struct usb_port_status ps;
};
-typedef usb_error_t (*usb_roothub_fops_t)(struct usb_generic_softc *sc, const struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index);
-typedef usb_error_t (*usb_clocks_fops_t)(struct usb_generic_softc *sc);
+typedef usb_error_t (usb_roothub_fops_t)(struct usb_generic_softc *sc, const struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index);
+typedef void (usb_clocks_fops_t)(void *arg);
struct usb_roothub_fops {
- usb_roothub_fops_t handle_get_descriptor;
- usb_roothub_fops_t handle_get_config;
- usb_roothub_fops_t handle_get_status;
- usb_roothub_fops_t handle_set_address;
- usb_roothub_fops_t handle_set_config;
- usb_roothub_fops_t handle_clear_halt;
- usb_roothub_fops_t handle_clear_wakeup;
- usb_roothub_fops_t handle_set_halt;
- usb_roothub_fops_t handle_set_wakeup;
- usb_roothub_fops_t handle_get_ep_status;
- usb_roothub_fops_t handle_set_interface;
- usb_roothub_fops_t handle_get_interface;
- usb_roothub_fops_t handle_get_iface_status;
- usb_roothub_fops_t handle_clear_port_feature;
- usb_roothub_fops_t handle_set_port_feature;
- usb_roothub_fops_t handle_get_tt_state;
- usb_roothub_fops_t handle_get_port_status;
- usb_roothub_fops_t handle_get_class_descriptor;
- usb_roothub_fops_t handle_get_class_status;
- usb_clocks_fops_t handle_clocks_on;
- usb_clocks_fops_t handle_clocks_off;
- usb_clocks_fops_t handle_pull_up;
- usb_clocks_fops_t handle_pull_down;
- usb_clocks_fops_t handle_wakeup_peer;
+ usb_roothub_fops_t *handle_get_descriptor;
+ usb_roothub_fops_t *handle_get_config;
+ usb_roothub_fops_t *handle_get_status;
+ usb_roothub_fops_t *handle_set_address;
+ usb_roothub_fops_t *handle_set_config;
+ usb_roothub_fops_t *handle_clear_halt;
+ usb_roothub_fops_t *handle_clear_wakeup;
+ usb_roothub_fops_t *handle_set_halt;
+ usb_roothub_fops_t *handle_set_wakeup;
+ usb_roothub_fops_t *handle_get_ep_status;
+ usb_roothub_fops_t *handle_set_interface;
+ usb_roothub_fops_t *handle_get_interface;
+ usb_roothub_fops_t *handle_get_iface_status;
+ usb_roothub_fops_t *handle_clear_port_feature;
+ usb_roothub_fops_t *handle_set_port_feature;
+ usb_roothub_fops_t *handle_get_tt_state;
+ usb_roothub_fops_t *handle_get_port_status;
+ usb_roothub_fops_t *handle_get_class_descriptor;
+ usb_roothub_fops_t *handle_get_class_status;
+ usb_clocks_fops_t *handle_clocks_on;
+ usb_clocks_fops_t *handle_clocks_off;
+ usb_clocks_fops_t *handle_pull_up;
+ usb_clocks_fops_t *handle_pull_down;
+ usb_clocks_fops_t *handle_wakeup_peer;
};
/* prototypes */
==== //depot/projects/soc2009/syl_usb/src/sys/dev/usb/usb_roothub_exec.c#9 (text+ko) ====
More information about the p4-projects
mailing list