IB/core: Allow device-specific per-port sysfs files
authorRalph Campbell <ralph.campbell@qlogic.com>
Fri, 7 May 2010 00:03:25 +0000 (17:03 -0700)
committerRoland Dreier <rolandd@cisco.com>
Fri, 21 May 2010 17:34:44 +0000 (10:34 -0700)
commit9a6edb60ec10d86b1025a0cdad68fd89f1ddaf02
tree8727118d511e8336f038e618cfc6d4aa6b73aaaf
parenta0fe3cc5d36a5f5b4f60abfe1a4b1caf4a5cce5a
IB/core: Allow device-specific per-port sysfs files

Add a new parameter to ib_register_device() so that low-level device
drivers can pass in a pointer to a callback function that will be
called for each port that is registered in sysfs.  This allows
low-level device drivers to create files in

    /sys/class/infiniband/<hca>/ports/<N>/

without having to poke through the internals of the RDMA sysfs handling.

There is no need for an unregister function since the kobject
reference will go to zero when ib_unregister_device() is called.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 files changed:
drivers/infiniband/core/core_priv.h
drivers/infiniband/core/device.c
drivers/infiniband/core/sysfs.c
drivers/infiniband/hw/amso1100/c2_provider.c
drivers/infiniband/hw/cxgb3/iwch_provider.c
drivers/infiniband/hw/cxgb4/provider.c
drivers/infiniband/hw/ehca/ehca_main.c
drivers/infiniband/hw/ipath/ipath_verbs.c
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/hw/mthca/mthca_provider.c
drivers/infiniband/hw/nes/nes_verbs.c
include/rdma/ib_verbs.h