diff --git a/src/userland/scisi/include/scisi.h b/src/userland/scisi/include/scisi.h index bcd6da5..bf97eb1 100644 --- a/src/userland/scisi/include/scisi.h +++ b/src/userland/scisi/include/scisi.h @@ -19,4 +19,28 @@ uint8_t control; } __attribute__((packed)) InquiryCommand; +typedef struct { + uint32_t size; + union { + uint8_t byte; + struct { + uint8_t deviceType: 5; + uint8_t qualifier: 3; + } data; + } type; + uint8_t removable; + uint8_t version; + union { + uint8_t byte; + struct { + uint8_t responseDataFormat: 4; + uint8_t hierarchicalSupport: 1; + uint8_t normalAca: 1; + uint8_t reserved: 2; + } data; + } responseData; + uint8_t additionalLength; + uint8_t restData[127]; +} InquiryResponse; + #endif \ No newline at end of file diff --git a/src/userland/scisi/include/scisi.h b/src/userland/scisi/include/scisi.h index bcd6da5..bf97eb1 100644 --- a/src/userland/scisi/include/scisi.h +++ b/src/userland/scisi/include/scisi.h @@ -19,4 +19,28 @@ uint8_t control; } __attribute__((packed)) InquiryCommand; +typedef struct { + uint32_t size; + union { + uint8_t byte; + struct { + uint8_t deviceType: 5; + uint8_t qualifier: 3; + } data; + } type; + uint8_t removable; + uint8_t version; + union { + uint8_t byte; + struct { + uint8_t responseDataFormat: 4; + uint8_t hierarchicalSupport: 1; + uint8_t normalAca: 1; + uint8_t reserved: 2; + } data; + } responseData; + uint8_t additionalLength; + uint8_t restData[127]; +} InquiryResponse; + #endif \ No newline at end of file diff --git a/src/userland/scisi/main.c b/src/userland/scisi/main.c index 4f9846e..016c531 100644 --- a/src/userland/scisi/main.c +++ b/src/userland/scisi/main.c @@ -12,8 +12,23 @@ command->allocationLengthLow = 5; command->control = 0; command->size = sizeof(InquiryCommand) - sizeof(uint32_t); + request(device->serviceId, device->outFunction, device->out, U32(getPhysicalAddress(command))); - request(device->serviceId, device->inFunction, device->in, U32(getPhysicalAddress(command))); + InquiryResponse *response = malloc(sizeof(InquiryResponse)); + response->size = sizeof(InquiryResponse) - sizeof(uint32_t); + request(device->serviceId, device->inFunction, device->in, U32(getPhysicalAddress(response))); + command->allocationLengthLow = 5 + response->additionalLength; + + request(device->serviceId, device->outFunction, device->out, U32(getPhysicalAddress(command))); + request(device->serviceId, device->inFunction, device->in, U32(getPhysicalAddress(response))); + + + printf("response: type: %x, removable: %i, version: %x, responseData: %x, additionalLength: %i\n", + response->type, response->removable, response->version, response->responseData, response->additionalLength); + for (uint32_t i = 0; i < 10; i++) { + printf("restData: %x %x %x %x\n", response->restData[4*i], response->restData[4*i+1], + response->restData[4*i+2], response->restData[4*i+3]); + } } int32_t registerDevice(uint32_t in, uint32_t out, uint32_t serviceName, uint32_t serviceId) {