	.file	"extr_ag71xx.c_ag71xx_dma_reset.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"unable to clear DMA Rx status: %08x\n"
	.align 8
.LC1:
	.string	"unable to clear DMA Tx status: %08x\n"
	.text
	.p2align 4
	.type	ag71xx_dma_reset, @function
ag71xx_dma_reset:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	esi, DWORD PTR AG71XX_REG_RX_CTRL[rip]
	xor	edx, edx
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	r12, QWORD PTR 8[rdi]
	mov	ebx, 256
	call	ag71xx_wr@PLT
	mov	esi, DWORD PTR AG71XX_REG_TX_CTRL[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	ag71xx_wr@PLT
	mov	rdi, rbp
	call	ag71xx_dma_wait_stop@PLT
	mov	edx, DWORD PTR 0[rbp]
	mov	esi, DWORD PTR AG71XX_REG_TX_DESC[rip]
	mov	rdi, rbp
	call	ag71xx_wr@PLT
	mov	edx, DWORD PTR 0[rbp]
	mov	esi, DWORD PTR AG71XX_REG_RX_DESC[rip]
	mov	rdi, rbp
	call	ag71xx_wr@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	mov	edx, DWORD PTR RX_STATUS_PR[rip]
	mov	esi, DWORD PTR AG71XX_REG_RX_STATUS[rip]
	mov	rdi, rbp
	call	ag71xx_wr@PLT
	mov	edx, DWORD PTR TX_STATUS_PS[rip]
	mov	esi, DWORD PTR AG71XX_REG_TX_STATUS[rip]
	mov	rdi, rbp
	call	ag71xx_wr@PLT
	sub	ebx, 1
	jne	.L2
	mov	esi, DWORD PTR AG71XX_REG_RX_STATUS[rip]
	mov	edx, DWORD PTR RX_STATUS_BE[rip]
	mov	rdi, rbp
	or	edx, DWORD PTR RX_STATUS_OF[rip]
	call	ag71xx_wr@PLT
	mov	esi, DWORD PTR AG71XX_REG_TX_STATUS[rip]
	mov	edx, DWORD PTR TX_STATUS_BE[rip]
	mov	rdi, rbp
	or	edx, DWORD PTR TX_STATUS_UR[rip]
	call	ag71xx_wr@PLT
	mov	esi, DWORD PTR AG71XX_REG_RX_STATUS[rip]
	mov	rdi, rbp
	call	ag71xx_rr@PLT
	test	eax, eax
	jne	.L11
.L3:
	mov	esi, DWORD PTR AG71XX_REG_TX_STATUS[rip]
	mov	rdi, rbp
	call	ag71xx_rr@PLT
	and	eax, 16777215
	jne	.L12
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	mov	esi, DWORD PTR hw[rip]
	mov	r8d, eax
	mov	rdx, r12
	mov	rdi, rbp
	lea	rcx, .LC0[rip]
	call	netif_err@PLT
	jmp	.L3
.L12:
	mov	esi, DWORD PTR hw[rip]
	pop	rbx
	.cfi_def_cfa_offset 24
	mov	rdx, r12
	mov	rdi, rbp
	mov	r8d, eax
	pop	rbp
	.cfi_def_cfa_offset 16
	lea	rcx, .LC1[rip]
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	netif_err@PLT
	.cfi_endproc
.LFE0:
	.size	ag71xx_dma_reset, .-ag71xx_dma_reset
	.comm	hw,4,4
	.comm	TX_STATUS_UR,4,4
	.comm	TX_STATUS_PS,4,4
	.comm	TX_STATUS_BE,4,4
	.comm	RX_STATUS_PR,4,4
	.comm	RX_STATUS_OF,4,4
	.comm	RX_STATUS_BE,4,4
	.comm	AG71XX_REG_TX_STATUS,4,4
	.comm	AG71XX_REG_TX_DESC,4,4
	.comm	AG71XX_REG_TX_CTRL,4,4
	.comm	AG71XX_REG_RX_STATUS,4,4
	.comm	AG71XX_REG_RX_DESC,4,4
	.comm	AG71XX_REG_RX_CTRL,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_ag71xx.c_ag71xx_dma_reset.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"unable to clear DMA Rx status: %08x\012\000"
	.align	2
.LC1:
	.ascii	"unable to clear DMA Tx status: %08x\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ag71xx_dma_reset, %function
ag71xx_dma_reset:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r5, r0
	ldr	r3, .L16
	sub	sp, sp, #8
	ldr	r1, [r3]
	mov	r2, #0
	ldr	r10, [r0, #4]
	bl	ag71xx_wr
	ldr	r3, .L16+4
	mov	r2, #0
	ldr	r1, [r3]
	mov	r0, r5
	bl	ag71xx_wr
	mov	r0, r5
	bl	ag71xx_dma_wait_stop
	ldr	r3, .L16+8
	ldr	r2, [r5]
	ldr	r1, [r3]
	mov	r0, r5
	bl	ag71xx_wr
	ldr	r3, .L16+12
	mov	r0, r5
	ldr	r2, [r5]
	ldr	r1, [r3]
	bl	ag71xx_wr
	mov	r4, #256
	ldr	r9, .L16+16
	ldr	r7, .L16+20
	ldr	r8, .L16+24
	ldr	r6, .L16+28
.L2:
	ldr	r2, [r9]
	ldr	r1, [r7]
	mov	r0, r5
	bl	ag71xx_wr
	mov	r0, r5
	ldr	r2, [r8]
	ldr	r1, [r6]
	bl	ag71xx_wr
	subs	r4, r4, #1
	bne	.L2
	ldr	r2, .L16+32
	ldr	r3, .L16+36
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r1, [r7]
	orr	r2, r2, r3
	mov	r0, r5
	bl	ag71xx_wr
	ldr	r2, .L16+40
	ldr	r3, .L16+44
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r1, [r6]
	orr	r2, r2, r3
	mov	r0, r5
	bl	ag71xx_wr
	mov	r0, r5
	ldr	r1, [r7]
	bl	ag71xx_rr
	cmp	r0, #0
	bne	.L14
.L3:
	mov	r0, r5
	ldr	r1, [r6]
	bl	ag71xx_rr
	bics	r0, r0, #-16777216
	bne	.L15
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L14:
	ldr	r3, .L16+48
	str	r0, [sp]
	ldr	r1, [r3]
	mov	r2, r10
	mov	r0, r5
	ldr	r3, .L16+52
	bl	netif_err
	b	.L3
.L15:
	ldr	r3, .L16+48
	str	r0, [sp]
	ldr	r1, [r3]
	mov	r2, r10
	mov	r0, r5
	ldr	r3, .L16+56
	bl	netif_err
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L17:
	.align	2
.L16:
	.word	AG71XX_REG_RX_CTRL
	.word	AG71XX_REG_TX_CTRL
	.word	AG71XX_REG_TX_DESC
	.word	AG71XX_REG_RX_DESC
	.word	RX_STATUS_PR
	.word	AG71XX_REG_RX_STATUS
	.word	TX_STATUS_PS
	.word	AG71XX_REG_TX_STATUS
	.word	RX_STATUS_BE
	.word	RX_STATUS_OF
	.word	TX_STATUS_BE
	.word	TX_STATUS_UR
	.word	hw
	.word	.LC0
	.word	.LC1
	.size	ag71xx_dma_reset, .-ag71xx_dma_reset
	.comm	hw,4,4
	.comm	TX_STATUS_UR,4,4
	.comm	TX_STATUS_PS,4,4
	.comm	TX_STATUS_BE,4,4
	.comm	RX_STATUS_PR,4,4
	.comm	RX_STATUS_OF,4,4
	.comm	RX_STATUS_BE,4,4
	.comm	AG71XX_REG_TX_STATUS,4,4
	.comm	AG71XX_REG_TX_DESC,4,4
	.comm	AG71XX_REG_TX_CTRL,4,4
	.comm	AG71XX_REG_RX_STATUS,4,4
	.comm	AG71XX_REG_RX_DESC,4,4
	.comm	AG71XX_REG_RX_CTRL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
