/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 QLogic Corporation. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "Copyright 2010 QLogic Corporation; ql_nx.c"
/*
* ISP2xxx Solaris Fibre Channel Adapter (FCA) driver source file.
*
* ***********************************************************************
* * **
* * NOTICE **
* * COPYRIGHT (C) 1996-2010 QLOGIC CORPORATION **
* * ALL RIGHTS RESERVED **
* * **
* ***********************************************************************
*
*/
#include <ql_apps.h>
#include <ql_api.h>
#include <ql_debug.h>
#include <ql_mbx.h>
#include <ql_nx.h>
/*
* Local Function Prototypes.
*/
static void ql_crb_addr_transform_setup(ql_adapter_state_t *);
static int ql_8021_crb_win_lock(ql_adapter_state_t *);
static void ql_8021_crb_win_unlock(ql_adapter_state_t *);
uint32_t);
uint32_t);
uint32_t);
uint32_t);
uint32_t);
static int ql_8021_rom_lock(ql_adapter_state_t *);
static void ql_8021_rom_unlock(ql_adapter_state_t *);
static int ql_8021_wait_rom_done(ql_adapter_state_t *);
static int ql_8021_wait_flash_done(ql_adapter_state_t *);
static int ql_8021_phantom_init(ql_adapter_state_t *);
static int ql_8021_pinit_from_rom(ql_adapter_state_t *);
static int ql_8021_load_from_flash(ql_adapter_state_t *);
static int ql_8021_load_firmware(ql_adapter_state_t *);
static int ql_8021_reset_hw(ql_adapter_state_t *, int);
static int ql_8021_init_p3p(ql_adapter_state_t *);
static void ql_8021_hw_unlock(ql_adapter_state_t *);
static void ql_8021_need_reset_handler(ql_adapter_state_t *);
/*
* Local Data.
*/
static int crb_table_initialized = 0;
static int pci_set_window_warning_count = 0;
{{{0, 0, 0, 0}}}, /* 0: PCI */
{{{1, 0x0100000, 0x0102000, 0x120000}, /* 1: PCIE */
{1, 0x0110000, 0x0120000, 0x130000},
{1, 0x0120000, 0x0122000, 0x124000},
{1, 0x0130000, 0x0132000, 0x126000},
{1, 0x0140000, 0x0142000, 0x128000},
{1, 0x0150000, 0x0152000, 0x12a000},
{1, 0x0160000, 0x0170000, 0x110000},
{1, 0x0170000, 0x0172000, 0x12e000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{1, 0x01e0000, 0x01e0800, 0x122000},
{0, 0x0000000, 0x0000000, 0x000000}}},
{{{1, 0x0200000, 0x0210000, 0x180000}}}, /* 2: MN */
{{{0, 0, 0, 0}}}, /* 3: */
{{{1, 0x0400000, 0x0401000, 0x169000}}}, /* 4: P2NR1 */
{{{1, 0x0500000, 0x0510000, 0x140000}}}, /* 5: SRE */
{{{1, 0x0600000, 0x0610000, 0x1c0000}}}, /* 6: NIU */
{{{1, 0x0700000, 0x0704000, 0x1b8000}}}, /* 7: QM */
{{{1, 0x0800000, 0x0802000, 0x170000}, /* 8: SQM0 */
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{1, 0x08f0000, 0x08f2000, 0x172000}}},
{{{1, 0x0900000, 0x0902000, 0x174000}, /* 9: SQM1 */
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{1, 0x09f0000, 0x09f2000, 0x176000}}},
{{{0, 0x0a00000, 0x0a02000, 0x178000}, /* 10: SQM2 */
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{1, 0x0af0000, 0x0af2000, 0x17a000}}},
{{{0, 0x0b00000, 0x0b02000, 0x17c000}, /* 11: SQM3 */
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{1, 0x0bf0000, 0x0bf2000, 0x17e000}}},
{{{1, 0x0c00000, 0x0c04000, 0x1d4000}}}, /* 12: I2Q */
{{{1, 0x0d00000, 0x0d04000, 0x1a4000}}}, /* 13: TMR */
{{{1, 0x0e00000, 0x0e04000, 0x1a0000}}}, /* 14: ROMUSB */
{{{1, 0x0f00000, 0x0f01000, 0x164000}}}, /* 15: PEG4 */
{{{0, 0x1000000, 0x1004000, 0x1a8000}}}, /* 16: XDMA */
{{{1, 0x1100000, 0x1101000, 0x160000}}}, /* 17: PEG0 */
{{{1, 0x1200000, 0x1201000, 0x161000}}}, /* 18: PEG1 */
{{{1, 0x1300000, 0x1301000, 0x162000}}}, /* 19: PEG2 */
{{{1, 0x1400000, 0x1401000, 0x163000}}}, /* 20: PEG3 */
{{{1, 0x1500000, 0x1501000, 0x165000}}}, /* 21: P2ND */
{{{1, 0x1600000, 0x1601000, 0x166000}}}, /* 22: P2NI */
{{{0, 0, 0, 0}}}, /* 23: */
{{{0, 0, 0, 0}}}, /* 24: */
{{{0, 0, 0, 0}}}, /* 25: */
{{{0, 0, 0, 0}}}, /* 26: */
{{{0, 0, 0, 0}}}, /* 27: */
{{{0, 0, 0, 0}}}, /* 28: */
{{{1, 0x1d00000, 0x1d10000, 0x190000}}}, /* 29: MS */
{{{1, 0x1e00000, 0x1e01000, 0x16a000}}}, /* 30: P2NR2 */
{{{1, 0x1f00000, 0x1f10000, 0x150000}}}, /* 31: EPG */
{{{0}}}, /* 32: PCI */
{{{1, 0x2100000, 0x2102000, 0x120000}, /* 33: PCIE */
{1, 0x2110000, 0x2120000, 0x130000},
{1, 0x2120000, 0x2122000, 0x124000},
{1, 0x2130000, 0x2132000, 0x126000},
{1, 0x2140000, 0x2142000, 0x128000},
{1, 0x2150000, 0x2152000, 0x12a000},
{1, 0x2160000, 0x2170000, 0x110000},
{1, 0x2170000, 0x2172000, 0x12e000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000},
{0, 0x0000000, 0x0000000, 0x000000}}},
{{{1, 0x2200000, 0x2204000, 0x1b0000}}}, /* 34: CAM */
{{{0}}}, /* 35: */
{{{0}}}, /* 36: */
{{{0}}}, /* 37: */
{{{0}}}, /* 38: */
{{{0}}}, /* 39: */
{{{1, 0x2800000, 0x2804000, 0x1a4000}}}, /* 40: TMR */
{{{1, 0x2900000, 0x2901000, 0x16b000}}}, /* 41: P2NR3 */
{{{1, 0x2a00000, 0x2a00400, 0x1ac400}}}, /* 42: RPMX1 */
{{{1, 0x2b00000, 0x2b00400, 0x1ac800}}}, /* 43: RPMX2 */
{{{1, 0x2c00000, 0x2c00400, 0x1acc00}}}, /* 44: RPMX3 */
{{{1, 0x2d00000, 0x2d00400, 0x1ad000}}}, /* 45: RPMX4 */
{{{1, 0x2e00000, 0x2e00400, 0x1ad400}}}, /* 46: RPMX5 */
{{{1, 0x2f00000, 0x2f00400, 0x1ad800}}}, /* 47: RPMX6 */
{{{1, 0x3000000, 0x3000400, 0x1adc00}}}, /* 48: RPMX7 */
{{{0, 0x3100000, 0x3104000, 0x1a8000}}}, /* 49: XDMA */
{{{1, 0x3200000, 0x3204000, 0x1d4000}}}, /* 50: I2Q */
{{{1, 0x3300000, 0x3304000, 0x1a0000}}}, /* 51: ROMUSB */
{{{0}}}, /* 52: */
{{{1, 0x3500000, 0x3500400, 0x1ac000}}}, /* 53: RPMX0 */
{{{1, 0x3600000, 0x3600400, 0x1ae000}}}, /* 54: RPMX8 */
{{{1, 0x3700000, 0x3700400, 0x1ae400}}}, /* 55: RPMX9 */
{{{1, 0x3800000, 0x3804000, 0x1d0000}}}, /* 56: OCM0 */
{{{1, 0x3900000, 0x3904000, 0x1b4000}}}, /* 57: CRYPTO */
{{{1, 0x3a00000, 0x3a04000, 0x1d8000}}}, /* 58: SMB */
{{{0}}}, /* 59: I2C0 */
{{{0}}}, /* 60: I2C1 */
{{{1, 0x3d00000, 0x3d04000, 0x1dc000}}}, /* 61: LPC */
{{{1, 0x3e00000, 0x3e01000, 0x167000}}}, /* 62: P2NC */
{{{1, 0x3f00000, 0x3f01000, 0x168000}}} /* 63: P2NR0 */
};
/*
* top 12 bits of crb internal address (hub, agent)
*/
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
};
static void *
{
}
return (NULL);
}
/* ARGSUSED */
static void
{
/*
* Used only in P3 just define it for P2 also.
*/
}
/*
* In: 'off' is offset from CRB space in 128M pci map
* Out: 'off' is 2M pci map addr
* side effect: lock crb window
*/
static void
{
/*
* Read back value to make sure write has gone through before trying
* to use it.
*/
}
}
static void
{
int rv;
if (rv == -1) {
"2M=-1\n");
}
if (rv == 1) {
(void) ql_8021_crb_win_lock(ha);
}
if (rv == 1) {
}
}
static void
{
int rv;
uint32_t n;
if (rv == -1) {
"2M=-1\n");
}
if (rv == 1) {
(void) ql_8021_crb_win_lock(ha);
}
*data = n;
}
if (rv == 1) {
}
}
static int
{
while (!done) {
/* acquire semaphore3 from PCI HW block */
if (done == 1) {
break;
}
if (timeout >= CRB_WIN_LOCK_TIMEOUT) {
return (-1);
}
timeout++;
/* Yield CPU */
delay(1);
}
return (0);
}
static void
{
}
static int
{
if (*off >= UNM_CRB_MAX) {
return (-1);
}
return (0);
}
if (*off < UNM_PCI_CRBSPACE) {
return (-1);
}
*off -= UNM_PCI_CRBSPACE;
/*
* Try direct map
*/
return (0);
}
/*
* Not in direct map, use crb window
*/
return (1);
}
/*
* check memory access boundary.
* used by test agent. support ddr access only for now
*/
/* ARGSUSED */
static uint32_t
{
/*LINTED suspicious 0 comparison*/
/*LINTED suspicious 0 comparison*/
return (0);
}
return (1);
}
static uint64_t
{
/*LINTED suspicious 0 comparison*/
/* DDR network side */
&win_read);
}
/* if bits 19:18&17:11 are on */
addr = -1UL;
}
&win_read);
}
/* QDR network side */
&win_read);
}
} else {
/*
* peg gdb frequently accesses memory that doesn't exist,
* this limits the chit chat so debugging isn't slowed down.
*/
if ((pci_set_window_warning_count++ < 8) ||
(pci_set_window_warning_count % 64 == 0)) {
}
addr = -1UL;
}
return (addr);
}
/* check if address is in the same windows as the previous access */
static int
{
/*LINTED suspicious 0 comparison*/
/* DDR network side */
return (0); /* MN access can not come here */
return (1);
return (1);
/* QDR network side */
return (1);
}
}
return (0);
}
static int
{
void *addr;
int ret = 0;
/*
* If attempting to access unknown address or straddle hw windows,
* do not access.
*/
off);
return (-1);
}
if (!addr) {
}
switch (size) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
break;
default:
ret = -1;
break;
}
return (ret);
}
static int
{
void *addr;
int ret = 0;
/*
* If attempting to access unknown address or straddle hw windows,
* do not access.
*/
off);
return (-1);
}
if (!addr) {
}
switch (size) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
break;
default:
ret = -1;
break;
}
return (ret);
}
static int
{
int j = 0;
/*
* If not MN, go check for MS or invalid.
*/
} else {
size));
}
}
(16 - off0[0]));
shift_amount = 4;
} else {
(8 - off0[0]));
shift_amount = 3;
}
off0[1] = 0;
/*
* don't lock here - write_wx gets the lock if each time
* write_lock_irqsave(&adapter->adapter_lock, flags);
* netxen_nic_pci_change_crbwindow_128M(adapter, 0);
*/
for (i = 0; i < loop; i++) {
temp = 0;
for (j = 0; j < MAX_CTL_CHECK; j++) {
if ((temp & MIU_TA_CTL_BUSY) == 0) {
break;
}
}
if (j >= MAX_CTL_CHECK) {
break;
}
&temp);
}
}
/*
* netxen_nic_pci_change_crbwindow_128M(adapter, 1);
* write_unlock_irqrestore(&adapter->adapter_lock, flags);
*/
if (j >= MAX_CTL_CHECK) {
return (-1);
}
if ((off0[0] & 7) == 0) {
} else {
}
switch (size) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
break;
}
return (0);
}
static int
{
int j, ret = 0;
/*
* If not MN, go check for MS or invalid.
*/
} else {
size));
}
}
shift_amount = 4;
scale = 2;
p3p = 1;
} else {
shift_amount = 3;
scale = 1;
p3p = 0;
startword = 0;
}
for (i = 0; i < loop; i++) {
return (-1);
}
}
}
switch (size) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
default:
break;
}
if (p3p) {
if (sz[0] == 8) {
} else {
(off0 * 8));
}
if (sz[1] != 0) {
}
} else {
if (loop == 2) {
}
}
/*
* don't lock here - write_wx gets the lock if each time
* write_lock_irqsave(&adapter->adapter_lock, flags);
* netxen_nic_pci_change_crbwindow_128M(adapter, 0);
*/
for (i = 0; i < loop; i++) {
temp = 0;
if (p3p) {
0xffffffff);
}
for (j = 0; j < MAX_CTL_CHECK; j++) {
if ((temp & MIU_TA_CTL_BUSY) == 0)
break;
}
if (j >= MAX_CTL_CHECK) {
ret = -1;
break;
}
}
return (ret);
}
static uint32_t
{
int i;
if (!crb_table_initialized) {
}
for (i = 0; i < MAX_CRB_XFORM; i++) {
if (crb_addr_xform[i] == base_addr) {
pci_base = i << 20;
break;
}
}
if (pci_base == ADDR_ERROR) {
return (pci_base);
} else {
}
}
static int
{
while (!done) {
/* acquire semaphore5 from PCI HW block */
if (done == 1) {
break;
}
return (-1);
}
timeout++;
/*
* Yield CPU
*/
delay(1);
}
return (0);
}
static void
{
}
static int
{
while (!done) {
/* acquire semaphore2 from PCI HW block */
if (done == 1) {
break;
}
if (timeout >= ROM_LOCK_TIMEOUT) {
return (-1);
}
timeout++;
/*
* Yield CPU
*/
delay(1);
}
return (0);
}
static void
{
}
static int
{
while (done == 0) {
done &= 2;
timeout++;
if (timeout >= ROM_MAX_TIMEOUT) {
return (-1);
}
}
return (0);
}
static int
{
if (ql_8021_wait_rom_done(ha)) {
return (-1);
}
/* Get status. */
return (0);
}
delay(1);
}
return (-1);
}
static int
{
if (ql_8021_wait_rom_done(ha)) {
return (-1);
}
/* reset abyte_cnt and dummy_byte_cnt */
drv_usecwait(10);
return (0);
}
int
{
drv_usecwait(100);
loops++;
}
if (loops >= 50000) {
return (-1);
}
return (ret);
}
static int
{
if (ql_8021_wait_rom_done(ha)) {
return (-1);
}
if (ql_8021_wait_rom_done(ha)) {
return (-1);
}
if (ql_8021_wait_flash_done(ha)) {
return (-1);
}
return (0);
}
static int
{
if (ql_8021_wait_rom_done(ha)) {
return (-1);
}
if (ql_8021_wait_rom_done(ha)) {
return (-1);
}
if (ql_8021_wait_flash_done(ha)) {
return (-1);
}
return (0);
}
int
{
int ret;
return (ret);
}
int
{
drv_usecwait(100);
loops++;
}
if (loops >= 50000) {
} else {
}
return (ret);
}
int
{
drv_usecwait(100);
loops++;
}
if (loops >= 50000) {
} else {
}
return (ret);
}
int
{
drv_usecwait(100);
loops++;
}
if (loops >= 50000) {
} else {
if (ql_8021_wait_rom_done(ha)) {
} else {
if (ql_8021_wait_rom_done(ha)) {
} else if (ql_8021_wait_flash_done(ha)) {
}
}
}
return (ret);
}
static int
{
do {
switch (val) {
case PHAN_INITIALIZE_COMPLETE:
case PHAN_INITIALIZE_ACK:
return (0);
case PHAN_INITIALIZE_FAILED:
err = 1;
break;
default:
break;
}
if (err) {
break;
}
/* 500 msec wait */
delay(50);
} while (--retries);
if (!err) {
}
return (-1);
}
static int
{
int init_delay = 0;
/* Grab the lock so that no one can read flash when we reset the chip */
(void) ql_8021_rom_lock(ha);
/* Just in case it was held when we reset the chip */
return (-1);
}
offset = n & 0xffff;
n = (n >> 16) & 0xffff;
if (n >= 1024) {
return (-1);
}
return (-1);
}
for (i = 0; i < n; i++) {
0) {
return (-1);
}
}
for (i = 0; i < n; i++) {
if (off == ADDR_ERROR) {
continue;
}
off += UNM_PCI_CRBSPACE;
if (off & 1) {
continue;
}
/* skipping cold reboot MAGIC */
if (off == UNM_RAM_COLD_BOOT) {
continue;
}
continue;
}
/* do not reset PCI */
continue;
}
continue;
}
continue;
}
continue;
}
continue;
}
continue;
}
}
/* skip the function enable register */
continue;
}
continue;
}
continue;
}
/* After writing this register, HW needs time for CRB */
/* to quiet down (else crb_window returns 0xffffffff) */
init_delay = 1;
if (off == UNM_ROMUSB_GLB_SW_RESET) {
}
}
/* disable_peg_cache_all */
/* p2dn replyCount */
/* disable_peg_cache 0 */
/* disable_peg_cache 1 */
/* peg_clr_all */
/* peg_clr 0 */
/* peg_clr 1 */
/* peg_clr 2 */
/* peg_clr 3 */
return (0);
}
static int
{
int i;
for (i = 0; i < size; i++) {
return (-1);
}
flashaddr += 8;
memaddr += 8;
}
for (i = 0; i < size; i++) {
return (-1);
}
flashaddr += 8;
memaddr += 8;
}
return (0);
}
static int
{
for (n = 0; n < 4; n++) {
}
for (i = 0; i < size; i++) {
for (n = 0; n < 8; n++) {
}
flashaddr += 8;
}
for (n = 0; n < 4; n++) {
}
for (i = 0; i < size; i++) {
for (n = 0; n < 8; n++) {
}
flashaddr += 8;
}
return (0);
}
static int
{
/* ??? */
/* CAM RAM Cold Boot Register */
if (data == 0x55555555) {
if (data != 0x80000f) {
return (-1);
}
}
data |= 1;
/*
* ???
* data = ha->pci_bus_addr | BIT_31;
* ql_8021_wr_32(ha, UNM_BUS_DEV_NO, data);
*/
return (0);
}
/* ARGSUSED */
void
{
/*
* Disable interrupts does not work on a per function bases
* leave them enabled
*/
(void) ql_stop_firmware(ha);
}
static int
{
int ret;
/* scrub dma mask expansion register */
/* Overwrite stale initialization register values */
(void) ql_8021_pinit_from_rom(ha);
delay(1);
/* Bring QM and CAMRAM out of reset */
switch (type) {
case 0:
break;
case 1:
break;
case 2:
break;
}
delay(1);
if (ret) {
} else {
}
return (ret);
}
int
{
int rv = 0;
static int ql_8021_fw_loaded = 0;
if (!ql_8021_fw_loaded) {
} else {
/*
* BIOS method
* ql_8021_reset_hw(ha, 0)
*/
}
if (rv == 0) {
ql_8021_fw_loaded = 1;
(void) ql_8021_enable_intrs(ha);
} else {
}
} else {
}
if (rv == 0) {
} else {
return (QL_FUNCTION_FAILED);
}
return (QL_SUCCESS);
}
void
{
}
void
{
}
void
{
}
void
{
(void) ql_toggle_interrupt(ha, 0);
}
void
{
}
void
{
return;
}
if (val == 0xffffffff) {
} else {
}
}
void
{
return;
}
}
static void
{
delay(100);
}
}
{
/* wait for 30 seconds for device to go ready */
timer = 30;
while (timer) {
}
switch (dev_state) {
case 0xffffffff:
case NX_DEV_COLD:
rval = NX_DEV_COLD;
(void) ql_8021_hw_unlock(ha);
&ha->fw_major_version);
&ha->fw_minor_version);
rval = NX_DEV_READY;
rval = NX_DEV_READY;
}
break;
case NX_DEV_READY:
rval = NX_DEV_READY;
timer = 0;
break;
case NX_DEV_FAILED:
timer = 0;
break;
case NX_DEV_NEED_RESET:
(void) ql_8021_hw_unlock(ha);
}
break;
case NX_DEV_NEED_QUIESCENT:
(void) ql_8021_hw_unlock(ha);
if (rval == QL_SUCCESS) {
drv_state |=
}
break;
case NX_DEV_INITIALIZING:
break;
case NX_DEV_QUIESCENT:
break;
default:
break;
}
(void) ql_8021_hw_unlock(ha);
}
if (timer) {
delay(100);
timer--;
}
}
if (stalled) {
}
return (rval);
}