History log of /linux-master/drivers/scsi/bfa/bfa_fcs.h
Revision Date Author Comments
# 37126399 22-Feb-2024 Arnd Bergmann <arnd@arndb.de>

scsi: bfa: Fix function pointer type mismatch for state machines

The bfa driver is full of state machines and a generic abstraction layer
for them. This relies on casting function pointers, but that is no longer
allowed when CONFIG_CFI_CLANG is enabled and causes a huge number of
warnings like:

drivers/scsi/bfa/bfad.c:169:3: error: cast from 'void (*)(struct bfad_s *, enum bfad_sm_event)' to 'bfa_sm_t' (aka 'void (*)(void *, int)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
bfa_sm_set_state(bfad, bfad_sm_created);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Rework the mechanism to no longer require the function pointer casts, by
having separate types for each individual state machine. This in turn
requires moving the enum definitions for each state machine into the header
files in order to define the typedef.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240222124433.2046570-2-arnd@kernel.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# c121b588 17-Feb-2024 Simone Weiß <simone.p.weiss@posteo.com>

scsi: bfa: Remove additional unnecessary struct declarations

Commit c3b0d087763f ("scsi: bfa: Remove unnecessary struct declarations")
removed duplicate struct declarations for struct bfa_fcs_s and struct
bfa_fcs_fabric_s.

However, there are further duplications:

- struct bfad_vf_s is declared in line 165 remove the duplication in line
834.

- struct bfad_rport_s is declared in line 394 remove the duplication in
line 836.

Remove them.

Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com>
Link: https://lore.kernel.org/r/20240217191409.6260-1-simone.p.weiss@posteo.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# c3b0d087 01-Apr-2021 Wan Jiabing <wanjiabing@vivo.com>

scsi: bfa: Remove unnecessary struct declarations

struct bfa_fcs_s is declared twice. First is declared at line 50, remove
the duplicate.

struct bfa_fcs_fabric_s is defined at line 175, remove unnecessary
declaration.

Link: https://lore.kernel.org/r/20210401063535.992487-1-wanjiabing@vivo.com
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 52fa7bf9 29-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 292

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license gpl version 2
as published by the free software foundation this program is
distributed in the hope that it will be useful but without any
warranty without even the implied warranty of merchantability or
fitness for a particular purpose see the gnu general public license
for more details

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 66 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141901.606369721@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 984dc46c 08-Jan-2017 Christoph Hellwig <hch@lst.de>

scsi: bfa: remove bfa_fcs_mod_s

Just call the functions directly instead of obsfucating the call chain.
This was in reply to a patch from Kees Cook to constify the function
pointer struct bfa_fcs_mod_s, but it turns out there is no reason to
have this indirection at all.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 4e51af9e 13-Apr-2016 Dan Carpenter <dan.carpenter@oracle.com>

bfa: fix bfa_fcb_itnim_alloc() error handling

The caller assumes that "itnim" is NULL on error and non-NULL on success
but really "itnim" is uninitialized on error. This function should just
use normal error handling where it returns zero on success and negative
on failure.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 31e1d569 26-Nov-2015 Anil Gurumurthy <anil.gurumurthy@qlogic.com>

bfa: File header and user visible string changes

Signed-off-by: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 889d0d42 26-Nov-2015 Anil Gurumurthy <anil.gurumurthy@qlogic.com>

bfa: Update copyright messages

Signed-off-by: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 22a08538 21-Nov-2013 Vijaya Mohan Guvva <vmohan@brocade.com>

[SCSI] bfa: Fix crash when symb name set for offline vport

This patch fixes a crash when tried setting symbolic name for an offline
vport through sysfs. Crash is due to uninitialized pointer lport->ns,
which gets initialized only on linkup (port online).

Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 079bcbc3 13-May-2013 Vijaya Mohan Guvva <vmohan@brocade.com>

[SCSI] bfa: fru vpd date update changes

1. While FRU VPD data update, inform firmware to send a completion event
on I2C bus. Without this change, firmware used to send completion
message on I2C bus for every chunk of FRU VPD update.
2. Support for FRU VPN update on CHINOOK2 cards.
3. Append port count to the model name to differentiate between single
port and dual port model of 1860.
4. Update the size of the model name to 16bytes

Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# d7cbc304 13-May-2013 Vijaya Mohan Guvva <vmohan@brocade.com>

[SCSI] bfa: FDMI enhancements

Update addl. fields in FDMI to confirm to FC-GS6 standard for RPA and
RHBA commands.

Signed-off-by: Anil Gurumurthy <agurumur@brocade.com>
Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# bbe37a67 13-May-2013 Vijaya Mohan Guvva <vmohan@brocade.com>

[SCSI] bfa: Support for FC BB credit recovery

This patch includes changes to 1) Enable/disable fc credit recovery on
Brocade FC adapter port operating at max supported speed. 2) Get credit
recovery status and stats related to credit loss and recovered credits

Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# b480a32e 21-Sep-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Fix few attributes in the RHBA CT passthru command

