irlmp_event.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*********************************************************************
  2. *
  3. * Filename: irlmp_event.h
  4. * Version: 0.1
  5. * Description: IrDA-LMP event handling
  6. * Status: Experimental.
  7. * Author: Dag Brattli <dagb@cs.uit.no>
  8. * Created at: Mon Aug 4 20:40:53 1997
  9. * Modified at: Thu Jul 8 12:18:54 1999
  10. * Modified by: Dag Brattli <dagb@cs.uit.no>
  11. *
  12. * Copyright (c) 1997, 1999 Dag Brattli <dagb@cs.uit.no>,
  13. * All Rights Reserved.
  14. * Copyright (c) 2000-2002 Jean Tourrilhes <jt@hpl.hp.com>
  15. *
  16. * This program is free software; you can redistribute it and/or
  17. * modify it under the terms of the GNU General Public License as
  18. * published by the Free Software Foundation; either version 2 of
  19. * the License, or (at your option) any later version.
  20. *
  21. * Neither Dag Brattli nor University of Tromsø admit liability nor
  22. * provide warranty for any of this software. This material is
  23. * provided "AS-IS" and at no charge.
  24. *
  25. ********************************************************************/
  26. #ifndef IRLMP_EVENT_H
  27. #define IRLMP_EVENT_H
  28. /* A few forward declarations (to make compiler happy) */
  29. struct irlmp_cb;
  30. struct lsap_cb;
  31. struct lap_cb;
  32. struct discovery_t;
  33. /* LAP states */
  34. typedef enum {
  35. /* IrLAP connection control states */
  36. LAP_STANDBY, /* No LAP connection */
  37. LAP_U_CONNECT, /* Starting LAP connection */
  38. LAP_ACTIVE, /* LAP connection is active */
  39. } IRLMP_STATE;
  40. /* LSAP connection control states */
  41. typedef enum {
  42. LSAP_DISCONNECTED, /* No LSAP connection */
  43. LSAP_CONNECT, /* Connect indication from peer */
  44. LSAP_CONNECT_PEND, /* Connect request from service user */
  45. LSAP_DATA_TRANSFER_READY, /* LSAP connection established */
  46. LSAP_SETUP, /* Trying to set up LSAP connection */
  47. LSAP_SETUP_PEND, /* Request to start LAP connection */
  48. } LSAP_STATE;
  49. typedef enum {
  50. /* LSAP events */
  51. LM_CONNECT_REQUEST,
  52. LM_CONNECT_CONFIRM,
  53. LM_CONNECT_RESPONSE,
  54. LM_CONNECT_INDICATION,
  55. LM_DISCONNECT_INDICATION,
  56. LM_DISCONNECT_REQUEST,
  57. LM_DATA_REQUEST,
  58. LM_UDATA_REQUEST,
  59. LM_DATA_INDICATION,
  60. LM_UDATA_INDICATION,
  61. LM_WATCHDOG_TIMEOUT,
  62. /* IrLAP events */
  63. LM_LAP_CONNECT_REQUEST,
  64. LM_LAP_CONNECT_INDICATION,
  65. LM_LAP_CONNECT_CONFIRM,
  66. LM_LAP_DISCONNECT_INDICATION,
  67. LM_LAP_DISCONNECT_REQUEST,
  68. LM_LAP_DISCOVERY_REQUEST,
  69. LM_LAP_DISCOVERY_CONFIRM,
  70. LM_LAP_IDLE_TIMEOUT,
  71. } IRLMP_EVENT;
  72. extern const char *const irlmp_state[];
  73. extern const char *const irlsap_state[];
  74. void irlmp_watchdog_timer_expired(void *data);
  75. void irlmp_discovery_timer_expired(void *data);
  76. void irlmp_idle_timer_expired(void *data);
  77. void irlmp_do_lap_event(struct lap_cb *self, IRLMP_EVENT event,
  78. struct sk_buff *skb);
  79. int irlmp_do_lsap_event(struct lsap_cb *self, IRLMP_EVENT event,
  80. struct sk_buff *skb);
  81. #endif /* IRLMP_EVENT_H */