Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/axgbe/xgbe-drv.c
Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include "xgbe.h" | #include "xgbe.h" | ||||
#include "xgbe-common.h" | #include "xgbe-common.h" | ||||
int | int | ||||
xgbe_calc_rx_buf_size(struct ifnet *netdev, unsigned int mtu) | xgbe_calc_rx_buf_size(if_t netdev, unsigned int mtu) | ||||
{ | { | ||||
unsigned int rx_buf_size; | unsigned int rx_buf_size; | ||||
if (mtu > XGMAC_JUMBO_PACKET_MTU) | if (mtu > XGMAC_JUMBO_PACKET_MTU) | ||||
return (-EINVAL); | return (-EINVAL); | ||||
rx_buf_size = mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN; | rx_buf_size = mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN; | ||||
rx_buf_size = min(max(rx_buf_size, XGBE_RX_MIN_BUF_SIZE), PAGE_SIZE); | rx_buf_size = min(max(rx_buf_size, XGBE_RX_MIN_BUF_SIZE), PAGE_SIZE); | ||||
▲ Show 20 Lines • Show All 218 Lines • Show Last 20 Lines |