af_irda.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*********************************************************************
  2. *
  3. * Filename: af_irda.h
  4. * Version: 1.0
  5. * Description: IrDA sockets declarations
  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 AF_IRDA_H
  26. #define AF_IRDA_H
  27. #include <linux/irda.h>
  28. #include <net/irda/irda.h>
  29. #include <net/irda/iriap.h> /* struct iriap_cb */
  30. #include <net/irda/irias_object.h> /* struct ias_value */
  31. #include <net/irda/irlmp.h> /* struct lsap_cb */
  32. #include <net/irda/irttp.h> /* struct tsap_cb */
  33. #include <net/irda/discovery.h> /* struct discovery_t */
  34. #include <net/sock.h>
  35. /* IrDA Socket */
  36. struct irda_sock {
  37. /* struct sock has to be the first member of irda_sock */
  38. struct sock sk;
  39. __u32 saddr; /* my local address */
  40. __u32 daddr; /* peer address */
  41. struct lsap_cb *lsap; /* LSAP used by Ultra */
  42. __u8 pid; /* Protocol IP (PID) used by Ultra */
  43. struct tsap_cb *tsap; /* TSAP used by this connection */
  44. __u8 dtsap_sel; /* remote TSAP address */
  45. __u8 stsap_sel; /* local TSAP address */
  46. __u32 max_sdu_size_rx;
  47. __u32 max_sdu_size_tx;
  48. __u32 max_data_size;
  49. __u8 max_header_size;
  50. struct qos_info qos_tx;
  51. __u16_host_order mask; /* Hint bits mask */
  52. __u16_host_order hints; /* Hint bits */
  53. void *ckey; /* IrLMP client handle */
  54. void *skey; /* IrLMP service handle */
  55. struct ias_object *ias_obj; /* Our service name + lsap in IAS */
  56. struct iriap_cb *iriap; /* Used to query remote IAS */
  57. struct ias_value *ias_result; /* Result of remote IAS query */
  58. hashbin_t *cachelog; /* Result of discovery query */
  59. __u32 cachedaddr; /* Result of selective discovery query */
  60. int nslots; /* Number of slots to use for discovery */
  61. int errno; /* status of the IAS query */
  62. wait_queue_head_t query_wait; /* Wait for the answer to a query */
  63. struct timer_list watchdog; /* Timeout for discovery */
  64. LOCAL_FLOW tx_flow;
  65. LOCAL_FLOW rx_flow;
  66. };
  67. static inline struct irda_sock *irda_sk(struct sock *sk)
  68. {
  69. return (struct irda_sock *)sk;
  70. }
  71. #endif /* AF_IRDA_H */