blob: 92c8fb57521387ea3186a6e3fd4b5e65a857036a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*********************************************************************
2 *
3 * Filename: irda.h
4 * Version: 1.0
5 * Description: IrDA common include file for kernel internal use
6 * Status: Stable
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Tue Dec 9 21:13:12 1997
9 * Modified at: Fri Jan 28 13:16:32 2000
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
11 *
12 * Copyright (c) 1998-2000 Dag Brattli, All Rights Reserved.
13 * Copyright (c) 2000-2002 Jean Tourrilhes <jt@hpl.hp.com>
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
19 *
John Anthony Kazos Jr121e70b2007-05-09 08:30:57 +020020 * Neither Dag Brattli nor University of Tromsø admit liability nor
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 * provide warranty for any of this software. This material is
22 * provided "AS-IS" and at no charge.
23 *
24 ********************************************************************/
25
26#ifndef NET_IRDA_H
27#define NET_IRDA_H
28
Linus Torvalds1da177e2005-04-16 15:20:36 -070029#include <linux/skbuff.h> /* struct sk_buff */
30#include <linux/kernel.h>
31#include <linux/if.h> /* sa_family_t in <linux/irda.h> */
32#include <linux/irda.h>
33
34typedef __u32 magic_t;
35
36#ifndef TRUE
37#define TRUE 1
38#endif
39
40#ifndef FALSE
41#define FALSE 0
42#endif
43
44/* Hack to do small backoff when setting media busy in IrLAP */
45#ifndef SMALL
46#define SMALL 5
47#endif
48
49#ifndef IRDA_MIN /* Lets not mix this MIN with other header files */
50#define IRDA_MIN(a, b) (((a) < (b)) ? (a) : (b))
51#endif
52
53#ifndef IRDA_ALIGN
54# define IRDA_ALIGN __attribute__((aligned))
55#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070056
57#ifdef CONFIG_IRDA_DEBUG
Linus Torvalds1da177e2005-04-16 15:20:36 -070058#define IRDA_ASSERT(expr, func) \
59do { if(!(expr)) { \
60 printk( "Assertion failed! %s:%s:%d %s\n", \
Harvey Harrisond5c003b2008-10-15 22:01:24 -070061 __FILE__,__func__,__LINE__,(#expr) ); \
Linus Torvalds1da177e2005-04-16 15:20:36 -070062 func } } while (0)
63#define IRDA_ASSERT_LABEL(label) label
64#else
Linus Torvalds1da177e2005-04-16 15:20:36 -070065#define IRDA_ASSERT(expr, func) do { (void)(expr); } while (0)
66#define IRDA_ASSERT_LABEL(label)
67#endif /* CONFIG_IRDA_DEBUG */
68
Linus Torvalds1da177e2005-04-16 15:20:36 -070069/*
70 * Magic numbers used by Linux-IrDA. Random numbers which must be unique to
71 * give the best protection
72 */
73
74#define IRTTY_MAGIC 0x2357
75#define LAP_MAGIC 0x1357
76#define LMP_MAGIC 0x4321
77#define LMP_LSAP_MAGIC 0x69333
78#define LMP_LAP_MAGIC 0x3432
79#define IRDA_DEVICE_MAGIC 0x63454
80#define IAS_MAGIC 0x007
81#define TTP_MAGIC 0x241169
82#define TTP_TSAP_MAGIC 0x4345
83#define IROBEX_MAGIC 0x341324
84#define HB_MAGIC 0x64534
85#define IRLAN_MAGIC 0x754
86#define IAS_OBJECT_MAGIC 0x34234
87#define IAS_ATTRIB_MAGIC 0x45232
88#define IRDA_TASK_MAGIC 0x38423
89
90#define IAS_DEVICE_ID 0x0000 /* Defined by IrDA, IrLMP section 4.1 (page 68) */
91#define IAS_PNP_ID 0xd342
92#define IAS_OBEX_ID 0x34323
93#define IAS_IRLAN_ID 0x34234
94#define IAS_IRCOMM_ID 0x2343
95#define IAS_IRLPT_ID 0x9876
96
Adrian Bunka39a2192007-02-20 01:06:40 -080097struct net_device;
98struct packet_type;
99
Joe Perches0e418f92013-09-23 11:37:44 -0700100void irda_proc_register(void);
101void irda_proc_unregister(void);
Adrian Bunka39a2192007-02-20 01:06:40 -0800102
Joe Perches0e418f92013-09-23 11:37:44 -0700103int irda_sysctl_register(void);
104void irda_sysctl_unregister(void);
Adrian Bunka39a2192007-02-20 01:06:40 -0800105
Joe Perches0e418f92013-09-23 11:37:44 -0700106int irsock_init(void);
107void irsock_cleanup(void);
Adrian Bunka39a2192007-02-20 01:06:40 -0800108
Joe Perches0e418f92013-09-23 11:37:44 -0700109int irda_nl_register(void);
110void irda_nl_unregister(void);
Samuel Ortiz89da1ec2007-07-02 22:54:18 -0700111
Joe Perches0e418f92013-09-23 11:37:44 -0700112int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
113 struct packet_type *ptype, struct net_device *orig_dev);
Adrian Bunka39a2192007-02-20 01:06:40 -0800114
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115#endif /* NET_IRDA_H */