00001 /********************************************************************* 00002 * 00003 * Filename: irport.h 00004 * Version: 0.1 00005 * Description: Serial driver for IrDA 00006 * Status: Experimental. 00007 * Author: Dag Brattli <dagb@cs.uit.no> 00008 * Created at: Sun Aug 3 13:49:59 1997 00009 * Modified at: Fri Jan 14 10:21:10 2000 00010 * Modified by: Dag Brattli <dagb@cs.uit.no> 00011 * 00012 * Copyright (c) 1997, 1998-2000 Dag Brattli <dagb@cs.uit.no> 00013 * All Rights Reserved. 00014 * 00015 * This program is free software; you can redistribute it and/or 00016 * modify it under the terms of the GNU General Public License as 00017 * published by the Free Software Foundation; either version 2 of 00018 * the License, or (at your option) any later version. 00019 * 00020 * Neither Dag Brattli nor University of Tromsų admit liability nor 00021 * provide warranty for any of this software. This material is 00022 * provided "AS-IS" and at no charge. 00023 * 00024 ********************************************************************/ 00025 00026 #ifndef IRPORT_H 00027 #define IRPORT_H 00028 00029 #include <linux/netdevice.h> 00030 #include <linux/skbuff.h> 00031 #include <linux/types.h> 00032 #include <asm/spinlock.h> 00033 00034 #include <net/irda/irda_device.h> 00035 00036 #define SPEED_DEFAULT 9600 00037 #define SPEED_MAX 115200 00038 00039 /* 00040 * These are the supported serial types. 00041 */ 00042 #define PORT_UNKNOWN 0 00043 #define PORT_8250 1 00044 #define PORT_16450 2 00045 #define PORT_16550 3 00046 #define PORT_16550A 4 00047 #define PORT_CIRRUS 5 00048 #define PORT_16650 6 00049 #define PORT_MAX 6 00050 00051 #define FRAME_MAX_SIZE 2048 00052 00053 struct irport_cb { 00054 struct device *netdev; /* Yes! we are some kind of netdevice */ 00055 struct net_device_stats stats; 00056 00057 struct irlap_cb *irlap; /* The link layer we are attached to */ 00058 00059 chipio_t io; /* IrDA controller information */ 00060 iobuff_t tx_buff; /* Transmit buffer */ 00061 iobuff_t rx_buff; /* Receive buffer */ 00062 00063 struct qos_info qos; /* QoS capabilities for this device */ 00064 dongle_t *dongle; /* Dongle driver */ 00065 00066 __u32 flags; /* Interface flags */ 00067 __u32 new_speed; 00068 int mode; 00069 int index; /* Instance index */ 00070 00071 spinlock_t lock; /* For serializing operations */ 00072 00073 /* For piggyback drivers */ 00074 void *priv; 00075 void (*change_speed)(void *priv, __u32 speed); 00076 void (*interrupt)(int irq, void *dev_id, struct pt_regs *regs); 00077 }; 00078 00079 struct irport_cb *irport_open(int i, unsigned int iobase, unsigned int irq); 00080 int irport_close(struct irport_cb *self); 00081 void irport_start(struct irport_cb *self); 00082 void irport_stop(struct irport_cb *self); 00083 void irport_change_speed(void *priv, __u32 speed); 00084 void irport_interrupt(int irq, void *dev_id, struct pt_regs *regs); 00085 int irport_hard_xmit(struct sk_buff *skb, struct device *dev); 00086 int irport_net_open(struct device *dev); 00087 int irport_net_close(struct device *dev); 00088 00089 #endif /* IRPORT_H */