usr/src/uts/common/io/bfe/bfe.c
1000
OUTL(bfe, BFE_ENET_CTRL, BFE_ENET_DISABLE);
usr/src/uts/common/io/bfe/bfe.c
1001
(void) bfe_wait_bit(bfe, BFE_ENET_CTRL,
usr/src/uts/common/io/bfe/bfe.c
1003
OUTL(bfe, BFE_DMATX_CTRL, 0);
usr/src/uts/common/io/bfe/bfe.c
1004
FLUSH(bfe, BFE_DMARX_STAT);
usr/src/uts/common/io/bfe/bfe.c
1006
if (INL(bfe, BFE_DMARX_STAT) & BFE_STAT_EMASK) {
usr/src/uts/common/io/bfe/bfe.c
1007
(void) bfe_wait_bit(bfe, BFE_DMARX_STAT, BFE_STAT_SIDLE,
usr/src/uts/common/io/bfe/bfe.c
1010
OUTL(bfe, BFE_DMARX_CTRL, 0);
usr/src/uts/common/io/bfe/bfe.c
1013
bfe_core_reset(bfe);
usr/src/uts/common/io/bfe/bfe.c
1014
bfe_clear_stats(bfe);
usr/src/uts/common/io/bfe/bfe.c
1016
OUTL(bfe, BFE_MDIO_CTRL, 0x8d);
usr/src/uts/common/io/bfe/bfe.c
1017
val = INL(bfe, BFE_DEVCTRL);
usr/src/uts/common/io/bfe/bfe.c
1019
OUTL(bfe, BFE_ENET_CTRL, BFE_ENET_EPSEL);
usr/src/uts/common/io/bfe/bfe.c
1020
else if (INL(bfe, BFE_DEVCTRL & BFE_EPR)) {
usr/src/uts/common/io/bfe/bfe.c
1021
OUTL_AND(bfe, BFE_DEVCTRL, ~BFE_EPR);
usr/src/uts/common/io/bfe/bfe.c
1025
OUTL_OR(bfe, BFE_MAC_CTRL, BFE_CTRL_CRC32_ENAB | BFE_CTRL_LED);
usr/src/uts/common/io/bfe/bfe.c
1027
OUTL_AND(bfe, BFE_MAC_CTRL, ~BFE_CTRL_PDOWN);
usr/src/uts/common/io/bfe/bfe.c
1029
OUTL(bfe, BFE_RCV_LAZY, ((1 << BFE_LAZY_FC_SHIFT) &
usr/src/uts/common/io/bfe/bfe.c
1032
OUTL_OR(bfe, BFE_RCV_LAZY, 0);
usr/src/uts/common/io/bfe/bfe.c
1034
OUTL(bfe, BFE_RXMAXLEN, bfe->bfe_rx_ring.r_buf_len);
usr/src/uts/common/io/bfe/bfe.c
1035
OUTL(bfe, BFE_TXMAXLEN, bfe->bfe_tx_ring.r_buf_len);
usr/src/uts/common/io/bfe/bfe.c
1037
OUTL(bfe, BFE_TX_WMARK, 56);
usr/src/uts/common/io/bfe/bfe.c
1040
OUTL(bfe, BFE_DMATX_CTRL, BFE_TX_CTRL_ENABLE);
usr/src/uts/common/io/bfe/bfe.c
1045
OUTL(bfe, BFE_DMATX_ADDR,
usr/src/uts/common/io/bfe/bfe.c
1046
bfe->bfe_tx_ring.r_desc_cookie.dmac_laddress + BFE_PCI_DMA);
usr/src/uts/common/io/bfe/bfe.c
1048
OUTL(bfe, BFE_DMARX_CTRL, (BFE_RX_OFFSET << BFE_RX_CTRL_ROSHIFT)
usr/src/uts/common/io/bfe/bfe.c
1051
OUTL(bfe, BFE_DMARX_ADDR,
usr/src/uts/common/io/bfe/bfe.c
1052
bfe->bfe_rx_ring.r_desc_cookie.dmac_laddress + BFE_PCI_DMA);
usr/src/uts/common/io/bfe/bfe.c
1054
(void) bfe_startup_phy(bfe);
usr/src/uts/common/io/bfe/bfe.c
1056
bfe->bfe_chip_state = BFE_CHIP_INITIALIZED;
usr/src/uts/common/io/bfe/bfe.c
1063
bfe_enable_chip_intrs(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
1066
OUTL(bfe, BFE_ENET_CTRL, BFE_ENET_ENABLE);
usr/src/uts/common/io/bfe/bfe.c
1069
OUTL(bfe, BFE_INTR_MASK, BFE_IMASK_DEF);
usr/src/uts/common/io/bfe/bfe.c
1076
bfe_set_rx_mode(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
1086
if (bfe->bfe_chip_state == BFE_CHIP_SUSPENDED)
usr/src/uts/common/io/bfe/bfe.c
1089
val = INL(bfe, BFE_RXCONF);
usr/src/uts/common/io/bfe/bfe.c
1094
if ((bfe->bfe_chip_mode & BFE_RX_MODE_ENABLE) == 0) {
usr/src/uts/common/io/bfe/bfe.c
1095
OUTL(bfe, BFE_CAM_CTRL, 0);
usr/src/uts/common/io/bfe/bfe.c
1096
FLUSH(bfe, BFE_CAM_CTRL);
usr/src/uts/common/io/bfe/bfe.c
1097
} else if (bfe->bfe_chip_mode & BFE_RX_MODE_PROMISC) {
usr/src/uts/common/io/bfe/bfe.c
1101
if (bfe->bfe_chip_state == BFE_CHIP_ACTIVE) {
usr/src/uts/common/io/bfe/bfe.c
1103
OUTL(bfe, BFE_RXCONF, val |
usr/src/uts/common/io/bfe/bfe.c
1105
FLUSH(bfe, BFE_RXCONF);
usr/src/uts/common/io/bfe/bfe.c
1109
OUTL(bfe, BFE_CAM_CTRL, 0);
usr/src/uts/common/io/bfe/bfe.c
1110
FLUSH(bfe, BFE_CAM_CTRL);
usr/src/uts/common/io/bfe/bfe.c
1118
bfe_cam_write(bfe, (uchar_t *)mac, i);
usr/src/uts/common/io/bfe/bfe.c
1121
bfe_cam_write(bfe, bfe->bfe_ether_addr, i);
usr/src/uts/common/io/bfe/bfe.c
1124
OUTL_OR(bfe, BFE_CAM_CTRL, BFE_CAM_ENABLE);
usr/src/uts/common/io/bfe/bfe.c
1125
FLUSH(bfe, BFE_CAM_CTRL);
usr/src/uts/common/io/bfe/bfe.c
1128
DTRACE_PROBE2(rx__mode__filter, int, bfe->bfe_unit,
usr/src/uts/common/io/bfe/bfe.c
1131
OUTL(bfe, BFE_RXCONF, val);
usr/src/uts/common/io/bfe/bfe.c
1132
FLUSH(bfe, BFE_RXCONF);
usr/src/uts/common/io/bfe/bfe.c
1139
bfe_init_vars(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
1141
bfe->bfe_chip_mode = BFE_RX_MODE_ENABLE;
usr/src/uts/common/io/bfe/bfe.c
1144
bfe->bfe_chip.link = LINK_STATE_UNKNOWN;
usr/src/uts/common/io/bfe/bfe.c
1145
bfe->bfe_chip.speed = 0;
usr/src/uts/common/io/bfe/bfe.c
1146
bfe->bfe_chip.duplex = LINK_DUPLEX_UNKNOWN;
usr/src/uts/common/io/bfe/bfe.c
1148
bfe->bfe_periodic_id = NULL;
usr/src/uts/common/io/bfe/bfe.c
1149
bfe->bfe_chip_state = BFE_CHIP_UNINITIALIZED;
usr/src/uts/common/io/bfe/bfe.c
1151
bfe->bfe_tx_stall_time = 0;
usr/src/uts/common/io/bfe/bfe.c
1224
bfe_chip_start(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
1226
ASSERT_ALL_LOCKS(bfe);
usr/src/uts/common/io/bfe/bfe.c
1231
bfe_chip_halt(bfe);
usr/src/uts/common/io/bfe/bfe.c
1232
bfe_stop_phy(bfe);
usr/src/uts/common/io/bfe/bfe.c
1237
bfe_chip_reset(bfe);
usr/src/uts/common/io/bfe/bfe.c
1242
bfe_tx_desc_init(&bfe->bfe_tx_ring);
usr/src/uts/common/io/bfe/bfe.c
1243
bfe_rx_desc_init(&bfe->bfe_rx_ring);
usr/src/uts/common/io/bfe/bfe.c
1245
bfe->bfe_chip_state = BFE_CHIP_ACTIVE;
usr/src/uts/common/io/bfe/bfe.c
1246
bfe->bfe_chip_mode |= BFE_RX_MODE_ENABLE;
usr/src/uts/common/io/bfe/bfe.c
1247
bfe_set_rx_mode(bfe);
usr/src/uts/common/io/bfe/bfe.c
1248
bfe_enable_chip_intrs(bfe);
usr/src/uts/common/io/bfe/bfe.c
1251
(void) bfe_check_link(bfe);
usr/src/uts/common/io/bfe/bfe.c
1261
bfe_clear_stats(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
1265
OUTL(bfe, BFE_MIB_CTRL, BFE_MIB_CLR_ON_READ);
usr/src/uts/common/io/bfe/bfe.c
1271
(void) INL(bfe, r);
usr/src/uts/common/io/bfe/bfe.c
1274
(void) INL(bfe, r);
usr/src/uts/common/io/bfe/bfe.c
1281
bfe_gather_stats(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
1287
v = &bfe->bfe_hw_stats.tx_good_octets;
usr/src/uts/common/io/bfe/bfe.c
1289
*v += INL(bfe, r);
usr/src/uts/common/io/bfe/bfe.c
1293
v = &bfe->bfe_hw_stats.rx_good_octets;
usr/src/uts/common/io/bfe/bfe.c
1295
*v += INL(bfe, r);
usr/src/uts/common/io/bfe/bfe.c
1323
bfe->bfe_stats.ether_stat_carrier_errors =
usr/src/uts/common/io/bfe/bfe.c
1324
bfe->bfe_hw_stats.tx_carrier_lost;
usr/src/uts/common/io/bfe/bfe.c
1328
bfe->bfe_stats.ether_stat_ex_collisions =
usr/src/uts/common/io/bfe/bfe.c
1329
bfe->bfe_hw_stats.tx_excessive_cols;
usr/src/uts/common/io/bfe/bfe.c
1330
txerr += bfe->bfe_hw_stats.tx_excessive_cols;
usr/src/uts/common/io/bfe/bfe.c
1331
coll += bfe->bfe_hw_stats.tx_excessive_cols;
usr/src/uts/common/io/bfe/bfe.c
1333
bfe->bfe_stats.ether_stat_fcs_errors =
usr/src/uts/common/io/bfe/bfe.c
1334
bfe->bfe_hw_stats.rx_crc_errs;
usr/src/uts/common/io/bfe/bfe.c
1335
rxerr += bfe->bfe_hw_stats.rx_crc_errs;
usr/src/uts/common/io/bfe/bfe.c
1337
bfe->bfe_stats.ether_stat_first_collisions =
usr/src/uts/common/io/bfe/bfe.c
1338
bfe->bfe_hw_stats.tx_single_cols;
usr/src/uts/common/io/bfe/bfe.c
1339
coll += bfe->bfe_hw_stats.tx_single_cols;
usr/src/uts/common/io/bfe/bfe.c
1340
bfe->bfe_stats.ether_stat_multi_collisions =
usr/src/uts/common/io/bfe/bfe.c
1341
bfe->bfe_hw_stats.tx_multiple_cols;
usr/src/uts/common/io/bfe/bfe.c
1342
coll += bfe->bfe_hw_stats.tx_multiple_cols;
usr/src/uts/common/io/bfe/bfe.c
1344
bfe->bfe_stats.ether_stat_toolong_errors =
usr/src/uts/common/io/bfe/bfe.c
1345
bfe->bfe_hw_stats.rx_oversize_pkts;
usr/src/uts/common/io/bfe/bfe.c
1346
rxerr += bfe->bfe_hw_stats.rx_oversize_pkts;
usr/src/uts/common/io/bfe/bfe.c
1348
bfe->bfe_stats.ether_stat_tooshort_errors =
usr/src/uts/common/io/bfe/bfe.c
1349
bfe->bfe_hw_stats.rx_undersize;
usr/src/uts/common/io/bfe/bfe.c
1350
rxerr += bfe->bfe_hw_stats.rx_undersize;
usr/src/uts/common/io/bfe/bfe.c
1352
bfe->bfe_stats.ether_stat_tx_late_collisions +=
usr/src/uts/common/io/bfe/bfe.c
1353
bfe->bfe_hw_stats.tx_late_cols;
usr/src/uts/common/io/bfe/bfe.c
1355
bfe->bfe_stats.ether_stat_defer_xmts +=
usr/src/uts/common/io/bfe/bfe.c
1356
bfe->bfe_hw_stats.tx_defered;
usr/src/uts/common/io/bfe/bfe.c
1358
bfe->bfe_stats.ether_stat_macrcv_errors += rxerr;
usr/src/uts/common/io/bfe/bfe.c
1359
bfe->bfe_stats.ether_stat_macxmt_errors += txerr;
usr/src/uts/common/io/bfe/bfe.c
1361
bfe->bfe_stats.collisions += coll;
usr/src/uts/common/io/bfe/bfe.c
1370
bfe_t *bfe = (bfe_t *)arg;
usr/src/uts/common/io/bfe/bfe.c
1374
rw_enter(&bfe->bfe_rwlock, RW_READER);
usr/src/uts/common/io/bfe/bfe.c
1387
if (bfe->bfe_chip_state == BFE_CHIP_ACTIVE) {
usr/src/uts/common/io/bfe/bfe.c
1391
bfe_gather_stats(bfe);
usr/src/uts/common/io/bfe/bfe.c
1393
v = bfe->bfe_chip.speed;
usr/src/uts/common/io/bfe/bfe.c
1397
v = bfe->bfe_adv_100T4;
usr/src/uts/common/io/bfe/bfe.c
1401
v = (bfe->bfe_mii_anar & MII_ABILITY_100BASE_TX_FD) != 0;
usr/src/uts/common/io/bfe/bfe.c
1405
v = (bfe->bfe_mii_anar & MII_ABILITY_100BASE_TX) != 0;
usr/src/uts/common/io/bfe/bfe.c
1409
v = (bfe->bfe_mii_anar & MII_ABILITY_10BASE_T_FD) != 0;
usr/src/uts/common/io/bfe/bfe.c
1413
v = (bfe->bfe_mii_anar & MII_ABILITY_10BASE_T) != 0;
usr/src/uts/common/io/bfe/bfe.c
1421
v = bfe->bfe_adv_aneg;
usr/src/uts/common/io/bfe/bfe.c
1425
v = (bfe->bfe_mii_anar & MII_ABILITY_PAUSE) != 0;
usr/src/uts/common/io/bfe/bfe.c
1429
v = (bfe->bfe_mii_anar & MII_AN_ADVERT_REMFAULT) != 0;
usr/src/uts/common/io/bfe/bfe.c
1434
v = bfe->bfe_stats.ether_stat_align_errors;
usr/src/uts/common/io/bfe/bfe.c
1438
v = (bfe->bfe_mii_bmsr & MII_STATUS_100_BASE_T4) != 0;
usr/src/uts/common/io/bfe/bfe.c
1442
v = (bfe->bfe_mii_bmsr & MII_STATUS_100_BASEX_FD) != 0;
usr/src/uts/common/io/bfe/bfe.c
1446
v = (bfe->bfe_mii_bmsr & MII_STATUS_100_BASEX) != 0;
usr/src/uts/common/io/bfe/bfe.c
1450
v = (bfe->bfe_mii_bmsr & MII_STATUS_10_FD) != 0;
usr/src/uts/common/io/bfe/bfe.c
1454
v = (bfe->bfe_mii_bmsr & MII_STATUS_10) != 0;
usr/src/uts/common/io/bfe/bfe.c
1462
v = ((bfe->bfe_mii_bmsr & MII_STATUS_CANAUTONEG) != 0);
usr/src/uts/common/io/bfe/bfe.c
1470
v = (bfe->bfe_mii_bmsr & MII_STATUS_REMFAULT) != 0;
usr/src/uts/common/io/bfe/bfe.c
1474
v = bfe->bfe_stats.ether_stat_carrier_errors;
usr/src/uts/common/io/bfe/bfe.c
1482
v = bfe->bfe_stats.ether_stat_defer_xmts;
usr/src/uts/common/io/bfe/bfe.c
1487
v = bfe->bfe_stats.ether_stat_ex_collisions;
usr/src/uts/common/io/bfe/bfe.c
1492
v = bfe->bfe_stats.ether_stat_fcs_errors;
usr/src/uts/common/io/bfe/bfe.c
1497
v = bfe->bfe_stats.ether_stat_first_collisions;
usr/src/uts/common/io/bfe/bfe.c
1505
v = (bfe->bfe_mii_bmcr & MII_CONTROL_ANE) != 0 &&
usr/src/uts/common/io/bfe/bfe.c
1506
(bfe->bfe_mii_bmsr & MII_STATUS_ANDONE) != 0;
usr/src/uts/common/io/bfe/bfe.c
1510
v = bfe->bfe_chip.duplex;
usr/src/uts/common/io/bfe/bfe.c
1514
v = (bfe->bfe_mii_anlpar & MII_ABILITY_100BASE_T4) != 0;
usr/src/uts/common/io/bfe/bfe.c
1518
v = (bfe->bfe_mii_anlpar & MII_ABILITY_100BASE_TX_FD) != 0;
usr/src/uts/common/io/bfe/bfe.c
1522
v = (bfe->bfe_mii_anlpar & MII_ABILITY_100BASE_TX) != 0;
usr/src/uts/common/io/bfe/bfe.c
1526
v = (bfe->bfe_mii_anlpar & MII_ABILITY_10BASE_T_FD) != 0;
usr/src/uts/common/io/bfe/bfe.c
1530
v = (bfe->bfe_mii_anlpar & MII_ABILITY_10BASE_T) != 0;
usr/src/uts/common/io/bfe/bfe.c
1538
v = (bfe->bfe_mii_exp & MII_AN_EXP_LPCANAN) != 0;
usr/src/uts/common/io/bfe/bfe.c
1542
v = (bfe->bfe_mii_anlpar & MII_ABILITY_PAUSE) != 0;
usr/src/uts/common/io/bfe/bfe.c
1546
v = (bfe->bfe_mii_anlpar & MII_STATUS_REMFAULT) != 0;
usr/src/uts/common/io/bfe/bfe.c
1550
v = bfe->bfe_stats.ether_stat_macrcv_errors;
usr/src/uts/common/io/bfe/bfe.c
1554
v = bfe->bfe_stats.ether_stat_macxmt_errors;
usr/src/uts/common/io/bfe/bfe.c
1558
v = bfe->bfe_stats.ether_stat_multi_collisions;
usr/src/uts/common/io/bfe/bfe.c
1566
v = bfe->bfe_stats.ether_stat_toolong_errors;
usr/src/uts/common/io/bfe/bfe.c
1570
v = bfe->bfe_stats.ether_stat_tooshort_errors;
usr/src/uts/common/io/bfe/bfe.c
1574
v = bfe->bfe_stats.ether_stat_tx_late_collisions;
usr/src/uts/common/io/bfe/bfe.c
1578
v = bfe->bfe_phy_addr;
usr/src/uts/common/io/bfe/bfe.c
1582
v = bfe->bfe_phy_id;
usr/src/uts/common/io/bfe/bfe.c
1586
v = bfe->bfe_stats.brdcstrcv;
usr/src/uts/common/io/bfe/bfe.c
1590
v = bfe->bfe_stats.brdcstxmt;
usr/src/uts/common/io/bfe/bfe.c
1594
v = bfe->bfe_stats.multixmt;
usr/src/uts/common/io/bfe/bfe.c
1598
v = bfe->bfe_stats.collisions;
usr/src/uts/common/io/bfe/bfe.c
1602
v = bfe->bfe_stats.ierrors;
usr/src/uts/common/io/bfe/bfe.c
1606
v = bfe->bfe_stats.ipackets;
usr/src/uts/common/io/bfe/bfe.c
1610
v = bfe->bfe_stats.multircv;
usr/src/uts/common/io/bfe/bfe.c
1614
v = bfe->bfe_stats.norcvbuf;
usr/src/uts/common/io/bfe/bfe.c
1618
v = bfe->bfe_stats.noxmtbuf;
usr/src/uts/common/io/bfe/bfe.c
1622
v = bfe->bfe_stats.obytes;
usr/src/uts/common/io/bfe/bfe.c
1627
v = bfe->bfe_stats.ether_stat_macxmt_errors;
usr/src/uts/common/io/bfe/bfe.c
1631
v = bfe->bfe_stats.opackets;
usr/src/uts/common/io/bfe/bfe.c
1635
v = bfe->bfe_stats.rbytes;
usr/src/uts/common/io/bfe/bfe.c
1639
v = bfe->bfe_stats.underflows;
usr/src/uts/common/io/bfe/bfe.c
1643
v = bfe->bfe_stats.overflows;
usr/src/uts/common/io/bfe/bfe.c
1647
rw_exit(&bfe->bfe_rwlock);
usr/src/uts/common/io/bfe/bfe.c
1657
bfe_t *bfe = (bfe_t *)arg;
usr/src/uts/common/io/bfe/bfe.c
1663
bcopy(&bfe->bfe_chip.duplex, val, sizeof (link_duplex_t));
usr/src/uts/common/io/bfe/bfe.c
1668
bcopy(&bfe->bfe_chip.speed, val, sizeof (uint64_t));
usr/src/uts/common/io/bfe/bfe.c
1672
*(uint8_t *)val = bfe->bfe_adv_aneg;
usr/src/uts/common/io/bfe/bfe.c
1676
*(uint8_t *)val = bfe->bfe_adv_100fdx;
usr/src/uts/common/io/bfe/bfe.c
1680
*(uint8_t *)val = bfe->bfe_adv_100fdx;
usr/src/uts/common/io/bfe/bfe.c
1684
*(uint8_t *)val = bfe->bfe_adv_100hdx;
usr/src/uts/common/io/bfe/bfe.c
1688
*(uint8_t *)val = bfe->bfe_adv_100hdx;
usr/src/uts/common/io/bfe/bfe.c
1692
*(uint8_t *)val = bfe->bfe_adv_10fdx;
usr/src/uts/common/io/bfe/bfe.c
1696
*(uint8_t *)val = bfe->bfe_adv_10fdx;
usr/src/uts/common/io/bfe/bfe.c
1700
*(uint8_t *)val = bfe->bfe_adv_10hdx;
usr/src/uts/common/io/bfe/bfe.c
1704
*(uint8_t *)val = bfe->bfe_adv_10hdx;
usr/src/uts/common/io/bfe/bfe.c
1708
*(uint8_t *)val = bfe->bfe_adv_100T4;
usr/src/uts/common/io/bfe/bfe.c
1712
*(uint8_t *)val = bfe->bfe_adv_100T4;
usr/src/uts/common/io/bfe/bfe.c
1727
bfe_t *bfe = (bfe_t *)arg;
usr/src/uts/common/io/bfe/bfe.c
1742
mac_prop_info_set_default_uint8(prh, bfe->bfe_cap_aneg);
usr/src/uts/common/io/bfe/bfe.c
1746
mac_prop_info_set_default_uint8(prh, bfe->bfe_cap_100fdx);
usr/src/uts/common/io/bfe/bfe.c
1750
mac_prop_info_set_default_uint8(prh, bfe->bfe_cap_100hdx);
usr/src/uts/common/io/bfe/bfe.c
1754
mac_prop_info_set_default_uint8(prh, bfe->bfe_cap_10fdx);
usr/src/uts/common/io/bfe/bfe.c
1758
mac_prop_info_set_default_uint8(prh, bfe->bfe_cap_10hdx);
usr/src/uts/common/io/bfe/bfe.c
1769
bfe_t *bfe = (bfe_t *)arg;
usr/src/uts/common/io/bfe/bfe.c
1776
advp = &bfe->bfe_adv_100fdx;
usr/src/uts/common/io/bfe/bfe.c
1777
capp = &bfe->bfe_cap_100fdx;
usr/src/uts/common/io/bfe/bfe.c
1781
advp = &bfe->bfe_adv_100hdx;
usr/src/uts/common/io/bfe/bfe.c
1782
capp = &bfe->bfe_cap_100hdx;
usr/src/uts/common/io/bfe/bfe.c
1786
advp = &bfe->bfe_adv_10fdx;
usr/src/uts/common/io/bfe/bfe.c
1787
capp = &bfe->bfe_cap_10fdx;
usr/src/uts/common/io/bfe/bfe.c
1791
advp = &bfe->bfe_adv_10hdx;
usr/src/uts/common/io/bfe/bfe.c
1792
capp = &bfe->bfe_cap_10hdx;
usr/src/uts/common/io/bfe/bfe.c
1796
advp = &bfe->bfe_adv_aneg;
usr/src/uts/common/io/bfe/bfe.c
1797
capp = &bfe->bfe_cap_aneg;
usr/src/uts/common/io/bfe/bfe.c
1807
bfe_grab_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
1812
bfe->bfe_chip_action = BFE_ACTION_RESTART_SETPROP;
usr/src/uts/common/io/bfe/bfe.c
1813
if (bfe->bfe_chip_state == BFE_CHIP_ACTIVE) {
usr/src/uts/common/io/bfe/bfe.c
1818
bfe_stop_timer(bfe);
usr/src/uts/common/io/bfe/bfe.c
1820
bfe->bfe_chip_action |= BFE_ACTION_RESTART;
usr/src/uts/common/io/bfe/bfe.c
1822
bfe_chip_restart(bfe);
usr/src/uts/common/io/bfe/bfe.c
1828
bfe->bfe_chip_action &= ~(BFE_ACTION_RESTART);
usr/src/uts/common/io/bfe/bfe.c
1833
bfe_release_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
1837
mac_tx_update(bfe->bfe_machdl);
usr/src/uts/common/io/bfe/bfe.c
1846
bfe_t *bfe = (bfe_t *)arg;
usr/src/uts/common/io/bfe/bfe.c
1848
bfe_grab_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
1849
bcopy(ea, bfe->bfe_ether_addr, ETHERADDRL);
usr/src/uts/common/io/bfe/bfe.c
1850
bfe_set_rx_mode(bfe);
usr/src/uts/common/io/bfe/bfe.c
1851
bfe_release_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
1858
bfe_t *bfe = (bfe_t *)arg;
usr/src/uts/common/io/bfe/bfe.c
1860
bfe_grab_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
1861
if (bfe_chip_start(bfe) == DDI_FAILURE) {
usr/src/uts/common/io/bfe/bfe.c
1862
bfe_release_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
1866
bfe_release_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
1868
mac_tx_update(bfe->bfe_machdl);
usr/src/uts/common/io/bfe/bfe.c
1876
bfe_t *bfe = (bfe_t *)arg;
usr/src/uts/common/io/bfe/bfe.c
1882
bfe_stop_timer(bfe);
usr/src/uts/common/io/bfe/bfe.c
1884
bfe_grab_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
1889
bfe_chip_halt(bfe);
usr/src/uts/common/io/bfe/bfe.c
1890
bfe_stop_phy(bfe);
usr/src/uts/common/io/bfe/bfe.c
1892
bfe->bfe_chip_state = BFE_CHIP_STOPPED;
usr/src/uts/common/io/bfe/bfe.c
1897
bfe_chip_reset(bfe);
usr/src/uts/common/io/bfe/bfe.c
1902
bfe->bfe_chip_mode &= ~BFE_RX_MODE_ENABLE;
usr/src/uts/common/io/bfe/bfe.c
1903
bfe_set_rx_mode(bfe);
usr/src/uts/common/io/bfe/bfe.c
1905
bfe_release_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
1912
bfe_send_a_packet(bfe_t *bfe, mblk_t *mp)
usr/src/uts/common/io/bfe/bfe.c
1914
bfe_ring_t *r = &bfe->bfe_tx_ring;
usr/src/uts/common/io/bfe/bfe.c
1938
bfe->bfe_stats.noxmtbuf++;
usr/src/uts/common/io/bfe/bfe.c
1939
bfe->bfe_tx_resched = 1;
usr/src/uts/common/io/bfe/bfe.c
1955
bfe->bfe_stats.multixmt++;
usr/src/uts/common/io/bfe/bfe.c
1957
bfe->bfe_stats.brdcstxmt++;
usr/src/uts/common/io/bfe/bfe.c
1959
bfe->bfe_stats.opackets++;
usr/src/uts/common/io/bfe/bfe.c
1960
bfe->bfe_stats.obytes += pktlen;
usr/src/uts/common/io/bfe/bfe.c
1997
OUTL(bfe, BFE_DMATX_PTR, next * sizeof (bfe_desc_t));
usr/src/uts/common/io/bfe/bfe.c
1998
FLUSH(bfe, BFE_DMATX_PTR);
usr/src/uts/common/io/bfe/bfe.c
2006
bfe->bfe_tx_stall_time = gethrtime() + (5 * 1000000000ULL);
usr/src/uts/common/io/bfe/bfe.c
2014
bfe_t *bfe = (bfe_t *)arg;
usr/src/uts/common/io/bfe/bfe.c
2015
bfe_ring_t *r = &bfe->bfe_tx_ring;
usr/src/uts/common/io/bfe/bfe.c
2020
if (bfe->bfe_chip_state != BFE_CHIP_ACTIVE) {
usr/src/uts/common/io/bfe/bfe.c
2021
DTRACE_PROBE1(tx__chip__not__active, int, bfe->bfe_unit);
usr/src/uts/common/io/bfe/bfe.c
2033
if (bfe_send_a_packet(bfe, mp) == BFE_FAILURE) {
usr/src/uts/common/io/bfe/bfe.c
2048
bfe_t *bfe = (bfe_t *)arg;
usr/src/uts/common/io/bfe/bfe.c
2050
bfe_grab_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
2051
if (bfe->bfe_chip_state != BFE_CHIP_ACTIVE) {
usr/src/uts/common/io/bfe/bfe.c
2052
bfe_release_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
2058
bfe->bfe_chip_mode |= BFE_RX_MODE_PROMISC;
usr/src/uts/common/io/bfe/bfe.c
2060
bfe->bfe_chip_mode &= ~BFE_RX_MODE_PROMISC;
usr/src/uts/common/io/bfe/bfe.c
2063
bfe_set_rx_mode(bfe);
usr/src/uts/common/io/bfe/bfe.c
2064
bfe_release_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
2099
bfe_error_handler(bfe_t *bfe, int intr_mask)
usr/src/uts/common/io/bfe/bfe.c
2104
bfe->bfe_stats.overflows++;
usr/src/uts/common/io/bfe/bfe.c
2105
bfe->bfe_chip_action |=
usr/src/uts/common/io/bfe/bfe.c
2111
bfe->bfe_stats.underflows++;
usr/src/uts/common/io/bfe/bfe.c
2117
bfe_error(bfe->bfe_dip,
usr/src/uts/common/io/bfe/bfe.c
2119
bfe->bfe_chip_action |=
usr/src/uts/common/io/bfe/bfe.c
2126
bfe_error(bfe->bfe_dip, "Descriptor Error. Restarting Chip");
usr/src/uts/common/io/bfe/bfe.c
2132
bfe_error(bfe->bfe_dip,
usr/src/uts/common/io/bfe/bfe.c
2134
bfe->bfe_stats.ether_stat_macrcv_errors++;
usr/src/uts/common/io/bfe/bfe.c
2135
bfe->bfe_chip_action |=
usr/src/uts/common/io/bfe/bfe.c
2140
v = INL(bfe, BFE_DMATX_STAT);
usr/src/uts/common/io/bfe/bfe.c
2144
bfe->bfe_stats.ether_stat_macxmt_errors++;
usr/src/uts/common/io/bfe/bfe.c
2145
bfe_error(bfe->bfe_dip,
usr/src/uts/common/io/bfe/bfe.c
2150
v = INL(bfe, BFE_DMARX_STAT);
usr/src/uts/common/io/bfe/bfe.c
2152
bfe->bfe_stats.ierrors++;
usr/src/uts/common/io/bfe/bfe.c
2153
bfe_error(bfe->bfe_dip,
usr/src/uts/common/io/bfe/bfe.c
2158
bfe->bfe_chip_action |=
usr/src/uts/common/io/bfe/bfe.c
2162
bfe_chip_halt(bfe);
usr/src/uts/common/io/bfe/bfe.c
2169
bfe_rx_desc_buf_reinit(bfe_t *bfe, uint_t slot)
usr/src/uts/common/io/bfe/bfe.c
2171
bfe_ring_t *r = &bfe->bfe_rx_ring;
usr/src/uts/common/io/bfe/bfe.c
2197
bfe_receive(bfe_t *bfe, int intr_mask)
usr/src/uts/common/io/bfe/bfe.c
2204
bfe_ring_t *r = &bfe->bfe_rx_ring;
usr/src/uts/common/io/bfe/bfe.c
2207
rxstat = INL(bfe, BFE_DMARX_STAT);
usr/src/uts/common/io/bfe/bfe.c
2213
DTRACE_PROBE3(receive, int, bfe->bfe_unit,
usr/src/uts/common/io/bfe/bfe.c
2247
bfe_rx_desc_buf_reinit(bfe, i);
usr/src/uts/common/io/bfe/bfe.c
2269
bfe->bfe_stats.ipackets++;
usr/src/uts/common/io/bfe/bfe.c
2272
bfe->bfe_stats.rbytes += len;
usr/src/uts/common/io/bfe/bfe.c
2275
bfe->bfe_stats.brdcstrcv++;
usr/src/uts/common/io/bfe/bfe.c
2277
bfe->bfe_stats.multircv++;
usr/src/uts/common/io/bfe/bfe.c
2279
bfe->bfe_stats.norcvbuf++;
usr/src/uts/common/io/bfe/bfe.c
2281
bfe_rx_desc_buf_reinit(bfe, i);
usr/src/uts/common/io/bfe/bfe.c
2289
bfe_rx_desc_buf_reinit(bfe, i);
usr/src/uts/common/io/bfe/bfe.c
2345
bfe_tx_done(bfe_t *bfe, int intr_mask)
usr/src/uts/common/io/bfe/bfe.c
2347
bfe_ring_t *r = &bfe->bfe_tx_ring;
usr/src/uts/common/io/bfe/bfe.c
2353
if (bfe->bfe_tx_resched) {
usr/src/uts/common/io/bfe/bfe.c
2355
bfe->bfe_tx_resched = 0;
usr/src/uts/common/io/bfe/bfe.c
2368
bfe_t *bfe = (void *)arg1;
usr/src/uts/common/io/bfe/bfe.c
2377
rw_enter(&bfe->bfe_rwlock, RW_READER);
usr/src/uts/common/io/bfe/bfe.c
2383
intr_stat = INL(bfe, BFE_INTR_STAT);
usr/src/uts/common/io/bfe/bfe.c
2385
OUTL(bfe, BFE_INTR_STAT, intr_stat);
usr/src/uts/common/io/bfe/bfe.c
2386
(void) INL(bfe, BFE_INTR_STAT);
usr/src/uts/common/io/bfe/bfe.c
2389
rw_exit(&bfe->bfe_rwlock);
usr/src/uts/common/io/bfe/bfe.c
2393
DTRACE_PROBE2(bfe__interrupt, int, bfe->bfe_unit,
usr/src/uts/common/io/bfe/bfe.c
2396
if (bfe->bfe_chip_state != BFE_CHIP_ACTIVE) {
usr/src/uts/common/io/bfe/bfe.c
2400
if (bfe->bfe_chip_state == BFE_CHIP_SUSPENDED) {
usr/src/uts/common/io/bfe/bfe.c
2401
rw_exit(&bfe->bfe_rwlock);
usr/src/uts/common/io/bfe/bfe.c
2403
bfe->bfe_unit);
usr/src/uts/common/io/bfe/bfe.c
2410
bfe_chip_halt(bfe);
usr/src/uts/common/io/bfe/bfe.c
2411
rw_exit(&bfe->bfe_rwlock);
usr/src/uts/common/io/bfe/bfe.c
2413
bfe->bfe_unit);
usr/src/uts/common/io/bfe/bfe.c
2419
rx_head = bfe_receive(bfe, intr_stat);
usr/src/uts/common/io/bfe/bfe.c
2424
resched = bfe_tx_done(bfe, intr_stat);
usr/src/uts/common/io/bfe/bfe.c
2429
bfe_error_handler(bfe, intr_stat);
usr/src/uts/common/io/bfe/bfe.c
2432
rw_exit(&bfe->bfe_rwlock);
usr/src/uts/common/io/bfe/bfe.c
2438
mac_rx(bfe->bfe_machdl, 0, rx_head);
usr/src/uts/common/io/bfe/bfe.c
244
#define ASSERT_ALL_LOCKS(bfe) { \
usr/src/uts/common/io/bfe/bfe.c
2445
mac_tx_update(bfe->bfe_machdl);
usr/src/uts/common/io/bfe/bfe.c
245
ASSERT(mutex_owned(&bfe->bfe_tx_ring.r_lock)); \
usr/src/uts/common/io/bfe/bfe.c
2454
bfe_remove_intr(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
2456
(void) ddi_intr_remove_handler(bfe->bfe_intrhdl);
usr/src/uts/common/io/bfe/bfe.c
2457
(void) ddi_intr_free(bfe->bfe_intrhdl);
usr/src/uts/common/io/bfe/bfe.c
246
ASSERT(rw_write_held(&bfe->bfe_rwlock)); \
usr/src/uts/common/io/bfe/bfe.c
2464
bfe_add_intr(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
2469
ret = ddi_intr_alloc(bfe->bfe_dip, &bfe->bfe_intrhdl,
usr/src/uts/common/io/bfe/bfe.c
2477
bfe_error(bfe->bfe_dip, "ddi_intr_alloc() failed"
usr/src/uts/common/io/bfe/bfe.c
2482
ret = ddi_intr_add_handler(bfe->bfe_intrhdl, bfe_interrupt, bfe, NULL);
usr/src/uts/common/io/bfe/bfe.c
2484
bfe_error(bfe->bfe_dip, "ddi_intr_add_handler() failed");
usr/src/uts/common/io/bfe/bfe.c
2485
(void) ddi_intr_free(bfe->bfe_intrhdl);
usr/src/uts/common/io/bfe/bfe.c
2489
ret = ddi_intr_get_pri(bfe->bfe_intrhdl, &bfe->bfe_intrpri);
usr/src/uts/common/io/bfe/bfe.c
2491
bfe_error(bfe->bfe_dip, "ddi_intr_get_pri() failed");
usr/src/uts/common/io/bfe/bfe.c
2492
bfe_remove_intr(bfe);
usr/src/uts/common/io/bfe/bfe.c
2504
bfe_identify_hardware(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
2509
vid = pci_config_get16(bfe->bfe_conf_handle, PCI_CONF_VENID);
usr/src/uts/common/io/bfe/bfe.c
2510
did = pci_config_get16(bfe->bfe_conf_handle, PCI_CONF_DEVID);
usr/src/uts/common/io/bfe/bfe.c
2519
bfe_error(bfe->bfe_dip, "bfe driver is attaching to unknown pci%d,%d"
usr/src/uts/common/io/bfe/bfe.c
2529
bfe_regs_map(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
2531
dev_info_t *dip = bfe->bfe_dip;
usr/src/uts/common/io/bfe/bfe.c
2534
ret = ddi_regs_map_setup(dip, 1, &bfe->bfe_mem_regset.addr, 0, 0,
usr/src/uts/common/io/bfe/bfe.c
2535
&bfe_dev_attr, &bfe->bfe_mem_regset.hdl);
usr/src/uts/common/io/bfe/bfe.c
2538
bfe_error(bfe->bfe_dip, "ddi_regs_map_setup failed");
usr/src/uts/common/io/bfe/bfe.c
2546
bfe_unmap_regs(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
2548
ddi_regs_map_free(&bfe->bfe_mem_regset.hdl);
usr/src/uts/common/io/bfe/bfe.c
2552
bfe_get_chip_config(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
2555
bfe->bfe_dev_addr[0] = bfe->bfe_ether_addr[0] =
usr/src/uts/common/io/bfe/bfe.c
2556
INB(bfe, BFE_EEPROM_BASE + 79);
usr/src/uts/common/io/bfe/bfe.c
2558
bfe->bfe_dev_addr[1] = bfe->bfe_ether_addr[1] =
usr/src/uts/common/io/bfe/bfe.c
2559
INB(bfe, BFE_EEPROM_BASE + 78);
usr/src/uts/common/io/bfe/bfe.c
2561
bfe->bfe_dev_addr[2] = bfe->bfe_ether_addr[2] =
usr/src/uts/common/io/bfe/bfe.c
2562
INB(bfe, BFE_EEPROM_BASE + 81);
usr/src/uts/common/io/bfe/bfe.c
2564
bfe->bfe_dev_addr[3] = bfe->bfe_ether_addr[3] =
usr/src/uts/common/io/bfe/bfe.c
2565
INB(bfe, BFE_EEPROM_BASE + 80);
usr/src/uts/common/io/bfe/bfe.c
2567
bfe->bfe_dev_addr[4] = bfe->bfe_ether_addr[4] =
usr/src/uts/common/io/bfe/bfe.c
2568
INB(bfe, BFE_EEPROM_BASE + 83);
usr/src/uts/common/io/bfe/bfe.c
2570
bfe->bfe_dev_addr[5] = bfe->bfe_ether_addr[5] =
usr/src/uts/common/io/bfe/bfe.c
2571
INB(bfe, BFE_EEPROM_BASE + 82);
usr/src/uts/common/io/bfe/bfe.c
2573
bfe->bfe_phy_addr = -1;
usr/src/uts/common/io/bfe/bfe.c
2582
bfe_ring_buf_alloc(bfe_t *bfe, bfe_ring_t *r, int slot, int d)
usr/src/uts/common/io/bfe/bfe.c
2587
err = ddi_dma_alloc_handle(bfe->bfe_dip,
usr/src/uts/common/io/bfe/bfe.c
2592
bfe_error(bfe->bfe_dip, " bfe_ring_buf_alloc() :"
usr/src/uts/common/io/bfe/bfe.c
2604
bfe_error(bfe->bfe_dip, " bfe_ring_buf_alloc() :"
usr/src/uts/common/io/bfe/bfe.c
2618
bfe_error(bfe->bfe_dip, " bfe_ring_buf_alloc() :"
usr/src/uts/common/io/bfe/bfe.c
2624
bfe_error(bfe->bfe_dip, " bfe_ring_buf_alloc() :"
usr/src/uts/common/io/bfe/bfe.c
2674
bfe_ring_desc_alloc(bfe_t *bfe, bfe_ring_t *r, int d)
usr/src/uts/common/io/bfe/bfe.c
2682
ASSERT(bfe != NULL);
usr/src/uts/common/io/bfe/bfe.c
2689
err = ddi_dma_alloc_handle(bfe->bfe_dip, &bfe_dma_attr_desc,
usr/src/uts/common/io/bfe/bfe.c
2693
bfe_error(bfe->bfe_dip, "bfe_ring_desc_alloc() failed on"
usr/src/uts/common/io/bfe/bfe.c
2706
bfe_error(bfe->bfe_dip, "bfe_ring_desc_alloc() failed on"
usr/src/uts/common/io/bfe/bfe.c
2720
bfe_error(bfe->bfe_dip, "bfe_ring_desc_alloc() failed on"
usr/src/uts/common/io/bfe/bfe.c
274
bfe_grab_locks(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
2746
if (bfe_ring_buf_alloc(bfe, r, i, d) != DDI_SUCCESS) {
usr/src/uts/common/io/bfe/bfe.c
276
bfe_ring_t *tx = &bfe->bfe_tx_ring;
usr/src/uts/common/io/bfe/bfe.c
2767
bfe_rings_alloc(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
2770
mutex_init(&bfe->bfe_tx_ring.r_lock, NULL, MUTEX_DRIVER, NULL);
usr/src/uts/common/io/bfe/bfe.c
2771
bfe->bfe_tx_ring.r_lockp = &bfe->bfe_tx_ring.r_lock;
usr/src/uts/common/io/bfe/bfe.c
2772
bfe->bfe_tx_ring.r_buf_len = BFE_MTU + sizeof (struct ether_header) +
usr/src/uts/common/io/bfe/bfe.c
2774
bfe->bfe_tx_ring.r_ndesc = TX_NUM_DESC;
usr/src/uts/common/io/bfe/bfe.c
2775
bfe->bfe_tx_ring.r_bfe = bfe;
usr/src/uts/common/io/bfe/bfe.c
2776
bfe->bfe_tx_ring.r_avail_desc = TX_NUM_DESC;
usr/src/uts/common/io/bfe/bfe.c
2779
mutex_init(&bfe->bfe_rx_ring.r_lock, NULL, MUTEX_DRIVER, NULL);
usr/src/uts/common/io/bfe/bfe.c
2780
bfe->bfe_rx_ring.r_lockp = &bfe->bfe_rx_ring.r_lock;
usr/src/uts/common/io/bfe/bfe.c
2781
bfe->bfe_rx_ring.r_buf_len = BFE_MTU + sizeof (struct ether_header) +
usr/src/uts/common/io/bfe/bfe.c
2783
bfe->bfe_rx_ring.r_ndesc = RX_NUM_DESC;
usr/src/uts/common/io/bfe/bfe.c
2784
bfe->bfe_rx_ring.r_bfe = bfe;
usr/src/uts/common/io/bfe/bfe.c
2785
bfe->bfe_rx_ring.r_avail_desc = RX_NUM_DESC;
usr/src/uts/common/io/bfe/bfe.c
2788
if (bfe_ring_desc_alloc(bfe, &bfe->bfe_tx_ring,
usr/src/uts/common/io/bfe/bfe.c
2793
if (bfe_ring_desc_alloc(bfe, &bfe->bfe_rx_ring,
usr/src/uts/common/io/bfe/bfe.c
2796
bfe_ring_desc_free(&bfe->bfe_tx_ring);
usr/src/uts/common/io/bfe/bfe.c
2800
bfe->bfe_tx_ring.r_flags = BFE_RING_ALLOCATED;
usr/src/uts/common/io/bfe/bfe.c
2801
bfe->bfe_rx_ring.r_flags = BFE_RING_ALLOCATED;
usr/src/uts/common/io/bfe/bfe.c
2809
bfe_t *bfe;
usr/src/uts/common/io/bfe/bfe.c
2812
if ((bfe = ddi_get_driver_private(dip)) == NULL) {
usr/src/uts/common/io/bfe/bfe.c
2821
bfe_grab_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
2822
bfe->bfe_chip_state = BFE_CHIP_RESUME;
usr/src/uts/common/io/bfe/bfe.c
2824
bfe_init_vars(bfe);
usr/src/uts/common/io/bfe/bfe.c
2826
bfe_chip_reset(bfe);
usr/src/uts/common/io/bfe/bfe.c
2827
if (bfe_chip_start(bfe) == DDI_FAILURE) {
usr/src/uts/common/io/bfe/bfe.c
283
rw_enter(&bfe->bfe_rwlock, RW_WRITER);
usr/src/uts/common/io/bfe/bfe.c
2832
bfe_release_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
2835
mac_tx_update(bfe->bfe_machdl);
usr/src/uts/common/io/bfe/bfe.c
2844
bfe_t *bfe;
usr/src/uts/common/io/bfe/bfe.c
2862
bfe = kmem_zalloc(sizeof (bfe_t), KM_SLEEP);
usr/src/uts/common/io/bfe/bfe.c
2863
bfe->bfe_dip = dip;
usr/src/uts/common/io/bfe/bfe.c
2864
bfe->bfe_unit = unit;
usr/src/uts/common/io/bfe/bfe.c
2866
if (pci_config_setup(dip, &bfe->bfe_conf_handle) != DDI_SUCCESS) {
usr/src/uts/common/io/bfe/bfe.c
2874
ret = pci_config_get16(bfe->bfe_conf_handle, PCI_CONF_COMM);
usr/src/uts/common/io/bfe/bfe.c
2875
pci_config_put16(bfe->bfe_conf_handle, PCI_CONF_COMM,
usr/src/uts/common/io/bfe/bfe.c
2878
ddi_set_driver_private(dip, bfe);
usr/src/uts/common/io/bfe/bfe.c
2881
if (bfe_identify_hardware(bfe) == BFE_FAILURE) {
usr/src/uts/common/io/bfe/bfe.c
2886
if (bfe_regs_map(bfe) != DDI_SUCCESS) {
usr/src/uts/common/io/bfe/bfe.c
2891
(void) bfe_get_chip_config(bfe);
usr/src/uts/common/io/bfe/bfe.c
2902
macreg->m_driver = bfe;
usr/src/uts/common/io/bfe/bfe.c
2905
macreg->m_src_addr = bfe->bfe_ether_addr;
usr/src/uts/common/io/bfe/bfe.c
2911
if ((ret = mac_register(macreg, &bfe->bfe_machdl)) != 0) {
usr/src/uts/common/io/bfe/bfe.c
2919
rw_init(&bfe->bfe_rwlock, NULL, RW_DRIVER,
usr/src/uts/common/io/bfe/bfe.c
2920
DDI_INTR_PRI(bfe->bfe_intrpri));
usr/src/uts/common/io/bfe/bfe.c
2922
if (bfe_add_intr(bfe) != DDI_SUCCESS) {
usr/src/uts/common/io/bfe/bfe.c
2927
if (bfe_rings_alloc(bfe) != DDI_SUCCESS) {
usr/src/uts/common/io/bfe/bfe.c
2933
bfe->bfe_chip_action = 0;
usr/src/uts/common/io/bfe/bfe.c
2934
bfe_init_vars(bfe);
usr/src/uts/common/io/bfe/bfe.c
2937
bfe_chip_reset(bfe);
usr/src/uts/common/io/bfe/bfe.c
2943
if (ddi_intr_enable(bfe->bfe_intrhdl) != DDI_SUCCESS) {
usr/src/uts/common/io/bfe/bfe.c
295
bfe_release_locks(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
2951
bfe_remove_intr(bfe);
usr/src/uts/common/io/bfe/bfe.c
2953
(void) mac_unregister(bfe->bfe_machdl);
usr/src/uts/common/io/bfe/bfe.c
2955
bfe_unmap_regs(bfe);
usr/src/uts/common/io/bfe/bfe.c
2957
pci_config_teardown(&bfe->bfe_conf_handle);
usr/src/uts/common/io/bfe/bfe.c
2959
kmem_free(bfe, sizeof (bfe_t));
usr/src/uts/common/io/bfe/bfe.c
2966
bfe_t *bfe;
usr/src/uts/common/io/bfe/bfe.c
2968
bfe = ddi_get_driver_private(devinfo);
usr/src/uts/common/io/bfe/bfe.c
297
bfe_ring_t *tx = &bfe->bfe_tx_ring;
usr/src/uts/common/io/bfe/bfe.c
2976
bfe_stop_timer(bfe);
usr/src/uts/common/io/bfe/bfe.c
2982
if (mac_unregister(bfe->bfe_machdl) != DDI_SUCCESS)
usr/src/uts/common/io/bfe/bfe.c
2985
bfe->bfe_machdl = NULL;
usr/src/uts/common/io/bfe/bfe.c
2990
bfe_grab_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
2991
bfe_chip_halt(bfe);
usr/src/uts/common/io/bfe/bfe.c
2992
bfe_stop_phy(bfe);
usr/src/uts/common/io/bfe/bfe.c
2993
bfe_release_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
2995
(void) ddi_intr_disable(bfe->bfe_intrhdl);
usr/src/uts/common/io/bfe/bfe.c
2998
bfe_stop_timer(bfe);
usr/src/uts/common/io/bfe/bfe.c
3003
if (bfe->bfe_tx_ring.r_flags == BFE_RING_ALLOCATED) {
usr/src/uts/common/io/bfe/bfe.c
3005
bfe_buffer_free(&bfe->bfe_tx_ring);
usr/src/uts/common/io/bfe/bfe.c
3006
bfe_ring_desc_free(&bfe->bfe_tx_ring);
usr/src/uts/common/io/bfe/bfe.c
3009
if (bfe->bfe_rx_ring.r_flags == BFE_RING_ALLOCATED) {
usr/src/uts/common/io/bfe/bfe.c
3011
bfe_buffer_free(&bfe->bfe_rx_ring);
usr/src/uts/common/io/bfe/bfe.c
3012
bfe_ring_desc_free(&bfe->bfe_rx_ring);
usr/src/uts/common/io/bfe/bfe.c
3015
bfe_remove_intr(bfe);
usr/src/uts/common/io/bfe/bfe.c
3016
bfe_unmap_regs(bfe);
usr/src/uts/common/io/bfe/bfe.c
3017
pci_config_teardown(&bfe->bfe_conf_handle);
usr/src/uts/common/io/bfe/bfe.c
3019
mutex_destroy(&bfe->bfe_tx_ring.r_lock);
usr/src/uts/common/io/bfe/bfe.c
3020
mutex_destroy(&bfe->bfe_rx_ring.r_lock);
usr/src/uts/common/io/bfe/bfe.c
3021
rw_destroy(&bfe->bfe_rwlock);
usr/src/uts/common/io/bfe/bfe.c
3023
kmem_free(bfe, sizeof (bfe_t));
usr/src/uts/common/io/bfe/bfe.c
303
rw_exit(&bfe->bfe_rwlock);
usr/src/uts/common/io/bfe/bfe.c
3033
bfe_stop_timer(bfe);
usr/src/uts/common/io/bfe/bfe.c
3038
bfe_grab_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
3039
bfe_chip_halt(bfe);
usr/src/uts/common/io/bfe/bfe.c
3040
bfe_stop_phy(bfe);
usr/src/uts/common/io/bfe/bfe.c
3041
bfe->bfe_chip_state = BFE_CHIP_SUSPENDED;
usr/src/uts/common/io/bfe/bfe.c
3042
bfe_release_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
3057
bfe_t *bfe;
usr/src/uts/common/io/bfe/bfe.c
3059
bfe = ddi_get_driver_private(dev_info);
usr/src/uts/common/io/bfe/bfe.c
3061
bfe_chip_halt(bfe);
usr/src/uts/common/io/bfe/bfe.c
3062
bfe_stop_phy(bfe);
usr/src/uts/common/io/bfe/bfe.c
3063
bfe->bfe_chip_state = BFE_CHIP_QUIESCED;
usr/src/uts/common/io/bfe/bfe.c
311
bfe_wait_bit(bfe_t *bfe, uint32_t reg, uint32_t bit,
usr/src/uts/common/io/bfe/bfe.c
318
v = INL(bfe, reg);
usr/src/uts/common/io/bfe/bfe.c
340
bfe_read_phy(bfe_t *bfe, uint32_t reg)
usr/src/uts/common/io/bfe/bfe.c
342
OUTL(bfe, BFE_EMAC_ISTAT, BFE_EMAC_INT_MII);
usr/src/uts/common/io/bfe/bfe.c
343
OUTL(bfe, BFE_MDIO_DATA, (BFE_MDIO_SB_START |
usr/src/uts/common/io/bfe/bfe.c
345
(bfe->bfe_phy_addr << BFE_MDIO_PMD_SHIFT) |
usr/src/uts/common/io/bfe/bfe.c
349
(void) bfe_wait_bit(bfe, BFE_EMAC_ISTAT, BFE_EMAC_INT_MII, 10, 0);
usr/src/uts/common/io/bfe/bfe.c
351
return ((INL(bfe, BFE_MDIO_DATA) & BFE_MDIO_DATA_DATA));
usr/src/uts/common/io/bfe/bfe.c
355
bfe_write_phy(bfe_t *bfe, uint32_t reg, uint32_t val)
usr/src/uts/common/io/bfe/bfe.c
357
OUTL(bfe, BFE_EMAC_ISTAT, BFE_EMAC_INT_MII);
usr/src/uts/common/io/bfe/bfe.c
358
OUTL(bfe, BFE_MDIO_DATA, (BFE_MDIO_SB_START |
usr/src/uts/common/io/bfe/bfe.c
360
(bfe->bfe_phy_addr << BFE_MDIO_PMD_SHIFT) |
usr/src/uts/common/io/bfe/bfe.c
365
(void) bfe_wait_bit(bfe, BFE_EMAC_ISTAT, BFE_EMAC_INT_MII, 10, 0);
usr/src/uts/common/io/bfe/bfe.c
372
bfe_reset_phy(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
376
bfe_write_phy(bfe, MII_CONTROL, MII_CONTROL_RESET);
usr/src/uts/common/io/bfe/bfe.c
379
if (bfe_read_phy(bfe, MII_CONTROL) &
usr/src/uts/common/io/bfe/bfe.c
389
bfe_error(bfe->bfe_dip, "Timeout waiting for PHY to reset");
usr/src/uts/common/io/bfe/bfe.c
390
bfe->bfe_phy_state = BFE_PHY_RESET_TIMEOUT;
usr/src/uts/common/io/bfe/bfe.c
394
bfe->bfe_phy_state = BFE_PHY_RESET_DONE;
usr/src/uts/common/io/bfe/bfe.c
404
bfe_stop_timer(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
406
if (bfe->bfe_periodic_id) {
usr/src/uts/common/io/bfe/bfe.c
407
ddi_periodic_delete(bfe->bfe_periodic_id);
usr/src/uts/common/io/bfe/bfe.c
408
bfe->bfe_periodic_id = NULL;
usr/src/uts/common/io/bfe/bfe.c
416
bfe_stop_phy(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
418
bfe_write_phy(bfe, MII_CONTROL, MII_CONTROL_PWRDN |
usr/src/uts/common/io/bfe/bfe.c
421
bfe->bfe_chip.link = LINK_STATE_UNKNOWN;
usr/src/uts/common/io/bfe/bfe.c
422
bfe->bfe_chip.speed = 0;
usr/src/uts/common/io/bfe/bfe.c
423
bfe->bfe_chip.duplex = LINK_DUPLEX_UNKNOWN;
usr/src/uts/common/io/bfe/bfe.c
425
bfe->bfe_phy_state = BFE_PHY_STOPPED;
usr/src/uts/common/io/bfe/bfe.c
430
if (bfe->bfe_machdl != NULL)
usr/src/uts/common/io/bfe/bfe.c
431
(void) bfe_report_link(bfe);
usr/src/uts/common/io/bfe/bfe.c
435
bfe_probe_phy(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
440
if (bfe->bfe_phy_addr) {
usr/src/uts/common/io/bfe/bfe.c
441
status = bfe_read_phy(bfe, MII_STATUS);
usr/src/uts/common/io/bfe/bfe.c
443
bfe_write_phy(bfe, MII_CONTROL, 0);
usr/src/uts/common/io/bfe/bfe.c
449
bfe->bfe_phy_addr = phy;
usr/src/uts/common/io/bfe/bfe.c
450
status = bfe_read_phy(bfe, MII_STATUS);
usr/src/uts/common/io/bfe/bfe.c
452
bfe_write_phy(bfe, MII_CONTROL, 0);
usr/src/uts/common/io/bfe/bfe.c
467
bfe_t *bfe = (bfe_t *)arg;
usr/src/uts/common/io/bfe/bfe.c
474
if (bfe->bfe_chip_action & BFE_ACTION_RESTART) {
usr/src/uts/common/io/bfe/bfe.c
478
bfe_grab_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
479
bfe_chip_restart(bfe);
usr/src/uts/common/io/bfe/bfe.c
480
bfe->bfe_chip_action &= ~BFE_ACTION_RESTART;
usr/src/uts/common/io/bfe/bfe.c
481
bfe->bfe_chip_action &= ~BFE_ACTION_RESTART_FAULT;
usr/src/uts/common/io/bfe/bfe.c
482
bfe->bfe_chip_action &= ~BFE_ACTION_RESTART_PKT;
usr/src/uts/common/io/bfe/bfe.c
483
bfe_release_locks(bfe);
usr/src/uts/common/io/bfe/bfe.c
484
mac_tx_update(bfe->bfe_machdl);
usr/src/uts/common/io/bfe/bfe.c
489
rw_enter(&bfe->bfe_rwlock, RW_READER);
usr/src/uts/common/io/bfe/bfe.c
491
if (bfe->bfe_chip_state == BFE_CHIP_ACTIVE) {
usr/src/uts/common/io/bfe/bfe.c
495
if (bfe->bfe_tx_stall_time != 0 &&
usr/src/uts/common/io/bfe/bfe.c
496
hr > bfe->bfe_tx_stall_time) {
usr/src/uts/common/io/bfe/bfe.c
497
DTRACE_PROBE2(chip__restart, int, bfe->bfe_unit,
usr/src/uts/common/io/bfe/bfe.c
499
bfe->bfe_chip_action |=
usr/src/uts/common/io/bfe/bfe.c
501
bfe->bfe_tx_stall_time = 0;
usr/src/uts/common/io/bfe/bfe.c
505
if (bfe->bfe_phy_state == BFE_PHY_STARTED) {
usr/src/uts/common/io/bfe/bfe.c
509
if (bfe_check_link(bfe)) {
usr/src/uts/common/io/bfe/bfe.c
510
bfe_report_link(bfe);
usr/src/uts/common/io/bfe/bfe.c
511
if (bfe->bfe_chip.link == LINK_STATE_UP) {
usr/src/uts/common/io/bfe/bfe.c
514
val = INL(bfe, BFE_TX_CTRL);
usr/src/uts/common/io/bfe/bfe.c
516
if (bfe->bfe_chip.duplex == LINK_DUPLEX_FULL) {
usr/src/uts/common/io/bfe/bfe.c
518
flow = INL(bfe, BFE_RXCONF);
usr/src/uts/common/io/bfe/bfe.c
520
OUTL(bfe, BFE_RXCONF, flow);
usr/src/uts/common/io/bfe/bfe.c
522
flow = INL(bfe, BFE_MAC_FLOW);
usr/src/uts/common/io/bfe/bfe.c
524
OUTL(bfe, BFE_MAC_FLOW, flow);
usr/src/uts/common/io/bfe/bfe.c
529
OUTL(bfe, BFE_TX_CTRL, val);
usr/src/uts/common/io/bfe/bfe.c
531
int, bfe->bfe_unit);
usr/src/uts/common/io/bfe/bfe.c
536
rw_exit(&bfe->bfe_rwlock);
usr/src/uts/common/io/bfe/bfe.c
539
mac_tx_update(bfe->bfe_machdl);
usr/src/uts/common/io/bfe/bfe.c
546
bfe_startup_phy(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
552
if (bfe_probe_phy(bfe) == BFE_FAILURE) {
usr/src/uts/common/io/bfe/bfe.c
553
bfe->bfe_phy_state = BFE_PHY_NOTFOUND;
usr/src/uts/common/io/bfe/bfe.c
557
(void) bfe_reset_phy(bfe);
usr/src/uts/common/io/bfe/bfe.c
559
phyid1 = bfe_read_phy(bfe, MII_PHYIDH);
usr/src/uts/common/io/bfe/bfe.c
560
phyid2 = bfe_read_phy(bfe, MII_PHYIDL);
usr/src/uts/common/io/bfe/bfe.c
561
bfe->bfe_phy_id = (phyid1 << 16) | phyid2;
usr/src/uts/common/io/bfe/bfe.c
563
bmsr = bfe_read_phy(bfe, MII_STATUS);
usr/src/uts/common/io/bfe/bfe.c
564
anar = bfe_read_phy(bfe, MII_AN_ADVERT);
usr/src/uts/common/io/bfe/bfe.c
574
bfe->bfe_chip.bmsr = bmsr;
usr/src/uts/common/io/bfe/bfe.c
579
bfe->bfe_cap_aneg = bfe->bfe_cap_100T4 =
usr/src/uts/common/io/bfe/bfe.c
580
bfe->bfe_cap_100fdx = bfe->bfe_cap_100hdx =
usr/src/uts/common/io/bfe/bfe.c
581
bfe->bfe_cap_10fdx = bfe->bfe_cap_10hdx = 0;
usr/src/uts/common/io/bfe/bfe.c
587
if (!(bfe->bfe_chip_action & BFE_ACTION_RESTART_SETPROP)) {
usr/src/uts/common/io/bfe/bfe.c
598
bfe->bfe_cap_100fdx = 1;
usr/src/uts/common/io/bfe/bfe.c
601
bfe->bfe_adv_100fdx = 1;
usr/src/uts/common/io/bfe/bfe.c
603
} else if (bfe->bfe_adv_100fdx) {
usr/src/uts/common/io/bfe/bfe.c
610
bfe->bfe_cap_100T4 = 1;
usr/src/uts/common/io/bfe/bfe.c
613
bfe->bfe_adv_100T4 = 1;
usr/src/uts/common/io/bfe/bfe.c
615
} else if (bfe->bfe_adv_100T4) {
usr/src/uts/common/io/bfe/bfe.c
622
bfe->bfe_cap_100hdx = 1;
usr/src/uts/common/io/bfe/bfe.c
625
bfe->bfe_adv_100hdx = 1;
usr/src/uts/common/io/bfe/bfe.c
627
} else if (bfe->bfe_adv_100hdx) {
usr/src/uts/common/io/bfe/bfe.c
634
bfe->bfe_cap_10fdx = 1;
usr/src/uts/common/io/bfe/bfe.c
637
bfe->bfe_adv_10fdx = 1;
usr/src/uts/common/io/bfe/bfe.c
639
} else if (bfe->bfe_adv_10fdx) {
usr/src/uts/common/io/bfe/bfe.c
646
bfe->bfe_cap_10hdx = 1;
usr/src/uts/common/io/bfe/bfe.c
649
bfe->bfe_adv_10hdx = 1;
usr/src/uts/common/io/bfe/bfe.c
651
} else if (bfe->bfe_adv_10hdx) {
usr/src/uts/common/io/bfe/bfe.c
658
bfe->bfe_cap_aneg = 1;
usr/src/uts/common/io/bfe/bfe.c
660
bfe->bfe_adv_aneg = 1;
usr/src/uts/common/io/bfe/bfe.c
666
bfe_error(bfe->bfe_dip,
usr/src/uts/common/io/bfe/bfe.c
668
bfe_stop_phy(bfe);
usr/src/uts/common/io/bfe/bfe.c
669
bfe_report_link(bfe);
usr/src/uts/common/io/bfe/bfe.c
677
bfe->bfe_chip_action &= ~BFE_ACTION_RESTART_SETPROP;
usr/src/uts/common/io/bfe/bfe.c
681
if (bfe->bfe_adv_aneg && (bmsr & MII_STATUS_CANAUTONEG)) {
usr/src/uts/common/io/bfe/bfe.c
684
if (bfe->bfe_adv_100fdx)
usr/src/uts/common/io/bfe/bfe.c
686
else if (bfe->bfe_adv_100hdx)
usr/src/uts/common/io/bfe/bfe.c
688
else if (bfe->bfe_adv_10fdx)
usr/src/uts/common/io/bfe/bfe.c
695
bfe_write_phy(bfe, MII_AN_ADVERT, anar);
usr/src/uts/common/io/bfe/bfe.c
698
bfe_write_phy(bfe, MII_CONTROL, bmcr);
usr/src/uts/common/io/bfe/bfe.c
700
bfe->bfe_mii_anar = anar;
usr/src/uts/common/io/bfe/bfe.c
701
bfe->bfe_mii_bmcr = bmcr;
usr/src/uts/common/io/bfe/bfe.c
702
bfe->bfe_phy_state = BFE_PHY_STARTED;
usr/src/uts/common/io/bfe/bfe.c
704
if (bfe->bfe_periodic_id == NULL) {
usr/src/uts/common/io/bfe/bfe.c
705
bfe->bfe_periodic_id = ddi_periodic_add(bfe_timeout,
usr/src/uts/common/io/bfe/bfe.c
706
(void *)bfe, BFE_TIMEOUT_INTERVAL, DDI_IPL_0);
usr/src/uts/common/io/bfe/bfe.c
708
DTRACE_PROBE1(first__timeout, int, bfe->bfe_unit);
usr/src/uts/common/io/bfe/bfe.c
711
DTRACE_PROBE4(phy_started, int, bfe->bfe_unit,
usr/src/uts/common/io/bfe/bfe.c
721
bfe_report_link(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
723
mac_link_update(bfe->bfe_machdl, bfe->bfe_chip.link);
usr/src/uts/common/io/bfe/bfe.c
730
bfe_check_link(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
735
speed = bfe->bfe_chip.speed;
usr/src/uts/common/io/bfe/bfe.c
736
duplex = bfe->bfe_chip.duplex;
usr/src/uts/common/io/bfe/bfe.c
737
link = bfe->bfe_chip.link;
usr/src/uts/common/io/bfe/bfe.c
739
bmsr = bfe_read_phy(bfe, MII_STATUS);
usr/src/uts/common/io/bfe/bfe.c
740
bfe->bfe_mii_bmsr = bmsr;
usr/src/uts/common/io/bfe/bfe.c
742
bmcr = bfe_read_phy(bfe, MII_CONTROL);
usr/src/uts/common/io/bfe/bfe.c
744
anar = bfe_read_phy(bfe, MII_AN_ADVERT);
usr/src/uts/common/io/bfe/bfe.c
745
bfe->bfe_mii_anar = anar;
usr/src/uts/common/io/bfe/bfe.c
747
anlpar = bfe_read_phy(bfe, MII_AN_LPABLE);
usr/src/uts/common/io/bfe/bfe.c
748
bfe->bfe_mii_anlpar = anlpar;
usr/src/uts/common/io/bfe/bfe.c
750
bfe->bfe_mii_exp = bfe_read_phy(bfe, MII_AN_EXPANSION);
usr/src/uts/common/io/bfe/bfe.c
755
if (bfe->bfe_mii_exp == 0xffff) {
usr/src/uts/common/io/bfe/bfe.c
756
bfe->bfe_mii_exp = 0;
usr/src/uts/common/io/bfe/bfe.c
760
bfe->bfe_chip.link = LINK_STATE_DOWN;
usr/src/uts/common/io/bfe/bfe.c
761
bfe->bfe_chip.speed = 0;
usr/src/uts/common/io/bfe/bfe.c
762
bfe->bfe_chip.duplex = LINK_DUPLEX_UNKNOWN;
usr/src/uts/common/io/bfe/bfe.c
766
bfe->bfe_chip.link = LINK_STATE_UP;
usr/src/uts/common/io/bfe/bfe.c
771
bfe->bfe_chip.speed = 100000000;
usr/src/uts/common/io/bfe/bfe.c
773
bfe->bfe_chip.speed = 10000000;
usr/src/uts/common/io/bfe/bfe.c
776
bfe->bfe_chip.duplex = LINK_DUPLEX_FULL;
usr/src/uts/common/io/bfe/bfe.c
778
bfe->bfe_chip.duplex = LINK_DUPLEX_HALF;
usr/src/uts/common/io/bfe/bfe.c
782
bfe->bfe_chip.speed = 0;
usr/src/uts/common/io/bfe/bfe.c
783
bfe->bfe_chip.duplex = LINK_DUPLEX_UNKNOWN;
usr/src/uts/common/io/bfe/bfe.c
785
bfe->bfe_chip.speed = 100000000;
usr/src/uts/common/io/bfe/bfe.c
786
bfe->bfe_chip.duplex = LINK_DUPLEX_FULL;
usr/src/uts/common/io/bfe/bfe.c
788
bfe->bfe_chip.speed = 100000000;
usr/src/uts/common/io/bfe/bfe.c
789
bfe->bfe_chip.duplex = LINK_DUPLEX_HALF;
usr/src/uts/common/io/bfe/bfe.c
791
bfe->bfe_chip.speed = 100000000;
usr/src/uts/common/io/bfe/bfe.c
792
bfe->bfe_chip.duplex = LINK_DUPLEX_HALF;
usr/src/uts/common/io/bfe/bfe.c
794
bfe->bfe_chip.speed = 10000000;
usr/src/uts/common/io/bfe/bfe.c
795
bfe->bfe_chip.duplex = LINK_DUPLEX_FULL;
usr/src/uts/common/io/bfe/bfe.c
797
bfe->bfe_chip.speed = 10000000;
usr/src/uts/common/io/bfe/bfe.c
798
bfe->bfe_chip.duplex = LINK_DUPLEX_HALF;
usr/src/uts/common/io/bfe/bfe.c
800
bfe->bfe_chip.speed = 0;
usr/src/uts/common/io/bfe/bfe.c
801
bfe->bfe_chip.duplex = LINK_DUPLEX_UNKNOWN;
usr/src/uts/common/io/bfe/bfe.c
809
if (speed != bfe->bfe_chip.speed ||
usr/src/uts/common/io/bfe/bfe.c
810
duplex != bfe->bfe_chip.duplex ||
usr/src/uts/common/io/bfe/bfe.c
811
link != bfe->bfe_chip.link) {
usr/src/uts/common/io/bfe/bfe.c
819
bfe_cam_write(bfe_t *bfe, uchar_t *d, int index)
usr/src/uts/common/io/bfe/bfe.c
828
OUTL(bfe, BFE_CAM_DATA_LO, v);
usr/src/uts/common/io/bfe/bfe.c
833
OUTL(bfe, BFE_CAM_DATA_HI, v);
usr/src/uts/common/io/bfe/bfe.c
834
OUTL(bfe, BFE_CAM_CTRL, (BFE_CAM_WRITE |
usr/src/uts/common/io/bfe/bfe.c
836
(void) bfe_wait_bit(bfe, BFE_CAM_CTRL, BFE_CAM_BUSY, 10, 1);
usr/src/uts/common/io/bfe/bfe.c
843
bfe_chip_halt(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
848
OUTL(bfe, BFE_INTR_MASK, 0);
usr/src/uts/common/io/bfe/bfe.c
849
FLUSH(bfe, BFE_INTR_MASK);
usr/src/uts/common/io/bfe/bfe.c
851
OUTL(bfe, BFE_ENET_CTRL, BFE_ENET_DISABLE);
usr/src/uts/common/io/bfe/bfe.c
856
(void) bfe_wait_bit(bfe, BFE_ENET_CTRL, BFE_ENET_DISABLE, 20, 1);
usr/src/uts/common/io/bfe/bfe.c
861
OUTL(bfe, BFE_DMARX_CTRL, 0);
usr/src/uts/common/io/bfe/bfe.c
862
OUTL(bfe, BFE_DMATX_CTRL, 0);
usr/src/uts/common/io/bfe/bfe.c
866
bfe->bfe_chip_state = BFE_CHIP_HALT;
usr/src/uts/common/io/bfe/bfe.c
870
bfe_chip_restart(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
872
DTRACE_PROBE2(chip__restart, int, bfe->bfe_unit,
usr/src/uts/common/io/bfe/bfe.c
873
int, bfe->bfe_chip_action);
usr/src/uts/common/io/bfe/bfe.c
878
bfe_chip_halt(bfe);
usr/src/uts/common/io/bfe/bfe.c
879
bfe_stop_phy(bfe);
usr/src/uts/common/io/bfe/bfe.c
880
bfe->bfe_chip_state = BFE_CHIP_STOPPED;
usr/src/uts/common/io/bfe/bfe.c
885
bfe_init_vars(bfe);
usr/src/uts/common/io/bfe/bfe.c
890
bfe_chip_reset(bfe);
usr/src/uts/common/io/bfe/bfe.c
895
bfe_tx_desc_init(&bfe->bfe_tx_ring);
usr/src/uts/common/io/bfe/bfe.c
896
bfe_rx_desc_init(&bfe->bfe_rx_ring);
usr/src/uts/common/io/bfe/bfe.c
898
bfe->bfe_chip_state = BFE_CHIP_ACTIVE;
usr/src/uts/common/io/bfe/bfe.c
899
bfe_set_rx_mode(bfe);
usr/src/uts/common/io/bfe/bfe.c
900
bfe_enable_chip_intrs(bfe);
usr/src/uts/common/io/bfe/bfe.c
907
bfe_core_disable(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
909
if ((INL(bfe, BFE_SBTMSLOW) & BFE_RESET))
usr/src/uts/common/io/bfe/bfe.c
912
OUTL(bfe, BFE_SBTMSLOW, (BFE_REJECT | BFE_CLOCK));
usr/src/uts/common/io/bfe/bfe.c
913
(void) bfe_wait_bit(bfe, BFE_SBTMSLOW, BFE_REJECT, 100, 0);
usr/src/uts/common/io/bfe/bfe.c
914
(void) bfe_wait_bit(bfe, BFE_SBTMSHIGH, BFE_BUSY, 100, 1);
usr/src/uts/common/io/bfe/bfe.c
915
OUTL(bfe, BFE_SBTMSLOW, (BFE_FGC | BFE_CLOCK | BFE_REJECT | BFE_RESET));
usr/src/uts/common/io/bfe/bfe.c
916
FLUSH(bfe, BFE_SBTMSLOW);
usr/src/uts/common/io/bfe/bfe.c
918
OUTL(bfe, BFE_SBTMSLOW, (BFE_REJECT | BFE_RESET));
usr/src/uts/common/io/bfe/bfe.c
926
bfe_core_reset(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
933
bfe_core_disable(bfe);
usr/src/uts/common/io/bfe/bfe.c
935
OUTL(bfe, BFE_SBTMSLOW, (BFE_RESET | BFE_CLOCK | BFE_FGC));
usr/src/uts/common/io/bfe/bfe.c
936
FLUSH(bfe, BFE_SBTMSLOW);
usr/src/uts/common/io/bfe/bfe.c
939
if (INL(bfe, BFE_SBTMSHIGH) & BFE_SERR)
usr/src/uts/common/io/bfe/bfe.c
940
OUTL(bfe, BFE_SBTMSHIGH, 0);
usr/src/uts/common/io/bfe/bfe.c
942
val = INL(bfe, BFE_SBIMSTATE);
usr/src/uts/common/io/bfe/bfe.c
944
OUTL(bfe, BFE_SBIMSTATE, val & ~(BFE_IBE | BFE_TO));
usr/src/uts/common/io/bfe/bfe.c
946
OUTL(bfe, BFE_SBTMSLOW, (BFE_CLOCK | BFE_FGC));
usr/src/uts/common/io/bfe/bfe.c
947
FLUSH(bfe, BFE_SBTMSLOW);
usr/src/uts/common/io/bfe/bfe.c
950
OUTL(bfe, BFE_SBTMSLOW, BFE_CLOCK);
usr/src/uts/common/io/bfe/bfe.c
951
FLUSH(bfe, BFE_SBTMSLOW);
usr/src/uts/common/io/bfe/bfe.c
956
bfe_setup_config(bfe_t *bfe, uint32_t cores)
usr/src/uts/common/io/bfe/bfe.c
963
bar_orig = pci_config_get32(bfe->bfe_conf_handle, BFE_BAR0_WIN);
usr/src/uts/common/io/bfe/bfe.c
964
pci_config_put32(bfe->bfe_conf_handle, BFE_BAR0_WIN, BFE_REG_PCI);
usr/src/uts/common/io/bfe/bfe.c
967
val = INL(bfe, BFE_SBIDHIGH) & BFE_IDH_CORE;
usr/src/uts/common/io/bfe/bfe.c
969
val = INL(bfe, BFE_SBINTVEC);
usr/src/uts/common/io/bfe/bfe.c
971
OUTL(bfe, BFE_SBINTVEC, val);
usr/src/uts/common/io/bfe/bfe.c
973
val = INL(bfe, BFE_SSB_PCI_TRANS_2);
usr/src/uts/common/io/bfe/bfe.c
975
OUTL(bfe, BFE_SSB_PCI_TRANS_2, val);
usr/src/uts/common/io/bfe/bfe.c
980
pci_config_put32(bfe->bfe_conf_handle, BFE_BAR0_WIN, bar_orig);
usr/src/uts/common/io/bfe/bfe.c
987
bfe_chip_reset(bfe_t *bfe)
usr/src/uts/common/io/bfe/bfe.c
992
bfe_setup_config(bfe, BFE_INTVEC_ENET0);
usr/src/uts/common/io/bfe/bfe.c
995
val = INL(bfe, BFE_SBTMSLOW) &
usr/src/uts/common/io/bfe/bfe.c
999
OUTL(bfe, BFE_RCV_LAZY, 0);
usr/src/uts/common/io/bfe/bfe.h
251
struct bfe;
usr/src/uts/common/io/bfe/bfe.h
280
struct bfe *r_bfe;
usr/src/uts/common/io/bfe/bfe.h
60
#define OUTB(bfe, p, v) \
usr/src/uts/common/io/bfe/bfe.h
61
ddi_put8((bfe)->bfe_mem_regset.hdl, \
usr/src/uts/common/io/bfe/bfe.h
62
(void *)((caddr_t)((bfe)->bfe_mem_regset.addr) + (p)), v)
usr/src/uts/common/io/bfe/bfe.h
64
#define OUTW(bfe, p, v) \
usr/src/uts/common/io/bfe/bfe.h
65
ddi_put16((bfe)->bfe_mem_regset.hdl, \
usr/src/uts/common/io/bfe/bfe.h
66
(void *)((caddr_t)((bfe)->bfe_mem_regset.addr) + (p)), v)
usr/src/uts/common/io/bfe/bfe.h
68
#define OUTL(bfe, p, v) \
usr/src/uts/common/io/bfe/bfe.h
69
ddi_put32((bfe)->bfe_mem_regset.hdl, \
usr/src/uts/common/io/bfe/bfe.h
70
(void *)((caddr_t)((bfe)->bfe_mem_regset.addr) + (p)), v)
usr/src/uts/common/io/bfe/bfe.h
72
#define INB(bfe, p) \
usr/src/uts/common/io/bfe/bfe.h
73
ddi_get8((bfe)->bfe_mem_regset.hdl, \
usr/src/uts/common/io/bfe/bfe.h
74
(void *)(((caddr_t)(bfe)->bfe_mem_regset.addr) + (p)))
usr/src/uts/common/io/bfe/bfe.h
75
#define INW(bfe, p) \
usr/src/uts/common/io/bfe/bfe.h
76
ddi_get16((bfe)->bfe_mem_regset.hdl, \
usr/src/uts/common/io/bfe/bfe.h
77
(void *)(((caddr_t)(bfe)->bfe_mem_regset.addr) + (p)))
usr/src/uts/common/io/bfe/bfe.h
79
#define INL(bfe, p) \
usr/src/uts/common/io/bfe/bfe.h
80
ddi_get32((bfe)->bfe_mem_regset.hdl, \
usr/src/uts/common/io/bfe/bfe.h
81
(void *)(((caddr_t)(bfe)->bfe_mem_regset.addr) + (p)))
usr/src/uts/common/io/bfe/bfe.h
83
#define FLUSH(bfe, reg) \
usr/src/uts/common/io/bfe/bfe.h
84
(void) INL(bfe, reg)
usr/src/uts/common/io/bfe/bfe.h
86
#define OUTL_OR(bfe, reg, v) \
usr/src/uts/common/io/bfe/bfe.h
87
OUTL(bfe, reg, (INL(bfe, reg) | v))
usr/src/uts/common/io/bfe/bfe.h
89
#define OUTL_AND(bfe, reg, v) \
usr/src/uts/common/io/bfe/bfe.h
90
OUTL(bfe, reg, (INL(bfe, reg) & v))
usr/src/uts/sun4u/sunfire/io/ac_del.c
401
patt_t *bf, *bfe, patt;
usr/src/uts/sun4u/sunfire/io/ac_del.c
404
bfe = (patt_t *)((char *)fill_buf + DEL_PAGESIZE);
usr/src/uts/sun4u/sunfire/io/ac_del.c
406
while (bf < bfe)
usr/src/uts/sun4u/sunfire/io/ac_del.c
435
patt_t *bf, *bfe, patt;
usr/src/uts/sun4u/sunfire/io/ac_del.c
438
bfe = (patt_t *)((char *)fill_buf + DEL_PAGESIZE);
usr/src/uts/sun4u/sunfire/io/ac_del.c
440
while (bf < bfe)