Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298450
b: refs/heads/master
c: 452427b
h: refs/heads/master
v: v3
  • Loading branch information
Yuval Mintz authored and David S. Miller committed Mar 28, 2012
1 parent 8127f1e commit 48d5d8b
Show file tree
Hide file tree
Showing 9 changed files with 418 additions and 108 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: a2daf263107ba3eb6db33931881731fa51c95045
refs/heads/master: 452427b015b1b0cbbef7b6207908726837d39d57
7 changes: 7 additions & 0 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,13 @@ enum {
};


struct bnx2x_prev_path_list {
u8 bus;
u8 slot;
u8 path;
struct list_head list;
};

struct bnx2x {
/* Fields used in the tx and intr/napi performance paths
* are grouped together in the beginning of the structure
Expand Down
40 changes: 24 additions & 16 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,29 @@ static void bnx2x_squeeze_objects(struct bnx2x *bp)
} while (0)
#endif

bool bnx2x_test_firmware_version(struct bnx2x *bp, bool is_err)
{
/* build FW version dword */
u32 my_fw = (BCM_5710_FW_MAJOR_VERSION) +
(BCM_5710_FW_MINOR_VERSION << 8) +
(BCM_5710_FW_REVISION_VERSION << 16) +
(BCM_5710_FW_ENGINEERING_VERSION << 24);

/* read loaded FW from chip */
u32 loaded_fw = REG_RD(bp, XSEM_REG_PRAM);

DP(NETIF_MSG_IFUP, "loaded fw %x, my fw %x\n", loaded_fw, my_fw);

if (loaded_fw != my_fw) {
if (is_err)
BNX2X_ERR("bnx2x with FW %x was already loaded, which mismatches my %x FW. aborting\n",
loaded_fw, my_fw);
return false;
}

return true;
}

/* must be called with rtnl_lock */
int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
{
Expand Down Expand Up @@ -1815,23 +1838,8 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
}
if (load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP &&
load_code != FW_MSG_CODE_DRV_LOAD_COMMON) {
/* build FW version dword */
u32 my_fw = (BCM_5710_FW_MAJOR_VERSION) +
(BCM_5710_FW_MINOR_VERSION << 8) +
(BCM_5710_FW_REVISION_VERSION << 16) +
(BCM_5710_FW_ENGINEERING_VERSION << 24);

/* read loaded FW from chip */
u32 loaded_fw = REG_RD(bp, XSEM_REG_PRAM);

DP(BNX2X_MSG_SP, "loaded fw %x, my fw %x",
loaded_fw, my_fw);

/* abort nic load if version mismatch */
if (my_fw != loaded_fw) {
BNX2X_ERR("bnx2x with FW %x already loaded, "
"which mismatches my %x FW. aborting",
loaded_fw, my_fw);
if (!bnx2x_test_firmware_version(bp, true)) {
rc = -EBUSY;
LOAD_ERROR_EXIT(bp, load_error2);
}
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ void bnx2x_panic_dump(struct bnx2x *bp);

void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl);

/* validate currect fw is loaded */
bool bnx2x_test_firmware_version(struct bnx2x *bp, bool is_err);

/* dev_close main block */
int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode);

Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,9 @@ struct drv_func_mb {

#define DRV_MSG_CODE_LINK_STATUS_CHANGED 0x01000000

#define DRV_MSG_CODE_INITIATE_FLR 0x02000000
#define REQ_BC_VER_4_INITIATE_FLR 0x00070213

#define BIOS_MSG_CODE_LIC_CHALLENGE 0xff010000
#define BIOS_MSG_CODE_LIC_RESPONSE 0xff020000
#define BIOS_MSG_CODE_VIRT_MAC_PRIM 0xff030000
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#define ETH_MAX_PACKET_SIZE 1500
#define ETH_MAX_JUMBO_PACKET_SIZE 9600
#define MDIO_ACCESS_TIMEOUT 1000
#define BMAC_CONTROL_RX_ENABLE 2
#define WC_LANE_MAX 4
#define I2C_SWITCH_WIDTH 2
#define I2C_BSC0 0
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
#define PFC_BRB_FULL_LB_XON_THRESHOLD 250

#define MAXVAL(a, b) (((a) > (b)) ? (a) : (b))

#define BMAC_CONTROL_RX_ENABLE 2
/***********************************************************/
/* Structs */
/***********************************************************/
Expand Down
Loading

0 comments on commit 48d5d8b

Please sign in to comment.