Changeset 77 for trunk/src/os2ahci/ahci.c
- Timestamp:
- Feb 22, 2011, 2:25:44 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ahci.c
r76 r77 413 413 int i; 414 414 415 spin_lock(drv_lock); 416 id_buf = malloc(ATA_ID_WORDS * sizeof(u16)); 417 spin_unlock(drv_lock); 418 if (id_buf == NULL) { 415 if ((id_buf = malloc(ATA_ID_WORDS * sizeof(u16))) == NULL) { 419 416 return(-1); 420 417 } … … 499 496 ahci_restore_bios_config(ai); 500 497 } 501 spin_lock(drv_lock);502 498 free(id_buf); 503 spin_unlock(drv_lock);504 499 return(0); 505 500 } … … 613 608 writel(ai->mmio + HOST_IRQ_STAT, 1UL << p); 614 609 615 /* set link speed */ 616 tmp = readl(port_mmio + PORT_SCR_CTL) & ~0x000000f0UL; 617 writel(port_mmio + PORT_SCR_CTL, tmp | (link_speed[ad_no(ai)][p] << 4)); 610 /* set link speed and power management options */ 611 tmp = readl(port_mmio + PORT_SCR_CTL) & ~0x00000ff0UL; 612 tmp |= ((u32) link_speed[ad_no(ai)][p] & 0x0f) << 4; 613 tmp |= ((u32) link_power[ad_no(ai)][p] & 0x0f) << 8; 614 writel(port_mmio + PORT_SCR_CTL, tmp); 618 615 619 616 /* issue COMRESET on the port */ … … 873 870 AD_INFO *ai = ad_infos + iorb_unit_adapter(iorb); 874 871 P_INFO *port = ai->ports + iorb_unit_port(iorb); 875 ULONG timeout = (iorb->Timeout > 0) ? iorb->Timeout * 1000 : DEFAULT_TIMEOUT;872 ULONG timeout; 876 873 u8 _far *port_mmio = port_base(ai, iorb_unit_port(iorb)); 877 874 u16 cmd_max = ai->cmd_max; 878 875 int i; 876 877 /* determine timeout in milliseconds */ 878 switch (iorb->Timeout) { 879 case 0: 880 timeout = DEFAULT_TIMEOUT; 881 break; 882 case 0xffffffffUL: 883 timeout = 0xffffffffUL; 884 break; 885 default: 886 timeout = iorb->Timeout * 1000; 887 break; 888 } 879 889 880 890 /* Enable AHCI mode; apparently, the AHCI mode may end up becoming … … 1296 1306 for (iorb = done_queue.root; iorb != NULL; iorb = next) { 1297 1307 next = iorb->pNxtIORB; 1298 complete_iorb(iorb);1308 iorb_complete(iorb); 1299 1309 } 1300 1310 } … … 1541 1551 1542 1552 /* try to detect virtualbox environment to enable a hack for IRQ routing */ 1543 if (ai == ad_infos && p == 7 && 1544 ai->pci->vendor == 0x8086 && ai->pci->device == 0x2829 && 1553 if (ai == ad_infos && ai->pci->vendor == 0x8086 && ai->pci->device == 0x2829 && 1545 1554 !memcmp(ata_dev_name(id_buf), "VBOX HARDDISK", 13)) { 1546 1555 /* running inside virtualbox */
Note:
See TracChangeset
for help on using the changeset viewer.