From owner-svn-src-head@FreeBSD.ORG Wed Nov 26 17:16:54 2008 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 EF3DF1065672; Wed, 26 Nov 2008 17:16:54 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5E8C8FC1A; Wed, 26 Nov 2008 17:16:54 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAQHGsls061310; Wed, 26 Nov 2008 17:16:54 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAQHGsV6061308; Wed, 26 Nov 2008 17:16:54 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200811261716.mAQHGsV6061308@svn.freebsd.org> From: Nick Hibma Date: Wed, 26 Nov 2008 17:16:54 +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: r185338 - 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, 26 Nov 2008 17:16:55 -0000 Author: n_hibma Date: Wed Nov 26 17:16:54 2008 New Revision: 185338 URL: http://svn.freebsd.org/changeset/base/185338 Log: - Add the device ID for the HP HS2300 MC8775 clone (michael) - Bugfix: Don't excede static number of ports allowed when iterating over endpoints within an interface. - u3g_speeds contains speeds in baud, not bytes per second, so divide the buffer size by 10. Modified: head/sys/dev/usb/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/u3g.c ============================================================================== --- head/sys/dev/usb/u3g.c Wed Nov 26 16:38:43 2008 (r185337) +++ head/sys/dev/usb/u3g.c Wed Nov 26 17:16:54 2008 (r185338) @@ -87,8 +87,8 @@ struct ucom_callback u3g_callback = { struct u3g_speeds_s { - u_int32_t ispeed; - u_int32_t ospeed; + u_int32_t ispeed; // Speed in bits per second + u_int32_t ospeed; // Speed in bits per second }; static const struct u3g_speeds_s u3g_speeds[] = { @@ -180,7 +180,8 @@ static const struct u3g_dev_type_s u3g_d {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8755_3 }, U3GSP_UMTS, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8765 }, U3GSP_UMTS, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC875U }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8775_2 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8775_2 }, U3GSP_HSDPA, U3GFL_NONE }, // XXX + {{ USB_VENDOR_HP, USB_PRODUCT_HP_HS2300 }, U3GSP_HSDPA, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8780 }, U3GSP_UMTS, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8781 }, U3GSP_UMTS, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_TRUINSTALL }, U3GSP_UMTS, U3GFL_SIERRA_INIT }, // Sierra TruInstaller device ID @@ -272,7 +273,7 @@ u3g_attach(device_t self) int bulkin_no = -1, bulkout_no = -1; int claim_iface = 0; - for (n = 0; n < id->bNumEndpoints; n++) { + for (n = 0; n < id->bNumEndpoints && portno < U3G_MAXPORTS; n++) { ed = usbd_interface2endpoint_descriptor(uaa->ifaces[i], n); if (ed == NULL) continue; @@ -296,9 +297,9 @@ u3g_attach(device_t self) ucom->sc_bulkin_no = bulkin_no; ucom->sc_bulkout_no = bulkout_no; // Allocate a buffer enough for 10ms worth of data - ucom->sc_ibufsize = u3g_speeds[sc->sc_speed].ispeed/USB_FRAMES_PER_SECOND*10; + ucom->sc_ibufsize = u3g_speeds[sc->sc_speed].ispeed/10/USB_FRAMES_PER_SECOND*10; ucom->sc_ibufsizepad = ucom->sc_ibufsize; - ucom->sc_obufsize = u3g_speeds[sc->sc_speed].ospeed/USB_FRAMES_PER_SECOND*10; + ucom->sc_obufsize = u3g_speeds[sc->sc_speed].ospeed/10/USB_FRAMES_PER_SECOND*10; ucom->sc_opkthdrlen = 0; ucom->sc_callback = &u3g_callback; Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Nov 26 16:38:43 2008 (r185337) +++ head/sys/dev/usb/usbdevs Wed Nov 26 17:16:54 2008 (r185338) @@ -1429,6 +1429,7 @@ product HP P1100 0x3102 Photosmart P110 product HP OJ4215 0x3d11 OfficeJet 4215 product HP HN210E 0x811c Ethernet HN210E product HP2 C500 0x6002 PhotoSmart C500 +product HP HS2300 0x1e1d hs2300 HSDPA (aka MC8775) /* HTC products */ product HTC WINMOBILE 0x00ce HTC USB Sync