	.file	"extr_bnx2i_iscsi.c_bnx2i_alloc_hba.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	bnx2i_alloc_hba
	.type	bnx2i_alloc_hba, @function
bnx2i_alloc_hba:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xor	edx, edx
	mov	r13, rdi
	mov	esi, 152
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	lea	rdi, bnx2i_host_template[rip]
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	call	iscsi_host_alloc@PLT
	test	rax, rax
	je	.L16
	mov	rbp, rax
	mov	rax, QWORD PTR 0[r13]
	mov	rdi, rbp
	mov	eax, DWORD PTR 24[rax]
	mov	QWORD PTR 8[rbp], 0
	mov	DWORD PTR 28[rbp], eax
	mov	eax, DWORD PTR bnx2i_scsi_xport_template[rip]
	mov	DWORD PTR 24[rbp], eax
	mov	rax, QWORD PTR ISCSI_MAX_CONNS_PER_HBA[rip]
	mov	QWORD PTR 16[rbp], rax
	movabs	rax, 68719477248
	mov	QWORD PTR 0[rbp], rax
	call	iscsi_host_priv@PLT
	mov	rdi, QWORD PTR 0[r13]
	mov	r12, rax
	mov	QWORD PTR 144[rax], rbp
	mov	eax, DWORD PTR 8[r13]
	mov	QWORD PTR 32[r12], rdi
	mov	DWORD PTR 136[r12], eax
	call	pci_dev_get@PLT
	mov	rax, QWORD PTR 32[r12]
	mov	edx, DWORD PTR 20[rax]
	mov	edi, DWORD PTR 4[rax]
	mov	DWORD PTR 132[r12], edx
	mov	edx, DWORD PTR 16[rax]
	mov	DWORD PTR 128[r12], edx
	mov	edx, DWORD PTR 12[rax]
	mov	DWORD PTR 124[r12], edx
	mov	edx, DWORD PTR 8[rax]
	mov	DWORD PTR 120[r12], edx
	call	PCI_FUNC@PLT
	mov	DWORD PTR 116[r12], eax
	mov	rax, QWORD PTR 32[r12]
	mov	edi, DWORD PTR 4[rax]
	call	PCI_SLOT@PLT
	mov	rsi, r13
	mov	rdi, r12
	lea	r13, 56[r12]
	mov	DWORD PTR 112[r12], eax
	call	bnx2i_identify_device@PLT
	mov	rsi, rbp
	mov	rdi, r12
	call	bnx2i_setup_host_queue_size@PLT
	mov	rdi, QWORD PTR 32[r12]
	xor	esi, esi
	call	pci_resource_start@PLT
	mov	edi, DWORD PTR BNX2I_NX2_DEV_5709[rip]
	mov	rsi, r13
	mov	DWORD PTR 108[r12], eax
	call	test_bit@PLT
	test	rax, rax
	jne	.L39
	mov	edi, DWORD PTR BNX2I_NX2_DEV_57710[rip]
	mov	rsi, r13
	call	test_bit@PLT
	test	rax, rax
	jne	.L40
.L4:
	mov	rdi, r12
	call	bnx2i_setup_mp_bdt@PLT
	test	rax, rax
	jne	.L6
	lea	rdi, 104[r12]
	call	INIT_LIST_HEAD@PLT
	lea	rdi, 100[r12]
	call	INIT_LIST_HEAD@PLT
	lea	rdi, 96[r12]
	call	INIT_LIST_HEAD@PLT
	lea	rdi, 92[r12]
	call	rwlock_init@PLT
	mov	eax, DWORD PTR BNX2I_MAX_MTU_SUPPORTED[rip]
	mov	rdi, r12
	mov	DWORD PTR 88[r12], eax
	mov	rax, QWORD PTR ISCSI_MAX_CONNS_PER_HBA[rip]
	mov	QWORD PTR 80[r12], rax
	call	bnx2i_setup_free_cid_que@PLT
	test	rax, rax
	jne	.L7
	mov	edi, DWORD PTR BNX2I_NX2_DEV_57710[rip]
	mov	rsi, r13
	call	test_bit@PLT
	test	rax, rax
	mov	rax, QWORD PTR sq_size[rip]
	je	.L8
	test	rax, rax
	je	.L9
	cmp	rax, QWORD PTR BNX2I_5770X_SQ_WQES_MAX[rip]
	jle	.L33
.L9:
	movsx	rdx, DWORD PTR BNX2I_5770X_SQ_WQES_DEFAULT[rip]
	mov	DWORD PTR [r12], edx
