Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Oct 1997 14:55:09 -0700
From:      John-Mark Gurney <gurney_j@efn.org>
To:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   how to provide bus specific probe routine
Message-ID:  <19971012145509.41987@hydrogen.nike.efn.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971012145509.41987>