Blame IbAccess/Common/Inc/ib_status.h

Packit Service ac7b0b
/* BEGIN_ICS_COPYRIGHT3 ****************************************
Packit Service ac7b0b
Packit Service ac7b0b
Copyright (c) 2015, Intel Corporation
Packit Service ac7b0b
Packit Service ac7b0b
Redistribution and use in source and binary forms, with or without
Packit Service ac7b0b
modification, are permitted provided that the following conditions are met:
Packit Service ac7b0b
Packit Service ac7b0b
    * Redistributions of source code must retain the above copyright notice,
Packit Service ac7b0b
      this list of conditions and the following disclaimer.
Packit Service ac7b0b
    * Redistributions in binary form must reproduce the above copyright
Packit Service ac7b0b
      notice, this list of conditions and the following disclaimer in the
Packit Service ac7b0b
     documentation and/or other materials provided with the distribution.
Packit Service ac7b0b
    * Neither the name of Intel Corporation nor the names of its contributors
Packit Service ac7b0b
      may be used to endorse or promote products derived from this software
Packit Service ac7b0b
      without specific prior written permission.
Packit Service ac7b0b
Packit Service ac7b0b
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Packit Service ac7b0b
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit Service ac7b0b
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Packit Service ac7b0b
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
Packit Service ac7b0b
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit Service ac7b0b
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Packit Service ac7b0b
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Packit Service ac7b0b
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Packit Service ac7b0b
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit Service ac7b0b
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit Service ac7b0b
Packit Service ac7b0b
** END_ICS_COPYRIGHT3   ****************************************/
Packit Service ac7b0b
Packit Service ac7b0b
/* [ICS VERSION STRING: unknown] */
Packit Service ac7b0b
Packit Service ac7b0b
#ifndef _IBA_IB_STATUS_H_
Packit Service ac7b0b
#define _IBA_IB_STATUS_H_
Packit Service ac7b0b
Packit Service ac7b0b
#include "iba/public/datatypes.h"
Packit Service ac7b0b
Packit Service ac7b0b
/*
Packit Service ac7b0b
 * The following values defines different IB software stack modules.
Packit Service ac7b0b
 * These are the values that would be found in bits 16 - 23
Packit Service ac7b0b
 */
Packit Service ac7b0b
Packit Service ac7b0b
#define IB_MOD_VPI		0x01	/* Verbs provider Interface */
Packit Service ac7b0b
#define IB_MOD_VCA		0x02	/* Verbs Consumer Agent */
Packit Service ac7b0b
#define IB_MOD_VKA		0x03	/* Verbs Kernel Agent */
Packit Service ac7b0b
#define IB_MOD_GSA		0x04	/* General Services Agent */
Packit Service ac7b0b
#define IB_MOD_SMA		0x05	/* Subnet Management Agent */
Packit Service ac7b0b
#define IB_MOD_TSL		0x06	/* IB Transport Services */
Packit Service ac7b0b
#define IB_MOD_SM		0x07	/* Subnet Manager */
Packit Service ac7b0b
#define IB_MOD_CM		0x08	/* Connection Manager */
Packit Service ac7b0b
Packit Service ac7b0b
/*
Packit Service ac7b0b
 * The low 8 bits define generic codes defined in the datatypes.h
Packit Service ac7b0b
 * file. The top 24bits are application specific. For IB error and status 
Packit Service ac7b0b
 * types we use the low 8 bits of this 24 bits for module identification. we
Packit Service ac7b0b
 * use the values defined above. The low 16 bits are module specific 
Packit Service ac7b0b
 * error codes that the module can choose to implement in their own way 
Packit Service ac7b0b
 * as applicable.
Packit Service ac7b0b
 *
Packit Service ac7b0b
 *   31               16        8        0
Packit Service ac7b0b
 *     +--------+--------+--------+--------+
Packit Service ac7b0b
 *     | module err code | mod #  | fstatus|
Packit Service ac7b0b
 *     +--------+--------+--------+--------+
Packit Service ac7b0b
 */
Packit Service ac7b0b
Packit Service ac7b0b
#define SET_FSTATUS(fstatus, mod, mstatus)		\
Packit Service ac7b0b
		((fstatus) & 0x000000FF) |				\
Packit Service ac7b0b
		(((mod) << 8) & 0x0000FF00)	|			\
Packit Service ac7b0b
		(((mstatus) << 16) & 0xFFFF0000)  		
Packit Service ac7b0b
Packit Service ac7b0b
#define GET_STATUS(fstatus)						\
Packit Service ac7b0b
		(fstatus & 0x000000FF)
Packit Service ac7b0b
Packit Service ac7b0b
#define GET_MODULE(fstatus)						\
Packit Service ac7b0b
		((fstatus & 0x0000FF00) >> 8)
Packit Service ac7b0b
Packit Service ac7b0b
#define GET_MODERR(fstatus)						\
Packit Service ac7b0b
		((fstatus & 0xFFFF0000) >> 16)
Packit Service ac7b0b
	
Packit Service ac7b0b
#endif /* _IBA_IB_STATUS_H_ */