Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 1ec394e in mainline


Ignore:
Timestamp:
2012-08-18T10:58:04Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
f6992df
Parents:
4a9704ad
Message:

isa: Refactoring.

Location:
uspace/drv/bus/isa
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/isa/i8237.c

    r4a9704ad r1ec394e  
    321321 *
    322322 * @return Error code.
    323  *
    324  */
    325 int dma_setup_channel(unsigned int channel, uint32_t pa, uint16_t size,
     323 */
     324int dma_channel_setup(unsigned int channel, uint32_t pa, uint16_t size,
    326325    uint8_t mode)
    327326{
  • uspace/drv/bus/isa/i8237.h

    r4a9704ad r1ec394e  
    3838#define DRV_BUS_ISA_I8237_H
    3939
    40 extern int dma_setup_channel(unsigned int, uint32_t, uint16_t, uint8_t);
     40extern int dma_channel_setup(unsigned, uint32_t, uint16_t, uint8_t);
    4141
    4242#endif
  • uspace/drv/bus/isa/isa.c

    r4a9704ad r1ec394e  
    9999{
    100100        isa_fun_t *fun = ISA_FUN(fnode);
    101         assert(fun != NULL);
     101        assert(fun);
    102102
    103103        return &fun->hw_resources;
     
    108108        /* This is an old ugly way, copied from pci driver */
    109109        assert(fnode);
    110         isa_fun_t *isa_fun = fnode->driver_data;
     110        isa_fun_t *isa_fun = ISA_FUN(fnode);
    111111
    112112        sysarg_t apic;
     
    152152        assert(fnode);
    153153        isa_fun_t *isa_fun = fnode->driver_data;
     154        assert(isa_fun);
    154155        const hw_resource_list_t *res = &isa_fun->hw_resources;
    155156        assert(res);
    156157       
    157         const unsigned int ch = channel;
    158158        for (size_t i = 0; i < res->count; ++i) {
     159                /* Check for assigned channel */
    159160                if (((res->resources[i].type == DMA_CHANNEL_16) &&
    160                     (res->resources[i].res.dma_channel.dma16 == ch)) ||
     161                    (res->resources[i].res.dma_channel.dma16 == channel)) ||
    161162                    ((res->resources[i].type == DMA_CHANNEL_8) &&
    162                     (res->resources[i].res.dma_channel.dma8 == ch))) {
    163                         return dma_setup_channel(channel, pa, size, mode);
     163                    (res->resources[i].res.dma_channel.dma8 == channel))) {
     164                        return dma_channel_setup(channel, pa, size, mode);
    164165                }
    165166        }
     
    403404       
    404405        val = skip_spaces(val);
    405         int dma = strtol(val, &end, 10);
     406        const int dma = strtol(val, &end, 10);
    406407       
    407408        if (val != end)
Note: See TracChangeset for help on using the changeset viewer.