Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 237499
b: refs/heads/master
c: 8ba5366
h: refs/heads/master
i:
  237497: 58da3eb
  237495: c304d7e
v: v3
  • Loading branch information
Steve Hodgson authored and Ben Hutchings committed Feb 28, 2011
1 parent 19726c8 commit 7d0c34c
Show file tree
Hide file tree
Showing 30 changed files with 273 additions and 246 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: e364a3416d81c7717dd642dc9b3ab132b7885f66
refs/heads/master: 8ba5366adacef220b6ce16dca777600433a22a42
2 changes: 1 addition & 1 deletion trunk/drivers/net/atl1e/atl1e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,8 @@ static int __devinit atl1e_sw_init(struct atl1e_adapter *adapter)
hw->device_id = pdev->device;
hw->subsystem_vendor_id = pdev->subsystem_vendor;
hw->subsystem_id = pdev->subsystem_device;
hw->revision_id = pdev->revision;

pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id);
pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word);

phy_status_data = AT_READ_REG(hw, REG_PHY_STATUS);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/atlx/atl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ static int __devinit atl2_sw_init(struct atl2_adapter *adapter)
hw->device_id = pdev->device;
hw->subsystem_vendor_id = pdev->subsystem_vendor;
hw->subsystem_id = pdev->subsystem_device;
hw->revision_id = pdev->revision;

pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id);
pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word);

adapter->wol = 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/bnx2x/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#define BNX2X_NEW_NAPI

#if defined(CONFIG_DCB)
#define BCM_DCBNL
#define BCM_DCB
#endif
#if defined(CONFIG_CNIC) || defined(CONFIG_CNIC_MODULE)
#define BCM_CNIC 1
Expand Down
137 changes: 55 additions & 82 deletions trunk/drivers/net/bnx2x/bnx2x_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
#include <linux/netdevice.h>
#include <linux/types.h>
#include <linux/errno.h>
#ifdef BCM_DCBNL
#include <linux/dcbnl.h>
#endif

#include "bnx2x.h"
#include "bnx2x_cmn.h"
Expand Down Expand Up @@ -511,75 +508,13 @@ static int bnx2x_dcbx_read_shmem_neg_results(struct bnx2x *bp)
return 0;
}


#ifdef BCM_DCBNL
static inline
u8 bnx2x_dcbx_dcbnl_app_up(struct dcbx_app_priority_entry *ent)
{
u8 pri;

/* Choose the highest priority */
for (pri = MAX_PFC_PRIORITIES - 1; pri > 0; pri--)
if (ent->pri_bitmap & (1 << pri))
break;
return pri;
}

static inline
u8 bnx2x_dcbx_dcbnl_app_idtype(struct dcbx_app_priority_entry *ent)
{
return ((ent->appBitfield & DCBX_APP_ENTRY_SF_MASK) ==
DCBX_APP_SF_PORT) ? DCB_APP_IDTYPE_PORTNUM :
DCB_APP_IDTYPE_ETHTYPE;
}

static inline
void bnx2x_dcbx_invalidate_local_apps(struct bnx2x *bp)
{
int i;
for (i = 0; i < DCBX_MAX_APP_PROTOCOL; i++)
bp->dcbx_local_feat.app.app_pri_tbl[i].appBitfield &=
~DCBX_APP_ENTRY_VALID;
}

int bnx2x_dcbnl_update_applist(struct bnx2x *bp, bool delall)
{
int i, err = 0;

for (i = 0; i < DCBX_MAX_APP_PROTOCOL && err == 0; i++) {
struct dcbx_app_priority_entry *ent =
&bp->dcbx_local_feat.app.app_pri_tbl[i];

if (ent->appBitfield & DCBX_APP_ENTRY_VALID) {
u8 up = bnx2x_dcbx_dcbnl_app_up(ent);

/* avoid invalid user-priority */
if (up) {
struct dcb_app app;
app.selector = bnx2x_dcbx_dcbnl_app_idtype(ent);
app.protocol = ent->app_id;
app.priority = delall ? 0 : up;
err = dcb_setapp(bp->dev, &app);
}
}
}
return err;
}
#endif

void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)
{
switch (state) {
case BNX2X_DCBX_STATE_NEG_RECEIVED:
{
DP(NETIF_MSG_LINK, "BNX2X_DCBX_STATE_NEG_RECEIVED\n");
#ifdef BCM_DCBNL
/**
* Delete app tlvs from dcbnl before reading new
* negotiation results
*/
bnx2x_dcbnl_update_applist(bp, true);
#endif

/* Read neg results if dcbx is in the FW */
if (bnx2x_dcbx_read_shmem_neg_results(bp))
return;
Expand All @@ -591,24 +526,10 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)
bp->dcbx_error);

if (bp->state != BNX2X_STATE_OPENING_WAIT4_LOAD) {
#ifdef BCM_DCBNL
/**
* Add new app tlvs to dcbnl
*/
bnx2x_dcbnl_update_applist(bp, false);
#endif
bnx2x_dcbx_stop_hw_tx(bp);
return;
}
/* fall through */
#ifdef BCM_DCBNL
/**
* Invalidate the local app tlvs if they are not added
* to the dcbnl app list to avoid deleting them from
* the list later on
*/
bnx2x_dcbx_invalidate_local_apps(bp);
#endif
}
case BNX2X_DCBX_STATE_TX_PAUSED:
DP(NETIF_MSG_LINK, "BNX2X_DCBX_STATE_TX_PAUSED\n");
Expand Down Expand Up @@ -1584,7 +1505,8 @@ static void bnx2x_pfc_fw_struct_e2(struct bnx2x *bp)
bnx2x_dcbx_print_cos_params(bp, pfc_fw_cfg);
}
/* DCB netlink */
#ifdef BCM_DCBNL
#ifdef BCM_DCB
#include <linux/dcbnl.h>

#define BNX2X_DCBX_CAPS (DCB_CAP_DCBX_LLD_MANAGED | \
DCB_CAP_DCBX_VER_CEE | DCB_CAP_DCBX_STATIC)
Expand Down Expand Up @@ -1894,6 +1816,32 @@ static void bnx2x_dcbnl_set_pfc_state(struct net_device *netdev, u8 state)
bp->dcbx_config_params.admin_pfc_enable = (state ? 1 : 0);
}

static bool bnx2x_app_is_equal(struct dcbx_app_priority_entry *app_ent,
u8 idtype, u16 idval)
{
if (!(app_ent->appBitfield & DCBX_APP_ENTRY_VALID))
return false;

switch (idtype) {
case DCB_APP_IDTYPE_ETHTYPE:
if ((app_ent->appBitfield & DCBX_APP_ENTRY_SF_MASK) !=
DCBX_APP_SF_ETH_TYPE)
return false;
break;
case DCB_APP_IDTYPE_PORTNUM:
if ((app_ent->appBitfield & DCBX_APP_ENTRY_SF_MASK) !=
DCBX_APP_SF_PORT)
return false;
break;
default:
return false;
}
if (app_ent->app_id != idval)
return false;

return true;
}

static void bnx2x_admin_app_set_ent(
struct bnx2x_admin_priority_app_table *app_ent,
u8 idtype, u16 idval, u8 up)
Expand Down Expand Up @@ -1995,6 +1943,30 @@ static u8 bnx2x_dcbnl_set_app_up(struct net_device *netdev, u8 idtype,
return bnx2x_set_admin_app_up(bp, idtype, idval, up);
}

static u8 bnx2x_dcbnl_get_app_up(struct net_device *netdev, u8 idtype,
u16 idval)
{
int i;
u8 up = 0;

struct bnx2x *bp = netdev_priv(netdev);
DP(NETIF_MSG_LINK, "app_type %d, app_id 0x%x\n", idtype, idval);

/* iterate over the app entries looking for idtype and idval */
for (i = 0; i < DCBX_MAX_APP_PROTOCOL; i++)
if (bnx2x_app_is_equal(&bp->dcbx_local_feat.app.app_pri_tbl[i],
idtype, idval))
break;

if (i < DCBX_MAX_APP_PROTOCOL)
/* if found return up */
up = bp->dcbx_local_feat.app.app_pri_tbl[i].pri_bitmap;
else
DP(NETIF_MSG_LINK, "app not found\n");

return up;
}

static u8 bnx2x_dcbnl_get_dcbx(struct net_device *netdev)
{
struct bnx2x *bp = netdev_priv(netdev);
Expand Down Expand Up @@ -2135,11 +2107,12 @@ const struct dcbnl_rtnl_ops bnx2x_dcbnl_ops = {
.setnumtcs = bnx2x_dcbnl_set_numtcs,
.getpfcstate = bnx2x_dcbnl_get_pfc_state,
.setpfcstate = bnx2x_dcbnl_set_pfc_state,
.getapp = bnx2x_dcbnl_get_app_up,
.setapp = bnx2x_dcbnl_set_app_up,
.getdcbx = bnx2x_dcbnl_get_dcbx,
.setdcbx = bnx2x_dcbnl_set_dcbx,
.getfeatcfg = bnx2x_dcbnl_get_featcfg,
.setfeatcfg = bnx2x_dcbnl_set_featcfg,
};

#endif /* BCM_DCBNL */
#endif /* BCM_DCB */
5 changes: 2 additions & 3 deletions trunk/drivers/net/bnx2x/bnx2x_dcb.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,8 @@ enum {
void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state);

/* DCB netlink */
#ifdef BCM_DCBNL
#ifdef BCM_DCB
extern const struct dcbnl_rtnl_ops bnx2x_dcbnl_ops;
int bnx2x_dcbnl_update_applist(struct bnx2x *bp, bool delall);
#endif /* BCM_DCBNL */
#endif /* BCM_DCB */

#endif /* BNX2X_DCB_H */
7 changes: 1 addition & 6 deletions trunk/drivers/net/bnx2x/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9441,7 +9441,7 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
dev->vlan_features |= (NETIF_F_TSO | NETIF_F_TSO_ECN);
dev->vlan_features |= NETIF_F_TSO6;

#ifdef BCM_DCBNL
#ifdef BCM_DCB
dev->dcbnl_ops = &bnx2x_dcbnl_ops;
#endif

Expand Down Expand Up @@ -9848,11 +9848,6 @@ static void __devexit bnx2x_remove_one(struct pci_dev *pdev)
}
#endif

