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
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
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
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
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
);
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
size of all device descriptors behind 4, know the remaining device descriptor size, you can read the remaining device descriptors 5. Then put the device into the Usb_bus_type's dev link list 6. Remove the Usb_bus_type from the driver list Usb_driver 7, the Usb_interface and usb_driver of the id_table comparison (for the USB mouse is the ultimate comparison of the interface descriptor under the Binterfaceclass;binterfacesubclass; Binterfaceprotocol; t
Linux USB driver workflow 1. in the Linux driver of a USB host, the USB driver is at the bottom of the USB host controller hardware. The driver runs on it and the USB core layer on the
Linux under the ADB drive problemLinux under the use of mobile phone USB debugging mode to connect ADB to the Android program debugging, configuration driver without windows to intuitive.The first step is to confirm that the phone is connected to the computer, LSUSB check the device record.[Email protected]:~$ LsusbBus 007 Device 009:id 18d1:4e12Bus 007 Device 001:id 1d6b:0002
Linux USBDevice Driver Framework Analysis
In fact, all the device drivers in Linux follow the same Convention-representing the structure of the driver program (which is more appropriate with the driver, it should be called a better driver, the struct should contain all the resources required by the driver. In terms of terms, it is the attributes and members of the drive object. Since the
Take notes on the USB Kernel in Linux-general Linux technology-Linux programming and kernel information. For details, refer to the following section. In Linux, the software structure of the USB subsystem is
(400) {this. resized
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.