drivers/scsi/bnx2fc/bnx2fc_constants.h

Source file repositories/reference/linux-study-clean/drivers/scsi/bnx2fc/bnx2fc_constants.h

File Facts

System
Linux kernel
Corpus path
drivers/scsi/bnx2fc/bnx2fc_constants.h
Extension
.h
Size
11401 bytes
Lines
289
Domain
Driver Families
Bucket
drivers/scsi
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef __BNX2FC_CONSTANTS_H_
#define __BNX2FC_CONSTANTS_H_

/**
 * This file defines HSI constants for the FCoE flows
 */

/* Current FCoE HSI version number composed of two fields (16 bit) */
/* Implies on a change broken previous HSI */
#define FCOE_HSI_MAJOR_VERSION (2)
/* Implies on a change which does not broken previous HSI */
#define FCOE_HSI_MINOR_VERSION (1)

/* KWQ/KCQ FCoE layer code */
#define FCOE_KWQE_LAYER_CODE   (7)

/* KWQ (kernel work queue) request op codes */
#define FCOE_KWQE_OPCODE_INIT1			(0)
#define FCOE_KWQE_OPCODE_INIT2			(1)
#define FCOE_KWQE_OPCODE_INIT3			(2)
#define FCOE_KWQE_OPCODE_OFFLOAD_CONN1	(3)
#define FCOE_KWQE_OPCODE_OFFLOAD_CONN2	(4)
#define FCOE_KWQE_OPCODE_OFFLOAD_CONN3	(5)
#define FCOE_KWQE_OPCODE_OFFLOAD_CONN4	(6)
#define FCOE_KWQE_OPCODE_ENABLE_CONN	(7)
#define FCOE_KWQE_OPCODE_DISABLE_CONN	(8)
#define FCOE_KWQE_OPCODE_DESTROY_CONN	(9)
#define FCOE_KWQE_OPCODE_DESTROY		(10)
#define FCOE_KWQE_OPCODE_STAT			(11)

/* KCQ (kernel completion queue) response op codes */
#define FCOE_KCQE_OPCODE_INIT_FUNC				(0x10)
#define FCOE_KCQE_OPCODE_DESTROY_FUNC			(0x11)
#define FCOE_KCQE_OPCODE_STAT_FUNC				(0x12)
#define FCOE_KCQE_OPCODE_OFFLOAD_CONN			(0x15)
#define FCOE_KCQE_OPCODE_ENABLE_CONN			(0x16)
#define FCOE_KCQE_OPCODE_DISABLE_CONN			(0x17)
#define FCOE_KCQE_OPCODE_DESTROY_CONN			(0x18)
#define FCOE_KCQE_OPCODE_CQ_EVENT_NOTIFICATION  (0x20)
#define FCOE_KCQE_OPCODE_FCOE_ERROR				(0x21)

/* KCQ (kernel completion queue) completion status */
#define FCOE_KCQE_COMPLETION_STATUS_SUCCESS				(0x0)
#define FCOE_KCQE_COMPLETION_STATUS_ERROR				(0x1)
#define FCOE_KCQE_COMPLETION_STATUS_INVALID_OPCODE		(0x2)
#define FCOE_KCQE_COMPLETION_STATUS_CTX_ALLOC_FAILURE	(0x3)
#define FCOE_KCQE_COMPLETION_STATUS_CTX_FREE_FAILURE	(0x4)
#define FCOE_KCQE_COMPLETION_STATUS_NIC_ERROR			(0x5)
#define FCOE_KCQE_COMPLETION_STATUS_WRONG_HSI_VERSION   (0x6)
#define FCOE_KCQE_COMPLETION_STATUS_PARITY_ERROR	(0x81)

/* CQE type */
#define FCOE_PENDING_CQE_TYPE			0
#define FCOE_UNSOLIC_CQE_TYPE			1

/* Unsolicited CQE type */
#define FCOE_UNSOLICITED_FRAME_CQE_TYPE			0
#define FCOE_ERROR_DETECTION_CQE_TYPE			1
#define FCOE_WARNING_DETECTION_CQE_TYPE			2

/* E_D_TOV timer resolution in ms */
#define FCOE_E_D_TOV_TIMER_RESOLUTION_MS (20)

/* E_D_TOV timer resolution for SDM (4 micro) */
#define FCOE_E_D_TOV_SDM_TIMER_RESOLUTION				\
	(FCOE_E_D_TOV_TIMER_RESOLUTION_MS * 1000 / 4)

/* REC timer resolution in ms */
#define FCOE_REC_TIMER_RESOLUTION_MS (20)

/* REC timer resolution for SDM (4 micro) */
#define FCOE_REC_SDM_TIMER_RESOLUTION (FCOE_REC_TIMER_RESOLUTION_MS * 1000 / 4)

/* E_D_TOV timer default wraparound value (2 sec) in 20 ms resolution */
#define FCOE_E_D_TOV_DEFAULT_WRAPAROUND_VAL			\
			(2000 / FCOE_E_D_TOV_TIMER_RESOLUTION_MS)

/* REC_TOV timer default wraparound value (3 sec) in 20 ms resolution */
#define FCOE_REC_TOV_DEFAULT_WRAPAROUND_VAL			\
			(3000 / FCOE_REC_TIMER_RESOLUTION_MS)

#define FCOE_NUM_OF_TIMER_TASKS  (8 * 1024)

#define FCOE_NUM_OF_CACHED_TASKS_TIMER (8)

/* Task context constants */
/******** Remove FCP_CMD write tce sleep ***********************/
/* In case timer services are required then shall be updated by Xstorm after
 * start processing the task. In case no timer facilities are required then the
 * driver would initialize the state to this value

Annotation

Implementation Notes