1 // Copyright 2017 The Fuchsia Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include <ddk/binding.h>
6 #include <ddk/device.h>
7 #include <ddk/driver.h>
8 #include <zircon/types.h>
9 
10 // Callback for devmgr to instantiate the zxcrypt::Device when ioctl_device_bind is called on a
11 // previously formatted block device.
12 extern zx_status_t zxcrypt_device_bind(void* ctx, zx_device_t* parent);
13 
14 static zx_driver_ops_t zxcrypt_driver_ops = {
15     .version = DRIVER_OPS_VERSION,
16     .bind = zxcrypt_device_bind,
17 };
18 
19 // clang-format off
20 ZIRCON_DRIVER_BEGIN(zxcrypt, zxcrypt_driver_ops, "zircon", "0.1", 2)
21     BI_ABORT_IF_AUTOBIND,
22     BI_MATCH_IF(EQ, BIND_PROTOCOL, ZX_PROTOCOL_BLOCK),
23 ZIRCON_DRIVER_END(zxcrypt)
24