drivers/staging/rtl8723bs/os_dep/xmit_linux.c
Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/os_dep/xmit_linux.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/rtl8723bs/os_dep/xmit_linux.c- Extension
.c- Size
- 5811 bytes
- Lines
- 224
- 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.
- 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.h
Detected Declarations
function Copyrightfunction _rtw_open_pktfilefunction _rtw_pktfile_readfunction rtw_endofpktfilefunction rtw_os_xmit_resource_allocfunction rtw_os_xmit_resource_freefunction rtw_os_pkt_completefunction rtw_os_xmit_completefunction rtw_os_xmit_schedulefunction rtw_check_xmit_resourcefunction rtw_mlcst2unicstfunction _rtw_xmit_entryfunction rtw_xmit_entry
Annotated Snippet
if (pxmitpriv->free_xmitframe_cnt <= 4) {
if (!netif_tx_queue_stopped(netdev_get_tx_queue(padapter->pnetdev, queue)))
netif_stop_subqueue(padapter->pnetdev, queue);
}
}
}
static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
{
struct sta_priv *pstapriv = &padapter->stapriv;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct list_head *phead, *plist;
struct sk_buff *newskb;
struct sta_info *psta = NULL;
u8 chk_alive_num = 0;
char chk_alive_list[NUM_STA];
u8 bc_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
u8 null_addr[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
int i;
s32 res;
spin_lock_bh(&pstapriv->asoc_list_lock);
phead = &pstapriv->asoc_list;
/* free sta asoc_queue */
list_for_each(plist, phead) {
int stainfo_offset;
psta = list_entry(plist, struct sta_info, asoc_list);
stainfo_offset = rtw_stainfo_offset(pstapriv, psta);
if (stainfo_offset_valid(stainfo_offset))
chk_alive_list[chk_alive_num++] = stainfo_offset;
}
spin_unlock_bh(&pstapriv->asoc_list_lock);
for (i = 0; i < chk_alive_num; i++) {
psta = rtw_get_stainfo_by_offset(pstapriv, chk_alive_list[i]);
if (!(psta->state & _FW_LINKED))
continue;
/* avoid come from STA1 and send back STA1 */
if (!memcmp(psta->hwaddr, &skb->data[6], 6) ||
!memcmp(psta->hwaddr, null_addr, 6) ||
!memcmp(psta->hwaddr, bc_addr, 6))
continue;
newskb = skb_copy(skb, GFP_ATOMIC);
if (newskb) {
memcpy(newskb->data, psta->hwaddr, 6);
res = rtw_xmit(padapter, &newskb);
if (res < 0) {
pxmitpriv->tx_drop++;
dev_kfree_skb_any(newskb);
}
} else {
pxmitpriv->tx_drop++;
/* dev_kfree_skb_any(skb); */
return false; /* Caller shall tx this multicast frame via normal way. */
}
}
dev_kfree_skb_any(skb);
return true;
}
void _rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev)
{
struct adapter *padapter = rtw_netdev_priv(pnetdev);
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
s32 res = 0;
if (rtw_if_up(padapter) == false)
goto drop_packet;
rtw_check_xmit_resource(padapter, pkt);
if (!rtw_mc2u_disable && check_fwstate(pmlmepriv, WIFI_AP_STATE) &&
(IP_MCAST_MAC(pkt->data) || ICMPV6_MCAST_MAC(pkt->data)) &&
!padapter->registrypriv.wifi_spec) {
if (pxmitpriv->free_xmitframe_cnt > (NR_XMITFRAME / 4)) {
res = rtw_mlcst2unicst(padapter, pkt);
if (res)
return;
}
}
res = rtw_xmit(padapter, &pkt);
if (res < 0)
Annotation
- Immediate include surface: `drv_types.h`.
- Detected declarations: `function Copyright`, `function _rtw_open_pktfile`, `function _rtw_pktfile_read`, `function rtw_endofpktfile`, `function rtw_os_xmit_resource_alloc`, `function rtw_os_xmit_resource_free`, `function rtw_os_pkt_complete`, `function rtw_os_xmit_complete`, `function rtw_os_xmit_schedule`, `function rtw_check_xmit_resource`.
- Atlas domain: Driver Families / drivers/staging.
- 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.