Home | History | Annotate | Line # | Download | only in usb
if_cdcereg.h revision 1.9
      1  1.9     skrll /*	$NetBSD: if_cdcereg.h,v 1.9 2016/04/23 10:15:31 skrll Exp $ */
      2  1.1  augustss 
      3  1.1  augustss /*
      4  1.1  augustss  * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul (at) windriver.com>
      5  1.1  augustss  * Copyright (c) 2003 Craig Boston
      6  1.1  augustss  * Copyright (c) 2004 Daniel Hartmeier
      7  1.1  augustss  * All rights reserved.
      8  1.1  augustss  *
      9  1.1  augustss  * Redistribution and use in source and binary forms, with or without
     10  1.1  augustss  * modification, are permitted provided that the following conditions
     11  1.1  augustss  * are met:
     12  1.1  augustss  * 1. Redistributions of source code must retain the above copyright
     13  1.1  augustss  *    notice, this list of conditions and the following disclaimer.
     14  1.1  augustss  * 2. Redistributions in binary form must reproduce the above copyright
     15  1.1  augustss  *    notice, this list of conditions and the following disclaimer in the
     16  1.1  augustss  *    documentation and/or other materials provided with the distribution.
     17  1.1  augustss  * 3. All advertising materials mentioning features or use of this software
     18  1.1  augustss  *    must display the following acknowledgement:
     19  1.1  augustss  *	This product includes software developed by Bill Paul.
     20  1.1  augustss  * 4. Neither the name of the author nor the names of any co-contributors
     21  1.1  augustss  *    may be used to endorse or promote products derived from this software
     22  1.1  augustss  *    without specific prior written permission.
     23  1.1  augustss  *
     24  1.1  augustss  * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
     25  1.1  augustss  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     26  1.1  augustss  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     27  1.1  augustss  * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul, THE VOICES IN HIS HEAD OR
     28  1.1  augustss  * THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     29  1.1  augustss  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     30  1.1  augustss  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     31  1.1  augustss  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     32  1.1  augustss  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     33  1.1  augustss  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     34  1.1  augustss  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     35  1.1  augustss  */
     36  1.1  augustss 
     37  1.8  riastrad #include <sys/rndsource.h>
     38  1.8  riastrad 
     39  1.1  augustss #define CDCE_RX_LIST_CNT	1
     40  1.1  augustss #define CDCE_TX_LIST_CNT	1
     41  1.1  augustss #define CDCE_BUFSZ		1542
     42  1.1  augustss 
     43  1.1  augustss struct cdce_type {
     44  1.1  augustss 	struct usb_devno	 cdce_dev;
     45  1.9     skrll 	uint16_t		 cdce_flags;
     46  1.1  augustss #define CDCE_ZAURUS	1
     47  1.1  augustss #define CDCE_NO_UNION	2
     48  1.1  augustss };
     49  1.1  augustss 
     50  1.1  augustss struct cdce_softc;
     51  1.1  augustss 
     52  1.1  augustss struct cdce_chain {
     53  1.1  augustss 	struct cdce_softc	*cdce_sc;
     54  1.9     skrll 	struct usbd_xfer	*cdce_xfer;
     55  1.1  augustss 	char			*cdce_buf;
     56  1.1  augustss 	struct mbuf		*cdce_mbuf;
     57  1.1  augustss 	int			 cdce_accum;
     58  1.1  augustss 	int			 cdce_idx;
     59  1.1  augustss };
     60  1.1  augustss 
     61  1.1  augustss struct cdce_cdata {
     62  1.1  augustss 	struct cdce_chain	 cdce_rx_chain[CDCE_RX_LIST_CNT];
     63  1.1  augustss 	struct cdce_chain	 cdce_tx_chain[CDCE_TX_LIST_CNT];
     64  1.1  augustss 	int			 cdce_tx_prod;
     65  1.1  augustss 	int			 cdce_tx_cons;
     66  1.1  augustss 	int			 cdce_tx_cnt;
     67  1.1  augustss 	int			 cdce_rx_prod;
     68  1.1  augustss };
     69  1.1  augustss 
     70  1.1  augustss struct cdce_softc {
     71  1.5    dyoung 	device_t cdce_dev;
     72  1.1  augustss 	struct ethercom		 cdce_ec;
     73  1.6       tls 	krndsource_t	 rnd_source;
     74  1.1  augustss #define GET_IFP(sc) (&(sc)->cdce_ec.ec_if)
     75  1.9     skrll 	struct usbd_device *	 cdce_udev;
     76  1.9     skrll 	struct usbd_interface *	 cdce_ctl_iface;
     77  1.9     skrll 	struct usbd_interface *	 cdce_data_iface;
     78  1.1  augustss 	int			 cdce_bulkin_no;
     79  1.9     skrll 	struct usbd_pipe *	 cdce_bulkin_pipe;
     80  1.1  augustss 	int			 cdce_bulkout_no;
     81  1.9     skrll 	struct usbd_pipe *	 cdce_bulkout_pipe;
     82  1.1  augustss 	char			 cdce_dying;
     83  1.1  augustss 	int			 cdce_unit;
     84  1.1  augustss 	struct cdce_cdata	 cdce_cdata;
     85  1.1  augustss 	int			 cdce_rxeof_errors;
     86  1.9     skrll 	uint16_t		 cdce_flags;
     87  1.1  augustss 	char			 cdce_attached;
     88  1.1  augustss };
     89