drivers/net/arcnet/com20020.h
Source file repositories/reference/linux-study-clean/drivers/net/arcnet/com20020.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/arcnet/com20020.h- Extension
.h- Size
- 3725 bytes
- Lines
- 133
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/leds.h
Detected Declarations
struct ledoffsetsstruct com20020_pci_channel_mapstruct com20020_pci_card_infostruct com20020_privstruct com20020_devfunction com20020_set_subaddress
Annotated Snippet
extern const struct net_device_ops com20020_netdev_ops;
/* The number of low I/O ports used by the card. */
#define ARCNET_TOTAL_SIZE 8
#define PLX_PCI_MAX_CARDS 2
struct ledoffsets {
int green;
int red;
};
struct com20020_pci_channel_map {
u32 bar;
u32 offset;
u32 size; /* 0x00 - auto, e.g. length of entire bar */
};
struct com20020_pci_card_info {
const char *name;
u8 devcount;
struct com20020_pci_channel_map chan_map_tbl[PLX_PCI_MAX_CARDS];
struct com20020_pci_channel_map misc_map;
struct ledoffsets leds[PLX_PCI_MAX_CARDS];
int rotary;
unsigned int flags;
};
struct com20020_priv {
struct com20020_pci_card_info *ci;
struct list_head list_dev;
resource_size_t misc;
};
struct com20020_dev {
struct list_head list;
struct net_device *dev;
struct led_classdev tx_led;
struct led_classdev recon_led;
struct com20020_priv *pci_priv;
int index;
};
#define COM20020_REG_W_INTMASK 0 /* writable */
#define COM20020_REG_R_STATUS 0 /* readable */
#define COM20020_REG_W_COMMAND 1 /* standard arcnet commands */
#define COM20020_REG_R_DIAGSTAT 1 /* diagnostic status */
#define COM20020_REG_W_ADDR_HI 2 /* control for IO-mapped memory */
#define COM20020_REG_W_ADDR_LO 3
#define COM20020_REG_RW_MEMDATA 4 /* data port for IO-mapped memory */
#define COM20020_REG_W_SUBADR 5 /* the extended port _XREG refers to */
#define COM20020_REG_W_CONFIG 6 /* configuration */
#define COM20020_REG_W_XREG 7 /* extra
* (indexed by _CONFIG or _SUBADDR)
*/
/* in the ADDR_HI register */
#define RDDATAflag 0x80 /* next access is a read (not a write) */
/* in the DIAGSTAT register */
#define NEWNXTIDflag 0x02 /* ID to which token is passed has changed */
/* in the CONFIG register */
#define RESETcfg 0x80 /* put card in reset state */
#define TXENcfg 0x20 /* enable TX */
#define XTOcfg(x) ((x) << 3) /* extended timeout */
/* in SETUP register */
#define PROMISCset 0x10 /* enable RCV_ALL */
#define P1MODE 0x80 /* enable P1-MODE for Backplane */
#define SLOWARB 0x01 /* enable Slow Arbitration for >=5Mbps */
/* COM2002x */
#define SUB_TENTATIVE 0 /* tentative node ID */
#define SUB_NODE 1 /* node ID */
#define SUB_SETUP1 2 /* various options */
#define SUB_TEST 3 /* test/diag register */
/* COM20022 only */
#define SUB_SETUP2 4 /* sundry options */
#define SUB_BUSCTL 5 /* bus control options */
#define SUB_DMACOUNT 6 /* DMA count options */
static inline void com20020_set_subaddress(struct arcnet_local *lp,
int ioaddr, int val)
Annotation
- Immediate include surface: `linux/leds.h`.
- Detected declarations: `struct ledoffsets`, `struct com20020_pci_channel_map`, `struct com20020_pci_card_info`, `struct com20020_priv`, `struct com20020_dev`, `function com20020_set_subaddress`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern 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.