shithub: riscv

Download patch

ref: e182ec11fb0b4e90d69f94dc5020deed505bf33a
parent: 354273938c80121158db1a9ac87556ddcb1d024c
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Sep 16 20:16:24 EDT 2023

devip: automatically unbind interface on read errors

netdevmedium and ethermedium should unbind the interface
if one of the reader procs encounters an error,
such as a usb ethernet device being un-plugged.

netdevmedium already attempted something like this,
but without considering the locking as we need to
acquire the ipifc conv qlock for adjusting the
inuse ref counter.

this change adds a mediumunbindifc() function to
be used by the medium to unbind from its interface
asynchronously from its reader procs.

the call eigther succeeds (returning nil)
meaning the Medium.unbind function was executed
and the auxiolary structure has been freed,
or retunrs an error (when Medium.unbind was called
before) and we just clear our Proc* pointer.