@@ -83,6 +83,7 @@ static int bnxt_re_netdev_event(struct notifier_block *notifier,
83
83
unsigned long event , void * ptr );
84
84
static struct bnxt_re_dev * bnxt_re_from_netdev (struct net_device * netdev );
85
85
static void bnxt_re_dev_uninit (struct bnxt_re_dev * rdev );
86
+ static int bnxt_re_hwrm_qcaps (struct bnxt_re_dev * rdev );
86
87
87
88
static void bnxt_re_set_drv_mode (struct bnxt_re_dev * rdev , u8 mode )
88
89
{
@@ -91,6 +92,9 @@ static void bnxt_re_set_drv_mode(struct bnxt_re_dev *rdev, u8 mode)
91
92
cctx = rdev -> chip_ctx ;
92
93
cctx -> modes .wqe_mode = bnxt_qplib_is_chip_gen_p5 (rdev -> chip_ctx ) ?
93
94
mode : BNXT_QPLIB_WQE_MODE_STATIC ;
95
+ if (bnxt_re_hwrm_qcaps (rdev ))
96
+ dev_err (rdev_to_dev (rdev ),
97
+ "Failed to query hwrm qcaps\n" );
94
98
}
95
99
96
100
static void bnxt_re_destroy_chip_ctx (struct bnxt_re_dev * rdev )
@@ -339,6 +343,23 @@ static void bnxt_re_fill_fw_msg(struct bnxt_fw_msg *fw_msg, void *msg,
339
343
fw_msg -> timeout = timeout ;
340
344
}
341
345
346
+ /* Query function capabilities using common hwrm */
347
+ int bnxt_re_hwrm_qcaps (struct bnxt_re_dev * rdev )
348
+ {
349
+ struct bnxt_en_dev * en_dev = rdev -> en_dev ;
350
+ struct hwrm_func_qcaps_output resp = {};
351
+ struct hwrm_func_qcaps_input req = {};
352
+ struct bnxt_qplib_chip_ctx * cctx ;
353
+ struct bnxt_fw_msg fw_msg = {};
354
+
355
+ cctx = rdev -> chip_ctx ;
356
+ bnxt_re_init_hwrm_hdr ((void * )& req , HWRM_FUNC_QCAPS );
357
+ req .fid = cpu_to_le16 (0xffff );
358
+ bnxt_re_fill_fw_msg (& fw_msg , (void * )& req , sizeof (req ), (void * )& resp ,
359
+ sizeof (resp ), DFLT_HWRM_CMD_TIMEOUT );
360
+ return bnxt_send_msg (en_dev , & fw_msg );
361
+ }
362
+
342
363
static int bnxt_re_net_ring_free (struct bnxt_re_dev * rdev ,
343
364
u16 fw_ring_id , int type )
344
365
{
0 commit comments