.L10:
	mov	rax, QWORD PTR rq_size[rip]
	mov	edi, DWORD PTR BNX2I_NX2_DEV_57710[rip]
	mov	rsi, r13
	mov	QWORD PTR 72[r12], rax
	add	rax, rdx
	mov	QWORD PTR 8[r12], rax
	call	test_bit@PLT
	test	rax, rax
	je	.L12
	mov	rax, QWORD PTR BNX2I_5770X_CQ_WQES_MAX[rip]
	cmp	QWORD PTR 8[r12], rax
	jle	.L13
.L34:
	mov	QWORD PTR 8[r12], rax
.L13:
	mov	edx, DWORD PTR [r12]
	lea	rdi, 68[r12]
	mov	eax, edx
	shr	eax, 31
	add	eax, edx
	sar	eax
	mov	DWORD PTR 16[r12], eax
	call	spin_lock_init@PLT
	lea	rdi, 64[r12]
	call	mutex_init@PLT
	lea	rdi, 60[r12]
	call	init_waitqueue_head@PLT
	mov	edi, DWORD PTR BNX2I_NX2_DEV_57710[rip]
	mov	rsi, r13
	call	test_bit@PLT
	test	rax, rax
	mov	eax, DWORD PTR HZ[rip]
	je	.L14
	imul	edx, eax, 30
	mov	DWORD PTR 20[r12], edx
	lea	edx, [rax+rax*4]
	lea	eax, [rax+rax*2]
	sal	edx, 2
	add	eax, eax
	mov	DWORD PTR 24[r12], edx
	mov	DWORD PTR 28[r12], eax
.L15:
	xor	esi, esi
	lea	rdi, 48[r12]
	mov	edx, 4
	call	memset@PLT
	mov	rsi, QWORD PTR 32[r12]
	mov	rdi, rbp
	call	iscsi_host_add@PLT
	test	rax, rax
	je	.L1
	mov	rdi, r12
	call	bnx2i_release_free_cid_que@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdi, r12
	call	bnx2i_free_mp_bdt@PLT
.L6:
	mov	rsi, QWORD PTR 40[r12]
	mov	rdi, QWORD PTR 32[r12]
	test	rsi, rsi
	je	.L5
	call	pci_iounmap@PLT
	mov	QWORD PTR 40[r12], 0
.L35:
	mov	rdi, QWORD PTR 32[r12]
.L5:
	call	pci_dev_put@PLT
	mov	rdi, rbp
	xor	r12d, r12d
	call	scsi_host_put@PLT
.L1:
	mov	rax, r12
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L39:
	.cfi_restore_state
	mov	rdi, QWORD PTR 32[r12]
	mov	edx, DWORD PTR BNX2_MQ_CONFIG2[rip]
.L37:
	xor	esi, esi
	call	pci_iomap@PLT
	mov	QWORD PTR 40[r12], rax
	test	rax, rax
	jne	.L4
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L8:
	test	rax, rax
	je	.L11
	cmp	rax, QWORD PTR BNX2I_570X_SQ_WQES_MAX[rip]
	jg	.L11
.L33:
	mov	DWORD PTR [r12], eax
	movsx	rdx, eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movsx	rdx, DWORD PTR BNX2I_570X_SQ_WQES_DEFAULT[rip]
	mov	DWORD PTR [r12], edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rax, QWORD PTR BNX2I_570X_CQ_WQES_MAX[rip]
	cmp	QWORD PTR 8[r12], rax
	jle	.L13
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L14:
	lea	edx, [rax+rax*4]
	add	eax, eax
	lea	ecx, 0[0+rdx*4]
	add	edx, edx
	mov	DWORD PTR 28[r12], eax
	mov	DWORD PTR 20[r12], ecx
	mov	DWORD PTR 24[r12], edx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L16:
	xor	r12d, r12d
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rax, r12
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L40:
	.cfi_restore_state
	mov	rdi, QWORD PTR 32[r12]
	mov	edx, 4096
	jmp	.L37
	.cfi_endproc
.LFE0:
	.size	bnx2i_alloc_hba, .-bnx2i_alloc_hba
	.comm	sq_size,8,8
	.comm	rq_size,8,8
	.comm	bnx2i_scsi_xport_template,4,4
	.comm	bnx2i_host_template,4,4
	.comm	ISCSI_MAX_CONNS_PER_HBA,8,8
	.comm	HZ,4,4
	.comm	BNX2_MQ_CONFIG2,4,4
	.comm	BNX2I_NX2_DEV_57710,4,4
	.comm	BNX2I_NX2_DEV_5709,4,4
	.comm	BNX2I_MAX_MTU_SUPPORTED,4,4
	.comm	BNX2I_5770X_SQ_WQES_MAX,8,8
	.comm	BNX2I_5770X_SQ_WQES_DEFAULT,4,4
	.comm	BNX2I_5770X_CQ_WQES_MAX,8,8
	.comm	BNX2I_570X_SQ_WQES_MAX,8,8
	.comm	BNX2I_570X_SQ_WQES_DEFAULT,4,4
	.comm	BNX2I_570X_CQ_WQES_MAX,8,8
	.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_bnx2i_iscsi.c_bnx2i_alloc_hba.c"
	.text
	.align	2
	.global	bnx2i_alloc_hba
	.syntax unified
	.arm
	.fpu softvfp
	.type	bnx2i_alloc_hba, %function
