diff options
author | jfv <jfv@FreeBSD.org> | 2008-05-16 18:46:30 +0000 |
---|---|---|
committer | jfv <jfv@FreeBSD.org> | 2008-05-16 18:46:30 +0000 |
commit | 57de9f8139222232fe979e551a156428ea474d04 (patch) | |
tree | 9aec21727f8b2a5d35e54cb6951c970d9052ca50 /sys/dev/ixgbe/ixgbe_api.c | |
parent | 14ceaad756cfa75128f72cd64bc54463ac22a11e (diff) | |
download | FreeBSD-src-57de9f8139222232fe979e551a156428ea474d04.zip FreeBSD-src-57de9f8139222232fe979e551a156428ea474d04.tar.gz |
This is driver version 1.4.4 of the Intel ixgbe driver.
-It has new hardware support
-It uses a new method of TX cleanup called Head Write Back
-It includes the provisional generic TCP LRO feature contributed
by Myricom and made general purpose by me. This should move into
the stack upon approval but for this driver drop its in here.
-Also bug fixes and etc...
MFC in a week if no serious issues arise.
Diffstat (limited to 'sys/dev/ixgbe/ixgbe_api.c')
-rw-r--r-- | sys/dev/ixgbe/ixgbe_api.c | 406 |
1 files changed, 221 insertions, 185 deletions
diff --git a/sys/dev/ixgbe/ixgbe_api.c b/sys/dev/ixgbe/ixgbe_api.c index 57b5678..570d480 100644 --- a/sys/dev/ixgbe/ixgbe_api.c +++ b/sys/dev/ixgbe/ixgbe_api.c @@ -1,6 +1,6 @@ -/******************************************************************************* +/****************************************************************************** - Copyright (c) 2001-2007, Intel Corporation + Copyright (c) 2001-2008, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -29,15 +29,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*******************************************************************************/ -/* $FreeBSD$ */ - +******************************************************************************/ +/*$FreeBSD$*/ #include "ixgbe_api.h" #include "ixgbe_common.h" -extern s32 ixgbe_init_shared_code_82598(struct ixgbe_hw *hw); -extern s32 ixgbe_init_shared_code_phy(struct ixgbe_hw *hw); +extern s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw); /** * ixgbe_init_shared_code - Initialize the shared code @@ -56,20 +54,13 @@ s32 ixgbe_init_shared_code(struct ixgbe_hw *hw) s32 status; /* - * Assign generic function pointers before entering adapter-specific - * init - */ - ixgbe_assign_func_pointers_generic(hw); - - /* * Set the mac type */ ixgbe_set_mac_type(hw); switch (hw->mac.type) { case ixgbe_mac_82598EB: - status = ixgbe_init_shared_code_82598(hw); - status = ixgbe_init_shared_code_phy(hw); + status = ixgbe_init_ops_82598(hw); break; default: status = IXGBE_ERR_DEVICE_NOT_SUPPORTED; @@ -90,13 +81,19 @@ s32 ixgbe_set_mac_type(struct ixgbe_hw *hw) { s32 ret_val = IXGBE_SUCCESS; - DEBUGFUNC("ixgbe_set_mac_type"); + DEBUGFUNC("ixgbe_set_mac_type\n"); if (hw->vendor_id == IXGBE_INTEL_VENDOR_ID) { switch (hw->device_id) { case IXGBE_DEV_ID_82598AF_SINGLE_PORT: case IXGBE_DEV_ID_82598AF_DUAL_PORT: + case IXGBE_DEV_ID_82598AT: + case IXGBE_DEV_ID_82598AT_DUAL_PORT: case IXGBE_DEV_ID_82598EB_CX4: + case IXGBE_DEV_ID_82598_CX4_DUAL_PORT: + case IXGBE_DEV_ID_82598_DA_DUAL_PORT: + case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM: + case IXGBE_DEV_ID_82598EB_XF_LR: hw->mac.type = ixgbe_mac_82598EB; break; default: @@ -107,6 +104,8 @@ s32 ixgbe_set_mac_type(struct ixgbe_hw *hw) ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED; } + DEBUGOUT2("ixgbe_set_mac_type found mac: %d, returns: %d\n", + hw->mac.type, ret_val); return ret_val; } @@ -118,8 +117,8 @@ s32 ixgbe_set_mac_type(struct ixgbe_hw *hw) **/ s32 ixgbe_init_hw(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_init_hw, (hw), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.init_hw, (hw), + IXGBE_NOT_IMPLEMENTED); } /** @@ -131,12 +130,12 @@ s32 ixgbe_init_hw(struct ixgbe_hw *hw) **/ s32 ixgbe_reset_hw(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_reset_hw, (hw), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.reset_hw, (hw), + IXGBE_NOT_IMPLEMENTED); } /** - * ixgbe_start_hw - Prepares hardware for TX/TX + * ixgbe_start_hw - Prepares hardware for Rx/Tx * @hw: pointer to hardware structure * * Starts the hardware by filling the bus info structure and media type, @@ -147,8 +146,8 @@ s32 ixgbe_reset_hw(struct ixgbe_hw *hw) **/ s32 ixgbe_start_hw(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_start_hw, (hw), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.start_hw, (hw), + IXGBE_NOT_IMPLEMENTED); } /** @@ -160,8 +159,8 @@ s32 ixgbe_start_hw(struct ixgbe_hw *hw) **/ s32 ixgbe_clear_hw_cntrs(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_clear_hw_cntrs, (hw), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.clear_hw_cntrs, (hw), + IXGBE_NOT_IMPLEMENTED); } /** @@ -172,8 +171,8 @@ s32 ixgbe_clear_hw_cntrs(struct ixgbe_hw *hw) **/ enum ixgbe_media_type ixgbe_get_media_type(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_get_media_type, (hw), - ixgbe_media_type_unknown); + return ixgbe_call_func(hw, hw->mac.ops.get_media_type, (hw), + ixgbe_media_type_unknown); } /** @@ -182,14 +181,14 @@ enum ixgbe_media_type ixgbe_get_media_type(struct ixgbe_hw *hw) * @mac_addr: Adapter MAC address * * Reads the adapter's MAC address from the first Receive Address Register - * (RAR0) A reset of the adapter must have been performed prior to calling this - * function in order for the MAC address to have been loaded from the EEPROM - * into RAR0 + * (RAR0) A reset of the adapter must have been performed prior to calling + * this function in order for the MAC address to have been loaded from the + * EEPROM into RAR0 **/ s32 ixgbe_get_mac_addr(struct ixgbe_hw *hw, u8 *mac_addr) { - return ixgbe_call_func(hw, ixgbe_func_get_mac_addr, - (hw, mac_addr), IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.get_mac_addr, + (hw, mac_addr), IXGBE_NOT_IMPLEMENTED); } /** @@ -200,36 +199,34 @@ s32 ixgbe_get_mac_addr(struct ixgbe_hw *hw, u8 *mac_addr) **/ s32 ixgbe_get_bus_info(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_get_bus_info, (hw), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.get_bus_info, (hw), + IXGBE_NOT_IMPLEMENTED); } /** - * ixgbe_get_num_of_tx_queues - Get TX queues + * ixgbe_get_num_of_tx_queues - Get Tx queues * @hw: pointer to hardware structure * * Returns the number of transmit queues for the given adapter. **/ u32 ixgbe_get_num_of_tx_queues(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_get_num_of_tx_queues, - (hw), 0); + return hw->mac.max_tx_queues; } /** - * ixgbe_get_num_of_rx_queues - Get RX queues + * ixgbe_get_num_of_rx_queues - Get Rx queues * @hw: pointer to hardware structure * * Returns the number of receive queues for the given adapter. **/ u32 ixgbe_get_num_of_rx_queues(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_get_num_of_rx_queues, - (hw), 0); + return hw->mac.max_rx_queues; } /** - * ixgbe_stop_adapter - Disable TX/TX units + * ixgbe_stop_adapter - Disable Rx/Tx units * @hw: pointer to hardware structure * * Sets the adapter_stopped flag within ixgbe_hw struct. Clears interrupts, @@ -239,8 +236,20 @@ u32 ixgbe_get_num_of_rx_queues(struct ixgbe_hw *hw) **/ s32 ixgbe_stop_adapter(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_stop_adapter, (hw), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.stop_adapter, (hw), + IXGBE_NOT_IMPLEMENTED); +} + +/** + * ixgbe_read_pba_num - Reads part number from EEPROM + * @hw: pointer to hardware structure + * @pba_num: stores the part number from the EEPROM + * + * Reads the part number from the EEPROM. + **/ +s32 ixgbe_read_pba_num(struct ixgbe_hw *hw, u32 *pba_num) +{ + return ixgbe_read_pba_num_generic(hw, pba_num); } /** @@ -255,9 +264,9 @@ s32 ixgbe_identify_phy(struct ixgbe_hw *hw) if (hw->phy.type == ixgbe_phy_unknown) { status = ixgbe_call_func(hw, - ixgbe_func_identify_phy, - (hw), - IXGBE_NOT_IMPLEMENTED); + hw->phy.ops.identify, + (hw), + IXGBE_NOT_IMPLEMENTED); } return status; @@ -278,15 +287,28 @@ s32 ixgbe_reset_phy(struct ixgbe_hw *hw) } if (status == IXGBE_SUCCESS) { - status = ixgbe_call_func(hw, - ixgbe_func_reset_phy, - (hw), - IXGBE_NOT_IMPLEMENTED); + status = ixgbe_call_func(hw, hw->phy.ops.reset, (hw), + IXGBE_NOT_IMPLEMENTED); } return status; } /** + * ixgbe_get_phy_firmware_version - + * @hw: pointer to hardware structure + * @firmware_version: pointer to firmware version + **/ +s32 ixgbe_get_phy_firmware_version(struct ixgbe_hw *hw, u16 *firmware_version) +{ + s32 status = IXGBE_SUCCESS; + + status = ixgbe_call_func(hw, hw->phy.ops.get_firmware_version, + (hw, firmware_version), + IXGBE_NOT_IMPLEMENTED); + return status; +} + +/** * ixgbe_read_phy_reg - Read PHY register * @hw: pointer to hardware structure * @reg_addr: 32 bit address of PHY register to read @@ -295,23 +317,10 @@ s32 ixgbe_reset_phy(struct ixgbe_hw *hw) * Reads a value from a specified PHY register **/ s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, - u16 *phy_data) + u16 *phy_data) { - s32 status = IXGBE_SUCCESS; - - if (hw->phy.type == ixgbe_phy_unknown) { - if (ixgbe_identify_phy(hw) != IXGBE_SUCCESS) { - status = IXGBE_ERR_PHY; - } - } - - if (status == IXGBE_SUCCESS) { - status = ixgbe_call_func(hw, - ixgbe_func_read_phy_reg, - (hw, reg_addr, device_type, phy_data), - IXGBE_NOT_IMPLEMENTED); - } - return status; + return ixgbe_call_func(hw, hw->phy.ops.read_reg, (hw, reg_addr, + device_type, phy_data), IXGBE_NOT_IMPLEMENTED); } /** @@ -323,23 +332,53 @@ s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, * Writes a value to specified PHY register **/ s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, - u16 phy_data) + u16 phy_data) { - s32 status = IXGBE_SUCCESS; + return ixgbe_call_func(hw, hw->phy.ops.write_reg, (hw, reg_addr, + device_type, phy_data), IXGBE_NOT_IMPLEMENTED); +} - if (hw->phy.type == ixgbe_phy_unknown) { - if (ixgbe_identify_phy(hw) != IXGBE_SUCCESS) { - status = IXGBE_ERR_PHY; - } - } +/** + * ixgbe_setup_phy_link - Restart PHY autoneg + * @hw: pointer to hardware structure + * + * Restart autonegotiation and PHY and waits for completion. + **/ +s32 ixgbe_setup_phy_link(struct ixgbe_hw *hw) +{ + return ixgbe_call_func(hw, hw->phy.ops.setup_link, (hw), + IXGBE_NOT_IMPLEMENTED); +} - if (status == IXGBE_SUCCESS) { - status = ixgbe_call_func(hw, - ixgbe_func_write_phy_reg, - (hw, reg_addr, device_type, phy_data), - IXGBE_NOT_IMPLEMENTED); - } - return status; +/** + * ixgbe_check_phy_link - Determine link and speed status + * @hw: pointer to hardware structure + * + * Reads a PHY register to determine if link is up and the current speed for + * the PHY. + **/ +s32 ixgbe_check_phy_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed, + bool *link_up) +{ + return ixgbe_call_func(hw, hw->phy.ops.check_link, (hw, speed, + link_up), IXGBE_NOT_IMPLEMENTED); +} + +/** + * ixgbe_setup_phy_link_speed - Set auto advertise + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg: TRUE if autonegotiation enabled + * + * Sets the auto advertised capabilities + **/ +s32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed, + bool autoneg, + bool autoneg_wait_to_complete) +{ + return ixgbe_call_func(hw, hw->phy.ops.setup_link_speed, (hw, speed, + autoneg, autoneg_wait_to_complete), + IXGBE_NOT_IMPLEMENTED); } /** @@ -351,8 +390,8 @@ s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, **/ s32 ixgbe_setup_link(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_setup_link, (hw), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.setup_link, (hw), + IXGBE_NOT_IMPLEMENTED); } /** @@ -362,10 +401,11 @@ s32 ixgbe_setup_link(struct ixgbe_hw *hw) * Reads the links register to determine if link is up and the current speed **/ s32 ixgbe_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed, - bool *link_up) + bool *link_up, bool link_up_wait_to_complete) { - return ixgbe_call_func(hw, ixgbe_func_check_link, (hw, speed, link_up), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.check_link, (hw, speed, + link_up, link_up_wait_to_complete), + IXGBE_NOT_IMPLEMENTED); } /** @@ -377,29 +417,29 @@ s32 ixgbe_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed, * Set the link speed and restarts the link. **/ s32 ixgbe_setup_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed, - bool autoneg, - bool autoneg_wait_to_complete) + bool autoneg, + bool autoneg_wait_to_complete) { - return ixgbe_call_func(hw, ixgbe_func_setup_link_speed, (hw, speed, - autoneg, autoneg_wait_to_complete), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.setup_link_speed, (hw, speed, + autoneg, autoneg_wait_to_complete), + IXGBE_NOT_IMPLEMENTED); } /** - * ixgbe_get_link_settings - Set link settings to default + * ixgbe_get_link_capabilities - Returns link capabilities * @hw: pointer to hardware structure * - * Sets the default link settings based on attach type in the hw struct. + * Determines the link capabilities of the current configuration. **/ -s32 ixgbe_get_link_settings(struct ixgbe_hw *hw, ixgbe_link_speed *speed, - bool *autoneg) +s32 ixgbe_get_link_capabilities(struct ixgbe_hw *hw, ixgbe_link_speed *speed, + bool *autoneg) { - return ixgbe_call_func(hw, ixgbe_func_get_link_settings, (hw, speed, - autoneg), IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.get_link_capabilities, (hw, + speed, autoneg), IXGBE_NOT_IMPLEMENTED); } /** - * ixgbe_led_on - Turn on LED's + * ixgbe_led_on - Turn on LEDs * @hw: pointer to hardware structure * @index: led number to turn on * @@ -407,12 +447,12 @@ s32 ixgbe_get_link_settings(struct ixgbe_hw *hw, ixgbe_link_speed *speed, **/ s32 ixgbe_led_on(struct ixgbe_hw *hw, u32 index) { - return ixgbe_call_func(hw, ixgbe_func_led_on, (hw, index), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.led_on, (hw, index), + IXGBE_NOT_IMPLEMENTED); } /** - * ixgbe_led_off - Turn off LED's + * ixgbe_led_off - Turn off LEDs * @hw: pointer to hardware structure * @index: led number to turn off * @@ -420,12 +460,12 @@ s32 ixgbe_led_on(struct ixgbe_hw *hw, u32 index) **/ s32 ixgbe_led_off(struct ixgbe_hw *hw, u32 index) { - return ixgbe_call_func(hw, ixgbe_func_led_off, (hw, index), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.led_off, (hw, index), + IXGBE_NOT_IMPLEMENTED); } /** - * ixgbe_blink_led_start - Blink LED's + * ixgbe_blink_led_start - Blink LEDs * @hw: pointer to hardware structure * @index: led number to blink * @@ -433,24 +473,24 @@ s32 ixgbe_led_off(struct ixgbe_hw *hw, u32 index) **/ s32 ixgbe_blink_led_start(struct ixgbe_hw *hw, u32 index) { - return ixgbe_call_func(hw, ixgbe_func_blink_led_start, (hw, index), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.blink_led_start, (hw, index), + IXGBE_NOT_IMPLEMENTED); } /** - * ixgbe_blink_led_stop - Stop blinking LED's + * ixgbe_blink_led_stop - Stop blinking LEDs * @hw: pointer to hardware structure * * Stop blinking LED based on index. **/ s32 ixgbe_blink_led_stop(struct ixgbe_hw *hw, u32 index) { - return ixgbe_call_func(hw, ixgbe_func_blink_led_stop, (hw, index), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.blink_led_stop, (hw, index), + IXGBE_NOT_IMPLEMENTED); } /** - * ixgbe_init_eeprom_params - Initialiaze EEPROM parameters + * ixgbe_init_eeprom_params - Initialize EEPROM parameters * @hw: pointer to hardware structure * * Initializes the EEPROM parameters ixgbe_eeprom_info within the @@ -458,8 +498,8 @@ s32 ixgbe_blink_led_stop(struct ixgbe_hw *hw, u32 index) **/ s32 ixgbe_init_eeprom_params(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_init_eeprom_params, (hw), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->eeprom.ops.init_params, (hw), + IXGBE_NOT_IMPLEMENTED); } @@ -475,25 +515,8 @@ s32 ixgbe_init_eeprom_params(struct ixgbe_hw *hw) **/ s32 ixgbe_write_eeprom(struct ixgbe_hw *hw, u16 offset, u16 data) { - s32 status; - - /* - * Initialize EEPROM parameters. This will not do anything if the - * EEPROM structure has already been initialized - */ - ixgbe_init_eeprom_params(hw); - - /* Check for invalid offset */ - if (offset >= hw->eeprom.word_size) { - status = IXGBE_ERR_EEPROM; - } else { - status = ixgbe_call_func(hw, - ixgbe_func_write_eeprom, - (hw, offset, data), - IXGBE_NOT_IMPLEMENTED); - } - - return status; + return ixgbe_call_func(hw, hw->eeprom.ops.write, (hw, offset, data), + IXGBE_NOT_IMPLEMENTED); } /** @@ -506,25 +529,8 @@ s32 ixgbe_write_eeprom(struct ixgbe_hw *hw, u16 offset, u16 data) **/ s32 ixgbe_read_eeprom(struct ixgbe_hw *hw, u16 offset, u16 *data) { - s32 status; - - /* - * Initialize EEPROM parameters. This will not do anything if the - * EEPROM structure has already been initialized - */ - ixgbe_init_eeprom_params(hw); - - /* Check for invalid offset */ - if (offset >= hw->eeprom.word_size) { - status = IXGBE_ERR_EEPROM; - } else { - status = ixgbe_call_func(hw, - ixgbe_func_read_eeprom, - (hw, offset, data), - IXGBE_NOT_IMPLEMENTED); - } - - return status; + return ixgbe_call_func(hw, hw->eeprom.ops.read, (hw, offset, data), + IXGBE_NOT_IMPLEMENTED); } /** @@ -536,8 +542,8 @@ s32 ixgbe_read_eeprom(struct ixgbe_hw *hw, u16 offset, u16 *data) **/ s32 ixgbe_validate_eeprom_checksum(struct ixgbe_hw *hw, u16 *checksum_val) { - return ixgbe_call_func(hw, ixgbe_func_validate_eeprom_checksum, - (hw, checksum_val), IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->eeprom.ops.validate_checksum, + (hw, checksum_val), IXGBE_NOT_IMPLEMENTED); } /** @@ -546,25 +552,37 @@ s32 ixgbe_validate_eeprom_checksum(struct ixgbe_hw *hw, u16 *checksum_val) **/ s32 ixgbe_update_eeprom_checksum(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_update_eeprom_checksum, (hw), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->eeprom.ops.update_checksum, (hw), + IXGBE_NOT_IMPLEMENTED); } /** - * ixgbe_set_rar - Set RX address register + * ixgbe_set_rar - Set Rx address register * @hw: pointer to hardware structure - * @addr: Address to put into receive address register * @index: Receive address register to write - * @vind: Vind to set RAR to + * @addr: Address to put into receive address register + * @vmdq: VMDq "set" * @enable_addr: set flag that address is active * * Puts an ethernet address into a receive address register. **/ -s32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vind, - u32 enable_addr) +s32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq, + u32 enable_addr) { - return ixgbe_call_func(hw, ixgbe_func_set_rar, (hw, index, addr, vind, - enable_addr), IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.set_rar, (hw, index, addr, vmdq, + enable_addr), IXGBE_NOT_IMPLEMENTED); +} + +/** + * ixgbe_set_vmdq - Associate a VMDq index with a receive address + * @hw: pointer to hardware structure + * @rar: receive address register index to associate with VMDq index + * @vmdq: VMDq set or pool index + **/ +s32 ixgbe_set_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq) +{ + return ixgbe_call_func(hw, hw->mac.ops.set_vmdq, (hw, rar, vmdq), + IXGBE_NOT_IMPLEMENTED); } /** @@ -572,13 +590,13 @@ s32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vind, * @hw: pointer to hardware structure * * Places the MAC address in receive address register 0 and clears the rest - * of the receive addresss registers. Clears the multicast table. Assumes + * of the receive address registers. Clears the multicast table. Assumes * the receiver is in reset when the routine is called. **/ s32 ixgbe_init_rx_addrs(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_init_rx_addrs, (hw), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.init_rx_addrs, (hw), + IXGBE_NOT_IMPLEMENTED); } /** @@ -587,7 +605,26 @@ s32 ixgbe_init_rx_addrs(struct ixgbe_hw *hw) **/ u32 ixgbe_get_num_rx_addrs(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_get_num_rx_addrs, (hw), 0); + return hw->mac.num_rar_entries; +} + +/** + * ixgbe_update_uc_addr_list - Updates the MAC's list of secondary addresses + * @hw: pointer to hardware structure + * @addr_list: the list of new multicast addresses + * @addr_count: number of addresses + * @func: iterator function to walk the multicast address list + * + * The given list replaces any existing list. Clears the secondary addrs from + * receive address registers. Uses unused receive address registers for the + * first secondary addresses, and falls back to promiscuous mode as needed. + **/ +s32 ixgbe_update_uc_addr_list(struct ixgbe_hw *hw, u8 *addr_list, + u32 addr_count, ixgbe_mc_addr_itr func) +{ + return ixgbe_call_func(hw, hw->mac.ops.update_uc_addr_list, (hw, + addr_list, addr_count, func), + IXGBE_NOT_IMPLEMENTED); } /** @@ -595,19 +632,19 @@ u32 ixgbe_get_num_rx_addrs(struct ixgbe_hw *hw) * @hw: pointer to hardware structure * @mc_addr_list: the list of new multicast addresses * @mc_addr_count: number of addresses - * @pad: number of bytes between addresses in the list + * @func: iterator function to walk the multicast address list * * The given list replaces any existing list. Clears the MC addrs from receive - * address registers and the multicast table. Uses unsed receive address + * address registers and the multicast table. Uses unused receive address * registers for the first multicast addresses, and hashes the rest into the * multicast table. **/ s32 ixgbe_update_mc_addr_list(struct ixgbe_hw *hw, u8 *mc_addr_list, - u32 mc_addr_count, u32 pad) + u32 mc_addr_count, ixgbe_mc_addr_itr func) { - return ixgbe_call_func(hw, ixgbe_func_update_mc_addr_list, (hw, - mc_addr_list, mc_addr_count, pad), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.update_mc_addr_list, (hw, + mc_addr_list, mc_addr_count, func), + IXGBE_NOT_IMPLEMENTED); } /** @@ -618,8 +655,8 @@ s32 ixgbe_update_mc_addr_list(struct ixgbe_hw *hw, u8 *mc_addr_list, **/ s32 ixgbe_enable_mc(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_enable_mc, (hw), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.enable_mc, (hw), + IXGBE_NOT_IMPLEMENTED); } /** @@ -630,8 +667,8 @@ s32 ixgbe_enable_mc(struct ixgbe_hw *hw) **/ s32 ixgbe_disable_mc(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_disable_mc, (hw), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.disable_mc, (hw), + IXGBE_NOT_IMPLEMENTED); } /** @@ -642,8 +679,8 @@ s32 ixgbe_disable_mc(struct ixgbe_hw *hw) **/ s32 ixgbe_clear_vfta(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, ixgbe_func_clear_vfta, (hw), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.clear_vfta, (hw), + IXGBE_NOT_IMPLEMENTED); } /** @@ -657,8 +694,8 @@ s32 ixgbe_clear_vfta(struct ixgbe_hw *hw) **/ s32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on) { - return ixgbe_call_func(hw, ixgbe_func_set_vfta, (hw, vlan, vind, - vlan_on), IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.set_vfta, (hw, vlan, vind, + vlan_on), IXGBE_NOT_IMPLEMENTED); } /** @@ -670,11 +707,10 @@ s32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on) **/ s32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num) { - return ixgbe_call_func(hw, ixgbe_func_setup_fc, (hw, packetbuf_num), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.setup_fc, (hw, packetbuf_num), + IXGBE_NOT_IMPLEMENTED); } - /** * ixgbe_read_analog_reg8 - Reads 8 bit analog register * @hw: pointer to hardware structure @@ -685,8 +721,8 @@ s32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num) **/ s32 ixgbe_read_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 *val) { - return ixgbe_call_func(hw, ixgbe_func_read_analog_reg8, (hw, reg, val), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.read_analog_reg8, (hw, reg, + val), IXGBE_NOT_IMPLEMENTED); } /** @@ -699,7 +735,7 @@ s32 ixgbe_read_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 *val) **/ s32 ixgbe_write_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 val) { - return ixgbe_call_func(hw, ixgbe_func_write_analog_reg8, (hw, reg, val), - IXGBE_NOT_IMPLEMENTED); + return ixgbe_call_func(hw, hw->mac.ops.write_analog_reg8, (hw, reg, + val), IXGBE_NOT_IMPLEMENTED); } |