Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- + /* fix drive name inconsistent issue */
- + {
- + u8 model[40];
- + u8 Vendor[9], Product[17];
- + u8 i, j;
- +
- + ata_id_string(args->id, model, ATA_ID_PROD, 40);
- + for (i = 0; i < 9; i++)
- + if (model[i] == ' ')
- + break;
- + if (i == 9) {
- + if (((model[0] == 'I') && (model[1] == 'C')) ||
- + ((model[0] == 'H') && (model[1] == 'T')) ||
- + ((model[0] == 'H') && (model[1] == 'D')) ||
- + ((model[0] == 'D') && (model[1] == 'K'))) {
- + /*Hitachi*/
- + Vendor[0] = 'H';
- + Vendor[1] = 'i';
- + Vendor[2] = 't';
- + Vendor[3] = 'a';
- + Vendor[4] = 'c';
- + Vendor[5] = 'h';
- + Vendor[6] = 'i';
- + Vendor[7] = ' ';
- + Vendor[8] = '\0';
- + } else if ((model[0] == 'S') && (model[1] == 'T')) {
- + /*Seagate*/
- + Vendor[0] = 'S';
- + Vendor[1] = 'e';
- + Vendor[2] = 'a';
- + Vendor[3] = 'g';
- + Vendor[4] = 'a';
- + Vendor[5] = 't';
- + Vendor[6] = 'e';
- + Vendor[7] = ' ';
- + Vendor[8] = '\0';
- + } else {
- + /* Unknown */
- + Vendor[0] = 'A';
- + Vendor[1] = 'T';
- + Vendor[2] = 'A';
- + Vendor[3] = ' ';
- + Vendor[4] = ' ';
- + Vendor[5] = ' ';
- + Vendor[6] = ' ';
- + Vendor[7] = ' ';
- + Vendor[8] = '\0';
- + }
- + memcpy(Product, model, 16);
- + Product[16] = '\0';
- + } else {
- + j = i;
- + memcpy(Vendor, model, j);
- + for (; j < 9; j++)
- + Vendor[j] = ' ';
- + Vendor[8] = '\0';
- +
- + for (; i < 24; i++)
- + if (model[i] != ' ')
- + break;
- + memcpy(Product, &model[i], 16);
- + Product[16] = '\0';
- + }
- + memcpy(&rbuf[8], Vendor, 8);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement