OK, so I figured it out eventually :-)
First a couple of red herrings - it turns out that the order of the
endpoints actually doesn't matter.
What I thought was a firmware download turns out to be the packet dump
of the initial descriptor fetch and config selection for the device. I
just didn't know about USB to understand that.
We also don't need to make the correction for bulk out endpoint maximum
packet size, since the (my? :-) Belkin reports this correctly - perhaps
a firmware fix?
What we did have to do was apply Stelian's baud rate calculation code to
the Belkin device. Then - success!
To be sure that it worked, I tested against some samples of the devices
I typically need to use a serial cable with - Cisco 6506 and 3524, 3com
Switch 610, Sun Ultra 1 (all with "cu -s 9600 -l /dev/usb/ttyUSB0"),
Nokia 7110 (gsmlib, mygnokii 0.3.3_pre8-gold_2001_11_22_silver).
I've appended a patch which works for me under my hacked over version
of the 2.4.14 kernel. All changes localised to mct_u232.[ch]. It
should apply cleanly to 2.4.15 and 2.4.16.
The "struct usb_serial_device_type" in mct_u232.c wants to be declared
static for the 2.5 kernels, but that seems to be the only necessary
change for them. This will also be needed for 2.4.17.
It'd be nice to get this into 2.4.17, if it's not too late...
I don't really use 2.2 any more except on servers, but it looks like
only minor frobbing would be required to get this working. I might
have a go at this and post my attempt in a few days.
Cheers,
Martin
--- linux-2.4.14/drivers/usb/serial/mct_u232.c Thu Oct 11 07:42:47 2001
+++ linux-2.4.14+ipsec+ext3+vers+belkinbits/drivers/usb/serial/mct_u232.c Thu
+Dec 6 22:03:05 2001
@@ -24,6 +24,9 @@
* Basic tests have been performed with minicom/zmodem transfers and
* modem dialing under Linux 2.4.0-test10 (for me it works fine).
*
+ * 06-Dec-2001 Martin Hamilton <[EMAIL PROTECTED]>
+ * Added support for the Belkin F5U109 DB9 adaptor
+ *
* 30-May-2001 Greg Kroah-Hartman
* switched from using spinlock to a semaphore, which fixes lots of problems.
*
@@ -130,6 +133,7 @@
{ USB_DEVICE(MCT_U232_VID, MCT_U232_PID) },
{ USB_DEVICE(MCT_U232_VID, MCT_U232_SITECOM_PID) },
{ USB_DEVICE(MCT_U232_VID, MCT_U232_DU_H3SP_PID) },
+ { USB_DEVICE(MCT_U232_BELKIN_F5U109_VID, MCT_U232_BELKIN_F5U109_PID) },
{ } /* Terminating entry */
};
@@ -148,6 +152,11 @@
{ } /* Terminating entry */
};
+static __devinitdata struct usb_device_id mct_u232_belkin_f5u109_table [] = {
+ { USB_DEVICE(MCT_U232_BELKIN_F5U109_VID, MCT_U232_BELKIN_F5U109_PID) },
+ { } /* Terminating entry */
+};
+
MODULE_DEVICE_TABLE (usb, id_table_combined);
@@ -223,6 +232,30 @@
shutdown: mct_u232_shutdown,
};
+struct usb_serial_device_type mct_u232_belkin_f5u109_device = {
+ name: "Belkin F5U109 USB serial adaptor",
+ id_table: mct_u232_belkin_f5u109_table,
+ needs_interrupt_in: MUST_HAVE, /* 2 interrupt-in endpoints */
+ needs_bulk_in: MUST_HAVE_NOT, /* no bulk-in endpoint */
+ needs_bulk_out: MUST_HAVE, /* 1 bulk-out endpoint */
+ num_interrupt_in: 2,
+ num_bulk_in: 0,
+ num_bulk_out: 1,
+ num_ports: 1,
+ open: mct_u232_open,
+ close: mct_u232_close,
+#ifdef FIX_WRITE_RETURN_CODE_PROBLEM
+ write: mct_u232_write,
+ write_bulk_callback: mct_u232_write_bulk_callback,
+#endif
+ read_int_callback: mct_u232_read_int_callback,
+ ioctl: mct_u232_ioctl,
+ set_termios: mct_u232_set_termios,
+ break_ctl: mct_u232_break_ctl,
+ startup: mct_u232_startup,
+ shutdown: mct_u232_shutdown,
+};
+
@@ -240,7 +273,8 @@
#define WDR_TIMEOUT (HZ * 5 ) /* default urb timeout */
static int mct_u232_calculate_baud_rate(struct usb_serial *serial, int value) {
- if (serial->dev->descriptor.idProduct == MCT_U232_SITECOM_PID) {
+ if (serial->dev->descriptor.idProduct == MCT_U232_SITECOM_PID
+ || serial->dev->descriptor.idProduct == MCT_U232_BELKIN_F5U109_PID) {
switch (value) {
case 300: return 0x01;
case 600: return 0x02; /* this one not tested */
@@ -879,6 +913,7 @@
usb_serial_register (&mct_u232_device);
usb_serial_register (&mct_u232_sitecom_device);
usb_serial_register (&mct_u232_du_h3sp_device);
+ usb_serial_register (&mct_u232_belkin_f5u109_device);
info(DRIVER_VERSION ":" DRIVER_DESC);
return 0;
}
@@ -889,6 +924,7 @@
usb_serial_deregister (&mct_u232_device);
usb_serial_deregister (&mct_u232_sitecom_device);
usb_serial_deregister (&mct_u232_du_h3sp_device);
+ usb_serial_register (&mct_u232_belkin_f5u109_device);
}
--- linux-2.4.14/drivers/usb/serial/mct_u232.h Fri Feb 9 00:30:40 2001
+++ linux-2.4.14+ipsec+ext3+vers+belkinbits/drivers/usb/serial/mct_u232.h Thu
+Dec 6 22:09:35 2001
@@ -30,9 +30,12 @@
#define MCT_U232_SITECOM_PID 0x0230 /* Sitecom Product Id */
/* DU-H3SP USB BAY hub */
-
#define MCT_U232_DU_H3SP_PID 0x0200 /* D-Link DU-H3SP USB BAY */
+/* Belkin badge the MCT U232-P9 as the F5U109 */
+#define MCT_U232_BELKIN_F5U109_VID 0x050d /* Vendor Id */
+#define MCT_U232_BELKIN_F5U109_PID 0x0109 /* Product Id */
+
/*
* Vendor Request Interface
*/
@@ -363,6 +366,25 @@
* bmAttributes = 03 (Interrupt)
* wMaxPacketSize = 0002
* bInterval = 02
+ *
+ *
+ * Hardware details (added by Martin Hamilton, 2001/12/06)
+ * -----------------------------------------------------------------
+ *
+ * This info was gleaned from opening a Belkin F5U109 DB9 USB serial
+ * adaptor, which turns out to simply be a re-badged U232-P9. We
+ * know this because there is a sticky label on the circuit board
+ * which says "U232-P9" ;-)
+ *
+ * The circuit board inside the adaptor contains a Philips PDIUSBD12
+ * USB endpoint chip and a Phillips P87C52UBAA microcontroller with
+ * embedded UART. Exhaustive documentation for these is available at:
+ *
+ * http://www.semiconductors.philips.com/pip/p87c52ubaa
+ * http://www.semiconductors.philips.com/pip/pdiusbd12
+ *
+ * Thanks to Julian Highfield for the pointer to the Philips database.
+ *
*/
#endif /* __LINUX_USB_SERIAL_MCT_U232_H */
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users