drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c- Extension
.c- Size
- 10836 bytes
- Lines
- 438
- 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
linux/pci.hlinux/delay.hixgbe.hixgbe_mbx.h
Detected Declarations
function ixgbe_read_mbxfunction ixgbe_write_mbxfunction ixgbe_check_for_msgfunction ixgbe_check_for_ackfunction ixgbe_check_for_rstfunction ixgbe_poll_for_msgfunction ixgbe_poll_for_ackfunction ixgbe_read_posted_mbxfunction ixgbe_write_posted_mbxfunction ixgbe_check_for_bit_pffunction ixgbe_check_for_msg_pffunction ixgbe_check_for_ack_pffunction ixgbe_check_for_rst_pffunction ixgbe_obtain_mbx_lock_pffunction ixgbe_write_mbx_pffunction ixgbe_read_mbx_pffunction ixgbe_init_mbx_params_pf
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 1999 - 2024 Intel Corporation. */
#include <linux/pci.h>
#include <linux/delay.h>
#include "ixgbe.h"
#include "ixgbe_mbx.h"
/**
* ixgbe_read_mbx - Reads a message from the mailbox
* @hw: pointer to the HW structure
* @msg: The message buffer
* @size: Length of buffer
* @mbx_id: id of mailbox to read
*
* returns SUCCESS if it successfully read message from buffer
**/
int ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
{
struct ixgbe_mbx_info *mbx = &hw->mbx;
/* limit read to size of mailbox */
if (size > mbx->size)
size = mbx->size;
if (!mbx->ops)
return -EIO;
return mbx->ops->read(hw, msg, size, mbx_id);
}
/**
* ixgbe_write_mbx - Write a message to the mailbox
* @hw: pointer to the HW structure
* @msg: The message buffer
* @size: Length of buffer
* @mbx_id: id of mailbox to write
*
* returns SUCCESS if it successfully copied message into the buffer
**/
int ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
{
struct ixgbe_mbx_info *mbx = &hw->mbx;
if (size > mbx->size)
return -EINVAL;
if (!mbx->ops)
return -EIO;
return mbx->ops->write(hw, msg, size, mbx_id);
}
/**
* ixgbe_check_for_msg - checks to see if someone sent us mail
* @hw: pointer to the HW structure
* @mbx_id: id of mailbox to check
*
* returns SUCCESS if the Status bit was found or else ERR_MBX
**/
int ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id)
{
struct ixgbe_mbx_info *mbx = &hw->mbx;
if (!mbx->ops)
return -EIO;
return mbx->ops->check_for_msg(hw, mbx_id);
}
/**
* ixgbe_check_for_ack - checks to see if someone sent us ACK
* @hw: pointer to the HW structure
* @mbx_id: id of mailbox to check
*
* returns SUCCESS if the Status bit was found or else ERR_MBX
**/
int ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id)
{
struct ixgbe_mbx_info *mbx = &hw->mbx;
if (!mbx->ops)
return -EIO;
return mbx->ops->check_for_ack(hw, mbx_id);
}
/**
* ixgbe_check_for_rst - checks to see if other side has reset
* @hw: pointer to the HW structure
Annotation
- Immediate include surface: `linux/pci.h`, `linux/delay.h`, `ixgbe.h`, `ixgbe_mbx.h`.
- Detected declarations: `function ixgbe_read_mbx`, `function ixgbe_write_mbx`, `function ixgbe_check_for_msg`, `function ixgbe_check_for_ack`, `function ixgbe_check_for_rst`, `function ixgbe_poll_for_msg`, `function ixgbe_poll_for_ack`, `function ixgbe_read_posted_mbx`, `function ixgbe_write_posted_mbx`, `function ixgbe_check_for_bit_pf`.
- 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.