~serge-hallyn/ubuntu/oneiric/ipxe/link-kvm

« back to all changes in this revision

Viewing changes to src/include/ipxe/netdevice.h

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2011-07-31 20:57:02 UTC
  • mfrom: (2.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110731205702-kffmzz6tnmgfw50f
Tags: 1.0.0+git-2.149b50-1
New snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        /**
67
67
         * Process received packet
68
68
         *
69
 
         * @v iobuf     I/O buffer
70
 
         * @v netdev    Network device
71
 
         * @v ll_dest   Link-layer destination address
72
 
         * @v ll_source Link-layer source address
 
69
         * @v iobuf             I/O buffer
 
70
         * @v netdev            Network device
 
71
         * @v ll_dest           Link-layer destination address
 
72
         * @v ll_source         Link-layer source address
 
73
         * @v flags             Packet flags
 
74
         * @ret rc              Return status code
73
75
         *
74
76
         * This method takes ownership of the I/O buffer.
75
77
         */
76
78
        int ( * rx ) ( struct io_buffer *iobuf, struct net_device *netdev,
77
 
                       const void *ll_dest, const void *ll_source );
 
79
                       const void *ll_dest, const void *ll_source,
 
80
                       unsigned int flags );
78
81
        /**
79
82
         * Transcribe network-layer address
80
83
         *
81
 
         * @v net_addr  Network-layer address
82
 
         * @ret string  Human-readable transcription of address
 
84
         * @v net_addr          Network-layer address
 
85
         * @ret string          Human-readable transcription of address
83
86
         *
84
87
         * This method should convert the network-layer address into a
85
88
         * human-readable format (e.g. dotted quad notation for IPv4).
97
100
        uint8_t net_addr_len;
98
101
};
99
102
 
 
103
/** Packet is a multicast (including broadcast) packet */
 
104
#define LL_MULTICAST 0x0001
 
105
 
 
106
/** Packet is a broadcast packet */
 
107
#define LL_BROADCAST 0x0002
 
108
 
100
109
/**
101
110
 * A link-layer protocol
102
111
 *
125
134
         * @ret ll_dest         Link-layer destination address
126
135
         * @ret ll_source       Source link-layer address
127
136
         * @ret net_proto       Network-layer protocol, in network-byte order
 
137
         * @ret flags           Packet flags
128
138
         * @ret rc              Return status code
129
139
         */
130
140
        int ( * pull ) ( struct net_device *netdev, struct io_buffer *iobuf,
131
141
                         const void **ll_dest, const void **ll_source,
132
 
                         uint16_t *net_proto );
 
142
                         uint16_t *net_proto, unsigned int *flags );
133
143
        /**
134
144
         * Initialise link-layer address
135
145
         *
586
596
extern void netdev_link_err ( struct net_device *netdev, int rc );
587
597
extern void netdev_link_down ( struct net_device *netdev );
588
598
extern int netdev_tx ( struct net_device *netdev, struct io_buffer *iobuf );
 
599
extern void netdev_tx_err ( struct net_device *netdev,
 
600
                            struct io_buffer *iobuf, int rc );
589
601
extern void netdev_tx_complete_err ( struct net_device *netdev,
590
602
                                 struct io_buffer *iobuf, int rc );
591
603
extern void netdev_tx_complete_next_err ( struct net_device *netdev, int rc );
609
621
                    const void *ll_source );
610
622
extern int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
611
623
                    uint16_t net_proto, const void *ll_dest,
612
 
                    const void *ll_source );
 
624
                    const void *ll_source, unsigned int flags );
613
625
extern void net_poll ( void );
614
626
 
615
627
/**