drivers/net/ethernet/renesas/rswitch.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/renesas/rswitch.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/renesas/rswitch.h- Extension
.h- Size
- 27871 bytes
- Lines
- 1075
- 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/platform_device.hlinux/phy.hrcar_gen4_ptp.h
Detected Declarations
struct rswitch_descstruct rswitch_ts_descstruct rswitch_ext_descstruct rswitch_ext_ts_descstruct rswitch_ethastruct rswitch_gwca_queuestruct rswitch_gwcastruct rswitch_devicestruct rswitch_mfwd_mac_table_entrystruct rswitch_mfwdstruct rswitch_privateenum rswitch_regenum rswitch_etha_modeenum rswitch_gwca_modeenum RX_DS_CC_BITenum TX_DS_TAGL_BITenum DIE_DT
Annotated Snippet
struct rswitch_desc {
__le16 info_ds; /* Descriptor size */
u8 die_dt; /* Descriptor interrupt enable and type */
__u8 dptrh; /* Descriptor pointer MSB */
__le32 dptrl; /* Descriptor pointer LSW */
} __packed;
struct rswitch_ts_desc {
struct rswitch_desc desc;
__le32 ts_nsec;
__le32 ts_sec;
} __packed;
struct rswitch_ext_desc {
struct rswitch_desc desc;
__le64 info1;
} __packed;
struct rswitch_ext_ts_desc {
struct rswitch_desc desc;
__le64 info1;
__le32 ts_nsec;
__le32 ts_sec;
} __packed;
struct rswitch_etha {
unsigned int index;
void __iomem *addr;
void __iomem *coma_addr;
bool external_phy;
struct mii_bus *mii;
phy_interface_t phy_interface;
u32 psmcs;
u8 mac_addr[MAX_ADDR_LEN];
int link;
int speed;
/* This hardware could not be initialized twice so that marked
* this flag to avoid multiple initialization.
*/
bool operated;
};
/* The datasheet said descriptor "chain" and/or "queue". For consistency of
* name, this driver calls "queue".
*/
struct rswitch_gwca_queue {
union {
struct rswitch_ext_desc *tx_ring;
struct rswitch_ext_ts_desc *rx_ring;
struct rswitch_ts_desc *ts_ring;
};
/* Common */
dma_addr_t ring_dma;
unsigned int ring_size;
unsigned int cur;
unsigned int dirty;
/* For [rt]x_ring */
unsigned int index;
bool dir_tx;
struct net_device *ndev; /* queue to ndev for irq */
union {
/* For TX */
struct {
struct sk_buff **skbs;
dma_addr_t *unmap_addrs;
};
/* For RX */
struct {
void **rx_bufs;
struct sk_buff *skb_fstart;
u16 pkt_len;
};
};
};
#define RSWITCH_NUM_IRQ_REGS (RSWITCH_MAX_NUM_QUEUES / BITS_PER_TYPE(u32))
struct rswitch_gwca {
unsigned int index;
struct rswitch_desc *linkfix_table;
dma_addr_t linkfix_table_dma;
u32 linkfix_table_size;
struct rswitch_gwca_queue *queues;
int num_queues;
struct rswitch_gwca_queue ts_queue;
DECLARE_BITMAP(used, RSWITCH_MAX_NUM_QUEUES);
u32 tx_irq_bits[RSWITCH_NUM_IRQ_REGS];
Annotation
- Immediate include surface: `linux/platform_device.h`, `linux/phy.h`, `rcar_gen4_ptp.h`.
- Detected declarations: `struct rswitch_desc`, `struct rswitch_ts_desc`, `struct rswitch_ext_desc`, `struct rswitch_ext_ts_desc`, `struct rswitch_etha`, `struct rswitch_gwca_queue`, `struct rswitch_gwca`, `struct rswitch_device`, `struct rswitch_mfwd_mac_table_entry`, `struct rswitch_mfwd`.
- 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.