drivers/net/ethernet/intel/ixgbevf/vf.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ixgbevf/vf.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ixgbevf/vf.c- Extension
.c- Size
- 31890 bytes
- Lines
- 1215
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
vf.hixgbevf.h
Detected Declarations
function ixgbevf_write_msg_read_ackfunction ixgbevf_start_hw_vffunction ixgbevf_init_hw_vffunction ixgbevf_reset_hw_vffunction ixgbevf_hv_reset_hw_vffunction ixgbevf_stop_hw_vffunction ixgbevf_mta_vectorfunction ixgbevf_get_mac_addr_vffunction ixgbevf_set_uc_addr_vffunction ixgbevf_hv_set_uc_addr_vffunction ixgbevf_get_reta_lockedfunction ixgbevf_get_rss_key_lockedfunction ixgbevf_set_rar_vffunction ixgbevf_hv_set_rar_vffunction ixgbevf_update_mc_addr_list_vffunction ixgbevf_hv_update_mc_addr_list_vffunction ixgbevf_update_xcast_modefunction ixgbevf_hv_update_xcast_modefunction ixgbevf_get_link_state_vffunction ixgbevf_hv_get_link_state_vffunction ixgbevf_get_pf_link_statefunction ixgbevf_negotiate_features_vffunction ixgbevf_hv_negotiate_features_vffunction ixgbevf_set_vfta_vffunction ixgbe_read_vflinksfunction ixgbevf_hv_set_vfta_vffunction ixgbevf_setup_mac_link_vffunction ixgbevf_check_mac_link_vffunction ixgbevf_hv_check_mac_link_vffunction ixgbevf_set_rlpml_vffunction ixgbevf_hv_set_rlpml_vffunction ixgbevf_negotiate_api_version_vffunction ixgbevf_hv_negotiate_api_version_vffunction ixgbevf_get_queues
Annotated Snippet
if (reg_val & IXGBE_RXDCTL_ENABLE) {
reg_val &= ~IXGBE_RXDCTL_ENABLE;
IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), reg_val);
}
}
IXGBE_WRITE_FLUSH(hw);
/* Clear interrupt mask to stop from interrupts being generated */
IXGBE_WRITE_REG(hw, IXGBE_VTEIMC, IXGBE_VF_IRQ_CLEAR_MASK);
/* Clear any pending interrupts */
IXGBE_READ_REG(hw, IXGBE_VTEICR);
/* Disable the transmit unit. Each queue must be disabled. */
number_of_queues = hw->mac.max_tx_queues;
for (i = 0; i < number_of_queues; i++) {
reg_val = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(i));
if (reg_val & IXGBE_TXDCTL_ENABLE) {
reg_val &= ~IXGBE_TXDCTL_ENABLE;
IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(i), reg_val);
}
}
return 0;
}
/**
* ixgbevf_mta_vector - Determines bit-vector in multicast table to set
* @hw: pointer to hardware structure
* @mc_addr: the multicast address
*
* Extracts the 12 bits, from a multicast address, to determine which
* bit-vector to set in the multicast table. The hardware uses 12 bits, from
* incoming Rx multicast addresses, to determine the bit-vector to check in
* the MTA. Which of the 4 combination, of 12-bits, the hardware uses is set
* by the MO field of the MCSTCTRL. The MO field is set during initialization
* to mc_filter_type.
**/
static s32 ixgbevf_mta_vector(struct ixgbe_hw *hw, u8 *mc_addr)
{
u32 vector = 0;
switch (hw->mac.mc_filter_type) {
case 0: /* use bits [47:36] of the address */
vector = ((mc_addr[4] >> 4) | (((u16)mc_addr[5]) << 4));
break;
case 1: /* use bits [46:35] of the address */
vector = ((mc_addr[4] >> 3) | (((u16)mc_addr[5]) << 5));
break;
case 2: /* use bits [45:34] of the address */
vector = ((mc_addr[4] >> 2) | (((u16)mc_addr[5]) << 6));
break;
case 3: /* use bits [43:32] of the address */
vector = ((mc_addr[4]) | (((u16)mc_addr[5]) << 8));
break;
default: /* Invalid mc_filter_type */
break;
}
/* vector can only be 12-bits or boundary will be exceeded */
vector &= 0xFFF;
return vector;
}
/**
* ixgbevf_get_mac_addr_vf - Read device MAC address
* @hw: pointer to the HW structure
* @mac_addr: pointer to storage for retrieved MAC address
**/
static s32 ixgbevf_get_mac_addr_vf(struct ixgbe_hw *hw, u8 *mac_addr)
{
ether_addr_copy(mac_addr, hw->mac.perm_addr);
return 0;
}
static s32 ixgbevf_set_uc_addr_vf(struct ixgbe_hw *hw, u32 index, u8 *addr)
{
u32 msgbuf[3], msgbuf_chk;
u8 *msg_addr = (u8 *)(&msgbuf[1]);
s32 ret_val;
memset(msgbuf, 0, sizeof(msgbuf));
/* If index is one then this is the start of a new list and needs
* indication to the PF so it can do its own list management.
* If it is zero then that tells the PF to just clear all of
* this VF's macvlans and there is no new list.
*/
msgbuf[0] |= index << IXGBE_VT_MSGINFO_SHIFT;
Annotation
- Immediate include surface: `vf.h`, `ixgbevf.h`.
- Detected declarations: `function ixgbevf_write_msg_read_ack`, `function ixgbevf_start_hw_vf`, `function ixgbevf_init_hw_vf`, `function ixgbevf_reset_hw_vf`, `function ixgbevf_hv_reset_hw_vf`, `function ixgbevf_stop_hw_vf`, `function ixgbevf_mta_vector`, `function ixgbevf_get_mac_addr_vf`, `function ixgbevf_set_uc_addr_vf`, `function ixgbevf_hv_set_uc_addr_vf`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.