Ignore:
Timestamp:
Aug 9, 2013, 12:17:15 AM (12 years ago)
Author:
David Azarewicz
Message:

Added a check for bad geometries reported by the BIOS and fix them.

File:
1 edited

Legend:

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

    r167 r169  
    265265  }
    266266  ai->flags = initial_flags[ai->pci->board];
     267  ai->hw_ports = (ai->cap & 0x1f) + 1;
    267268
    268269  if ((ai->cap & HOST_CAP_64) && (ai->flags & AHCI_HFLAG_32BIT_ONLY)) {
     
    298299    dprintf("JMB361 has only one port, port_map 0x%lx -> 0x%lx\n", ai->port_map, 1);
    299300    ai->port_map = 1;
     301    ai->hw_ports = 1;
    300302  }
    301303
     
    309311   *       in ahci_scan_ports().
    310312   */
    311   ports = (ai->cap & 0x1f) + 1;
     313  ports = ai->hw_ports;
    312314  for (i = 0; i < AHCI_MAX_PORTS; i++) {
    313315    if (ai->port_map & (1UL << i)) {
     
    317319  if (ports < 0) {
    318320    /* more ports in port_map than in HOST_CAP & 0x1f */
    319     ports = (ai->cap & 0x1f) + 1;
     321    ports = ai->hw_ports;
    320322    dprintf("implemented port map (0x%lx) contains more "
    321323            "ports than nr_ports (%d), using nr_ports\n",
Note: See TracChangeset for help on using the changeset viewer.