• Home
  • Raw
  • Download

Lines Matching refs:np

31 static inline void mq_init(struct capilib_ncci *np)  in mq_init()  argument
34 np->msgidqueue = NULL; in mq_init()
35 np->msgidlast = NULL; in mq_init()
36 np->nmsg = 0; in mq_init()
37 memset(np->msgidpool, 0, sizeof(np->msgidpool)); in mq_init()
38 np->msgidfree = &np->msgidpool[0]; in mq_init()
39 for (i = 1; i < np->winsize; i++) { in mq_init()
40 np->msgidpool[i].next = np->msgidfree; in mq_init()
41 np->msgidfree = &np->msgidpool[i]; in mq_init()
45 static inline int mq_enqueue(struct capilib_ncci *np, u16 msgid) in mq_enqueue() argument
48 if ((mq = np->msgidfree) == NULL) in mq_enqueue()
50 np->msgidfree = mq->next; in mq_enqueue()
53 if (np->msgidlast) in mq_enqueue()
54 np->msgidlast->next = mq; in mq_enqueue()
55 np->msgidlast = mq; in mq_enqueue()
56 if (!np->msgidqueue) in mq_enqueue()
57 np->msgidqueue = mq; in mq_enqueue()
58 np->nmsg++; in mq_enqueue()
62 static inline int mq_dequeue(struct capilib_ncci *np, u16 msgid) in mq_dequeue() argument
65 for (pp = &np->msgidqueue; *pp; pp = &(*pp)->next) { in mq_dequeue()
69 if (mq == np->msgidlast) in mq_dequeue()
70 np->msgidlast = NULL; in mq_dequeue()
71 mq->next = np->msgidfree; in mq_dequeue()
72 np->msgidfree = mq; in mq_dequeue()
73 np->nmsg--; in mq_dequeue()
82 struct capilib_ncci *np; in capilib_new_ncci() local
84 np = kmalloc(sizeof(*np), GFP_ATOMIC); in capilib_new_ncci()
85 if (!np) { in capilib_new_ncci()
94 np->applid = applid; in capilib_new_ncci()
95 np->ncci = ncci; in capilib_new_ncci()
96 np->winsize = winsize; in capilib_new_ncci()
97 mq_init(np); in capilib_new_ncci()
98 list_add_tail(&np->list, head); in capilib_new_ncci()
107 struct capilib_ncci *np; in capilib_free_ncci() local
110 np = list_entry(l, struct capilib_ncci, list); in capilib_free_ncci()
111 if (np->applid != applid) in capilib_free_ncci()
113 if (np->ncci != ncci) in capilib_free_ncci()
116 list_del(&np->list); in capilib_free_ncci()
117 kfree(np); in capilib_free_ncci()
128 struct capilib_ncci *np; in capilib_release_appl() local
131 np = list_entry(l, struct capilib_ncci, list); in capilib_release_appl()
132 if (np->applid != applid) in capilib_release_appl()
134 printk(KERN_INFO "kcapi: appl %d ncci 0x%x forced down\n", applid, np->ncci); in capilib_release_appl()
135 list_del(&np->list); in capilib_release_appl()
136 kfree(np); in capilib_release_appl()
145 struct capilib_ncci *np; in capilib_release() local
148 np = list_entry(l, struct capilib_ncci, list); in capilib_release()
149 printk(KERN_INFO "kcapi: appl %d ncci 0x%x forced down\n", np->applid, np->ncci); in capilib_release()
150 list_del(&np->list); in capilib_release()
151 kfree(np); in capilib_release()
160 struct capilib_ncci *np; in capilib_data_b3_req() local
163 np = list_entry(l, struct capilib_ncci, list); in capilib_data_b3_req()
164 if (np->applid != applid) in capilib_data_b3_req()
166 if (np->ncci != ncci) in capilib_data_b3_req()
169 if (mq_enqueue(np, msgid) == 0) in capilib_data_b3_req()
183 struct capilib_ncci *np; in capilib_data_b3_conf() local
186 np = list_entry(l, struct capilib_ncci, list); in capilib_data_b3_conf()
187 if (np->applid != applid) in capilib_data_b3_conf()
189 if (np->ncci != ncci) in capilib_data_b3_conf()
192 if (mq_dequeue(np, msgid) == 0) { in capilib_data_b3_conf()