diff options
author | sam <sam@FreeBSD.org> | 2003-04-27 04:26:22 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2003-04-27 04:26:22 +0000 |
commit | 0c267521bcf1feea70b96249554a94417834e5d4 (patch) | |
tree | 31ba268666e41f07b772bf49d196b890944ad3af | |
parent | d6131fb8f8ee6f76cbcbd8518e940c49c0299778 (diff) | |
download | FreeBSD-src-0c267521bcf1feea70b96249554a94417834e5d4.zip FreeBSD-src-0c267521bcf1feea70b96249554a94417834e5d4.tar.gz |
recognize the Sun Crypto 5821 and Crypto 1K cards;
they both use the Broadcom 5821
Submitted by: Panagiotis Astithas
MFC after: 1 day
-rw-r--r-- | sys/dev/ubsec/ubsec.c | 21 | ||||
-rw-r--r-- | sys/dev/ubsec/ubsecreg.h | 5 |
2 files changed, 22 insertions, 4 deletions
diff --git a/sys/dev/ubsec/ubsec.c b/sys/dev/ubsec/ubsec.c index c5291b9..224c41c 100644 --- a/sys/dev/ubsec/ubsec.c +++ b/sys/dev/ubsec/ubsec.c @@ -194,6 +194,10 @@ SYSCTL_STRUCT(_hw_ubsec, OID_AUTO, stats, CTLFLAG_RD, &ubsecstats, static int ubsec_probe(device_t dev) { + if (pci_get_vendor(dev) == PCI_VENDOR_SUN && + (pci_get_device(dev) == PCI_PRODUCT_SUN_5821 || + pci_get_device(dev) == PCI_PRODUCT_SUN_SCA1K)) + return (0); if (pci_get_vendor(dev) == PCI_VENDOR_BLUESTEEL && (pci_get_device(dev) == PCI_PRODUCT_BLUESTEEL_5501 || pci_get_device(dev) == PCI_PRODUCT_BLUESTEEL_5601)) @@ -232,6 +236,12 @@ ubsec_partname(struct ubsec_softc *sc) case PCI_PRODUCT_BLUESTEEL_5601: return "Bluesteel 5601"; } return "Bluesteel unknown-part"; + case PCI_VENDOR_SUN: + switch (pci_get_device(sc->sc_dev)) { + case PCI_PRODUCT_SUN_5821: return "Sun Crypto 5821"; + case PCI_PRODUCT_SUN_SCA1K: return "Sun Crypto 1K"; + } + return "Sun unknown-part"; } return "Unknown-vendor unknown-part"; } @@ -280,10 +290,13 @@ ubsec_attach(device_t dev) sc->sc_flags |= UBS_FLAGS_KEY | UBS_FLAGS_RNG | UBS_FLAGS_LONGCTX | UBS_FLAGS_HWNORM | UBS_FLAGS_BIGKEY; - if (pci_get_vendor(dev) == PCI_VENDOR_BROADCOM && - (pci_get_device(dev) == PCI_PRODUCT_BROADCOM_5821 || - pci_get_device(dev) == PCI_PRODUCT_BROADCOM_5822 || - pci_get_device(dev) == PCI_PRODUCT_BROADCOM_5823 )) { + if ((pci_get_vendor(dev) == PCI_VENDOR_BROADCOM && + (pci_get_device(dev) == PCI_PRODUCT_BROADCOM_5821 || + pci_get_device(dev) == PCI_PRODUCT_BROADCOM_5822 || + pci_get_device(dev) == PCI_PRODUCT_BROADCOM_5823)) || + (pci_get_vendor(dev) == PCI_VENDOR_SUN && + (pci_get_device(dev) == PCI_PRODUCT_SUN_SCA1K || + pci_get_device(dev) == PCI_PRODUCT_SUN_5821))) { /* NB: the 5821/5822 defines some additional status bits */ sc->sc_statmask |= BS_STAT_MCR1_ALLEMPTY | BS_STAT_MCR2_ALLEMPTY; diff --git a/sys/dev/ubsec/ubsecreg.h b/sys/dev/ubsec/ubsecreg.h index 5aeae3a..4be530a 100644 --- a/sys/dev/ubsec/ubsecreg.h +++ b/sys/dev/ubsec/ubsecreg.h @@ -46,6 +46,7 @@ #define PCI_VENDOR_BROADCOM 0x14e4 /* Broadcom */ #define PCI_VENDOR_BLUESTEEL 0x15ab /* Bluesteel Networks */ +#define PCI_VENDOR_SUN 0x108e /* Sun Microsystems */ /* Bluesteel Networks */ #define PCI_PRODUCT_BLUESTEEL_5501 0x0000 /* 5501 */ @@ -62,6 +63,10 @@ #define PCI_PRODUCT_BROADCOM_5822 0x5822 /* 5822 */ #define PCI_PRODUCT_BROADCOM_5823 0x5823 /* 5823 */ +/* Sun Microsystems */ +#define PCI_PRODUCT_SUN_5821 0x5454 /* Crypto 5821 */ +#define PCI_PRODUCT_SUN_SCA1K 0x5455 /* Crypto 1K */ + #define UBS_PCI_RTY_SHIFT 8 #define UBS_PCI_RTY_MASK 0xff #define UBS_PCI_RTY(misc) \ |