forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/infiniband/hw/cxgb4/provider.c
....@@ -58,51 +58,34 @@
5858 module_param(fastreg_support, int, 0644);
5959 MODULE_PARM_DESC(fastreg_support, "Advertise fastreg support (default=1)");
6060
61
-void _c4iw_free_ucontext(struct kref *kref)
61
+static void c4iw_dealloc_ucontext(struct ib_ucontext *context)
6262 {
63
- struct c4iw_ucontext *ucontext;
63
+ struct c4iw_ucontext *ucontext = to_c4iw_ucontext(context);
6464 struct c4iw_dev *rhp;
6565 struct c4iw_mm_entry *mm, *tmp;
6666
67
- ucontext = container_of(kref, struct c4iw_ucontext, kref);
67
+ pr_debug("context %p\n", context);
6868 rhp = to_c4iw_dev(ucontext->ibucontext.device);
6969
70
- pr_debug("ucontext %p\n", ucontext);
7170 list_for_each_entry_safe(mm, tmp, &ucontext->mmaps, entry)
7271 kfree(mm);
7372 c4iw_release_dev_ucontext(&rhp->rdev, &ucontext->uctx);
74
- kfree(ucontext);
7573 }
7674
77
-static int c4iw_dealloc_ucontext(struct ib_ucontext *context)
75
+static int c4iw_alloc_ucontext(struct ib_ucontext *ucontext,
76
+ struct ib_udata *udata)
7877 {
79
- struct c4iw_ucontext *ucontext = to_c4iw_ucontext(context);
80
-
81
- pr_debug("context %p\n", context);
82
- c4iw_put_ucontext(ucontext);
83
- return 0;
84
-}
85
-
86
-static struct ib_ucontext *c4iw_alloc_ucontext(struct ib_device *ibdev,
87
- struct ib_udata *udata)
88
-{
89
- struct c4iw_ucontext *context;
78
+ struct ib_device *ibdev = ucontext->device;
79
+ struct c4iw_ucontext *context = to_c4iw_ucontext(ucontext);
9080 struct c4iw_dev *rhp = to_c4iw_dev(ibdev);
9181 struct c4iw_alloc_ucontext_resp uresp;
9282 int ret = 0;
9383 struct c4iw_mm_entry *mm = NULL;
9484
9585 pr_debug("ibdev %p\n", ibdev);
96
- context = kzalloc(sizeof(*context), GFP_KERNEL);
97
- if (!context) {
98
- ret = -ENOMEM;
99
- goto err;
100
- }
101
-
10286 c4iw_init_dev_ucontext(&rhp->rdev, &context->uctx);
10387 INIT_LIST_HEAD(&context->mmaps);
10488 spin_lock_init(&context->mmap_lock);
105
- kref_init(&context->kref);
10689
10790 if (udata->outlen < sizeof(uresp) - sizeof(uresp.reserved)) {
10891 pr_err_once("Warning - downlevel libcxgb4 (non-fatal), device status page disabled\n");
....@@ -111,7 +94,7 @@
11194 mm = kmalloc(sizeof(*mm), GFP_KERNEL);
11295 if (!mm) {
11396 ret = -ENOMEM;
114
- goto err_free;
97
+ goto err;
11598 }
11699
117100 uresp.status_page_size = PAGE_SIZE;
....@@ -131,13 +114,11 @@
131114 mm->len = PAGE_SIZE;
132115 insert_mmap(context, mm);
133116 }
134
- return &context->ibucontext;
117
+ return 0;
135118 err_mm:
136119 kfree(mm);
137
-err_free:
138
- kfree(context);
139120 err:
140
- return ERR_PTR(ret);
121
+ return ret;
141122 }
142123
143124 static int c4iw_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
....@@ -209,7 +190,7 @@
209190 return ret;
210191 }
211192
212
-static int c4iw_deallocate_pd(struct ib_pd *pd)
193
+static int c4iw_deallocate_pd(struct ib_pd *pd, struct ib_udata *udata)
213194 {
214195 struct c4iw_dev *rhp;
215196 struct c4iw_pd *php;
....@@ -221,15 +202,13 @@
221202 mutex_lock(&rhp->rdev.stats.lock);
222203 rhp->rdev.stats.pd.cur--;
223204 mutex_unlock(&rhp->rdev.stats.lock);
224
- kfree(php);
225205 return 0;
226206 }
227207
228
-static struct ib_pd *c4iw_allocate_pd(struct ib_device *ibdev,
229
- struct ib_ucontext *context,
230
- struct ib_udata *udata)
208
+static int c4iw_allocate_pd(struct ib_pd *pd, struct ib_udata *udata)
231209 {
232
- struct c4iw_pd *php;
210
+ struct c4iw_pd *php = to_c4iw_pd(pd);
211
+ struct ib_device *ibdev = pd->device;
233212 u32 pdid;
234213 struct c4iw_dev *rhp;
235214
....@@ -237,20 +216,16 @@
237216 rhp = (struct c4iw_dev *) ibdev;
238217 pdid = c4iw_get_resource(&rhp->rdev.resource.pdid_table);
239218 if (!pdid)
240
- return ERR_PTR(-EINVAL);
241
- php = kzalloc(sizeof(*php), GFP_KERNEL);
242
- if (!php) {
243
- c4iw_put_resource(&rhp->rdev.resource.pdid_table, pdid);
244
- return ERR_PTR(-ENOMEM);
245
- }
219
+ return -EINVAL;
220
+
246221 php->pdid = pdid;
247222 php->rhp = rhp;
248
- if (context) {
223
+ if (udata) {
249224 struct c4iw_alloc_pd_resp uresp = {.pdid = php->pdid};
250225
251226 if (ib_copy_to_udata(udata, &uresp, sizeof(uresp))) {
252
- c4iw_deallocate_pd(&php->ibpd);
253
- return ERR_PTR(-EFAULT);
227
+ c4iw_deallocate_pd(&php->ibpd, udata);
228
+ return -EFAULT;
254229 }
255230 }
256231 mutex_lock(&rhp->rdev.stats.lock);
....@@ -259,14 +234,6 @@
259234 rhp->rdev.stats.pd.max = rhp->rdev.stats.pd.cur;
260235 mutex_unlock(&rhp->rdev.stats.lock);
261236 pr_debug("pdid 0x%0x ptr 0x%p\n", pdid, php);
262
- return &php->ibpd;
263
-}
264
-
265
-static int c4iw_query_pkey(struct ib_device *ibdev, u8 port, u16 index,
266
- u16 *pkey)
267
-{
268
- pr_debug("ibdev %p\n", ibdev);
269
- *pkey = 0;
270237 return 0;
271238 }
272239
....@@ -297,7 +264,6 @@
297264 return -EINVAL;
298265
299266 dev = to_c4iw_dev(ibdev);
300
- memset(props, 0, sizeof *props);
301267 memcpy(&props->sys_image_guid, dev->rdev.lldi.ports[0]->dev_addr, 6);
302268 props->hw_ver = CHELSIO_CHIP_RELEASE(dev->rdev.lldi.adapter_type);
303269 props->fw_ver = dev->rdev.lldi.fw_vers;
....@@ -332,31 +298,10 @@
332298 static int c4iw_query_port(struct ib_device *ibdev, u8 port,
333299 struct ib_port_attr *props)
334300 {
335
- struct c4iw_dev *dev;
336
- struct net_device *netdev;
337
- struct in_device *inetdev;
338
-
301
+ int ret = 0;
339302 pr_debug("ibdev %p\n", ibdev);
340
-
341
- dev = to_c4iw_dev(ibdev);
342
- netdev = dev->rdev.lldi.ports[port-1];
343
- /* props being zeroed by the caller, avoid zeroing it here */
344
- props->max_mtu = IB_MTU_4096;
345
- props->active_mtu = ib_mtu_int_to_enum(netdev->mtu);
346
-
347
- if (!netif_carrier_ok(netdev))
348
- props->state = IB_PORT_DOWN;
349
- else {
350
- inetdev = in_dev_get(netdev);
351
- if (inetdev) {
352
- if (inetdev->ifa_list)
353
- props->state = IB_PORT_ACTIVE;
354
- else
355
- props->state = IB_PORT_INIT;
356
- in_dev_put(inetdev);
357
- } else
358
- props->state = IB_PORT_INIT;
359
- }
303
+ ret = ib_get_eth_speed(ibdev, port, &props->active_speed,
304
+ &props->active_width);
360305
361306 props->port_cap_flags =
362307 IB_PORT_CM_SUP |
....@@ -365,29 +310,28 @@
365310 IB_PORT_DEVICE_MGMT_SUP |
366311 IB_PORT_VENDOR_CLASS_SUP | IB_PORT_BOOT_MGMT_SUP;
367312 props->gid_tbl_len = 1;
368
- props->pkey_tbl_len = 1;
369
- props->active_width = 2;
370
- props->active_speed = IB_SPEED_DDR;
371313 props->max_msg_sz = -1;
372314
373
- return 0;
315
+ return ret;
374316 }
375317
376
-static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
377
- char *buf)
318
+static ssize_t hw_rev_show(struct device *dev,
319
+ struct device_attribute *attr, char *buf)
378320 {
379
- struct c4iw_dev *c4iw_dev = container_of(dev, struct c4iw_dev,
380
- ibdev.dev);
321
+ struct c4iw_dev *c4iw_dev =
322
+ rdma_device_to_drv_device(dev, struct c4iw_dev, ibdev);
323
+
381324 pr_debug("dev 0x%p\n", dev);
382325 return sprintf(buf, "%d\n",
383326 CHELSIO_CHIP_RELEASE(c4iw_dev->rdev.lldi.adapter_type));
384327 }
328
+static DEVICE_ATTR_RO(hw_rev);
385329
386
-static ssize_t show_hca(struct device *dev, struct device_attribute *attr,
387
- char *buf)
330
+static ssize_t hca_type_show(struct device *dev,
331
+ struct device_attribute *attr, char *buf)
388332 {
389
- struct c4iw_dev *c4iw_dev = container_of(dev, struct c4iw_dev,
390
- ibdev.dev);
333
+ struct c4iw_dev *c4iw_dev =
334
+ rdma_device_to_drv_device(dev, struct c4iw_dev, ibdev);
391335 struct ethtool_drvinfo info;
392336 struct net_device *lldev = c4iw_dev->rdev.lldi.ports[0];
393337
....@@ -395,16 +339,19 @@
395339 lldev->ethtool_ops->get_drvinfo(lldev, &info);
396340 return sprintf(buf, "%s\n", info.driver);
397341 }
342
+static DEVICE_ATTR_RO(hca_type);
398343
399
-static ssize_t show_board(struct device *dev, struct device_attribute *attr,
400
- char *buf)
344
+static ssize_t board_id_show(struct device *dev, struct device_attribute *attr,
345
+ char *buf)
401346 {
402
- struct c4iw_dev *c4iw_dev = container_of(dev, struct c4iw_dev,
403
- ibdev.dev);
347
+ struct c4iw_dev *c4iw_dev =
348
+ rdma_device_to_drv_device(dev, struct c4iw_dev, ibdev);
349
+
404350 pr_debug("dev 0x%p\n", dev);
405351 return sprintf(buf, "%x.%x\n", c4iw_dev->rdev.lldi.pdev->vendor,
406352 c4iw_dev->rdev.lldi.pdev->device);
407353 }
354
+static DEVICE_ATTR_RO(board_id);
408355
409356 enum counters {
410357 IP4INSEGS,
....@@ -461,14 +408,15 @@
461408 return stats->num_counters;
462409 }
463410
464
-static DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
465
-static DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL);
466
-static DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL);
411
+static struct attribute *c4iw_class_attributes[] = {
412
+ &dev_attr_hw_rev.attr,
413
+ &dev_attr_hca_type.attr,
414
+ &dev_attr_board_id.attr,
415
+ NULL
416
+};
467417
468
-static struct device_attribute *c4iw_class_attributes[] = {
469
- &dev_attr_hw_rev,
470
- &dev_attr_hca_type,
471
- &dev_attr_board_id,
418
+static const struct attribute_group c4iw_attr_group = {
419
+ .attrs = c4iw_class_attributes,
472420 };
473421
474422 static int c4iw_port_immutable(struct ib_device *ibdev, u8 port_num,
....@@ -483,7 +431,6 @@
483431 if (err)
484432 return err;
485433
486
- immutable->pkey_tbl_len = attr.pkey_tbl_len;
487434 immutable->gid_tbl_len = attr.gid_tbl_len;
488435
489436 return 0;
....@@ -502,43 +449,86 @@
502449 FW_HDR_FW_VER_BUILD_G(c4iw_dev->rdev.lldi.fw_vers));
503450 }
504451
505
-static struct net_device *get_netdev(struct ib_device *dev, u8 port)
452
+static const struct ib_device_ops c4iw_dev_ops = {
453
+ .owner = THIS_MODULE,
454
+ .driver_id = RDMA_DRIVER_CXGB4,
455
+ .uverbs_abi_ver = C4IW_UVERBS_ABI_VERSION,
456
+
457
+ .alloc_hw_stats = c4iw_alloc_stats,
458
+ .alloc_mr = c4iw_alloc_mr,
459
+ .alloc_mw = c4iw_alloc_mw,
460
+ .alloc_pd = c4iw_allocate_pd,
461
+ .alloc_ucontext = c4iw_alloc_ucontext,
462
+ .create_cq = c4iw_create_cq,
463
+ .create_qp = c4iw_create_qp,
464
+ .create_srq = c4iw_create_srq,
465
+ .dealloc_mw = c4iw_dealloc_mw,
466
+ .dealloc_pd = c4iw_deallocate_pd,
467
+ .dealloc_ucontext = c4iw_dealloc_ucontext,
468
+ .dereg_mr = c4iw_dereg_mr,
469
+ .destroy_cq = c4iw_destroy_cq,
470
+ .destroy_qp = c4iw_destroy_qp,
471
+ .destroy_srq = c4iw_destroy_srq,
472
+ .fill_res_cq_entry = c4iw_fill_res_cq_entry,
473
+ .fill_res_cm_id_entry = c4iw_fill_res_cm_id_entry,
474
+ .fill_res_mr_entry = c4iw_fill_res_mr_entry,
475
+ .get_dev_fw_str = get_dev_fw_str,
476
+ .get_dma_mr = c4iw_get_dma_mr,
477
+ .get_hw_stats = c4iw_get_mib,
478
+ .get_port_immutable = c4iw_port_immutable,
479
+ .iw_accept = c4iw_accept_cr,
480
+ .iw_add_ref = c4iw_qp_add_ref,
481
+ .iw_connect = c4iw_connect,
482
+ .iw_create_listen = c4iw_create_listen,
483
+ .iw_destroy_listen = c4iw_destroy_listen,
484
+ .iw_get_qp = c4iw_get_qp,
485
+ .iw_reject = c4iw_reject_cr,
486
+ .iw_rem_ref = c4iw_qp_rem_ref,
487
+ .map_mr_sg = c4iw_map_mr_sg,
488
+ .mmap = c4iw_mmap,
489
+ .modify_qp = c4iw_ib_modify_qp,
490
+ .modify_srq = c4iw_modify_srq,
491
+ .poll_cq = c4iw_poll_cq,
492
+ .post_recv = c4iw_post_receive,
493
+ .post_send = c4iw_post_send,
494
+ .post_srq_recv = c4iw_post_srq_recv,
495
+ .query_device = c4iw_query_device,
496
+ .query_gid = c4iw_query_gid,
497
+ .query_port = c4iw_query_port,
498
+ .query_qp = c4iw_ib_query_qp,
499
+ .reg_user_mr = c4iw_reg_user_mr,
500
+ .req_notify_cq = c4iw_arm_cq,
501
+
502
+ INIT_RDMA_OBJ_SIZE(ib_cq, c4iw_cq, ibcq),
503
+ INIT_RDMA_OBJ_SIZE(ib_mw, c4iw_mw, ibmw),
504
+ INIT_RDMA_OBJ_SIZE(ib_pd, c4iw_pd, ibpd),
505
+ INIT_RDMA_OBJ_SIZE(ib_srq, c4iw_srq, ibsrq),
506
+ INIT_RDMA_OBJ_SIZE(ib_ucontext, c4iw_ucontext, ibucontext),
507
+};
508
+
509
+static int set_netdevs(struct ib_device *ib_dev, struct c4iw_rdev *rdev)
506510 {
507
- struct c4iw_dev *c4iw_dev = container_of(dev, struct c4iw_dev, ibdev);
508
- struct c4iw_rdev *rdev = &c4iw_dev->rdev;
509
- struct net_device *ndev;
511
+ int ret;
512
+ int i;
510513
511
- if (!port || port > rdev->lldi.nports)
512
- return NULL;
513
-
514
- rcu_read_lock();
515
- ndev = rdev->lldi.ports[port - 1];
516
- if (ndev)
517
- dev_hold(ndev);
518
- rcu_read_unlock();
519
-
520
- return ndev;
521
-}
522
-
523
-static int fill_res_entry(struct sk_buff *msg, struct rdma_restrack_entry *res)
524
-{
525
- return (res->type < ARRAY_SIZE(c4iw_restrack_funcs) &&
526
- c4iw_restrack_funcs[res->type]) ?
527
- c4iw_restrack_funcs[res->type](msg, res) : 0;
514
+ for (i = 0; i < rdev->lldi.nports; i++) {
515
+ ret = ib_device_set_netdev(ib_dev, rdev->lldi.ports[i],
516
+ i + 1);
517
+ if (ret)
518
+ return ret;
519
+ }
520
+ return 0;
528521 }
529522
530523 void c4iw_register_device(struct work_struct *work)
531524 {
532525 int ret;
533
- int i;
534526 struct uld_ctx *ctx = container_of(work, struct uld_ctx, reg_work);
535527 struct c4iw_dev *dev = ctx->dev;
536528
537529 pr_debug("c4iw_dev %p\n", dev);
538
- strlcpy(dev->ibdev.name, "cxgb4_%d", IB_DEVICE_NAME_MAX);
539530 memset(&dev->ibdev.node_guid, 0, sizeof(dev->ibdev.node_guid));
540531 memcpy(&dev->ibdev.node_guid, dev->rdev.lldi.ports[0]->dev_addr, 6);
541
- dev->ibdev.owner = THIS_MODULE;
542532 dev->device_cap_flags = IB_DEVICE_LOCAL_DMA_LKEY | IB_DEVICE_MEM_WINDOW;
543533 if (fastreg_support)
544534 dev->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS;
....@@ -571,77 +561,22 @@
571561 dev->ibdev.phys_port_cnt = dev->rdev.lldi.nports;
572562 dev->ibdev.num_comp_vectors = dev->rdev.lldi.nciq;
573563 dev->ibdev.dev.parent = &dev->rdev.lldi.pdev->dev;
574
- dev->ibdev.query_device = c4iw_query_device;
575
- dev->ibdev.query_port = c4iw_query_port;
576
- dev->ibdev.query_pkey = c4iw_query_pkey;
577
- dev->ibdev.query_gid = c4iw_query_gid;
578
- dev->ibdev.alloc_ucontext = c4iw_alloc_ucontext;
579
- dev->ibdev.dealloc_ucontext = c4iw_dealloc_ucontext;
580
- dev->ibdev.mmap = c4iw_mmap;
581
- dev->ibdev.alloc_pd = c4iw_allocate_pd;
582
- dev->ibdev.dealloc_pd = c4iw_deallocate_pd;
583
- dev->ibdev.create_qp = c4iw_create_qp;
584
- dev->ibdev.modify_qp = c4iw_ib_modify_qp;
585
- dev->ibdev.query_qp = c4iw_ib_query_qp;
586
- dev->ibdev.destroy_qp = c4iw_destroy_qp;
587
- dev->ibdev.create_srq = c4iw_create_srq;
588
- dev->ibdev.modify_srq = c4iw_modify_srq;
589
- dev->ibdev.destroy_srq = c4iw_destroy_srq;
590
- dev->ibdev.create_cq = c4iw_create_cq;
591
- dev->ibdev.destroy_cq = c4iw_destroy_cq;
592
- dev->ibdev.poll_cq = c4iw_poll_cq;
593
- dev->ibdev.get_dma_mr = c4iw_get_dma_mr;
594
- dev->ibdev.reg_user_mr = c4iw_reg_user_mr;
595
- dev->ibdev.dereg_mr = c4iw_dereg_mr;
596
- dev->ibdev.alloc_mw = c4iw_alloc_mw;
597
- dev->ibdev.dealloc_mw = c4iw_dealloc_mw;
598
- dev->ibdev.alloc_mr = c4iw_alloc_mr;
599
- dev->ibdev.map_mr_sg = c4iw_map_mr_sg;
600
- dev->ibdev.req_notify_cq = c4iw_arm_cq;
601
- dev->ibdev.post_send = c4iw_post_send;
602
- dev->ibdev.post_recv = c4iw_post_receive;
603
- dev->ibdev.post_srq_recv = c4iw_post_srq_recv;
604
- dev->ibdev.alloc_hw_stats = c4iw_alloc_stats;
605
- dev->ibdev.get_hw_stats = c4iw_get_mib;
606
- dev->ibdev.uverbs_abi_ver = C4IW_UVERBS_ABI_VERSION;
607
- dev->ibdev.get_port_immutable = c4iw_port_immutable;
608
- dev->ibdev.get_dev_fw_str = get_dev_fw_str;
609
- dev->ibdev.get_netdev = get_netdev;
610564
611
- dev->ibdev.iwcm = kmalloc(sizeof(struct iw_cm_verbs), GFP_KERNEL);
612
- if (!dev->ibdev.iwcm) {
613
- ret = -ENOMEM;
614
- goto err_dealloc_ctx;
615
- }
565
+ memcpy(dev->ibdev.iw_ifname, dev->rdev.lldi.ports[0]->name,
566
+ sizeof(dev->ibdev.iw_ifname));
616567
617
- dev->ibdev.iwcm->connect = c4iw_connect;
618
- dev->ibdev.iwcm->accept = c4iw_accept_cr;
619
- dev->ibdev.iwcm->reject = c4iw_reject_cr;
620
- dev->ibdev.iwcm->create_listen = c4iw_create_listen;
621
- dev->ibdev.iwcm->destroy_listen = c4iw_destroy_listen;
622
- dev->ibdev.iwcm->add_ref = c4iw_qp_add_ref;
623
- dev->ibdev.iwcm->rem_ref = c4iw_qp_rem_ref;
624
- dev->ibdev.iwcm->get_qp = c4iw_get_qp;
625
- dev->ibdev.res.fill_res_entry = fill_res_entry;
626
- memcpy(dev->ibdev.iwcm->ifname, dev->rdev.lldi.ports[0]->name,
627
- sizeof(dev->ibdev.iwcm->ifname));
628
-
629
- dev->ibdev.driver_id = RDMA_DRIVER_CXGB4;
630
- ret = ib_register_device(&dev->ibdev, NULL);
568
+ rdma_set_device_sysfs_group(&dev->ibdev, &c4iw_attr_group);
569
+ ib_set_device_ops(&dev->ibdev, &c4iw_dev_ops);
570
+ ret = set_netdevs(&dev->ibdev, &dev->rdev);
631571 if (ret)
632
- goto err_kfree_iwcm;
633
-
634
- for (i = 0; i < ARRAY_SIZE(c4iw_class_attributes); ++i) {
635
- ret = device_create_file(&dev->ibdev.dev,
636
- c4iw_class_attributes[i]);
637
- if (ret)
638
- goto err_unregister_device;
639
- }
572
+ goto err_dealloc_ctx;
573
+ dma_set_max_seg_size(&dev->rdev.lldi.pdev->dev, UINT_MAX);
574
+ ret = ib_register_device(&dev->ibdev, "cxgb4_%d",
575
+ &dev->rdev.lldi.pdev->dev);
576
+ if (ret)
577
+ goto err_dealloc_ctx;
640578 return;
641
-err_unregister_device:
642
- ib_unregister_device(&dev->ibdev);
643
-err_kfree_iwcm:
644
- kfree(dev->ibdev.iwcm);
579
+
645580 err_dealloc_ctx:
646581 pr_err("%s - Failed registering iwarp device: %d\n",
647582 pci_name(ctx->lldi.pdev), ret);
....@@ -651,13 +586,7 @@
651586
652587 void c4iw_unregister_device(struct c4iw_dev *dev)
653588 {
654
- int i;
655
-
656589 pr_debug("c4iw_dev %p\n", dev);
657
- for (i = 0; i < ARRAY_SIZE(c4iw_class_attributes); ++i)
658
- device_remove_file(&dev->ibdev.dev,
659
- c4iw_class_attributes[i]);
660590 ib_unregister_device(&dev->ibdev);
661
- kfree(dev->ibdev.iwcm);
662591 return;
663592 }