[問題] Driver Modules 引用Kernel func方式?

看板LinuxDev作者 (瑞奇馬汀)時間3年前 (2020/10/14 14:16), 編輯推噓7(7015)
留言22則, 5人參與, 3年前最新討論串1/1
Hello 因為工作需要,要做mmc/sdio Driver Modules 網卡 因底層設定 mmc/sdio 引用和 device tree 還在 Kernel 中 需要在 v4.19\drivers\misc\mediatek\connectivity\common\wmt_build_in_adapter.c 修改設定 要和外部 網卡Driver Source code modules\connectivity\wmt_mt66xx\common_detect\mtk_wcn_stub_alps.c 引用Kernel wmt_build_in_adapter.c 中的function 請問Modules應該如何引用Kernel程式? 或是那裡有資料可以參考? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 210.243.225.199 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/LinuxDev/M.1602656213.A.440.html

10/14 16:44, 3年前 , 1F
編譯module的時候宣告要用的kernel function的定義.
10/14 16:44, 1F

10/14 16:45, 3年前 , 2F
通常是用#include .h 檔案的方式.若沒有.h檔,就自己
10/14 16:45, 2F

10/14 16:46, 3年前 , 3F
在C檔案要用的的地方前加上 function 的宣告
10/14 16:46, 3F

10/15 00:12, 3年前 , 4F
external 之類的有點忘了...
10/15 00:12, 4F

10/15 00:46, 3年前 , 5F
EXPORT_SYMBOL(func) 看看?
10/15 00:46, 5F

10/15 00:58, 3年前 , 6F

10/15 00:58, 3年前 , 7F
不過這是舊版的語法...m..
10/15 00:58, 7F

10/15 01:55, 3年前 , 8F
10/15 01:55, 8F

10/21 10:34, 3年前 , 9F
所以export有成功嗎
10/21 10:34, 9F

10/25 22:01, 3年前 , 10F
副程式有成功但device tree 引用還是有問題
10/25 22:01, 10F

10/28 13:10, 3年前 , 11F
不管是使用 device tree 或是 platform data structure
10/28 13:10, 11F

10/28 13:10, 3年前 , 12F
去 describing 給kernel,最後都能用 platform_driver_r
10/28 13:10, 12F

10/28 13:10, 3年前 , 13F
egister() 要求kernel match, 成功後就會呼叫你定義的 pr
10/28 13:10, 13F

10/28 13:11, 3年前 , 14F
obe(), 重點來了,之後你才能從 probe()內去get 剛剛 dev
10/28 13:11, 14F

10/28 13:11, 3年前 , 15F
ice tree 的 describe
10/28 13:11, 15F

10/28 18:07, 3年前 , 16F
10/28 18:07, 16F

12/14 22:23, 3年前 , 17F
兩個月沒文了...路過
12/14 22:23, 17F

12/15 12:09, 3年前 , 18F
現在linux kernel 相關的技術已經沒那麼深奧,很多資訊
12/15 12:09, 18F

12/15 12:10, 3年前 , 19F
大陸農場或bootlin 上都能查到研究到
12/15 12:10, 19F

12/15 17:24, 3年前 , 20F
那薪水百萬還是很少嗎
12/15 17:24, 20F

12/15 17:58, 3年前 , 21F
我說做這個的年薪百萬的人很少嗎
12/15 17:58, 21F

12/16 16:03, 3年前 , 22F
越來越少了
12/16 16:03, 22F
文章代碼(AID): #1VXfVLH0 (LinuxDev)
文章代碼(AID): #1VXfVLH0 (LinuxDev)