⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e1000_api.c

📁 linux下的网卡驱动
💻 C
📖 第 1 页 / 共 3 页
字号:
 *  Enables packet filtering on transmit packets if manageability is enabled *  and host interface is enabled. *  Currently no func pointer exists and all implementations are handled in the *  generic version of this function. **/boolean_t e1000_enable_tx_pkt_filtering(struct e1000_hw *hw){	return e1000_enable_tx_pkt_filtering_generic(hw);}/** *  e1000_mng_host_if_write - Writes to the manageability host interface *  @hw: pointer to the HW structure *  @buffer: pointer to the host interface buffer *  @length: size of the buffer *  @offset: location in the buffer to write to *  @sum: sum of the data (not checksum) * *  This function writes the buffer content at the offset given on the host if. *  It also does alignment considerations to do the writes in most efficient *  way.  Also fills up the sum of the buffer in *buffer parameter. **/s32 e1000_mng_host_if_write(struct e1000_hw * hw, u8 *buffer, u16 length,                            u16 offset, u8 *sum){	if (hw->func.mng_host_if_write != NULL)		return hw->func.mng_host_if_write(hw, buffer, length, offset,		                                  sum);	else		return E1000_NOT_IMPLEMENTED;}/** *  e1000_mng_write_cmd_header - Writes manageability command header *  @hw: pointer to the HW structure *  @hdr: pointer to the host interface command header * *  Writes the command header after does the checksum calculation. **/s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,                               struct e1000_host_mng_command_header *hdr){	if (hw->func.mng_write_cmd_header != NULL)		return hw->func.mng_write_cmd_header(hw, hdr);	else		return E1000_NOT_IMPLEMENTED;}/** *  e1000_mng_enable_host_if - Checks host interface is enabled *  @hw: pointer to the HW structure * *  Returns E1000_success upon success, else E1000_ERR_HOST_INTERFACE_COMMAND * *  This function checks whether the HOST IF is enabled for command operaton *  and also checks whether the previous command is completed.  It busy waits *  in case of previous command is not completed. **/s32 e1000_mng_enable_host_if(struct e1000_hw * hw){	if (hw->func.mng_enable_host_if != NULL)		return hw->func.mng_enable_host_if(hw);	else		return E1000_NOT_IMPLEMENTED;}/** *  e1000_wait_autoneg - Waits for autonegotiation completion *  @hw: pointer to the HW structure * *  Waits for autoneg to complete. Currently no func pointer exists and all *  implementations are handled in the generic version of this function. **/s32 e1000_wait_autoneg(struct e1000_hw *hw){	if (hw->func.wait_autoneg != NULL)		return hw->func.wait_autoneg(hw);	else		return E1000_SUCCESS;}/** *  e1000_check_reset_block - Verifies PHY can be reset *  @hw: pointer to the HW structure * *  Checks if the PHY is in a state that can be reset or if manageability *  has it tied up. This is a function pointer entry point called by drivers. **/s32 e1000_check_reset_block(struct e1000_hw *hw){	if (hw->func.check_reset_block != NULL)		return hw->func.check_reset_block(hw);	else		return E1000_SUCCESS;}/** *  e1000_read_phy_reg - Reads PHY register *  @hw: pointer to the HW structure *  @offset: the register to read *  @data: the buffer to store the 16-bit read. * *  Reads the PHY register and returns the value in data. *  This is a function pointer entry point called by drivers. **/s32 e1000_read_phy_reg(struct e1000_hw *hw, u32 offset, u16 *data){	if (hw->func.read_phy_reg != NULL)		return hw->func.read_phy_reg(hw, offset, data);	else		return E1000_SUCCESS;}/** *  e1000_write_phy_reg - Writes PHY register *  @hw: pointer to the HW structure *  @offset: the register to write *  @data: the value to write. * *  Writes the PHY register at offset with the value in data. *  This is a function pointer entry point called by drivers. **/s32 e1000_write_phy_reg(struct e1000_hw *hw, u32 offset, u16 data){	if (hw->func.write_phy_reg != NULL)		return hw->func.write_phy_reg(hw, offset, data);	else		return E1000_SUCCESS;}/** *  e1000_read_kmrn_reg - Reads register using Kumeran interface *  @hw: pointer to the HW structure *  @offset: the register to read *  @data: the location to store the 16-bit value read. * *  Reads a register out of the Kumeran interface. Currently no func pointer *  exists and all implementations are handled in the generic version of *  this function. **/s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data){	return e1000_read_kmrn_reg_generic(hw, offset, data);}/** *  e1000_write_kmrn_reg - Writes register using Kumeran interface *  @hw: pointer to the HW structure *  @offset: the register to write *  @data: the value to write. * *  Writes a register to the Kumeran interface. Currently no func pointer *  exists and all implementations are handled in the generic version of *  this function. **/s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data){	return e1000_write_kmrn_reg_generic(hw, offset, data);}/** *  e1000_get_cable_length - Retrieves cable length estimation *  @hw: pointer to the HW structure * *  This function estimates the cable length and stores them in *  hw->phy.min_length and hw->phy.max_length. This is a function pointer *  entry point called by drivers. **/s32 e1000_get_cable_length(struct e1000_hw *hw){	if (hw->func.get_cable_length != NULL)		return hw->func.get_cable_length(hw);	else		return E1000_SUCCESS;}/** *  e1000_get_phy_info - Retrieves PHY information from registers *  @hw: pointer to the HW structure * *  This function gets some information from various PHY registers and *  populates hw->phy values with it. This is a function pointer entry *  point called by drivers. **/s32 e1000_get_phy_info(struct e1000_hw *hw){	if (hw->func.get_phy_info != NULL)		return hw->func.get_phy_info(hw);	else		return E1000_SUCCESS;}/** *  e1000_phy_hw_reset - Hard PHY reset *  @hw: pointer to the HW structure * *  Performs a hard PHY reset. This is a function pointer entry point called *  by drivers. **/s32 e1000_phy_hw_reset(struct e1000_hw *hw){	if (hw->func.reset_phy != NULL)		return hw->func.reset_phy(hw);	else		return E1000_SUCCESS;}/** *  e1000_phy_commit - Soft PHY reset *  @hw: pointer to the HW structure * *  Performs a soft PHY reset on those that apply. This is a function pointer *  entry point called by drivers. **/s32 e1000_phy_commit(struct e1000_hw *hw){	if (hw->func.commit_phy != NULL)		return hw->func.commit_phy(hw);	else		return E1000_SUCCESS;}/** *  e1000_set_d3_lplu_state - Sets low power link up state for D0 *  @hw: pointer to the HW structure *  @active: boolean used to enable/disable lplu * *  Success returns 0, Failure returns 1 * *  The low power link up (lplu) state is set to the power management level D0 *  and SmartSpeed is disabled when active is true, else clear lplu for D0 *  and enable Smartspeed.  LPLU and Smartspeed are mutually exclusive.  LPLU *  is used during Dx states where the power conservation is most important. *  During driver activity, SmartSpeed should be enabled so performance is *  maintained.  This is a function pointer entry point called by drivers. **/s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, boolean_t active){	if (hw->func.set_d0_lplu_state != NULL)		return hw->func.set_d0_lplu_state(hw, active);	else		return E1000_SUCCESS;}/** *  e1000_set_d3_lplu_state - Sets low power link up state for D3 *  @hw: pointer to the HW structure *  @active: boolean used to enable/disable lplu * *  Success returns 0, Failure returns 1 * *  The low power link up (lplu) state is set to the power management level D3 *  and SmartSpeed is disabled when active is true, else clear lplu for D3 *  and enable Smartspeed.  LPLU and Smartspeed are mutually exclusive.  LPLU *  is used during Dx states where the power conservation is most important. *  During driver activity, SmartSpeed should be enabled so performance is *  maintained.  This is a function pointer entry point called by drivers. **/s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, boolean_t active){	if (hw->func.set_d3_lplu_state != NULL)		return hw->func.set_d3_lplu_state(hw, active);	else		return E1000_SUCCESS;}/** *  e1000_read_mac_addr - Reads MAC address *  @hw: pointer to the HW structure * *  Reads the MAC address out of the adapter and stores it in the HW structure. *  Currently no func pointer exists and all implementations are handled in the *  generic version of this function. **/s32 e1000_read_mac_addr(struct e1000_hw *hw){	return e1000_read_mac_addr_generic(hw);}/** *  e1000_read_part_num - Read device part number *  @hw: pointer to the HW structure *  @part_num: pointer to device part number * *  Reads the product board assembly (PBA) number from the EEPROM and stores *  the value in part_num. *  Currently no func pointer exists and all implementations are handled in the *  generic version of this function. **/s32 e1000_read_part_num(struct e1000_hw *hw, u32 *part_num){	return e1000_read_part_num_generic(hw, part_num);}/** *  e1000_validate_nvm_checksum - Verifies NVM (EEPROM) checksum *  @hw: pointer to the HW structure * *  Validates the NVM checksum is correct. This is a function pointer entry *  point called by drivers. **/s32 e1000_validate_nvm_checksum(struct e1000_hw *hw){	if (hw->func.validate_nvm != NULL)		return hw->func.validate_nvm(hw);	else		return -E1000_ERR_CONFIG;}/** *  e1000_update_nvm_checksum - Updates NVM (EEPROM) checksum *  @hw: pointer to the HW structure * *  Updates the NVM checksum. Currently no func pointer exists and all *  implementations are handled in the generic version of this function. **/s32 e1000_update_nvm_checksum(struct e1000_hw *hw){	if (hw->func.update_nvm != NULL)		return hw->func.update_nvm(hw);	else		return -E1000_ERR_CONFIG;}/** *  e1000_reload_nvm - Reloads EEPROM *  @hw: pointer to the HW structure * *  Reloads the EEPROM by setting the "Reinitialize from EEPROM" bit in the *  extended control register. **/void e1000_reload_nvm(struct e1000_hw *hw){	if (hw->func.reload_nvm != NULL)		hw->func.reload_nvm(hw);}/** *  e1000_read_nvm - Reads NVM (EEPROM) *  @hw: pointer to the HW structure *  @offset: the word offset to read *  @words: number of 16-bit words to read *  @data: pointer to the properly sized buffer for the data. * *  Reads 16-bit chunks of data from the NVM (EEPROM). This is a function *  pointer entry point called by drivers. **/s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data){	if (hw->func.read_nvm != NULL)		return hw->func.read_nvm(hw, offset, words, data);	else		return -E1000_ERR_CONFIG;}/** *  e1000_write_nvm - Writes to NVM (EEPROM) *  @hw: pointer to the HW structure *  @offset: the word offset to read *  @words: number of 16-bit words to write *  @data: pointer to the properly sized buffer for the data. * *  Writes 16-bit chunks of data to the NVM (EEPROM). This is a function *  pointer entry point called by drivers. **/s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data){	if (hw->func.write_nvm != NULL)		return hw->func.write_nvm(hw, offset, words, data);	else		return E1000_SUCCESS;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -