From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 21 18:42:12 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B32C106566B; Mon, 21 Nov 2011 18:42:12 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8B60D8FC08; Mon, 21 Nov 2011 18:42:11 +0000 (UTC) Received: by vcbfl10 with SMTP id fl10so3017413vcb.13 for ; Mon, 21 Nov 2011 10:42:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=C5AZ9F9jmwPKdRcnShIseP+FJpeEndss3YRKdRsCXkQ=; b=b2TfhYSmWhlslc9RmwVYH0GhSy5VNWAHuM43+JQ3eFxxPYnC/mciflcmnFOPVFAzL7 D4uagbsHJnCAx4opvW656r4GdYvk68L0lWQj5NyiZgGdgPDgFaj7PiNY2c/F1rWJCcsi ZlyA5TUMcBcw6HqQOUDnDxBUYob7hPfhJPCI0= MIME-Version: 1.0 Received: by 10.52.65.77 with SMTP id v13mr16439341vds.95.1321900930857; Mon, 21 Nov 2011 10:42:10 -0800 (PST) Received: by 10.52.101.132 with HTTP; Mon, 21 Nov 2011 10:42:10 -0800 (PST) In-Reply-To: <201111211126.15627.jhb@freebsd.org> References: <201111211126.15627.jhb@freebsd.org> Date: Mon, 21 Nov 2011 18:42:10 +0000 Message-ID: From: "Paul B. Mahol" To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org, FreeBSD-Current Subject: Re: Reprobing of devices after module load? 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: Mon, 21 Nov 2011 18:42:12 -0000 On 11/21/11, John Baldwin wrote: > On Friday, November 18, 2011 11:48:20 am Paul B. Mahol wrote: >> Hi, >> >> Is there nice way in FreeBSD to force reprobe of devices for specific >> driver like it is done when kernel module is loaded (via >> DRIVER_MODULE(...) stuff)? > > Note that those probes happen for specific buses rather than for specific > drivers. The routine that does this currently is static > (devclass_driver_added() in sys/kern/subr_bus.c). What specific problem are > you trying to solve? You might be able to use BUS_DRIVER_ADDED() or > device_probe_and_attach() to achieve what you are trying to do. I have changed NDISulator to load 3rd party *.SYS from userspace via ioctl on /dev/ndis. For now i can do reprobe by reloading if_ndis.ko module. Loading if_ndis.ko ideally should not cause reprobe but reprobe should be done after ioctl on /dev/ndis. Perhaps devclass_add_driver from sys/kern/subr_bus can do this?