if_wanpipe_common.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. typedef struct {
  19. struct net_device *slave;
  20. atomic_t packet_sent;
  21. atomic_t receive_block;
  22. atomic_t command;
  23. atomic_t disconnect;
  24. atomic_t driver_busy;
  25. long common_critical;
  26. struct timer_list *tx_timer;
  27. struct sock *sk; /* Wanpipe Sock bind's here */
  28. int (*func)(struct sk_buff *skb, struct net_device *dev,
  29. struct sock *sk);
  30. struct work_struct wanpipe_work; /* deferred keventd work */
  31. unsigned char rw_bind; /* Sock bind state */
  32. unsigned char usedby;
  33. unsigned char state;
  34. unsigned char svc;
  35. unsigned short lcn;
  36. void *mbox;
  37. } wanpipe_common_t;
  38. enum {
  39. WANSOCK_UNCONFIGURED, /* link/channel is not configured */
  40. WANSOCK_DISCONNECTED, /* link/channel is disconnected */
  41. WANSOCK_CONNECTING, /* connection is in progress */
  42. WANSOCK_CONNECTED, /* link/channel is operational */
  43. WANSOCK_LIMIT, /* for verification only */
  44. WANSOCK_DUALPORT, /* for Dual Port cards */
  45. WANSOCK_DISCONNECTING,
  46. WANSOCK_BINDED,
  47. WANSOCK_BIND_LISTEN,
  48. WANSOCK_LISTEN
  49. };
  50. #endif