Merge branch 'master' into for-next

Conflicts:
	MAINTAINERS
	arch/arm/mach-omap2/pm24xx.c
	drivers/scsi/bfa/bfa_fcpim.c

Needed to update to apply fixes for which the old branch was too
outdated.
This commit is contained in:
Jiri Kosina 2010-12-22 18:57:02 +01:00
commit 4b7bd36470
2029 changed files with 37852 additions and 20361 deletions

View file

@ -1765,7 +1765,7 @@ out:
} /* End twa_scsi_eh_reset() */
/* This is the main scsi queue function to handle scsi opcodes */
static int twa_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
{
int request_id, retval;
TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;
@ -1812,6 +1812,8 @@ out:
return retval;
} /* End twa_scsi_queue() */
static DEF_SCSI_QCMD(twa_scsi_queue)
/* This function hands scsi cdb's to the firmware */
static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg)
{

View file

@ -1501,7 +1501,7 @@ out:
} /* End twl_scsi_eh_reset() */
/* This is the main scsi queue function to handle scsi opcodes */
static int twl_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
{
int request_id, retval;
TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;
@ -1536,6 +1536,8 @@ out:
return retval;
} /* End twl_scsi_queue() */
static DEF_SCSI_QCMD(twl_scsi_queue)
/* This function tells the controller to shut down */
static void __twl_shutdown(TW_Device_Extension *tw_dev)
{

View file

@ -1947,7 +1947,7 @@ static int tw_scsiop_test_unit_ready_complete(TW_Device_Extension *tw_dev, int r
} /* End tw_scsiop_test_unit_ready_complete() */
/* This is the main scsi queue function to handle scsi opcodes */
static int tw_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
{
unsigned char *command = SCpnt->cmnd;
int request_id = 0;
@ -2023,6 +2023,8 @@ static int tw_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd
return retval;
} /* End tw_scsi_queue() */
static DEF_SCSI_QCMD(tw_scsi_queue)
/* This function is the interrupt service routine */
static irqreturn_t tw_interrupt(int irq, void *dev_instance)
{

View file

@ -167,7 +167,7 @@ MODULE_LICENSE("GPL");
#include "53c700_d.h"
STATIC int NCR_700_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *));
STATIC int NCR_700_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *);
STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt);
STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt);
STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt);
@ -1749,8 +1749,8 @@ NCR_700_intr(int irq, void *dev_id)
return IRQ_RETVAL(handled);
}
STATIC int
NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *))
static int
NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *))
{
struct NCR_700_Host_Parameters *hostdata =
(struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0];
@ -1904,6 +1904,8 @@ NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *))
return 0;
}
STATIC DEF_SCSI_QCMD(NCR_700_queuecommand)
STATIC int
NCR_700_abort(struct scsi_cmnd * SCp)
{

View file

@ -2807,7 +2807,7 @@ static int BusLogic_host_reset(struct scsi_cmnd * SCpnt)
Outgoing Mailbox for execution by the associated Host Adapter.
*/
static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRoutine) (struct scsi_cmnd *))
static int BusLogic_QueueCommand_lck(struct scsi_cmnd *Command, void (*CompletionRoutine) (struct scsi_cmnd *))
{
struct BusLogic_HostAdapter *HostAdapter = (struct BusLogic_HostAdapter *) Command->device->host->hostdata;
struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[Command->device->id];
@ -2994,6 +2994,7 @@ static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRou
return 0;
}
static DEF_SCSI_QCMD(BusLogic_QueueCommand)
#if 0
/*

View file

@ -1319,7 +1319,7 @@ static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T Co
*/
static const char *BusLogic_DriverInfo(struct Scsi_Host *);
static int BusLogic_QueueCommand(struct scsi_cmnd *, void (*CompletionRoutine) (struct scsi_cmnd *));
static int BusLogic_QueueCommand(struct Scsi_Host *h, struct scsi_cmnd *);
static int BusLogic_BIOSDiskParameters(struct scsi_device *, struct block_device *, sector_t, int *);
static int BusLogic_ProcDirectoryInfo(struct Scsi_Host *, char *, char **, off_t, int, int);
static int BusLogic_SlaveConfigure(struct scsi_device *);

View file

@ -952,7 +952,7 @@ static void NCR5380_exit(struct Scsi_Host *instance)
* Locks: host lock taken by caller
*/
static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
static int NCR5380_queue_command_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
{
struct Scsi_Host *instance = cmd->device->host;
struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
@ -1021,6 +1021,7 @@ static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
return 0;
}
static DEF_SCSI_QCMD(NCR5380_queue_command)
/**
* NCR5380_main - NCR state machines

View file

@ -313,7 +313,7 @@ static void NCR5380_print(struct Scsi_Host *instance);
#endif
static int NCR5380_abort(Scsi_Cmnd * cmd);
static int NCR5380_bus_reset(Scsi_Cmnd * cmd);
static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *));
static int NCR5380_queue_command(struct Scsi_Host *, struct scsi_cmnd *);
static int __maybe_unused NCR5380_proc_info(struct Scsi_Host *instance,
char *buffer, char **start, off_t offset, int length, int inout);

View file

@ -693,7 +693,7 @@ static void wait_intr(void)
}
#endif
static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
static int NCR53c406a_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
{
int i;
@ -726,6 +726,8 @@ static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
return 0;
}
static DEF_SCSI_QCMD(NCR53c406a_queue)
static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt)
{
DEB(printk("NCR53c406a_reset called\n"));

View file

@ -911,7 +911,7 @@ static int inia100_build_scb(struct orc_host * host, struct orc_scb * scb, struc
* queue the command down to the controller
*/
static int inia100_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *))
static int inia100_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *))
{
struct orc_scb *scb;
struct orc_host *host; /* Point to Host adapter control block */
@ -930,6 +930,8 @@ static int inia100_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd
return 0;
}
static DEF_SCSI_QCMD(inia100_queue)
/*****************************************************************************
Function name : inia100_abort
Description : Abort a queued command.

View file

@ -248,7 +248,7 @@ static struct aac_driver_ident aac_drivers[] = {
* TODO: unify with aac_scsi_cmd().
*/
static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
static int aac_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
{
struct Scsi_Host *host = cmd->device->host;
struct aac_dev *dev = (struct aac_dev *)host->hostdata;
@ -267,6 +267,8 @@ static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd
return (aac_scsi_cmd(cmd) ? FAILED : 0);
}
static DEF_SCSI_QCMD(aac_queuecommand)
/**
* aac_info - Returns the host adapter name
* @shost: Scsi host to report on

View file

@ -9500,7 +9500,7 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
* in the 'scp' result field.
*/
static int
advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))
advansys_queuecommand_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))
{
struct Scsi_Host *shost = scp->device->host;
int asc_res, result = 0;
@ -9525,6 +9525,8 @@ advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))
return result;
}
static DEF_SCSI_QCMD(advansys_queuecommand)
static ushort __devinit AscGetEisaChipCfg(PortAddr iop_base)
{
PortAddr eisa_cfg_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) |

View file

@ -1056,7 +1056,7 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete,
* queue a command
*
*/
static int aha152x_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
static int aha152x_queue_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
{
#if 0
if(*SCpnt->cmnd == REQUEST_SENSE) {
@ -1070,6 +1070,8 @@ static int aha152x_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
return aha152x_internal_queue(SCpnt, NULL, 0, done);
}
static DEF_SCSI_QCMD(aha152x_queue)
/*
*

View file

@ -558,7 +558,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost)
};
}
static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
{
unchar ahacmd = CMD_START_SCSI;
unchar direction;
@ -718,6 +718,8 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
return 0;
}
static DEF_SCSI_QCMD(aha1542_queuecommand)
/* Initialize mailboxes */
static void setup_mailboxes(int bse, struct Scsi_Host *shpnt)
{

View file

@ -132,7 +132,7 @@ struct ccb { /* Command Control Block 5.3 */
};
static int aha1542_detect(struct scsi_host_template *);
static int aha1542_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
static int aha1542_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
static int aha1542_bus_reset(Scsi_Cmnd * SCpnt);
static int aha1542_dev_reset(Scsi_Cmnd * SCpnt);
static int aha1542_host_reset(Scsi_Cmnd * SCpnt);

View file

@ -331,7 +331,7 @@ static irqreturn_t aha1740_intr_handle(int irq, void *dev_id)
return IRQ_RETVAL(handled);
}
static int aha1740_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))
static int aha1740_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))
{
unchar direction;
unchar *cmd = (unchar *) SCpnt->cmnd;
@ -503,6 +503,8 @@ static int aha1740_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))
return 0;
}
static DEF_SCSI_QCMD(aha1740_queuecommand)
/* Query the board for its irq_level and irq_type. Nothing else matters
in enhanced mode on an EISA bus. */

View file

@ -573,7 +573,7 @@ ahd_linux_info(struct Scsi_Host *host)
* Queue an SCB to the controller.
*/
static int
ahd_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
ahd_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
{
struct ahd_softc *ahd;
struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device);
@ -588,6 +588,8 @@ ahd_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
return rtn;
}
static DEF_SCSI_QCMD(ahd_linux_queue)
static struct scsi_target **
ahd_linux_target_in_softc(struct scsi_target *starget)
{

View file

@ -528,7 +528,7 @@ ahc_linux_info(struct Scsi_Host *host)
* Queue an SCB to the controller.
*/
static int
ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
ahc_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
{
struct ahc_softc *ahc;
struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device);
@ -548,6 +548,8 @@ ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
return rtn;
}
static DEF_SCSI_QCMD(ahc_linux_queue)
static inline struct scsi_target **
ahc_linux_target_in_softc(struct scsi_target *starget)
{

View file

@ -10234,7 +10234,7 @@ static void aic7xxx_buildscb(struct aic7xxx_host *p, struct scsi_cmnd *cmd,
* Description:
* Queue a SCB to the controller.
*-F*************************************************************************/
static int aic7xxx_queue(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
static int aic7xxx_queue_lck(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
{
struct aic7xxx_host *p;
struct aic7xxx_scb *scb;
@ -10292,6 +10292,8 @@ static int aic7xxx_queue(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
return (0);
}
static DEF_SCSI_QCMD(aic7xxx_queue)
/*+F*************************************************************************
* Function:
* aic7xxx_bus_device_reset

View file

@ -85,8 +85,7 @@ static int arcmsr_abort(struct scsi_cmnd *);
static int arcmsr_bus_reset(struct scsi_cmnd *);
static int arcmsr_bios_param(struct scsi_device *sdev,
struct block_device *bdev, sector_t capacity, int *info);
static int arcmsr_queue_command(struct scsi_cmnd *cmd,
void (*done) (struct scsi_cmnd *));
static int arcmsr_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd);
static int arcmsr_probe(struct pci_dev *pdev,
const struct pci_device_id *id);
static void arcmsr_remove(struct pci_dev *pdev);
@ -2081,7 +2080,7 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb,
}
}
static int arcmsr_queue_command(struct scsi_cmnd *cmd,
static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd,
void (* done)(struct scsi_cmnd *))
{
struct Scsi_Host *host = cmd->device->host;
@ -2124,6 +2123,8 @@ static int arcmsr_queue_command(struct scsi_cmnd *cmd,
return 0;
}
static DEF_SCSI_QCMD(arcmsr_queue_command)
static bool arcmsr_get_hba_config(struct AdapterControlBlock *acb)
{
struct MessageUnit_A __iomem *reg = acb->pmuA;

View file

@ -2511,7 +2511,7 @@ acornscsi_intr(int irq, void *dev_id)
* done - function called on completion, with pointer to command descriptor
* Returns : 0, or < 0 on error.
*/
int acornscsi_queuecmd(struct scsi_cmnd *SCpnt,
static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt,
void (*done)(struct scsi_cmnd *))
{
AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata;
@ -2561,6 +2561,8 @@ int acornscsi_queuecmd(struct scsi_cmnd *SCpnt,
return 0;
}
DEF_SCSI_QCMD(acornscsi_queuecmd)
/*
* Prototype: void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, struct scsi_cmnd **SCpntp2, int result)
* Purpose : pass a result to *SCpntp1, and check if *SCpntp1 = *SCpntp2

View file

@ -2198,7 +2198,7 @@ no_command:
* Returns: 0 on success, else error.
* Notes: io_request_lock is held, interrupts are disabled.
*/
int fas216_queue_command(struct scsi_cmnd *SCpnt,
static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt,
void (*done)(struct scsi_cmnd *))
{
FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
@ -2240,6 +2240,8 @@ int fas216_queue_command(struct scsi_cmnd *SCpnt,
return result;
}
DEF_SCSI_QCMD(fas216_queue_command)
/**
* fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command
* @SCpnt: Command to wake
@ -2263,7 +2265,7 @@ static void fas216_internal_done(struct scsi_cmnd *SCpnt)
* Returns: scsi result code.
* Notes: io_request_lock is held, interrupts are disabled.
*/
int fas216_noqueue_command(struct scsi_cmnd *SCpnt,
static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt,
void (*done)(struct scsi_cmnd *))
{
FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
@ -2277,7 +2279,7 @@ int fas216_noqueue_command(struct scsi_cmnd *SCpnt,
BUG_ON(info->scsi.irq != NO_IRQ);
info->internal_done = 0;
fas216_queue_command(SCpnt, fas216_internal_done);
fas216_queue_command_lck(SCpnt, fas216_internal_done);
/*
* This wastes time, since we can't return until the command is
@ -2310,6 +2312,8 @@ int fas216_noqueue_command(struct scsi_cmnd *SCpnt,
return 0;
}
DEF_SCSI_QCMD(fas216_noqueue_command)
/*
* Error handler timeout function. Indicate that we timed out,
* and wake up any error handler process so it can continue.

View file

@ -331,23 +331,21 @@ extern int fas216_init (struct Scsi_Host *instance);
*/
extern int fas216_add (struct Scsi_Host *instance, struct device *dev);
/* Function: int fas216_queue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
/* Function: int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt)
* Purpose : queue a command for adapter to process.
* Params : SCpnt - Command to queue
* done - done function to call once command is complete
* Params : h - host adapter
* : SCpnt - Command to queue
* Returns : 0 - success, else error
*/
extern int fas216_queue_command(struct scsi_cmnd *,
void (*done)(struct scsi_cmnd *));
extern int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt);
/* Function: int fas216_noqueue_command(istruct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
/* Function: int fas216_noqueue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt)
* Purpose : queue a command for adapter to process, and process it to completion.
* Params : SCpnt - Command to queue
* done - done function to call once command is complete
* Params : h - host adapter
* : SCpnt - Command to queue
* Returns : 0 - success, else error
*/
extern int fas216_noqueue_command(struct scsi_cmnd *,
void (*done)(struct scsi_cmnd *));
extern int fas216_noqueue_command(struct Scsi_Host *, struct scsi_cmnd *);
/* Function: irqreturn_t fas216_intr (FAS216_Info *info)
* Purpose : handle interrupts from the interface to progress a command

View file

@ -910,7 +910,7 @@ static int __init NCR5380_init(struct Scsi_Host *instance, int flags)
*
*/
static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
static int NCR5380_queue_command_lck(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
{
SETUP_HOSTDATA(cmd->device->host);
Scsi_Cmnd *tmp;
@ -1022,6 +1022,8 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
return 0;
}
static DEF_SCSI_QCMD(NCR5380_queue_command)
/*
* Function : NCR5380_main (void)
*

View file

@ -572,23 +572,6 @@ static void falcon_get_lock(void)
}
/* This is the wrapper function for NCR5380_queue_command(). It just
* tries to get the lock on the ST-DMA (see above) and then calls the
* original function.
*/
#if 0
int atari_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
{
/* falcon_get_lock();
* ++guenther: moved to NCR5380_queue_command() to prevent
* race condition, see there for an explanation.
*/
return NCR5380_queue_command(cmd, done);
}
#endif
int __init atari_scsi_detect(struct scsi_host_template *host)
{
static int called = 0;

View file

@ -605,7 +605,7 @@ handled:
*
* Queue a command to the ATP queue. Called with the host lock held.
*/
static int atp870u_queuecommand(struct scsi_cmnd * req_p,
static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p,
void (*done) (struct scsi_cmnd *))
{
unsigned char c;
@ -694,6 +694,8 @@ static int atp870u_queuecommand(struct scsi_cmnd * req_p,
return 0;
}
static DEF_SCSI_QCMD(atp870u_queuecommand)
/**
* send_s870 - send a command to the controller
* @host: host

View file

@ -29,13 +29,13 @@ struct bfa_s;
typedef void (*bfa_isr_func_t) (struct bfa_s *bfa, struct bfi_msg_s *m);
typedef void (*bfa_cb_cbfn_t) (void *cbarg, bfa_boolean_t complete);
/**
/*
* Interrupt message handlers
*/
void bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m);
void bfa_isr_bind(enum bfi_mclass mc, bfa_isr_func_t isr_func);
/**
/*
* Request and response queue related defines
*/
#define BFA_REQQ_NELEMS_MIN (4)
@ -58,9 +58,9 @@ void bfa_isr_bind(enum bfi_mclass mc, bfa_isr_func_t isr_func);
#define bfa_reqq_produce(__bfa, __reqq) do { \
(__bfa)->iocfc.req_cq_pi[__reqq]++; \
(__bfa)->iocfc.req_cq_pi[__reqq] &= \
((__bfa)->iocfc.cfg.drvcfg.num_reqq_elems - 1); \
bfa_reg_write((__bfa)->iocfc.bfa_regs.cpe_q_pi[__reqq], \
(__bfa)->iocfc.req_cq_pi[__reqq]); \
((__bfa)->iocfc.cfg.drvcfg.num_reqq_elems - 1); \
writel((__bfa)->iocfc.req_cq_pi[__reqq], \
(__bfa)->iocfc.bfa_regs.cpe_q_pi[__reqq]); \
mmiowb(); \
} while (0)
@ -76,7 +76,7 @@ void bfa_isr_bind(enum bfi_mclass mc, bfa_isr_func_t isr_func);
(__index) &= ((__size) - 1); \
} while (0)
/**
/*
* Queue element to wait for room in request queue. FIFO order is
* maintained when fullfilling requests.
*/
@ -86,7 +86,7 @@ struct bfa_reqq_wait_s {
void *cbarg;
};
/**
/*
* Circular queue usage assignments
*/
enum {
@ -113,7 +113,7 @@ bfa_reqq_winit(struct bfa_reqq_wait_s *wqe, void (*qresume) (void *cbarg),
#define bfa_reqq(__bfa, __reqq) (&(__bfa)->reqq_waitq[__reqq])
/**
/*
* static inline void
* bfa_reqq_wait(struct bfa_s *bfa, int reqq, struct bfa_reqq_wait_s *wqe)
*/
@ -130,7 +130,7 @@ bfa_reqq_winit(struct bfa_reqq_wait_s *wqe, void (*qresume) (void *cbarg),
#define bfa_reqq_wcancel(__wqe) list_del(&(__wqe)->qe)
/**
/*
* Generic BFA callback element.
*/
struct bfa_cb_qe_s {
@ -163,7 +163,7 @@ struct bfa_cb_qe_s {
} while (0)
/**
/*
* PCI devices supported by the current BFA
*/
struct bfa_pciid_s {
@ -173,7 +173,7 @@ struct bfa_pciid_s {
extern char bfa_version[];
/**
/*
* BFA memory resources
*/
enum bfa_mem_type {
@ -202,19 +202,19 @@ struct bfa_meminfo_s {
((_m)->meminfo[BFA_MEM_TYPE_DMA - 1].dma_curp)
struct bfa_iocfc_regs_s {
bfa_os_addr_t intr_status;
bfa_os_addr_t intr_mask;
bfa_os_addr_t cpe_q_pi[BFI_IOC_MAX_CQS];
bfa_os_addr_t cpe_q_ci[BFI_IOC_MAX_CQS];
bfa_os_addr_t cpe_q_depth[BFI_IOC_MAX_CQS];
bfa_os_addr_t cpe_q_ctrl[BFI_IOC_MAX_CQS];
bfa_os_addr_t rme_q_ci[BFI_IOC_MAX_CQS];
bfa_os_addr_t rme_q_pi[BFI_IOC_MAX_CQS];
bfa_os_addr_t rme_q_depth[BFI_IOC_MAX_CQS];
bfa_os_addr_t rme_q_ctrl[BFI_IOC_MAX_CQS];
void __iomem *intr_status;
void __iomem *intr_mask;
void __iomem *cpe_q_pi[BFI_IOC_MAX_CQS];
void __iomem *cpe_q_ci[BFI_IOC_MAX_CQS];
void __iomem *cpe_q_depth[BFI_IOC_MAX_CQS];
void __iomem *cpe_q_ctrl[BFI_IOC_MAX_CQS];
void __iomem *rme_q_ci[BFI_IOC_MAX_CQS];
void __iomem *rme_q_pi[BFI_IOC_MAX_CQS];
void __iomem *rme_q_depth[BFI_IOC_MAX_CQS];
void __iomem *rme_q_ctrl[BFI_IOC_MAX_CQS];
};
/**
/*
* MSIX vector handlers
*/
#define BFA_MSIX_MAX_VECTORS 22
@ -224,7 +224,7 @@ struct bfa_msix_s {
bfa_msix_handler_t handler[BFA_MSIX_MAX_VECTORS];
};
/**
/*
* Chip specific interfaces
*/
struct bfa_hwif_s {
@ -343,7 +343,7 @@ int bfa_iocfc_get_pbc_vports(struct bfa_s *bfa,
struct bfi_pbc_vport_s *pbc_vport);
/**
/*
*----------------------------------------------------------------------
* BFA public interfaces
*----------------------------------------------------------------------

View file

@ -37,18 +37,18 @@ bfad_int_to_lun(u32 luno)
} lun;
lun.bfa_lun = 0;
lun.scsi_lun[0] = bfa_os_htons(luno);
lun.scsi_lun[0] = cpu_to_be16(luno);
return lun.bfa_lun;
}
/**
/*
* Get LUN for the I/O request
*/
#define bfa_cb_ioim_get_lun(__dio) \
bfad_int_to_lun(((struct scsi_cmnd *)__dio)->device->lun)
/**
/*
* Get CDB for the I/O request
*/
static inline u8 *
@ -59,7 +59,7 @@ bfa_cb_ioim_get_cdb(struct bfad_ioim_s *dio)
return (u8 *) cmnd->cmnd;
}
/**
/*
* Get I/O direction (read/write) for the I/O request
*/
static inline enum fcp_iodir
@ -77,7 +77,7 @@ bfa_cb_ioim_get_iodir(struct bfad_ioim_s *dio)
return FCP_IODIR_NONE;
}
/**
/*
* Get IO size in bytes for the I/O request
*/
static inline u32
@ -88,7 +88,7 @@ bfa_cb_ioim_get_size(struct bfad_ioim_s *dio)
return scsi_bufflen(cmnd);
}
/**
/*
* Get timeout for the I/O request
*/
static inline u8
@ -104,7 +104,7 @@ bfa_cb_ioim_get_timeout(struct bfad_ioim_s *dio)
return 0;
}
/**
/*
* Get Command Reference Number for the I/O request. 0 if none.
*/
static inline u8
@ -113,7 +113,7 @@ bfa_cb_ioim_get_crn(struct bfad_ioim_s *dio)
return 0;
}
/**
/*
* Get SAM-3 priority for the I/O request. 0 is default.
*/
static inline u8
@ -122,7 +122,7 @@ bfa_cb_ioim_get_priority(struct bfad_ioim_s *dio)
return 0;
}
/**
/*
* Get task attributes for the I/O request. Default is FCP_TASK_ATTR_SIMPLE(0).
*/
static inline u8
@ -148,7 +148,7 @@ bfa_cb_ioim_get_taskattr(struct bfad_ioim_s *dio)
return task_attr;
}
/**
/*
* Get CDB length in bytes for the I/O request. Default is FCP_CMND_CDB_LEN(16).
*/
static inline u8
@ -159,7 +159,7 @@ bfa_cb_ioim_get_cdblen(struct bfad_ioim_s *dio)
return cmnd->cmd_len;
}
/**
/*
* Assign queue to be used for the I/O request. This value depends on whether
* the driver wants to use the queues via any specific algorithm. Currently,
* this is not supported.

View file

@ -21,11 +21,11 @@
BFA_TRC_FILE(HAL, CORE);
/**
/*
* BFA IOC FC related definitions
*/
/**
/*
* IOC local definitions
*/
#define BFA_IOCFC_TOV 5000 /* msecs */
@ -54,7 +54,7 @@ enum {
#define DEF_CFG_NUM_SBOOT_TGTS 16
#define DEF_CFG_NUM_SBOOT_LUNS 16
/**
/*
* forward declaration for IOC FC functions
*/
static void bfa_iocfc_enable_cbfn(void *bfa_arg, enum bfa_status status);
@ -63,7 +63,7 @@ static void bfa_iocfc_hbfail_cbfn(void *bfa_arg);
static void bfa_iocfc_reset_cbfn(void *bfa_arg);
static struct bfa_ioc_cbfn_s bfa_iocfc_cbfn;
/**
/*
* BFA Interrupt handling functions
*/
static void
@ -86,7 +86,7 @@ bfa_reqq_resume(struct bfa_s *bfa, int qid)
waitq = bfa_reqq(bfa, qid);
list_for_each_safe(qe, qen, waitq) {
/**
/*
* Callback only as long as there is room in request queue
*/
if (bfa_reqq_full(bfa, qid))
@ -104,7 +104,7 @@ bfa_msix_all(struct bfa_s *bfa, int vec)
bfa_intx(bfa);
}
/**
/*
* hal_intr_api
*/
bfa_boolean_t
@ -113,15 +113,15 @@ bfa_intx(struct bfa_s *bfa)
u32 intr, qintr;
int queue;
intr = bfa_reg_read(bfa->iocfc.bfa_regs.intr_status);
intr = readl(bfa->iocfc.bfa_regs.intr_status);
if (!intr)
return BFA_FALSE;
/**
/*
* RME completion queue interrupt
*/
qintr = intr & __HFN_INT_RME_MASK;
bfa_reg_write(bfa->iocfc.bfa_regs.intr_status, qintr);
writel(qintr, bfa->iocfc.bfa_regs.intr_status);
for (queue = 0; queue < BFI_IOC_MAX_CQS_ASIC; queue++) {
if (intr & (__HFN_INT_RME_Q0 << queue))
@ -131,11 +131,11 @@ bfa_intx(struct bfa_s *bfa)
if (!intr)
return BFA_TRUE;
/**
/*
* CPE completion queue interrupt
*/
qintr = intr & __HFN_INT_CPE_MASK;
bfa_reg_write(bfa->iocfc.bfa_regs.intr_status, qintr);
writel(qintr, bfa->iocfc.bfa_regs.intr_status);
for (queue = 0; queue < BFI_IOC_MAX_CQS_ASIC; queue++) {
if (intr & (__HFN_INT_CPE_Q0 << queue))
@ -153,13 +153,13 @@ bfa_intx(struct bfa_s *bfa)
void
bfa_intx_enable(struct bfa_s *bfa)
{
bfa_reg_write(bfa->iocfc.bfa_regs.intr_mask, bfa->iocfc.intr_mask);
writel(bfa->iocfc.intr_mask, bfa->iocfc.bfa_regs.intr_mask);
}
void
bfa_intx_disable(struct bfa_s *bfa)
{
bfa_reg_write(bfa->iocfc.bfa_regs.intr_mask, -1L);
writel(-1L, bfa->iocfc.bfa_regs.intr_mask);
}
void
@ -188,8 +188,8 @@ bfa_isr_enable(struct bfa_s *bfa)
__HFN_INT_RME_Q6 | __HFN_INT_RME_Q7 |
__HFN_INT_MBOX_LPU1);
bfa_reg_write(bfa->iocfc.bfa_regs.intr_status, intr_unmask);
bfa_reg_write(bfa->iocfc.bfa_regs.intr_mask, ~intr_unmask);
writel(intr_unmask, bfa->iocfc.bfa_regs.intr_status);
writel(~intr_unmask, bfa->iocfc.bfa_regs.intr_mask);
bfa->iocfc.intr_mask = ~intr_unmask;
bfa_isr_mode_set(bfa, bfa->msix.nvecs != 0);
}
@ -198,7 +198,7 @@ void
bfa_isr_disable(struct bfa_s *bfa)
{
bfa_isr_mode_set(bfa, BFA_FALSE);
bfa_reg_write(bfa->iocfc.bfa_regs.intr_mask, -1L);
writel(-1L, bfa->iocfc.bfa_regs.intr_mask);
bfa_msix_uninstall(bfa);
}
@ -211,7 +211,7 @@ bfa_msix_reqq(struct bfa_s *bfa, int qid)
bfa->iocfc.hwif.hw_reqq_ack(bfa, qid);
/**
/*
* Resume any pending requests in the corresponding reqq.
*/
waitq = bfa_reqq(bfa, qid);
@ -259,14 +259,14 @@ bfa_msix_rspq(struct bfa_s *bfa, int qid)
}
}
/**
/*
* update CI
*/
bfa_rspq_ci(bfa, qid) = pi;
bfa_reg_write(bfa->iocfc.bfa_regs.rme_q_ci[qid], pi);
writel(pi, bfa->iocfc.bfa_regs.rme_q_ci[qid]);
mmiowb();
/**
/*
* Resume any pending requests in the corresponding reqq.
*/
waitq = bfa_reqq(bfa, qid);
@ -279,7 +279,7 @@ bfa_msix_lpu_err(struct bfa_s *bfa, int vec)
{
u32 intr, curr_value;
intr = bfa_reg_read(bfa->iocfc.bfa_regs.intr_status);
intr = readl(bfa->iocfc.bfa_regs.intr_status);
if (intr & (__HFN_INT_MBOX_LPU0 | __HFN_INT_MBOX_LPU1))
bfa_msix_lpu(bfa);
@ -289,30 +289,30 @@ bfa_msix_lpu_err(struct bfa_s *bfa, int vec)
if (intr) {
if (intr & __HFN_INT_LL_HALT) {
/**
/*
* If LL_HALT bit is set then FW Init Halt LL Port
* Register needs to be cleared as well so Interrupt
* Status Register will be cleared.
*/
curr_value = bfa_reg_read(bfa->ioc.ioc_regs.ll_halt);
curr_value = readl(bfa->ioc.ioc_regs.ll_halt);
curr_value &= ~__FW_INIT_HALT_P;
bfa_reg_write(bfa->ioc.ioc_regs.ll_halt, curr_value);
writel(curr_value, bfa->ioc.ioc_regs.ll_halt);
}
if (intr & __HFN_INT_ERR_PSS) {
/**
/*
* ERR_PSS bit needs to be cleared as well in case
* interrups are shared so driver's interrupt handler is
* still called eventhough it is already masked out.
*/
curr_value = bfa_reg_read(
curr_value = readl(
bfa->ioc.ioc_regs.pss_err_status_reg);
curr_value &= __PSS_ERR_STATUS_SET;
bfa_reg_write(bfa->ioc.ioc_regs.pss_err_status_reg,
curr_value);
writel(curr_value,
bfa->ioc.ioc_regs.pss_err_status_reg);
}
bfa_reg_write(bfa->iocfc.bfa_regs.intr_status, intr);
writel(intr, bfa->iocfc.bfa_regs.intr_status);
bfa_msix_errint(bfa, intr);
}
}
@ -323,11 +323,11 @@ bfa_isr_bind(enum bfi_mclass mc, bfa_isr_func_t isr_func)
bfa_isrs[mc] = isr_func;
}
/**
/*
* BFA IOC FC related functions
*/
/**
/*
* hal_ioc_pvt BFA IOC private functions
*/
@ -366,7 +366,7 @@ bfa_iocfc_fw_cfg_sz(struct bfa_iocfc_cfg_s *cfg, u32 *dm_len)
BFA_CACHELINE_SZ);
}
/**
/*
* Use the Mailbox interface to send BFI_IOCFC_H2I_CFG_REQ
*/
static void
@ -384,14 +384,14 @@ bfa_iocfc_send_cfg(void *bfa_arg)
bfa_iocfc_reset_queues(bfa);
/**
/*
* initialize IOC configuration info
*/
cfg_info->endian_sig = BFI_IOC_ENDIAN_SIG;
cfg_info->num_cqs = cfg->fwcfg.num_cqs;
bfa_dma_be_addr_set(cfg_info->cfgrsp_addr, iocfc->cfgrsp_dma.pa);
/**
/*
* dma map REQ and RSP circular queues and shadow pointers
*/
for (i = 0; i < cfg->fwcfg.num_cqs; i++) {
@ -400,17 +400,17 @@ bfa_iocfc_send_cfg(void *bfa_arg)
bfa_dma_be_addr_set(cfg_info->req_shadow_ci[i],
iocfc->req_cq_shadow_ci[i].pa);
cfg_info->req_cq_elems[i] =
bfa_os_htons(cfg->drvcfg.num_reqq_elems);
cpu_to_be16(cfg->drvcfg.num_reqq_elems);
bfa_dma_be_addr_set(cfg_info->rsp_cq_ba[i],
iocfc->rsp_cq_ba[i].pa);
bfa_dma_be_addr_set(cfg_info->rsp_shadow_pi[i],
iocfc->rsp_cq_shadow_pi[i].pa);
cfg_info->rsp_cq_elems[i] =
bfa_os_htons(cfg->drvcfg.num_rspq_elems);
cpu_to_be16(cfg->drvcfg.num_rspq_elems);
}
/**
/*
* Enable interrupt coalescing if it is driver init path
* and not ioc disable/enable path.
*/
@ -419,7 +419,7 @@ bfa_iocfc_send_cfg(void *bfa_arg)
iocfc->cfgdone = BFA_FALSE;
/**
/*
* dma map IOC configuration itself
*/
bfi_h2i_set(cfg_req.mh, BFI_MC_IOCFC, BFI_IOCFC_H2I_CFG_REQ,
@ -440,9 +440,9 @@ bfa_iocfc_init_mem(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
iocfc->bfa = bfa;
iocfc->action = BFA_IOCFC_ACT_NONE;
bfa_os_assign(iocfc->cfg, *cfg);
iocfc->cfg = *cfg;
/**
/*
* Initialize chip specific handlers.
*/
if (bfa_asic_id_ct(bfa_ioc_devid(&bfa->ioc))) {
@ -503,13 +503,13 @@ bfa_iocfc_mem_claim(struct bfa_s *bfa, struct bfa_iocfc_cfg_s *cfg,
for (i = 0; i < cfg->fwcfg.num_cqs; i++) {
iocfc->req_cq_ba[i].kva = dm_kva;
iocfc->req_cq_ba[i].pa = dm_pa;
bfa_os_memset(dm_kva, 0, per_reqq_sz);
memset(dm_kva, 0, per_reqq_sz);
dm_kva += per_reqq_sz;
dm_pa += per_reqq_sz;
iocfc->rsp_cq_ba[i].kva = dm_kva;
iocfc->rsp_cq_ba[i].pa = dm_pa;
bfa_os_memset(dm_kva, 0, per_rspq_sz);
memset(dm_kva, 0, per_rspq_sz);
dm_kva += per_rspq_sz;
dm_pa += per_rspq_sz;
}
@ -559,7 +559,7 @@ bfa_iocfc_mem_claim(struct bfa_s *bfa, struct bfa_iocfc_cfg_s *cfg,
}
}
/**
/*
* Start BFA submodules.
*/
static void
@ -573,7 +573,7 @@ bfa_iocfc_start_submod(struct bfa_s *bfa)
hal_mods[i]->start(bfa);
}
/**
/*
* Disable BFA submodules.
*/
static void
@ -623,7 +623,7 @@ bfa_iocfc_disable_cb(void *bfa_arg, bfa_boolean_t compl)
complete(&bfad->disable_comp);
}
/**
/*
* Update BFA configuration from firmware configuration.
*/
static void
@ -634,15 +634,15 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa)
struct bfa_iocfc_fwcfg_s *fwcfg = &cfgrsp->fwcfg;
fwcfg->num_cqs = fwcfg->num_cqs;
fwcfg->num_ioim_reqs = bfa_os_ntohs(fwcfg->num_ioim_reqs);
fwcfg->num_tskim_reqs = bfa_os_ntohs(fwcfg->num_tskim_reqs);
fwcfg->num_fcxp_reqs = bfa_os_ntohs(fwcfg->num_fcxp_reqs);
fwcfg->num_uf_bufs = bfa_os_ntohs(fwcfg->num_uf_bufs);
fwcfg->num_rports = bfa_os_ntohs(fwcfg->num_rports);
fwcfg->num_ioim_reqs = be16_to_cpu(fwcfg->num_ioim_reqs);
fwcfg->num_tskim_reqs = be16_to_cpu(fwcfg->num_tskim_reqs);
fwcfg->num_fcxp_reqs = be16_to_cpu(fwcfg->num_fcxp_reqs);
fwcfg->num_uf_bufs = be16_to_cpu(fwcfg->num_uf_bufs);
fwcfg->num_rports = be16_to_cpu(fwcfg->num_rports);
iocfc->cfgdone = BFA_TRUE;
/**
/*
* Configuration is complete - initialize/start submodules
*/
bfa_fcport_init(bfa);
@ -665,7 +665,7 @@ bfa_iocfc_reset_queues(struct bfa_s *bfa)
}
}
/**
/*
* IOC enable request is complete
*/
static void
@ -684,7 +684,7 @@ bfa_iocfc_enable_cbfn(void *bfa_arg, enum bfa_status status)
bfa_iocfc_send_cfg(bfa);
}
/**
/*
* IOC disable request is complete
*/
static void
@ -705,7 +705,7 @@ bfa_iocfc_disable_cbfn(void *bfa_arg)
}
}
/**
/*
* Notify sub-modules of hardware failure.
*/
static void
@ -723,7 +723,7 @@ bfa_iocfc_hbfail_cbfn(void *bfa_arg)
bfa);
}
/**
/*
* Actions on chip-reset completion.
*/
static void
@ -735,11 +735,11 @@ bfa_iocfc_reset_cbfn(void *bfa_arg)
bfa_isr_enable(bfa);
}
/**
/*
* hal_ioc_public
*/
/**
/*
* Query IOC memory requirement information.
*/
void
@ -754,7 +754,7 @@ bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len,
*km_len += bfa_ioc_debug_trcsz(bfa_auto_recover);
}
/**
/*
* Query IOC memory requirement information.
*/
void
@ -772,7 +772,7 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
ioc->trcmod = bfa->trcmod;
bfa_ioc_attach(&bfa->ioc, bfa, &bfa_iocfc_cbfn, &bfa->timer_mod);
/**
/*
* Set FC mode for BFA_PCI_DEVICE_ID_CT_FC.
*/
if (pcidev->device_id == BFA_PCI_DEVICE_ID_CT_FC)
@ -790,7 +790,7 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
INIT_LIST_HEAD(&bfa->reqq_waitq[i]);
}
/**
/*
* Query IOC memory requirement information.
*/
void
@ -799,7 +799,7 @@ bfa_iocfc_detach(struct bfa_s *bfa)
bfa_ioc_detach(&bfa->ioc);
}
/**
/*
* Query IOC memory requirement information.
*/
void
@ -809,7 +809,7 @@ bfa_iocfc_init(struct bfa_s *bfa)
bfa_ioc_enable(&bfa->ioc);
}
/**
/*
* IOC start called from bfa_start(). Called to start IOC operations
* at driver instantiation for this instance.
*/
@ -820,7 +820,7 @@ bfa_iocfc_start(struct bfa_s *bfa)
bfa_iocfc_start_submod(bfa);
}
/**
/*
* IOC stop called from bfa_stop(). Called only when driver is unloaded
* for this instance.
*/
@ -876,12 +876,12 @@ bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr)
attr->intr_attr.coalesce = iocfc->cfginfo->intr_attr.coalesce;
attr->intr_attr.delay = iocfc->cfginfo->intr_attr.delay ?
bfa_os_ntohs(iocfc->cfginfo->intr_attr.delay) :
bfa_os_ntohs(iocfc->cfgrsp->intr_attr.delay);
be16_to_cpu(iocfc->cfginfo->intr_attr.delay) :
be16_to_cpu(iocfc->cfgrsp->intr_attr.delay);
attr->intr_attr.latency = iocfc->cfginfo->intr_attr.latency ?
bfa_os_ntohs(iocfc->cfginfo->intr_attr.latency) :
bfa_os_ntohs(iocfc->cfgrsp->intr_attr.latency);
be16_to_cpu(iocfc->cfginfo->intr_attr.latency) :
be16_to_cpu(iocfc->cfgrsp->intr_attr.latency);
attr->config = iocfc->cfg;
}
@ -893,8 +893,8 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr)
struct bfi_iocfc_set_intr_req_s *m;
iocfc->cfginfo->intr_attr.coalesce = attr->coalesce;
iocfc->cfginfo->intr_attr.delay = bfa_os_htons(attr->delay);
iocfc->cfginfo->intr_attr.latency = bfa_os_htons(attr->latency);
iocfc->cfginfo->intr_attr.delay = cpu_to_be16(attr->delay);
iocfc->cfginfo->intr_attr.latency = cpu_to_be16(attr->latency);
if (!bfa_iocfc_is_operational(bfa))
return BFA_STATUS_OK;
@ -924,7 +924,7 @@ bfa_iocfc_set_snsbase(struct bfa_s *bfa, u64 snsbase_pa)
iocfc->cfginfo->sense_buf_len = (BFI_IOIM_SNSLEN - 1);
bfa_dma_be_addr_set(iocfc->cfginfo->ioim_snsbase, snsbase_pa);
}
/**
/*
* Enable IOC after it is disabled.
*/
void
@ -953,7 +953,7 @@ bfa_iocfc_is_operational(struct bfa_s *bfa)
return bfa_ioc_is_operational(&bfa->ioc) && bfa->iocfc.cfgdone;
}
/**
/*
* Return boot target port wwns -- read from boot information in flash.
*/
void
@ -998,11 +998,11 @@ bfa_iocfc_get_pbc_vports(struct bfa_s *bfa, struct bfi_pbc_vport_s *pbc_vport)
return cfgrsp->pbc_cfg.nvports;
}
/**
/*
* hal_api
*/
/**
/*
* Use this function query the memory requirement of the BFA library.
* This function needs to be called before bfa_attach() to get the
* memory required of the BFA layer for a given driver configuration.
@ -1038,7 +1038,7 @@ bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo)
bfa_assert((cfg != NULL) && (meminfo != NULL));
bfa_os_memset((void *)meminfo, 0, sizeof(struct bfa_meminfo_s));
memset((void *)meminfo, 0, sizeof(struct bfa_meminfo_s));
meminfo->meminfo[BFA_MEM_TYPE_KVA - 1].mem_type =
BFA_MEM_TYPE_KVA;
meminfo->meminfo[BFA_MEM_TYPE_DMA - 1].mem_type =
@ -1055,7 +1055,7 @@ bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo)
meminfo->meminfo[BFA_MEM_TYPE_DMA - 1].mem_len = dm_len;
}
/**
/*
* Use this function to do attach the driver instance with the BFA
* library. This function will not trigger any HW initialization
* process (which will be done in bfa_init() call)
@ -1092,7 +1092,7 @@ bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
bfa_assert((cfg != NULL) && (meminfo != NULL));
/**
/*
* initialize all memory pointers for iterative allocation
*/
for (i = 0; i < BFA_MEM_TYPE_MAX; i++) {
@ -1109,7 +1109,7 @@ bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
bfa_com_port_attach(bfa, meminfo);
}
/**
/*
* Use this function to delete a BFA IOC. IOC should be stopped (by
* calling bfa_stop()) before this function call.
*
@ -1146,7 +1146,7 @@ bfa_init_plog(struct bfa_s *bfa, struct bfa_plog_s *plog)
bfa->plog = plog;
}
/**
/*
* Initialize IOC.
*
* This function will return immediately, when the IOC initialization is
@ -1169,7 +1169,7 @@ bfa_init(struct bfa_s *bfa)
bfa_iocfc_init(bfa);
}
/**
/*
* Use this function initiate the IOC configuration setup. This function
* will return immediately.
*
@ -1183,7 +1183,7 @@ bfa_start(struct bfa_s *bfa)
bfa_iocfc_start(bfa);
}
/**
/*
* Use this function quiese the IOC. This function will return immediately,
* when the IOC is actually stopped, the bfad->comp will be set.
*
@ -1243,7 +1243,7 @@ bfa_attach_fcs(struct bfa_s *bfa)
bfa->fcs = BFA_TRUE;
}
/**
/*
* Periodic timer heart beat from driver
*/
void
@ -1252,7 +1252,7 @@ bfa_timer_tick(struct bfa_s *bfa)
bfa_timer_beat(&bfa->timer_mod);
}
/**
/*
* Return the list of PCI vendor/device id lists supported by this
* BFA instance.
*/
@ -1270,7 +1270,7 @@ bfa_get_pciids(struct bfa_pciid_s **pciids, int *npciids)
*pciids = __pciids;
}
/**
/*
* Use this function query the default struct bfa_iocfc_cfg_s value (compiled
* into BFA layer). The OS driver can then turn back and overwrite entries that
* have been configured by the user.
@ -1328,7 +1328,7 @@ bfa_get_attr(struct bfa_s *bfa, struct bfa_ioc_attr_s *ioc_attr)
bfa_ioc_get_attr(&bfa->ioc, ioc_attr);
}
/**
/*
* Retrieve firmware trace information on IOC failure.
*/
bfa_status_t
@ -1337,7 +1337,7 @@ bfa_debug_fwsave(struct bfa_s *bfa, void *trcdata, int *trclen)
return bfa_ioc_debug_fwsave(&bfa->ioc, trcdata, trclen);
}
/**
/*
* Clear the saved firmware trace information of an IOC.
*/
void
@ -1346,7 +1346,7 @@ bfa_debug_fwsave_clear(struct bfa_s *bfa)
bfa_ioc_debug_fwsave_clear(&bfa->ioc);
}
/**
/*
* Fetch firmware trace data.
*
* @param[in] bfa BFA instance
@ -1362,7 +1362,7 @@ bfa_debug_fwtrc(struct bfa_s *bfa, void *trcdata, int *trclen)
return bfa_ioc_debug_fwtrc(&bfa->ioc, trcdata, trclen);
}
/**
/*
* Dump firmware memory.
*
* @param[in] bfa BFA instance
@ -1378,7 +1378,7 @@ bfa_debug_fwcore(struct bfa_s *bfa, void *buf, u32 *offset, int *buflen)
{
return bfa_ioc_debug_fwcore(&bfa->ioc, buf, offset, buflen);
}
/**
/*
* Reset hw semaphore & usage cnt regs and initialize.
*/
void
@ -1388,7 +1388,7 @@ bfa_chip_reset(struct bfa_s *bfa)
bfa_ioc_pll_init(&bfa->ioc);
}
/**
/*
* Fetch firmware statistics data.
*
* @param[in] bfa BFA instance

View file

@ -15,7 +15,7 @@
* General Public License for more details.
*/
/**
/*
* bfa_cs.h BFA common services
*/
@ -24,7 +24,7 @@
#include "bfa_os_inc.h"
/**
/*
* BFA TRC
*/
@ -73,7 +73,7 @@ enum {
#define BFA_TRC_MOD_SH 10
#define BFA_TRC_MOD(__mod) ((BFA_TRC_ ## __mod) << BFA_TRC_MOD_SH)
/**
/*
* Define a new tracing file (module). Module should match one defined above.
*/
#define BFA_TRC_FILE(__mod, __submod) \
@ -155,7 +155,7 @@ __bfa_trc32(struct bfa_trc_mod_s *trcm, int fileno, int line, u32 data)
#define bfa_trc_fp(_trcp, _data)
#endif
/**
/*
* @ BFA LOG interfaces
*/
#define bfa_assert(__cond) do { \
@ -249,13 +249,13 @@ bfa_q_is_on_q_func(struct list_head *q, struct list_head *qe)
#define bfa_q_is_on_q(_q, _qe) \
bfa_q_is_on_q_func(_q, (struct list_head *)(_qe))
/**
/*
* @ BFA state machine interfaces
*/
typedef void (*bfa_sm_t)(void *sm, int event);
/**
/*
* oc - object class eg. bfa_ioc
* st - state, eg. reset
* otype - object type, eg. struct bfa_ioc_s
@ -269,7 +269,7 @@ typedef void (*bfa_sm_t)(void *sm, int event);
#define bfa_sm_get_state(_sm) ((_sm)->sm)
#define bfa_sm_cmp_state(_sm, _state) ((_sm)->sm == (bfa_sm_t)(_state))
/**
/*
* For converting from state machine function to state encoding.
*/
struct bfa_sm_table_s {
@ -279,12 +279,12 @@ struct bfa_sm_table_s {
};
#define BFA_SM(_sm) ((bfa_sm_t)(_sm))
/**
/*
* State machine with entry actions.
*/
typedef void (*bfa_fsm_t)(void *fsm, int event);
/**
/*
* oc - object class eg. bfa_ioc
* st - state, eg. reset
* otype - object type, eg. struct bfa_ioc_s
@ -314,7 +314,7 @@ bfa_sm_to_state(struct bfa_sm_table_s *smt, bfa_sm_t sm)
return smt[i].state;
}
/**
/*
* @ Generic wait counter.
*/
@ -340,7 +340,7 @@ bfa_wc_down(struct bfa_wc_s *wc)
wc->wc_resume(wc->wc_cbarg);
}
/**
/*
* Initialize a waiting counter.
*/
static inline void
@ -352,7 +352,7 @@ bfa_wc_init(struct bfa_wc_s *wc, bfa_wc_resume_t wc_resume, void *wc_cbarg)
bfa_wc_up(wc);
}
/**
/*
* Wait for counter to reach zero
*/
static inline void

