How do I get the MAC address of the NIC in the kernel? It is also possible to get the MAC address according to the NIC.

xiaoxiao2021-03-05  23

WW7109 (STRANGER) 04-08-23 14:10

How do I get the MAC address of the NIC in the kernel? It is also possible to get the MAC address according to the NIC.

Reply to article: DL_DHT (Addict) 04-08-23 18:56

Re: How do I get the MAC address of the NIC in the kernel? Get the MAC address according to the Net card [Re: ww7109]

Reply struct net_device * dev = dev_get_by_name ("ethx"); dev-> dev_addr -------------------- Chicken voicemine shop, human trail board bridge cream. Article option : ZHANRK (Addict) 04-08-23 19:22

Re: How do I get the MAC address of the NIC in the kernel? Get the MAC address according to the Net card [Re: ww7109]

Reply is generally to read the NEP EEPROM to get the MAC address, such as the NE2K series. -------------------- http://jtager.sourceforge.net article option: aarecn (newbie) 04-08-24 11:24

Re: How do I get the MAC address of the NIC in the kernel? Get the MAC address according to the Net card [Re: ww7109]

Reply to the DEV-> dev_addr in the kernel to get the MAC address. Without the EEPROM, the MAC address is saved in the EEPROM, no EEPROM Get NIC MAC address is generally incompatible through the command line or bootloader, some network card Chip or CPU will have a separate The register is set to set the MAC address, but it is usually not available. Because the messages sent from the DEV_ADDR are filled with the address, except for some of the network accelerated chips. Article option: chfwang (newbie) 04-08-24 14:24

Re: How do I get the MAC address of the NIC in the kernel? Get the MAC address according to the Net card [Re: zhanrk]

Reply from the work from EEPROM read MAC address Driver has been done, so you can read the address inside the DEV structure. You can use the article: WW7109 (STRANGER) 04-08-24 21:27

Re: How do I get the MAC address of the NIC in the kernel? Get the MAC address according to the Net card [RE: DL_DHT]

Reply Thank you for your article:

转载请注明原文地址:https://www.9cbs.com/read-32325.html

New Post(0)