-/* $OpenBSD: ahcivar.h,v 1.2 2013/07/09 11:55:55 jmatthew Exp $ */
+/* $OpenBSD: ahcivar.h,v 1.3 2014/01/02 08:00:35 gilles Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
#define AHCI_F_NO_NCQ (1<<0)
#define AHCI_F_IPMS_PROBE (1<<1) /* IPMS on failed PMP probe */
#define AHCI_F_NO_PMP (1<<2) /* ignore PMP capability */
+#define AHCI_F_NO_MSI (1<<3) /* disable MSI */
u_int sc_ncmds;
-/* $OpenBSD: ahci_pci.c,v 1.2 2013/02/19 15:29:27 brad Exp $ */
+/* $OpenBSD: ahci_pci.c,v 1.3 2014/01/02 08:00:35 gilles Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
struct pci_attach_args *);
int ahci_intel_attach(struct ahci_softc *,
struct pci_attach_args *);
+int ahci_samsung_attach(struct ahci_softc *,
+ struct pci_attach_args *);
static const struct ahci_device ahci_devices[] = {
{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_HUDSON2_SATA_1,
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_EP80579_AHCI,
NULL, ahci_intel_attach },
+ { PCI_VENDOR_SAMSUNG2, PCI_PRODUCT_SAMSUNG2_XP941,
+ NULL, ahci_samsung_attach },
+
{ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT8251_SATA,
ahci_no_match, ahci_vt8251_attach }
};
return (0);
}
+int
+ahci_samsung_attach(struct ahci_softc *sc, struct pci_attach_args *pa)
+{
+ sc->sc_flags |= AHCI_F_NO_MSI;
+ return (0);
+}
+
int
ahci_pci_match(struct device *parent, void *match, void *aux)
{
struct pci_attach_args *pa = aux;
const struct ahci_device *ad;
pci_intr_handle_t ih;
+ int mapped = 0;
psc->psc_pc = pa->pa_pc;
psc->psc_tag = pa->pa_tag;
}
}
- if (pci_intr_map_msi(pa, &ih) != 0 && pci_intr_map(pa, &ih) != 0) {
+ if (!(sc->sc_flags & AHCI_F_NO_MSI))
+ mapped = pci_intr_map_msi(pa, &ih) != 0 ? 0 : 1;
+
+ if (!mapped && pci_intr_map(pa, &ih) != 0) {
printf(": unable to map interrupt\n");
return;
}