hwdep

package
v0.0.0-...-15a9a0c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package hwdep provides the hardware dependency mechanism to select tests to run on a DUT based on its hardware features and setup.

Index

Constants

These are form factor values that can be passed to FormFactor and SkipOnFormFactor.

View Source
const (
	Marvell88w8897SDIO         = wlan.Marvell88w8897SDIO
	Marvell88w8997PCIE         = wlan.Marvell88w8997PCIE
	QualcommAtherosQCA6174     = wlan.QualcommAtherosQCA6174
	QualcommAtherosQCA6174SDIO = wlan.QualcommAtherosQCA6174SDIO
	QualcommWCN3990            = wlan.QualcommWCN3990
	QualcommWCN6750            = wlan.QualcommWCN6750
	QualcommWCN6855            = wlan.QualcommWCN6855
	Intel7260                  = wlan.Intel7260
	Intel7265                  = wlan.Intel7265
	Intel8265                  = wlan.Intel8265
	Intel9000                  = wlan.Intel9000
	Intel9260                  = wlan.Intel9260
	Intel22260                 = wlan.Intel22260
	Intel22560                 = wlan.Intel22560
	IntelAX201                 = wlan.IntelAX201
	IntelAX203                 = wlan.IntelAX203
	IntelAX211                 = wlan.IntelAX211
	BroadcomBCM4354SDIO        = wlan.BroadcomBCM4354SDIO
	BroadcomBCM4356PCIE        = wlan.BroadcomBCM4356PCIE
	BroadcomBCM4371PCIE        = wlan.BroadcomBCM4371PCIE
	Realtek8822CPCIE           = wlan.Realtek8822CPCIE
	Realtek8852APCIE           = wlan.Realtek8852APCIE
	Realtek8852CPCIE           = wlan.Realtek8852CPCIE
	MediaTekMT7921PCIE         = wlan.MediaTekMT7921PCIE
	MediaTekMT7921SDIO         = wlan.MediaTekMT7921SDIO
	MediaTekMT7922PCIE         = wlan.MediaTekMT7922PCIE
)

WLAN device IDs. Convenience wrappers.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition = dep.HardwareCondition

Condition represents one condition of hardware dependencies.

func AssistantKey

func AssistantKey() Condition

AssistantKey is satisfied if a model has an assistant key.

func Battery

func Battery() Condition

Battery returns a hardware dependency condition that is satisfied iff the DUT has a battery, e.g. Chromeboxes and Chromebits don't.

func Bluetooth

func Bluetooth() Condition

Bluetooth returns a hardware dependency condition that is satisfied iff the DUT has a bluetooth adapter.

func CPUNeedsCoreScheduling

func CPUNeedsCoreScheduling() Condition

CPUNeedsCoreScheduling returns a hardware dependency condition that is satisfied iff the DUT's CPU needs to use core scheduling to mitigate hardware vulnerabilities.

func CPUNotNeedsCoreScheduling

func CPUNotNeedsCoreScheduling() Condition

CPUNotNeedsCoreScheduling returns a hardware dependency condition that is satisfied iff the DUT's CPU is does not need to use core scheduling to mitigate hardware vulnerabilities.

func CPUSocFamily

func CPUSocFamily(families []string) Condition

CPUSocFamily is satisfied if the devices CPU SOC family is categorized as one of the families specified. For a complete list of values or to add new ones please check the files at https://chromium.googlesource.com/chromiumos/platform/graphics/+/refs/heads/main/src/go.chromium.org/chromiumos/graphics-utils-go/hardware_probe/cmd/hardware_probe

func CPUSupportsSHANI

func CPUSupportsSHANI() Condition

CPUSupportsSHANI returns a hardware dependency condition that is satisfied iff the DUT supports SHA-NI instruction extension.

func CPUSupportsSMT

func CPUSupportsSMT() Condition

CPUSupportsSMT returns a hardware dependency condition that is satisfied iff the DUT supports Symmetric Multi-Threading.

