drivers/staging/rtl8723bs/os_dep/os_intfs.c
Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/os_dep/os_intfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/rtl8723bs/os_dep/os_intfs.c- Extension
.c- Size
- 32256 bytes
- Lines
- 1195
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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.
- 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
drv_types.hhal_data.hrtl8723b_xmit.h
Detected Declarations
function loadparamfunction rtw_net_set_mac_addressfunction rtw_classify8021dfunction rtw_select_queuefunction rtw_recv_select_queuefunction rtw_ndev_initfunction rtw_ndev_uninitfunction rtw_init_netdev_namefunction rtw_unregister_netdevsfunction rtw_start_drv_threadsfunction rtw_stop_drv_threadsfunction rtw_init_default_valuefunction devobj_deinitfunction rtw_reset_drv_swfunction rtw_init_drv_swfunction rtw_cancel_all_timerfunction rtw_free_drv_swfunction _rtw_drv_register_netdevfunction rtw_drv_register_netdevfunction _netdev_openfunction netdev_openfunction ips_netdrv_openfunction rtw_ips_pwr_upfunction rtw_ips_pwr_downfunction rtw_ips_dev_unloadfunction pm_netdev_openfunction netdev_closefunction rtw_ndev_destructorfunction rtw_dev_unloadfunction rtw_suspend_free_assoc_resourcefunction rtw_suspend_normalfunction rtw_suspend_commonfunction rtw_resume_process_normalfunction rtw_resume_common
Annotated Snippet
static const struct net_device_ops rtw_netdev_ops = {
.ndo_init = rtw_ndev_init,
.ndo_uninit = rtw_ndev_uninit,
.ndo_open = netdev_open,
.ndo_stop = netdev_close,
.ndo_start_xmit = rtw_xmit_entry,
.ndo_select_queue = rtw_select_queue,
.ndo_set_mac_address = rtw_net_set_mac_address,
.ndo_get_stats = rtw_net_get_stats,
};
int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
{
if (dev_alloc_name(pnetdev, ifname) < 0) {
pr_err("dev_alloc_name, fail for %s\n", ifname);
return 1;
}
netif_carrier_off(pnetdev);
/* rtw_netif_stop_queue(pnetdev); */
return 0;
}
struct net_device *rtw_init_netdev(struct adapter *old_padapter)
{
struct adapter *padapter;
struct net_device *pnetdev;
if (old_padapter)
pnetdev = rtw_alloc_etherdev_with_old_priv(sizeof(struct adapter), (void *)old_padapter);
else
pnetdev = rtw_alloc_etherdev(sizeof(struct adapter));
pr_info("pnetdev = %p\n", pnetdev);
if (!pnetdev)
return NULL;
padapter = rtw_netdev_priv(pnetdev);
padapter->pnetdev = pnetdev;
/* pnetdev->init = NULL; */
pnetdev->netdev_ops = &rtw_netdev_ops;
/* pnetdev->tx_timeout = NULL; */
pnetdev->watchdog_timeo = HZ * 3; /* 3 second timeout */
/* step 2. */
loadparam(padapter, pnetdev);
return pnetdev;
}
void rtw_unregister_netdevs(struct dvobj_priv *dvobj)
{
struct adapter *padapter = NULL;
struct net_device *pnetdev = NULL;
padapter = dvobj->padapters;
if (!padapter)
return;
pnetdev = padapter->pnetdev;
if ((padapter->DriverState != DRIVER_DISAPPEAR) && pnetdev)
unregister_netdev(pnetdev); /* will call netdev_close() */
rtw_wdev_unregister(padapter->rtw_wdev);
}
u32 rtw_start_drv_threads(struct adapter *padapter)
{
u32 _status = _SUCCESS;
padapter->xmitThread = kthread_run(rtw_xmit_thread, padapter, "RTW_XMIT_THREAD");
if (IS_ERR(padapter->xmitThread))
_status = _FAIL;
padapter->cmdThread = kthread_run(rtw_cmd_thread, padapter, "RTW_CMD_THREAD");
if (IS_ERR(padapter->cmdThread))
_status = _FAIL;
else
wait_for_completion(&padapter->cmdpriv.terminate_cmdthread_comp); /* wait for cmd_thread to run */
padapter->xmitpriv.SdioXmitThread = kthread_run(rtl8723bs_xmit_thread,
padapter, "RTWHALXT");
if (IS_ERR(padapter->xmitpriv.SdioXmitThread)) {
padapter->xmitpriv.SdioXmitThread = NULL;
_status = _FAIL;
}
Annotation
- Immediate include surface: `drv_types.h`, `hal_data.h`, `rtl8723b_xmit.h`.
- Detected declarations: `function loadparam`, `function rtw_net_set_mac_address`, `function rtw_classify8021d`, `function rtw_select_queue`, `function rtw_recv_select_queue`, `function rtw_ndev_init`, `function rtw_ndev_uninit`, `function rtw_init_netdev_name`, `function rtw_unregister_netdevs`, `function rtw_start_drv_threads`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: pattern 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.