From owner-p4-projects@FreeBSD.ORG Wed Aug 12 18:31:03 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 522201065672; Wed, 12 Aug 2009 18:31:03 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 122BF106566C for ; Wed, 12 Aug 2009 18:31:03 +0000 (UTC) (envelope-from syl@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id F39D88FC44 for ; Wed, 12 Aug 2009 18:31:02 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n7CIV275033669 for ; Wed, 12 Aug 2009 18:31:02 GMT (envelope-from syl@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n7CIV2uW033667 for perforce@freebsd.org; Wed, 12 Aug 2009 18:31:02 GMT (envelope-from syl@FreeBSD.org) Date: Wed, 12 Aug 2009 18:31:02 GMT Message-Id: <200908121831.n7CIV2uW033667@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to syl@FreeBSD.org using -f From: Sylvestre Gallon To: Perforce Change Reviews Cc: Subject: PERFORCE change 167252 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2009 18:31:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=167252 Change 167252 by syl@syl_atuin on 2009/08/12 18:30:48 Add 2 missing break. Add missing comments. Style update. Affected files ... .. //depot/projects/soc2009/syl_usb/src/sys/dev/usb/usb_controller.h#10 edit .. //depot/projects/soc2009/syl_usb/src/sys/dev/usb/usb_roothub_exec.c#7 edit Differences ... ==== //depot/projects/soc2009/syl_usb/src/sys/dev/usb/usb_controller.h#10 (text+ko) ==== ==== //depot/projects/soc2009/syl_usb/src/sys/dev/usb/usb_roothub_exec.c#7 (text+ko) ==== @@ -79,7 +79,9 @@ static struct usb_roothub_fops generic_roothub_fops; static usb_error_t -generic_get_descriptor(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_get_descriptor(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, + uint16_t *index) { switch ((*value) >> 8) { case UDESC_DEVICE: @@ -115,7 +117,9 @@ } static usb_error_t -generic_get_config(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_get_config(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, + uint16_t *index) { *len = 1; sc->sc_hub_temp.wValue[0] = sc->sc_conf; @@ -123,7 +127,8 @@ } static usb_error_t -generic_get_status(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_get_status(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, + uint16_t *len, uint16_t *value, uint16_t *index) { *len = 2; USETW(sc->sc_hub_temp.wValue, UDS_SELF_POWERED); @@ -131,7 +136,9 @@ } static usb_error_t -generic_set_address(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_set_address(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, + uint16_t *index) { if ((*value) & 0xff00) { return (USB_ERR_STALLED); @@ -141,7 +148,8 @@ } static usb_error_t -generic_set_config(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_set_config(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, + uint16_t *len, uint16_t *value, uint16_t *index) { if ((*value) >= 2) { return (USB_ERR_STALLED); @@ -151,31 +159,38 @@ } static usb_error_t -generic_clear_halt(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_clear_halt(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, + uint16_t *len, uint16_t *value, uint16_t *index) { return (0); } static usb_error_t -generic_clear_wakeup(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_clear_wakeup(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, + uint16_t *index) { return (0); } static usb_error_t -generic_set_halt(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_set_halt(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, + uint16_t *len, uint16_t *value, uint16_t *index) { return (0); } static usb_error_t -generic_set_wakeup(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_set_wakeup(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, + uint16_t *len, uint16_t *value, uint16_t *index) { return (0); } static usb_error_t -generic_get_ep_status(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_get_ep_status(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, + uint16_t *index) { *len = 2; USETW(sc->sc_hub_temp.wValue, 0); @@ -183,13 +198,17 @@ } static usb_error_t -generic_set_interface(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_set_interface(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, + uint16_t *index) { return (0); } static usb_error_t -generic_get_interface(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_get_interface(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, + uint16_t *index) { *len = 1; sc->sc_hub_temp.wValue[0] = 0; @@ -197,15 +216,20 @@ } static usb_error_t -generic_get_iface_status(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_get_iface_status(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, + uint16_t *index) { *len = 2; USETW(sc->sc_hub_temp.wValue, 0); return (0); } +/* XXX Atmega need another function here */ static usb_error_t -generic_clear_port_feature(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_clear_port_feature(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, + uint16_t *index) { if ((*index) != 1) { return (USB_ERR_STALLED); @@ -227,6 +251,7 @@ case UHF_C_PORT_ENABLE: case UHF_C_PORT_OVER_CURRENT: case UHF_C_PORT_RESET: + /* nops */ break; case UHF_PORT_POWER: sc->sc_flags.port_powered = 0; @@ -248,7 +273,9 @@ } static usb_error_t -generic_set_port_feature(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_set_port_feature(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, + uint16_t *index) { if ((*index) != 1) { return (USB_ERR_IOERROR); @@ -263,6 +290,7 @@ case UHF_PORT_RESET: case UHF_PORT_TEST: case UHF_PORT_INDICATOR: + /* nops */ break; case UHF_PORT_POWER: sc->sc_flags.port_powered = 1; @@ -274,16 +302,19 @@ } static usb_error_t -generic_get_tt_state(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_get_tt_state(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, + uint16_t *index) { *len = 2; USETW(sc->sc_hub_temp.wValue, 0); return (0); } -/* XXX at91 Need another func*/ static usb_error_t -generic_get_port_status(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_get_port_status(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, + uint16_t *index) { DPRINTFN(9, "UR_GET_PORT_STATUS"); @@ -296,10 +327,10 @@ if (fops->handle_pull_up) fops->handle_pull_up(sc); } else { + if (fops->handle_pull_down) + fops->handle_pull_down(sc); if (fops->handle_clocks_off) fops->handle_clocks_off(sc); - if (fops->handle_pull_down) - fops->handle_pull_down(sc); } /* Select Full-Speend and Device Side Mode */ @@ -336,7 +367,9 @@ } static usb_error_t -generic_get_class_descriptor(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_get_class_descriptor(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, + uint16_t *index) { if ((*value) & 0xff) { return (USB_ERR_STALLED); @@ -346,7 +379,9 @@ } static usb_error_t -generic_get_class_status(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, uint16_t *index) +generic_get_class_status(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, uint16_t *len, uint16_t *value, + uint16_t *index) { *len = 2; USETW(sc->sc_hub_temp.wValue, 0); @@ -354,8 +389,9 @@ } usb_error_t -generic_roothub_exec(struct usb_generic_softc *sc, struct usb_roothub_fops *fops, - struct usb_device_request *req, const void **pptr, uint16_t *plength) +generic_roothub_exec(struct usb_generic_softc *sc, + struct usb_roothub_fops *fops, struct usb_device_request *req, + const void **pptr, uint16_t *plength) { const void *ptr; uint16_t len; @@ -557,8 +593,10 @@ break ; } break; + default: err = USB_ERR_STALLED; + break; } *plength = len;