2008-04-29 00:22:51 +04:00
|
|
|
/* $NetBSD: umodemvar.h,v 1.7 2008/04/28 20:24:00 martin Exp $ */
|
2005-04-15 18:14:09 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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) 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.
|
|
|
|
*
|
|
|
|
* 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 */
|
|
|
|
};
|
|
|
|
|
2008-02-18 08:24:24 +03:00
|
|
|
void umodem_common_childdet(struct umodem_softc *, device_t);
|
2005-04-15 18:14:09 +04:00
|
|
|
int umodem_common_attach(device_ptr_t, struct umodem_softc *,
|
Introduce different autoconf interface attributes for USB drivers
matching (and handling) a whole device and those which match an
interface only. This will allow to enforce some rules, eg that
the former don't use interface information for matching or that the
latter don't modify global device state.
The previous way left too much freedom do the drivers which led to
inconsistencies and abuse.
For now, I've not changed locators and submatch rules, this will
happen later.
There should not be any change in behaviour, except in the case of
some drivers which did behave inconsistently:
if_atu, if_axe, uep: matched the configured device in the interface
stage, but did configuration again. I've converted them to match
in the device stage.
ustir, utoppy: matched in the interface stage, but only against
vendor/device information, and used any configuration/interface
without checking. Changed to match in device stage, and added
some simple code to configure and use the first interface.
If you have one of those devices, please test!
2007-03-13 16:51:53 +03:00
|
|
|
struct usbif_attach_arg *, struct ucom_attach_args *);
|
2005-04-15 18:14:09 +04:00
|
|
|
|
2005-04-15 18:43:05 +04:00
|
|
|
int umodem_get_caps(usbd_device_handle, int *, int *,
|
2005-04-15 18:14:09 +04:00
|
|
|
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 *);
|
2007-03-04 08:59:00 +03:00
|
|
|
int umodem_ioctl(void *, int, u_long, void *, int, usb_proc_ptr);
|
2005-04-15 18:14:09 +04:00
|
|
|
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);
|