Changeset cfb79747 in mainline for uspace/lib/nic/include/nic.h


Ignore:
Timestamp:
2012-02-14T22:06:15Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a31aad1
Parents:
199112e4 (diff), e10d41a (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/lib/nic/include/nic.h

    r199112e4 rcfb79747  
    4242#include <ddf/driver.h>
    4343#include <device/hw_res_parsed.h>
    44 #include <net/packet.h>
    4544#include <ops/nic.h>
     45
     46#define DEVICE_CATEGORY_NIC "nic"
    4647
    4748struct nic;
     
    6162
    6263/**
    63  * Simple structure for sending the allocated frames (packets) in a list.
     64 * Simple structure for sending lists of frames.
    6465 */
    6566typedef struct {
    6667        link_t link;
    67         packet_t *packet;
     68        void *data;
     69        size_t size;
    6870} nic_frame_t;
    6971
     
    7173
    7274/**
    73  * Handler for writing packet data to the NIC device.
    74  * The function is responsible for releasing the packet.
     75 * Handler for writing frame data to the NIC device.
     76 * The function is responsible for releasing the frame.
    7577 * It does not return anything, if some error is detected the function just
    7678 * silently fails (logging on debug level is suggested).
     
    158160 * @return ENOTSUP      If this filter cannot work on this NIC (e.g. the NIC
    159161 *                                      cannot run in promiscuous node or the limit of WOL
    160  *                                      packets' specifications was reached).
     162 *                                      frames' specifications was reached).
    161163 * @return ELIMIT       If this filter must implemented in HW but currently the
    162164 *                                      limit of these HW filters was reached.
     
    204206/* Functions called in add_device */
    205207extern int nic_connect_to_services(nic_t *);
    206 extern int nic_register_as_ddf_fun(nic_t *, ddf_dev_ops_t *);
    207208extern int nic_get_resources(nic_t *, hw_res_list_parsed_t *);
    208209extern void nic_set_specific(nic_t *, void *);
     
    219220        poll_mode_change_handler, poll_request_handler);
    220221
    221 /* Functions called in device_added */
    222 extern int nic_ready(nic_t *);
    223 
    224222/* General driver functions */
    225223extern ddf_dev_t *nic_get_ddf_dev(nic_t *);
    226224extern ddf_fun_t *nic_get_ddf_fun(nic_t *);
     225extern void nic_set_ddf_fun(nic_t *, ddf_fun_t *);
    227226extern nic_t *nic_get_from_ddf_dev(ddf_dev_t *);
    228227extern nic_t *nic_get_from_ddf_fun(ddf_fun_t *);
     
    233232extern int nic_report_poll_mode(nic_t *, nic_poll_mode_t, struct timeval *);
    234233extern void nic_query_address(nic_t *, nic_address_t *);
    235 extern void nic_received_packet(nic_t *, packet_t *);
    236 extern void nic_received_noneth_packet(nic_t *, packet_t *);
     234extern void nic_received_noneth_frame(nic_t *, void *, size_t);
    237235extern void nic_received_frame(nic_t *, nic_frame_t *);
    238236extern void nic_received_frame_list(nic_t *, nic_frame_list_t *);
     
    248246extern void nic_report_collisions(nic_t *, unsigned);
    249247
    250 /* Packet / frame / frame list allocation and deallocation */
    251 extern packet_t *nic_alloc_packet(nic_t *, size_t);
    252 extern void nic_release_packet(nic_t *, packet_t *);
     248/* Frame / frame list allocation and deallocation */
    253249extern nic_frame_t *nic_alloc_frame(nic_t *, size_t);
    254250extern nic_frame_list_t *nic_alloc_frame_list(void);
     
    275271extern void nic_sw_period_stop(nic_t *);
    276272
    277 /* Packet DMA lock */
    278 extern int nic_dma_lock_packet(packet_t *, size_t, void **);
    279 extern int nic_dma_unlock_packet(packet_t *, size_t);
    280 
    281273#endif // __NIC_H__
    282274
Note: See TracChangeset for help on using the changeset viewer.