hulk inclusion category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I96GO9 CVE: CVE-2023-52595
--------------------------------
Fix kabi breakage in struct rt2x00lib_ops.
Fixes: 09db3b000619 ("rt2800: add pre_reset_hw callback") Signed-off-by: Pu Lehui pulehui@huawei.com --- drivers/net/wireless/ralink/rt2x00/rt2800pci.c | 6 +++++- drivers/net/wireless/ralink/rt2x00/rt2800soc.c | 6 +++++- drivers/net/wireless/ralink/rt2x00/rt2800usb.c | 6 +++++- drivers/net/wireless/ralink/rt2x00/rt2x00.h | 2 +- drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 6 +++++- 5 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c index cf730a47fb15..39c1d7356428 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c @@ -52,6 +52,11 @@ static bool modparam_nohwcrypt = false; module_param_named(nohwcrypt, modparam_nohwcrypt, bool, 0444); MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
+void rt2x00lib_pre_reset_hw(struct rt2x00_dev *rt2x00dev) +{ + rt2800_pre_reset_hw(rt2x00dev); +} + static bool rt2800pci_hwcrypt_disabled(struct rt2x00_dev *rt2x00dev) { return modparam_nohwcrypt; @@ -377,7 +382,6 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { .config_erp = rt2800_config_erp, .config_ant = rt2800_config_ant, .config = rt2800_config, - .pre_reset_hw = rt2800_pre_reset_hw, };
static const struct rt2x00_ops rt2800pci_ops = { diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c index 752604027108..6343fec502f4 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c @@ -44,6 +44,11 @@ static bool modparam_nohwcrypt; module_param_named(nohwcrypt, modparam_nohwcrypt, bool, 0444); MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
+void rt2x00lib_pre_reset_hw(struct rt2x00_dev *rt2x00dev) +{ + rt2800_pre_reset_hw(rt2x00dev); +} + static bool rt2800soc_hwcrypt_disabled(struct rt2x00_dev *rt2x00dev) { return modparam_nohwcrypt; @@ -216,7 +221,6 @@ static const struct rt2x00lib_ops rt2800soc_rt2x00_ops = { .config_erp = rt2800_config_erp, .config_ant = rt2800_config_ant, .config = rt2800_config, - .pre_reset_hw = rt2800_pre_reset_hw, };
static const struct rt2x00_ops rt2800soc_ops = { diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c index 6e31f243aab1..6dbcd1875faa 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c @@ -46,6 +46,11 @@ static bool modparam_nohwcrypt; module_param_named(nohwcrypt, modparam_nohwcrypt, bool, 0444); MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
+void rt2x00lib_pre_reset_hw(struct rt2x00_dev *rt2x00dev) +{ + rt2800_pre_reset_hw(rt2x00dev); +} + static bool rt2800usb_hwcrypt_disabled(struct rt2x00_dev *rt2x00dev) { return modparam_nohwcrypt; @@ -858,7 +863,6 @@ static const struct rt2x00lib_ops rt2800usb_rt2x00_ops = { .config_erp = rt2800_config_erp, .config_ant = rt2800_config_ant, .config = rt2800_config, - .pre_reset_hw = rt2800_pre_reset_hw, };
static void rt2800usb_queue_init(struct data_queue *queue) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00.h b/drivers/net/wireless/ralink/rt2x00/rt2x00.h index d4dfc9c147ea..8aba6ea7d4e9 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h @@ -626,7 +626,6 @@ struct rt2x00lib_ops { void (*config) (struct rt2x00_dev *rt2x00dev, struct rt2x00lib_conf *libconf, const unsigned int changed_flags); - void (*pre_reset_hw) (struct rt2x00_dev *rt2x00dev); int (*sta_add) (struct rt2x00_dev *rt2x00dev, struct ieee80211_vif *vif, struct ieee80211_sta *sta); @@ -1417,6 +1416,7 @@ static inline void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev, u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev, struct ieee80211_vif *vif); void rt2x00lib_set_mac_address(struct rt2x00_dev *rt2x00dev, u8 *eeprom_mac_addr); +void rt2x00lib_pre_reset_hw(struct rt2x00_dev *rt2x00dev);
/* * Interrupt context handlers. diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c index 5ebbd9b5607a..dc5317328b80 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c @@ -1266,6 +1266,10 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev) return 0; }
+void __weak rt2x00lib_pre_reset_hw(struct rt2x00_dev *rt2x00dev) +{ +} + int rt2x00lib_start(struct rt2x00_dev *rt2x00dev) { int retval = 0; @@ -1276,7 +1280,7 @@ int rt2x00lib_start(struct rt2x00_dev *rt2x00dev) * mac80211 never call start() two times in row without stop(); */ set_bit(DEVICE_STATE_RESET, &rt2x00dev->flags); - rt2x00dev->ops->lib->pre_reset_hw(rt2x00dev); + rt2x00lib_pre_reset_hw(rt2x00dev); rt2x00lib_stop(rt2x00dev); }