func CameraFeature

func CameraFeature(names ...string) Condition

CameraFeature is satisfied if all the features listed in |names| are enabled on the DUT.

func Cellular

func Cellular() Condition

Cellular returns a hardware dependency condition that is satisfied iff the DUT has a cellular modem.

func CellularSoftwareDynamicSar

func CellularSoftwareDynamicSar() Condition

CellularSoftwareDynamicSar returns a hardware dependency condition that is satisfied iff the DUT has enabled software dynamic sar.

func CellularVariant

func CellularVariant(names ...string) Condition

CellularVariant returns a hardware dependency condition that is satisfied iff the DUT's cellular variant is one of the given names.

func ChromeEC

func ChromeEC() Condition

ChromeEC returns a hardware dependency condition that is satisfied iff the DUT has a present EC of the "Chrome EC" type.

func DisplayPortConverter

func DisplayPortConverter(names ...string) Condition

DisplayPortConverter is satisfied if a DP converter with one of the given names is present.

func ECFeatureCBI

func ECFeatureCBI() Condition

ECFeatureCBI returns a hardware dependency condition that is satisfied iff the DUT has an EC which supports CBI.

func ECFeatureChargeControlV2

func ECFeatureChargeControlV2() Condition

ECFeatureChargeControlV2 returns a hardware dependency condition that is satisfied iff the DUT supports version 2 of the EC_CMD_CHARGE_CONTROL feature (which adds battery sustain).

func ECFeatureDetachableBase

func ECFeatureDetachableBase() Condition

ECFeatureDetachableBase returns a hardware dependency condition that is satisfied iff the DUT has the detachable base attached.

func ECFeatureTypecCmd

func ECFeatureTypecCmd() Condition

ECFeatureTypecCmd returns a hardware dependency condition that is satisfied iff the DUT has an EC which supports the EC_FEATURE_TYPEC_CMD feature flag.

func Emmc

func Emmc() Condition

Emmc returns a hardware dependency condition if the device has an eMMC storage device.

func ExternalDisplay

func ExternalDisplay() Condition

ExternalDisplay returns a hardware dependency condition that is satisfied iff the DUT has an external display

func Fingerprint

func Fingerprint() Condition

Fingerprint returns a hardware dependency condition that is satisfied iff the DUT has fingerprint sensor.

func ForceDischarge

func ForceDischarge() Condition

ForceDischarge returns a hardware dependency condition that is satisfied iff the DUT has a battery and it supports force discharge through `ectool chargecontrol`. The devices listed in modelsWithoutForceDischargeSupport do not satisfy this condition even though they have a battery since they does not support force discharge via ectool. This is a complementary condition of NoForceDischarge.

func FormFactor

FormFactor returns a hardware dependency condition that is satisfied iff the DUT's form factor is one of the given values.

func GPUFamily

func GPUFamily(families []string) Condition

GPUFamily is satisfied if the devices GPU family is categorized as one of the families specified. For a complete list of values or to add new ones please check the pciid maps at https://chromium.googlesource.com/chromiumos/platform/graphics/+/refs/heads/main/src/go.chromium.org/chromiumos/graphics-utils-go/hardware_probe/cmd/hardware_probe

func GPUVendor

func GPUVendor(vendors []string) Condition

GPUVendor is satisfied if the devices GPU vendor is categorized as one of the vendors specified. For a complete list of values or to add new ones please check the files at https://chromium.googlesource.com/chromiumos/platform/graphics/+/refs/heads/main/src/go.chromium.org/chromiumos/graphics-utils-go/hardware_probe/cmd/hardware_probe

func GSCRWKeyIDProd

func GSCRWKeyIDProd() Condition

GSCRWKeyIDProd returns a hardware dependency condition that is satisfied iff the DUT does have a GSC RW image signed with prod key.

func GSCUART

func GSCUART() Condition

