Install the wireless driver and ifconfig wlan0 up

Source: Internet
Author: User

After reading the code for a few days, some relationships have finally become a bit eye-catching.

Because the wireless device is a PCI device, the. probe function is called after the insmod driver.

. Probe = xxx_probe.

There are several notable points in the implementation of xxx_probe.

Void xxx_probe ()

{

// Ieee80211_alloc_hw allocates data related to the driver and hardware. If there is no time, attach the allocated figure.

Struct ieee80211_hw * ieee80211_alloc_hw (size_t priv_data_len, const struct ieee80211_ops * OPS)

 

Then there will be applications for IRQ Io, memory, and other resources.

DMA, etc.

...

// This function is called to register with the kernel after hardware resources are allocated.

Int ieee80211_register_hw (struct ieee80211_hw * HW)

{

...

// This function is particularly worth noting. It creates a net _ DEVICE data structure named wlanx and inserts the data structure into the global network device linked list.

Result = ieee80211_if_add (local, "WLAN % d", null,
Nl80211_iftype_station, null );

Int ieee80211_if_add (struct ieee80211_local * local, const char * Name,
Struct net_device ** new_dev, Enum nl80211_iftype type,
Struct vif_params * Params)

{Ndev = alloc_netdev_mq (sizeof (* sdata) + local-> HW. vif_data_size,
Name, ieee80211_if_setup, local-> HW. Queues );

}
...

}

 

}

 

 

Net_device is the most important data structure in the network. This is described in Linux driver and understanding Linux Network internals.

 

Now, the ifconfig wlan0 up command is used.

On the Linux Device Driver 508 page, we will not describe it here.

These relationships should be understood in this way and can be serialized. If you think there is any misunderstanding in the future, add it.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.