Ignore:
Timestamp:
Dec 20, 2016, 9:35:27 PM (9 years ago)
Author:
David Azarewicz
Message:

Fix for sparse port hardware

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/os2ahci.h

    r184 r185  
    243243/* port information structure */
    244244typedef struct {
    245   IORB_QUEUE    iorb_queue;            /* IORB queue for this port */
    246   unsigned      dev_max     : 4;       /* maximum device number on this port (0..AHCI_MAX_DEVS-1) */
    247   unsigned      cmd_slot    : 5;       /* current command slot index (using round-
    248                                         * robin indexes to prevent starvation) */
    249 
    250   volatile u32  ncq_cmds;              /* bitmap for NCQ commands issued */
    251   volatile u32  reg_cmds;              /* bitmap for regular commands issued */
    252   u32           dma_buf_phys;          /* physical address of DMA scratch buffer */
    253   u8           *dma_buf;               /* DMA scatch buffers */
    254 
    255   struct {
     245  IORB_QUEUE    iorb_queue;            /* 00 IORB queue for this port */
     246  unsigned      dev_max     : 4;       /* 08 maximum device number on this port (0..AHCI_MAX_DEVS-1) */
     247  unsigned      cmd_slot    : 5;       /*    current command slot index (using round-
     248                                        *    robin indexes to prevent starvation) */
     249
     250  volatile u32  ncq_cmds;              /* 0c bitmap for NCQ commands issued */
     251  volatile u32  reg_cmds;              /* 10 bitmap for regular commands issued */
     252  u32           dma_buf_phys;          /* 14 physical address of DMA scratch buffer */
     253  u8           *dma_buf;               /* 18 DMA scatch buffers */
     254
     255  struct {                             /* 1c */
    256256    unsigned allocated :1;        /* if != 0, device is allocated */
    257257    unsigned present   :1;        /* if != 0, device is present */
     
    264264    UNITINFO *unit_info;          /* pointer to modified unit info */
    265265    DEV_INFO dev_info;
     266    char dev_name[AHCI_DEV_NAME_LEN];
    266267  } devs[AHCI_MAX_DEVS];
    267268
     
    272273/* adapter information structure */
    273274typedef struct {
    274   PCI_ID       *pci;                   /* pointer to corresponding PCI ID */
    275 
    276   unsigned      port_max : 5;          /* maximum port number (0..AHCI_MAX_PORTS-1) */
    277   unsigned      cmd_max : 5;           /* maximum cmd slot number (0-31) */
    278   unsigned      port_scan_done : 1;    /* if != 0, port scan already done */
    279   unsigned      busy : 1;              /* if != 0, adapter is busy */
    280 
    281   unsigned      hw_ports : 6;          /* number of ports as reported by the hardware */
    282 
    283   u32           port_map;              /* bitmap of active ports */
    284   u16           pci_vendor;
    285   u16           pci_device;
     275  PCI_ID       *pci;                   /* 00 pointer to corresponding PCI ID */
     276
     277  unsigned      port_max : 5;          /* 04 maximum port number (0..AHCI_MAX_PORTS-1) */
     278  unsigned      cmd_max : 5;           /*    maximum cmd slot number (0-31) */
     279  unsigned      port_scan_done : 1;    /*    if != 0, port scan already done */
     280  unsigned      busy : 1;              /*    if != 0, adapter is busy */
     281  unsigned      hw_ports : 6;          /*    number of ports as reported by the hardware */
     282
     283  u32           port_map;              /* 08   bitmap of active ports */
     284  u16           pci_vendor;            /* 0c */
     285  u16           pci_device;            /* 0e */
    286286
    287287  /* initial adapter configuration from BIOS */
    288   u32           bios_config[HOST_CAP2 / sizeof(u32) + 1];
    289 
    290   u32           cap;                   /* working copy of CAP register */
    291   u32           cap2;                  /* working copy of CAP2 register */
    292   u32           flags;                 /* adapter flags */
    293 
    294   HRESOURCE     rm_adh;                /* resource handle for adapter */
    295   HRESOURCE     rm_bars[6];            /* resource handle for MMIO and I/O BARs */
    296   HRESOURCE     rm_irq;                /* resource handle for IRQ */
    297 
    298   u16           bus_dev_func;          /* PCI bus number PCI device and function number */
    299   u16           irq;                   /* interrupt number */
    300 
    301   u32           mmio_phys;             /* physical address of MMIO region */
    302   u32           mmio_size;             /* size of MMIO region */
    303   u8           *mmio;                  /* pointer to this adapter's MMIO region */
    304 
    305   P_INFO        ports[AHCI_MAX_PORTS]; /* SATA ports on this adapter */
     288  u32           bios_config[HOST_CAP2 / sizeof(u32) + 1];  /* 10  0x24 / 4 + 1 = 0x0a dwords = 0x28 bytes*/
     289
     290  u32           cap;                   /* 38 working copy of CAP register */
     291  u32           cap2;                  /* 3c working copy of CAP2 register */
     292  u32           flags;                 /* 40 adapter flags */
     293
     294  HRESOURCE     rm_adh;                /* 44 resource handle for adapter */
     295  HRESOURCE     rm_bars[6];            /* 48 resource handle for MMIO and I/O BARs */
     296  HRESOURCE     rm_irq;                /* 60 resource handle for IRQ */
     297
     298  u16           bus_dev_func;          /* 64 PCI bus number PCI device and function number */
     299  u16           irq;                   /* 66 interrupt number */
     300
     301  u32           mmio_phys;             /* 68 physical address of MMIO region */
     302  u32           mmio_size;             /* 6c size of MMIO region */
     303  u8           *mmio;                  /* 70 pointer to this adapter's MMIO region */
     304
     305  P_INFO        ports[AHCI_MAX_PORTS]; /* 74 SATA ports on this adapter */
    306306} AD_INFO;
    307307
Note: See TracChangeset for help on using the changeset viewer.