src/dpdk/drivers/net/ice/base/ice_common.c
enum ice_status
ice_set_ctx(struct ice_hw *hw, u8 *src_ctx, u8 *dest_ctx,
	    const struct ice_ctx_ele *ce_info)
{
	int f;

	for (f = 0; ce_info[f].width; f++) {
		/* We have to deal with each element of the FW response
		 * using the correct size so that we are correct regardless
		 * of the endianness of the machine.
		 */
		if (ce_info[f].width > (ce_info[f].size_of * BITS_PER_BYTE)) {
			ice_debug(hw, ICE_DBG_QCTX, "Field %d width of %d bits larger than size of %d byte(s) ... skipping write\n",
				  f, ce_info[f].width, ce_info[f].size_of);
			continue;
		}
		switch (ce_info[f].size_of) {
		case sizeof(u8):
			ice_write_byte(src_ctx, dest_ctx, &ce_info[f]);
			break;
		case sizeof(u16):
			ice_write_word(src_ctx, dest_ctx, &ce_info[f]);
			break;
		case sizeof(u32):
			ice_write_dword(src_ctx, dest_ctx, &ce_info[f]);
			break;
		case sizeof(u64):
			ice_write_qword(src_ctx, dest_ctx, &ce_info[f]);
			break;
		default:
			return ICE_ERR_INVAL_SIZE;
		}
	}

	return ICE_SUCCESS;
}
/**
 * ice_set_ctx - set context bits in packed structure
 * @hw: pointer to the hardware structure
 * @src_ctx:  pointer to a generic non-packed context structure
 * @dest_ctx: pointer to memory for the packed structure
 * @ce_info:  a description of the structure to be transformed
 */
set context bits in packed structure
@hw: pointer to the hardware structure
@src_ctx:  pointer to a generic non-packed context structure
@dest_ctx: pointer to memory for the packed structure
@ce_info:  a description of the structure to be transformed
set context bits in packed structure @hw : pointer to the hardware structure @src_ctx : pointer to a generic non - packed context structure @dest_ctx : pointer to memory for the packed structure @ce_info : a description of the structure to be transformed
enum ice_status
ice_set_ctx(struct ice_hw *hw, u8 *src_ctx, u8 *dest_ctx,
	    const struct ice_ctx_ele *ce_info)
{
	int f;
	for (f = 0; ce_info[f].width; f++) {
		if (ce_info[f].width > (ce_info[f].size_of * BITS_PER_BYTE)) {
			ice_debug(hw, ICE_DBG_QCTX, "Field %d width of %d bits larger than size of %d byte(s) ... skipping write\n",
				  f, ce_info[f].width, ce_info[f].size_of);
			continue;
		}
		switch (ce_info[f].size_of) {
		case sizeof(u8):
			ice_write_byte(src_ctx, dest_ctx, &ce_info[f]);
			break;
		case sizeof(u16):
			ice_write_word(src_ctx, dest_ctx, &ce_info[f]);
			break;
		case sizeof(u32):
			ice_write_dword(src_ctx, dest_ctx, &ce_info[f]);
			break;
		case sizeof(u64):
			ice_write_qword(src_ctx, dest_ctx, &ce_info[f]);
			break;
		default:
			return ICE_ERR_INVAL_SIZE;
		}
	}
	return ICE_SUCCESS;
}
enum ice_status ice_set_ctx ( struct ice_hw * hw , u8 * src_ctx , u8 * dest_ctx , const struct ice_ctx_ele * ce_info ) { int f ; for ( f = 0 ; ce_info [ f ] . width ; f ++ ) { if ( ce_info [ f ] . width > ( ce_info [ f ] . size_of * BITS_PER_BYTE ) ) { ice_debug ( hw , ICE_DBG_QCTX , " \n " , f , ce_info [ f ] . width , ce_info [ f ] . size_of ) ; continue ; } switch ( ce_info [ f ] . size_of ) { case sizeof ( u8 ) : ice_write_byte ( src_ctx , dest_ctx , & ce_info [ f ] ) ; break ; case sizeof ( u16 ) : ice_write_word ( src_ctx , dest_ctx , & ce_info [ f ] ) ; break ; case sizeof ( u32 ) : ice_write_dword ( src_ctx , dest_ctx , & ce_info [ f ] ) ; break ; case sizeof ( u64 ) : ice_write_qword ( src_ctx , dest_ctx , & ce_info [ f ] ) ; break ; default : return ICE_ERR_INVAL_SIZE ; } } return ICE_SUCCESS ; }
ice_set_ctx - set context bits in packed structure
 @hw: pointer to the hardware structure
 @src_ctx:  pointer to a generic non-packed context structure
 @dest_ctx: pointer to memory for the packed structure
 @ce_info:  a description of the structure to be transformed
ice_set_ctx - set context bits in packed structure @hw : pointer to the hardware structure @src_ctx : pointer to a generic non - packed context structure @dest_ctx : pointer to memory for the packed structure @ce_info : a description of the structure to be transformed
/* We have to deal with each element of the FW response
		 * using the correct size so that we are correct regardless
		 * of the endianness of the machine.
		 */