Changeset 5159ae9 in mainline for uspace/srv


Ignore:
Timestamp:
2010-05-29T08:37:38Z (16 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ce89036b
Parents:
692c40cb
Message:

Rename 'device_class' structure to a more appropriate 'device_ops'. The device_class structure has nothing in common with the device classes introduced by the previous commit and it evolved to just a set of callback functions.

Location:
uspace/srv/drivers
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/drivers/isa/isa.c

    r692c40cb r5159ae9  
    8787};
    8888
    89 static device_class_t isa_child_class;
     89static device_ops_t isa_child_dev_ops;
    9090
    9191static int isa_add_device(device_t *dev);
     
    449449        }
    450450       
    451         // set a class (including the corresponding set of interfaces) to the device
    452         dev->class = &isa_child_class;
     451        // set device operations to the device
     452        dev->ops = &isa_child_dev_ops;
    453453       
    454454        printf(NAME ": child_device_register(dev, parent); device is %s.\n", dev->name);
     
    487487static void isa_init()
    488488{
    489         isa_child_class.id = 0; // TODO
    490         isa_child_class.interfaces[HW_RES_DEV_IFACE] = &isa_child_res_iface;
     489        isa_child_dev_ops.interfaces[HW_RES_DEV_IFACE] = &isa_child_res_iface;
    491490}
    492491
  • uspace/srv/drivers/ns8250/ns8250.c

    r692c40cb r5159ae9  
    228228}
    229229
    230 static device_class_t ns8250_dev_class;
     230static device_ops_t ns8250_dev_ops;
    231231
    232232/** The character interface's callbacks.
     
    758758        }       
    759759       
    760         dev->class = &ns8250_dev_class;
     760        // set device operations
     761        dev->ops = &ns8250_dev_ops;
    761762       
    762763        add_device_to_class(dev, "serial");
     
    900901/** Initialize the serial port driver.
    901902 *
    902  * Initialize class structures with callback methods for handling
     903 * Initialize device operations structures with callback methods for handling
    903904 * client requests to the serial port devices.
    904905 */
    905906static void ns8250_init()
    906907{
    907         // TODO
    908         ns8250_dev_class.id = 0;
    909         ns8250_dev_class.open = &ns8250_open;
    910         ns8250_dev_class.close = &ns8250_close;
    911        
    912         ns8250_dev_class.interfaces[CHAR_DEV_IFACE] = &ns8250_char_iface;
    913         ns8250_dev_class.default_handler = &ns8250_default_handler;
     908        ns8250_dev_ops.open = &ns8250_open;
     909        ns8250_dev_ops.close = &ns8250_close;   
     910       
     911        ns8250_dev_ops.interfaces[CHAR_DEV_IFACE] = &ns8250_char_iface;
     912        ns8250_dev_ops.default_handler = &ns8250_default_handler;
    914913}
    915914
  • uspace/srv/drivers/pciintel/pci.c

    r692c40cb r5159ae9  
    8282};
    8383
    84 static device_class_t pci_child_class;
     84static device_ops_t pci_child_ops;
    8585
    8686
     
    398398                        pci_read_interrupt(dev);
    399399                       
    400                         dev->class = &pci_child_class;                 
     400                        dev->ops = &pci_child_ops;                     
    401401                       
    402402                        printf(NAME ": adding new child device %s.\n", dev->name);
     
    491491static void pciintel_init()
    492492{
    493         pci_child_class.id = 0; // TODO
    494         pci_child_class.interfaces[HW_RES_DEV_IFACE] = &pciintel_child_res_iface;
     493        pci_child_ops.interfaces[HW_RES_DEV_IFACE] = &pciintel_child_res_iface;
    495494}
    496495
  • uspace/srv/drivers/rootia32/rootia32.c

    r692c40cb r5159ae9  
    113113
    114114// initialized in root_ia32_init() function
    115 static device_class_t rootia32_child_class;
     115static device_ops_t rootia32_child_ops;
    116116
    117117static bool rootia32_add_child(
     
    140140        add_match_id(&child->match_ids, match_id);     
    141141       
    142         // set class to the device
    143         child->class = &rootia32_child_class;
     142        // set provided operations to the device
     143        child->ops = &rootia32_child_ops;
    144144       
    145145        // register child  device
     
    188188
    189189static void root_ia32_init() {
    190         // initialize child device class               
    191         rootia32_child_class.id = 0;    // TODO
    192         rootia32_child_class.interfaces[HW_RES_DEV_IFACE] = &child_res_iface;
     190        rootia32_child_ops.interfaces[HW_RES_DEV_IFACE] = &child_res_iface;
    193191}
    194192
Note: See TracChangeset for help on using the changeset viewer.