	.file	"extr_os_intfs.c_netdev_open.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	netdev_open, @function
netdev_open:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	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
	call	netdev_priv@PLT
	lea	r12, 12[rax]
	mov	rbx, rax
	mov	rdi, r12
	call	mutex_lock@PLT
	mov	edx, DWORD PTR [rbx]
	test	edx, edx
	jne	.L2
	mov	QWORD PTR [rbx], 1
	mov	rdi, rbx
	mov	DWORD PTR 8[rbx], 0
	call	rtl871x_hal_init@PLT
	cmp	rax, QWORD PTR _SUCCESS[rip]
	jne	.L3
	mov	eax, DWORD PTR r8712_initmac[rip]
	test	eax, eax
	jne	.L4
	mov	rsi, QWORD PTR 40[rbx]
	mov	edx, DWORD PTR ETH_ALEN[rip]
	mov	rdi, QWORD PTR 0[rbp]
	call	memcpy@PLT
.L5:
	mov	rdi, rbx
	call	start_drv_threads@PLT
	cmp	rax, QWORD PTR _SUCCESS[rip]
	jne	.L3
	mov	rax, QWORD PTR 32[rbx]
	test	rax, rax
	je	.L3
	mov	rdi, rbx
	call	rax
	mov	edx, DWORD PTR 24[rbx]
	mov	esi, DWORD PTR 28[rbx]
	mov	rdi, rbx
	call	r8712_set_ps_mode@PLT
.L2:
	mov	rdi, rbp
	call	netif_queue_stopped@PLT
	mov	rdi, rbp
	test	eax, eax
	je	.L15
	call	netif_wake_queue@PLT
	cmp	QWORD PTR video_mode[rip], 0
	jne	.L16
.L8:
	mov	rdi, rbx
	call	start_drv_timers@PLT
	mov	esi, DWORD PTR LED_CTL_NO_LINK[rip]
	mov	rdi, rbx
	call	[QWORD PTR 16[rbx]]
	mov	rdi, r12
	call	mutex_unlock@PLT
	xor	eax, eax
.L1:
	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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	call	netif_start_queue@PLT
	cmp	QWORD PTR video_mode[rip], 0
	je	.L8
.L16:
	mov	esi, DWORD PTR cbw40_enable[rip]
	mov	rdi, rbx
	call	enable_video_mode@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, 200
	call	msleep@PLT
	mov	rsi, QWORD PTR 0[rbp]
	mov	rdi, rbx
	call	r8712_setMacAddr_cmd@PLT
	mov	rdi, QWORD PTR 40[rbx]
	mov	edx, DWORD PTR ETH_ALEN[rip]
	mov	rsi, QWORD PTR 0[rbp]
	call	memcpy@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	mov	DWORD PTR [rbx], 0
	mov	rdi, rbp
	call	netif_carrier_off@PLT
	mov	rdi, rbp
	call	netif_stop_queue@PLT
	mov	rdi, r12
	call	mutex_unlock@PLT
	mov	eax, -1
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	netdev_open, .-netdev_open
	.comm	video_mode,8,8
	.comm	r8712_initmac,4,4
	.comm	cbw40_enable,4,4
	.comm	_SUCCESS,8,8
	.comm	LED_CTL_NO_LINK,4,4
	.comm	ETH_ALEN,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_os_intfs.c_netdev_open.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	netdev_open, %function
netdev_open:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r0
	bl	netdev_priv
	mov	r4, r0
	add	r6, r0, #12
	mov	r0, r6
	bl	mutex_lock
	ldr	r3, [r4]
	cmp	r3, #0
	bne	.L2
	mov	r2, #1
	str	r3, [r4, #4]
	str	r3, [r4, #8]
	mov	r0, r4
	str	r2, [r4]
	bl	rtl871x_hal_init
	ldr	r7, .L20
	ldr	r3, [r7]
	cmp	r0, r3
	bne	.L3
	ldr	r3, .L20+4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L4
	ldr	r3, .L20+8
	ldr	r1, [r4, #32]
	ldr	r2, [r3]
	ldr	r0, [r5]
	bl	memcpy
.L5:
	mov	r0, r4
	bl	start_drv_threads
	ldr	r3, [r7]
	cmp	r0, r3
	bne	.L3
	ldr	r3, [r4, #28]
	cmp	r3, #0
	beq	.L3
	mov	r0, r4
	blx	r3
	mov	r0, r4
	ldr	r2, [r4, #20]
	ldr	r1, [r4, #24]
	bl	r8712_set_ps_mode
.L2:
	mov	r0, r5
	bl	netif_queue_stopped
	cmp	r0, #0
	mov	r0, r5
	beq	.L18
	bl	netif_wake_queue
	ldr	r3, .L20+12
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L19
.L8:
	mov	r0, r4
	bl	start_drv_timers
	ldr	r2, .L20+16
	ldr	r3, [r4, #16]
	ldr	r1, [r2]
	mov	r0, r4
	blx	r3
	mov	r0, r6
	bl	mutex_unlock
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L18:
	bl	netif_start_queue
	ldr	r3, .L20+12
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L8
.L19:
	ldr	r3, .L20+20
	mov	r0, r4
	ldr	r1, [r3]
	bl	enable_video_mode
	b	.L8
.L4:
	mov	r0, #200
	bl	msleep
	ldr	r1, [r5]
	mov	r0, r4
	bl	r8712_setMacAddr_cmd
	ldr	r3, .L20+8
	ldr	r1, [r5]
	ldr	r2, [r3]
	ldr	r0, [r4, #32]
	bl	memcpy
	b	.L5
.L3:
	mov	r3, #0
	mov	r0, r5
	str	r3, [r4]
	bl	netif_carrier_off
	mov	r0, r5
	bl	netif_stop_queue
	mov	r0, r6
	bl	mutex_unlock
	mvn	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L21:
	.align	2
.L20:
	.word	_SUCCESS
	.word	r8712_initmac
	.word	ETH_ALEN
	.word	video_mode
	.word	LED_CTL_NO_LINK
	.word	cbw40_enable
	.size	netdev_open, .-netdev_open
	.comm	video_mode,4,4
	.comm	r8712_initmac,4,4
	.comm	cbw40_enable,4,4
	.comm	_SUCCESS,4,4
	.comm	LED_CTL_NO_LINK,4,4
	.comm	ETH_ALEN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
