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
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
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
usb_stor_exit (void)
1083 {
1084 US_DEBUGP ("usb_stor_exit () called/n ");
1085
1086/* Deregister the driver
1087 * This will cause disconnect () to be called for each
1088 * attached unit
1089 */
1090 US_DEBUGP ("-- calling usb_deregister ()/n ");
1091 usb_deregister ( usb_storage_driver );
1092
1093/* Don't return until all of our control and scanning threads
1094 * have exited. Since each thread signals threads_gone as its
1095 * last act, we have to call wait_for_completion the right number
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 drives are not only USB devices but also "disks". They also need to comply with the USB Mass Storage protocol and Transparent SCSI specifications. From the driver's perspective, it is similar
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
Objective: To study USB in depth and take notes here. Welcome to the discussion.
[Linux 3.2] [Driver/USB/CORE/hub. C]
Function: usb_hub_init
int usb_hub_init(void){if (usb_register(hub_driver)
Usb_hub_init mainly implements two functions: one is to register the hub driver, and the other is to start a kernel thread named khubd (this thread can be seen through P
threads_gone as its
1095* Last act, we have to call wait_for_completion the rightNumber
1096* Of times.
1097*/
1098While(Atomic_read ( total_threads)> 0 ){
1099Wait_for_completion ( threads_gone );
1100Atomic_dec ( total_threads );
1101}
1102
1103Usb_usual_clear_present (usb_us_type_stor );
1104}
1105
1106 module_init (usb_stor_init );
1107 module_exit (usb_stor_exit );
In fact,Module_init/module_exitIt's just a macro. Generally, a module writer will give his own initialization function and log
Let's continue with the previous section. Fill_inquiry_response (), which is from drivers/USB/storage/USB. C.
266 void fill_inquiry_response (struct us_data * us, unsigned char * data,
267 unsigned int data_len)
268 {
269 If (data_len
270 return;
271
272 if (data [0] 0x20) {/* USB device currently not connected. Return
273 peripheral qualifier 001b (".
Let's continue with the previous section. Fill_inquiry_response (), which is from drivers/usb/storage/usb. c.
266 void fill_inquiry_response (struct us_data * us, unsigned char * data,
267 unsigned int data_len)
268 {
269 if (data_len
270 return;
271
272 if (data [0] 0x20) {/* USB device currently not connected. Return
273 peripheral qualifier 001b ("..
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 compare whether this product is from Genesys Logic. If yes, consider this latency. Otherwise, you will not need to use it.Line 3, tr
days before and after the spring equinox and three days before and after the autumn equinox, every reincarnation of manzhu and Sha Hua on the huangquan road smells the fragrance of the other side of the flower, you can think of yourself in the past, and swear not to separate, but only at this moment, because they will fall into the curse of the reincarnation, the soul through the guidance of flowers, to the Nether.
The Linux kernel introduces a daem
. From then on, Manzhu shahua is also called another shore flower, which means the flowers that are open to heaven. the flowers are in the shape of a palm that is only praying to heaven, but it never appeared in this city again. She will be on the huangquan Road during the cross-shore Autumn period (three days before and after the spring equinox and three days before and after the autumn equinox, every reincarnation of Manzhu and Sha Hua on the huangquan Road smells the fragrance of the other si
drivers/usb/storage/protocol. h:
51/* struct scsi_cmnd transfer buffer accessutilities */
52 enum xfer_buf_dir {TO_XFER_BUF, FROM_XFER_BUF };
This parameter is actually a simple enumerated data type, and its meaning is also very simple: one indicates copying to the server load balancer> request_buffer, TO_XFER_BUF; the other indicates copying from the server load balancer> request_buffer, FROM_XFER_BUF. (Digression: XFER refers to TRANSFER, which
);
252 if (buflen
Request_bufflen)
253 corner stone> resid = Corner Stone> request_bufflen-buflen;
254}
The main call is the usb_stor_access_xfer_buf () function, which also comes from the same file: drivers/usb/storage/protocol. c:
159 unsigned int usb_stor_access_xfer_buf (unsignedchar * buffer,
160 unsigned intbuflen, struct scsi_cmnd * sulfate, unsigned int * index,
161 unsigned int * offset, enum xfer_buf_dir)
162 {
163 unsignedi
Article Title: three methods are supported for Linux-based USB devices. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Introduction
Universal Serial Bus (
From: http://hyt19860117.love.blog.163.com/blog/static/127773729201042435553852/
With the improvement of people's living standards, more and more USB devices are used, but Linux still does not fully Plug and Play in hardware configuration. how to configure and use Linux is alsoThis article is intended to help you understand how to develop a
Installation Configuration minicom--------------------------------------------------
#
lsmod | grep usbserial(If you use the serial port directly, but do not use USB to switch serial device, this step can be skipped)
If there is usbserial, the system supports USB to the serial port.
Install minicom (fedora comes with minicom, this step can be skipped)
apt-get Install minicom
apt-get Install Lrzsz
Confi
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.