Changeset 71
- Timestamp:
- Feb 15, 2011, 1:18:21 PM (14 years ago)
- Location:
- trunk/src/os2ahci
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ahci.c
r69 r71 553 553 554 554 /* enable interrupts on PCI-level (PCI 2.3 added a feature to disable ints) */ 555 pci_enable_int(ai->bus, ai->dev_func);555 /* pci_enable_int(ai->bus, ai->dev_func); */ 556 556 557 557 return(0); … … 1103 1103 int ahci_flush_cache(AD_INFO *ai, int p, int d) 1104 1104 { 1105 dprintf("flushing cache on %d.%d.%d\n", ad_no(ai), p, d); 1106 return(ahci_exec_polled_cmd(ai, p, d, 30000, 1107 ai->ports[p].devs[d].lba48 ? ATA_CMD_FLUSH_EXT 1108 : ATA_CMD_FLUSH, 1109 AP_END)); 1105 if (!ai->ports[p].devs[d].atapi) { 1106 dprintf("flushing cache on %d.%d.%d\n", ad_no(ai), p, d); 1107 return(ahci_exec_polled_cmd(ai, p, d, 30000, 1108 ai->ports[p].devs[d].lba48 ? ATA_CMD_FLUSH_EXT 1109 : ATA_CMD_FLUSH, 1110 AP_END)); 1111 } 1110 1112 } 1111 1113 … … 1397 1399 int d = iorb_unit_device(iorb); 1398 1400 1399 dphex(((IORB_ADAPTER_PASSTHRU _far *) iorb)->pControllerCmd,1400 ((IORB_ADAPTER_PASSTHRU _far *) iorb)->ControllerCmdLen,1401 "ahci_execute_cdb(%d.%d.%d)", a, p, d);1402 1403 1401 if (ad_infos[a].ports[p].devs[d].atapi) { 1404 1402 ahci_exec_iorb(iorb, 0, atapi_execute_cdb); … … 1471 1469 dprintf("NCQ off for a:%d p:%d\n", (int) ad_no(ai), p); 1472 1470 } else { 1473 ai->ports[p].devs[d].ncq_max = id_buf[ATA_ID_QUEUE_DEPTH] & 0x001fU;1471 ai->ports[p].devs[d].ncq_max = max(1, id_buf[ATA_ID_QUEUE_DEPTH] & 0x001fU); 1474 1472 dprintf("NCQ max=%d for a:%d p:%d\n", ai->ports[p].devs[d].ncq_max, (int) ad_no(ai), p); 1475 1473 } … … 1518 1516 if (ai == ad_infos && p == 7 && 1519 1517 ai->pci->vendor == 0x8086 && ai->pci->device == 0x2829 && 1520 !memcmp( ds.DevDescriptName, "VBOX HARDDISK", 13)) {1518 !memcmp(ata_dev_name(id_buf), "VBOX HARDDISK", 13)) { 1521 1519 /* running inside virtualbox */ 1522 1520 pci_hack_virtualbox(); -
trunk/src/os2ahci/ata.c
r70 r71 624 624 625 625 io->BlocksXferred += add_workspace(iorb)->blocks; 626 d dprintf("ata(pi)_read_pp(): blocks transferred = %d\n", (int) io->BlocksXferred);626 dprintf("ata_read_pp(): blocks transferred = %d\n", (int) io->BlocksXferred); 627 627 628 628 if (io->BlocksXferred >= io->BlockCount) { … … 756 756 757 757 io->BlocksXferred += add_workspace(iorb)->blocks; 758 d dprintf("ata_write_pp(): blocks transferred = %d\n", (int) io->BlocksXferred);758 dprintf("ata_write_pp(): blocks transferred = %d\n", (int) io->BlocksXferred); 759 759 760 760 if (io->BlocksXferred >= io->BlockCount) { -
trunk/src/os2ahci/atapi.c
r69 r71 53 53 int atapi_unit_ready(IORBH _far *iorb, int slot) 54 54 { 55 d printf("atapi_unit_ready called\n");55 ddprintf("atapi_unit_ready called\n"); 56 56 iorb_seterr(iorb, IOERR_CMD_NOT_SUPPORTED); 57 57 return(-1); … … 123 123 int atapi_verify(IORBH _far *iorb, int slot) 124 124 { 125 d printf("atapi_verify called\n");125 ddprintf("atapi_verify called\n"); 126 126 iorb_seterr(iorb, IOERR_CMD_NOT_SUPPORTED); 127 127 return(-1); … … 133 133 int atapi_write(IORBH _far *iorb, int slot) 134 134 { 135 d printf("atapi_write called\n");135 ddprintf("atapi_write called\n"); 136 136 iorb_seterr(iorb, IOERR_CMD_NOT_SUPPORTED); 137 137 return(-1); … … 241 241 ATAPI_SENSE_DATA *psd = (ATAPI_SENSE_DATA *) aws->buf; 242 242 243 d dphex(psd, sizeof(psd), "sense buffer:\n");243 dphex(psd, sizeof(psd), "sense buffer:\n"); 244 244 245 245 /* map sense data to some IOERR_ value */ -
trunk/src/os2ahci/libc.c
r66 r71 73 73 int reg; 74 74 u8 data; 75 } com 1_init_sequence[] = {75 } com_init_sequence[] = { 76 76 3, 0x80, /* overlay divisor latch register at 0x3f8 and 0x3f9 */ 77 77 0, 0x01, /* set low byte of divisor to 1 (115200 baud) */ … … 107 107 int i; 108 108 109 DevHelp_CreateSpinLock(&com_lock);110 111 for (i = 0; com 1_init_sequence[i].reg != -1; i++) {112 u16 port = com_base + com 1_init_sequence[i].reg;113 u8 data = com 1_init_sequence[i].data;109 spin_lock(com_lock); 110 111 for (i = 0; com_init_sequence[i].reg != -1; i++) { 112 u16 port = com_base + com_init_sequence[i].reg; 113 u8 data = com_init_sequence[i].data; 114 114 _asm { 115 115 mov dx, port; … … 118 118 } 119 119 } 120 121 spin_unlock(com_lock); 120 122 } 121 123 -
trunk/src/os2ahci/os2ahci.c
r69 r71 964 964 } 965 965 966 d printf("IORB queued: %d/%d (queue = %Fp, IORB = %Fp)\n",967 iorb->CommandCode, iorb->CommandModifier, queue, iorb);966 ddprintf("IORB queued: %d/%d (queue = %Fp, IORB = %Fp)\n", 967 iorb->CommandCode, iorb->CommandModifier, queue, iorb); 968 968 } 969 969 … … 995 995 996 996 if (found) { 997 d printf("IORB removed: %d/%d (queue = %Fp, IORB = %Fp) - %04x/%04x\n",998 iorb->CommandCode, iorb->CommandModifier, queue, iorb,999 iorb->Status, iorb->ErrorCode);997 ddprintf("IORB removed: %d/%d (queue = %Fp, IORB = %Fp) - %04x/%04x\n", 998 iorb->CommandCode, iorb->CommandModifier, queue, iorb, 999 iorb->Status, iorb->ErrorCode); 1000 1000 } else { 1001 1001 dprintf("IORB %Fp not found in queue %Fp\n", iorb, queue); -
trunk/src/os2ahci/os2ahci.def
r69 r71 1 1 library os2ahci 2 Description '$@#thi.guten (www.thiguten.de):1.00.20110 107#@OS/2 AHCI Adapter Device Driver'2 Description '$@#thi.guten (www.thiguten.de):1.00.20110215#@OS/2 AHCI Adapter Device Driver' 3 3 protmode 4 4 -
trunk/src/os2ahci/os2ahci.h
r69 r71 79 79 80 80 /* max/min macros */ 81 #define max(a, b) a > b ? a : b82 #define min(a, b) a < b ? a : b81 #define max(a, b) (a) > (b) ? (a) : (b) 82 #define min(a, b) (a) < (b) ? (a) : (b) 83 83 84 84 /* debug output macros */
Note:
See TracChangeset
for help on using the changeset viewer.