aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/nes
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-21 18:49:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-21 18:49:58 -0400
commite80ab411e589e00550e2e6e5a6a02d59cc730357 (patch)
tree870225ff7b5b8d03e82a996963213a4bb9cce248 /drivers/infiniband/hw/nes
parent529a41e36673b518c9e091f3a8d932b6b9e3c461 (diff)
parentee959b00c335d7780136c5abda37809191fe52c3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (36 commits) SCSI: convert struct class_device to struct device DRM: remove unused dev_class IB: rename "dev" to "srp_dev" in srp_host structure IB: convert struct class_device to struct device memstick: convert struct class_device to struct device driver core: replace remaining __FUNCTION__ occurrences sysfs: refill attribute buffer when reading from offset 0 PM: Remove destroy_suspended_device() Firmware: add iSCSI iBFT Support PM: Remove legacy PM (fix) Kobject: Replace list_for_each() with list_for_each_entry(). SYSFS: Explicitly include required header file slab.h. Driver core: make device_is_registered() work for class devices PM: Convert wakeup flag accessors to inline functions PM: Make wakeup flags available whenever CONFIG_PM is set PM: Fix misuse of wakeup flag accessors in serial core Driver core: Call device_pm_add() after bus_add_device() in device_add() PM: Handle device registrations during suspend/resume block: send disk "change" event for rescan_partitions() sysdev: detect multiple driver registrations ... Fixed trivial conflict in include/linux/memory.h due to semaphore header file change (made irrelevant by the change to mutex).
Diffstat (limited to 'drivers/infiniband/hw/nes')
-rw-r--r--drivers/infiniband/hw/nes/nes_verbs.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index 7c27420c2240..f9a5d4390892 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -2800,10 +2800,11 @@ static int nes_dereg_mr(struct ib_mr *ib_mr)
2800/** 2800/**
2801 * show_rev 2801 * show_rev
2802 */ 2802 */
2803static ssize_t show_rev(struct class_device *cdev, char *buf) 2803static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
2804 char *buf)
2804{ 2805{
2805 struct nes_ib_device *nesibdev = 2806 struct nes_ib_device *nesibdev =
2806 container_of(cdev, struct nes_ib_device, ibdev.class_dev); 2807 container_of(dev, struct nes_ib_device, ibdev.dev);
2807 struct nes_vnic *nesvnic = nesibdev->nesvnic; 2808 struct nes_vnic *nesvnic = nesibdev->nesvnic;
2808 2809
2809 nes_debug(NES_DBG_INIT, "\n"); 2810 nes_debug(NES_DBG_INIT, "\n");
@@ -2814,10 +2815,11 @@ static ssize_t show_rev(struct class_device *cdev, char *buf)
2814/** 2815/**
2815 * show_fw_ver 2816 * show_fw_ver
2816 */ 2817 */
2817static ssize_t show_fw_ver(struct class_device *cdev, char *buf) 2818static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr,
2819 char *buf)
2818{ 2820{
2819 struct nes_ib_device *nesibdev = 2821 struct nes_ib_device *nesibdev =
2820 container_of(cdev, struct nes_ib_device, ibdev.class_dev); 2822 container_of(dev, struct nes_ib_device, ibdev.dev);
2821 struct nes_vnic *nesvnic = nesibdev->nesvnic; 2823 struct nes_vnic *nesvnic = nesibdev->nesvnic;
2822 2824
2823 nes_debug(NES_DBG_INIT, "\n"); 2825 nes_debug(NES_DBG_INIT, "\n");
@@ -2831,7 +2833,8 @@ static ssize_t show_fw_ver(struct class_device *cdev, char *buf)
2831/** 2833/**
2832 * show_hca 2834 * show_hca
2833 */ 2835 */
2834static ssize_t show_hca(struct class_device *cdev, char *buf) 2836static ssize_t show_hca(struct device *dev, struct device_attribute *attr,
2837 char *buf)
2835{ 2838{
2836 nes_debug(NES_DBG_INIT, "\n"); 2839 nes_debug(NES_DBG_INIT, "\n");
2837 return sprintf(buf, "NES020\n"); 2840 return sprintf(buf, "NES020\n");
@@ -2841,23 +2844,24 @@ static ssize_t show_hca(struct class_device *cdev, char *buf)
2841/** 2844/**
2842 * show_board 2845 * show_board
2843 */ 2846 */
2844static ssize_t show_board(struct class_device *cdev, char *buf) 2847static ssize_t show_board(struct device *dev, struct device_attribute *attr,
2848 char *buf)
2845{ 2849{
2846 nes_debug(NES_DBG_INIT, "\n"); 2850 nes_debug(NES_DBG_INIT, "\n");
2847 return sprintf(buf, "%.*s\n", 32, "NES020 Board ID"); 2851 return sprintf(buf, "%.*s\n", 32, "NES020 Board ID");
2848} 2852}
2849 2853
2850 2854
2851static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL); 2855static DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
2852static CLASS_DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL); 2856static DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
2853static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL); 2857static DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL);
2854static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL); 2858static DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL);
2855 2859
2856static struct class_device_attribute *nes_class_attributes[] = { 2860static struct device_attribute *nes_dev_attributes[] = {
2857 &class_device_attr_hw_rev, 2861 &dev_attr_hw_rev,
2858 &class_device_attr_fw_ver, 2862 &dev_attr_fw_ver,
2859 &class_device_attr_hca_type, 2863 &dev_attr_hca_type,
2860 &class_device_attr_board_id 2864 &dev_attr_board_id
2861}; 2865};
2862 2866
2863 2867
@@ -3782,7 +3786,7 @@ struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev)
3782 nesibdev->ibdev.phys_port_cnt = 1; 3786 nesibdev->ibdev.phys_port_cnt = 1;
3783 nesibdev->ibdev.num_comp_vectors = 1; 3787 nesibdev->ibdev.num_comp_vectors = 1;
3784 nesibdev->ibdev.dma_device = &nesdev->pcidev->dev; 3788 nesibdev->ibdev.dma_device = &nesdev->pcidev->dev;
3785 nesibdev->ibdev.class_dev.dev = &nesdev->pcidev->dev; 3789 nesibdev->ibdev.dev.parent = &nesdev->pcidev->dev;
3786 nesibdev->ibdev.query_device = nes_query_device; 3790 nesibdev->ibdev.query_device = nes_query_device;
3787 nesibdev->ibdev.query_port = nes_query_port; 3791 nesibdev->ibdev.query_port = nes_query_port;
3788 nesibdev->ibdev.modify_port = nes_modify_port; 3792 nesibdev->ibdev.modify_port = nes_modify_port;
@@ -3877,13 +3881,13 @@ int nes_register_ofa_device(struct nes_ib_device *nesibdev)
3877 nesibdev->max_qp = (nesadapter->max_qp-NES_FIRST_QPN) / nesadapter->port_count; 3881 nesibdev->max_qp = (nesadapter->max_qp-NES_FIRST_QPN) / nesadapter->port_count;
3878 nesibdev->max_pd = nesadapter->max_pd / nesadapter->port_count; 3882 nesibdev->max_pd = nesadapter->max_pd / nesadapter->port_count;
3879 3883
3880 for (i = 0; i < ARRAY_SIZE(nes_class_attributes); ++i) { 3884 for (i = 0; i < ARRAY_SIZE(nes_dev_attributes); ++i) {
3881 ret = class_device_create_file(&nesibdev->ibdev.class_dev, nes_class_attributes[i]); 3885 ret = device_create_file(&nesibdev->ibdev.dev, nes_dev_attributes[i]);
3882 if (ret) { 3886 if (ret) {
3883 while (i > 0) { 3887 while (i > 0) {
3884 i--; 3888 i--;
3885 class_device_remove_file(&nesibdev->ibdev.class_dev, 3889 device_remove_file(&nesibdev->ibdev.dev,
3886 nes_class_attributes[i]); 3890 nes_dev_attributes[i]);
3887 } 3891 }
3888 ib_unregister_device(&nesibdev->ibdev); 3892 ib_unregister_device(&nesibdev->ibdev);
3889 return ret; 3893 return ret;
@@ -3904,8 +3908,8 @@ static void nes_unregister_ofa_device(struct nes_ib_device *nesibdev)
3904 struct nes_vnic *nesvnic = nesibdev->nesvnic; 3908 struct nes_vnic *nesvnic = nesibdev->nesvnic;
3905 int i; 3909 int i;
3906 3910
3907 for (i = 0; i < ARRAY_SIZE(nes_class_attributes); ++i) { 3911 for (i = 0; i < ARRAY_SIZE(nes_dev_attributes); ++i) {
3908 class_device_remove_file(&nesibdev->ibdev.class_dev, nes_class_attributes[i]); 3912 device_remove_file(&nesibdev->ibdev.dev, nes_dev_attributes[i]);
3909 } 3913 }
3910 3914
3911 if (nesvnic->of_device_registered) { 3915 if (nesvnic->of_device_registered) {