Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204190
b: refs/heads/master
c: ed96932
h: refs/heads/master
v: v3
  • Loading branch information
Jing Huang authored and James Bottomley committed Jul 27, 2010
1 parent 7c4c294 commit 59b43c4
Show file tree
Hide file tree
Showing 20 changed files with 155 additions and 128 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: 293f82d59ed8b6d61d242e40ee7a6a146fae5eaa
refs/heads/master: ed96932470e4ca3aab29518a748dc1162853b456
5 changes: 0 additions & 5 deletions trunk/drivers/scsi/bfa/bfa_fcpim.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ bfa_fcpim_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
bfa_ioim_attach(fcpim, meminfo);
}

static void
bfa_fcpim_initdone(struct bfa_s *bfa)
{
}

static void
bfa_fcpim_detach(struct bfa_s *bfa)
{
Expand Down
42 changes: 23 additions & 19 deletions trunk/drivers/scsi/bfa/bfa_fcport.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,25 +911,6 @@ bfa_fcport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
bfa_reqq_winit(&fcport->reqq_wait, bfa_fcport_qresume, fcport);
}

static void
bfa_fcport_initdone(struct bfa_s *bfa)
{
struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);

/**
* Initialize port attributes from IOC hardware data.
*/
bfa_fcport_set_wwns(fcport);
if (fcport->cfg.maxfrsize == 0)
fcport->cfg.maxfrsize = bfa_ioc_maxfrsize(&bfa->ioc);
fcport->cfg.rx_bbcredit = bfa_ioc_rx_bbcredit(&bfa->ioc);
fcport->speed_sup = bfa_ioc_speed_sup(&bfa->ioc);

bfa_assert(fcport->cfg.maxfrsize);
bfa_assert(fcport->cfg.rx_bbcredit);
bfa_assert(fcport->speed_sup);
}

static void
bfa_fcport_detach(struct bfa_s *bfa)
{
Expand Down Expand Up @@ -1262,6 +1243,29 @@ bfa_fcport_send_stats_clear(void *cbarg)
* bfa_pport_public
*/

/**
* Called to initialize port attributes
*/
void
bfa_fcport_init(struct bfa_s *bfa)
{
struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);

/**
* Initialize port attributes from IOC hardware data.
*/
bfa_fcport_set_wwns(fcport);
if (fcport->cfg.maxfrsize == 0)
fcport->cfg.maxfrsize = bfa_ioc_maxfrsize(&bfa->ioc);
fcport->cfg.rx_bbcredit = bfa_ioc_rx_bbcredit(&bfa->ioc);
fcport->speed_sup = bfa_ioc_speed_sup(&bfa->ioc);

bfa_assert(fcport->cfg.maxfrsize);
bfa_assert(fcport->cfg.rx_bbcredit);
bfa_assert(fcport->speed_sup);
}


/**
* Firmware message handler.
*/
Expand Down
14 changes: 3 additions & 11 deletions trunk/drivers/scsi/bfa/bfa_fcxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,6 @@ bfa_fcxp_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
claim_fcxps_mem(mod, meminfo);
}

static void
bfa_fcxp_initdone(struct bfa_s *bfa)
{
}

