Skip to content

Commit

Permalink
fix: correct the logic error when building with Rockchip 6.1 kernel
Browse files Browse the repository at this point in the history
Thanks @amazingfate for pointing this out.

Ref: radxa-pkg@75f304c#commitcomment-140897806

Signed-off-by: ZHANG Yuntian <[email protected]>
  • Loading branch information
RadxaYuntian committed Apr 12, 2024
1 parent c709f65 commit 147eab9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions debian/patches/fix-linux-6.1-build.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ index 107e151..a8d2e05 100644
__func__);
wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
+ /* From kernel 6.5.0, this bit is removed and will be reused later */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) || !IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) */
wiphy_apply_custom_regulatory(wiphy, regdomain);
Expand All @@ -19,7 +19,7 @@ index 107e151..a8d2e05 100644
wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
- wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+ /* From kernel 6.5.0, this bit is removed and will be reused later */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) || !IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
+ wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) */
wiphy_apply_custom_regulatory(wiphy, &rwnx_regdom);
Expand All @@ -31,7 +31,7 @@ index 107e151..a8d2e05 100644

- wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+ /* From kernel 6.5.0, this bit is removed and will be reused later */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) || !IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
+ wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) */
wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED;
Expand All @@ -46,7 +46,7 @@ index 4aa6eba..3d16e63 100644
__func__);
wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
+ /* From kernel 6.5.0, this bit is removed and will be reused later */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) || !IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) */
wiphy_apply_custom_regulatory(wiphy, regdomain);
Expand All @@ -58,7 +58,7 @@ index 4aa6eba..3d16e63 100644
wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
- wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+ /* From kernel 6.5.0, this bit is removed and will be reused later */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) || !IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
+ wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) */
wiphy_apply_custom_regulatory(wiphy, &rwnx_regdom);
Expand All @@ -72,7 +72,7 @@ index 4aa6eba..3d16e63 100644
- wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+
+ /* From kernel 6.5.0, this bit is removed and will be reused later */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) || !IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
+ wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) */
wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED;
Expand All @@ -87,7 +87,7 @@ index 146bba6..a4befec 100644
__func__);
wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
+ /* From kernel 6.5.0, this bit is removed and will be reused later */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) || !IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) */
wiphy_apply_custom_regulatory(wiphy, regdomain);
Expand All @@ -98,7 +98,7 @@ index 146bba6..a4befec 100644

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
+ /* From kernel 6.5.0, this bit is removed and will be reused later */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) || !IS_ENABLED(CONFIG_ROCKCHIP_RKNPU))
wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) */
wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED;
Expand Down

0 comments on commit 147eab9

Please sign in to comment.