Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6083
b: refs/heads/master
c: d8892c6
h: refs/heads/master
i:
  6081: 2d639c8
  6079: 5ac5efd
v: v3
  • Loading branch information
raghavendra.koushik@neterion.com authored and Jeff Garzik committed Aug 11, 2005
1 parent c539f52 commit 62c8eed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe113638328995b69d8797e6466b29661b1602d1
refs/heads/master: d8892c6ee39614bc6d282dbef0ff9fa461a6467c
28 changes: 16 additions & 12 deletions trunk/drivers/net/s2io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2849,6 +2849,7 @@ int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
}

txdp->Control_2 |= config->tx_intr_type;

txdp->Control_1 |= (TXD_BUFFER0_SIZE(frg_len) |
TXD_GATHER_CODE_FIRST);
txdp->Control_1 |= TXD_LIST_OWN_XENA;
Expand Down Expand Up @@ -4246,26 +4247,29 @@ int s2io_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
int s2io_change_mtu(struct net_device *dev, int new_mtu)
{
nic_t *sp = dev->priv;
XENA_dev_config_t __iomem *bar0 = sp->bar0;
register u64 val64;

if (netif_running(dev)) {
DBG_PRINT(ERR_DBG, "%s: Must be stopped to ", dev->name);
DBG_PRINT(ERR_DBG, "change its MTU\n");
return -EBUSY;
}

if ((new_mtu < MIN_MTU) || (new_mtu > S2IO_JUMBO_SIZE)) {
DBG_PRINT(ERR_DBG, "%s: MTU size is invalid.\n",
dev->name);
return -EPERM;
}

/* Set the new MTU into the PYLD register of the NIC */
val64 = new_mtu;
writeq(vBIT(val64, 2, 14), &bar0->rmac_max_pyld_len);

dev->mtu = new_mtu;
if (netif_running(dev)) {
s2io_card_down(sp);
netif_stop_queue(dev);
if (s2io_card_up(sp)) {
DBG_PRINT(ERR_DBG, "%s: Device bring up failed\n",
__FUNCTION__);
}
if (netif_queue_stopped(dev))
netif_wake_queue(dev);
} else { /* Device is down */
XENA_dev_config_t __iomem *bar0 = sp->bar0;
u64 val64 = new_mtu;

writeq(vBIT(val64, 2, 14), &bar0->rmac_max_pyld_len);
}

return 0;
}
Expand Down

0 comments on commit 62c8eed

Please sign in to comment.