Skip to content

Commit 532929a

Browse files
chandramohan-akularleon
authored andcommitted
RDMA/bnxt_re: Use the aux device for L2 ULP callbacks
While registering with the L2 for ULP operations, use the aux device pointer as the handle. Aux device has the data bnxt_re_en_dev_info, which is used to store required information for the bnxt_re_suspend and bnxt_re_resume functions. Signed-off-by: Chandramohan Akula <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Reviewed-by: Kashyap Desai <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent dee3da3 commit 532929a

File tree

1 file changed

+20
-6
lines changed
  • drivers/infiniband/hw/bnxt_re

1 file changed

+20
-6
lines changed

drivers/infiniband/hw/bnxt_re/main.c

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,18 @@ static void bnxt_re_shutdown(struct auxiliary_device *adev)
305305

306306
static void bnxt_re_stop_irq(void *handle)
307307
{
308-
struct bnxt_re_dev *rdev = (struct bnxt_re_dev *)handle;
309-
struct bnxt_qplib_rcfw *rcfw = &rdev->rcfw;
308+
struct bnxt_re_en_dev_info *en_info = auxiliary_get_drvdata(handle);
309+
struct bnxt_qplib_rcfw *rcfw;
310+
struct bnxt_re_dev *rdev;
310311
struct bnxt_qplib_nq *nq;
311312
int indx;
312313

314+
if (!en_info)
315+
return;
316+
317+
rdev = en_info->rdev;
318+
rcfw = &rdev->rcfw;
319+
313320
for (indx = BNXT_RE_NQ_IDX; indx < rdev->num_msix; indx++) {
314321
nq = &rdev->nq[indx - 1];
315322
bnxt_qplib_nq_stop_irq(nq, false);
@@ -320,12 +327,19 @@ static void bnxt_re_stop_irq(void *handle)
320327

321328
static void bnxt_re_start_irq(void *handle, struct bnxt_msix_entry *ent)
322329
{
323-
struct bnxt_re_dev *rdev = (struct bnxt_re_dev *)handle;
324-
struct bnxt_msix_entry *msix_ent = rdev->en_dev->msix_entries;
325-
struct bnxt_qplib_rcfw *rcfw = &rdev->rcfw;
330+
struct bnxt_re_en_dev_info *en_info = auxiliary_get_drvdata(handle);
331+
struct bnxt_msix_entry *msix_ent;
332+
struct bnxt_qplib_rcfw *rcfw;
333+
struct bnxt_re_dev *rdev;
326334
struct bnxt_qplib_nq *nq;
327335
int indx, rc;
328336

337+
if (!en_info)
338+
return;
339+
340+
rdev = en_info->rdev;
341+
msix_ent = rdev->en_dev->msix_entries;
342+
rcfw = &rdev->rcfw;
329343
if (!ent) {
330344
/* Not setting the f/w timeout bit in rcfw.
331345
* During the driver unload the first command
@@ -374,7 +388,7 @@ static int bnxt_re_register_netdev(struct bnxt_re_dev *rdev)
374388

375389
en_dev = rdev->en_dev;
376390

377-
rc = bnxt_register_dev(en_dev, &bnxt_re_ulp_ops, rdev);
391+
rc = bnxt_register_dev(en_dev, &bnxt_re_ulp_ops, rdev->adev);
378392
if (!rc)
379393
rdev->qplib_res.pdev = rdev->en_dev->pdev;
380394
return rc;

0 commit comments

Comments
 (0)