From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 11 17:54:31 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4ADA216A4DD for ; Fri, 11 Aug 2006 17:54:31 +0000 (UTC) (envelope-from jchoque@tlmat.unican.es) Received: from luna.tlmat.unican.es (luna.tlmat.unican.es [193.144.186.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 94AB243D4C for ; Fri, 11 Aug 2006 17:54:29 +0000 (GMT) (envelope-from jchoque@tlmat.unican.es) Received: from Altair (altair.tlmat.unican.es [193.144.186.43]) by luna.tlmat.unican.es (8.12.11/8.12.11) with ESMTP id k7BHSMAk004502 for ; Fri, 11 Aug 2006 19:28:22 +0200 From: "Johnny Choque" To: Date: Fri, 11 Aug 2006 19:56:27 +0200 Message-ID: <00bb01c6bd6f$77c8ddb0$2bba90c1@Altair> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 Thread-Index: Aca9b3eZafrLKPswTweDOslZeF3+WA== Subject: Attach/detach devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Aug 2006 17:54:31 -0000 Hi, I'm trying to do a userland program that detect the event when a device is attached/detached. In particular, I would like to detect these events for wireless pc card insertion/ejection or when tear down the connection of the wireless interface build-in laptop. I've found that functions device_attach/device_detach are used by the kernel when a device is attached/detached respectively, and, e.g, when a device is detached "a notification event is sent to userland for user-based device management service", how can I use that notification event in my userland program? Could you give me some ideas to do my program? Cheers, Johnny