這是一個想要從 userspace 一直深入到 driver,理解 Linux packet 究竟如何運行的流程圖。 我在交大做的東西都在 driver space,使用 ath9k/ath10k 做實驗。我所理解的是 ath9k 上面對著 mac80211 (Linux 的 softmac),也就是說,driver 在功能上,只需要實做struct ieee80211_ops 的功能即可。主要都在 …
分類: kernel
問題在於 kernel buffer 不足。 http://lists.netfilter.org/pipermail/netfilter/2007-February/067929.html 解法: echo 500000 > /proc/sys/net/core/rmem_max
32-bit paging: CR0.PG = 1 & CR4.PAE = 0 (section 4.3) CR0.WP CR4.PSE CR4.PGE CR4.SMEP CR4.SMAP PAE paging; CR0.PG = 1 & CR4.PAE = 1 & IA32_EFER.LME = 0 (section 4.4) CR0.WP CR4.PGE CR4.SMEP …
今天在處理 netlink 的時候,使用 Python 當作 user-space 承接來自 kernel-space 訊息的工具。我的情況是大約每 10ms 會由 kernel-space 發起一次 netlink multicast 到 user-space。當在運行 user-space script 的時候,過一陣子會出現這個錯誤: [crayon-63d80f238515657614574 …
在 Linux kernel 當中有許多的 common struct,例如說 ieee80211_txq 這樣的結構,透過這樣的方式,可以讓不同的 driver 重用相同的 struct。但是,針對每個不同的 driver,還是會有不同的 private data,這時候就會用 private data struct 的方式來處理。 例如說,struct ieee80211_txq 是 mac80 …
from net/mac80211/sta_info.c, define at include/linux/kernel.h [crayon-63d80f238550d068075763/] __must_be_array: 檢查 a 是否為 array,當 a 為 array 時,會因為 &(a)[0] 變成 pointer,而讓 __same_type 產生 0 的結果,反之如果 a 為 …
ieee80211_local *local 用途: contains information about the real hardware, and is created when the interface is first added. (Daniel Caps Mur, Linux Wi-Fi open source drivers-mac80211,ath9k/ath5k-, pp.1) …
以 linux-4.19-rc2 為例,平台為 TP-Link WDR4300。程式碼以 linux-4.19-rc2 為準,有特別標示者以 OpenWrt/LEDE 為準。 1. ath9k 驅動程式註冊點:ath9k/init.c#ath9k_init(void) [crayon-63d80f23859f9301031186/] 主要有三件事情,(1) 初始化 PCI 匯流排、(2) 初始化 A …
from include/uapi/linux/kernel.h and scripts/dtc/dtc.h [crayon-63d80f2385e21746210770/]
1. Config LEDE/OpenWRT with CONFIG_PACKAGE_perf=y CONFIG_KERNEL_PERF_EVENTS=y 2. Add dynamic probe with external modules [crayon-63d80f2385fc9750966181/] 3. Perf Recording [crayon-63d80f2385fce98697630 …