From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 13 19:00:26 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 A2700106564A for ; Mon, 13 Jun 2011 19:00:24 +0000 (UTC) (envelope-from yanegomi@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 609678FC13 for ; Mon, 13 Jun 2011 19:00:24 +0000 (UTC) Received: by vxc34 with SMTP id 34so5610673vxc.13 for ; Mon, 13 Jun 2011 12:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=6/2TJC1FtXlLKAelXGYPPKRputWZ/xollKepW1OICfk=; b=jstjlOID5SMoIO0EZ4U1qLZWNxq9DiN2llH3iK4WhQnX7EhgPb3Vo7dBnoLiLEyAQz dpx8lgm48nuCIqCEjqeokLzhx6Gj3+FQCh2AV9E3HSqToHWo8HALtlvQlTInVF8uJWvE cKWbIv/pe36Ojo5n/rBw3jCjWaq40f/BSu9ZM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=F1ZK9SYFnhhFnGUBnhCaWWIGLi+FT4ErBGQUiZPZsGGYQzS5yvT5vQNNWnaUCjhGL6 JaiymcRbCyIdXdYeWlnZhiGNUGEVxSqWU7P7W4XBAx42rn7XhD7XgJvLsBYemezzXjSw MzR+8vuP3TylZkotmK1eF9Lk7NtwihnXx6CAc= MIME-Version: 1.0 Received: by 10.220.187.76 with SMTP id cv12mr2199756vcb.128.1307991623567; Mon, 13 Jun 2011 12:00:23 -0700 (PDT) Received: by 10.220.189.202 with HTTP; Mon, 13 Jun 2011 12:00:23 -0700 (PDT) Date: Mon, 13 Jun 2011 12:00:23 -0700 Message-ID: From: Garrett Cooper To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Opening a character device from a helper driver? 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, 13 Jun 2011 19:00:27 -0000 Hi, Just to confirm whether or not this is the best way, say I had a module foo(4) that pokes at /dev/bar0, which is attached to bar(4). Should I setup the foo(4) driver with the same class as bar(4) and use KPIs like device_get_parent(9) to get the device_t structure and pass it along to bar(4)'s helper/ioctl functions, or is there a better way to skin the proverbial cat? I'm basing this observation off what I see in /sys/dev/uart_bus_puc.c . Thanks! -Garrett