Changeset 25 for trunk/src/os2ahci/ahci.c
- Timestamp:
- Sep 23, 2010, 4:39:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ahci.c
r14 r25 103 103 #define call_ahci_intr(i) return(ahci_intr(irq_map[i]) >> 1) 104 104 105 static USHORT _far irq_handler_00(void) { call_ahci_intr(0); }106 static USHORT _far irq_handler_01(void) { call_ahci_intr(1); }107 static USHORT _far irq_handler_02(void) { call_ahci_intr(2); }108 static USHORT _far irq_handler_03(void) { call_ahci_intr(3); }109 static USHORT _far irq_handler_04(void) { call_ahci_intr(4); }110 static USHORT _far irq_handler_05(void) { call_ahci_intr(5); }111 static USHORT _far irq_handler_06(void) { call_ahci_intr(6); }112 static USHORT _far irq_handler_07(void) { call_ahci_intr(7); }105 static USHORT _far APIENTRY irq_handler_00(void) { call_ahci_intr(0); } 106 static USHORT _far APIENTRY irq_handler_01(void) { call_ahci_intr(1); } 107 static USHORT _far APIENTRY irq_handler_02(void) { call_ahci_intr(2); } 108 static USHORT _far APIENTRY irq_handler_03(void) { call_ahci_intr(3); } 109 static USHORT _far APIENTRY irq_handler_04(void) { call_ahci_intr(4); } 110 static USHORT _far APIENTRY irq_handler_05(void) { call_ahci_intr(5); } 111 static USHORT _far APIENTRY irq_handler_06(void) { call_ahci_intr(6); } 112 static USHORT _far APIENTRY irq_handler_07(void) { call_ahci_intr(7); } 113 113 114 114 PFN irq_handlers[] = { … … 185 185 if (val & HOST_CAP2_NVMHCI) printf(" nvmhci"); 186 186 if (val & HOST_CAP2_APST) printf(" apst"); 187 187 188 188 } 189 189 printf("\n"); … … 427 427 goto exit_port_scan; 428 428 } 429 429 430 430 /* perform port scan */ 431 431 dprintf("scanning ports on adapter #%d\n", ad_no(ai)); … … 456 456 /* this port has a device attached and is ready to accept commands */ 457 457 ddprintf("port #%d seems to be attached to a device; probing...\n", p); 458 rc = ahci_exec_polled_cmd(ai, p, 0, 500, ATA_CMD_ID_ATA, 458 rc = ahci_exec_polled_cmd(ai, p, 0, 500, ATA_CMD_ID_ATA, 459 459 AP_VADDR, (void _far *) id_buf, 512, 460 460 AP_END); … … 865 865 if (aws->is_ncq && port->reg_cmds == 0 || !aws->is_ncq && port->ncq_cmds == 0) { 866 866 867 /* Find next available command slot. We use a simple round-robin 867 /* Find next available command slot. We use a simple round-robin 868 868 * algorithm for this to prevent commands with higher slot indexes 869 869 * from stalling when new commands are coming in frequently. … … 954 954 goto restore_bios_config; 955 955 } 956 956 957 957 /* save port configuration */ 958 958 if ((pc = ahci_save_port_config(ai, p)) == NULL) { … … 1132 1132 u32 active_cmds; 1133 1133 u32 done_mask; 1134 1134 1135 1135 ddprintf("port interrupt for adapter #%d, port #%d\n", ad_no(ai), p); 1136 1136 memset(&done_queue, 0x00, sizeof(done_queue)); … … 1140 1140 writel(port_mmio + PORT_IRQ_STAT, irq_stat); 1141 1141 readl(port_mmio + PORT_IRQ_STAT); /* flush */ 1142 1142 1143 1143 if (irq_stat & PORT_IRQ_ERROR) { 1144 1144 /* this is an error interrupt */ … … 1258 1258 /* no point analyzing device errors after a reset... */ 1259 1259 return; 1260 } 1260 } 1261 1261 1262 1262 /* Handle device-specific errors. Those errors typically involve restarting … … 1269 1269 } 1270 1270 } 1271 1271 1272 1272 /****************************************************************************** 1273 1273 * Get device or media geometry. Device and media geometry are expected to be … … 1304 1304 1305 1305 ahci_exec_iorb(iorb, 1, cmd_func(iorb, read)); 1306 } 1306 } 1307 1307 1308 1308 /****************************************************************************** … … 1344 1344 ((IORB_ADAPTER_PASSTHRU _far *) iorb)->ControllerCmdLen, 1345 1345 "ahci_execute_cdb(%d.%d.%d)", a, p, d); 1346 1346 1347 1347 if (ad_infos[a].ports[p].devs[d].atapi) { 1348 1348 ahci_exec_iorb(iorb, 0, atapi_execute_cdb); … … 1361 1361 int p = iorb_unit_port(iorb); 1362 1362 int d = iorb_unit_device(iorb); 1363 1363 1364 1364 dphex(((IORB_ADAPTER_PASSTHRU _far *) iorb)->pControllerCmd, 1365 1365 ((IORB_ADAPTER_PASSTHRU _far *) iorb)->ControllerCmdLen, 1366 1366 "ahci_execute_cdb(%d.%d.%d)", a, p, d); 1367 1367 1368 1368 if (ad_infos[a].ports[p].devs[d].atapi) { 1369 1369 iorb_seterr(iorb, IOERR_CMD_NOT_SUPPORTED);
Note:
See TracChangeset
for help on using the changeset viewer.