LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 10-17-2019, 02:00 AM   #1
kimi_2019
LQ Newbie
 
Registered: Oct 2019
Posts: 4

Rep: Reputation: Disabled
Smile Is there any way to handle scsi command in usb mass storage protocol in userspace


I was working on an embedded linux device(which has kernel version 3.10.14). My target is to communicate with this device by a windows PC via SCSI command (so that it will not request any driver on Windows PC). And in the kernel source, I found the scsi command was directly processed by the kernel driver (in function do_scsi_command in driver/usb/gadget/f_mass_storage.c), but this doesn't meet my need, I need to process the scsi command in userspace, so that I can control other H/W modules like camera, uart on this device, read/write files, etc. Is there any way to do this?
 
Old 10-17-2019, 06:58 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
This perhaps: https://www.systutorials.com/docs/linux/man/8-sg_raw/.
 
Old 10-17-2019, 07:50 PM   #3
kimi_2019
LQ Newbie
 
Registered: Oct 2019
Posts: 4

Original Poster
Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by berndbausch View Post
Thanks a lot. But I think this doesn't meet my requirement. My scenario is: my embeded device was recognized as an USB mass storage device by Windows PC, So I can send scsi command by calling DeviceIoControl API in my windows application. but the scsi command was processed by kernel driver on my embeded device, I want to find a way which can pass through scsi command to userspace
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to process SCSI command in USB mass storage gadget in userspace kimi_2019 Linux - Kernel 1 10-17-2019 07:00 PM
[SOLVED] HOWTO handle Bad Block in mass storage device Niraj Kulkarni Linux - Newbie 3 11-05-2009 12:39 AM
SCSI error: return code = 0x10000 on USB Mass Storage device gringer Linux - Hardware 4 05-14-2007 06:43 AM
Problem with MAC-level multicasts in userspace protocol elrusso Linux - Networking 0 02-01-2005 06:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 02:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration