	.file	"extr_bnx2.c_bnx2_5706_serdes_timer.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	bnx2_5706_serdes_timer, @function
bnx2_5706_serdes_timer:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	lea	r12, 20[rdi]
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	mov	rdi, r12
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	spin_lock@PLT
	mov	rax, QWORD PTR 32[rbp]
	test	rax, rax
	je	.L2
	sub	rax, 1
	mov	QWORD PTR 32[rbp], rax
.L3:
	mov	rdi, r12
	call	spin_unlock@PLT
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L37
	add	rsp, 16
	.cfi_remember_state
	.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
.L2:
	.cfi_restore_state
	mov	eax, DWORD PTR AUTONEG_SPEED[rip]
	and	eax, DWORD PTR 8[rbp]
	cmp	QWORD PTR 0[rbp], 0
	je	.L38
	test	eax, eax
	je	.L11
	mov	eax, DWORD PTR 16[rbp]
	test	DWORD PTR BNX2_PHY_FLAG_PARALLEL_DETECT[rip], eax
	jne	.L39
.L11:
	mov	rdx, QWORD PTR BNX2_TIMER_INTERVAL[rip]
.L5:
	mov	QWORD PTR 24[rbp], rdx
	lea	r13, 4[rsp]
.L9:
	mov	edx, DWORD PTR MISC_SHDW_AN_DBG[rip]
	mov	esi, DWORD PTR MII_BNX2_MISC_SHADOW[rip]
	mov	rdi, rbp
	call	bnx2_write_phy@PLT
	mov	esi, DWORD PTR MII_BNX2_MISC_SHADOW[rip]
	mov	rdx, r13
	mov	rdi, rbp
	call	bnx2_read_phy@PLT
	mov	esi, DWORD PTR MII_BNX2_MISC_SHADOW[rip]
	mov	rdx, r13
	mov	rdi, rbp
	call	bnx2_read_phy@PLT
	cmp	QWORD PTR 0[rbp], 0
	mov	eax, DWORD PTR 4[rsp]
	jne	.L40
	test	DWORD PTR MISC_SHDW_AN_DBG_NOSYNC[rip], eax
	jne	.L3
.L15:
	mov	rdi, rbp
	call	bnx2_set_link@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L38:
	mov	rdx, QWORD PTR BNX2_TIMER_INTERVAL[rip]
	test	eax, eax
	je	.L5
	mov	QWORD PTR 24[rbp], rdx
	mov	esi, DWORD PTR 12[rbp]
	lea	r13, 4[rsp]
	mov	rdi, rbp
	mov	rdx, r13
	call	bnx2_read_phy@PLT
	mov	eax, DWORD PTR 4[rsp]
	test	DWORD PTR BMCR_ANENABLE[rip], eax
	je	.L9
	mov	rdi, rbp
	call	bnx2_5706_serdes_has_link@PLT
	test	rax, rax
	je	.L9
	mov	edx, DWORD PTR BMCR_ANENABLE[rip]
	mov	eax, DWORD PTR BMCR_SPEED1000[rip]
	mov	rdi, rbp
	or	eax, DWORD PTR BMCR_FULLDPLX[rip]
	mov	esi, DWORD PTR 12[rbp]
	not	edx
	and	edx, DWORD PTR 4[rsp]
	or	edx, eax
	mov	DWORD PTR 4[rsp], edx
	call	bnx2_write_phy@PLT
	mov	eax, DWORD PTR BNX2_PHY_FLAG_PARALLEL_DETECT[rip]
	or	DWORD PTR 16[rbp], eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L40:
	test	DWORD PTR MISC_SHDW_AN_DBG_NOSYNC[rip], eax
	je	.L3
	mov	eax, DWORD PTR 16[rbp]
	test	DWORD PTR BNX2_PHY_FLAG_FORCED_DOWN[rip], eax
	jne	.L15
	mov	esi, 1
	mov	rdi, rbp
	call	bnx2_5706s_force_link_dn@PLT
	mov	eax, DWORD PTR BNX2_PHY_FLAG_FORCED_DOWN[rip]
	or	DWORD PTR 16[rbp], eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L39:
	mov	edx, 3841
	mov	esi, 23
	mov	rdi, rbp
	call	bnx2_write_phy@PLT
	mov	rdx, rsp
	mov	esi, 21
	mov	rdi, rbp
	call	bnx2_read_phy@PLT
	lea	r13, 4[rsp]
	test	BYTE PTR [rsp], 32
	je	.L9
	mov	esi, DWORD PTR 12[rbp]
	mov	rdx, r13
	mov	rdi, rbp
	call	bnx2_read_phy@PLT
	mov	esi, DWORD PTR 12[rbp]
	mov	edx, DWORD PTR 4[rsp]
	mov	rdi, rbp
	or	edx, DWORD PTR BMCR_ANENABLE[rip]
	mov	DWORD PTR 4[rsp], edx
	call	bnx2_write_phy@PLT
	mov	eax, DWORD PTR BNX2_PHY_FLAG_PARALLEL_DETECT[rip]
	not	eax
	and	DWORD PTR 16[rbp], eax
	jmp	.L9
