Lines Matching refs:channel

21 #define CHANNEL_MODULE_NAME		"busses/ata/silicon_image_3112/channel/v1"
65 struct channel_data *channel[4]; // XXX only for interrupt workaround
305 controller->channel[i] = 0;
372 // publish channel nodes
380 // private data to identify channel
412 channel_data *channel;
419 channel = malloc(sizeof(channel_data));
420 if (!channel)
441 TRACE("channel name: %s\n", kControllerChannelData[channelIndex].name);
443 TRACE("channel %p\n", channel);
456 channel->prd_area = create_area("prd", (void **)&channel->prdt,
459 if (channel->prd_area < B_OK) {
464 get_memory_map(channel->prdt, prdtSize, &entry, 1);
465 channel->prdt_phys = entry.address;
467 channel->pci = controller->pci;
468 channel->device = controller->device;
469 channel->node = node;
470 channel->ataChannel = NULL;
472 channel->task_file = (volatile uint8 *)(controller->mmio_addr + kControllerChannelData[channelIndex].cmd + 1);
473 channel->control_block = (volatile uint8 *)(controller->mmio_addr + kControllerChannelData[channelIndex].ctl);
474 channel->command_block = (volatile uint8 *)(controller->mmio_addr + kControllerChannelData[channelIndex].cmd);
475 channel->dev_ctrl = (volatile uint8 *)(controller->mmio_addr + kControllerChannelData[channelIndex].ctl);
476 channel->bm_prdt_address = (volatile uint32 *)(controller->mmio_addr + kControllerChannelData[channelIndex].bmdma + ATA_BM_PRDT_ADDRESS);
477 channel->bm_status_reg = (volatile uint8 *)(controller->mmio_addr + kControllerChannelData[channelIndex].bmdma + ATA_BM_STATUS_REG);
478 channel->bm_command_reg = (volatile uint8 *)(controller->mmio_addr + kControllerChannelData[channelIndex].bmdma + ATA_BM_COMMAND_REG);
479 channel->stat = (volatile uint32 *)(controller->mmio_addr + kControllerChannelData[channelIndex].stat);
481 channel->lost = 0;
482 channel->dma_active = 0;
484 controller->channel[channelIndex] = channel;
487 device_control_write(channel, ATA_DEVICE_CONTROL_BIT3
490 *_channelCookie = channel;
496 free(channel);
504 channel_data *channel = channelCookie;
509 device_control_write(channel, ATA_DEVICE_CONTROL_BIT3
512 delete_area(channel->prd_area);
513 free(channel);
522 channel_data *channel = channelCookie;
523 channel->lost = 1;
530 channel_data *channel = channelCookie;
531 channel->ataChannel = ataChannel;
538 channel_data *channel = channelCookie;
543 if (channel->lost)
549 channel->task_file[i] = tf->raw.r[i + 7];
554 channel->task_file[i] = tf->raw.r[i];
557 *channel->dev_ctrl; // read altstatus to flush
566 channel_data *channel = channelCookie;
571 if (channel->lost)
576 tf->raw.r[i] = channel->task_file[i];
588 channel_data *channel = channelCookie;
592 if (channel->lost)
595 return *channel->dev_ctrl;
602 channel_data *channel = channelCookie;
606 if (channel->lost)
609 *channel->dev_ctrl = val;
610 *channel->dev_ctrl; // read altstatus to flush
619 channel_data *channel = channelCookie;
620 if (channel->lost)
628 volatile uint16 * base = (volatile uint16 *)channel->command_block;
632 volatile uint32 * base = (volatile uint32 *)channel->command_block;
638 *channel->dev_ctrl; // read altstatus to flush
647 channel_data *channel = channelCookie;
648 if (channel->lost)
657 volatile uint16 * base = (volatile uint16 *)channel->command_block;
661 volatile uint32 * base = (volatile uint32 *)channel->command_block;
676 channel_data *channel = channelCookie;
677 pci_device_module_info *pci = channel->pci;
678 pci_device *device = channel->device;
679 prd_entry *prd = channel->prdt;
687 for (i = sg_list_count - 1, prd = channel->prdt; i >= 0;
700 temp = (*channel->bm_prdt_address) & 3;
702 channel->prdt_phys)) & ~3;
703 *channel->bm_prdt_address = temp;
705 *channel->dev_ctrl; // read altstatus to flush
708 status = *channel->bm_status_reg | ATA_BM_STATUS_INTERRUPT
710 *channel->bm_status_reg = status;
712 *channel->dev_ctrl; // read altstatus to flush
715 command = *channel->bm_command_reg;
721 *channel->bm_command_reg = command;
723 *channel->dev_ctrl; // read altstatus to flush
734 channel_data *channel = channelCookie;
739 command = *channel->bm_command_reg | ATA_BM_COMMAND_START_STOP;
740 channel->dma_active = true;
741 *channel->bm_command_reg = command;
743 *channel->dev_ctrl; // read altstatus to flush
754 channel_data *channel = channelCookie;
760 status = *channel->bm_status_reg;
762 command = *channel->bm_command_reg;
763 *channel->bm_command_reg = command & ~ATA_BM_COMMAND_START_STOP;
765 channel->dma_active = false;
767 *channel->bm_status_reg = status | ATA_BM_STATUS_ERROR;
768 *channel->dev_ctrl; // read altstatus to flush
797 channel_data *channel = controller->channel[i];
798 if (!channel || channel->lost)
801 if (!channel->dma_active) {
804 *(channel->command_block + 7);
808 statusBM = *channel->bm_status_reg;
810 statusATA = *(channel->command_block + 7);
811 *channel->bm_status_reg
813 sATA->interrupt_handler(channel->ataChannel, statusATA);