aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe/fcoe_sysfs.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-07-20[SCSI] fcoe: Remove redundant 'less than zero' checkRobert Love1-1/+1
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 Love1-0/+832
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>