Changeset cbfece7 in mainline for uspace/drv/nic/e1k/e1k.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/e1k/e1k.c

    r96e368a rcbfece7  
    3333 */
    3434
    35 /* XXX Fix this */
    36 #define _DDF_DATA_IMPLANT
    37 
    3835#include <assert.h>
    3936#include <stdio.h>
     
    4239#include <align.h>
    4340#include <byteorder.h>
    44 #include <sysinfo.h>
    45 #include <ipc/irc.h>
    46 #include <ipc/ns.h>
     41#include <irc.h>
     42#include <as.h>
    4743#include <ddi.h>
    48 #include <as.h>
    4944#include <ddf/log.h>
    5045#include <ddf/interrupt.h>
     
    17581753        e1000_enable_interrupts(e1000);
    17591754       
    1760         nic_enable_interrupt(nic, e1000->irq);
     1755        int rc = irc_enable_interrupt(e1000->irq);
     1756        if (rc != EOK) {
     1757                e1000_disable_interrupts(e1000);
     1758                fibril_mutex_unlock(&e1000->ctrl_lock);
     1759                fibril_mutex_unlock(&e1000->tx_lock);
     1760                fibril_mutex_unlock(&e1000->rx_lock);
     1761                return rc;
     1762        }
    17611763       
    17621764        e1000_clear_rx_ring(e1000);
     
    17961798        e1000_disable_rx(e1000);
    17971799       
    1798         nic_disable_interrupt(nic, e1000->irq);
     1800        irc_disable_interrupt(e1000->irq);
    17991801        e1000_disable_interrupts(e1000);
    18001802       
     
    21482150        nic_set_ddf_fun(nic, fun);
    21492151        ddf_fun_set_ops(fun, &e1000_dev_ops);
    2150         ddf_fun_data_implant(fun, nic);
    21512152       
    21522153        rc = e1000_register_int_handler(nic);
    21532154        if (rc != EOK)
    21542155                goto err_fun_create;
    2155        
    2156         rc = nic_connect_to_services(nic);
    2157         if (rc != EOK)
    2158                 goto err_irq;
    21592156       
    21602157        rc = e1000_initialize_rx_structure(nic);
     
    23792376int main(void)
    23802377{
    2381         int rc = nic_driver_init(NAME);
    2382         if (rc != EOK)
    2383                 return rc;
     2378        printf("%s: HelenOS E1000 network adapter driver\n", NAME);
     2379       
     2380        if (nic_driver_init(NAME) != EOK)
     2381                return 1;
    23842382       
    23852383        nic_driver_implement(&e1000_driver_ops, &e1000_dev_ops,
     
    23872385       
    23882386        ddf_log_init(NAME);
    2389         ddf_msg(LVL_NOTE, "HelenOS E1000 driver started");
    23902387        return ddf_driver_main(&e1000_driver);
    23912388}
Note: See TracChangeset for help on using the changeset viewer.