.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | Copyright (C) 2010 Willow Garage <http://www.willowgarage.com> |
---|
3 | 4 | Copyright (C) 2004 - 2010 Ivo van Doorn <IvDoorn@gmail.com> |
---|
4 | 5 | <http://rt2x00.serialmonkey.com> |
---|
5 | 6 | |
---|
6 | | - This program is free software; you can redistribute it and/or modify |
---|
7 | | - it under the terms of the GNU General Public License as published by |
---|
8 | | - the Free Software Foundation; either version 2 of the License, or |
---|
9 | | - (at your option) any later version. |
---|
10 | | - |
---|
11 | | - This program is distributed in the hope that it will be useful, |
---|
12 | | - but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | | - GNU General Public License for more details. |
---|
15 | | - |
---|
16 | | - You should have received a copy of the GNU General Public License |
---|
17 | | - along with this program; if not, see <http://www.gnu.org/licenses/>. |
---|
18 | 7 | */ |
---|
19 | 8 | |
---|
20 | 9 | /* |
---|
.. | .. |
---|
382 | 371 | IEEE80211_TX_CTL_AMPDU; |
---|
383 | 372 | tx_info->status.ampdu_len = 1; |
---|
384 | 373 | tx_info->status.ampdu_ack_len = success ? 1 : 0; |
---|
385 | | - |
---|
386 | | - if (!success) |
---|
387 | | - tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; |
---|
388 | 374 | } |
---|
389 | 375 | |
---|
390 | 376 | if (rate_flags & IEEE80211_TX_RC_USE_RTS_CTS) { |
---|
.. | .. |
---|
1007 | 993 | const char *mac_addr; |
---|
1008 | 994 | |
---|
1009 | 995 | mac_addr = of_get_mac_address(rt2x00dev->dev->of_node); |
---|
1010 | | - if (mac_addr) |
---|
| 996 | + if (!IS_ERR(mac_addr)) |
---|
1011 | 997 | ether_addr_copy(eeprom_mac_addr, mac_addr); |
---|
1012 | 998 | |
---|
1013 | 999 | if (!is_valid_ether_addr(eeprom_mac_addr)) { |
---|
.. | .. |
---|
1181 | 1167 | */ |
---|
1182 | 1168 | #define RT2X00_TASKLET_INIT(taskletname) \ |
---|
1183 | 1169 | if (rt2x00dev->ops->lib->taskletname) { \ |
---|
1184 | | - tasklet_init(&rt2x00dev->taskletname, \ |
---|
1185 | | - rt2x00dev->ops->lib->taskletname, \ |
---|
1186 | | - (unsigned long)rt2x00dev); \ |
---|
| 1170 | + tasklet_setup(&rt2x00dev->taskletname, \ |
---|
| 1171 | + rt2x00dev->ops->lib->taskletname); \ |
---|
1187 | 1172 | } |
---|
1188 | 1173 | |
---|
1189 | 1174 | RT2X00_TASKLET_INIT(txstatus_tasklet); |
---|
.. | .. |
---|
1267 | 1252 | |
---|
1268 | 1253 | int rt2x00lib_start(struct rt2x00_dev *rt2x00dev) |
---|
1269 | 1254 | { |
---|
1270 | | - int retval; |
---|
1271 | | - |
---|
1272 | | - if (test_bit(DEVICE_STATE_STARTED, &rt2x00dev->flags)) |
---|
1273 | | - return 0; |
---|
| 1255 | + int retval = 0; |
---|
1274 | 1256 | |
---|
1275 | 1257 | /* |
---|
1276 | 1258 | * If this is the first interface which is added, |
---|
.. | .. |
---|
1278 | 1260 | */ |
---|
1279 | 1261 | retval = rt2x00lib_load_firmware(rt2x00dev); |
---|
1280 | 1262 | if (retval) |
---|
1281 | | - return retval; |
---|
| 1263 | + goto out; |
---|
1282 | 1264 | |
---|
1283 | 1265 | /* |
---|
1284 | 1266 | * Initialize the device. |
---|
1285 | 1267 | */ |
---|
1286 | 1268 | retval = rt2x00lib_initialize(rt2x00dev); |
---|
1287 | 1269 | if (retval) |
---|
1288 | | - return retval; |
---|
| 1270 | + goto out; |
---|
1289 | 1271 | |
---|
1290 | 1272 | rt2x00dev->intf_ap_count = 0; |
---|
1291 | 1273 | rt2x00dev->intf_sta_count = 0; |
---|
.. | .. |
---|
1294 | 1276 | /* Enable the radio */ |
---|
1295 | 1277 | retval = rt2x00lib_enable_radio(rt2x00dev); |
---|
1296 | 1278 | if (retval) |
---|
1297 | | - return retval; |
---|
| 1279 | + goto out; |
---|
1298 | 1280 | |
---|
1299 | 1281 | set_bit(DEVICE_STATE_STARTED, &rt2x00dev->flags); |
---|
1300 | 1282 | |
---|
1301 | | - return 0; |
---|
| 1283 | +out: |
---|
| 1284 | + return retval; |
---|
1302 | 1285 | } |
---|
1303 | 1286 | |
---|
1304 | 1287 | void rt2x00lib_stop(struct rt2x00_dev *rt2x00dev) |
---|
.. | .. |
---|
1391 | 1374 | mutex_init(&rt2x00dev->conf_mutex); |
---|
1392 | 1375 | INIT_LIST_HEAD(&rt2x00dev->bar_list); |
---|
1393 | 1376 | spin_lock_init(&rt2x00dev->bar_list_lock); |
---|
| 1377 | + hrtimer_init(&rt2x00dev->txstatus_timer, CLOCK_MONOTONIC, |
---|
| 1378 | + HRTIMER_MODE_REL); |
---|
1394 | 1379 | |
---|
1395 | 1380 | set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); |
---|
1396 | 1381 | |
---|
.. | .. |
---|
1515 | 1500 | cancel_delayed_work_sync(&rt2x00dev->autowakeup_work); |
---|
1516 | 1501 | cancel_work_sync(&rt2x00dev->sleep_work); |
---|
1517 | 1502 | |
---|
| 1503 | + hrtimer_cancel(&rt2x00dev->txstatus_timer); |
---|
| 1504 | + |
---|
1518 | 1505 | /* |
---|
1519 | 1506 | * Kill the tx status tasklet. |
---|
1520 | 1507 | */ |
---|
.. | .. |
---|
1568 | 1555 | /* |
---|
1569 | 1556 | * Device state handlers |
---|
1570 | 1557 | */ |
---|
1571 | | -#ifdef CONFIG_PM |
---|
1572 | | -int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev, pm_message_t state) |
---|
| 1558 | +int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev) |
---|
1573 | 1559 | { |
---|
1574 | 1560 | rt2x00_dbg(rt2x00dev, "Going to sleep\n"); |
---|
1575 | 1561 | |
---|
.. | .. |
---|
1626 | 1612 | return 0; |
---|
1627 | 1613 | } |
---|
1628 | 1614 | EXPORT_SYMBOL_GPL(rt2x00lib_resume); |
---|
1629 | | -#endif /* CONFIG_PM */ |
---|
1630 | 1615 | |
---|
1631 | 1616 | /* |
---|
1632 | 1617 | * rt2x00lib module information. |
---|