drivers/net/wireless/rsi/rsi_common.h
Source file repositories/reference/linux-study-clean/drivers/net/wireless/rsi/rsi_common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/rsi/rsi_common.h- Extension
.h- Size
- 2979 bytes
- Lines
- 93
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kthread.h
Detected Declarations
function Copyrightfunction rsi_wait_eventfunction rsi_set_eventfunction rsi_reset_eventfunction rsi_create_kthreadfunction rsi_kill_thread
Annotated Snippet
#ifndef __RSI_COMMON_H__
#define __RSI_COMMON_H__
#include <linux/kthread.h>
#define EVENT_WAIT_FOREVER 0
#define FIRMWARE_RSI9113 "rs9113_wlan_qspi.rps"
#define QUEUE_NOT_FULL 1
#define QUEUE_FULL 0
static inline int rsi_init_event(struct rsi_event *pevent)
{
atomic_set(&pevent->event_condition, 1);
init_waitqueue_head(&pevent->event_queue);
return 0;
}
static inline int rsi_wait_event(struct rsi_event *event, u32 timeout)
{
int status = 0;
if (!timeout)
status = wait_event_interruptible(event->event_queue,
(atomic_read(&event->event_condition) == 0));
else
status = wait_event_interruptible_timeout(event->event_queue,
(atomic_read(&event->event_condition) == 0),
timeout);
return status;
}
static inline void rsi_set_event(struct rsi_event *event)
{
atomic_set(&event->event_condition, 0);
wake_up_interruptible(&event->event_queue);
}
static inline void rsi_reset_event(struct rsi_event *event)
{
atomic_set(&event->event_condition, 1);
}
static inline int rsi_create_kthread(struct rsi_common *common,
struct rsi_thread *thread,
void *func_ptr,
u8 *name)
{
init_completion(&thread->completion);
atomic_set(&thread->thread_done, 0);
thread->task = kthread_run(func_ptr, common, "%s", name);
if (IS_ERR(thread->task))
return (int)PTR_ERR(thread->task);
return 0;
}
static inline void rsi_kill_thread(struct rsi_thread *handle)
{
atomic_inc(&handle->thread_done);
rsi_set_event(&handle->event);
wait_for_completion(&handle->completion);
}
void rsi_mac80211_detach(struct rsi_hw *hw);
void rsi_mac80211_rfkill_exit(struct rsi_hw *hw);
u16 rsi_get_connected_channel(struct ieee80211_vif *vif);
struct rsi_hw *rsi_91x_init(u16 oper_mode);
void rsi_91x_deinit(struct rsi_hw *adapter);
int rsi_read_pkt(struct rsi_common *common, u8 *rx_pkt, s32 rcv_pkt_len);
#ifdef CONFIG_PM
int rsi_config_wowlan(struct rsi_hw *adapter, struct cfg80211_wowlan *wowlan);
#endif
struct rsi_sta *rsi_find_sta(struct rsi_common *common, u8 *mac_addr);
struct ieee80211_vif *rsi_get_vif(struct rsi_hw *adapter, u8 *mac);
void rsi_roc_timeout(struct timer_list *t);
#endif
Annotation
- Immediate include surface: `linux/kthread.h`.
- Detected declarations: `function Copyright`, `function rsi_wait_event`, `function rsi_set_event`, `function rsi_reset_event`, `function rsi_create_kthread`, `function rsi_kill_thread`.
- Atlas domain: Driver Families / drivers/net.
- 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.