Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
HardenedBSD
HardenedBSD
Commits
eb051710
Commit
eb051710
authored
Aug 14, 2015
by
hselasky
Browse files
Minor code refactor to avoid duplicating code.
MFC after: 2 weeks
parent
caf5c1e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
sys/dev/usb/controller/dwc_otg.c
View file @
eb051710
...
...
@@ -2551,11 +2551,19 @@ static void
dwc_otg_interrupt_poll_locked
(
struct
dwc_otg_softc
*
sc
)
{
struct
usb_xfer
*
xfer
;
uint32_t
count
=
0
;
uint32_t
count
;
uint32_t
temp
;
uint8_t
got_rx_status
;
uint8_t
x
;
if
(
sc
->
sc_flags
.
status_device_mode
==
0
)
{
/*
* Update host transfer schedule, so that new
* transfers can be issued:
*/
dwc_otg_update_host_transfer_schedule_locked
(
sc
);
}
count
=
0
;
repeat:
if
(
++
count
==
16
)
{
/* give other interrupts a chance */
...
...
@@ -2659,12 +2667,6 @@ dwc_otg_interrupt_poll_locked(struct dwc_otg_softc *sc)
sc
->
sc_irq_mask
&=
~
GINTMSK_RXFLVLMSK
;
DWC_OTG_WRITE_4
(
sc
,
DOTG_GINTMSK
,
sc
->
sc_irq_mask
);
}
if
(
sc
->
sc_flags
.
status_device_mode
==
0
&&
sc
->
sc_xfer_complete
==
0
)
{
/* update host transfer schedule, so that new transfers can be issued */
if
(
dwc_otg_update_host_transfer_schedule_locked
(
sc
))
goto
repeat
;
}
}
static
void
...
...
@@ -2944,12 +2946,6 @@ dwc_otg_interrupt(void *arg)
/* complete FIFOs, if any */
dwc_otg_interrupt_complete_locked
(
sc
);
if
(
sc
->
sc_flags
.
status_device_mode
==
0
)
{
/* update host transfer schedule, so that new transfers can be issued */
if
(
dwc_otg_update_host_transfer_schedule_locked
(
sc
))
dwc_otg_interrupt_poll_locked
(
sc
);
}
}
USB_BUS_SPIN_UNLOCK
(
&
sc
->
sc_bus
);
USB_BUS_UNLOCK
(
&
sc
->
sc_bus
);
...
...
@@ -3950,11 +3946,6 @@ dwc_otg_do_poll(struct usb_bus *bus)
USB_BUS_SPIN_LOCK
(
&
sc
->
sc_bus
);
dwc_otg_interrupt_poll_locked
(
sc
);
dwc_otg_interrupt_complete_locked
(
sc
);
if
(
sc
->
sc_flags
.
status_device_mode
==
0
)
{
/* update host transfer schedule, so that new transfers can be issued */
if
(
dwc_otg_update_host_transfer_schedule_locked
(
sc
))
dwc_otg_interrupt_poll_locked
(
sc
);
}
USB_BUS_SPIN_UNLOCK
(
&
sc
->
sc_bus
);
USB_BUS_UNLOCK
(
&
sc
->
sc_bus
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment