: 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
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
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
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/
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
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
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 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
tool for viewing all the partition tables in your system, including all USB devices, using root privileges to execute the following commands:[[emailprotected] ~]# fdisk-ldisk/dev/sda:21.5 GB, 21474836480 bytes, 41943040 sectorsunits = sectors of 1 * 512 = Bytessector Size (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 bytesdisk Labe L type:dosdisk identifier:0x0006c7ae Device Boot Start End Blocks Id system/dev/sda1 * 2 048
*/
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/
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
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
Objective: To study USB in depth and take notes here. Welcome to the discussion.
[Linux 3.2] [Driver/USB/CORE/devio. C]
Definition: usbfs_driver
struct usb_driver usbfs_driver = {.name ="usbfs",.probe =driver_probe,.disconnect =driver_disconnect,.suspend =driver_suspend,.resume =driver_resume,};
[Linux 3.2] [INCLUDE/
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.