.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com> |
---|
3 | 4 | <http://rt2x00.serialmonkey.com> |
---|
4 | 5 | |
---|
5 | | - This program is free software; you can redistribute it and/or modify |
---|
6 | | - it under the terms of the GNU General Public License as published by |
---|
7 | | - the Free Software Foundation; either version 2 of the License, or |
---|
8 | | - (at your option) any later version. |
---|
9 | | - |
---|
10 | | - This program is distributed in the hope that it will be useful, |
---|
11 | | - but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | | - GNU General Public License for more details. |
---|
14 | | - |
---|
15 | | - You should have received a copy of the GNU General Public License |
---|
16 | | - along with this program; if not, see <http://www.gnu.org/licenses/>. |
---|
17 | 6 | */ |
---|
18 | 7 | |
---|
19 | 8 | /* |
---|
.. | .. |
---|
176 | 165 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) |
---|
177 | 166 | return 0; |
---|
178 | 167 | |
---|
| 168 | + if (test_bit(DEVICE_STATE_STARTED, &rt2x00dev->flags)) { |
---|
| 169 | + /* |
---|
| 170 | + * This is special case for ieee80211_restart_hw(), otherwise |
---|
| 171 | + * mac80211 never call start() two times in row without stop(); |
---|
| 172 | + */ |
---|
| 173 | + set_bit(DEVICE_STATE_RESET, &rt2x00dev->flags); |
---|
| 174 | + rt2x00dev->ops->lib->pre_reset_hw(rt2x00dev); |
---|
| 175 | + rt2x00lib_stop(rt2x00dev); |
---|
| 176 | + } |
---|
179 | 177 | return rt2x00lib_start(rt2x00dev); |
---|
180 | 178 | } |
---|
181 | 179 | EXPORT_SYMBOL_GPL(rt2x00mac_start); |
---|
.. | .. |
---|
190 | 188 | rt2x00lib_stop(rt2x00dev); |
---|
191 | 189 | } |
---|
192 | 190 | EXPORT_SYMBOL_GPL(rt2x00mac_stop); |
---|
| 191 | + |
---|
| 192 | +void |
---|
| 193 | +rt2x00mac_reconfig_complete(struct ieee80211_hw *hw, |
---|
| 194 | + enum ieee80211_reconfig_type reconfig_type) |
---|
| 195 | +{ |
---|
| 196 | + struct rt2x00_dev *rt2x00dev = hw->priv; |
---|
| 197 | + |
---|
| 198 | + if (reconfig_type == IEEE80211_RECONFIG_TYPE_RESTART) |
---|
| 199 | + clear_bit(DEVICE_STATE_RESET, &rt2x00dev->flags); |
---|
| 200 | +} |
---|
| 201 | +EXPORT_SYMBOL_GPL(rt2x00mac_reconfig_complete); |
---|
193 | 202 | |
---|
194 | 203 | int rt2x00mac_add_interface(struct ieee80211_hw *hw, |
---|
195 | 204 | struct ieee80211_vif *vif) |
---|
.. | .. |
---|
459 | 468 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) |
---|
460 | 469 | return 0; |
---|
461 | 470 | |
---|
462 | | - if (!rt2x00_has_cap_hw_crypto(rt2x00dev)) |
---|
| 471 | + /* The hardware can't do MFP */ |
---|
| 472 | + if (!rt2x00_has_cap_hw_crypto(rt2x00dev) || (sta && sta->mfp)) |
---|
463 | 473 | return -EOPNOTSUPP; |
---|
464 | 474 | |
---|
465 | 475 | /* |
---|
.. | .. |
---|
710 | 720 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) |
---|
711 | 721 | return; |
---|
712 | 722 | |
---|
| 723 | + set_bit(DEVICE_STATE_FLUSHING, &rt2x00dev->flags); |
---|
| 724 | + |
---|
713 | 725 | tx_queue_for_each(rt2x00dev, queue) |
---|
714 | 726 | rt2x00queue_flush_queue(queue, drop); |
---|
| 727 | + |
---|
| 728 | + clear_bit(DEVICE_STATE_FLUSHING, &rt2x00dev->flags); |
---|
715 | 729 | } |
---|
716 | 730 | EXPORT_SYMBOL_GPL(rt2x00mac_flush); |
---|
717 | 731 | |
---|