summaryrefslogtreecommitdiff
path: root/drivers/net/ipg.c
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2008-06-23 14:36:18 +0300
committerJeff Garzik <jgarzik@redhat.com>2008-07-04 08:46:53 -0400
commit39f205854c829294f9b4db65100d3abdf9c9c145 (patch)
treefc400cb85716334d52bf9f63be16ede3d7842c09 /drivers/net/ipg.c
parent18a9cdb9c7ec88f6e94cd8dcb03fb6cded067119 (diff)
ipg: per-device rxsupport_size
Add a ->max_rxframe member to struct ipg_nic_private and convert the users of IPG_RXSUPPORT_SIZE to use it instead to enable per-device jumbo frame configuration. Tested-by: Andrew Savchenko <Bircoph@list.ru> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/ipg.c')
-rw-r--r--drivers/net/ipg.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index 5c5653bd48c..51d5f30e0af 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -730,7 +730,7 @@ static int ipg_get_rxbuff(struct net_device *dev, int entry)
IPG_DEBUG_MSG("_get_rxbuff\n");
- skb = netdev_alloc_skb(dev, IPG_RXSUPPORT_SIZE + NET_IP_ALIGN);
+ skb = netdev_alloc_skb(dev, sp->rxsupport_size + NET_IP_ALIGN);
if (!skb) {
sp->rx_buff[entry] = NULL;
return -ENOMEM;
@@ -1270,7 +1270,7 @@ static void ipg_nic_rx_with_end(struct net_device *dev,
framelen = le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFRAMELEN;
endframelen = framelen - jumbo->current_size;
- if (framelen > IPG_RXSUPPORT_SIZE)
+ if (framelen > sp->rxsupport_size)
dev_kfree_skb_irq(jumbo->skb);
else {
memcpy(skb_put(jumbo->skb, endframelen),
@@ -1311,7 +1311,7 @@ static void ipg_nic_rx_no_start_no_end(struct net_device *dev,
if (skb) {
if (jumbo->found_start) {
jumbo->current_size += sp->rxfrag_size;
- if (jumbo->current_size <= IPG_RXSUPPORT_SIZE) {
+ if (jumbo->current_size <= sp->rxsupport_size) {
memcpy(skb_put(jumbo->skb,
sp->rxfrag_size),
skb->data, sp->rxfrag_size);
@@ -1744,7 +1744,7 @@ static int ipg_nic_open(struct net_device *dev)
IPG_DEBUG_MSG("_nic_open\n");
- sp->rx_buf_sz = IPG_RXSUPPORT_SIZE;
+ sp->rx_buf_sz = sp->rxsupport_size;
/* Check for interrupt line conflicts, and request interrupt
* line for IPG.
@@ -2237,6 +2237,7 @@ static int __devinit ipg_probe(struct pci_dev *pdev,
sp->is_jumbo = IPG_JUMBO;
sp->rxfrag_size = IPG_RXFRAG_SIZE;
+ sp->rxsupport_size = IPG_RXSUPPORT_SIZE;
/* Declare IPG NIC functions for Ethernet device methods.
*/