Lines Matching refs:sta_id

37 static int iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id)  in iwl_sta_ucode_activate()  argument
41 if (sta_id >= IWLAGN_STATION_COUNT) { in iwl_sta_ucode_activate()
42 IWL_ERR(priv, "invalid sta_id %u\n", sta_id); in iwl_sta_ucode_activate()
45 if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE)) in iwl_sta_ucode_activate()
48 sta_id, priv->stations[sta_id].sta.sta.addr); in iwl_sta_ucode_activate()
50 if (priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE) { in iwl_sta_ucode_activate()
54 sta_id, priv->stations[sta_id].sta.sta.addr); in iwl_sta_ucode_activate()
56 priv->stations[sta_id].used |= IWL_STA_UCODE_ACTIVE; in iwl_sta_ucode_activate()
58 sta_id, priv->stations[sta_id].sta.sta.addr); in iwl_sta_ucode_activate()
68 u8 sta_id = addsta->sta.sta_id; in iwl_process_add_sta_resp() local
78 sta_id); in iwl_process_add_sta_resp()
85 ret = iwl_sta_ucode_activate(priv, sta_id); in iwl_process_add_sta_resp()
89 sta_id); in iwl_process_add_sta_resp()
93 "resource.\n", sta_id); in iwl_process_add_sta_resp()
97 sta_id); in iwl_process_add_sta_resp()
106 priv->stations[sta_id].sta.mode == in iwl_process_add_sta_resp()
108 sta_id, priv->stations[sta_id].sta.sta.addr); in iwl_process_add_sta_resp()
119 priv->stations[sta_id].sta.mode == in iwl_process_add_sta_resp()
148 u8 sta_id __maybe_unused = sta->sta.sta_id; in iwl_send_add_sta()
151 sta_id, sta->sta.addr, flags & CMD_ASYNC ? "a" : ""); in iwl_send_add_sta()
244 u8 sta_id = iwl_sta_id(sta); in iwl_sta_update_ht() local
248 if (WARN_ON_ONCE(sta_id == IWL_INVALID_STATION)) in iwl_sta_update_ht()
254 priv->stations[sta_id].sta.station_flags &= ~mask; in iwl_sta_update_ht()
255 priv->stations[sta_id].sta.station_flags |= flags; in iwl_sta_update_ht()
262 cmd.sta.sta_id = sta_id; in iwl_sta_update_ht()
290 u8 sta_id = IWL_INVALID_STATION; in iwl_prep_station() local
293 sta_id = ctx->ap_sta_id; in iwl_prep_station()
295 sta_id = ctx->bcast_sta_id; in iwl_prep_station()
300 sta_id = i; in iwl_prep_station()
305 sta_id == IWL_INVALID_STATION) in iwl_prep_station()
306 sta_id = i; in iwl_prep_station()
313 if (unlikely(sta_id == IWL_INVALID_STATION)) in iwl_prep_station()
314 return sta_id; in iwl_prep_station()
321 if (priv->stations[sta_id].used & IWL_STA_UCODE_INPROGRESS) { in iwl_prep_station()
323 "added.\n", sta_id); in iwl_prep_station()
324 return sta_id; in iwl_prep_station()
327 if ((priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE) && in iwl_prep_station()
328 (priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE) && in iwl_prep_station()
329 ether_addr_equal(priv->stations[sta_id].sta.sta.addr, addr)) { in iwl_prep_station()
331 "adding again.\n", sta_id, addr); in iwl_prep_station()
332 return sta_id; in iwl_prep_station()
335 station = &priv->stations[sta_id]; in iwl_prep_station()
338 sta_id, addr); in iwl_prep_station()
345 station->sta.sta.sta_id = sta_id; in iwl_prep_station()
361 iwl_set_ht_add_station(priv, sta_id, sta, ctx); in iwl_prep_station()
363 return sta_id; in iwl_prep_station()
377 u8 sta_id; in iwl_add_station_common() local
382 sta_id = iwl_prep_station(priv, ctx, addr, is_ap, sta); in iwl_add_station_common()
383 if (sta_id == IWL_INVALID_STATION) { in iwl_add_station_common()
395 if (priv->stations[sta_id].used & IWL_STA_UCODE_INPROGRESS) { in iwl_add_station_common()
397 "added.\n", sta_id); in iwl_add_station_common()
402 if ((priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE) && in iwl_add_station_common()
403 (priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE)) { in iwl_add_station_common()
405 "adding again.\n", sta_id, addr); in iwl_add_station_common()
410 priv->stations[sta_id].used |= IWL_STA_UCODE_INPROGRESS; in iwl_add_station_common()
411 memcpy(&sta_cmd, &priv->stations[sta_id].sta, in iwl_add_station_common()
420 priv->stations[sta_id].sta.sta.addr); in iwl_add_station_common()
421 priv->stations[sta_id].used &= ~IWL_STA_DRIVER_ACTIVE; in iwl_add_station_common()
422 priv->stations[sta_id].used &= ~IWL_STA_UCODE_INPROGRESS; in iwl_add_station_common()
425 *sta_id_r = sta_id; in iwl_add_station_common()
432 static void iwl_sta_ucode_deactivate(struct iwl_priv *priv, u8 sta_id) in iwl_sta_ucode_deactivate() argument
437 if ((priv->stations[sta_id].used & in iwl_sta_ucode_deactivate()
440 IWL_ERR(priv, "removed non active STA %u\n", sta_id); in iwl_sta_ucode_deactivate()
442 priv->stations[sta_id].used &= ~IWL_STA_UCODE_ACTIVE; in iwl_sta_ucode_deactivate()
444 memset(&priv->stations[sta_id], 0, sizeof(struct iwl_station_entry)); in iwl_sta_ucode_deactivate()
445 IWL_DEBUG_ASSOC(priv, "Removed STA %u\n", sta_id); in iwl_sta_ucode_deactivate()
449 const u8 *addr, int sta_id, in iwl_send_remove_station() argument
486 iwl_sta_ucode_deactivate(priv, sta_id); in iwl_send_remove_station()
505 int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id, in iwl_remove_station() argument
523 sta_id, addr); in iwl_remove_station()
525 if (WARN_ON(sta_id == IWL_INVALID_STATION)) in iwl_remove_station()
530 if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE)) { in iwl_remove_station()
536 if (!(priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE)) { in iwl_remove_station()
542 if (priv->stations[sta_id].used & IWL_STA_LOCAL) { in iwl_remove_station()
543 kfree(priv->stations[sta_id].lq); in iwl_remove_station()
544 priv->stations[sta_id].lq = NULL; in iwl_remove_station()
548 memset(&priv->tid_data[sta_id][tid], 0, in iwl_remove_station()
549 sizeof(priv->tid_data[sta_id][tid])); in iwl_remove_station()
551 priv->stations[sta_id].used &= ~IWL_STA_DRIVER_ACTIVE; in iwl_remove_station()
560 return iwl_send_remove_station(priv, addr, sta_id, false); in iwl_remove_station()
566 void iwl_deactivate_station(struct iwl_priv *priv, const u8 sta_id, in iwl_deactivate_station() argument
578 IWL_DEBUG_ASSOC(priv, "Deactivating STA: %pM (%d)\n", addr, sta_id); in iwl_deactivate_station()
580 if (WARN_ON_ONCE(sta_id == IWL_INVALID_STATION)) in iwl_deactivate_station()
585 WARN_ON_ONCE(!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE)); in iwl_deactivate_station()
588 memset(&priv->tid_data[sta_id][tid], 0, in iwl_deactivate_station()
589 sizeof(priv->tid_data[sta_id][tid])); in iwl_deactivate_station()
591 priv->stations[sta_id].used &= ~IWL_STA_DRIVER_ACTIVE; in iwl_deactivate_station()
592 priv->stations[sta_id].used &= ~IWL_STA_UCODE_INPROGRESS; in iwl_deactivate_station()
603 u8 sta_id, struct iwl_link_quality_cmd *link_cmd) in iwl_sta_fill_lq() argument
649 link_cmd->sta_id = sta_id; in iwl_sta_fill_lq()
808 IWL_DEBUG_RATE(priv, "lq station id 0x%x\n", lq->sta_id); in iwl_dump_lq_cmd()
879 if (WARN_ON(lq->sta_id == IWL_INVALID_STATION)) in iwl_send_lq_cmd()
884 if (!(priv->stations[lq->sta_id].used & IWL_STA_DRIVER_ACTIVE)) { in iwl_send_lq_cmd()
905 lq->sta_id); in iwl_send_lq_cmd()
907 priv->stations[lq->sta_id].used &= ~IWL_STA_UCODE_INPROGRESS; in iwl_send_lq_cmd()
916 u8 sta_id) in iwl_sta_alloc_lq() argument
926 iwl_sta_fill_lq(priv, ctx, sta_id, link_cmd); in iwl_sta_alloc_lq()
941 u8 sta_id; in iwlagn_add_bssid_station() local
947 ret = iwl_add_station_common(priv, ctx, addr, 0, NULL, &sta_id); in iwlagn_add_bssid_station()
954 *sta_id_r = sta_id; in iwlagn_add_bssid_station()
957 priv->stations[sta_id].used |= IWL_STA_LOCAL; in iwlagn_add_bssid_station()
961 link_cmd = iwl_sta_alloc_lq(priv, ctx, sta_id); in iwlagn_add_bssid_station()
974 priv->stations[sta_id].lq = link_cmd; in iwlagn_add_bssid_station()
1132 u8 sta_id, u32 tkip_iv32, u16 *tkip_p1k, in iwlagn_send_sta_key() argument
1140 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(sta_cmd)); in iwlagn_send_sta_key()
1188 u8 sta_id = iwlagn_key_sta_id(priv, vif, sta); in iwl_update_tkip_key() local
1190 if (sta_id == IWL_INVALID_STATION) in iwl_update_tkip_key()
1199 iwlagn_send_sta_key(priv, keyconf, sta_id, in iwl_update_tkip_key()
1209 u8 sta_id = iwlagn_key_sta_id(priv, ctx->vif, sta); in iwl_remove_dynamic_key() local
1213 if (sta_id == IWL_INVALID_STATION) in iwl_remove_dynamic_key()
1217 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(sta_cmd)); in iwl_remove_dynamic_key()
1218 if (!(priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE)) in iwl_remove_dynamic_key()
1219 sta_id = IWL_INVALID_STATION; in iwl_remove_dynamic_key()
1222 if (sta_id == IWL_INVALID_STATION) in iwl_remove_dynamic_key()
1230 keyconf->keyidx, sta_id); in iwl_remove_dynamic_key()
1259 u8 sta_id = iwlagn_key_sta_id(priv, ctx->vif, sta); in iwl_set_dynamic_key() local
1262 if (sta_id == IWL_INVALID_STATION) in iwl_set_dynamic_key()
1283 ret = iwlagn_send_sta_key(priv, keyconf, sta_id, in iwl_set_dynamic_key()
1289 ret = iwlagn_send_sta_key(priv, keyconf, sta_id, in iwl_set_dynamic_key()
1320 u8 sta_id; in iwlagn_alloc_bcast_station() local
1323 sta_id = iwl_prep_station(priv, ctx, iwl_bcast_addr, false, NULL); in iwlagn_alloc_bcast_station()
1324 if (sta_id == IWL_INVALID_STATION) { in iwlagn_alloc_bcast_station()
1331 priv->stations[sta_id].used |= IWL_STA_DRIVER_ACTIVE; in iwlagn_alloc_bcast_station()
1332 priv->stations[sta_id].used |= IWL_STA_BCAST; in iwlagn_alloc_bcast_station()
1335 link_cmd = iwl_sta_alloc_lq(priv, ctx, sta_id); in iwlagn_alloc_bcast_station()
1343 priv->stations[sta_id].lq = link_cmd; in iwlagn_alloc_bcast_station()
1359 u8 sta_id = ctx->bcast_sta_id; in iwl_update_bcast_station() local
1361 link_cmd = iwl_sta_alloc_lq(priv, ctx, sta_id); in iwl_update_bcast_station()
1368 if (priv->stations[sta_id].lq) in iwl_update_bcast_station()
1369 kfree(priv->stations[sta_id].lq); in iwl_update_bcast_station()
1372 priv->stations[sta_id].lq = link_cmd; in iwl_update_bcast_station()
1395 int iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid) in iwl_sta_tx_modify_enable_tid() argument
1403 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_TID_DISABLE_TX; in iwl_sta_tx_modify_enable_tid()
1404 priv->stations[sta_id].sta.tid_disable_tx &= cpu_to_le16(~(1 << tid)); in iwl_sta_tx_modify_enable_tid()
1405 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; in iwl_sta_tx_modify_enable_tid()
1406 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(struct iwl_addsta_cmd)); in iwl_sta_tx_modify_enable_tid()
1415 int sta_id; in iwl_sta_rx_agg_start() local
1420 sta_id = iwl_sta_id(sta); in iwl_sta_rx_agg_start()
1421 if (sta_id == IWL_INVALID_STATION) in iwl_sta_rx_agg_start()
1425 priv->stations[sta_id].sta.station_flags_msk = 0; in iwl_sta_rx_agg_start()
1426 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_ADDBA_TID_MSK; in iwl_sta_rx_agg_start()
1427 priv->stations[sta_id].sta.add_immediate_ba_tid = (u8)tid; in iwl_sta_rx_agg_start()
1428 priv->stations[sta_id].sta.add_immediate_ba_ssn = cpu_to_le16(ssn); in iwl_sta_rx_agg_start()
1429 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; in iwl_sta_rx_agg_start()
1430 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(struct iwl_addsta_cmd)); in iwl_sta_rx_agg_start()
1439 int sta_id; in iwl_sta_rx_agg_stop() local
1444 sta_id = iwl_sta_id(sta); in iwl_sta_rx_agg_stop()
1445 if (sta_id == IWL_INVALID_STATION) { in iwl_sta_rx_agg_stop()
1451 priv->stations[sta_id].sta.station_flags_msk = 0; in iwl_sta_rx_agg_stop()
1452 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_DELBA_TID_MSK; in iwl_sta_rx_agg_stop()
1453 priv->stations[sta_id].sta.remove_immediate_ba_tid = (u8)tid; in iwl_sta_rx_agg_stop()
1454 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; in iwl_sta_rx_agg_stop()
1455 memcpy(&sta_cmd, &priv->stations[sta_id].sta, sizeof(struct iwl_addsta_cmd)); in iwl_sta_rx_agg_stop()
1463 void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt) in iwl_sta_modify_sleep_tx_count() argument
1469 .sta.sta_id = sta_id, in iwl_sta_modify_sleep_tx_count()