if_wanpipe_common.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*****************************************************************************
  2. * if_wanipe_common.h   Sangoma Driver/Socket common area definitions.
  3. *
  4. * Author:       Nenad Corbic <ncorbic@sangoma.com>
  5. *
  6. * Copyright:    (c) 2000 Sangoma Technologies Inc.
  7. *
  8. *               This program is free software; you can redistribute it and/or
  9. *               modify it under the terms of the GNU General Public License
  10. *               as published by the Free Software Foundation; either version
  11. *               2 of the License, or (at your option) any later version.
  12. * ============================================================================
  13. * Jan 13, 2000  Nenad Corbic      Initial version
  14. *****************************************************************************/
  15. #ifndef _WANPIPE_SOCK_DRIVER_COMMON_H
  16. #define _WANPIPE_SOCK_DRIVER_COMMON_H
  17. #include <linux/version.h>
  18. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
  19.  #define netdevice_t struct net_device
  20. #else
  21.  #define netdevice_t struct device
  22. #endif
  23. typedef struct {
  24. netdevice_t *slave;
  25. atomic_t packet_sent;
  26. atomic_t receive_block;
  27. atomic_t command;
  28. atomic_t disconnect;
  29. atomic_t driver_busy;
  30. unsigned char common_critical;
  31. struct timer_list *tx_timer;
  32. struct sock *sk; /* Wanpipe Sock bind's here */ 
  33. int   (*func) (struct sk_buff *, netdevice_t *, 
  34.                        struct sock *);
  35. struct tq_struct wanpipe_task;    /* Immediate BH handler task */
  36. unsigned char rw_bind;   /* Sock bind state */
  37. unsigned char usedby;
  38. unsigned char state;
  39. unsigned char svc;
  40. unsigned short lcn;
  41. void *mbox;
  42. } wanpipe_common_t;
  43. enum {
  44. WANSOCK_UNCONFIGURED, /* link/channel is not configured */
  45. WANSOCK_DISCONNECTED, /* link/channel is disconnected */
  46. WANSOCK_CONNECTING, /* connection is in progress */
  47. WANSOCK_CONNECTED, /* link/channel is operational */
  48. WANSOCK_LIMIT, /* for verification only */
  49. WANSOCK_DUALPORT, /* for Dual Port cards */
  50. WANSOCK_DISCONNECTING,
  51. WANSOCK_BINDED,
  52. WANSOCK_BIND_LISTEN,
  53. WANSOCK_LISTEN
  54. };
  55. #endif