sound/usb/usx2y/us144mkii.c
Source file repositories/reference/linux-study-clean/sound/usb/usx2y/us144mkii.c
File Facts
- System
- Linux kernel
- Corpus path
sound/usb/usx2y/us144mkii.c- Extension
.c- Size
- 18502 bytes
- Lines
- 625
- Domain
- Driver Families
- Bucket
- sound/usb
- 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.
- 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
us144mkii.h
Detected Declarations
function tascam_free_urbsfunction tascam_alloc_urbsfunction tascam_stop_work_handlerfunction tascam_card_private_freefunction tascam_suspendfunction tascam_resumefunction tascam_error_timerfunction tascam_probefunction tascam_disconnect
Annotated Snippet
if (tascam->playback_urbs[i]) {
usb_free_coherent(
tascam->dev, tascam->playback_urb_alloc_size,
tascam->playback_urbs[i]->transfer_buffer,
tascam->playback_urbs[i]->transfer_dma);
usb_free_urb(tascam->playback_urbs[i]);
tascam->playback_urbs[i] = NULL;
}
}
usb_kill_anchored_urbs(&tascam->feedback_anchor);
for (i = 0; i < NUM_FEEDBACK_URBS; i++) {
if (tascam->feedback_urbs[i]) {
usb_free_coherent(
tascam->dev, tascam->feedback_urb_alloc_size,
tascam->feedback_urbs[i]->transfer_buffer,
tascam->feedback_urbs[i]->transfer_dma);
usb_free_urb(tascam->feedback_urbs[i]);
tascam->feedback_urbs[i] = NULL;
}
}
usb_kill_anchored_urbs(&tascam->capture_anchor);
for (i = 0; i < NUM_CAPTURE_URBS; i++) {
if (tascam->capture_urbs[i]) {
usb_free_coherent(
tascam->dev, tascam->capture_urb_alloc_size,
tascam->capture_urbs[i]->transfer_buffer,
tascam->capture_urbs[i]->transfer_dma);
usb_free_urb(tascam->capture_urbs[i]);
tascam->capture_urbs[i] = NULL;
}
}
usb_kill_anchored_urbs(&tascam->midi_in_anchor);
for (i = 0; i < NUM_MIDI_IN_URBS; i++) {
if (tascam->midi_in_urbs[i]) {
usb_free_coherent(
tascam->dev, MIDI_IN_BUF_SIZE,
tascam->midi_in_urbs[i]->transfer_buffer,
tascam->midi_in_urbs[i]->transfer_dma);
usb_free_urb(tascam->midi_in_urbs[i]);
tascam->midi_in_urbs[i] = NULL;
}
}
usb_kill_anchored_urbs(&tascam->midi_out_anchor);
for (i = 0; i < NUM_MIDI_OUT_URBS; i++) {
if (tascam->midi_out_urbs[i]) {
usb_free_coherent(
tascam->dev, MIDI_OUT_BUF_SIZE,
tascam->midi_out_urbs[i]->transfer_buffer,
tascam->midi_out_urbs[i]->transfer_dma);
usb_free_urb(tascam->midi_out_urbs[i]);
tascam->midi_out_urbs[i] = NULL;
}
}
kfree(tascam->capture_routing_buffer);
tascam->capture_routing_buffer = NULL;
kfree(tascam->capture_decode_dst_block);
tascam->capture_decode_dst_block = NULL;
kfree(tascam->capture_decode_raw_block);
tascam->capture_decode_raw_block = NULL;
kfree(tascam->capture_ring_buffer);
tascam->capture_ring_buffer = NULL;
}
int tascam_alloc_urbs(struct tascam_card *tascam)
{
int i;
size_t max_packet_size;
max_packet_size = ((96000 / 8000) + 2) * BYTES_PER_FRAME;
tascam->playback_urb_alloc_size =
max_packet_size * PLAYBACK_URB_PACKETS;
for (i = 0; i < NUM_PLAYBACK_URBS; i++) {
struct urb *urb =
usb_alloc_urb(PLAYBACK_URB_PACKETS, GFP_KERNEL);
if (!urb)
goto error;
tascam->playback_urbs[i] = urb;
urb->transfer_buffer = usb_alloc_coherent(
tascam->dev, tascam->playback_urb_alloc_size,
GFP_KERNEL, &urb->transfer_dma);
if (!urb->transfer_buffer)
goto error;
Annotation
- Immediate include surface: `us144mkii.h`.
- Detected declarations: `function tascam_free_urbs`, `function tascam_alloc_urbs`, `function tascam_stop_work_handler`, `function tascam_card_private_free`, `function tascam_suspend`, `function tascam_resume`, `function tascam_error_timer`, `function tascam_probe`, `function tascam_disconnect`.
- Atlas domain: Driver Families / sound/usb.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.