Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351256
b: refs/heads/master
c: 81d0aeb
h: refs/heads/master
v: v3
  • Loading branch information
Sony Chacko authored and David S. Miller committed Jan 2, 2013
1 parent 2f4d0f0 commit 6bf0b17
Show file tree
Hide file tree
Showing 6 changed files with 539 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 629263acaea3613a7da4d602ac1d143533d251cc
refs/heads/master: 81d0aeb0a4fff6c274f956644a837caac14a7c21
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ struct qlcnic_hardware_context {
struct qlcnic_nic_intr_coalesce coal;
struct qlcnic_fw_dump fw_dump;
struct qlcnic_fdt fdt;
struct qlc_83xx_reset reset;
struct qlc_83xx_idc idc;
struct qlc_83xx_fw_info fw_info;
struct qlcnic_intrpt_config *intr_tbl;
Expand Down
40 changes: 40 additions & 0 deletions trunk/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2343,3 +2343,43 @@ int qlcnic_83xx_ms_mem_write128(struct qlcnic_adapter *adapter, u64 addr,

return ret;
}

int qlcnic_83xx_flash_read32(struct qlcnic_adapter *adapter, u32 flash_addr,
u8 *p_data, int count)
{
int i, ret;
u32 word, addr = flash_addr;
ulong indirect_addr;

if (qlcnic_83xx_lock_flash(adapter) != 0)
return -EIO;

if (addr & 0x3) {
dev_err(&adapter->pdev->dev, "Illegal addr = 0x%x\n", addr);
qlcnic_83xx_unlock_flash(adapter);
return -EIO;
}

for (i = 0; i < count; i++) {
if (qlcnic_83xx_wrt_reg_indirect(adapter,
QLC_83XX_FLASH_DIRECT_WINDOW,
(addr))) {
qlcnic_83xx_unlock_flash(adapter);
return -EIO;
}

indirect_addr = QLC_83XX_FLASH_DIRECT_DATA(addr);
ret = qlcnic_83xx_rd_reg_indirect(adapter,
indirect_addr);
if (ret == -EIO)
return -EIO;
word = ret;
*p_data = word;
p_data = p_data + 4;
addr = addr + 4;
}

qlcnic_83xx_unlock_flash(adapter);

return 0;
}
17 changes: 17 additions & 0 deletions trunk/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
#define QLC_83XX_BOOT_FROM_FLASH 0
#define QLC_83XX_BOOT_FROM_FILE 0x12345678

#define QLC_83XX_MAX_RESET_SEQ_ENTRIES 16

struct qlcnic_intrpt_config {
u8 type;
u8 enabled;
Expand All @@ -98,6 +100,20 @@ struct qlc_83xx_fw_info {
u8 load_from_file;
};

struct qlc_83xx_reset {
struct qlc_83xx_reset_hdr *hdr;
int seq_index;
int seq_error;
int array_index;
u32 array[QLC_83XX_MAX_RESET_SEQ_ENTRIES];
u8 *buff;
u8 *stop_offset;
u8 *start_offset;
u8 *init_offset;
u8 seq_end;
u8 template_end;
};

#define QLC_83XX_IDC_DISABLE_FW_RESET_RECOVERY 0x1
#define QLC_83XX_IDC_GRACEFULL_RESET 0x2
#define QLC_83XX_IDC_TIMESTAMP 0
Expand Down Expand Up @@ -377,6 +393,7 @@ int qlcnic_83xx_init(struct qlcnic_adapter *);
int qlcnic_83xx_idc_ready_state_entry(struct qlcnic_adapter *);
int qlcnic_83xx_check_hw_status(struct qlcnic_adapter *p_dev);
void qlcnic_83xx_idc_poll_dev_state(struct work_struct *);
int qlcnic_83xx_get_reset_instruction_template(struct qlcnic_adapter *);
void qlcnic_83xx_idc_exit(struct qlcnic_adapter *);
void qlcnic_83xx_idc_request_reset(struct qlcnic_adapter *, u32);
int qlcnic_83xx_lock_driver(struct qlcnic_adapter *);
Expand Down
Loading

0 comments on commit 6bf0b17

Please sign in to comment.