seagate / opensea-transport Goto Github PK
View Code? Open in Web Editor NEWCross platform library containing common set of functions to issue standard commands to storage devices.
License: Other
Cross platform library containing common set of functions to issue standard commands to storage devices.
License: Other
Hi,
When I built opensea-transport lib, it reports the error as below on my Ubuntu desktop with GCC:
leoy@leoy-ThinkPad-X240s:~/Work2/Develop/seagate/opensea-transport/Make/gcc$ make
rm -f lib/libopensea-transport.a lib/libopensea-transport.so* *.o ../../src/*.o
rm -rf lib
mkdir -p lib
cc -Wall -c -fPIC -I. -std=gnu99 -DSEA_NVME_IOCTL_H -D_GNU_SOURCE -I../../include -I../../include/vendor -I../../../opensea-common/include ../../src/ata_cmds.c -o ../../src/ata_cmds.o
In file included from ../../src/ata_cmds.c:15:
../../include/common_public.h:17:10: fatal error: common.h: No such file or directory
#include "common.h"
^~~~~~~~~~
compilation terminated.
Makefile:101: recipe for target '../../src/ata_cmds.o' failed
make: *** [../../src/ata_cmds.o] Error 1
I also searched my local repository and cannot find common.h header.
Thanks,
Leo
I have a number of drives in my system, and when using lsscsi
to list them the drives will show up in order of sg1, sg2,.. sg10, sg11, sg12,... But with openSeaChest_something -s
, they could only be shown up in alphabetical order like sg1, sg10, sg11,.. sg19, sg2, sg20, sg21,.. sg3, sg4, sg5,...
I could see that the problem is due to alphasort
used in scandir
:
opensea-transport/src/sg_helper.c
Line 1609 in 5ce7152
versionsort
could sort it in numeric order.from ata_helper_func.h
I could see these definitions:
//These functions below are commands that can be sent in PIO or DMA Mode.
//They will automatically try DMA if it is supported, then retry with PIO mode if the Translator or Driver doesn't support issuing DMA mode commands.
OPENSEA_TRANSPORT_API int send_ATA_Read_Log_Ext_Cmd(tDevice *device, uint8_t logAddress, uint16_t pageNumber, uint8_t *ptrData, uint32_t dataSize, uint16_t featureRegister);
OPENSEA_TRANSPORT_API int send_ATA_Write_Log_Ext_Cmd(tDevice *device, uint8_t logAddress, uint16_t pageNumber, uint8_t *ptrData, uint32_t dataSize, bool forceRTFRs);
OPENSEA_TRANSPORT_API int send_ATA_Download_Microcode_Cmd(tDevice *device, eDownloadMicrocodeFeatures subCommand, uint16_t blockCount, uint16_t bufferOffset, uint8_t *pData, uint32_t dataLen, bool firstSegment, bool lastSegment, uint32_t timeoutSeconds);
OPENSEA_TRANSPORT_API int send_ATA_Trusted_Send_Cmd(tDevice *device, uint8_t securityProtocol, uint16_t securityProtocolSpecific, uint8_t *ptrData, uint32_t dataSize);
OPENSEA_TRANSPORT_API int send_ATA_Trusted_Receive_Cmd(tDevice *device, uint8_t securityProtocol, uint16_t securityProtocolSpecific, uint8_t *ptrData, uint32_t dataSize);
OPENSEA_TRANSPORT_API int send_ATA_Read_Buffer_Cmd(tDevice *device, uint8_t *ptrData);
OPENSEA_TRANSPORT_API int send_ATA_Write_Buffer_Cmd(tDevice *device, uint8_t *ptrData);
OPENSEA_TRANSPORT_API int send_ATA_Read_Stream_Cmd(tDevice *device, uint8_t streamID, bool notSequential, bool readContinuous, uint8_t commandCCTL, uint64_t LBA, uint8_t *ptrData, uint32_t dataSize);
OPENSEA_TRANSPORT_API int send_ATA_Write_Stream_Cmd(tDevice *device, uint8_t streamID, bool flush, bool writeContinuous, uint8_t commandCCTL, uint64_t LBA, uint8_t *ptrData, uint32_t dataSize);
//Similar to above, but for SCT stuff. This will automatically retry from DMA to PIO mode. Also removes GPL flag. Now depends on if device supports GPL or not internally (can be flipped in device->drive_info.ata_Options.generalPurposeLoggingSupported if you want to force a SMART command)
OPENSEA_TRANSPORT_API int send_ATA_SCT(tDevice *device, eDataTransferDirection direction, uint8_t logAddress, uint8_t *dataBuf, uint32_t dataSize, bool forceRTFRs);
OPENSEA_TRANSPORT_API int send_ATA_SCT_Status(tDevice *device, uint8_t *dataBuf, uint32_t dataSize);
OPENSEA_TRANSPORT_API int send_ATA_SCT_Command(tDevice *device, uint8_t *dataBuf, uint32_t dataSize, bool forceRTFRs);
OPENSEA_TRANSPORT_API int send_ATA_SCT_Data_Transfer(tDevice *device, eDataTransferDirection direction, uint8_t *dataBuf, uint32_t dataSize);
OPENSEA_TRANSPORT_API int send_ATA_SCT_Read_Write_Long(tDevice *device, eSCTRWLMode mode, uint64_t lba, uint8_t *dataBuf, uint32_t dataSize, uint16_t *numberOfECCCRCBytes, uint16_t *numberOfBlocksRequested);
OPENSEA_TRANSPORT_API int send_ATA_SCT_Write_Same(tDevice *device, eSCTWriteSameFunctions functionCode, uint64_t startLBA, uint64_t fillCount, uint8_t *pattern, uint64_t patternLength);
OPENSEA_TRANSPORT_API int send_ATA_SCT_Error_Recovery_Control(tDevice *device, uint16_t functionCode, uint16_t selectionCode, uint16_t *currentValue, uint16_t recoveryTimeLimit);
OPENSEA_TRANSPORT_API int send_ATA_SCT_Feature_Control(tDevice *device, uint16_t functionCode, uint16_t featureCode, uint16_t *state, uint16_t *optionFlags);
OPENSEA_TRANSPORT_API int send_ATA_SCT_Data_Table(tDevice *device, uint16_t functionCode, uint16_t tableID, uint8_t *dataBuf, uint32_t dataSize);
I could see that these functions has their alternatives, such as ata_SCT
in ata_cmds.c
is similiar to send_ATA_SCT
in ata_helper.c
.
Is there some reason to provide these redundant functions? Is there any plan to remove some of them?
This function pays attention to the /etc/mnttab
file, looking for information about mounted partitions, but quite commonly, on systems where ZFS is the dominant filesystem, which is likely to be majority of Solaris, illumos and derivatives, there won't be anything referring to individual drives or partitions in mnttab
, instead there will be ZFS mountpoints. Indeed a given drive may be in a pool and in use, but won't be seen in mnttab
.
I think, if this functionality is to exist on Solaris and friends, it might be necessary to enhance it with checks for ZFS labels. I am not sure about the best approach here, haven't had time to think about. Just wanted to raise this in case it was not already considered.
NA
Anything with ZFS, which at this point would include Linux, BSD, Solaris, illumos, etc.
No response
For ata_Read_Log_Ext
and ata_Write_Log_Ext
, they will print verbosity output such as:
Sending ATA Write Log Ext DMA command - Log 00h
Could we have the page number and sector count also print out together with log page above?
This would ease the debugging with logs which has multiple pages.
I do not know if this is seen elsewhere, have not tested, but I do see it on a recent OmniOS version. This issue should exist anywhere, I would expect. The concern here is that char
is signed. It is straight-forward to silence this with casting the curSN
and newSN
to unsigned char
, but that's more lipstick than anything.
[27/116] Compiling C object subprojects/opensea-transport/libopensea-transport.a.p/src_scsi_helper.c.o
../subprojects/opensea-transport/src/scsi_helper.c: In function 'seagate_Serial_Number_Cleanup':
../subprojects/opensea-transport/src/scsi_helper.c:2478:44: warning: array subscript has type 'char' [-Wchar-subscripts]
2478 | if ((*unitSerialNumber)[curSN] != '\0')
| ^
../subprojects/opensea-transport/src/scsi_helper.c:2480:40: warning: array subscript has type 'char' [-Wchar-subscripts]
2480 | newSerialNumber[newSN] = (*unitSerialNumber)[curSN];
| ^
../subprojects/opensea-transport/src/scsi_helper.c:2480:69: warning: array subscript has type 'char' [-Wchar-subscripts]
2480 | newSerialNumber[newSN] = (*unitSerialNumber)[curSN];
| ^
I would not expect this compiler warning to be present.
Just run the build according to the instructions in BUILDING.md
on OmniOS.
SunOS omni-lab 5.11 omnios-r151040-d70a3d4f10 i86pc i386 i86pc
gcc (OmniOS 151040/11.2.0-il-0) 11.2.0
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.