Expand linux-kpi wireless scaffolding, consolidate desktop plan, remove historical report

Add channel/band/rate/BSS/RX-TX structures to linux-kpi wireless
scaffolding (mac80211.rs, wireless.rs, net.rs, C headers), extend
redbear-iwlwifi linux_port.c with comprehensive PCIe transport, and
create consolidated CONSOLE-TO-KDE-DESKTOP-PLAN.md as the canonical
desktop path document. Remove stale INTEGRATION_REPORT.md (1388 lines)
in favor of current local/docs/ references. Update AGENTS.md, README,
and docs index to point to the new plan.
This commit is contained in:
2026-04-16 13:52:09 +01:00
parent e2f20aacb6
commit 6c2643bd9c
36 changed files with 5230 additions and 1757 deletions
@@ -42,6 +42,26 @@ static inline void atomic_sub(int i, atomic_t *v)
__sync_fetch_and_sub(&v->counter, i);
}
static inline int atomic_inc_and_test(atomic_t *v)
{
return __sync_add_and_fetch(&v->counter, 1) == 0;
}
static inline int atomic_dec_and_test(atomic_t *v)
{
return __sync_sub_and_fetch(&v->counter, 1) == 0;
}
static inline int atomic_add_return(int i, atomic_t *v)
{
return __sync_add_and_fetch(&v->counter, i);
}
static inline int atomic_sub_return(int i, atomic_t *v)
{
return __sync_sub_and_fetch(&v->counter, i);
}
static inline int atomic_inc_return(atomic_t *v)
{
return __sync_add_and_fetch(&v->counter, 1);
@@ -72,11 +92,6 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
static inline int atomic_dec_and_test(atomic_t *v)
{
return __sync_sub_and_fetch(&v->counter, 1) == 0;
}
#define smp_mb() __sync_synchronize()
#define smp_rmb() __sync_synchronize()
#define smp_wmb() __sync_synchronize()
@@ -1,7 +1,8 @@
#ifndef _LINUX_DMA_MAPPING_H
#define _LINUX_DMA_MAPPING_H
#include <linux/types.h>
#include "types.h"
#include <stddef.h>
enum dma_data_direction {
DMA_BIDIRECTIONAL = 0,
@@ -10,6 +11,8 @@ enum dma_data_direction {
DMA_NONE = 3,
};
struct dma_pool;
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL << (n)) - 1))
extern void *dma_alloc_coherent(void *dev, size_t size,
@@ -21,6 +24,14 @@ extern dma_addr_t dma_map_single(void *dev, void *ptr, size_t size,
enum dma_data_direction dir);
extern void dma_unmap_single(void *dev, dma_addr_t addr, size_t size,
enum dma_data_direction dir);
extern struct dma_pool *dma_pool_create(const char *name, void *dev, size_t size, size_t align, size_t boundary);
extern void dma_pool_destroy(struct dma_pool *pool);
extern void *dma_pool_alloc(struct dma_pool *pool, gfp_t flags, dma_addr_t *handle);
extern void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr);
extern void dma_sync_single_for_cpu(void *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir);
extern void dma_sync_single_for_device(void *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir);
extern dma_addr_t dma_map_page(void *dev, void *page, size_t offset, size_t size, enum dma_data_direction dir);
extern void dma_unmap_page(void *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir);
static inline int dma_mapping_error(void *dev, dma_addr_t addr)
{
@@ -2,7 +2,7 @@
#define _LINUX_FIRMWARE_H
#include <stddef.h>
#include <linux/types.h>
#include "types.h"
struct firmware {
size_t size;
@@ -1,9 +1,9 @@
#ifndef _LINUX_INTERRUPT_H
#define _LINUX_INTERRUPT_H
#include <linux/types.h>
#include <linux/irq.h>
#include <linux/spinlock.h>
#include "types.h"
#include "irq.h"
#include "spinlock.h"
extern void local_irq_save(unsigned long *flags);
extern void local_irq_restore(unsigned long flags);
@@ -1,7 +1,7 @@
#ifndef _LINUX_IO_H
#define _LINUX_IO_H
#include <linux/types.h>
#include "types.h"
#include <stddef.h>
extern void *ioremap(phys_addr_t phys_addr, size_t size);
@@ -31,6 +31,21 @@ static inline void memset_io(void *dst, int c, size_t count)
__builtin_memset(dst, c, count);
}
static inline void mb(void)
{
__sync_synchronize();
}
static inline void rmb(void)
{
__sync_synchronize();
}
static inline void wmb(void)
{
__sync_synchronize();
}
#define ioread8(addr) readb(addr)
#define ioread16(addr) readw(addr)
#define ioread32(addr) readl(addr)
@@ -1,7 +1,7 @@
#ifndef _LINUX_IRQ_H
#define _LINUX_IRQ_H
#include <linux/types.h>
#include "types.h"
typedef unsigned int irqreturn_t;
@@ -1,7 +1,7 @@
#ifndef _LINUX_JIFFIES_H
#define _LINUX_JIFFIES_H
#include <linux/types.h>
#include "types.h"
#include <time.h>
static inline u64 redox_get_jiffies(void)
@@ -1,7 +1,7 @@
#ifndef _LINUX_MUTEX_H
#define _LINUX_MUTEX_H
#include <linux/types.h>
#include "types.h"
struct mutex {
unsigned char __opaque[64];
@@ -1,9 +1,9 @@
#ifndef _LINUX_PCI_H
#define _LINUX_PCI_H
#include <linux/types.h>
#include <linux/device.h>
#include <linux/io.h>
#include "types.h"
#include "device.h"
#include "io.h"
#include <stddef.h>
#define PCI_VENDOR_ID_AMD 0x1002U
@@ -12,6 +12,12 @@
#define PCI_ANY_ID (~0U)
/* MSI/MSI-X support */
#define PCI_IRQ_MSI 1U
#define PCI_IRQ_MSIX 2U
#define PCI_IRQ_LEGACY 4U
#define PCI_IRQ_NOLEGACY 8U
struct pci_device_id {
u32 vendor;
u32 device;
@@ -49,6 +55,11 @@ struct pci_driver {
extern int pci_enable_device(struct pci_dev *dev);
extern void pci_disable_device(struct pci_dev *dev);
extern void pci_set_master(struct pci_dev *dev);
extern int pci_alloc_irq_vectors(struct pci_dev *dev, int min_vecs, int max_vecs, unsigned int flags);
extern void pci_free_irq_vectors(struct pci_dev *dev);
extern int pci_irq_vector(struct pci_dev *dev, unsigned int nr);
extern int pci_enable_msi(struct pci_dev *dev);
extern void pci_disable_msi(struct pci_dev *dev);
extern void *pci_iomap(struct pci_dev *dev, unsigned int bar, size_t max_len);
extern void pci_iounmap(struct pci_dev *dev, void *addr, size_t size);
@@ -0,0 +1,6 @@
#ifndef _LINUX_SKB_H
#define _LINUX_SKB_H
#include "skbuff.h"
#endif
@@ -3,6 +3,8 @@
#include "types.h"
struct net_device;
struct sk_buff {
void *head;
void *data;
@@ -11,6 +13,12 @@ struct sk_buff {
unsigned int end;
};
struct sk_buff_head {
struct sk_buff *next;
struct sk_buff *prev;
u32 qlen;
};
extern struct sk_buff *alloc_skb(unsigned int size, gfp_t gfp_mask);
extern void kfree_skb(struct sk_buff *skb);
extern void skb_reserve(struct sk_buff *skb, unsigned int len);
@@ -20,5 +28,14 @@ extern void *skb_pull(struct sk_buff *skb, unsigned int len);
extern unsigned int skb_headroom(const struct sk_buff *skb);
extern unsigned int skb_tailroom(const struct sk_buff *skb);
extern void skb_trim(struct sk_buff *skb, unsigned int len);
extern void skb_queue_head_init(struct sk_buff_head *list);
extern void skb_queue_tail(struct sk_buff_head *list, struct sk_buff *newsk);
extern struct sk_buff *skb_dequeue(struct sk_buff_head *list);
extern void skb_queue_purge(struct sk_buff_head *list);
extern u32 skb_queue_len(const struct sk_buff_head *list);
extern int skb_queue_empty(const struct sk_buff_head *list);
extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, u32 length, gfp_t gfp_mask);
extern struct sk_buff *skb_copy(const struct sk_buff *src, gfp_t gfp);
extern struct sk_buff *skb_clone(const struct sk_buff *skb, gfp_t gfp);
#endif
@@ -1,7 +1,7 @@
#ifndef _LINUX_SPINLOCK_H
#define _LINUX_SPINLOCK_H
#include <linux/types.h>
#include "types.h"
typedef struct spinlock {
volatile unsigned char __locked;
@@ -1,8 +1,8 @@
#ifndef _LINUX_TIMER_H
#define _LINUX_TIMER_H
#include <linux/types.h>
#include <linux/compiler.h>
#include "types.h"
#include "compiler.h"
struct timer_list {
void (*function)(unsigned long data);
@@ -1,13 +1,15 @@
#ifndef _LINUX_WAIT_H
#define _LINUX_WAIT_H
#include <linux/types.h>
#include <linux/compiler.h>
#include "types.h"
#include "compiler.h"
struct wait_queue_head {
unsigned char __opaque[128];
};
typedef struct wait_queue_head wait_queue_head_t;
static inline void init_waitqueue_head(struct wait_queue_head *wq)
{
(void)wq;
@@ -98,6 +98,11 @@ extern void cfg80211_connect_bss(struct net_device *dev,
size_t resp_ie_len,
u16 status,
gfp_t gfp);
extern void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
struct station_parameters *params, gfp_t gfp);
extern void cfg80211_rx_mgmt(struct wireless_dev *wdev, u32 freq, int sig_dbm,
const u8 *buf, size_t len, gfp_t gfp);
extern void cfg80211_sched_scan_results(struct wiphy *wiphy, u64 reqid);
extern void cfg80211_ready_on_channel(struct wireless_dev *wdev,
u64 cookie,
struct ieee80211_channel *chan,
@@ -34,6 +34,48 @@ struct ieee80211_bss_conf {
u16 beacon_int;
};
enum ieee80211_sta_state {
IEEE80211_STA_NOTEXIST,
IEEE80211_STA_NONE,
IEEE80211_STA_AUTH,
IEEE80211_STA_ASSOC,
IEEE80211_STA_AUTHORIZED,
};
enum set_key_cmd {
SET_KEY,
DISABLE_KEY,
};
struct ieee80211_ops {
void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
int (*start)(struct ieee80211_hw *hw);
void (*stop)(struct ieee80211_hw *hw);
int (*add_interface)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
void (*remove_interface)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
int (*config)(struct ieee80211_hw *hw, u32 changed);
void (*bss_info_changed)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *info, u32 changed);
int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, enum ieee80211_sta_state old_state,
enum ieee80211_sta_state new_state);
int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd,
struct ieee80211_vif *vif, struct ieee80211_sta *sta,
struct key_params *key);
void (*sw_scan_start)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, const u8 *mac_addr);
void (*sw_scan_complete)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
int (*sched_scan_start)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void *req);
void (*sched_scan_stop)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
};
#define BSS_CHANGED_ASSOC (1U << 0)
#define BSS_CHANGED_BSSID (1U << 1)
#define BSS_CHANGED_ERP_CTS_PROT (1U << 2)
#define BSS_CHANGED_HT (1U << 3)
#define BSS_CHANGED_BASIC_RATES (1U << 4)
#define BSS_CHANGED_BEACON_INT (1U << 5)
#define BSS_CHANGED_BANDWIDTH (1U << 6)
extern struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
const void *ops,
const char *requested_name);
@@ -43,5 +85,8 @@ extern void ieee80211_unregister_hw(struct ieee80211_hw *hw);
extern void ieee80211_queue_work(struct ieee80211_hw *hw, void *work);
extern void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted);
extern void ieee80211_connection_loss(struct ieee80211_vif *vif);
extern int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid, u16 timeout);
extern int ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, u16 tid);
extern void ieee80211_beacon_loss(struct ieee80211_vif *vif);
#endif