From owner-freebsd-mobile Fri Apr 7 23: 9:22 2000 Delivered-To: freebsd-mobile@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id AC17F37BAB3; Fri, 7 Apr 2000 23:09:18 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id AAA09102; Sat, 8 Apr 2000 00:09:17 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id AAA09623; Sat, 8 Apr 2000 00:08:23 -0600 (MDT) Message-Id: <200004080608.AAA09623@harmony.village.org> To: mobile@freebsd.org Cc: mdodd@freebsd.org Subject: Two pccards in the tree for a while Date: Sat, 08 Apr 2000 00:08:23 -0600 From: Warner Losh Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I've been thinking about driver attachments in the NEWCARD world. I'd like to make them as compatible as I can to the oldcard world. To that end, I'd like to propose a small addition to each of the pccard driver attachments in anticipation of NEWCARD. Right now the typical pccard_probe routine looks like one of the following: foo_pccard_probe(device_t dev) { device_set_description(dev, "foo pccard thing"); return 0; } or foo_pccard_probe(device_t dev) { return foo_probe(dev); } Where foo_probe might be expanded inline foo_pccard_probe. I'd like to propose a small addition. I'd like to move to primarily identifying the cards by their OEM number and OEM ID (these numbers are similar to the pci vendor codes). Each driver would have a table of IDs that they support. So the above driver's probe routines would turn into foo_pccard_probe(device_t dev) { if (pccard_probe_vendor_id(dev, &foo_vendor_table)) return ENXIO; /* Optionally probe the hardware here */ device_set_description(dev, "foo card thang"); return 0; } I'd also provide a pccard_probe_fucntion_id() as well for ata and sio to use. For existing pccard drivers, the changes are trivial to have them continue to work with OLDCARD. More work if you want to get a good, accurate list of vendor ids, but NetBSD can be a good place to look. I may also provide a pccard_probe_cis_strings() routine, since I know there are some cards that are only identifiable by their CIS strings, but these are few and far between. Of course, it is highly desirable to have the ability for a driver to read its own CIS in various ways, and as that is accomplished, the results will be available in both OLDCARD and NEWCARD. The xe driver is the only one right now that does this, but there are other drivers that would like to do this, but they have pccardd provide them with information at the moment for things like ethernet address. However, in the old world order, pccardd desides what card gets what drivers. So, these new functions would be implemented as return 0; in OLDCARD so that we can use the same drivers (in source) for both the old and new code. There may be other problems that crop up along the way. This is the only one that I'm seeing on my horizon right now, so I thought I'd get people talking about these issues before I get to the point of needing to jump on them. I have the CIS reading code approaching completion and I think the next thing after that is driver attachment. I'll know more in a few days. I think the transition period in -current is going to be long enough that these issues are important. It would also be nice if we can use the same or substantially drivers in -stable and -current for as long as possible. Comments? Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message