Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/nic/include/nic.h

    rea788701 r6d8455d  
    4242#include <ddf/driver.h>
    4343#include <device/hw_res_parsed.h>
     44#include <net/packet.h>
    4445#include <ops/nic.h>
    4546
     
    6061
    6162/**
    62  * Simple structure for sending lists of frames.
     63 * Simple structure for sending the allocated frames (packets) in a list.
    6364 */
    6465typedef struct {
    6566        link_t link;
    66         void *data;
    67         size_t size;
     67        packet_t *packet;
    6868} nic_frame_t;
    6969
     
    7171
    7272/**
    73  * Handler for writing frame data to the NIC device.
    74  * The function is responsible for releasing the frame.
     73 * Handler for writing packet data to the NIC device.
     74 * The function is responsible for releasing the packet.
    7575 * It does not return anything, if some error is detected the function just
    7676 * silently fails (logging on debug level is suggested).
     
    158158 * @return ENOTSUP      If this filter cannot work on this NIC (e.g. the NIC
    159159 *                                      cannot run in promiscuous node or the limit of WOL
    160  *                                      frames' specifications was reached).
     160 *                                      packets' specifications was reached).
    161161 * @return ELIMIT       If this filter must implemented in HW but currently the
    162162 *                                      limit of these HW filters was reached.
     
    233233extern int nic_report_poll_mode(nic_t *, nic_poll_mode_t, struct timeval *);
    234234extern void nic_query_address(nic_t *, nic_address_t *);
    235 extern void nic_received_noneth_frame(nic_t *, void *, size_t);
     235extern void nic_received_packet(nic_t *, packet_t *);
     236extern void nic_received_noneth_packet(nic_t *, packet_t *);
    236237extern void nic_received_frame(nic_t *, nic_frame_t *);
    237238extern void nic_received_frame_list(nic_t *, nic_frame_list_t *);
     
    247248extern void nic_report_collisions(nic_t *, unsigned);
    248249
    249 /* Frame / frame list allocation and deallocation */
     250/* Packet / frame / frame list allocation and deallocation */
     251extern packet_t *nic_alloc_packet(nic_t *, size_t);
     252extern void nic_release_packet(nic_t *, packet_t *);
    250253extern nic_frame_t *nic_alloc_frame(nic_t *, size_t);
    251254extern nic_frame_list_t *nic_alloc_frame_list(void);
     
    272275extern void nic_sw_period_stop(nic_t *);
    273276
     277/* Packet DMA lock */
     278extern int nic_dma_lock_packet(packet_t *, size_t, void **);
     279extern int nic_dma_unlock_packet(packet_t *, size_t);
     280
    274281#endif // __NIC_H__
    275282
Note: See TracChangeset for help on using the changeset viewer.