summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-08-15 00:43:44 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-08-15 00:43:44 +0000
commitf348afed80fd9e01405120cdb9f4f8754d97f057 (patch)
tree614dcd2ef3eb164dc2f9aec417cbddb5770299e3 /sys/dev
parentf2353d4473646f0b8d54d6cd7ee5aeda14be2dfd (diff)
provide a map of the board type the flash memory will tell us we are to the
type of interface it provides. drivers need to deal with 10Gb (XGB) and gigabit (GBE) differently.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_nxe.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/sys/dev/pci/if_nxe.c b/sys/dev/pci/if_nxe.c
index ff47eecd660..8d13649c654 100644
--- a/sys/dev/pci/if_nxe.c
+++ b/sys/dev/pci/if_nxe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nxe.c,v 1.14 2007/08/15 00:33:45 dlg Exp $ */
+/* $OpenBSD: if_nxe.c,v 1.15 2007/08/15 00:43:43 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -176,6 +176,14 @@ int nxedebug = 0;
#define NXE_SEM_DONE 0x1
/*
+ * Network Interface Unit (NIU) Registers
+ */
+
+#define NXE_0_NIU_MODE 0x00600000
+#define NXE_0_NIU_MODE_XGE (1<<2) /* XGE interface enabled */
+#define NXE_0_NIU_MODE_GBE (1<<1) /* 4 GbE interfaces enabled */
+
+/*
* Software Defined Registers
*/
@@ -359,6 +367,14 @@ struct nxe_userinfo {
u_int32_t nu_bios_ver;
} __packed;
+/*
+ * driver definitions
+ */
+
+struct nxe_board {
+ u_int32_t brd_type;
+ u_int brd_mode;
+};
/*
* autoconf glue
@@ -441,6 +457,15 @@ const struct pci_matchid nxe_devices[] = {
{ PCI_VENDOR_NETXEN, PCI_PRODUCT_NETXEN_NXB_HMEZ_2 }
};
+const struct nxe_board nxe_boards[] = {
+ { NXE_BRDTYPE_P2_SB35_4G, NXE_0_NIU_MODE_GBE },
+ { NXE_BRDTYPE_P2_SB31_10G, NXE_0_NIU_MODE_XGE },
+ { NXE_BRDTYPE_P2_SB31_2G, NXE_0_NIU_MODE_GBE },
+ { NXE_BRDTYPE_P2_SB31_10G_IMEZ, NXE_0_NIU_MODE_XGE },
+ { NXE_BRDTYPE_P2_SB31_10G_HMEZ, NXE_0_NIU_MODE_XGE },
+ { NXE_BRDTYPE_P2_SB31_10G_CX4, NXE_0_NIU_MODE_XGE }
+};
+
int
nxe_match(struct device *parent, void *match, void *aux)
{