Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixgbe/ixgbe_api.c
Show First 20 Lines • Show All 515 Lines • ▼ Show 20 Lines | status = ixgbe_call_func(hw, hw->phy.ops.get_firmware_version, | ||||
IXGBE_NOT_IMPLEMENTED); | IXGBE_NOT_IMPLEMENTED); | ||||
return status; | return status; | ||||
} | } | ||||
/** | /** | ||||
* ixgbe_read_phy_reg - Read PHY register | * ixgbe_read_phy_reg - Read PHY register | ||||
* @hw: pointer to hardware structure | * @hw: pointer to hardware structure | ||||
* @reg_addr: 32 bit address of PHY register to read | * @reg_addr: 32 bit address of PHY register to read | ||||
* @device_type: type of device you want to communicate with | |||||
* @phy_data: Pointer to read data from PHY register | * @phy_data: Pointer to read data from PHY register | ||||
* | * | ||||
* Reads a value from a specified PHY register | * Reads a value from a specified PHY register | ||||
**/ | **/ | ||||
s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, | s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, | ||||
u16 *phy_data) | u16 *phy_data) | ||||
{ | { | ||||
if (hw->phy.id == 0) | if (hw->phy.id == 0) | ||||
ixgbe_identify_phy(hw); | ixgbe_identify_phy(hw); | ||||
return ixgbe_call_func(hw, hw->phy.ops.read_reg, (hw, reg_addr, | return ixgbe_call_func(hw, hw->phy.ops.read_reg, (hw, reg_addr, | ||||
device_type, phy_data), IXGBE_NOT_IMPLEMENTED); | device_type, phy_data), IXGBE_NOT_IMPLEMENTED); | ||||
} | } | ||||
/** | /** | ||||
* ixgbe_write_phy_reg - Write PHY register | * ixgbe_write_phy_reg - Write PHY register | ||||
* @hw: pointer to hardware structure | * @hw: pointer to hardware structure | ||||
* @reg_addr: 32 bit PHY register to write | * @reg_addr: 32 bit PHY register to write | ||||
* @device_type: type of device you want to communicate with | |||||
* @phy_data: Data to write to the PHY register | * @phy_data: Data to write to the PHY register | ||||
* | * | ||||
* Writes a value to specified PHY register | * Writes a value to specified PHY register | ||||
**/ | **/ | ||||
s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, | s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, | ||||
u16 phy_data) | u16 phy_data) | ||||
{ | { | ||||
if (hw->phy.id == 0) | if (hw->phy.id == 0) | ||||
Show All 27 Lines | |||||
{ | { | ||||
return ixgbe_call_func(hw, hw->phy.ops.setup_internal_link, (hw), | return ixgbe_call_func(hw, hw->phy.ops.setup_internal_link, (hw), | ||||
IXGBE_SUCCESS); | IXGBE_SUCCESS); | ||||
} | } | ||||
/** | /** | ||||
* ixgbe_check_phy_link - Determine link and speed status | * ixgbe_check_phy_link - Determine link and speed status | ||||
* @hw: pointer to hardware structure | * @hw: pointer to hardware structure | ||||
* @speed: link speed | |||||
* @link_up: TRUE when link is up | |||||
* | * | ||||
* Reads a PHY register to determine if link is up and the current speed for | * Reads a PHY register to determine if link is up and the current speed for | ||||
* the PHY. | * the PHY. | ||||
**/ | **/ | ||||
s32 ixgbe_check_phy_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed, | s32 ixgbe_check_phy_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed, | ||||
bool *link_up) | bool *link_up) | ||||
{ | { | ||||
return ixgbe_call_func(hw, hw->phy.ops.check_link, (hw, speed, | return ixgbe_call_func(hw, hw->phy.ops.check_link, (hw, speed, | ||||
link_up), IXGBE_NOT_IMPLEMENTED); | link_up), IXGBE_NOT_IMPLEMENTED); | ||||
} | } | ||||
/** | /** | ||||
* ixgbe_setup_phy_link_speed - Set auto advertise | * ixgbe_setup_phy_link_speed - Set auto advertise | ||||
* @hw: pointer to hardware structure | * @hw: pointer to hardware structure | ||||
* @speed: new link speed | * @speed: new link speed | ||||
* @autoneg_wait_to_complete: TRUE when waiting for completion is needed | |||||
* | * | ||||
* Sets the auto advertised capabilities | * Sets the auto advertised capabilities | ||||
**/ | **/ | ||||
s32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed, | s32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed, | ||||
bool autoneg_wait_to_complete) | bool autoneg_wait_to_complete) | ||||
{ | { | ||||
return ixgbe_call_func(hw, hw->phy.ops.setup_link_speed, (hw, speed, | return ixgbe_call_func(hw, hw->phy.ops.setup_link_speed, (hw, speed, | ||||
autoneg_wait_to_complete), | autoneg_wait_to_complete), | ||||
Show All 9 Lines | |||||
{ | { | ||||
return ixgbe_call_func(hw, hw->phy.ops.set_phy_power, (hw, on), | return ixgbe_call_func(hw, hw->phy.ops.set_phy_power, (hw, on), | ||||
IXGBE_NOT_IMPLEMENTED); | IXGBE_NOT_IMPLEMENTED); | ||||
} | } | ||||
/** | /** | ||||
* ixgbe_check_link - Get link and speed status | * ixgbe_check_link - Get link and speed status | ||||
* @hw: pointer to hardware structure | * @hw: pointer to hardware structure | ||||
* @speed: pointer to link speed | |||||
* @link_up: TRUE when link is up | |||||
* @link_up_wait_to_complete: bool used to wait for link up or not | |||||
* | * | ||||
* Reads the links register to determine if link is up and the current speed | * 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, | s32 ixgbe_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed, | ||||
bool *link_up, bool link_up_wait_to_complete) | bool *link_up, bool link_up_wait_to_complete) | ||||
{ | { | ||||
return ixgbe_call_func(hw, hw->mac.ops.check_link, (hw, speed, | return ixgbe_call_func(hw, hw->mac.ops.check_link, (hw, speed, | ||||
link_up, link_up_wait_to_complete), | link_up, link_up_wait_to_complete), | ||||
Show All 37 Lines | void ixgbe_flap_tx_laser(struct ixgbe_hw *hw) | ||||
if (hw->mac.ops.flap_tx_laser) | if (hw->mac.ops.flap_tx_laser) | ||||
hw->mac.ops.flap_tx_laser(hw); | hw->mac.ops.flap_tx_laser(hw); | ||||
} | } | ||||
/** | /** | ||||
* ixgbe_setup_link - Set link speed | * ixgbe_setup_link - Set link speed | ||||
* @hw: pointer to hardware structure | * @hw: pointer to hardware structure | ||||
* @speed: new link speed | * @speed: new link speed | ||||
* @autoneg_wait_to_complete: TRUE when waiting for completion is needed | |||||
* | * | ||||
* Configures link settings. Restarts the link. | * Configures link settings. Restarts the link. | ||||
* Performs autonegotiation if needed. | * Performs autonegotiation if needed. | ||||
**/ | **/ | ||||
s32 ixgbe_setup_link(struct ixgbe_hw *hw, ixgbe_link_speed speed, | s32 ixgbe_setup_link(struct ixgbe_hw *hw, ixgbe_link_speed speed, | ||||
bool autoneg_wait_to_complete) | bool autoneg_wait_to_complete) | ||||
{ | { | ||||
return ixgbe_call_func(hw, hw->mac.ops.setup_link, (hw, speed, | return ixgbe_call_func(hw, hw->mac.ops.setup_link, (hw, speed, | ||||
autoneg_wait_to_complete), | autoneg_wait_to_complete), | ||||
IXGBE_NOT_IMPLEMENTED); | IXGBE_NOT_IMPLEMENTED); | ||||
} | } | ||||
/** | /** | ||||
* ixgbe_setup_mac_link - Set link speed | * ixgbe_setup_mac_link - Set link speed | ||||
* @hw: pointer to hardware structure | * @hw: pointer to hardware structure | ||||
* @speed: new link speed | * @speed: new link speed | ||||
* @autoneg_wait_to_complete: TRUE when waiting for completion is needed | |||||
* | * | ||||
* Configures link settings. Restarts the link. | * Configures link settings. Restarts the link. | ||||
* Performs autonegotiation if needed. | * Performs autonegotiation if needed. | ||||
**/ | **/ | ||||
s32 ixgbe_setup_mac_link(struct ixgbe_hw *hw, ixgbe_link_speed speed, | s32 ixgbe_setup_mac_link(struct ixgbe_hw *hw, ixgbe_link_speed speed, | ||||
bool autoneg_wait_to_complete) | bool autoneg_wait_to_complete) | ||||
{ | { | ||||
return ixgbe_call_func(hw, hw->mac.ops.setup_mac_link, (hw, speed, | return ixgbe_call_func(hw, hw->mac.ops.setup_mac_link, (hw, speed, | ||||
autoneg_wait_to_complete), | autoneg_wait_to_complete), | ||||
IXGBE_NOT_IMPLEMENTED); | IXGBE_NOT_IMPLEMENTED); | ||||
} | } | ||||
/** | /** | ||||
* ixgbe_get_link_capabilities - Returns link capabilities | * ixgbe_get_link_capabilities - Returns link capabilities | ||||
* @hw: pointer to hardware structure | * @hw: pointer to hardware structure | ||||
* @speed: link speed capabilities | |||||
* @autoneg: TRUE when autoneg or autotry is enabled | |||||
* | * | ||||
* Determines the link capabilities of the current configuration. | * Determines the link capabilities of the current configuration. | ||||
**/ | **/ | ||||
s32 ixgbe_get_link_capabilities(struct ixgbe_hw *hw, ixgbe_link_speed *speed, | s32 ixgbe_get_link_capabilities(struct ixgbe_hw *hw, ixgbe_link_speed *speed, | ||||
bool *autoneg) | bool *autoneg) | ||||
{ | { | ||||
return ixgbe_call_func(hw, hw->mac.ops.get_link_capabilities, (hw, | return ixgbe_call_func(hw, hw->mac.ops.get_link_capabilities, (hw, | ||||
speed, autoneg), IXGBE_NOT_IMPLEMENTED); | speed, autoneg), IXGBE_NOT_IMPLEMENTED); | ||||
Show All 36 Lines | |||||
{ | { | ||||
return ixgbe_call_func(hw, hw->mac.ops.blink_led_start, (hw, index), | return ixgbe_call_func(hw, hw->mac.ops.blink_led_start, (hw, index), | ||||
IXGBE_NOT_IMPLEMENTED); | IXGBE_NOT_IMPLEMENTED); | ||||
} | } | ||||
/** | /** | ||||
* ixgbe_blink_led_stop - Stop blinking LEDs | * ixgbe_blink_led_stop - Stop blinking LEDs | ||||
* @hw: pointer to hardware structure | * @hw: pointer to hardware structure | ||||
* @index: led number to stop | |||||
* | * | ||||
* Stop blinking LED based on index. | * Stop blinking LED based on index. | ||||
**/ | **/ | ||||
s32 ixgbe_blink_led_stop(struct ixgbe_hw *hw, u32 index) | s32 ixgbe_blink_led_stop(struct ixgbe_hw *hw, u32 index) | ||||
{ | { | ||||
return ixgbe_call_func(hw, hw->mac.ops.blink_led_stop, (hw, index), | return ixgbe_call_func(hw, hw->mac.ops.blink_led_stop, (hw, index), | ||||
IXGBE_NOT_IMPLEMENTED); | IXGBE_NOT_IMPLEMENTED); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 226 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/** | /** | ||||
* ixgbe_update_mc_addr_list - Updates the MAC's list of multicast addresses | * ixgbe_update_mc_addr_list - Updates the MAC's list of multicast addresses | ||||
* @hw: pointer to hardware structure | * @hw: pointer to hardware structure | ||||
* @mc_addr_list: the list of new multicast addresses | * @mc_addr_list: the list of new multicast addresses | ||||
* @mc_addr_count: number of addresses | * @mc_addr_count: number of addresses | ||||
* @func: iterator function to walk the multicast address list | * @func: iterator function to walk the multicast address list | ||||
* @clear: flag, when set clears the table beforehand | |||||
* | * | ||||
* The given list replaces any existing list. Clears the MC addrs from receive | * The given list replaces any existing list. Clears the MC addrs from receive | ||||
* address registers and the multicast table. Uses unused receive address | * address registers and the multicast table. Uses unused receive address | ||||
* registers for the first multicast addresses, and hashes the rest into the | * registers for the first multicast addresses, and hashes the rest into the | ||||
* multicast table. | * multicast table. | ||||
**/ | **/ | ||||
s32 ixgbe_update_mc_addr_list(struct ixgbe_hw *hw, u8 *mc_addr_list, | s32 ixgbe_update_mc_addr_list(struct ixgbe_hw *hw, u8 *mc_addr_list, | ||||
u32 mc_addr_count, ixgbe_mc_addr_itr func, | u32 mc_addr_count, ixgbe_mc_addr_itr func, | ||||
▲ Show 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
return ixgbe_call_func(hw, hw->mac.ops.setup_eee, (hw, enable_eee), | return ixgbe_call_func(hw, hw->mac.ops.setup_eee, (hw, enable_eee), | ||||
IXGBE_NOT_IMPLEMENTED); | IXGBE_NOT_IMPLEMENTED); | ||||
} | } | ||||
/** | /** | ||||
* ixgbe_set_source_address_pruning - Enable/Disable source address pruning | * ixgbe_set_source_address_pruning - Enable/Disable source address pruning | ||||
* @hw: pointer to hardware structure | * @hw: pointer to hardware structure | ||||
* @enbale: enable or disable source address pruning | * @enable: enable or disable source address pruning | ||||
* @pool: Rx pool - Rx pool to toggle source address pruning | * @pool: Rx pool - Rx pool to toggle source address pruning | ||||
**/ | **/ | ||||
void ixgbe_set_source_address_pruning(struct ixgbe_hw *hw, bool enable, | void ixgbe_set_source_address_pruning(struct ixgbe_hw *hw, bool enable, | ||||
unsigned int pool) | unsigned int pool) | ||||
{ | { | ||||
if (hw->mac.ops.set_source_address_pruning) | if (hw->mac.ops.set_source_address_pruning) | ||||
hw->mac.ops.set_source_address_pruning(hw, enable, pool); | hw->mac.ops.set_source_address_pruning(hw, enable, pool); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 503 Lines • Show Last 20 Lines |