Changeset 162 for trunk


Ignore:
Timestamp:
Jun 2, 2013, 5:10:06 AM (12 years ago)
Author:
David Azarewicz
Message:

driver info updates, misc cleanup, add comments
This is version 1.28

Location:
trunk/src/os2ahci
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/Makefile

    r160 r162  
    3232BLD_MINOR=28 # must be 2 digits
    3333BLD_REV=0 # not used at this time
    34 FIXPACK=Test Build
     34FIXPACK=
    3535
    3636!ifndef %WATCOM # if not defined in the environment
  • trunk/src/os2ahci/README

    r161 r162  
    382382==========
    383383
    384 v.1.28 30-May-2013 - David Azarewicz
     384v.1.28 01-Jun-2013 - David Azarewicz
    385385  Reworked trap dump kernel exit
    386386  Removed unused IDC entry point.
    387   Some work on suspend/resume routines.
     387  Reworked suspend/resume routines.
     388  Implemented a temporary hack to make resume work reasonably well.
    388389  Suspend/resume is only supported on eCS systems with ACPI.
     390  Suspend/resume is known to not work reliably and cannot be further
     391    addressed in this driver.
    389392
    390393v.1.27 23-Apr-2013 - David Azarewicz
  • trunk/src/os2ahci/ahci.c

    r161 r162  
    17361736  static u8 total_dev_cnt;
    17371737
     1738  if (p >= AHCI_MAX_PORTS) return;
     1739  if (d >= AHCI_MAX_DEVS) return;
     1740
    17381741  if (ai->port_max < p) {
    17391742    ai->port_max = p;
  • trunk/src/os2ahci/ahci.h

    r155 r162  
    5858#define AHCI_PCI_BAR            5
    5959#define AHCI_MAX_PORTS          16 /* Spec says 32, but we only support 16 */
     60#define AHCI_MAX_DEVS           8
    6061#define AHCI_MAX_SG             48 /* hardware max is 64K */
    6162#define AHCI_MAX_SG_ELEMENT_LEN (1UL << 22)
  • trunk/src/os2ahci/apm.c

    r161 r162  
    133133    writel(ai->mmio + HOST_CTL, readl(ai->mmio + HOST_CTL) & ~HOST_IRQ_EN);
    134134    readl(ai->mmio + HOST_CTL); /* flush */
     135
     136    /* TODO: put the device into the D3 state */
    135137  }
    136138
     
    138140  init_complete = 0;
    139141
    140   /* TODO: put the device into the D3 state */
    141 
    142142  suspended = 1;
    143143  dprintf("suspend() finished\n");
     
    155155  dprintf("resume()\n");
    156156
    157   /* TODO: put the device into the D0 state */
    158 
    159   for (a = 0; a < ad_info_cnt; a++) {
    160     AD_INFO *ai = ad_infos + a;
     157  for (a = 0; a < ad_info_cnt; a++) {
     158    AD_INFO *ai = ad_infos + a;
     159
     160    /* TODO: put the device into the D0 state */
    161161
    162162    //ahci_reset_controller(ai);
     
    181181
    182182  /* restart engine to resume IORB processing */
     183  /* The resume_sleep_flag and probably rearming the ctx hook is a temporary hack
     184   * to make resume kind of work when I/O operations are outstanding or started
     185   * during the suspend operation. This behavior may change with future versions
     186   * of the ACPI software which will make this hack unnecessary.
     187   */
    183188  resume_sleep_flag = 5000;
    184189  DevHelp_ArmCtxHook(0, engine_ctxhook_h);
  • trunk/src/os2ahci/ata.c

    r160 r162  
    605605
    606606  if (is_lvm_geometry(iorb)) Method = "LVM";
     607  ad_infos[a].ports[p].devs[0].dev_info.Cylinders = geometry->TotalCylinders;
     608  ad_infos[a].ports[p].devs[0].dev_info.HeadsPerCylinder = geometry->NumHeads;
     609  ad_infos[a].ports[p].devs[0].dev_info.SectorsPerTrack = geometry->SectorsPerTrack;
     610  ad_infos[a].ports[p].devs[0].dev_info.TotalSectors = geometry->TotalSectors;
     611  ad_infos[a].ports[p].devs[0].dev_info.Method = Method;
    607612
    608613  dprintf("Drive geometry: %ld cylinders, %d heads, %d sectors per track (%ldMB) (%s)\n",
  • trunk/src/os2ahci/os2ahci.c

    r161 r162  
    224224  suspended = 0;
    225225  resume_sleep_flag = 0;
     226  memset(ad_infos, 0, sizeof(ad_infos));
    226227
    227228  /* set device helper entry point */
  • trunk/src/os2ahci/os2ahci.h

    r161 r162  
    333333} IORB_QUEUE;
    334334
     335typedef struct {
     336    USHORT Cylinders;
     337    USHORT HeadsPerCylinder;
     338    USHORT SectorsPerTrack;
     339    ULONG  TotalSectors;
     340    char *Method;
     341} DEV_INFO;
     342
    335343/* port information structure */
    336344typedef struct {
    337345  IORB_QUEUE    iorb_queue;            /* IORB queue for this port */
    338   unsigned      dev_max     : 4;       /* maximum device number on this port (0-15) */
     346  unsigned      dev_max     : 4;       /* maximum device number on this port (0..AHCI_MAX_DEVS-1) */
    339347  unsigned      cmd_slot    : 5;       /* current command slot index (using round-
    340348                                        * robin indexes to prevent starvation) */
     
    353361    unsigned    ncq_max   : 5;         /* maximum tag number for queued commands */
    354362    UNITINFO _far *unit_info;          /* pointer to modified unit info */
    355   } devs[15];
     363    DEV_INFO    dev_info;
     364  } devs[AHCI_MAX_DEVS];
    356365} P_INFO;
    357366
     
    360369  PCI_ID       *pci;                   /* pointer to corresponding PCI ID */
    361370
    362   unsigned      port_max : 5;          /* maximum port number (0-31) */
     371  unsigned      port_max : 5;          /* maximum port number (0..AHCI_MAX_PORTS-1) */
    363372  unsigned      cmd_max : 5;           /* maximum cmd slot number (0-31) */
    364373  unsigned      port_scan_done : 1;    /* if != 0, port scan already done */
  • trunk/src/os2ahci/trace.c

    r160 r162  
    246246      for (d = 0; d <= pi->dev_max; d++) {
    247247        if (!pi->devs[d].present) continue;
    248         ntprintf("    Drive %d: atapi=%d, removable=%d\n", d, pi->devs[d].atapi, pi->devs[d].removable);
     248
     249        ntprintf("    Drive %d:");
     250        if (pi->devs[d].atapi) ntprintf(" atapi");
     251        if (pi->devs[d].removable) ntprintf(" removable");
     252        if (pi->devs[d].dev_info.Method != NULL)
     253          ntprintf(" %d cylinders, %d heads, %d sectors per track (%ldMB) (%s)",
     254            pi->devs[d].dev_info.Cylinders, pi->devs[d].dev_info.HeadsPerCylinder, pi->devs[d].dev_info.SectorsPerTrack,
     255            pi->devs[d].dev_info.TotalSectors/2048, pi->devs[d].dev_info.Method);
     256        ntprintf("\n");
    249257      }
    250258    }
Note: See TracChangeset for help on using the changeset viewer.