Changeset 55a8e0c in mainline
- Timestamp:
- 2011-11-13T21:22:51Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e6def65
- Parents:
- d98d136
- Location:
- uspace/drv/bus/isa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/isa/isa.c
rd98d136 r55a8e0c 74 74 #define ISA_FUN(fun) ((isa_fun_t *) ((fun)->driver_data)) 75 75 76 #define ISA_MAX_HW_RES 476 #define ISA_MAX_HW_RES 5 77 77 78 78 typedef struct { … … 314 314 } 315 315 316 static void isa_fun_set_dma(isa_fun_t *fun, int dma) 317 { 318 size_t count = fun->hw_resources.count; 319 hw_resource_t *resources = fun->hw_resources.resources; 320 321 if (count < ISA_MAX_HW_RES) { 322 if (dma > 0 && dma < 4) { 323 resources[count].type = DMA_CHANNEL_8; 324 resources[count].res.dma_channel.dma8 = dma; 325 326 fun->hw_resources.count++; 327 ddf_msg(LVL_NOTE, "Added dma 0x%x to function %s", dma, 328 fun->fnode->name); 329 return; 330 } 331 332 if (dma > 4 && dma < 8) { 333 resources[count].type = DMA_CHANNEL_16; 334 resources[count].res.dma_channel.dma16 = dma; 335 336 fun->hw_resources.count++; 337 ddf_msg(LVL_NOTE, "Added dma 0x%x to function %s", dma, 338 fun->fnode->name); 339 return; 340 } 341 342 ddf_msg(LVL_WARN, "Skipped dma 0x%x for function %s", dma, 343 fun->fnode->name); 344 } 345 } 346 316 347 static void isa_fun_set_io_range(isa_fun_t *fun, size_t addr, size_t len) 317 348 { … … 343 374 if (val != end) 344 375 isa_fun_set_irq(fun, irq); 376 } 377 378 static void fun_parse_dma(isa_fun_t *fun, char *val) 379 { 380 int dma = 0; 381 char *end = NULL; 382 383 val = skip_spaces(val); 384 dma = (int)strtol(val, &end, 10); 385 386 if (val != end) 387 isa_fun_set_dma(fun, dma); 345 388 } 346 389 … … 436 479 if (!prop_parse(fun, line, "io_range", &fun_parse_io_range) && 437 480 !prop_parse(fun, line, "irq", &fun_parse_irq) && 481 !prop_parse(fun, line, "dma", &fun_parse_dma) && 438 482 !prop_parse(fun, line, "match", &fun_parse_match_id)) { 439 483 -
uspace/drv/bus/isa/isa.dev
rd98d136 r55a8e0c 16 16 sb16: 17 17 match 100 isa/sb16 18 irq 519 18 io_range 220 20 20 19 io_range 330 2 20 irq 5 21 dma 1 22 dma 5
Note:
See TracChangeset
for help on using the changeset viewer.