I'm USB in Linux, I'm a USB flash drive (13) device roster

Source: Internet
Author: User

 

Storage_probe is a very interesting function with a total length of less than 100 rows, but has done a lot of things. It is like the Back Waist on the football field, such as Chelsea's mark le. It is not remarkable on the court, however, they have made outstanding contributions to the entire team.

 

Let's continue to read the storage_probe code:

 

972 mutex_init (& (us-> dev_mutex ));

 

973 init_MUTEX_LOCKED (& (us-> sema ));

 

974 init_completion (& (us-> notify ));

 

975 init_waitqueue_head (& us-> delay_wait );

 

976

 

977/* Associate the us_data structure with the USB device */

 

978 result = associate_dev (us, intf );

 

979 if (result)

 

980 goto BadDevice;

 

981

 

982 /*

 

983 * Get the unusual_devs entries and thedescriptors

 

984 *

 

985 * id_index is calculated in thedeclaration to be the index number

 

986 * of the match from the usb_device_idtable, so we can find

 

987 * corresponding entry in the privatetable.

 

988 */

 

989 result = get_device_info (us, id );

 

990 if (result)

 

991 goto BadDevice;

 

992

 

The storage_probe function is short because it calls a large number of functions. So it seems that a short piece of code actually takes several hours to read the code.

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.