	.file	"extr_phy_lcn.c_wlc_lcnphy_periodic_cal.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	wlc_lcnphy_periodic_cal, @function
wlc_lcnphy_periodic_cal:
.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
	sub	rsp, 88
	.cfi_def_cfa_offset 144
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 72[rsp], rax
	xor	eax, eax
	call	wlc_lcnphy_get_tx_pwr_ctrl@PLT
	mov	edi, DWORD PTR 32[rbp]
	mov	rbx, QWORD PTR 40[rbp]
	mov	DWORD PTR 8[rsp], eax
	mov	rax, QWORD PTR 16[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	DWORD PTR 0[rbp], 0
	mov	DWORD PTR 36[rbp], eax
	call	CHSPEC_CHANNEL@PLT
	mov	edi, DWORD PTR 32[rbp]
	call	CHSPEC_CHANNEL@PLT
	mov	edi, DWORD PTR maccontrol[rip]
	mov	QWORD PTR [rbx], rax
	mov	eax, DWORD PTR 8[rbx]
	mov	DWORD PTR 12[rsp], eax
	call	D11REGOFFS@PLT
	mov	edi, DWORD PTR 28[rbp]
	mov	esi, eax
	call	bcma_read32@PLT
	and	eax, DWORD PTR MCTL_EN_MAC[rip]
	mov	DWORD PTR 4[rsp], eax
	jne	.L22
.L2:
	mov	esi, 1
	mov	rdi, rbp
	call	wlc_lcnphy_deaf_mode@PLT
	mov	rdi, rbp
	call	wlc_lcnphy_txpwrtbl_iqlo_cal@PLT
	mov	rdi, QWORD PTR lcnphy_rx_iqcomp_table_rev0[rip]
	call	ARRAY_SIZE@PLT
	mov	edi, DWORD PTR 24[rbp]
	mov	esi, 1
	call	LCNREV_IS@PLT
	test	rax, rax
	je	.L3
	sub	rsp, 8
	.cfi_def_cfa_offset 152
	push	40
	.cfi_def_cfa_offset 160
.L20:
	xor	edx, edx
	xor	r8d, r8d
	mov	ecx, 1
	xor	esi, esi
	mov	rdi, rbp
	mov	r9d, 1
	call	wlc_lcnphy_rx_iq_cal@PLT
	pop	rdx
	.cfi_def_cfa_offset 152
	mov	rdi, rbp
	pop	rcx
	.cfi_def_cfa_offset 144
	call	wlc_lcnphy_tssi_based_pwr_ctrl_enabled@PLT
	test	rax, rax
	jne	.L23
.L5:
	mov	esi, DWORD PTR 12[rsp]
	mov	rdi, rbp
	call	wlc_lcnphy_set_tx_pwr_by_index@PLT
	mov	esi, DWORD PTR 8[rsp]
	mov	rdi, rbp
	call	wlc_lcnphy_set_tx_pwr_ctrl@PLT
	xor	esi, esi
	mov	rdi, rbp
	call	wlc_lcnphy_deaf_mode@PLT
	mov	eax, DWORD PTR 4[rsp]
	test	eax, eax
	jne	.L24
.L1:
	mov	rax, QWORD PTR 72[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L25
	add	rsp, 88
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	sub	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 152
	push	127
	.cfi_def_cfa_offset 160
	jmp	.L20
.L22:
	.cfi_restore_state
	mov	rax, QWORD PTR 16[rbp]
	mov	esi, DWORD PTR M_CTS_DURATION[rip]
	mov	edx, 10000
	mov	edi, DWORD PTR [rax]
	call	wlapi_bmac_write_shm@PLT
	mov	rax, QWORD PTR 16[rbp]
	mov	edi, DWORD PTR [rax]
	call	wlapi_suspend_mac_and_wait@PLT
	jmp	.L2
.L24:
	mov	rax, QWORD PTR 16[rbp]
	mov	edi, DWORD PTR [rax]
	call	wlapi_enable_mac@PLT
	jmp	.L1
.L23:
	mov	rdi, rbp
	xor	ebx, ebx
	lea	r15, 32[rsp]
	call	wlc_lcnphy_idle_tssi_est@PLT
	mov	rax, QWORD PTR 8[rbp]
	mov	edi, 10
	mov	r13d, DWORD PTR [rax]
	mov	r14d, DWORD PTR 4[rax]
	mov	r12d, DWORD PTR 8[rax]
	mov	ecx, r14d
	mov	edx, r13d
	mov	esi, r12d
	call	wlc_lcnphy_tssi2dbm@PLT
	mov	ecx, r14d
	mov	edx, r13d
	mov	esi, r12d
	mov	edi, 125
	call	wlc_lcnphy_tssi2dbm@PLT
	mov	DWORD PTR 32[rsp], 32
	mov	DWORD PTR [rsp], eax
	mov	eax, DWORD PTR LCNPHY_TBL_ID_TXPWRCTL[rip]
	mov	DWORD PTR 48[rsp], 1
	mov	DWORD PTR 64[rsp], eax
	lea	rax, 28[rsp]
	mov	QWORD PTR 40[rsp], rax
	mov	QWORD PTR 56[rsp], 0
	.p2align 4,,10
	.p2align 3
.L6:
	mov	edi, ebx
	mov	ecx, r14d
	mov	edx, r13d
	mov	esi, r12d
	call	wlc_lcnphy_tssi2dbm@PLT
	mov	ecx, DWORD PTR [rsp]
	mov	rsi, r15
	mov	rdi, rbp
	cmp	eax, ecx
	cmovl	eax, ecx
	add	ebx, 1
	mov	DWORD PTR 28[rsp], eax
	call	wlc_lcnphy_write_table@PLT
	add	QWORD PTR 56[rsp], 1
	cmp	ebx, 128
	jne	.L6
	jmp	.L5
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	wlc_lcnphy_periodic_cal, .-wlc_lcnphy_periodic_cal
	.comm	maccontrol,4,4
	.comm	lcnphy_rx_iqcomp_table_rev0,8,8
	.comm	M_CTS_DURATION,4,4
	.comm	MCTL_EN_MAC,4,4
	.comm	LCNPHY_TBL_ID_TXPWRCTL,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_phy_lcn.c_wlc_lcnphy_periodic_cal.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	wlc_lcnphy_periodic_cal, %function
wlc_lcnphy_periodic_cal:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r0
	ldr	r3, .L25
	sub	sp, sp, #60
	ldr	r3, [r3]
	str	r3, [sp, #52]
	mov	r3,#0
	bl	wlc_lcnphy_get_tx_pwr_ctrl
	mov	r2, #0
	ldr	r3, [r6, #8]
	mov	r10, r0
	ldr	r3, [r3, #4]
	ldr	r0, [r6, #20]
	str	r2, [r6]
	str	r3, [r6, #24]
	ldr	r4, [r6, #28]
	bl	CHSPEC_CHANNEL
	ldr	r0, [r6, #20]
	bl	CHSPEC_CHANNEL
	ldr	r3, .L25+4
	str	r0, [r4]
	ldr	r0, [r3]
	ldr	r5, [r6, #16]
	ldr	fp, [r4, #4]
	bl	D11REGOFFS
	mov	r1, r0
	mov	r0, r5
	bl	bcma_read32
	ldr	r3, .L25+8
	ldr	r3, [r3]
	ands	r3, r0, r3
	str	r3, [sp, #20]
	bne	.L21
.L2:
	mov	r1, #1
	mov	r0, r6
	bl	wlc_lcnphy_deaf_mode
	mov	r0, r6
	bl	wlc_lcnphy_txpwrtbl_iqlo_cal
	ldr	r3, .L25+12
	ldr	r0, [r3]
	bl	ARRAY_SIZE
	mov	r1, #1
	ldr	r0, [r6, #12]
	bl	LCNREV_IS
	subs	r2, r0, #0
	movne	r1, #40
	movne	r2, #0
	moveq	r1, #127
	movne	r3, #1
	moveq	r3, #1
	strne	r1, [sp, #8]
	streq	r1, [sp, #8]
	stmne	sp, {r2, r3}
	streq	r2, [sp]
	streq	r3, [sp, #4]
	mov	r1, r2
	mov	r0, r6
	bl	wlc_lcnphy_rx_iq_cal
	mov	r0, r6
	bl	wlc_lcnphy_tssi_based_pwr_ctrl_enabled
	cmp	r0, #0
	bne	.L22
.L5:
	mov	r1, fp
	mov	r0, r6
	bl	wlc_lcnphy_set_tx_pwr_by_index
	mov	r1, r10
	mov	r0, r6
	bl	wlc_lcnphy_set_tx_pwr_ctrl
	mov	r1, #0
	mov	r0, r6
	bl	wlc_lcnphy_deaf_mode
	ldr	r3, [sp, #20]
	cmp	r3, #0
	bne	.L23
.L1:
	ldr	r3, .L25
	ldr	r2, [r3]
	ldr	r3, [sp, #52]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L24
	add	sp, sp, #60
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L21:
	ldr	r3, [r6, #8]
	ldr	r2, .L25+16
	ldr	r0, [r3]
	ldr	r1, [r2]
	ldr	r2, .L25+20
	bl	wlapi_bmac_write_shm
	ldr	r3, [r6, #8]
	ldr	r0, [r3]
	bl	wlapi_suspend_mac_and_wait
	b	.L2
.L23:
	ldr	r3, [r6, #8]
	ldr	r0, [r3]
	bl	wlapi_enable_mac
	b	.L1
.L22:
	mov	r0, r6
	bl	wlc_lcnphy_idle_tssi_est
	ldr	r2, [r6, #4]
	mov	r0, #10
	ldm	r2, {r8, r9}
	ldr	r7, [r2, #8]
	mov	r3, r9
	mov	r2, r8
	mov	r1, r7
	bl	wlc_lcnphy_tssi2dbm
	mov	r2, r8
	mov	r1, r7
	mov	r3, r9
	mov	r0, #125
	bl	wlc_lcnphy_tssi2dbm
	mov	r2, #0
	mov	ip, #32
	mov	r1, #1
	mov	r5, r0
	ldr	r0, .L25+24
	mov	r4, r2
	ldr	r0, [r0]
	str	r2, [sp, #44]
	add	r2, sp, #28
	str	ip, [sp, #32]
	str	r0, [sp, #48]
	str	r1, [sp, #40]
	str	r2, [sp, #36]
.L6:
	mov	r3, r9
	mov	r2, r8
	mov	r1, r7
	mov	r0, r4
	bl	wlc_lcnphy_tssi2dbm
	cmp	r0, r5
	movge	r3, r0
	movlt	r3, r5
	mov	r0, r6
	add	r1, sp, #32
	str	r3, [sp, #28]
	bl	wlc_lcnphy_write_table
	ldr	r3, [sp, #44]
	add	r4, r4, #1
	add	r3, r3, #1
	cmp	r4, #128
	str	r3, [sp, #44]
	bne	.L6
	b	.L5
.L24:
	bl	__stack_chk_fail
.L26:
	.align	2
.L25:
	.word	.LC0
	.word	maccontrol
	.word	MCTL_EN_MAC
	.word	lcnphy_rx_iqcomp_table_rev0
	.word	M_CTS_DURATION
	.word	10000
	.word	LCNPHY_TBL_ID_TXPWRCTL
	.size	wlc_lcnphy_periodic_cal, .-wlc_lcnphy_periodic_cal
	.comm	maccontrol,4,4
	.comm	lcnphy_rx_iqcomp_table_rev0,4,4
	.comm	M_CTS_DURATION,4,4
	.comm	MCTL_EN_MAC,4,4
	.comm	LCNPHY_TBL_ID_TXPWRCTL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
