From owner-svn-src-head@FreeBSD.ORG Wed Dec 1 03:51:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D664106564A; Wed, 1 Dec 2010 03:51:07 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BF668FC0C; Wed, 1 Dec 2010 03:51:07 +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 oB13p6Dk062511; Wed, 1 Dec 2010 03:51:06 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB13p6du062509; Wed, 1 Dec 2010 03:51:06 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201012010351.oB13p6du062509@svn.freebsd.org> From: Weongyo Jeong Date: Wed, 1 Dec 2010 03:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216091 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 03:51:07 -0000 Author: weongyo Date: Wed Dec 1 03:51:06 2010 New Revision: 216091 URL: http://svn.freebsd.org/changeset/base/216091 Log: Explicitly UP and DOWN the usbus interfaces (IFT_USB) when it's attached or detached. Normally it should be changed through user land ioctl(2) system calls but it looks there's no apps for USB and no need. With this patch, libpcap would detect the usbus interfaces correctly and tcpdump(1) could dump the USB packets into PCAP format with -w option. However it couldn't print the output to console because there's no printer-routine at tcpdump(1). Modified: head/sys/dev/usb/usb_pf.c Modified: head/sys/dev/usb/usb_pf.c ============================================================================== --- head/sys/dev/usb/usb_pf.c Wed Dec 1 03:35:19 2010 (r216090) +++ head/sys/dev/usb/usb_pf.c Wed Dec 1 03:51:06 2010 (r216091) @@ -65,6 +65,7 @@ usbpf_attach(struct usb_bus *ubus) ifp = ubus->ifp = if_alloc(IFT_USB); if_initname(ifp, "usbus", device_get_unit(ubus->bdev)); if_attach(ifp); + if_up(ifp); KASSERT(sizeof(struct usbpf_pkthdr) == USBPF_HDR_LEN, ("wrong USB pf header length (%zd)", sizeof(struct usbpf_pkthdr))); @@ -86,6 +87,7 @@ usbpf_detach(struct usb_bus *ubus) if (ifp != NULL) { bpfdetach(ifp); + if_down(ifp); if_detach(ifp); if_free(ifp); }