Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 258440
b: refs/heads/master
c: d4e16d4
h: refs/heads/master
v: v3
  • Loading branch information
Rasesh Mody authored and David S. Miller committed Jul 23, 2011
1 parent 5365c61 commit f8ee9c6
Show file tree
Hide file tree
Showing 3 changed files with 32 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: f374b36103cf22c9416f1004b0302b03fad79547
refs/heads/master: d4e16d4285d93ea0c284a3cf547e61472f79f8d2
25 changes: 25 additions & 0 deletions trunk/drivers/net/bna/bfa_ioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ static bool bfa_nw_auto_recover = true;
/*
* forward declarations
*/
static void bfa_ioc_hw_sem_init(struct bfa_ioc *ioc);
static void bfa_ioc_hw_sem_get(struct bfa_ioc *ioc);
static void bfa_ioc_hw_sem_get_cancel(struct bfa_ioc *ioc);
static void bfa_ioc_hwinit(struct bfa_ioc *ioc, bool force);
Expand Down Expand Up @@ -590,6 +591,7 @@ bfa_iocpf_sm_reset(struct bfa_iocpf *iocpf, enum iocpf_event event)
static void
bfa_iocpf_sm_fwcheck_entry(struct bfa_iocpf *iocpf)
{
bfa_ioc_hw_sem_init(iocpf->ioc);
bfa_ioc_hw_sem_get(iocpf->ioc);
}

Expand Down Expand Up @@ -1175,6 +1177,29 @@ bfa_nw_ioc_sem_release(void __iomem *sem_reg)
writel(1, sem_reg);
}

static void
bfa_ioc_hw_sem_init(struct bfa_ioc *ioc)
{
struct bfi_ioc_image_hdr fwhdr;
u32 fwstate = readl(ioc->ioc_regs.ioc_fwstate);

if (fwstate == BFI_IOC_UNINIT)
return;

bfa_nw_ioc_fwver_get(ioc, &fwhdr);

if (swab32(fwhdr.exec) == BFI_FWBOOT_TYPE_NORMAL)
return;

writel(BFI_IOC_UNINIT, ioc->ioc_regs.ioc_fwstate);

/*
* Try to lock and then unlock the semaphore.
*/
readl(ioc->ioc_regs.ioc_sem_reg);
writel(1, ioc->ioc_regs.ioc_sem_reg);
}

static void
bfa_ioc_hw_sem_get(struct bfa_ioc *ioc)
{
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/net/bna/bfi.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ struct bfi_ioc_image_hdr {
u32 md5sum[BFI_IOC_MD5SUM_SZ];
};

enum bfi_fwboot_type {
BFI_FWBOOT_TYPE_NORMAL = 0,
BFI_FWBOOT_TYPE_FLASH = 1,
BFI_FWBOOT_TYPE_MEMTEST = 2,
};

/**
* BFI_IOC_I2H_READY_EVENT message
*/
Expand Down

0 comments on commit f8ee9c6

Please sign in to comment.