Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SAS to GUI. #350

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ typedef enum nwipe_device_t_ {
NWIPE_DEVICE_IEEE1394, // Unimplemented.
NWIPE_DEVICE_ATA,
NWIPE_DEVICE_NVME,
NWIPE_DEVICE_VIRT
NWIPE_DEVICE_VIRT,
NWIPE_DEVICE_SAS
} nwipe_device_t;

typedef enum nwipe_pass_t_ {
Expand Down
17 changes: 17 additions & 0 deletions src/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ int check_device( nwipe_context_t*** c, PedDevice* dev, int dcount )
case NWIPE_DEVICE_VIRT:
strcpy( next_device->device_type_str, "VIRT" );
break;

case NWIPE_DEVICE_SAS:
strcpy( next_device->device_type_str, " SAS" );
break;
}

if( strlen( (const char*) next_device->device_serial_no ) )
Expand Down Expand Up @@ -629,6 +633,19 @@ int nwipe_get_device_bus_type_and_serialno( char* device, nwipe_device_t* bus, c

strncpy( serialnumber, &result[15], 20 );
}
if( *bus == 0 )
{
if( strstr( result, "Transport protocol:" ) != 0 )
{
/* strip any leading or trailing spaces and left justify, +4 is the length of "bus type:" */
trim( &result[19] );

if( strncmp( &result[19], "SAS", 3 ) == 0 )
{
*bus = NWIPE_DEVICE_SAS;
}
}
}
}

/* close */
Expand Down
4 changes: 2 additions & 2 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* used by configure to dynamically assign those values
* to documentation files.
*/
const char* version_string = "0.32";
const char* version_string = "0.32.001";
const char* program_name = "nwipe";
const char* author_name = "Martijn van Brummelen";
const char* email_address = "[email protected]";
Expand All @@ -14,4 +14,4 @@ Modifications to original dwipe Copyright Andy Beverley <[email protected]>\n\
This is free software; see the source for copying conditions.\n\
There is NO warranty; not even for MERCHANTABILITY or FITNESS\n\
FOR A PARTICULAR PURPOSE.\n";
const char* banner = "nwipe 0.32";
const char* banner = "nwipe 0.32.001";