	.file	"extr_zfcp_qdio.c_zfcp_qdio_open.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Setting up the QDIO connection to the FCP adapter failed\n"
	.text
	.p2align 4
	.globl	zfcp_qdio_open
	.type	zfcp_qdio_open, @function
zfcp_qdio_open:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rbp, QWORD PTR 8[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	lea	r14, 8[rbp]
	mov	r12, QWORD PTR 16[rbp]
	mov	rdi, r14
	call	atomic_read@PLT
	and	eax, DWORD PTR ZFCP_STATUS_ADAPTER_QDIOUP[rip]
	je	.L2
.L23:
	mov	r13d, DWORD PTR EIO[rip]
	neg	r13d
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L25
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	r13d, eax
	mov	rax, QWORD PTR 8[rbx]
	mov	edi, DWORD PTR ZFCP_STATUS_ADAPTER_SIOSL_ISSUED[rip]
	mov	r15, rsp
	lea	rsi, 8[rax]
	call	atomic_andnot@PLT
	mov	rdi, r15
	mov	rsi, rbx
	call	zfcp_qdio_setup_init_data@PLT
	mov	rdi, r15
	call	qdio_establish@PLT
	test	rax, rax
	jne	.L4
	mov	edi, DWORD PTR [rsp]
	lea	rsi, 4[rsp]
	call	qdio_get_ssqd_desc@PLT
	test	rax, rax
	jne	.L5
	mov	eax, DWORD PTR 4[rsp]
	test	DWORD PTR CHSC_AC2_DATA_DIV_ENABLED[rip], eax
	jne	.L26
.L6:
	mov	edi, DWORD PTR ZFCP_STATUS_ADAPTER_MB_ACT[rip]
	mov	rsi, r14
	test	DWORD PTR CHSC_AC2_MULTI_BUFFER_ENABLED[rip], eax
	je	.L7
	call	atomic_or@PLT
	mov	rdx, QWORD PTR QDIO_MAX_ELEMENTS_PER_BUFFER[rip]
	mov	DWORD PTR [rbx], edx
	mov	eax, edx
.L8:
	imul	eax, DWORD PTR ZFCP_QDIO_MAX_SBALS_PER_REQ[rip]
	mov	rdi, r12
	sub	eax, 2
	mov	DWORD PTR 4[rbx], eax
	call	qdio_activate@PLT
	test	rax, rax
	jne	.L5
	mov	r8d, DWORD PTR QDIO_MAX_BUFFERS_PER_Q[rip]
	test	r8d, r8d
	jle	.L12
	mov	rdx, QWORD PTR 32[rbx]
	lea	eax, -1[r8]
	mov	esi, DWORD PTR SBAL_EFLAGS_LAST_ENTRY[rip]
	lea	rcx, [rdx+rax*8]
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rax, QWORD PTR [rdx]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR 24[rax], 0
	mov	DWORD PTR 16[rax], esi
	mov	QWORD PTR 8[rax], 0
	mov	QWORD PTR [rax], 0
	mov	rax, rdx
	add	rdx, 8
	cmp	rcx, rax
	jne	.L11
.L12:
	mov	esi, DWORD PTR QDIO_FLAG_SYNC_INPUT[rip]
	xor	ecx, ecx
	xor	edx, edx
	mov	rdi, r12
	call	do_QDIO@PLT
	test	rax, rax
	jne	.L5
	mov	QWORD PTR 24[rbx], 0
	mov	esi, DWORD PTR QDIO_MAX_BUFFERS_PER_Q[rip]
	lea	rdi, 16[rbx]
	call	atomic_set@PLT
	mov	rax, QWORD PTR 8[rbx]
	mov	edi, DWORD PTR ZFCP_STATUS_ADAPTER_QDIOUP[rip]
	lea	rsi, 8[rax]
	call	atomic_or@PLT
	mov	rdx, QWORD PTR 0[rbp]
	test	rdx, rdx
	je	.L1
	mov	eax, DWORD PTR 4[rbx]
	mov	DWORD PTR [rdx], eax
	sal	eax, 3
	mov	DWORD PTR 4[rdx], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	mov	esi, DWORD PTR QDIO_FLAG_CLEANUP_USING_CLEAR[rip]
	mov	rdi, r12
	call	qdio_shutdown@PLT
.L4:
	lea	rsi, .LC0[rip]
	mov	rdi, r12
	call	dev_err@PLT
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L7:
	call	atomic_andnot@PLT
	mov	rax, QWORD PTR QDIO_MAX_ELEMENTS_PER_BUFFER[rip]
	lea	rdx, -1[rax]
	mov	DWORD PTR [rbx], edx
	mov	eax, edx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L26:
	mov	rax, QWORD PTR 8[rbx]
	mov	edi, DWORD PTR ZFCP_STATUS_ADAPTER_DATA_DIV_ENABLED[rip]
	lea	rsi, 8[rax]
	call	atomic_or@PLT
	mov	eax, DWORD PTR 4[rsp]
	jmp	.L6
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	zfcp_qdio_open, .-zfcp_qdio_open
	.comm	ZFCP_STATUS_ADAPTER_SIOSL_ISSUED,4,4
	.comm	ZFCP_STATUS_ADAPTER_QDIOUP,4,4
	.comm	ZFCP_STATUS_ADAPTER_MB_ACT,4,4
	.comm	ZFCP_STATUS_ADAPTER_DATA_DIV_ENABLED,4,4
	.comm	ZFCP_QDIO_MAX_SBALS_PER_REQ,4,4
	.comm	SBAL_EFLAGS_LAST_ENTRY,4,4
	.comm	QDIO_MAX_ELEMENTS_PER_BUFFER,8,8
	.comm	QDIO_MAX_BUFFERS_PER_Q,4,4
	.comm	QDIO_FLAG_SYNC_INPUT,4,4
	.comm	QDIO_FLAG_CLEANUP_USING_CLEAR,4,4
	.comm	EIO,4,4
	.comm	CHSC_AC2_MULTI_BUFFER_ENABLED,4,4
	.comm	CHSC_AC2_DATA_DIV_ENABLED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_zfcp_qdio.c_zfcp_qdio_open.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Setting up the QDIO connection to the FCP adapter f"
	.ascii	"ailed\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	zfcp_qdio_open
	.syntax unified
	.arm
	.fpu softvfp
	.type	zfcp_qdio_open, %function
zfcp_qdio_open:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	ldr	r6, [r0, #8]
	ldr	r3, .L27
	add	r5, r6, #4
	sub	sp, sp, #28
	mov	r4, r0
	mov	r0, r5
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	ldr	r8, [r6, #8]
	bl	atomic_read
	ldr	r7, .L27+4
	ldr	r3, [r7]
	tst	r0, r3
	beq	.L2
.L23:
	ldr	r3, .L27+8
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L1:
	ldr	r3, .L27
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L25
	mov	r0, r5
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L2:
	ldr	r3, .L27+12
	ldr	r1, [r4, #8]
	ldr	r0, [r3]
	add	r1, r1, #4
	bl	atomic_andnot
	mov	r1, r4
	add	r0, sp, #12
	bl	zfcp_qdio_setup_init_data
	add	r0, sp, #12
	bl	qdio_establish
	cmp	r0, #0
	bne	.L4
	ldr	r0, [sp, #12]
	add	r1, sp, #16
	bl	qdio_get_ssqd_desc
	cmp	r0, #0
	bne	.L5
	ldr	r2, .L27+16
	ldr	r3, [sp, #16]
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L26
.L6:
	ldr	r2, .L27+20
	ldr	r1, .L27+24
	ldr	r2, [r2]
	ldr	r0, [r1]
	tst	r3, r2
	mov	r1, r5
	beq	.L7
	bl	atomic_or
	ldr	r3, .L27+28
	ldr	r3, [r3]
	str	r3, [r4]
.L8:
	ldr	r2, .L27+32
	mov	r0, r8
	ldr	r2, [r2]
	mul	r3, r2, r3
	sub	r3, r3, #2
	str	r3, [r4, #4]
	bl	qdio_activate
	cmp	r0, #0
	bne	.L5
	ldr	r9, .L27+36
	ldr	ip, [r9]
	cmp	ip, #0
	ble	.L12
	ldr	r2, [r4, #20]
	ldr	r3, .L27+40
	add	r1, r2, ip, lsl #2
	ldr	lr, [r3]
	sub	r1, r1, #4
	sub	r2, r2, #4
.L11:
	ldr	r3, [r2, #4]!
	ldr	r3, [r3]
	cmp	r2, r1
	stmib	r3, {r0, lr}
	str	r0, [r3, #12]
	str	r0, [r3]
	bne	.L11
.L12:
	mov	r3, #0
	ldr	r1, .L27+44
	str	ip, [sp]
	mov	r2, r3
	mov	r0, r8
	ldr	r1, [r1]
	bl	do_QDIO
	subs	r5, r0, #0
	bne	.L5
	ldr	r1, [r9]
	str	r5, [r4, #16]
	add	r0, r4, #12
	bl	atomic_set
	ldr	r1, [r4, #8]
	ldr	r0, [r7]
	add	r1, r1, #4
	bl	atomic_or
	ldr	r3, [r6]
	cmp	r3, #0
	ldrne	r2, [r4, #4]
	lslne	r1, r2, #3
	strne	r2, [r3]
	strne	r1, [r3, #4]
	b	.L1
.L5:
	ldr	r3, .L27+48
	mov	r0, r8
	ldr	r1, [r3]
	bl	qdio_shutdown
.L4:
	mov	r0, r8
	ldr	r1, .L27+52
	bl	dev_err
	b	.L23
.L7:
	bl	atomic_andnot
	ldr	r3, .L27+28
	ldr	r3, [r3]
	sub	r3, r3, #1
	str	r3, [r4]
	b	.L8
.L26:
	ldr	r3, .L27+56
	ldr	r1, [r4, #8]
	ldr	r0, [r3]
	add	r1, r1, #4
	bl	atomic_or
	ldr	r3, [sp, #16]
	b	.L6
.L25:
	bl	__stack_chk_fail
.L28:
	.align	2
.L27:
	.word	.LC1
	.word	ZFCP_STATUS_ADAPTER_QDIOUP
	.word	EIO
	.word	ZFCP_STATUS_ADAPTER_SIOSL_ISSUED
	.word	CHSC_AC2_DATA_DIV_ENABLED
	.word	CHSC_AC2_MULTI_BUFFER_ENABLED
	.word	ZFCP_STATUS_ADAPTER_MB_ACT
	.word	QDIO_MAX_ELEMENTS_PER_BUFFER
	.word	ZFCP_QDIO_MAX_SBALS_PER_REQ
	.word	QDIO_MAX_BUFFERS_PER_Q
	.word	SBAL_EFLAGS_LAST_ENTRY
	.word	QDIO_FLAG_SYNC_INPUT
	.word	QDIO_FLAG_CLEANUP_USING_CLEAR
	.word	.LC0
	.word	ZFCP_STATUS_ADAPTER_DATA_DIV_ENABLED
	.size	zfcp_qdio_open, .-zfcp_qdio_open
	.comm	ZFCP_STATUS_ADAPTER_SIOSL_ISSUED,4,4
	.comm	ZFCP_STATUS_ADAPTER_QDIOUP,4,4
	.comm	ZFCP_STATUS_ADAPTER_MB_ACT,4,4
	.comm	ZFCP_STATUS_ADAPTER_DATA_DIV_ENABLED,4,4
	.comm	ZFCP_QDIO_MAX_SBALS_PER_REQ,4,4
	.comm	SBAL_EFLAGS_LAST_ENTRY,4,4
	.comm	QDIO_MAX_ELEMENTS_PER_BUFFER,4,4
	.comm	QDIO_MAX_BUFFERS_PER_Q,4,4
	.comm	QDIO_FLAG_SYNC_INPUT,4,4
	.comm	QDIO_FLAG_CLEANUP_USING_CLEAR,4,4
	.comm	EIO,4,4
	.comm	CHSC_AC2_MULTI_BUFFER_ENABLED,4,4
	.comm	CHSC_AC2_DATA_DIV_ENABLED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