bnx2i_alloc_hba:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r2, #0
	mov	r6, r0
	mov	r1, #120
	ldr	r0, .L40
	bl	iscsi_host_alloc
	subs	r5, r0, #0
	moveq	r4, r5
	beq	.L1
	mov	r2, #512
	mov	r3, #16
	mov	r9, #0
	ldr	r1, .L40+4
	ldr	ip, [r6]
	ldr	r1, [r1]
	ldr	r8, .L40+8
	ldr	ip, [ip, #24]
	str	r1, [r5, #16]
	ldr	r1, [r8]
	str	ip, [r5, #20]
	stm	r5, {r2, r3}
	str	r1, [r5, #12]
	str	r9, [r5, #8]
	bl	iscsi_host_priv
	mov	r4, r0
	ldm	r6, {r0, r3}
	str	r5, [r4, #116]
	str	r3, [r4, #112]
	str	r0, [r4, #24]
	bl	pci_dev_get
	ldr	r3, [r4, #24]
	add	r7, r4, #40
	ldr	r1, [r3, #20]
	ldr	r2, [r3, #16]
	str	r1, [r4, #108]
	str	r2, [r4, #104]
	ldr	r1, [r3, #12]
	ldr	r2, [r3, #8]
	ldr	r0, [r3, #4]
	str	r2, [r4, #96]
	str	r1, [r4, #100]
	bl	PCI_FUNC
	ldr	r3, [r4, #24]
	str	r0, [r4, #92]
	ldr	r0, [r3, #4]
	bl	PCI_SLOT
	mov	r1, r6
	str	r0, [r4, #88]
	mov	r0, r4
	bl	bnx2i_identify_device
	mov	r1, r5
	mov	r0, r4
	bl	bnx2i_setup_host_queue_size
	mov	r1, r9
	ldr	r0, [r4, #24]
	bl	pci_resource_start
	ldr	r3, .L40+12
	str	r0, [r4, #84]
	mov	r1, r7
	ldr	r0, [r3]
	bl	test_bit
	subs	r6, r0, #0
	bne	.L37
	ldr	r3, .L40+16
	mov	r1, r7
	ldr	r0, [r3]
	bl	test_bit
	cmp	r0, #0
	bne	.L38
.L4:
	mov	r0, r4
	bl	bnx2i_setup_mp_bdt
	cmp	r0, #0
	bne	.L6
	add	r0, r4, #80
	bl	INIT_LIST_HEAD
	add	r0, r4, #76
	bl	INIT_LIST_HEAD
	add	r0, r4, #72
	bl	INIT_LIST_HEAD
	add	r0, r4, #68
	bl	rwlock_init
	ldr	r3, .L40+20
	ldr	r2, [r8]
	ldr	r3, [r3]
	mov	r0, r4
	str	r2, [r4, #60]
	str	r3, [r4, #64]
	bl	bnx2i_setup_free_cid_que
	cmp	r0, #0
	bne	.L7
	ldr	r6, .L40+16
	mov	r1, r7
	ldr	r0, [r6]
	bl	test_bit
	ldr	r3, .L40+24
	cmp	r0, #0
	ldr	r3, [r3]
	beq	.L8
	cmp	r3, #0
	beq	.L9
	ldr	r2, .L40+28
	ldr	r2, [r2]
	cmp	r3, r2
	bgt	.L9
.L33:
	str	r3, [r4]
.L10:
	ldr	r2, .L40+32
	mov	r1, r7
	ldr	r2, [r2]
	ldr	r0, [r6]
	add	r3, r2, r3
	str	r3, [r4, #4]
	str	r2, [r4, #56]
	bl	test_bit
	cmp	r0, #0
	beq	.L12
	ldr	r3, .L40+36
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	ble	.L13
.L34:
	str	r3, [r4, #4]
.L13:
	ldr	r3, [r4]
	add	r0, r4, #52
	add	r3, r3, r3, lsr #31
	asr	r3, r3, #1
	str	r3, [r4, #8]
	bl	spin_lock_init
	add	r0, r4, #48
	bl	mutex_init
	add	r0, r4, #44
	bl	init_waitqueue_head
	mov	r1, r7
	ldr	r0, [r6]
	bl	test_bit
	ldr	r3, .L40+40
	cmp	r0, #0
	ldr	r3, [r3]
	beq	.L14
	rsb	r1, r3, r3, lsl #4
	add	r2, r3, r3, lsl #2
	add	r3, r3, r3, lsl #1
	lsl	r1, r1, #1
	lsl	r2, r2, #2
	lsl	r3, r3, #1
	str	r1, [r4, #12]
	str	r2, [r4, #16]
	str	r3, [r4, #20]
.L15:
	mov	r2, #0
	mov	r0, r5
	ldr	r1, [r4, #24]
	strb	r2, [r4, #32]
	strb	r2, [r4, #33]
	strb	r2, [r4, #34]
	strb	r2, [r4, #35]
	bl	iscsi_host_add
	cmp	r0, #0
	bne	.L39
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L37:
	ldr	r3, .L40+44
	mov	r1, r9
	ldr	r2, [r3]
	ldr	r0, [r4, #24]
	bl	pci_iomap
	cmp	r0, r9
	str	r0, [r4, #28]
	bne	.L4
.L35:
	ldr	r0, [r4, #24]
	b	.L5
.L39:
	mov	r0, r4
	bl	bnx2i_release_free_cid_que
.L7:
	mov	r0, r4
	bl	bnx2i_free_mp_bdt
.L6:
	ldr	r1, [r4, #28]
	ldr	r0, [r4, #24]
	cmp	r1, #0
	beq	.L5
	bl	pci_iounmap
	mov	r3, #0
	ldr	r0, [r4, #24]
	str	r3, [r4, #28]
.L5:
	mov	r4, #0
	bl	pci_dev_put
	mov	r0, r5
	bl	scsi_host_put
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L8:
	cmp	r3, #0
	beq	.L11
	ldr	r2, .L40+48
	ldr	r2, [r2]
	cmp	r3, r2
	ble	.L33
.L11:
	ldr	r3, .L40+52
	ldr	r3, [r3]
	b	.L33
.L9:
	ldr	r3, .L40+56
	ldr	r3, [r3]
	str	r3, [r4]
	b	.L10
.L12:
	ldr	r3, .L40+60
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	ble	.L13
	b	.L34
.L14:
	add	r2, r3, r3, lsl #2
	lsl	r1, r2, #2
	lsl	r3, r3, #1
	lsl	r2, r2, #1
	str	r3, [r4, #20]
	str	r1, [r4, #12]
	str	r2, [r4, #16]
	b	.L15
.L38:
	mov	r1, r6
	mov	r2, #4096
	ldr	r0, [r4, #24]
	bl	pci_iomap
	cmp	r0, #0
	str	r0, [r4, #28]
	bne	.L4
	b	.L35
.L41:
	.align	2
.L40:
	.word	bnx2i_host_template
	.word	bnx2i_scsi_xport_template
	.word	ISCSI_MAX_CONNS_PER_HBA
	.word	BNX2I_NX2_DEV_5709
	.word	BNX2I_NX2_DEV_57710
	.word	BNX2I_MAX_MTU_SUPPORTED
	.word	sq_size
	.word	BNX2I_5770X_SQ_WQES_MAX
	.word	rq_size
	.word	BNX2I_5770X_CQ_WQES_MAX
	.word	HZ
	.word	BNX2_MQ_CONFIG2
	.word	BNX2I_570X_SQ_WQES_MAX
	.word	BNX2I_570X_SQ_WQES_DEFAULT
	.word	BNX2I_5770X_SQ_WQES_DEFAULT
	.word	BNX2I_570X_CQ_WQES_MAX
	.size	bnx2i_alloc_hba, .-bnx2i_alloc_hba
	.comm	sq_size,4,4
	.comm	rq_size,4,4
	.comm	bnx2i_scsi_xport_template,4,4
	.comm	bnx2i_host_template,4,4
	.comm	ISCSI_MAX_CONNS_PER_HBA,4,4
	.comm	HZ,4,4
	.comm	BNX2_MQ_CONFIG2,4,4
	.comm	BNX2I_NX2_DEV_57710,4,4
	.comm	BNX2I_NX2_DEV_5709,4,4
	.comm	BNX2I_MAX_MTU_SUPPORTED,4,4
	.comm	BNX2I_5770X_SQ_WQES_MAX,4,4
	.comm	BNX2I_5770X_SQ_WQES_DEFAULT,4,4
	.comm	BNX2I_5770X_CQ_WQES_MAX,4,4
	.comm	BNX2I_570X_SQ_WQES_MAX,4,4
	.comm	BNX2I_570X_SQ_WQES_DEFAULT,4,4
	.comm	BNX2I_570X_CQ_WQES_MAX,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
