- Timestamp:
- Oct 16, 2011, 9:06:02 PM (14 years ago)
- Location:
- trunk/src/os2ahci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ioctl.c
r128 r129 59 59 /* -------------------------- function prototypes -------------------------- */ 60 60 61 static USHORT do_smart (BYTE unit, BYTE sub_func, BYTE parm, void _far *buf); 61 static USHORT do_smart (BYTE unit, BYTE sub_func, BYTE cnt, BYTE lba_l, 62 void _far *buf); 62 63 static int map_unit (BYTE unit, USHORT _far *a, USHORT _far *p, 63 64 USHORT _far *d); … … 498 499 499 500 case DSKSP_SMART_ONOFF: 500 ret = do_smart(unit, 501 (BYTE) ((parm) ? ATA_SMART_ENABLE 502 : ATA_SMART_DISABLE), 503 0, NULL); 501 ret = do_smart(unit, (BYTE) ((parm) ? ATA_SMART_ENABLE 502 : ATA_SMART_DISABLE), 503 0, 0, NULL); 504 504 break; 505 505 506 506 case DSKSP_SMART_AUTOSAVE_ONOFF: 507 507 ret = do_smart(unit, ATA_SMART_AUTOSAVE, 508 (BYTE) ((parm) ? (BYTE) 0xf1 : 0), 509 NULL); 508 (BYTE) ((parm) ? (BYTE) 0xf1 : 0), 0, NULL); 510 509 break; 511 510 512 511 case DSKSP_SMART_AUTO_OFFLINE: 513 ret = do_smart(unit, ATA_SMART_AUTO_OFFLINE, parm, NULL);512 ret = do_smart(unit, ATA_SMART_AUTO_OFFLINE, parm, 0, NULL); 514 513 break; 515 514 516 515 case DSKSP_SMART_EXEC_OFFLINE: 517 ret = do_smart(unit, ATA_SMART_IMMEDIATE_OFFLINE, parm, NULL);516 ret = do_smart(unit, ATA_SMART_IMMEDIATE_OFFLINE, 0, parm, NULL); 518 517 break; 519 518 520 519 case DSKSP_SMART_SAVE: 521 ret = do_smart(unit, ATA_SMART_SAVE, 0, NULL);520 ret = do_smart(unit, ATA_SMART_SAVE, 0, 0, NULL); 522 521 break; 523 522 524 523 case DSKSP_SMART_GETSTATUS: 525 ret = do_smart(unit, ATA_SMART_STATUS, 0, ioctl->DataPacket);524 ret = do_smart(unit, ATA_SMART_STATUS, 0, 0, ioctl->DataPacket); 526 525 break; 527 526 528 527 case DSKSP_SMART_GET_ATTRIBUTES: 529 ret = do_smart(unit, ATA_SMART_READ_VALUES, 0, ioctl->DataPacket);528 ret = do_smart(unit, ATA_SMART_READ_VALUES, 0, 0, ioctl->DataPacket); 530 529 break; 531 530 532 531 case DSKSP_SMART_GET_THRESHOLDS: 533 ret = do_smart(unit, ATA_SMART_READ_THRESHOLDS, 0, ioctl->DataPacket);532 ret = do_smart(unit, ATA_SMART_READ_THRESHOLDS, 0, 0, ioctl->DataPacket); 534 533 break; 535 534 536 535 case DSKSP_SMART_GET_LOG: 537 ret = do_smart(unit, ATA_SMART_READ_LOG, parm, ioctl->DataPacket);536 ret = do_smart(unit, ATA_SMART_READ_LOG, 1, parm, ioctl->DataPacket); 538 537 break; 539 538 … … 548 547 * Perform SMART request. The code has been more or less copied from DANIS506. 549 548 */ 550 static USHORT do_smart(BYTE unit, BYTE sub_func, BYTE parm, void _far *buf) 549 static USHORT do_smart(BYTE unit, BYTE sub_func, BYTE cnt, BYTE lba_l, 550 void _far *buf) 551 551 { 552 552 OS2AHCI_PASSTHROUGH pt; … … 575 575 pt.cmdlen = sizeof(pt.cmd.ata); 576 576 pt.cmd.ata.features = sub_func; 577 pt.cmd.ata.count = parm;578 pt.cmd.ata.lba_l = (0xc24fL << 8) | parm;577 pt.cmd.ata.count = cnt; 578 pt.cmd.ata.lba_l = (0xc24fL << 8) | lba_l; 579 579 pt.cmd.ata.cmd = ATA_CMD_SMART; 580 580 … … 623 623 for (_d = 0; _d <= pi->dev_max; _d++) { 624 624 if (pi->devs[_d].present) { 625 if ( --unit== 0) {625 if (unit-- == 0) { 626 626 /* found the device */ 627 627 *a = _a; -
trunk/src/os2ahci/ioctl.h
r125 r129 179 179 USHORT SeekErrors[2]; 180 180 USHORT SATAErrors; 181 } DeviceCountersData , NEAR *NPDeviceCountersData, FAR *PDeviceCountersData;181 } DeviceCountersData; 182 182 183 183 /****************************************************************************** … … 200 200 ULONG UnitFlags1; 201 201 USHORT UnitFlags2; 202 } UnitInformationData , NEAR *NPUnitInformationData, FAR *PUnitInformationData;202 } UnitInformationData; 203 203 204 204
Note:
See TracChangeset
for help on using the changeset viewer.