Lines Matching +full:spi +full:- +full:tx +full:- +full:bus +full:- +full:width

4   Copyright(c) 1999 - 2011 Intel Corporation.
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
45 * e1000e_get_bus_info_pcie - Get PCIe bus information
48 * Determines and stores the system bus information for a particular
49 * network interface. The following bus information is determined and stored:
50 * bus speed, bus width, type (PCIe), and PCIe function.
54 struct e1000_mac_info *mac = &hw->mac; in e1000e_get_bus_info_pcie()
55 struct e1000_bus_info *bus = &hw->bus; in e1000e_get_bus_info_pcie() local
56 struct e1000_adapter *adapter = hw->adapter; in e1000e_get_bus_info_pcie()
59 cap_offset = adapter->pdev->pcie_cap; in e1000e_get_bus_info_pcie()
61 bus->width = e1000_bus_width_unknown; in e1000e_get_bus_info_pcie()
63 pci_read_config_word(adapter->pdev, in e1000e_get_bus_info_pcie()
66 bus->width = (enum e1000_bus_width)((pcie_link_status & in e1000e_get_bus_info_pcie()
71 mac->ops.set_lan_id(hw); in e1000e_get_bus_info_pcie()
77 * e1000_set_lan_id_multi_port_pcie - Set LAN id for PCIe multiple port devices
81 * Determines the LAN function id by reading memory-mapped registers
86 struct e1000_bus_info *bus = &hw->bus; in e1000_set_lan_id_multi_port_pcie() local
94 bus->func = (reg & E1000_STATUS_FUNC_MASK) >> E1000_STATUS_FUNC_SHIFT; in e1000_set_lan_id_multi_port_pcie()
98 * e1000_set_lan_id_single_port - Set LAN id for a single port device
105 struct e1000_bus_info *bus = &hw->bus; in e1000_set_lan_id_single_port() local
107 bus->func = 0; in e1000_set_lan_id_single_port()
111 * e1000_clear_vfta_generic - Clear VLAN filter table
128 * e1000_write_vfta_generic - Write value to VLAN filter table
143 * e1000e_init_rx_addrs - Initialize receive address's
159 e1000e_rar_set(hw, hw->mac.addr, 0); in e1000e_init_rx_addrs()
161 /* Zero out the other (rar_entry_count - 1) receive addresses */ in e1000e_init_rx_addrs()
162 e_dbg("Clearing RAR[1-%u]\n", rar_count-1); in e1000e_init_rx_addrs()
168 * e1000_check_alt_mac_addr_generic - Check for alternate MAC addr
172 * can be setup by pre-boot software and must be treated like a permanent
192 (hw->adapter->pdev->device == E1000_DEV_ID_82571EB_SERDES_DUAL) || in e1000_check_alt_mac_addr_generic()
193 (hw->adapter->pdev->device == E1000_DEV_ID_82571EB_SERDES_QUAD) || in e1000_check_alt_mac_addr_generic()
194 (hw->adapter->pdev->device == E1000_DEV_ID_82571EB_SERDES))) in e1000_check_alt_mac_addr_generic()
209 if (hw->bus.func == E1000_FUNC_1) in e1000_check_alt_mac_addr_generic()
241 * e1000e_rar_set - Set receive address register
268 * Some bridges will combine consecutive 32-bit writes into in e1000e_rar_set()
279 * e1000_hash_mc_addr - Generate a multicast hash value
293 hash_mask = (hw->mac.mta_reg_count * 32) - 1; in e1000_hash_mc_addr()
296 * For a mc_filter_type of 0, bit_shift is the number of left-shifts in e1000_hash_mc_addr()
307 * left-shifts where the MSB of mc_addr[5] would still fall within in e1000_hash_mc_addr()
310 * remaining number of bits. Thus 8 - bit_shift. The rest of the in e1000_hash_mc_addr()
313 * 8-bit shifting total. in e1000_hash_mc_addr()
316 * mta register count of 128 (thus a 4096-bit vector and 0xFFF mask), in e1000_hash_mc_addr()
328 switch (hw->mac.mc_filter_type) { in e1000_hash_mc_addr()
343 hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) | in e1000_hash_mc_addr()
350 * e1000e_update_mc_addr_list_generic - Update Multicast addresses
365 memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow)); in e1000e_update_mc_addr_list_generic()
371 hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1); in e1000e_update_mc_addr_list_generic()
374 hw->mac.mta_shadow[hash_reg] |= (1 << hash_bit); in e1000e_update_mc_addr_list_generic()
379 for (i = hw->mac.mta_reg_count - 1; i >= 0; i--) in e1000e_update_mc_addr_list_generic()
380 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, hw->mac.mta_shadow[i]); in e1000e_update_mc_addr_list_generic()
385 * e1000e_clear_hw_cntrs_base - Clear base hardware counters
432 * e1000e_check_for_copper_link - Check for link (Copper)
441 struct e1000_mac_info *mac = &hw->mac; in e1000e_check_for_copper_link()
446 * We only want to go out to the PHY registers to see if Auto-Neg in e1000e_check_for_copper_link()
451 if (!mac->get_link_status) in e1000e_check_for_copper_link()
466 mac->get_link_status = false; in e1000e_check_for_copper_link()
470 * immediately after link-up in e1000e_check_for_copper_link()
478 if (!mac->autoneg) { in e1000e_check_for_copper_link()
479 ret_val = -E1000_ERR_CONFIG; in e1000e_check_for_copper_link()
484 * Auto-Neg is enabled. Auto Speed Detection takes care in e1000e_check_for_copper_link()
491 * Configure Flow Control now that Auto-Neg has completed. in e1000e_check_for_copper_link()
493 * settings because we may have had to re-autoneg with a in e1000e_check_for_copper_link()
504 * e1000e_check_for_fiber_link - Check for link (Fiber)
512 struct e1000_mac_info *mac = &hw->mac; in e1000e_check_for_fiber_link()
523 * If we don't have link (auto-negotiation failed or link partner in e1000e_check_for_fiber_link()
524 * cannot auto-negotiate), the cable is plugged in (we have signal), in e1000e_check_for_fiber_link()
525 * and our link partner is not trying to auto-negotiate with us (we in e1000e_check_for_fiber_link()
527 * need to give auto-negotiation time to complete, in case the cable in e1000e_check_for_fiber_link()
533 if (mac->autoneg_failed == 0) { in e1000e_check_for_fiber_link()
534 mac->autoneg_failed = 1; in e1000e_check_for_fiber_link()
539 /* Disable auto-negotiation in the TXCW register */ in e1000e_check_for_fiber_link()
540 ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE)); in e1000e_check_for_fiber_link()
542 /* Force link-up and also force full-duplex. */ in e1000e_check_for_fiber_link()
556 * sets, re-enable auto-negotiation in the TXCW register in e1000e_check_for_fiber_link()
558 * in an attempt to auto-negotiate with our link partner. in e1000e_check_for_fiber_link()
561 ew32(TXCW, mac->txcw); in e1000e_check_for_fiber_link()
564 mac->serdes_has_link = true; in e1000e_check_for_fiber_link()
571 * e1000e_check_for_serdes_link - Check for link (Serdes)
579 struct e1000_mac_info *mac = &hw->mac; in e1000e_check_for_serdes_link()
590 * If we don't have link (auto-negotiation failed or link partner in e1000e_check_for_serdes_link()
591 * cannot auto-negotiate), and our link partner is not trying to in e1000e_check_for_serdes_link()
592 * auto-negotiate with us (we are receiving idles or data), in e1000e_check_for_serdes_link()
593 * we need to force link up. We also need to give auto-negotiation in e1000e_check_for_serdes_link()
598 if (mac->autoneg_failed == 0) { in e1000e_check_for_serdes_link()
599 mac->autoneg_failed = 1; in e1000e_check_for_serdes_link()
604 /* Disable auto-negotiation in the TXCW register */ in e1000e_check_for_serdes_link()
605 ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE)); in e1000e_check_for_serdes_link()
607 /* Force link-up and also force full-duplex. */ in e1000e_check_for_serdes_link()
621 * sets, re-enable auto-negotiation in the TXCW register in e1000e_check_for_serdes_link()
623 * in an attempt to auto-negotiate with our link partner. in e1000e_check_for_serdes_link()
626 ew32(TXCW, mac->txcw); in e1000e_check_for_serdes_link()
629 mac->serdes_has_link = true; in e1000e_check_for_serdes_link()
632 * If we force link for non-auto-negotiation switch, check in e1000e_check_for_serdes_link()
641 mac->serdes_has_link = true; in e1000e_check_for_serdes_link()
642 e_dbg("SERDES: Link up - forced.\n"); in e1000e_check_for_serdes_link()
645 mac->serdes_has_link = false; in e1000e_check_for_serdes_link()
646 e_dbg("SERDES: Link down - force failed.\n"); in e1000e_check_for_serdes_link()
658 mac->serdes_has_link = true; in e1000e_check_for_serdes_link()
659 e_dbg("SERDES: Link up - autoneg " in e1000e_check_for_serdes_link()
662 mac->serdes_has_link = false; in e1000e_check_for_serdes_link()
663 e_dbg("SERDES: Link down - invalid" in e1000e_check_for_serdes_link()
667 mac->serdes_has_link = false; in e1000e_check_for_serdes_link()
668 e_dbg("SERDES: Link down - no sync.\n"); in e1000e_check_for_serdes_link()
671 mac->serdes_has_link = false; in e1000e_check_for_serdes_link()
672 e_dbg("SERDES: Link down - autoneg failed\n"); in e1000e_check_for_serdes_link()
680 * e1000_set_default_fc_generic - Set flow control default values
695 * disabling auto-negotiation, and the direction of the in e1000_set_default_fc_generic()
696 * SW defined pins. If there is no SW over-ride of the flow in e1000_set_default_fc_generic()
697 * control setting, then the variable hw->fc will in e1000_set_default_fc_generic()
708 hw->fc.requested_mode = e1000_fc_none; in e1000_set_default_fc_generic()
711 hw->fc.requested_mode = e1000_fc_tx_pause; in e1000_set_default_fc_generic()
713 hw->fc.requested_mode = e1000_fc_full; in e1000_set_default_fc_generic()
719 * e1000e_setup_link - Setup flow control and link settings
723 * control. Calls the appropriate media-specific link configuration
730 struct e1000_mac_info *mac = &hw->mac; in e1000e_setup_link()
744 if (hw->fc.requested_mode == e1000_fc_default) { in e1000e_setup_link()
754 hw->fc.current_mode = hw->fc.requested_mode; in e1000e_setup_link()
756 e_dbg("After fix-ups FlowControl is now = %x\n", in e1000e_setup_link()
757 hw->fc.current_mode); in e1000e_setup_link()
760 ret_val = mac->ops.setup_physical_interface(hw); in e1000e_setup_link()
775 ew32(FCTTV, hw->fc.pause_time); in e1000e_setup_link()
781 * e1000_commit_fc_settings_generic - Configure flow control
789 struct e1000_mac_info *mac = &hw->mac; in e1000_commit_fc_settings_generic()
794 * setup the device accordingly. If auto-negotiation is enabled, then in e1000_commit_fc_settings_generic()
796 * the Transmit Config Word Register (TXCW) and re-start auto- in e1000_commit_fc_settings_generic()
797 * negotiation. However, if auto-negotiation is disabled, then in e1000_commit_fc_settings_generic()
805 * 2: Tx flow control is enabled (we can send pause frames but we in e1000_commit_fc_settings_generic()
807 * 3: Both Rx and Tx flow control (symmetric) are enabled. in e1000_commit_fc_settings_generic()
809 switch (hw->fc.current_mode) { in e1000_commit_fc_settings_generic()
811 /* Flow control completely disabled by a software over-ride. */ in e1000_commit_fc_settings_generic()
816 * Rx Flow control is enabled and Tx Flow control is disabled in e1000_commit_fc_settings_generic()
817 * by a software over-ride. Since there really isn't a way to in e1000_commit_fc_settings_generic()
827 * Tx Flow control is enabled, and Rx Flow control is disabled, in e1000_commit_fc_settings_generic()
828 * by a software over-ride. in e1000_commit_fc_settings_generic()
834 * Flow control (both Rx and Tx) is enabled by a software in e1000_commit_fc_settings_generic()
835 * over-ride. in e1000_commit_fc_settings_generic()
841 return -E1000_ERR_CONFIG; in e1000_commit_fc_settings_generic()
846 mac->txcw = txcw; in e1000_commit_fc_settings_generic()
852 * e1000_poll_fiber_serdes_link_generic - Poll for link up
856 * up with auto-negotiation, then the link is forced if a signal is detected.
860 struct e1000_mac_info *mac = &hw->mac; in e1000_poll_fiber_serdes_link_generic()
866 * serdes media) then poll for a "Link-Up" indication in the Device in e1000_poll_fiber_serdes_link_generic()
867 * Status Register. Time-out if a link isn't seen in 500 milliseconds in e1000_poll_fiber_serdes_link_generic()
868 * seconds (Auto-negotiation should complete in less than 500 in e1000_poll_fiber_serdes_link_generic()
878 e_dbg("Never got a valid link from auto-neg!!!\n"); in e1000_poll_fiber_serdes_link_generic()
879 mac->autoneg_failed = 1; in e1000_poll_fiber_serdes_link_generic()
882 * mac->check_for_link. This routine will force the in e1000_poll_fiber_serdes_link_generic()
884 * communicate with non-autonegotiating link partners. in e1000_poll_fiber_serdes_link_generic()
886 ret_val = mac->ops.check_for_link(hw); in e1000_poll_fiber_serdes_link_generic()
891 mac->autoneg_failed = 0; in e1000_poll_fiber_serdes_link_generic()
893 mac->autoneg_failed = 0; in e1000_poll_fiber_serdes_link_generic()
901 * e1000e_setup_fiber_serdes_link - Setup link for fiber/serdes
924 * Since auto-negotiation is enabled, take the link out of reset (the in e1000e_setup_fiber_serdes_link()
926 * will restart auto-negotiation. If auto-negotiation is successful in e1000e_setup_fiber_serdes_link()
927 * then the link-up status bit will be set and the flow control enable in e1000e_setup_fiber_serdes_link()
930 e_dbg("Auto-negotiation enabled\n"); in e1000e_setup_fiber_serdes_link()
938 * detect a signal. If we have a signal, then poll for a "Link-Up" in e1000e_setup_fiber_serdes_link()
941 if (hw->phy.media_type == e1000_media_type_internal_serdes || in e1000e_setup_fiber_serdes_link()
952 * e1000e_config_collision_dist - Configure collision distance
973 * e1000e_set_fc_watermarks - Set flow control high/low watermarks
991 if (hw->fc.current_mode & e1000_fc_tx_pause) { in e1000e_set_fc_watermarks()
997 fcrtl = hw->fc.low_water; in e1000e_set_fc_watermarks()
999 fcrth = hw->fc.high_water; in e1000e_set_fc_watermarks()
1008 * e1000e_force_mac_fc - Force the MAC's flow control settings
1024 * Because we didn't get link via the internal auto-negotiation in e1000e_force_mac_fc()
1026 * auto-neg), we have to manually enable/disable transmit an in e1000e_force_mac_fc()
1030 * according to the "hw->fc.current_mode" parameter. in e1000e_force_mac_fc()
1036 * 2: Tx flow control is enabled (we can send pause frames in e1000e_force_mac_fc()
1038 * 3: Both Rx and Tx flow control (symmetric) is enabled. in e1000e_force_mac_fc()
1041 e_dbg("hw->fc.current_mode = %u\n", hw->fc.current_mode); in e1000e_force_mac_fc()
1043 switch (hw->fc.current_mode) { in e1000e_force_mac_fc()
1060 return -E1000_ERR_CONFIG; in e1000e_force_mac_fc()
1069 * e1000e_config_fc_after_link_up - Configures flow control after link
1072 * Checks the status of auto-negotiation after link up to ensure that the
1074 * flow control needs to be forced also. If auto-negotiation is enabled
1080 struct e1000_mac_info *mac = &hw->mac; in e1000e_config_fc_after_link_up()
1086 * Check for the case where we have fiber media and auto-neg failed in e1000e_config_fc_after_link_up()
1090 if (mac->autoneg_failed) { in e1000e_config_fc_after_link_up()
1091 if (hw->phy.media_type == e1000_media_type_fiber || in e1000e_config_fc_after_link_up()
1092 hw->phy.media_type == e1000_media_type_internal_serdes) in e1000e_config_fc_after_link_up()
1095 if (hw->phy.media_type == e1000_media_type_copper) in e1000e_config_fc_after_link_up()
1105 * Check for the case where we have copper media and auto-neg is in e1000e_config_fc_after_link_up()
1106 * enabled. In this case, we need to check and see if Auto-Neg in e1000e_config_fc_after_link_up()
1110 if ((hw->phy.media_type == e1000_media_type_copper) && mac->autoneg) { in e1000e_config_fc_after_link_up()
1156 *-------|---------|-------|---------|-------------------- in e1000e_config_fc_after_link_up()
1174 *-------|---------|-------|---------|-------------------- in e1000e_config_fc_after_link_up()
1187 if (hw->fc.requested_mode == e1000_fc_full) { in e1000e_config_fc_after_link_up()
1188 hw->fc.current_mode = e1000_fc_full; in e1000e_config_fc_after_link_up()
1191 hw->fc.current_mode = e1000_fc_rx_pause; in e1000e_config_fc_after_link_up()
1201 *-------|---------|-------|---------|-------------------- in e1000e_config_fc_after_link_up()
1208 hw->fc.current_mode = e1000_fc_tx_pause; in e1000e_config_fc_after_link_up()
1209 e_dbg("Flow Control = Tx PAUSE frames only.\r\n"); in e1000e_config_fc_after_link_up()
1216 *-------|---------|-------|---------|-------------------- in e1000e_config_fc_after_link_up()
1223 hw->fc.current_mode = e1000_fc_rx_pause; in e1000e_config_fc_after_link_up()
1230 hw->fc.current_mode = e1000_fc_none; in e1000e_config_fc_after_link_up()
1235 * Now we need to do one last check... If we auto- in e1000e_config_fc_after_link_up()
1239 ret_val = mac->ops.get_link_up_info(hw, &speed, &duplex); in e1000e_config_fc_after_link_up()
1246 hw->fc.current_mode = e1000_fc_none; in e1000e_config_fc_after_link_up()
1263 * e1000e_get_speed_and_duplex_copper - Retrieve current speed/duplex
1296 * e1000e_get_speed_and_duplex_fiber_serdes - Retrieve current speed/duplex
1313 * e1000e_get_hw_semaphore - Acquire hardware semaphore
1321 s32 timeout = hw->nvm.word_size + 1; in e1000e_get_hw_semaphore()
1335 e_dbg("Driver can't access device - SMBI bit is set.\n"); in e1000e_get_hw_semaphore()
1336 return -E1000_ERR_NVM; in e1000e_get_hw_semaphore()
1355 return -E1000_ERR_NVM; in e1000e_get_hw_semaphore()
1362 * e1000e_put_hw_semaphore - Release hardware semaphore
1377 * e1000e_get_auto_rd_done - Check for auto read completion
1395 return -E1000_ERR_RESET; in e1000e_get_auto_rd_done()
1402 * e1000e_valid_led_default - Verify a valid default LED config
1426 * e1000e_id_led_init -
1432 struct e1000_mac_info *mac = &hw->mac; in e1000e_id_led_init()
1440 ret_val = hw->nvm.ops.valid_led_default(hw, &data); in e1000e_id_led_init()
1444 mac->ledctl_default = er32(LEDCTL); in e1000e_id_led_init()
1445 mac->ledctl_mode1 = mac->ledctl_default; in e1000e_id_led_init()
1446 mac->ledctl_mode2 = mac->ledctl_default; in e1000e_id_led_init()
1454 mac->ledctl_mode1 &= ~(ledctl_mask << (i << 3)); in e1000e_id_led_init()
1455 mac->ledctl_mode1 |= ledctl_on << (i << 3); in e1000e_id_led_init()
1460 mac->ledctl_mode1 &= ~(ledctl_mask << (i << 3)); in e1000e_id_led_init()
1461 mac->ledctl_mode1 |= ledctl_off << (i << 3); in e1000e_id_led_init()
1471 mac->ledctl_mode2 &= ~(ledctl_mask << (i << 3)); in e1000e_id_led_init()
1472 mac->ledctl_mode2 |= ledctl_on << (i << 3); in e1000e_id_led_init()
1477 mac->ledctl_mode2 &= ~(ledctl_mask << (i << 3)); in e1000e_id_led_init()
1478 mac->ledctl_mode2 |= ledctl_off << (i << 3); in e1000e_id_led_init()
1490 * e1000e_setup_led_generic - Configures SW controllable LED
1500 if (hw->mac.ops.setup_led != e1000e_setup_led_generic) in e1000e_setup_led_generic()
1501 return -E1000_ERR_CONFIG; in e1000e_setup_led_generic()
1503 if (hw->phy.media_type == e1000_media_type_fiber) { in e1000e_setup_led_generic()
1505 hw->mac.ledctl_default = ledctl; in e1000e_setup_led_generic()
1513 } else if (hw->phy.media_type == e1000_media_type_copper) { in e1000e_setup_led_generic()
1514 ew32(LEDCTL, hw->mac.ledctl_mode1); in e1000e_setup_led_generic()
1521 * e1000e_cleanup_led_generic - Set LED config to default operation
1529 ew32(LEDCTL, hw->mac.ledctl_default); in e1000e_cleanup_led_generic()
1534 * e1000e_blink_led_generic - Blink LED
1544 if (hw->phy.media_type == e1000_media_type_fiber) { in e1000e_blink_led_generic()
1545 /* always blink LED0 for PCI-E fiber */ in e1000e_blink_led_generic()
1553 ledctl_blink = hw->mac.ledctl_mode2; in e1000e_blink_led_generic()
1555 if (((hw->mac.ledctl_mode2 >> (i * 8)) & 0xFF) == in e1000e_blink_led_generic()
1567 * e1000e_led_on_generic - Turn LED on
1576 switch (hw->phy.media_type) { in e1000e_led_on_generic()
1584 ew32(LEDCTL, hw->mac.ledctl_mode2); in e1000e_led_on_generic()
1594 * e1000e_led_off_generic - Turn LED off
1603 switch (hw->phy.media_type) { in e1000e_led_off_generic()
1611 ew32(LEDCTL, hw->mac.ledctl_mode1); in e1000e_led_off_generic()
1621 * e1000e_set_pcie_no_snoop - Set PCI-express capabilities
1625 * Set the PCI-express register to snoop for events enabled in 'no_snoop'.
1640 * e1000e_disable_pcie_master - Disables PCI-express master access
1643 * Returns 0 if successful, else returns -10
1644 * (-E1000_ERR_MASTER_REQUESTS_PENDING) if master disable bit has not caused
1647 * Disables PCI-Express master access and verifies there are no pending
1664 timeout--; in e1000e_disable_pcie_master()
1669 return -E1000_ERR_MASTER_REQUESTS_PENDING; in e1000e_disable_pcie_master()
1676 * e1000e_reset_adaptive - Reset Adaptive Interframe Spacing
1683 struct e1000_mac_info *mac = &hw->mac; in e1000e_reset_adaptive()
1685 if (!mac->adaptive_ifs) { in e1000e_reset_adaptive()
1690 mac->current_ifs_val = 0; in e1000e_reset_adaptive()
1691 mac->ifs_min_val = IFS_MIN; in e1000e_reset_adaptive()
1692 mac->ifs_max_val = IFS_MAX; in e1000e_reset_adaptive()
1693 mac->ifs_step_size = IFS_STEP; in e1000e_reset_adaptive()
1694 mac->ifs_ratio = IFS_RATIO; in e1000e_reset_adaptive()
1696 mac->in_ifs_mode = false; in e1000e_reset_adaptive()
1703 * e1000e_update_adaptive - Update Adaptive Interframe Spacing
1711 struct e1000_mac_info *mac = &hw->mac; in e1000e_update_adaptive()
1713 if (!mac->adaptive_ifs) { in e1000e_update_adaptive()
1718 if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) { in e1000e_update_adaptive()
1719 if (mac->tx_packet_delta > MIN_NUM_XMITS) { in e1000e_update_adaptive()
1720 mac->in_ifs_mode = true; in e1000e_update_adaptive()
1721 if (mac->current_ifs_val < mac->ifs_max_val) { in e1000e_update_adaptive()
1722 if (!mac->current_ifs_val) in e1000e_update_adaptive()
1723 mac->current_ifs_val = mac->ifs_min_val; in e1000e_update_adaptive()
1725 mac->current_ifs_val += in e1000e_update_adaptive()
1726 mac->ifs_step_size; in e1000e_update_adaptive()
1727 ew32(AIT, mac->current_ifs_val); in e1000e_update_adaptive()
1731 if (mac->in_ifs_mode && in e1000e_update_adaptive()
1732 (mac->tx_packet_delta <= MIN_NUM_XMITS)) { in e1000e_update_adaptive()
1733 mac->current_ifs_val = 0; in e1000e_update_adaptive()
1734 mac->in_ifs_mode = false; in e1000e_update_adaptive()
1743 * e1000_raise_eec_clk - Raise EEPROM clock
1754 udelay(hw->nvm.delay_usec); in e1000_raise_eec_clk()
1758 * e1000_lower_eec_clk - Lower EEPROM clock
1769 udelay(hw->nvm.delay_usec); in e1000_lower_eec_clk()
1773 * e1000_shift_out_eec_bits - Shift data bits our to the EEPROM
1784 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_shift_out_eec_bits()
1788 mask = 0x01 << (count - 1); in e1000_shift_out_eec_bits()
1789 if (nvm->type == e1000_nvm_eeprom_spi) in e1000_shift_out_eec_bits()
1801 udelay(nvm->delay_usec); in e1000_shift_out_eec_bits()
1814 * e1000_shift_in_eec_bits - Shift data bits in from the EEPROM
1852 * e1000e_poll_eerd_eewr_done - Poll for EEPROM read/write completion
1876 return -E1000_ERR_NVM; in e1000e_poll_eerd_eewr_done()
1880 * e1000e_acquire_nvm - Generic request for access to EEPROM
1885 * EEPROM access and return -E1000_ERR_NVM (-1).
1900 timeout--; in e1000e_acquire_nvm()
1907 return -E1000_ERR_NVM; in e1000e_acquire_nvm()
1914 * e1000_standby_nvm - Return EEPROM to standby state
1921 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_standby_nvm()
1924 if (nvm->type == e1000_nvm_eeprom_spi) { in e1000_standby_nvm()
1929 udelay(nvm->delay_usec); in e1000_standby_nvm()
1933 udelay(nvm->delay_usec); in e1000_standby_nvm()
1938 * e1000_stop_nvm - Terminate EEPROM command
1948 if (hw->nvm.type == e1000_nvm_eeprom_spi) { in e1000_stop_nvm()
1956 * e1000e_release_nvm - Release exclusive access to EEPROM
1973 * e1000_ready_nvm_eeprom - Prepares EEPROM for read/write
1980 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_ready_nvm_eeprom()
1984 if (nvm->type == e1000_nvm_eeprom_spi) { in e1000_ready_nvm_eeprom()
2001 hw->nvm.opcode_bits); in e1000_ready_nvm_eeprom()
2008 timeout--; in e1000_ready_nvm_eeprom()
2012 e_dbg("SPI NVM Status error\n"); in e1000_ready_nvm_eeprom()
2013 return -E1000_ERR_NVM; in e1000_ready_nvm_eeprom()
2021 * e1000e_read_nvm_eerd - Reads EEPROM using EERD register
2031 struct e1000_nvm_info *nvm = &hw->nvm; in e1000e_read_nvm_eerd()
2039 if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || in e1000e_read_nvm_eerd()
2042 return -E1000_ERR_NVM; in e1000e_read_nvm_eerd()
2061 * e1000e_write_nvm_spi - Write to EEPROM using SPI
2067 * Writes data to EEPROM at offset using SPI interface.
2074 struct e1000_nvm_info *nvm = &hw->nvm; in e1000e_write_nvm_spi()
2082 if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || in e1000e_write_nvm_spi()
2085 return -E1000_ERR_NVM; in e1000e_write_nvm_spi()
2088 ret_val = nvm->ops.acquire(hw); in e1000e_write_nvm_spi()
2097 nvm->ops.release(hw); in e1000e_write_nvm_spi()
2105 nvm->opcode_bits); in e1000e_write_nvm_spi()
2110 * Some SPI eeproms use the 8th address bit embedded in the in e1000e_write_nvm_spi()
2113 if ((nvm->address_bits == 8) && (offset >= 128)) in e1000e_write_nvm_spi()
2116 /* Send the Write command (8-bit opcode + addr) */ in e1000e_write_nvm_spi()
2117 e1000_shift_out_eec_bits(hw, write_opcode, nvm->opcode_bits); in e1000e_write_nvm_spi()
2119 nvm->address_bits); in e1000e_write_nvm_spi()
2128 if ((((offset + widx) * 2) % nvm->page_size) == 0) { in e1000e_write_nvm_spi()
2136 nvm->ops.release(hw); in e1000e_write_nvm_spi()
2141 * e1000_read_pba_string_generic - Read device part number
2197 pba_num[6] = '-'; in e1000_read_pba_string_generic()
2205 /* switch all the data but the '-' to hex char */ in e1000_read_pba_string_generic()
2210 pba_num[offset] += 'A' - 0xA; in e1000_read_pba_string_generic()
2228 if (pba_num_size < (((u32)length * 2) - 1)) { in e1000_read_pba_string_generic()
2236 length--; in e1000_read_pba_string_generic()
2254 * e1000_read_mac_addr_generic - Read device MAC address
2271 hw->mac.perm_addr[i] = (u8)(rar_low >> (i*8)); in e1000_read_mac_addr_generic()
2274 hw->mac.perm_addr[i+4] = (u8)(rar_high >> (i*8)); in e1000_read_mac_addr_generic()
2277 hw->mac.addr[i] = hw->mac.perm_addr[i]; in e1000_read_mac_addr_generic()
2283 * e1000e_validate_nvm_checksum_generic - Validate EEPROM checksum
2306 return -E1000_ERR_NVM; in e1000e_validate_nvm_checksum_generic()
2313 * e1000e_update_nvm_checksum_generic - Update EEPROM checksum
2334 checksum = (u16) NVM_SUM - checksum; in e1000e_update_nvm_checksum_generic()
2343 * e1000e_reload_nvm - Reloads EEPROM
2361 * e1000_calculate_checksum - Calculate checksum for buffer
2379 return (u8) (0 - sum); in e1000_calculate_checksum()
2383 * e1000_mng_enable_host_if - Checks host interface is enabled
2397 if (!(hw->mac.arc_subsystem_valid)) { in e1000_mng_enable_host_if()
2399 return -E1000_ERR_HOST_INTERFACE_COMMAND; in e1000_mng_enable_host_if()
2406 return -E1000_ERR_HOST_INTERFACE_COMMAND; in e1000_mng_enable_host_if()
2418 return -E1000_ERR_HOST_INTERFACE_COMMAND; in e1000_mng_enable_host_if()
2425 * e1000e_check_mng_mode_generic - check management mode
2440 * e1000e_enable_tx_pkt_filtering - Enable packet filtering on Tx
2448 struct e1000_host_mng_dhcp_cookie *hdr = &hw->mng_cookie; in e1000e_enable_tx_pkt_filtering()
2449 u32 *buffer = (u32 *)&hw->mng_cookie; in e1000e_enable_tx_pkt_filtering()
2454 hw->mac.tx_pkt_filtering = true; in e1000e_enable_tx_pkt_filtering()
2458 hw->mac.tx_pkt_filtering = false; in e1000e_enable_tx_pkt_filtering()
2468 hw->mac.tx_pkt_filtering = false; in e1000e_enable_tx_pkt_filtering()
2477 hdr_csum = hdr->checksum; in e1000e_enable_tx_pkt_filtering()
2478 hdr->checksum = 0; in e1000e_enable_tx_pkt_filtering()
2484 * take the safe route of assuming Tx filtering is enabled. in e1000e_enable_tx_pkt_filtering()
2486 if ((hdr_csum != csum) || (hdr->signature != E1000_IAMT_SIGNATURE)) { in e1000e_enable_tx_pkt_filtering()
2487 hw->mac.tx_pkt_filtering = true; in e1000e_enable_tx_pkt_filtering()
2492 if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING)) { in e1000e_enable_tx_pkt_filtering()
2493 hw->mac.tx_pkt_filtering = false; in e1000e_enable_tx_pkt_filtering()
2498 return hw->mac.tx_pkt_filtering; in e1000e_enable_tx_pkt_filtering()
2502 * e1000_mng_write_cmd_header - Writes manageability command header
2515 hdr->checksum = e1000_calculate_checksum((u8 *)hdr, length); in e1000_mng_write_cmd_header()
2529 * e1000_mng_host_if_write - Write to the manageability host interface
2551 return -E1000_ERR_PARAM; in e1000_mng_host_if_write()
2564 length -= j - prev_bytes; in e1000_mng_host_if_write()
2569 length -= remaining; in e1000_mng_host_if_write()
2602 * e1000e_mng_write_dhcp_info - Writes DHCP info to host interface
2645 * e1000e_enable_mng_pass_thru - Check if management passthrough is needed
2662 if (hw->mac.has_fwsm) { in e1000e_enable_mng_pass_thru()
2672 } else if ((hw->mac.type == e1000_82574) || in e1000e_enable_mng_pass_thru()
2673 (hw->mac.type == e1000_82583)) { in e1000e_enable_mng_pass_thru()