static void
bfa_fcxp_detach(struct bfa_s *bfa)
{
Expand Down Expand Up @@ -225,7 +220,7 @@ bfa_fcxp_null_comp(void *bfad_fcxp, struct bfa_fcxp_s *fcxp, void *cbarg,
bfa_status_t req_status, u32 rsp_len,
u32 resid_len, struct fchs_s *rsp_fchs)
{
/**discarded fcxp completion */
/* discarded fcxp completion */
}

static void
Expand Down Expand Up @@ -527,11 +522,8 @@ bfa_fcxp_alloc(void *caller, struct bfa_s *bfa, int nreq_sgles,
if (nreq_sgles > BFI_SGE_INLINE) {
nreq_sgpg = BFA_SGPG_NPAGE(nreq_sgles);

if (bfa_sgpg_malloc
(bfa, &fcxp->req_sgpg_q, nreq_sgpg)
if (bfa_sgpg_malloc(bfa, &fcxp->req_sgpg_q, nreq_sgpg)
!= BFA_STATUS_OK) {
/* bfa_sgpg_wait(bfa, &fcxp->req_sgpg_wqe,
nreq_sgpg); */
/*
* TODO
*/
Expand Down Expand Up @@ -685,7 +677,7 @@ bfa_fcxp_send(struct bfa_fcxp_s *fcxp, struct bfa_rport_s *rport,
fcxp->send_cbarg = cbarg;

/**
* If no room in CPE queue, wait for
* If no room in CPE queue, wait for space in request queue
*/
send_req = bfa_reqq_next(bfa, BFA_REQQ_FCXP);
if (!send_req) {
Expand Down
41 changes: 10 additions & 31 deletions trunk/drivers/scsi/bfa/bfa_ioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,13 @@ bfa_ioc_error_isr(struct bfa_ioc_s *ioc)
bfa_fsm_send_event(ioc, IOC_E_HWERROR);
}

void
bfa_ioc_set_fcmode(struct bfa_ioc_s *ioc)
{
ioc->fcmode = BFA_TRUE;
ioc->port_id = bfa_ioc_pcifn(ioc);
}

#ifndef BFA_BIOS_BUILD

/**
Expand Down Expand Up @@ -1697,6 +1704,9 @@ bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc,
/* For now, model descr uses same model string */
bfa_ioc_get_adapter_model(ioc, ad_attr->model_descr);

ad_attr->card_type = ioc_attr->card_type;
ad_attr->is_mezz = bfa_mfg_is_mezz(ioc_attr->card_type);

if (BFI_ADAPTER_IS_SPECIAL(ioc_attr->adapter_prop))
ad_attr->prototype = 1;
else
Expand Down Expand Up @@ -1866,30 +1876,6 @@ bfa_ioc_get_nwwn(struct bfa_ioc_s *ioc)
return w.wwn;
}

wwn_t
bfa_ioc_get_wwn_naa5(struct bfa_ioc_s *ioc, u16 inst)
{
union {
wwn_t wwn;
u8 byte[sizeof(wwn_t)];
}
w , w5;

bfa_trc(ioc, inst);

w.wwn = ioc->attr->mfg_wwn;
w5.byte[0] = 0x50 | w.byte[2] >> 4;
w5.byte[1] = w.byte[2] << 4 | w.byte[3] >> 4;
w5.byte[2] = w.byte[3] << 4 | w.byte[4] >> 4;
w5.byte[3] = w.byte[4] << 4 | w.byte[5] >> 4;
w5.byte[4] = w.byte[5] << 4 | w.byte[6] >> 4;
w5.byte[5] = w.byte[6] << 4 | w.byte[7] >> 4;
w5.byte[6] = w.byte[7] << 4 | (inst & 0x0f00) >> 8;
w5.byte[7] = (inst & 0xff);

return w5.wwn;
}

u64
bfa_ioc_get_adid(struct bfa_ioc_s *ioc)
{
Expand All @@ -1907,13 +1893,6 @@ bfa_ioc_get_mac(struct bfa_ioc_s *ioc)
return mac;
}

void
bfa_ioc_set_fcmode(struct bfa_ioc_s *ioc)
{
ioc->fcmode = BFA_TRUE;
ioc->port_id = bfa_ioc_pcifn(ioc);
}

bfa_boolean_t
bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc)
{
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/scsi/bfa/bfa_ioc.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ bfa_boolean_t bfa_ioc_fwver_cmp(struct bfa_ioc_s *ioc,
*/
wwn_t bfa_ioc_get_pwwn(struct bfa_ioc_s *ioc);
wwn_t bfa_ioc_get_nwwn(struct bfa_ioc_s *ioc);
wwn_t bfa_ioc_get_wwn_naa5(struct bfa_ioc_s *ioc, u16 inst);
mac_t bfa_ioc_get_mac(struct bfa_ioc_s *ioc);
u64 bfa_ioc_get_adid(struct bfa_ioc_s *ioc);

Expand Down
27 changes: 14 additions & 13 deletions trunk/drivers/scsi/bfa/bfa_iocfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,18 +290,6 @@ bfa_iocfc_mem_claim(struct bfa_s *bfa, struct bfa_iocfc_cfg_s *cfg,
}
}

/**
* BFA submodules initialization completion notification.
*/
static void
bfa_iocfc_initdone_submod(struct bfa_s *bfa)
{
int i;

for (i = 0; hal_mods[i]; i++)
hal_mods[i]->initdone(bfa);
}

/**
* Start BFA submodules.
*/
Expand Down Expand Up @@ -394,6 +382,8 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa)
/**
* Configuration is complete - initialize/start submodules
*/
bfa_fcport_init(bfa);

if (iocfc->action == BFA_IOCFC_ACT_INIT)
bfa_cb_queue(bfa, &iocfc->init_hcb_qe, bfa_iocfc_init_cb, bfa);
else
Expand Down Expand Up @@ -531,7 +521,6 @@ bfa_iocfc_enable_cbfn(void *bfa_arg, enum bfa_status status)
return;
}

bfa_iocfc_initdone_submod(bfa);
bfa_iocfc_send_cfg(bfa);
}

Expand Down Expand Up @@ -881,6 +870,18 @@ bfa_iocfc_get_bootwwns(struct bfa_s *bfa, u8 *nwwns, wwn_t **wwns)
*wwns = cfgrsp->bootwwns.wwn;
}

void
bfa_iocfc_get_pbc_boot_cfg(struct bfa_s *bfa, struct bfa_boot_pbc_s *pbcfg)
{
struct bfa_iocfc_s *iocfc = &bfa->iocfc;
struct bfi_iocfc_cfgrsp_s *cfgrsp = iocfc->cfgrsp;

pbcfg->enable = cfgrsp->pbc_cfg.boot_enabled;
pbcfg->nbluns = cfgrsp->pbc_cfg.nbluns;
pbcfg->speed = cfgrsp->pbc_cfg.port_speed;
memcpy(pbcfg->pblun, cfgrsp->pbc_cfg.blun, sizeof(pbcfg->pblun));
}

#endif


5 changes: 4 additions & 1 deletion trunk/drivers/scsi/bfa/bfa_iocfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ struct bfa_iocfc_s {
#define bfa_isr_mode_set(__bfa, __msix) \
((__bfa)->iocfc.hwif.hw_isr_mode_set(__bfa, __msix))
#define bfa_msix_getvecs(__bfa, __vecmap, __nvecs, __maxvec) \
(__bfa)->iocfc.hwif.hw_msix_getvecs(__bfa, __vecmap, __nvecs, __maxvec)
((__bfa)->iocfc.hwif.hw_msix_getvecs(__bfa, __vecmap, \
__nvecs, __maxvec))

/*
* FC specific IOC functions.
Expand Down Expand Up @@ -166,6 +167,8 @@ void bfa_com_meminfo(bfa_boolean_t mincfg, u32 *dm_len);
void bfa_com_attach(struct bfa_s *bfa, struct bfa_meminfo_s *mi,
bfa_boolean_t mincfg);
void bfa_iocfc_get_bootwwns(struct bfa_s *bfa, u8 *nwwns, wwn_t **wwns);
void bfa_iocfc_get_pbc_boot_cfg(struct bfa_s *bfa,
struct bfa_boot_pbc_s *pbcfg);

#endif /* __BFA_IOCFC_H__ */

6 changes: 0 additions & 6 deletions trunk/drivers/scsi/bfa/bfa_lps.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ static void bfa_lps_attach(struct bfa_s *bfa, void *bfad,
struct bfa_iocfc_cfg_s *cfg,
struct bfa_meminfo_s *meminfo,
struct bfa_pcidev_s *pcidev);
static void bfa_lps_initdone(struct bfa_s *bfa);
static void bfa_lps_detach(struct bfa_s *bfa);
static void bfa_lps_start(struct bfa_s *bfa);
static void bfa_lps_stop(struct bfa_s *bfa);
Expand Down Expand Up @@ -346,11 +345,6 @@ bfa_lps_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
}
}

