Changeset 193
- Timestamp:
- Dec 12, 2017, 11:08:37 PM (8 years ago)
- Location:
- trunk/src/os2ahci
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/Makefile
r190 r193 12 12 # Define default build version if not specified in environment 13 13 BLD_MAJOR=2 14 BLD_MINOR=0 3# must be 2 digits14 BLD_MINOR=04 # must be 2 digits 15 15 BLD_REV=0 # not used at this time 16 16 … … 166 166 copy /b $(ROOT)\src\os2ahci\$(O)\os2ahci.sym $(ZIPDIR)\pkg1 >NUL 167 167 168 @md $(ZIPDIR)\pkg2169 @copy /b $(ROOT)\Tools\smartahci.exe $(ZIPDIR)\pkg2 >NUL170 171 168 @md $(ZIPDIR)\pkg20 172 169 @copy $(ROOT)\src\os2ahci\ReadMe.txt $(ZIPDIR)\pkg20 >NUL -
trunk/src/os2ahci/ReadMe.txt
r191 r193 1 AHCI Driver for OS/2 v2.0 31 AHCI Driver for OS/2 v2.04 2 2 3 3 Introduction … … 321 321 322 322 Starting with version 1.22, OS2AHCI supports the IOCTL interface required by 323 existing SMART monitoring tools. Since those tools are hard-coded to open 324 the character device named "IBMS506$", they will not work with OS2AHCI unless 325 modified to open the OS2AHCI$ device. Previous versions of OS2AHCI used to 326 register a duplicate device with the IBMS506$ name, however since that caused 327 so many unacceptable problems, that is no longer done. You must have a SMART 328 utility that opens the OS2AHCI$ device to access the AHCI driver. 329 330 A patched version of the smartctl.exe program is included in the OS2AHCI 331 distribution. This patched version simply has the name "IBMS506$" changed 332 to "OS2AHCI$" and is otherwise identical. This patched program has been 333 renamed to smartahci.exe to distinguish it from the unpatched version. 334 The patched smartahci.exe program is provided AS-IS and is completely 335 UNSUPPORTED. Use of this program is at your own risk. 323 existing SMART monitoring tools. Beware that the IBM version of smartctl.exe 324 is hard-coded to open the character device named "IBMS506$" so it will not 325 work with OS2AHCI. You must use a version that allows specifying ahci devices. 336 326 337 327 NOTES: … … 360 350 361 351 Hot swap is not supported. 352 Port expanders are not supported. Only one drive per port is allowed. 362 353 363 354 … … 387 378 Change Log 388 379 ========== 380 381 v.2.04 06-Dec-2017 - David Azarewicz 382 Cosmetic changes to user display. 383 Fixed the ioctl pass-thru interface. 384 Removed the old IBM smartctl.exe from the distribution. 389 385 390 386 v.2.03 15-Jul-2017 - David Azarewicz -
trunk/src/os2ahci/ahci.c
r191 r193 504 504 } 505 505 506 if (ai->pci_vendor == PCI_VENDOR_ID_INTEL) 507 { 508 /* Adapter is not in AHCI mode and the spec says a COMRESET is 509 * required when switching from SATA to AHCI mode and vice versa. 510 */ 511 init_reset = 1; 512 } 513 506 514 /* some controllers need AHCI_EN to be written multiple times */ 507 515 for (i = 0; i < 5; i++) -
trunk/src/os2ahci/ioctl.c
r191 r193 55 55 SCATGATENTRY sg_lst[AHCI_MAX_SG / 2]; /* scatter/gather list */ 56 56 ULONG sg_cnt; /* number of S/G elements */ 57 struct _KernVMLock_t *lh; /* lock handle forVMLock() */57 struct _KernVMLock_t lh; /* lock handle for KernVMLock() */ 58 58 } IOCTL_CONTEXT; 59 59 60 60 /* -------------------------- function prototypes -------------------------- */ 61 61 62 static USHORT do_smart (BYTE unit, BYTE sub_func, BYTE cnt, BYTE lba_l, 63 void *buf); 64 static int map_unit (BYTE unit, USHORT *a, USHORT *p, 65 USHORT *d); 62 static USHORT do_smart(BYTE unit, BYTE sub_func, BYTE cnt, BYTE lba_l, void *buf); 63 static int map_unit(BYTE unit, USHORT *a, USHORT *p, USHORT *d); 66 64 67 65 extern IORBH FAR16DATA * (__far16 *Far16AdrOfIoctlWakeup16)(IORBH FAR16DATA*); … … 168 166 memset(ic, 0x00, sizeof(*ic)); 169 167 168 /* lock DMA transfer buffer into memory and construct S/G list */ 169 if (req->buflen > 0) 170 { 171 if (KernVMLock(VMDHL_LONG | !((req->flags & PT_WRITE) ? VMDHL_WRITE : 0), 172 req->buf, req->buflen, &ic->lh, (KernPageList_t*)&ic->sg_lst, &ic->sg_cnt) != 0) 173 { 174 /* couldn't lock buffer and/or produce a S/G list */ 175 MemFree(ic); 176 return(RPDONE | RPERR_PARAMETER); 177 } 178 } 179 170 180 /* fill in adapter passthrough fields */ 171 181 ic->iorb.iorbh.Length = sizeof(ic->iorb); … … 200 210 201 211 /* Wait for IORB completion. */ 202 spin_lock(drv_lock); 212 213 //DAZ 20171206 spin_lock(drv_lock); 203 214 while (!(ic->iorb.iorbh.Status & IORB_DONE)) 204 215 { 205 KernBlock( (ULONG)&ic->iorb.iorbh, 30000, 0, NULL, NULL);206 } 207 spin_unlock(drv_lock);216 KernBlock(CastFar16ToULONG(MemFar16Adr(&ic->iorb.iorbh)), 30000, 0, NULL, NULL); 217 } 218 //DAZ 20171206 spin_unlock(drv_lock); 208 219 209 220 ret = RPDONE; … … 270 281 memcpy(sense_buf, ic->sense, min(ic->ssb.ReqSenseLen, req->sense_len)); 271 282 } 272 273 283 } 274 284 else if ((req->flags & PT_ATAPI) == 0) … … 282 292 283 293 MemFree(ic); 294 if (req->buflen > 0) KernVMUnlock(&ic->lh); 284 295 return(ret); 285 296 } … … 393 404 { 394 405 DSKSP_CommandParameters *cp = (DSKSP_CommandParameters *)Far16ToFlat(ioctl->ioctl.pvParm); 395 USHORT size = 0;396 406 USHORT ret; 397 407 UCHAR unit; 398 UCHAR parm; 408 UCHAR parm = 0; 409 void *pData = NULL; 399 410 400 411 unit = cp->byPhysicalUnit; 401 412 402 /* verify addressability of data buffer (depends on SMART function) */ 403 switch (ioctl->ioctl.bFunction) 404 { 405 406 case DSKSP_SMART_GETSTATUS: 407 size = sizeof(ULONG); 408 break; 409 410 case DSKSP_SMART_GET_ATTRIBUTES: 411 case DSKSP_SMART_GET_THRESHOLDS: 412 case DSKSP_SMART_GET_LOG: 413 size = 512; 414 break; 415 } 416 417 if (size > 0) 418 { 419 parm = *(UCHAR*)Far16ToFlat(ioctl->ioctl.pvData); 413 if (ioctl->ioctl.pvData) 414 { 415 pData = (void*)Far16ToFlat(ioctl->ioctl.pvData); 416 parm = *(UCHAR*)pData; 420 417 } 421 418 … … 444 441 445 442 case DSKSP_SMART_GETSTATUS: 446 ret = do_smart(unit, ATA_SMART_STATUS, 0, 0, Far16ToFlat(ioctl->ioctl.pvData));443 ret = do_smart(unit, ATA_SMART_STATUS, 0, 0, pData); 447 444 break; 448 445 449 446 case DSKSP_SMART_GET_ATTRIBUTES: 450 ret = do_smart(unit, ATA_SMART_READ_VALUES, 0, 0, Far16ToFlat(ioctl->ioctl.pvData));447 ret = do_smart(unit, ATA_SMART_READ_VALUES, 0, 0, pData); 451 448 break; 452 449 453 450 case DSKSP_SMART_GET_THRESHOLDS: 454 ret = do_smart(unit, ATA_SMART_READ_THRESHOLDS, 0, 0, Far16ToFlat(ioctl->ioctl.pvData));451 ret = do_smart(unit, ATA_SMART_READ_THRESHOLDS, 0, 0, pData); 455 452 break; 456 453 457 454 case DSKSP_SMART_GET_LOG: 458 ret = do_smart(unit, ATA_SMART_READ_LOG, 1, parm, Far16ToFlat(ioctl->ioctl.pvData));455 ret = do_smart(unit, ATA_SMART_READ_LOG, 1, parm, pData); 459 456 break; 460 457 -
trunk/src/os2ahci/trace.c
r186 r193 25 25 int p; 26 26 int d; 27 int iFlag; 27 28 28 29 for (a = 0; a < ad_info_cnt; a++) … … 37 38 ai->bios_config[HOST_VERSION / sizeof(u32)]); 38 39 39 for (p = 0; p < = ai->port_max; p++)40 for (p = 0; p < ai->hw_ports; p++) 40 41 { 41 42 P_INFO *pi = &ai->ports[p]; 42 43 dprintf(0," Port %d:\n", p); 43 iFlag = 1; 44 44 45 45 for (d = 0; d <= pi->dev_max; d++) 46 46 { 47 if ( !pi->devs[d].present)47 if (pi->devs[d].present) 48 48 { 49 dprintf(0," No drive present\n");50 } else {49 if (iFlag) dprintf(0," Port %d:\n", p); 50 iFlag = 0; 51 51 dprintf(0," Drive %d:", d); 52 52 if (pi->devs[d].atapi) dprintf(0," atapi"); … … 60 60 dprintf(0,"\n"); 61 61 dprintf(0," Model: %s\n", pi->devs[d].dev_name); 62 } 63 else if (verbosity > 0) 64 { 65 if (iFlag) dprintf(0," Port %d:\n", p); 66 iFlag = 0; 67 dprintf(0," No drive present\n"); 62 68 } /* if */ 63 69 } /* for d */
Note:
See TracChangeset
for help on using the changeset viewer.