Lines Matching +full:fiber +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 1999 - 2018 Intel Corporation. */
9 * e1000e_get_bus_info_pcie - Get PCIe bus information
18 struct pci_dev *pdev = hw->adapter->pdev; in e1000e_get_bus_info_pcie()
19 struct e1000_mac_info *mac = &hw->mac; in e1000e_get_bus_info_pcie()
20 struct e1000_bus_info *bus = &hw->bus; in e1000e_get_bus_info_pcie()
24 bus->width = e1000_bus_width_unknown; in e1000e_get_bus_info_pcie()
27 bus->width = (enum e1000_bus_width)FIELD_GET(PCI_EXP_LNKSTA_NLW, in e1000e_get_bus_info_pcie()
31 mac->ops.set_lan_id(hw); in e1000e_get_bus_info_pcie()
37 * e1000_set_lan_id_multi_port_pcie - Set LAN id for PCIe multiple port devices
41 * Determines the LAN function id by reading memory-mapped registers
46 struct e1000_bus_info *bus = &hw->bus; in e1000_set_lan_id_multi_port_pcie()
53 bus->func = FIELD_GET(E1000_STATUS_FUNC_MASK, reg); in e1000_set_lan_id_multi_port_pcie()
57 * e1000_set_lan_id_single_port - Set LAN id for a single port device
64 struct e1000_bus_info *bus = &hw->bus; in e1000_set_lan_id_single_port()
66 bus->func = 0; in e1000_set_lan_id_single_port()
70 * e1000_clear_vfta_generic - Clear VLAN filter table
87 * e1000_write_vfta_generic - Write value to VLAN filter table
102 * e1000e_init_rx_addrs - Initialize receive address's
118 hw->mac.ops.rar_set(hw, hw->mac.addr, 0); in e1000e_init_rx_addrs()
120 /* Zero out the other (rar_entry_count - 1) receive addresses */ in e1000e_init_rx_addrs()
121 e_dbg("Clearing RAR[1-%u]\n", rar_count - 1); in e1000e_init_rx_addrs()
123 hw->mac.ops.rar_set(hw, mac_addr, i); in e1000e_init_rx_addrs()
127 * e1000_check_alt_mac_addr_generic - Check for alternate MAC addr
131 * can be setup by pre-boot software and must be treated like a permanent
150 if (hw->mac.type == e1000_82573) in e1000_check_alt_mac_addr_generic()
165 if (hw->bus.func == E1000_FUNC_1) in e1000_check_alt_mac_addr_generic()
189 hw->mac.ops.rar_set(hw, alt_mac_addr, 0); in e1000_check_alt_mac_addr_generic()
196 return hw->mac.rar_entry_count; in e1000e_rar_get_count_generic()
200 * e1000e_rar_set_generic - Set receive address register
224 /* Some bridges will combine consecutive 32-bit writes into in e1000e_rar_set_generic()
237 * e1000_hash_mc_addr - Generate a multicast hash value
250 hash_mask = (hw->mac.mta_reg_count * 32) - 1; in e1000_hash_mc_addr()
252 /* For a mc_filter_type of 0, bit_shift is the number of left-shifts in e1000_hash_mc_addr()
262 * left-shifts where the MSB of mc_addr[5] would still fall within in e1000_hash_mc_addr()
265 * remaining number of bits. Thus 8 - bit_shift. The rest of the in e1000_hash_mc_addr()
268 * 8-bit shifting total. in e1000_hash_mc_addr()
271 * mta register count of 128 (thus a 4096-bit vector and 0xFFF mask), in e1000_hash_mc_addr()
283 switch (hw->mac.mc_filter_type) { in e1000_hash_mc_addr()
298 hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) | in e1000_hash_mc_addr()
305 * e1000e_update_mc_addr_list_generic - Update Multicast addresses
320 memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow)); in e1000e_update_mc_addr_list_generic()
326 hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1); in e1000e_update_mc_addr_list_generic()
329 hw->mac.mta_shadow[hash_reg] |= BIT(hash_bit); in e1000e_update_mc_addr_list_generic()
334 for (i = hw->mac.mta_reg_count - 1; i >= 0; i--) in e1000e_update_mc_addr_list_generic()
335 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, hw->mac.mta_shadow[i]); in e1000e_update_mc_addr_list_generic()
340 * e1000e_clear_hw_cntrs_base - Clear base hardware counters
387 * e1000e_check_for_copper_link - Check for link (Copper)
396 struct e1000_mac_info *mac = &hw->mac; in e1000e_check_for_copper_link()
400 /* We only want to go out to the PHY registers to see if Auto-Neg in e1000e_check_for_copper_link()
405 if (!mac->get_link_status) in e1000e_check_for_copper_link()
407 mac->get_link_status = false; in e1000e_check_for_copper_link()
418 * immediately after link-up in e1000e_check_for_copper_link()
425 if (!mac->autoneg) in e1000e_check_for_copper_link()
426 return -E1000_ERR_CONFIG; in e1000e_check_for_copper_link()
428 /* Auto-Neg is enabled. Auto Speed Detection takes care in e1000e_check_for_copper_link()
432 mac->ops.config_collision_dist(hw); in e1000e_check_for_copper_link()
434 /* Configure Flow Control now that Auto-Neg has completed. in e1000e_check_for_copper_link()
436 * settings because we may have had to re-autoneg with a in e1000e_check_for_copper_link()
446 mac->get_link_status = true; in e1000e_check_for_copper_link()
451 * e1000e_check_for_fiber_link - Check for link (Fiber)
459 struct e1000_mac_info *mac = &hw->mac; in e1000e_check_for_fiber_link()
469 /* If we don't have link (auto-negotiation failed or link partner in e1000e_check_for_fiber_link()
470 * cannot auto-negotiate), the cable is plugged in (we have signal), in e1000e_check_for_fiber_link()
471 * and our link partner is not trying to auto-negotiate with us (we in e1000e_check_for_fiber_link()
473 * need to give auto-negotiation time to complete, in case the cable in e1000e_check_for_fiber_link()
479 if (!mac->autoneg_failed) { in e1000e_check_for_fiber_link()
480 mac->autoneg_failed = true; in e1000e_check_for_fiber_link()
485 /* Disable auto-negotiation in the TXCW register */ in e1000e_check_for_fiber_link()
486 ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE)); in e1000e_check_for_fiber_link()
488 /* Force link-up and also force full-duplex. */ in e1000e_check_for_fiber_link()
501 * sets, re-enable auto-negotiation in the TXCW register in e1000e_check_for_fiber_link()
503 * in an attempt to auto-negotiate with our link partner. in e1000e_check_for_fiber_link()
506 ew32(TXCW, mac->txcw); in e1000e_check_for_fiber_link()
509 mac->serdes_has_link = true; in e1000e_check_for_fiber_link()
516 * e1000e_check_for_serdes_link - Check for link (Serdes)
524 struct e1000_mac_info *mac = &hw->mac; in e1000e_check_for_serdes_link()
534 /* If we don't have link (auto-negotiation failed or link partner in e1000e_check_for_serdes_link()
535 * cannot auto-negotiate), and our link partner is not trying to in e1000e_check_for_serdes_link()
536 * auto-negotiate with us (we are receiving idles or data), in e1000e_check_for_serdes_link()
537 * we need to force link up. We also need to give auto-negotiation in e1000e_check_for_serdes_link()
542 if (!mac->autoneg_failed) { in e1000e_check_for_serdes_link()
543 mac->autoneg_failed = true; in e1000e_check_for_serdes_link()
548 /* Disable auto-negotiation in the TXCW register */ in e1000e_check_for_serdes_link()
549 ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE)); in e1000e_check_for_serdes_link()
551 /* Force link-up and also force full-duplex. */ in e1000e_check_for_serdes_link()
564 * sets, re-enable auto-negotiation in the TXCW register in e1000e_check_for_serdes_link()
566 * in an attempt to auto-negotiate with our link partner. in e1000e_check_for_serdes_link()
569 ew32(TXCW, mac->txcw); in e1000e_check_for_serdes_link()
572 mac->serdes_has_link = true; in e1000e_check_for_serdes_link()
574 /* If we force link for non-auto-negotiation switch, check in e1000e_check_for_serdes_link()
583 mac->serdes_has_link = true; in e1000e_check_for_serdes_link()
584 e_dbg("SERDES: Link up - forced.\n"); in e1000e_check_for_serdes_link()
587 mac->serdes_has_link = false; in e1000e_check_for_serdes_link()
588 e_dbg("SERDES: Link down - force failed.\n"); in e1000e_check_for_serdes_link()
600 mac->serdes_has_link = true; in e1000e_check_for_serdes_link()
601 e_dbg("SERDES: Link up - autoneg completed successfully.\n"); in e1000e_check_for_serdes_link()
603 mac->serdes_has_link = false; in e1000e_check_for_serdes_link()
604 e_dbg("SERDES: Link down - invalid codewords detected in autoneg.\n"); in e1000e_check_for_serdes_link()
607 mac->serdes_has_link = false; in e1000e_check_for_serdes_link()
608 e_dbg("SERDES: Link down - no sync.\n"); in e1000e_check_for_serdes_link()
611 mac->serdes_has_link = false; in e1000e_check_for_serdes_link()
612 e_dbg("SERDES: Link down - autoneg failed\n"); in e1000e_check_for_serdes_link()
620 * e1000_set_default_fc_generic - Set flow control default values
632 * that determine the hardware's default PAUSE (flow control) mode, in e1000_set_default_fc_generic()
634 * disabling auto-negotiation, and the direction of the in e1000_set_default_fc_generic()
635 * SW defined pins. If there is no SW over-ride of the flow in e1000_set_default_fc_generic()
636 * control setting, then the variable hw->fc will in e1000_set_default_fc_generic()
647 hw->fc.requested_mode = e1000_fc_none; in e1000_set_default_fc_generic()
649 hw->fc.requested_mode = e1000_fc_tx_pause; in e1000_set_default_fc_generic()
651 hw->fc.requested_mode = e1000_fc_full; in e1000_set_default_fc_generic()
657 * e1000e_setup_link_generic - Setup flow control and link settings
661 * control. Calls the appropriate media-specific link configuration
673 if (hw->phy.ops.check_reset_block && hw->phy.ops.check_reset_block(hw)) in e1000e_setup_link_generic()
679 if (hw->fc.requested_mode == e1000_fc_default) { in e1000e_setup_link_generic()
685 /* Save off the requested flow control mode for use later. Depending in e1000e_setup_link_generic()
686 * on the link partner's capabilities, we may or may not use this mode. in e1000e_setup_link_generic()
688 hw->fc.current_mode = hw->fc.requested_mode; in e1000e_setup_link_generic()
690 e_dbg("After fix-ups FlowControl is now = %x\n", hw->fc.current_mode); in e1000e_setup_link_generic()
693 ret_val = hw->mac.ops.setup_physical_interface(hw); in e1000e_setup_link_generic()
707 ew32(FCTTV, hw->fc.pause_time); in e1000e_setup_link_generic()
713 * e1000_commit_fc_settings_generic - Configure flow control
721 struct e1000_mac_info *mac = &hw->mac; in e1000_commit_fc_settings_generic()
725 * setup the device accordingly. If auto-negotiation is enabled, then in e1000_commit_fc_settings_generic()
727 * the Transmit Config Word Register (TXCW) and re-start auto- in e1000_commit_fc_settings_generic()
728 * negotiation. However, if auto-negotiation is disabled, then in e1000_commit_fc_settings_generic()
740 switch (hw->fc.current_mode) { in e1000_commit_fc_settings_generic()
742 /* Flow control completely disabled by a software over-ride. */ in e1000_commit_fc_settings_generic()
747 * by a software over-ride. Since there really isn't a way to in e1000_commit_fc_settings_generic()
757 * by a software over-ride. in e1000_commit_fc_settings_generic()
763 * over-ride. in e1000_commit_fc_settings_generic()
769 return -E1000_ERR_CONFIG; in e1000_commit_fc_settings_generic()
773 mac->txcw = txcw; in e1000_commit_fc_settings_generic()
779 * e1000_poll_fiber_serdes_link_generic - Poll for link up
783 * up with auto-negotiation, then the link is forced if a signal is detected.
787 struct e1000_mac_info *mac = &hw->mac; in e1000_poll_fiber_serdes_link_generic()
792 * serdes media) then poll for a "Link-Up" indication in the Device in e1000_poll_fiber_serdes_link_generic()
793 * Status Register. Time-out if a link isn't seen in 500 milliseconds in e1000_poll_fiber_serdes_link_generic()
794 * seconds (Auto-negotiation should complete in less than 500 in e1000_poll_fiber_serdes_link_generic()
804 e_dbg("Never got a valid link from auto-neg!!!\n"); in e1000_poll_fiber_serdes_link_generic()
805 mac->autoneg_failed = true; in e1000_poll_fiber_serdes_link_generic()
807 * mac->check_for_link. This routine will force the in e1000_poll_fiber_serdes_link_generic()
809 * communicate with non-autonegotiating link partners. in e1000_poll_fiber_serdes_link_generic()
811 ret_val = mac->ops.check_for_link(hw); in e1000_poll_fiber_serdes_link_generic()
816 mac->autoneg_failed = false; in e1000_poll_fiber_serdes_link_generic()
818 mac->autoneg_failed = false; in e1000_poll_fiber_serdes_link_generic()
826 * e1000e_setup_fiber_serdes_link - Setup link for fiber/serdes
829 * Configures collision distance and flow control for fiber and serdes
842 hw->mac.ops.config_collision_dist(hw); in e1000e_setup_fiber_serdes_link()
848 /* Since auto-negotiation is enabled, take the link out of reset (the in e1000e_setup_fiber_serdes_link()
850 * will restart auto-negotiation. If auto-negotiation is successful in e1000e_setup_fiber_serdes_link()
851 * then the link-up status bit will be set and the flow control enable in e1000e_setup_fiber_serdes_link()
854 e_dbg("Auto-negotiation enabled\n"); in e1000e_setup_fiber_serdes_link()
861 * detect a signal. If we have a signal, then poll for a "Link-Up" in e1000e_setup_fiber_serdes_link()
864 if (hw->phy.media_type == e1000_media_type_internal_serdes || in e1000e_setup_fiber_serdes_link()
875 * e1000e_config_collision_dist_generic - Configure collision distance
895 * e1000e_set_fc_watermarks - Set flow control high/low watermarks
912 if (hw->fc.current_mode & e1000_fc_tx_pause) { in e1000e_set_fc_watermarks()
917 fcrtl = hw->fc.low_water; in e1000e_set_fc_watermarks()
918 if (hw->fc.send_xon) in e1000e_set_fc_watermarks()
921 fcrth = hw->fc.high_water; in e1000e_set_fc_watermarks()
930 * e1000e_force_mac_fc - Force the MAC's flow control settings
937 * also configure these bits when link is forced on a fiber connection.
945 /* Because we didn't get link via the internal auto-negotiation in e1000e_force_mac_fc()
947 * auto-neg), we have to manually enable/disable transmit an in e1000e_force_mac_fc()
951 * according to the "hw->fc.current_mode" parameter. in e1000e_force_mac_fc()
962 e_dbg("hw->fc.current_mode = %u\n", hw->fc.current_mode); in e1000e_force_mac_fc()
964 switch (hw->fc.current_mode) { in e1000e_force_mac_fc()
981 return -E1000_ERR_CONFIG; in e1000e_force_mac_fc()
990 * e1000e_config_fc_after_link_up - Configures flow control after link
993 * Checks the status of auto-negotiation after link up to ensure that the
995 * flow control needs to be forced also. If auto-negotiation is enabled
1001 struct e1000_mac_info *mac = &hw->mac; in e1000e_config_fc_after_link_up()
1007 /* Check for the case where we have fiber media and auto-neg failed in e1000e_config_fc_after_link_up()
1011 if (mac->autoneg_failed) { in e1000e_config_fc_after_link_up()
1012 if (hw->phy.media_type == e1000_media_type_fiber || in e1000e_config_fc_after_link_up()
1013 hw->phy.media_type == e1000_media_type_internal_serdes) in e1000e_config_fc_after_link_up()
1016 if (hw->phy.media_type == e1000_media_type_copper) in e1000e_config_fc_after_link_up()
1025 /* Check for the case where we have copper media and auto-neg is in e1000e_config_fc_after_link_up()
1026 * enabled. In this case, we need to check and see if Auto-Neg in e1000e_config_fc_after_link_up()
1030 if ((hw->phy.media_type == e1000_media_type_copper) && mac->autoneg) { in e1000e_config_fc_after_link_up()
1071 *-------|---------|-------|---------|-------------------- in e1000e_config_fc_after_link_up()
1089 *-------|---------|-------|---------|-------------------- in e1000e_config_fc_after_link_up()
1101 if (hw->fc.requested_mode == e1000_fc_full) { in e1000e_config_fc_after_link_up()
1102 hw->fc.current_mode = e1000_fc_full; in e1000e_config_fc_after_link_up()
1105 hw->fc.current_mode = e1000_fc_rx_pause; in e1000e_config_fc_after_link_up()
1113 *-------|---------|-------|---------|-------------------- in e1000e_config_fc_after_link_up()
1120 hw->fc.current_mode = e1000_fc_tx_pause; in e1000e_config_fc_after_link_up()
1127 *-------|---------|-------|---------|-------------------- in e1000e_config_fc_after_link_up()
1134 hw->fc.current_mode = e1000_fc_rx_pause; in e1000e_config_fc_after_link_up()
1140 hw->fc.current_mode = e1000_fc_none; in e1000e_config_fc_after_link_up()
1144 /* Now we need to do one last check... If we auto- in e1000e_config_fc_after_link_up()
1148 ret_val = mac->ops.get_link_up_info(hw, &speed, &duplex); in e1000e_config_fc_after_link_up()
1155 hw->fc.current_mode = e1000_fc_none; in e1000e_config_fc_after_link_up()
1167 /* Check for the case where we have SerDes media and auto-neg is in e1000e_config_fc_after_link_up()
1168 * enabled. In this case, we need to check and see if Auto-Neg in e1000e_config_fc_after_link_up()
1172 if ((hw->phy.media_type == e1000_media_type_internal_serdes) && in e1000e_config_fc_after_link_up()
1173 mac->autoneg) { in e1000e_config_fc_after_link_up()
1204 *-------|---------|-------|---------|-------------------- in e1000e_config_fc_after_link_up()
1222 *-------|---------|-------|---------|-------------------- in e1000e_config_fc_after_link_up()
1234 if (hw->fc.requested_mode == e1000_fc_full) { in e1000e_config_fc_after_link_up()
1235 hw->fc.current_mode = e1000_fc_full; in e1000e_config_fc_after_link_up()
1238 hw->fc.current_mode = e1000_fc_rx_pause; in e1000e_config_fc_after_link_up()
1246 *-------|---------|-------|---------|-------------------- in e1000e_config_fc_after_link_up()
1253 hw->fc.current_mode = e1000_fc_tx_pause; in e1000e_config_fc_after_link_up()
1260 *-------|---------|-------|---------|-------------------- in e1000e_config_fc_after_link_up()
1267 hw->fc.current_mode = e1000_fc_rx_pause; in e1000e_config_fc_after_link_up()
1273 hw->fc.current_mode = e1000_fc_none; in e1000e_config_fc_after_link_up()
1295 * e1000e_get_speed_and_duplex_copper - Retrieve current speed/duplex
1329 * e1000e_get_speed_and_duplex_fiber_serdes - Retrieve current speed/duplex
1335 * for fiber/serdes links.
1347 * e1000e_get_hw_semaphore - Acquire hardware semaphore
1355 s32 timeout = hw->nvm.word_size + 1; in e1000e_get_hw_semaphore()
1369 e_dbg("Driver can't access device - SMBI bit is set.\n"); in e1000e_get_hw_semaphore()
1370 return -E1000_ERR_NVM; in e1000e_get_hw_semaphore()
1389 return -E1000_ERR_NVM; in e1000e_get_hw_semaphore()
1396 * e1000e_put_hw_semaphore - Release hardware semaphore
1411 * e1000e_get_auto_rd_done - Check for auto read completion
1429 return -E1000_ERR_RESET; in e1000e_get_auto_rd_done()
1436 * e1000e_valid_led_default - Verify a valid default LED config
1460 * e1000e_id_led_init_generic -
1466 struct e1000_mac_info *mac = &hw->mac; in e1000e_id_led_init_generic()
1474 ret_val = hw->nvm.ops.valid_led_default(hw, &data); in e1000e_id_led_init_generic()
1478 mac->ledctl_default = er32(LEDCTL); in e1000e_id_led_init_generic()
1479 mac->ledctl_mode1 = mac->ledctl_default; in e1000e_id_led_init_generic()
1480 mac->ledctl_mode2 = mac->ledctl_default; in e1000e_id_led_init_generic()
1488 mac->ledctl_mode1 &= ~(ledctl_mask << (i << 3)); in e1000e_id_led_init_generic()
1489 mac->ledctl_mode1 |= ledctl_on << (i << 3); in e1000e_id_led_init_generic()
1494 mac->ledctl_mode1 &= ~(ledctl_mask << (i << 3)); in e1000e_id_led_init_generic()
1495 mac->ledctl_mode1 |= ledctl_off << (i << 3); in e1000e_id_led_init_generic()
1505 mac->ledctl_mode2 &= ~(ledctl_mask << (i << 3)); in e1000e_id_led_init_generic()
1506 mac->ledctl_mode2 |= ledctl_on << (i << 3); in e1000e_id_led_init_generic()
1511 mac->ledctl_mode2 &= ~(ledctl_mask << (i << 3)); in e1000e_id_led_init_generic()
1512 mac->ledctl_mode2 |= ledctl_off << (i << 3); in e1000e_id_led_init_generic()
1524 * e1000e_setup_led_generic - Configures SW controllable LED
1534 if (hw->mac.ops.setup_led != e1000e_setup_led_generic) in e1000e_setup_led_generic()
1535 return -E1000_ERR_CONFIG; in e1000e_setup_led_generic()
1537 if (hw->phy.media_type == e1000_media_type_fiber) { in e1000e_setup_led_generic()
1539 hw->mac.ledctl_default = ledctl; in e1000e_setup_led_generic()
1546 } else if (hw->phy.media_type == e1000_media_type_copper) { in e1000e_setup_led_generic()
1547 ew32(LEDCTL, hw->mac.ledctl_mode1); in e1000e_setup_led_generic()
1554 * e1000e_cleanup_led_generic - Set LED config to default operation
1562 ew32(LEDCTL, hw->mac.ledctl_default); in e1000e_cleanup_led_generic()
1567 * e1000e_blink_led_generic - Blink LED
1577 if (hw->phy.media_type == e1000_media_type_fiber) { in e1000e_blink_led_generic()
1578 /* always blink LED0 for PCI-E fiber */ in e1000e_blink_led_generic()
1584 * logic in hardware only works when mode is set to "on" in e1000e_blink_led_generic()
1585 * so it must be changed accordingly when the mode is in e1000e_blink_led_generic()
1588 ledctl_blink = hw->mac.ledctl_mode2; in e1000e_blink_led_generic()
1590 u32 mode = (hw->mac.ledctl_mode2 >> i) & in e1000e_blink_led_generic() local
1592 u32 led_default = hw->mac.ledctl_default >> i; in e1000e_blink_led_generic()
1595 (mode == E1000_LEDCTL_MODE_LED_ON)) || in e1000e_blink_led_generic()
1597 (mode == E1000_LEDCTL_MODE_LED_OFF))) { in e1000e_blink_led_generic()
1612 * e1000e_led_on_generic - Turn LED on
1621 switch (hw->phy.media_type) { in e1000e_led_on_generic()
1629 ew32(LEDCTL, hw->mac.ledctl_mode2); in e1000e_led_on_generic()
1639 * e1000e_led_off_generic - Turn LED off
1648 switch (hw->phy.media_type) { in e1000e_led_off_generic()
1656 ew32(LEDCTL, hw->mac.ledctl_mode1); in e1000e_led_off_generic()
1666 * e1000e_set_pcie_no_snoop - Set PCI-express capabilities
1670 * Set the PCI-express register to snoop for events enabled in 'no_snoop'.
1685 * e1000e_disable_pcie_master - Disables PCI-express master access
1688 * Returns 0 if successful, else returns -10
1689 * (-E1000_ERR_MASTER_REQUESTS_PENDING) if master disable bit has not caused
1692 * Disables PCI-Express master access and verifies there are no pending
1708 timeout--; in e1000e_disable_pcie_master()
1713 return -E1000_ERR_MASTER_REQUESTS_PENDING; in e1000e_disable_pcie_master()
1720 * e1000e_reset_adaptive - Reset Adaptive Interframe Spacing
1727 struct e1000_mac_info *mac = &hw->mac; in e1000e_reset_adaptive()
1729 if (!mac->adaptive_ifs) { in e1000e_reset_adaptive()
1730 e_dbg("Not in Adaptive IFS mode!\n"); in e1000e_reset_adaptive()
1734 mac->current_ifs_val = 0; in e1000e_reset_adaptive()
1735 mac->ifs_min_val = IFS_MIN; in e1000e_reset_adaptive()
1736 mac->ifs_max_val = IFS_MAX; in e1000e_reset_adaptive()
1737 mac->ifs_step_size = IFS_STEP; in e1000e_reset_adaptive()
1738 mac->ifs_ratio = IFS_RATIO; in e1000e_reset_adaptive()
1740 mac->in_ifs_mode = false; in e1000e_reset_adaptive()
1745 * e1000e_update_adaptive - Update Adaptive Interframe Spacing
1753 struct e1000_mac_info *mac = &hw->mac; in e1000e_update_adaptive()
1755 if (!mac->adaptive_ifs) { in e1000e_update_adaptive()
1756 e_dbg("Not in Adaptive IFS mode!\n"); in e1000e_update_adaptive()
1760 if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) { in e1000e_update_adaptive()
1761 if (mac->tx_packet_delta > MIN_NUM_XMITS) { in e1000e_update_adaptive()
1762 mac->in_ifs_mode = true; in e1000e_update_adaptive()
1763 if (mac->current_ifs_val < mac->ifs_max_val) { in e1000e_update_adaptive()
1764 if (!mac->current_ifs_val) in e1000e_update_adaptive()
1765 mac->current_ifs_val = mac->ifs_min_val; in e1000e_update_adaptive()
1767 mac->current_ifs_val += in e1000e_update_adaptive()
1768 mac->ifs_step_size; in e1000e_update_adaptive()
1769 ew32(AIT, mac->current_ifs_val); in e1000e_update_adaptive()
1773 if (mac->in_ifs_mode && in e1000e_update_adaptive()
1774 (mac->tx_packet_delta <= MIN_NUM_XMITS)) { in e1000e_update_adaptive()
1775 mac->current_ifs_val = 0; in e1000e_update_adaptive()
1776 mac->in_ifs_mode = false; in e1000e_update_adaptive()