From owner-freebsd-usb@freebsd.org Sun Mar 1 07:50:36 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D2FA261492 for ; Sun, 1 Mar 2020 07:50:36 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48Vb6f4SbWz4Fq7 for ; Sun, 1 Mar 2020 07:50:33 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 52123224AA for ; Sun, 1 Mar 2020 02:50:32 -0500 (EST) Received: from imap35 ([10.202.2.85]) by compute1.internal (MEProxy); Sun, 01 Mar 2020 02:50:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=farhan.codes; h= mime-version:message-id:date:from:to:subject:content-type; s= fm2; bh=HJIgDbQrOkga10+thVwM9t4o4BTwXpCYCPg87fZ8kZU=; b=j/CUssEt l4nGqMhgzMPAhWNZz9FOHT+K+Mg0DqgZwLJN7rg3pF7wH8YKBg8qAVk+2NkGBK5d ng855NmGRWSPp0fX4Mr7YuTo3veIoG5qjopu6IvHlTMmU4UnXhQG0zVogylRL50t qVDkpQrXJUYRCXTWlHoTbhWBElRAPucniFhkPAsAq0yq/r96dEWhWuvmARaAXJ9L FbXECPhbqp5AZNUOIP8DAdMmrABpZcPJSST+pANOrToJiGT2MBpt7kI5QJOpEPW8 UJ3srIV2KGh+LXLeB7pcbbXxLXVyVJ4/nmfp8k7NwzfNuCc8RfwU2pSY5y1w8BPu hIe1cX9rTzZWlg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=HJIgDbQrOkga10+thVwM9t4o4BTwX pCYCPg87fZ8kZU=; b=PLpyDGe8LZ1WgRWu8v/1vqUrFRXNfwatPDQqKqXuw+s90 HQdH6fLNRitusLyoi9IAHtnU8hPKl1PckEfq3OSar1MSF64qiK5jDv08Bp2PbWYh +rhuUIgWikX7FsSTYyQr1bQrcmppEAW2lLQ3Uu5RuXGRCAN4LsQd31+obxBZVV6n fS0wbnHEVCAVRP1SowDAWGEDBTJ98F4sdIipd+lRSrzTSq20sJwMpmLEM2DPlFsW VYP9Fuq9yyikULGtkJD/7+Klqzy36Ezazga2ep8OnOX3B9gCRsRU+k9bZ4WiHIE4 KC1Dw6Yuor/cVf7uU0UV6EKP+XD3mCaMEl0Q90mBw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddtuddguddtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesthdtre dtreertdenucfhrhhomhepfdfhrghrhhgrnhcumfhhrghnfdcuoehfrghrhhgrnhesfhgr rhhhrghnrdgtohguvghsqeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehfrghrhhgrnhesfhgrrhhhrghnrdgtohguvghs X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id BCF3F14C0149; Sun, 1 Mar 2020 02:50:31 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-967-g014f925-fmstable-20200226v1 Mime-Version: 1.0 Message-Id: <52e73cc5-5881-40bd-99bf-5b69f5cbcc4f@www.fastmail.com> Date: Sun, 01 Mar 2020 02:50:10 -0500 From: "Farhan Khan" To: freebsd-usb@freebsd.org Subject: Detecting if USB device pulled from machine Content-Type: text/plain X-Rspamd-Queue-Id: 48Vb6f4SbWz4Fq7 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=farhan.codes header.s=fm2 header.b=j/CUssEt; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=PLpyDGe8; dmarc=none; spf=pass (mx1.freebsd.org: domain of farhan@farhan.codes designates 66.111.4.28 as permitted sender) smtp.mailfrom=farhan@farhan.codes X-Spamd-Result: default: False [-5.08 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[farhan.codes:s=fm2,messagingengine.com:s=fm2]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[28.4.111.66.rep.mailspike.net : 127.0.0.18]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.28]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[farhan.codes]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[farhan.codes:+,messagingengine.com:+]; IP_SCORE(-3.49)[ip: (-9.85), ipnet: 66.111.4.0/24(-4.89), asn: 11403(-2.68), country: US(-0.05)]; RCVD_IN_DNSWL_LOW(-0.10)[28.4.111.66.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; RCVD_TLS_LAST(0.00)[]; MID_RHS_WWW(0.50)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2020 07:50:36 -0000 Hi all, Quick question: I am reviewing some USB code between FreeBSD and OpenBSD. In OpenBSD, there is a function called usbd_is_dying (sys/dev/usb/usbdi.c) which appears to check if a device was removed from the system. Is there an equivalent in FreeBSD? Thanks! -- Farhan Khan PGP Fingerprint: 1312 89CE 663E 1EB2 179C 1C83 C41D 2281 F8DA C0DE