Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Oct 2010 21:28:58 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r214301 - stable/8/sys/dev/usb/net
Message-ID:  <201010242128.o9OLSwri040804@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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,
 };
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010242128.o9OLSwri040804>