Date: Sat, 15 Mar 2003 20:06:33 +0100 (CET) From: Soeren Schmidt <sos@spider.deepcore.dk> To: der_julian@web.de Cc: freebsd-current@FreeBSD.ORG Subject: Re: SiS5591(?) ATA Message-ID: <200303151906.h2FJ6Xn5058390@spider.deepcore.dk> In-Reply-To: <XFMail.20030315185549.der_julian@web.de>
next in thread | previous in thread | raw e-mail | index | archive | help
It seems der_julian@web.de wrote:
>
> On 15-Mar-2003 Soeren Schmidt wrote:
> > Please make sure that ata-chipset.c is rev 1.14 which corrected a
> > bug in the chip ident function...
>
> ata-chipset.c 1.14 was checked in on March 12 my kernel is from two days after.
> So I guess it is included. I cvsuped the same sources I used to compile my
> current system and it is 1.14.
Hmm, OK, try this patch:
Index: ata-chipset.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-chipset.c,v
retrieving revision 1.14
diff -u -r1.14 ata-chipset.c
--- ata-chipset.c 12 Mar 2003 15:45:52 -0000 1.14
+++ ata-chipset.c 15 Mar 2003 19:02:13 -0000
@@ -95,8 +95,8 @@
static void ata_sis_setmode(struct ata_device *, int);
static int ata_mode2idx(int);
static int ata_check_80pin(struct ata_device *, int);
-static int ata_find_dev(device_t, u_int32_t, u_int32_t);
-static struct ata_chip_id *ata_match_chip(device_t, struct ata_chip_id *);
+static int ata_find_dev(device_t, u_int32_t, u_int32_t, int);
+static struct ata_chip_id *ata_match_chip(device_t, struct ata_chip_id *, int);
static int ata_default_interrupt(device_t);
static void ata_pci_serialize(struct ata_channel *, int);
@@ -171,7 +171,7 @@
{ 0, 0, 0, 0, 0, 0}};
char buffer[64];
- if (!(idx = ata_match_chip(dev, ids)))
+ if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev))))
return ENXIO;
sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -321,7 +321,7 @@
{ 0, 0, 0, 0, 0, 0}};
char buffer[64];
- if (!(idx = ata_match_chip(dev, ids)))
+ if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev))))
return ENXIO;
sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -428,7 +428,7 @@
{ 0, 0, 0, 0, 0, 0}};
char buffer[64];
- if (!(idx = ata_match_chip(dev, ids)))
+ if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev))))
return ENXIO;
sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -601,7 +601,7 @@
{ 0, 0, 0, 0, 0, 0}};
char buffer[64];
- if (!(idx = ata_match_chip(dev, ids)))
+ if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev))))
return ENXIO;
sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -768,7 +768,7 @@
{ 0, 0, 0, 0, 0, 0}};
char buffer[64];
- if (!(idx = ata_match_chip(dev, ids)))
+ if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev))))
return ENXIO;
sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -887,7 +887,7 @@
{ 0, 0, 0, 0, 0, 0}};
char buffer[64];
- if (!(idx = ata_match_chip(dev, ids)))
+ if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev))))
return ENXIO;
sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -944,7 +944,7 @@
char *desc, buffer[64];
uintptr_t devid = 0;
- if (!(idx = ata_match_chip(dev, ids)))
+ if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev))))
return ENXIO;
/* if we are on a SuperTrak SX6000 dont attach */
@@ -1188,7 +1188,7 @@
{ 0, 0, 0, 0, 0, 0}};
char buffer[64];
- if (!(idx = ata_match_chip(dev, ids)))
+ if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev))))
return ENXIO;
sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -1276,7 +1276,7 @@
{ 0, 0, 0, 0, 0, 0}};
char buffer[64];
- if (!(idx = ata_match_chip(dev, ids)))
+ if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev))))
return ENXIO;
sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -1501,7 +1501,7 @@
{ 0, 0, 0, 0, 0, 0 }};
char buffer[64];
- if (!(idx = ata_match_chip(dev, ids)))
+ if (!(idx = ata_match_chip(dev, ids, -1)))
return ENXIO;
if (idx->cfg1 == SIS_SOUTH) {
@@ -1511,7 +1511,7 @@
sprintf(buffer, "SiS 96X %s controller",ata_mode2str(idx->max_dma));
}
else {
- if (ata_find_dev(dev, ATA_SISSOUTH, 0x10))
+ if (ata_find_dev(dev, ATA_SISSOUTH, 0x10, pci_get_slot(dev)))
idx->cfg1 = SIS133OLD;
else {
idx->max_dma = ATA_UDMA5;
@@ -1659,7 +1659,7 @@
{ 0, 0, 0, 0, 0, 0 }};
char buffer[64];
- if (!(idx = ata_match_chip(dev, ids)))
+ if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev))))
return ENXIO;
sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -1808,16 +1808,16 @@
}
static int
-ata_find_dev(device_t dev, u_int32_t devid, u_int32_t revid)
+ata_find_dev(device_t dev, u_int32_t devid, u_int32_t revid, int slot)
{
device_t *children;
- int nchildren, i, slot = pci_get_slot(dev);
+ int nchildren, i;
if (device_get_children(device_get_parent(dev), &children, &nchildren))
return 0;
for (i = 0; i < nchildren; i++) {
- if (pci_get_slot(children[i]) == slot &&
+ if (((slot >= 0 && pci_get_slot(children[i]) == slot) || slot < 0) &&
pci_get_devid(children[i]) == devid &&
pci_get_revid(children[i]) >= revid) {
free(children, M_TEMP);
@@ -1829,10 +1829,10 @@
}
static struct ata_chip_id *
-ata_match_chip(device_t dev, struct ata_chip_id *index)
+ata_match_chip(device_t dev, struct ata_chip_id *index, int slot)
{
while (index->chiptype != 0) {
- if (ata_find_dev(dev, index->chiptype, index->chiprev))
+ if (ata_find_dev(dev, index->chiptype, index->chiprev, slot))
return index;
index++;
}
-Søren
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303151906.h2FJ6Xn5058390>
