mirror of
https://github.com/opnsense/src.git
synced 2026-02-18 18:20:26 -05:00
ata: Use device_set_descf()
No functional change intended. MFC after: 1 week (cherry picked from commit 25b839dfd2aa60640c7b92abc69b11c107a95020)
This commit is contained in:
parent
6324f02689
commit
19d8708817
5 changed files with 22 additions and 32 deletions
|
|
@ -61,7 +61,6 @@ int
|
|||
ata_pci_probe(device_t dev)
|
||||
{
|
||||
struct ata_pci_controller *ctlr = device_get_softc(dev);
|
||||
char buffer[64];
|
||||
|
||||
/* is this a storage class device ? */
|
||||
if (pci_get_class(dev) != PCIC_STORAGE)
|
||||
|
|
@ -71,8 +70,7 @@ ata_pci_probe(device_t dev)
|
|||
if (pci_get_subclass(dev) != PCIS_STORAGE_IDE)
|
||||
return (ENXIO);
|
||||
|
||||
sprintf(buffer, "%s ATA controller", ata_pcivendor2str(dev));
|
||||
device_set_desc_copy(dev, buffer);
|
||||
device_set_descf(dev, "%s ATA controller", ata_pcivendor2str(dev));
|
||||
ctlr->chipinit = ata_generic_chipinit;
|
||||
|
||||
/* we are a low priority handler */
|
||||
|
|
@ -836,12 +834,10 @@ void
|
|||
ata_set_desc(device_t dev)
|
||||
{
|
||||
struct ata_pci_controller *ctlr = device_get_softc(dev);
|
||||
char buffer[128];
|
||||
|
||||
sprintf(buffer, "%s %s %s controller",
|
||||
device_set_descf(dev, "%s %s %s controller",
|
||||
ata_pcivendor2str(dev), ctlr->chip->text,
|
||||
ata_mode2str(ctlr->chip->max_dma));
|
||||
device_set_desc_copy(dev, buffer);
|
||||
}
|
||||
|
||||
const struct ata_chip_id *
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ ata_highpoint_probe(device_t dev)
|
|||
{ ATA_HPT366, 0x00, HPT_366, HPT_OLD, ATA_UDMA4, "HPT366" },
|
||||
{ ATA_HPT302, 0x01, HPT_372, 0, ATA_UDMA6, "HPT302" },
|
||||
{ 0, 0, 0, 0, 0, 0}};
|
||||
char buffer[64];
|
||||
const char *channel;
|
||||
|
||||
if (pci_get_vendor(dev) != ATA_HIGHPOINT_ID)
|
||||
return ENXIO;
|
||||
|
|
@ -90,16 +90,15 @@ ata_highpoint_probe(device_t dev)
|
|||
if (!(idx = ata_match_chip(dev, ids)))
|
||||
return ENXIO;
|
||||
|
||||
strcpy(buffer, "HighPoint ");
|
||||
strcat(buffer, idx->text);
|
||||
channel = "";
|
||||
if (idx->cfg1 == HPT_374) {
|
||||
if (pci_get_function(dev) == 0)
|
||||
strcat(buffer, " (channel 0+1)");
|
||||
if (pci_get_function(dev) == 1)
|
||||
strcat(buffer, " (channel 2+3)");
|
||||
channel = " (channel 0+1)";
|
||||
else if (pci_get_function(dev) == 1)
|
||||
channel = " (channel 2+3)";
|
||||
}
|
||||
sprintf(buffer, "%s %s controller", buffer, ata_mode2str(idx->max_dma));
|
||||
device_set_desc_copy(dev, buffer);
|
||||
device_set_descf(dev, "Highpoint %s%s %s controller",
|
||||
idx->text, channel, ata_mode2str(idx->max_dma));
|
||||
ctlr->chip = idx;
|
||||
ctlr->chipinit = ata_highpoint_chipinit;
|
||||
return (BUS_PROBE_LOW_PRIORITY);
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ ata_jmicron_probe(device_t dev)
|
|||
{ ATA_JMB368, 0, 0, 1, ATA_UDMA6, "JMB368" },
|
||||
{ ATA_JMB368_2, 0, 0, 1, ATA_UDMA6, "JMB368" },
|
||||
{ 0, 0, 0, 0, 0, 0}};
|
||||
char buffer[64];
|
||||
|
||||
if (pci_get_vendor(dev) != ATA_JMICRON_ID)
|
||||
return ENXIO;
|
||||
|
|
@ -81,9 +80,8 @@ ata_jmicron_probe(device_t dev)
|
|||
if (!(idx = ata_match_chip(dev, ids)))
|
||||
return ENXIO;
|
||||
|
||||
sprintf(buffer, "JMicron %s %s controller",
|
||||
device_set_descf(dev, "JMicron %s %s controller",
|
||||
idx->text, ata_mode2str(idx->max_dma));
|
||||
device_set_desc_copy(dev, buffer);
|
||||
ctlr->chip = idx;
|
||||
ctlr->chipinit = ata_jmicron_chipinit;
|
||||
return (BUS_PROBE_LOW_PRIORITY);
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ ata_promise_probe(device_t dev)
|
|||
{ ATA_PDC40719, 0, PR_MIO, PR_SATA2, ATA_SA300, "PDC40719" },
|
||||
{ ATA_PDC40779, 0, PR_MIO, PR_SATA2, ATA_SA300, "PDC40779" },
|
||||
{ 0, 0, 0, 0, 0, 0}};
|
||||
char buffer[64];
|
||||
const char *channel;
|
||||
uintptr_t devid = 0;
|
||||
|
||||
if (pci_get_vendor(dev) != ATA_PROMISE_ID)
|
||||
|
|
@ -183,10 +183,8 @@ ata_promise_probe(device_t dev)
|
|||
devid == ATA_I960RM)
|
||||
return ENXIO;
|
||||
|
||||
strcpy(buffer, "Promise ");
|
||||
strcat(buffer, idx->text);
|
||||
|
||||
/* if we are on a FastTrak TX4, adjust the interrupt resource */
|
||||
channel = NULL;
|
||||
if ((idx->cfg2 & PR_TX4) && pci_get_class(GRANDPARENT(dev))==PCIC_BRIDGE &&
|
||||
!BUS_READ_IVAR(device_get_parent(GRANDPARENT(dev)),
|
||||
GRANDPARENT(dev), PCI_IVAR_DEVID, &devid) &&
|
||||
|
|
@ -195,18 +193,18 @@ ata_promise_probe(device_t dev)
|
|||
|
||||
if (pci_get_slot(dev) == 1) {
|
||||
bus_get_resource(dev, SYS_RES_IRQ, 0, &start, &end);
|
||||
strcat(buffer, " (channel 0+1)");
|
||||
channel = " (channel 0+1)";
|
||||
}
|
||||
else if (pci_get_slot(dev) == 2 && start && end) {
|
||||
bus_set_resource(dev, SYS_RES_IRQ, 0, start, end);
|
||||
strcat(buffer, " (channel 2+3)");
|
||||
channel = " (channel 2+3)";
|
||||
}
|
||||
else {
|
||||
start = end = 0;
|
||||
}
|
||||
}
|
||||
sprintf(buffer, "%s %s controller", buffer, ata_mode2str(idx->max_dma));
|
||||
device_set_desc_copy(dev, buffer);
|
||||
device_set_descf(dev, "Promise %s%s %s controller", idx->text,
|
||||
channel == NULL ? "" : channel, ata_mode2str(idx->max_dma));
|
||||
ctlr->chip = idx;
|
||||
ctlr->chipinit = ata_promise_chipinit;
|
||||
return (BUS_PROBE_LOW_PRIORITY);
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ ata_sis_probe(device_t dev)
|
|||
{ 0, 0, 0, 0, 0, 0 }};
|
||||
static struct ata_chip_id id[] =
|
||||
{{ ATA_SISSOUTH, 0x10, 0, 0, 0, "" }, { 0, 0, 0, 0, 0, 0 }};
|
||||
char buffer[64];
|
||||
int found = 0;
|
||||
|
||||
if (pci_get_class(dev) != PCIC_STORAGE)
|
||||
|
|
@ -123,8 +122,8 @@ ata_sis_probe(device_t dev)
|
|||
memcpy(&id[0], idx, sizeof(id[0]));
|
||||
id[0].cfg1 = SIS_133NEW;
|
||||
id[0].max_dma = ATA_UDMA6;
|
||||
sprintf(buffer, "SiS 962/963 %s controller",
|
||||
ata_mode2str(idx->max_dma));
|
||||
device_set_descf(dev, "SiS 962/963 %s controller",
|
||||
ata_mode2str(idx->max_dma));
|
||||
}
|
||||
pci_write_config(dev, 0x57, reg57, 1);
|
||||
}
|
||||
|
|
@ -141,17 +140,17 @@ ata_sis_probe(device_t dev)
|
|||
id[0].cfg1 = SIS_100NEW;
|
||||
id[0].max_dma = ATA_UDMA5;
|
||||
}
|
||||
sprintf(buffer, "SiS 961 %s controller",ata_mode2str(idx->max_dma));
|
||||
device_set_descf(dev, "SiS 961 %s controller",
|
||||
ata_mode2str(idx->max_dma));
|
||||
}
|
||||
pci_write_config(dev, 0x4a, reg4a, 1);
|
||||
}
|
||||
if (!found)
|
||||
sprintf(buffer,"SiS %s %s controller",
|
||||
idx->text, ata_mode2str(idx->max_dma));
|
||||
device_set_descf(dev, "SiS %s %s controller",
|
||||
idx->text, ata_mode2str(idx->max_dma));
|
||||
else
|
||||
idx = &id[0];
|
||||
|
||||
device_set_desc_copy(dev, buffer);
|
||||
ctlr->chip = idx;
|
||||
ctlr->chipinit = ata_sis_chipinit;
|
||||
return (BUS_PROBE_LOW_PRIORITY);
|
||||
|
|
|
|||
Loading…
Reference in a new issue