main.c (82ffd0454bd9bd57780966d47bfd56d579dd4fb3) main.c (21a428a019c9a6d133e745b529b9bf18c1187e70)
1/* QLogic qedr NIC Driver
2 * Copyright (c) 2015-2016 QLogic Corporation
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 123 unchanged lines hidden (view full) ---

132
133 return 0;
134}
135
136/* QEDR sysfs interface */
137static ssize_t hw_rev_show(struct device *device, struct device_attribute *attr,
138 char *buf)
139{
1/* QLogic qedr NIC Driver
2 * Copyright (c) 2015-2016 QLogic Corporation
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 123 unchanged lines hidden (view full) ---

132
133 return 0;
134}
135
136/* QEDR sysfs interface */
137static ssize_t hw_rev_show(struct device *device, struct device_attribute *attr,
138 char *buf)
139{
140 struct qedr_dev *dev = dev_get_drvdata(device);
140 struct qedr_dev *dev =
141 rdma_device_to_drv_device(device, struct qedr_dev, ibdev);
141
142 return scnprintf(buf, PAGE_SIZE, "0x%x\n", dev->pdev->vendor);
143}
144static DEVICE_ATTR_RO(hw_rev);
145
146static ssize_t hca_type_show(struct device *device,
147 struct device_attribute *attr, char *buf)
148{

--- 84 unchanged lines hidden (view full) ---

233 .query_device = qedr_query_device,
234 .query_pkey = qedr_query_pkey,
235 .query_port = qedr_query_port,
236 .query_qp = qedr_query_qp,
237 .query_srq = qedr_query_srq,
238 .reg_user_mr = qedr_reg_user_mr,
239 .req_notify_cq = qedr_arm_cq,
240 .resize_cq = qedr_resize_cq,
142
143 return scnprintf(buf, PAGE_SIZE, "0x%x\n", dev->pdev->vendor);
144}
145static DEVICE_ATTR_RO(hw_rev);
146
147static ssize_t hca_type_show(struct device *device,
148 struct device_attribute *attr, char *buf)
149{

--- 84 unchanged lines hidden (view full) ---

234 .query_device = qedr_query_device,
235 .query_pkey = qedr_query_pkey,
236 .query_port = qedr_query_port,
237 .query_qp = qedr_query_qp,
238 .query_srq = qedr_query_srq,
239 .reg_user_mr = qedr_reg_user_mr,
240 .req_notify_cq = qedr_arm_cq,
241 .resize_cq = qedr_resize_cq,
242 INIT_RDMA_OBJ_SIZE(ib_pd, qedr_pd, ibpd),
241};
242
243static int qedr_register_device(struct qedr_dev *dev)
244{
245 int rc;
246
247 dev->ibdev.node_guid = dev->attr.node_guid;
248 memcpy(dev->ibdev.node_desc, QEDR_NODE_DESC, sizeof(QEDR_NODE_DESC));

--- 36 unchanged lines hidden (view full) ---

285 dev->ibdev.phys_port_cnt = 1;
286 dev->ibdev.num_comp_vectors = dev->num_cnq;
287 dev->ibdev.dev.parent = &dev->pdev->dev;
288
289 rdma_set_device_sysfs_group(&dev->ibdev, &qedr_attr_group);
290 ib_set_device_ops(&dev->ibdev, &qedr_dev_ops);
291
292 dev->ibdev.driver_id = RDMA_DRIVER_QEDR;
243};
244
245static int qedr_register_device(struct qedr_dev *dev)
246{
247 int rc;
248
249 dev->ibdev.node_guid = dev->attr.node_guid;
250 memcpy(dev->ibdev.node_desc, QEDR_NODE_DESC, sizeof(QEDR_NODE_DESC));

--- 36 unchanged lines hidden (view full) ---

287 dev->ibdev.phys_port_cnt = 1;
288 dev->ibdev.num_comp_vectors = dev->num_cnq;
289 dev->ibdev.dev.parent = &dev->pdev->dev;
290
291 rdma_set_device_sysfs_group(&dev->ibdev, &qedr_attr_group);
292 ib_set_device_ops(&dev->ibdev, &qedr_dev_ops);
293
294 dev->ibdev.driver_id = RDMA_DRIVER_QEDR;
293 return ib_register_device(&dev->ibdev, "qedr%d", NULL);
295 return ib_register_device(&dev->ibdev, "qedr%d");
294}
295
296/* This function allocates fast-path status block memory */
297static int qedr_alloc_mem_sb(struct qedr_dev *dev,
298 struct qed_sb_info *sb_info, u16 sb_id)
299{
300 struct status_block_e4 *sb_virt;
301 dma_addr_t sb_phys;

--- 545 unchanged lines hidden (view full) ---

847
848static struct qedr_dev *qedr_add(struct qed_dev *cdev, struct pci_dev *pdev,
849 struct net_device *ndev)
850{
851 struct qed_dev_rdma_info dev_info;
852 struct qedr_dev *dev;
853 int rc = 0;
854
296}
297
298/* This function allocates fast-path status block memory */
299static int qedr_alloc_mem_sb(struct qedr_dev *dev,
300 struct qed_sb_info *sb_info, u16 sb_id)
301{
302 struct status_block_e4 *sb_virt;
303 dma_addr_t sb_phys;

--- 545 unchanged lines hidden (view full) ---

849
850static struct qedr_dev *qedr_add(struct qed_dev *cdev, struct pci_dev *pdev,
851 struct net_device *ndev)
852{
853 struct qed_dev_rdma_info dev_info;
854 struct qedr_dev *dev;
855 int rc = 0;
856
855 dev = (struct qedr_dev *)ib_alloc_device(sizeof(*dev));
857 dev = ib_alloc_device(qedr_dev, ibdev);
856 if (!dev) {
857 pr_err("Unable to allocate ib device\n");
858 return NULL;
859 }
860
861 DP_DEBUG(dev, QEDR_MSG_INIT, "qedr add device called\n");
862
863 dev->pdev = pdev;

--- 173 unchanged lines hidden ---
858 if (!dev) {
859 pr_err("Unable to allocate ib device\n");
860 return NULL;
861 }
862
863 DP_DEBUG(dev, QEDR_MSG_INIT, "qedr add device called\n");
864
865 dev->pdev = pdev;

--- 173 unchanged lines hidden ---