drivers/net/fddi/skfp/hwmtm.c
Source file repositories/reference/linux-study-clean/drivers/net/fddi/skfp/hwmtm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/fddi/skfp/hwmtm.c- Extension
.c- Size
- 56012 bytes
- Lines
- 2171
- 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
h/types.hh/fddi.hh/smc.hh/supern_2.hh/skfbiinc.h
Detected Declarations
function BEGIN_MANUAL_ENTRYfunction BEGIN_MANUAL_ENTRYfunction mac_drv_get_desc_memfunction BEGIN_MANUAL_ENTRYfunction init_descr_ringfunction init_txd_ringfunction init_rxd_ringfunction BEGIN_MANUAL_ENTRYfunction smt_free_mbuffunction BEGIN_MANUAL_ENTRYfunction repair_txd_ringfunction driverfunction BEGIN_MANUAL_ENTRYfunction Completefunction BEGIN_MANUAL_ENTRYfunction process_receivefunction smt_to_llcfunction BEGIN_MANUAL_ENTRYfunction DOWNCALLfunction BEGIN_MANUAL_ENTRYfunction BEGIN_MANUAL_ENTRYfunction queue_llc_rxfunction queue_txd_mbfunction smt_send_mbuffunction mac_drv_clear_txdfunction DOWNCALLfunction BEGIN_MANUAL_ENTRY
Annotated Snippet
if (!mb->sm_use_count) {
DB_GEN(3, "free SMbuf: mb = %p", mb);
#ifndef COMMON_MB_POOL
mb->sm_next = smc->os.hwm.mbuf_pool.mb_free ;
smc->os.hwm.mbuf_pool.mb_free = mb ;
#else
mb->sm_next = mb_free ;
mb_free = mb ;
#endif
}
}
else
SMT_PANIC(smc,HWM_E0003,HWM_E0003_MSG) ;
}
/*
* BEGIN_MANUAL_ENTRY(mac_drv_repair_descr)
* void mac_drv_repair_descr(smc)
*
* function called from SMT (HWM / hwmtm.c)
* The BMU is idle when this function is called.
* Mac_drv_repair_descr sets up the physical address
* for all receive and transmit queues where the BMU
* should continue.
* It may be that the BMU was reseted during a fragmented
* transfer. In this case there are some fragments which will
* never completed by the BMU. The OWN bit of this fragments
* must be switched to be owned by the host.
*
* Give a start command to the receive BMU.
* Start the transmit BMUs if transmit frames pending.
*
* END_MANUAL_ENTRY
*/
void mac_drv_repair_descr(struct s_smc *smc)
{
u_long phys ;
if (smc->hw.hw_state != STOPPED) {
SK_BREAK() ;
SMT_PANIC(smc,HWM_E0013,HWM_E0013_MSG) ;
return ;
}
/*
* repair tx queues: don't start
*/
phys = repair_txd_ring(smc,smc->hw.fp.tx[QUEUE_A0]) ;
outpd(ADDR(B5_XA_DA),phys) ;
if (smc->hw.fp.tx_q[QUEUE_A0].tx_used) {
outpd(ADDR(B0_XA_CSR),CSR_START) ;
}
phys = repair_txd_ring(smc,smc->hw.fp.tx[QUEUE_S]) ;
outpd(ADDR(B5_XS_DA),phys) ;
if (smc->hw.fp.tx_q[QUEUE_S].tx_used) {
outpd(ADDR(B0_XS_CSR),CSR_START) ;
}
/*
* repair rx queues
*/
phys = repair_rxd_ring(smc,smc->hw.fp.rx[QUEUE_R1]) ;
outpd(ADDR(B4_R1_DA),phys) ;
outpd(ADDR(B0_R1_CSR),CSR_START) ;
}
static u_long repair_txd_ring(struct s_smc *smc, struct s_smt_tx_queue *queue)
{
int i ;
int tx_used ;
u_long phys ;
u_long tbctrl ;
struct s_smt_fp_txd volatile *t ;
SK_UNUSED(smc) ;
t = queue->tx_curr_get ;
tx_used = queue->tx_used ;
for (i = tx_used+queue->tx_free-1 ; i ; i-- ) {
t = t->txd_next ;
}
phys = le32_to_cpu(t->txd_ntdadr) ;
t = queue->tx_curr_get ;
while (tx_used) {
DRV_BUF_FLUSH(t,DDI_DMA_SYNC_FORCPU) ;
tbctrl = le32_to_cpu(t->txd_tbctrl) ;
if (tbctrl & BMU_OWN) {
Annotation
- Immediate include surface: `h/types.h`, `h/fddi.h`, `h/smc.h`, `h/supern_2.h`, `h/skfbiinc.h`.
- Detected declarations: `function BEGIN_MANUAL_ENTRY`, `function BEGIN_MANUAL_ENTRY`, `function mac_drv_get_desc_mem`, `function BEGIN_MANUAL_ENTRY`, `function init_descr_ring`, `function init_txd_ring`, `function init_rxd_ring`, `function BEGIN_MANUAL_ENTRY`, `function smt_free_mbuf`, `function BEGIN_MANUAL_ENTRY`.
- 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.