GSCUART returns a hardware dependency condition that is satisfied iff the DUT has a GSC and that GSC has a working UART. TODO(b/224608005): Add a cros_config for this and use that instead.

func HPS

func HPS() Condition

HPS is satisfied if the HPS peripheral (go/cros-hps) is present in the DUT.

func HapticTouchpad

func HapticTouchpad() Condition

HapticTouchpad is satisfied if a model has a haptic touchpad.

func HasNoTpm

func HasNoTpm() Condition

HasNoTpm returns a hardware dependency condition that is satisfied iff the DUT doesn't have an enabled TPM.

func HasTpm

func HasTpm() Condition

HasTpm returns a hardware dependency condition that is satisfied iff the DUT does have an enabled TPM.

func HasTpm1

func HasTpm1() Condition

HasTpm1 returns a hardware dependency condition that is satisfied iff the DUT does have an enabled TPM1.2.

func HasTpm2

func HasTpm2() Condition

HasTpm2 returns a hardware dependency condition that is satisfied iff the DUT does have an enabled TPM2.0.

func InternalDisplay

func InternalDisplay() Condition

InternalDisplay returns a hardware dependency condition that is satisfied iff the DUT has an internal display, e.g. Chromeboxes and Chromebits don't.

func InternalKeyboard

func InternalKeyboard() Condition

InternalKeyboard returns a hardware dependency condition that is satisfied iff the DUT's form factor has a fixed undetachable keyboard.

func InternalTrackpoint

func InternalTrackpoint() Condition

InternalTrackpoint is satisfied if a model has an internal trackpoint.

func Keyboard

func Keyboard() Condition

Keyboard returns a hardware dependency condition that is satisfied iff the DUT has an keyboard, e.g. Chromeboxes and Chromebits don't. Tablets might have a removable keyboard.

func KeyboardBacklight

func KeyboardBacklight() Condition

KeyboardBacklight returns a hardware dependency condition that is satisfied if the DUT supports keyboard backlight functionality.

func Lid

func Lid() Condition

Lid returns a hardware dependency condition that is satisfied iff the DUT's form factor has a lid.

func MainboardHasEarlyLibgfxinit

func MainboardHasEarlyLibgfxinit() Condition

MainboardHasEarlyLibgfxinit is satisfied if the BIOS was built with Kconfig CONFIG_MAINBOARD_HAS_EARLY_LIBGFXINIT

func MaxMemory

func MaxMemory(reqMegabytes int) Condition

MaxMemory returns a hardware dependency condition requiring no more than the maximum size of the memory in megabytes.

func Microphone

func Microphone() Condition

Microphone returns a hardware dependency condition that is satisfied iff the DUT has a microphone.

func MinMemory

func MinMemory(reqMegabytes int) Condition

MinMemory returns a hardware dependency condition requiring the minimum size of the memory in megabytes.

func MinStorage

func MinStorage(reqGigabytes int) Condition

MinStorage returns a hardware dependency condition requiring the minimum size of the storage in gigabytes.

func Model

func Model(names ...string) Condition

Model returns a hardware dependency condition that is satisfied if the DUT's model ID is one of the given names. Practically, this is not recommended to be used in most cases. Please consider again if this is the appropriate use, and whether there exists another option, such as check whether DUT needs to have touchscreen, some specific SKU, internal display etc.

Expected example use case is; there is a problem in some code where we do not have control, such as a device specific driver, or hardware etc., and unfortunately it unlikely be fixed for a while. Another use case is; a test is stably running on most of models, but failing on some specific models. By using Model() and SkipOnModel() combination, the test can be promoted to critical on stably running models, while it is still informational on other models. Note that, in this case, it is expected that an engineer is assigned to stabilize/fix issues of the test on informational models.

func NoAssistantKey

func NoAssistantKey() Condition

NoAssistantKey is satisfied if a model does not have an assistant key.

func NoBatteryBootSupported

func NoBatteryBootSupported() Condition

