From owner-freebsd-questions@freebsd.org Tue Sep 26 14:31:10 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DD57E0D3A6; Tue, 26 Sep 2017 14:31:10 +0000 (UTC) (envelope-from tomek.cedro@gmail.com) Received: from mail-vk0-x22e.google.com (mail-vk0-x22e.google.com [IPv6:2607:f8b0:400c:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 582D267ED3; Tue, 26 Sep 2017 14:31:10 +0000 (UTC) (envelope-from tomek.cedro@gmail.com) Received: by mail-vk0-x22e.google.com with SMTP id q190so3770802vkd.13; Tue, 26 Sep 2017 07:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to; bh=xOyPwskdA6frPfhl6cBxoZKMMwQaEftRLifWMR8Ncno=; b=avVXNe5VWCBBkq7v1cxm2y0XSa3BkALeDIF3bxPVGCN5sI/58VoDC39VrrO4Tgyem3 li5J+jIzpB2xhXcdQMM0dkrf40Ox5FkpeOuRZjr+yDeufWE+G2vbmI8JeJBqkPt7T/XV G2zdhm4FJJARbTlDJ6JLjrJU4lx2WmY4CpwGK8ikSRFx3oOH4SouxZjSvwHjFeFki2Tk UjpVbBfzZVi79CPtfmZptb2MwoaGHDgx7dNDuRsUqxCFqOoD7cz3AYS0FwjT5M3AIvW3 uERop2rX4ISs1I1/XWn1nW+aWxEpETDwb0zlHK6CI2VV+g1kULIEThbdryHDRInNoofw DP7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=xOyPwskdA6frPfhl6cBxoZKMMwQaEftRLifWMR8Ncno=; b=LbaTKmG9krDkQf9EJQVYmMp2pojZ+no2+g0wl9xnR2il0meu7CrMJTZZvWjM2CCFY8 4foxl5BGt6qtFVdUtMKyVCTCuCRGsdY1coNzuQx33PVVbF3XocsFiQgDmCik+ietYFVM +LtEE1Ikor+6HNBya5d42qEMcY0EpJWvpjQkyJ0q5ix4Y9sRpPjGQouWowPSVPSVgIvm SsILTmjevvmmkbZHHi7iQZ8/tDoYWxNd2B0PQPX/f7NKSbnP5BEQIsSZAbmb/cLQLrmE 4p0IJW38UL+zGScH3ZGZIrq/huL/AVVtiPtCFf8UuUbO5r1E/KN1yKb4drvs6XmvHFRo 8HwQ== X-Gm-Message-State: AHPjjUg3s3FtsHqH6rSpCKzgY8qjfYx3Fy11aGuDE70/oCU0vI4RZ0x1 v5iqc5EUqPIpo/F4a+yy/ZBhAapc+z1Vw5/CfptPLviB X-Google-Smtp-Source: AOwi7QDgjFWC763/FKwkvDLLgh+6O5yYvf+DiUJHJtmWdtAwgwutANhwKCu0hpATCwLElhv5R9/WwIFp2h38KgsYrEE= X-Received: by 10.31.167.71 with SMTP id q68mr8547908vke.49.1506436268722; Tue, 26 Sep 2017 07:31:08 -0700 (PDT) MIME-Version: 1.0 Sender: tomek.cedro@gmail.com Received: by 10.176.20.35 with HTTP; Tue, 26 Sep 2017 07:30:48 -0700 (PDT) From: Tomasz CEDRO Date: Tue, 26 Sep 2017 16:30:48 +0200 X-Google-Sender-Auth: Tg_bzUrjNgVbqxK-3ZkuZSzZj94 Message-ID: Subject: USB Device self-umount To: FreeBSD Questions Mailing List , "freebsd-usb@FreeBSD.org" , freebsd-hardware@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Sep 2017 14:31:10 -0000 Hello world! :-) I am working on a device that implements USB MSC mass storage for firmware programming [1]. After receiving file, it flashes the firmware image to the target MCU, then reboots and starts the program or waits debug session.. The question is how to gracefully self-umount from a device point of view in a way not to confuse automounter and/or usb / mass storage drivers? Is there any way of doing that in SCSI+USB? Something like CD-ROM eject, then device removal.. Any hints appreciated :-) Tomek [1] https://github.com/mbedmicro/DAPLink -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info