/drivers/net/wireguard/ |
D | timers.c | 30 static inline void mod_peer_timer(struct wg_peer *peer, in mod_peer_timer() argument 35 if (likely(netif_running(peer->device->dev) && in mod_peer_timer() 36 !READ_ONCE(peer->is_dead))) in mod_peer_timer() 43 struct wg_peer *peer = from_timer(peer, timer, in wg_expired_retransmit_handshake() local 46 if (peer->timer_handshake_attempts > MAX_TIMER_HANDSHAKES) { in wg_expired_retransmit_handshake() 48 peer->device->dev->name, peer->internal_id, in wg_expired_retransmit_handshake() 49 &peer->endpoint.addr, (int)MAX_TIMER_HANDSHAKES + 2); in wg_expired_retransmit_handshake() 51 del_timer(&peer->timer_send_keepalive); in wg_expired_retransmit_handshake() 55 wg_packet_purge_staged_packets(peer); in wg_expired_retransmit_handshake() 60 if (!timer_pending(&peer->timer_zero_key_material)) in wg_expired_retransmit_handshake() [all …]
|
D | peer.c | 25 struct wg_peer *peer; in wg_peer_create() local 33 peer = kmem_cache_zalloc(peer_cache, GFP_KERNEL); in wg_peer_create() 34 if (unlikely(!peer)) in wg_peer_create() 36 if (unlikely(dst_cache_init(&peer->endpoint_cache, GFP_KERNEL))) in wg_peer_create() 39 peer->device = wg; in wg_peer_create() 40 wg_noise_handshake_init(&peer->handshake, &wg->static_identity, in wg_peer_create() 41 public_key, preshared_key, peer); in wg_peer_create() 42 peer->internal_id = atomic64_inc_return(&peer_counter); in wg_peer_create() 43 peer->serial_work_cpu = nr_cpumask_bits; in wg_peer_create() 44 wg_cookie_init(&peer->latest_cookie); in wg_peer_create() [all …]
|
D | send.c | 21 static void wg_packet_send_handshake_initiation(struct wg_peer *peer) in wg_packet_send_handshake_initiation() argument 25 if (!wg_birthdate_has_expired(atomic64_read(&peer->last_sent_handshake), in wg_packet_send_handshake_initiation() 29 atomic64_set(&peer->last_sent_handshake, ktime_get_coarse_boottime_ns()); in wg_packet_send_handshake_initiation() 31 peer->device->dev->name, peer->internal_id, in wg_packet_send_handshake_initiation() 32 &peer->endpoint.addr); in wg_packet_send_handshake_initiation() 34 if (wg_noise_handshake_create_initiation(&packet, &peer->handshake)) { in wg_packet_send_handshake_initiation() 35 wg_cookie_add_mac_to_packet(&packet, sizeof(packet), peer); in wg_packet_send_handshake_initiation() 36 wg_timers_any_authenticated_packet_traversal(peer); in wg_packet_send_handshake_initiation() 37 wg_timers_any_authenticated_packet_sent(peer); in wg_packet_send_handshake_initiation() 38 atomic64_set(&peer->last_sent_handshake, in wg_packet_send_handshake_initiation() [all …]
|
D | netlink.c | 106 get_peer(struct wg_peer *peer, struct sk_buff *skb, struct dump_ctx *ctx) in get_peer() argument 116 down_read(&peer->handshake.lock); in get_peer() 118 peer->handshake.remote_static); in get_peer() 119 up_read(&peer->handshake.lock); in get_peer() 125 .tv_sec = peer->walltime_last_handshake.tv_sec, in get_peer() 126 .tv_nsec = peer->walltime_last_handshake.tv_nsec in get_peer() 129 down_read(&peer->handshake.lock); in get_peer() 132 peer->handshake.preshared_key); in get_peer() 133 up_read(&peer->handshake.lock); in get_peer() 140 peer->persistent_keepalive_interval) || in get_peer() [all …]
|
D | receive.c | 20 static void update_rx_stats(struct wg_peer *peer, size_t len) in update_rx_stats() argument 23 get_cpu_ptr(peer->device->dev->tstats); in update_rx_stats() 28 peer->rx_bytes += len; in update_rx_stats() 103 struct wg_peer *peer = NULL; in wg_receive_handshake_packet() local 151 peer = wg_noise_handshake_consume_initiation(message, wg); in wg_receive_handshake_packet() 152 if (unlikely(!peer)) { in wg_receive_handshake_packet() 157 wg_socket_set_peer_endpoint_from_skb(peer, skb); in wg_receive_handshake_packet() 159 wg->dev->name, peer->internal_id, in wg_receive_handshake_packet() 160 &peer->endpoint.addr); in wg_receive_handshake_packet() 161 wg_packet_send_handshake_response(peer); in wg_receive_handshake_packet() [all …]
|
D | cookie.c | 61 void wg_cookie_checker_precompute_peer_keys(struct wg_peer *peer) in wg_cookie_checker_precompute_peer_keys() argument 63 precompute_key(peer->latest_cookie.cookie_decryption_key, in wg_cookie_checker_precompute_peer_keys() 64 peer->handshake.remote_static, cookie_key_label); in wg_cookie_checker_precompute_peer_keys() 65 precompute_key(peer->latest_cookie.message_mac1_key, in wg_cookie_checker_precompute_peer_keys() 66 peer->handshake.remote_static, mac1_key_label); in wg_cookie_checker_precompute_peer_keys() 157 struct wg_peer *peer) in wg_cookie_add_mac_to_packet() argument 162 down_write(&peer->latest_cookie.lock); in wg_cookie_add_mac_to_packet() 164 peer->latest_cookie.message_mac1_key); in wg_cookie_add_mac_to_packet() 165 memcpy(peer->latest_cookie.last_mac1_sent, macs->mac1, COOKIE_LEN); in wg_cookie_add_mac_to_packet() 166 peer->latest_cookie.have_sent_mac1 = true; in wg_cookie_add_mac_to_packet() [all …]
|
D | device.c | 35 struct wg_peer *peer; in wg_open() local 53 list_for_each_entry(peer, &wg->peer_list, peer_list) { in wg_open() 54 wg_packet_send_staged_packets(peer); in wg_open() 55 if (peer->persistent_keepalive_interval) in wg_open() 56 wg_packet_send_keepalive(peer); in wg_open() 68 struct wg_peer *peer; in wg_pm_notification() local 83 list_for_each_entry(peer, &wg->peer_list, peer_list) { in wg_pm_notification() 84 del_timer(&peer->timer_zero_key_material); in wg_pm_notification() 85 wg_noise_handshake_clear(&peer->handshake); in wg_pm_notification() 86 wg_noise_keypairs_clear(&peer->keypairs); in wg_pm_notification() [all …]
|
D | timers.h | 13 void wg_timers_init(struct wg_peer *peer); 14 void wg_timers_stop(struct wg_peer *peer); 15 void wg_timers_data_sent(struct wg_peer *peer); 16 void wg_timers_data_received(struct wg_peer *peer); 17 void wg_timers_any_authenticated_packet_sent(struct wg_peer *peer); 18 void wg_timers_any_authenticated_packet_received(struct wg_peer *peer); 19 void wg_timers_handshake_initiated(struct wg_peer *peer); 20 void wg_timers_handshake_complete(struct wg_peer *peer); 21 void wg_timers_session_derived(struct wg_peer *peer); 22 void wg_timers_any_authenticated_packet_traversal(struct wg_peer *peer);
|
D | peerlookup.c | 36 struct wg_peer *peer) in wg_pubkey_hashtable_add() argument 39 hlist_add_head_rcu(&peer->pubkey_hash, in wg_pubkey_hashtable_add() 40 pubkey_bucket(table, peer->handshake.remote_static)); in wg_pubkey_hashtable_add() 45 struct wg_peer *peer) in wg_pubkey_hashtable_remove() argument 48 hlist_del_init_rcu(&peer->pubkey_hash); in wg_pubkey_hashtable_remove() 57 struct wg_peer *iter_peer, *peer = NULL; in wg_pubkey_hashtable_lookup() local 64 peer = iter_peer; in wg_pubkey_hashtable_lookup() 68 peer = wg_peer_get_maybe_zero(peer); in wg_pubkey_hashtable_lookup() 70 return peer; in wg_pubkey_hashtable_lookup() 204 const __le32 index, struct wg_peer **peer) in wg_index_hashtable_lookup() argument [all …]
|
D | socket.c | 168 int wg_socket_send_skb_to_peer(struct wg_peer *peer, struct sk_buff *skb, u8 ds) in wg_socket_send_skb_to_peer() argument 173 read_lock_bh(&peer->endpoint_lock); in wg_socket_send_skb_to_peer() 174 if (peer->endpoint.addr.sa_family == AF_INET) in wg_socket_send_skb_to_peer() 175 ret = send4(peer->device, skb, &peer->endpoint, ds, in wg_socket_send_skb_to_peer() 176 &peer->endpoint_cache); in wg_socket_send_skb_to_peer() 177 else if (peer->endpoint.addr.sa_family == AF_INET6) in wg_socket_send_skb_to_peer() 178 ret = send6(peer->device, skb, &peer->endpoint, ds, in wg_socket_send_skb_to_peer() 179 &peer->endpoint_cache); in wg_socket_send_skb_to_peer() 183 peer->tx_bytes += skb_len; in wg_socket_send_skb_to_peer() 184 read_unlock_bh(&peer->endpoint_lock); in wg_socket_send_skb_to_peer() [all …]
|
D | allowedips.c | 77 if (rcu_access_pointer(node->peer)) in root_remove_peer_lists() 117 if (rcu_access_pointer(node->peer)) in find_node() 133 struct wg_peer *peer = NULL; in lookup() local 141 peer = wg_peer_get_maybe_zero(rcu_dereference_bh(node->peer)); in lookup() 142 if (!peer) in lookup() 146 return peer; in lookup() 182 u8 cidr, struct wg_peer *peer, struct mutex *lock) in add() argument 186 if (unlikely(cidr > bits || !peer)) in add() 193 RCU_INIT_POINTER(node->peer, peer); in add() 194 list_add_tail(&node->peer_list, &peer->allowedips_list); in add() [all …]
|
D | queueing.h | 39 void wg_packet_send_queued_handshake_initiation(struct wg_peer *peer, 41 void wg_packet_send_handshake_response(struct wg_peer *peer); 45 void wg_packet_send_keepalive(struct wg_peer *peer); 46 void wg_packet_purge_staged_packets(struct wg_peer *peer); 47 void wg_packet_send_staged_packets(struct wg_peer *peer); 68 #define PACKET_PEER(skb) (PACKET_CB(skb)->keypair->entry.peer) 187 struct wg_peer *peer = wg_peer_get(PACKET_PEER(skb)); in wg_queue_enqueue_per_peer_tx() local 190 queue_work_on(wg_cpumask_choose_online(&peer->serial_work_cpu, peer->internal_id), in wg_queue_enqueue_per_peer_tx() 191 peer->device->packet_crypt_wq, &peer->transmit_packet_work); in wg_queue_enqueue_per_peer_tx() 192 wg_peer_put(peer); in wg_queue_enqueue_per_peer_tx() [all …]
|
D | noise.c | 47 void wg_noise_precompute_static_static(struct wg_peer *peer) in wg_noise_precompute_static_static() argument 49 down_write(&peer->handshake.lock); in wg_noise_precompute_static_static() 50 if (!peer->handshake.static_identity->has_identity || in wg_noise_precompute_static_static() 51 !curve25519(peer->handshake.precomputed_static_static, in wg_noise_precompute_static_static() 52 peer->handshake.static_identity->static_private, in wg_noise_precompute_static_static() 53 peer->handshake.remote_static)) in wg_noise_precompute_static_static() 54 memset(peer->handshake.precomputed_static_static, 0, in wg_noise_precompute_static_static() 56 up_write(&peer->handshake.lock); in wg_noise_precompute_static_static() 63 struct wg_peer *peer) in wg_noise_handshake_init() argument 68 handshake->entry.peer = peer; in wg_noise_handshake_init() [all …]
|
/drivers/net/wireless/ath/ath11k/ |
D | peer.c | 13 struct ath11k_peer *peer; in ath11k_peer_find() local 17 list_for_each_entry(peer, &ab->peers, list) { in ath11k_peer_find() 18 if (peer->vdev_id != vdev_id) in ath11k_peer_find() 20 if (!ether_addr_equal(peer->addr, addr)) in ath11k_peer_find() 23 return peer; in ath11k_peer_find() 32 struct ath11k_peer *peer; in ath11k_peer_find_by_pdev_idx() local 36 list_for_each_entry(peer, &ab->peers, list) { in ath11k_peer_find_by_pdev_idx() 37 if (peer->pdev_idx != pdev_idx) in ath11k_peer_find_by_pdev_idx() 39 if (!ether_addr_equal(peer->addr, addr)) in ath11k_peer_find_by_pdev_idx() 42 return peer; in ath11k_peer_find_by_pdev_idx() [all …]
|
/drivers/ntb/test/ |
D | ntb_perf.c | 204 int (*cmd_send)(struct perf_peer *peer, enum perf_cmd cmd, u64 data); 249 static inline bool perf_link_is_up(struct perf_peer *peer) in perf_link_is_up() argument 253 link = ntb_link_is_up(peer->perf->ntb, NULL, NULL); in perf_link_is_up() 254 return !!(link & BIT_ULL_MASK(peer->pidx)); in perf_link_is_up() 257 static int perf_spad_cmd_send(struct perf_peer *peer, enum perf_cmd cmd, in perf_spad_cmd_send() argument 260 struct perf_ctx *perf = peer->perf; in perf_spad_cmd_send() 274 if (!perf_link_is_up(peer)) in perf_spad_cmd_send() 277 sts = ntb_peer_spad_read(perf->ntb, peer->pidx, in perf_spad_cmd_send() 284 ntb_peer_spad_write(perf->ntb, peer->pidx, in perf_spad_cmd_send() 287 ntb_peer_spad_write(perf->ntb, peer->pidx, in perf_spad_cmd_send() [all …]
|
D | ntb_msi_test.c | 131 static void ntb_msit_copy_peer_desc(struct ntb_msit_ctx *nm, int peer) in ntb_msit_copy_peer_desc() argument 134 struct ntb_msi_desc *desc = nm->peers[peer].msi_desc; in ntb_msit_copy_peer_desc() 135 int irq_count = nm->peers[peer].num_irqs; in ntb_msit_copy_peer_desc() 138 desc[i].addr_offset = ntb_peer_spad_read(nm->ntb, peer, in ntb_msit_copy_peer_desc() 140 desc[i].data = ntb_peer_spad_read(nm->ntb, peer, 2 * i + 2); in ntb_msit_copy_peer_desc() 144 irq_count, peer); in ntb_msit_copy_peer_desc() 146 complete_all(&nm->peers[peer].init_comp); in ntb_msit_copy_peer_desc() 155 int peer; in ntb_msit_db_event() local 159 for (peer = 0; peer < sizeof(peer_mask) * 8; peer++) { in ntb_msit_db_event() 160 if (!(peer_mask & BIT(peer))) in ntb_msit_db_event() [all …]
|
/drivers/net/can/ |
D | vxcan.c | 33 struct net_device __rcu *peer; member 39 struct net_device *peer; in vxcan_xmit() local 48 peer = rcu_dereference(priv->peer); in vxcan_xmit() 49 if (unlikely(!peer)) { in vxcan_xmit() 62 skb->dev = peer; in vxcan_xmit() 69 peerstats = &peer->stats; in vxcan_xmit() 83 struct net_device *peer = rtnl_dereference(priv->peer); in vxcan_open() local 85 if (!peer) in vxcan_open() 88 if (peer->flags & IFF_UP) { in vxcan_open() 90 netif_carrier_on(peer); in vxcan_open() [all …]
|
/drivers/staging/fwserial/ |
D | fwserial.c | 227 static int fwtty_send_data_async(struct fwtty_peer *peer, int tcode, in fwtty_send_data_async() argument 242 generation = peer->generation; in fwtty_send_data_async() 244 fw_send_request(peer->serial->card, &txn->fw_txn, tcode, in fwtty_send_data_async() 245 peer->node_id, generation, peer->speed, addr, payload, in fwtty_send_data_async() 250 static void fwtty_send_txn_async(struct fwtty_peer *peer, in fwtty_send_txn_async() argument 261 generation = peer->generation; in fwtty_send_txn_async() 263 fw_send_request(peer->serial->card, &txn->fw_txn, tcode, in fwtty_send_txn_async() 264 peer->node_id, generation, peer->speed, addr, payload, in fwtty_send_txn_async() 413 struct fwtty_peer *peer; in __fwtty_write_port_status() local 418 peer = rcu_dereference(port->peer); in __fwtty_write_port_status() [all …]
|
/drivers/net/wireless/ath/ath10k/ |
D | txrx.c | 140 struct ath10k_peer *peer; in ath10k_peer_find() local 144 list_for_each_entry(peer, &ar->peers, list) { in ath10k_peer_find() 145 if (peer->vdev_id != vdev_id) in ath10k_peer_find() 147 if (!ether_addr_equal(peer->addr, addr)) in ath10k_peer_find() 150 return peer; in ath10k_peer_find() 158 struct ath10k_peer *peer; in ath10k_peer_find_by_id() local 160 if (peer_id >= BITS_PER_TYPE(peer->peer_ids)) in ath10k_peer_find_by_id() 165 list_for_each_entry(peer, &ar->peers, list) in ath10k_peer_find_by_id() 166 if (test_bit(peer_id, peer->peer_ids)) in ath10k_peer_find_by_id() 167 return peer; in ath10k_peer_find_by_id() [all …]
|
/drivers/net/ |
D | veth.c | 71 struct net_device __rcu *peer; member 180 struct net_device *peer = rtnl_dereference(priv->peer); in veth_get_ethtool_stats() local 183 data[0] = peer ? peer->ifindex : 0; in veth_get_ethtool_stats() 201 if (!peer) in veth_get_ethtool_stats() 204 rcv_priv = netdev_priv(peer); in veth_get_ethtool_stats() 205 for (i = 0; i < peer->real_num_rx_queues; i++) { in veth_get_ethtool_stats() 330 rcv = rcu_dereference(priv->peer); in veth_xmit() 410 struct net_device *peer; in veth_get_stats64() local 425 peer = rcu_dereference(priv->peer); in veth_get_stats64() 426 if (peer) { in veth_get_stats64() [all …]
|
D | rionet.c | 232 struct rionet_peer *peer; in rionet_dbell_event() local 241 list_for_each_entry(peer, &nets[netid].peers, node) { in rionet_dbell_event() 242 if (peer->rdev->destid == sid) { in rionet_dbell_event() 243 nets[netid].active[sid] = peer->rdev; in rionet_dbell_event() 312 struct rionet_peer *peer; in rionet_open() local 355 list_for_each_entry(peer, &nets[netid].peers, node) { in rionet_open() 357 rio_send_doorbell(peer->rdev, RIONET_DOORBELL_JOIN); in rionet_open() 369 struct rionet_peer *peer; in rionet_close() local 385 list_for_each_entry(peer, &nets[netid].peers, node) { in rionet_close() 386 if (nets[netid].active[peer->rdev->destid]) { in rionet_close() [all …]
|
/drivers/ntb/ |
D | msi.c | 101 int peer, peer_widx; in ntb_msi_setup_mws() local 114 for (peer = 0; peer < ntb_peer_port_count(ntb); peer++) { in ntb_msi_setup_mws() 115 peer_widx = ntb_peer_highest_mw_idx(ntb, peer); in ntb_msi_setup_mws() 119 ret = ntb_mw_get_align(ntb, peer, peer_widx, &addr_align, in ntb_msi_setup_mws() 127 for (peer = 0; peer < ntb_peer_port_count(ntb); peer++) { in ntb_msi_setup_mws() 128 peer_widx = ntb_peer_highest_mw_idx(ntb, peer); in ntb_msi_setup_mws() 134 ret = ntb_mw_get_align(ntb, peer, peer_widx, NULL, in ntb_msi_setup_mws() 144 ret = ntb_mw_set_trans(ntb, peer, peer_widx, in ntb_msi_setup_mws() 156 for (i = 0; i < peer; i++) { in ntb_msi_setup_mws() 157 peer_widx = ntb_peer_highest_mw_idx(ntb, peer); in ntb_msi_setup_mws() [all …]
|
/drivers/net/wireless/marvell/mwifiex/ |
D | tdls.c | 465 const u8 *peer, u8 action_code, in mwifiex_prep_tdls_encap_data() argument 478 memcpy(tf->da, peer, ETH_ALEN); in mwifiex_prep_tdls_encap_data() 572 ret = mwifiex_tdls_add_vht_oper(priv, peer, skb); in mwifiex_prep_tdls_encap_data() 577 ret = mwifiex_tdls_add_ht_oper(priv, peer, 1, skb); in mwifiex_prep_tdls_encap_data() 583 ret = mwifiex_tdls_add_ht_oper(priv, peer, 0, skb); in mwifiex_prep_tdls_encap_data() 614 const u8 *peer, const u8 *bssid) in mwifiex_tdls_add_link_ie() argument 625 memcpy(lnkid->resp_sta, peer, ETH_ALEN); in mwifiex_tdls_add_link_ie() 628 int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer, in mwifiex_send_tdls_data_frame() argument 673 ret = mwifiex_prep_tdls_encap_data(priv, peer, action_code, in mwifiex_send_tdls_data_frame() 682 mwifiex_tdls_add_link_ie(skb, priv->curr_addr, peer, in mwifiex_send_tdls_data_frame() [all …]
|
/drivers/usb/core/ |
D | port.c | 236 struct usb_port *peer = port_dev->peer; in usb_port_runtime_resume() local 251 if (!port_dev->is_superspeed && peer) in usb_port_runtime_resume() 252 pm_runtime_get_sync(&peer->dev); in usb_port_runtime_resume() 294 struct usb_port *peer = port_dev->peer; in usb_port_runtime_suspend() local 325 if (!port_dev->is_superspeed && peer) in usb_port_runtime_suspend() 326 pm_runtime_put(&peer->dev); in usb_port_runtime_suspend() 364 if (left->peer == right && right->peer == left) in link_peers() 367 if (left->peer || right->peer) { in link_peers() 368 struct usb_port *lpeer = left->peer; in link_peers() 369 struct usb_port *rpeer = right->peer; in link_peers() [all …]
|
/drivers/net/wireless/intel/iwlwifi/mvm/ |
D | ftm-initiator.c | 287 struct cfg80211_pmsr_request_peer *peer, in iwl_mvm_ftm_target_chandef_v1() argument 291 u32 freq = peer->chandef.chan->center_freq; in iwl_mvm_ftm_target_chandef_v1() 295 switch (peer->chandef.width) { in iwl_mvm_ftm_target_chandef_v1() 310 peer->chandef.width); in iwl_mvm_ftm_target_chandef_v1() 314 *ctrl_ch_position = (peer->chandef.width > NL80211_CHAN_WIDTH_20) ? in iwl_mvm_ftm_target_chandef_v1() 315 iwl_mvm_get_ctrl_pos(&peer->chandef) : 0; in iwl_mvm_ftm_target_chandef_v1() 322 struct cfg80211_pmsr_request_peer *peer, in iwl_mvm_ftm_target_chandef_v2() argument 326 u32 freq = peer->chandef.chan->center_freq; in iwl_mvm_ftm_target_chandef_v2() 330 switch (peer->chandef.width) { in iwl_mvm_ftm_target_chandef_v2() 349 peer->chandef.width); in iwl_mvm_ftm_target_chandef_v2() [all …]
|