Changeset ec388d7 in mainline
- Timestamp:
- 2011-11-14T10:03:49Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a0d1d9d
- Parents:
- 8a5962f
- Location:
- uspace/drv/bus/isa
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/isa/Makefile
r8a5962f rec388d7 1 1 # 2 2 # Copyright (c) 2010 Lenka Trochtova 3 # Copyright (c) 2011 Jan Vesely 3 4 # All rights reserved. 4 5 # … … 33 34 34 35 SOURCES = \ 36 dma_controller.c \ 35 37 isa.c 36 38 -
uspace/drv/bus/isa/isa.c
r8a5962f rec388d7 2 2 * Copyright (c) 2010 Lenka Trochtova 3 3 * Copyright (c) 2011 Jiri Svoboda 4 * Copyright (c) 2011 Jan Vesely 4 5 * All rights reserved. 5 6 * … … 65 66 #include <device/hw_res.h> 66 67 68 #include "dma_controller.h" 69 67 70 #define NAME "isa" 68 71 #define CHILD_FUN_CONF_PATH "/drv/isa/isa.dev" … … 119 122 120 123 assert(isa_fun); 121 hw_resource_list_t *res = &isa_fun->hw_resources;124 const hw_resource_list_t *res = &isa_fun->hw_resources; 122 125 assert(res); 123 for (size_t i = 0; i < res->count; i++) {126 for (size_t i = 0; i < res->count; ++i) { 124 127 if (res->resources[i].type == INTERRUPT) { 125 128 const int irq = res->resources[i].res.interrupt.irq; … … 141 144 } 142 145 146 static int isa_dma_channel_fun_setup(ddf_fun_t *fnode, 147 unsigned channel, uint32_t pa, uint16_t size, uint8_t mode) 148 { 149 assert(fnode); 150 isa_fun_t *isa_fun = fnode->driver_data; 151 const hw_resource_list_t *res = &isa_fun->hw_resources; 152 assert(res); 153 const int ch = channel; 154 for (size_t i = 0; i < res->count; ++i) { 155 if ((res->resources[i].type == DMA_CHANNEL_16 && 156 res->resources[i].res.dma_channel.dma16 == ch) || 157 (res->resources[i].type == DMA_CHANNEL_8 && 158 res->resources[i].res.dma_channel.dma8 == ch)) { 159 return dma_setup_channel(channel, pa, size, mode); 160 } 161 } 162 return EINVAL; 163 } 164 143 165 static hw_res_ops_t isa_fun_hw_res_ops = { 144 .get_resource_list = &isa_get_fun_resources, 145 .enable_interrupt = &isa_enable_fun_interrupt, 166 .get_resource_list = isa_get_fun_resources, 167 .enable_interrupt = isa_enable_fun_interrupt, 168 .dma_channel_setup = isa_dma_channel_fun_setup, 146 169 }; 147 170
Note:
See TracChangeset
for help on using the changeset viewer.