Changeset b7068da in mainline for uspace/drv/nic/ne2k/ne2k.c


Ignore:
Timestamp:
2012-02-09T20:35:12Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
591762c6
Parents:
7cede12c (diff), 3d4750f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/ne2k/ne2k.c

    r7cede12c rb7068da  
    261261        /* Note: some frame with previous physical address may slip to NIL here
    262262         * (for a moment the filtering is not exact), but ethernet should be OK with
    263          * that. Some packet may also be lost, but this is not a problem.
     263         * that. Some frames may also be lost, but this is not a problem.
    264264         */
    265265        ne2k_set_physical_address((ne2k_t *) nic_get_specific(nic_data), address);
     
    338338static int ne2k_dev_add(ddf_dev_t *dev)
    339339{
     340        ddf_fun_t *fun;
     341       
    340342        /* Allocate driver data for the device. */
    341343        nic_t *nic_data = nic_create_and_bind(dev);
     
    343345                return ENOMEM;
    344346       
    345         nic_set_write_packet_handler(nic_data, ne2k_send);
     347        nic_set_send_frame_handler(nic_data, ne2k_send);
    346348        nic_set_state_change_handlers(nic_data,
    347349                ne2k_on_activating, NULL, ne2k_on_stopping);
     
    371373        }
    372374       
    373         rc = nic_register_as_ddf_fun(nic_data, &ne2k_dev_ops);
     375        rc = nic_connect_to_services(nic_data);
    374376        if (rc != EOK) {
    375377                ne2k_dev_cleanup(dev);
     
    377379        }
    378380       
    379         rc = nic_connect_to_services(nic_data);
    380         if (rc != EOK) {
     381        fun = ddf_fun_create(nic_get_ddf_dev(nic_data), fun_exposed, "port0");
     382        if (fun == NULL) {
    381383                ne2k_dev_cleanup(dev);
     384                return ENOMEM;
     385        }
     386        nic_set_ddf_fun(nic_data, fun);
     387        fun->ops = &ne2k_dev_ops;
     388        fun->driver_data = nic_data;
     389       
     390        rc = ddf_fun_bind(fun);
     391        if (rc != EOK) {
     392                ddf_fun_destroy(fun);
     393                ne2k_dev_cleanup(dev);
     394                return rc;
     395        }
     396       
     397        rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
     398        if (rc != EOK) {
     399                ddf_fun_unbind(fun);
     400                ddf_fun_destroy(fun);
    382401                return rc;
    383402        }
Note: See TracChangeset for help on using the changeset viewer.