	.file	"extr_usb.c_mt7601u_vendor_request.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Vendor request req:%02x off:%04x failed:%d\n"
	.text
	.p2align 4
	.globl	mt7601u_vendor_request
	.type	mt7601u_vendor_request, @function
mt7601u_vendor_request:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, ecx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, r8d
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, edx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	QWORD PTR 24[rsp], rdi
	mov	QWORD PTR 16[rsp], r9
	call	mt7601u_to_usb_dev@PLT
	mov	ebx, DWORD PTR USB_TYPE_VENDOR[rip]
	xor	esi, esi
	or	ebx, DWORD PTR USB_RECIP_DEVICE[rip]
	or	ebx, ebp
	cmp	DWORD PTR USB_DIR_IN[rip], ebp
	mov	QWORD PTR 32[rsp], rax
	je	.L14
	mov	rdi, QWORD PTR 32[rsp]
	call	usb_sndctrlpipe@PLT
	mov	ebp, eax
.L3:
	mov	eax, DWORD PTR MT_VEND_REQ_MAX_RETRY[rip]
	test	eax, eax
	jle	.L4
	mov	rax, QWORD PTR 24[rsp]
	mov	r12d, r15d
	mov	DWORD PTR 12[rsp], 0
	mov	r15d, ebx
	add	rax, 4
	mov	QWORD PTR 40[rsp], rax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	test	ebx, ebx
	jns	.L11
.L8:
	mov	edi, 5
	call	msleep@PLT
	add	DWORD PTR 12[rsp], 1
	mov	eax, DWORD PTR 12[rsp]
	cmp	DWORD PTR MT_VEND_REQ_MAX_RETRY[rip], eax
	jle	.L15
.L7:
	mov	eax, DWORD PTR MT_VEND_REQ_TOUT_MS[rip]
	sub	rsp, 8
	.cfi_def_cfa_offset 120
	mov	r9d, r14d
	mov	r8d, r12d
	mov	ecx, r15d
	mov	edx, r13d
	mov	esi, ebp
	push	rax
	.cfi_def_cfa_offset 128
	push	QWORD PTR 128[rsp]
	.cfi_def_cfa_offset 136
	push	QWORD PTR 40[rsp]
	.cfi_def_cfa_offset 144
	mov	rdi, QWORD PTR 64[rsp]
	call	usb_control_msg@PLT
	add	rsp, 24
	.cfi_def_cfa_offset 120
	mov	r9d, r14d
	mov	r8d, r12d
	push	rax
	.cfi_def_cfa_offset 128
	mov	ebx, eax
	mov	ecx, r15d
	mov	edx, r13d
	push	QWORD PTR 128[rsp]
	.cfi_def_cfa_offset 136
	mov	esi, ebp
	push	QWORD PTR 40[rsp]
	.cfi_def_cfa_offset 144
	mov	rdi, QWORD PTR 56[rsp]
	call	trace_mt_vend_req@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 112
	mov	eax, ebx
	add	eax, DWORD PTR ENODEV[rip]
	jne	.L5
	mov	rsi, QWORD PTR 40[rsp]
	mov	edi, DWORD PTR MT7601U_STATE_REMOVED[rip]
	call	set_bit@PLT
	test	ebx, ebx
	jns	.L11
	mov	eax, ebx
	add	eax, DWORD PTR ENODEV[rip]
	jne	.L8
.L11:
	mov	r12d, ebx
.L1:
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L15:
	.cfi_restore_state
	mov	r12d, ebx
.L4:
	mov	rax, QWORD PTR 24[rsp]
	mov	r8d, r12d
	mov	ecx, r14d
	mov	edx, r13d
	lea	rsi, .LC0[rip]
	mov	edi, DWORD PTR [rax]
	call	dev_err@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	mov	rdi, rax
	call	usb_rcvctrlpipe@PLT
	mov	ebp, eax
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	mt7601u_vendor_request, .-mt7601u_vendor_request
	.comm	USB_TYPE_VENDOR,4,4
	.comm	USB_RECIP_DEVICE,4,4
	.comm	USB_DIR_IN,4,4
	.comm	MT_VEND_REQ_TOUT_MS,4,4
	.comm	MT_VEND_REQ_MAX_RETRY,4,4
	.comm	MT7601U_STATE_REMOVED,4,4
	.comm	ENODEV,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_usb.c_mt7601u_vendor_request.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Vendor request req:%02x off:%04x failed:%d\012\000"
	.text
	.align	2
	.global	mt7601u_vendor_request
	.syntax unified
	.arm
	.fpu softvfp
	.type	mt7601u_vendor_request, %function
