summaryrefslogtreecommitdiff
path: root/sys/dev/pci/qli_pci.c
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2007-09-05 11:05:45 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2007-09-05 11:05:45 +0000
commit4754b6cf7c009bcdcf641a65d7dc4a86d2cdaa3e (patch)
tree1b088e2fc48d2d0023e04f368f17242580cf70e7 /sys/dev/pci/qli_pci.c
parentcddb49171ccc1e479c3a625d8eee67d698a4892e (diff)
Implement qli_get_fw_state and fix a typo.
Diffstat (limited to 'sys/dev/pci/qli_pci.c')
-rw-r--r--sys/dev/pci/qli_pci.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/pci/qli_pci.c b/sys/dev/pci/qli_pci.c
index 4a89be39655..89e0cc9128e 100644
--- a/sys/dev/pci/qli_pci.c
+++ b/sys/dev/pci/qli_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qli_pci.c,v 1.2 2007/09/04 23:03:59 marco Exp $ */
+/* $OpenBSD: qli_pci.c,v 1.3 2007/09/05 11:05:44 marco Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2007 David Collins <dave@davec.name>
@@ -375,12 +375,20 @@ qli_soft_reset(struct qli_softc *sc)
int
qli_get_fw_state(struct qli_softc *sc, u_int32_t *mbox)
{
+ int rv = 1;
+
DNPRINTF(QLI_D_MISC, "%s: qli_get_fw_state\n", DEVNAME(sc));
- DNPRINTF(QLI_D_MISC, "%s: qli_get_fw_state: not implemented yet\n",
- DEVNAME(sc));
+ bzero(mbox, sizeof(mbox));
+ mbox[0] = QLI_MBOX_OPC_GET_FW_STATE;
+ if (qli_mgmt(sc, 1, mbox))
+ goto done;
- return (1);
+ DNPRINTF(QLI_D_MISC, "%s: qli_get_fw_state: state: 0x%08x\n",
+ DEVNAME(sc), mbox[1]);
+ rv = 0;
+done:
+ return (rv);
}
int
@@ -555,7 +563,7 @@ qli_start_firmware(struct qli_softc *sc)
"firmware\n", DEVNAME(sc));
/* stuff random value in mbox[7] to randomize source ports */
- /* XXX use random ne instead of 123 */
+ /* XXX use random ne instead of 1234 */
qli_write(sc, &sc->sc_reg->qlr_mbox[7], 1234);
/* XXX linux driver sets ACB v2 into mbox[6] */