.L37:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	bnx2_5706_serdes_timer, .-bnx2_5706_serdes_timer
	.comm	MISC_SHDW_AN_DBG_NOSYNC,4,4
	.comm	MISC_SHDW_AN_DBG,4,4
	.comm	MII_BNX2_MISC_SHADOW,4,4
	.comm	BNX2_TIMER_INTERVAL,8,8
	.comm	BNX2_PHY_FLAG_PARALLEL_DETECT,4,4
	.comm	BNX2_PHY_FLAG_FORCED_DOWN,4,4
	.comm	BMCR_SPEED1000,4,4
	.comm	BMCR_FULLDPLX,4,4
	.comm	BMCR_ANENABLE,4,4
	.comm	AUTONEG_SPEED,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_bnx2.c_bnx2_5706_serdes_timer.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bnx2_5706_serdes_timer, %function
bnx2_5706_serdes_timer:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r4, r0
	ldr	r3, .L41
	add	r5, r0, #16
	sub	sp, sp, #20
	mov	r0, r5
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	spin_lock
	ldr	r3, [r4, #24]
	cmp	r3, #0
	subne	r3, r3, #1
	strne	r3, [r4, #24]
	bne	.L3
	ldr	r3, .L41+4
	ldr	r1, [r4]
	ldr	r3, [r3]
	ldr	r2, [r4, #4]
	cmp	r1, #0
	and	r3, r3, r2
	bne	.L4
	ldr	r2, .L41+8
	cmp	r3, #0
	ldr	r3, [r2]
	bne	.L37
.L5:
	str	r3, [r4, #20]
	add	r7, sp, #8
.L9:
	ldr	r3, .L41+12
	ldr	r6, .L41+16
	ldr	r2, [r3]
	ldr	r1, [r6]
	mov	r0, r4
	bl	bnx2_write_phy
	mov	r2, r7
	ldr	r1, [r6]
	mov	r0, r4
	bl	bnx2_read_phy
	mov	r2, r7
	mov	r0, r4
	ldr	r1, [r6]
	bl	bnx2_read_phy
	ldr	r3, [r4]
	ldr	r2, [sp, #8]
	cmp	r3, #0
	ldr	r3, .L41+20
	ldr	r3, [r3]
	bne	.L38
	tst	r2, r3
	beq	.L15
.L3:
	mov	r0, r5
	bl	spin_unlock
	ldr	r3, .L41
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L39
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L4:
	cmp	r3, #0
	beq	.L11
	ldr	r6, .L41+24
	ldr	r2, [r4, #12]
	ldr	r3, [r6]
	tst	r2, r3
	bne	.L40
.L11:
	ldr	r3, .L41+8
	ldr	r3, [r3]
	b	.L5
.L38:
	tst	r2, r3
	beq	.L3
	ldr	r6, .L41+28
	ldr	r2, [r4, #12]
	ldr	r3, [r6]
	tst	r2, r3
	bne	.L15
	mov	r1, #1
	mov	r0, r4
	bl	bnx2_5706s_force_link_dn
	ldr	r3, [r4, #12]
	ldr	r2, [r6]
	orr	r3, r3, r2
	str	r3, [r4, #12]
	b	.L3
.L37:
	ldr	r6, .L41+32
	add	r7, sp, #8
	mov	r2, r7
	str	r3, [r4, #20]
	mov	r0, r4
	ldr	r1, [r4, #8]
	bl	bnx2_read_phy
	ldr	r3, [r6]
	ldr	r2, [sp, #8]
	tst	r2, r3
	beq	.L9
	mov	r0, r4
	bl	bnx2_5706_serdes_has_link
	cmp	r0, #0
	beq	.L9
	ldr	r3, .L41+36
	ldr	r1, .L41+40
	ldr	r0, [r6]
	ldr	r2, [sp, #8]
	ldr	r1, [r1]
	ldr	r3, [r3]
	bic	r2, r2, r0
	orr	r3, r3, r1
	orr	r2, r2, r3
	mov	r0, r4
	ldr	r1, [r4, #8]
	str	r2, [sp, #8]
	bl	bnx2_write_phy
	ldr	r2, .L41+24
	ldr	r3, [r4, #12]
	ldr	r2, [r2]
	orr	r3, r3, r2
	str	r3, [r4, #12]
	b	.L9
.L15:
	mov	r0, r4
	bl	bnx2_set_link
	b	.L3
.L40:
	mov	r1, #23
	ldr	r2, .L41+44
	mov	r0, r4
	bl	bnx2_write_phy
	mov	r1, #21
	mov	r0, r4
	add	r2, sp, #4
	bl	bnx2_read_phy
	ldr	r3, [sp, #4]
	add	r7, sp, #8
	tst	r3, #32
	beq	.L9
	mov	r2, r7
	ldr	r1, [r4, #8]
	mov	r0, r4
	bl	bnx2_read_phy
	ldr	r3, .L41+32
	ldr	r2, [sp, #8]
	ldr	r3, [r3]
	mov	r0, r4
	orr	r2, r2, r3
	ldr	r1, [r4, #8]
	str	r2, [sp, #8]
	bl	bnx2_write_phy
	ldr	r3, [r4, #12]
	ldr	r2, [r6]
	bic	r3, r3, r2
	str	r3, [r4, #12]
	b	.L9
.L39:
	bl	__stack_chk_fail
.L42:
	.align	2
.L41:
	.word	.LC0
	.word	AUTONEG_SPEED
	.word	BNX2_TIMER_INTERVAL
	.word	MISC_SHDW_AN_DBG
	.word	MII_BNX2_MISC_SHADOW
	.word	MISC_SHDW_AN_DBG_NOSYNC
	.word	BNX2_PHY_FLAG_PARALLEL_DETECT
	.word	BNX2_PHY_FLAG_FORCED_DOWN
	.word	BMCR_ANENABLE
	.word	BMCR_SPEED1000
	.word	BMCR_FULLDPLX
	.word	3841
	.size	bnx2_5706_serdes_timer, .-bnx2_5706_serdes_timer
	.comm	MISC_SHDW_AN_DBG_NOSYNC,4,4
	.comm	MISC_SHDW_AN_DBG,4,4
	.comm	MII_BNX2_MISC_SHADOW,4,4
	.comm	BNX2_TIMER_INTERVAL,4,4
	.comm	BNX2_PHY_FLAG_PARALLEL_DETECT,4,4
	.comm	BNX2_PHY_FLAG_FORCED_DOWN,4,4
	.comm	BMCR_SPEED1000,4,4
	.comm	BMCR_FULLDPLX,4,4
	.comm	BMCR_ANENABLE,4,4
	.comm	AUTONEG_SPEED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
