ircomm_tty_attach.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:3k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  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, write to the Free Software 
  26.  *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
  27.  *     MA 02111-1307 USA
  28.  *     
  29.  ********************************************************************/
  30. #ifndef IRCOMM_TTY_ATTACH_H
  31. #define IRCOMM_TTY_ATTACH_H
  32. #include <net/irda/ircomm_tty.h>
  33. typedef enum {
  34.         IRCOMM_TTY_IDLE,
  35. IRCOMM_TTY_SEARCH,
  36.         IRCOMM_TTY_QUERY_PARAMETERS,
  37. IRCOMM_TTY_QUERY_LSAP_SEL,
  38. IRCOMM_TTY_SETUP,
  39.         IRCOMM_TTY_READY,
  40. } IRCOMM_TTY_STATE;
  41. /* IrCOMM TTY Events */
  42. typedef enum {
  43. IRCOMM_TTY_ATTACH_CABLE,
  44. IRCOMM_TTY_DETACH_CABLE,
  45. IRCOMM_TTY_DATA_REQUEST,
  46. IRCOMM_TTY_DATA_INDICATION,
  47. IRCOMM_TTY_DISCOVERY_REQUEST,
  48. IRCOMM_TTY_DISCOVERY_INDICATION,
  49. IRCOMM_TTY_CONNECT_CONFIRM,
  50. IRCOMM_TTY_CONNECT_INDICATION,
  51. IRCOMM_TTY_DISCONNECT_REQUEST,
  52. IRCOMM_TTY_DISCONNECT_INDICATION,
  53. IRCOMM_TTY_WD_TIMER_EXPIRED,
  54. IRCOMM_TTY_GOT_PARAMETERS,
  55. IRCOMM_TTY_GOT_LSAPSEL,
  56. } IRCOMM_TTY_EVENT;
  57. /* Used for passing information through the state-machine */
  58. struct ircomm_tty_info {
  59.         __u32     saddr;               /* Source device address */
  60.         __u32     daddr;               /* Destination device address */
  61.         __u8      dlsap_sel;
  62. };
  63. extern char *ircomm_state[];
  64. extern char *ircomm_event[];
  65. extern char *ircomm_tty_state[];
  66. int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event,
  67. struct sk_buff *skb, struct ircomm_tty_info *info);
  68. void ircomm_tty_next_state(struct ircomm_tty_cb *self, IRCOMM_TTY_STATE state);
  69. int  ircomm_tty_attach_cable(struct ircomm_tty_cb *self);
  70. void ircomm_tty_detach_cable(struct ircomm_tty_cb *self);
  71. void ircomm_tty_connect_confirm(void *instance, void *sap, 
  72. struct qos_info *qos, 
  73. __u32 max_sdu_size, 
  74. __u8 max_header_size, 
  75. struct sk_buff *skb);
  76. void ircomm_tty_disconnect_indication(void *instance, void *sap, 
  77.       LM_REASON reason,
  78.       struct sk_buff *skb);
  79. void ircomm_tty_connect_indication(void *instance, void *sap, 
  80.    struct qos_info *qos, 
  81.    __u32 max_sdu_size,
  82.    __u8 max_header_size, 
  83.    struct sk_buff *skb);
  84. int ircomm_tty_send_initial_parameters(struct ircomm_tty_cb *self);
  85. void ircomm_tty_link_established(struct ircomm_tty_cb *self);
  86. #endif /* IRCOMM_TTY_ATTACH_H */