Lines Matching refs:sap
2 * llc_core.c - Minimum needed routines for sap handling and module init/exit
29 * llc_sap_alloc - allocates and initializes sap.
31 * Allocates and initializes sap.
35 struct llc_sap *sap = kzalloc(sizeof(*sap), GFP_ATOMIC);
38 if (sap) {
39 /* sap->laddr.mac - leave as a null, it's filled by bind */
40 sap->state = LLC_SAP_STATE_ACTIVE;
41 spin_lock_init(&sap->sk_lock);
43 INIT_HLIST_NULLS_HEAD(&sap->sk_laddr_hash[i], i);
44 atomic_set(&sap->refcnt, 1);
46 return sap;
51 struct llc_sap* sap;
53 list_for_each_entry(sap, &llc_sap_list, node)
54 if (sap->laddr.lsap == sap_value)
56 sap = NULL;
58 return sap;
63 * @sap_value: sap to be found
65 * Searchs for a sap in the sap list of the LLC's station upon the sap ID.
66 * If the sap is found it will be refcounted and the user will have to do
68 * Returns the sap or %NULL if not found.
72 struct llc_sap *sap;
75 sap = __llc_sap_find(sap_value);
76 if (sap)
77 llc_sap_hold(sap);
79 return sap;
97 struct llc_sap *sap = NULL;
102 sap = llc_sap_alloc();
103 if (!sap)
105 sap->laddr.lsap = lsap;
106 sap->rcv_func = func;
107 list_add_tail_rcu(&sap->node, &llc_sap_list);
110 return sap;
115 * @sap: SAP to be closed.
119 * Removes this sap from the list of saps in the station and then
120 * frees the memory for this sap.
122 void llc_sap_close(struct llc_sap *sap)
124 WARN_ON(sap->sk_count);
127 list_del_rcu(&sap->node);
132 kfree(sap);