irda.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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/skbuff.h> /* struct sk_buff */
  28. #include <linux/kernel.h>
  29. #include <linux/if.h> /* sa_family_t in <linux/irda.h> */
  30. #include <linux/irda.h>
  31. typedef __u32 magic_t;
  32. #ifndef TRUE
  33. #define TRUE 1
  34. #endif
  35. #ifndef FALSE
  36. #define FALSE 0
  37. #endif
  38. /* Hack to do small backoff when setting media busy in IrLAP */
  39. #ifndef SMALL
  40. #define SMALL 5
  41. #endif
  42. #ifndef IRDA_MIN /* Lets not mix this MIN with other header files */
  43. #define IRDA_MIN(a, b) (((a) < (b)) ? (a) : (b))
  44. #endif
  45. #ifndef IRDA_ALIGN
  46. # define IRDA_ALIGN __attribute__((aligned))
  47. #endif
  48. #ifdef CONFIG_IRDA_DEBUG
  49. #define IRDA_ASSERT(expr, func) \
  50. do { if(!(expr)) { \
  51. printk( "Assertion failed! %s:%s:%d %s\n", \
  52. __FILE__,__func__,__LINE__,(#expr) ); \
  53. func } } while (0)
  54. #define IRDA_ASSERT_LABEL(label) label
  55. #else
  56. #define IRDA_ASSERT(expr, func) do { (void)(expr); } while (0)
  57. #define IRDA_ASSERT_LABEL(label)
  58. #endif /* CONFIG_IRDA_DEBUG */
  59. /*
  60. * Magic numbers used by Linux-IrDA. Random numbers which must be unique to
  61. * give the best protection
  62. */
  63. #define IRTTY_MAGIC 0x2357
  64. #define LAP_MAGIC 0x1357
  65. #define LMP_MAGIC 0x4321
  66. #define LMP_LSAP_MAGIC 0x69333
  67. #define LMP_LAP_MAGIC 0x3432
  68. #define IRDA_DEVICE_MAGIC 0x63454
  69. #define IAS_MAGIC 0x007
  70. #define TTP_MAGIC 0x241169
  71. #define TTP_TSAP_MAGIC 0x4345
  72. #define IROBEX_MAGIC 0x341324
  73. #define HB_MAGIC 0x64534
  74. #define IRLAN_MAGIC 0x754
  75. #define IAS_OBJECT_MAGIC 0x34234
  76. #define IAS_ATTRIB_MAGIC 0x45232
  77. #define IRDA_TASK_MAGIC 0x38423
  78. #define IAS_DEVICE_ID 0x0000 /* Defined by IrDA, IrLMP section 4.1 (page 68) */
  79. #define IAS_PNP_ID 0xd342
  80. #define IAS_OBEX_ID 0x34323
  81. #define IAS_IRLAN_ID 0x34234
  82. #define IAS_IRCOMM_ID 0x2343
  83. #define IAS_IRLPT_ID 0x9876
  84. struct net_device;
  85. struct packet_type;
  86. void irda_proc_register(void);
  87. void irda_proc_unregister(void);
  88. int irda_sysctl_register(void);
  89. void irda_sysctl_unregister(void);
  90. int irsock_init(void);
  91. void irsock_cleanup(void);
  92. int irda_nl_register(void);
  93. void irda_nl_unregister(void);
  94. int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
  95. struct packet_type *ptype, struct net_device *orig_dev);
  96. #endif /* NET_IRDA_H */