	.file	"extr_bnad.c_bnad_enable_msix.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"%d MSI-X vectors allocated < %d requested\n"
	.align 8
.LC1:
	.string	"MSI-X enable failed - operating in INTx mode\n"
	.text
	.p2align 4
	.type	bnad_enable_msix, @function
bnad_enable_msix:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	lea	r13, 8[rdi]
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xor	r12d, r12d
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rsi, r12
	mov	rbp, rdi
	mov	rdi, r13
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	spin_lock_irqsave@PLT
	mov	eax, DWORD PTR 0[rbp]
	test	DWORD PTR BNAD_CF_MSIX[rip], eax
	je	.L19
	xor	r12d, r12d
	mov	rdi, r13
	mov	rsi, r12
	call	spin_unlock_irqrestore@PLT
	cmp	QWORD PTR 16[rbp], 0
	je	.L21
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.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
.L21:
	.cfi_restore_state
	mov	edi, DWORD PTR 4[rbp]
	mov	edx, DWORD PTR GFP_KERNEL[rip]
	mov	esi, 4
	call	kcalloc@PLT
	mov	QWORD PTR 16[rbp], rax
	mov	rsi, rax
	test	rax, rax
	je	.L11
	mov	r8d, DWORD PTR 4[rbp]
	xor	edx, edx
	lea	eax, -1[r8]
	test	r8d, r8d
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rcx, rdx
	mov	DWORD PTR [rsi+rdx*4], edx
	add	rdx, 1
	cmp	rax, rcx
	jne	.L7
.L8:
	mov	rdi, QWORD PTR 24[rbp]
	mov	ecx, r8d
	mov	edx, 1
	call	pci_enable_msix_range@PLT
	mov	ebx, eax
	test	eax, eax
	js	.L11
	mov	ecx, DWORD PTR 4[rbp]
	mov	rdi, QWORD PTR 24[rbp]
	cmp	ecx, eax
	jle	.L9
	mov	edx, eax
	lea	rsi, .LC0[rip]
	xor	r12d, r12d
	xor	eax, eax
	call	dev_warn@PLT
	mov	rsi, r12
	mov	rdi, r13
	call	spin_lock_irqsave@PLT
	mov	eax, ebx
	sub	eax, DWORD PTR BNAD_MAILBOX_MSIX_VECTORS[rip]
	mov	rdi, rbp
	mov	esi, eax
	shr	esi, 31
	add	esi, eax
	sar	esi
	mov	edx, esi
	call	bnad_q_num_adjust@PLT
	mov	rdi, r13
	mov	rsi, r12
	call	spin_unlock_irqrestore@PLT
	mov	eax, DWORD PTR BNAD_NUM_RXP[rip]
	mov	rdi, QWORD PTR 24[rbp]
	add	eax, DWORD PTR BNAD_NUM_TXQ[rip]
	add	eax, DWORD PTR BNAD_MAILBOX_MSIX_VECTORS[rip]
	mov	DWORD PTR 4[rbp], eax
	cmp	eax, ebx
	jle	.L9
	call	pci_disable_msix@PLT
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rdi, QWORD PTR 24[rbp]
	lea	rsi, .LC1[rip]
	xor	eax, eax
	xor	r12d, r12d
	call	dev_warn@PLT
	mov	rdi, QWORD PTR 16[rbp]
	call	kfree@PLT
	mov	QWORD PTR 16[rbp], 0
	mov	rdi, r13
	mov	rsi, r12
	mov	DWORD PTR 4[rbp], 0
	call	spin_lock_irqsave@PLT
	mov	eax, DWORD PTR BNAD_CF_MSIX[rip]
	mov	rdi, rbp
	not	eax
	and	DWORD PTR 0[rbp], eax
	call	bnad_q_num_init@PLT
.L19:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rsi, r12
	mov	rdi, r13
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	spin_unlock_irqrestore@PLT
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	add	rsp, 8
	.cfi_def_cfa_offset 40
	xor	esi, esi
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	pci_intx@PLT
	.cfi_endproc
