1*2874c5fdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 233f810b2SJeff Kirsher /****************************************************************************** 333f810b2SJeff Kirsher * 433f810b2SJeff Kirsher * (C)Copyright 1998,1999 SysKonnect, 533f810b2SJeff Kirsher * a business unit of Schneider & Koch & Co. Datensysteme GmbH. 633f810b2SJeff Kirsher * 733f810b2SJeff Kirsher * The information in this file is provided "AS IS" without warranty. 833f810b2SJeff Kirsher * 933f810b2SJeff Kirsher ******************************************************************************/ 1033f810b2SJeff Kirsher 1133f810b2SJeff Kirsher /* 1233f810b2SJeff Kirsher * Synchronous Bandwidth Allocation (SBA) structs 1333f810b2SJeff Kirsher */ 1433f810b2SJeff Kirsher 1533f810b2SJeff Kirsher #ifndef _SBA_ 1633f810b2SJeff Kirsher #define _SBA_ 1733f810b2SJeff Kirsher 18aab3ac26SJeff Kirsher #include "mbuf.h" 19aab3ac26SJeff Kirsher #include "sba_def.h" 2033f810b2SJeff Kirsher 2133f810b2SJeff Kirsher #ifdef SBA 2233f810b2SJeff Kirsher 2333f810b2SJeff Kirsher /* Timer Cell Template */ 2433f810b2SJeff Kirsher struct timer_cell { 2533f810b2SJeff Kirsher struct timer_cell *next_ptr ; 2633f810b2SJeff Kirsher struct timer_cell *prev_ptr ; 2733f810b2SJeff Kirsher u_long start_time ; 2833f810b2SJeff Kirsher struct s_sba_node_vars *node_var ; 2933f810b2SJeff Kirsher } ; 3033f810b2SJeff Kirsher 3133f810b2SJeff Kirsher /* 3233f810b2SJeff Kirsher * Node variables 3333f810b2SJeff Kirsher */ 3433f810b2SJeff Kirsher struct s_sba_node_vars { 3533f810b2SJeff Kirsher u_char change_resp_flag ; 3633f810b2SJeff Kirsher u_char report_resp_flag ; 3733f810b2SJeff Kirsher u_char change_req_flag ; 3833f810b2SJeff Kirsher u_char report_req_flag ; 3933f810b2SJeff Kirsher long change_amount ; 4033f810b2SJeff Kirsher long node_overhead ; 4133f810b2SJeff Kirsher long node_payload ; 4233f810b2SJeff Kirsher u_long node_status ; 4333f810b2SJeff Kirsher u_char deallocate_status ; 4433f810b2SJeff Kirsher u_char timer_state ; 4533f810b2SJeff Kirsher u_short report_cnt ; 4633f810b2SJeff Kirsher long lastrep_req_tranid ; 4733f810b2SJeff Kirsher struct fddi_addr mac_address ; 4833f810b2SJeff Kirsher struct s_sba_sessions *node_sessions ; 4933f810b2SJeff Kirsher struct timer_cell timer ; 5033f810b2SJeff Kirsher } ; 5133f810b2SJeff Kirsher 5233f810b2SJeff Kirsher /* 5333f810b2SJeff Kirsher * Session variables 5433f810b2SJeff Kirsher */ 5533f810b2SJeff Kirsher struct s_sba_sessions { 5633f810b2SJeff Kirsher u_long deallocate_status ; 5733f810b2SJeff Kirsher long session_overhead ; 5833f810b2SJeff Kirsher u_long min_segment_size ; 5933f810b2SJeff Kirsher long session_payload ; 6033f810b2SJeff Kirsher u_long session_status ; 6133f810b2SJeff Kirsher u_long sba_category ; 6233f810b2SJeff Kirsher long lastchg_req_tranid ; 6333f810b2SJeff Kirsher u_short session_id ; 6433f810b2SJeff Kirsher u_char class ; 6533f810b2SJeff Kirsher u_char fddi2 ; 6633f810b2SJeff Kirsher u_long max_t_neg ; 6733f810b2SJeff Kirsher struct s_sba_sessions *next_session ; 6833f810b2SJeff Kirsher } ; 6933f810b2SJeff Kirsher 7033f810b2SJeff Kirsher struct s_sba { 7133f810b2SJeff Kirsher 7233f810b2SJeff Kirsher struct s_sba_node_vars node[MAX_NODES] ; 7333f810b2SJeff Kirsher struct s_sba_sessions session[MAX_SESSIONS] ; 7433f810b2SJeff Kirsher 7533f810b2SJeff Kirsher struct s_sba_sessions *free_session ; /* points to the first */ 7633f810b2SJeff Kirsher /* free session */ 7733f810b2SJeff Kirsher 7833f810b2SJeff Kirsher struct timer_cell *tail_timer ; /* points to the last timer cell */ 7933f810b2SJeff Kirsher 8033f810b2SJeff Kirsher /* 8133f810b2SJeff Kirsher * variables for allocation actions 8233f810b2SJeff Kirsher */ 8333f810b2SJeff Kirsher long total_payload ; /* Total Payload */ 8433f810b2SJeff Kirsher long total_overhead ; /* Total Overhead */ 8533f810b2SJeff Kirsher long sba_allocatable ; /* allocatable sync bandwidth */ 8633f810b2SJeff Kirsher 8733f810b2SJeff Kirsher /* 8833f810b2SJeff Kirsher * RAF message receive parameters 8933f810b2SJeff Kirsher */ 9033f810b2SJeff Kirsher long msg_path_index ; /* Path Type */ 9133f810b2SJeff Kirsher long msg_sba_pl_req ; /* Payload Request */ 9233f810b2SJeff Kirsher long msg_sba_ov_req ; /* Overhead Request */ 9333f810b2SJeff Kirsher long msg_mib_pl ; /* Current Payload for this Path */ 9433f810b2SJeff Kirsher long msg_mib_ov ; /* Current Overhead for this Path*/ 9533f810b2SJeff Kirsher long msg_category ; /* Category of the Allocation */ 9633f810b2SJeff Kirsher u_long msg_max_t_neg ; /* longest T_Neg acceptable */ 9733f810b2SJeff Kirsher u_long msg_min_seg_siz ; /* minimum segement size */ 9833f810b2SJeff Kirsher struct smt_header *sm ; /* points to the rec message */ 9933f810b2SJeff Kirsher struct fddi_addr *msg_alloc_addr ; /* Allocation Address */ 10033f810b2SJeff Kirsher 10133f810b2SJeff Kirsher /* 10233f810b2SJeff Kirsher * SBA variables 10333f810b2SJeff Kirsher */ 10433f810b2SJeff Kirsher u_long sba_t_neg ; /* holds the last T_NEG */ 10533f810b2SJeff Kirsher long sba_max_alloc ; /* the parsed value of SBAAvailable */ 10633f810b2SJeff Kirsher 10733f810b2SJeff Kirsher /* 10833f810b2SJeff Kirsher * SBA state machine variables 10933f810b2SJeff Kirsher */ 11033f810b2SJeff Kirsher short sba_next_state ; /* the next state of the SBA */ 11133f810b2SJeff Kirsher char sba_command ; /* holds the execuded SBA cmd */ 11233f810b2SJeff Kirsher u_char sba_available ; /* parsed value after possible check */ 11333f810b2SJeff Kirsher } ; 11433f810b2SJeff Kirsher 11533f810b2SJeff Kirsher #endif /* SBA */ 11633f810b2SJeff Kirsher 11733f810b2SJeff Kirsher /* 11833f810b2SJeff Kirsher * variables for the End Station Support 11933f810b2SJeff Kirsher */ 12033f810b2SJeff Kirsher struct s_ess { 12133f810b2SJeff Kirsher 12233f810b2SJeff Kirsher /* 12333f810b2SJeff Kirsher * flags and counters 12433f810b2SJeff Kirsher */ 12533f810b2SJeff Kirsher u_char sync_bw_available ; /* is set if sync bw is allocated */ 12633f810b2SJeff Kirsher u_char local_sba_active ; /* set when a local sba is available */ 12733f810b2SJeff Kirsher char raf_act_timer_poll ; /* activate the timer to send allc req */ 12833f810b2SJeff Kirsher char timer_count ; /* counts every timer function call */ 12933f810b2SJeff Kirsher 13033f810b2SJeff Kirsher SMbuf *sba_reply_pend ; /* local reply for the sba is pending */ 13133f810b2SJeff Kirsher 13233f810b2SJeff Kirsher /* 13333f810b2SJeff Kirsher * variables for the ess bandwidth control 13433f810b2SJeff Kirsher */ 13533f810b2SJeff Kirsher long sync_bw ; /* holds the allocaed sync bw */ 13633f810b2SJeff Kirsher u_long alloc_trans_id ; /* trans id of the last alloc req */ 13733f810b2SJeff Kirsher } ; 13833f810b2SJeff Kirsher #endif 139