Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19275
b: refs/heads/master
c: 1122db7
h: refs/heads/master
i:
  19273: 49c1daf
  19271: 149f46c
v: v3
  • Loading branch information
Michael Chan authored and David S. Miller committed Jan 24, 2006
1 parent 31fb72b commit b8b02db
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 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: 1269a8a64a37c8a06af672f4cff4fed16a478734
refs/heads/master: 1122db717ab5443ca9043fc0d23c1e862cfb3a61
13 changes: 10 additions & 3 deletions trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2724,9 +2724,16 @@ bnx2_init_nvram(struct bnx2 *bp)
if (j == entry_count) {
bp->flash_info = NULL;
printk(KERN_ALERT PFX "Unknown flash/EEPROM type.\n");
rc = -ENODEV;
return -ENODEV;
}

val = REG_RD_IND(bp, bp->shmem_base + BNX2_SHARED_HW_CFG_CONFIG2);
val &= BNX2_SHARED_HW_CFG2_NVM_SIZE_MASK;
if (val)
bp->flash_size = val;
else
bp->flash_size = bp->flash_info->total_size;

return rc;
}

Expand Down Expand Up @@ -4809,10 +4816,10 @@ bnx2_get_eeprom_len(struct net_device *dev)
{
struct bnx2 *bp = dev->priv;

if (bp->flash_info == 0)
if (bp->flash_info == NULL)
return 0;

return (int) bp->flash_info->total_size;
return (int) bp->flash_size;
}

static int
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/net/bnx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -4072,6 +4072,7 @@ struct bnx2 {
struct net_device_stats net_stats;

struct flash_spec *flash_info;
u32 flash_size;
};

static u32 bnx2_reg_rd_ind(struct bnx2 *bp, u32 offset);
Expand Down Expand Up @@ -4273,6 +4274,9 @@ struct fw_info {
#define BNX2_SHARED_HW_CFG_LED_MODE_GPHY1 0x100
#define BNX2_SHARED_HW_CFG_LED_MODE_GPHY2 0x200

#define BNX2_SHARED_HW_CFG_CONFIG2 0x00000040
#define BNX2_SHARED_HW_CFG2_NVM_SIZE_MASK 0x00fff000

#define BNX2_DEV_INFO_BC_REV 0x0000004c

#define BNX2_PORT_HW_CFG_MAC_UPPER 0x00000050
Expand Down

0 comments on commit b8b02db

Please sign in to comment.