Lines Matching +full:pin +full:- +full:count
1 // SPDX-License-Identifier: GPL-2.0
3 //! Rust PCI driver sample (based on QEMU's `pci-testdev`).
5 //! To make this driver probe, QEMU must be run with `-device pci-testdev`.
15 const COUNT: usize = 0xC;
31 #[pin]
47 fn testdev(index: &TestIndex, bar: &Bar0) -> Result<u32> {
54 // Write `data` to `offset` to increase `count` by one.
56 // Note that we need `try_write8`, since `offset` can't be checked at compile-time.
59 Ok(bar.read32(Regs::COUNT))
68 fn probe(pdev: &pci::Device<Core>, info: &Self::IdInfo) -> Result<Pin<KBox<Self>>> {
82 bar <- pdev.iomap_region_sized::<{ Regs::END }>(0, c_str!("rust_driver_pci")),
92 "pci-testdev data-match count: {}\n",
99 fn unbind(pdev: &pci::Device<Core>, this: Pin<&Self>) {
101 // Reset pci-testdev by writing a new test index.
109 fn drop(self: Pin<&mut Self>) {