	.file	"extr_tx.c_wl1271_tx_flush.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"flushing tx buffer: %d %d"
.LC1:
	.string	"tx flush took %d ms"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"Unable to flush all TX buffers, timed out (timeout %d ms"
	.text
	.p2align 4
	.globl	wl1271_tx_flush
	.type	wl1271_tx_flush, @function
wl1271_tx_flush:
.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
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	lea	r14, 8[rbp]
	lea	r12, 12[rbp]
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	edi, DWORD PTR WL1271_TX_FLUSH_TIMEOUT[rip]
	mov	r15, QWORD PTR jiffies[rip]
	call	usecs_to_jiffies@PLT
	mov	rdi, r14
	lea	rbx, [rax+r15]
	call	mutex_lock@PLT
	mov	rdi, r12
	call	mutex_lock@PLT
	cmp	QWORD PTR 0[rbp], 0
	jne	.L2
	mov	rdi, rbp
	call	wl1271_tx_total_queue_count@PLT
	test	rax, rax
	je	.L18
.L2:
	mov	esi, DWORD PTR WLCORE_QUEUE_STOP_REASON_FLUSH[rip]
	mov	rdi, rbp
	lea	r13, 16[rbp]
	call	wlcore_stop_queues@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edi, 20
	call	msleep@PLT
	mov	rdi, r12
	call	mutex_lock@PLT
	cmp	QWORD PTR 0[rbp], 0
	je	.L20
.L6:
	mov	rdi, QWORD PTR jiffies[rip]
	mov	rsi, rbx
	call	time_after@PLT
	test	eax, eax
	jne	.L21
	mov	rdi, rbp
	call	wl1271_tx_total_queue_count@PLT
	mov	rdx, QWORD PTR 0[rbp]
	mov	edi, DWORD PTR DEBUG_MAC80211[rip]
	lea	rsi, .LC0[rip]
	mov	rcx, rax
	xor	eax, eax
	call	wl1271_debug@PLT
	mov	rdi, r12
	call	mutex_unlock@PLT
	mov	rdi, rbp
	call	wl1271_tx_total_queue_count@PLT
	test	rax, rax
	je	.L5
	mov	rdi, r13
	call	wl1271_tx_work@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L20:
	mov	rdi, rbp
	call	wl1271_tx_total_queue_count@PLT
	test	rax, rax
	jne	.L6
	mov	rdi, QWORD PTR jiffies[rip]
	sub	rdi, r15
	call	jiffies_to_msecs@PLT
	mov	edi, DWORD PTR DEBUG_MAC80211[rip]
	lea	rsi, .LC1[rip]
	movsx	rdx, eax
	xor	eax, eax
	call	wl1271_debug@PLT
.L7:
	mov	esi, DWORD PTR WLCORE_QUEUE_STOP_REASON_FLUSH[rip]
	mov	rdi, rbp
	call	wlcore_wake_queues@PLT
.L18:
.L3:
	endbr64
	mov	rdi, r12
	call	mutex_unlock@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, r14
	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
	jmp	mutex_unlock@PLT
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	movsx	rsi, DWORD PTR WL1271_TX_FLUSH_TIMEOUT[rip]
	lea	rdi, .LC2[rip]
	mov	rax, rsi
	imul	rsi, rsi, 274877907
	sar	eax, 31
	sar	rsi, 38
	sub	esi, eax
	call	wl1271_warning@PLT
	mov	eax, DWORD PTR WL12XX_MAX_LINKS[rip]
	test	eax, eax
	jle	.L7
	xor	ebx, ebx
	.p2align 4,,10
	.p2align 3
.L10:
	mov	esi, ebx
	mov	rdi, rbp
	add	ebx, 1
	call	wl1271_tx_reset_link_queues@PLT
	cmp	DWORD PTR WL12XX_MAX_LINKS[rip], ebx
	jg	.L10
	mov	esi, DWORD PTR WLCORE_QUEUE_STOP_REASON_FLUSH[rip]
	mov	rdi, rbp
	call	wlcore_wake_queues@PLT
	jmp	.L18
	.cfi_endproc
.LFE0:
	.size	wl1271_tx_flush, .-wl1271_tx_flush
	.comm	jiffies,8,8
	.comm	WLCORE_QUEUE_STOP_REASON_FLUSH,4,4
	.comm	WL12XX_MAX_LINKS,4,4
	.comm	WL1271_TX_FLUSH_TIMEOUT,4,4
	.comm	DEBUG_MAC80211,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_tx.c_wl1271_tx_flush.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"flushing tx buffer: %d %d\000"
	.align	2
