2019-04-18 11:59:12 +02:00
|
|
|
// Copyright 2018 The Chromium OS Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
2019-05-08 12:22:53 +02:00
|
|
|
// found in the LICENSE-BSD-3-Clause file.
|
2019-04-18 11:59:12 +02:00
|
|
|
|
|
|
|
//! Implements pci devices and busses.
|
|
|
|
#[macro_use]
|
|
|
|
extern crate log;
|
|
|
|
extern crate devices;
|
|
|
|
extern crate vm_memory;
|
|
|
|
|
2019-06-04 14:51:00 +08:00
|
|
|
mod bus;
|
2019-04-18 11:59:12 +02:00
|
|
|
mod configuration;
|
|
|
|
mod device;
|
2019-07-16 22:01:32 -07:00
|
|
|
mod msi;
|
2019-05-29 16:33:29 -07:00
|
|
|
mod msix;
|
2019-04-18 11:59:12 +02:00
|
|
|
|
2019-09-30 15:23:57 +01:00
|
|
|
pub use self::bus::{PciBus, PciConfigIo, PciConfigMmio, PciRoot, PciRootError};
|
2019-04-18 11:59:12 +02:00
|
|
|
pub use self::configuration::{
|
|
|
|
PciBarConfiguration, PciBarPrefetchable, PciBarRegionType, PciCapability, PciCapabilityID,
|
2019-07-02 17:08:51 +02:00
|
|
|
PciClassCode, PciConfiguration, PciHeaderType, PciMassStorageSubclass,
|
|
|
|
PciNetworkControllerSubclass, PciProgrammingInterface, PciSerialBusSubClass, PciSubclass,
|
2019-04-18 11:59:12 +02:00
|
|
|
};
|
2019-06-04 14:51:00 +08:00
|
|
|
pub use self::device::{
|
2020-01-20 16:41:25 +01:00
|
|
|
BarReprogrammingParams, DeviceRelocation, Error as PciDeviceError, PciDevice,
|
2019-06-04 14:51:00 +08:00
|
|
|
};
|
2020-01-14 23:47:41 +01:00
|
|
|
pub use self::msi::{msi_num_enabled_vectors, MsiCap, MsiConfig};
|
2019-07-16 17:19:21 -07:00
|
|
|
pub use self::msix::{MsixCap, MsixConfig, MsixTableEntry, MSIX_TABLE_ENTRY_SIZE};
|
2019-04-18 11:59:12 +02:00
|
|
|
|
|
|
|
/// PCI has four interrupt pins A->D.
|
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
pub enum PciInterruptPin {
|
|
|
|
IntA,
|
|
|
|
IntB,
|
|
|
|
IntC,
|
|
|
|
IntD,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl PciInterruptPin {
|
|
|
|
pub fn to_mask(self) -> u32 {
|
|
|
|
self as u32
|
|
|
|
}
|
|
|
|
}
|