.LFE0:
	.size	bnad_enable_msix, .-bnad_enable_msix
	.comm	GFP_KERNEL,4,4
	.comm	BNAD_NUM_TXQ,4,4
	.comm	BNAD_NUM_RXP,4,4
	.comm	BNAD_MAILBOX_MSIX_VECTORS,4,4
	.comm	BNAD_CF_MSIX,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_bnad.c_bnad_enable_msix.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%d MSI-X vectors allocated < %d requested\012\000"
	.align	2
.LC1:
	.ascii	"MSI-X enable failed - operating in INTx mode\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bnad_enable_msix, %function
bnad_enable_msix:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r0
	ldr	r7, .L20
	add	r6, r0, #8
	mov	r0, r6
	mov	r1, #0
	bl	spin_lock_irqsave
	ldr	r2, [r4]
	ldr	r3, [r7]
	tst	r2, r3
	beq	.L19
	mov	r1, #0
	mov	r0, r6
	bl	spin_unlock_irqrestore
	ldr	r5, [r4, #12]
	cmp	r5, #0
	popne	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r3, .L20+4
	mov	r1, #4
	ldr	r2, [r3]
	ldr	r0, [r4, #4]
	bl	kcalloc
	cmp	r0, #0
	mov	r1, r0
	str	r0, [r4, #12]
	beq	.L11
	ldr	r3, [r4, #4]
	cmp	r3, #0
	movgt	r2, r5
	subgt	ip, r0, #4
	ble	.L8
.L7:
	str	r2, [ip, #4]!
	add	r2, r2, #1
	cmp	r2, r3
	bne	.L7
.L8:
	mov	r2, #1
	ldr	r0, [r4, #16]
	bl	pci_enable_msix_range
	subs	r5, r0, #0
	blt	.L11
	ldr	r3, [r4, #4]
	ldr	r0, [r4, #16]
	cmp	r3, r5
	ble	.L9
	mov	r8, #0
	mov	r2, r5
	ldr	r1, .L20+8
	ldr	r9, .L20+12
	bl	dev_warn
	mov	r1, r8
	mov	r0, r6
	bl	spin_lock_irqsave
	ldr	r2, [r9]
	mov	r0, r4
	sub	r2, r5, r2
	add	r2, r2, r2, lsr #31
	asr	r2, r2, #1
	mov	r1, r2
	bl	bnad_q_num_adjust
	mov	r1, r8
	mov	r0, r6
	bl	spin_unlock_irqrestore
	ldr	r2, .L20+16
	ldr	r3, .L20+20
	ldr	r1, [r2]
	ldr	r3, [r3]
	ldr	r2, [r9]
	add	r3, r3, r1
	add	r3, r3, r2
	cmp	r3, r5
	ldr	r0, [r4, #16]
	str	r3, [r4, #4]
	bgt	.L10
.L9:
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r1, #0
	b	pci_intx
.L19:
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r1, #0
	b	spin_unlock_irqrestore
.L10:
	bl	pci_disable_msix
.L11:
	mov	r8, #0
	ldr	r1, .L20+24
	ldr	r0, [r4, #16]
	bl	dev_warn
	ldr	r0, [r4, #12]
	bl	kfree
	mov	r1, r8
	mov	r0, r6
	str	r8, [r4, #12]
	str	r8, [r4, #4]
	bl	spin_lock_irqsave
	ldr	r2, [r7]
	ldr	r3, [r4]
	mov	r0, r4
	bic	r3, r3, r2
	str	r3, [r4]
	bl	bnad_q_num_init
	mov	r1, r8
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	spin_unlock_irqrestore
.L21:
	.align	2
.L20:
	.word	BNAD_CF_MSIX
	.word	GFP_KERNEL
	.word	.LC0
	.word	BNAD_MAILBOX_MSIX_VECTORS
	.word	BNAD_NUM_RXP
	.word	BNAD_NUM_TXQ
	.word	.LC1
	.size	bnad_enable_msix, .-bnad_enable_msix
	.comm	GFP_KERNEL,4,4
	.comm	BNAD_NUM_TXQ,4,4
	.comm	BNAD_NUM_RXP,4,4
	.comm	BNAD_MAILBOX_MSIX_VECTORS,4,4
	.comm	BNAD_CF_MSIX,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