View file

@ -24,7 +24,7 @@
#define BFA_MFG_SERIALNUM_SIZE 11
#define STRSZ(_n) (((_n) + 4) & ~3)
/**
/*
* Manufacturing card type
*/
enum {
@ -45,7 +45,7 @@ enum {
#pragma pack(1)
/**
/*
* Check if Mezz card
*/
#define bfa_mfg_is_mezz(type) (( \
@ -55,7 +55,7 @@ enum {
(type) == BFA_MFG_TYPE_LIGHTNING_P0 || \
(type) == BFA_MFG_TYPE_LIGHTNING))
/**
/*
* Check if the card having old wwn/mac handling
*/
#define bfa_mfg_is_old_wwn_mac_model(type) (( \
@ -78,12 +78,12 @@ do { \
(m)[2] = t & 0xFF; \
} while (0)
/**
/*
* VPD data length
*/
#define BFA_MFG_VPD_LEN 512
/**
/*
* VPD vendor tag
*/
enum {
@ -97,7 +97,7 @@ enum {
BFA_MFG_VPD_PCI_BRCD = 0xf8, /* PCI VPD Brocade */
};
/**
/*
* All numerical fields are in big-endian format.
*/
struct bfa_mfg_vpd_s {
@ -112,7 +112,7 @@ struct bfa_mfg_vpd_s {
#pragma pack()
/**
/*
* Status return values
*/
enum bfa_status {
@ -167,11 +167,11 @@ enum bfa_boolean {
#define BFA_STRING_32 32
#define BFA_VERSION_LEN 64
/**
/*
* ---------------------- adapter definitions ------------
*/
/**
/*
* BFA adapter level attributes.
*/
enum {
@ -215,7 +215,7 @@ struct bfa_adapter_attr_s {
u8 trunk_capable;
};
/**
/*
* ---------------------- IOC definitions ------------
*/
@ -224,7 +224,7 @@ enum {
BFA_IOC_CHIP_REV_LEN = 8,
};
/**
/*
* Driver and firmware versions.
*/
struct bfa_ioc_driver_attr_s {
@ -236,7 +236,7 @@ struct bfa_ioc_driver_attr_s {
char ob_ver[BFA_VERSION_LEN]; /* openboot version */
};
/**
/*
* IOC PCI device attributes
*/
struct bfa_ioc_pci_attr_s {
@ -249,7 +249,7 @@ struct bfa_ioc_pci_attr_s {
char chip_rev[BFA_IOC_CHIP_REV_LEN]; /* chip revision */
};
/**
/*
* IOC states
*/
enum bfa_ioc_state {
@ -267,7 +267,7 @@ enum bfa_ioc_state {
BFA_IOC_ENABLING = 12, /* IOC is being enabled */
};
/**
/*
* IOC firmware stats
*/
struct bfa_fw_ioc_stats_s {
@ -279,7 +279,7 @@ struct bfa_fw_ioc_stats_s {
u32 unknown_reqs;
};
/**
/*
* IOC driver stats
*/
struct bfa_ioc_drv_stats_s {
@ -296,7 +296,7 @@ struct bfa_ioc_drv_stats_s {
u32 enable_replies;
};
/**
/*
* IOC statistics
*/
struct bfa_ioc_stats_s {
@ -310,7 +310,7 @@ enum bfa_ioc_type_e {
BFA_IOC_TYPE_LL = 3,
};
/**
/*
* IOC attributes returned in queries
*/
struct bfa_ioc_attr_s {
@ -323,11 +323,11 @@ struct bfa_ioc_attr_s {
u8 rsvd[7]; /* 64bit align */
};
/**
/*
* ---------------------- mfg definitions ------------
*/
/**
/*
* Checksum size
*/
#define BFA_MFG_CHKSUM_SIZE 16
@ -340,7 +340,7 @@ struct bfa_ioc_attr_s {
#pragma pack(1)
/**
/*
* All numerical fields are in big-endian format.
*/
struct bfa_mfg_block_s {
@ -373,11 +373,11 @@ struct bfa_mfg_block_s {
#pragma pack()
/**
/*
* ---------------------- pci definitions ------------
*/
/**
/*
* PCI device and vendor ID information
*/
enum {
@ -392,14 +392,14 @@ enum {
((devid) == BFA_PCI_DEVICE_ID_CT || \
(devid) == BFA_PCI_DEVICE_ID_CT_FC)
/**
/*
* PCI sub-system device and vendor ID information
*/
enum {
BFA_PCI_FCOE_SSDEVICE_ID = 0x14,
};
/**
/*
* Maximum number of device address ranges mapped through different BAR(s)
*/
#define BFA_PCI_ACCESS_RANGES 1
@ -430,7 +430,7 @@ enum {
#define BOOT_CFG_REV1 1
#define BOOT_CFG_VLAN 1
/**
/*
* Boot options setting. Boot options setting determines from where
* to get the boot lun information
*/
@ -442,7 +442,7 @@ enum bfa_boot_bootopt {
};
#pragma pack(1)
/**
/*
* Boot lun information.
*/
struct bfa_boot_bootlun_s {
@ -451,7 +451,7 @@ struct bfa_boot_bootlun_s {
};
#pragma pack()
/**
/*
* BOOT boot configuraton
*/
struct bfa_boot_pbc_s {

View file

@ -21,7 +21,7 @@
#include "bfa_fc.h"
#include "bfa_defs_svc.h"
/**
/*
* VF states
*/
enum bfa_vf_state {
@ -35,7 +35,7 @@ enum bfa_vf_state {
BFA_VF_ISOLATED = 7, /* port isolated due to vf_id mismatch */
};
/**
/*
* VF statistics
*/
struct bfa_vf_stats_s {
@ -55,7 +55,7 @@ struct bfa_vf_stats_s {
u32 resvd; /* padding for 64 bit alignment */
};
/**
/*
* VF attributes returned in queries
*/
struct bfa_vf_attr_s {
@ -67,7 +67,7 @@ struct bfa_vf_attr_s {
#define BFA_FCS_MAX_LPORTS 256
#define BFA_FCS_FABRIC_IPADDR_SZ 16
/**
/*
* symbolic names for base port/virtual port
*/
#define BFA_SYMNAME_MAXLEN 128 /* 128 bytes */
@ -75,7 +75,7 @@ struct bfa_lport_symname_s {
char symname[BFA_SYMNAME_MAXLEN];
};
/**
/*
* Roles of FCS port:
* - FCP IM and FCP TM roles cannot be enabled together for a FCS port
* - Create multiple ports if both IM and TM functions required.
@ -86,19 +86,19 @@ enum bfa_lport_role {
BFA_LPORT_ROLE_FCP_MAX = BFA_LPORT_ROLE_FCP_IM,
};
/**
/*
* FCS port configuration.
*/
struct bfa_lport_cfg_s {
wwn_t pwwn; /* port wwn */
wwn_t nwwn; /* node wwn */
struct bfa_lport_symname_s sym_name; /* vm port symbolic name */
bfa_boolean_t preboot_vp; /* vport created from PBC */
bfa_boolean_t preboot_vp; /* vport created from PBC */
enum bfa_lport_role roles; /* FCS port roles */
u8 tag[16]; /* opaque tag from application */
};
/**
/*
* FCS port states
*/
enum bfa_lport_state {
@ -108,7 +108,7 @@ enum bfa_lport_state {
BFA_LPORT_OFFLINE = 3, /* No login to fabric */
};
/**
/*
* FCS port type.
*/
enum bfa_lport_type {
@ -116,7 +116,7 @@ enum bfa_lport_type {
BFA_LPORT_TYPE_VIRTUAL,
};
/**
/*
* FCS port offline reason.
*/
enum bfa_lport_offline_reason {
@ -128,7 +128,7 @@ enum bfa_lport_offline_reason {
BFA_LPORT_OFFLINE_FAB_LOGOUT,
};
/**
/*
* FCS lport info.
*/
struct bfa_lport_info_s {
@ -150,7 +150,7 @@ struct bfa_lport_info_s {
};
/**
/*
* FCS port statistics
*/
struct bfa_lport_stats_s {
@ -222,7 +222,7 @@ struct bfa_lport_stats_s {
* (max retry of plogi) */
};
/**
/*
* BFA port attribute returned in queries
*/
struct bfa_lport_attr_s {
@ -239,7 +239,7 @@ struct bfa_lport_attr_s {
};
/**
/*
* VPORT states
*/
enum bfa_vport_state {
@ -258,7 +258,7 @@ enum bfa_vport_state {
BFA_FCS_VPORT_MAX_STATE,
};
/**
/*
* vport statistics
*/
struct bfa_vport_stats_s {
@ -296,7 +296,7 @@ struct bfa_vport_stats_s {
u32 rsvd;
};
/**
/*
* BFA vport attribute returned in queries
*/
struct bfa_vport_attr_s {
@ -305,7 +305,7 @@ struct bfa_vport_attr_s {
u32 rsvd;
};
/**
/*
* FCS remote port states
*/
enum bfa_rport_state {
@ -321,7 +321,7 @@ enum bfa_rport_state {
BFA_RPORT_NSDISC = 9, /* re-discover rport */
};
/**
/*
* Rport Scsi Function : Initiator/Target.
*/
enum bfa_rport_function {
@ -329,7 +329,7 @@ enum bfa_rport_function {
BFA_RPORT_TARGET = 0x02, /* SCSI Target */
};
/**
/*
* port/node symbolic names for rport
*/
#define BFA_RPORT_SYMNAME_MAXLEN 255
@ -337,7 +337,7 @@ struct bfa_rport_symname_s {
char symname[BFA_RPORT_SYMNAME_MAXLEN];
};
/**
/*
* FCS remote port statistics
*/
struct bfa_rport_stats_s {
@ -374,7 +374,7 @@ struct bfa_rport_stats_s {
struct bfa_rport_hal_stats_s hal_stats; /* BFA rport stats */
};
/**
/*
* FCS remote port attributes returned in queries
*/
struct bfa_rport_attr_s {
@ -411,7 +411,7 @@ struct bfa_rport_remote_link_stats_s {
#define BFA_MAX_IO_INDEX 7
#define BFA_NO_IO_INDEX 9
/**
/*
* FCS itnim states
*/
enum bfa_itnim_state {
@ -425,7 +425,7 @@ enum bfa_itnim_state {
BFA_ITNIM_INITIATIOR = 7, /* initiator */
};
/**
/*
* FCS remote port statistics
*/
struct bfa_itnim_stats_s {
@ -443,7 +443,7 @@ struct bfa_itnim_stats_s {
u32 rsvd; /* padding for 64 bit alignment */
};
/**
/*
* FCS itnim attributes returned in queries
*/
struct bfa_itnim_attr_s {

View file

@ -27,7 +27,7 @@
#define BFA_IOCFCOE_INTR_DELAY 25
#define BFA_IOCFCOE_INTR_LATENCY 5
/**
/*
* Interrupt coalescing configuration.
*/
#pragma pack(1)
@ -38,7 +38,7 @@ struct bfa_iocfc_intr_attr_s {
u16 delay; /* delay in microseconds */
};
/**
/*
* IOC firmware configuraton
*/
struct bfa_iocfc_fwcfg_s {
@ -71,7 +71,7 @@ struct bfa_iocfc_drvcfg_s {
u32 rsvd;
};
/**
/*
* IOC configuration
*/
struct bfa_iocfc_cfg_s {
@ -79,7 +79,7 @@ struct bfa_iocfc_cfg_s {
struct bfa_iocfc_drvcfg_s drvcfg; /* driver side config */
};
/**
/*
* IOC firmware IO stats
*/
struct bfa_fw_io_stats_s {
@ -152,7 +152,7 @@ struct bfa_fw_io_stats_s {
*/
};
/**
/*
* IOC port firmware stats
*/
@ -262,7 +262,7 @@ struct bfa_fw_fcoe_stats_s {
u32 mac_invalids; /* Invalid mac assigned */
};
/**
/*
* IOC firmware FCoE port stats
*/
struct bfa_fw_fcoe_port_stats_s {
@ -270,7 +270,7 @@ struct bfa_fw_fcoe_port_stats_s {
struct bfa_fw_fip_stats_s fip_stats;
};
/**
/*
* IOC firmware FC uport stats
*/
struct bfa_fw_fc_uport_stats_s {
@ -278,7 +278,7 @@ struct bfa_fw_fc_uport_stats_s {
struct bfa_fw_port_lksm_stats_s lksm_stats;
};
/**
/*
* IOC firmware FC port stats
*/
union bfa_fw_fc_port_stats_s {
@ -286,7 +286,7 @@ union bfa_fw_fc_port_stats_s {
struct bfa_fw_fcoe_port_stats_s fcoe_stats;
};
/**
/*
* IOC firmware port stats
*/
struct bfa_fw_port_stats_s {
@ -295,7 +295,7 @@ struct bfa_fw_port_stats_s {
union bfa_fw_fc_port_stats_s fc_port;
};
/**
/*
* fcxchg module statistics
*/
struct bfa_fw_fcxchg_stats_s {
@ -308,7 +308,7 @@ struct bfa_fw_lpsm_stats_s {
u32 cls_tx;
};
/**
/*
* Trunk statistics
*/
struct bfa_fw_trunk_stats_s {
@ -334,7 +334,7 @@ struct bfa_fw_advsm_stats_s {
u32 elp_dropped; /* ELP dropped */
};
/**
/*
* IOCFC firmware stats
*/
struct bfa_fw_iocfc_stats_s {
@ -345,7 +345,7 @@ struct bfa_fw_iocfc_stats_s {
u32 set_intr_reqs; /* set interrupt reqs */
};
/**
/*
* IOC attributes returned in queries
*/
struct bfa_iocfc_attr_s {
@ -353,7 +353,7 @@ struct bfa_iocfc_attr_s {
struct bfa_iocfc_intr_attr_s intr_attr; /* interrupt attr */
};
/**
/*
* Eth_sndrcv mod stats
*/
struct bfa_fw_eth_sndrcv_stats_s {
@ -361,7 +361,7 @@ struct bfa_fw_eth_sndrcv_stats_s {
u32 rsvd; /* 64bit align */
};
/**
/*
* CT MAC mod stats
*/
struct bfa_fw_mac_mod_stats_s {
@ -379,7 +379,7 @@ struct bfa_fw_mac_mod_stats_s {
u32 rsvd; /* 64bit align */
};
/**
/*
* CT MOD stats
*/
struct bfa_fw_ct_mod_stats_s {
@ -391,7 +391,7 @@ struct bfa_fw_ct_mod_stats_s {
u32 rsvd; /* 64bit align */
};
/**
/*
* IOC firmware stats
*/
struct bfa_fw_stats_s {
@ -412,7 +412,7 @@ struct bfa_fw_stats_s {
#define BFA_IOCFC_PATHTOV_MAX 60
#define BFA_IOCFC_QDEPTH_MAX 2000
/**
/*
* QoS states
*/
enum bfa_qos_state {
@ -420,7 +420,7 @@ enum bfa_qos_state {
BFA_QOS_OFFLINE = 2, /* QoS is offline */
};
/**
/*
* QoS Priority levels.
*/
enum bfa_qos_priority {
@ -430,7 +430,7 @@ enum bfa_qos_priority {
BFA_QOS_LOW = 3, /* QoS Priority Level Low */
};
/**
/*
* QoS bandwidth allocation for each priority level
*/
enum bfa_qos_bw_alloc {
@ -439,7 +439,7 @@ enum bfa_qos_bw_alloc {
BFA_QOS_BW_LOW = 10, /* bandwidth allocation for Low */
};
#pragma pack(1)
/**
/*
* QoS attribute returned in QoS Query
*/
struct bfa_qos_attr_s {
@ -448,7 +448,7 @@ struct bfa_qos_attr_s {
u32 total_bb_cr; /* Total BB Credits */
};
/**
/*
* These fields should be displayed only from the CLI.
* There will be a separate BFAL API (get_qos_vc_attr ?)
* to retrieve this.
@ -471,7 +471,7 @@ struct bfa_qos_vc_attr_s {
* total_vc_count */
};
/**
/*
* QoS statistics
*/
struct bfa_qos_stats_s {
@ -489,7 +489,7 @@ struct bfa_qos_stats_s {
u32 rsvd; /* padding for 64 bit alignment */
};
/**
/*
* FCoE statistics
*/
struct bfa_fcoe_stats_s {
@ -540,7 +540,7 @@ struct bfa_fcoe_stats_s {
u64 rxf_bcast_vlan; /* Rx FCoE broadcast vlan frames */
};
/**
/*
* QoS or FCoE stats (fcport stats excluding physical FC port stats)
*/
union bfa_fcport_stats_u {
@ -639,7 +639,7 @@ enum bfa_port_states {
BFA_PORT_ST_MAX_STATE,
};
/**
/*
* Port operational type (in sync with SNIA port type).
*/
enum bfa_port_type {
@ -651,7 +651,7 @@ enum bfa_port_type {
BFA_PORT_TYPE_VPORT = 22, /* NPIV - virtual port */
};
/**
/*
* Port topology setting. A port's topology and fabric login status
* determine its operational type.
*/
@ -662,7 +662,7 @@ enum bfa_port_topology {
BFA_PORT_TOPOLOGY_AUTO = 3, /* auto topology selection */
};
/**
/*
* Physical port loopback types.
*/
enum bfa_port_opmode {
@ -679,7 +679,7 @@ enum bfa_port_opmode {
(_mode == BFA_PORT_OPMODE_LB_SLW) || \
(_mode == BFA_PORT_OPMODE_LB_EXT))
/**
/*
* Port link state
*/
enum bfa_port_linkstate {
@ -687,7 +687,7 @@ enum bfa_port_linkstate {
BFA_PORT_LINKDOWN = 2, /* Physical port/Trunk link down */
};
/**
/*
* Port link state reason code
*/
enum bfa_port_linkstate_rsn {
@ -733,7 +733,7 @@ enum bfa_port_linkstate_rsn {
CEE_ISCSI_PRI_OVERLAP_FCOE_PRI = 43
};
#pragma pack(1)
/**
/*
* Physical port configuration
*/
struct bfa_port_cfg_s {
@ -753,7 +753,7 @@ struct bfa_port_cfg_s {
};
#pragma pack()
/**
/*
* Port attribute values.
*/
struct bfa_port_attr_s {
@ -800,7 +800,7 @@ struct bfa_port_attr_s {
u8 rsvd1[6];
};
/**
/*
* Port FCP mappings.
*/
struct bfa_port_fcpmap_s {
@ -815,7 +815,7 @@ struct bfa_port_fcpmap_s {
char luid[256];
};
/**
/*
* Port RNID info.
*/
struct bfa_port_rnid_s {
@ -848,7 +848,7 @@ struct bfa_fcport_fcf_s {
mac_t mac; /* FCF mac */
};
/**
/*
* Trunk states for BCU/BFAL
*/
enum bfa_trunk_state {
@ -857,7 +857,7 @@ enum bfa_trunk_state {
BFA_TRUNK_OFFLINE = 2, /* Trunk is offline */
};
/**
/*
* VC attributes for trunked link
*/
struct bfa_trunk_vc_attr_s {
@ -867,7 +867,7 @@ struct bfa_trunk_vc_attr_s {
u16 vc_credits[8];
};
/**
/*
* Link state information
*/
struct bfa_port_link_s {
@ -959,7 +959,7 @@ struct bfa_rport_hal_stats_s {
u32 rsvd;
};
#pragma pack(1)
/**
/*
* Rport's QoS attributes
*/
struct bfa_rport_qos_attr_s {
@ -987,7 +987,7 @@ struct bfa_itnim_ioprofile_s {
struct bfa_itnim_latency_s io_latency;
};
/**
/*
* FC physical port statistics.
*/
struct bfa_port_fc_stats_s {
@ -1022,7 +1022,7 @@ struct bfa_port_fc_stats_s {
u64 err_enc; /* Encoding err frame_8b10b */
};
/**
/*
* Eth Physical Port statistics.
*/
struct bfa_port_eth_stats_s {
@ -1070,7 +1070,7 @@ struct bfa_port_eth_stats_s {
u64 tx_iscsi_zero_pause; /* Tx iSCSI zero pause */
};
/**
/*
* Port statistics.
*/
union bfa_port_stats_u {

View file

@ -17,7 +17,7 @@
#include "bfa_modules.h"
/**
/*
* BFA module list terminated by NULL
*/
struct bfa_module_s *hal_mods[] = {
@ -31,7 +31,7 @@ struct bfa_module_s *hal_mods[] = {
NULL
};
/**
/*
* Message handlers for various modules.
*/
bfa_isr_func_t bfa_isrs[BFI_MC_MAX] = {
@ -70,7 +70,7 @@ bfa_isr_func_t bfa_isrs[BFI_MC_MAX] = {
};
/**
/*
* Message handlers for mailbox command classes
*/
bfa_ioc_mbox_mcfunc_t bfa_mbox_isrs[BFI_MC_MAX] = {

View file

@ -1029,7 +1029,7 @@ struct link_e2e_beacon_req_s {
struct link_e2e_beacon_param_s beacon_parm;
};
/**
/*
* If RPSC request is sent to the Domain Controller, the request is for
* all the ports within that domain (TODO - I don't think FOS implements
* this...).
@ -1049,7 +1049,7 @@ struct fc_rpsc_acc_s {
struct fc_rpsc_speed_info_s speed_info[1];
};
/**
/*
* If RPSC2 request is sent to the Domain Controller,
*/
#define FC_BRCD_TOKEN 0x42524344
@ -1094,7 +1094,7 @@ struct fc_rpsc2_acc_s {
struct fc_rpsc2_port_info_s port_info[1]; /* port information */
};
/**
/*
* bit fields so that multiple classes can be specified
*/
enum fc_cos {
@ -1131,7 +1131,7 @@ struct fc_alpabm_s {
#define FC_VF_ID_MAX 0xEFF
#define FC_VF_ID_CTL 0xFEF /* control VF_ID */
/**
/*
* Virtual Fabric Tagging header format
* @caution This is defined only in BIG ENDIAN format.
*/
@ -1463,7 +1463,7 @@ struct fcgs_gidpn_resp_s {
u32 dap:24; /* port identifier */
};
/**
/*
* RFT_ID
*/
struct fcgs_rftid_req_s {
@ -1472,7 +1472,7 @@ struct fcgs_rftid_req_s {
u32 fc4_type[8]; /* fc4 types */
};
/**
/*
* RFF_ID : Register FC4 features.
*/
@ -1487,7 +1487,7 @@ struct fcgs_rffid_req_s {
u32 fc4_type:8; /* corresponding FC4 Type */
};
/**
/*
* GID_FT Request
*/
struct fcgs_gidft_req_s {
@ -1497,7 +1497,7 @@ struct fcgs_gidft_req_s {
u8 fc4_type; /* FC_TYPE_FCP for SCSI devices */
}; /* GID_FT Request */
/**
/*
* GID_FT Response
*/
struct fcgs_gidft_resp_s {
@ -1506,7 +1506,7 @@ struct fcgs_gidft_resp_s {
u32 pid:24; /* port identifier */
}; /* GID_FT Response */
/**
/*
* RSPN_ID
*/
struct fcgs_rspnid_req_s {
@ -1516,7 +1516,7 @@ struct fcgs_rspnid_req_s {
u8 spn[256]; /* symbolic port name */
};
/**
/*
* RPN_ID
*/
struct fcgs_rpnid_req_s {
@ -1525,7 +1525,7 @@ struct fcgs_rpnid_req_s {
wwn_t port_name;
};
/**
/*
* RNN_ID
*/
struct fcgs_rnnid_req_s {
@ -1534,7 +1534,7 @@ struct fcgs_rnnid_req_s {
wwn_t node_name;
};
/**
/*
* RCS_ID
*/
struct fcgs_rcsid_req_s {
@ -1543,7 +1543,7 @@ struct fcgs_rcsid_req_s {
u32 cos;
};
/**
/*
* RPT_ID
*/
struct fcgs_rptid_req_s {
@ -1553,7 +1553,7 @@ struct fcgs_rptid_req_s {
u32 rsvd1:24;
};
/**
/*
* GA_NXT Request
*/
struct fcgs_ganxt_req_s {
@ -1561,7 +1561,7 @@ struct fcgs_ganxt_req_s {
u32 port_id:24;
};
/**
/*
* GA_NXT Response
*/
struct fcgs_ganxt_rsp_s {

View file

@ -94,13 +94,13 @@ fcbuild_init(void)
*/
plogi_tmpl.csp.verhi = FC_PH_VER_PH_3;
plogi_tmpl.csp.verlo = FC_PH_VER_4_3;
plogi_tmpl.csp.bbcred = bfa_os_htons(0x0004);
plogi_tmpl.csp.bbcred = cpu_to_be16(0x0004);
plogi_tmpl.csp.ciro = 0x1;
plogi_tmpl.csp.cisc = 0x0;
plogi_tmpl.csp.altbbcred = 0x0;
plogi_tmpl.csp.conseq = bfa_os_htons(0x00FF);
plogi_tmpl.csp.ro_bitmap = bfa_os_htons(0x0002);
plogi_tmpl.csp.e_d_tov = bfa_os_htonl(2000);
plogi_tmpl.csp.conseq = cpu_to_be16(0x00FF);
plogi_tmpl.csp.ro_bitmap = cpu_to_be16(0x0002);
plogi_tmpl.csp.e_d_tov = cpu_to_be32(2000);
plogi_tmpl.class3.class_valid = 1;
plogi_tmpl.class3.sequential = 1;
@ -112,7 +112,7 @@ fcbuild_init(void)
*/
prli_tmpl.command = FC_ELS_PRLI;
prli_tmpl.pglen = 0x10;
prli_tmpl.pagebytes = bfa_os_htons(0x0014);
prli_tmpl.pagebytes = cpu_to_be16(0x0014);
prli_tmpl.parampage.type = FC_TYPE_FCP;
prli_tmpl.parampage.imagepair = 1;
prli_tmpl.parampage.servparams.rxrdisab = 1;
@ -137,7 +137,7 @@ fcbuild_init(void)
static void
fc_gs_fchdr_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u32 ox_id)
{
bfa_os_memset(fchs, 0, sizeof(struct fchs_s));
memset(fchs, 0, sizeof(struct fchs_s));
fchs->routing = FC_RTG_FC4_DEV_DATA;
fchs->cat_info = FC_CAT_UNSOLICIT_CTRL;
@ -148,9 +148,9 @@ fc_gs_fchdr_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u32 ox_id)
fchs->rx_id = FC_RXID_ANY;
fchs->d_id = (d_id);
fchs->s_id = (s_id);
fchs->ox_id = bfa_os_htons(ox_id);
fchs->ox_id = cpu_to_be16(ox_id);
/**
/*
* @todo no need to set ox_id for request
* no need to set rx_id for response
*/
@ -159,16 +159,16 @@ fc_gs_fchdr_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u32 ox_id)
void
fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id)
{
bfa_os_memcpy(fchs, &fc_els_req_tmpl, sizeof(struct fchs_s));
memcpy(fchs, &fc_els_req_tmpl, sizeof(struct fchs_s));
fchs->d_id = (d_id);
fchs->s_id = (s_id);
fchs->ox_id = bfa_os_htons(ox_id);
fchs->ox_id = cpu_to_be16(ox_id);
}
static void
fc_els_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id)
{
bfa_os_memcpy(fchs, &fc_els_rsp_tmpl, sizeof(struct fchs_s));
memcpy(fchs, &fc_els_rsp_tmpl, sizeof(struct fchs_s));
fchs->d_id = d_id;
fchs->s_id = s_id;
fchs->ox_id = ox_id;
@ -198,7 +198,7 @@ fc_els_rsp_parse(struct fchs_s *fchs, int len)
static void
fc_bls_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id)
{
bfa_os_memcpy(fchs, &fc_bls_rsp_tmpl, sizeof(struct fchs_s));
memcpy(fchs, &fc_bls_rsp_tmpl, sizeof(struct fchs_s));
fchs->d_id = d_id;
fchs->s_id = s_id;
fchs->ox_id = ox_id;
@ -211,7 +211,7 @@ fc_plogi_x_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
{
struct fc_logi_s *plogi = (struct fc_logi_s *) (pld);
bfa_os_memcpy(plogi, &plogi_tmpl, sizeof(struct fc_logi_s));
memcpy(plogi, &plogi_tmpl, sizeof(struct fc_logi_s));
plogi->els_cmd.els_code = els_code;
if (els_code == FC_ELS_PLOGI)
@ -219,10 +219,10 @@ fc_plogi_x_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
else
fc_els_rsp_build(fchs, d_id, s_id, ox_id);
plogi->csp.rxsz = plogi->class3.rxsz = bfa_os_htons(pdu_size);
plogi->csp.rxsz = plogi->class3.rxsz = cpu_to_be16(pdu_size);
bfa_os_memcpy(&plogi->port_name, &port_name, sizeof(wwn_t));
bfa_os_memcpy(&plogi->node_name, &node_name, sizeof(wwn_t));
memcpy(&plogi->port_name, &port_name, sizeof(wwn_t));
memcpy(&plogi->node_name, &node_name, sizeof(wwn_t));
return sizeof(struct fc_logi_s);
}
@ -235,12 +235,12 @@ fc_flogi_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id,
u32 d_id = bfa_os_hton3b(FC_FABRIC_PORT);
u32 *vvl_info;
bfa_os_memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s));
memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s));
flogi->els_cmd.els_code = FC_ELS_FLOGI;
fc_els_req_build(fchs, d_id, s_id, ox_id);
flogi->csp.rxsz = flogi->class3.rxsz = bfa_os_htons(pdu_size);
flogi->csp.rxsz = flogi->class3.rxsz = cpu_to_be16(pdu_size);
flogi->port_name = port_name;
flogi->node_name = node_name;
@ -253,14 +253,14 @@ fc_flogi_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id,
/* set AUTH capability */
flogi->csp.security = set_auth;
flogi->csp.bbcred = bfa_os_htons(local_bb_credits);
flogi->csp.bbcred = cpu_to_be16(local_bb_credits);
/* Set brcd token in VVL */
vvl_info = (u32 *)&flogi->vvl[0];
/* set the flag to indicate the presence of VVL */
flogi->csp.npiv_supp = 1; /* @todo. field name is not correct */
vvl_info[0] = bfa_os_htonl(FLOGI_VVL_BRCD);
vvl_info[0] = cpu_to_be32(FLOGI_VVL_BRCD);
return sizeof(struct fc_logi_s);
}
@ -272,15 +272,15 @@ fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id,
{
u32 d_id = 0;
bfa_os_memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s));
memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s));
fc_els_rsp_build(fchs, d_id, s_id, ox_id);
flogi->els_cmd.els_code = FC_ELS_ACC;
flogi->csp.rxsz = flogi->class3.rxsz = bfa_os_htons(pdu_size);
flogi->csp.rxsz = flogi->class3.rxsz = cpu_to_be16(pdu_size);
flogi->port_name = port_name;
flogi->node_name = node_name;
flogi->csp.bbcred = bfa_os_htons(local_bb_credits);
flogi->csp.bbcred = cpu_to_be16(local_bb_credits);
return sizeof(struct fc_logi_s);
}
@ -291,12 +291,12 @@ fc_fdisc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id,
{
u32 d_id = bfa_os_hton3b(FC_FABRIC_PORT);
bfa_os_memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s));
memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s));
flogi->els_cmd.els_code = FC_ELS_FDISC;
fc_els_req_build(fchs, d_id, s_id, ox_id);
flogi->csp.rxsz = flogi->class3.rxsz = bfa_os_htons(pdu_size);
flogi->csp.rxsz = flogi->class3.rxsz = cpu_to_be16(pdu_size);
flogi->port_name = port_name;
flogi->node_name = node_name;
@ -346,7 +346,7 @@ fc_plogi_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name)
if (!plogi->class3.class_valid)
return FC_PARSE_FAILURE;
if (bfa_os_ntohs(plogi->class3.rxsz) < (FC_MIN_PDUSZ))
if (be16_to_cpu(plogi->class3.rxsz) < (FC_MIN_PDUSZ))
return FC_PARSE_FAILURE;
return FC_PARSE_OK;
@ -363,8 +363,8 @@ fc_plogi_parse(struct fchs_s *fchs)
if (plogi->class3.class_valid != 1)
return FC_PARSE_FAILURE;
if ((bfa_os_ntohs(plogi->class3.rxsz) < FC_MIN_PDUSZ)
|| (bfa_os_ntohs(plogi->class3.rxsz) > FC_MAX_PDUSZ)
if ((be16_to_cpu(plogi->class3.rxsz) < FC_MIN_PDUSZ)
|| (be16_to_cpu(plogi->class3.rxsz) > FC_MAX_PDUSZ)
|| (plogi->class3.rxsz == 0))
return FC_PARSE_FAILURE;
@ -378,7 +378,7 @@ fc_prli_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
struct fc_prli_s *prli = (struct fc_prli_s *) (pld);
fc_els_req_build(fchs, d_id, s_id, ox_id);
bfa_os_memcpy(prli, &prli_tmpl, sizeof(struct fc_prli_s));
memcpy(prli, &prli_tmpl, sizeof(struct fc_prli_s));
prli->command = FC_ELS_PRLI;
prli->parampage.servparams.initiator = 1;
@ -397,7 +397,7 @@ fc_prli_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
struct fc_prli_s *prli = (struct fc_prli_s *) (pld);
fc_els_rsp_build(fchs, d_id, s_id, ox_id);
bfa_os_memcpy(prli, &prli_tmpl, sizeof(struct fc_prli_s));
memcpy(prli, &prli_tmpl, sizeof(struct fc_prli_s));
prli->command = FC_ELS_ACC;
@ -448,7 +448,7 @@ fc_logo_build(struct fchs_s *fchs, struct fc_logo_s *logo, u32 d_id, u32 s_id,
{
fc_els_req_build(fchs, d_id, s_id, ox_id);
bfa_os_memset(logo, '\0', sizeof(struct fc_logo_s));
memset(logo, '\0', sizeof(struct fc_logo_s));
logo->els_cmd.els_code = FC_ELS_LOGO;
logo->nport_id = (s_id);
logo->orig_port_name = port_name;
@ -461,7 +461,7 @@ fc_adisc_x_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id,
u32 s_id, u16 ox_id, wwn_t port_name,
wwn_t node_name, u8 els_code)
{
bfa_os_memset(adisc, '\0', sizeof(struct fc_adisc_s));
memset(adisc, '\0', sizeof(struct fc_adisc_s));
adisc->els_cmd.els_code = els_code;
@ -537,7 +537,7 @@ fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name, wwn_t port_name)
if (pdisc->class3.class_valid != 1)
return FC_PARSE_FAILURE;
if ((bfa_os_ntohs(pdisc->class3.rxsz) <
if ((be16_to_cpu(pdisc->class3.rxsz) <
(FC_MIN_PDUSZ - sizeof(struct fchs_s)))
|| (pdisc->class3.rxsz == 0))
return FC_PARSE_FAILURE;
@ -554,11 +554,11 @@ fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name, wwn_t port_name)
u16
fc_abts_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id)
{
bfa_os_memcpy(fchs, &fc_bls_req_tmpl, sizeof(struct fchs_s));
memcpy(fchs, &fc_bls_req_tmpl, sizeof(struct fchs_s));
fchs->cat_info = FC_CAT_ABTS;
fchs->d_id = (d_id);
fchs->s_id = (s_id);
fchs->ox_id = bfa_os_htons(ox_id);
fchs->ox_id = cpu_to_be16(ox_id);
return sizeof(struct fchs_s);
}
@ -582,9 +582,9 @@ fc_rrq_build(struct fchs_s *fchs, struct fc_rrq_s *rrq, u32 d_id, u32 s_id,
/*
* build rrq payload
*/
bfa_os_memcpy(rrq, &rrq_tmpl, sizeof(struct fc_rrq_s));
memcpy(rrq, &rrq_tmpl, sizeof(struct fc_rrq_s));
rrq->s_id = (s_id);
rrq->ox_id = bfa_os_htons(rrq_oxid);
rrq->ox_id = cpu_to_be16(rrq_oxid);
rrq->rx_id = FC_RXID_ANY;
return sizeof(struct fc_rrq_s);
@ -598,7 +598,7 @@ fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
fc_els_rsp_build(fchs, d_id, s_id, ox_id);
bfa_os_memset(acc, 0, sizeof(struct fc_els_cmd_s));
memset(acc, 0, sizeof(struct fc_els_cmd_s));
acc->els_code = FC_ELS_ACC;
return sizeof(struct fc_els_cmd_s);
@ -610,7 +610,7 @@ fc_ls_rjt_build(struct fchs_s *fchs, struct fc_ls_rjt_s *ls_rjt, u32 d_id,
u8 reason_code_expl)
{
fc_els_rsp_build(fchs, d_id, s_id, ox_id);
bfa_os_memset(ls_rjt, 0, sizeof(struct fc_ls_rjt_s));
memset(ls_rjt, 0, sizeof(struct fc_ls_rjt_s));
ls_rjt->els_cmd.els_code = FC_ELS_LS_RJT;
ls_rjt->reason_code = reason_code;
@ -626,7 +626,7 @@ fc_ba_acc_build(struct fchs_s *fchs, struct fc_ba_acc_s *ba_acc, u32 d_id,
{
fc_bls_rsp_build(fchs, d_id, s_id, ox_id);
bfa_os_memcpy(ba_acc, &ba_acc_tmpl, sizeof(struct fc_ba_acc_s));
memcpy(ba_acc, &ba_acc_tmpl, sizeof(struct fc_ba_acc_s));
fchs->rx_id = rx_id;
@ -641,7 +641,7 @@ fc_ls_acc_build(struct fchs_s *fchs, struct fc_els_cmd_s *els_cmd, u32 d_id,
u32 s_id, u16 ox_id)
{
fc_els_rsp_build(fchs, d_id, s_id, ox_id);
bfa_os_memset(els_cmd, 0, sizeof(struct fc_els_cmd_s));
memset(els_cmd, 0, sizeof(struct fc_els_cmd_s));
els_cmd->els_code = FC_ELS_ACC;
return sizeof(struct fc_els_cmd_s);
@ -656,10 +656,10 @@ fc_logout_params_pages(struct fchs_s *fc_frame, u8 els_code)
if (els_code == FC_ELS_PRLO) {
prlo = (struct fc_prlo_s *) (fc_frame + 1);
num_pages = (bfa_os_ntohs(prlo->payload_len) - 4) / 16;
num_pages = (be16_to_cpu(prlo->payload_len) - 4) / 16;
} else {
tprlo = (struct fc_tprlo_s *) (fc_frame + 1);
num_pages = (bfa_os_ntohs(tprlo->payload_len) - 4) / 16;
num_pages = (be16_to_cpu(tprlo->payload_len) - 4) / 16;
}
return num_pages;
}
@ -672,11 +672,11 @@ fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc,
fc_els_rsp_build(fchs, d_id, s_id, ox_id);
bfa_os_memset(tprlo_acc, 0, (num_pages * 16) + 4);
memset(tprlo_acc, 0, (num_pages * 16) + 4);
tprlo_acc->command = FC_ELS_ACC;
tprlo_acc->page_len = 0x10;
tprlo_acc->payload_len = bfa_os_htons((num_pages * 16) + 4);
tprlo_acc->payload_len = cpu_to_be16((num_pages * 16) + 4);
for (page = 0; page < num_pages; page++) {
tprlo_acc->tprlo_acc_params[page].opa_valid = 0;
@ -685,7 +685,7 @@ fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc,
tprlo_acc->tprlo_acc_params[page].orig_process_assc = 0;
tprlo_acc->tprlo_acc_params[page].resp_process_assc = 0;
}
return bfa_os_ntohs(tprlo_acc->payload_len);
return be16_to_cpu(tprlo_acc->payload_len);
}
u16
@ -696,10 +696,10 @@ fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc, u32 d_id,
fc_els_rsp_build(fchs, d_id, s_id, ox_id);
bfa_os_memset(prlo_acc, 0, (num_pages * 16) + 4);
memset(prlo_acc, 0, (num_pages * 16) + 4);
prlo_acc->command = FC_ELS_ACC;
prlo_acc->page_len = 0x10;
prlo_acc->payload_len = bfa_os_htons((num_pages * 16) + 4);
prlo_acc->payload_len = cpu_to_be16((num_pages * 16) + 4);
for (page = 0; page < num_pages; page++) {
prlo_acc->prlo_acc_params[page].opa_valid = 0;
@ -709,7 +709,7 @@ fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc, u32 d_id,
prlo_acc->prlo_acc_params[page].resp_process_assc = 0;
}
return bfa_os_ntohs(prlo_acc->payload_len);
return be16_to_cpu(prlo_acc->payload_len);
}
u16
@ -718,7 +718,7 @@ fc_rnid_build(struct fchs_s *fchs, struct fc_rnid_cmd_s *rnid, u32 d_id,
{
fc_els_req_build(fchs, d_id, s_id, ox_id);
bfa_os_memset(rnid, 0, sizeof(struct fc_rnid_cmd_s));
memset(rnid, 0, sizeof(struct fc_rnid_cmd_s));
rnid->els_cmd.els_code = FC_ELS_RNID;
rnid->node_id_data_format = data_format;
@ -732,7 +732,7 @@ fc_rnid_acc_build(struct fchs_s *fchs, struct fc_rnid_acc_s *rnid_acc, u32 d_id,
struct fc_rnid_common_id_data_s *common_id_data,
struct fc_rnid_general_topology_data_s *gen_topo_data)
{
bfa_os_memset(rnid_acc, 0, sizeof(struct fc_rnid_acc_s));
memset(rnid_acc, 0, sizeof(struct fc_rnid_acc_s));
fc_els_rsp_build(fchs, d_id, s_id, ox_id);
@ -745,7 +745,7 @@ fc_rnid_acc_build(struct fchs_s *fchs, struct fc_rnid_acc_s *rnid_acc, u32 d_id,
if (data_format == RNID_NODEID_DATA_FORMAT_DISCOVERY) {
rnid_acc->specific_id_data_length =
sizeof(struct fc_rnid_general_topology_data_s);
bfa_os_assign(rnid_acc->gen_topology_data, *gen_topo_data);
rnid_acc->gen_topology_data = *gen_topo_data;
return sizeof(struct fc_rnid_acc_s);
} else {
return sizeof(struct fc_rnid_acc_s) -
@ -760,7 +760,7 @@ fc_rpsc_build(struct fchs_s *fchs, struct fc_rpsc_cmd_s *rpsc, u32 d_id,
{
fc_els_req_build(fchs, d_id, s_id, ox_id);
bfa_os_memset(rpsc, 0, sizeof(struct fc_rpsc_cmd_s));
memset(rpsc, 0, sizeof(struct fc_rpsc_cmd_s));
rpsc->els_cmd.els_code = FC_ELS_RPSC;
return sizeof(struct fc_rpsc_cmd_s);
@ -775,11 +775,11 @@ fc_rpsc2_build(struct fchs_s *fchs, struct fc_rpsc2_cmd_s *rpsc2, u32 d_id,
fc_els_req_build(fchs, bfa_os_hton3b(dctlr_id), s_id, 0);
bfa_os_memset(rpsc2, 0, sizeof(struct fc_rpsc2_cmd_s));
memset(rpsc2, 0, sizeof(struct fc_rpsc2_cmd_s));
rpsc2->els_cmd.els_code = FC_ELS_RPSC;
rpsc2->token = bfa_os_htonl(FC_BRCD_TOKEN);
rpsc2->num_pids = bfa_os_htons(npids);
rpsc2->token = cpu_to_be32(FC_BRCD_TOKEN);
rpsc2->num_pids = cpu_to_be16(npids);
for (i = 0; i < npids; i++)
rpsc2->pid_list[i].pid = pid_list[i];
@ -791,18 +791,18 @@ fc_rpsc_acc_build(struct fchs_s *fchs, struct fc_rpsc_acc_s *rpsc_acc,
u32 d_id, u32 s_id, u16 ox_id,
struct fc_rpsc_speed_info_s *oper_speed)
{
bfa_os_memset(rpsc_acc, 0, sizeof(struct fc_rpsc_acc_s));
memset(rpsc_acc, 0, sizeof(struct fc_rpsc_acc_s));
fc_els_rsp_build(fchs, d_id, s_id, ox_id);
rpsc_acc->command = FC_ELS_ACC;
rpsc_acc->num_entries = bfa_os_htons(1);
rpsc_acc->num_entries = cpu_to_be16(1);
rpsc_acc->speed_info[0].port_speed_cap =
bfa_os_htons(oper_speed->port_speed_cap);
cpu_to_be16(oper_speed->port_speed_cap);
rpsc_acc->speed_info[0].port_op_speed =
bfa_os_htons(oper_speed->port_op_speed);
cpu_to_be16(oper_speed->port_op_speed);
return sizeof(struct fc_rpsc_acc_s);
}
@ -830,12 +830,12 @@ fc_pdisc_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id,
{
struct fc_logi_s *pdisc = (struct fc_logi_s *) (fchs + 1);
bfa_os_memcpy(pdisc, &plogi_tmpl, sizeof(struct fc_logi_s));
memcpy(pdisc, &plogi_tmpl, sizeof(struct fc_logi_s));
pdisc->els_cmd.els_code = FC_ELS_PDISC;
fc_els_req_build(fchs, d_id, s_id, ox_id);
pdisc->csp.rxsz = pdisc->class3.rxsz = bfa_os_htons(pdu_size);
pdisc->csp.rxsz = pdisc->class3.rxsz = cpu_to_be16(pdu_size);
pdisc->port_name = port_name;
pdisc->node_name = node_name;
@ -859,7 +859,7 @@ fc_pdisc_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name)
if (!pdisc->class3.class_valid)
return FC_PARSE_NWWN_NOT_EQUAL;
if (bfa_os_ntohs(pdisc->class3.rxsz) < (FC_MIN_PDUSZ))
if (be16_to_cpu(pdisc->class3.rxsz) < (FC_MIN_PDUSZ))
return FC_PARSE_RXSZ_INVAL;
return FC_PARSE_OK;
@ -873,10 +873,10 @@ fc_prlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id,
int page;
fc_els_req_build(fchs, d_id, s_id, ox_id);
bfa_os_memset(prlo, 0, (num_pages * 16) + 4);
memset(prlo, 0, (num_pages * 16) + 4);
prlo->command = FC_ELS_PRLO;
prlo->page_len = 0x10;
prlo->payload_len = bfa_os_htons((num_pages * 16) + 4);
prlo->payload_len = cpu_to_be16((num_pages * 16) + 4);
for (page = 0; page < num_pages; page++) {
prlo->prlo_params[page].type = FC_TYPE_FCP;
@ -886,7 +886,7 @@ fc_prlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id,
prlo->prlo_params[page].resp_process_assc = 0;
}
return bfa_os_ntohs(prlo->payload_len);
return be16_to_cpu(prlo->payload_len);
}
u16
@ -901,7 +901,7 @@ fc_prlo_rsp_parse(struct fchs_s *fchs, int len)
if (prlo->command != FC_ELS_ACC)
return FC_PARSE_FAILURE;
num_pages = ((bfa_os_ntohs(prlo->payload_len)) - 4) / 16;
num_pages = ((be16_to_cpu(prlo->payload_len)) - 4) / 16;
for (page = 0; page < num_pages; page++) {
if (prlo->prlo_acc_params[page].type != FC_TYPE_FCP)
@ -931,10 +931,10 @@ fc_tprlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id,
int page;
fc_els_req_build(fchs, d_id, s_id, ox_id);
bfa_os_memset(tprlo, 0, (num_pages * 16) + 4);
memset(tprlo, 0, (num_pages * 16) + 4);
tprlo->command = FC_ELS_TPRLO;
tprlo->page_len = 0x10;
tprlo->payload_len = bfa_os_htons((num_pages * 16) + 4);
tprlo->payload_len = cpu_to_be16((num_pages * 16) + 4);
for (page = 0; page < num_pages; page++) {
tprlo->tprlo_params[page].type = FC_TYPE_FCP;
@ -950,7 +950,7 @@ fc_tprlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id,
}
}
return bfa_os_ntohs(tprlo->payload_len);
return be16_to_cpu(tprlo->payload_len);
}
u16
@ -965,7 +965,7 @@ fc_tprlo_rsp_parse(struct fchs_s *fchs, int len)
if (tprlo->command != FC_ELS_ACC)
return FC_PARSE_ACC_INVAL;
num_pages = (bfa_os_ntohs(tprlo->payload_len) - 4) / 16;
num_pages = (be16_to_cpu(tprlo->payload_len) - 4) / 16;
for (page = 0; page < num_pages; page++) {
if (tprlo->tprlo_acc_params[page].type != FC_TYPE_FCP)
@ -1011,32 +1011,32 @@ fc_ba_rjt_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id,
static void
fc_gs_cthdr_build(struct ct_hdr_s *cthdr, u32 s_id, u16 cmd_code)
{
bfa_os_memset(cthdr, 0, sizeof(struct ct_hdr_s));
memset(cthdr, 0, sizeof(struct ct_hdr_s));
cthdr->rev_id = CT_GS3_REVISION;
cthdr->gs_type = CT_GSTYPE_DIRSERVICE;
cthdr->gs_sub_type = CT_GSSUBTYPE_NAMESERVER;
cthdr->cmd_rsp_code = bfa_os_htons(cmd_code);
cthdr->cmd_rsp_code = cpu_to_be16(cmd_code);
}
static void
fc_gs_fdmi_cthdr_build(struct ct_hdr_s *cthdr, u32 s_id, u16 cmd_code)
{
bfa_os_memset(cthdr, 0, sizeof(struct ct_hdr_s));
memset(cthdr, 0, sizeof(struct ct_hdr_s));
cthdr->rev_id = CT_GS3_REVISION;
cthdr->gs_type = CT_GSTYPE_MGMTSERVICE;
cthdr->gs_sub_type = CT_GSSUBTYPE_HBA_MGMTSERVER;
cthdr->cmd_rsp_code = bfa_os_htons(cmd_code);
cthdr->cmd_rsp_code = cpu_to_be16(cmd_code);
}
static void
fc_gs_ms_cthdr_build(struct ct_hdr_s *cthdr, u32 s_id, u16 cmd_code,
u8 sub_type)
{
bfa_os_memset(cthdr, 0, sizeof(struct ct_hdr_s));
memset(cthdr, 0, sizeof(struct ct_hdr_s));
cthdr->rev_id = CT_GS3_REVISION;
cthdr->gs_type = CT_GSTYPE_MGMTSERVICE;
cthdr->gs_sub_type = sub_type;
cthdr->cmd_rsp_code = bfa_os_htons(cmd_code);
cthdr->cmd_rsp_code = cpu_to_be16(cmd_code);
}
u16
@ -1050,7 +1050,7 @@ fc_gidpn_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
fc_gs_cthdr_build(cthdr, s_id, GS_GID_PN);
bfa_os_memset(gidpn, 0, sizeof(struct fcgs_gidpn_req_s));
memset(gidpn, 0, sizeof(struct fcgs_gidpn_req_s));
gidpn->port_name = port_name;
return sizeof(struct fcgs_gidpn_req_s) + sizeof(struct ct_hdr_s);
}
@ -1066,7 +1066,7 @@ fc_gpnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
fc_gs_cthdr_build(cthdr, s_id, GS_GPN_ID);
bfa_os_memset(gpnid, 0, sizeof(fcgs_gpnid_req_t));
memset(gpnid, 0, sizeof(fcgs_gpnid_req_t));
gpnid->dap = port_id;
return sizeof(fcgs_gpnid_req_t) + sizeof(struct ct_hdr_s);
}
@ -1082,7 +1082,7 @@ fc_gnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
fc_gs_cthdr_build(cthdr, s_id, GS_GNN_ID);
bfa_os_memset(gnnid, 0, sizeof(fcgs_gnnid_req_t));
memset(gnnid, 0, sizeof(fcgs_gnnid_req_t));
gnnid->dap = port_id;
return sizeof(fcgs_gnnid_req_t) + sizeof(struct ct_hdr_s);
}
@ -1090,7 +1090,7 @@ fc_gnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
u16
fc_ct_rsp_parse(struct ct_hdr_s *cthdr)
{
if (bfa_os_ntohs(cthdr->cmd_rsp_code) != CT_RSP_ACCEPT) {
if (be16_to_cpu(cthdr->cmd_rsp_code) != CT_RSP_ACCEPT) {
if (cthdr->reason_code == CT_RSN_LOGICAL_BUSY)
return FC_PARSE_BUSY;
else
@ -1108,7 +1108,7 @@ fc_scr_build(struct fchs_s *fchs, struct fc_scr_s *scr,
fc_els_req_build(fchs, d_id, s_id, ox_id);
bfa_os_memset(scr, 0, sizeof(struct fc_scr_s));
memset(scr, 0, sizeof(struct fc_scr_s));
scr->command = FC_ELS_SCR;
scr->reg_func = FC_SCR_REG_FUNC_FULL;
if (set_br_reg)
@ -1129,7 +1129,7 @@ fc_rscn_build(struct fchs_s *fchs, struct fc_rscn_pl_s *rscn,
rscn->pagelen = sizeof(rscn->event[0]);
payldlen = sizeof(u32) + rscn->pagelen;
rscn->payldlen = bfa_os_htons(payldlen);
rscn->payldlen = cpu_to_be16(payldlen);
rscn->event[0].format = FC_RSCN_FORMAT_PORTID;
rscn->event[0].portid = s_id;
@ -1149,14 +1149,14 @@ fc_rftid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
fc_gs_cthdr_build(cthdr, s_id, GS_RFT_ID);
bfa_os_memset(rftid, 0, sizeof(struct fcgs_rftid_req_s));
memset(rftid, 0, sizeof(struct fcgs_rftid_req_s));
rftid->dap = s_id;
/* By default, FCP FC4 Type is registered */
index = FC_TYPE_FCP >> 5;
type_value = 1 << (FC_TYPE_FCP % 32);
rftid->fc4_type[index] = bfa_os_htonl(type_value);
rftid->fc4_type[index] = cpu_to_be32(type_value);
return sizeof(struct fcgs_rftid_req_s) + sizeof(struct ct_hdr_s);
}
@ -1172,10 +1172,10 @@ fc_rftid_build_sol(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
fc_gs_cthdr_build(cthdr, s_id, GS_RFT_ID);
bfa_os_memset(rftid, 0, sizeof(struct fcgs_rftid_req_s));
memset(rftid, 0, sizeof(struct fcgs_rftid_req_s));
rftid->dap = s_id;
bfa_os_memcpy((void *)rftid->fc4_type, (void *)fc4_bitmap,
memcpy((void *)rftid->fc4_type, (void *)fc4_bitmap,
(bitmap_size < 32 ? bitmap_size : 32));
return sizeof(struct fcgs_rftid_req_s) + sizeof(struct ct_hdr_s);
@ -1192,7 +1192,7 @@ fc_rffid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
fc_gs_cthdr_build(cthdr, s_id, GS_RFF_ID);
bfa_os_memset(rffid, 0, sizeof(struct fcgs_rffid_req_s));
memset(rffid, 0, sizeof(struct fcgs_rffid_req_s));
rffid->dap = s_id;
rffid->fc4ftr_bits = fc4_ftrs;
@ -1214,7 +1214,7 @@ fc_rspnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
fc_gs_cthdr_build(cthdr, s_id, GS_RSPN_ID);
bfa_os_memset(rspnid, 0, sizeof(struct fcgs_rspnid_req_s));
memset(rspnid, 0, sizeof(struct fcgs_rspnid_req_s));
rspnid->dap = s_id;
rspnid->spn_len = (u8) strlen((char *)name);
@ -1235,7 +1235,7 @@ fc_gid_ft_build(struct fchs_s *fchs, void *pyld, u32 s_id, u8 fc4_type)
fc_gs_cthdr_build(cthdr, s_id, GS_GID_FT);
bfa_os_memset(gidft, 0, sizeof(struct fcgs_gidft_req_s));
memset(gidft, 0, sizeof(struct fcgs_gidft_req_s));
gidft->fc4_type = fc4_type;
gidft->domain_id = 0;
gidft->area_id = 0;
@ -1254,7 +1254,7 @@ fc_rpnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id,
fc_gs_fchdr_build(fchs, d_id, s_id, 0);
fc_gs_cthdr_build(cthdr, s_id, GS_RPN_ID);
bfa_os_memset(rpnid, 0, sizeof(struct fcgs_rpnid_req_s));
memset(rpnid, 0, sizeof(struct fcgs_rpnid_req_s));
rpnid->port_id = port_id;
rpnid->port_name = port_name;
@ -1272,7 +1272,7 @@ fc_rnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id,
fc_gs_fchdr_build(fchs, d_id, s_id, 0);
fc_gs_cthdr_build(cthdr, s_id, GS_RNN_ID);
bfa_os_memset(rnnid, 0, sizeof(struct fcgs_rnnid_req_s));
memset(rnnid, 0, sizeof(struct fcgs_rnnid_req_s));
rnnid->port_id = port_id;
rnnid->node_name = node_name;
@ -1291,7 +1291,7 @@ fc_rcsid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id,
fc_gs_fchdr_build(fchs, d_id, s_id, 0);
fc_gs_cthdr_build(cthdr, s_id, GS_RCS_ID);
bfa_os_memset(rcsid, 0, sizeof(struct fcgs_rcsid_req_s));
memset(rcsid, 0, sizeof(struct fcgs_rcsid_req_s));
rcsid->port_id = port_id;
rcsid->cos = cos;
@ -1309,7 +1309,7 @@ fc_rptid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id,
fc_gs_fchdr_build(fchs, d_id, s_id, 0);
fc_gs_cthdr_build(cthdr, s_id, GS_RPT_ID);
bfa_os_memset(rptid, 0, sizeof(struct fcgs_rptid_req_s));
memset(rptid, 0, sizeof(struct fcgs_rptid_req_s));
rptid->port_id = port_id;
rptid->port_type = port_type;
@ -1326,7 +1326,7 @@ fc_ganxt_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id)
fc_gs_fchdr_build(fchs, d_id, s_id, 0);
fc_gs_cthdr_build(cthdr, s_id, GS_GA_NXT);
bfa_os_memset(ganxt, 0, sizeof(struct fcgs_ganxt_req_s));
memset(ganxt, 0, sizeof(struct fcgs_ganxt_req_s));
ganxt->port_id = port_id;
return sizeof(struct ct_hdr_s) + sizeof(struct fcgs_ganxt_req_s);
@ -1365,7 +1365,7 @@ fc_get_fc4type_bitmask(u8 fc4_type, u8 *bit_mask)
index = fc4_type >> 5;
type_value = 1 << (fc4_type % 32);
ptr[index] = bfa_os_htonl(type_value);
ptr[index] = cpu_to_be32(type_value);
}
@ -1383,7 +1383,7 @@ fc_gmal_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn)
fc_gs_ms_cthdr_build(cthdr, s_id, GS_FC_GMAL_CMD,
CT_GSSUBTYPE_CFGSERVER);
bfa_os_memset(gmal, 0, sizeof(fcgs_gmal_req_t));
memset(gmal, 0, sizeof(fcgs_gmal_req_t));
gmal->wwn = wwn;
return sizeof(struct ct_hdr_s) + sizeof(fcgs_gmal_req_t);
@ -1403,7 +1403,7 @@ fc_gfn_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn)
fc_gs_ms_cthdr_build(cthdr, s_id, GS_FC_GFN_CMD,
CT_GSSUBTYPE_CFGSERVER);
bfa_os_memset(gfn, 0, sizeof(fcgs_gfn_req_t));
memset(gfn, 0, sizeof(fcgs_gfn_req_t));
gfn->wwn = wwn;
return sizeof(struct ct_hdr_s) + sizeof(fcgs_gfn_req_t);

File diff suppressed because it is too large Load diff

View file

@ -104,7 +104,7 @@ struct bfa_fcpim_mod_s {
bfa_fcpim_profile_t profile_start;
};
/**
/*
* BFA IO (initiator mode)
*/
struct bfa_ioim_s {
@ -137,7 +137,7 @@ struct bfa_ioim_sp_s {
struct bfa_tskim_s *tskim; /* Relevant TM cmd */
};
/**
/*
* BFA Task management command (initiator mode)
*/
struct bfa_tskim_s {
@ -160,7 +160,7 @@ struct bfa_tskim_s {
};
/**
/*
* BFA i-t-n (initiator mode)
*/
struct bfa_itnim_s {
@ -303,7 +303,7 @@ bfa_status_t bfa_itnim_get_ioprofile(struct bfa_itnim_s *itnim,
struct bfa_itnim_ioprofile_s *ioprofile);
#define bfa_itnim_get_reqq(__ioim) (((struct bfa_ioim_s *)__ioim)->itnim->reqq)
/**
/*
* BFA completion callback for bfa_itnim_online().
*
* @param[in] itnim FCS or driver itnim instance
@ -312,7 +312,7 @@ bfa_status_t bfa_itnim_get_ioprofile(struct bfa_itnim_s *itnim,
*/
void bfa_cb_itnim_online(void *itnim);
/**
/*
* BFA completion callback for bfa_itnim_offline().
*
* @param[in] itnim FCS or driver itnim instance
@ -323,7 +323,7 @@ void bfa_cb_itnim_offline(void *itnim);
void bfa_cb_itnim_tov_begin(void *itnim);
void bfa_cb_itnim_tov(void *itnim);
/**
/*
* BFA notification to FCS/driver for second level error recovery.
*
* Atleast one I/O request has timedout and target is unresponsive to
@ -351,7 +351,7 @@ void bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim,
bfa_boolean_t iotov);
/**
/*
* I/O completion notification.
*
* @param[in] dio driver IO structure
@ -368,7 +368,7 @@ void bfa_cb_ioim_done(void *bfad, struct bfad_ioim_s *dio,
u8 scsi_status, int sns_len,
u8 *sns_info, s32 residue);
/**
/*
* I/O good completion notification.
*
* @param[in] dio driver IO structure
@ -377,7 +377,7 @@ void bfa_cb_ioim_done(void *bfad, struct bfad_ioim_s *dio,
*/
void bfa_cb_ioim_good_comp(void *bfad, struct bfad_ioim_s *dio);
/**
/*
* I/O abort completion notification
*
* @param[in] dio driver IO that was aborted

View file

@ -15,7 +15,7 @@
* General Public License for more details.
*/
/**
/*
* bfa_fcs.c BFA FCS main
*/
@ -25,7 +25,7 @@
BFA_TRC_FILE(FCS, FCS);
/**
/*
* FCS sub-modules
*/
struct bfa_fcs_mod_s {
@ -43,7 +43,7 @@ static struct bfa_fcs_mod_s fcs_modules[] = {
bfa_fcs_fabric_modexit },
};
/**
/*
* fcs_api BFA FCS API
*/
@ -58,11 +58,11 @@ bfa_fcs_exit_comp(void *fcs_cbarg)
/**
/*
* fcs_api BFA FCS API
*/
/**
/*
* fcs attach -- called once to initialize data structures at driver attach time
*/
void
@ -86,7 +86,7 @@ bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
}
}
/**
/*
* fcs initialization, called once after bfa initialization is complete
*/
void
@ -110,7 +110,7 @@ bfa_fcs_init(struct bfa_fcs_s *fcs)
}
}
/**
/*
* Start FCS operations.
*/
void
@ -119,7 +119,7 @@ bfa_fcs_start(struct bfa_fcs_s *fcs)
bfa_fcs_fabric_modstart(fcs);
}
/**
/*
* brief
* FCS driver details initialization.
*
@ -138,7 +138,7 @@ bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs,
bfa_fcs_fabric_psymb_init(&fcs->fabric);
}
/**
/*
* brief
* FCS FDMI Driver Parameter Initialization
*
@ -154,7 +154,7 @@ bfa_fcs_set_fdmi_param(struct bfa_fcs_s *fcs, bfa_boolean_t fdmi_enable)
fcs->fdmi_enabled = fdmi_enable;
}
/**
/*
* brief
* FCS instance cleanup and exit.
*
@ -196,7 +196,7 @@ bfa_fcs_modexit_comp(struct bfa_fcs_s *fcs)
bfa_wc_down(&fcs->wc);
}
/**
/*
* Fabric module implementation.
*/
@ -232,11 +232,11 @@ static void bfa_fcs_fabric_flogiacc_comp(void *fcsarg,
u32 rsp_len,
u32 resid_len,
struct fchs_s *rspfchs);
/**
/*
* fcs_fabric_sm fabric state machine functions
*/
/**
/*
* Fabric state machine events
*/
enum bfa_fcs_fabric_event {
@ -286,7 +286,7 @@ static void bfa_fcs_fabric_sm_isolated(struct bfa_fcs_fabric_s *fabric,
enum bfa_fcs_fabric_event event);
static void bfa_fcs_fabric_sm_deleting(struct bfa_fcs_fabric_s *fabric,
enum bfa_fcs_fabric_event event);
/**
/*
* Beginning state before fabric creation.
*/
static void
@ -312,7 +312,7 @@ bfa_fcs_fabric_sm_uninit(struct bfa_fcs_fabric_s *fabric,
}
}
/**
/*
* Beginning state before fabric creation.
*/
static void
@ -345,7 +345,7 @@ bfa_fcs_fabric_sm_created(struct bfa_fcs_fabric_s *fabric,
}
}
/**
/*
* Link is down, awaiting LINK UP event from port. This is also the
* first state at fabric creation.
*/
@ -375,7 +375,7 @@ bfa_fcs_fabric_sm_linkdown(struct bfa_fcs_fabric_s *fabric,
}
}
/**
/*
* FLOGI is in progress, awaiting FLOGI reply.
*/
static void
@ -468,7 +468,7 @@ bfa_fcs_fabric_sm_flogi_retry(struct bfa_fcs_fabric_s *fabric,
}
}
/**
/*
* Authentication is in progress, awaiting authentication results.
*/
static void
@ -508,7 +508,7 @@ bfa_fcs_fabric_sm_auth(struct bfa_fcs_fabric_s *fabric,
}
}
/**
/*
* Authentication failed
*/
static void
@ -534,7 +534,7 @@ bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric,
}
}
/**
/*
* Port is in loopback mode.
*/
static void
@ -560,7 +560,7 @@ bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric,
}
}
/**
/*
* There is no attached fabric - private loop or NPort-to-NPort topology.
*/
static void
@ -593,7 +593,7 @@ bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric,
}
}
/**
/*
* Fabric is online - normal operating state.
*/
static void
@ -628,7 +628,7 @@ bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric,
}
}
/**
/*
* Exchanging virtual fabric parameters.
*/
static void
@ -652,7 +652,7 @@ bfa_fcs_fabric_sm_evfp(struct bfa_fcs_fabric_s *fabric,
}
}
/**
/*
* EVFP exchange complete and VFT tagging is enabled.
*/
static void
@ -663,7 +663,7 @@ bfa_fcs_fabric_sm_evfp_done(struct bfa_fcs_fabric_s *fabric,
bfa_trc(fabric->fcs, event);
}
/**
/*
* Port is isolated after EVFP exchange due to VF_ID mismatch (N and F).
*/
static void
@ -684,7 +684,7 @@ bfa_fcs_fabric_sm_isolated(struct bfa_fcs_fabric_s *fabric,
fabric->event_arg.swp_vfid);
}
/**
/*
* Fabric is being deleted, awaiting vport delete completions.
*/
static void
@ -714,7 +714,7 @@ bfa_fcs_fabric_sm_deleting(struct bfa_fcs_fabric_s *fabric,
/**
/*
* fcs_fabric_private fabric private functions
*/
@ -728,7 +728,7 @@ bfa_fcs_fabric_init(struct bfa_fcs_fabric_s *fabric)
port_cfg->pwwn = bfa_ioc_get_pwwn(&fabric->fcs->bfa->ioc);
}
/**
/*
* Port Symbolic Name Creation for base port.
*/
void
@ -789,7 +789,7 @@ bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)
port_cfg->sym_name.symname[BFA_SYMNAME_MAXLEN - 1] = 0;
}
/**
/*
* bfa lps login completion callback
*/
void
@ -867,7 +867,7 @@ bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status)
bfa_trc(fabric->fcs, fabric->is_npiv);
bfa_trc(fabric->fcs, fabric->is_auth);
}
/**
/*
* Allocate and send FLOGI.
*/
static void
@ -897,7 +897,7 @@ bfa_fcs_fabric_notify_online(struct bfa_fcs_fabric_s *fabric)
bfa_fcs_fabric_set_opertype(fabric);
fabric->stats.fabric_onlines++;
/**
/*
* notify online event to base and then virtual ports
*/
bfa_fcs_lport_online(&fabric->bport);
@ -917,7 +917,7 @@ bfa_fcs_fabric_notify_offline(struct bfa_fcs_fabric_s *fabric)
bfa_trc(fabric->fcs, fabric->fabric_name);
fabric->stats.fabric_offlines++;
/**
/*
* notify offline event first to vports and then base port.
*/
list_for_each_safe(qe, qen, &fabric->vport_q) {
@ -939,7 +939,7 @@ bfa_fcs_fabric_delay(void *cbarg)
bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_DELAYED);
}
/**
/*
* Delete all vports and wait for vport delete completions.
*/
static void
@ -965,11 +965,11 @@ bfa_fcs_fabric_delete_comp(void *cbarg)
bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_DELCOMP);
}
/**
/*
* fcs_fabric_public fabric public functions
*/
/**
/*
* Attach time initialization.
*/
void
@ -978,9 +978,9 @@ bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs)
struct bfa_fcs_fabric_s *fabric;
fabric = &fcs->fabric;
bfa_os_memset(fabric, 0, sizeof(struct bfa_fcs_fabric_s));
memset(fabric, 0, sizeof(struct bfa_fcs_fabric_s));
/**
/*
* Initialize base fabric.
*/
fabric->fcs = fcs;
@ -989,7 +989,7 @@ bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs)
fabric->lps = bfa_lps_alloc(fcs->bfa);
bfa_assert(fabric->lps);
/**
/*
* Initialize fabric delete completion handler. Fabric deletion is
* complete when the last vport delete is complete.
*/
@ -1007,7 +1007,7 @@ bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs)
bfa_trc(fcs, 0);
}
/**
/*
* Module cleanup
*/
void
@ -1017,7 +1017,7 @@ bfa_fcs_fabric_modexit(struct bfa_fcs_s *fcs)
bfa_trc(fcs, 0);
/**
/*
* Cleanup base fabric.
*/
fabric = &fcs->fabric;
@ -1025,7 +1025,7 @@ bfa_fcs_fabric_modexit(struct bfa_fcs_s *fcs)
bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_DELETE);
}
/**
/*
* Fabric module start -- kick starts FCS actions
*/
void
@ -1038,7 +1038,7 @@ bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs)
bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_START);
}
/**
/*
* Suspend fabric activity as part of driver suspend.
*/
void
@ -1064,7 +1064,7 @@ bfa_fcs_fabric_port_type(struct bfa_fcs_fabric_s *fabric)
return fabric->oper_type;
}
/**
/*
* Link up notification from BFA physical port module.
*/
void
@ -1074,7 +1074,7 @@ bfa_fcs_fabric_link_up(struct bfa_fcs_fabric_s *fabric)
bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LINK_UP);
}
/**
/*
* Link down notification from BFA physical port module.
*/
void
@ -1084,7 +1084,7 @@ bfa_fcs_fabric_link_down(struct bfa_fcs_fabric_s *fabric)
bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LINK_DOWN);
}
/**
/*
* A child vport is being created in the fabric.
*
* Call from vport module at vport creation. A list of base port and vports
@ -1099,7 +1099,7 @@ void
bfa_fcs_fabric_addvport(struct bfa_fcs_fabric_s *fabric,
struct bfa_fcs_vport_s *vport)
{
/**
/*
* - add vport to fabric's vport_q
*/
bfa_trc(fabric->fcs, fabric->vf_id);
@ -1109,7 +1109,7 @@ bfa_fcs_fabric_addvport(struct bfa_fcs_fabric_s *fabric,
bfa_wc_up(&fabric->wc);
}
/**
/*
* A child vport is being deleted from fabric.
*
* Vport is being deleted.
@ -1123,7 +1123,7 @@ bfa_fcs_fabric_delvport(struct bfa_fcs_fabric_s *fabric,
bfa_wc_down(&fabric->wc);
}
/**
/*
* Base port is deleted.
*/
void
@ -1133,7 +1133,7 @@ bfa_fcs_fabric_port_delete_comp(struct bfa_fcs_fabric_s *fabric)
}
/**
/*
* Check if fabric is online.
*
* param[in] fabric - Fabric instance. This can be a base fabric or vf.
@ -1146,7 +1146,7 @@ bfa_fcs_fabric_is_online(struct bfa_fcs_fabric_s *fabric)
return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_online);
}
/**
/*
* brief
*
*/
@ -1158,7 +1158,7 @@ bfa_fcs_fabric_addvf(struct bfa_fcs_fabric_s *vf, struct bfa_fcs_s *fcs,
return BFA_STATUS_OK;
}
/**
/*
* Lookup for a vport withing a fabric given its pwwn
*/
struct bfa_fcs_vport_s *
@ -1176,7 +1176,7 @@ bfa_fcs_fabric_vport_lookup(struct bfa_fcs_fabric_s *fabric, wwn_t pwwn)
return NULL;
}
/**
/*
* In a given fabric, return the number of lports.
*
* param[in] fabric - Fabric instance. This can be a base fabric or vf.
@ -1214,7 +1214,7 @@ bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric)
return oui;
}
/**
/*
* Unsolicited frame receive handling.
*/
void
@ -1230,7 +1230,7 @@ bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs,
bfa_trc(fabric->fcs, len);
bfa_trc(fabric->fcs, pid);
/**
/*
* Look for our own FLOGI frames being looped back. This means an
* external loopback cable is in place. Our own FLOGI frames are
* sometimes looped back when switch port gets temporarily bypassed.
@ -1242,7 +1242,7 @@ bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs,
return;
}
/**
/*
* FLOGI/EVFP exchanges should be consumed by base fabric.
*/
if (fchs->d_id == bfa_os_hton3b(FC_FABRIC_PORT)) {
@ -1252,7 +1252,7 @@ bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs,
}
if (fabric->bport.pid == pid) {
/**
/*
* All authentication frames should be routed to auth
*/
bfa_trc(fabric->fcs, els_cmd->els_code);
@ -1266,7 +1266,7 @@ bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs,
return;
}
/**
/*
* look for a matching local port ID
*/
list_for_each(qe, &fabric->vport_q) {
@ -1280,7 +1280,7 @@ bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs,
bfa_fcs_lport_uf_recv(&fabric->bport, fchs, len);
}
/**
/*
* Unsolicited frames to be processed by fabric.
*/
static void
@ -1304,7 +1304,7 @@ bfa_fcs_fabric_process_uf(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs,
}
}
/**
/*
* Process incoming FLOGI
*/
static void
@ -1329,7 +1329,7 @@ bfa_fcs_fabric_process_flogi(struct bfa_fcs_fabric_s *fabric,
return;
}
fabric->bb_credit = bfa_os_ntohs(flogi->csp.bbcred);
fabric->bb_credit = be16_to_cpu(flogi->csp.bbcred);
bport->port_topo.pn2n.rem_port_wwn = flogi->port_name;
bport->port_topo.pn2n.reply_oxid = fchs->ox_id;
@ -1351,7 +1351,7 @@ bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric)
struct fchs_s fchs;
fcxp = bfa_fcs_fcxp_alloc(fabric->fcs);
/**
/*
* Do not expect this failure -- expect remote node to retry
*/
if (!fcxp)
@ -1370,7 +1370,7 @@ bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric)
FC_MAX_PDUSZ, 0);
}
/**
/*
* Flogi Acc completion callback.
*/
static void
@ -1417,130 +1417,7 @@ bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric,
}
}
/**
* fcs_vf_api virtual fabrics API
*/
/**
* Enable VF mode.
*
* @param[in] fcs fcs module instance
* @param[in] vf_id default vf_id of port, FC_VF_ID_NULL
* to use standard default vf_id of 1.
*
* @retval BFA_STATUS_OK vf mode is enabled
* @retval BFA_STATUS_BUSY Port is active. Port must be disabled
* before VF mode can be enabled.
*/
bfa_status_t
bfa_fcs_vf_mode_enable(struct bfa_fcs_s *fcs, u16 vf_id)
{
return BFA_STATUS_OK;
}
/**
* Disable VF mode.
*
* @param[in] fcs fcs module instance
*
* @retval BFA_STATUS_OK vf mode is disabled
* @retval BFA_STATUS_BUSY VFs are present and being used. All
* VFs must be deleted before disabling
* VF mode.
*/
bfa_status_t
bfa_fcs_vf_mode_disable(struct bfa_fcs_s *fcs)
{
return BFA_STATUS_OK;
}
/**
* Create a new VF instance.
*
* A new VF is created using the given VF configuration. A VF is identified
* by VF id. No duplicate VF creation is allowed with the same VF id. Once
* a VF is created, VF is automatically started after link initialization
* and EVFP exchange is completed.
*
* param[in] vf - FCS vf data structure. Memory is
* allocated by caller (driver)
* param[in] fcs - FCS module
* param[in] vf_cfg - VF configuration
* param[in] vf_drv - Opaque handle back to the driver's
* virtual vf structure
*
* retval BFA_STATUS_OK VF creation is successful
* retval BFA_STATUS_FAILED VF creation failed
* retval BFA_STATUS_EEXIST A VF exists with the given vf_id
*/
bfa_status_t
bfa_fcs_vf_create(bfa_fcs_vf_t *vf, struct bfa_fcs_s *fcs, u16 vf_id,
struct bfa_lport_cfg_s *port_cfg, struct bfad_vf_s *vf_drv)
{
bfa_trc(fcs, vf_id);
return BFA_STATUS_OK;
}
/**
* Use this function to delete a BFA VF object. VF object should
* be stopped before this function call.
*
* param[in] vf - pointer to bfa_vf_t.
*
* retval BFA_STATUS_OK On vf deletion success
* retval BFA_STATUS_BUSY VF is not in a stopped state
* retval BFA_STATUS_INPROGRESS VF deletion in in progress
*/
bfa_status_t
bfa_fcs_vf_delete(bfa_fcs_vf_t *vf)
{
bfa_trc(vf->fcs, vf->vf_id);
return BFA_STATUS_OK;
}
/**
* Returns attributes of the given VF.
*
* param[in] vf pointer to bfa_vf_t.
* param[out] vf_attr vf attributes returned
*
* return None
*/
void
bfa_fcs_vf_get_attr(bfa_fcs_vf_t *vf, struct bfa_vf_attr_s *vf_attr)
{
bfa_trc(vf->fcs, vf->vf_id);
}
/**
* Return statistics associated with the given vf.
*
* param[in] vf pointer to bfa_vf_t.
* param[out] vf_stats vf statistics returned
*
* @return None
*/
void
bfa_fcs_vf_get_stats(bfa_fcs_vf_t *vf, struct bfa_vf_stats_s *vf_stats)
{
bfa_os_memcpy(vf_stats, &vf->stats, sizeof(struct bfa_vf_stats_s));
}
/**
* clear statistics associated with the given vf.
*
* param[in] vf pointer to bfa_vf_t.
*
* @return None
*/
void
bfa_fcs_vf_clear_stats(bfa_fcs_vf_t *vf)
{
bfa_os_memset(&vf->stats, 0, sizeof(struct bfa_vf_stats_s));
}
/**
/*
* Returns FCS vf structure for a given vf_id.
*
* param[in] vf_id - VF_ID
@ -1558,81 +1435,7 @@ bfa_fcs_vf_lookup(struct bfa_fcs_s *fcs, u16 vf_id)
return NULL;
}
/**
* Return the list of VFs configured.
*
* param[in] fcs fcs module instance
* param[out] vf_ids returned list of vf_ids
* param[in,out] nvfs in:size of vf_ids array,
* out:total elements present,
* actual elements returned is limited by the size
*
* return Driver VF structure
*/
void
bfa_fcs_vf_list(struct bfa_fcs_s *fcs, u16 *vf_ids, int *nvfs)
{
bfa_trc(fcs, *nvfs);
}
/**
* Return the list of all VFs visible from fabric.
*
* param[in] fcs fcs module instance
* param[out] vf_ids returned list of vf_ids
* param[in,out] nvfs in:size of vf_ids array,
* out:total elements present,
* actual elements returned is limited by the size
*
* return Driver VF structure
*/
void
bfa_fcs_vf_list_all(struct bfa_fcs_s *fcs, u16 *vf_ids, int *nvfs)
{
bfa_trc(fcs, *nvfs);
}
/**
* Return the list of local logical ports present in the given VF.
*
* param[in] vf vf for which logical ports are returned
* param[out] lpwwn returned logical port wwn list
* param[in,out] nlports in:size of lpwwn list;
* out:total elements present,
* actual elements returned is limited by the size
*/
void
bfa_fcs_vf_get_ports(bfa_fcs_vf_t *vf, wwn_t lpwwn[], int *nlports)
{
struct list_head *qe;
struct bfa_fcs_vport_s *vport;
int i;
struct bfa_fcs_s *fcs;
if (vf == NULL || lpwwn == NULL || *nlports == 0)
return;
fcs = vf->fcs;
bfa_trc(fcs, vf->vf_id);
bfa_trc(fcs, (u32) *nlports);
i = 0;
lpwwn[i++] = vf->bport.port_cfg.pwwn;
list_for_each(qe, &vf->vport_q) {
if (i >= *nlports)
break;
vport = (struct bfa_fcs_vport_s *) qe;
lpwwn[i++] = vport->lport.port_cfg.pwwn;
}
bfa_trc(fcs, i);
*nlports = i;
}
/**
/*
* BFA FCS PPORT ( physical port)
*/
static void
@ -1662,11 +1465,11 @@ bfa_fcs_port_attach(struct bfa_fcs_s *fcs)
bfa_fcport_event_register(fcs->bfa, bfa_fcs_port_event_handler, fcs);
}
/**
/*
* BFA FCS UF ( Unsolicited Frames)
*/
/**
/*
* BFA callback for unsolicited frame receive handler.
*
* @param[in] cbarg callback arg for receive handler
@ -1683,7 +1486,7 @@ bfa_fcs_uf_recv(void *cbarg, struct bfa_uf_s *uf)
struct fc_vft_s *vft;
struct bfa_fcs_fabric_s *fabric;
/**
/*
* check for VFT header
*/
if (fchs->routing == FC_RTG_EXT_HDR &&
@ -1695,7 +1498,7 @@ bfa_fcs_uf_recv(void *cbarg, struct bfa_uf_s *uf)
else
fabric = bfa_fcs_vf_lookup(fcs, (u16) vft->vf_id);
/**
/*
* drop frame if vfid is unknown
*/
if (!fabric) {
@ -1705,7 +1508,7 @@ bfa_fcs_uf_recv(void *cbarg, struct bfa_uf_s *uf)
return;
}
/**
/*
* skip vft header
*/
fchs = (struct fchs_s *) (vft + 1);

View file

@ -196,7 +196,7 @@ struct bfa_fcs_fabric_s {
#define bfa_fcs_fabric_is_switched(__f) \
((__f)->fab_type == BFA_FCS_FABRIC_SWITCHED)
/**
/*
* The design calls for a single implementation of base fabric and vf.
*/
#define bfa_fcs_vf_t struct bfa_fcs_fabric_s
@ -216,7 +216,7 @@ struct bfa_fcs_fabric_s;
#define bfa_fcs_lport_t struct bfa_fcs_lport_s
/**
/*
* Symbolic Name related defines
* Total bytes 255.
* Physical Port's symbolic name 128 bytes.
@ -239,7 +239,7 @@ struct bfa_fcs_fabric_s;
#define BFA_FCS_PORT_SYMBNAME_OSINFO_SZ 48
#define BFA_FCS_PORT_SYMBNAME_OSPATCH_SZ 16
/**
/*
* Get FC port ID for a logical port.
*/
#define bfa_fcs_lport_get_fcid(_lport) ((_lport)->pid)
@ -262,7 +262,7 @@ bfa_fcs_lport_get_drvport(struct bfa_fcs_lport_s *port)
#define bfa_fcs_lport_get_fabric_ipaddr(_lport) \
((_lport)->fabric->fabric_ip_addr)
/**
/*
* bfa fcs port public functions
*/
@ -342,7 +342,7 @@ struct bfa_fcs_vport_s {
#define bfa_fcs_vport_get_port(vport) \
((struct bfa_fcs_lport_s *)(&vport->port))
/**
/*
* bfa fcs vport public functions
*/
bfa_status_t bfa_fcs_vport_create(struct bfa_fcs_vport_s *vport,
@ -393,7 +393,7 @@ struct bfa_fcs_rpf_s {
enum bfa_port_speed rpsc_speed;
/* Current Speed from RPSC. O if RPSC fails */
enum bfa_port_speed assigned_speed;
/**
/*
* Speed assigned by the user. will be used if RPSC is
* not supported by the rport.
*/
@ -434,7 +434,7 @@ bfa_fcs_rport_get_halrport(struct bfa_fcs_rport_s *rport)
return rport->bfa_rport;
}
/**
/*
* bfa fcs rport API functions
*/
bfa_status_t bfa_fcs_rport_add(struct bfa_fcs_lport_s *port, wwn_t *pwwn,
@ -573,7 +573,7 @@ bfa_fcs_itnim_get_halitn(struct bfa_fcs_itnim_s *itnim)
return itnim->bfa_itnim;
}
/**
/*
* bfa fcs FCP Initiator mode API functions
*/
void bfa_fcs_itnim_get_attr(struct bfa_fcs_itnim_s *itnim,
@ -677,22 +677,9 @@ void bfa_fcs_exit(struct bfa_fcs_s *fcs);
void bfa_fcs_trc_init(struct bfa_fcs_s *fcs, struct bfa_trc_mod_s *trcmod);
void bfa_fcs_start(struct bfa_fcs_s *fcs);
/**
/*
* bfa fcs vf public functions
*/
bfa_status_t bfa_fcs_vf_mode_enable(struct bfa_fcs_s *fcs, u16 vf_id);
bfa_status_t bfa_fcs_vf_mode_disable(struct bfa_fcs_s *fcs);
bfa_status_t bfa_fcs_vf_create(bfa_fcs_vf_t *vf, struct bfa_fcs_s *fcs,
u16 vf_id, struct bfa_lport_cfg_s *port_cfg,
struct bfad_vf_s *vf_drv);
bfa_status_t bfa_fcs_vf_delete(bfa_fcs_vf_t *vf);
void bfa_fcs_vf_list(struct bfa_fcs_s *fcs, u16 *vf_ids, int *nvfs);
void bfa_fcs_vf_list_all(struct bfa_fcs_s *fcs, u16 *vf_ids, int *nvfs);
void bfa_fcs_vf_get_attr(bfa_fcs_vf_t *vf, struct bfa_vf_attr_s *vf_attr);
void bfa_fcs_vf_get_stats(bfa_fcs_vf_t *vf,
struct bfa_vf_stats_s *vf_stats);
void bfa_fcs_vf_clear_stats(bfa_fcs_vf_t *vf);
void bfa_fcs_vf_get_ports(bfa_fcs_vf_t *vf, wwn_t vpwwn[], int *nports);
bfa_fcs_vf_t *bfa_fcs_vf_lookup(struct bfa_fcs_s *fcs, u16 vf_id);
u16 bfa_fcs_fabric_vport_count(struct bfa_fcs_fabric_s *fabric);
@ -729,11 +716,11 @@ u16 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric);
void bfa_fcs_uf_attach(struct bfa_fcs_s *fcs);
void bfa_fcs_port_attach(struct bfa_fcs_s *fcs);
/**
/*
* BFA FCS callback interfaces
*/
/**
/*
* fcb Main fcs callbacks
*/
@ -742,7 +729,7 @@ struct bfad_vf_s;
struct bfad_vport_s;
struct bfad_rport_s;
/**
/*
* lport callbacks
*/
struct bfad_port_s *bfa_fcb_lport_new(struct bfad_s *bfad,
@ -754,19 +741,19 @@ void bfa_fcb_lport_delete(struct bfad_s *bfad, enum bfa_lport_role roles,
struct bfad_vf_s *vf_drv,
struct bfad_vport_s *vp_drv);
/**
/*
* vport callbacks
*/
void bfa_fcb_pbc_vport_create(struct bfad_s *bfad, struct bfi_pbc_vport_s);
/**
/*
* rport callbacks
*/
bfa_status_t bfa_fcb_rport_alloc(struct bfad_s *bfad,
struct bfa_fcs_rport_s **rport,
struct bfad_rport_s **rport_drv);
/**
/*
* itnim callbacks
*/
void bfa_fcb_itnim_alloc(struct bfad_s *bfad, struct bfa_fcs_itnim_s **itnim,

View file

@ -15,7 +15,7 @@
* General Public License for more details.
*/
/**
/*
* fcpim.c - FCP initiator mode i-t nexus state machine
*/
@ -38,7 +38,7 @@ static void bfa_fcs_itnim_prli_response(void *fcsarg,
bfa_status_t req_status, u32 rsp_len,
u32 resid_len, struct fchs_s *rsp_fchs);
/**
/*
* fcs_itnim_sm FCS itnim state machine events
*/
@ -84,7 +84,7 @@ static struct bfa_sm_table_s itnim_sm_table[] = {
{BFA_SM(bfa_fcs_itnim_sm_initiator), BFA_ITNIM_INITIATIOR},
};
/**
/*
* fcs_itnim_sm FCS itnim state machine
*/
@ -494,11 +494,11 @@ bfa_fcs_itnim_free(struct bfa_fcs_itnim_s *itnim)
/**
/*
* itnim_public FCS ITNIM public interfaces
*/
/**
/*
* Called by rport when a new rport is created.
*
* @param[in] rport - remote port.
@ -554,7 +554,7 @@ bfa_fcs_itnim_create(struct bfa_fcs_rport_s *rport)
return itnim;
}
/**
/*
* Called by rport to delete the instance of FCPIM.
*
* @param[in] rport - remote port.
@ -566,7 +566,7 @@ bfa_fcs_itnim_delete(struct bfa_fcs_itnim_s *itnim)
bfa_sm_send_event(itnim, BFA_FCS_ITNIM_SM_DELETE);
}
/**
/*
* Notification from rport that PLOGI is complete to initiate FC-4 session.
*/
void
@ -586,7 +586,7 @@ bfa_fcs_itnim_rport_online(struct bfa_fcs_itnim_s *itnim)
}
}
/**
/*
* Called by rport to handle a remote device offline.
*/
void
@ -596,7 +596,7 @@ bfa_fcs_itnim_rport_offline(struct bfa_fcs_itnim_s *itnim)
bfa_sm_send_event(itnim, BFA_FCS_ITNIM_SM_OFFLINE);
}
/**
/*
* Called by rport when remote port is known to be an initiator from
* PRLI received.
*/
@ -608,7 +608,7 @@ bfa_fcs_itnim_is_initiator(struct bfa_fcs_itnim_s *itnim)
bfa_sm_send_event(itnim, BFA_FCS_ITNIM_SM_INITIATOR);
}
/**
/*
* Called by rport to check if the itnim is online.
*/
bfa_status_t
@ -625,7 +625,7 @@ bfa_fcs_itnim_get_online_state(struct bfa_fcs_itnim_s *itnim)
}
}
/**
/*
* BFA completion callback for bfa_itnim_online().
*/
void
@ -637,7 +637,7 @@ bfa_cb_itnim_online(void *cbarg)
bfa_sm_send_event(itnim, BFA_FCS_ITNIM_SM_HCB_ONLINE);
}
/**
/*
* BFA completion callback for bfa_itnim_offline().
*/
void
@ -649,7 +649,7 @@ bfa_cb_itnim_offline(void *cb_arg)
bfa_sm_send_event(itnim, BFA_FCS_ITNIM_SM_HCB_OFFLINE);
}
/**
/*
* Mark the beginning of PATH TOV handling. IO completion callbacks
* are still pending.
*/
@ -661,7 +661,7 @@ bfa_cb_itnim_tov_begin(void *cb_arg)
bfa_trc(itnim->fcs, itnim->rport->pwwn);
}
/**
/*
* Mark the end of PATH TOV handling. All pending IOs are already cleaned up.
*/
void
@ -674,7 +674,7 @@ bfa_cb_itnim_tov(void *cb_arg)
itnim_drv->state = ITNIM_STATE_TIMEOUT;
}
/**
/*
* BFA notification to FCS/driver for second level error recovery.
*
* Atleast one I/O request has timedout and target is unresponsive to
@ -736,7 +736,7 @@ bfa_fcs_itnim_stats_get(struct bfa_fcs_lport_s *port, wwn_t rpwwn,
if (itnim == NULL)
return BFA_STATUS_NO_FCPIM_NEXUS;
bfa_os_memcpy(stats, &itnim->stats, sizeof(struct bfa_itnim_stats_s));
memcpy(stats, &itnim->stats, sizeof(struct bfa_itnim_stats_s));
return BFA_STATUS_OK;
}
@ -753,7 +753,7 @@ bfa_fcs_itnim_stats_clear(struct bfa_fcs_lport_s *port, wwn_t rpwwn)
if (itnim == NULL)
return BFA_STATUS_NO_FCPIM_NEXUS;
bfa_os_memset(&itnim->stats, 0, sizeof(struct bfa_itnim_stats_s));
memset(&itnim->stats, 0, sizeof(struct bfa_itnim_stats_s));
return BFA_STATUS_OK;
}

File diff suppressed because it is too large Load diff

View file

@ -15,7 +15,7 @@
* General Public License for more details.
*/
/**
/*
* rport.c Remote port implementation.
*/
@ -75,7 +75,7 @@ static void bfa_fcs_rport_send_ls_rjt(struct bfa_fcs_rport_s *rport,
static void bfa_fcs_rport_process_adisc(struct bfa_fcs_rport_s *rport,
struct fchs_s *rx_fchs, u16 len);
static void bfa_fcs_rport_send_prlo_acc(struct bfa_fcs_rport_s *rport);
/**
/*
* fcs_rport_sm FCS rport state machine events
*/
@ -172,7 +172,7 @@ static struct bfa_sm_table_s rport_sm_table[] = {
{BFA_SM(bfa_fcs_rport_sm_nsdisc_sent), BFA_RPORT_NSDISC},
};
/**
/*
* Beginning state.
*/
static void
@ -210,7 +210,7 @@ bfa_fcs_rport_sm_uninit(struct bfa_fcs_rport_s *rport, enum rport_event event)
}
}
/**
/*
* PLOGI is being sent.
*/
static void
@ -262,7 +262,7 @@ bfa_fcs_rport_sm_plogi_sending(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* PLOGI is being sent.
*/
static void
@ -287,7 +287,7 @@ bfa_fcs_rport_sm_plogiacc_sending(struct bfa_fcs_rport_s *rport,
case RPSM_EVENT_PLOGI_RCVD:
case RPSM_EVENT_SCN:
/**
/*
* Ignore, SCN is possibly online notification.
*/
break;
@ -309,7 +309,7 @@ bfa_fcs_rport_sm_plogiacc_sending(struct bfa_fcs_rport_s *rport,
break;
case RPSM_EVENT_HCB_OFFLINE:
/**
/*
* Ignore BFA callback, on a PLOGI receive we call bfa offline.
*/
break;
@ -319,7 +319,7 @@ bfa_fcs_rport_sm_plogiacc_sending(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* PLOGI is sent.
*/
static void
@ -380,7 +380,7 @@ bfa_fcs_rport_sm_plogi_retry(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* PLOGI is sent.
*/
static void
@ -475,7 +475,7 @@ bfa_fcs_rport_sm_plogi(struct bfa_fcs_rport_s *rport, enum rport_event event)
}
}
/**
/*
* PLOGI is complete. Awaiting BFA rport online callback. FC-4s
* are offline.
*/
@ -519,7 +519,7 @@ bfa_fcs_rport_sm_hal_online(struct bfa_fcs_rport_s *rport,
break;
case RPSM_EVENT_SCN:
/**
/*
* @todo
* Ignore SCN - PLOGI just completed, FC-4 login should detect
* device failures.
@ -531,7 +531,7 @@ bfa_fcs_rport_sm_hal_online(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* Rport is ONLINE. FC-4s active.
*/
static void
@ -580,7 +580,7 @@ bfa_fcs_rport_sm_online(struct bfa_fcs_rport_s *rport, enum rport_event event)
}
}
/**
/*
* An SCN event is received in ONLINE state. NS query is being sent
* prior to ADISC authentication with rport. FC-4s are paused.
*/
@ -604,7 +604,7 @@ bfa_fcs_rport_sm_nsquery_sending(struct bfa_fcs_rport_s *rport,
break;
case RPSM_EVENT_SCN:
/**
/*
* ignore SCN, wait for response to query itself
*/
break;
@ -638,7 +638,7 @@ bfa_fcs_rport_sm_nsquery_sending(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* An SCN event is received in ONLINE state. NS query is sent to rport.
* FC-4s are paused.
*/
@ -697,7 +697,7 @@ bfa_fcs_rport_sm_nsquery(struct bfa_fcs_rport_s *rport, enum rport_event event)
}
}
/**
/*
* An SCN event is received in ONLINE state. ADISC is being sent for
* authenticating with rport. FC-4s are paused.
*/
@ -748,7 +748,7 @@ bfa_fcs_rport_sm_adisc_sending(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* An SCN event is received in ONLINE state. ADISC is to rport.
* FC-4s are paused.
*/
@ -765,7 +765,7 @@ bfa_fcs_rport_sm_adisc(struct bfa_fcs_rport_s *rport, enum rport_event event)
break;
case RPSM_EVENT_PLOGI_RCVD:
/**
/*
* Too complex to cleanup FC-4 & rport and then acc to PLOGI.
* At least go offline when a PLOGI is received.
*/
@ -787,7 +787,7 @@ bfa_fcs_rport_sm_adisc(struct bfa_fcs_rport_s *rport, enum rport_event event)
break;
case RPSM_EVENT_SCN:
/**
/*
* already processing RSCN
*/
break;
@ -810,7 +810,7 @@ bfa_fcs_rport_sm_adisc(struct bfa_fcs_rport_s *rport, enum rport_event event)
}
}
/**
/*
* Rport has sent LOGO. Awaiting FC-4 offline completion callback.
*/
static void
@ -841,7 +841,7 @@ bfa_fcs_rport_sm_fc4_logorcv(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* LOGO needs to be sent to rport. Awaiting FC-4 offline completion
* callback.
*/
@ -864,7 +864,7 @@ bfa_fcs_rport_sm_fc4_logosend(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* Rport is going offline. Awaiting FC-4 offline completion callback.
*/
static void
@ -886,7 +886,7 @@ bfa_fcs_rport_sm_fc4_offline(struct bfa_fcs_rport_s *rport,
case RPSM_EVENT_LOGO_RCVD:
case RPSM_EVENT_PRLO_RCVD:
case RPSM_EVENT_ADDRESS_CHANGE:
/**
/*
* rport is already going offline.
* SCN - ignore and wait till transitioning to offline state
*/
@ -901,7 +901,7 @@ bfa_fcs_rport_sm_fc4_offline(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* Rport is offline. FC-4s are offline. Awaiting BFA rport offline
* callback.
*/
@ -945,7 +945,7 @@ bfa_fcs_rport_sm_hcb_offline(struct bfa_fcs_rport_s *rport,
case RPSM_EVENT_SCN:
case RPSM_EVENT_LOGO_RCVD:
case RPSM_EVENT_PRLO_RCVD:
/**
/*
* Ignore, already offline.
*/
break;
@ -955,7 +955,7 @@ bfa_fcs_rport_sm_hcb_offline(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* Rport is offline. FC-4s are offline. Awaiting BFA rport offline
* callback to send LOGO accept.
*/
@ -1009,7 +1009,7 @@ bfa_fcs_rport_sm_hcb_logorcv(struct bfa_fcs_rport_s *rport,
case RPSM_EVENT_LOGO_RCVD:
case RPSM_EVENT_PRLO_RCVD:
/**
/*
* Ignore - already processing a LOGO.
*/
break;
@ -1019,7 +1019,7 @@ bfa_fcs_rport_sm_hcb_logorcv(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* Rport is being deleted. FC-4s are offline.
* Awaiting BFA rport offline
* callback to send LOGO.
@ -1048,7 +1048,7 @@ bfa_fcs_rport_sm_hcb_logosend(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* Rport is being deleted. FC-4s are offline. LOGO is being sent.
*/
static void
@ -1082,7 +1082,7 @@ bfa_fcs_rport_sm_logo_sending(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* Rport is offline. FC-4s are offline. BFA rport is offline.
* Timer active to delete stale rport.
*/
@ -1142,7 +1142,7 @@ bfa_fcs_rport_sm_offline(struct bfa_fcs_rport_s *rport, enum rport_event event)
}
}
/**
/*
* Rport address has changed. Nameserver discovery request is being sent.
*/
static void
@ -1199,7 +1199,7 @@ bfa_fcs_rport_sm_nsdisc_sending(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* Nameserver discovery failed. Waiting for timeout to retry.
*/
static void
@ -1263,7 +1263,7 @@ bfa_fcs_rport_sm_nsdisc_retry(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* Rport address has changed. Nameserver discovery request is sent.
*/
static void
@ -1329,13 +1329,13 @@ bfa_fcs_rport_sm_nsdisc_sent(struct bfa_fcs_rport_s *rport,
bfa_fcs_rport_send_prlo_acc(rport);
break;
case RPSM_EVENT_SCN:
/**
/*
* ignore, wait for NS query response
*/
break;
case RPSM_EVENT_LOGO_RCVD:
/**
/*
* Not logged-in yet. Accept LOGO.
*/
bfa_fcs_rport_send_logo_acc(rport);
@ -1354,7 +1354,7 @@ bfa_fcs_rport_sm_nsdisc_sent(struct bfa_fcs_rport_s *rport,
/**
/*
* fcs_rport_private FCS RPORT provate functions
*/
@ -1415,7 +1415,7 @@ bfa_fcs_rport_plogi_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
plogi_rsp = (struct fc_logi_s *) BFA_FCXP_RSP_PLD(fcxp);
/**
/*
* Check for failure first.
*/
if (plogi_rsp->els_cmd.els_code != FC_ELS_ACC) {
@ -1436,7 +1436,7 @@ bfa_fcs_rport_plogi_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
return;
}
/**
/*
* PLOGI is complete. Make sure this device is not one of the known
* device with a new FC port address.
*/
@ -1468,7 +1468,7 @@ bfa_fcs_rport_plogi_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
}
}
/**
/*
* Normal login path -- no evil twins.
*/
rport->stats.plogi_accs++;
@ -1621,7 +1621,7 @@ bfa_fcs_rport_gidpn_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
bfa_trc(rport->fcs, rport->pwwn);
cthdr = (struct ct_hdr_s *) BFA_FCXP_RSP_PLD(fcxp);
cthdr->cmd_rsp_code = bfa_os_ntohs(cthdr->cmd_rsp_code);
cthdr->cmd_rsp_code = be16_to_cpu(cthdr->cmd_rsp_code);
if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) {
/* Check if the pid is the same as before. */
@ -1691,7 +1691,7 @@ bfa_fcs_rport_gpnid_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
bfa_trc(rport->fcs, rport->pwwn);
cthdr = (struct ct_hdr_s *) BFA_FCXP_RSP_PLD(fcxp);
cthdr->cmd_rsp_code = bfa_os_ntohs(cthdr->cmd_rsp_code);
cthdr->cmd_rsp_code = be16_to_cpu(cthdr->cmd_rsp_code);
if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) {
bfa_sm_send_event(rport, RPSM_EVENT_ACCEPTED);
@ -1722,7 +1722,7 @@ bfa_fcs_rport_gpnid_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
}
}
/**
/*
* Called to send a logout to the rport.
*/
static void
@ -1759,7 +1759,7 @@ bfa_fcs_rport_send_logo(void *rport_cbarg, struct bfa_fcxp_s *fcxp_alloced)
bfa_sm_send_event(rport, RPSM_EVENT_FCXP_SENT);
}
/**
/*
* Send ACC for a LOGO received.
*/
static void
@ -1788,7 +1788,7 @@ bfa_fcs_rport_send_logo_acc(void *rport_cbarg)
FC_CLASS_3, len, &fchs, NULL, NULL, FC_MAX_PDUSZ, 0);
}
/**
/*
* brief
* This routine will be called by bfa_timer on timer timeouts.
*
@ -1961,7 +1961,7 @@ bfa_fcs_rport_alloc(struct bfa_fcs_lport_s *port, wwn_t pwwn, u32 rpid)
struct bfa_fcs_rport_s *rport;
struct bfad_rport_s *rport_drv;
/**
/*
* allocate rport
*/
if (bfa_fcb_rport_alloc(fcs->bfad, &rport, &rport_drv)
@ -1979,7 +1979,7 @@ bfa_fcs_rport_alloc(struct bfa_fcs_lport_s *port, wwn_t pwwn, u32 rpid)
rport->pid = rpid;
rport->pwwn = pwwn;
/**
/*
* allocate BFA rport
*/
rport->bfa_rport = bfa_rport_create(port->fcs->bfa, rport);
@ -1989,7 +1989,7 @@ bfa_fcs_rport_alloc(struct bfa_fcs_lport_s *port, wwn_t pwwn, u32 rpid)
return NULL;
}
/**
/*
* allocate FC-4s
*/
bfa_assert(bfa_fcs_lport_is_initiator(port));
@ -2021,7 +2021,7 @@ bfa_fcs_rport_free(struct bfa_fcs_rport_s *rport)
{
struct bfa_fcs_lport_s *port = rport->port;
/**
/*
* - delete FC-4s
* - delete BFA rport
* - remove from queue of rports
@ -2093,7 +2093,7 @@ bfa_fcs_rport_offline_action(struct bfa_fcs_rport_s *rport)
}
}
/**
/*
* Update rport parameters from PLOGI or PLOGI accept.
*/
static void
@ -2101,14 +2101,14 @@ bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport, struct fc_logi_s *plogi)
{
bfa_fcs_lport_t *port = rport->port;
/**
/*
* - port name
* - node name
*/
rport->pwwn = plogi->port_name;
rport->nwwn = plogi->node_name;
/**
/*
* - class of service
*/
rport->fc_cos = 0;
@ -2118,16 +2118,16 @@ bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport, struct fc_logi_s *plogi)
if (plogi->class2.class_valid)
rport->fc_cos |= FC_CLASS_2;
/**
/*
* - CISC
* - MAX receive frame size
*/
rport->cisc = plogi->csp.cisc;
rport->maxfrsize = bfa_os_ntohs(plogi->class3.rxsz);
rport->maxfrsize = be16_to_cpu(plogi->class3.rxsz);
bfa_trc(port->fcs, bfa_os_ntohs(plogi->csp.bbcred));
bfa_trc(port->fcs, be16_to_cpu(plogi->csp.bbcred));
bfa_trc(port->fcs, port->fabric->bb_credit);
/**
/*
* Direct Attach P2P mode :
* This is to handle a bug (233476) in IBM targets in Direct Attach
* Mode. Basically, in FLOGI Accept the target would have
@ -2136,19 +2136,19 @@ bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport, struct fc_logi_s *plogi)
* in PLOGI.
*/
if ((!bfa_fcs_fabric_is_switched(port->fabric)) &&
(bfa_os_ntohs(plogi->csp.bbcred) < port->fabric->bb_credit)) {
(be16_to_cpu(plogi->csp.bbcred) < port->fabric->bb_credit)) {
bfa_trc(port->fcs, bfa_os_ntohs(plogi->csp.bbcred));
bfa_trc(port->fcs, be16_to_cpu(plogi->csp.bbcred));
bfa_trc(port->fcs, port->fabric->bb_credit);
port->fabric->bb_credit = bfa_os_ntohs(plogi->csp.bbcred);
port->fabric->bb_credit = be16_to_cpu(plogi->csp.bbcred);
bfa_fcport_set_tx_bbcredit(port->fcs->bfa,
port->fabric->bb_credit);
}
}
/**
/*
* Called to handle LOGO received from an existing remote port.
*/
static void
@ -2164,11 +2164,11 @@ bfa_fcs_rport_process_logo(struct bfa_fcs_rport_s *rport, struct fchs_s *fchs)
/**
/*
* fcs_rport_public FCS rport public interfaces
*/
/**
/*
* Called by bport/vport to create a remote port instance for a discovered
* remote device.
*
@ -2191,7 +2191,7 @@ bfa_fcs_rport_create(struct bfa_fcs_lport_s *port, u32 rpid)
return rport;
}
/**
/*
* Called to create a rport for which only the wwn is known.
*
* @param[in] port - base port
@ -2211,7 +2211,7 @@ bfa_fcs_rport_create_by_wwn(struct bfa_fcs_lport_s *port, wwn_t rpwwn)
bfa_sm_send_event(rport, RPSM_EVENT_ADDRESS_DISC);
return rport;
}
/**
/*
* Called by bport in private loop topology to indicate that a
* rport has been discovered and plogi has been completed.
*
@ -2233,7 +2233,7 @@ bfa_fcs_rport_start(struct bfa_fcs_lport_s *port, struct fchs_s *fchs,
bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_COMP);
}
/**
/*
* Called by bport/vport to handle PLOGI received from a new remote port.
* If an existing rport does a plogi, it will be handled separately.
*/
@ -2272,7 +2272,7 @@ wwn_compare(wwn_t wwn1, wwn_t wwn2)
return 0;
}
/**
/*
* Called by bport/vport to handle PLOGI received from an existing
* remote port.
*/
@ -2280,7 +2280,7 @@ void
bfa_fcs_rport_plogi(struct bfa_fcs_rport_s *rport, struct fchs_s *rx_fchs,
struct fc_logi_s *plogi)
{
/**
/*
* @todo Handle P2P and initiator-initiator.
*/
@ -2289,7 +2289,7 @@ bfa_fcs_rport_plogi(struct bfa_fcs_rport_s *rport, struct fchs_s *rx_fchs,
rport->reply_oxid = rx_fchs->ox_id;
bfa_trc(rport->fcs, rport->reply_oxid);
/**
/*
* In Switched fabric topology,
* PLOGI to each other. If our pwwn is smaller, ignore it,
* if it is not a well known address.
@ -2307,7 +2307,7 @@ bfa_fcs_rport_plogi(struct bfa_fcs_rport_s *rport, struct fchs_s *rx_fchs,
bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_RCVD);
}
/**
/*
* Called by bport/vport to delete a remote port instance.
*
* Rport delete is called under the following conditions:
@ -2321,7 +2321,7 @@ bfa_fcs_rport_delete(struct bfa_fcs_rport_s *rport)
bfa_sm_send_event(rport, RPSM_EVENT_DELETE);
}
/**
/*
* Called by bport/vport to when a target goes offline.
*
*/
@ -2331,7 +2331,7 @@ bfa_fcs_rport_offline(struct bfa_fcs_rport_s *rport)
bfa_sm_send_event(rport, RPSM_EVENT_LOGO_IMP);
}
/**
/*
* Called by bport in n2n when a target (attached port) becomes online.
*
*/
@ -2340,7 +2340,7 @@ bfa_fcs_rport_online(struct bfa_fcs_rport_s *rport)
{
bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_SEND);
}
/**
/*
* Called by bport/vport to notify SCN for the remote port
*/
void
@ -2350,7 +2350,7 @@ bfa_fcs_rport_scn(struct bfa_fcs_rport_s *rport)
bfa_sm_send_event(rport, RPSM_EVENT_SCN);
}
/**
/*
* Called by fcpim to notify that the ITN cleanup is done.
*/
void
@ -2359,7 +2359,7 @@ bfa_fcs_rport_itnim_ack(struct bfa_fcs_rport_s *rport)
bfa_sm_send_event(rport, RPSM_EVENT_FC4_OFFLINE);
}
/**
/*
* Called by fcptm to notify that the ITN cleanup is done.
*/
void
@ -2368,7 +2368,7 @@ bfa_fcs_rport_tin_ack(struct bfa_fcs_rport_s *rport)
bfa_sm_send_event(rport, RPSM_EVENT_FC4_OFFLINE);
}
/**
/*
* brief
* This routine BFA callback for bfa_rport_online() call.
*
@ -2391,7 +2391,7 @@ bfa_cb_rport_online(void *cbarg)
bfa_sm_send_event(rport, RPSM_EVENT_HCB_ONLINE);
}
/**
/*
* brief
* This routine BFA callback for bfa_rport_offline() call.
*
@ -2413,7 +2413,7 @@ bfa_cb_rport_offline(void *cbarg)
bfa_sm_send_event(rport, RPSM_EVENT_HCB_OFFLINE);
}
/**
/*
* brief
* This routine is a static BFA callback when there is a QoS flow_id
* change notification
@ -2437,7 +2437,7 @@ bfa_cb_rport_qos_scn_flowid(void *cbarg,
bfa_trc(rport->fcs, rport->pwwn);
}
/**
/*
* brief
* This routine is a static BFA callback when there is a QoS priority
* change notification
@ -2461,7 +2461,7 @@ bfa_cb_rport_qos_scn_prio(void *cbarg,
bfa_trc(rport->fcs, rport->pwwn);
}
/**
/*
* Called to process any unsolicted frames from this remote port
*/
void
@ -2470,7 +2470,7 @@ bfa_fcs_rport_logo_imp(struct bfa_fcs_rport_s *rport)
bfa_sm_send_event(rport, RPSM_EVENT_LOGO_IMP);
}
/**
/*
* Called to process any unsolicted frames from this remote port
*/
void
@ -2577,7 +2577,7 @@ bfa_fcs_rport_send_ls_rjt(struct bfa_fcs_rport_s *rport, struct fchs_s *rx_fchs,
FC_MAX_PDUSZ, 0);
}
/**
/*
* Return state of rport.
*/
int
@ -2586,7 +2586,7 @@ bfa_fcs_rport_get_state(struct bfa_fcs_rport_s *rport)
return bfa_sm_to_state(rport_sm_table, rport->sm);
}
/**
/*
* brief
* Called by the Driver to set rport delete/ageout timeout
*
@ -2613,15 +2613,15 @@ bfa_fcs_rport_prlo(struct bfa_fcs_rport_s *rport, u16 ox_id)
/**
/*
* Remote port implementation.
*/
/**
/*
* fcs_rport_api FCS rport API.
*/
/**
/*
* Direct API to add a target by port wwn. This interface is used, for
* example, by bios when target pwwn is known from boot lun configuration.
*/
@ -2634,7 +2634,7 @@ bfa_fcs_rport_add(struct bfa_fcs_lport_s *port, wwn_t *pwwn,
return BFA_STATUS_OK;
}
/**
/*
* Direct API to remove a target and its associated resources. This
* interface is used, for example, by driver to remove target
* ports from the target list for a VM.
@ -2663,7 +2663,7 @@ bfa_fcs_rport_remove(struct bfa_fcs_rport_s *rport_in)
}
/**
/*
* Remote device status for display/debug.
*/
void
@ -2674,7 +2674,7 @@ bfa_fcs_rport_get_attr(struct bfa_fcs_rport_s *rport,
bfa_fcs_lport_t *port = rport->port;
bfa_port_speed_t rport_speed = rport->rpf.rpsc_speed;
bfa_os_memset(rport_attr, 0, sizeof(struct bfa_rport_attr_s));
memset(rport_attr, 0, sizeof(struct bfa_rport_attr_s));
rport_attr->pid = rport->pid;
rport_attr->pwwn = rport->pwwn;
@ -2704,7 +2704,7 @@ bfa_fcs_rport_get_attr(struct bfa_fcs_rport_s *rport,
}
}
/**
/*
* Per remote device statistics.
*/
void
@ -2717,7 +2717,7 @@ bfa_fcs_rport_get_stats(struct bfa_fcs_rport_s *rport,
void
bfa_fcs_rport_clear_stats(struct bfa_fcs_rport_s *rport)
{
bfa_os_memset((char *)&rport->stats, 0,
memset((char *)&rport->stats, 0,
sizeof(struct bfa_rport_stats_s));
}
@ -2767,7 +2767,7 @@ bfa_fcs_rport_set_speed(struct bfa_fcs_rport_s *rport, bfa_port_speed_t speed)
/**
/*
* Remote port features (RPF) implementation.
*/
@ -2786,7 +2786,7 @@ static void bfa_fcs_rpf_rpsc2_response(void *fcsarg,
static void bfa_fcs_rpf_timeout(void *arg);
/**
/*
* fcs_rport_ftrs_sm FCS rport state machine events
*/
@ -2981,7 +2981,7 @@ bfa_fcs_rpf_sm_offline(struct bfa_fcs_rpf_s *rpf, enum rpf_event event)
bfa_sm_fault(rport->fcs, event);
}
}
/**
/*
* Called when Rport is created.
*/
void
@ -2995,7 +2995,7 @@ bfa_fcs_rpf_init(struct bfa_fcs_rport_s *rport)
bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_uninit);
}
/**
/*
* Called when Rport becomes online
*/
void
@ -3010,7 +3010,7 @@ bfa_fcs_rpf_rport_online(struct bfa_fcs_rport_s *rport)
bfa_sm_send_event(&rport->rpf, RPFSM_EVENT_RPORT_ONLINE);
}
/**
/*
* Called when Rport becomes offline
*/
void
@ -3090,16 +3090,16 @@ bfa_fcs_rpf_rpsc2_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
rpsc2_acc = (struct fc_rpsc2_acc_s *) BFA_FCXP_RSP_PLD(fcxp);
if (rpsc2_acc->els_cmd == FC_ELS_ACC) {
rport->stats.rpsc_accs++;
num_ents = bfa_os_ntohs(rpsc2_acc->num_pids);
num_ents = be16_to_cpu(rpsc2_acc->num_pids);
bfa_trc(rport->fcs, num_ents);
if (num_ents > 0) {
bfa_assert(rpsc2_acc->port_info[0].pid != rport->pid);
bfa_trc(rport->fcs,
bfa_os_ntohs(rpsc2_acc->port_info[0].pid));
be16_to_cpu(rpsc2_acc->port_info[0].pid));
bfa_trc(rport->fcs,
bfa_os_ntohs(rpsc2_acc->port_info[0].speed));
be16_to_cpu(rpsc2_acc->port_info[0].speed));
bfa_trc(rport->fcs,
bfa_os_ntohs(rpsc2_acc->port_info[0].index));
be16_to_cpu(rpsc2_acc->port_info[0].index));
bfa_trc(rport->fcs,
rpsc2_acc->port_info[0].type);
@ -3109,7 +3109,7 @@ bfa_fcs_rpf_rpsc2_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
}
rpf->rpsc_speed = fc_rpsc_operspeed_to_bfa_speed(
bfa_os_ntohs(rpsc2_acc->port_info[0].speed));
be16_to_cpu(rpsc2_acc->port_info[0].speed));
bfa_sm_send_event(rpf, RPFSM_EVENT_RPSC_COMP);
}

View file

@ -22,7 +22,7 @@ void
bfa_hwcb_reginit(struct bfa_s *bfa)
{
struct bfa_iocfc_regs_s *bfa_regs = &bfa->iocfc.bfa_regs;
bfa_os_addr_t kva = bfa_ioc_bar0(&bfa->ioc);
void __iomem *kva = bfa_ioc_bar0(&bfa->ioc);
int i, q, fn = bfa_ioc_pcifn(&bfa->ioc);
if (fn == 0) {
@ -60,8 +60,8 @@ bfa_hwcb_reqq_ack(struct bfa_s *bfa, int reqq)
static void
bfa_hwcb_reqq_ack_msix(struct bfa_s *bfa, int reqq)
{
bfa_reg_write(bfa->iocfc.bfa_regs.intr_status,
__HFN_INT_CPE_Q0 << CPE_Q_NUM(bfa_ioc_pcifn(&bfa->ioc), reqq));
writel(__HFN_INT_CPE_Q0 << CPE_Q_NUM(bfa_ioc_pcifn(&bfa->ioc), reqq),
bfa->iocfc.bfa_regs.intr_status);
}
void
@ -72,8 +72,8 @@ bfa_hwcb_rspq_ack(struct bfa_s *bfa, int rspq)
static void
bfa_hwcb_rspq_ack_msix(struct bfa_s *bfa, int rspq)
{
bfa_reg_write(bfa->iocfc.bfa_regs.intr_status,
__HFN_INT_RME_Q0 << RME_Q_NUM(bfa_ioc_pcifn(&bfa->ioc), rspq));
writel(__HFN_INT_RME_Q0 << RME_Q_NUM(bfa_ioc_pcifn(&bfa->ioc), rspq),
bfa->iocfc.bfa_regs.intr_status);
}
void
@ -102,7 +102,7 @@ bfa_hwcb_msix_getvecs(struct bfa_s *bfa, u32 *msix_vecs_bmap,
*num_vecs = __HFN_NUMINTS;
}
/**
/*
* No special setup required for crossbow -- vector assignments are implicit.
*/
void
@ -129,7 +129,7 @@ bfa_hwcb_msix_init(struct bfa_s *bfa, int nvecs)
bfa->msix.handler[i] = bfa_msix_lpu_err;
}
/**
/*
* Crossbow -- dummy, interrupts are masked
*/
void
@ -142,7 +142,7 @@ bfa_hwcb_msix_uninstall(struct bfa_s *bfa)
{
}
/**
/*
* No special enable/disable -- vector assignments are implicit.
*/
void

View file

@ -31,15 +31,15 @@ static void
bfa_hwct_msix_lpu_err_set(struct bfa_s *bfa, bfa_boolean_t msix, int vec)
{
int fn = bfa_ioc_pcifn(&bfa->ioc);
bfa_os_addr_t kva = bfa_ioc_bar0(&bfa->ioc);
void __iomem *kva = bfa_ioc_bar0(&bfa->ioc);
if (msix)
bfa_reg_write(kva + __ct_msix_err_vec_reg[fn], vec);
writel(vec, kva + __ct_msix_err_vec_reg[fn]);
else
bfa_reg_write(kva + __ct_msix_err_vec_reg[fn], 0);
writel(0, kva + __ct_msix_err_vec_reg[fn]);
}
/**
/*
* Dummy interrupt handler for handling spurious interrupt during chip-reinit.
*/
static void
@ -51,7 +51,7 @@ void
bfa_hwct_reginit(struct bfa_s *bfa)
{
struct bfa_iocfc_regs_s *bfa_regs = &bfa->iocfc.bfa_regs;
bfa_os_addr_t kva = bfa_ioc_bar0(&bfa->ioc);
void __iomem *kva = bfa_ioc_bar0(&bfa->ioc);
int i, q, fn = bfa_ioc_pcifn(&bfa->ioc);
if (fn == 0) {
@ -88,8 +88,8 @@ bfa_hwct_reqq_ack(struct bfa_s *bfa, int reqq)
{
u32 r32;
r32 = bfa_reg_read(bfa->iocfc.bfa_regs.cpe_q_ctrl[reqq]);
bfa_reg_write(bfa->iocfc.bfa_regs.cpe_q_ctrl[reqq], r32);
r32 = readl(bfa->iocfc.bfa_regs.cpe_q_ctrl[reqq]);
writel(r32, bfa->iocfc.bfa_regs.cpe_q_ctrl[reqq]);
}
void
@ -97,8 +97,8 @@ bfa_hwct_rspq_ack(struct bfa_s *bfa, int rspq)
{
u32 r32;
r32 = bfa_reg_read(bfa->iocfc.bfa_regs.rme_q_ctrl[rspq]);
bfa_reg_write(bfa->iocfc.bfa_regs.rme_q_ctrl[rspq], r32);
r32 = readl(bfa->iocfc.bfa_regs.rme_q_ctrl[rspq]);
writel(r32, bfa->iocfc.bfa_regs.rme_q_ctrl[rspq]);
}
void
@ -110,7 +110,7 @@ bfa_hwct_msix_getvecs(struct bfa_s *bfa, u32 *msix_vecs_bmap,
*num_vecs = BFA_MSIX_CT_MAX;
}
/**
/*
* Setup MSI-X vector for catapult
*/
void
@ -156,7 +156,7 @@ bfa_hwct_msix_uninstall(struct bfa_s *bfa)
bfa->msix.handler[i] = bfa_hwct_msix_dummy;
}
/**
/*
* Enable MSI-X vectors
*/
void

File diff suppressed because it is too large Load diff

View file

@ -22,29 +22,29 @@
#include "bfa_cs.h"
#include "bfi.h"
/**
/*
* BFA timer declarations
*/
typedef void (*bfa_timer_cbfn_t)(void *);
/**
/*
* BFA timer data structure
*/
struct bfa_timer_s {
struct list_head qe;
bfa_timer_cbfn_t timercb;
void *arg;
int timeout; /**< in millisecs. */
int timeout; /* in millisecs */
};
/**
/*
* Timer module structure
*/
struct bfa_timer_mod_s {
struct list_head timer_q;
};
#define BFA_TIMER_FREQ 200 /**< specified in millisecs */
#define BFA_TIMER_FREQ 200 /* specified in millisecs */
void bfa_timer_beat(struct bfa_timer_mod_s *mod);
void bfa_timer_init(struct bfa_timer_mod_s *mod);
@ -53,7 +53,7 @@ void bfa_timer_begin(struct bfa_timer_mod_s *mod, struct bfa_timer_s *timer,
unsigned int timeout);
void bfa_timer_stop(struct bfa_timer_s *timer);
/**
/*
* Generic Scatter Gather Element used by driver
*/
struct bfa_sge_s {
@ -62,9 +62,9 @@ struct bfa_sge_s {
};
#define bfa_sge_word_swap(__sge) do { \
((u32 *)(__sge))[0] = bfa_os_swap32(((u32 *)(__sge))[0]); \
((u32 *)(__sge))[1] = bfa_os_swap32(((u32 *)(__sge))[1]); \
((u32 *)(__sge))[2] = bfa_os_swap32(((u32 *)(__sge))[2]); \
((u32 *)(__sge))[0] = swab32(((u32 *)(__sge))[0]); \
((u32 *)(__sge))[1] = swab32(((u32 *)(__sge))[1]); \
((u32 *)(__sge))[2] = swab32(((u32 *)(__sge))[2]); \
} while (0)
#define bfa_swap_words(_x) ( \
@ -80,17 +80,17 @@ struct bfa_sge_s {
#define bfa_sgaddr_le(_x) (_x)
#endif
/**
/*
* PCI device information required by IOC
*/
struct bfa_pcidev_s {
int pci_slot;
u8 pci_func;
u16 device_id;
bfa_os_addr_t pci_bar_kva;
u16 device_id;
void __iomem *pci_bar_kva;
};
/**
/*
* Structure used to remember the DMA-able memory block's KVA and Physical
* Address
*/
@ -102,7 +102,7 @@ struct bfa_dma_s {
#define BFA_DMA_ALIGN_SZ 256
#define BFA_ROUNDUP(_l, _s) (((_l) + ((_s) - 1)) & ~((_s) - 1))
/**
/*
* smem size for Crossbow and Catapult
*/
#define BFI_SMEM_CB_SIZE 0x200000U /* ! 2MB for crossbow */
@ -125,40 +125,38 @@ __bfa_dma_addr_set(union bfi_addr_u *dma_addr, u64 pa)
static inline void
__bfa_dma_be_addr_set(union bfi_addr_u *dma_addr, u64 pa)
{
dma_addr->a32.addr_lo = (u32) bfa_os_htonl(pa);
dma_addr->a32.addr_hi = (u32) bfa_os_htonl(bfa_os_u32(pa));
dma_addr->a32.addr_lo = (u32) cpu_to_be32(pa);
dma_addr->a32.addr_hi = (u32) cpu_to_be32(bfa_os_u32(pa));
}
struct bfa_ioc_regs_s {
bfa_os_addr_t hfn_mbox_cmd;
bfa_os_addr_t hfn_mbox;
bfa_os_addr_t lpu_mbox_cmd;
bfa_os_addr_t lpu_mbox;
bfa_os_addr_t pss_ctl_reg;
bfa_os_addr_t pss_err_status_reg;
bfa_os_addr_t app_pll_fast_ctl_reg;
bfa_os_addr_t app_pll_slow_ctl_reg;
bfa_os_addr_t ioc_sem_reg;
bfa_os_addr_t ioc_usage_sem_reg;
bfa_os_addr_t ioc_init_sem_reg;
bfa_os_addr_t ioc_usage_reg;
bfa_os_addr_t host_page_num_fn;
bfa_os_addr_t heartbeat;
bfa_os_addr_t ioc_fwstate;
bfa_os_addr_t ll_halt;
bfa_os_addr_t err_set;
bfa_os_addr_t shirq_isr_next;
bfa_os_addr_t shirq_msk_next;
bfa_os_addr_t smem_page_start;
void __iomem *hfn_mbox_cmd;
void __iomem *hfn_mbox;
void __iomem *lpu_mbox_cmd;
void __iomem *lpu_mbox;
void __iomem *pss_ctl_reg;
void __iomem *pss_err_status_reg;
void __iomem *app_pll_fast_ctl_reg;
void __iomem *app_pll_slow_ctl_reg;
void __iomem *ioc_sem_reg;
void __iomem *ioc_usage_sem_reg;
void __iomem *ioc_init_sem_reg;
void __iomem *ioc_usage_reg;
void __iomem *host_page_num_fn;
void __iomem *heartbeat;
void __iomem *ioc_fwstate;
void __iomem *ll_halt;
void __iomem *err_set;
void __iomem *shirq_isr_next;
void __iomem *shirq_msk_next;
void __iomem *smem_page_start;
u32 smem_pg0;
};
#define bfa_reg_read(_raddr) bfa_os_reg_read(_raddr)
#define bfa_reg_write(_raddr, _val) bfa_os_reg_write(_raddr, _val)
#define bfa_mem_read(_raddr, _off) bfa_os_mem_read(_raddr, _off)
#define bfa_mem_read(_raddr, _off) swab32(readl(((_raddr) + (_off))))
#define bfa_mem_write(_raddr, _off, _val) \
bfa_os_mem_write(_raddr, _off, _val)
/**
writel(swab32((_val)), ((_raddr) + (_off)))
/*
* IOC Mailbox structures
*/
struct bfa_mbox_cmd_s {
@ -166,7 +164,7 @@ struct bfa_mbox_cmd_s {
u32 msg[BFI_IOC_MSGSZ];
};
/**
/*
* IOC mailbox module
*/
typedef void (*bfa_ioc_mbox_mcfunc_t)(void *cbarg, struct bfi_mbmsg_s *m);
@ -179,7 +177,7 @@ struct bfa_ioc_mbox_mod_s {
} mbhdlr[BFI_MC_MAX];
};
/**
/*
* IOC callback function interfaces
*/
typedef void (*bfa_ioc_enable_cbfn_t)(void *bfa, enum bfa_status status);
@ -193,7 +191,7 @@ struct bfa_ioc_cbfn_s {
bfa_ioc_reset_cbfn_t reset_cbfn;
};
/**
/*
* Heartbeat failure notification queue element.
*/
struct bfa_ioc_hbfail_notify_s {
@ -202,7 +200,7 @@ struct bfa_ioc_hbfail_notify_s {
void *cbarg;
};
/**
/*
* Initialize a heartbeat failure notification structure
*/
#define bfa_ioc_hbfail_init(__notify, __cbfn, __cbarg) do { \
@ -249,7 +247,7 @@ struct bfa_ioc_s {
};
struct bfa_ioc_hwif_s {
bfa_status_t (*ioc_pll_init) (bfa_os_addr_t rb, bfa_boolean_t fcmode);
bfa_status_t (*ioc_pll_init) (void __iomem *rb, bfa_boolean_t fcmode);
bfa_boolean_t (*ioc_firmware_lock) (struct bfa_ioc_s *ioc);
void (*ioc_firmware_unlock) (struct bfa_ioc_s *ioc);
void (*ioc_reg_init) (struct bfa_ioc_s *ioc);
@ -267,7 +265,7 @@ struct bfa_ioc_hwif_s {
#define bfa_ioc_fetch_stats(__ioc, __stats) \
(((__stats)->drv_stats) = (__ioc)->stats)
#define bfa_ioc_clr_stats(__ioc) \
bfa_os_memset(&(__ioc)->stats, 0, sizeof((__ioc)->stats))
memset(&(__ioc)->stats, 0, sizeof((__ioc)->stats))
#define bfa_ioc_maxfrsize(__ioc) ((__ioc)->attr->maxfrsize)
#define bfa_ioc_rx_bbcredit(__ioc) ((__ioc)->attr->rx_bbcredit)
#define bfa_ioc_speed_sup(__ioc) \
@ -287,7 +285,7 @@ struct bfa_ioc_hwif_s {
#define BFA_IOC_FLASH_OFFSET_IN_CHUNK(off) (off % BFI_FLASH_CHUNK_SZ_WORDS)
#define BFA_IOC_FLASH_CHUNK_ADDR(chunkno) (chunkno * BFI_FLASH_CHUNK_SZ_WORDS)
/**
/*
* IOC mailbox interface
*/
void bfa_ioc_mbox_queue(struct bfa_ioc_s *ioc, struct bfa_mbox_cmd_s *cmd);
@ -299,7 +297,7 @@ void bfa_ioc_msgget(struct bfa_ioc_s *ioc, void *mbmsg);
void bfa_ioc_mbox_regisr(struct bfa_ioc_s *ioc, enum bfi_mclass mc,
bfa_ioc_mbox_mcfunc_t cbfn, void *cbarg);
/**
/*
* IOC interfaces
*/
@ -308,9 +306,9 @@ void bfa_ioc_mbox_regisr(struct bfa_ioc_s *ioc, enum bfi_mclass mc,
(__ioc)->fcmode))
bfa_status_t bfa_ioc_pll_init(struct bfa_ioc_s *ioc);
bfa_status_t bfa_ioc_cb_pll_init(bfa_os_addr_t rb, bfa_boolean_t fcmode);
bfa_boolean_t bfa_ioc_ct_pll_init_complete(bfa_os_addr_t rb);
bfa_status_t bfa_ioc_ct_pll_init(bfa_os_addr_t rb, bfa_boolean_t fcmode);
bfa_status_t bfa_ioc_cb_pll_init(void __iomem *rb, bfa_boolean_t fcmode);
bfa_boolean_t bfa_ioc_ct_pll_init_complete(void __iomem *rb);
bfa_status_t bfa_ioc_ct_pll_init(void __iomem *rb, bfa_boolean_t fcmode);
#define bfa_ioc_isr_mode_set(__ioc, __msix) \
((__ioc)->ioc_hwif->ioc_isr_mode_set(__ioc, __msix))
@ -370,8 +368,8 @@ void bfa_ioc_set_fcmode(struct bfa_ioc_s *ioc);
bfa_boolean_t bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc);
void bfa_ioc_hbfail_register(struct bfa_ioc_s *ioc,
struct bfa_ioc_hbfail_notify_s *notify);
bfa_boolean_t bfa_ioc_sem_get(bfa_os_addr_t sem_reg);
void bfa_ioc_sem_release(bfa_os_addr_t sem_reg);
bfa_boolean_t bfa_ioc_sem_get(void __iomem *sem_reg);
void bfa_ioc_sem_release(void __iomem *sem_reg);
void bfa_ioc_hw_sem_release(struct bfa_ioc_s *ioc);
void bfa_ioc_fwver_get(struct bfa_ioc_s *ioc,
struct bfi_ioc_image_hdr_s *fwhdr);
@ -441,7 +439,7 @@ bfa_cb_image_get_size(int type)
}
}
/**
/*
* CNA TRCMOD declaration
*/
/*

View file

@ -34,7 +34,7 @@ static void bfa_ioc_cb_ownership_reset(struct bfa_ioc_s *ioc);
struct bfa_ioc_hwif_s hwif_cb;
/**
/*
* Called from bfa_ioc_attach() to map asic specific calls.
*/
void
@ -52,7 +52,7 @@ bfa_ioc_set_cb_hwif(struct bfa_ioc_s *ioc)
ioc->ioc_hwif = &hwif_cb;
}
/**
/*
* Return true if firmware of current driver matches the running firmware.
*/
static bfa_boolean_t
@ -66,17 +66,17 @@ bfa_ioc_cb_firmware_unlock(struct bfa_ioc_s *ioc)
{
}
/**
/*
* Notify other functions on HB failure.
*/
static void
bfa_ioc_cb_notify_hbfail(struct bfa_ioc_s *ioc)
{
bfa_reg_write(ioc->ioc_regs.err_set, __PSS_ERR_STATUS_SET);
bfa_reg_read(ioc->ioc_regs.err_set);
writel(__PSS_ERR_STATUS_SET, ioc->ioc_regs.err_set);
readl(ioc->ioc_regs.err_set);
}
/**
/*
* Host to LPU mailbox message addresses
*/
static struct { u32 hfn_mbox, lpu_mbox, hfn_pgn; } iocreg_fnreg[] = {
@ -84,7 +84,7 @@ static struct { u32 hfn_mbox, lpu_mbox, hfn_pgn; } iocreg_fnreg[] = {
{ HOSTFN1_LPU_MBOX0_8, LPU_HOSTFN1_MBOX0_8, HOST_PAGE_NUM_FN1 }
};
/**
/*
* Host <-> LPU mailbox command/status registers
*/
static struct { u32 hfn, lpu; } iocreg_mbcmd[] = {
@ -96,7 +96,7 @@ static struct { u32 hfn, lpu; } iocreg_mbcmd[] = {
static void
bfa_ioc_cb_reg_init(struct bfa_ioc_s *ioc)
{
bfa_os_addr_t rb;
void __iomem *rb;
int pcifn = bfa_ioc_pcifn(ioc);
rb = bfa_ioc_bar0(ioc);
@ -113,7 +113,7 @@ bfa_ioc_cb_reg_init(struct bfa_ioc_s *ioc)
ioc->ioc_regs.ioc_fwstate = (rb + BFA_IOC1_STATE_REG);
}
/**
/*
* Host <-> LPU mailbox command/status registers
*/
ioc->ioc_regs.hfn_mbox_cmd = rb + iocreg_mbcmd[pcifn].hfn;
@ -133,7 +133,7 @@ bfa_ioc_cb_reg_init(struct bfa_ioc_s *ioc)
ioc->ioc_regs.ioc_sem_reg = (rb + HOST_SEM0_REG);
ioc->ioc_regs.ioc_init_sem_reg = (rb + HOST_SEM2_REG);
/**
/*
* sram memory access
*/
ioc->ioc_regs.smem_page_start = (rb + PSS_SMEM_PAGE_START);
@ -145,14 +145,14 @@ bfa_ioc_cb_reg_init(struct bfa_ioc_s *ioc)
ioc->ioc_regs.err_set = (rb + ERR_SET_REG);
}
/**
/*
* Initialize IOC to port mapping.
*/
static void
bfa_ioc_cb_map_port(struct bfa_ioc_s *ioc)
{
/**
/*
* For crossbow, port id is same as pci function.
*/
ioc->port_id = bfa_ioc_pcifn(ioc);
@ -160,7 +160,7 @@ bfa_ioc_cb_map_port(struct bfa_ioc_s *ioc)
bfa_trc(ioc, ioc->port_id);
}
/**
/*
* Set interrupt mode for a function: INTX or MSIX
*/
static void
@ -168,7 +168,7 @@ bfa_ioc_cb_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix)
{
}
/**
/*
* Cleanup hw semaphore and usecnt registers
*/
static void
@ -180,14 +180,14 @@ bfa_ioc_cb_ownership_reset(struct bfa_ioc_s *ioc)
* before we clear it. If it is not locked, writing 1
* will lock it instead of clearing it.
*/
bfa_reg_read(ioc->ioc_regs.ioc_sem_reg);
readl(ioc->ioc_regs.ioc_sem_reg);
bfa_ioc_hw_sem_release(ioc);
}
bfa_status_t
bfa_ioc_cb_pll_init(bfa_os_addr_t rb, bfa_boolean_t fcmode)
bfa_ioc_cb_pll_init(void __iomem *rb, bfa_boolean_t fcmode)
{
u32 pll_sclk, pll_fclk;
@ -199,38 +199,32 @@ bfa_ioc_cb_pll_init(bfa_os_addr_t rb, bfa_boolean_t fcmode)
__APP_PLL_400_RSEL200500 | __APP_PLL_400_P0_1(3U) |
__APP_PLL_400_JITLMT0_1(3U) |
__APP_PLL_400_CNTLMT0_1(3U);
bfa_reg_write((rb + BFA_IOC0_STATE_REG), BFI_IOC_UNINIT);
bfa_reg_write((rb + BFA_IOC1_STATE_REG), BFI_IOC_UNINIT);
bfa_reg_write((rb + HOSTFN0_INT_MSK), 0xffffffffU);
bfa_reg_write((rb + HOSTFN1_INT_MSK), 0xffffffffU);
bfa_reg_write((rb + HOSTFN0_INT_STATUS), 0xffffffffU);
bfa_reg_write((rb + HOSTFN1_INT_STATUS), 0xffffffffU);
bfa_reg_write((rb + HOSTFN0_INT_MSK), 0xffffffffU);
bfa_reg_write((rb + HOSTFN1_INT_MSK), 0xffffffffU);
bfa_reg_write(rb + APP_PLL_212_CTL_REG,
__APP_PLL_212_LOGIC_SOFT_RESET);
bfa_reg_write(rb + APP_PLL_212_CTL_REG,
__APP_PLL_212_BYPASS |
__APP_PLL_212_LOGIC_SOFT_RESET);
bfa_reg_write(rb + APP_PLL_400_CTL_REG,
__APP_PLL_400_LOGIC_SOFT_RESET);
bfa_reg_write(rb + APP_PLL_400_CTL_REG,
__APP_PLL_400_BYPASS |
__APP_PLL_400_LOGIC_SOFT_RESET);
bfa_os_udelay(2);
bfa_reg_write(rb + APP_PLL_212_CTL_REG,
__APP_PLL_212_LOGIC_SOFT_RESET);
bfa_reg_write(rb + APP_PLL_400_CTL_REG,
__APP_PLL_400_LOGIC_SOFT_RESET);
bfa_reg_write(rb + APP_PLL_212_CTL_REG,
pll_sclk | __APP_PLL_212_LOGIC_SOFT_RESET);
bfa_reg_write(rb + APP_PLL_400_CTL_REG,
pll_fclk | __APP_PLL_400_LOGIC_SOFT_RESET);
bfa_os_udelay(2000);
bfa_reg_write((rb + HOSTFN0_INT_STATUS), 0xffffffffU);
bfa_reg_write((rb + HOSTFN1_INT_STATUS), 0xffffffffU);
bfa_reg_write((rb + APP_PLL_212_CTL_REG), pll_sclk);
bfa_reg_write((rb + APP_PLL_400_CTL_REG), pll_fclk);
writel(BFI_IOC_UNINIT, (rb + BFA_IOC0_STATE_REG));
writel(BFI_IOC_UNINIT, (rb + BFA_IOC1_STATE_REG));
writel(0xffffffffU, (rb + HOSTFN0_INT_MSK));
writel(0xffffffffU, (rb + HOSTFN1_INT_MSK));
writel(0xffffffffU, (rb + HOSTFN0_INT_STATUS));
writel(0xffffffffU, (rb + HOSTFN1_INT_STATUS));
writel(0xffffffffU, (rb + HOSTFN0_INT_MSK));
writel(0xffffffffU, (rb + HOSTFN1_INT_MSK));
writel(__APP_PLL_212_LOGIC_SOFT_RESET, rb + APP_PLL_212_CTL_REG);
writel(__APP_PLL_212_BYPASS | __APP_PLL_212_LOGIC_SOFT_RESET,
rb + APP_PLL_212_CTL_REG);
writel(__APP_PLL_400_LOGIC_SOFT_RESET, rb + APP_PLL_400_CTL_REG);
writel(__APP_PLL_400_BYPASS | __APP_PLL_400_LOGIC_SOFT_RESET,
rb + APP_PLL_400_CTL_REG);
udelay(2);
writel(__APP_PLL_212_LOGIC_SOFT_RESET, rb + APP_PLL_212_CTL_REG);
writel(__APP_PLL_400_LOGIC_SOFT_RESET, rb + APP_PLL_400_CTL_REG);
writel(pll_sclk | __APP_PLL_212_LOGIC_SOFT_RESET,
rb + APP_PLL_212_CTL_REG);
writel(pll_fclk | __APP_PLL_400_LOGIC_SOFT_RESET,
rb + APP_PLL_400_CTL_REG);
udelay(2000);
writel(0xffffffffU, (rb + HOSTFN0_INT_STATUS));
writel(0xffffffffU, (rb + HOSTFN1_INT_STATUS));
writel(pll_sclk, (rb + APP_PLL_212_CTL_REG));
writel(pll_fclk, (rb + APP_PLL_400_CTL_REG));
return BFA_STATUS_OK;
}

View file

@ -34,7 +34,7 @@ static void bfa_ioc_ct_ownership_reset(struct bfa_ioc_s *ioc);
struct bfa_ioc_hwif_s hwif_ct;
/**
/*
* Called from bfa_ioc_attach() to map asic specific calls.
*/
void
@ -52,7 +52,7 @@ bfa_ioc_set_ct_hwif(struct bfa_ioc_s *ioc)
ioc->ioc_hwif = &hwif_ct;
}
/**
/*
* Return true if firmware of current driver matches the running firmware.
*/
static bfa_boolean_t
@ -62,13 +62,13 @@ bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc)
u32 usecnt;
struct bfi_ioc_image_hdr_s fwhdr;
/**
/*
* Firmware match check is relevant only for CNA.
*/
if (!ioc->cna)
return BFA_TRUE;
/**
/*
* If bios boot (flash based) -- do not increment usage count
*/
if (bfa_cb_image_get_size(BFA_IOC_FWIMG_TYPE(ioc)) <
@ -76,27 +76,27 @@ bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc)
return BFA_TRUE;
bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg);
usecnt = bfa_reg_read(ioc->ioc_regs.ioc_usage_reg);
usecnt = readl(ioc->ioc_regs.ioc_usage_reg);
/**
/*
* If usage count is 0, always return TRUE.
*/
if (usecnt == 0) {
bfa_reg_write(ioc->ioc_regs.ioc_usage_reg, 1);
writel(1, ioc->ioc_regs.ioc_usage_reg);
bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg);
bfa_trc(ioc, usecnt);
return BFA_TRUE;
}
ioc_fwstate = bfa_reg_read(ioc->ioc_regs.ioc_fwstate);
ioc_fwstate = readl(ioc->ioc_regs.ioc_fwstate);
bfa_trc(ioc, ioc_fwstate);
/**
/*
* Use count cannot be non-zero and chip in uninitialized state.
*/
bfa_assert(ioc_fwstate != BFI_IOC_UNINIT);
/**
/*
* Check if another driver with a different firmware is active
*/
bfa_ioc_fwver_get(ioc, &fwhdr);
@ -106,11 +106,11 @@ bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc)
return BFA_FALSE;
}
/**
/*
* Same firmware version. Increment the reference count.
*/
usecnt++;
bfa_reg_write(ioc->ioc_regs.ioc_usage_reg, usecnt);
writel(usecnt, ioc->ioc_regs.ioc_usage_reg);
bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg);
bfa_trc(ioc, usecnt);
return BFA_TRUE;
@ -121,50 +121,50 @@ bfa_ioc_ct_firmware_unlock(struct bfa_ioc_s *ioc)
{
u32 usecnt;
/**
/*
* Firmware lock is relevant only for CNA.
*/
if (!ioc->cna)
return;
/**
/*
* If bios boot (flash based) -- do not decrement usage count
*/
if (bfa_cb_image_get_size(BFA_IOC_FWIMG_TYPE(ioc)) <
BFA_IOC_FWIMG_MINSZ)
return;
/**
/*
* decrement usage count
*/
bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg);
usecnt = bfa_reg_read(ioc->ioc_regs.ioc_usage_reg);
usecnt = readl(ioc->ioc_regs.ioc_usage_reg);
bfa_assert(usecnt > 0);
usecnt--;
bfa_reg_write(ioc->ioc_regs.ioc_usage_reg, usecnt);
writel(usecnt, ioc->ioc_regs.ioc_usage_reg);
bfa_trc(ioc, usecnt);
bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg);
}
/**
/*
* Notify other functions on HB failure.
*/
static void
bfa_ioc_ct_notify_hbfail(struct bfa_ioc_s *ioc)
{
if (ioc->cna) {
bfa_reg_write(ioc->ioc_regs.ll_halt, __FW_INIT_HALT_P);
writel(__FW_INIT_HALT_P, ioc->ioc_regs.ll_halt);
/* Wait for halt to take effect */
bfa_reg_read(ioc->ioc_regs.ll_halt);
readl(ioc->ioc_regs.ll_halt);
} else {
bfa_reg_write(ioc->ioc_regs.err_set, __PSS_ERR_STATUS_SET);
bfa_reg_read(ioc->ioc_regs.err_set);
writel(__PSS_ERR_STATUS_SET, ioc->ioc_regs.err_set);
readl(ioc->ioc_regs.err_set);
}
}
/**
/*
* Host to LPU mailbox message addresses
*/
static struct { u32 hfn_mbox, lpu_mbox, hfn_pgn; } iocreg_fnreg[] = {
@ -174,7 +174,7 @@ static struct { u32 hfn_mbox, lpu_mbox, hfn_pgn; } iocreg_fnreg[] = {
{ HOSTFN3_LPU_MBOX0_8, LPU_HOSTFN3_MBOX0_8, HOST_PAGE_NUM_FN3 }
};
/**
/*
* Host <-> LPU mailbox command/status registers - port 0
*/
static struct { u32 hfn, lpu; } iocreg_mbcmd_p0[] = {
@ -184,7 +184,7 @@ static struct { u32 hfn, lpu; } iocreg_mbcmd_p0[] = {
{ HOSTFN3_LPU0_MBOX0_CMD_STAT, LPU0_HOSTFN3_MBOX0_CMD_STAT }
};
/**
/*
* Host <-> LPU mailbox command/status registers - port 1
*/
static struct { u32 hfn, lpu; } iocreg_mbcmd_p1[] = {
@ -197,7 +197,7 @@ static struct { u32 hfn, lpu; } iocreg_mbcmd_p1[] = {
static void
bfa_ioc_ct_reg_init(struct bfa_ioc_s *ioc)
{
bfa_os_addr_t rb;
void __iomem *rb;
int pcifn = bfa_ioc_pcifn(ioc);
rb = bfa_ioc_bar0(ioc);
@ -236,7 +236,7 @@ bfa_ioc_ct_reg_init(struct bfa_ioc_s *ioc)
ioc->ioc_regs.ioc_init_sem_reg = (rb + HOST_SEM2_REG);
ioc->ioc_regs.ioc_usage_reg = (rb + BFA_FW_USE_COUNT);
/**
/*
* sram memory access
*/
ioc->ioc_regs.smem_page_start = (rb + PSS_SMEM_PAGE_START);
@ -248,7 +248,7 @@ bfa_ioc_ct_reg_init(struct bfa_ioc_s *ioc)
ioc->ioc_regs.err_set = (rb + ERR_SET_REG);
}
/**
/*
* Initialize IOC to port mapping.
*/
@ -256,13 +256,13 @@ bfa_ioc_ct_reg_init(struct bfa_ioc_s *ioc)
static void
bfa_ioc_ct_map_port(struct bfa_ioc_s *ioc)
{
bfa_os_addr_t rb = ioc->pcidev.pci_bar_kva;
void __iomem *rb = ioc->pcidev.pci_bar_kva;
u32 r32;
/**
/*
* For catapult, base port id on personality register and IOC type
*/
r32 = bfa_reg_read(rb + FNC_PERS_REG);
r32 = readl(rb + FNC_PERS_REG);
r32 >>= FNC_PERS_FN_SHIFT(bfa_ioc_pcifn(ioc));
ioc->port_id = (r32 & __F0_PORT_MAP_MK) >> __F0_PORT_MAP_SH;
@ -270,22 +270,22 @@ bfa_ioc_ct_map_port(struct bfa_ioc_s *ioc)
bfa_trc(ioc, ioc->port_id);
}
/**
/*
* Set interrupt mode for a function: INTX or MSIX
*/
static void
bfa_ioc_ct_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix)
{
bfa_os_addr_t rb = ioc->pcidev.pci_bar_kva;
void __iomem *rb = ioc->pcidev.pci_bar_kva;
u32 r32, mode;
r32 = bfa_reg_read(rb + FNC_PERS_REG);
r32 = readl(rb + FNC_PERS_REG);
bfa_trc(ioc, r32);
mode = (r32 >> FNC_PERS_FN_SHIFT(bfa_ioc_pcifn(ioc))) &
__F0_INTX_STATUS;
/**
/*
* If already in desired mode, do not change anything
*/
if (!msix && mode)
@ -300,10 +300,10 @@ bfa_ioc_ct_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix)
r32 |= (mode << FNC_PERS_FN_SHIFT(bfa_ioc_pcifn(ioc)));
bfa_trc(ioc, r32);
bfa_reg_write(rb + FNC_PERS_REG, r32);
writel(r32, rb + FNC_PERS_REG);
}
/**
/*
* Cleanup hw semaphore and usecnt registers
*/
static void
@ -312,7 +312,7 @@ bfa_ioc_ct_ownership_reset(struct bfa_ioc_s *ioc)
if (ioc->cna) {
bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg);
bfa_reg_write(ioc->ioc_regs.ioc_usage_reg, 0);
writel(0, ioc->ioc_regs.ioc_usage_reg);
bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg);
}
@ -321,7 +321,7 @@ bfa_ioc_ct_ownership_reset(struct bfa_ioc_s *ioc)
* before we clear it. If it is not locked, writing 1
* will lock it instead of clearing it.
*/
bfa_reg_read(ioc->ioc_regs.ioc_sem_reg);
readl(ioc->ioc_regs.ioc_sem_reg);
bfa_ioc_hw_sem_release(ioc);
}
@ -331,17 +331,17 @@ bfa_ioc_ct_ownership_reset(struct bfa_ioc_s *ioc)
* Check the firmware state to know if pll_init has been completed already
*/
bfa_boolean_t
bfa_ioc_ct_pll_init_complete(bfa_os_addr_t rb)
bfa_ioc_ct_pll_init_complete(void __iomem *rb)
{
if ((bfa_reg_read(rb + BFA_IOC0_STATE_REG) == BFI_IOC_OP) ||
(bfa_reg_read(rb + BFA_IOC1_STATE_REG) == BFI_IOC_OP))
if ((readl(rb + BFA_IOC0_STATE_REG) == BFI_IOC_OP) ||
(readl(rb + BFA_IOC1_STATE_REG) == BFI_IOC_OP))
return BFA_TRUE;
return BFA_FALSE;
}
bfa_status_t
bfa_ioc_ct_pll_init(bfa_os_addr_t rb, bfa_boolean_t fcmode)
bfa_ioc_ct_pll_init(void __iomem *rb, bfa_boolean_t fcmode)
{
u32 pll_sclk, pll_fclk, r32;
@ -354,56 +354,51 @@ bfa_ioc_ct_pll_init(bfa_os_addr_t rb, bfa_boolean_t fcmode)
__APP_PLL_425_JITLMT0_1(3U) |
__APP_PLL_425_CNTLMT0_1(1U);
if (fcmode) {
bfa_reg_write((rb + OP_MODE), 0);
bfa_reg_write((rb + ETH_MAC_SER_REG),
__APP_EMS_CMLCKSEL |
__APP_EMS_REFCKBUFEN2 |
__APP_EMS_CHANNEL_SEL);
writel(0, (rb + OP_MODE));
writel(__APP_EMS_CMLCKSEL | __APP_EMS_REFCKBUFEN2 |
__APP_EMS_CHANNEL_SEL, (rb + ETH_MAC_SER_REG));
} else {
bfa_reg_write((rb + OP_MODE), __GLOBAL_FCOE_MODE);
bfa_reg_write((rb + ETH_MAC_SER_REG),
__APP_EMS_REFCKBUFEN1);
writel(__GLOBAL_FCOE_MODE, (rb + OP_MODE));
writel(__APP_EMS_REFCKBUFEN1, (rb + ETH_MAC_SER_REG));
}
bfa_reg_write((rb + BFA_IOC0_STATE_REG), BFI_IOC_UNINIT);
bfa_reg_write((rb + BFA_IOC1_STATE_REG), BFI_IOC_UNINIT);
bfa_reg_write((rb + HOSTFN0_INT_MSK), 0xffffffffU);
bfa_reg_write((rb + HOSTFN1_INT_MSK), 0xffffffffU);
bfa_reg_write((rb + HOSTFN0_INT_STATUS), 0xffffffffU);
bfa_reg_write((rb + HOSTFN1_INT_STATUS), 0xffffffffU);
bfa_reg_write((rb + HOSTFN0_INT_MSK), 0xffffffffU);
bfa_reg_write((rb + HOSTFN1_INT_MSK), 0xffffffffU);
bfa_reg_write(rb + APP_PLL_312_CTL_REG, pll_sclk |
__APP_PLL_312_LOGIC_SOFT_RESET);
bfa_reg_write(rb + APP_PLL_425_CTL_REG, pll_fclk |
__APP_PLL_425_LOGIC_SOFT_RESET);
bfa_reg_write(rb + APP_PLL_312_CTL_REG, pll_sclk |
__APP_PLL_312_LOGIC_SOFT_RESET | __APP_PLL_312_ENABLE);
bfa_reg_write(rb + APP_PLL_425_CTL_REG, pll_fclk |
__APP_PLL_425_LOGIC_SOFT_RESET | __APP_PLL_425_ENABLE);
bfa_reg_read(rb + HOSTFN0_INT_MSK);
bfa_os_udelay(2000);
bfa_reg_write((rb + HOSTFN0_INT_STATUS), 0xffffffffU);
bfa_reg_write((rb + HOSTFN1_INT_STATUS), 0xffffffffU);
bfa_reg_write(rb + APP_PLL_312_CTL_REG, pll_sclk |
__APP_PLL_312_ENABLE);
bfa_reg_write(rb + APP_PLL_425_CTL_REG, pll_fclk |
__APP_PLL_425_ENABLE);
writel(BFI_IOC_UNINIT, (rb + BFA_IOC0_STATE_REG));
writel(BFI_IOC_UNINIT, (rb + BFA_IOC1_STATE_REG));
writel(0xffffffffU, (rb + HOSTFN0_INT_MSK));
writel(0xffffffffU, (rb + HOSTFN1_INT_MSK));
writel(0xffffffffU, (rb + HOSTFN0_INT_STATUS));
writel(0xffffffffU, (rb + HOSTFN1_INT_STATUS));
writel(0xffffffffU, (rb + HOSTFN0_INT_MSK));
writel(0xffffffffU, (rb + HOSTFN1_INT_MSK));
writel(pll_sclk | __APP_PLL_312_LOGIC_SOFT_RESET,
rb + APP_PLL_312_CTL_REG);
writel(pll_fclk | __APP_PLL_425_LOGIC_SOFT_RESET,
rb + APP_PLL_425_CTL_REG);
writel(pll_sclk | __APP_PLL_312_LOGIC_SOFT_RESET | __APP_PLL_312_ENABLE,
rb + APP_PLL_312_CTL_REG);
writel(pll_fclk | __APP_PLL_425_LOGIC_SOFT_RESET | __APP_PLL_425_ENABLE,
rb + APP_PLL_425_CTL_REG);
readl(rb + HOSTFN0_INT_MSK);
udelay(2000);
writel(0xffffffffU, (rb + HOSTFN0_INT_STATUS));
writel(0xffffffffU, (rb + HOSTFN1_INT_STATUS));
writel(pll_sclk | __APP_PLL_312_ENABLE, rb + APP_PLL_312_CTL_REG);
writel(pll_fclk | __APP_PLL_425_ENABLE, rb + APP_PLL_425_CTL_REG);
if (!fcmode) {
bfa_reg_write((rb + PMM_1T_RESET_REG_P0), __PMM_1T_RESET_P);
bfa_reg_write((rb + PMM_1T_RESET_REG_P1), __PMM_1T_RESET_P);
writel(__PMM_1T_RESET_P, (rb + PMM_1T_RESET_REG_P0));
writel(__PMM_1T_RESET_P, (rb + PMM_1T_RESET_REG_P1));
}
r32 = bfa_reg_read((rb + PSS_CTL_REG));
r32 = readl((rb + PSS_CTL_REG));
r32 &= ~__PSS_LMEM_RESET;
bfa_reg_write((rb + PSS_CTL_REG), r32);
bfa_os_udelay(1000);
writel(r32, (rb + PSS_CTL_REG));
udelay(1000);
if (!fcmode) {
bfa_reg_write((rb + PMM_1T_RESET_REG_P0), 0);
bfa_reg_write((rb + PMM_1T_RESET_REG_P1), 0);
writel(0, (rb + PMM_1T_RESET_REG_P0));
writel(0, (rb + PMM_1T_RESET_REG_P1));
}
bfa_reg_write((rb + MBIST_CTL_REG), __EDRAM_BISTR_START);
bfa_os_udelay(1000);
r32 = bfa_reg_read((rb + MBIST_STAT_REG));
bfa_reg_write((rb + MBIST_CTL_REG), 0);
writel(__EDRAM_BISTR_START, (rb + MBIST_CTL_REG));
udelay(1000);
r32 = readl((rb + MBIST_STAT_REG));
writel(0, (rb + MBIST_CTL_REG));
return BFA_STATUS_OK;
}

View file

@ -15,7 +15,7 @@
* General Public License for more details.
*/
/**
/*
* bfa_modules.h BFA modules
*/
@ -52,7 +52,7 @@ enum {
};
/**
/*
* Macro to define a new BFA module
*/
#define BFA_MODULE(__mod) \
@ -80,7 +80,7 @@ enum {
#define BFA_CACHELINE_SZ (256)
/**
/*
* Structure used to interact between different BFA sub modules
*
* Each sub module needs to implement only the entry points relevant to it (and

View file

@ -15,10 +15,6 @@
* General Public License for more details.
*/
/**
* Contains declarations all OS Specific files needed for BFA layer
*/
#ifndef __BFA_OS_INC_H__
#define __BFA_OS_INC_H__
@ -44,11 +40,6 @@
#define __BIGENDIAN
#endif
static inline u64 bfa_os_get_clock(void)
{
return jiffies;
}
static inline u64 bfa_os_get_log_time(void)
{
u64 system_time = 0;
@ -63,13 +54,6 @@ static inline u64 bfa_os_get_log_time(void)
#define bfa_io_lat_clock_res_div HZ
#define bfa_io_lat_clock_res_mul 1000
#define BFA_ASSERT(p) do { \
if (!(p)) { \
printk(KERN_ERR "assert(%s) failed at %s:%d\n", \
#p, __FILE__, __LINE__); \
} \
} while (0)
#define BFA_LOG(level, bfad, mask, fmt, arg...) \
do { \
if (((mask) == 4) || (level[1] <= '4')) \
@ -81,22 +65,6 @@ do { \
((_x) & 0x00ff00) | \
(((_x) & 0xff0000) >> 16))
#define bfa_swap_8b(_x) \
((((_x) & 0xff00000000000000ull) >> 56) \
| (((_x) & 0x00ff000000000000ull) >> 40) \
| (((_x) & 0x0000ff0000000000ull) >> 24) \
| (((_x) & 0x000000ff00000000ull) >> 8) \
| (((_x) & 0x00000000ff000000ull) << 8) \
| (((_x) & 0x0000000000ff0000ull) << 24) \
| (((_x) & 0x000000000000ff00ull) << 40) \
| (((_x) & 0x00000000000000ffull) << 56))
#define bfa_os_swap32(_x) \
((((_x) & 0xff) << 24) | \
(((_x) & 0x0000ff00) << 8) | \
(((_x) & 0x00ff0000) >> 8) | \
(((_x) & 0xff000000) >> 24))
#define bfa_os_swap_sgaddr(_x) ((u64)( \
(((u64)(_x) & (u64)0x00000000000000ffull) << 32) | \
(((u64)(_x) & (u64)0x000000000000ff00ull) << 32) | \
@ -108,59 +76,27 @@ do { \
(((u64)(_x) & (u64)0xff00000000000000ull) >> 32)))
#ifndef __BIGENDIAN
#define bfa_os_htons(_x) ((u16)((((_x) & 0xff00) >> 8) | \
(((_x) & 0x00ff) << 8)))
#define bfa_os_htonl(_x) bfa_os_swap32(_x)
#define bfa_os_htonll(_x) bfa_swap_8b(_x)
#define bfa_os_hton3b(_x) bfa_swap_3b(_x)
#define bfa_os_wtole(_x) (_x)
#define bfa_os_hton3b(_x) bfa_swap_3b(_x)
#define bfa_os_sgaddr(_x) (_x)
#else
#define bfa_os_htons(_x) (_x)
#define bfa_os_htonl(_x) (_x)
#define bfa_os_hton3b(_x) (_x)
#define bfa_os_htonll(_x) (_x)
#define bfa_os_wtole(_x) bfa_os_swap32(_x)
#define bfa_os_sgaddr(_x) bfa_os_swap_sgaddr(_x)
#endif
#define bfa_os_ntohs(_x) bfa_os_htons(_x)
#define bfa_os_ntohl(_x) bfa_os_htonl(_x)
#define bfa_os_ntohll(_x) bfa_os_htonll(_x)
#define bfa_os_ntoh3b(_x) bfa_os_hton3b(_x)
#define bfa_os_u32(__pa64) ((__pa64) >> 32)
#define bfa_os_memset memset
#define bfa_os_memcpy memcpy
#define bfa_os_udelay udelay
#define bfa_os_vsprintf vsprintf
#define bfa_os_snprintf snprintf
#define bfa_os_assign(__t, __s) __t = __s
#define bfa_os_addr_t void __iomem *
#define bfa_os_reg_read(_raddr) readl(_raddr)
#define bfa_os_reg_write(_raddr, _val) writel((_val), (_raddr))
#define bfa_os_mem_read(_raddr, _off) \
bfa_os_swap32(readl(((_raddr) + (_off))))
#define bfa_os_mem_write(_raddr, _off, _val) \
writel(bfa_os_swap32((_val)), ((_raddr) + (_off)))
#define BFA_TRC_TS(_trcm) \
({ \
struct timeval tv; \
\
do_gettimeofday(&tv); \
(tv.tv_sec*1000000+tv.tv_usec); \
})
#define BFA_TRC_TS(_trcm) \
({ \
struct timeval tv; \
\
do_gettimeofday(&tv); \
(tv.tv_sec*1000000+tv.tv_usec); \
})
#define boolean_t int
/**
/*
* For current time stamp, OS API will fill-in
*/
struct bfa_timeval_s {

View file

@ -37,16 +37,16 @@ bfa_port_stats_swap(struct bfa_port_s *port, union bfa_port_stats_u *stats)
t0 = dip[i];
t1 = dip[i + 1];
#ifdef __BIGENDIAN
dip[i] = bfa_os_ntohl(t0);
dip[i + 1] = bfa_os_ntohl(t1);
dip[i] = be32_to_cpu(t0);
dip[i + 1] = be32_to_cpu(t1);
#else
dip[i] = bfa_os_ntohl(t1);
dip[i + 1] = bfa_os_ntohl(t0);
dip[i] = be32_to_cpu(t1);
dip[i + 1] = be32_to_cpu(t0);
#endif
}
}
/**
/*
* bfa_port_enable_isr()
*
*
@ -63,7 +63,7 @@ bfa_port_enable_isr(struct bfa_port_s *port, bfa_status_t status)
port->endis_cbfn(port->endis_cbarg, status);
}
/**
/*
* bfa_port_disable_isr()
*
*
@ -80,7 +80,7 @@ bfa_port_disable_isr(struct bfa_port_s *port, bfa_status_t status)
port->endis_cbfn(port->endis_cbarg, status);
}
/**
/*
* bfa_port_get_stats_isr()
*
*
@ -112,7 +112,7 @@ bfa_port_get_stats_isr(struct bfa_port_s *port, bfa_status_t status)
}
}
/**
/*
* bfa_port_clear_stats_isr()
*
*
@ -129,7 +129,7 @@ bfa_port_clear_stats_isr(struct bfa_port_s *port, bfa_status_t status)
port->stats_status = status;
port->stats_busy = BFA_FALSE;
/**
/*
* re-initialize time stamp for stats reset
*/
bfa_os_gettimeofday(&tv);
@ -141,7 +141,7 @@ bfa_port_clear_stats_isr(struct bfa_port_s *port, bfa_status_t status)
}
}
/**
/*
* bfa_port_isr()
*
*
@ -189,7 +189,7 @@ bfa_port_isr(void *cbarg, struct bfi_mbmsg_s *m)
}
}
/**
/*
* bfa_port_meminfo()
*
*
@ -203,7 +203,7 @@ bfa_port_meminfo(void)
return BFA_ROUNDUP(sizeof(union bfa_port_stats_u), BFA_DMA_ALIGN_SZ);
}
/**
/*
* bfa_port_mem_claim()
*
*
@ -220,7 +220,7 @@ bfa_port_mem_claim(struct bfa_port_s *port, u8 *dma_kva, u64 dma_pa)
port->stats_dma.pa = dma_pa;
}
/**
/*
* bfa_port_enable()
*
* Send the Port enable request to the f/w
@ -264,7 +264,7 @@ bfa_port_enable(struct bfa_port_s *port, bfa_port_endis_cbfn_t cbfn,
return BFA_STATUS_OK;
}
/**
/*
* bfa_port_disable()
*
* Send the Port disable request to the f/w
@ -308,7 +308,7 @@ bfa_port_disable(struct bfa_port_s *port, bfa_port_endis_cbfn_t cbfn,
return BFA_STATUS_OK;
}
/**
/*
* bfa_port_get_stats()
*
* Send the request to the f/w to fetch Port statistics.
@ -348,7 +348,7 @@ bfa_port_get_stats(struct bfa_port_s *port, union bfa_port_stats_u *stats,
return BFA_STATUS_OK;
}
/**
/*
* bfa_port_clear_stats()
*
*
@ -385,7 +385,7 @@ bfa_port_clear_stats(struct bfa_port_s *port, bfa_port_stats_cbfn_t cbfn,
return BFA_STATUS_OK;
}
/**
/*
* bfa_port_hbfail()
*
*
@ -415,7 +415,7 @@ bfa_port_hbfail(void *arg)
}
}
/**
/*
* bfa_port_attach()
*
*
@ -449,7 +449,7 @@ bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,
bfa_ioc_hbfail_init(&port->hbfail, bfa_port_hbfail, port);
bfa_ioc_hbfail_register(port->ioc, &port->hbfail);
/**
/*
* initialize time stamp for stats reset
*/
bfa_os_gettimeofday(&tv);
@ -458,7 +458,7 @@ bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,
bfa_trc(port, 0);
}
/**
/*
* bfa_port_detach()
*
*

File diff suppressed because it is too large Load diff

View file

@ -22,12 +22,12 @@
#include "bfi_ms.h"
/**
/*
* Scatter-gather DMA related defines
*/
#define BFA_SGPG_MIN (16)
/**
/*
* Alignment macro for SG page allocation
*/
#define BFA_SGPG_ROUNDUP(_l) (((_l) + (sizeof(struct bfi_sgpg_s) - 1)) \
@ -48,7 +48,7 @@ struct bfa_sgpg_s {
union bfi_addr_u sgpg_pa; /* pa of SG page */
};
/**
/*
* Given number of SG elements, BFA_SGPG_NPAGE() returns the number of
* SG pages required.
*/
@ -75,7 +75,7 @@ void bfa_sgpg_wait(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe, int nsgpgs);
void bfa_sgpg_wcancel(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe);
/**
/*
* FCXP related defines
*/
#define BFA_FCXP_MIN (1)
@ -115,12 +115,12 @@ typedef void (*bfa_fcxp_alloc_cbfn_t) (void *cbarg, struct bfa_fcxp_s *fcxp);
/**
/*
* Information needed for a FCXP request
*/
struct bfa_fcxp_req_info_s {
struct bfa_rport_s *bfa_rport;
/** Pointer to the bfa rport that was
/* Pointer to the bfa rport that was
* returned from bfa_rport_create().
* This could be left NULL for WKA or
* for FCXP interactions before the
@ -137,11 +137,10 @@ struct bfa_fcxp_req_info_s {
struct bfa_fcxp_rsp_info_s {
struct fchs_s rsp_fchs;
/** !< Response frame's FC header will
/* Response frame's FC header will
* be sent back in this field */
u8 rsp_timeout;
/** !< timeout in seconds, 0-no response
*/
/* timeout in seconds, 0-no response */
u8 rsvd2[3];
u32 rsp_maxlen; /* max response length expected */
};
@ -218,7 +217,7 @@ struct bfa_fcxp_wqe_s {
void bfa_fcxp_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
/**
/*
* RPORT related defines
*/
#define BFA_RPORT_MIN 4
@ -232,7 +231,7 @@ struct bfa_rport_mod_s {
#define BFA_RPORT_MOD(__bfa) (&(__bfa)->modules.rport_mod)
/**
/*
* Convert rport tag to RPORT
*/
#define BFA_RPORT_FROM_TAG(__bfa, _tag) \
@ -244,7 +243,7 @@ struct bfa_rport_mod_s {
*/
void bfa_rport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
/**
/*
* BFA rport information.
*/
struct bfa_rport_info_s {
@ -259,7 +258,7 @@ struct bfa_rport_info_s {
enum bfa_port_speed speed; /* Rport's current speed */
};
/**
/*
* BFA rport data structure
*/
struct bfa_rport_s {
@ -282,7 +281,7 @@ struct bfa_rport_s {
#define BFA_RPORT_FC_COS(_rport) ((_rport)->rport_info.fc_class)
/**
/*
* UF - unsolicited receive related defines
*/
@ -305,7 +304,7 @@ struct bfa_uf_s {
struct bfa_sge_s sges[BFI_SGE_INLINE_MAX];
};
/**
/*
* Callback prototype for unsolicited frame receive handler.
*
* @param[in] cbarg callback arg for receive handler
@ -338,7 +337,7 @@ void bfa_uf_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
#define BFA_UF_BUFSZ (2 * 1024 + 256)
/**
/*
* @todo private
*/
struct bfa_uf_buf_s {
@ -346,7 +345,7 @@ struct bfa_uf_buf_s {
};
/**
/*
* LPS - bfa lport login/logout service interface
*/
struct bfa_lps_s {
@ -397,14 +396,14 @@ struct bfa_lps_mod_s {
void bfa_lps_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
/**
/*
* FCPORT related defines
*/
#define BFA_FCPORT(_bfa) (&((_bfa)->modules.port))
typedef void (*bfa_cb_port_t) (void *cbarg, enum bfa_status status);
/**
/*
* Link notification data structure
*/
struct bfa_fcport_ln_s {
@ -418,7 +417,7 @@ struct bfa_fcport_trunk_s {
struct bfa_trunk_attr_s attr;
};
/**
/*
* BFA FC port data structure
*/
struct bfa_fcport_s {
@ -613,7 +612,7 @@ void bfa_uf_recv_register(struct bfa_s *bfa, bfa_cb_uf_recv_t ufrecv,
void *cbarg);
void bfa_uf_free(struct bfa_uf_s *uf);
/**
/*
* bfa lport service api
*/

View file

@ -15,7 +15,7 @@
* General Public License for more details.
*/
/**
/*
* bfad.c Linux driver PCI interface module.
*/
#include <linux/module.h>
@ -151,7 +151,7 @@ bfad_sm_failed(struct bfad_s *bfad, enum bfad_sm_event event);
static void
bfad_sm_fcs_exit(struct bfad_s *bfad, enum bfad_sm_event event);
/**
/*
* Beginning state for the driver instance, awaiting the pci_probe event
*/
static void
@ -181,7 +181,7 @@ bfad_sm_uninit(struct bfad_s *bfad, enum bfad_sm_event event)
}
}
/**
/*
* Driver Instance is created, awaiting event INIT to initialize the bfad
*/
static void
@ -364,7 +364,7 @@ bfad_sm_stopping(struct bfad_s *bfad, enum bfad_sm_event event)
}
}
/**
/*
* BFA callbacks
*/
void
@ -376,7 +376,7 @@ bfad_hcb_comp(void *arg, bfa_status_t status)
complete(&fcomp->comp);
}
/**
/*
* bfa_init callback
*/
void
@ -401,7 +401,7 @@ bfa_cb_init(void *drv, bfa_status_t init_status)
complete(&bfad->comp);
}
/**
/*
* BFA_FCS callbacks
*/
struct bfad_port_s *
@ -457,7 +457,7 @@ bfa_fcb_lport_delete(struct bfad_s *bfad, enum bfa_lport_role roles,
}
}
/**
/*
* FCS RPORT alloc callback, after successful PLOGI by FCS
*/
bfa_status_t
@ -478,7 +478,7 @@ ext:
return rc;
}
/**
/*
* FCS PBC VPORT Create
*/
void
@ -663,7 +663,7 @@ ext:
return rc;
}
/**
/*
* Create a vport under a vf.
*/
bfa_status_t
@ -716,30 +716,6 @@ ext:
return rc;
}
/**
* Create a vf and its base vport implicitely.
*/
bfa_status_t
bfad_vf_create(struct bfad_s *bfad, u16 vf_id,
struct bfa_lport_cfg_s *port_cfg)
{
struct bfad_vf_s *vf;
int rc = BFA_STATUS_OK;
vf = kzalloc(sizeof(struct bfad_vf_s), GFP_KERNEL);
if (!vf) {
rc = BFA_STATUS_FAILED;
goto ext;
}
rc = bfa_fcs_vf_create(&vf->fcs_vf, &bfad->bfa_fcs, vf_id, port_cfg,
vf);
if (rc != BFA_STATUS_OK)
kfree(vf);
ext:
return rc;
}
void
bfad_bfa_tmo(unsigned long data)
{
@ -885,20 +861,6 @@ bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad)
pci_set_drvdata(pdev, NULL);
}
void
bfad_fcs_port_cfg(struct bfad_s *bfad)
{
struct bfa_lport_cfg_s port_cfg;
struct bfa_port_attr_s attr;
char symname[BFA_SYMNAME_MAXLEN];
sprintf(symname, "%s-%d", BFAD_DRIVER_NAME, bfad->inst_no);
memcpy(port_cfg.sym_name.symname, symname, strlen(symname));
bfa_fcport_get_attr(&bfad->bfa, &attr);
port_cfg.nwwn = attr.nwwn;
port_cfg.pwwn = attr.pwwn;
}
bfa_status_t
bfad_drv_init(struct bfad_s *bfad)
{
@ -1089,9 +1051,6 @@ bfad_start_ops(struct bfad_s *bfad) {
bfa_fcs_init(&bfad->bfa_fcs);
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
/* PPORT FCS config */
bfad_fcs_port_cfg(bfad);
retval = bfad_cfg_pport(bfad, BFA_LPORT_ROLE_FCP_IM);
if (retval != BFA_STATUS_OK) {
if (bfa_sm_cmp_state(bfad, bfad_sm_initializing))
@ -1181,7 +1140,7 @@ bfad_worker(void *ptr)
return 0;
}
/**
/*
* BFA driver interrupt functions
*/
irqreturn_t
@ -1240,7 +1199,7 @@ bfad_msix(int irq, void *dev_id)
return IRQ_HANDLED;
}
/**
/*
* Initialize the MSIX entry table.
*/
static void
@ -1293,7 +1252,7 @@ bfad_install_msix_handler(struct bfad_s *bfad)
return 0;
}
/**
/*
* Setup MSIX based interrupt.
*/
int
@ -1374,7 +1333,7 @@ bfad_remove_intr(struct bfad_s *bfad)
}
}
/**
/*
* PCI probe entry.
*/
int
@ -1460,7 +1419,7 @@ out:
return error;
}
/**
/*
* PCI remove entry.
*/
void
@ -1541,7 +1500,7 @@ static struct pci_driver bfad_pci_driver = {
.remove = __devexit_p(bfad_pci_remove),
};
/**
/*
* Driver module init.
*/
static int __init
@ -1581,7 +1540,7 @@ ext:
return error;
}
/**
/*
* Driver module exit.
*/
static void __exit

View file

@ -15,14 +15,14 @@
* General Public License for more details.
*/
/**
/*
* bfa_attr.c Linux driver configuration interface module.
*/
#include "bfad_drv.h"
#include "bfad_im.h"
/**
/*
* FC transport template entry, get SCSI target port ID.
*/
void
@ -48,7 +48,7 @@ bfad_im_get_starget_port_id(struct scsi_target *starget)
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
}
/**
/*
* FC transport template entry, get SCSI target nwwn.
*/
void
@ -70,11 +70,11 @@ bfad_im_get_starget_node_name(struct scsi_target *starget)
if (itnim)
node_name = bfa_fcs_itnim_get_nwwn(&itnim->fcs_itnim);
fc_starget_node_name(starget) = bfa_os_htonll(node_name);
fc_starget_node_name(starget) = cpu_to_be64(node_name);
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
}
/**
/*
* FC transport template entry, get SCSI target pwwn.
*/
void
@ -96,11 +96,11 @@ bfad_im_get_starget_port_name(struct scsi_target *starget)
if (itnim)
port_name = bfa_fcs_itnim_get_pwwn(&itnim->fcs_itnim);
fc_starget_port_name(starget) = bfa_os_htonll(port_name);
fc_starget_port_name(starget) = cpu_to_be64(port_name);
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
}
/**
/*
* FC transport template entry, get SCSI host port ID.
*/
void
@ -114,7 +114,7 @@ bfad_im_get_host_port_id(struct Scsi_Host *shost)
bfa_os_hton3b(bfa_fcs_lport_get_fcid(port->fcs_port));
}
/**
/*
* FC transport template entry, get SCSI host port type.
*/
static void
@ -146,7 +146,7 @@ bfad_im_get_host_port_type(struct Scsi_Host *shost)
}
}
/**
/*
* FC transport template entry, get SCSI host port state.
*/
static void
@ -183,7 +183,7 @@ bfad_im_get_host_port_state(struct Scsi_Host *shost)
}
}
/**
/*
* FC transport template entry, get SCSI host active fc4s.
*/
static void
@ -202,7 +202,7 @@ bfad_im_get_host_active_fc4s(struct Scsi_Host *shost)
fc_host_active_fc4s(shost)[7] = 1;
}
/**
/*
* FC transport template entry, get SCSI host link speed.
*/
static void
@ -236,7 +236,7 @@ bfad_im_get_host_speed(struct Scsi_Host *shost)
}
}
/**
/*
* FC transport template entry, get SCSI host port type.
*/
static void
@ -249,11 +249,11 @@ bfad_im_get_host_fabric_name(struct Scsi_Host *shost)
fabric_nwwn = bfa_fcs_lport_get_fabric_name(port->fcs_port);
fc_host_fabric_name(shost) = bfa_os_htonll(fabric_nwwn);
fc_host_fabric_name(shost) = cpu_to_be64(fabric_nwwn);
}
/**
/*
* FC transport template entry, get BFAD statistics.
*/
static struct fc_host_statistics *
@ -304,7 +304,7 @@ bfad_im_get_stats(struct Scsi_Host *shost)
return hstats;
}
/**
/*
* FC transport template entry, reset BFAD statistics.
*/
static void
@ -331,7 +331,7 @@ bfad_im_reset_stats(struct Scsi_Host *shost)
return;
}
/**
/*
* FC transport template entry, get rport loss timeout.
*/
static void
@ -347,7 +347,7 @@ bfad_im_get_rport_loss_tmo(struct fc_rport *rport)
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
}
/**
/*
* FC transport template entry, set rport loss timeout.
*/
static void
@ -633,7 +633,7 @@ struct fc_function_template bfad_im_vport_fc_function_template = {
.set_rport_dev_loss_tmo = bfad_im_set_rport_loss_tmo,
};
/**
/*
* Scsi_Host_attrs SCSI host attributes
*/
static ssize_t
@ -733,7 +733,7 @@ bfad_im_node_name_show(struct device *dev, struct device_attribute *attr,
u64 nwwn;
nwwn = bfa_fcs_lport_get_nwwn(port->fcs_port);
return snprintf(buf, PAGE_SIZE, "0x%llx\n", bfa_os_htonll(nwwn));
return snprintf(buf, PAGE_SIZE, "0x%llx\n", cpu_to_be64(nwwn));
}
static ssize_t

