1/* 2 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc. 3 * All rights reserved 4 * www.brocade.com 5 * 6 * Linux driver for Brocade Fibre Channel Host Bus Adapter. 7 * 8 * This program is free software; you can redistribute it and/or modify it 9 * under the terms of the GNU General Public License (GPL) Version 2 as 10 * published by the Free Software Foundation 11 * 12 * This program is distributed in the hope that it will be useful, but 13 * WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * General Public License for more details. 16 */ 17 18#ifndef __BFA_DEFS_QOS_H__ 19#define __BFA_DEFS_QOS_H__ 20 21/** 22 * QoS states 23 */ 24enum bfa_qos_state { 25 BFA_QOS_ONLINE = 1, /* QoS is online */ 26 BFA_QOS_OFFLINE = 2, /* QoS is offline */ 27}; 28 29 30/** 31 * QoS Priority levels. 32 */ 33enum bfa_qos_priority { 34 BFA_QOS_UNKNOWN = 0, 35 BFA_QOS_HIGH = 1, /* QoS Priority Level High */ 36 BFA_QOS_MED = 2, /* QoS Priority Level Medium */ 37 BFA_QOS_LOW = 3, /* QoS Priority Level Low */ 38}; 39 40 41/** 42 * QoS bandwidth allocation for each priority level 43 */ 44enum bfa_qos_bw_alloc { 45 BFA_QOS_BW_HIGH = 60, /* bandwidth allocation for High */ 46 BFA_QOS_BW_MED = 30, /* bandwidth allocation for Medium */ 47 BFA_QOS_BW_LOW = 10, /* bandwidth allocation for Low */ 48}; 49 50/** 51 * QoS attribute returned in QoS Query 52 */ 53struct bfa_qos_attr_s { 54 enum bfa_qos_state state; /* QoS current state */ 55 u32 total_bb_cr; /* Total BB Credits */ 56}; 57 58/** 59 * These fields should be displayed only from the CLI. 60 * There will be a separate BFAL API (get_qos_vc_attr ?) 61 * to retrieve this. 62 * 63 */ 64#define BFA_QOS_MAX_VC 16 65 66struct bfa_qos_vc_info_s { 67 u8 vc_credit; 68 u8 borrow_credit; 69 u8 priority; 70 u8 resvd; 71}; 72 73struct bfa_qos_vc_attr_s { 74 u16 total_vc_count; /* Total VC Count */ 75 u16 shared_credit; 76 u32 elp_opmode_flags; 77 struct bfa_qos_vc_info_s vc_info[BFA_QOS_MAX_VC]; /* as many as 78 * total_vc_count */ 79}; 80 81/** 82 * QoS statistics 83 */ 84struct bfa_qos_stats_s { 85 u32 flogi_sent; /* QoS Flogi sent */ 86 u32 flogi_acc_recvd; /* QoS Flogi Acc received */ 87 u32 flogi_rjt_recvd; /* QoS Flogi rejects received */ 88 u32 flogi_retries; /* QoS Flogi retries */ 89 90 u32 elp_recvd; /* QoS ELP received */ 91 u32 elp_accepted; /* QoS ELP Accepted */ 92 u32 elp_rejected; /* QoS ELP rejected */ 93 u32 elp_dropped; /* QoS ELP dropped */ 94 95 u32 qos_rscn_recvd; /* QoS RSCN received */ 96 u32 rsvd; /* padding for 64 bit alignment */ 97}; 98 99#endif /* __BFA_DEFS_QOS_H__ */ 100