nxge_mac.c revision 678453a8ed49104d8adad58f3ba591bdc39883e8
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
/* The following functions may be found in nxge_main.c */
sizeof (uint32_t))
sizeof (uint32_t))
NULL,
NULL,
NULL,
NULL,
NULL,
#ifdef NXGE_DEBUG
char *phy_type;
char *prop_val;
BCM_PHY_ID_MASK)) {
goto found_phy;
goto found_phy;
goto check_phy_done;
return (status);
return (NXGE_OK);
return (NXGE_ERROR);
return (status);
return (NXGE_ERROR);
return (NXGE_OK);
goto read_seeprom;
goto read_seeprom;
return (status);
return (status);
portn));
case N2_NIU:
case PORT_1G_FIBER:
case PORT_1G_SERDES:
case PORT_10G_FIBER:
case PORT_10G_SERDES:
case PORT_HSP_MODE:
return (NXGE_ERROR);
return (NXGE_ERROR);
switch (port_type) {
case NXGE_PORT_1G_COPPER:
case NXGE_PORT_10G_COPPER:
case NXGE_PORT_1G_FIBRE:
case NXGE_PORT_10G_FIBRE:
case NXGE_PORT_1G_SERDES:
case NXGE_PORT_10G_SERDES:
case NXGE_PORT_1G_RGMII_FIBER:
return (NXGE_ERROR);
case PORT_1G_COPPER:
case PORT_1G_RGMII_FIBER:
case P_NEPTUNE_ATLAS_4PORT:
case P_NEPTUNE_MARAMBA_P0:
case P_NEPTUNE_MARAMBA_P1:
switch (portn) {
return (NXGE_ERROR);
case PORT_10G_COPPER:
case PORT_1G_FIBER:
case PORT_1G_SERDES:
case PORT_10G_FIBER:
case PORT_10G_SERDES:
case P_NEPTUNE_MARAMBA_P0:
case P_NEPTUNE_MARAMBA_P1:
case PORT_HSP_MODE:
return (NXGE_ERROR);
switch (chip_id) {
case BCM8704_CHIP_ID:
chip_id));
case BCM8706_CHIP_ID:
chip_id));
chip_id));
return (status);
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
return (NXGE_OK);
fail:
portn));
return (status);
#ifdef NXGE_DEBUG
return (status);
goto fail;
goto fail;
goto fail;
return (NXGE_OK);
fail:
portn));
return (status);
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
return (NXGE_OK);
fail:
portn));
goto fail;
goto fail;
!= NPI_SUCCESS)
goto fail;
!= NPI_SUCCESS)
goto fail;
!= NPI_SUCCESS)
goto fail;
!= NPI_SUCCESS)
goto fail;
!= NPI_SUCCESS)
goto fail;
goto fail;
goto fail;
pass:
return (NXGE_OK);
fail:
portn));
portn));
portn));
portn));
return (NXGE_OK);
#ifdef NXGE_DEBUG
#ifdef NXGE_DEBUG
goto fail;
portn));
return (NXGE_OK);
fail:
portn));
return (status);
static nxge_status_t
int chan;
#ifdef NXGE_DEBUG
portn));
!= NXGE_OK)
goto fail;
if (portn == 0) {
!= NXGE_OK)
goto fail;
goto fail;
#ifdef NXGE_DEBUG
goto fail;
goto fail;
!= NXGE_OK)
goto fail;
!= NXGE_OK)
goto fail;
!= NXGE_OK)
goto fail;
!= NXGE_OK)
goto fail;
portn));
return (NXGE_OK);
fail:
portn));
return (status);
static nxge_status_t
int chan, i;
return (NXGE_OK);
switch (portn) {
goto done;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
if (portn == 0) {
for (i = 0; i < MAX_SERDES_RDY_RETRIES; i++) {
if (i == MAX_SERDES_RDY_RETRIES) {
goto fail;
for (i = 0; i < MAX_SERDES_RDY_RETRIES; i++) {
if (i == MAX_SERDES_RDY_RETRIES) {
goto fail;
done:
return (NXGE_OK);
fail:
return (status);
static nxge_status_t
int chan;
switch (portn) {
goto done;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
NXGE_OK) {
goto fail;
NXGE_OK) {
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
if (portn == 0) {
goto fail;
goto fail;
done:
return (NXGE_OK);
fail:
portn));
return (status);
static nxge_status_t
#ifdef NXGE_DEBUG
#ifdef NXGE_DEBUG
portn));
goto fail;
goto fail;
goto fail;
delay++;
goto fail;
!= NXGE_OK)
goto fail;
goto fail;
!= NXGE_OK)
goto fail;
!= NXGE_OK)
goto fail;
!= NXGE_OK)
goto fail;
!= NXGE_OK)
goto fail;
goto fail;
goto fail;
!= NXGE_OK)
goto fail;
!= NXGE_OK)
goto fail;
goto fail;
goto fail;
goto fail;
#ifdef NXGE_DEBUG
&val);
goto fail;
&val);
goto fail;
&val1);
goto fail;
&val1);
goto fail;
portn));
return (NXGE_OK);
fail:
return (NXGE_ERROR);
static nxge_status_t
#ifdef NXGE_DEBUG
portn));
goto fail;
goto fail;
goto fail;
delay++;
goto fail;
!= NXGE_OK)
goto fail;
!= NXGE_OK)
goto fail;
goto fail;
goto fail;
portn));
return (NXGE_OK);
fail:
return (status);
static nxge_status_t
#ifdef NXGE_DEBUG
portn));
goto done;
goto fail;
case BCM8704_CHIP_ID:
case BCM8706_CHIP_ID:
goto fail;
goto fail;
done:
portn));
return (NXGE_OK);
fail:
return (NXGE_ERROR);
static nxge_status_t
goto done;
done:
return (status);
#ifdef NXGE_DEBUG
#ifdef NXGE_DEBUG
goto fail;
portn));
return (NXGE_OK);
fail:
portn));
return (status);
return (NXGE_ERROR);
return (NXGE_ERROR);
return (NXGE_OK);
portn));
portn));
rs);
goto fail;
0)) != NPI_SUCCESS)
goto fail;
goto fail;
goto fail;
goto fail;
!= NPI_SUCCESS)
goto fail;
0)) != NPI_SUCCESS)
goto fail;
rs);
goto fail;
goto fail;
goto fail;
portn));
return (NXGE_OK);
fail:
portn));
int rdc_tbl;
return (EBUSY);
return (rdc_tbl);
return (ENOSPC);
slot++) {
& MMAC_SLOT_USED))
return (EIO);
return (EIO);
slot++;
(void) npi_mac_altaddr_enable(
(void) npi_mac_altaddr_disable(
uint32_t i;
portn));
rs);
goto fail;
goto fail;
goto fail;
for (i = 0; i < MAC_MAX_HASH_ENTRY; i++) {
hashtab_e = 0;
goto fail;
0)) != NPI_SUCCESS)
goto fail;
goto fail;
!= NPI_SUCCESS)
goto fail;
0) != NPI_SUCCESS)
goto fail;
goto fail;
!= NPI_SUCCESS)
goto fail;
portn));
return (NXGE_OK);
fail:
portn));
goto fail;
goto fail;
goto fail;
return (NXGE_OK);
fail:
return (status);
return (NXGE_OK);
goto fail;
goto fail;
return (NXGE_OK);
fail:
return (status);
portn));
goto fail;
goto fail;
goto fail;
return (NXGE_OK);
fail:
return (status);
return (NXGE_OK);
portn));
goto fail;
goto fail;
portn));
return (NXGE_OK);
fail:
portn));
portn));
!= NPI_SUCCESS)
goto fail;
!= NPI_SUCCESS)
goto fail;
portn));
return (NXGE_OK);
fail:
portn));
portn));
!= NPI_SUCCESS)
goto fail;
!= NPI_SUCCESS)
goto fail;
portn));
return (NXGE_OK);
fail:
portn));
static nxge_status_t
return (NXGE_OK);
static nxge_status_t
return (NXGE_OK);
static nxge_status_t
return (NXGE_OK);
static nxge_status_t
return (NXGE_OK);
static nxge_status_t
return (NXGE_OK);
static nxge_status_t
return (NXGE_OK);
return (NXGE_OK);
goto fail;
return (NXGE_OK);
fail:
portn));
return (status);
delay = 0;
#if defined(__i386)
goto fail;
#if defined(__i386)
!= NXGE_OK)
goto fail;
delay++;
goto fail;
#if defined(__i386)
goto fail;
#if defined(__i386)
!= NXGE_OK)
goto fail;
#if defined(__i386)
goto fail;
!= NXGE_OK)
goto fail;
#if defined(__i386)
!= NXGE_OK)
goto fail;
#if defined(__i386)
!= NXGE_OK)
goto fail;
#if defined(__i386)
!= NXGE_OK)
goto fail;
#if defined(__i386)
!= NXGE_OK)
goto fail;
== nxge_lb_ext100) {
== nxge_lb_ext10) {
#if defined(__i386)
goto fail;
#if defined(__i386)
goto fail;
#if defined(__i386)
goto fail;
fail:
return (status);
delay = 0;
#if defined(__i386)
goto fail;
goto fail;
#if defined(__i386)
!= NXGE_OK)
goto fail;
!= NXGE_OK)
goto fail;
delay++;
goto fail;
#if defined(__i386)
goto fail;
goto fail;
#if defined(__i386)
goto fail;
goto fail;
#if defined(__i386)
goto fail;
goto fail;
goto fail;
#if defined(__i386)
goto fail;
goto fail;
#if defined(__i386)
goto fail;
goto fail;
#if defined(__i386)
goto fail;
goto fail;
#if defined(__i386)
goto fail;
goto fail;
return (status);
fail:
return (status);
goto fail;
goto fail;
goto fail;
return (NXGE_OK);
fail:
xcvr_portn));
value));
goto fail;
goto fail;
goto fail;
return (NXGE_OK);
fail:
xcvr_portn));
xcvr_portn));
goto fail;
xcvr_portn));
return (NXGE_OK);
fail:
xcvr_portn));
xcvr_portn));
goto fail;
xcvr_portn));
return (NXGE_OK);
fail:
xcvr_portn));
#if defined(__i386)
goto fail;
#if defined(__i386)
goto fail;
#if defined(__i386)
goto fail;
#if defined(__i386)
!= NXGE_OK)
goto fail;
goto fail;
return (NXGE_OK);
fail:
return (status);
if (linkup) {
return (NXGE_OK);
fail:
return (status);
uint_t j;
KM_SLEEP);
if (rx_init) {
goto fail;
goto fail;
return (NXGE_OK);
fail:
return (status);
uint_t j;
return (NXGE_OK);
if (rx_init) {
goto fail;
goto fail;
return (NXGE_OK);
fail:
return (status);
goto nxge_set_mac_addr_exit;
goto fail;
goto fail;
goto nxge_set_mac_addr_end;
return (NXGE_OK);
fail:
return (status);
return (CHECK_LINK_STOP);
return (CHECK_LINK_RESCHEDULE);
static nxge_status_t
return (NXGE_ERROR);
return (NXGE_OK);
portn));
goto nxge_check_mii_link_exit;
#if defined(__i386)
goto fail;
#if defined(__i386)
goto fail;
#if defined(__i386)
goto fail;
goto nxge_check_mii_link_exit;
goto fail;
case PORT_1G_SERDES:
!= NXGE_OK) {
goto fail;
portn));
return (NXGE_OK);
fail:
portn));
return (status);
static nxge_status_t
return (NXGE_ERROR);
return (NXGE_OK);
val = 0;
portn));
goto phy_check_done;
if (phy_present_now) {
goto fail;
goto start_link_check;
} else if (!phy_present_now) {
goto start_link_check;
goto fail;
case PORT_10G_SERDES:
if (rs != 0)
goto fail;
if (link_up) {
goto fail;
goto fail;
portn));
return (NXGE_OK);
fail:
portn));
return (status);
uint32_t c;
int byte;
int bit;
return (NXGE_OK);
return (status);
return (NXGE_OK);
return (NXGE_OK);
return (NXGE_OK);
!= NXGE_OK)
goto fail;
return (NXGE_OK);
return (NXGE_ERROR);
!= NXGE_OK)
goto fail;
return (NXGE_OK);
ddi_get_lbolt() +
return (NXGE_OK);
fail:
return (status);
goto fail;
goto fail;
if (on)
return (NXGE_OK);
fail:
return (status);
#ifdef NXGE_DEBUG
#if NXGE_MIF
#ifdef NXGE_MIF
return (DDI_INTR_CLAIMED);
return (DDI_INTR_UNCLAIMED);
goto npi_fail;
goto npi_fail;
goto npi_fail;
goto npi_fail;
goto npi_fail;
goto npi_fail;
return (DDI_INTR_CLAIMED);
return (DDI_INTR_UNCLAIMED);
#ifdef NXGE_DEBUG_SYMBOL_ERR
#ifdef NXGE_DEBUG_SYMBOL_ERR
&val_debug);
if (val != 0)
if (val != 0)
if (val != 0)
&val1);
goto fail;
goto fail;
&val3);
goto fail;
case BCM8704_CHIP_ID:
case BCM8706_CHIP_ID:
goto fail;
#ifdef NXGE_DEBUG_ALIGN_ERR
return (NXGE_OK);
fail:
return (status);
!= NPI_SUCCESS)
return (NXGE_ERROR);
return (NXGE_OK);
!= NPI_SUCCESS)
return (NXGE_ERROR);
return (NXGE_OK);
static boolean_t
goto found_phy;
goto found_phy;
goto found_phy;
return (B_FALSE);
return (B_TRUE);
static boolean_t
switch (type) {
case CLAUSE_45_TYPE:
for (i = 0; i < cl45_arr_len; i++) {
case CLAUSE_22_TYPE:
for (i = 0; i < cl22_arr_len; i++) {
return (found);
static uint32_t
return (pma_pmd_dev_id);
static uint32_t
return (pcs_dev_id);
static uint32_t
&val1);
goto exit;
&val2);
if (npi_status != 0) {
goto exit;
exit:
return (phy_id);
return (NXGE_OK);
if (j < NXGE_PORTS_NEPTUNE) {
pma_pmd_dev_fd[i] = 0;
if (j < NXGE_PORTS_NEPTUNE) {
pcs_dev_fd[i] = 0;
total_port_fd ++;
total_phy_fd ++;
if (l < NXGE_PORTS_NEPTUNE) {
switch (total_port_fd) {
switch (total_phy_fd) {
goto error_exit;
goto error_exit;
switch (port_fd_arr[0]) {
goto error_exit;
goto error_exit;
switch (phy_fd_arr[0]) {
goto error_exit;
goto error_exit;
goto error_exit;
switch (total_phy_fd) {
goto error_exit;
goto error_exit;
goto error_exit;
switch (port_fd_arr[0]) {
goto error_exit;
if (port_fd_arr[0] ==
port_fd_arr[0];
goto error_exit;
switch (phy_fd_arr[0]) {
goto error_exit;
switch (port_fd_arr[0]) {
phy_fd_arr[i];
goto error_exit;
goto error_exit;
goto error_exit;
switch (total_phy_fd) {
switch (phy_fd_arr[0]) {
goto error_exit;
for (i = 0; i < NXGE_MAX_PORTS; i++) {
goto error_exit;
goto error_exit;
goto error_exit;
goto error_exit;
total_phy_fd));
goto error_exit;
goto error_exit;
return (status);
return (NXGE_ERROR);
return (B_FALSE);
return (B_TRUE);
switch (portn) {
static nxge_status_t
#if defined(__i386)
goto fail;
goto fail;
#if defined(__i386)
goto fail;
goto fail;
return (status);
fail:
return (NXGE_ERROR);
rs);
return (NXGE_OK);
#ifdef NXGE_DEBUG
#if defined(__i386)
#if defined(__i386)
#if defined(__i386)
#if defined(__i386)
#if defined(__i386)