template <bool manage_lifetime, typename gtest_base>
class TestFixture
Defined at line 246 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
Test is templated on a parameter which, if true, will have the harness start and stop the driver.
Otherwise, it is the individual test(s) responsibility to start and stop the driver.
Protected Members
uint32_t ver_number_
atomic dctl_val_
atomic stuck_reset_test_
BackgroundDriverTest dut_
Public Methods
Dwc3::UserEndpoint & GetUserEndpoint (Dwc3 & drv, uint8_t ep_num)
Defined at line 248 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
uint8_t UsbAddressToEpNum (uint8_t addr)
Defined at line 254 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
const zx::bti & GetBti (const Dwc3 & drv)
Defined at line 256 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
void TriggerEpTransferNotReady (Dwc3 &drv,uint8_tep_num,uint32_tstage)
Defined at line 258 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
void TriggerEpTransferComplete (Dwc3 & drv, uint8_t ep_num)
Defined at line 262 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
void TriggerEpTransferStarted (Dwc3 &drv,uint8_tep_num,uint32_trsrc_id)
Defined at line 276 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
void TriggerConnectionDone (Dwc3 & drv)
Defined at line 280 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
void TriggerConnectionPlugIn (Environment & env, fuchsia_hardware_usb_descriptor::UsbSpeed speed)
Defined at line 282 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
void SetUp ()
Defined at line 296 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
void TearDown ()
Defined at line 320 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
Protected Methods
uint32_t Read_GHWPARAMS3 ()
Section 1.2.22 of the DWC3 Programmer's guide
DWC_USB31_CACHE_TOTAL_XFER_RESOURCES : 32
DWC_USB31_NUM_IN_EPS : 16
DWC_USB31_NUM_EPS : 32
DWC_USB31_VENDOR_CTL_INTERFACE : 0
DWC_USB31_HSPHY_DWIDTH : 2
DWC_USB31_HSPHY_INTERFACE : 1
DWC_USB31_SSPHY_INTERFACE : 2
Defined at line 340 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
uint32_t Read_DCTL ()
Section 1.4.2 of the DWC3 Programmer's guide
Defined at line 345 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
void Write_DCTL (uint32_t val)
Defined at line 346 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
uint32_t Read_GSNPSID ()
Section 1.2.9 of the DWC3 Programmer's guide
core_id = 0x5533
version = 1.60a
Defined at line 362 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc
zx_status_t WaitForPhy ()
There's an inherent race in the way this test is set up between the three threads: the
foreground testing thread, the background driver thread, and the environment thread the fakes
are running on. Driving the driver's dispatcher to an idle state and then tearing down the test
will race with the environment's dispatcher execution of the Watch handler. If the environment
dispatcher is torn down before the side effects of the Watch handler execute, ~FakeUsbPhy()
will sometimes fail. To resolve this race, the foreground testing thread needs to be
synchronized against the environment thread and wait for the fakes to catch up.
Defined at line 376 of file ../../src/devices/usb/drivers/dwc3/dwc3-test.cc