include/linux/ssb/ssb_driver_gige.h
Source file repositories/reference/linux-study-clean/include/linux/ssb/ssb_driver_gige.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/ssb/ssb_driver_gige.h- Extension
.h- Size
- 5346 bytes
- Lines
- 195
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ssb/ssb.hlinux/bug.hlinux/pci.hlinux/spinlock.h
Detected Declarations
struct ssb_gigefunction pdev_to_ssb_gigefunction ssb_gige_is_rgmiifunction ssb_gige_have_roboswitchfunction ssb_gige_one_dma_at_oncefunction ssb_gige_must_flush_posted_writesfunction ssb_gige_get_macaddrfunction ssb_gige_get_phyaddrfunction ssb_gige_exitfunction ssb_gige_pcibios_plat_dev_initfunction ssb_gige_map_irqfunction ssb_gige_initfunction ssb_gige_exitfunction pdev_to_ssb_gigefunction ssb_gige_is_rgmiifunction ssb_gige_have_roboswitchfunction ssb_gige_one_dma_at_oncefunction ssb_gige_must_flush_posted_writesfunction ssb_gige_get_macaddrfunction ssb_gige_get_phyaddr
Annotated Snippet
struct ssb_gige {
struct ssb_device *dev;
spinlock_t lock;
/* True, if the device has an RGMII bus.
* False, if the device has a GMII bus. */
bool has_rgmii;
/* The PCI controller device. */
struct pci_controller pci_controller;
struct pci_ops pci_ops;
struct resource mem_resource;
struct resource io_resource;
};
/* Check whether a PCI device is a SSB Gigabit Ethernet core. */
extern bool pdev_is_ssb_gige_core(struct pci_dev *pdev);
/* Convert a pci_dev pointer to a ssb_gige pointer. */
static inline struct ssb_gige * pdev_to_ssb_gige(struct pci_dev *pdev)
{
if (!pdev_is_ssb_gige_core(pdev))
return NULL;
return container_of(pdev->bus->ops, struct ssb_gige, pci_ops);
}
/* Returns whether the PHY is connected by an RGMII bus. */
static inline bool ssb_gige_is_rgmii(struct pci_dev *pdev)
{
struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
return (dev ? dev->has_rgmii : 0);
}
/* Returns whether we have a Roboswitch. */
static inline bool ssb_gige_have_roboswitch(struct pci_dev *pdev)
{
struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
if (dev)
return !!(dev->dev->bus->sprom.boardflags_lo &
SSB_GIGE_BFL_ROBOSWITCH);
return false;
}
/* Returns whether we can only do one DMA at once. */
static inline bool ssb_gige_one_dma_at_once(struct pci_dev *pdev)
{
struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
if (dev)
return ((dev->dev->bus->chip_id == 0x4785) &&
(dev->dev->bus->chip_rev < 2));
return false;
}
/* Returns whether we must flush posted writes. */
static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev)
{
struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
if (dev)
return (dev->dev->bus->chip_id == 0x4785);
return false;
}
/* Get the device MAC address */
static inline int ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
{
struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
if (!dev)
return -ENODEV;
memcpy(macaddr, dev->dev->bus->sprom.et0mac, 6);
return 0;
}
/* Get the device phy address */
static inline int ssb_gige_get_phyaddr(struct pci_dev *pdev)
{
struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
if (!dev)
return -ENODEV;
return dev->dev->bus->sprom.et0phyaddr;
}
extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev,
struct pci_dev *pdev);
extern int ssb_gige_map_irq(struct ssb_device *sdev,
const struct pci_dev *pdev);
/* The GigE driver is not a standalone module, because we don't have support
Annotation
- Immediate include surface: `linux/ssb/ssb.h`, `linux/bug.h`, `linux/pci.h`, `linux/spinlock.h`.
- Detected declarations: `struct ssb_gige`, `function pdev_to_ssb_gige`, `function ssb_gige_is_rgmii`, `function ssb_gige_have_roboswitch`, `function ssb_gige_one_dma_at_once`, `function ssb_gige_must_flush_posted_writes`, `function ssb_gige_get_macaddr`, `function ssb_gige_get_phyaddr`, `function ssb_gige_exit`, `function ssb_gige_pcibios_plat_dev_init`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.