#ifdef BCM_DCBNL
/* Delete app tlvs from dcbnl */
bnx2x_dcbnl_update_applist(bp, true);
#endif

unregister_netdev(dev);

/* Delete all NAPI objects */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/bonding/bond_alb.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon

_lock_rx_hashtbl(bond);

hash_index = _simple_hash((u8 *)&arp->ip_dst, sizeof(arp->ip_dst));
hash_index = _simple_hash((u8 *)&arp->ip_dst, sizeof(arp->ip_src));
client_info = &(bond_info->rx_hashtbl[hash_index]);

if (client_info->assigned) {
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/net/bonding/bonding.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ struct bonding {
*
* Caller must hold bond lock for read
*/
static inline struct slave *bond_get_slave_by_dev(struct bonding *bond,
struct net_device *slave_dev)
static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev)
{
struct slave *slave = NULL;
int i;
Expand All @@ -281,7 +280,7 @@ static inline struct slave *bond_get_slave_by_dev(struct bonding *bond,
}
}

return NULL;
return 0;
}

static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)
Expand Down
14 changes: 9 additions & 5 deletions trunk/drivers/net/cnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -5158,11 +5158,15 @@ static struct cnic_dev *init_bnx2_cnic(struct net_device *dev)

dev_hold(dev);
pci_dev_get(pdev);
if ((pdev->device == PCI_DEVICE_ID_NX2_5709 ||
pdev->device == PCI_DEVICE_ID_NX2_5709S) &&
(pdev->revision < 0x10)) {
pci_dev_put(pdev);
goto cnic_err;
if (pdev->device == PCI_DEVICE_ID_NX2_5709 ||
pdev->device == PCI_DEVICE_ID_NX2_5709S) {
u8 rev;

pci_read_config_byte(pdev, PCI_REVISION_ID, &rev);
if (rev < 0x10) {
pci_dev_put(pdev);
goto cnic_err;
}
}
pci_dev_put(pdev);

Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/net/dm9000.c
Original file line number Diff line number Diff line change
Expand Up @@ -1592,15 +1592,10 @@ dm9000_probe(struct platform_device *pdev)
ndev->dev_addr[i] = ior(db, i+DM9000_PAR);
}

if (!is_valid_ether_addr(ndev->dev_addr)) {
if (!is_valid_ether_addr(ndev->dev_addr))
dev_warn(db->dev, "%s: Invalid ethernet MAC address. Please "
"set using ifconfig\n", ndev->name);

random_ether_addr(ndev->dev_addr);
mac_src = "random";
}


platform_set_drvdata(pdev, ndev);
ret = register_netdev(ndev);

Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/net/e1000e/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,13 @@ static void e1000_get_regs(struct net_device *netdev,
struct e1000_hw *hw = &adapter->hw;
u32 *regs_buff = p;
u16 phy_data;
u8 revision_id;

memset(p, 0, E1000_REGS_LEN * sizeof(u32));

regs->version = (1 << 24) | (adapter->pdev->revision << 16) |
adapter->pdev->device;
pci_read_config_byte(adapter->pdev, PCI_REVISION_ID, &revision_id);

regs->version = (1 << 24) | (revision_id << 16) | adapter->pdev->device;

regs_buff[0] = er32(CTRL);
regs_buff[1] = er32(STATUS);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/enic/enic.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#define DRV_NAME "enic"
#define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver"
#define DRV_VERSION "2.1.1.10"
#define DRV_VERSION "2.1.1.9"
#define DRV_COPYRIGHT "Copyright 2008-2011 Cisco Systems, Inc"

#define ENIC_BARS_MAX 6
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/net/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1126,8 +1126,6 @@ static int enic_set_port_profile(struct enic *enic, u8 *mac)
if (err)
return err;

enic_reset_addr_lists(enic);

switch (enic->pp.request) {

case PORT_REQUEST_ASSOCIATE:
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/net/igbvf/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,13 @@ static void igbvf_get_regs(struct net_device *netdev,
struct igbvf_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
u32 *regs_buff = p;
u8 revision_id;

memset(p, 0, IGBVF_REGS_LEN * sizeof(u32));

regs->version = (1 << 24) | (adapter->pdev->revision << 16) |
adapter->pdev->device;
pci_read_config_byte(adapter->pdev, PCI_REVISION_ID, &revision_id);

regs->version = (1 << 24) | (revision_id << 16) | adapter->pdev->device;

regs_buff[0] = er32(CTRL);
regs_buff[1] = er32(STATUS);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/igbvf/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2639,7 +2639,8 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
hw->device_id = pdev->device;
hw->subsystem_vendor_id = pdev->subsystem_vendor;
hw->subsystem_device_id = pdev->subsystem_device;
hw->revision_id = pdev->revision;

pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id);

err = -EIO;
adapter->hw.hw_addr = ioremap(pci_resource_start(pdev, 0),
Expand Down
Loading

0 comments on commit 7d0c34c

Please sign in to comment.