Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. + /* fix drive name inconsistent issue */
  2. + {
  3. + u8 model[40];
  4. + u8 Vendor[9], Product[17];
  5. + u8 i, j;
  6. +
  7. + ata_id_string(args->id, model, ATA_ID_PROD, 40);
  8. + for (i = 0; i < 9; i++)
  9. + if (model[i] == ' ')
  10. + break;
  11. + if (i == 9) {
  12. + if (((model[0] == 'I') && (model[1] == 'C')) ||
  13. + ((model[0] == 'H') && (model[1] == 'T')) ||
  14. + ((model[0] == 'H') && (model[1] == 'D')) ||
  15. + ((model[0] == 'D') && (model[1] == 'K'))) {
  16. + /*Hitachi*/
  17. + Vendor[0] = 'H';
  18. + Vendor[1] = 'i';
  19. + Vendor[2] = 't';
  20. + Vendor[3] = 'a';
  21. + Vendor[4] = 'c';
  22. + Vendor[5] = 'h';
  23. + Vendor[6] = 'i';
  24. + Vendor[7] = ' ';
  25. + Vendor[8] = '\0';
  26. + } else if ((model[0] == 'S') && (model[1] == 'T')) {
  27. + /*Seagate*/
  28. + Vendor[0] = 'S';
  29. + Vendor[1] = 'e';
  30. + Vendor[2] = 'a';
  31. + Vendor[3] = 'g';
  32. + Vendor[4] = 'a';
  33. + Vendor[5] = 't';
  34. + Vendor[6] = 'e';
  35. + Vendor[7] = ' ';
  36. + Vendor[8] = '\0';
  37. + } else {
  38. + /* Unknown */
  39. + Vendor[0] = 'A';
  40. + Vendor[1] = 'T';
  41. + Vendor[2] = 'A';
  42. + Vendor[3] = ' ';
  43. + Vendor[4] = ' ';
  44. + Vendor[5] = ' ';
  45. + Vendor[6] = ' ';
  46. + Vendor[7] = ' ';
  47. + Vendor[8] = '\0';
  48. + }
  49. + memcpy(Product, model, 16);
  50. + Product[16] = '\0';
  51. + } else {
  52. + j = i;
  53. + memcpy(Vendor, model, j);
  54. + for (; j < 9; j++)
  55. + Vendor[j] = ' ';
  56. + Vendor[8] = '\0';
  57. +
  58. + for (; i < 24; i++)
  59. + if (model[i] != ' ')
  60. + break;
  61. + memcpy(Product, &model[i], 16);
  62. + Product[16] = '\0';
  63. + }
  64. + memcpy(&rbuf[8], Vendor, 8);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement