	.file	"extr_dma.c_b43_setup_dmaring.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"TXHDR DMA allocation failed\n"
	.text
	.p2align 4
	.type	b43_setup_dmaring, @function
b43_setup_dmaring:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14d, edx
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13d, esi
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	ebp, ecx
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rdi
	mov	edi, 88
	call	kzalloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L1
	mov	edi, DWORD PTR B43_RXRING_SLOTS[rip]
	mov	DWORD PTR [rax], edi
	test	r14d, r14d
	jne	.L40
.L3:
	mov	edx, DWORD PTR GFP_KERNEL[rip]
	mov	esi, 4
	call	kcalloc@PLT
	mov	QWORD PTR 24[r12], rax
	test	rax, rax
	je	.L4
	mov	edx, DWORD PTR [r12]
	test	edx, edx
	jle	.L5
	mov	edx, DWORD PTR B43_DMA_PTR_POISON[rip]
	mov	DWORD PTR 80[rax], edx
.L5:
	mov	DWORD PTR 4[r12], ebp
	mov	esi, r13d
	mov	edi, ebp
	mov	QWORD PTR 72[r12], rbx
	call	b43_dmacontroller_base@PLT
	cmp	DWORD PTR B43_DMA_64BIT[rip], ebp
	mov	DWORD PTR 8[r12], r13d
	lea	rdx, dma32_ops[rip]
	mov	DWORD PTR 64[r12], eax
	lea	rax, dma64_ops[rip]
	cmovne	rax, rdx
	mov	QWORD PTR 56[r12], rax
	test	r14d, r14d
	je	.L7
	movabs	rax, -4294967295
	xor	edi, edi
	mov	QWORD PTR 12[r12], rax
	mov	eax, DWORD PTR B43_TXRING_SLOTS[rip]
	cdq
	idiv	DWORD PTR TX_SLOTS_PER_FRAME[rip]
	test	edx, edx
	setne	dil
	call	BUILD_BUG_ON@PLT
	mov	rdi, rbx
	mov	r13d, DWORD PTR GFP_KERNEL[rip]
	call	b43_txhdr_size@PLT
	mov	esi, eax
	mov	eax, DWORD PTR [r12]
	cdq
	idiv	DWORD PTR TX_SLOTS_PER_FRAME[rip]
	mov	edx, r13d
	mov	edi, eax
	call	kcalloc@PLT
	mov	QWORD PTR 32[r12], rax
	test	rax, rax
	je	.L9
	mov	rdi, rbx
	mov	r13d, DWORD PTR DMA_TO_DEVICE[rip]
	call	b43_txhdr_size@PLT
	mov	rsi, QWORD PTR 32[r12]
	mov	edx, eax
	mov	rax, QWORD PTR [rbx]
	mov	ecx, r13d
	mov	edi, DWORD PTR [rax]
	call	dma_map_single@PLT
	mov	rdi, rbx
	mov	ebp, eax
	call	b43_txhdr_size@PLT
	mov	ecx, 1
	mov	esi, ebp
	mov	rdi, r12
	mov	edx, eax
	call	b43_dma_mapping_error@PLT
	test	rax, rax
	je	.L13
	mov	rdi, QWORD PTR 32[r12]
	call	kfree@PLT
	mov	rdi, rbx
	mov	r13d, DWORD PTR GFP_KERNEL[rip]
	or	r13d, DWORD PTR GFP_DMA[rip]
	call	b43_txhdr_size@PLT
	mov	esi, eax
	mov	eax, DWORD PTR [r12]
	cdq
	idiv	DWORD PTR TX_SLOTS_PER_FRAME[rip]
	mov	edx, r13d
	mov	edi, eax
	call	kcalloc@PLT
	mov	QWORD PTR 32[r12], rax
	test	rax, rax
	je	.L9
	mov	rdi, rbx
	mov	r13d, DWORD PTR DMA_TO_DEVICE[rip]
	call	b43_txhdr_size@PLT
	mov	rsi, QWORD PTR 32[r12]
	mov	edx, eax
	mov	rax, QWORD PTR [rbx]
	mov	ecx, r13d
	mov	edi, DWORD PTR [rax]
	call	dma_map_single@PLT
	mov	rdi, rbx
	mov	ebp, eax
	call	b43_txhdr_size@PLT
	mov	ecx, 1
	mov	esi, ebp
	mov	rdi, r12
	mov	edx, eax
	call	b43_dma_mapping_error@PLT
	test	rax, rax
	jne	.L41
.L13:
	mov	rdi, rbx
	mov	r13d, DWORD PTR DMA_TO_DEVICE[rip]
	call	b43_txhdr_size@PLT
	mov	esi, ebp
	mov	edx, eax
	mov	rax, QWORD PTR [rbx]
	mov	ecx, r13d
	mov	edi, DWORD PTR [rax]
	call	dma_unmap_single@PLT
	mov	rdi, r12
	call	alloc_ringmemory@PLT
	test	eax, eax
	je	.L42
.L2:
.L15:
	mov	rdi, QWORD PTR 32[r12]
	call	kfree@PLT
.L9:
	mov	rdi, QWORD PTR 24[r12]
	call	kfree@PLT
.L4:
	mov	rdi, r12
	xor	r12d, r12d
	call	kfree@PLT
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rax, r12
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L40:
	.cfi_restore_state
	mov	edi, DWORD PTR B43_TXRING_SLOTS[rip]
	mov	DWORD PTR [rax], edi
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L7:
	test	r13d, r13d
	jne	.L10
	mov	eax, DWORD PTR 12[rbx]
	cmp	eax, 128
	je	.L11
	sub	eax, 129
	cmp	eax, 1
	ja	.L12
	mov	eax, DWORD PTR B43_DMA0_RX_FW351_BUFSIZE[rip]
	mov	DWORD PTR 48[r12], eax
	mov	eax, DWORD PTR B43_DMA0_RX_FW351_FO[rip]
	mov	DWORD PTR 44[r12], eax
.L12:
	mov	rdi, r12
	call	alloc_ringmemory@PLT
	test	eax, eax
	jne	.L15
.L42:
	mov	rdi, r12
	call	dmacontroller_setup@PLT
	test	eax, eax
	je	.L1
	mov	rdi, r12
	call	free_ringmemory@PLT
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L11:
	mov	eax, DWORD PTR B43_DMA0_RX_FW598_BUFSIZE[rip]
	mov	DWORD PTR 48[r12], eax
	mov	eax, DWORD PTR B43_DMA0_RX_FW598_FO[rip]
	mov	DWORD PTR 44[r12], eax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L10:
	mov	edi, 1
	call	B43_WARN_ON@PLT
	jmp	.L12
.L41:
	mov	edi, DWORD PTR 8[rbx]
	lea	rsi, .LC0[rip]
	call	b43err@PLT
	jmp	.L15
	.cfi_endproc
