Lines Matching +full:hw +full:- +full:device +full:- +full:address

1 /*-
4 * SPDX-License-Identifier: BSD-3-Clause
11 * igc_init_mac_params - Initialize MAC function pointers
12 * @hw: pointer to the HW structure
17 s32 igc_init_mac_params(struct igc_hw *hw) in igc_init_mac_params() argument
21 if (hw->mac.ops.init_params) { in igc_init_mac_params()
22 ret_val = hw->mac.ops.init_params(hw); in igc_init_mac_params()
29 ret_val = -IGC_ERR_CONFIG; in igc_init_mac_params()
37 * igc_init_nvm_params - Initialize NVM function pointers
38 * @hw: pointer to the HW structure
43 s32 igc_init_nvm_params(struct igc_hw *hw) in igc_init_nvm_params() argument
47 if (hw->nvm.ops.init_params) { in igc_init_nvm_params()
48 ret_val = hw->nvm.ops.init_params(hw); in igc_init_nvm_params()
55 ret_val = -IGC_ERR_CONFIG; in igc_init_nvm_params()
63 * igc_init_phy_params - Initialize PHY function pointers
64 * @hw: pointer to the HW structure
69 s32 igc_init_phy_params(struct igc_hw *hw) in igc_init_phy_params() argument
73 if (hw->phy.ops.init_params) { in igc_init_phy_params()
74 ret_val = hw->phy.ops.init_params(hw); in igc_init_phy_params()
81 ret_val = -IGC_ERR_CONFIG; in igc_init_phy_params()
89 * igc_set_mac_type - Sets MAC type
90 * @hw: pointer to the HW structure
93 * device ID stored in the hw structure.
97 s32 igc_set_mac_type(struct igc_hw *hw) in igc_set_mac_type() argument
99 struct igc_mac_info *mac = &hw->mac; in igc_set_mac_type()
104 switch (hw->device_id) { in igc_set_mac_type()
121 mac->type = igc_i225; in igc_set_mac_type()
124 /* Should never have loaded on this device */ in igc_set_mac_type()
125 ret_val = -IGC_ERR_MAC_INIT; in igc_set_mac_type()
133 * igc_setup_init_funcs - Initializes function pointers
134 * @hw: pointer to the HW structure
136 * getting the device ready for use. FALSE will only set
144 s32 igc_setup_init_funcs(struct igc_hw *hw, bool init_device) in igc_setup_init_funcs() argument
149 ret_val = igc_set_mac_type(hw); in igc_setup_init_funcs()
155 if (!hw->hw_addr) { in igc_setup_init_funcs()
157 ret_val = -IGC_ERR_CONFIG; in igc_setup_init_funcs()
165 igc_init_mac_ops_generic(hw); in igc_setup_init_funcs()
166 igc_init_phy_ops_generic(hw); in igc_setup_init_funcs()
167 igc_init_nvm_ops_generic(hw); in igc_setup_init_funcs()
174 switch (hw->mac.type) { in igc_setup_init_funcs()
176 igc_init_function_pointers_i225(hw); in igc_setup_init_funcs()
180 ret_val = -IGC_ERR_CONFIG; in igc_setup_init_funcs()
189 ret_val = igc_init_mac_params(hw); in igc_setup_init_funcs()
193 ret_val = igc_init_nvm_params(hw); in igc_setup_init_funcs()
197 ret_val = igc_init_phy_params(hw); in igc_setup_init_funcs()
207 * igc_get_bus_info - Obtain bus information for adapter
208 * @hw: pointer to the HW structure
210 * This will obtain information about the HW bus for which the
211 * adapter is attached and stores it in the hw structure. This is a
214 s32 igc_get_bus_info(struct igc_hw *hw) in igc_get_bus_info() argument
216 if (hw->mac.ops.get_bus_info) in igc_get_bus_info()
217 return hw->mac.ops.get_bus_info(hw); in igc_get_bus_info()
223 * igc_clear_vfta - Clear VLAN filter table
224 * @hw: pointer to the HW structure
229 void igc_clear_vfta(struct igc_hw *hw) in igc_clear_vfta() argument
231 if (hw->mac.ops.clear_vfta) in igc_clear_vfta()
232 hw->mac.ops.clear_vfta(hw); in igc_clear_vfta()
236 * igc_write_vfta - Write value to VLAN filter table
237 * @hw: pointer to the HW structure
238 * @offset: the 32-bit offset in which to write the value to.
239 * @value: the 32-bit value to write at location offset.
241 * This writes a 32-bit value to a 32-bit offset in the VLAN filter
244 void igc_write_vfta(struct igc_hw *hw, u32 offset, u32 value) in igc_write_vfta() argument
246 if (hw->mac.ops.write_vfta) in igc_write_vfta()
247 hw->mac.ops.write_vfta(hw, offset, value); in igc_write_vfta()
251 * igc_update_mc_addr_list - Update Multicast addresses
252 * @hw: pointer to the HW structure
259 void igc_update_mc_addr_list(struct igc_hw *hw, u8 *mc_addr_list, in igc_update_mc_addr_list() argument
262 if (hw->mac.ops.update_mc_addr_list) in igc_update_mc_addr_list()
263 hw->mac.ops.update_mc_addr_list(hw, mc_addr_list, in igc_update_mc_addr_list()
268 * igc_force_mac_fc - Force MAC flow control
269 * @hw: pointer to the HW structure
275 s32 igc_force_mac_fc(struct igc_hw *hw) in igc_force_mac_fc() argument
277 return igc_force_mac_fc_generic(hw); in igc_force_mac_fc()
281 * igc_check_for_link - Check/Store link connection
282 * @hw: pointer to the HW structure
285 * results in the hw->mac structure. This is a function pointer entry
288 s32 igc_check_for_link(struct igc_hw *hw) in igc_check_for_link() argument
290 if (hw->mac.ops.check_for_link) in igc_check_for_link()
291 return hw->mac.ops.check_for_link(hw); in igc_check_for_link()
293 return -IGC_ERR_CONFIG; in igc_check_for_link()
297 * igc_reset_hw - Reset hardware
298 * @hw: pointer to the HW structure
303 s32 igc_reset_hw(struct igc_hw *hw) in igc_reset_hw() argument
305 if (hw->mac.ops.reset_hw) in igc_reset_hw()
306 return hw->mac.ops.reset_hw(hw); in igc_reset_hw()
308 return -IGC_ERR_CONFIG; in igc_reset_hw()
312 * igc_init_hw - Initialize hardware
313 * @hw: pointer to the HW structure
318 s32 igc_init_hw(struct igc_hw *hw) in igc_init_hw() argument
320 if (hw->mac.ops.init_hw) in igc_init_hw()
321 return hw->mac.ops.init_hw(hw); in igc_init_hw()
323 return -IGC_ERR_CONFIG; in igc_init_hw()
327 * igc_setup_link - Configures link and flow control
328 * @hw: pointer to the HW structure
334 s32 igc_setup_link(struct igc_hw *hw) in igc_setup_link() argument
336 if (hw->mac.ops.setup_link) in igc_setup_link()
337 return hw->mac.ops.setup_link(hw); in igc_setup_link()
339 return -IGC_ERR_CONFIG; in igc_setup_link()
343 * igc_get_speed_and_duplex - Returns current speed and duplex
344 * @hw: pointer to the HW structure
345 * @speed: pointer to a 16-bit value to store the speed
346 * @duplex: pointer to a 16-bit value to store the duplex.
352 s32 igc_get_speed_and_duplex(struct igc_hw *hw, u16 *speed, u16 *duplex) in igc_get_speed_and_duplex() argument
354 if (hw->mac.ops.get_link_up_info) in igc_get_speed_and_duplex()
355 return hw->mac.ops.get_link_up_info(hw, speed, duplex); in igc_get_speed_and_duplex()
357 return -IGC_ERR_CONFIG; in igc_get_speed_and_duplex()
361 * igc_disable_pcie_master - Disable PCI-Express master access
362 * @hw: pointer to the HW structure
364 * Disables PCI-Express master access and verifies there are no pending
368 s32 igc_disable_pcie_master(struct igc_hw *hw) in igc_disable_pcie_master() argument
370 return igc_disable_pcie_master_generic(hw); in igc_disable_pcie_master()
374 * igc_config_collision_dist - Configure collision distance
375 * @hw: pointer to the HW structure
380 void igc_config_collision_dist(struct igc_hw *hw) in igc_config_collision_dist() argument
382 if (hw->mac.ops.config_collision_dist) in igc_config_collision_dist()
383 hw->mac.ops.config_collision_dist(hw); in igc_config_collision_dist()
387 * igc_rar_set - Sets a receive address register
388 * @hw: pointer to the HW structure
389 * @addr: address to set the RAR to
392 * Sets a Receive Address Register (RAR) to the specified address.
394 int igc_rar_set(struct igc_hw *hw, u8 *addr, u32 index) in igc_rar_set() argument
396 if (hw->mac.ops.rar_set) in igc_rar_set()
397 return hw->mac.ops.rar_set(hw, addr, index); in igc_rar_set()
403 * igc_validate_mdi_setting - Ensures valid MDI/MDIX SW state
404 * @hw: pointer to the HW structure
408 s32 igc_validate_mdi_setting(struct igc_hw *hw) in igc_validate_mdi_setting() argument
410 if (hw->mac.ops.validate_mdi_setting) in igc_validate_mdi_setting()
411 return hw->mac.ops.validate_mdi_setting(hw); in igc_validate_mdi_setting()
417 * igc_hash_mc_addr - Determines address location in multicast table
418 * @hw: pointer to the HW structure
419 * @mc_addr: Multicast address to hash.
421 * This hashes an address to determine its location in the multicast
425 u32 igc_hash_mc_addr(struct igc_hw *hw, u8 *mc_addr) in igc_hash_mc_addr() argument
427 return igc_hash_mc_addr_generic(hw, mc_addr); in igc_hash_mc_addr()
431 * igc_check_reset_block - Verifies PHY can be reset
432 * @hw: pointer to the HW structure
437 s32 igc_check_reset_block(struct igc_hw *hw) in igc_check_reset_block() argument
439 if (hw->phy.ops.check_reset_block) in igc_check_reset_block()
440 return hw->phy.ops.check_reset_block(hw); in igc_check_reset_block()
446 * igc_read_phy_reg - Reads PHY register
447 * @hw: pointer to the HW structure
449 * @data: the buffer to store the 16-bit read.
454 s32 igc_read_phy_reg(struct igc_hw *hw, u32 offset, u16 *data) in igc_read_phy_reg() argument
456 if (hw->phy.ops.read_reg) in igc_read_phy_reg()
457 return hw->phy.ops.read_reg(hw, offset, data); in igc_read_phy_reg()
463 * igc_write_phy_reg - Writes PHY register
464 * @hw: pointer to the HW structure
471 s32 igc_write_phy_reg(struct igc_hw *hw, u32 offset, u16 data) in igc_write_phy_reg() argument
473 if (hw->phy.ops.write_reg) in igc_write_phy_reg()
474 return hw->phy.ops.write_reg(hw, offset, data); in igc_write_phy_reg()
480 * igc_release_phy - Generic release PHY
481 * @hw: pointer to the HW structure
486 void igc_release_phy(struct igc_hw *hw) in igc_release_phy() argument
488 if (hw->phy.ops.release) in igc_release_phy()
489 hw->phy.ops.release(hw); in igc_release_phy()
493 * igc_acquire_phy - Generic acquire PHY
494 * @hw: pointer to the HW structure
499 s32 igc_acquire_phy(struct igc_hw *hw) in igc_acquire_phy() argument
501 if (hw->phy.ops.acquire) in igc_acquire_phy()
502 return hw->phy.ops.acquire(hw); in igc_acquire_phy()
508 * igc_get_phy_info - Retrieves PHY information from registers
509 * @hw: pointer to the HW structure
512 * populates hw->phy values with it. This is a function pointer entry
515 s32 igc_get_phy_info(struct igc_hw *hw) in igc_get_phy_info() argument
517 if (hw->phy.ops.get_info) in igc_get_phy_info()
518 return hw->phy.ops.get_info(hw); in igc_get_phy_info()
524 * igc_phy_hw_reset - Hard PHY reset
525 * @hw: pointer to the HW structure
530 s32 igc_phy_hw_reset(struct igc_hw *hw) in igc_phy_hw_reset() argument
532 if (hw->phy.ops.reset) in igc_phy_hw_reset()
533 return hw->phy.ops.reset(hw); in igc_phy_hw_reset()
539 * igc_set_d0_lplu_state - Sets low power link up state for D0
540 * @hw: pointer to the HW structure
552 s32 igc_set_d0_lplu_state(struct igc_hw *hw, bool active) in igc_set_d0_lplu_state() argument
554 if (hw->phy.ops.set_d0_lplu_state) in igc_set_d0_lplu_state()
555 return hw->phy.ops.set_d0_lplu_state(hw, active); in igc_set_d0_lplu_state()
561 * igc_set_d3_lplu_state - Sets low power link up state for D3
562 * @hw: pointer to the HW structure
574 s32 igc_set_d3_lplu_state(struct igc_hw *hw, bool active) in igc_set_d3_lplu_state() argument
576 if (hw->phy.ops.set_d3_lplu_state) in igc_set_d3_lplu_state()
577 return hw->phy.ops.set_d3_lplu_state(hw, active); in igc_set_d3_lplu_state()
583 * igc_read_mac_addr - Reads MAC address
584 * @hw: pointer to the HW structure
586 * Reads the MAC address out of the adapter and stores it in the HW structure.
590 s32 igc_read_mac_addr(struct igc_hw *hw) in igc_read_mac_addr() argument
592 if (hw->mac.ops.read_mac_addr) in igc_read_mac_addr()
593 return hw->mac.ops.read_mac_addr(hw); in igc_read_mac_addr()
595 return igc_read_mac_addr_generic(hw); in igc_read_mac_addr()
599 * igc_read_pba_string - Read device part number string
600 * @hw: pointer to the HW structure
601 * @pba_num: pointer to device part number
609 s32 igc_read_pba_string(struct igc_hw *hw, u8 *pba_num, u32 pba_num_size) in igc_read_pba_string() argument
611 return igc_read_pba_string_generic(hw, pba_num, pba_num_size); in igc_read_pba_string()
615 * igc_validate_nvm_checksum - Verifies NVM (EEPROM) checksum
616 * @hw: pointer to the HW structure
621 s32 igc_validate_nvm_checksum(struct igc_hw *hw) in igc_validate_nvm_checksum() argument
623 if (hw->nvm.ops.validate) in igc_validate_nvm_checksum()
624 return hw->nvm.ops.validate(hw); in igc_validate_nvm_checksum()
626 return -IGC_ERR_CONFIG; in igc_validate_nvm_checksum()
630 * igc_update_nvm_checksum - Updates NVM (EEPROM) checksum
631 * @hw: pointer to the HW structure
636 s32 igc_update_nvm_checksum(struct igc_hw *hw) in igc_update_nvm_checksum() argument
638 if (hw->nvm.ops.update) in igc_update_nvm_checksum()
639 return hw->nvm.ops.update(hw); in igc_update_nvm_checksum()
641 return -IGC_ERR_CONFIG; in igc_update_nvm_checksum()
645 * igc_reload_nvm - Reloads EEPROM
646 * @hw: pointer to the HW structure
651 void igc_reload_nvm(struct igc_hw *hw) in igc_reload_nvm() argument
653 if (hw->nvm.ops.reload) in igc_reload_nvm()
654 hw->nvm.ops.reload(hw); in igc_reload_nvm()
658 * igc_read_nvm - Reads NVM (EEPROM)
659 * @hw: pointer to the HW structure
661 * @words: number of 16-bit words to read
664 * Reads 16-bit chunks of data from the NVM (EEPROM). This is a function
667 s32 igc_read_nvm(struct igc_hw *hw, u16 offset, u16 words, u16 *data) in igc_read_nvm() argument
669 if (hw->nvm.ops.read) in igc_read_nvm()
670 return hw->nvm.ops.read(hw, offset, words, data); in igc_read_nvm()
672 return -IGC_ERR_CONFIG; in igc_read_nvm()
676 * igc_write_nvm - Writes to NVM (EEPROM)
677 * @hw: pointer to the HW structure
679 * @words: number of 16-bit words to write
682 * Writes 16-bit chunks of data to the NVM (EEPROM). This is a function
685 s32 igc_write_nvm(struct igc_hw *hw, u16 offset, u16 words, u16 *data) in igc_write_nvm() argument
687 if (hw->nvm.ops.write) in igc_write_nvm()
688 return hw->nvm.ops.write(hw, offset, words, data); in igc_write_nvm()
694 * igc_power_up_phy - Restores link in case of PHY power down
695 * @hw: pointer to the HW structure
700 void igc_power_up_phy(struct igc_hw *hw) in igc_power_up_phy() argument
702 if (hw->phy.ops.power_up) in igc_power_up_phy()
703 hw->phy.ops.power_up(hw); in igc_power_up_phy()
705 igc_setup_link(hw); in igc_power_up_phy()
709 * igc_power_down_phy - Power down PHY
710 * @hw: pointer to the HW structure
715 void igc_power_down_phy(struct igc_hw *hw) in igc_power_down_phy() argument
717 if (hw->phy.ops.power_down) in igc_power_down_phy()
718 hw->phy.ops.power_down(hw); in igc_power_down_phy()