Lines Matching refs:irlmp

47 struct irlmp_cb *irlmp = NULL;  variable
81 irlmp = kmalloc( sizeof(struct irlmp_cb), GFP_KERNEL); in irlmp_init()
82 if (irlmp == NULL) in irlmp_init()
84 memset(irlmp, 0, sizeof(struct irlmp_cb)); in irlmp_init()
86 irlmp->magic = LMP_MAGIC; in irlmp_init()
87 spin_lock_init(&irlmp->log_lock); in irlmp_init()
89 irlmp->clients = hashbin_new(HB_GLOBAL); in irlmp_init()
90 irlmp->services = hashbin_new(HB_GLOBAL); in irlmp_init()
91 irlmp->links = hashbin_new(HB_GLOBAL); in irlmp_init()
92 irlmp->unconnected_lsaps = hashbin_new(HB_GLOBAL); in irlmp_init()
93 irlmp->cachelog = hashbin_new(HB_GLOBAL); in irlmp_init()
95 irlmp->free_lsap_sel = 0x10; /* Reserved 0x00-0x0f */ in irlmp_init()
97 irlmp->cache.valid = FALSE; in irlmp_init()
102 init_timer(&irlmp->discovery_timer); in irlmp_init()
103 irlmp_start_discovery_timer(irlmp, sysctl_discovery_timeout*HZ); in irlmp_init()
117 ASSERT(irlmp != NULL, return;); in irlmp_cleanup()
118 ASSERT(irlmp->magic == LMP_MAGIC, return;); in irlmp_cleanup()
120 del_timer(&irlmp->discovery_timer); in irlmp_cleanup()
122 hashbin_delete(irlmp->links, (FREE_FUNC) kfree); in irlmp_cleanup()
123 hashbin_delete(irlmp->unconnected_lsaps, (FREE_FUNC) kfree); in irlmp_cleanup()
124 hashbin_delete(irlmp->clients, (FREE_FUNC) kfree); in irlmp_cleanup()
125 hashbin_delete(irlmp->services, (FREE_FUNC) kfree); in irlmp_cleanup()
126 hashbin_delete(irlmp->cachelog, (FREE_FUNC) kfree); in irlmp_cleanup()
129 kfree(irlmp); in irlmp_cleanup()
130 irlmp = NULL; in irlmp_cleanup()
144 ASSERT(irlmp != NULL, return NULL;); in irlmp_open_lsap()
145 ASSERT(irlmp->magic == LMP_MAGIC, return NULL;); in irlmp_open_lsap()
184 hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) self, (int) self, in irlmp_open_lsap()
212 ASSERT(irlmp != NULL, return;); in __irlmp_close_lsap()
213 irlmp->cache.valid = FALSE; in __irlmp_close_lsap()
254 lsap = hashbin_remove(irlmp->unconnected_lsaps, (int) self, in irlmp_close_lsap()
275 ASSERT(irlmp != NULL, return;); in irlmp_register_link()
276 ASSERT(irlmp->magic == LMP_MAGIC, return;); in irlmp_register_link()
302 hashbin_insert(irlmp->links, (irda_queue_t *) lap, lap->saddr, NULL); in irlmp_register_link()
324 link = hashbin_remove(irlmp->links, saddr, NULL); in irlmp_unregister_link()
329 irlmp_expire_discoveries(irlmp->cachelog, link->saddr, TRUE); in irlmp_unregister_link()
392 discovery = hashbin_find(irlmp->cachelog, daddr, NULL); in irlmp_connect_request()
396 hashbin_get_first(irlmp->cachelog); in irlmp_connect_request()
404 lap = hashbin_find(irlmp->links, saddr, NULL); in irlmp_connect_request()
439 lsap = hashbin_remove(irlmp->unconnected_lsaps, (int) self, NULL); in irlmp_connect_request()
581 if (!hashbin_find(irlmp->unconnected_lsaps, (int) orig, NULL)) { in irlmp_dup()
598 hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) new, (int) new, in irlmp_dup()
603 irlmp->cache.valid = FALSE; in irlmp_dup()
655 hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) self, (int) self, in irlmp_disconnect_request()
694 irlmp->cache.valid = FALSE; in irlmp_disconnect_indication()
707 hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) lsap, (int) lsap, in irlmp_disconnect_indication()
747 lap = (struct lap_cb *) hashbin_get_first(irlmp->links); in irlmp_do_expiry()
753 irlmp_expire_discoveries(irlmp->cachelog, lap->saddr, in irlmp_do_expiry()
756 lap = (struct lap_cb *) hashbin_get_next(irlmp->links); in irlmp_do_expiry()
778 irlmp->discovery_cmd.hints.word = irlmp->hints.word; in irlmp_do_discovery()
785 irlmp->discovery_cmd.charset = CS_ASCII; in irlmp_do_discovery()
786 strncpy(irlmp->discovery_cmd.nickname, sysctl_devname, in irlmp_do_discovery()
788 irlmp->discovery_cmd.name_len = strlen(irlmp->discovery_cmd.nickname); in irlmp_do_discovery()
789 irlmp->discovery_cmd.nslots = nslots; in irlmp_do_discovery()
794 lap = (struct lap_cb *) hashbin_get_first(irlmp->links); in irlmp_do_discovery()
803 lap = (struct lap_cb *) hashbin_get_next(irlmp->links); in irlmp_do_discovery()
816 irlmp_discovery_confirm(irlmp->cachelog, DISCOVERY_LOG); in irlmp_discovery_request()
860 return(irlmp_copy_discoveries(irlmp->cachelog, pn, mask)); in irlmp_get_discoveries()
889 client = hashbin_find(irlmp->registry, service, NULL);
967 client = (irlmp_client_t *) hashbin_get_first(irlmp->clients); in irlmp_discovery_confirm()
972 client = (irlmp_client_t *) hashbin_get_next(irlmp->clients); in irlmp_discovery_confirm()
995 client = (irlmp_client_t *) hashbin_get_first(irlmp->clients); in irlmp_discovery_expiry()
1004 client = (irlmp_client_t *) hashbin_get_next(irlmp->clients); in irlmp_discovery_expiry()
1018 ASSERT(irlmp != NULL, return NULL;); in irlmp_get_discovery_response()
1020 irlmp->discovery_rsp.hints.word = irlmp->hints.word; in irlmp_get_discovery_response()
1027 irlmp->discovery_rsp.charset = CS_ASCII; in irlmp_get_discovery_response()
1029 strncpy(irlmp->discovery_rsp.nickname, sysctl_devname, in irlmp_get_discovery_response()
1031 irlmp->discovery_rsp.name_len = strlen(irlmp->discovery_rsp.nickname); in irlmp_get_discovery_response()
1033 return &irlmp->discovery_rsp; in irlmp_get_discovery_response()
1142 lap = (struct lap_cb *) hashbin_get_first(irlmp->links); in irlmp_connless_data_request()
1152 lap = (struct lap_cb *) hashbin_get_next(irlmp->links); in irlmp_connless_data_request()
1432 while (hashbin_find(irlmp->services, handle, NULL) || !handle) in irlmp_register_service()
1435 irlmp->hints.word |= hints; in irlmp_register_service()
1444 hashbin_insert(irlmp->services, (irda_queue_t *) service, handle, NULL); in irlmp_register_service()
1465 service = hashbin_find(irlmp->services, handle, NULL); in irlmp_unregister_service()
1471 service = hashbin_remove(irlmp->services, handle, NULL); in irlmp_unregister_service()
1476 irlmp->hints.word = 0; in irlmp_unregister_service()
1479 service = (irlmp_service_t *) hashbin_get_first(irlmp->services); in irlmp_unregister_service()
1481 irlmp->hints.word |= service->hints; in irlmp_unregister_service()
1483 service = (irlmp_service_t *)hashbin_get_next(irlmp->services); in irlmp_unregister_service()
1504 ASSERT(irlmp != NULL, return 0;); in irlmp_register_client()
1508 while (hashbin_find(irlmp->clients, handle, NULL) || !handle) in irlmp_register_client()
1524 hashbin_insert(irlmp->clients, (irda_queue_t *) client, handle, NULL); in irlmp_register_client()
1546 client = hashbin_find(irlmp->clients, handle, NULL); in irlmp_update_client()
1575 client = hashbin_find(irlmp->clients, handle, NULL); in irlmp_unregister_client()
1582 client = hashbin_remove( irlmp->clients, handle, NULL); in irlmp_unregister_client()
1599 ASSERT(irlmp != NULL, return TRUE;); in irlmp_slsap_inuse()
1600 ASSERT(irlmp->magic == LMP_MAGIC, return TRUE;); in irlmp_slsap_inuse()
1620 lap = (struct lap_cb *) hashbin_get_first(irlmp->links); in irlmp_slsap_inuse()
1635 lap = (struct lap_cb *) hashbin_get_next(irlmp->links); in irlmp_slsap_inuse()
1651 ASSERT(irlmp != NULL, return -1;); in irlmp_find_free_slsap()
1652 ASSERT(irlmp->magic == LMP_MAGIC, return -1;); in irlmp_find_free_slsap()
1654 lsap_sel = irlmp->free_lsap_sel++; in irlmp_find_free_slsap()
1657 while (irlmp_slsap_inuse(irlmp->free_lsap_sel)) { in irlmp_find_free_slsap()
1658 irlmp->free_lsap_sel++; in irlmp_find_free_slsap()
1661 if (irlmp->free_lsap_sel > LSAP_MAX) { in irlmp_find_free_slsap()
1662 irlmp->free_lsap_sel = 10; in irlmp_find_free_slsap()
1743 ASSERT(irlmp != NULL, return 0;); in irlmp_proc_read()
1751 self = (struct lsap_cb *) hashbin_get_first( irlmp->unconnected_lsaps); in irlmp_proc_read()
1763 irlmp->unconnected_lsaps); in irlmp_proc_read()
1768 lap = (struct lap_cb *) hashbin_get_first(irlmp->links); in irlmp_proc_read()
1796 lap = (struct lap_cb *) hashbin_get_next(irlmp->links); in irlmp_proc_read()