/*
* 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 2008 NetXen, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/ethernet.h>
#include <sys/dditypes.h>
#include <sys/sysmacros.h>
#include "unm_nic.h"
#include "unm_nic_hw.h"
#include "nic_cmn.h"
#include "unm_brdcfg.h"
#include "driver_info.h"
long unm_niu_gbe_phy_read(struct unm_adapter_s *,
#define UNM_PCI_MN_2M (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, 0x1d8000}}}, /* 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
{
int i;
while (!done) {
/* acquire semaphore3 from PCI HW block */
if (done == 1)
break;
if (timeout >= CRB_WIN_LOCK_TIMEOUT) {
return;
}
timeout++;
/*
* Yield CPU
*/
for (i = 0; i < 20; i++);
}
}
static void
{
int val;
&val, 4);
}
/*
* Changes the CRB window to the specified window.
*/
void
{
unsigned long offset;
return;
}
/*
* Move the CRB window.
* We need to write to the "direct access" region of PCI
* to avoid a race condition where the window register has
* not been successfully written across CRB before the target
* register address is received by PCI. The direct region bypasses
* the CRB bus.
*/
*(unm_crbword_t *)&window = 0;
/* MUST make sure window is set before we forge on... */
"registered properly: 0x%08x.\n",
}
}
/*
* Changes the CRB window to the specified window.
*/
/* ARGSUSED */
void
{
}
{
return (adapter->curr_window);
}
/*
* Return -1 if off is not valid,
* 1 if window access is needed. 'off' is set to offset from
* CRB space in 128M pci map
* 0 if no window access is needed. 'off' is set to 2M addr
* In: 'off' is offset from base in 128M pci map
*/
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);
}
/*
* 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.
*/
win_read = UNM_NIC_PCI_READ_32((void *)
}
}
int
{
void *addr;
if (!addr) {
offset);
}
} else {// Window 0
if (!addr) {
offset);
}
}
switch (len) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
break;
default:
#if !defined(NDEBUG)
if ((len & 0x7) != 0)
#endif
break;
}
} else {// Window 0
}
return (0);
}
/*
* Note : 'len' argument should be either 1, 2, 4, or a multiple of 8.
*/
int
{
/*
* This is modified from _unm_nic_hw_write().
* unm_nic_hw_write does not exist now.
*/
void *addr;
} else {// Window 0
}
if (!addr) {
} else {// Window 0
}
return (1);
}
switch (len) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
break;
default:
#if !defined(NDEBUG)
if ((len & 0x7) != 0)
"%s: %s len(%d) not multiple of 8.\n",
#endif
break;
}
} else {// Window 0
}
return (0);
}
/*
* Note : only 32-bit writes!
*/
void
{
}
/*
* Note : only 32-bit reads!
*/
{
}
/*
* Note : only 32-bit writes!
*/
int
{
return (0);
}
/*
* Note : only 32-bit reads!
*/
int
{
*data = UNM_NIC_PCI_READ_32((void *)
return (0);
}
/*
* Note : only 32-bit writes!
*/
void
{
}
/*
* Note : only 32-bit reads!
*/
{
return (temp);
}
/*
* Note : only 32-bit writes!
*/
int
{
return (0);
}
/*
* Note : only 32-bit reads!
*/
int
{
return (0);
}
/*
* write cross hw window boundary is not supported
* 'len' should be either 1, 2, 4, or multiple of 8
*/
int
{
int rv;
if (rv == -1) {
__FUNCTION__, off);
return (-1);
}
if (rv == 1) {
}
switch (len) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
break;
default:
#if !defined(NDEBUG)
if ((len & 0x7) != 0)
#endif
break;
}
if (rv == 1) {
}
return (0);
}
int
{
void *addr;
if (!addr) {
offset);
}
} else {// Window 0
if (!addr) {
offset);
}
}
switch (len) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
break;
default:
#if !defined(NDEBUG)
if ((len & 0x7) != 0)
#endif
break;
}
} else {// Window 0
}
return (0);
}
int
{
int rv;
if (rv == -1) {
__FUNCTION__, off);
return (-1);
}
if (rv == 1) {
}
switch (len) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
break;
default:
#if !defined(NDEBUG)
if ((len & 0x7) != 0)
#endif
break;
}
if (rv == 1) {
}
return (0);
}
int
{
void *addr;
if (ADDR_IN_WINDOW1(off)) {
// Window 1
} else {// Window 0
}
if (!addr) {
} else {// Window 0
}
return (1);
}
switch (len) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
break;
default:
#if !defined(NDEBUG)
if ((len & 0x7) != 0)
"%s: %s len(%d) not multiple of 8.\n",
#endif
break;
}
} else {// Window 0
}
return (0);
}
/* PCI Windowing for DDR regions. */
/*
* check memory access boundary.
* used by test agent. support ddr access only for now
*/
/* ARGSUSED */
static unsigned long
{
return (0);
return (1);
}
int unm_pci_set_window_warning_count = 0;
unsigned long long
unsigned long long addr)
{
int window;
unsigned long long qdr_max;
} else {
}
/* DDR network side */
/* MN access should never come here */
addr = -1ULL;
addr -= UNM_ADDR_OCM0;
addr += UNM_PCI_OCM0;
addr -= UNM_ADDR_OCM1;
addr += UNM_PCI_OCM1;
/* QDR network side */
addr -= UNM_ADDR_QDR_NET;
/* MUST make sure window is set before we forge on... */
(void) UNM_NIC_PCI_READ_32((void *)
}
addr += UNM_PCI_QDR_NET;
} else {
/*
* peg gdb frequently accesses memory that doesn't exist,
* this limits the chit chat so debugging isn't slowed down.
*/
if ((unm_pci_set_window_warning_count++ < 8) ||
(unm_pci_set_window_warning_count%64 == 0)) {
"Unknown address range!\n", unm_nic_driver_name);
}
addr = -1ULL;
}
return (addr);
}
unsigned long long
unsigned long long addr)
{
int window;
/* DDR network side */
"%s: Written MNwin (0x%x) != Read MNwin (0x%x)\n",
}
unsigned int temp1;
// OCM: pci_addr[20:18] == 011 && pci_addr[17:11] != 7f
// if bits 19:18&17:11 are on
addr = -1ULL;
}
"%s: Written OCMwin(0x%x) != Read OCMwin(0x%x)\n",
}
/* QDR network side */
"%s: Written MSwin (0x%x) != Read MSwin (0x%x)\n",
}
} else {
/*
* peg gdb frequently accesses memory that doesn't exist,
* this limits the chit chat so debugging isn't slowed down.
*/
if ((unm_pci_set_window_warning_count++ < 8) ||
(unm_pci_set_window_warning_count%64 == 0)) {
}
addr = -1ULL;
}
return (addr);
}
/* check if address is in the same windows as the previous access */
static unsigned long
unsigned long long addr)
{
int window;
unsigned long long qdr_max;
} else {
}
/* DDR network side */
/* MN access can not come here */
#if 0
return (1);
}
#endif
return (1);
return (1);
/* QDR network side */
return (1);
}
}
return (0);
}
static int
{
void *addr;
int ret = 0;
#if 0
/*
* This check can not be currently executed, since phanmon findq
* command breaks this check whereby 8 byte reads are being attempted
* on "aligned-by-4" addresses on x86. Reason this works is our version
* breaks up the access into 2 consecutive 4 byte writes; on other
* architectures, this might require "aligned-by-8" addresses and we
* will run into trouble.
*
* Check alignment for expected sizes of 1, 2, 4, 8. Other size
* values will not trigger access.
*/
return (-1);
#endif
/*
* If attempting to access unknown address or straddle hw windows,
* do not access.
*/
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 0
/*
* This check can not be currently executed, since firmware load
* breaks this check whereby 8 byte writes are being attempted on
* "aligned-by-4" addresses on x86. Reason this works is our version
* breaks up the access into 2 consecutive 4 byte writes; on other
* architectures, this might require "aligned-by-8" addresses and we
* will run into trouble.
*
* Check alignment for expected sizes of 1, 2, 4, 8. Other size
* values will not trigger access.
*/
return (-1);
#endif
/*
* If attempting to access unknown address or straddle hw windows,
* do not access.
*/
return (-1);
}
if (!addr)
switch (size) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
break;
default:
ret = -1;
break;
}
return (ret);
}
int
int size)
{
/*
* If not MN, go check for MS or invalid.
*/
/* LINTED: E_FALSE_LOGICAL_EXPR */
for (i = 0; i < loop; i++) {
return (-1);
}
}
switch (size) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
default:
break;
}
if (loop == 2) {
}
for (i = 0; i < loop; i++) {
for (j = 0; j < MAX_CTL_CHECK; j++) {
temp = UNM_NIC_PCI_READ_32((void *)
if ((temp & MIU_TA_CTL_BUSY) == 0) {
break;
}
}
if (j >= MAX_CTL_CHECK) {
ret = -1;
break;
}
}
return (ret);
}
int
int size)
{
/*
* If not MN, go check for MS or invalid.
*/
off0[1] = 0;
/* LINTED: E_FALSE_LOGICAL_EXPR */
for (i = 0; i < loop; i++) {
for (j = 0; j < MAX_CTL_CHECK; j++) {
temp = UNM_NIC_PCI_READ_32((void *)
if ((temp & MIU_TA_CTL_BUSY) == 0) {
break;
}
}
if (j >= MAX_CTL_CHECK) {
break;
}
word[i] = 0;
MIU_TEST_AGT_RDDATA(k))) << (32*k));
}
}
if (j >= MAX_CTL_CHECK)
return (-1);
if (sz[0] == 8) {
} else {
}
switch (size) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
break;
}
return (0);
}
int
int size)
{
/*
* If not MN, go check for MS or invalid.
*/
} else {
return (unm_nic_pci_mem_write_direct(adapter,
}
for (i = 0; i < loop; i++) {
return (-1);
}
}
switch (size) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
default:
break;
}
if (loop == 2) {
}
// don't lock here - write_wx gets the lock if each time
// UNM_WRITE_LOCK_IRQS(&adapter->adapter_lock, flags);
// unm_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) {
ret = -1;
break;
}
}
// unm_nic_pci_change_crbwindow_128M(adapter, 1);
// UNM_WRITE_UNLOCK_IRQR(&adapter->adapter_lock, flags);
return (ret);
}
int
int size)
{
// unsigned long flags;
/*
* If not MN, go check for MS or invalid.
*/
} else {
return (unm_nic_pci_mem_read_direct(adapter,
}
off0[1] = 0;
// don't get lock - write_wx will get it
// UNM_WRITE_LOCK_IRQS(&adapter->adapter_lock, flags);
// unm_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;
}
}
}
// unm_nic_pci_change_crbwindow_128M(adapter, 1);
// UNM_WRITE_UNLOCK_IRQR(&adapter->adapter_lock, flags);
if (j >= MAX_CTL_CHECK)
return (-1);
if (sz[0] == 8) {
} else {
}
switch (size) {
case 1:
break;
case 2:
break;
case 4:
break;
case 8:
break;
}
return (0);
}
int
int data)
{
}
int
int data)
{
void *addr;
if (ADDR_IN_WINDOW1(off)) {
} else {
// unm_nic_write_w0 (adapter, off, data);
}
return (0);
}
int
{
int rv = 0;
int i;
for (i = 0; i < sizeof (unm_board_info_t) / sizeof (uint32_t); i++) {
return (-1);
}
ptr32++;
}
" Read %x, expected %x\n", unm_nic_driver_name,
rv = -1;
}
" Read %x, expected %x\n", unm_nic_driver_name,
rv = -1;
}
adapter);
if ((gpioval & 0x8000) == 0)
}
boardinfo->board_type));
case UNM_BRDTYPE_P2_SB35_4G:
break;
case UNM_BRDTYPE_P2_SB31_10G:
case UNM_BRDTYPE_P3_HMEZ:
case UNM_BRDTYPE_P3_XG_LOM:
case UNM_BRDTYPE_P3_10G_CX4:
case UNM_BRDTYPE_P3_IMEZ:
case UNM_BRDTYPE_P3_10G_XFP:
break;
case UNM_BRDTYPE_P3_REF_QG:
case UNM_BRDTYPE_P3_4_GB:
case UNM_BRDTYPE_P3_4_GB_MM:
break;
case UNM_BRDTYPE_P1_BD:
case UNM_BRDTYPE_P1_SB:
case UNM_BRDTYPE_P1_SMAX:
case UNM_BRDTYPE_P1_SOCK:
break;
case UNM_BRDTYPE_P3_10G_TRP:
else
break;
default:
boardinfo->board_type));
break;
}
return (rv);
}
/* NIU access sections */
int
{
/* For P3, we should not set MAC in HW any more */
return (0);
case UNM_NIC_GBE:
/*
* Flaky Mac address registers on qgig require several writes.
*/
for (i = 0; i < retry_count; ++i) {
return (-1);
(void) unm_niu_macaddr_get(adapter,
(unsigned char *)mac_addr);
return (0);
}
break;
case UNM_NIC_XGBE:
break;
default:
" while setting the MAC address.\n");
return (-1);
}
return (ret);
}
int
{
int ret = 0;
case UNM_NIC_GBE:
new_mtu);
break;
case UNM_NIC_XGBE:
&port_mode, 4);
if (port_mode == UNM_PORT_MODE_802_3_AP) {
} else {
if (adapter->physical_port == 0) {
new_mtu);
} else {
new_mtu);
}
}
break;
default:
}
return (ret);
}
int
{
int ret;
return (0);
case UNM_NIC_GBE:
break;
case UNM_NIC_XGBE:
break;
default:
ret = -1;
break;
}
if (!ret)
return (ret);
}
int
{
int ret = 0;
/*
* P3 does not unset promiscous mode. Why?
*/
return (0);
}
return (0);
case UNM_NIC_GBE:
break;
case UNM_NIC_XGBE:
break;
default:
ret = -1;
break;
}
if (!ret)
return (ret);
}
long
{
long ret = 0;
case UNM_NIC_GBE:
break;
case UNM_NIC_XGBE:
"%s: Function %s is not implemented for XG\n",
break;
default:
}
return (ret);
}
long
{
long ret = 0;
long reg = 0;
case UNM_NIC_GBE:
break;
case UNM_NIC_XGBE:
&port_mode, 4);
if (port_mode == UNM_PORT_MODE_802_3_AP) {
} else {
}
break;
default:
}
return (ret);
}
void
{
case UNM_NIC_GBE:
(void) unm_niu_disable_gbe_port(adapter);
break;
case UNM_NIC_XGBE:
(void) unm_niu_disable_xg_port(adapter);
break;
default:
}
}
void
struct unm_adapter_s *adapter)
{
}
int
struct unm_adapter_s *adapter)
{
}
int
{
int data;
return (data);
}
void
{
&port_mode, 4);
if (port_mode == UNM_PORT_MODE_802_3_AP) {
} else {
if (unm_nic_phy_read(adapter,
(unm_crbword_t *)&status) == 0) {
break;
break;
break;
default:
break;
}
break;
break;
default:
break;
}
} else {
}
} else {
}
}
}
}
void
{
"expected as 0x%x\n", unm_nic_driver_name,
valid = 0;
}
" Read %x, expected %x\n", unm_nic_driver_name,
valid = 0;
}
if (valid) {
int i;
int *ptr32;
for (i = 0; i < sizeof (unm_user_info_t) / sizeof (uint32_t);
i++) {
"%s: ERROR reading %s board userarea.\n",
return;
}
ptr32++;
}
if (verbmsg != 0) {
char *brd_name;
}
}
}
static int
int nr_elements)
{
unsigned int i = 0, producer;
/*
* We need to check if space is available.
*/
do {
&cmd_desc_arr[i], sizeof (cmdDescType0_t));
i++;
} while (i != nr_elements);
return (0);
}
typedef struct {
} nx_nic_req_t;
typedef struct {
} nx_mac_req_t;
static void
{
int rv;
if (rv != 0)
}
static int
{
}
/*
* Currently only invoked at interface initialization time
*/
void
{
}