View file

@ -318,7 +318,7 @@ bfad_debugfs_write_regrd(struct file *file, const char __user *buf,
regbuf = (u32 *)bfad->regdata;
spin_lock_irqsave(&bfad->bfad_lock, flags);
for (i = 0; i < len; i++) {
*regbuf = bfa_reg_read(reg_addr);
*regbuf = readl(reg_addr);
regbuf++;
reg_addr += sizeof(u32);
}
@ -361,7 +361,7 @@ bfad_debugfs_write_regwr(struct file *file, const char __user *buf,
reg_addr = (u32 *) ((u8 *) bfa_ioc_bar0(ioc) + addr);
spin_lock_irqsave(&bfad->bfad_lock, flags);
bfa_reg_write(reg_addr, val);
writel(val, reg_addr);
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
return nbytes;

View file

@ -15,11 +15,11 @@
* General Public License for more details.
*/
/**
/*
* Contains base driver definitions.
*/
/**
/*
* bfa_drv.h Linux driver data structures.
*/
@ -309,7 +309,6 @@ void bfad_bfa_tmo(unsigned long data);
void bfad_init_timer(struct bfad_s *bfad);
int bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad);
void bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad);
void bfad_fcs_port_cfg(struct bfad_s *bfad);
void bfad_drv_uninit(struct bfad_s *bfad);
int bfad_worker(void *ptr);
void bfad_debugfs_init(struct bfad_port_s *port);