static void
bfa_lps_initdone(struct bfa_s *bfa)
{
}

static void
bfa_lps_detach(struct bfa_s *bfa)
{
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/scsi/bfa/bfa_port_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,7 @@ struct bfa_fcport_s {
/*
* public functions
*/
void bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
void bfa_fcport_init(struct bfa_s *bfa);
void bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);

#endif /* __BFA_PORT_PRIV_H__ */
3 changes: 0 additions & 3 deletions trunk/drivers/scsi/bfa/bfa_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
void *bfad, struct bfa_iocfc_cfg_s *cfg, \
struct bfa_meminfo_s *meminfo, \
struct bfa_pcidev_s *pcidev); \
static void bfa_ ## __mod ## _initdone(struct bfa_s *bfa); \
static void bfa_ ## __mod ## _detach(struct bfa_s *bfa); \
static void bfa_ ## __mod ## _start(struct bfa_s *bfa); \
static void bfa_ ## __mod ## _stop(struct bfa_s *bfa); \
Expand All @@ -47,7 +46,6 @@
struct bfa_module_s hal_mod_ ## __mod = { \
bfa_ ## __mod ## _meminfo, \
bfa_ ## __mod ## _attach, \
bfa_ ## __mod ## _initdone, \
bfa_ ## __mod ## _detach, \
bfa_ ## __mod ## _start, \
bfa_ ## __mod ## _stop, \
Expand All @@ -69,7 +67,6 @@ struct bfa_module_s {
struct bfa_iocfc_cfg_s *cfg,
struct bfa_meminfo_s *meminfo,
struct bfa_pcidev_s *pcidev);
void (*initdone) (struct bfa_s *bfa);
void (*detach) (struct bfa_s *bfa);
void (*start) (struct bfa_s *bfa);
void (*stop) (struct bfa_s *bfa);
Expand Down
5 changes: 0 additions & 5 deletions trunk/drivers/scsi/bfa/bfa_rport.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,11 +635,6 @@ bfa_rport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
bfa_meminfo_kva(meminfo) = (u8 *) rp;
}

