Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset.
Synopsis: The umodem driver doesn't support the MTK 3329 GPS chipset. State-Changed-From-To: open->patched State-Changed-By: linimon State-Changed-When: Mon Feb 28 04:13:40 UTC 2011 State-Changed-Why: Over to committer as MFC reminder. Responsible-Changed-From-To: freebsd-usb->hselasky Responsible-Changed-By: linimon Responsible-Changed-When: Mon Feb 28 04:13:40 UTC 2011 Responsible-Changed-Why: http://www.freebsd.org/cgi/query-pr.cgi?pr=153929 ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset.
The following reply was made to PR usb/153929; it has been noted by GNATS. From: Mykhaylo Yehorov To: Hans Petter Selasky Cc: freebsd-usb@freebsd.org, freebsd-gnats-sub...@freebsd.org Subject: Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset. Date: Thu, 3 Feb 2011 15:56:43 +0200 On Wed, Feb 2, 2011 at 20:35, Hans Petter Selasky wrote: > Can you verify the attached patch with your device? It works fine with my device. ugen1.3: at usbus1 umodem_probe: umodem_probe: umodem_probe: umodem0: on usbus1 umodem_get_caps: no CM desc (faking one) umodem_get_caps: no ACM desc umodem_attach: Missing descriptor. Assuming data interface is next. umodem_find_data_iface: Match at index 0 umodem0: data interface 0, has CM over data, has no break ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset.
On Wed, Feb 2, 2011 at 20:35, Hans Petter Selasky wrote: > Can you verify the attached patch with your device? It works fine with my device. ugen1.3: at usbus1 umodem_probe: umodem_probe: umodem_probe: umodem0: on usbus1 umodem_get_caps: no CM desc (faking one) umodem_get_caps: no ACM desc umodem_attach: Missing descriptor. Assuming data interface is next. umodem_find_data_iface: Match at index 0 umodem0: data interface 0, has CM over data, has no break ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset.
The following reply was made to PR usb/153929; it has been noted by GNATS. From: Hans Petter Selasky To: freebsd-usb@freebsd.org Cc: Mykhaylo Yehorov , freebsd-gnats-sub...@freebsd.org Subject: Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset. Date: Wed, 2 Feb 2011 19:35:13 +0100 --Boundary-00=_hPaSN1ZTrNWJk0m Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit On Thursday 13 January 2011 14:20:08 Hans Petter Selasky wrote: > The following reply was made to PR usb/153929; it has been noted by GNATS. > > From: Hans Petter Selasky > To: Mykhaylo Yehorov > Cc: freebsd-gnats-sub...@freebsd.org > Subject: Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS > chipset. Date: Thu, 13 Jan 2011 14:12:41 +0100 > > On Thursday 13 January 2011 14:07:22 Mykhaylo Yehorov wrote: > > These are changes for searching the closest unlocked data interface. > > OK, I will see if I can get your patch committed [with some modifications > which I will do] in not so long. > > --HPS Hi Mykhaylo, Can you verify the attached patch with your device? --HPS --Boundary-00=_hPaSN1ZTrNWJk0m Content-Type: text/x-patch; charset="iso-8859-15"; name="umodem.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="umodem.patch" === serial/umodem.c == --- serial/umodem.c(revision 218169) +++ serial/umodem.c(local) @@ -197,6 +197,8 @@ static usb_error_t umodem_set_comm_feature(struct usb_device *, uint8_t, uint16_t, uint16_t); static void umodem_poll(struct ucom_softc *ucom); +static void umodem_find_data_iface(struct usb_attach_arg *uaa, + uint8_t, uint8_t *, uint8_t *); static const struct usb_config umodem_config[UMODEM_N_TRANSFER] = { @@ -311,13 +313,30 @@ 0 - 1, UDESCSUB_CDC_UNION, 0 - 1); if ((cud == NULL) || (cud->bLength < sizeof(*cud))) { - device_printf(dev, "Missing descriptor. " + DPRINTF("Missing descriptor. " "Assuming data interface is next.\n"); - if (sc->sc_ctrl_iface_no == 0xFF) + if (sc->sc_ctrl_iface_no == 0xFF) { goto detach; - else - sc->sc_data_iface_no = - sc->sc_ctrl_iface_no + 1; + } else { + uint8_t class_match = 0; + + /* set default interface number */ + sc->sc_data_iface_no = 0xFF; + + /* try to find the data interface backwards */ + umodem_find_data_iface(uaa, + uaa->info.bIfaceIndex - 1, + &sc->sc_data_iface_no, &class_match); + + /* try to find the data interface forwards */ + umodem_find_data_iface(uaa, + uaa->info.bIfaceIndex + 1, + &sc->sc_data_iface_no, &class_match); + + /* check if nothing was found */ + if (sc->sc_data_iface_no == 0xFF) + goto detach; + } } else { sc->sc_data_iface_no = cud->bSlaveInterface[0]; } @@ -398,6 +417,36 @@ } static void +umodem_find_data_iface(struct usb_attach_arg *uaa, +uint8_t iface_index, uint8_t *p_data_no, uint8_t *p_match_class) +{ + struct usb_interface_descriptor *id; + struct usb_interface *iface; + + iface = usbd_get_iface(uaa->device, iface_index); + + /* check for end of interfaces */ + if (iface == NULL) + return; + + id = usbd_get_interface_descriptor(iface); + + /* check for non-matching interface class */ + if (id->bInterfaceClass != UICLASS_CDC_DATA || + id->bInterfaceSubClass != UISUBCLASS_DATA) { + /* if we got a class match then return */ + if (*p_match_class) + return; + } else { + *p_match_class = 1; + } + + DPRINTFN(11, "Match at index %u\n", iface_index); + + *p_data_no = id->bInterfaceNumber; +} + +static void umodem_start_read(struct ucom_softc *ucom) { struct umodem_softc *sc = ucom->sc_parent; === usbdevs =
Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset.
On Thursday 13 January 2011 14:20:08 Hans Petter Selasky wrote: > The following reply was made to PR usb/153929; it has been noted by GNATS. > > From: Hans Petter Selasky > To: Mykhaylo Yehorov > Cc: freebsd-gnats-sub...@freebsd.org > Subject: Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS > chipset. Date: Thu, 13 Jan 2011 14:12:41 +0100 > > On Thursday 13 January 2011 14:07:22 Mykhaylo Yehorov wrote: > > These are changes for searching the closest unlocked data interface. > > OK, I will see if I can get your patch committed [with some modifications > which I will do] in not so long. > > --HPS Hi Mykhaylo, Can you verify the attached patch with your device? --HPS === serial/umodem.c == --- serial/umodem.c (revision 218169) +++ serial/umodem.c (local) @@ -197,6 +197,8 @@ static usb_error_t umodem_set_comm_feature(struct usb_device *, uint8_t, uint16_t, uint16_t); static void umodem_poll(struct ucom_softc *ucom); +static void umodem_find_data_iface(struct usb_attach_arg *uaa, + uint8_t, uint8_t *, uint8_t *); static const struct usb_config umodem_config[UMODEM_N_TRANSFER] = { @@ -311,13 +313,30 @@ 0 - 1, UDESCSUB_CDC_UNION, 0 - 1); if ((cud == NULL) || (cud->bLength < sizeof(*cud))) { - device_printf(dev, "Missing descriptor. " + DPRINTF("Missing descriptor. " "Assuming data interface is next.\n"); - if (sc->sc_ctrl_iface_no == 0xFF) + if (sc->sc_ctrl_iface_no == 0xFF) { goto detach; - else -sc->sc_data_iface_no = -sc->sc_ctrl_iface_no + 1; + } else { +uint8_t class_match = 0; + +/* set default interface number */ +sc->sc_data_iface_no = 0xFF; + +/* try to find the data interface backwards */ +umodem_find_data_iface(uaa, +uaa->info.bIfaceIndex - 1, +&sc->sc_data_iface_no, &class_match); + +/* try to find the data interface forwards */ +umodem_find_data_iface(uaa, +uaa->info.bIfaceIndex + 1, +&sc->sc_data_iface_no, &class_match); + +/* check if nothing was found */ +if (sc->sc_data_iface_no == 0xFF) + goto detach; + } } else { sc->sc_data_iface_no = cud->bSlaveInterface[0]; } @@ -398,6 +417,36 @@ } static void +umodem_find_data_iface(struct usb_attach_arg *uaa, +uint8_t iface_index, uint8_t *p_data_no, uint8_t *p_match_class) +{ + struct usb_interface_descriptor *id; + struct usb_interface *iface; + + iface = usbd_get_iface(uaa->device, iface_index); + + /* check for end of interfaces */ + if (iface == NULL) + return; + + id = usbd_get_interface_descriptor(iface); + + /* check for non-matching interface class */ + if (id->bInterfaceClass != UICLASS_CDC_DATA || + id->bInterfaceSubClass != UISUBCLASS_DATA) { + /* if we got a class match then return */ + if (*p_match_class) + return; + } else { + *p_match_class = 1; + } + + DPRINTFN(11, "Match at index %u\n", iface_index); + + *p_data_no = id->bInterfaceNumber; +} + +static void umodem_start_read(struct ucom_softc *ucom) { struct umodem_softc *sc = ucom->sc_parent; === usbdevs == --- usbdevs (revision 218169) +++ usbdevs (local) @@ -536,6 +536,7 @@ vendor HAWKING 0x0e66 Hawking vendor FOSSIL 0x0e67 Fossil, Inc vendor GMATE 0x0e7e G.Mate, Inc +vendor MEDIATEK 0x0e8d MediaTek, Inc. vendor OTI 0x0ea0 Ours Technology vendor YISO 0x0eab Yiso Wireless Co. vendor PILOTECH 0x0eaf Pilotech @@ -2120,6 +2121,9 @@ product MCT USB232 0x0210 USB-232 Interface product MCT SITECOM_USB232 0x0230 Sitecom USB-232 Products +/* MediaTek, Inc. */ +product MEDIATEK MTK3329 0x3329 MTK II GPS Receiver + /* Meizu Electronics */ product MEIZU M6_SL 0x0140 MiniPlayer M6 (SL) ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset.
The following reply was made to PR usb/153929; it has been noted by GNATS. From: Hans Petter Selasky To: Mykhaylo Yehorov Cc: freebsd-gnats-sub...@freebsd.org Subject: Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset. Date: Thu, 13 Jan 2011 14:12:41 +0100 On Thursday 13 January 2011 14:07:22 Mykhaylo Yehorov wrote: > These are changes for searching the closest unlocked data interface. OK, I will see if I can get your patch committed [with some modifications which I will do] in not so long. --HPS ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset.
The following reply was made to PR usb/153929; it has been noted by GNATS. From: Mykhaylo Yehorov To: Hans Petter Selasky Cc: freebsd-gnats-sub...@freebsd.org Subject: Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset. Date: Thu, 13 Jan 2011 15:07:22 +0200 --90e6ba6e8d7a8e61b40499b9ffd2 Content-Type: text/plain; charset=UTF-8 These are changes for searching the closest unlocked data interface. --90e6ba6e8d7a8e61b40499b9ffd2 Content-Type: text/plain; charset=US-ASCII; name="umodem.txt" Content-Disposition: attachment; filename="umodem.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_givo92mw0 LS0tIG9yaWcvc3lzL2Rldi91c2IvcXVpcmsvdXNiX3F1aXJrLmMJMjAxMC0xMS0yOSAwMDowNzow OC4wMDAwMDAwMDAgKzAyMDAKKysrIHN5cy9kZXYvdXNiL3F1aXJrL3VzYl9xdWlyay5jCTIwMTEt MDEtMTMgMTQ6NTQ6MzMuNjUyNTM2MDAwICswMjAwCkBAIC00NTgsNiArNDU4LDcgQEAKIAlVU0Jf UVVJUksoQ0hJUFNCQU5LLCBVU0JNRU1TVElDSywgMHgwMDAwLCAweGZmZmYsIFVRX01TQ19OT19T WU5DX0NBQ0hFKSwKIAlVU0JfUVVJUksoQ0hJUFNCQU5LLCBVU0JNRU1TVElDSzEsIDB4MDAwMCwg MHhmZmZmLCBVUV9NU0NfTk9fU1lOQ19DQUNIRSksCiAJVVNCX1FVSVJLKE5FV0xJTkssIFVTQjJJ REVCUklER0UsIDB4MDAwMCwgMHhmZmZmLCBVUV9NU0NfTk9fU1lOQ19DQUNIRSksCisJVVNCX1FV SVJLKE1FRElBVEVLLCBNVEszMzI5LCAweDAwMDAsIDB4ZmZmZiwgVVFfTURNX1NFRUtfQkFDS19E QVRBKSwKIH07CiAjdW5kZWYgVVNCX1FVSVJLX1ZQCiAjdW5kZWYgVVNCX1FVSVJLCkBAIC00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lZWtfZm9yd2FyZCA/ICJmb3J3YXJkIiA6ICJiYWNrd2FyZCIpOworCisJCWlzX2RldCA9 IHVtb2RlbV9maW5kX2RhdGFfaW50ZXJmYWNlKHVhYSwKKwkJICAgIHNjLT5zY19jdHJsX2lmYWNl X25vLAorCQkgICAgc2Vla19mb3J3YXJkLAorCQkgICAgJnNjLT5zY19kYXRhX2lmYWNlX25vKTsK KworCQlpZiAoIWlzX2RldCkgeworCQkJZGV2aWNlX3ByaW50Zih
Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset.
The following reply was made to PR usb/153929; it has been noted by GNATS. From: Mykhaylo Yehorov To: Hans Petter Selasky Cc: freebsd-usb@freebsd.org, freebsd-gnats-sub...@freebsd.org Subject: Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset. Date: Wed, 12 Jan 2011 18:31:21 +0200 On Wed, Jan 12, 2011 at 16:41, Hans Petter Selasky wrote: > Your patch looks OK, except it might need some more checks to figure out if > there are multiple modems or just one, and which DATA interface is the > closest > one. Do you have some ideas about how you would solve that? In this situation the best approach is to seek forward the closest data interface by default and seek backward if a device does have some new quirk which should be created. -- Mykhaylo Yehorov ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset.
On Wed, Jan 12, 2011 at 16:41, Hans Petter Selasky wrote: > Your patch looks OK, except it might need some more checks to figure out if > there are multiple modems or just one, and which DATA interface is the closest > one. Do you have some ideas about how you would solve that? In this situation the best approach is to seek forward the closest data interface by default and seek backward if a device does have some new quirk which should be created. -- Mykhaylo Yehorov ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset.
The following reply was made to PR usb/153929; it has been noted by GNATS. From: Hans Petter Selasky To: freebsd-usb@freebsd.org Cc: Mykhaylo Yehorov , freebsd-gnats-sub...@freebsd.org Subject: Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset. Date: Wed, 12 Jan 2011 15:41:24 +0100 On Wednesday 12 January 2011 14:09:53 Mykhaylo Yehorov wrote: > >Number: 153929 > >Category: usb > >Synopsis: The umodem driver doesn't support the MTK 3329 GPS > >chipset. Confidential: no > >Severity: non-critical > >Priority: low > >Responsible:freebsd-usb > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: change-request > >Submitter-Id: current-users > >Arrival-Date: Wed Jan 12 13:10:09 UTC 2011 > >Closed-Date: > >Last-Modified: > >Originator: Mykhaylo Yehorov > >Release:FreeBSD 8-STABLE > >Organization: > > >Environment: > FreeBSD box.interexc.com 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #1 r197782M: > Tue Jan 4 14:49:50 EET 2011 > m...@box.interexc.com:/usr/obj/usr/src/sys/MINI i386 > > >Description: > I'm trying to connect my GPS receiver based on the MTK 3329 GPS chipset to > a FreeBSD box. The umodem driver matches to the device but fails to attach > to it. > > My kernel is built with "options USB_DEBUG". > Sysctl variable syshw.usb.umodem.debug is set to 11. > After attaching the GPS receiver to an USB port the following lines appear > in dmesg. > > ugen1.3: at usbus1 > umodem_probe: > umodem_probe: > umodem_probe: > umodem0: on usbus1 > umodem_get_caps: no CM desc (faking one) > umodem_get_caps: no ACM desc > umodem0: Missing descriptor. Assuming data interface is next. > umodem0: data interface 2, has CM over data, has no break > umodem0: no data interface > umodem_detach: sc=0xc907aa00 > device_attach: umodem0 attach returned 6 > umodem_probe: > umodem0: on usbus1 > umodem_get_caps: no CM desc (faking one) > umodem_get_caps: no ACM desc > umodem0: Missing descriptor. Assuming data interface is next. > umodem0: data interface 2, has CM over data, has no break > umodem0: no data interface > umodem_detach: sc=0xc9ddf800 > device_attach: umodem0 attach returned 6 > > usbconfig shows the following. > > ugen1.3: at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) > pwr=ON > > bLength = 0x0012 > bDescriptorType = 0x0001 > bcdUSB = 0x0200 > bDeviceClass = 0x0002 > bDeviceSubClass = 0x > bDeviceProtocol = 0x > bMaxPacketSize0 = 0x0040 > idVendor = 0x0e8d > idProduct = 0x3329 > bcdDevice = 0x0100 > iManufacturer = 0x0003 > iProduct = 0x0004 > iSerialNumber = 0x > bNumConfigurations = 0x0001 > > > Configuration index 0 > > bLength = 0x0009 > bDescriptorType = 0x0002 > wTotalLength = 0x0043 > bNumInterfaces = 0x0002 > bConfigurationValue = 0x0001 > iConfiguration = 0x > bmAttributes = 0x0080 > bMaxPower = 0x00fa > > Interface 0 > bLength = 0x0009 > bDescriptorType = 0x0004 > bInterfaceNumber = 0x > bAlternateSetting = 0x > bNumEndpoints = 0x0002 > bInterfaceClass = 0x000a > bInterfaceSubClass = 0x > bInterfaceProtocol = 0x > iInterface = 0x0001 > > Endpoint 0 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0081 > bmAttributes = 0x0002 > wMaxPacketSize = 0x0040 > bInterval = 0x > bRefresh = 0x > bSynchAddress = 0x > > Endpoint 1 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0001 > bmAttributes = 0x0002 > wMaxPacketSize = 0x0040 > bInterval = 0x > bRefresh = 0x > bSynchAddress = 0x > > > Interface 1 > bLength = 0x001c > bDescriptorType = 0x0004 > bInterfaceNumber = 0x0001 > bAlternateSetting = 0x > bNumEndpoints = 0x0001 > bInterfaceClass = 0x0002 > bInterfaceSubClass = 0x0002 > bInterfaceProtocol = 0x0001 > iInterface = 0x0002 > > Endpoint 0 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0082 > bmAttributes = 0x0003 > wMaxPacketSize = 0x0040 > bInterval =
Re: usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset.
On Wednesday 12 January 2011 14:09:53 Mykhaylo Yehorov wrote: > >Number: 153929 > >Category: usb > >Synopsis: The umodem driver doesn't support the MTK 3329 GPS > >chipset. Confidential: no > >Severity: non-critical > >Priority: low > >Responsible:freebsd-usb > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: change-request > >Submitter-Id: current-users > >Arrival-Date: Wed Jan 12 13:10:09 UTC 2011 > >Closed-Date: > >Last-Modified: > >Originator: Mykhaylo Yehorov > >Release:FreeBSD 8-STABLE > >Organization: > > >Environment: > FreeBSD box.interexc.com 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #1 r197782M: > Tue Jan 4 14:49:50 EET 2011 > m...@box.interexc.com:/usr/obj/usr/src/sys/MINI i386 > > >Description: > I'm trying to connect my GPS receiver based on the MTK 3329 GPS chipset to > a FreeBSD box. The umodem driver matches to the device but fails to attach > to it. > > My kernel is built with "options USB_DEBUG". > Sysctl variable syshw.usb.umodem.debug is set to 11. > After attaching the GPS receiver to an USB port the following lines appear > in dmesg. > > ugen1.3: at usbus1 > umodem_probe: > umodem_probe: > umodem_probe: > umodem0: on usbus1 > umodem_get_caps: no CM desc (faking one) > umodem_get_caps: no ACM desc > umodem0: Missing descriptor. Assuming data interface is next. > umodem0: data interface 2, has CM over data, has no break > umodem0: no data interface > umodem_detach: sc=0xc907aa00 > device_attach: umodem0 attach returned 6 > umodem_probe: > umodem0: on usbus1 > umodem_get_caps: no CM desc (faking one) > umodem_get_caps: no ACM desc > umodem0: Missing descriptor. Assuming data interface is next. > umodem0: data interface 2, has CM over data, has no break > umodem0: no data interface > umodem_detach: sc=0xc9ddf800 > device_attach: umodem0 attach returned 6 > > usbconfig shows the following. > > ugen1.3: at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) > pwr=ON > > bLength = 0x0012 > bDescriptorType = 0x0001 > bcdUSB = 0x0200 > bDeviceClass = 0x0002 > bDeviceSubClass = 0x > bDeviceProtocol = 0x > bMaxPacketSize0 = 0x0040 > idVendor = 0x0e8d > idProduct = 0x3329 > bcdDevice = 0x0100 > iManufacturer = 0x0003 > iProduct = 0x0004 > iSerialNumber = 0x > bNumConfigurations = 0x0001 > > > Configuration index 0 > > bLength = 0x0009 > bDescriptorType = 0x0002 > wTotalLength = 0x0043 > bNumInterfaces = 0x0002 > bConfigurationValue = 0x0001 > iConfiguration = 0x > bmAttributes = 0x0080 > bMaxPower = 0x00fa > > Interface 0 > bLength = 0x0009 > bDescriptorType = 0x0004 > bInterfaceNumber = 0x > bAlternateSetting = 0x > bNumEndpoints = 0x0002 > bInterfaceClass = 0x000a > bInterfaceSubClass = 0x > bInterfaceProtocol = 0x > iInterface = 0x0001 > > Endpoint 0 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0081 > bmAttributes = 0x0002 > wMaxPacketSize = 0x0040 > bInterval = 0x > bRefresh = 0x > bSynchAddress = 0x > > Endpoint 1 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0001 > bmAttributes = 0x0002 > wMaxPacketSize = 0x0040 > bInterval = 0x > bRefresh = 0x > bSynchAddress = 0x > > > Interface 1 > bLength = 0x001c > bDescriptorType = 0x0004 > bInterfaceNumber = 0x0001 > bAlternateSetting = 0x > bNumEndpoints = 0x0001 > bInterfaceClass = 0x0002 > bInterfaceSubClass = 0x0002 > bInterfaceProtocol = 0x0001 > iInterface = 0x0002 > > Endpoint 0 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0082 > bmAttributes = 0x0003 > wMaxPacketSize = 0x0040 > bInterval = 0x0001 > bRefresh = 0x > bSynchAddress = 0x > > >How-To-Repeat: > Attach a GPS receiver based on the MTK 3329 chipset to an USB port. > > >Fix: > If driver cannot obtain descriptors about data interface it assumes data > interface is next that is wrong for this device. Data interface can be > find by bInterfaceClass and bInterfaceSubClass codes. > > My patch fixes driver behaviour. > After applying the umodem driver can attach to the device. > And GPS software works fine with the GPS receiver. > > ugen1.3: at usbus1 > umodem_probe: > umodem_probe: > umodem_probe: > umodem0: on usbus1 > umodem_get_caps: no CM desc (faking one) > umodem_get_caps: no ACM desc > umodem0: data interface 0, has CM over data, has no break > > > Patch attached with submission follows: > > --- orig/sys/dev/usb/serial/umodem.c 2010-04-30 01:44:04.0 +0300 > +++ sys/dev/usb/serial/umodem.c 2011-01-12 14:32:14.0 +0200 >
usb/153929: The umodem driver doesn't support the MTK 3329 GPS chipset.
>Number: 153929 >Category: usb >Synopsis: The umodem driver doesn't support the MTK 3329 GPS chipset. >Confidential: no >Severity: non-critical >Priority: low >Responsible:freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Jan 12 13:10:09 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Mykhaylo Yehorov >Release:FreeBSD 8-STABLE >Organization: >Environment: FreeBSD box.interexc.com 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #1 r197782M: Tue Jan 4 14:49:50 EET 2011 m...@box.interexc.com:/usr/obj/usr/src/sys/MINI i386 >Description: I'm trying to connect my GPS receiver based on the MTK 3329 GPS chipset to a FreeBSD box. The umodem driver matches to the device but fails to attach to it. My kernel is built with "options USB_DEBUG". Sysctl variable syshw.usb.umodem.debug is set to 11. After attaching the GPS receiver to an USB port the following lines appear in dmesg. ugen1.3: at usbus1 umodem_probe: umodem_probe: umodem_probe: umodem0: on usbus1 umodem_get_caps: no CM desc (faking one) umodem_get_caps: no ACM desc umodem0: Missing descriptor. Assuming data interface is next. umodem0: data interface 2, has CM over data, has no break umodem0: no data interface umodem_detach: sc=0xc907aa00 device_attach: umodem0 attach returned 6 umodem_probe: umodem0: on usbus1 umodem_get_caps: no CM desc (faking one) umodem_get_caps: no ACM desc umodem0: Missing descriptor. Assuming data interface is next. umodem0: data interface 2, has CM over data, has no break umodem0: no data interface umodem_detach: sc=0xc9ddf800 device_attach: umodem0 attach returned 6 usbconfig shows the following. ugen1.3: at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON bLength = 0x0012 bDescriptorType = 0x0001 bcdUSB = 0x0200 bDeviceClass = 0x0002 bDeviceSubClass = 0x bDeviceProtocol = 0x bMaxPacketSize0 = 0x0040 idVendor = 0x0e8d idProduct = 0x3329 bcdDevice = 0x0100 iManufacturer = 0x0003 iProduct = 0x0004 iSerialNumber = 0x bNumConfigurations = 0x0001 Configuration index 0 bLength = 0x0009 bDescriptorType = 0x0002 wTotalLength = 0x0043 bNumInterfaces = 0x0002 bConfigurationValue = 0x0001 iConfiguration = 0x bmAttributes = 0x0080 bMaxPower = 0x00fa Interface 0 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x bAlternateSetting = 0x bNumEndpoints = 0x0002 bInterfaceClass = 0x000a bInterfaceSubClass = 0x bInterfaceProtocol = 0x iInterface = 0x0001 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0081 bmAttributes = 0x0002 wMaxPacketSize = 0x0040 bInterval = 0x bRefresh = 0x bSynchAddress = 0x Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0001 bmAttributes = 0x0002 wMaxPacketSize = 0x0040 bInterval = 0x bRefresh = 0x bSynchAddress = 0x Interface 1 bLength = 0x001c bDescriptorType = 0x0004 bInterfaceNumber = 0x0001 bAlternateSetting = 0x bNumEndpoints = 0x0001 bInterfaceClass = 0x0002 bInterfaceSubClass = 0x0002 bInterfaceProtocol = 0x0001 iInterface = 0x0002 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0082 bmAttributes = 0x0003 wMaxPacketSize = 0x0040 bInterval = 0x0001 bRefresh = 0x bSynchAddress = 0x >How-To-Repeat: Attach a GPS receiver based on the MTK 3329 chipset to an USB port. >Fix: If driver cannot obtain descriptors about data interface it assumes data interface is next that is wrong for this device. Data interface can be find by bInterfaceClass and bInterfaceSubClass codes. My patch fixes driver behaviour. After applying the umodem driver can attach to the device. And GPS software works fine with the GPS receiver. ugen1.3: at usbus1 umodem_probe: umodem_probe: umodem_probe: umodem0: on usbus1 umodem_get_caps: no CM desc (faking one) umodem_get_caps: no ACM desc umodem0: data interface 0, has CM over data, has no break Patch attached with submission follows: --- orig/sys/dev/usb/serial/umodem.c2010-04-30 01:44:04.0 +0300 +++ sys/dev/usb/serial/umodem.c 2011-01-12 14:32:14.0 +0200 @@ -198,6 +198,7 @@ static usb_error_t umodem_set_comm_feature(struct usb_device *, uint8_t, uint16_t, uint16_t); static voidumodem_poll(struct ucom_softc *ucom); +static int umodem_find_data_interface(struct usb_attach_arg *, uint8_t *); static const struct usb_config umodem_config[UMODEM_N_T