.LFE0:
	.size	b43_setup_dmaring, .-b43_setup_dmaring
	.comm	jiffies,4,4
	.comm	dma64_ops,4,4
	.comm	dma32_ops,4,4
	.comm	TX_SLOTS_PER_FRAME,4,4
	.comm	GFP_KERNEL,4,4
	.comm	GFP_DMA,4,4
	.comm	DMA_TO_DEVICE,4,4
	.comm	B43_TXRING_SLOTS,4,4
	.comm	B43_RXRING_SLOTS,4,4
	.comm	B43_DMA_PTR_POISON,4,4
	.comm	B43_DMA_64BIT,4,4
	.comm	B43_DMA0_RX_FW598_FO,4,4
	.comm	B43_DMA0_RX_FW598_BUFSIZE,4,4
	.comm	B43_DMA0_RX_FW351_FO,4,4
	.comm	B43_DMA0_RX_FW351_BUFSIZE,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_dma.c_b43_setup_dmaring.c"
	.text
	.global	__aeabi_idivmod
	.global	__aeabi_idiv
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"TXHDR DMA allocation failed\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	b43_setup_dmaring, %function
b43_setup_dmaring:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r9, .L42
	mov	r5, r0
	mov	r7, r1
	mov	r0, #56
	ldr	r1, [r9]
	mov	r8, r2
	mov	r6, r3
	bl	kzalloc
	subs	r4, r0, #0
	beq	.L1
	ldr	r3, .L42+4
	cmp	r8, #0
	ldr	r0, [r3]
	ldrne	r3, .L42+8
	str	r0, [r4]
	ldrne	r0, [r3]
	mov	r1, #4
	strne	r0, [r4]
	ldr	r2, [r9]
	bl	kcalloc
	cmp	r0, #0
	str	r0, [r4, #20]
	beq	.L4
	ldr	r3, [r4]
	mov	r1, r7
	cmp	r3, #0
	ldrgt	r3, .L42+12
	ldrgt	r3, [r3]
	strgt	r3, [r0, #52]
	mov	r0, r6
	str	r6, [r4, #4]
	str	r5, [r4, #48]
	bl	b43_dmacontroller_base
	ldr	r2, .L42+16
	ldr	r3, .L42+20
	ldr	r1, [r2]
	ldr	r2, .L42+24
	cmp	r1, r6
	movne	r3, r2
	cmp	r8, #0
	str	r0, [r4, #44]
	str	r7, [r4, #8]
	str	r3, [r4, #40]
	beq	.L7
	mvn	r2, #0
	mov	r8, #1
	ldr	r3, .L42+8
	ldr	r7, .L42+28
	ldr	r0, [r3]
	str	r2, [r4, #16]
	ldr	r1, [r7]
	str	r8, [r4, #12]
	bl	__aeabi_idivmod
	subs	r0, r1, #0
	movne	r0, #1
	bl	BUILD_BUG_ON
	ldr	r1, [r7]
	ldr	r0, [r4]
	bl	__aeabi_idiv
	mov	r6, r0
	mov	r0, r5
	bl	b43_txhdr_size
	ldr	r2, [r9]
	mov	r1, r0
	mov	r0, r6
	bl	kcalloc
	cmp	r0, #0
	mov	r6, r0
	str	r0, [r4, #24]
	beq	.L9
	ldr	r3, [r5]
	mov	r0, r5
	ldr	fp, [r3]
	bl	b43_txhdr_size
	ldr	r10, .L42+32
	mov	r2, r0
	mov	r1, r6
	ldr	r3, [r10]
	mov	r0, fp
	bl	dma_map_single
	mov	r6, r0
	mov	r0, r5
	bl	b43_txhdr_size
	mov	r3, r8
	mov	r2, r0
	mov	r1, r6
	mov	r0, r4
	bl	b43_dma_mapping_error
	cmp	r0, #0
	beq	.L13
	ldr	r0, [r4, #24]
	bl	kfree
	ldr	r1, [r7]
	ldr	r0, [r4]
	bl	__aeabi_idiv
	mov	r6, r0
	mov	r0, r5
	bl	b43_txhdr_size
	ldr	r3, .L42+36
	ldr	r2, [r9]
	ldr	r3, [r3]
	mov	r1, r0
	orr	r2, r2, r3
	mov	r0, r6
	bl	kcalloc
	cmp	r0, #0
	mov	r6, r0
	str	r0, [r4, #24]
	beq	.L9
	ldr	r3, [r5]
	mov	r0, r5
	ldr	r7, [r3]
	bl	b43_txhdr_size
	mov	r1, r6
	mov	r2, r0
	ldr	r3, [r10]
	mov	r0, r7
	bl	dma_map_single
	mov	r6, r0
	mov	r0, r5
	bl	b43_txhdr_size
	mov	r3, r8
	mov	r2, r0
	mov	r1, r6
	mov	r0, r4
	bl	b43_dma_mapping_error
	cmp	r0, #0
	bne	.L40
.L13:
	ldr	r3, [r5]
	mov	r0, r5
	ldr	r5, [r3]
	bl	b43_txhdr_size
	mov	r1, r6
	mov	r2, r0
	ldr	r3, [r10]
	mov	r0, r5
	bl	dma_unmap_single
	mov	r0, r4
	bl	alloc_ringmemory
	cmp	r0, #0
	beq	.L41
.L2:
.L15:
	ldr	r0, [r4, #24]
	bl	kfree
.L9:
	ldr	r0, [r4, #20]
	bl	kfree
.L4:
	mov	r0, r4
	bl	kfree
	mov	r4, #0
.L1:
	mov	r0, r4
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	cmp	r7, #0
	bne	.L10
	ldr	r3, [r5, #8]
	cmp	r3, #128
	beq	.L11
	sub	r3, r3, #129
	cmp	r3, #1
	bhi	.L12
	ldr	r2, .L42+40
	ldr	r3, .L42+44
	ldr	r2, [r2]
	ldr	r3, [r3]
	str	r2, [r4, #36]
	str	r3, [r4, #32]
.L12:
	mov	r0, r4
	bl	alloc_ringmemory
	cmp	r0, #0
	bne	.L15
.L41:
	mov	r0, r4
	bl	dmacontroller_setup
	cmp	r0, #0
	beq	.L1
	mov	r0, r4
	bl	free_ringmemory
	b	.L15
.L11:
	ldr	r2, .L42+48
	ldr	r3, .L42+52
	ldr	r2, [r2]
	ldr	r3, [r3]
	str	r2, [r4, #36]
	str	r3, [r4, #32]
	b	.L12
.L10:
	mov	r0, #1
	bl	B43_WARN_ON
	b	.L12
.L40:
	ldr	r0, [r5, #4]
	ldr	r1, .L42+56
	bl	b43err
	b	.L15
.L43:
	.align	2
.L42:
	.word	GFP_KERNEL
	.word	B43_RXRING_SLOTS
	.word	B43_TXRING_SLOTS
	.word	B43_DMA_PTR_POISON
	.word	B43_DMA_64BIT
	.word	dma64_ops
	.word	dma32_ops
	.word	TX_SLOTS_PER_FRAME
	.word	DMA_TO_DEVICE
	.word	GFP_DMA
	.word	B43_DMA0_RX_FW351_BUFSIZE
	.word	B43_DMA0_RX_FW351_FO
	.word	B43_DMA0_RX_FW598_BUFSIZE
	.word	B43_DMA0_RX_FW598_FO
	.word	.LC0
	.size	b43_setup_dmaring, .-b43_setup_dmaring
	.comm	jiffies,4,4
	.comm	dma64_ops,4,4
	.comm	dma32_ops,4,4
	.comm	TX_SLOTS_PER_FRAME,4,4
	.comm	GFP_KERNEL,4,4
	.comm	GFP_DMA,4,4
	.comm	DMA_TO_DEVICE,4,4
	.comm	B43_TXRING_SLOTS,4,4
	.comm	B43_RXRING_SLOTS,4,4
	.comm	B43_DMA_PTR_POISON,4,4
	.comm	B43_DMA_64BIT,4,4
	.comm	B43_DMA0_RX_FW598_FO,4,4
	.comm	B43_DMA0_RX_FW598_BUFSIZE,4,4
	.comm	B43_DMA0_RX_FW351_FO,4,4
	.comm	B43_DMA0_RX_FW351_BUFSIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
