aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-05-27 03:17:53 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-07-22 00:54:49 -0400
commitd4c4196f24ade5f336882587480652efde2c739c (patch)
tree91e5f257a181b51c200d1b3b6e02bc2e3ee780cf /drivers/infiniband
parent27f302519148f311307637d4c9a6d0fd87d07e4c (diff)
infiniband: rename "device" to "ib_device" in cm_device
This pointer really is a struct ib_device, not a struct device, so name it properly to help prevent confusion. This makes the followon patch in this series much smaller and easier to understand as well. Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Roland Dreier <rolandd@cisco.com> Cc: Hal Rosenstock <hal.rosenstock@gmail.com> Acked-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/cm.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 55738eead3bf..8dc442984c82 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -162,7 +162,7 @@ struct cm_port {
162 162
163struct cm_device { 163struct cm_device {
164 struct list_head list; 164 struct list_head list;
165 struct ib_device *device; 165 struct ib_device *ib_device;
166 struct kobject dev_obj; 166 struct kobject dev_obj;
167 u8 ack_delay; 167 u8 ack_delay;
168 struct cm_port *port[0]; 168 struct cm_port *port[0];
@@ -339,7 +339,7 @@ static void cm_init_av_for_response(struct cm_port *port, struct ib_wc *wc,
339{ 339{
340 av->port = port; 340 av->port = port;
341 av->pkey_index = wc->pkey_index; 341 av->pkey_index = wc->pkey_index;
342 ib_init_ah_from_wc(port->cm_dev->device, port->port_num, wc, 342 ib_init_ah_from_wc(port->cm_dev->ib_device, port->port_num, wc,
343 grh, &av->ah_attr); 343 grh, &av->ah_attr);
344} 344}
345 345
@@ -353,7 +353,7 @@ static int cm_init_av_by_path(struct ib_sa_path_rec *path, struct cm_av *av)
353 353
354 read_lock_irqsave(&cm.device_lock, flags); 354 read_lock_irqsave(&cm.device_lock, flags);
355 list_for_each_entry(cm_dev, &cm.device_list, list) { 355 list_for_each_entry(cm_dev, &cm.device_list, list) {
356 if (!ib_find_cached_gid(cm_dev->device, &path->sgid, 356 if (!ib_find_cached_gid(cm_dev->ib_device, &path->sgid,
357 &p, NULL)) { 357 &p, NULL)) {
358 port = cm_dev->port[p-1]; 358 port = cm_dev->port[p-1];
359 break; 359 break;
@@ -364,13 +364,13 @@ static int cm_init_av_by_path(struct ib_sa_path_rec *path, struct cm_av *av)
364 if (!port) 364 if (!port)
365 return -EINVAL; 365 return -EINVAL;
366 366
367 ret = ib_find_cached_pkey(cm_dev->device, port->port_num, 367 ret = ib_find_cached_pkey(cm_dev->ib_device, port->port_num,
368 be16_to_cpu(path->pkey), &av->pkey_index); 368 be16_to_cpu(path->pkey), &av->pkey_index);
369 if (ret) 369 if (ret)
370 return ret; 370 return ret;
371 371
372 av->port = port; 372 av->port = port;
373 ib_init_ah_from_path(cm_dev->device, port->port_num, path, 373 ib_init_ah_from_path(cm_dev->ib_device, port->port_num, path,
374 &av->ah_attr); 374 &av->ah_attr);
375 av->timeout = path->packet_life_time + 1; 375 av->timeout = path->packet_life_time + 1;
376 return 0; 376 return 0;
@@ -1515,7 +1515,7 @@ static int cm_req_handler(struct cm_work *work)
1515 1515
1516 req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad; 1516 req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad;
1517 1517
1518 cm_id = ib_create_cm_id(work->port->cm_dev->device, NULL, NULL); 1518 cm_id = ib_create_cm_id(work->port->cm_dev->ib_device, NULL, NULL);
1519 if (IS_ERR(cm_id)) 1519 if (IS_ERR(cm_id))
1520 return PTR_ERR(cm_id); 1520 return PTR_ERR(cm_id);
1521 1521
@@ -1550,7 +1550,7 @@ static int cm_req_handler(struct cm_work *work)
1550 cm_format_paths_from_req(req_msg, &work->path[0], &work->path[1]); 1550 cm_format_paths_from_req(req_msg, &work->path[0], &work->path[1]);
1551 ret = cm_init_av_by_path(&work->path[0], &cm_id_priv->av); 1551 ret = cm_init_av_by_path(&work->path[0], &cm_id_priv->av);
1552 if (ret) { 1552 if (ret) {
1553 ib_get_cached_gid(work->port->cm_dev->device, 1553 ib_get_cached_gid(work->port->cm_dev->ib_device,
1554 work->port->port_num, 0, &work->path[0].sgid); 1554 work->port->port_num, 0, &work->path[0].sgid);
1555 ib_send_cm_rej(cm_id, IB_CM_REJ_INVALID_GID, 1555 ib_send_cm_rej(cm_id, IB_CM_REJ_INVALID_GID,
1556 &work->path[0].sgid, sizeof work->path[0].sgid, 1556 &work->path[0].sgid, sizeof work->path[0].sgid,
@@ -2950,7 +2950,7 @@ static int cm_sidr_req_handler(struct cm_work *work)
2950 struct cm_sidr_req_msg *sidr_req_msg; 2950 struct cm_sidr_req_msg *sidr_req_msg;
2951 struct ib_wc *wc; 2951 struct ib_wc *wc;
2952 2952
2953 cm_id = ib_create_cm_id(work->port->cm_dev->device, NULL, NULL); 2953 cm_id = ib_create_cm_id(work->port->cm_dev->ib_device, NULL, NULL);
2954 if (IS_ERR(cm_id)) 2954 if (IS_ERR(cm_id))
2955 return PTR_ERR(cm_id); 2955 return PTR_ERR(cm_id);
2956 cm_id_priv = container_of(cm_id, struct cm_id_private, id); 2956 cm_id_priv = container_of(cm_id, struct cm_id_private, id);
@@ -3578,7 +3578,7 @@ static void cm_get_ack_delay(struct cm_device *cm_dev)
3578{ 3578{
3579 struct ib_device_attr attr; 3579 struct ib_device_attr attr;
3580 3580
3581 if (ib_query_device(cm_dev->device, &attr)) 3581 if (ib_query_device(cm_dev->ib_device, &attr))
3582 cm_dev->ack_delay = 0; /* acks will rely on packet life time */ 3582 cm_dev->ack_delay = 0; /* acks will rely on packet life time */
3583 else 3583 else
3584 cm_dev->ack_delay = attr.local_ca_ack_delay; 3584 cm_dev->ack_delay = attr.local_ca_ack_delay;
@@ -3676,7 +3676,7 @@ static void cm_remove_port_fs(struct cm_port *port)
3676 kobject_put(&port->port_obj); 3676 kobject_put(&port->port_obj);
3677} 3677}
3678 3678
3679static void cm_add_one(struct ib_device *device) 3679static void cm_add_one(struct ib_device *ib_device)
3680{ 3680{
3681 struct cm_device *cm_dev; 3681 struct cm_device *cm_dev;
3682 struct cm_port *port; 3682 struct cm_port *port;
@@ -3691,26 +3691,27 @@ static void cm_add_one(struct ib_device *device)
3691 int ret; 3691 int ret;
3692 u8 i; 3692 u8 i;
3693 3693
3694 if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB) 3694 if (rdma_node_get_transport(ib_device->node_type) != RDMA_TRANSPORT_IB)
3695 return; 3695 return;
3696 3696
3697 cm_dev = kzalloc(sizeof(*cm_dev) + sizeof(*port) * 3697 cm_dev = kzalloc(sizeof(*cm_dev) + sizeof(*port) *
3698 device->phys_port_cnt, GFP_KERNEL); 3698 ib_device->phys_port_cnt, GFP_KERNEL);
3699 if (!cm_dev) 3699 if (!cm_dev)
3700 return; 3700 return;
3701 3701
3702 cm_dev->device = device; 3702 cm_dev->ib_device = ib_device;
3703 cm_get_ack_delay(cm_dev); 3703 cm_get_ack_delay(cm_dev);
3704 3704
3705 ret = kobject_init_and_add(&cm_dev->dev_obj, &cm_dev_obj_type, 3705 ret = kobject_init_and_add(&cm_dev->dev_obj, &cm_dev_obj_type,
3706 &cm_class.subsys.kobj, "%s", device->name); 3706 &cm_class.subsys.kobj, "%s",
3707 ib_device->name);
3707 if (ret) { 3708 if (ret) {
3708 kfree(cm_dev); 3709 kfree(cm_dev);
3709 return; 3710 return;
3710 } 3711 }
3711 3712
3712 set_bit(IB_MGMT_METHOD_SEND, reg_req.method_mask); 3713 set_bit(IB_MGMT_METHOD_SEND, reg_req.method_mask);
3713 for (i = 1; i <= device->phys_port_cnt; i++) { 3714 for (i = 1; i <= ib_device->phys_port_cnt; i++) {
3714 port = kzalloc(sizeof *port, GFP_KERNEL); 3715 port = kzalloc(sizeof *port, GFP_KERNEL);
3715 if (!port) 3716 if (!port)
3716 goto error1; 3717 goto error1;
@@ -3723,7 +3724,7 @@ static void cm_add_one(struct ib_device *device)
3723 if (ret) 3724 if (ret)
3724 goto error1; 3725 goto error1;
3725 3726
3726 port->mad_agent = ib_register_mad_agent(device, i, 3727 port->mad_agent = ib_register_mad_agent(ib_device, i,
3727 IB_QPT_GSI, 3728 IB_QPT_GSI,
3728 &reg_req, 3729 &reg_req,
3729 0, 3730 0,
@@ -3733,11 +3734,11 @@ static void cm_add_one(struct ib_device *device)
3733 if (IS_ERR(port->mad_agent)) 3734 if (IS_ERR(port->mad_agent))
3734 goto error2; 3735 goto error2;
3735 3736
3736 ret = ib_modify_port(device, i, 0, &port_modify); 3737 ret = ib_modify_port(ib_device, i, 0, &port_modify);
3737 if (ret) 3738 if (ret)
3738 goto error3; 3739 goto error3;
3739 } 3740 }
3740 ib_set_client_data(device, &cm_client, cm_dev); 3741 ib_set_client_data(ib_device, &cm_client, cm_dev);
3741 3742
3742 write_lock_irqsave(&cm.device_lock, flags); 3743 write_lock_irqsave(&cm.device_lock, flags);
3743 list_add_tail(&cm_dev->list, &cm.device_list); 3744 list_add_tail(&cm_dev->list, &cm.device_list);
@@ -3753,14 +3754,14 @@ error1:
3753 port_modify.clr_port_cap_mask = IB_PORT_CM_SUP; 3754 port_modify.clr_port_cap_mask = IB_PORT_CM_SUP;
3754 while (--i) { 3755 while (--i) {
3755 port = cm_dev->port[i-1]; 3756 port = cm_dev->port[i-1];
3756 ib_modify_port(device, port->port_num, 0, &port_modify); 3757 ib_modify_port(ib_device, port->port_num, 0, &port_modify);
3757 ib_unregister_mad_agent(port->mad_agent); 3758 ib_unregister_mad_agent(port->mad_agent);
3758 cm_remove_port_fs(port); 3759 cm_remove_port_fs(port);
3759 } 3760 }
3760 kobject_put(&cm_dev->dev_obj); 3761 kobject_put(&cm_dev->dev_obj);
3761} 3762}
3762 3763
3763static void cm_remove_one(struct ib_device *device) 3764static void cm_remove_one(struct ib_device *ib_device)
3764{ 3765{
3765 struct cm_device *cm_dev; 3766 struct cm_device *cm_dev;
3766 struct cm_port *port; 3767 struct cm_port *port;
@@ -3770,7 +3771,7 @@ static void cm_remove_one(struct ib_device *device)
3770 unsigned long flags; 3771 unsigned long flags;
3771 int i; 3772 int i;
3772 3773
3773 cm_dev = ib_get_client_data(device, &cm_client); 3774 cm_dev = ib_get_client_data(ib_device, &cm_client);
3774 if (!cm_dev) 3775 if (!cm_dev)
3775 return; 3776 return;
3776 3777
@@ -3778,9 +3779,9 @@ static void cm_remove_one(struct ib_device *device)
3778 list_del(&cm_dev->list); 3779 list_del(&cm_dev->list);
3779 write_unlock_irqrestore(&cm.device_lock, flags); 3780 write_unlock_irqrestore(&cm.device_lock, flags);
3780 3781
3781 for (i = 1; i <= device->phys_port_cnt; i++) { 3782 for (i = 1; i <= ib_device->phys_port_cnt; i++) {
3782 port = cm_dev->port[i-1]; 3783 port = cm_dev->port[i-1];
3783 ib_modify_port(device, port->port_num, 0, &port_modify); 3784 ib_modify_port(ib_device, port->port_num, 0, &port_modify);
3784 ib_unregister_mad_agent(port->mad_agent); 3785 ib_unregister_mad_agent(port->mad_agent);
3785 flush_workqueue(cm.wq); 3786 flush_workqueue(cm.wq);
3786 cm_remove_port_fs(port); 3787 cm_remove_port_fs(port);