- Made changes to set the RHBA command max payload based on
the port configured frame size.
- Made changes to fix the driver/fw version size in FMDI structure.
- Fix to pass the fw version for FDMI attribute type
FDMI_HBA_ATTRIB_FW_VERSION rather than driver version.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# bc0e2c2a 21-Sep-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Add support for FC Arbitrated Loop topology.

- Add private loop topology support at 2G/4G/8G speeds with following
limitations
1. No support for multiple initiators in the loop
2. No public loop support. If attached to a loop with an FL_Port,
device continues to work as a private NL_Port in the loop
3. No auto topology detection. User has to manually set the
configured topology to loop if attaching to loop.
- When loop topology is configured, enabling FC port features
QoS/Trunk/TRL are not allowed and vice versa.

Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 61ba4394 22-Aug-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Add support for max target ports discovery

- Changes to avoid discovering NPIV port as remote port by the other
NPIV ports created on same physical port when all the NPIV ports are
part of the same zone in a fabric.
- Provided mechanism to support maximum number of target ports for a
given initiator port (physical port + NPIV ports) irrespective of the
way in which the initiator and target ports are zoned in the fabric.
- Introduced module_parameter max_rport_logins to restrict number of
remote ports discovery which includes target and initiator remote ports.

Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# ce7242b8 22-Aug-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Add support to register node symbolic name with name server

- Changes to register node symbolic name with name server on the fabric
by sending CT commands RNN_ID and RSNN_NN.

Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 881c1b3c 22-Aug-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Add PowerPC support and enable PCIE AER handling.

- Added few missing endian swap changes to support BFA on PowerPC.
- Added PCIE AER support to BFA:
a) Implemented the PCI error handler entry points.
b) Made changes to FCS state machine to handle STOP event from the
PCI error detected entry point.
c) Made changes to the IO Controller state machine to handle SUSPEND
event from the PCI error detected entry point.
d) Made changes to restart the BFA operations on a slot_reset completion.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# c3f1b123 22-Aug-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Make changes to FCXP resource management.

- Made changes to split FCXP resources as request and response resources.
- The split will reduce the contention for FCXP resources in an open zone
config.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# ee1a4a42 22-Aug-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: FCS remote port enhancements.

- Introduced rport qualifier structure and modified design to
export remote ports with valid pid or valid pwwn to the user space.
- Introduced old_pid field in the rport structure and made changes to
prevent re-creating a new remote port for an already existing rport
that is transitioning to a delete state. (Happens if we receive a RSCN
on the existing remote port that is getting deleted).

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# ebfe8392 22-Aug-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Support vport symbolic name change from sysfs.

- Implemented the FC function template set_vport_symbolic_name entry
point to modify the vport symbolic name from sysfs.
- Implemented support to send RSPN_ID to switch to register the
modified vport symbolic name.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 17c201b3 09-Apr-2012 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Fix to defer vport delete handler invocation till firmware logo response.

Made changes to avoid queuing the vport delete work to IM driver
work queue in the bfa_fcb_lport_delete() - since at this stage we
are not completely done with using the vport structure as we are
still waiting for the LOGO response from the fw in online state or
just doing some cleanup. Since queuing up the vport delete work at
this stage will result in the FC transport layer to clean up the vport
before we get the response from firmware.
Made changes to queue the port delete work to the IM driver work queue -
from the bfa_fcs_vport_free() function since at this state we are done
with using the vport data structure and the FCS state machine is completely
cleaned up.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 7826f304 20-Jul-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Add FC-transport based Asynchronous Event Notification support.

- Added support to post vendor unique events on fc_host.
- Supports adapter, port, ioc, flash and remote port based AEN events.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 60138066 24-Jun-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Extend BSG interface.

- Added support to collect driver/fw stats.
- Added support to perform adapter/ioc enable, disable operations.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# d7be54cc 24-Jun-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: FCS bug fixes.

