: 0x00000000
Device boot start end blocks ID system/Dev/sdc1 1 970 124115 B w95 FAT32Partition 1 has different physical/logical beginnings (non-Linux ?) :Phys = (0, 2, 0) logical = (0, 2, 27)
From the last few lines, we can see that the U disk is mounted under/dev/sdc1. Remember this mount point, which varies according to the Linux system.
Step 2: mount the USB
urb_list; //URB for this endpoint, maintained by the USB core
void *hcpriv;
struct Ep_device *ep_dev; / * for SYSFS info * /
unsigned Char*extra; /* Extra descriptors * /
int Extralen;
int enabled;
};
an int usb_hcd_link_urb_to_ep (struct USB_HCD *hcd, struct URB *urb) is called to add this urb to urb_ when invoking the USB device driver call Usb_submit_urb commit URB Request List on th
From the Protocol to the Protocol (above)
In structusb_driver, the prototype of. Probe and. Disconnect is as follows:
836 int (* probe) (struct usb_interface * INTF,
837 const struct usb_device_id * ID );
838
839 void (* disconnect) (struct usb_interface * INTF );
Let's take a look at the parameter structusb_device_id, Which is needless to say. As we have already introduced, where does struct usb_interface come from? Let's start with struct usb_device.
We know that each device corresponds to a s
Install a Linux system to a USB flash drive or a USB flash drive for a linux System
Step 1: First insert the usb flash drive to the usb interface of the Computer Host (it is recommended to insert the
the right of the equal sign are called. If struct us_data is the main character in usb mass storage, struct urb will become the main character in the whole USB subsystem without dispute. All USB drivers in Linux must also use urb. So what exactly does urb look like? You can find it in include/
In 1991, one introduced the concept of pipelines in Linux and used pipelines in many places, such as file systems and device drivers. So we can see that there are various pipelines in Linux. But the same thing is that all pipelines are used to transmit things, but some pipelines transmit real material while some pipelines transmit data.
The pipe we see in the USB
interface descriptor.
Row 3, struct us_unusual_dev, is the first occurrence of this struct, which is defined in drivers/USB/storage/USB. h:
61 struct us_unusual_dev {
62 constchar * vendorname;
63 const char * productname;
64 _ u8 useprotocol;
65 _ u8 usetransport;
66 int (* initfunction) (struct us_data *);
67 };
The find_unusual () function on the right of "=" is defined in drivers/
use another pointer to temporarily replace altsetting. Next we will use its members desc and endpoint.
Looking back at structusb_host_interface, we can see its two members: struct usb_interface_descriptor desc and struct usb_host_endpoint * endpoint. Among them, desc is needless to say, it is the interface descriptor of this interface, and the endpoint pointer records several endpoints, they are stored in the form of an array, and the endpoint points to the array header. These are all set duri
the layman. The USB device has a configuration, which we mentioned earlier, and there is another setting (setting ). A little strange, aren't these two words the same thing? Let's take our most familiar mobile phone for example. If you don't talk about the configuration, you just need to set it. Various configurations of a mobile phone may have been determined. For example, the vibration or ringtones are determined, and various functions are determin
, 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
Linux-USB Gadget
OverviewThe Linux-USB Gadget driver framework (hereinafter referred to as gadget) provides software functions for devices defined by the USB protocol.Compared with the Linux U
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
Come out and try again later. Basically, each directory in the Linux kernel has a Makefile. Makefile and Kconfig are just like a map of a city. a map shows us a city, while Makefile and Kconfig let us know what is under this directory...
"Come out and try again sooner or later ."
Basically, there is a Makefile under each directory in the Linux kernel. Makefile and Kconfig are like a map of a city. a map lea
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
*/
154 void * extra;/* any extradata */
155 extra_data_destructor extra_destructor;/* extra data destructor */
156 # ifdef config_pm
157 pm_hook suspend_resume_hook;
158 # endif
159 };
It is not difficult to find that every important data structure in the Linux kernel is complex. In short, this troublesome data structure is available to every device. In other words, we apply for a us_data for each device, because the edge in this structure wil
In 1991, one introduced the concept of pipelines in Linux and used pipelines in many places, such as file systems and device drivers. So we can see that there are various pipelines in Linux. But the same thing is that all pipelines are used to transmit things, but some pipelines transmit real material while some pipelines transmit data.
The pipe we see in the USB
"Come out and try again sooner or later ."
Basically, LinuxEach directory in the kernel has a makefile. MakefileAnd kconfigJust like a map of a city, a map leads us to know a city, while makefileAnd kconfigSo that we can understand the structure under this directory. Drivers/USB/storage/Makefile under the DirectoryThe content is as follows:
Lfg1:/usr/src/linux-2.6.22/Drivers/
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
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.