irda.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*********************************************************************
  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. *
  20. * Neither Dag Brattli nor University of Tromsø admit liability nor
  21. * provide warranty for any of this software. This material is
  22. * provided "AS-IS" and at no charge.
  23. *
  24. ********************************************************************/
  25. #ifndef NET_IRDA_H
  26. #define NET_IRDA_H
  27. #include <linux/config.h>
  28. #include <linux/skbuff.h> /* struct sk_buff */
  29. #include <linux/kernel.h>
  30. #include <linux/if.h> /* sa_family_t in <linux/irda.h> */
  31. #include <linux/irda.h>
  32. typedef __u32 magic_t;
  33. #ifndef TRUE
  34. #define TRUE 1
  35. #endif
  36. #ifndef FALSE
  37. #define FALSE 0
  38. #endif
  39. /* Hack to do small backoff when setting media busy in IrLAP */
  40. #ifndef SMALL
  41. #define SMALL 5
  42. #endif
  43. #ifndef IRDA_MIN /* Lets not mix this MIN with other header files */
  44. #define IRDA_MIN(a, b) (((a) < (b)) ? (a) : (b))
  45. #endif
  46. #ifndef IRDA_ALIGN
  47. # define IRDA_ALIGN __attribute__((aligned))
  48. #endif
  49. #ifndef IRDA_PACK
  50. # define IRDA_PACK __attribute__((packed))
  51. #endif
  52. #ifdef CONFIG_IRDA_DEBUG
  53. extern unsigned int irda_debug;
  54. /* use 0 for production, 1 for verification, >2 for debug */
  55. #define IRDA_DEBUG_LEVEL 0
  56. #define IRDA_DEBUG(n, args...) \
  57. do { if (irda_debug >= (n)) \
  58. printk(KERN_DEBUG args); \
  59. } while (0)
  60. #define IRDA_ASSERT(expr, func) \
  61. do { if(!(expr)) { \
  62. printk( "Assertion failed! %s:%s:%d %s\n", \
  63. __FILE__,__FUNCTION__,__LINE__,(#expr) ); \
  64. func } } while (0)
  65. #define IRDA_ASSERT_LABEL(label) label
  66. #else
  67. #define IRDA_DEBUG(n, args...) do { } while (0)
  68. #define IRDA_ASSERT(expr, func) do { (void)(expr); } while (0)
  69. #define IRDA_ASSERT_LABEL(label)
  70. #endif /* CONFIG_IRDA_DEBUG */
  71. #define IRDA_WARNING(args...) printk(KERN_WARNING args)
  72. #define IRDA_MESSAGE(args...) printk(KERN_INFO args)
  73. #define IRDA_ERROR(args...) printk(KERN_ERR args)
  74. /*
  75. * Magic numbers used by Linux-IrDA. Random numbers which must be unique to
  76. * give the best protection
  77. */
  78. #define IRTTY_MAGIC 0x2357
  79. #define LAP_MAGIC 0x1357
  80. #define LMP_MAGIC 0x4321
  81. #define LMP_LSAP_MAGIC 0x69333
  82. #define LMP_LAP_MAGIC 0x3432
  83. #define IRDA_DEVICE_MAGIC 0x63454
  84. #define IAS_MAGIC 0x007
  85. #define TTP_MAGIC 0x241169
  86. #define TTP_TSAP_MAGIC 0x4345
  87. #define IROBEX_MAGIC 0x341324
  88. #define HB_MAGIC 0x64534
  89. #define IRLAN_MAGIC 0x754
  90. #define IAS_OBJECT_MAGIC 0x34234
  91. #define IAS_ATTRIB_MAGIC 0x45232
  92. #define IRDA_TASK_MAGIC 0x38423
  93. #define IAS_DEVICE_ID 0x0000 /* Defined by IrDA, IrLMP section 4.1 (page 68) */
  94. #define IAS_PNP_ID 0xd342
  95. #define IAS_OBEX_ID 0x34323
  96. #define IAS_IRLAN_ID 0x34234
  97. #define IAS_IRCOMM_ID 0x2343
  98. #define IAS_IRLPT_ID 0x9876
  99. #endif /* NET_IRDA_H */