NoBatteryBootSupported returns a hardware dependency condition that is satisfied iff the DUT supports booting without a battery.

func NoCellular

func NoCellular() Condition

NoCellular returns a hardware dependency condition that is satisfied iff the DUT does not have a cellular modem.

func NoFingerprint

func NoFingerprint() Condition

NoFingerprint returns a hardware dependency condition that is satisfied if the DUT doesn't have fingerprint sensor.

func NoForceDischarge

func NoForceDischarge() Condition

NoForceDischarge is a complementary condition of ForceDischarge.

func NoInternalDisplay

func NoInternalDisplay() Condition

NoInternalDisplay returns a hardware dependency condition that is satisfied iff the DUT does not have an internal display.

func NoPrivacyScreen

func NoPrivacyScreen() Condition

NoPrivacyScreen returns a hardware dependency condition that is satisfied if the DUT does not have a privacy screen.

func NoTouchScreen

func NoTouchScreen() Condition

NoTouchScreen returns a hardware dependency condition that is satisfied if the DUT doesn't have a touchscreen.

func NoX86

func NoX86() Condition

NoX86 returns a hardware dependency condition matching non-x86 ABI compatible platform.

func Nvme

func Nvme() Condition

Nvme returns a hardware dependency condition if the device has an NVMe storage device.

func NvmeSelfTest

func NvmeSelfTest() Condition

NvmeSelfTest returns a dependency condition if the device has an NVMe storage device which supported NVMe self-test.

func Platform

func Platform(names ...string) Condition

Platform returns a hardware dependency condition that is satisfied iff the DUT's platform ID is one of the give names. Please find the doc of Model(), too, for details about the expected usage. Deprecated. Use Model() or "board:*" software dependency.

func PrivacyScreen

func PrivacyScreen() Condition

PrivacyScreen returns a hardware dependency condition that is satisfied iff the DUT has a privacy screen.

func RuntimeProbeConfig

func RuntimeProbeConfig() Condition

RuntimeProbeConfig is satisfied if the probe config of the model exists.

func SeamlessRefreshRate

func SeamlessRefreshRate() Condition

SeamlessRefreshRate is satisfied if the device supports changing refresh rates without modeset.

func SkipCPUSocFamily

func SkipCPUSocFamily(families []string) Condition

SkipCPUSocFamily is satisfied if the device's CPU SOC family is none of the families specified. For a complete list of values or to add new ones please check the files at https://chromium.googlesource.com/chromiumos/platform/graphics/+/refs/heads/main/src/go.chromium.org/chromiumos/graphics-utils-go/hardware_probe/cmd/hardware_probe

func SkipGPUFamily

func SkipGPUFamily(families []string) Condition

SkipGPUFamily is satisfied if the devices GPU family is none of the families specified. For a complete list of values or to add new ones please check the pciid maps at https://chromium.googlesource.com/chromiumos/platform/graphics/+/refs/heads/main/src/go.chromium.org/chromiumos/graphics-utils-go/hardware_probe/cmd/hardware_probe

func SkipGPUVendor

func SkipGPUVendor(vendors []string) Condition

SkipGPUVendor is satisfied if the devices GPU vendor is categorized as none of the vendors specified. For a complete list of values or to add new ones please check the files at https://chromium.googlesource.com/chromiumos/platform/graphics/+/refs/heads/main/src/go.chromium.org/chromiumos/graphics-utils-go/hardware_probe/cmd/hardware_probe

func SkipOnCellularVariant

func SkipOnCellularVariant(names ...string) Condition

SkipOnCellularVariant returns a hardware dependency condition that is satisfied iff the DUT's cellular variant is none of the given names.

func SkipOnFormFactor

SkipOnFormFactor returns a hardware dependency condition that is satisfied iff the DUT's form factor is none of the give values.

func SkipOnModel

func SkipOnModel(names ...string) Condition

SkipOnModel returns a hardware dependency condition that is satisfied iff the DUT's model ID is none of the given names. Please find the doc of Model(), too, for details about the expected usage.

