From owner-svn-src-all@FreeBSD.ORG Sun Oct 24 21:28:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A8D8106564A; Sun, 24 Oct 2010 21:28:58 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 583718FC0A; Sun, 24 Oct 2010 21:28:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9OLSwZP040807; Sun, 24 Oct 2010 21:28:58 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9OLSwri040804; Sun, 24 Oct 2010 21:28:58 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010242128.o9OLSwri040804@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 24 Oct 2010 21:28:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214301 - stable/8/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Oct 2010 21:28:58 -0000 Author: yongari Date: Sun Oct 24 21:28:58 2010 New Revision: 214301 URL: http://svn.freebsd.org/changeset/base/214301 Log: MFC r213696: Do not setup interrupt endpoint for axe(4). It seems axe(4) controllers support interrupt endpoint such that enabling interrupt endpoint generates about 1000 interrupts/sec. Controllers transfer 8 bytes data through interrupt endpoint and the data include link UP/DOWN state as well as some PHY related information. Previously axe(4) didn't use the transferred data and didn't even try to read the data. Because axe(4) counts on mii(4) to detect link state changes there is no need to use interrupt endpoint here. This change fixes generation of unnecessary interrupts which was seen when interface is brought to UP. No objections from: hselasky Modified: stable/8/sys/dev/usb/net/if_axe.c stable/8/sys/dev/usb/net/if_axereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Sun Oct 24 21:26:41 2010 (r214300) +++ stable/8/sys/dev/usb/net/if_axe.c Sun Oct 24 21:28:58 2010 (r214301) @@ -171,7 +171,6 @@ static device_probe_t axe_probe; static device_attach_t axe_attach; static device_detach_t axe_detach; -static usb_callback_t axe_intr_callback; static usb_callback_t axe_bulk_read_callback; static usb_callback_t axe_bulk_write_callback; @@ -215,15 +214,6 @@ static const struct usb_config axe_confi .callback = axe_bulk_read_callback, .timeout = 0, /* no timeout */ }, - - [AXE_INTR_DT_RD] = { - .type = UE_INTERRUPT, - .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .bufsize = 0, /* use wMaxPacketSize */ - .callback = axe_intr_callback, - }, }; static device_method_t axe_methods[] = { @@ -746,27 +736,6 @@ axe_detach(device_t dev) return (0); } -static void -axe_intr_callback(struct usb_xfer *xfer, usb_error_t error) -{ - switch (USB_GET_STATE(xfer)) { - case USB_ST_TRANSFERRED: - case USB_ST_SETUP: -tr_setup: - usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); - usbd_transfer_submit(xfer); - return; - - default: /* Error */ - if (error != USB_ERR_CANCELLED) { - /* try to clear stall first */ - usbd_xfer_set_stall(xfer); - goto tr_setup; - } - return; - } -} - #if (AXE_BULK_BUF_SIZE >= 0x10000) #error "Please update axe_bulk_read_callback()!" #endif @@ -984,7 +953,6 @@ axe_start(struct usb_ether *ue) /* * start the USB transfers, if not already started: */ - usbd_transfer_start(sc->sc_xfer[AXE_INTR_DT_RD]); usbd_transfer_start(sc->sc_xfer[AXE_BULK_DT_RD]); usbd_transfer_start(sc->sc_xfer[AXE_BULK_DT_WR]); } @@ -1089,7 +1057,6 @@ axe_stop(struct usb_ether *ue) */ usbd_transfer_stop(sc->sc_xfer[AXE_BULK_DT_WR]); usbd_transfer_stop(sc->sc_xfer[AXE_BULK_DT_RD]); - usbd_transfer_stop(sc->sc_xfer[AXE_INTR_DT_RD]); axe_reset(sc); } Modified: stable/8/sys/dev/usb/net/if_axereg.h ============================================================================== --- stable/8/sys/dev/usb/net/if_axereg.h Sun Oct 24 21:26:41 2010 (r214300) +++ stable/8/sys/dev/usb/net/if_axereg.h Sun Oct 24 21:28:58 2010 (r214301) @@ -172,7 +172,6 @@ struct axe_sframe_hdr { enum { AXE_BULK_DT_WR, AXE_BULK_DT_RD, - AXE_INTR_DT_RD, AXE_N_TRANSFER, };