Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Copyright (c) 2014- QLogic Corporation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * All rights reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * www.qlogic.com
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #ifndef __BFA_FCPIM_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #define __BFA_FCPIM_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include "bfa.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include "bfa_svc.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include "bfi_ms.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include "bfa_defs_svc.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include "bfa_cs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) /* FCP module related definitions */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #define BFA_IO_MAX	BFI_IO_MAX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #define BFA_FWTIO_MAX	2000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) struct bfa_fcp_mod_s;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) struct bfa_iotag_s {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	struct list_head	qe;	/* queue element	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	u16	tag;			/* FW IO tag		*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) struct bfa_itn_s {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	bfa_isr_func_t isr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) void bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 		void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) void bfa_itn_isr(struct bfa_s *bfa, struct bfi_msg_s *m);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) void bfa_iotag_attach(struct bfa_fcp_mod_s *fcp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) void bfa_fcp_res_recfg(struct bfa_s *bfa, u16 num_ioim_fw, u16 max_ioim_fw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) #define BFA_FCP_MOD(_hal)	(&(_hal)->modules.fcp_mod)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) #define BFA_MEM_FCP_KVA(__bfa)	(&(BFA_FCP_MOD(__bfa)->kva_seg))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) #define BFA_IOTAG_FROM_TAG(_fcp, _tag)	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	(&(_fcp)->iotag_arr[(_tag & BFA_IOIM_IOTAG_MASK)])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) #define BFA_ITN_FROM_TAG(_fcp, _tag)	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	((_fcp)->itn_arr + ((_tag) & ((_fcp)->num_itns - 1)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) #define BFA_SNSINFO_FROM_TAG(_fcp, _tag) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	bfa_mem_get_dmabuf_kva(_fcp, (_tag & BFA_IOIM_IOTAG_MASK),	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	BFI_IOIM_SNSLEN)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) #define BFA_ITNIM_MIN   32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) #define BFA_ITNIM_MAX   1024
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) #define BFA_IOIM_MIN	8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) #define BFA_IOIM_MAX	2000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) #define BFA_TSKIM_MIN   4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) #define BFA_TSKIM_MAX   512
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) #define BFA_FCPIM_PATHTOV_DEF	(30 * 1000)	/* in millisecs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) #define BFA_FCPIM_PATHTOV_MAX	(90 * 1000)	/* in millisecs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) #define bfa_itnim_ioprofile_update(__itnim, __index)			\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	(__itnim->ioprofile.iocomps[__index]++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) #define BFA_IOIM_RETRY_TAG_OFFSET 11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) #define BFA_IOIM_IOTAG_MASK 0x07ff /* 2K IOs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) #define BFA_IOIM_RETRY_MAX 7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) /* Buckets are are 512 bytes to 2MB */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) static inline u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) bfa_ioim_get_index(u32 n) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	int pos = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	if (n >= (1UL)<<22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		return BFA_IOBUCKET_MAX - 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	n >>= 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	if (n >= (1UL)<<16) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 		n >>= 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 		pos += 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	if (n >= 1 << 8) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		n >>= 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 		pos += 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	if (n >= 1 << 4) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		n >>= 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 		pos += 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	if (n >= 1 << 2) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		n >>= 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 		pos += 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	if (n >= 1 << 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 		pos += 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	return (n == 0) ? (0) : pos;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)  * forward declarations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) struct bfa_ioim_s;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) struct bfa_tskim_s;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) struct bfad_ioim_s;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) struct bfad_tskim_s;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) typedef void    (*bfa_fcpim_profile_t) (struct bfa_ioim_s *ioim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) struct bfa_fcpim_s {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	struct bfa_s		*bfa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	struct bfa_fcp_mod_s	*fcp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	struct bfa_itnim_s	*itnim_arr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	struct bfa_ioim_s	*ioim_arr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	struct bfa_ioim_sp_s	*ioim_sp_arr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	struct bfa_tskim_s	*tskim_arr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	int			num_itnims;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	int			num_tskim_reqs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	u32			path_tov;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	u16			q_depth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	u8			reqq;		/*  Request queue to be used */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	struct list_head	itnim_q;	/*  queue of active itnim */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	struct list_head	ioim_resfree_q; /*  IOs waiting for f/w */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	struct list_head	ioim_comp_q;	/*  IO global comp Q	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	struct list_head	tskim_free_q;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	struct list_head	tskim_unused_q;	/* Unused tskim Q */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	u32			ios_active;	/*  current active IOs	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	u32			delay_comp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	struct bfa_fcpim_del_itn_stats_s del_itn_stats;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	bfa_boolean_t		ioredirect;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	bfa_boolean_t		io_profile;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	time64_t		io_profile_start_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	bfa_fcpim_profile_t     profile_comp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	bfa_fcpim_profile_t     profile_start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) /* Max FCP dma segs required */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) #define BFA_FCP_DMA_SEGS	BFI_IOIM_SNSBUF_SEGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) struct bfa_fcp_mod_s {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	struct bfa_s		*bfa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	struct list_head	iotag_ioim_free_q;	/* free IO resources */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	struct list_head	iotag_tio_free_q;	/* free IO resources */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	struct list_head	iotag_unused_q;	/* unused IO resources*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	struct bfa_iotag_s	*iotag_arr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	struct bfa_itn_s	*itn_arr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	int			max_ioim_reqs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	int			num_ioim_reqs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	int			num_fwtio_reqs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	int			num_itns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	struct bfa_dma_s	snsbase[BFA_FCP_DMA_SEGS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	struct bfa_fcpim_s	fcpim;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	struct bfa_mem_dma_s	dma_seg[BFA_FCP_DMA_SEGS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	struct bfa_mem_kva_s	kva_seg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	int			throttle_update_required;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)  * BFA IO (initiator mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) struct bfa_ioim_s {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	struct list_head	qe;		/*  queue elememt	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	bfa_sm_t		sm;		/*  BFA ioim state machine */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	struct bfa_s		*bfa;		/*  BFA module	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	struct bfa_fcpim_s	*fcpim;		/*  parent fcpim module */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	struct bfa_itnim_s	*itnim;		/*  i-t-n nexus for this IO  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	struct bfad_ioim_s	*dio;		/*  driver IO handle	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	u16			iotag;		/*  FWI IO tag	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	u16			abort_tag;	/*  unqiue abort request tag */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	u16			nsges;		/*  number of SG elements */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	u16			nsgpgs;		/*  number of SG pages	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	struct bfa_sgpg_s	*sgpg;		/*  first SG page	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	struct list_head	sgpg_q;		/*  allocated SG pages	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	struct bfa_cb_qe_s	hcb_qe;		/*  bfa callback qelem	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	bfa_cb_cbfn_t		io_cbfn;	/*  IO completion handler */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	struct bfa_ioim_sp_s	*iosp;		/*  slow-path IO handling */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	u8			reqq;		/*  Request queue for I/O */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	u8			mode;		/*  IO is passthrough or not */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	u64			start_time;	/*  IO's Profile start val */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) struct bfa_ioim_sp_s {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	struct bfi_msg_s	comp_rspmsg;	/*  IO comp f/w response */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	struct bfa_sgpg_wqe_s	sgpg_wqe;	/*  waitq elem for sgpg	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	struct bfa_reqq_wait_s	reqq_wait;	/*  to wait for room in reqq */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	bfa_boolean_t		abort_explicit;	/*  aborted by OS	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	struct bfa_tskim_s	*tskim;		/*  Relevant TM cmd	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)  * BFA Task management command (initiator mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) struct bfa_tskim_s {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	struct list_head	qe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	bfa_sm_t		sm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	struct bfa_s		*bfa;	/*  BFA module  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	struct bfa_fcpim_s	*fcpim;	/*  parent fcpim module	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	struct bfa_itnim_s	*itnim;	/*  i-t-n nexus for this IO  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	struct bfad_tskim_s	*dtsk;  /*  driver task mgmt cmnd	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	bfa_boolean_t		notify;	/*  notify itnim on TM comp  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	struct scsi_lun		lun;	/*  lun if applicable	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	enum fcp_tm_cmnd	tm_cmnd; /*  task management command  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	u16			tsk_tag; /*  FWI IO tag	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	u8			tsecs;	/*  timeout in seconds	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	struct bfa_reqq_wait_s  reqq_wait;   /*  to wait for room in reqq */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	struct list_head	io_q;	/*  queue of affected IOs	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	struct bfa_wc_s		wc;	/*  waiting counter	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	struct bfa_cb_qe_s	hcb_qe;	/*  bfa callback qelem	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	enum bfi_tskim_status   tsk_status;  /*  TM status	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)  * BFA i-t-n (initiator mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) struct bfa_itnim_s {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	struct list_head	qe;	/*  queue element	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	bfa_sm_t		sm;	/*  i-t-n im BFA state machine  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	struct bfa_s		*bfa;	/*  bfa instance	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	struct bfa_rport_s	*rport;	/*  bfa rport	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	void			*ditn;	/*  driver i-t-n structure	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	struct bfi_mhdr_s	mhdr;	/*  pre-built mhdr	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	u8			msg_no;	/*  itnim/rport firmware handle */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	u8			reqq;	/*  CQ for requests	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	struct bfa_cb_qe_s	hcb_qe;	/*  bfa callback qelem	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	struct list_head pending_q;	/*  queue of pending IO requests */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	struct list_head io_q;		/*  queue of active IO requests */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	struct list_head io_cleanup_q;	/*  IO being cleaned up	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	struct list_head tsk_q;		/*  queue of active TM commands */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	struct list_head  delay_comp_q; /*  queue of failed inflight cmds */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	bfa_boolean_t   seq_rec;	/*  SQER supported	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	bfa_boolean_t   is_online;	/*  itnim is ONLINE for IO	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	bfa_boolean_t   iotov_active;	/*  IO TOV timer is active	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	struct bfa_wc_s	wc;		/*  waiting counter	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	struct bfa_timer_s timer;	/*  pending IO TOV	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	struct bfa_reqq_wait_s reqq_wait; /*  to wait for room in reqq */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	struct bfa_fcpim_s *fcpim;	/*  fcpim module	*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	struct bfa_itnim_iostats_s	stats;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	struct bfa_itnim_ioprofile_s  ioprofile;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) #define bfa_itnim_is_online(_itnim) ((_itnim)->is_online)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) #define BFA_FCPIM(_hal)	(&(_hal)->modules.fcp_mod.fcpim)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) #define BFA_IOIM_TAG_2_ID(_iotag)	((_iotag) & BFA_IOIM_IOTAG_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) #define BFA_IOIM_FROM_TAG(_fcpim, _iotag)	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 	(&fcpim->ioim_arr[(_iotag & BFA_IOIM_IOTAG_MASK)])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) #define BFA_TSKIM_FROM_TAG(_fcpim, _tmtag)	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	(&fcpim->tskim_arr[_tmtag & (fcpim->num_tskim_reqs - 1)])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) #define bfa_io_profile_start_time(_bfa)	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	((_bfa)->modules.fcp_mod.fcpim.io_profile_start_time)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) #define bfa_fcpim_get_io_profile(_bfa)	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	((_bfa)->modules.fcp_mod.fcpim.io_profile)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) #define bfa_ioim_update_iotag(__ioim) do {				\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 	uint16_t k = (__ioim)->iotag >> BFA_IOIM_RETRY_TAG_OFFSET;	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	k++; (__ioim)->iotag &= BFA_IOIM_IOTAG_MASK;			\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	(__ioim)->iotag |= k << BFA_IOIM_RETRY_TAG_OFFSET;		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) } while (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) static inline bfa_boolean_t
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) bfa_ioim_maxretry_reached(struct bfa_ioim_s *ioim)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	uint16_t k = ioim->iotag >> BFA_IOIM_RETRY_TAG_OFFSET;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 	if (k < BFA_IOIM_RETRY_MAX)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 		return BFA_FALSE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 	return BFA_TRUE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)  * function prototypes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) void	bfa_ioim_attach(struct bfa_fcpim_s *fcpim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) void	bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) void	bfa_ioim_good_comp_isr(struct bfa_s *bfa,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 					struct bfi_msg_s *msg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) void	bfa_ioim_cleanup(struct bfa_ioim_s *ioim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) void	bfa_ioim_cleanup_tm(struct bfa_ioim_s *ioim,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 					struct bfa_tskim_s *tskim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) void	bfa_ioim_iocdisable(struct bfa_ioim_s *ioim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) void	bfa_ioim_tov(struct bfa_ioim_s *ioim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) void	bfa_tskim_attach(struct bfa_fcpim_s *fcpim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) void	bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) void	bfa_tskim_iodone(struct bfa_tskim_s *tskim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) void	bfa_tskim_iocdisable(struct bfa_tskim_s *tskim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) void	bfa_tskim_cleanup(struct bfa_tskim_s *tskim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) void	bfa_tskim_res_recfg(struct bfa_s *bfa, u16 num_tskim_fw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) void	bfa_itnim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) void	bfa_itnim_attach(struct bfa_fcpim_s *fcpim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) void	bfa_itnim_iocdisable(struct bfa_itnim_s *itnim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) void	bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) void	bfa_itnim_iodone(struct bfa_itnim_s *itnim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) void	bfa_itnim_tskdone(struct bfa_itnim_s *itnim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) bfa_boolean_t   bfa_itnim_hold_io(struct bfa_itnim_s *itnim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)  * bfa fcpim module API functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) void	bfa_fcpim_path_tov_set(struct bfa_s *bfa, u16 path_tov);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) u16	bfa_fcpim_path_tov_get(struct bfa_s *bfa);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) u16	bfa_fcpim_qdepth_get(struct bfa_s *bfa);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) bfa_status_t bfa_fcpim_port_iostats(struct bfa_s *bfa,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 			struct bfa_itnim_iostats_s *stats, u8 lp_tag);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) void bfa_fcpim_add_stats(struct bfa_itnim_iostats_s *fcpim_stats,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 			struct bfa_itnim_iostats_s *itnim_stats);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) bfa_status_t bfa_fcpim_profile_on(struct bfa_s *bfa, time64_t time);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) bfa_status_t bfa_fcpim_profile_off(struct bfa_s *bfa);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) #define bfa_fcpim_ioredirect_enabled(__bfa)				\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 	(((struct bfa_fcpim_s *)(BFA_FCPIM(__bfa)))->ioredirect)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) #define bfa_fcpim_get_next_reqq(__bfa, __qid)				\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) {									\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 	struct bfa_fcpim_s *__fcpim = BFA_FCPIM(__bfa);      \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 	__fcpim->reqq++;						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 	__fcpim->reqq &= (BFI_IOC_MAX_CQS - 1);      \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 	*(__qid) = __fcpim->reqq;					\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) #define bfa_iocfc_map_msg_to_qid(__msg, __qid)				\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 	*(__qid) = (u8)((__msg) & (BFI_IOC_MAX_CQS - 1));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322)  * bfa itnim API functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) struct bfa_itnim_s *bfa_itnim_create(struct bfa_s *bfa,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 		struct bfa_rport_s *rport, void *itnim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) void bfa_itnim_delete(struct bfa_itnim_s *itnim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) void bfa_itnim_online(struct bfa_itnim_s *itnim, bfa_boolean_t seq_rec);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) void bfa_itnim_offline(struct bfa_itnim_s *itnim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) void bfa_itnim_clear_stats(struct bfa_itnim_s *itnim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) bfa_status_t bfa_itnim_get_ioprofile(struct bfa_itnim_s *itnim,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 			struct bfa_itnim_ioprofile_s *ioprofile);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) #define bfa_itnim_get_reqq(__ioim) (((struct bfa_ioim_s *)__ioim)->itnim->reqq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336)  * BFA completion callback for bfa_itnim_online().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) void	bfa_cb_itnim_online(void *itnim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341)  * BFA completion callback for bfa_itnim_offline().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) void	bfa_cb_itnim_offline(void *itnim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) void	bfa_cb_itnim_tov_begin(void *itnim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) void	bfa_cb_itnim_tov(void *itnim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348)  * BFA notification to FCS/driver for second level error recovery.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349)  * Atleast one I/O request has timedout and target is unresponsive to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)  * repeated abort requests. Second level error recovery should be initiated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351)  * by starting implicit logout and recovery procedures.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) void	bfa_cb_itnim_sler(void *itnim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356)  * bfa ioim API functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) struct bfa_ioim_s	*bfa_ioim_alloc(struct bfa_s *bfa,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 					struct bfad_ioim_s *dio,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 					struct bfa_itnim_s *itnim,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 					u16 nsgles);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) void		bfa_ioim_free(struct bfa_ioim_s *ioim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) void		bfa_ioim_start(struct bfa_ioim_s *ioim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) bfa_status_t	bfa_ioim_abort(struct bfa_ioim_s *ioim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) void		bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 				      bfa_boolean_t iotov);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369)  * I/O completion notification.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371)  * @param[in]		dio			driver IO structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372)  * @param[in]		io_status		IO completion status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373)  * @param[in]		scsi_status		SCSI status returned by target
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374)  * @param[in]		sns_len			SCSI sense length, 0 if none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375)  * @param[in]		sns_info		SCSI sense data, if any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376)  * @param[in]		residue			Residual length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378)  * @return None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) void bfa_cb_ioim_done(void *bfad, struct bfad_ioim_s *dio,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) 			enum bfi_ioim_status io_status,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 			u8 scsi_status, int sns_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 			u8 *sns_info, s32 residue);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386)  * I/O good completion notification.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) void bfa_cb_ioim_good_comp(void *bfad, struct bfad_ioim_s *dio);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391)  * I/O abort completion notification
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) void bfa_cb_ioim_abort(void *bfad, struct bfad_ioim_s *dio);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396)  * bfa tskim API functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) struct bfa_tskim_s *bfa_tskim_alloc(struct bfa_s *bfa,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 			struct bfad_tskim_s *dtsk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) void bfa_tskim_free(struct bfa_tskim_s *tskim);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) void bfa_tskim_start(struct bfa_tskim_s *tskim,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 			struct bfa_itnim_s *itnim, struct scsi_lun lun,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 			enum fcp_tm_cmnd tm, u8 t_secs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) void bfa_cb_tskim_done(void *bfad, struct bfad_tskim_s *dtsk,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 			enum bfi_tskim_status tsk_status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) void	bfa_fcpim_lunmask_rp_update(struct bfa_s *bfa, wwn_t lp_wwn,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 			wwn_t rp_wwn, u16 rp_tag, u8 lp_tag);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) bfa_status_t	bfa_fcpim_lunmask_update(struct bfa_s *bfa, u32 on_off);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) bfa_status_t	bfa_fcpim_lunmask_query(struct bfa_s *bfa, void *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) bfa_status_t	bfa_fcpim_lunmask_delete(struct bfa_s *bfa, u16 vf_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 				wwn_t *pwwn, wwn_t rpwwn, struct scsi_lun lun);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) bfa_status_t	bfa_fcpim_lunmask_add(struct bfa_s *bfa, u16 vf_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 				wwn_t *pwwn, wwn_t rpwwn, struct scsi_lun lun);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) bfa_status_t	bfa_fcpim_lunmask_clear(struct bfa_s *bfa);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) u16		bfa_fcpim_read_throttle(struct bfa_s *bfa);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) bfa_status_t	bfa_fcpim_write_throttle(struct bfa_s *bfa, u16 value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) bfa_status_t	bfa_fcpim_throttle_set(struct bfa_s *bfa, u16 value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) bfa_status_t	bfa_fcpim_throttle_get(struct bfa_s *bfa, void *buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) u16     bfa_fcpim_get_throttle_cfg(struct bfa_s *bfa, u16 drv_cfg_param);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) #endif /* __BFA_FCPIM_H__ */