Lines Matching full:port

38 static void check_cmd(AHCIState *s, int port);
39 static void handle_cmd(AHCIState *s, int port, uint8_t slot);
40 static void ahci_reset_port(AHCIState *s, int port);
110 static uint32_t ahci_port_read(AHCIState *s, int port, int offset) in ahci_port_read() argument
113 AHCIPortRegs *pr = &s->dev[port].port_regs; in ahci_port_read()
146 if (s->dev[port].port.ifs[0].blk) { in ahci_port_read()
166 trace_ahci_port_read_default(s, port, AHCIPortReg_lookup[regnum], in ahci_port_read()
171 trace_ahci_port_read(s, port, AHCIPortReg_lookup[regnum], offset, val); in ahci_port_read()
272 static void ahci_port_write(AHCIState *s, int port, int offset, uint32_t val) in ahci_port_write() argument
274 AHCIPortRegs *pr = &s->dev[port].port_regs; in ahci_port_write()
277 trace_ahci_port_write(s, port, AHCIPortReg_lookup[regnum], offset, val); in ahci_port_write()
316 ahci_cond_start_engines(&s->dev[port]); in ahci_port_write()
323 !s->dev[port].init_d2h_sent) { in ahci_port_write()
324 ahci_init_d2h(&s->dev[port]); in ahci_port_write()
327 check_cmd(s, port); in ahci_port_write()
337 ahci_reset_port(s, port); in ahci_port_write()
350 check_cmd(s, port); in ahci_port_write()
353 trace_ahci_port_write_unimpl(s, port, AHCIPortReg_lookup[regnum], in ahci_port_write()
356 "AHCI port %d register %s, offset 0x%x: 0x%"PRIx32, in ahci_port_write()
357 port, AHCIPortReg_lookup[regnum], offset, val); in ahci_port_write()
562 static void check_cmd(AHCIState *s, int port) in check_cmd() argument
564 AHCIPortRegs *pr = &s->dev[port].port_regs; in check_cmd()
570 handle_cmd(s, port, slot); in check_cmd()
588 IDEState *ide_state = &ad->port.ifs[0]; in ahci_init_d2h()
612 IDEState *s = &ad->port.ifs[0]; in ahci_set_signature()
622 static void ahci_reset_port(AHCIState *s, int port) in ahci_reset_port() argument
624 AHCIDevice *d = &s->dev[port]; in ahci_reset_port()
626 IDEState *ide_state = &d->port.ifs[0]; in ahci_reset_port()
629 trace_ahci_reset_port(s, port); in ahci_reset_port()
631 ide_bus_reset(&d->port); in ahci_reset_port()
643 ide_state = &s->dev[port].port.ifs[0]; in ahci_reset_port()
650 NCQTransferState *ncq_tfs = &s->dev[port].ncq_tfs[i]; in ahci_reset_port()
670 s->dev[port].port_state = STATE_RUN; in ahci_reset_port()
766 ide_state = &ad->port.ifs[0]; in ahci_write_fis_sdb()
777 pr->tfdata = (ad->port.ifs[0].error << 8) | in ahci_write_fis_sdb()
778 (ad->port.ifs[0].status & 0x77) | in ahci_write_fis_sdb()
799 IDEState *s = &ad->port.ifs[0]; in ahci_write_fis_pio()
830 pr->tfdata = (ad->port.ifs[0].error << 8) | in ahci_write_fis_pio()
831 ad->port.ifs[0].status; in ahci_write_fis_pio()
843 IDEState *s = &ad->port.ifs[0]; in ahci_write_fis_d2h()
871 pr->tfdata = (ad->port.ifs[0].error << 8) | in ahci_write_fis_d2h()
872 ad->port.ifs[0].status; in ahci_write_fis_d2h()
918 IDEBus *bus = &ad->port; in ahci_populate_sglist()
985 IDEState *ide_state = &ncq_tfs->drive->port.ifs[0]; in ncq_err()
1007 block_acct_done(blk_get_stats(ncq_tfs->drive->port.ifs[0].blk), in ncq_finish()
1016 IDEState *ide_state = &ncq_tfs->drive->port.ifs[0]; in ncq_cb()
1058 IDEState *ide_state = &ad->port.ifs[0]; in execute_ncq_command()
1059 int port = ad->port_no; in execute_ncq_command() local
1066 trace_execute_ncq_command_read(ad->hba, port, ncq_tfs->tag, in execute_ncq_command()
1076 trace_execute_ncq_command_write(ad->hba, port, ncq_tfs->tag, in execute_ncq_command()
1086 trace_execute_ncq_command_unsup(ad->hba, port, in execute_ncq_command()
1093 static void process_ncq_command(AHCIState *s, int port, const uint8_t *cmd_fis, in process_ncq_command() argument
1096 AHCIDevice *ad = &s->dev[port]; in process_ncq_command()
1143 trace_process_ncq_command_mismatch(s, port, tag, slot); in process_ncq_command()
1147 trace_process_ncq_command_aux(s, port, tag); in process_ncq_command()
1150 trace_process_ncq_command_prioicc(s, port, tag); in process_ncq_command()
1153 trace_process_ncq_command_fua(s, port, tag); in process_ncq_command()
1156 trace_process_ncq_command_rarc(s, port, tag); in process_ncq_command()
1175 trace_process_ncq_command_large(s, port, tag, in process_ncq_command()
1179 trace_process_ncq_command(s, port, tag, in process_ncq_command()
1186 static AHCICmdHdr *get_cmd_header(AHCIState *s, uint8_t port, uint8_t slot) in get_cmd_header() argument
1188 if (port >= s->ports || slot >= AHCI_MAX_CMDS) { in get_cmd_header()
1192 return s->dev[port].lst ? &((AHCICmdHdr *)s->dev[port].lst)[slot] : NULL; in get_cmd_header()
1195 static void handle_reg_h2d_fis(AHCIState *s, int port, in handle_reg_h2d_fis() argument
1198 IDEState *ide_state = &s->dev[port].port.ifs[0]; in handle_reg_h2d_fis()
1199 AHCICmdHdr *cmd = get_cmd_header(s, port, slot); in handle_reg_h2d_fis()
1200 AHCIDevice *ad = &s->dev[port]; in handle_reg_h2d_fis()
1204 trace_handle_reg_h2d_fis_pmp(s, port, cmd_fis[1], in handle_reg_h2d_fis()
1210 trace_handle_reg_h2d_fis_res(s, port, cmd_fis[1], in handle_reg_h2d_fis()
1216 switch (s->dev[port].port_state) { in handle_reg_h2d_fis()
1219 s->dev[port].port_state = STATE_RESET; in handle_reg_h2d_fis()
1244 ahci_reset_port(s, port); in handle_reg_h2d_fis()
1253 process_ncq_command(s, port, cmd_fis, slot); in handle_reg_h2d_fis()
1287 trace_handle_reg_h2d_fis_dump(s, port, pretty_fis); in handle_reg_h2d_fis()
1293 s->dev[port].done_first_drq = false; in handle_reg_h2d_fis()
1306 ide_bus_exec_cmd(&s->dev[port].port, cmd_fis[2]); in handle_reg_h2d_fis()
1309 static void handle_cmd(AHCIState *s, int port, uint8_t slot) in handle_cmd() argument
1317 if (s->dev[port].port.ifs[0].status & (BUSY_STAT|DRQ_STAT)) { in handle_cmd()
1319 trace_handle_cmd_busy(s, port); in handle_cmd()
1323 if (!s->dev[port].lst) { in handle_cmd()
1324 trace_handle_cmd_nolist(s, port); in handle_cmd()
1327 cmd = get_cmd_header(s, port, slot); in handle_cmd()
1329 s->dev[port].cur_cmd = cmd; in handle_cmd()
1332 ide_state = &s->dev[port].port.ifs[0]; in handle_cmd()
1334 trace_handle_cmd_badport(s, port); in handle_cmd()
1343 trace_handle_cmd_badfis(s, port); in handle_cmd()
1346 ahci_trigger_irq(s, &s->dev[port], AHCI_PORT_IRQ_BIT_HBFS); in handle_cmd()
1347 trace_handle_cmd_badmap(s, port, cmd_len); in handle_cmd()
1352 trace_handle_cmd_fis_dump(s, port, pretty_fis); in handle_cmd()
1357 handle_reg_h2d_fis(s, port, slot, cmd_fis); in handle_cmd()
1360 trace_handle_cmd_unhandled_fis(s, port, in handle_cmd()
1374 IDEState *s = &ad->port.ifs[0]; in ahci_pio_transfer()
1470 IDEState *s = &ad->port.ifs[0]; in ahci_dma_prepare_buf()
1499 IDEState *s = &ad->port.ifs[0]; in ahci_dma_rw_buf()
1523 IDEState *ide_state = &ad->port.ifs[0]; in ahci_clear_cmd_issue()
1535 IDEState *ide_state = &ad->port.ifs[0]; in ahci_cmd_done()
1598 ide_bus_init(&ad->port, sizeof(ad->port), qdev, i, 1); in ahci_realize()
1599 ide_bus_init_output_irq(&ad->port, irqs[i]); in ahci_realize()
1603 ad->port.dma = &ad->dma; in ahci_realize()
1604 ad->port.dma->ops = &ahci_dma_ops; in ahci_realize()
1605 ide_bus_register_restart_cb(&ad->port); in ahci_realize()
1618 ide_exit(&ad->port.ifs[j]); in ahci_uninit()
1620 object_unparent(OBJECT(&ad->port)); in ahci_uninit()
1670 .name = "ahci port",
1673 VMSTATE_IDE_BUS(port, AHCIDevice),
1674 VMSTATE_IDE_DRIVE(port.ifs[0], AHCIDevice),
1811 ide_bus_create_drive(&ahci->dev[i].port, 0, hd[i]); in ahci_ide_create_devs()