ircomm_tty_attach.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*********************************************************************
  2. *
  3. * Filename: ircomm_tty_attach.h
  4. * Version:
  5. * Description:
  6. * Status: Experimental.
  7. * Author: Dag Brattli <dagb@cs.uit.no>
  8. * Created at: Wed Jun 9 15:55:18 1999
  9. * Modified at: Fri Dec 10 21:04:55 1999
  10. * Modified by: Dag Brattli <dagb@cs.uit.no>
  11. *
  12. * Copyright (c) 1999 Dag Brattli, All Rights Reserved.
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License as
  16. * published by the Free Software Foundation; either version 2 of
  17. * the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  26. *
  27. ********************************************************************/
  28. #ifndef IRCOMM_TTY_ATTACH_H
  29. #define IRCOMM_TTY_ATTACH_H
  30. #include <net/irda/ircomm_tty.h>
  31. typedef enum {
  32. IRCOMM_TTY_IDLE,
  33. IRCOMM_TTY_SEARCH,
  34. IRCOMM_TTY_QUERY_PARAMETERS,
  35. IRCOMM_TTY_QUERY_LSAP_SEL,
  36. IRCOMM_TTY_SETUP,
  37. IRCOMM_TTY_READY,
  38. } IRCOMM_TTY_STATE;
  39. /* IrCOMM TTY Events */
  40. typedef enum {
  41. IRCOMM_TTY_ATTACH_CABLE,
  42. IRCOMM_TTY_DETACH_CABLE,
  43. IRCOMM_TTY_DATA_REQUEST,
  44. IRCOMM_TTY_DATA_INDICATION,
  45. IRCOMM_TTY_DISCOVERY_REQUEST,
  46. IRCOMM_TTY_DISCOVERY_INDICATION,
  47. IRCOMM_TTY_CONNECT_CONFIRM,
  48. IRCOMM_TTY_CONNECT_INDICATION,
  49. IRCOMM_TTY_DISCONNECT_REQUEST,
  50. IRCOMM_TTY_DISCONNECT_INDICATION,
  51. IRCOMM_TTY_WD_TIMER_EXPIRED,
  52. IRCOMM_TTY_GOT_PARAMETERS,
  53. IRCOMM_TTY_GOT_LSAPSEL,
  54. } IRCOMM_TTY_EVENT;
  55. /* Used for passing information through the state-machine */
  56. struct ircomm_tty_info {
  57. __u32 saddr; /* Source device address */
  58. __u32 daddr; /* Destination device address */
  59. __u8 dlsap_sel;
  60. };
  61. extern const char *const ircomm_state[];
  62. extern const char *const ircomm_tty_state[];
  63. int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event,
  64. struct sk_buff *skb, struct ircomm_tty_info *info);
  65. int ircomm_tty_attach_cable(struct ircomm_tty_cb *self);
  66. void ircomm_tty_detach_cable(struct ircomm_tty_cb *self);
  67. void ircomm_tty_connect_confirm(void *instance, void *sap,
  68. struct qos_info *qos,
  69. __u32 max_sdu_size,
  70. __u8 max_header_size,
  71. struct sk_buff *skb);
  72. void ircomm_tty_disconnect_indication(void *instance, void *sap,
  73. LM_REASON reason,
  74. struct sk_buff *skb);
  75. void ircomm_tty_connect_indication(void *instance, void *sap,
  76. struct qos_info *qos,
  77. __u32 max_sdu_size,
  78. __u8 max_header_size,
  79. struct sk_buff *skb);
  80. int ircomm_tty_send_initial_parameters(struct ircomm_tty_cb *self);
  81. void ircomm_tty_link_established(struct ircomm_tty_cb *self);
  82. #endif /* IRCOMM_TTY_ATTACH_H */