patch-2.4.3 linux/drivers/usb/serial/belkin_sa.c

Next file: linux/drivers/usb/serial/belkin_sa.h
Previous file: linux/drivers/usb/serial/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/drivers/usb/serial/belkin_sa.c linux/drivers/usb/serial/belkin_sa.c
@@ -24,7 +24,11 @@
  * -- Add support for flush commands
  * -- Add everything that is missing :)
  *
- * (11/06/2000) gkh
+ * 12-Mar-2001 gkh
+ *	- Added support for the GoHubs GO-COM232 device which is the same as the
+ *	  Peracom device.
+ *
+ * 06-Nov-2000 gkh
  *	- Added support for the old Belkin and Peracom devices.
  *	- Made the port able to be opened multiple times.
  *	- Added some defaults incase the line settings are things these devices
@@ -90,6 +94,7 @@
 	{ USB_DEVICE(BELKIN_SA_VID, BELKIN_SA_PID) },
 	{ USB_DEVICE(BELKIN_OLD_VID, BELKIN_OLD_PID) },
 	{ USB_DEVICE(PERACOM_VID, PERACOM_PID) },
+	{ USB_DEVICE(GOHUBS_VID, GOHUBS_PID) },
 	{ }							/* Terminating entry */
 };
 
@@ -108,6 +113,11 @@
 	{ }							/* Terminating entry */
 };
 
+static __devinitdata struct usb_device_id gocom232_table [] = {
+	{ USB_DEVICE(GOHUBS_VID, GOHUBS_PID) },
+	{ }							/* Terminating entry */
+};
+
 MODULE_DEVICE_TABLE (usb, id_table_combined);
 
 /* All of the device info needed for the Belkin serial converter */
@@ -174,6 +184,27 @@
 	shutdown:		belkin_sa_shutdown,
 };
 
+/* the GoHubs Go-COM232 device is the same as the Peracom single port adapter */
+struct usb_serial_device_type gocom232_device = {
+	name:			"GO-COM232 USB Serial Converter",
+	id_table:		gocom232_table,			/* the GO-COM232 device */
+	needs_interrupt_in:	MUST_HAVE,			/* this device must have an interrupt in endpoint */
+	needs_bulk_in:		MUST_HAVE,			/* this device must have a bulk in endpoint */
+	needs_bulk_out:		MUST_HAVE,			/* this device must have a bulk out endpoint */
+	num_interrupt_in:	1,
+	num_bulk_in:		1,
+	num_bulk_out:		1,
+	num_ports:		1,
+	open:			belkin_sa_open,
+	close:			belkin_sa_close,
+	read_int_callback:	belkin_sa_read_int_callback,	/* How we get the status info */
+	ioctl:			belkin_sa_ioctl,
+	set_termios:		belkin_sa_set_termios,
+	break_ctl:		belkin_sa_break_ctl,
+	startup:		belkin_sa_startup,
+	shutdown:		belkin_sa_shutdown,
+};
+
 
 struct belkin_sa_private {
 	unsigned long		control_state;
@@ -233,8 +264,8 @@
 			belkin_sa_close (&serial->port[i], NULL);
 		}
 		/* My special items, the standard routines free my urbs */
-		if (serial->port->private)
-			kfree(serial->port->private);
+		if (serial->port[i].private)
+			kfree(serial->port[i].private);
 	}
 }
 
@@ -558,6 +589,7 @@
 	usb_serial_register (&belkin_sa_device);
 	usb_serial_register (&belkin_old_device);
 	usb_serial_register (&peracom_device);
+	usb_serial_register (&gocom232_device);
 	return 0;
 }
 
@@ -567,6 +599,7 @@
 	usb_serial_deregister (&belkin_sa_device);
 	usb_serial_deregister (&belkin_old_device);
 	usb_serial_deregister (&peracom_device);
+	usb_serial_deregister (&gocom232_device);
 }
 
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)