drivers/staging/rtl8723bs/os_dep/osdep_service.c
Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/os_dep/osdep_service.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/rtl8723bs/os_dep/osdep_service.c- Extension
.c- Size
- 3856 bytes
- Lines
- 202
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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.
- 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.h
Detected Declarations
function Copyrightfunction _rtw_netif_rxfunction rtw_free_netdevfunction rtw_buf_freefunction rtw_buf_updatefunction rtw_cbuf_fullfunction rtw_cbuf_emptyfunction rtw_cbuf_push
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/******************************************************************************
*
* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
*
******************************************************************************/
#include <drv_types.h>
/* Translate the OS dependent error_code to RTW_STATUS_CODE */
inline int RTW_STATUS_CODE(int error_code)
{
if (error_code >= 0)
return _SUCCESS;
return _FAIL;
}
inline int _rtw_netif_rx(struct net_device *ndev, struct sk_buff *skb)
{
skb->dev = ndev;
return netif_rx(skb);
}
struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_priv)
{
struct net_device *pnetdev;
struct rtw_netdev_priv_indicator *pnpi;
pnetdev = alloc_etherdev_mq(sizeof(struct rtw_netdev_priv_indicator), 4);
if (!pnetdev)
goto RETURN;
pnpi = netdev_priv(pnetdev);
pnpi->priv = old_priv;
pnpi->sizeof_priv = sizeof_priv;
RETURN:
return pnetdev;
}
struct net_device *rtw_alloc_etherdev(int sizeof_priv)
{
struct net_device *pnetdev;
struct rtw_netdev_priv_indicator *pnpi;
pnetdev = alloc_etherdev_mq(sizeof(struct rtw_netdev_priv_indicator), 4);
if (!pnetdev)
goto RETURN;
pnpi = netdev_priv(pnetdev);
pnpi->priv = vzalloc(sizeof_priv);
if (!pnpi->priv) {
free_netdev(pnetdev);
pnetdev = NULL;
goto RETURN;
}
pnpi->sizeof_priv = sizeof_priv;
RETURN:
return pnetdev;
}
void rtw_free_netdev(struct net_device *netdev)
{
struct rtw_netdev_priv_indicator *pnpi;
if (!netdev)
goto RETURN;
pnpi = netdev_priv(netdev);
if (!pnpi->priv)
goto RETURN;
vfree(pnpi->priv);
free_netdev(netdev);
RETURN:
return;
}
void rtw_buf_free(u8 **buf, u32 *buf_len)
{
if (!buf || !buf_len)
return;
if (*buf) {
*buf_len = 0;
kfree(*buf);
*buf = NULL;
Annotation
- Immediate include surface: `drv_types.h`.
- Detected declarations: `function Copyright`, `function _rtw_netif_rx`, `function rtw_free_netdev`, `function rtw_buf_free`, `function rtw_buf_update`, `function rtw_cbuf_full`, `function rtw_cbuf_empty`, `function rtw_cbuf_push`.
- Atlas domain: Driver Families / drivers/staging.
- 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.