Changeset d7ff048 in mainline for uspace/drv/nic/ne2k/dp8390.h


Ignore:
Timestamp:
2011-10-08T13:08:53Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bf08ff0
Parents:
8367d1d (diff), 80099c19 (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 moved

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/ne2k/dp8390.h

    r8367d1d rd7ff048  
    22 * Copyright (c) 2009 Lukas Mejdrech
    33 * Copyright (c) 2011 Martin Decky
     4 * Copyright (c) 2011 Radim Vansa
    45 * All rights reserved.
    56 *
     
    3839 */
    3940
    40 /** @addtogroup ne2000
     41/** @addtogroup drv_ne2k
    4142 *  @{
    4243 */
     
    5051
    5152#include <fibril_synch.h>
    52 #include <adt/list.h>
    53 #include <net/packet.h>
    54 #include <netif_skel.h>
    55 
    56 /** Module name */
    57 #define NAME  "ne2000"
     53#include <nic.h>
     54#include <ddf/interrupt.h>
    5855
    5956/** Input/output size */
    6057#define NE2K_IO_SIZE  0x0020
    6158
    62 /** Ethernet address length */
    63 #define ETH_ADDR  6
     59/* NE2000 implementation. */
     60
     61/** NE2000 Data Register */
     62#define NE2K_DATA  0x0010
     63
     64/** NE2000 Reset register */
     65#define NE2K_RESET  0x001f
     66
     67/** NE2000 data start */
     68#define NE2K_START  0x4000
     69
     70/** NE2000 data size */
     71#define NE2K_SIZE  0x4000
     72
     73/** NE2000 retry count */
     74#define NE2K_RETRY  0x1000
     75
     76/** NE2000 error messages rate limiting */
     77#define NE2K_ERL  10
     78
     79/** Minimum Ethernet packet size in bytes */
     80#define ETH_MIN_PACK_SIZE  60
     81
     82/** Maximum Ethernet packet size in bytes */
     83#define ETH_MAX_PACK_SIZE_TAGGED  1518
    6484
    6585/* National Semiconductor DP8390 Network Interface Controller. */
     
    204224typedef struct {
    205225        /* Device configuration */
     226        void *base_port; /**< Port assigned from ISA configuration **/
    206227        void *port;
    207228        void *data_port;
    208229        int irq;
    209         uint8_t mac[ETH_ADDR];
     230        nic_address_t mac;
    210231       
    211232        uint8_t start_page;  /**< Ring buffer start page */
     
    224245        bool probed;
    225246        bool up;
    226        
     247
     248        /* Irq code with assigned addresses for this device */
     249        irq_code_t code;
     250
     251        /* Copy of the receive configuration register */
     252        uint8_t receive_configuration;
     253
    227254        /* Device statistics */
    228         device_stats_t stats;
     255        // TODO: shouldn't be these directly in device.h - nic_device_stats?
    229256        uint64_t misses;     /**< Receive frame misses */
    230257        uint64_t underruns;  /**< FIFO underruns */
     
    232259} ne2k_t;
    233260
    234 typedef struct {
    235         link_t link;
    236         packet_t *packet;
    237 } frame_t;
    238 
    239 extern int ne2k_probe(ne2k_t *, void *, int);
     261extern int ne2k_probe(ne2k_t *);
    240262extern int ne2k_up(ne2k_t *);
    241263extern void ne2k_down(ne2k_t *);
    242 extern void ne2k_send(ne2k_t *, packet_t *);
    243 extern list_t *ne2k_interrupt(ne2k_t *, uint8_t, uint8_t);
     264extern void ne2k_send(nic_t *, packet_t *);
     265extern void ne2k_interrupt(nic_t *, uint8_t, uint8_t);
     266extern packet_t *ne2k_alloc_packet(nic_t *, size_t);
     267
     268extern void ne2k_set_accept_mcast(ne2k_t *, int);
     269extern void ne2k_set_accept_bcast(ne2k_t *, int);
     270extern void ne2k_set_promisc_phys(ne2k_t *, int);
     271extern void ne2k_set_mcast_hash(ne2k_t *, uint64_t);
     272extern void ne2k_set_physical_address(ne2k_t *, const nic_address_t *address);
    244273
    245274#endif
Note: See TracChangeset for help on using the changeset viewer.