Linux USB MSC architecture
Figure 1 shows the block- level architecture when an MSC device is connected to a standard Linux host. The Linux device’s MSC architecture consists of two parts: the storage subsystem and the rSB subsystem. In the Linux framework, the sirtual File System ( sFS) layer is used to abstract the storage and the rSB layers. The gadget driver, being rSB controller- specific, collects the rSB transfers and identifies to which function the transfer belongs ( e. g., the bthernet packet, the MSC packet, etc). If it is an MSC packet, the gadget driver sends the packet to the mass storage driver. Inside the class driver, the SCSI commands are decoded, and appropriate storage operations are done using the sFS layer. SCSI ( Small Computer Systems Interface) is a standard for the transfer of data between two devices. The entire blocks are implemented in kernel space.
ln the host side, the rSB core drivers detect the rSB device and expose it as a block device. The data is transferred to the block layer as SCSI commands, with the help of the storage driver.