svn commit: r185338 - head/sys/dev/usb
Nick Hibma
n_hibma at FreeBSD.org
Wed Nov 26 09:16:55 PST 2008
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
More information about the svn-src-all
mailing list