Lines Matching refs:pn
159 static struct pppox_sock *__get_item(struct pppoe_net *pn, __be16 sid, in __get_item() argument
165 ret = pn->hash_table[hash]; in __get_item()
177 static int __set_item(struct pppoe_net *pn, struct pppox_sock *po) in __set_item() argument
182 ret = pn->hash_table[hash]; in __set_item()
191 po->next = pn->hash_table[hash]; in __set_item()
192 pn->hash_table[hash] = po; in __set_item()
197 static void __delete_item(struct pppoe_net *pn, __be16 sid, in __delete_item() argument
203 ret = pn->hash_table[hash]; in __delete_item()
204 src = &pn->hash_table[hash]; in __delete_item()
223 static inline struct pppox_sock *get_item(struct pppoe_net *pn, __be16 sid, in get_item() argument
228 read_lock_bh(&pn->hash_lock); in get_item()
229 po = __get_item(pn, sid, addr, ifindex); in get_item()
232 read_unlock_bh(&pn->hash_lock); in get_item()
241 struct pppoe_net *pn; in get_item_by_addr() local
250 pn = pppoe_pernet(net); in get_item_by_addr()
251 pppox_sock = get_item(pn, sp->sa_addr.pppoe.sid, in get_item_by_addr()
258 static inline void delete_item(struct pppoe_net *pn, __be16 sid, in delete_item() argument
261 write_lock_bh(&pn->hash_lock); in delete_item()
262 __delete_item(pn, sid, addr, ifindex); in delete_item()
263 write_unlock_bh(&pn->hash_lock); in delete_item()
275 struct pppoe_net *pn; in pppoe_flush_dev() local
278 pn = pppoe_pernet(dev_net(dev)); in pppoe_flush_dev()
279 write_lock_bh(&pn->hash_lock); in pppoe_flush_dev()
281 struct pppox_sock *po = pn->hash_table[i]; in pppoe_flush_dev()
303 write_unlock_bh(&pn->hash_lock); in pppoe_flush_dev()
323 write_lock_bh(&pn->hash_lock); in pppoe_flush_dev()
324 po = pn->hash_table[i]; in pppoe_flush_dev()
327 write_unlock_bh(&pn->hash_lock); in pppoe_flush_dev()
418 struct pppoe_net *pn; in pppoe_rcv() local
442 pn = pppoe_pernet(dev_net(dev)); in pppoe_rcv()
447 po = get_item(pn, ph->sid, eth_hdr(skb)->h_source, dev->ifindex); in pppoe_rcv()
487 struct pppoe_net *pn; in pppoe_disc_rcv() local
503 pn = pppoe_pernet(dev_net(dev)); in pppoe_disc_rcv()
504 po = get_item(pn, ph->sid, eth_hdr(skb)->h_source, dev->ifindex); in pppoe_disc_rcv()
565 struct pppoe_net *pn; in pppoe_release() local
590 pn = pppoe_pernet(net); in pppoe_release()
596 delete_item(pn, po->pppoe_pa.sid, po->pppoe_pa.remote, in pppoe_release()
616 struct pppoe_net *pn; in pppoe_connect() local
647 pn = pppoe_pernet(sock_net(sk)); in pppoe_connect()
648 delete_item(pn, po->pppoe_pa.sid, in pppoe_connect()
675 pn = pppoe_pernet(net); in pppoe_connect()
684 write_lock_bh(&pn->hash_lock); in pppoe_connect()
685 error = __set_item(pn, po); in pppoe_connect()
686 write_unlock_bh(&pn->hash_lock); in pppoe_connect()
699 delete_item(pn, po->pppoe_pa.sid, in pppoe_connect()
1053 static inline struct pppox_sock *pppoe_get_idx(struct pppoe_net *pn, loff_t pos) in pppoe_get_idx() argument
1059 po = pn->hash_table[i]; in pppoe_get_idx()
1072 __acquires(pn->hash_lock) in pppoe_seq_start()
1074 struct pppoe_net *pn = pppoe_pernet(seq_file_net(seq)); in pppoe_seq_start() local
1077 read_lock_bh(&pn->hash_lock); in pppoe_seq_start()
1078 return l ? pppoe_get_idx(pn, --l) : SEQ_START_TOKEN; in pppoe_seq_start()
1083 struct pppoe_net *pn = pppoe_pernet(seq_file_net(seq)); in pppoe_seq_next() local
1088 po = pppoe_get_idx(pn, 0); in pppoe_seq_next()
1099 po = pn->hash_table[hash]; in pppoe_seq_next()
1110 __releases(pn->hash_lock) in pppoe_seq_stop()
1112 struct pppoe_net *pn = pppoe_pernet(seq_file_net(seq)); in pppoe_seq_stop() local
1113 read_unlock_bh(&pn->hash_lock); in pppoe_seq_stop()
1153 struct pppoe_net *pn = pppoe_pernet(net); in pppoe_init_net() local
1156 rwlock_init(&pn->hash_lock); in pppoe_init_net()