From 2771a8ce168b94e443f44edc97eeb2dce6b096eb Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 19 Jun 2012 00:53:20 +0000 Subject: mac80211: fix AP multi-BSSID support (#11698) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32448 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/mac80211/patches/300-pending_work.patch | 58 ++++++++++++++++++++++ .../522-ath9k_per_chain_signal_strength.patch | 4 +- 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/package/mac80211/patches/300-pending_work.patch b/package/mac80211/patches/300-pending_work.patch index cb219c9147..4f96a013f4 100644 --- a/package/mac80211/patches/300-pending_work.patch +++ b/package/mac80211/patches/300-pending_work.patch @@ -1544,3 +1544,61 @@ } u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate) +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -2246,6 +2246,33 @@ static int nl80211_parse_beacon(struct g + return 0; + } + ++static bool nl80211_get_ap_channel(struct cfg80211_registered_device *rdev, ++ struct cfg80211_ap_settings *params) ++{ ++ struct wireless_dev *wdev; ++ bool ret = false; ++ ++ mutex_lock(&rdev->devlist_mtx); ++ ++ list_for_each_entry(wdev, &rdev->netdev_list, list) { ++ if (wdev->iftype != NL80211_IFTYPE_AP && ++ wdev->iftype != NL80211_IFTYPE_P2P_GO) ++ continue; ++ ++ if (!wdev->preset_chan) ++ continue; ++ ++ params->channel = wdev->preset_chan; ++ params->channel_type = wdev->preset_chantype; ++ ret = true; ++ break; ++ } ++ ++ mutex_unlock(&rdev->devlist_mtx); ++ ++ return ret; ++} ++ + static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) + { + struct cfg80211_registered_device *rdev = info->user_ptr[0]; +@@ -2348,7 +2375,7 @@ static int nl80211_start_ap(struct sk_bu + } else if (wdev->preset_chan) { + params.channel = wdev->preset_chan; + params.channel_type = wdev->preset_chantype; +- } else ++ } else if (!nl80211_get_ap_channel(rdev, ¶ms)) + return -EINVAL; + + if (!cfg80211_can_beacon_sec_chan(&rdev->wiphy, params.channel, +@@ -2356,8 +2383,11 @@ static int nl80211_start_ap(struct sk_bu + return -EINVAL; + + err = rdev->ops->start_ap(&rdev->wiphy, dev, ¶ms); +- if (!err) ++ if (!err) { ++ wdev->preset_chan = params.channel; ++ wdev->preset_chantype = params.channel_type; + wdev->beacon_interval = params.beacon_interval; ++ } + return err; + } + diff --git a/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch b/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch index 40f4e62c7e..3b9cfe8752 100644 --- a/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch +++ b/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch @@ -270,7 +270,7 @@ __NL80211_STA_INFO_AFTER_LAST, --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -2523,6 +2523,33 @@ nla_put_failure: +@@ -2553,6 +2553,33 @@ nla_put_failure: return false; } @@ -304,7 +304,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq, int flags, struct cfg80211_registered_device *rdev, -@@ -2584,6 +2611,18 @@ static int nl80211_send_station(struct s +@@ -2614,6 +2641,18 @@ static int nl80211_send_station(struct s default: break; } -- cgit v1.2.3 type='hidden' name='id' value='aae7af4219e56c2787f675109d9dd1a44a5dcba4'/>
path: root/package/libs/openssl/patches/400-eng_devcrypto-save-ioctl-if-EVP_MD_.FLAG_ONESHOT.patch
blob: 84c68b16a29d468f5121f73dd6b5802e7dd0ba21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From f14345422747a495a52f9237a43b8be189f21912 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
Date: Mon, 5 Nov 2018 15:54:17 -0200
Subject: eng_devcrypto: save ioctl if EVP_MD_..FLAG_ONESHOT

Since each ioctl causes a context switch, slowing things down, if
EVP_MD_CTX_FLAG_ONESHOT is set, then:
 - call the ioctl in digest_update, saving the result; and
 - just copy the result in digest_final, instead of using another ioctl.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7585)

diff --git a/crypto/engine/eng_devcrypto.c b/crypto/engine/eng_devcrypto.c
index a727c6f646..a2c9a966f7 100644
--- a/crypto/engine/eng_devcrypto.c
+++ b/crypto/engine/eng_devcrypto.c
@@ -461,6 +461,7 @@ struct digest_ctx {
     struct session_op sess;
     /* This signals that the init function was called, not that it succeeded. */
     int init_called;
+    unsigned char digest_res[HASH_MAX_LEN];
 };
 
 static const struct digest_data_st {
@@ -564,12 +565,15 @@ static int digest_update(EVP_MD_CTX *ctx, const void *data, size_t count)
     if (digest_ctx == NULL)
         return 0;
 
-    if (digest_op(digest_ctx, data, count, NULL, COP_FLAG_UPDATE) < 0) {
-        SYSerr(SYS_F_IOCTL, errno);
-        return 0;
+    if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT)) {
+        if (digest_op(digest_ctx, data, count, digest_ctx->digest_res, 0) >= 0)
+            return 1;
+    } else if (digest_op(digest_ctx, data, count, NULL, COP_FLAG_UPDATE) >= 0) {
+        return 1;
     }
 
-    return 1;
+    SYSerr(SYS_F_IOCTL, errno);
+    return 0;
 }
 
 static int digest_final(EVP_MD_CTX *ctx, unsigned char *md)
@@ -579,7 +583,10 @@ static int digest_final(EVP_MD_CTX *ctx, unsigned char *md)
 
     if (md == NULL || digest_ctx == NULL)
         return 0;
-    if (digest_op(digest_ctx, NULL, 0, md, COP_FLAG_FINAL) < 0) {
+
+    if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT)) {
+        memcpy(md, digest_ctx->digest_res, EVP_MD_CTX_size(ctx));
+    } else if (digest_op(digest_ctx, NULL, 0, md, COP_FLAG_FINAL) < 0) {
         SYSerr(SYS_F_IOCTL, errno);
         return 0;
     }