func SkipOnPlatform

func SkipOnPlatform(names ...string) Condition

SkipOnPlatform returns a hardware dependency condition that is satisfied iff the DUT's platform ID is none of the give names. Please find the doc of Model(), too, for details about the expected usage. Deprecated. Use SkipOnModel() or "board:*" software dependency.

func SkipOnWifiDevice

func SkipOnWifiDevice(devices ...wlan.DeviceID) Condition

SkipOnWifiDevice returns a hardware dependency condition that is satisfied iff the DUT's WiFi device is none of the given names. Please find the doc of Model(), too, for details about the expected usage.

func SmartAmp

func SmartAmp() Condition

SmartAmp returns a hardware dependency condition that is satisfied iff the DUT has smart amplifier.

func SmartAmpBootTimeCalibration

func SmartAmpBootTimeCalibration() Condition

SmartAmpBootTimeCalibration returns a hardware dependency condition that is satisfied iff the DUT enables boot time calibration for smart amplifier.

func Speaker

func Speaker() Condition

Speaker returns a hardware dependency condition that is satisfied iff the DUT has a speaker.

func SupportsHEVCVideoDecodingInChrome

func SupportsHEVCVideoDecodingInChrome() Condition

SupportsHEVCVideoDecodingInChrome says true if the device supports HEVC video decoding in Chrome. Note that this might be different from support at the platform (i.e. drivers, kernel, hardware) level. This function represents a policy: Tast tests using this should still make use of SoftwareDeps "caps.HWDecodeHEVC" (or "caps.HWDecodeHEVC10BPP").

func SupportsHardwareOverlays

func SupportsHardwareOverlays() Condition

SupportsHardwareOverlays returns a hardware dependency condition that is satisfied if the SoC supports hardware overlays.

func SupportsNV12Overlays

func SupportsNV12Overlays() Condition

SupportsNV12Overlays says true if the SoC supports NV12 hardware overlays, which are commonly used for video overlays. SoCs with Intel Gen 7.5 (Haswell, BayTrail) and Gen 8 GPUs (Broadwell, Braswell) for example, don't support those.

func SupportsV4L2StatefulVideoDecoding

func SupportsV4L2StatefulVideoDecoding() Condition

SupportsV4L2StatefulVideoDecoding says true if the SoC supports the V4L2 stateful video decoding kernel API. Examples of this are MTK8173 and Qualcomm devices (7180, etc). In general, we prefer to use stateless decoding APIs, so listing them individually makes sense.

func SupportsV4L2StatelessVideoDecoding

func SupportsV4L2StatelessVideoDecoding() Condition

SupportsV4L2StatelessVideoDecoding says true if the SoC supports the V4L2 stateless video decoding kernel API. Examples of this are MTK8192 (Asurada), MTK8195 (Cherry), MTK8186 (Corsola), and RK3399 (scarlet/kevin/bob).

func SupportsVP9KSVCHWDecoding

func SupportsVP9KSVCHWDecoding() Condition

SupportsVP9KSVCHWDecoding is satisfied if the SoC supports VP9 k-SVC hardware decoding. They are x86 devices that are capable of VP9 hardware decoding and Qualcomm7180/7280. VP9 k-SVC is a SVC stream in which a frame only on keyframe can refer frames in a different spatial layer. See https://www.w3.org/TR/webrtc-svc/#dependencydiagrams* for detail.

func SupportsVideoOverlays

func SupportsVideoOverlays() Condition

SupportsVideoOverlays says true if the SoC supports some type of YUV hardware overlay. This includes NV12, I420, and YUY2.

func TouchScreen

func TouchScreen() Condition

TouchScreen returns a hardware dependency condition that is satisfied iff the DUT has touchscreen.

func Touchpad

func Touchpad() Condition

Touchpad returns a hardware dependency condition that is satisfied iff the DUT has a touchpad.