- Added logic to initiate a PLOGI to the target, while processing a LOGO
from the same target in Direct attach mode.
- Added logic to generate a FCCT Reject indicating unsupported command,
upon receiving FCCT/FCGS requests.
- Added logic to set the fcpim in offline state and avoid any PRLI retries
if a PRLI response is a reject with a reason Command Not Supported.
- Updated the FDMI Supported/Current speeds.
- Added logic to wait for the response from the firmware before sending
ACC to PLOGI and transitioning to subsequent states - while processing an
Incoming PLOGI in online state.
- Added a wait state in the fcs_vport state machine - For case where
FDISC is in progress and we get a vport delete request we wait for
fdisc response and will transition to the appropriate state based on
rsp status, else its causing both driver/fw resources to be not
freed.
- Remove the fc_credit_recovery module param.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# b85daafe 13-Jun-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Add BSG interface to support ELS, CT and vendor commands.

- Added BSG interface support to BFA driver
- Adds support to send ELS/CT FC passthru commands and
few vendor specific BSG requests.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 75332a70 13-Jun-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Driver initialization and model description fix

- Moved FCS initialization, which internally does the im_port creation
as well as the scsi_host creation before bfa_init.

Once the bfa_init is complete & successful:
- Reset the FCS base port cfg params such as pwwn/nwwn and setup fc host
params - based on the values learned during the ioc getattr request.
- Change needed to support BSG commands even on bfa init failure.
- Model description fixes for Brocade adapters.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# be540a99 13-Jun-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: FC credit recovery and misc bug fixes.

- Introduce FC credit recovery.
- Added module parameter to enable/disable credit recovery.

Bug Fixes:
- Removed check for ignoring plogi from initiator in switched fabric mode.
- The ABTS for PLOGI is going out few millisecs earlier due to FW
timer calibration (around 300 miilisecs earlier). So there is a
window if an accept comes during this time HBA would have initiated
an ABORT.
- Added 1 to FC_ELS_TOV for compensating for FW timer.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# dd5aaf45 13-Jun-2011 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: Changes to support vport disable and enable operations.

Made changes to FCS lport, vport state machines to support vport
enable / disable operations.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 25985edc 30-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi>

Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>


# b704495c 13-Dec-2010 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: direct attach mode fix.

- Direct attach is not working due to the check of PID in fcxp_send request.
- Added logic to set the lps->lp_pid with the PID assigned for n2n mode.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# f16a1750 09-Dec-2010 Maggie Zhang <xmzhang@brocade.com>

[SCSI] bfa: remove all OS wrappers

Remove OS wrapper functions/macros, and as a result remove bfa_os_inc.h.

Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# f7f73812 09-Dec-2010 Maggie Zhang <xmzhang@brocade.com>

[SCSI] bfa: clean up one line functions

Cleaned up one line functions.

Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# df0f1933 09-Dec-2010 Maggie Zhang <xmzhang@brocade.com>

[SCSI] bfa: remove unused and empty functions

Removed unused and empty functions.

Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <xmzhang@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 50444a34 29-Nov-2010 Maggie <xmzhang@brocade.com>

[SCSI] bfa: fix endianess sparse check warnings

First round of fix for the endianess check warnings from make C=2 CF="-D__CHECK_ENDIAN__".

Signed-off-by: Maggie <xmzhang@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# acdc79a6 18-Oct-2010 Jing Huang <huangj@brocade.com>

[SCSI] bfa: fix comments for header files

This patch addresses the comments from Randy Dunlap (Randy.Dunlap@oracle.com)
regarding comment blocks that begining with "/**". bfa driver comments
currently do not follow kernel-doc convention, we hence replace all
/** with /* and **/ with */.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 6a18b167 18-Oct-2010 Jing Huang <huangj@brocade.com>

[SCSI] bfa: remove os wrapper and unused functions

This patch removes os wrapper and unused functions.
bfa_os_assign(), bfa_os_memset(), bfa_os_memcpy(), bfa_os_udelay()
bfa_os_vsprintf(), bfa_os_snprintf(), and bfa_os_get_clock() are replaced with
direct assignment or native linux functions. Some unused functions related to VF
(Vitual fabric) are also removed.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# a36c61f9 15-Sep-2010 Krishna Gudipati <kgudipat@brocade.com>

[SCSI] bfa: cleanup driver

We have flattened the BFA hierarchy and also reduced the number of
source and header files we used to have earlier.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>