| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /****************************************************************************** |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. |
|---|
| 4 | 5 | * |
|---|
| 5 | 6 | * Portions of this file are derived from the ipw3945 project, as well |
|---|
| 6 | 7 | * as portions of the ieee80211 subsystem header files. |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 9 | | - * under the terms of version 2 of the GNU General Public License as |
|---|
| 10 | | - * published by the Free Software Foundation. |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 13 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 14 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 15 | | - * more details. |
|---|
| 16 | | - * |
|---|
| 17 | | - * You should have received a copy of the GNU General Public License along with |
|---|
| 18 | | - * this program; if not, write to the Free Software Foundation, Inc., |
|---|
| 19 | | - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA |
|---|
| 20 | | - * |
|---|
| 21 | | - * The full GNU General Public License is included in this distribution in the |
|---|
| 22 | | - * file called LICENSE. |
|---|
| 23 | 8 | * |
|---|
| 24 | 9 | * Contact Information: |
|---|
| 25 | 10 | * Intel Linux Wireless <linuxwifi@intel.com> |
|---|
| .. | .. |
|---|
| 249 | 234 | priv->stations[index].sta.station_flags |= flags; |
|---|
| 250 | 235 | } |
|---|
| 251 | 236 | |
|---|
| 252 | | -/** |
|---|
| 237 | +/* |
|---|
| 253 | 238 | * iwl_prep_station - Prepare station information for addition |
|---|
| 254 | 239 | * |
|---|
| 255 | 240 | * should be called with sta_lock held |
|---|
| .. | .. |
|---|
| 338 | 323 | |
|---|
| 339 | 324 | #define STA_WAIT_TIMEOUT (HZ/2) |
|---|
| 340 | 325 | |
|---|
| 341 | | -/** |
|---|
| 326 | +/* |
|---|
| 342 | 327 | * iwl_add_station_common - |
|---|
| 343 | 328 | */ |
|---|
| 344 | 329 | int iwl_add_station_common(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
|---|
| .. | .. |
|---|
| 398 | 383 | return ret; |
|---|
| 399 | 384 | } |
|---|
| 400 | 385 | |
|---|
| 401 | | -/** |
|---|
| 386 | +/* |
|---|
| 402 | 387 | * iwl_sta_ucode_deactivate - deactivate ucode status for a station |
|---|
| 403 | 388 | */ |
|---|
| 404 | 389 | static void iwl_sta_ucode_deactivate(struct iwl_priv *priv, u8 sta_id) |
|---|
| .. | .. |
|---|
| 466 | 451 | return ret; |
|---|
| 467 | 452 | } |
|---|
| 468 | 453 | |
|---|
| 469 | | -/** |
|---|
| 454 | +/* |
|---|
| 470 | 455 | * iwl_remove_station - Remove driver's knowledge of station. |
|---|
| 471 | 456 | */ |
|---|
| 472 | 457 | int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id, |
|---|
| .. | .. |
|---|
| 616 | 601 | link_cmd->sta_id = sta_id; |
|---|
| 617 | 602 | } |
|---|
| 618 | 603 | |
|---|
| 619 | | -/** |
|---|
| 604 | +/* |
|---|
| 620 | 605 | * iwl_clear_ucode_stations - clear ucode station table bits |
|---|
| 621 | 606 | * |
|---|
| 622 | 607 | * This function clears all the bits in the driver indicating |
|---|
| .. | .. |
|---|
| 651 | 636 | "No active stations found to be cleared\n"); |
|---|
| 652 | 637 | } |
|---|
| 653 | 638 | |
|---|
| 654 | | -/** |
|---|
| 639 | +/* |
|---|
| 655 | 640 | * iwl_restore_stations() - Restore driver known stations to device |
|---|
| 656 | 641 | * |
|---|
| 657 | 642 | * All stations considered active by driver, but not present in ucode, is |
|---|
| .. | .. |
|---|
| 788 | 773 | } |
|---|
| 789 | 774 | #endif |
|---|
| 790 | 775 | |
|---|
| 791 | | -/** |
|---|
| 776 | +/* |
|---|
| 792 | 777 | * is_lq_table_valid() - Test one aspect of LQ cmd for validity |
|---|
| 793 | 778 | * |
|---|
| 794 | 779 | * It sometimes happens when a HT rate has been in use and we |
|---|
| .. | .. |
|---|
| 822 | 807 | return true; |
|---|
| 823 | 808 | } |
|---|
| 824 | 809 | |
|---|
| 825 | | -/** |
|---|
| 810 | +/* |
|---|
| 826 | 811 | * iwl_send_lq_cmd() - Send link quality command |
|---|
| 827 | 812 | * @init: This command is sent as part of station initialization right |
|---|
| 828 | 813 | * after station has been added. |
|---|
| .. | .. |
|---|
| 1101 | 1086 | { |
|---|
| 1102 | 1087 | __le16 key_flags; |
|---|
| 1103 | 1088 | struct iwl_addsta_cmd sta_cmd; |
|---|
| 1089 | + size_t to_copy; |
|---|
| 1104 | 1090 | int i; |
|---|
| 1105 | 1091 | |
|---|
| 1106 | 1092 | spin_lock_bh(&priv->sta_lock); |
|---|
| .. | .. |
|---|
| 1120 | 1106 | sta_cmd.key.tkip_rx_tsc_byte2 = tkip_iv32; |
|---|
| 1121 | 1107 | for (i = 0; i < 5; i++) |
|---|
| 1122 | 1108 | sta_cmd.key.tkip_rx_ttak[i] = cpu_to_le16(tkip_p1k[i]); |
|---|
| 1123 | | - memcpy(sta_cmd.key.key, keyconf->key, keyconf->keylen); |
|---|
| 1109 | + /* keyconf may contain MIC rx/tx keys which iwl does not use */ |
|---|
| 1110 | + to_copy = min_t(size_t, sizeof(sta_cmd.key.key), keyconf->keylen); |
|---|
| 1111 | + memcpy(sta_cmd.key.key, keyconf->key, to_copy); |
|---|
| 1124 | 1112 | break; |
|---|
| 1125 | 1113 | case WLAN_CIPHER_SUITE_WEP104: |
|---|
| 1126 | 1114 | key_flags |= STA_KEY_FLG_KEY_SIZE_MSK; |
|---|
| .. | .. |
|---|
| 1273 | 1261 | return ret; |
|---|
| 1274 | 1262 | } |
|---|
| 1275 | 1263 | |
|---|
| 1276 | | -/** |
|---|
| 1264 | +/* |
|---|
| 1277 | 1265 | * iwlagn_alloc_bcast_station - add broadcast station into driver's station table. |
|---|
| 1278 | 1266 | * |
|---|
| 1279 | 1267 | * This adds the broadcast station into the driver's station table |
|---|
| .. | .. |
|---|
| 1313 | 1301 | return 0; |
|---|
| 1314 | 1302 | } |
|---|
| 1315 | 1303 | |
|---|
| 1316 | | -/** |
|---|
| 1304 | +/* |
|---|
| 1317 | 1305 | * iwl_update_bcast_station - update broadcast station's LQ command |
|---|
| 1318 | 1306 | * |
|---|
| 1319 | 1307 | * Only used by iwlagn. Placed here to have all bcast station management |
|---|
| .. | .. |
|---|
| 1356 | 1344 | return ret; |
|---|
| 1357 | 1345 | } |
|---|
| 1358 | 1346 | |
|---|
| 1359 | | -/** |
|---|
| 1347 | +/* |
|---|
| 1360 | 1348 | * iwl_sta_tx_modify_enable_tid - Enable Tx for this TID in station table |
|---|
| 1361 | 1349 | */ |
|---|
| 1362 | 1350 | int iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid) |
|---|