00001 /********************************************************************* 00002 * 00003 * Filename: wrapper.h 00004 * Version: 1.2 00005 * Description: IrDA SIR async wrapper layer 00006 * Status: Experimental. 00007 * Author: Dag Brattli <dagb@cs.uit.no> 00008 * Created at: Mon Aug 4 20:40:53 1997 00009 * Modified at: Tue Jan 11 12:37:29 2000 00010 * Modified by: Dag Brattli <dagb@cs.uit.no> 00011 * 00012 * Copyright (c) 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 WRAPPER_H 00027 #define WRAPPER_H 00028 00029 #include <linux/types.h> 00030 #include <linux/skbuff.h> 00031 #include <linux/netdevice.h> 00032 00033 #include <net/irda/irda_device.h> 00034 00035 #define BOF 0xc0 /* Beginning of frame */ 00036 #define XBOF 0xff 00037 #define EOF 0xc1 /* End of frame */ 00038 #define CE 0x7d /* Control escape */ 00039 00040 #define STA BOF /* Start flag */ 00041 #define STO EOF /* End flag */ 00042 00043 #define IRDA_TRANS 0x20 /* Asynchronous transparency modifier */ 00044 00045 /* States for receving a frame in async mode */ 00046 enum { 00047 OUTSIDE_FRAME, 00048 BEGIN_FRAME, 00049 LINK_ESCAPE, 00050 INSIDE_FRAME 00051 }; 00052 00053 /* Proto definitions */ 00054 int async_wrap_skb(struct sk_buff *skb, __u8 *tx_buff, int buffsize); 00055 void async_bump(struct device *dev, struct net_device_stats *stats, 00056 __u8 *buf, int len); 00057 void async_unwrap_char(struct device *dev, struct net_device_stats *stats, 00058 iobuff_t *buf, __u8 byte); 00059 00060 #endif