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


Ignore:
Timestamp:
2014-07-21T22:10:18Z (10 years ago)
Author:
Agnieszka Tabaka <nufcia@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1f1fa64
Parents:
96e368a (diff), 54a1ca7 (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:
  • Merged mainline changes
  • Refactored rtl8169 driver to work with recent driver framework changes
  • Fixed speed selection in rtl8169 (disables autonegotiation first)
  • Added support for restarting autonegotiation
  • Added new switch to 'nic' utility which restarts autonegotiation
File:
1 edited

Legend:

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

    r96e368a rcbfece7  
    3838 */
    3939
    40 /* XXX Fix this */
    41 #define _DDF_DATA_IMPLANT
    42 
    4340#include <stdio.h>
    4441#include <errno.h>
     42#include <irc.h>
    4543#include <stdlib.h>
    4644#include <str_error.h>
     
    256254        if (!ne2k->up) {
    257255                int rc = ne2k_up(ne2k);
     256                if (rc != EOK)
     257                        return rc;
     258
     259                rc = irc_enable_interrupt(ne2k->irq);
    258260                if (rc != EOK) {
     261                        ne2k_down(ne2k);
    259262                        return rc;
    260263                }
    261 
    262                 nic_enable_interrupt(nic_data, ne2k->irq);
    263264        }
    264265        return EOK;
     
    269270        ne2k_t *ne2k = (ne2k_t *) nic_get_specific(nic_data);
    270271
    271         nic_disable_interrupt(nic_data, ne2k->irq);
     272        (void) irc_disable_interrupt(ne2k->irq);
    272273        ne2k->receive_configuration = RCR_AB | RCR_AM;
    273274        ne2k_down(ne2k);
     
    396397        }
    397398       
    398         rc = nic_connect_to_services(nic_data);
    399         if (rc != EOK) {
    400                 ne2k_dev_cleanup(dev);
    401                 return rc;
    402         }
    403        
    404399        fun = ddf_fun_create(nic_get_ddf_dev(nic_data), fun_exposed, "port0");
    405400        if (fun == NULL) {
     
    407402                return ENOMEM;
    408403        }
     404       
    409405        nic_set_ddf_fun(nic_data, fun);
    410406        ddf_fun_set_ops(fun, &ne2k_dev_ops);
    411         ddf_fun_data_implant(fun, nic_data);
    412407       
    413408        rc = ddf_fun_bind(fun);
     
    443438int main(int argc, char *argv[])
    444439{
     440        printf("%s: HelenOS NE 2000 network adapter driver\n", NAME);
     441       
    445442        nic_driver_init(NAME);
    446443        nic_driver_implement(&ne2k_driver_ops, &ne2k_dev_ops, &ne2k_nic_iface);
Note: See TracChangeset for help on using the changeset viewer.