blob: 707df31dc821c4cb3e1cf16fd5b4fb05f7a3f63e [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.nand;
using fuchsia.hardware.nand;
using zx;
// Defines a Read/Write/Erase request to be sent to the nand driver.
struct BrokerRequest {
handle<vmo>? vmo; // Only used for read and write.
uint32 length; // In pages (read / write) or blocks (erase).
uint32 offset_nand; // In pages (read / write) or blocks (erase).
uint64 offset_data_vmo; // In pages.
uint64 offset_oob_vmo; // In pages.
bool data_vmo; // True to read or write data.
bool oob_vmo; // True to read or write OOB data.
};
[Layout = "Simple"]
interface Broker {
// Retrieves the nand info from the underlying device.
1: GetInfo() -> (zx.status status, fuchsia.hardware.nand.Info? info);
// Reads from the nand device.
2: Read(BrokerRequest request) -> (zx.status status, uint32 corrected_bit_flips);
// Writes to the nand device.
3: Write(BrokerRequest request) -> (zx.status status);
// Erases part of the nand device.
4: Erase(BrokerRequest request) -> (zx.status status);
};