Skip to content

Commit c379070

Browse files
EricRahmCQ Bot
authored andcommitted
[netdevice] Add eventpair variant to DelegatedRxLease
Add support for `zx.Handle:EVENT`-based event tokens to `DelegatedRxLease`. This allows `DelegatedRxLease` to hold the latest format of `LeaseToken` provided by the system `ActivityGovernor`. Bug: 466406261 Test: fx lsc presubmit Change-Id: I32b0a8bb499e6035636617e84e72a1174c709c1e Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1441103 API-Review: Bruno Dal Bo <brunodalbo@google.com> Reviewed-by: Bruno Dal Bo <brunodalbo@google.com> Commit-Queue: Eric Rahm <erahm@google.com>
1 parent 94d1a94 commit c379070

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"fidl/fuchsia.hardware.network": "a9e6cec0381f284a40084b7c21743ee5"
2+
"fidl/fuchsia.hardware.network": "81341dd7df98ad5985dfc6f4cdde4a35"
33
}

sdk/fidl/fuchsia.hardware.network/session.fidl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,5 +204,10 @@ type DelegatedRxLease = resource table {
204204
///
205205
/// Close the channel to release the lease.
206206
1: channel zx.Handle:CHANNEL;
207+
/// An eventpair representing a lease.
208+
///
209+
/// Close the eventpair to release the lease.
210+
2: eventpair
211+
zx.Handle:<EVENTPAIR, zx.Rights.TRANSFER | zx.Rights.DUPLICATE | zx.Rights.WAIT>;
207212
};
208213
};

src/connectivity/lib/network-device/rust/src/session/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,9 @@ impl Drop for RxLease {
801801
netdev::DelegatedRxLeaseHandle::Channel(_channel) => {
802802
// Dropping the channel is enough to relinquish the lease.
803803
}
804+
netdev::DelegatedRxLeaseHandle::Eventpair(_eventpair) => {
805+
// Dropping the eventpair is enough to relinquish the lease.
806+
}
804807
netdev::DelegatedRxLeaseHandle::__SourceBreaking { .. } => {}
805808
}
806809
}

src/connectivity/network/drivers/network-device/device/device_interface.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,6 +1479,7 @@ void DeviceInterface::DropDelegatedRxLease(netdev::DelegatedRxLease lease) {
14791479
// simply destroying the natural type is not enough to drop the lease.
14801480
switch (lease.handle()->Which()) {
14811481
case netdev::DelegatedRxLeaseHandle::Tag::kChannel:
1482+
case netdev::DelegatedRxLeaseHandle::Tag::kEventpair:
14821483
case netdev::DelegatedRxLeaseHandle::Tag::_do_not_handle_this__write_a_default_case_instead:
14831484
break;
14841485
}

0 commit comments

Comments
 (0)