cleanup
[linux-2.4.21-pre4.git] / include / net1 / prio_kernel_qtype.h
1 /* FILE : /usr/src/linux/include/net/prio_kernel_qtype.h\r
2  *\r
3  * This file define data structures used in kernel to run PRIO scheduler.\r
4  */\r
5 \r
6 #include <net/kernel_qtype.h>\r
7 #include <net/qmgt_red.h>               //added by Binbon\r
8 \r
9 \r
10 #define MAX_NUM_OF_PRIO 1024\r
11 //////Begin: Added by Payne For priority scheduling//////\r
12 struct t_flow{\r
13         Policer_Spec    p_spec; //the policer info of the queue\r
14         Filter_Spec     f_spec; //the filter bound to the queue\r
15         \r
16         struct t_flow   *prev;  //the previous flow\r
17         struct t_flow   *next;  //the next flow\r
18         struct t_pqspec *theQueue;  //the queue to which the traffic belongs\r
19 };\r
20 typedef struct t_flow Flow_Spec;\r
21 \r
22 struct t_pqspec\r
23 {\r
24         Q_Stat          q_stat;         //the information of the queue\r
25         Flow_Spec       *flow_spec;     //the flows bound to the queue\r
26         \r
27 \r
28         //doubly linked list to manage ALL queues\r
29         struct t_pqspec *prev;//the previous queue\r
30         struct t_pqspec *next;//the next queue\r
31         struct sk_buff_head pkt_list;   //the packet list of the queue\r
32         \r
33         void *ext;                      // for future extension\r
34 };\r
35 typedef struct t_pqspec PQ_Spec;\r
36 \r
37 \r
38 //20020718 by ARGAY\r
39 //Precedence Order Entry\r
40 struct PreOrderEntry\r
41 {\r
42         Flow_Spec               *fs;\r
43         u_int16_t               po;\r
44         u_int8_t                enabled; //0: DISABLE_BPIPE, 1: ENABLE_BPIPE\r
45         struct PreOrderEntry    *prev;\r
46         struct PreOrderEntry    *next;\r
47 };\r
48 \r
49 \r
50 /* Information of a PRIO scheduler\r
51  *\r
52  */\r
53 struct prio_sch_data{        \r
54         PQ_Spec *head;          //head of queue list which contains ALL queues\r
55                                 //created in a NIC (Let say "ALL-queue list")\r
56         int num_of_prio;        //Max number of priorities supported\r
57         PQ_Spec *default_q;     //for Best Effort traffic\r
58         \r
59         u_int32_t BW;           //bandwidth of link\r
60                                 //NOTE that "bandwidth" may be less than\r
61                                 //NIC's maximum capacity. If it is set\r
62                                 //this way, mechanism of "Maximum output\r
63                                 //rate control" will enforce the NIC to run\r
64                                 //at speed no more faster than "bandwidth".\r
65         u_int32_t BW_token;     //for bandwidth control (maximum output rate\r
66                                 //control), measured in BYTES\r
67         struct timeval last_ctl_time; //to count residual tokens of a NIC\r
68         struct timer_list deq_timer; //to regularly wake up scheduler to send\r
69                                      //packets out\r
70 \r
71         //20020718 by ARGAY\r
72         struct PreOrderEntry *poHead;\r
73         struct semaphore *poe_list_lock; //semaphore the precedence order list\r
74 };\r
75 \r
76 //////End: Added by Payne For priority scheduling//////\r
77 \r
78 \r