Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286659
b: refs/heads/master
c: 7335903
h: refs/heads/master
i:
  286657: 3506cb5
  286655: f56ccf5
v: v3
  • Loading branch information
Roopa Prabhu authored and David S. Miller committed Jan 18, 2012
1 parent 6933654 commit b9a38aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 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: 3a4adef5c0adbbd0d898578e13ba1adbbdecbbd5
refs/heads/master: 7335903cba523fc2fd801a178a0e4fcf8ccae756
17 changes: 8 additions & 9 deletions trunk/drivers/net/ethernet/cisco/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ static void enic_mtu_check(struct enic *enic)

if (mtu && mtu != enic->port_mtu) {
enic->port_mtu = mtu;
if (enic_is_dynamic(enic)) {
if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic)) {
mtu = max_t(int, ENIC_MIN_MTU,
min_t(int, ENIC_MAX_MTU, mtu));
if (mtu != netdev->mtu)
Expand Down Expand Up @@ -856,7 +856,7 @@ static int enic_set_mac_addr(struct net_device *netdev, char *addr)
{
struct enic *enic = netdev_priv(netdev);

if (enic_is_dynamic(enic)) {
if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic)) {
if (!is_valid_ether_addr(addr) && !is_zero_ether_addr(addr))
return -EADDRNOTAVAIL;
} else {
Expand Down Expand Up @@ -1615,7 +1615,7 @@ static int enic_open(struct net_device *netdev)
for (i = 0; i < enic->rq_count; i++)
vnic_rq_enable(&enic->rq[i]);

if (!enic_is_dynamic(enic))
if (!enic_is_dynamic(enic) && !enic_is_sriov_vf(enic))
enic_dev_add_station_addr(enic);

enic_set_rx_mode(netdev);
Expand Down Expand Up @@ -1666,7 +1666,7 @@ static int enic_stop(struct net_device *netdev)
netif_carrier_off(netdev);
netif_tx_disable(netdev);

if (!enic_is_dynamic(enic))
if (!enic_is_dynamic(enic) && !enic_is_sriov_vf(enic))
enic_dev_del_station_addr(enic);

for (i = 0; i < enic->wq_count; i++) {
Expand Down Expand Up @@ -1703,7 +1703,7 @@ static int enic_change_mtu(struct net_device *netdev, int new_mtu)
if (new_mtu < ENIC_MIN_MTU || new_mtu > ENIC_MAX_MTU)
return -EINVAL;

if (enic_is_dynamic(enic))
if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic))
return -EOPNOTSUPP;

if (running)
Expand Down Expand Up @@ -2433,7 +2433,7 @@ static int __devinit enic_probe(struct pci_dev *pdev,
* called later by an upper layer.
*/

if (!enic_is_dynamic(enic)) {
if (!enic_is_dynamic(enic) && !enic_is_sriov_vf(enic)) {
err = vnic_dev_init(enic->vdev, 0);
if (err) {
dev_err(dev, "vNIC dev init failed, aborting\n");
Expand Down Expand Up @@ -2467,8 +2467,7 @@ static int __devinit enic_probe(struct pci_dev *pdev,
(void)enic_change_mtu(netdev, enic->port_mtu);

#ifdef CONFIG_PCI_IOV
if (enic_is_dynamic(enic) && pdev->is_virtfn &&
is_zero_ether_addr(enic->mac_addr))
if (enic_is_sriov_vf(enic) && is_zero_ether_addr(enic->mac_addr))
random_ether_addr(enic->mac_addr);
#endif

Expand All @@ -2481,7 +2480,7 @@ static int __devinit enic_probe(struct pci_dev *pdev,
enic->tx_coalesce_usecs = enic->config.intr_timer_usec;
enic->rx_coalesce_usecs = enic->tx_coalesce_usecs;

if (enic_is_dynamic(enic))
if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic))
netdev->netdev_ops = &enic_netdev_dynamic_ops;
else
netdev->netdev_ops = &enic_netdev_ops;
Expand Down

0 comments on commit b9a38aa

Please sign in to comment.