mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 21:41:43 +03:00
[netdevice] Add maximum packet length as a net device property
Currently this length is set at device allocation time, and is never changed.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <gpxe/netdevice.h>
|
||||
#include <gpxe/if_ether.h>
|
||||
|
||||
extern struct ll_protocol ethernet_protocol;
|
||||
|
||||
@@ -26,6 +27,7 @@ static inline struct net_device * alloc_etherdev ( size_t priv_size ) {
|
||||
netdev = alloc_netdev ( priv_size );
|
||||
if ( netdev ) {
|
||||
netdev->ll_protocol = ðernet_protocol;
|
||||
netdev->max_pkt_len = ETH_FRAME_LEN;
|
||||
}
|
||||
return netdev;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
|
||||
#include <gpxe/infiniband.h>
|
||||
|
||||
/** IPoIB packet length */
|
||||
#define IPOIB_PKT_LEN 2048
|
||||
|
||||
/** IPoIB MAC address length */
|
||||
#define IPOIB_ALEN 20
|
||||
|
||||
@@ -68,6 +71,7 @@ static inline struct net_device * alloc_ipoibdev ( size_t priv_size ) {
|
||||
netdev = alloc_netdev ( priv_size );
|
||||
if ( netdev ) {
|
||||
netdev->ll_protocol = &ipoib_protocol;
|
||||
netdev->max_pkt_len = IPOIB_PKT_LEN;
|
||||
}
|
||||
return netdev;
|
||||
}
|
||||
|
||||
@@ -241,6 +241,11 @@ struct net_device {
|
||||
* This is the bitwise-OR of zero or more NETDEV_XXX constants.
|
||||
*/
|
||||
unsigned int state;
|
||||
/** Maximum packet length
|
||||
*
|
||||
* This length includes any link-layer headers.
|
||||
*/
|
||||
size_t max_pkt_len;
|
||||
/** TX packet queue */
|
||||
struct list_head tx_queue;
|
||||
/** RX packet queue */
|
||||
|
||||
Reference in New Issue
Block a user