summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe/fcoe_sysfs.c
AgeCommit message (Collapse)Author
2017-08-25scsi: make device_type constBhumika Goyal
Make these const as they are only stored in the type field of a device structure, which is const. Done using Coccinelle. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-11-08scsi: fcoe: catch invalid values for the 'enabled' attributeHannes Reinecke
The 'enabled' sysfs attribute only accepts the values '0' and '1', so we should error out any other values. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Johannes Thumshirn <jth@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-11-08scsi: fcoe: make R_A_TOV and E_D_TOV configurableHannes Reinecke
The user might want to modify the values for R_A_TOV and E_D_TOV, so add new module parameters 'e_d_tov' and 'r_a_tov' for the 'fcoe' modules and allow to modify them via sysfs attributes. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Johannes Thumshirn <jth@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-07-20fcoe: implement FIP VLAN responderHannes Reinecke
When running in VN2VN mode there is no central instance which would send out any FIP VLAN discovery notifications. So this patch adds a new sysfs attribute 'fip_vlan_responder' which will activate a FIP VLAN discovery responder. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Johannes Thumshirn <jth@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2013-11-14Merge tag 'scsi-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull first round of SCSI updates from James Bottomley: "This patch set is driver updates for qla4xxx, scsi_debug, pm80xx, fcoe/libfc, eas2r, lpfc, be2iscsi and megaraid_sas plus some assorted bug fixes and cleanups" * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (106 commits) [SCSI] scsi_error: Escalate to LUN reset if abort fails [SCSI] Add 'eh_deadline' to limit SCSI EH runtime [SCSI] remove check for 'resetting' [SCSI] dc395: Move 'last_reset' into internal host structure [SCSI] tmscsim: Move 'last_reset' into host structure [SCSI] advansys: Remove 'last_reset' references [SCSI] dpt_i2o: return SCSI_MLQUEUE_HOST_BUSY when in reset [SCSI] dpt_i2o: Remove DPTI_STATE_IOCTL [SCSI] megaraid_sas: Fix synchronization problem between sysPD IO path and AEN path [SCSI] lpfc: Fix typo on NULL assignment [SCSI] scsi_dh_alua: ALUA handler attach should succeed while TPG is transitioning [SCSI] scsi_dh_alua: ALUA check sense should retry device internal reset unit attention [SCSI] esas2r: Cleanup snprinf formatting of firmware version [SCSI] esas2r: Remove superfluous mask of pcie_cap_reg [SCSI] esas2r: Fixes for big-endian platforms [SCSI] esas2r: Directly call kernel functions for atomic bit operations [SCSI] lpfc 8.3.43: Update lpfc version to driver version 8.3.43 [SCSI] lpfc 8.3.43: Fixed not processing task management IOCB response status [SCSI] lpfc 8.3.43: Fixed spinlock hang. [SCSI] lpfc 8.3.43: Fixed invalid Total_Data_Placed value received for els and ct command responses ...
2013-10-14scsi: Convert uses of compare_ether_addr to ether_addr_equalJoe Perches
Preliminary to removing compare_ether_addr altogether: Use the new bool function ether_addr_equal to add some clarity and reduce the likelihood for misuse of compare_ether_addr for sorting. Done via cocci script: $ cat compare_ether_addr.cocci @@ expression a,b; @@ - !compare_ether_addr(a, b) + ether_addr_equal(a, b) @@ expression a,b; @@ - compare_ether_addr(a, b) + !ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) == 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) != 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) == 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) != 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !!ether_addr_equal(a, b) + ether_addr_equal(a, b) Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Robert Love <robert.w.love@intel.com>
2013-09-26scsi: fcoe: fix build errorGreg Kroah-Hartman
I had a typo in a variable name for the previous patch (SCSI: fcoe: convert bus code to use bus_group) that broke the build, this fixes that. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26SCSI: fcoe: convert bus code to use bus_groupsGreg Kroah-Hartman
The bus_attrs field of struct bus_type is going away soon, dev_groups should be used instead. This converts the fcoe bus code to use the correct field. Cc: Robert Love <robert.w.love@intel.com> Cc: "James E.J. Bottomley" <JBottomley@parallels.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-04fcoe: Add missing newlines in debug messagesBart Van Assche
FCoE debug statements must end in a newline. Add one where it is missing. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Cc: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Robert Love <robert.w.love@intel.com>
2013-07-09fcoe: Reduce number of sparse warningsBart Van Assche
Declare local variables and functions 'static'. This patch does not change any functionality. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Robert Love <robert.w.love@intel.com>
2012-12-14libfcoe, fcoe, bnx2fc: Add new fcoe control interfaceRobert Love
This patch does a few things. 1) Makes /sys/bus/fcoe/ctlr_{create,destroy} interfaces. These interfaces take an <ifname> and will either create an FCoE Controller or destroy an FCoE Controller depending on which file is written to. The new FCoE Controller will start in a DISABLED state and will not do discovery or login until it is ENABLED. This pause will allow us to configure the FCoE Controller before enabling it. 2) Makes the 'mode' attribute of a fcoe_ctlr_device writale. This allows the user to configure the mode in which the FCoE Controller will start in when it is ENABLED. Possible modes are 'Fabric', or 'VN2VN'. The default mode for a fcoe_ctlr{,_device} is 'Fabric'. Drivers must implement the set_fcoe_ctlr_mode routine to support this feature. libfcoe offers an exported routine to set a FCoE Controller's mode. The mode can only be changed when the FCoE Controller is DISABLED. This patch also removes the get_fcoe_ctlr_mode pointer in the fcoe_sysfs function template, the code in fcoe_ctlr.c to get the mode and the assignment of the fcoe_sysfs function pointer to the fcoe_ctlr.c implementation (in fcoe and bnx2fc). fcoe_sysfs can return that value for the mode without consulting the LLD. 3) Make a 'enabled' attribute of a fcoe_ctlr_device. On a read, fcoe_sysfs will return the attribute's value. On a write, fcoe_sysfs will call the LLD (if there is a callback) to notifiy that the enalbed state has changed. This patch maintains the old FCoE control interfaces as module parameters, but it adds comments pointing out that the old interfaces are deprecated. Signed-off-by: Robert Love <robert.w.love@intel.com> Acked-by: Neil Horman <nhorman@tuxdriver.com>
2012-12-14libfcoe: Add fcoe_sysfs debug logging levelRobert Love
Add a macro to print fcoe_sysfs debug statements. Signed-off-by: Robert Love <robert.w.love@intel.com> Acked-by: Neil Horman <nhorman@tuxdriver.com>
2012-12-04libfcoe: Save some memory and optimize name lookupsRobert Love
Instead of creating a structure with an enum and a pointer to a string, simply allocate an array of strings and use the enum values for the indicies. This means that we do not need to iterate through the list of entries when looking up a string name by its enum key. This will also help with a latter patch that will add more fcoe_sysfs attributes that will also use the fcoe_enum_name_search macro. One attribute will also do a reverse lookup which requires less code when the enum-to-string mappings are organized as this patch makes them to be. Signed-off-by: Robert Love <robert.w.love@intel.com> Acked-by: Neil Horman <nhorman@tuxdriver.com>
2012-07-20[SCSI] fcoe: Remove redundant 'less than zero' checkRobert Love
strtoul returns an 'unsigned long' so there is no reason to check if the value is less than zero. strtoul already checks for the '-' character deep in its bowels. It will return an error if the user has provided a negative value and fcoe_str_to_dev_loss will return that error to its caller. This patch fixes the following Coverity reported warning: CID 703581 - NO_EFFECT Unsigned compared against 0 - This less-than-zero comparison of an unsigned value is never true. "*val < 0UL". drivers/scsi/fcoe/fcoe_sysfs.c:105 Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-23[SCSI] libfcoe: Add fcoe_sysfsRobert Love
This patch adds a 'fcoe bus' infrastructure to the kernel that is driven by changes to libfcoe which allow LLDs to present FIP (FCoE Initialization Protocol) discovered entities and their attributes to user space via sysfs. This patch adds the following APIs- fcoe_ctlr_device_add fcoe_ctlr_device_delete fcoe_fcf_device_add fcoe_fcf_device_delete They allow the LLD to expose the FCoE ENode Controller and any discovered FCFs (Fibre Channel Forwarders, e.g. FCoE switches) to the user. Each of these new devices has their own bus_type so that they are grouped together for easy lookup from a user space application. Each new class has an attribute_group to expose attributes for any created instances. The attributes are- fcoe_ctlr_device * fcf_dev_loss_tmo * lesb_link_fail * lesb_vlink_fail * lesb_miss_fka * lesb_symb_err * lesb_err_block * lesb_fcs_error fcoe_fcf_device * fabric_name * switch_name * priority * selected * fc_map * vfid * mac * fka_peroid * fabric_state * dev_loss_tmo A device loss infrastructre similar to the FC Transport's is also added by this patch. It is nice to have so that a link flapping adapter doesn't continually advance the count used to identify the discovered FCF. FCFs will exist in a "Disconnected" state until either the timer expires or the FCF is rediscovered and becomes "Connected." This patch generates a few checkpatch.pl WARNINGS that I'm not sure what to do about. They're macros modeled around the FC Transport attribute building macros, which have the same 'feature' where the caller can ommit a cast in the argument list and no cast occurs in the code. I'm not sure how to keep the code condensed while keeping the macros. Any advice would be appreciated. Signed-off-by: Robert Love <robert.w.love@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: James Bottomley <JBottomley@Parallels.com>