From owner-svn-src-all@FreeBSD.ORG Thu Dec 31 00:06:53 2009 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 272BC106566B; Thu, 31 Dec 2009 00:06:53 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B63E8FC1D; Thu, 31 Dec 2009 00:06:53 +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 nBV06qXG078169; Thu, 31 Dec 2009 00:06:52 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBV06qs3078167; Thu, 31 Dec 2009 00:06:52 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912310006.nBV06qs3078167@svn.freebsd.org> From: Andrew Thompson Date: Thu, 31 Dec 2009 00:06:52 +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: r201299 - 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: Thu, 31 Dec 2009 00:06:53 -0000 Author: thompsa Date: Thu Dec 31 00:06:52 2009 New Revision: 201299 URL: http://svn.freebsd.org/changeset/base/201299 Log: MFC r200307 Fix dwSignature for NCM mode and add extra debug output. Modified: stable/8/sys/dev/usb/net/if_cdce.c 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_cdce.c ============================================================================== --- stable/8/sys/dev/usb/net/if_cdce.c Thu Dec 31 00:06:12 2009 (r201298) +++ stable/8/sys/dev/usb/net/if_cdce.c Thu Dec 31 00:06:52 2009 (r201299) @@ -1098,7 +1098,7 @@ cdce_ncm_fill_tx_frames(struct usb_xfer sc->sc_ncm.dpt.dwSignature[0] = 'N'; sc->sc_ncm.dpt.dwSignature[1] = 'C'; sc->sc_ncm.dpt.dwSignature[2] = 'M'; - sc->sc_ncm.dpt.dwSignature[3] = 'x'; + sc->sc_ncm.dpt.dwSignature[3] = '0'; USETW(sc->sc_ncm.dpt.wNextNdpIndex, 0); /* reserved */ usbd_copy_in(pc, 0, &(sc->sc_ncm.hdr), sizeof(sc->sc_ncm.hdr)); @@ -1182,7 +1182,7 @@ cdce_ncm_bulk_read_callback(struct usb_x if (actlen < (sizeof(sc->sc_ncm.hdr) + sizeof(sc->sc_ncm.dpt))) { DPRINTFN(1, "frame too short\n"); - goto tr_stall; + goto tr_setup; } usbd_copy_out(pc, 0, &(sc->sc_ncm.hdr), sizeof(sc->sc_ncm.hdr)); @@ -1191,7 +1191,12 @@ cdce_ncm_bulk_read_callback(struct usb_x (sc->sc_ncm.hdr.dwSignature[1] != 'C') || (sc->sc_ncm.hdr.dwSignature[2] != 'M') || (sc->sc_ncm.hdr.dwSignature[3] != 'H')) { - DPRINTFN(1, "invalid HDR signature\n"); + DPRINTFN(1, "invalid HDR signature: " + "0x%02x:0x%02x:0x%02x:0x%02x\n", + sc->sc_ncm.hdr.dwSignature[0], + sc->sc_ncm.hdr.dwSignature[1], + sc->sc_ncm.hdr.dwSignature[2], + sc->sc_ncm.hdr.dwSignature[3]); goto tr_stall; } temp = UGETW(sc->sc_ncm.hdr.wBlockLength); @@ -1202,7 +1207,7 @@ cdce_ncm_bulk_read_callback(struct usb_x } temp = UGETW(sc->sc_ncm.hdr.wDptIndex); if ((temp + sizeof(sc->sc_ncm.dpt)) > actlen) { - DPRINTFN(1, "invalid DPT index\n"); + DPRINTFN(1, "invalid DPT index: 0x%04x\n", temp); goto tr_stall; } usbd_copy_out(pc, temp, &(sc->sc_ncm.dpt), @@ -1211,8 +1216,13 @@ cdce_ncm_bulk_read_callback(struct usb_x if ((sc->sc_ncm.dpt.dwSignature[0] != 'N') || (sc->sc_ncm.dpt.dwSignature[1] != 'C') || (sc->sc_ncm.dpt.dwSignature[2] != 'M') || - (sc->sc_ncm.dpt.dwSignature[3] != 'x')) { - DPRINTFN(1, "invalid DPT signature\n"); + (sc->sc_ncm.dpt.dwSignature[3] != '0')) { + DPRINTFN(1, "invalid DPT signature" + "0x%02x:0x%02x:0x%02x:0x%02x\n", + sc->sc_ncm.dpt.dwSignature[0], + sc->sc_ncm.dpt.dwSignature[1], + sc->sc_ncm.dpt.dwSignature[2], + sc->sc_ncm.dpt.dwSignature[3]); goto tr_stall; } nframes = UGETW(sc->sc_ncm.dpt.wLength) / 4; @@ -1284,6 +1294,7 @@ cdce_ncm_bulk_read_callback(struct usb_x DPRINTFN(1, "Efficiency: %u/%u bytes\n", sumdata, actlen); case USB_ST_SETUP: +tr_setup: usbd_xfer_set_frame_len(xfer, 0, sc->sc_ncm.rx_max); usbd_xfer_set_frames(xfer, 1); usbd_transfer_submit(xfer);