func Vboot2

func Vboot2() Condition

Vboot2 is satisfied iff crossystem param 'fw_vboot2' indicates that DUT uses vboot2.

func VbootCbfsIntegration

func VbootCbfsIntegration() Condition

VbootCbfsIntegration is satisfied if the BIOS was built with Kconfig CONFIG_VBOOT_CBFS_INTEGRATION

func Wifi80211ax

func Wifi80211ax() Condition

Wifi80211ax returns a hardware dependency condition that is satisfied iff the DUT's WiFi module supports 802.11ax.

func Wifi80211ax6E

func Wifi80211ax6E() Condition

Wifi80211ax6E returns a hardware dependency condition that is satisfied iff the DUT's WiFi module supports WiFi 6E.

func WifiDevice

func WifiDevice(devices ...wlan.DeviceID) Condition

WifiDevice returns a hardware dependency condition that is satisfied iff the DUT's WiFi device is one of the given names. Please find the doc of Model(), too, for details about the expected usage.

func WifiFT

func WifiFT() Condition

WifiFT returns a hardware dependency condition that is satisfied iff the DUT supports Fast Transition roaming mode.

func WifiIntel

func WifiIntel() Condition

WifiIntel returns a hardware dependency condition that if satisfied, indicates that a device uses Intel WiFi. It is not guaranteed that the condition will be satisfied for all devices with Intel WiFi.

func WifiMACAddrRandomize

func WifiMACAddrRandomize() Condition

WifiMACAddrRandomize returns a hardware dependency condition that is satisfied iff the DUT supports WiFi MAC Address Randomization.

func WifiMarvell

func WifiMarvell() Condition

WifiMarvell returns a hardware dependency condition that is satisfied if the the DUT is using a Marvell WiFi chip.

func WifiNoVpdSar

func WifiNoVpdSar() Condition

WifiNoVpdSar returns a hardware dependency condition that if satisfied, indicates that the device does not support VPD SAR tables.

func WifiNotMarvell

func WifiNotMarvell() Condition

WifiNotMarvell returns a hardware dependency condition that is satisfied iff the DUT's not using a Marvell WiFi chip.

func WifiNotMarvell8997

func WifiNotMarvell8997() Condition

WifiNotMarvell8997 returns a hardware dependency condition that is satisfied if the DUT is not using Marvell 8997 chipsets.

func WifiNotQualcomm

func WifiNotQualcomm() Condition

WifiNotQualcomm returns a hardware dependency condition that if satisfied, indicates that a device doesn't use Qualcomm WiFi.

func WifiP2P

func WifiP2P() Condition

WifiP2P returns a hardware dependency condition that if satisfied, indicates that a device supports P2P.

func WifiQualcomm

func WifiQualcomm() Condition

WifiQualcomm returns a hardware dependency condition that if satisfied, indicates that a device uses Qualcomm WiFi.

func WifiSAP

func WifiSAP() Condition

WifiSAP returns a hardware dependency condition that if satisfied, indicates that a device supports SoftAP.

func WifiTDLS

func WifiTDLS() Condition

WifiTDLS returns a hardware dependency condition that is satisfied iff the DUT fully supports TDLS MGMT and OPER.

func WifiVpdSar

func WifiVpdSar() Condition

WifiVpdSar returns a hardware dependency condition that if satisfied, indicates that a device supports VPD SAR tables, and the device actually has such tables in VPD.

func WifiWEP

func WifiWEP() Condition

WifiWEP returns a hardware dependency condition that is satisfied if the DUT's WiFi module supports WEP. New generation of Qcom chipsets do not support WEP security protocols.

func X86

func X86() Condition

X86 returns a hardware dependency condition matching x86 ABI compatible platform.

type Deps

type Deps = dep.HardwareDeps

Deps holds hardware dependencies all of which need to be satisfied to run a test.

func D

func D(conds ...Condition) Deps

D returns hardware dependencies representing the given Conditions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL