/*****************************************************************************
 *
 * Filename:      irda-usb.h
 * Version:       0.1
 * Description:   IrDA-USB Driver
 * Status:        Experimental 
 * Author:        Dag Brattli <dag@brattli.net>
 *
 *	Copyright (C) 2000, Roman Weissgaerber <weissg@vienna.at>
 *      Copyright (C) 2000, Dag Brattli <dag@brattli.net>
 *          
 *	This program is free software; you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation; either version 2 of the License, or
 *	(at your option) any later version.
 *
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with this program; if not, write to the Free Software
 *	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *****************************************************************************/

#include <net/irda/irda.h>
#include <net/irda/irlap.h>
#include <net/irda/irda_device.h>

#define RX_COPY_THRESHOLD 200
#define IRDA_USB_MAX_MTU 2050 

/* Inbound header */
#define MEDIA_BUSY    0x80

#define SPEED_2400    0x01
#define SPEED_9600    0x02
#define SPEED_19200   0x03
#define SPEED_38400   0x04
#define SPEED_57600   0x05
#define SPEED_115200  0x06
#define SPEED_576000  0x07
#define SPEED_1152000 0x08
#define SPEED_4000000 0x09

struct irda_usb_dongle {
	__u32 idVendor;
	__u32 idProduct;
};
#define USB_IRDA_HEADER   0x01
#define USB_CLASS_IRDA    0x02 /* USB_CLASS_APP_SPEC subclass */ 
#define USB_DT_IRDA       0x21

struct irda_class_desc {
	__u8  bLength;
	__u8  bDescriptorType;
	__u16 bcdSpecRevision;
	__u8  bmDataSize;
	__u8  bmWindowSize;
	__u8  bmMinTurnaroundTime;
	__u16 wBaudRate;
	__u8  bmAdditionalBOFs;
	__u8  bIrdaRateSniff;
	__u8  bMaxUnicastList;
} __attribute__ ((packed));

struct irda_usb_cb {
	struct irda_class_desc *irda_desc;
        struct usb_device *usbdev;      /* init: probe_irda */
        unsigned int ifnum;             /* Interface number of the USB device */
        int isopen;                     /* nz if open */
        int present;                    /* Device is present on the bus */
        char bulk_in_ep, bulk_out_ep;   /* Endpoint assignments */
        wait_queue_head_t wait_q;       /* for timeouts */

	/*struct urb rx_urb;*/
	struct urb tx_urb;
	
	struct net_device *netdev;      /* Yes! we are some kind of netdevice */
	struct net_device_stats stats;
	struct irlap_cb   *irlap;       /* The link layer we are binded to */
	struct qos_info qos;		 
        iobuff_t tx_buff;               /* Transmit buffer */
        iobuff_t rx_buff;               /* Receive buffer */

        spinlock_t lock;                /* For serializing operations */

	__u16 xbofs;                    /* Current xbofs setting */
	__u32 speed;                    /* Current speed */
        __u32 new_speed;
        __u32 flags;                    /* Interface flags */
};

