From owner-freebsd-hackers Sun Oct 12 14:56:47 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id OAA19430 for hackers-outgoing; Sun, 12 Oct 1997 14:56:47 -0700 (PDT) (envelope-from owner-freebsd-hackers) Received: from hydrogen.nike.efn.org (resnet.uoregon.edu [128.223.170.28]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id OAA19425 for ; Sun, 12 Oct 1997 14:56:43 -0700 (PDT) (envelope-from gurney_j@efn.org) Received: (from jmg@localhost) by hydrogen.nike.efn.org (8.8.7/8.8.7) id OAA02214; Sun, 12 Oct 1997 14:55:24 -0700 (PDT) Message-ID: <19971012145509.41987@hydrogen.nike.efn.org> Date: Sun, 12 Oct 1997 14:55:09 -0700 From: John-Mark Gurney To: FreeBSD Hackers Subject: how to provide bus specific probe routine Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.69 Reply-To: John-Mark Gurney Organization: Cu Networking X-Operating-System: FreeBSD 2.2.1-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk well.. I'm working on a new bus/device code, and right now I'm trying to decide how to handle the probing of the device on the bus... right now there are a few options that we can go with: a) have one set of probe/attach/detach set per device, and have the device specific code look at the bus it's attached to and act appropriately... this would require to much code in each device that should be part of the generic bus code b) provide a way to specify which bus a set of probe/attach/detach functions belong to.. possibly taking NULL to mean try all.. this would work nicely, but end up duplicating strings (unless gcc will combine similar strings) c) possibly provide a specific structure that defines all the different bus and sets that it supports like: struct deviceinfo { char *name; int busnum; struct busspecific[busnum] { probe/attach/detach }; } personally I'm leaning to b as then we would be able to have one large listing of all supported devices along with their routines... comments? suggestions? -- John-Mark Gurney Modem/FAX: +1 541 683 6954 Cu Networking Live in Peace, destroy Micro$oft, support free software, run FreeBSD