, structusb_sg_request actually represents a scattergather request. From the perspective of our non-USB core layer, the usage of these two structs is the same. For each urb request, all we do is apply for a struct variable or request a pointer, and then apply for memory. The second step is to submit urb, that is, call usb_submit_urb ().Core will help us solve the problem. Every module in Linux provides serv
Install ubuntu on a USB flash drive and start Linux from the USB flash drive.
If we install the Linux system directly on our hard disk, the GRUB of Linux will overwrite the boot guide of window. It is not convenient to carry. So I want to install a ubuntu system on a
This story uses kernel code 2.6.22. In the Linux kernel code directory, all the code related to the device driver is under the drivers/Directory. Using the ls command in this directory, you can see many subdirectories: lfg1: /usr/src/linux-2.6.22/drivers # lsKconfi...
This story uses kernel code 2.6.22. In the Linux kernel code directory, all the code related to
course, after the value is assigned, it represents an array name, just as we have defined the value assigned in struct usb_driver usb_storage_driver ,. id_table = storage_usb_ids. Well, let's take a look at the structure of usb_device_id.
Struct usb_device_id from include/Linux/mod_devicetable.h:
98 struct usb_device_id {
99/* whichfields to match against? */
100 _ match_flags;
101
102/* used for product specificmatches; range is random */
103 _ 16id
unsigned int delay_use = 5;
111 module_param (delay_use, uint, S_IRUGO | S_IWUSR );
112 MODULE_PARM_DESC (delay_use, "seconds todelay before using a new device ");
Set delay_use to 5, while module_param is a macro provided by Linux Kernel 2.6, so that delay_use can be set when the module is loaded. (If this parameter is not set, the value 5 indicates that a new device is waiting for a delay of 5 seconds .) Why latency? When the inserted
USB flash drive to install Linux system, unplug the USB drive system cannot bootProblem Description:Use a USB stick to install the Linux operating system, excluding the USB stick, unable to boot the system normally, you must inser
U disk boot and installation of Linux (not to install Linux on the u disk) 1. DiskGenius.exe this software can meet my needs, try it, it is still very useful.DiskGenius Software InterfaceCreate a usb hdd boot diskUse this software to make the USB flash drive into a usb hdd b
Udisk boot installation linux( not the installation of linux5111.diskgenius.exe on the udisk can meet my needs. I tried it and it is still very useful. The DiskGenius software interface is used to create a usb hdd boot disk. this software is used to create a usb hdd boot disk. at this time, the USB flash disk can be st
The following describes the usb_stor_control_thread () function. What wakes up is the up ( (us-> sema) from the queuecommand, and us-> sulfate is assigned to the Server Load balancer, in contrast, the Server Load balancer is a parameter passed in when the SCSI core layer calls the queuecommand. Focus on usb_stor_control_thread (). Row 3: As mentioned earlier, we have to look at the dev_mutex lock from a higher perspective after reading the entire module.
Line 3: If us_fw.x_disconnecting is set,
The following describes the usb_stor_control_thread () function. What wakes up is the up ( (US-> SEMA) from the queuecommand, and us-> sulfate is assigned to the Server Load balancer, in contrast, the Server Load balancer is a parameter passed in when the SCSI core layer calls the queuecommand. Focus on usb_stor_control_thread (). Row 3: As mentioned earlier, we have to look at the dev_mutex lock from a higher perspective after reading the entire module.
Line 3: If us_fw.x_disconnecting is set,
unsigned int delay_use = 5;
111 module_param (delay_use, uint, s_irugo | s_iwusr );
112 module_parm_desc (delay_use, "seconds todelay before using a new device ");
Set delay_use to 5, while module_param is a macro provided by Linux kernel 2.6, so that delay_use can be set when the module is loaded. (If this parameter is not set, the value 5 indicates that a new device is waiting for a delay of 5 seconds .) Why latency? When the inserted
-storage: devicescan complete \ n ");
936
937/* shocould we unbind if no devices weredetected? */
938}
939
940 scsi_host_put (us_to_host (us ));
941 complete_and_exit ( threads_gone, 0 );
942}
Row 3, where does delay_use come from? In the same file, a static variable is defined at the beginning:
110 static unsigned int delay_use = 5;
111 module_param (delay_use, uint, S_IRUGO | S_IWUSR );
112 MODULE_PARM_DESC (delay_use, "seconds todelay before using a new device ");
Set delay_use to
who was involved in developing the USB subsystem in the Linux Kernel told me that a LUN is a driver in the device. The following is an example of the purpose of introducing LUN in USB. Some card readers can have multiple slots, such as two, one supporting the CF card and the other supporting the SD card. In this case, distinguish the devices in these two slots,
compilation switches related to a variety of specific products. They have some defined transmission functions, while others share common functions.
Row 3: judge us-> flags. Remember the flags we mentioned when talking about the unusual_devs.h file. It was used for the first time. Some devices have set the flag us_fl_single_lun, indicating that it only has one Lun. There are a lot of devices like this, just grab one from unusual_devs.h:
596 unusual_dev (0x054c, 0x002d, 0x0100, 0x0100,
597 "Sony
Capture the USB flash drive as an iso file in linux and copy the USB flash drive in batches using iso
Sometimes we need to capture the entire USB flash drive as an iso file. This iso can be used to burn the disc. Of course, we can also use the software to burn it back to another US
We followed storage_probe () almost completely, and it seems that everything is about to end, but do you think you haven't understood how the device works so far? USB flash disks, not just USB devices or disks, must comply with the USB massstorage protocol and...
We followed storage_probe () almost completely, and it seems that everything is about to end, but do
impossible for you to pull it out. hot swapping is a major feature of USB devices.
Row 3 and host are also locks, so we can check the lock at the end.
Lines 326 to 330 are used to determine whether another flag has been set. the meaning of the flag US_FLDX_TIMED_OUT is also as literal, that is, timeout. The concept of timeout is everywhere in the computer world. However, for this flag, the function for setting it is command_abort. This function is
lines 3 and lines 3. Some companies' products have to be delayed by 989 μs in the command and data phases, at first, we found that Genesys logic's products had this problem, and later we found that more products had the same problem. Therefore, the flag us_fl_go_slow is used. If you are interested in looking at the early Linux kernel, you will find that there was actually no such flag. At that time, a usb_vendor_id_genesys is defined, directly compar
Hardware driver in Linux system-USB device (on)
There are more and more USB devices, while Linux is still not completely plug-and-play in hardware configuration. how to configure and use Linux is becoming a major problem for us. This article describes how to use and config
module_exit (usb_stor_exit );
In fact, module_init/module_exit is just a macro. generally, to show your own personality, the module writer will name their own initialization function and deregister function. for example, module_init (usb_stor_init) and module_exit (usb_stor_exit) is actually telling the world that the real functions are usb_stor_init and usb_stor_exit. This kind of trick is not uncommon in Linux kernel code, so you don't have to worr
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.