* Use defines for the SCSI commands instead of the numeric opcode directly
* Colorize the trace output for easier syslog reading * Add usb_floppy to the default image * disable error tracing git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38411 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -249,6 +249,7 @@ AddDriversToHaikuImage midi : $(SYSTEM_ADD_ONS_DRIVERS_MIDI) ;
|
|||||||
AddDriversToHaikuImage bus : usb_raw fw_raw ;
|
AddDriversToHaikuImage bus : usb_raw fw_raw ;
|
||||||
AddDriversToHaikuImage disk floppy : $(X86_ONLY)pc_floppy ;
|
AddDriversToHaikuImage disk floppy : $(X86_ONLY)pc_floppy ;
|
||||||
AddDriversToHaikuImage disk usb : usb_disk ;
|
AddDriversToHaikuImage disk usb : usb_disk ;
|
||||||
|
AddDriversToHaikuImage disk usb : usb_floppy ;
|
||||||
AddDriversToHaikuImage printer usb : usb_printer ;
|
AddDriversToHaikuImage printer usb : usb_printer ;
|
||||||
AddDriversToHaikuImage disk virtual : nbd ;
|
AddDriversToHaikuImage disk virtual : nbd ;
|
||||||
AddDriversToHaikuImage dvb : cx23882 ;
|
AddDriversToHaikuImage dvb : cx23882 ;
|
||||||
|
|||||||
@@ -21,13 +21,13 @@
|
|||||||
#define DEVICE_NAME DEVICE_NAME_BASE"%ld/%d/raw"
|
#define DEVICE_NAME DEVICE_NAME_BASE"%ld/%d/raw"
|
||||||
|
|
||||||
|
|
||||||
#define TRACE_USB_DISK
|
//#define TRACE_USB_DISK
|
||||||
#ifdef TRACE_USB_DISK
|
#ifdef TRACE_USB_DISK
|
||||||
#define TRACE(x...) dprintf(DRIVER_NAME": "x)
|
#define TRACE(x...) dprintf("\x1B[35m"DRIVER_NAME"\x1B[0m: "x)
|
||||||
#define TRACE_ALWAYS(x...) dprintf(DRIVER_NAME": "x)
|
#define TRACE_ALWAYS(x...) dprintf("\x1B[35m"DRIVER_NAME"\x1B[0m: "x)
|
||||||
#else
|
#else
|
||||||
#define TRACE(x...) /* nothing */
|
#define TRACE(x...) /* nothing */
|
||||||
#define TRACE_ALWAYS(x...) dprintf(DRIVER_NAME": "x)
|
#define TRACE_ALWAYS(x...) dprintf("\x1B[35m"DRIVER_NAME"\x1B[0m: "x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -128,8 +128,6 @@ status_t usb_disk_synchronize(device_lun *lun, bool force);
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
usb_disk_free_device_and_luns(disk_device *device)
|
usb_disk_free_device_and_luns(disk_device *device)
|
||||||
{
|
{
|
||||||
@@ -319,7 +317,7 @@ usb_disk_send_diagnostic(device_lun *lun)
|
|||||||
uint8 commandBlock[12];
|
uint8 commandBlock[12];
|
||||||
memset(commandBlock, 0, sizeof(commandBlock));
|
memset(commandBlock, 0, sizeof(commandBlock));
|
||||||
|
|
||||||
commandBlock[0] = 0x1D;
|
commandBlock[0] = SCSI_SEND_DIAGNOSTIC;
|
||||||
commandBlock[1] = (lun->logical_unit_number << 5) | 4;
|
commandBlock[1] = (lun->logical_unit_number << 5) | 4;
|
||||||
|
|
||||||
status_t result = usb_disk_operation(lun, commandBlock, NULL,
|
status_t result = usb_disk_operation(lun, commandBlock, NULL,
|
||||||
@@ -811,7 +809,7 @@ usb_disk_block_read(device_lun *lun, uint32 blockPosition, uint16 blockCount,
|
|||||||
uint8 commandBlock[12];
|
uint8 commandBlock[12];
|
||||||
memset(commandBlock, 0, sizeof(commandBlock));
|
memset(commandBlock, 0, sizeof(commandBlock));
|
||||||
|
|
||||||
commandBlock[0] = 0xA8;
|
commandBlock[0] = SCSI_READ_12;
|
||||||
commandBlock[1] = lun->logical_unit_number << 5;
|
commandBlock[1] = lun->logical_unit_number << 5;
|
||||||
commandBlock[2] = blockPosition >> 24;
|
commandBlock[2] = blockPosition >> 24;
|
||||||
commandBlock[3] = blockPosition >> 16;
|
commandBlock[3] = blockPosition >> 16;
|
||||||
@@ -842,7 +840,7 @@ usb_disk_block_write(device_lun *lun, uint32 blockPosition, uint16 blockCount,
|
|||||||
uint8 commandBlock[12];
|
uint8 commandBlock[12];
|
||||||
memset(commandBlock, 0, sizeof(commandBlock));
|
memset(commandBlock, 0, sizeof(commandBlock));
|
||||||
|
|
||||||
commandBlock[0] = 0xAA;
|
commandBlock[0] = SCSI_WRITE_12;
|
||||||
commandBlock[1] = lun->logical_unit_number << 5;
|
commandBlock[1] = lun->logical_unit_number << 5;
|
||||||
commandBlock[2] = blockPosition >> 24;
|
commandBlock[2] = blockPosition >> 24;
|
||||||
commandBlock[3] = blockPosition >> 16;
|
commandBlock[3] = blockPosition >> 16;
|
||||||
|
|||||||
@@ -15,9 +15,10 @@ typedef enum {
|
|||||||
SCSI_INQUIRY_6 = 0x12,
|
SCSI_INQUIRY_6 = 0x12,
|
||||||
SCSI_MODE_SENSE_6 = 0x1a,
|
SCSI_MODE_SENSE_6 = 0x1a,
|
||||||
SCSI_START_STOP_UNIT_6 = 0x1b,
|
SCSI_START_STOP_UNIT_6 = 0x1b,
|
||||||
|
SCSI_SEND_DIAGNOSTIC = 0x1d,
|
||||||
SCSI_READ_CAPACITY_10 = 0x25,
|
SCSI_READ_CAPACITY_10 = 0x25,
|
||||||
SCSI_READ_10 = 0x28,
|
SCSI_READ_12 = 0xA8,
|
||||||
SCSI_WRITE_10 = 0x2a,
|
SCSI_WRITE_12 = 0xAA,
|
||||||
SCSI_SYNCHRONIZE_CACHE_10 = 0x35,
|
SCSI_SYNCHRONIZE_CACHE_10 = 0x35,
|
||||||
} scsi_operations;
|
} scsi_operations;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user