Heads up: checking in change to ata-card.c
M. Warner Losh
imp at bsdimp.com
Thu Jun 26 12:14:26 PDT 2003
Here's a better patch, basesd on wpaul's input. Bill, can you try it
an see if it works for you? If so, i would be better to commit this
one. If not, I'll work with you to fix it.
If you are uninterested in working with us to get things in, then your
patch will not lasts the evening as such an approach is unacceptibe.
Warner
Index: ata-card.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-card.c,v
retrieving revision 1.14
diff -u -r1.14 ata-card.c
--- ata-card.c 17 Jun 2003 12:33:53 -0000 1.14
+++ ata-card.c 26 Jun 2003 19:12:34 -0000
@@ -44,17 +44,26 @@
#include <dev/pccard/pccardvar.h>
#include <dev/pccard/pccarddevs.h>
-static const struct pccard_product ata_pccard_products[] = {
+struct ata_pccard_product
+{
+ struct pccard_product p;
+ u_int flags;
+#define ONE_REGION 1
+};
+
+
+
+static const struct ata_pccard_product ata_pccard_products[] = {
/* NetBSD has a few others that need to migrate into pccarddevs */
/* XXX */
- PCMCIA_CARD(FREECOM, PCCARDIDE, 0),
- PCMCIA_CARD(EXP, EXPMULTIMEDIA, 0),
- PCMCIA_CARD(IODATA, CBIDE2, 0),
- PCMCIA_CARD(OEM2, CDROM1, 0),
- PCMCIA_CARD(OEM2, IDE, 0),
- PCMCIA_CARD(PANASONIC, KXLC005, 0),
- PCMCIA_CARD(TEAC, IDECARDII, 0),
- {NULL}
+ { PCMCIA_CARD(FREECOM, PCCARDIDE, 0), 0 },
+ { PCMCIA_CARD(EXP, EXPMULTIMEDIA, 0), 0 },
+ { PCMCIA_CARD(IODATA, CBIDE2, 0), 0 },
+ { PCMCIA_CARD(OEM2, CDROM1, 0), 0 },
+ { PCMCIA_CARD(OEM2, IDE, 0), 0 },
+ { PCMCIA_CARD(PANASONIC, KXLC005, 0), 0 },
+ { PCMCIA_CARD(TEAC, IDECARDII, 0), ONE_REGION},
+ { {NULL}, 0}
};
static int
@@ -73,7 +82,7 @@
return (0);
/* Match other devices here, primarily cdrom/dvd rom */
- if ((pp = pccard_product_lookup(dev, ata_pccard_products,
+ if ((pp = pccard_product_lookup(dev, &ata_pccard_products[0].p,
sizeof(ata_pccard_products[0]), NULL)) != NULL) {
if (pp->pp_name)
device_set_desc(dev, pp->pp_name);
@@ -96,6 +105,7 @@
static int
ata_pccard_probe(device_t dev)
{
+ const struct ata_pccard_product *ap;
struct ata_channel *ch = device_get_softc(dev);
struct resource *io, *altio;
int i, rid, len, start, end;
@@ -116,12 +126,16 @@
io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
start, end, ATA_IOSIZE, RF_ACTIVE);
+ ap = (const struct ata_pccard_product *)pccard_product_lookup(dev,
+ &ata_pccard_products[0].p, sizeof(ata_pccard_products[0]), NULL);
+
/*
* if we got more than the default ATA_IOSIZE ports, this is likely
* a pccard system where the altio ports are located at offset 14
* otherwise its the normal altio offset
*/
- if (bus_get_resource(dev, SYS_RES_IOPORT, ATA_ALTADDR_RID, &tmp, &tmp)) {
+ if ((ap == NULL || (ap->flags & ONE_REGION) != 0) &&
+ bus_get_resource(dev, SYS_RES_IOPORT, ATA_ALTADDR_RID, &tmp, &tmp)) {
if (len > ATA_IOSIZE) {
bus_set_resource(dev, SYS_RES_IOPORT, ATA_ALTADDR_RID,
start + ATA_PCCARD_ALTOFFSET, ATA_ALTIOSIZE);
More information about the freebsd-current
mailing list