static void
bfa_rport_initdone(struct bfa_s *bfa)
{
}

static void
bfa_rport_detach(struct bfa_s *bfa)
{
Expand Down
5 changes: 0 additions & 5 deletions trunk/drivers/scsi/bfa/bfa_sgpg.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ bfa_sgpg_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
bfa_meminfo_dma_phys(minfo) = sgpg_pa.pa;
}

static void
bfa_sgpg_initdone(struct bfa_s *bfa)
{
}

static void
bfa_sgpg_detach(struct bfa_s *bfa)
{
Expand Down
5 changes: 0 additions & 5 deletions trunk/drivers/scsi/bfa/bfa_uf.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,6 @@ bfa_uf_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
uf_mem_claim(ufm, meminfo);
}

static void
bfa_uf_initdone(struct bfa_s *bfa)
{
}

static void
bfa_uf_detach(struct bfa_s *bfa)
{
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/scsi/bfa/include/bfi/bfi_iocfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define __BFI_IOCFC_H__

#include "bfi.h"
#include <bfi/bfi_pbc.h>
#include <defs/bfa_defs_ioc.h>
#include <defs/bfa_defs_iocfc.h>
#include <defs/bfa_defs_boot.h>
Expand Down Expand Up @@ -78,6 +79,7 @@ struct bfi_iocfc_cfgrsp_s {
struct bfa_iocfc_fwcfg_s fwcfg;
struct bfa_iocfc_intr_attr_s intr_attr;
struct bfi_iocfc_bootwwns bootwwns;
struct bfi_pbc_s pbc_cfg;
};

/**
Expand Down
Loading

0 comments on commit 59b43c4

Please sign in to comment.