Lines Matching defs:memo
61 struct hci_memo *memo;
88 memo = hci_memo_find(unit, dest);
89 if (memo)
112 * find unit memo from bdaddr
117 struct hci_memo *memo, *m0;
123 while ((memo = m0) != NULL) {
124 m0 = LIST_NEXT(memo, next);
126 if (now.tv_sec > memo->time.tv_sec + hci_memo_expiry) {
127 DPRINTF("memo %p too old (expiring)\n", memo);
128 hci_memo_free(memo);
132 if (bdaddr_same(bdaddr, &memo->bdaddr)) {
133 DPRINTF("memo %p found\n", memo);
134 return memo;
138 DPRINTF("no memo found\n");
143 * Make a new memo on unit for bdaddr. If a memo exists, just
149 struct hci_memo *memo;
151 memo = hci_memo_find(unit, bdaddr);
152 if (memo == NULL) {
153 memo = malloc(sizeof(struct hci_memo),
156 if (memo == NULL) {
157 DPRINTFN(0, "no memory for memo!\n");
161 DPRINTF("memo created for %02x:%02x:%02x:%02x:%02x:%02x\n",
165 bdaddr_copy(&memo->bdaddr, bdaddr);
166 LIST_INSERT_HEAD(&unit->hci_memos, memo, next);
169 DPRINTF("memo updated for %02x:%02x:%02x:%02x:%02x:%02x\n",
173 microtime(&memo->time);
174 return memo;
178 hci_memo_free(struct hci_memo *memo)
181 LIST_REMOVE(memo, next);
182 free(memo, M_BLUETOOTH);