View file

@ -15,7 +15,7 @@
* General Public License for more details.
*/
/**
/*
* bfad_im.c Linux driver IM module.
*/
@ -30,8 +30,7 @@ DEFINE_IDR(bfad_im_port_index);
struct scsi_transport_template *bfad_im_scsi_transport_template;
struct scsi_transport_template *bfad_im_scsi_vport_transport_template;
static void bfad_im_itnim_work_handler(struct work_struct *work);
static int bfad_im_queuecommand(struct scsi_cmnd *cmnd,
void (*done)(struct scsi_cmnd *));
static int bfad_im_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmnd);
static int bfad_im_slave_alloc(struct scsi_device *sdev);
static void bfad_im_fc_rport_add(struct bfad_im_port_s *im_port,
struct bfad_itnim_s *itnim);
@ -164,10 +163,10 @@ bfa_cb_tskim_done(void *bfad, struct bfad_tskim_s *dtsk,
wake_up(wq);
}
/**
/*
* Scsi_Host_template SCSI host template
*/
/**
/*
* Scsi_Host template entry, returns BFAD PCI info.
*/
static const char *
@ -196,7 +195,7 @@ bfad_im_info(struct Scsi_Host *shost)
return bfa_buf;
}
/**
/*
* Scsi_Host template entry, aborts the specified SCSI command.
*
* Returns: SUCCESS or FAILED.
@ -280,7 +279,7 @@ out:
return rc;
}
/**
/*
* Scsi_Host template entry, resets a LUN and abort its all commands.
*
* Returns: SUCCESS or FAILED.
@ -319,7 +318,7 @@ bfad_im_reset_lun_handler(struct scsi_cmnd *cmnd)
goto out;
}
/**
/*
* Set host_scribble to NULL to avoid aborting a task command
* if happens.
*/
@ -346,7 +345,7 @@ out:
return rc;
}
/**
/*
* Scsi_Host template entry, resets the bus and abort all commands.
*/
static int
@ -396,7 +395,7 @@ bfad_im_reset_bus_handler(struct scsi_cmnd *cmnd)
return SUCCESS;
}
/**
/*
* Scsi_Host template entry slave_destroy.
*/
static void
@ -406,11 +405,11 @@ bfad_im_slave_destroy(struct scsi_device *sdev)
return;
}
/**
/*
* BFA FCS itnim callbacks
*/
/**
/*
* BFA FCS itnim alloc callback, after successful PRLI
* Context: Interrupt
*/
@ -433,7 +432,7 @@ bfa_fcb_itnim_alloc(struct bfad_s *bfad, struct bfa_fcs_itnim_s **itnim,
bfad->bfad_flags |= BFAD_RPORT_ONLINE;
}
/**
/*
* BFA FCS itnim free callback.
* Context: Interrupt. bfad_lock is held
*/
@ -471,7 +470,7 @@ bfa_fcb_itnim_free(struct bfad_s *bfad, struct bfad_itnim_s *itnim_drv)
queue_work(im->drv_workq, &itnim_drv->itnim_work);
}
/**
/*
* BFA FCS itnim online callback.
* Context: Interrupt. bfad_lock is held
*/
@ -492,7 +491,7 @@ bfa_fcb_itnim_online(struct bfad_itnim_s *itnim_drv)
queue_work(im->drv_workq, &itnim_drv->itnim_work);
}
/**
/*
* BFA FCS itnim offline callback.
* Context: Interrupt. bfad_lock is held
*/
@ -519,7 +518,7 @@ bfa_fcb_itnim_offline(struct bfad_itnim_s *itnim_drv)
queue_work(im->drv_workq, &itnim_drv->itnim_work);
}
/**
/*
* Allocate a Scsi_Host for a port.
*/
int
@ -751,7 +750,7 @@ bfad_os_thread_workq(struct bfad_s *bfad)
return BFA_STATUS_OK;
}
/**
/*
* Scsi_Host template entry.
*
* Description:
@ -896,7 +895,7 @@ bfad_os_get_itnim(struct bfad_im_port_s *im_port, int id)
return NULL;
}
/**
/*
* Scsi_Host template entry slave_alloc
*/
static int
@ -915,12 +914,16 @@ bfad_im_slave_alloc(struct scsi_device *sdev)
static u32
bfad_im_supported_speeds(struct bfa_s *bfa)
{
struct bfa_ioc_attr_s ioc_attr;
struct bfa_ioc_attr_s *ioc_attr;
u32 supported_speed = 0;
bfa_get_attr(bfa, &ioc_attr);
if (ioc_attr.adapter_attr.max_speed == BFA_PORT_SPEED_8GBPS) {
if (ioc_attr.adapter_attr.is_mezz) {
ioc_attr = kzalloc(sizeof(struct bfa_ioc_attr_s), GFP_KERNEL);
if (!ioc_attr)
return 0;
bfa_get_attr(bfa, ioc_attr);
if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_8GBPS) {
if (ioc_attr->adapter_attr.is_mezz) {
supported_speed |= FC_PORTSPEED_8GBIT |
FC_PORTSPEED_4GBIT |
FC_PORTSPEED_2GBIT | FC_PORTSPEED_1GBIT;
@ -929,12 +932,13 @@ bfad_im_supported_speeds(struct bfa_s *bfa)
FC_PORTSPEED_4GBIT |
FC_PORTSPEED_2GBIT;
}
} else if (ioc_attr.adapter_attr.max_speed == BFA_PORT_SPEED_4GBPS) {
} else if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_4GBPS) {
supported_speed |= FC_PORTSPEED_4GBIT | FC_PORTSPEED_2GBIT |
FC_PORTSPEED_1GBIT;
} else if (ioc_attr.adapter_attr.max_speed == BFA_PORT_SPEED_10GBPS) {
} else if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_10GBPS) {
supported_speed |= FC_PORTSPEED_10GBIT;
}
kfree(ioc_attr);
return supported_speed;
}
@ -944,14 +948,13 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port)
struct Scsi_Host *host = im_port->shost;
struct bfad_s *bfad = im_port->bfad;
struct bfad_port_s *port = im_port->port;
struct bfa_port_attr_s pattr;
struct bfa_lport_attr_s port_attr;
char symname[BFA_SYMNAME_MAXLEN];
struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(&bfad->bfa);
fc_host_node_name(host) =
bfa_os_htonll((bfa_fcs_lport_get_nwwn(port->fcs_port)));
cpu_to_be64((bfa_fcs_lport_get_nwwn(port->fcs_port)));
fc_host_port_name(host) =
bfa_os_htonll((bfa_fcs_lport_get_pwwn(port->fcs_port)));
cpu_to_be64((bfa_fcs_lport_get_pwwn(port->fcs_port)));
fc_host_max_npiv_vports(host) = bfa_lps_get_max_vport(&bfad->bfa);
fc_host_supported_classes(host) = FC_COS_CLASS3;
@ -964,15 +967,12 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port)
/* For fibre channel services type 0x20 */
fc_host_supported_fc4s(host)[7] = 1;
bfa_fcs_lport_get_attr(&bfad->bfa_fcs.fabric.bport, &port_attr);
strncpy(symname, port_attr.port_cfg.sym_name.symname,
strncpy(symname, bfad->bfa_fcs.fabric.bport.port_cfg.sym_name.symname,
BFA_SYMNAME_MAXLEN);
sprintf(fc_host_symbolic_name(host), "%s", symname);
fc_host_supported_speeds(host) = bfad_im_supported_speeds(&bfad->bfa);
bfa_fcport_get_attr(&bfad->bfa, &pattr);
fc_host_maxframe_size(host) = pattr.pport_cfg.maxfrsize;
fc_host_maxframe_size(host) = fcport->cfg.maxfrsize;
}
static void
@ -983,9 +983,9 @@ bfad_im_fc_rport_add(struct bfad_im_port_s *im_port, struct bfad_itnim_s *itnim)
struct bfad_itnim_data_s *itnim_data;
rport_ids.node_name =
bfa_os_htonll(bfa_fcs_itnim_get_nwwn(&itnim->fcs_itnim));
cpu_to_be64(bfa_fcs_itnim_get_nwwn(&itnim->fcs_itnim));
rport_ids.port_name =
bfa_os_htonll(bfa_fcs_itnim_get_pwwn(&itnim->fcs_itnim));
cpu_to_be64(bfa_fcs_itnim_get_pwwn(&itnim->fcs_itnim));
rport_ids.port_id =
bfa_os_hton3b(bfa_fcs_itnim_get_fcid(&itnim->fcs_itnim));
rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
@ -1015,7 +1015,7 @@ bfad_im_fc_rport_add(struct bfad_im_port_s *im_port, struct bfad_itnim_s *itnim)
return;
}
/**
/*
* Work queue handler using FC transport service
* Context: kernel
*/
@ -1115,11 +1115,11 @@ bfad_im_itnim_work_handler(struct work_struct *work)
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
}
/**
/*
* Scsi_Host template entry, queue a SCSI command to the BFAD.
*/
static int
bfad_im_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))
bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))
{
struct bfad_im_port_s *im_port =
(struct bfad_im_port_s *) cmnd->device->host->hostdata[0];
@ -1186,6 +1186,8 @@ out_fail_cmd:
return 0;
}
static DEF_SCSI_QCMD(bfad_im_queuecommand)
void
bfad_os_rport_online_wait(struct bfad_s *bfad)
{

View file

@ -23,7 +23,7 @@
#pragma pack(1)
/**
/*
* BFI FW image type
*/
#define BFI_FLASH_CHUNK_SZ 256 /* Flash chunk size */
@ -35,7 +35,7 @@ enum {
BFI_IMAGE_MAX,
};
/**
/*
* Msg header common to all msgs
*/
struct bfi_mhdr_s {
@ -68,7 +68,7 @@ struct bfi_mhdr_s {
#define BFI_I2H_OPCODE_BASE 128
#define BFA_I2HM(_x) ((_x) + BFI_I2H_OPCODE_BASE)
/**
/*
****************************************************************************
*
* Scatter Gather Element and Page definition
@ -79,7 +79,7 @@ struct bfi_mhdr_s {
#define BFI_SGE_INLINE 1
#define BFI_SGE_INLINE_MAX (BFI_SGE_INLINE + 1)
/**
/*
* SG Flags
*/
enum {
@ -90,7 +90,7 @@ enum {
BFI_SGE_PGDLEN = 2, /* cumulative data length for page */
};
/**
/*
* DMA addresses
*/
union bfi_addr_u {
@ -100,7 +100,7 @@ union bfi_addr_u {
} a32;
};
/**
/*
* Scatter Gather Element
*/
struct bfi_sge_s {
@ -116,7 +116,7 @@ struct bfi_sge_s {
union bfi_addr_u sga;
};
/**
/*
* Scatter Gather Page
*/
#define BFI_SGPG_DATA_SGES 7
@ -139,7 +139,7 @@ struct bfi_msg_s {
u32 pl[BFI_LMSG_PL_WSZ];
};
/**
/*
* Mailbox message structure
*/
#define BFI_MBMSG_SZ 7
@ -148,7 +148,7 @@ struct bfi_mbmsg_s {
u32 pl[BFI_MBMSG_SZ];
};
/**
/*
* Message Classes
*/
enum bfi_mclass {
@ -186,7 +186,7 @@ enum bfi_mclass {
#define BFI_BOOT_LOADER_BIOS 1
#define BFI_BOOT_LOADER_UEFI 2
/**
/*
*----------------------------------------------------------------------
* IOC
*----------------------------------------------------------------------
@ -208,7 +208,7 @@ enum bfi_ioc_i2h_msgs {
BFI_IOC_I2H_HBEAT = BFA_I2HM(5),
};
/**
/*
* BFI_IOC_H2I_GETATTR_REQ message
*/
struct bfi_ioc_getattr_req_s {
@ -242,7 +242,7 @@ struct bfi_ioc_attr_s {
u32 card_type; /* card type */
};
/**
/*
* BFI_IOC_I2H_GETATTR_REPLY message
*/
struct bfi_ioc_getattr_reply_s {
@ -251,19 +251,19 @@ struct bfi_ioc_getattr_reply_s {
u8 rsvd[3];
};
/**
/*
* Firmware memory page offsets
*/
#define BFI_IOC_SMEM_PG0_CB (0x40)
#define BFI_IOC_SMEM_PG0_CT (0x180)
/**
/*
* Firmware statistic offset
*/
#define BFI_IOC_FWSTATS_OFF (0x6B40)
#define BFI_IOC_FWSTATS_SZ (4096)
/**
/*
* Firmware trace offset
*/
#define BFI_IOC_TRC_OFF (0x4b00)
@ -280,7 +280,7 @@ struct bfi_ioc_image_hdr_s {
u32 md5sum[BFI_IOC_MD5SUM_SZ];
};
/**
/*
* BFI_IOC_I2H_READY_EVENT message
*/
struct bfi_ioc_rdy_event_s {
@ -294,7 +294,7 @@ struct bfi_ioc_hbeat_s {
u32 hb_count; /* current heart beat count */
};
/**
/*
* IOC hardware/firmware state
*/
enum bfi_ioc_state {
@ -340,7 +340,7 @@ enum {
((__adap_type) & (BFI_ADAPTER_TTV | BFI_ADAPTER_PROTO | \
BFI_ADAPTER_UNSUPP))
/**
/*
* BFI_IOC_H2I_ENABLE_REQ & BFI_IOC_H2I_DISABLE_REQ messages
*/
struct bfi_ioc_ctrl_req_s {
@ -352,7 +352,7 @@ struct bfi_ioc_ctrl_req_s {
#define bfi_ioc_enable_req_t struct bfi_ioc_ctrl_req_s;
#define bfi_ioc_disable_req_t struct bfi_ioc_ctrl_req_s;
/**
/*
* BFI_IOC_I2H_ENABLE_REPLY & BFI_IOC_I2H_DISABLE_REPLY messages
*/
struct bfi_ioc_ctrl_reply_s {
@ -364,7 +364,7 @@ struct bfi_ioc_ctrl_reply_s {
#define bfi_ioc_disable_reply_t struct bfi_ioc_ctrl_reply_s;
#define BFI_IOC_MSGSZ 8
/**
/*
* H2I Messages
*/
union bfi_ioc_h2i_msg_u {
@ -375,7 +375,7 @@ union bfi_ioc_h2i_msg_u {
u32 mboxmsg[BFI_IOC_MSGSZ];
};
/**
/*
* I2H Messages
*/
union bfi_ioc_i2h_msg_u {
@ -385,7 +385,7 @@ union bfi_ioc_i2h_msg_u {
};
/**
/*
*----------------------------------------------------------------------
* PBC
*----------------------------------------------------------------------
@ -394,7 +394,7 @@ union bfi_ioc_i2h_msg_u {
#define BFI_PBC_MAX_BLUNS 8
#define BFI_PBC_MAX_VPORTS 16
/**
/*
* PBC boot lun configuration
*/
struct bfi_pbc_blun_s {
@ -402,7 +402,7 @@ struct bfi_pbc_blun_s {
lun_t tgt_lun;
};
/**
/*
* PBC virtual port configuration
*/
struct bfi_pbc_vport_s {
@ -410,7 +410,7 @@ struct bfi_pbc_vport_s {
wwn_t vp_nwwn;
};
/**
/*
* BFI pre-boot configuration information
*/
struct bfi_pbc_s {
@ -427,7 +427,7 @@ struct bfi_pbc_s {
struct bfi_pbc_vport_s vport[BFI_PBC_MAX_VPORTS];
};
/**
/*
*----------------------------------------------------------------------
* MSGQ
*----------------------------------------------------------------------
@ -531,7 +531,7 @@ enum bfi_port_i2h {
BFI_PORT_I2H_CLEAR_STATS_RSP = BFA_I2HM(4),
};
/**
/*
* Generic REQ type
*/
struct bfi_port_generic_req_s {
@ -540,7 +540,7 @@ struct bfi_port_generic_req_s {
u32 rsvd;
};
/**
/*
* Generic RSP type
*/
struct bfi_port_generic_rsp_s {
@ -550,7 +550,7 @@ struct bfi_port_generic_rsp_s {
u32 msgtag; /* msgtag for reply */
};
/**
/*
* BFI_PORT_H2I_GET_STATS_REQ
*/
struct bfi_port_get_stats_req_s {

View file

@ -41,7 +41,7 @@ struct bfi_iocfc_cfg_s {
u16 rsvd_1;
u32 endian_sig; /* endian signature of host */
/**
/*
* Request and response circular queue base addresses, size and
* shadow index pointers.
*/
@ -58,7 +58,7 @@ struct bfi_iocfc_cfg_s {
struct bfa_iocfc_intr_attr_s intr_attr; /* IOC interrupt attributes */
};
/**
/*
* Boot target wwn information for this port. This contains either the stored
* or discovered boot target port wwns for the port.
*/
@ -75,7 +75,7 @@ struct bfi_iocfc_cfgrsp_s {
struct bfi_pbc_s pbc_cfg;
};
/**
/*
* BFI_IOCFC_H2I_CFG_REQ message
*/
struct bfi_iocfc_cfg_req_s {
@ -84,7 +84,7 @@ struct bfi_iocfc_cfg_req_s {
};
/**
/*
* BFI_IOCFC_I2H_CFG_REPLY message
*/
struct bfi_iocfc_cfg_reply_s {
@ -95,7 +95,7 @@ struct bfi_iocfc_cfg_reply_s {
};
/**
/*
* BFI_IOCFC_H2I_SET_INTR_REQ message
*/
struct bfi_iocfc_set_intr_req_s {
@ -107,7 +107,7 @@ struct bfi_iocfc_set_intr_req_s {
};
/**
/*
* BFI_IOCFC_H2I_UPDATEQ_REQ message
*/
struct bfi_iocfc_updateq_req_s {
@ -119,7 +119,7 @@ struct bfi_iocfc_updateq_req_s {
};
/**
/*
* BFI_IOCFC_I2H_UPDATEQ_RSP message
*/
struct bfi_iocfc_updateq_rsp_s {
@ -129,7 +129,7 @@ struct bfi_iocfc_updateq_rsp_s {
};
/**
/*
* H2I Messages
*/
union bfi_iocfc_h2i_msg_u {
@ -140,7 +140,7 @@ union bfi_iocfc_h2i_msg_u {
};
/**
/*
* I2H Messages
*/
union bfi_iocfc_i2h_msg_u {
@ -173,7 +173,7 @@ enum bfi_fcport_i2h {
};
/**
/*
* Generic REQ type
*/
struct bfi_fcport_req_s {
@ -181,7 +181,7 @@ struct bfi_fcport_req_s {
u32 msgtag; /* msgtag for reply */
};
/**
/*
* Generic RSP type
*/
struct bfi_fcport_rsp_s {
@ -191,7 +191,7 @@ struct bfi_fcport_rsp_s {
u32 msgtag; /* msgtag for reply */
};
/**
/*
* BFI_FCPORT_H2I_ENABLE_REQ
*/
struct bfi_fcport_enable_req_s {
@ -205,7 +205,7 @@ struct bfi_fcport_enable_req_s {
u32 rsvd2;
};
/**
/*
* BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ
*/
struct bfi_fcport_set_svc_params_req_s {
@ -214,7 +214,7 @@ struct bfi_fcport_set_svc_params_req_s {
u16 rsvd;
};
/**
/*
* BFI_FCPORT_I2H_EVENT
*/
struct bfi_fcport_event_s {
@ -222,7 +222,7 @@ struct bfi_fcport_event_s {
struct bfa_port_link_s link_state;
};
/**
/*
* BFI_FCPORT_I2H_TRUNK_SCN
*/
struct bfi_fcport_trunk_link_s {
@ -243,7 +243,7 @@ struct bfi_fcport_trunk_scn_s {
struct bfi_fcport_trunk_link_s tlink[BFI_FCPORT_MAX_LINKS];
};
/**
/*
* fcport H2I message
*/
union bfi_fcport_h2i_msg_u {
@ -255,7 +255,7 @@ union bfi_fcport_h2i_msg_u {
struct bfi_fcport_req_s *pstatsclear;
};
/**
/*
* fcport I2H message
*/
union bfi_fcport_i2h_msg_u {
@ -279,7 +279,7 @@ enum bfi_fcxp_i2h {
#define BFA_FCXP_MAX_SGES 2
/**
/*
* FCXP send request structure
*/
struct bfi_fcxp_send_req_s {
@ -299,7 +299,7 @@ struct bfi_fcxp_send_req_s {
struct bfi_sge_s rsp_sge[BFA_FCXP_MAX_SGES]; /* response buf */
};
/**
/*
* FCXP send response structure
*/
struct bfi_fcxp_send_rsp_s {
@ -565,14 +565,14 @@ enum bfi_ioim_i2h {
BFI_IOIM_I2H_IOABORT_RSP = BFA_I2HM(2), /* ABORT rsp */
};
/**
/*
* IO command DIF info
*/
struct bfi_ioim_dif_s {
u32 dif_info[4];
};
/**
/*
* FCP IO messages overview
*
* @note
@ -587,7 +587,7 @@ struct bfi_ioim_req_s {
u16 rport_hdl; /* itnim/rport firmware handle */
struct fcp_cmnd_s cmnd; /* IO request info */
/**
/*
* SG elements array within the IO request must be double word
* aligned. This aligment is required to optimize SGM setup for the IO.
*/
@ -598,7 +598,7 @@ struct bfi_ioim_req_s {
struct bfi_ioim_dif_s dif;
};
/**
/*
* This table shows various IO status codes from firmware and their
* meaning. Host driver can use these status codes to further process
* IO completions.
@ -684,7 +684,7 @@ enum bfi_ioim_status {
};
#define BFI_IOIM_SNSLEN (256)
/**
/*
* I/O response message
*/
struct bfi_ioim_rsp_s {
@ -746,7 +746,7 @@ enum bfi_tskim_status {
BFI_TSKIM_STS_NOT_SUPP = 4,
BFI_TSKIM_STS_FAILED = 5,
/**
/*
* Defined by BFA
*/
BFI_TSKIM_STS_TIMEOUT = 10, /* TM request timedout */

View file

@ -692,6 +692,9 @@ static void do_act_open_rpl(struct cxgbi_device *cdev, struct sk_buff *skb)
&csk->daddr.sin_addr.s_addr, ntohs(csk->daddr.sin_port),
atid, tid, status, csk, csk->state, csk->flags);
if (status == CPL_ERR_RTX_NEG_ADVICE)
goto rel_skb;
if (status && status != CPL_ERR_TCAM_FULL &&
status != CPL_ERR_CONN_EXIST &&
status != CPL_ERR_ARP_MISS)

View file

@ -1080,7 +1080,7 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb,
* and is expected to be held on return.
*
**/
static int dc395x_queue_command(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
static int dc395x_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
{
struct DeviceCtlBlk *dcb;
struct ScsiReqBlk *srb;
@ -1154,6 +1154,7 @@ complete:
return 0;
}
static DEF_SCSI_QCMD(dc395x_queue_command)
/*
* Return the disk geometry for the given SCSI device.

View file

@ -773,6 +773,8 @@ static const struct scsi_dh_devlist rdac_dev_list[] = {
{"ENGENIO", "INF-01-00"},
{"STK", "FLEXLINE 380"},
{"SUN", "CSM100_R_FC"},
{"SUN", "STK6580_6780"},
{"SUN", "SUN_6180"},
{NULL, NULL},
};

View file

@ -423,7 +423,7 @@ static int adpt_slave_configure(struct scsi_device * device)
return 0;
}
static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *))
static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *))
{
adpt_hba* pHba = NULL;
struct adpt_device* pDev = NULL; /* dpt per device information */
@ -491,6 +491,8 @@ static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *))
return adpt_scsi_to_i2o(pHba, cmd, pDev);
}
static DEF_SCSI_QCMD(adpt_queue)
static int adpt_bios_param(struct scsi_device *sdev, struct block_device *dev,
sector_t capacity, int geom[])
{

View file

@ -29,7 +29,7 @@
*/
static int adpt_detect(struct scsi_host_template * sht);
static int adpt_queue(struct scsi_cmnd * cmd, void (*cmdcomplete) (struct scsi_cmnd *));
static int adpt_queue(struct Scsi_Host *h, struct scsi_cmnd * cmd);
static int adpt_abort(struct scsi_cmnd * cmd);
static int adpt_reset(struct scsi_cmnd* cmd);
static int adpt_release(struct Scsi_Host *host);

View file

@ -36,7 +36,7 @@ static int dtc_abort(Scsi_Cmnd *);
static int dtc_biosparam(struct scsi_device *, struct block_device *,
sector_t, int*);
static int dtc_detect(struct scsi_host_template *);
static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
static int dtc_queue_command(struct Scsi_Host *, struct scsi_cmnd *);
static int dtc_bus_reset(Scsi_Cmnd *);
#ifndef CMD_PER_LUN

View file

@ -505,8 +505,7 @@
static int eata2x_detect(struct scsi_host_template *);
static int eata2x_release(struct Scsi_Host *);
static int eata2x_queuecommand(struct scsi_cmnd *,
void (*done) (struct scsi_cmnd *));
static int eata2x_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
static int eata2x_eh_abort(struct scsi_cmnd *);
static int eata2x_eh_host_reset(struct scsi_cmnd *);
static int eata2x_bios_param(struct scsi_device *, struct block_device *,
@ -1758,7 +1757,7 @@ static void scsi_to_dev_dir(unsigned int i, struct hostdata *ha)
}
static int eata2x_queuecommand(struct scsi_cmnd *SCpnt,
static int eata2x_queuecommand_lck(struct scsi_cmnd *SCpnt,
void (*done) (struct scsi_cmnd *))
{
struct Scsi_Host *shost = SCpnt->device->host;
@ -1843,6 +1842,8 @@ static int eata2x_queuecommand(struct scsi_cmnd *SCpnt,
return 0;
}
static DEF_SCSI_QCMD(eata2x_queuecommand)
static int eata2x_eh_abort(struct scsi_cmnd *SCarg)
{
struct Scsi_Host *shost = SCarg->device->host;

View file

@ -335,7 +335,7 @@ static inline unsigned int eata_pio_send_command(unsigned long base, unsigned ch
return 0;
}
static int eata_pio_queue(struct scsi_cmnd *cmd,
static int eata_pio_queue_lck(struct scsi_cmnd *cmd,
void (*done)(struct scsi_cmnd *))
{
unsigned int x, y;
@ -438,6 +438,8 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,
return 0;
}
static DEF_SCSI_QCMD(eata_pio_queue)
static int eata_pio_abort(struct scsi_cmnd *cmd)
{
unsigned int loop = 100;

View file

@ -916,7 +916,7 @@ static void esp_event_queue_full(struct esp *esp, struct esp_cmd_entry *ent)
scsi_track_queue_full(dev, lp->num_tagged - 1);
}
static int esp_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
static int esp_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
{
struct scsi_device *dev = cmd->device;
struct esp *esp = shost_priv(dev->host);
@ -941,6 +941,8 @@ static int esp_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd
return 0;
}
static DEF_SCSI_QCMD(esp_queuecommand)
static int esp_check_gross_error(struct esp *esp)
{
if (esp->sreg & ESP_STAT_SPAM) {

View file

@ -117,7 +117,7 @@ static void fcoe_recv_frame(struct sk_buff *skb);
static void fcoe_get_lesb(struct fc_lport *, struct fc_els_lesb *);
module_param_call(create, fcoe_create, NULL, (void *)FIP_MODE_AUTO, S_IWUSR);
module_param_call(create, fcoe_create, NULL, (void *)FIP_MODE_FABRIC, S_IWUSR);
__MODULE_PARM_TYPE(create, "string");
MODULE_PARM_DESC(create, " Creates fcoe instance on a ethernet interface");
module_param_call(create_vn2vn, fcoe_create, NULL,
@ -1243,7 +1243,6 @@ int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev,
struct fcoe_interface *fcoe;
struct fc_frame_header *fh;
struct fcoe_percpu_s *fps;
struct fcoe_port *port;
struct ethhdr *eh;
unsigned int cpu;
@ -1262,16 +1261,7 @@ int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev,
skb_tail_pointer(skb), skb_end_pointer(skb),
skb->csum, skb->dev ? skb->dev->name : "<NULL>");
/* check for mac addresses */
eh = eth_hdr(skb);
port = lport_priv(lport);
if (compare_ether_addr(eh->h_dest, port->data_src_addr) &&
compare_ether_addr(eh->h_dest, fcoe->ctlr.ctl_src_addr) &&
compare_ether_addr(eh->h_dest, (u8[6])FC_FCOE_FLOGI_MAC)) {
FCOE_NETDEV_DBG(netdev, "wrong destination mac address:%pM\n",
eh->h_dest);
goto err;
}
if (is_fip_mode(&fcoe->ctlr) &&
compare_ether_addr(eh->h_source, fcoe->ctlr.dest_addr)) {
@ -1291,6 +1281,12 @@ int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev,
skb_set_transport_header(skb, sizeof(struct fcoe_hdr));
fh = (struct fc_frame_header *) skb_transport_header(skb);
if (ntoh24(&eh->h_dest[3]) != ntoh24(fh->fh_d_id)) {
FCOE_NETDEV_DBG(netdev, "FC frame d_id mismatch with MAC:%pM\n",
eh->h_dest);
goto err;
}
fr = fcoe_dev_from_skb(skb);
fr->fr_dev = lport;
fr->ptype = ptype;

View file

@ -2296,7 +2296,7 @@ static int fcoe_ctlr_vn_recv(struct fcoe_ctlr *fip, struct sk_buff *skb)
{
struct fip_header *fiph;
enum fip_vn2vn_subcode sub;
union {
struct {
struct fc_rport_priv rdata;
struct fcoe_rport frport;
} buf;

View file

@ -1072,7 +1072,7 @@ static int fd_mcs_release(struct Scsi_Host *shpnt)
return 0;
}
static int fd_mcs_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
static int fd_mcs_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
{
struct Scsi_Host *shpnt = SCpnt->device->host;
@ -1122,6 +1122,8 @@ static int fd_mcs_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
return 0;
}
static DEF_SCSI_QCMD(fd_mcs_queue)
#if DEBUG_ABORT || DEBUG_RESET
static void fd_mcs_print_info(Scsi_Cmnd * SCpnt)
{

View file

@ -1419,7 +1419,7 @@ static irqreturn_t do_fdomain_16x0_intr(int irq, void *dev_id)
return IRQ_HANDLED;
}
static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt,
static int fdomain_16x0_queue_lck(struct scsi_cmnd *SCpnt,
void (*done)(struct scsi_cmnd *))
{
if (in_command) {
@ -1469,6 +1469,8 @@ static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt,
return 0;
}
static DEF_SCSI_QCMD(fdomain_16x0_queue)
#if DEBUG_ABORT
static void print_info(struct scsi_cmnd *SCpnt)
{

View file

@ -246,7 +246,7 @@ void fnic_set_port_id(struct fc_lport *, u32, struct fc_frame *);
void fnic_update_mac(struct fc_lport *, u8 *new);
void fnic_update_mac_locked(struct fnic *, u8 *new);
int fnic_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *));
int fnic_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
int fnic_abort_cmd(struct scsi_cmnd *);
int fnic_device_reset(struct scsi_cmnd *);
int fnic_host_reset(struct scsi_cmnd *);

View file

@ -349,7 +349,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
* Routine to send a scsi cdb
* Called with host_lock held and interrupts disabled.
*/
int fnic_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
{
struct fc_lport *lp;
struct fc_rport *rport;
@ -457,6 +457,8 @@ out:
return ret;
}
DEF_SCSI_QCMD(fnic_queuecommand)
/*
* fnic_fcpio_fw_reset_cmpl_handler
* Routine to handle fw reset completion

View file

@ -46,7 +46,7 @@
static int generic_NCR5380_abort(Scsi_Cmnd *);
static int generic_NCR5380_detect(struct scsi_host_template *);
static int generic_NCR5380_release_resources(struct Scsi_Host *);
static int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
static int generic_NCR5380_queue_command(struct Scsi_Host *, struct scsi_cmnd *);
static int generic_NCR5380_bus_reset(Scsi_Cmnd *);
static const char* generic_NCR5380_info(struct Scsi_Host *);

View file

@ -185,7 +185,7 @@ static long gdth_unlocked_ioctl(struct file *filep, unsigned int cmd,
unsigned long arg);
static void gdth_flush(gdth_ha_str *ha);
static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *));
static int gdth_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd);
static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp,
struct gdth_cmndinfo *cmndinfo);
static void gdth_scsi_done(struct scsi_cmnd *scp);
@ -4004,7 +4004,7 @@ static int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,se
}
static int gdth_queuecommand(struct scsi_cmnd *scp,
static int gdth_queuecommand_lck(struct scsi_cmnd *scp,
void (*done)(struct scsi_cmnd *))
{
gdth_ha_str *ha = shost_priv(scp->device->host);
@ -4022,6 +4022,8 @@ static int gdth_queuecommand(struct scsi_cmnd *scp,
return __gdth_queuecommand(ha, scp, cmndinfo);
}
static DEF_SCSI_QCMD(gdth_queuecommand)
static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp,
struct gdth_cmndinfo *cmndinfo)
{
@ -4177,6 +4179,14 @@ static int ioc_general(void __user *arg, char *cmnd)
ha = gdth_find_ha(gen.ionode);
if (!ha)
return -EFAULT;
if (gen.data_len > INT_MAX)
return -EINVAL;
if (gen.sense_len > INT_MAX)
return -EINVAL;
if (gen.data_len + gen.sense_len > INT_MAX)
return -EINVAL;
if (gen.data_len + gen.sense_len != 0) {
if (!(buf = gdth_ioctl_alloc(ha, gen.data_len + gen.sense_len,
FALSE, &paddr)))

View file

@ -31,7 +31,6 @@
#include <linux/seq_file.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/smp_lock.h>
#include <linux/compat.h>
#include <linux/blktrace_api.h>
#include <linux/uaccess.h>
@ -91,11 +90,7 @@ static const struct pci_device_id hpsa_pci_device_id[] = {
{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3252},
{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3253},
{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3254},
#define PCI_DEVICE_ID_HP_CISSF 0x333f
{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSF, 0x103C, 0x333F},
{PCI_VENDOR_ID_HP, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0},
{PCI_VENDOR_ID_COMPAQ, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
{PCI_VENDOR_ID_HP, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0},
{0,}
};
@ -114,8 +109,6 @@ static struct board_type products[] = {
{0x3249103C, "Smart Array P812", &SA5_access},
{0x324a103C, "Smart Array P712m", &SA5_access},
{0x324b103C, "Smart Array P711m", &SA5_access},
{0x3233103C, "StorageWorks P1210m", &SA5_access},
{0x333F103C, "StorageWorks P1210m", &SA5_access},
{0x3250103C, "Smart Array", &SA5_access},
{0x3250113C, "Smart Array", &SA5_access},
{0x3250123C, "Smart Array", &SA5_access},
@ -143,8 +136,7 @@ static void fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h,
void *buff, size_t size, u8 page_code, unsigned char *scsi3addr,
int cmd_type);
static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd,
void (*done)(struct scsi_cmnd *));
static int hpsa_scsi_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd);
static void hpsa_scan_start(struct Scsi_Host *);
static int hpsa_scan_finished(struct Scsi_Host *sh,
unsigned long elapsed_time);
@ -1926,7 +1918,7 @@ sglist_finished:
}
static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd,
static int hpsa_scsi_queue_command_lck(struct scsi_cmnd *cmd,
void (*done)(struct scsi_cmnd *))
{
struct ctlr_info *h;
@ -2020,6 +2012,8 @@ static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd,
return 0;
}
static DEF_SCSI_QCMD(hpsa_scsi_queue_command)
static void hpsa_scan_start(struct Scsi_Host *sh)
{
struct ctlr_info *h = shost_to_hba(sh);

View file

@ -751,7 +751,7 @@ static void hptiop_post_req_mv(struct hptiop_hba *hba,
MVIOP_MU_QUEUE_ADDR_HOST_BIT | size_bit, hba);
}
static int hptiop_queuecommand(struct scsi_cmnd *scp,
static int hptiop_queuecommand_lck(struct scsi_cmnd *scp,
void (*done)(struct scsi_cmnd *))
{
struct Scsi_Host *host = scp->device->host;
@ -819,6 +819,8 @@ cmd_done:
return 0;
}
static DEF_SCSI_QCMD(hptiop_queuecommand)
static const char *hptiop_info(struct Scsi_Host *host)
{
return driver_name_long;

View file

@ -39,7 +39,7 @@
#include <scsi/scsi_host.h>
/* Common forward declarations for all Linux-versions: */
static int ibmmca_queuecommand (Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
static int ibmmca_queuecommand (struct Scsi_Host *, struct scsi_cmnd *);
static int ibmmca_abort (Scsi_Cmnd *);
static int ibmmca_host_reset (Scsi_Cmnd *);
static int ibmmca_biosparam (struct scsi_device *, struct block_device *, sector_t, int *);
@ -1691,7 +1691,7 @@ static int __devexit ibmmca_remove(struct device *dev)
}
/* The following routine is the SCSI command queue for the midlevel driver */
static int ibmmca_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
static int ibmmca_queuecommand_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
{
unsigned int ldn;
unsigned int scsi_cmd;
@ -1996,6 +1996,8 @@ static int ibmmca_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
return 0;
}
static DEF_SCSI_QCMD(ibmmca_queuecommand)
static int __ibmmca_abort(Scsi_Cmnd * cmd)
{
/* Abort does not work, as the adapter never generates an interrupt on

View file

@ -1606,7 +1606,7 @@ static inline int ibmvfc_host_chkready(struct ibmvfc_host *vhost)
* Returns:
* 0 on success / other on failure
**/
static int ibmvfc_queuecommand(struct scsi_cmnd *cmnd,
static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd,
void (*done) (struct scsi_cmnd *))
{
struct ibmvfc_host *vhost = shost_priv(cmnd->device->host);
@ -1672,6 +1672,8 @@ static int ibmvfc_queuecommand(struct scsi_cmnd *cmnd,
return 0;
}
static DEF_SCSI_QCMD(ibmvfc_queuecommand)
/**
* ibmvfc_sync_completion - Signal that a synchronous command has completed
* @evt: ibmvfc event struct

View file

@ -713,7 +713,7 @@ static inline u16 lun_from_dev(struct scsi_device *dev)
* @cmd: struct scsi_cmnd to be executed
* @done: Callback function to be called when cmd is completed
*/
static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd,
static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd,
void (*done) (struct scsi_cmnd *))
{
struct srp_cmd *srp_cmd;
@ -766,6 +766,8 @@ static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd,
return ibmvscsi_send_srp_event(evt_struct, hostdata, 0);
}
static DEF_SCSI_QCMD(ibmvscsi_queuecommand)
/* ------------------------------------------------------------
* Routines for driver initialization
*/

View file

@ -926,7 +926,7 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd)
return 0;
}
static int imm_queuecommand(struct scsi_cmnd *cmd,
static int imm_queuecommand_lck(struct scsi_cmnd *cmd,
void (*done)(struct scsi_cmnd *))
{
imm_struct *dev = imm_dev(cmd->device->host);
@ -949,6 +949,8 @@ static int imm_queuecommand(struct scsi_cmnd *cmd,
return 0;
}
static DEF_SCSI_QCMD(imm_queuecommand)
/*
* Apparently the disk->capacity attribute is off by 1 sector
* for all disk drives. We add the one here, but it should really

View file

@ -334,7 +334,7 @@ static uchar calc_sync_xfer(unsigned int period, unsigned int offset)
static void in2000_execute(struct Scsi_Host *instance);
static int in2000_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
static int in2000_queuecommand_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
{
struct Scsi_Host *instance;
struct IN2000_hostdata *hostdata;
@ -431,6 +431,8 @@ static int in2000_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
return 0;
}
static DEF_SCSI_QCMD(in2000_queuecommand)
/*

View file

@ -396,7 +396,7 @@ struct IN2000_hostdata {
flags)
static int in2000_detect(struct scsi_host_template *) in2000__INIT;
static int in2000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
static int in2000_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
static int in2000_abort(Scsi_Cmnd *);
static void in2000_setup(char *, int *) in2000__INIT;
static int in2000_biosparam(struct scsi_device *, struct block_device *,

View file

@ -2639,7 +2639,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c
* will cause the mid layer to call us again later with the command)
*/
static int i91u_queuecommand(struct scsi_cmnd *cmd,
static int i91u_queuecommand_lck(struct scsi_cmnd *cmd,
void (*done)(struct scsi_cmnd *))
{
struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata;
@ -2656,6 +2656,8 @@ static int i91u_queuecommand(struct scsi_cmnd *cmd,
return 0;
}
static DEF_SCSI_QCMD(i91u_queuecommand)
/**
* i91u_bus_reset - reset the SCSI bus
* @cmnd: Command block we want to trigger the reset for

View file

@ -5709,7 +5709,7 @@ static void ipr_scsi_done(struct ipr_cmnd *ipr_cmd)
* SCSI_MLQUEUE_DEVICE_BUSY if device is busy
* SCSI_MLQUEUE_HOST_BUSY if host is busy
**/
static int ipr_queuecommand(struct scsi_cmnd *scsi_cmd,
static int ipr_queuecommand_lck(struct scsi_cmnd *scsi_cmd,
void (*done) (struct scsi_cmnd *))
{
struct ipr_ioa_cfg *ioa_cfg;
@ -5792,6 +5792,8 @@ static int ipr_queuecommand(struct scsi_cmnd *scsi_cmd,
return 0;
}
static DEF_SCSI_QCMD(ipr_queuecommand)
/**
* ipr_ioctl - IOCTL handler
* @sdev: scsi device struct
@ -9025,6 +9027,8 @@ static struct pci_device_id ipr_pci_table[] __devinitdata = {
PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_574D, 0, 0, 0 },
{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CROC_FPGA_E2,
PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_57B2, 0, 0, 0 },
{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CROC_FPGA_E2,
PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_57C4, 0, 0, 0 },
{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CROC_ASIC_E2,
PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_57B4, 0, 0, 0 },
{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CROC_ASIC_E2,

View file

@ -82,6 +82,7 @@
#define IPR_SUBS_DEV_ID_57B4 0x033B
#define IPR_SUBS_DEV_ID_57B2 0x035F
#define IPR_SUBS_DEV_ID_57C4 0x0354
#define IPR_SUBS_DEV_ID_57C6 0x0357
#define IPR_SUBS_DEV_ID_57CC 0x035C

View file

@ -232,7 +232,7 @@ static int ips_detect(struct scsi_host_template *);
static int ips_release(struct Scsi_Host *);
static int ips_eh_abort(struct scsi_cmnd *);
static int ips_eh_reset(struct scsi_cmnd *);
static int ips_queue(struct scsi_cmnd *, void (*)(struct scsi_cmnd *));
static int ips_queue(struct Scsi_Host *, struct scsi_cmnd *);
static const char *ips_info(struct Scsi_Host *);
static irqreturn_t do_ipsintr(int, void *);
static int ips_hainit(ips_ha_t *);
@ -1046,7 +1046,7 @@ static int ips_eh_reset(struct scsi_cmnd *SC)
/* Linux obtains io_request_lock before calling this function */
/* */
/****************************************************************************/
static int ips_queue(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *))
static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *))
{
ips_ha_t *ha;
ips_passthru_t *pt;
@ -1137,6 +1137,8 @@ static int ips_queue(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *))
return (0);
}
static DEF_SCSI_QCMD(ips_queue)
/****************************************************************************/
/* */
/* Routine Name: ips_biosparam */

View file

@ -684,10 +684,9 @@ void fc_disc_stop(struct fc_lport *lport)
{
struct fc_disc *disc = &lport->disc;
if (disc) {
if (disc->pending)
cancel_delayed_work_sync(&disc->disc_work);
fc_disc_stop_rports(disc);
}
fc_disc_stop_rports(disc);
}
/**

View file

@ -58,8 +58,7 @@ struct kmem_cache *scsi_pkt_cachep;
#define FC_SRB_WRITE (1 << 0)
/*
* The SCp.ptr should be tested and set under the host lock. NULL indicates
* that the command has been retruned to the scsi layer.
* The SCp.ptr should be tested and set under the scsi_pkt_queue lock
*/
#define CMD_SP(Cmnd) ((struct fc_fcp_pkt *)(Cmnd)->SCp.ptr)
#define CMD_ENTRY_STATUS(Cmnd) ((Cmnd)->SCp.have_data_in)
@ -1754,7 +1753,7 @@ static inline int fc_fcp_lport_queue_ready(struct fc_lport *lport)
* This is the i/o strategy routine, called by the SCSI layer. This routine
* is called with the host_lock held.
*/
int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *))
static int fc_queuecommand_lck(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *))
{
struct fc_lport *lport;
struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
@ -1852,6 +1851,8 @@ out:
spin_lock_irq(lport->host->host_lock);
return rc;
}
DEF_SCSI_QCMD(fc_queuecommand)
EXPORT_SYMBOL(fc_queuecommand);
/**
@ -1880,8 +1881,6 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
lport = fsp->lp;
si = fc_get_scsi_internal(lport);
if (!fsp->cmd)
return;
/*
* if can_queue ramp down is done then try can_queue ramp up
@ -1891,11 +1890,6 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
fc_fcp_can_queue_ramp_up(lport);
sc_cmd = fsp->cmd;
fsp->cmd = NULL;
if (!sc_cmd->SCp.ptr)
return;
CMD_SCSI_STATUS(sc_cmd) = fsp->cdb_status;
switch (fsp->status_code) {
case FC_COMPLETE:
@ -1971,15 +1965,13 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
break;
}
if (lport->state != LPORT_ST_READY && fsp->status_code != FC_COMPLETE) {
sc_cmd->result = (DID_REQUEUE << 16);
FC_FCP_DBG(fsp, "Returning DID_REQUEUE to scsi-ml\n");
}
if (lport->state != LPORT_ST_READY && fsp->status_code != FC_COMPLETE)
sc_cmd->result = (DID_TRANSPORT_DISRUPTED << 16);
spin_lock_irqsave(&si->scsi_queue_lock, flags);
list_del(&fsp->list);
spin_unlock_irqrestore(&si->scsi_queue_lock, flags);
sc_cmd->SCp.ptr = NULL;
spin_unlock_irqrestore(&si->scsi_queue_lock, flags);
sc_cmd->scsi_done(sc_cmd);
/* release ref from initial allocation in queue command */
@ -1997,6 +1989,7 @@ int fc_eh_abort(struct scsi_cmnd *sc_cmd)
{
struct fc_fcp_pkt *fsp;
struct fc_lport *lport;
struct fc_fcp_internal *si;
int rc = FAILED;
unsigned long flags;
@ -2006,7 +1999,8 @@ int fc_eh_abort(struct scsi_cmnd *sc_cmd)
else if (!lport->link_up)
return rc;
spin_lock_irqsave(lport->host->host_lock, flags);
si = fc_get_scsi_internal(lport);
spin_lock_irqsave(&si->scsi_queue_lock, flags);
fsp = CMD_SP(sc_cmd);
if (!fsp) {
/* command completed while scsi eh was setting up */
@ -2015,7 +2009,7 @@ int fc_eh_abort(struct scsi_cmnd *sc_cmd)
}
/* grab a ref so the fsp and sc_cmd cannot be relased from under us */
fc_fcp_pkt_hold(fsp);
spin_unlock_irqrestore(lport->host->host_lock, flags);
spin_unlock_irqrestore(&si->scsi_queue_lock, flags);
if (fc_fcp_lock_pkt(fsp)) {
/* completed while we were waiting for timer to be deleted */

View file

@ -1447,13 +1447,7 @@ void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
}
did = fc_frame_did(fp);
if (!did) {
FC_LPORT_DBG(lport, "Bad FLOGI response\n");
goto out;
}
if (fc_frame_payload_op(fp) == ELS_LS_ACC) {
if (fc_frame_payload_op(fp) == ELS_LS_ACC && did) {
flp = fc_frame_payload_get(fp, sizeof(*flp));
if (flp) {
mfs = ntohs(flp->fl_csp.sp_bb_data) &
@ -1492,8 +1486,10 @@ void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
fc_lport_enter_dns(lport);
}
}
} else
} else {
FC_LPORT_DBG(lport, "FLOGI RJT or bad response\n");
fc_lport_error(lport, fp);
}
out:
fc_frame_free(fp);

View file

@ -196,9 +196,9 @@ static const char *fc_rport_state(struct fc_rport_priv *rdata)
void fc_set_rport_loss_tmo(struct fc_rport *rport, u32 timeout)
{
if (timeout)
rport->dev_loss_tmo = timeout + 5;
rport->dev_loss_tmo = timeout;
else
rport->dev_loss_tmo = 30;
rport->dev_loss_tmo = 1;
}
EXPORT_SYMBOL(fc_set_rport_loss_tmo);

View file

@ -1599,7 +1599,7 @@ enum {
FAILURE_SESSION_NOT_READY,
};
int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
static int iscsi_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
{
struct iscsi_cls_session *cls_session;
struct Scsi_Host *host;
@ -1736,6 +1736,8 @@ fault:
spin_lock(host->host_lock);
return 0;
}
DEF_SCSI_QCMD(iscsi_queuecommand)
EXPORT_SYMBOL_GPL(iscsi_queuecommand);
int iscsi_change_queue_depth(struct scsi_device *sdev, int depth, int reason)

View file

@ -189,7 +189,7 @@ int sas_queue_up(struct sas_task *task)
* Note: XXX: Remove the host unlock/lock pair when SCSI Core can
* call us without holding an IRQ spinlock...
*/
int sas_queuecommand(struct scsi_cmnd *cmd,
static int sas_queuecommand_lck(struct scsi_cmnd *cmd,
void (*scsi_done)(struct scsi_cmnd *))
__releases(host->host_lock)
__acquires(dev->sata_dev.ap->lock)
@ -254,6 +254,8 @@ out:
return res;
}
DEF_SCSI_QCMD(sas_queuecommand)
static void sas_eh_finish_cmd(struct scsi_cmnd *cmd)
{
struct sas_task *task = TO_SAS_TASK(cmd);

View file

@ -202,9 +202,12 @@ struct lpfc_stats {
uint32_t elsRcvPRLO;
uint32_t elsRcvPRLI;
uint32_t elsRcvLIRR;
uint32_t elsRcvRLS;
uint32_t elsRcvRPS;
uint32_t elsRcvRPL;
uint32_t elsRcvRRQ;
uint32_t elsRcvRTV;
uint32_t elsRcvECHO;
uint32_t elsXmitFLOGI;
uint32_t elsXmitFDISC;
uint32_t elsXmitPLOGI;
@ -549,9 +552,11 @@ struct lpfc_hba {
#define ELS_XRI_ABORT_EVENT 0x40
#define ASYNC_EVENT 0x80
#define LINK_DISABLED 0x100 /* Link disabled by user */
#define FCF_DISC_INPROGRESS 0x200 /* FCF discovery in progress */
#define HBA_FIP_SUPPORT 0x400 /* FIP support in HBA */
#define HBA_AER_ENABLED 0x800 /* AER enabled with HBA */
#define FCF_TS_INPROG 0x200 /* FCF table scan in progress */
#define FCF_RR_INPROG 0x400 /* FCF roundrobin flogi in progress */
#define HBA_FIP_SUPPORT 0x800 /* FIP support in HBA */
#define HBA_AER_ENABLED 0x1000 /* AER enabled with HBA */
#define HBA_DEVLOSS_TMO 0x2000 /* HBA in devloss timeout */
uint32_t fcp_ring_in_use; /* When polling test if intr-hndlr active*/
struct lpfc_dmabuf slim2p;
@ -573,6 +578,7 @@ struct lpfc_hba {
/* These fields used to be binfo */
uint32_t fc_pref_DID; /* preferred D_ID */
uint8_t fc_pref_ALPA; /* preferred AL_PA */
uint32_t fc_edtovResol; /* E_D_TOV timer resolution */
uint32_t fc_edtov; /* E_D_TOV timer value */
uint32_t fc_arbtov; /* ARB_TOV timer value */
uint32_t fc_ratov; /* R_A_TOV timer value */

View file

@ -3789,8 +3789,13 @@ sysfs_mbox_read(struct file *filp, struct kobject *kobj,
break;
case MBX_SECURITY_MGMT:
case MBX_AUTH_PORT:
if (phba->pci_dev_grp == LPFC_PCI_DEV_OC)
if (phba->pci_dev_grp == LPFC_PCI_DEV_OC) {
printk(KERN_WARNING "mbox_read:Command 0x%x "
"is not permitted\n", pmb->mbxCommand);
sysfs_mbox_idle(phba);
spin_unlock_irq(&phba->hbalock);
return -EPERM;
}
break;
case MBX_READ_SPARM64:
case MBX_READ_LA:

View file

@ -3142,12 +3142,12 @@ lpfc_bsg_menlo_cmd_cmp(struct lpfc_hba *phba,
job = menlo->set_job;
job->dd_data = NULL; /* so timeout handler does not reply */
spin_lock_irqsave(&phba->hbalock, flags);
spin_lock(&phba->hbalock);
cmdiocbq->iocb_flag |= LPFC_IO_WAKE;
if (cmdiocbq->context2 && rspiocbq)
memcpy(&((struct lpfc_iocbq *)cmdiocbq->context2)->iocb,
&rspiocbq->iocb, sizeof(IOCB_t));
spin_unlock_irqrestore(&phba->hbalock, flags);
spin_unlock(&phba->hbalock);
bmp = menlo->bmp;
rspiocbq = menlo->rspiocbq;

View file

@ -44,6 +44,8 @@ int lpfc_reg_rpi(struct lpfc_hba *, uint16_t, uint32_t, uint8_t *,
void lpfc_set_var(struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t, uint32_t);
void lpfc_unreg_login(struct lpfc_hba *, uint16_t, uint32_t, LPFC_MBOXQ_t *);
void lpfc_unreg_did(struct lpfc_hba *, uint16_t, uint32_t, LPFC_MBOXQ_t *);
void lpfc_sli4_unreg_all_rpis(struct lpfc_vport *);
void lpfc_reg_vpi(struct lpfc_vport *, LPFC_MBOXQ_t *);
void lpfc_register_new_vport(struct lpfc_hba *, struct lpfc_vport *,
struct lpfc_nodelist *);
@ -229,6 +231,7 @@ void lpfc_sli4_fcf_dead_failthrough(struct lpfc_hba *);
uint16_t lpfc_sli4_fcf_rr_next_index_get(struct lpfc_hba *);
int lpfc_sli4_fcf_rr_index_set(struct lpfc_hba *, uint16_t);
void lpfc_sli4_fcf_rr_index_clear(struct lpfc_hba *, uint16_t);
int lpfc_sli4_fcf_rr_next_proc(struct lpfc_vport *, uint16_t);
int lpfc_mem_alloc(struct lpfc_hba *, int align);
void lpfc_mem_free(struct lpfc_hba *);
@ -271,6 +274,7 @@ int lpfc_sli_issue_iocb(struct lpfc_hba *, uint32_t,
void lpfc_sli_pcimem_bcopy(void *, void *, uint32_t);
void lpfc_sli_bemem_bcopy(void *, void *, uint32_t);
void lpfc_sli_abort_iocb_ring(struct lpfc_hba *, struct lpfc_sli_ring *);
void lpfc_sli_hba_iocb_abort(struct lpfc_hba *);
void lpfc_sli_flush_fcp_rings(struct lpfc_hba *);
int lpfc_sli_ringpostbuf_put(struct lpfc_hba *, struct lpfc_sli_ring *,
struct lpfc_dmabuf *);

Some files were not shown because too many files have changed in this diff Show more