{"id":267785,"date":"2023-03-22T22:03:12","date_gmt":"2023-03-22T14:03:12","guid":{"rendered":"https:\/\/lrxjmw.cn\/tmlqdbcylcxy.html"},"modified":"2023-03-22T22:03:12","modified_gmt":"2023-03-22T14:03:12","slug":"tmlqdbcylcxy","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/tmlqdbcylcxy.html","title":{"rendered":"\u63a2\u79d8Linux lspci\u9a71\u52a8\u7f16\u7a0b\u539f\u7406\uff1a\u7a0b\u5e8f\u5458\u5fc5\u5907\u547d\u4ee4"},"content":{"rendered":"

\u5982\u679c\u4f60\u662f\u4e00\u540dLinux<\/a>\u9a71\u52a8\u7a0b\u5e8f\u5458\uff0c\u90a3\u4e48lspci\u547d\u4ee4<\/a>\u80af\u5b9a\u662f\u4f60\u7ecf\u5e38\u4f7f\u7528\u7684\u5de5\u5177\u4e4b\u4e00\u3002\u4f46\u662flinux\u4e0bsocket\u7f16\u7a0b\uff0c\u4f60\u662f\u5426\u771f\u6b63\u7406\u89e3lspci\u7684\u539f\u7406\u5462\uff1f\u4eca\u5929\uff0c\u6211\u4eec\u5c31\u6765\u6df1\u5165\u63a2\u8ba8\u4e00\u4e0blspci\u7684\u5de5\u4f5c\u539f\u7406\u3002<\/p>\n

1. lspci\u547d\u4ee4\u7b80\u4ecb<\/p>\n

2. lspci\u547d\u4ee4\u7684\u5b9e\u73b0\u539f\u7406<\/p>\n

linux \u4e32\u53e3\u9a71\u52a8\u7f16\u7a0b_linux \u9a71\u52a8\u7f16\u7a0b class_linux lspci \u9a71\u52a8\u7f16\u7a0b\u539f\u7406<\/p>\n

3. PCI\u603b\u7ebf\u67b6\u6784\u7b80\u4ecb<\/p>\n

4. PCI\u8bbe\u5907\u679a\u4e3e\u8fc7\u7a0b<\/p>\n

5. PCI\u8bbe\u5907\u9a71\u52a8\u7a0b\u5e8f\u6ce8\u518c\u8fc7\u7a0b<\/p>\n

linux lspci \u9a71\u52a8\u7f16\u7a0b\u539f\u7406_linux \u9a71\u52a8\u7f16\u7a0b class_linux \u4e32\u53e3\u9a71\u52a8\u7f16\u7a0b<\/p>\n

6.\u8bbe\u5907\u9a71\u52a8\u7a0b\u5e8f\u4e2d\u7684PCI\u64cd\u4f5c\u51fd\u6570<\/p>\n

7. PCI\u8bbe\u5907\u7684\u4e2d\u65ad\u5904\u7406<\/p>\n

8. lspci\u547d\u4ee4\u4e0e\u8bbe\u5907\u6811<\/p>\n

\u9996\u5148\uff0c\u6211\u4eec\u6765\u4e86\u89e3\u4e00\u4e0blspci\u547d\u4ee4\u3002lspci\u662f\u4e00\u4e2a\u7528\u4e8e\u5217\u51faPCI\uff08Peripheral Component Interconnect\uff09\u603b\u7ebf\u4e0a\u6240\u6709\u8bbe\u5907\u7684\u547d\u4ee4\u3002\u5b83\u53ef\u4ee5\u663e\u793a\u51faPCI\u8bbe\u5907\u7684\u4fe1\u606f\uff0c\u5982\u8bbe\u5907ID\u3001\u5236\u9020\u5546\u3001\u578b\u53f7\u7b49\u7b49\u3002\u540c\u65f6\uff0c\u5b83\u8fd8\u53ef\u4ee5\u5217\u51faPCI\u603b\u7ebf\u4e0a\u6240\u6709\u5df2\u7ecf\u52a0\u8f7d\u7684\u9a71\u52a8\u7a0b\u5e8f\u3002<\/p>\n

\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u6765\u63a2\u8ba8\u4e00\u4e0blspci\u547d\u4ee4\u7684\u5b9e\u73b0\u539f\u7406\u3002\u5728Linux\u5185\u6838\u4e2d\uff0clspci\u547d\u4ee4\u5b9e\u9645\u4e0a\u662f\u901a\u8fc7\u8bfb\u53d6\/sys\u6587\u4ef6\u7cfb\u7edf<\/a>\u4e2d\u7684\u76f8\u5173\u4fe1\u606f\u6765\u5b9e\u73b0\u7684\u3002\u5f53\u7528\u6237\u8f93\u5165lspci\u547d\u4ee4\u540e\uff0c\u5185\u6838\u4f1a\u6839\u636e\u8be5\u547d\u4ee4\u8c03\u7528sysfs\u63a5\u53e3\u6765\u8bfb\u53d6\/sys\/bus\/pci\u76ee\u5f55\u4e0b\u7684\u76f8\u5173\u4fe1\u606f\uff0c\u5e76\u5c06\u5176\u663e\u793a\u5728\u7ec8\u7aef\u4e0a\u3002<\/p>\n

\u90a3\u4e48\uff0c\u5728\u6df1\u5165\u63a2\u8ba8lspci\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u4e86\u89e3\u4e00\u4e9bPCI\u603b\u7ebf\u67b6\u6784\u76f8\u5173\u77e5\u8bc6\u3002PCI\u603b\u7ebf\u662f\u4e00\u79cd\u8ba1\u7b97\u673a\u6269\u5c55\u603b\u7ebf\u6807\u51c6\uff0c\u7528\u4e8e\u8fde\u63a5\u8ba1\u7b97\u673a\u4e3b\u677f\u548c\u5404\u79cd\u5916\u90e8\u786c\u4ef6\u8bbe\u5907\u3002PCI\u603b\u7ebf\u7531PCI\u6865\u3001PCI\u8bbe\u5907\u548cPCI\u63d2\u69fd\u4e09\u90e8\u5206\u7ec4\u6210\u3002<\/p>\n

\u5f53\u7cfb\u7edf\u542f\u52a8\u65f6\uff0cBIOS\u4f1a\u5bf9\u6240\u6709PCI\u8bbe\u5907\u8fdb\u884c\u679a\u4e3e\uff0c\u5e76\u4e3a\u6bcf\u4e2aPCI\u8bbe\u5907\u5206\u914d\u4e00\u4e2a\u552f\u4e00\u7684\u5730\u5740\u7a7a\u95f4\u3002\u63a5\u7740\uff0c\u5728Linux\u5185\u6838\u542f\u52a8\u65f6linux\u64cd\u4f5c\u7cfb\u7edf\u5b89\u88c5\uff0c\u5185\u6838\u4f1a\u8c03\u7528pci_register_driver()\u51fd\u6570\u6765\u6ce8\u518c\u6bcf\u4e2aPCI\u8bbe\u5907\u9a71\u52a8\u7a0b\u5e8f\u3002<\/p>\n

\u5728\u9a71\u52a8\u7a0b\u5e8f\u4e2d\uff0c\u5f00\u53d1\u8005\u9700\u8981\u5b9e\u73b0\u4e00\u4e9b\u7279\u5b9a\u7684\u51fd\u6570\u6765\u8fdb\u884c\u5bf9PCI\u8bbe\u5907\u7684\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u5728probe()\u51fd\u6570\u4e2d\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u521d\u59cb\u5316\u5e76\u6ce8\u518c\u8be5\u9a71\u52a8\u7a0b\u5e8f\u6240\u652f\u6301\u7684\u6240\u6709\u8bbe\u5907\uff1b\u5728remove()\u51fd\u6570\u4e2d\uff0c\u5219\u53ef\u4ee5\u6e05\u9664\u8be5\u9a71\u52a8\u7a0b\u5e8f\u6240\u652f\u6301\u7684\u6240\u6709\u8bbe\u5907\u3002<\/p>\n

\u5f53\u7528\u6237\u4f7f\u7528\u67d0\u4e2a\u88ab\u8be5\u9a71\u52a8\u7a0b\u5e8f\u652f\u6301\u7684\u8bbe\u5907\u65f6\uff0c\u5185\u6838\u4f1a\u8c03\u7528\u76f8\u5e94\u7684\u64cd\u4f5c\u51fd\u6570\u6765\u8fdb\u884c\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u5728\u7528\u6237\u5411\u8be5\u8bbe\u5907\u53d1\u9001\u6570\u636e\u65f6\uff0c\u5185\u6838\u4f1a\u8c03\u7528write()\u51fd\u6570\uff1b\u5728\u4ece\u8be5\u8bbe\u5907\u8bfb\u53d6\u6570\u636e\u65f6\uff0c\u5219\u4f1a\u8c03\u7528read()\u51fd\u6570\u3002<\/p>\n

\u53e6\u5916linux lspci \u9a71\u52a8\u7f16\u7a0b\u539f\u7406<\/strong>\uff0c\u5728\u5904\u7406\u4e2d\u65ad\u65f6linux lspci \u9a71\u52a8\u7f16\u7a0b\u539f\u7406<\/strong>\uff0c\u5185\u6838\u4e5f\u4f1a\u8c03\u7528\u76f8\u5e94\u7684\u4e2d\u65ad\u5904\u7406\u51fd\u6570\u6765\u5904\u7406\u5404\u79cd\u7c7b\u578b\u7684\u4e2d\u65ad\u4e8b\u4ef6\u3002<\/p>\n

\u6700\u540e\uff0c\u5728\u672c\u6587\u672b\u5c3e\uff0c\u6211\u4eec\u8fd8\u8981\u63d0\u5230\u4e00\u4e2a\u91cd\u8981\u8bdd\u9898\uff1alspci\u547d\u4ee4\u4e0e\u8bbe\u5907\u6811\u4e4b\u95f4\u7684\u5173\u7cfb\u3002\u4e8b\u5b9e\u4e0a\uff0c\u5728\u4f7f\u7528\u67d0\u4e9b\u5d4c\u5165\u5f0f\u7cfb\u7edf\u65f6\uff0c\u5e76\u4e0d\u652f\u6301\/sys\u6587\u4ef6\u7cfb\u7edf\u6216\u8005\u5176\u4ed6\u7c7b\u4f3c\u63a5\u53e3\u3002\u6b64\u65f6\uff0c\u6211\u4eec\u5c31\u9700\u8981\u901a\u8fc7\/devicetree\u6216\u5176\u4ed6\u65b9\u5f0f\u624b\u52a8\u914d\u7f6e\u5e76\u52a0\u8f7d\u7cfb\u7edf\u6240\u9700\u9a71\u52a8\u7a0b\u5e8f\u3002<\/p>\n

\u7efc\u4e0a\u6240\u8ff0\uff0c\u5bf9lspci\u547d\u4ee4\u53ca\u5176\u80cc\u540e\u5b9e\u73b0\u539f\u7406\u6709\u6df1\u523b\u7406\u89e3\u5bf9\u4e8eLinux\u9a71\u52a8\u7a0b\u5e8f\u5458\u800c\u8a00\u975e\u5e38\u91cd\u8981\u3002\u5e0c\u671b\u672c\u6587\u80fd\u591f\u5e2e\u52a9\u5927\u5bb6\u66f4\u597d\u5730\u638c\u63e1\u8fd9\u4e00\u6280\u80fd\uff0c\u5e76\u5728\u5de5\u4f5c\u4e2d\u53d6\u5f97\u66f4\u597d\u7684\u6548\u679c\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5982\u679c\u4f60\u662f\u4e00\u540dLinux\u9a71\u52a8\u7a0b\u5e8f\u5458\uff0c\u90a3\u4e48lspci\u547d\u4ee4\u80af\u5b9a\u662f\u4f60\u7ecf\u5e38\u4f7f\u7528\u7684\u5de5\u5177\u4e4b\u4e00\u3002lspci\u547d\u4ee4\u7684\u5b9e\u73b0\u539f\u7406\u8bbe\u5907\u9a71\u52a8\u7a0b\u5e8f\u4e2d\u7684PCI\u64cd\u4f5c\u51fd\u6570\u63a5\u7740\uff0c\u5728Linux\u5185\u6838\u542f\u52a8\u65f6\uff0c\u5185\u6838\u4f1a\u8c03\u7528pci_register_driver()\u51fd\u6570\u6765\u6ce8\u518c\u6bcf\u4e2aPCI\u8bbe\u5907\u9a71\u52a8\u7a0b\u5e8f\u3002\u5728\u9a71\u52a8\u7a0b\u5e8f\u4e2d\uff0c\u5f00\u53d1\u8005\u9700\u8981\u5b9e\u73b0\u4e00\u4e9b\u7279\u5b9a\u7684\u51fd\u6570\u6765\u8fdb\u884c\u5bf9PCI\u8bbe\u5907\u7684\u64cd\u4f5c\u3002\u5f53\u7528\u6237\u4f7f\u7528\u67d0\u4e2a\u88ab\u8be5\u9a71\u52a8\u7a0b\u5e8f\u652f\u6301\u7684\u8bbe\u5907\u65f6\uff0c\u5185\u6838\u4f1a\u8c03\u7528\u76f8\u5e94\u7684\u64cd\u4f5c\u51fd\u6570\u6765\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n","protected":false},"author":1,"featured_media":267786,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-267785","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/267785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=267785"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/267785\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/267786"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=267785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=267785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=267785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}