mt7601u_vendor_request:
	@ args = 12, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r2
	sub	sp, sp, #44
	mov	r7, r1
	mov	r9, r3
	str	r0, [sp, #28]
	bl	mt7601u_to_usb_dev
	ldr	r1, .L15
	ldr	r2, .L15+4
	ldr	r3, .L15+8
	ldr	r6, [r1]
	ldr	r2, [r2]
	ldr	r3, [r3]
	cmp	r2, r5
	orr	r6, r6, r3
	mov	r1, #0
	orr	r6, r6, r5
	str	r0, [sp, #32]
	beq	.L14
	bl	usb_sndctrlpipe
	mov	r8, r0
.L3:
	ldr	fp, .L15+12
	ldr	r3, [fp]
	cmp	r3, #0
	ble	.L4
	ldr	r3, [sp, #28]
	mov	r5, #0
	add	r3, r3, #4
	ldr	r10, .L15+16
	str	r3, [sp, #36]
	b	.L7
.L5:
	cmp	r4, #0
	bge	.L1
.L8:
	mov	r0, #5
	bl	msleep
	ldr	r3, [fp]
	cmp	r3, r5
	ble	.L4
.L7:
	ldr	r2, [sp, #88]
	ldr	r3, .L15+20
	mov	r1, r8
	ldr	r3, [r3]
	str	r2, [sp, #12]
	ldr	r2, [sp, #84]
	str	r3, [sp, #16]
	str	r2, [sp, #8]
	ldr	r2, [sp, #80]
	mov	r3, r6
	str	r2, [sp, #4]
	ldr	r0, [sp, #32]
	mov	r2, r7
	str	r9, [sp]
	bl	usb_control_msg
	mov	r4, r0
	ldr	r3, [sp, #88]
	str	r0, [sp, #16]
	str	r3, [sp, #12]
	ldr	r3, [sp, #84]
	mov	r2, r7
	str	r3, [sp, #8]
	ldr	r3, [sp, #80]
	mov	r1, r8
	str	r3, [sp, #4]
	ldr	r0, [sp, #28]
	mov	r3, r6
	str	r9, [sp]
	bl	trace_mt_vend_req
	ldr	r3, [r10]
	add	r5, r5, #1
	cmn	r4, r3
	bne	.L5
	ldr	r3, .L15+24
	ldr	r1, [sp, #36]
	ldr	r0, [r3]
	bl	set_bit
	cmp	r4, #0
	bge	.L1
	ldr	r3, [r10]
	cmn	r4, r3
	bne	.L8
.L1:
	mov	r0, r4
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	r1, [sp, #28]
	str	r4, [sp]
	mov	r2, r7
	ldr	r3, [sp, #80]
	ldr	r0, [r1]
	ldr	r1, .L15+28
	bl	dev_err
	mov	r0, r4
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L14:
	bl	usb_rcvctrlpipe
	mov	r8, r0
	b	.L3
.L16:
	.align	2
.L15:
	.word	USB_TYPE_VENDOR
	.word	USB_DIR_IN
	.word	USB_RECIP_DEVICE
	.word	MT_VEND_REQ_MAX_RETRY
	.word	ENODEV
	.word	MT_VEND_REQ_TOUT_MS
	.word	MT7601U_STATE_REMOVED
	.word	.LC0
	.size	mt7601u_vendor_request, .-mt7601u_vendor_request
	.comm	USB_TYPE_VENDOR,4,4
	.comm	USB_RECIP_DEVICE,4,4
	.comm	USB_DIR_IN,4,4
	.comm	MT_VEND_REQ_TOUT_MS,4,4
	.comm	MT_VEND_REQ_MAX_RETRY,4,4
	.comm	MT7601U_STATE_REMOVED,4,4
	.comm	ENODEV,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
