Commit da02b231 authored by Pekka Enberg's avatar Pekka Enberg Committed by Jeff Garzik

ipg: per-device max_rxframe_size

Add a ->max_rxframe member to struct ipg_nic_private and convert the users of
IPG_MAX_RXFRAME_SIZE to use it instead to enable per-device jumbo frame
configuration.
Tested-by: default avatarAndrew Savchenko <Bircoph@list.ru>
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 39f20585
...@@ -631,6 +631,7 @@ static void ipg_nic_set_multicast_list(struct net_device *dev) ...@@ -631,6 +631,7 @@ static void ipg_nic_set_multicast_list(struct net_device *dev)
static int ipg_io_config(struct net_device *dev) static int ipg_io_config(struct net_device *dev)
{ {
struct ipg_nic_private *sp = netdev_priv(dev);
void __iomem *ioaddr = ipg_ioaddr(dev); void __iomem *ioaddr = ipg_ioaddr(dev);
u32 origmacctrl; u32 origmacctrl;
u32 restoremacctrl; u32 restoremacctrl;
...@@ -670,7 +671,7 @@ static int ipg_io_config(struct net_device *dev) ...@@ -670,7 +671,7 @@ static int ipg_io_config(struct net_device *dev)
/* Set RECEIVEMODE register. */ /* Set RECEIVEMODE register. */
ipg_nic_set_multicast_list(dev); ipg_nic_set_multicast_list(dev);
ipg_w16(IPG_MAX_RXFRAME_SIZE, MAX_FRAME_SIZE); ipg_w16(sp->max_rxframe_size, MAX_FRAME_SIZE);
ipg_w8(IPG_RXDMAPOLLPERIOD_VALUE, RX_DMA_POLL_PERIOD); ipg_w8(IPG_RXDMAPOLLPERIOD_VALUE, RX_DMA_POLL_PERIOD);
ipg_w8(IPG_RXDMAURGENTTHRESH_VALUE, RX_DMA_URGENT_THRESH); ipg_w8(IPG_RXDMAURGENTTHRESH_VALUE, RX_DMA_URGENT_THRESH);
...@@ -2114,6 +2115,8 @@ static int ipg_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -2114,6 +2115,8 @@ static int ipg_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
static int ipg_nic_change_mtu(struct net_device *dev, int new_mtu) static int ipg_nic_change_mtu(struct net_device *dev, int new_mtu)
{ {
struct ipg_nic_private *sp = netdev_priv(dev);
/* Function to accomodate changes to Maximum Transfer Unit /* Function to accomodate changes to Maximum Transfer Unit
* (or MTU) of IPG NIC. Cannot use default function since * (or MTU) of IPG NIC. Cannot use default function since
* the default will not allow for MTU > 1500 bytes. * the default will not allow for MTU > 1500 bytes.
...@@ -2125,7 +2128,7 @@ static int ipg_nic_change_mtu(struct net_device *dev, int new_mtu) ...@@ -2125,7 +2128,7 @@ static int ipg_nic_change_mtu(struct net_device *dev, int new_mtu)
* byte payload, 4 byte FCS) and IPG_MAX_RXFRAME_SIZE, which * byte payload, 4 byte FCS) and IPG_MAX_RXFRAME_SIZE, which
* corresponds to the MAXFRAMESIZE register in the IPG. * corresponds to the MAXFRAMESIZE register in the IPG.
*/ */
if ((new_mtu < 68) || (new_mtu > IPG_MAX_RXFRAME_SIZE)) if ((new_mtu < 68) || (new_mtu > sp->max_rxframe_size))
return -EINVAL; return -EINVAL;
dev->mtu = new_mtu; dev->mtu = new_mtu;
...@@ -2238,6 +2241,7 @@ static int __devinit ipg_probe(struct pci_dev *pdev, ...@@ -2238,6 +2241,7 @@ static int __devinit ipg_probe(struct pci_dev *pdev,
sp->is_jumbo = IPG_JUMBO; sp->is_jumbo = IPG_JUMBO;
sp->rxfrag_size = IPG_RXFRAG_SIZE; sp->rxfrag_size = IPG_RXFRAG_SIZE;
sp->rxsupport_size = IPG_RXSUPPORT_SIZE; sp->rxsupport_size = IPG_RXSUPPORT_SIZE;
sp->max_rxframe_size = IPG_MAX_RXFRAME_SIZE;
/* Declare IPG NIC functions for Ethernet device methods. /* Declare IPG NIC functions for Ethernet device methods.
*/ */
......
...@@ -798,6 +798,7 @@ struct ipg_nic_private { ...@@ -798,6 +798,7 @@ struct ipg_nic_private {
struct ipg_jumbo jumbo; struct ipg_jumbo jumbo;
unsigned long rxfrag_size; unsigned long rxfrag_size;
unsigned long rxsupport_size; unsigned long rxsupport_size;
unsigned long max_rxframe_size;
unsigned int rx_buf_sz; unsigned int rx_buf_sz;
struct pci_dev *pdev; struct pci_dev *pdev;
struct net_device *dev; struct net_device *dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment