@@ -339,6 +339,10 @@ enum hnae3_dbg_cmd {
339
339
HNAE3_DBG_CMD_UNKNOWN ,
340
340
};
341
341
342
+ #define hnae3_seq_file_to_ae_dev (s ) (dev_get_drvdata((s)->private))
343
+ #define hnae3_seq_file_to_handle (s ) \
344
+ (((struct hnae3_ae_dev *)hnae3_seq_file_to_ae_dev(s))->handle)
345
+
342
346
enum hnae3_tc_map_mode {
343
347
HNAE3_TC_MAP_MODE_PRIO ,
344
348
HNAE3_TC_MAP_MODE_DSCP ,
@@ -434,8 +438,11 @@ struct hnae3_ae_dev {
434
438
u32 dev_version ;
435
439
DECLARE_BITMAP (caps , HNAE3_DEV_CAPS_MAX_NUM );
436
440
void * priv ;
441
+ struct hnae3_handle * handle ;
437
442
};
438
443
444
+ typedef int (* read_func )(struct seq_file * s , void * data );
445
+
439
446
/* This struct defines the operation on the handle.
440
447
*
441
448
* init_ae_dev(): (mandatory)
@@ -580,8 +587,6 @@ struct hnae3_ae_dev {
580
587
* Delete clsflower rule
581
588
* cls_flower_active
582
589
* Check if any cls flower rule exist
583
- * dbg_read_cmd
584
- * Execute debugfs read command.
585
590
* set_tx_hwts_info
586
591
* Save information for 1588 tx packet
587
592
* get_rx_hwts
@@ -594,6 +599,8 @@ struct hnae3_ae_dev {
594
599
* Get wake on lan info
595
600
* set_wol
596
601
* Config wake on lan
602
+ * dbg_get_read_func
603
+ * Return the read func for debugfs seq file
597
604
*/
598
605
struct hnae3_ae_ops {
599
606
int (* init_ae_dev )(struct hnae3_ae_dev * ae_dev );
@@ -748,8 +755,6 @@ struct hnae3_ae_ops {
748
755
void (* enable_fd )(struct hnae3_handle * handle , bool enable );
749
756
int (* add_arfs_entry )(struct hnae3_handle * handle , u16 queue_id ,
750
757
u16 flow_id , struct flow_keys * fkeys );
751
- int (* dbg_read_cmd )(struct hnae3_handle * handle , enum hnae3_dbg_cmd cmd ,
752
- char * buf , int len );
753
758
pci_ers_result_t (* handle_hw_ras_error )(struct hnae3_ae_dev * ae_dev );
754
759
bool (* get_hw_reset_stat )(struct hnae3_handle * handle );
755
760
bool (* ae_dev_resetting )(struct hnae3_handle * handle );
@@ -796,6 +801,9 @@ struct hnae3_ae_ops {
796
801
struct ethtool_wolinfo * wol );
797
802
int (* set_wol )(struct hnae3_handle * handle ,
798
803
struct ethtool_wolinfo * wol );
804
+ int (* dbg_get_read_func )(struct hnae3_handle * handle ,
805
+ enum hnae3_dbg_cmd cmd ,
806
+ read_func * func );
799
807
};
800
808
801
809
struct hnae3_dcb_ops {
0 commit comments