Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2]: src/sys/dev/usb Pull up new file (revisions 1.1-1.2) (request...



details:   https://anonhg.NetBSD.org/src/rev/ebe3bca15ae5
branches:  netbsd-2
changeset: 563815:ebe3bca15ae5
user:      riz <riz%NetBSD.org@localhost>
date:      Thu Jul 21 19:26:43 2005 +0000

description:
Pull up new file (revisions 1.1-1.2) (requested by itohy in ticket #1430):
1.1:
Split common modem part of umodem.c to umodem_common.c and umodemvar.h,
to be shared with other umodem-like drivers.

1.2:
If CM descriptor is found, use the data interface in it;
if CM descriptor is NOT found but UNION descriotor is found,
use the data interface in it.
Do not require CM or ACM descriptors as long as
the data interface is found.
Should fix NetBSD PR #29754 by rivo nurges.

diffstat:

 sys/dev/usb/umodemvar.h |  84 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 84 insertions(+), 0 deletions(-)

diffs (88 lines):

diff -r e184cb4a0a84 -r ebe3bca15ae5 sys/dev/usb/umodemvar.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/usb/umodemvar.h   Thu Jul 21 19:26:43 2005 +0000
@@ -0,0 +1,84 @@
+/*     $NetBSD: umodemvar.h,v 1.2.8.2 2005/07/21 19:26:43 riz Exp $    */
+
+/*
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Lennart Augustsson (lennart%augustsson.net@localhost) at
+ * Carlstedt Research & Technology.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+struct umodem_softc {
+       USBBASEDEVICE           sc_dev;         /* base device */
+
+       usbd_device_handle      sc_udev;        /* USB device */
+
+       int                     sc_ctl_iface_no;
+       usbd_interface_handle   sc_ctl_iface;   /* control interface */
+       int                     sc_data_iface_no;
+       usbd_interface_handle   sc_data_iface;  /* data interface */
+
+       int                     sc_cm_cap;      /* CM capabilities */
+       int                     sc_acm_cap;     /* ACM capabilities */
+
+       int                     sc_cm_over_data;
+
+       usb_cdc_line_state_t    sc_line_state;  /* current line state */
+       u_char                  sc_dtr;         /* current DTR state */
+       u_char                  sc_rts;         /* current RTS state */
+
+       device_ptr_t            sc_subdev;      /* ucom device */
+
+       u_char                  sc_opening;     /* lock during open */
+       u_char                  sc_dying;       /* disconnecting */
+
+       int                     sc_ctl_notify;  /* Notification endpoint */
+       usbd_pipe_handle        sc_notify_pipe; /* Notification pipe */
+       usb_cdc_notification_t  sc_notify_buf;  /* Notification structure */
+       u_char                  sc_lsr;         /* Local status register */
+       u_char                  sc_msr;         /* Modem status register */
+};
+
+int umodem_common_attach(device_ptr_t, struct umodem_softc *,
+                        struct usb_attach_arg *, struct ucom_attach_args *);
+
+int    umodem_get_caps(usbd_device_handle, int *, int *,
+                       usb_interface_descriptor_t *);
+
+void   umodem_get_status(void *, int portno, u_char *lsr, u_char *msr);
+void   umodem_set(void *, int, int, int);
+int    umodem_param(void *, int, struct termios *);
+int    umodem_ioctl(void *, int, u_long, caddr_t, int, usb_proc_ptr);
+int    umodem_open(void *, int portno);
+void   umodem_close(void *, int portno);
+int    umodem_common_activate(struct umodem_softc *, enum devact);
+int    umodem_common_detach(struct umodem_softc *, int);



Home | Main Index | Thread Index | Old Index