.LC1:
	.ascii	"tx flush took %d ms\000"
	.align	2
.LC2:
	.ascii	"Unable to flush all TX buffers, timed out (timeout "
	.ascii	"%d ms\000"
	.text
	.align	2
	.global	wl1271_tx_flush
	.syntax unified
	.arm
	.fpu softvfp
	.type	wl1271_tx_flush, %function
wl1271_tx_flush:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r8, .L22
	ldr	r3, .L22+4
	ldr	r6, [r8]
	sub	sp, sp, #20
	mov	r4, r0
	ldr	r0, [r3]
	str	r6, [sp, #12]
	bl	usecs_to_jiffies
	mov	r7, r0
	add	r3, r4, #4
	mov	r0, r3
	add	r5, r4, #8
	str	r3, [sp, #8]
	bl	mutex_lock
	mov	r0, r5
	bl	mutex_lock
	ldr	r3, [r4]
	add	r7, r7, r6
	cmp	r3, #0
	bne	.L2
	mov	r0, r4
	bl	wl1271_tx_total_queue_count
	cmp	r0, #0
	beq	.L18
.L2:
	ldr	r3, .L22+8
	mov	r0, r4
	ldr	r1, [r3]
	bl	wlcore_stop_queues
	ldr	r9, .L22+12
	ldr	r10, .L22+16
.L4:
	add	r3, r4, #12
	str	r3, [sp, #4]
	b	.L6
.L5:
	mov	r0, #20
	bl	msleep
	mov	r0, r5
	bl	mutex_lock
	ldr	r3, [r4]
	cmp	r3, #0
	beq	.L20
.L6:
	mov	r1, r7
	ldr	r0, [r8]
	bl	time_after
	cmp	r0, #0
	bne	.L21
	mov	r0, r4
	ldr	fp, [r9]
	ldr	r6, [r4]
	bl	wl1271_tx_total_queue_count
	mov	r2, r6
	mov	r3, r0
	mov	r1, r10
	mov	r0, fp
	bl	wl1271_debug
	mov	r0, r5
	bl	mutex_unlock
	mov	r0, r4
	bl	wl1271_tx_total_queue_count
	cmp	r0, #0
	beq	.L5
	ldr	r0, [sp, #4]
	bl	wl1271_tx_work
	b	.L5
.L20:
	mov	r0, r4
	bl	wl1271_tx_total_queue_count
	cmp	r0, #0
	bne	.L4
	ldr	r0, [r8]
	ldr	r3, [sp, #12]
	ldr	r6, [r9]
	sub	r0, r0, r3
	bl	jiffies_to_msecs
	ldr	r1, .L22+20
	mov	r2, r0
	mov	r0, r6
	bl	wl1271_debug
.L7:
	ldr	r3, .L22+8
	mov	r0, r4
	ldr	r1, [r3]
	bl	wlcore_wake_queues
.L18:
.L3:
	mov	r0, r5
	bl	mutex_unlock
	ldr	r0, [sp, #8]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	mutex_unlock
.L21:
	ldr	r3, .L22+4
	ldr	r2, .L22+24
	ldr	r3, [r3]
	ldr	r7, .L22+28
	asr	r1, r3, #31
	smull	r0, r3, r2, r3
	ldr	r0, .L22+32
	rsb	r1, r1, r3, asr #6
	bl	wl1271_warning
	ldr	r3, [r7]
	cmp	r3, #0
	ble	.L7
	mov	r6, #0
.L10:
	mov	r1, r6
	mov	r0, r4
	bl	wl1271_tx_reset_link_queues
	ldr	r3, [r7]
	add	r6, r6, #1
	cmp	r3, r6
	bgt	.L10
	ldr	r3, .L22+8
	mov	r0, r4
	ldr	r1, [r3]
	bl	wlcore_wake_queues
	b	.L18
.L23:
	.align	2
.L22:
	.word	jiffies
	.word	WL1271_TX_FLUSH_TIMEOUT
	.word	WLCORE_QUEUE_STOP_REASON_FLUSH
	.word	DEBUG_MAC80211
	.word	.LC0
	.word	.LC1
	.word	274877907
	.word	WL12XX_MAX_LINKS
	.word	.LC2
	.size	wl1271_tx_flush, .-wl1271_tx_flush
	.comm	jiffies,4,4
	.comm	WLCORE_QUEUE_STOP_REASON_FLUSH,4,4
	.comm	WL12XX_MAX_LINKS,4,4
	.comm	WL1271_TX_FLUSH_TIMEOUT,4,4
	.comm	DEBUG_MAC80211,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
