drivers/tty/ipwireless/hardware.c
Source file repositories/reference/linux-study-clean/drivers/tty/ipwireless/hardware.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/tty/ipwireless/hardware.c- Extension
.c- Size
- 46594 bytes
- Lines
- 1771
- Domain
- Driver Families
- Bucket
- drivers/tty
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/interrupt.hlinux/io.hlinux/irq.hlinux/kernel.hlinux/list.hlinux/slab.hhardware.hsetup_protocol.hnetwork.hmain.h
Detected Declarations
struct nl_first_packet_headerstruct nl_packet_headerstruct MEMCCRstruct MEMINFREGstruct ipw_hardwarestruct ipw_tx_packetstruct ipw_control_packet_bodystruct ipw_control_packetstruct ipw_rx_packetstruct ipw_setup_get_version_query_packetstruct ipw_setup_config_packetstruct ipw_setup_config_done_packetstruct ipw_setup_open_packetstruct ipw_setup_info_packetstruct ipw_setup_reboot_msg_ackfunction start_timingfunction end_read_timingfunction end_write_timingfunction report_timingfunction start_timingfunction dump_data_bytesfunction swap_packet_bitfield_to_lefunction swap_packet_bitfield_from_lefunction do_send_fragmentfunction do_send_packetfunction ipw_setup_hardwarefunction pool_freefunction queue_received_packetfunction ipw_receive_data_workfunction contextfunction handle_received_CTRL_packetfunction handle_received_packetfunction acknowledge_data_readfunction do_receive_packetfunction get_current_packet_priorityfunction get_packets_from_hwfunction send_pending_packetfunction ipwireless_do_taskletfunction is_card_presentfunction ipwireless_handle_v1_interruptfunction acknowledge_pcmcia_interruptfunction ipwireless_handle_v2_v3_interruptfunction ipwireless_interruptfunction flush_packets_to_hwfunction send_packetfunction ipwireless_send_packetfunction set_control_linefunction set_DTR
Annotated Snippet
struct nl_first_packet_header {
unsigned char protocol:3;
unsigned char address:3;
unsigned char packet_rank:2;
unsigned char length_lsb;
unsigned char length_msb;
};
struct nl_packet_header {
unsigned char protocol:3;
unsigned char address:3;
unsigned char packet_rank:2;
};
/* Value of 'packet_rank' above */
#define NL_INTERMEDIATE_PACKET 0x0
#define NL_LAST_PACKET 0x1
#define NL_FIRST_PACKET 0x2
union nl_packet {
/* Network packet header of the first packet (a special case) */
struct nl_first_packet_header hdr_first;
/* Network packet header of the following packets (if any) */
struct nl_packet_header hdr;
/* Complete network packet (header + data) */
unsigned char rawpkt[LL_MTU_MAX];
} __attribute__ ((__packed__));
#define HW_VERSION_UNKNOWN -1
#define HW_VERSION_1 1
#define HW_VERSION_2 2
/* IPW I/O ports */
#define IOIER 0x00 /* Interrupt Enable Register */
#define IOIR 0x02 /* Interrupt Source/ACK register */
#define IODCR 0x04 /* Data Control Register */
#define IODRR 0x06 /* Data Read Register */
#define IODWR 0x08 /* Data Write Register */
#define IOESR 0x0A /* Embedded Driver Status Register */
#define IORXR 0x0C /* Rx Fifo Register (Host to Embedded) */
#define IOTXR 0x0E /* Tx Fifo Register (Embedded to Host) */
/* I/O ports and bit definitions for version 1 of the hardware */
/* IER bits*/
#define IER_RXENABLED 0x1
#define IER_TXENABLED 0x2
/* ISR bits */
#define IR_RXINTR 0x1
#define IR_TXINTR 0x2
/* DCR bits */
#define DCR_RXDONE 0x1
#define DCR_TXDONE 0x2
#define DCR_RXRESET 0x4
#define DCR_TXRESET 0x8
/* I/O ports and bit definitions for version 2 of the hardware */
struct MEMCCR {
unsigned short reg_config_option; /* PCCOR: Configuration Option Register */
unsigned short reg_config_and_status; /* PCCSR: Configuration and Status Register */
unsigned short reg_pin_replacement; /* PCPRR: Pin Replacemant Register */
unsigned short reg_socket_and_copy; /* PCSCR: Socket and Copy Register */
unsigned short reg_ext_status; /* PCESR: Extendend Status Register */
unsigned short reg_io_base; /* PCIOB: I/O Base Register */
};
struct MEMINFREG {
unsigned short memreg_tx_old; /* TX Register (R/W) */
unsigned short pad1;
unsigned short memreg_rx_done; /* RXDone Register (R/W) */
unsigned short pad2;
unsigned short memreg_rx; /* RX Register (R/W) */
unsigned short pad3;
unsigned short memreg_pc_interrupt_ack; /* PC intr Ack Register (W) */
unsigned short pad4;
unsigned long memreg_card_present;/* Mask for Host to check (R) for
* CARD_PRESENT_VALUE */
unsigned short memreg_tx_new; /* TX2 (new) Register (R/W) */
};
#define CARD_PRESENT_VALUE (0xBEEFCAFEUL)
#define MEMTX_TX 0x0001
#define MEMRX_RX 0x0001
#define MEMRX_RX_DONE 0x0001
#define MEMRX_PCINTACKK 0x0001
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/io.h`, `linux/irq.h`, `linux/kernel.h`, `linux/list.h`, `linux/slab.h`, `hardware.h`, `setup_protocol.h`.
- Detected declarations: `struct nl_first_packet_header`, `struct nl_packet_header`, `struct MEMCCR`, `struct MEMINFREG`, `struct ipw_hardware`, `struct ipw_tx_packet`, `struct ipw_control_packet_body`, `struct ipw_control_packet`, `struct ipw_rx_packet`, `struct ipw_setup_get_version_query_packet`.
- Atlas domain: Driver Families / drivers/tty.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.