sba.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /******************************************************************************
  2. *
  3. * (C)Copyright 1998,1999 SysKonnect,
  4. * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * The information in this file is provided "AS IS" without warranty.
  12. *
  13. ******************************************************************************/
  14. /*
  15. * Synchronous Bandwidth Allocation (SBA) structs
  16. */
  17. #ifndef _SBA_
  18. #define _SBA_
  19. #include "mbuf.h"
  20. #include "sba_def.h"
  21. #ifdef SBA
  22. /* Timer Cell Template */
  23. struct timer_cell {
  24. struct timer_cell *next_ptr ;
  25. struct timer_cell *prev_ptr ;
  26. u_long start_time ;
  27. struct s_sba_node_vars *node_var ;
  28. } ;
  29. /*
  30. * Node variables
  31. */
  32. struct s_sba_node_vars {
  33. u_char change_resp_flag ;
  34. u_char report_resp_flag ;
  35. u_char change_req_flag ;
  36. u_char report_req_flag ;
  37. long change_amount ;
  38. long node_overhead ;
  39. long node_payload ;
  40. u_long node_status ;
  41. u_char deallocate_status ;
  42. u_char timer_state ;
  43. u_short report_cnt ;
  44. long lastrep_req_tranid ;
  45. struct fddi_addr mac_address ;
  46. struct s_sba_sessions *node_sessions ;
  47. struct timer_cell timer ;
  48. } ;
  49. /*
  50. * Session variables
  51. */
  52. struct s_sba_sessions {
  53. u_long deallocate_status ;
  54. long session_overhead ;
  55. u_long min_segment_size ;
  56. long session_payload ;
  57. u_long session_status ;
  58. u_long sba_category ;
  59. long lastchg_req_tranid ;
  60. u_short session_id ;
  61. u_char class ;
  62. u_char fddi2 ;
  63. u_long max_t_neg ;
  64. struct s_sba_sessions *next_session ;
  65. } ;
  66. struct s_sba {
  67. struct s_sba_node_vars node[MAX_NODES] ;
  68. struct s_sba_sessions session[MAX_SESSIONS] ;
  69. struct s_sba_sessions *free_session ; /* points to the first */
  70. /* free session */
  71. struct timer_cell *tail_timer ; /* points to the last timer cell */
  72. /*
  73. * variables for allocation actions
  74. */
  75. long total_payload ; /* Total Payload */
  76. long total_overhead ; /* Total Overhead */
  77. long sba_allocatable ; /* allocatable sync bandwidth */
  78. /*
  79. * RAF message receive parameters
  80. */
  81. long msg_path_index ; /* Path Type */
  82. long msg_sba_pl_req ; /* Payload Request */
  83. long msg_sba_ov_req ; /* Overhead Request */
  84. long msg_mib_pl ; /* Current Payload for this Path */
  85. long msg_mib_ov ; /* Current Overhead for this Path*/
  86. long msg_category ; /* Category of the Allocation */
  87. u_long msg_max_t_neg ; /* longest T_Neg acceptable */
  88. u_long msg_min_seg_siz ; /* minimum segement size */
  89. struct smt_header *sm ; /* points to the rec message */
  90. struct fddi_addr *msg_alloc_addr ; /* Allocation Address */
  91. /*
  92. * SBA variables
  93. */
  94. u_long sba_t_neg ; /* holds the last T_NEG */
  95. long sba_max_alloc ; /* the parsed value of SBAAvailable */
  96. /*
  97. * SBA state machine variables
  98. */
  99. short sba_next_state ; /* the next state of the SBA */
  100. char sba_command ; /* holds the execuded SBA cmd */
  101. u_char sba_available ; /* parsed value after possible check */
  102. } ;
  103. #endif /* SBA */
  104. /*
  105. * variables for the End Station Support
  106. */
  107. struct s_ess {
  108. /*
  109. * flags and counters
  110. */
  111. u_char sync_bw_available ; /* is set if sync bw is allocated */
  112. u_char local_sba_active ; /* set when a local sba is available */
  113. char raf_act_timer_poll ; /* activate the timer to send allc req */
  114. char timer_count ; /* counts every timer function call */
  115. SMbuf *sba_reply_pend ; /* local reply for the sba is pending */
  116. /*
  117. * variables for the ess bandwidth control
  118. */
  119. long sync_bw ; /* holds the allocaed sync bw */
  120. u_long alloc_trans_id ; /* trans id of the last alloc req */
  121. } ;
  122. #endif