patch-2.4.0-test8 linux/drivers/usb/serial/usb-serial.h
Next file: linux/drivers/usb/serial/usbserial.c
Previous file: linux/drivers/usb/serial/omninet.c
Back to the patch index
Back to the overall index
- Lines: 41
- Date:
Tue Sep 5 13:19:08 2000
- Orig file:
v2.4.0-test7/linux/drivers/usb/serial/usb-serial.h
- Orig date:
Wed Aug 23 18:36:38 2000
diff -u --recursive --new-file v2.4.0-test7/linux/drivers/usb/serial/usb-serial.h linux/drivers/usb/serial/usb-serial.h
@@ -11,6 +11,9 @@
*
* See Documentation/usb/usb-serial.txt for more information on using this driver
*
+ * (08/28/2000) gkh
+ * Added port_lock to port structure.
+ *
* (08/08/2000) gkh
* Added open_count to port structure.
*
@@ -63,6 +66,7 @@
struct tq_struct tqueue; /* task queue for line discipline waking up */
int open_count; /* number of times this port has been opened */
+ spinlock_t port_lock;
void * private; /* data private to the specific port */
};
@@ -184,6 +188,22 @@
return 0;
}
+
+
+static inline struct usb_serial* get_usb_serial (struct usb_serial_port *port, const char *function)
+{
+ /* if no port was specified, or it fails a paranoia check */
+ if (!port ||
+ port_paranoia_check (port, function) ||
+ serial_paranoia_check (port->serial, function)) {
+ /* then say that we dont have a valid usb_serial thing, which will
+ * end up genrating -ENODEV return values */
+ return NULL;
+ }
+
+ return port->serial;
+}
+
#endif /* ifdef __LINUX_USB_SERIAL_H */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)