Ignore:
Timestamp:
Feb 22, 2011, 2:25:44 AM (14 years ago)
Author:
chris
Message:
  • Further fixes to automatic ATAPI sense handling, now supporting sense buffers larger than 64 bytes if requested by initiator (cdrecord wanted 96 bytes)
  • Separate, and internally handled, spinlock for libc malloc/free calls to reduce chances of memory corruption if somebody forgets to get the driver-level spinlock before calling malloc/free. There was no real problem with that, just some awkward code fragments which look much better now.
  • Link power management implemented
  • More generic support for adapter/port options so all of them can now have a global, adapter or port scope
  • Generic support for inverting driver options (i.e. turn them off with '!')
  • Thorough PCI scan is now the default; the reason it wasn't so far was a delay in Virtualbox but that was never a problem on real hardware
  • SCSI emulation for ATAPI devices; this can be enabled on global, adapter or port scope
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/ahci.c

    r76 r77  
    413413  int i;
    414414
    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) {
    419416    return(-1);
    420417  }
     
    499496    ahci_restore_bios_config(ai);
    500497  }
    501   spin_lock(drv_lock);
    502498  free(id_buf);
    503   spin_unlock(drv_lock);
    504499  return(0);
    505500}
     
    613608  writel(ai->mmio + HOST_IRQ_STAT, 1UL << p);
    614609
    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);
    618615
    619616  /* issue COMRESET on the port */
     
    873870  AD_INFO *ai = ad_infos + iorb_unit_adapter(iorb);
    874871  P_INFO *port = ai->ports + iorb_unit_port(iorb);
    875   ULONG timeout = (iorb->Timeout > 0) ? iorb->Timeout * 1000 : DEFAULT_TIMEOUT;
     872  ULONG timeout;
    876873  u8 _far *port_mmio = port_base(ai, iorb_unit_port(iorb));
    877874  u16 cmd_max = ai->cmd_max;
    878875  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  }
    879889
    880890  /* Enable AHCI mode; apparently, the AHCI mode may end up becoming
     
    12961306  for (iorb = done_queue.root; iorb != NULL; iorb = next) {
    12971307    next = iorb->pNxtIORB;
    1298     complete_iorb(iorb);
     1308    iorb_complete(iorb);
    12991309  }
    13001310}
     
    15411551
    15421552  /* 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 &&
    15451554      !memcmp(ata_dev_name(id_buf), "VBOX HARDDISK", 13)) {
    15461555    /* running inside virtualbox */
Note: See TracChangeset for help on using the changeset viewer.