File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -460,6 +460,17 @@ static inline int gdr_use_persistent_mapping(void)
460
460
461
461
//-----------------------------------------------------------------------------
462
462
463
+ static inline int gdr_support_force_pcie (void )
464
+ {
465
+ #ifdef NVIDIA_P2P_FLAGS_FORCE_BAR1_MAPPING
466
+ return gdr_use_persistent_mapping ();
467
+ #else
468
+ return 0 ;
469
+ #endif
470
+ }
471
+
472
+ //-----------------------------------------------------------------------------
473
+
463
474
static int gdrdrv_open (struct inode * inode , struct file * filp )
464
475
{
465
476
unsigned int minor = MINOR (inode -> i_rdev );
@@ -1201,11 +1212,7 @@ static int gdrdrv_get_attr(gdr_info_t *info, void __user *_params)
1201
1212
params .val = gdr_use_persistent_mapping ();
1202
1213
break ;
1203
1214
case GDRDRV_ATTR_SUPPORT_PIN_FLAG_FORCE_PCIE :
1204
- #ifdef NVIDIA_P2P_FLAGS_FORCE_BAR1_MAPPING
1205
- params .val = 1 ;
1206
- #else
1207
- params .val = 0 ;
1208
- #endif
1215
+ params .val = gdr_support_force_pcie ();
1209
1216
break ;
1210
1217
default :
1211
1218
ret = - EINVAL ;
You can’t perform that action at this time.
0 commit comments