Lines Matching refs:irlmp

52 struct irlmp_cb *irlmp = NULL;  variable
81 irlmp = kzalloc( sizeof(struct irlmp_cb), GFP_KERNEL); in irlmp_init()
82 if (irlmp == NULL) in irlmp_init()
85 irlmp->magic = LMP_MAGIC; in irlmp_init()
87 irlmp->clients = hashbin_new(HB_LOCK); in irlmp_init()
88 irlmp->services = hashbin_new(HB_LOCK); in irlmp_init()
89 irlmp->links = hashbin_new(HB_LOCK); in irlmp_init()
90 irlmp->unconnected_lsaps = hashbin_new(HB_LOCK); in irlmp_init()
91 irlmp->cachelog = hashbin_new(HB_NOLOCK); in irlmp_init()
93 if ((irlmp->clients == NULL) || in irlmp_init()
94 (irlmp->services == NULL) || in irlmp_init()
95 (irlmp->links == NULL) || in irlmp_init()
96 (irlmp->unconnected_lsaps == NULL) || in irlmp_init()
97 (irlmp->cachelog == NULL)) { in irlmp_init()
101 spin_lock_init(&irlmp->cachelog->hb_spinlock); in irlmp_init()
103 irlmp->last_lsap_sel = 0x0f; /* Reserved 0x00-0x0f */ in irlmp_init()
106 init_timer(&irlmp->discovery_timer); in irlmp_init()
110 irlmp_start_discovery_timer(irlmp, in irlmp_init()
125 IRDA_ASSERT(irlmp != NULL, return;); in irlmp_cleanup()
126 IRDA_ASSERT(irlmp->magic == LMP_MAGIC, return;); in irlmp_cleanup()
128 del_timer(&irlmp->discovery_timer); in irlmp_cleanup()
130 hashbin_delete(irlmp->links, (FREE_FUNC) kfree); in irlmp_cleanup()
131 hashbin_delete(irlmp->unconnected_lsaps, (FREE_FUNC) kfree); in irlmp_cleanup()
132 hashbin_delete(irlmp->clients, (FREE_FUNC) kfree); in irlmp_cleanup()
133 hashbin_delete(irlmp->services, (FREE_FUNC) kfree); in irlmp_cleanup()
134 hashbin_delete(irlmp->cachelog, (FREE_FUNC) kfree); in irlmp_cleanup()
137 kfree(irlmp); in irlmp_cleanup()
138 irlmp = NULL; in irlmp_cleanup()
152 IRDA_ASSERT(irlmp != NULL, return NULL;); in irlmp_open_lsap()
153 IRDA_ASSERT(irlmp->magic == LMP_MAGIC, return NULL;); in irlmp_open_lsap()
191 hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) self, in irlmp_open_lsap()
261 lsap = hashbin_remove(irlmp->unconnected_lsaps, (long) self, in irlmp_close_lsap()
285 IRDA_ASSERT(irlmp != NULL, return;); in irlmp_register_link()
286 IRDA_ASSERT(irlmp->magic == LMP_MAGIC, return;); in irlmp_register_link()
319 hashbin_insert(irlmp->links, (irda_queue_t *) lap, lap->saddr, NULL); in irlmp_register_link()
344 link = hashbin_remove(irlmp->links, saddr, NULL); in irlmp_unregister_link()
354 irlmp_expire_discoveries(irlmp->cachelog, link->saddr, TRUE); in irlmp_unregister_link()
424 spin_lock_irqsave(&irlmp->cachelog->hb_spinlock, flags); in irlmp_connect_request()
426 discovery = hashbin_find(irlmp->cachelog, daddr, NULL); in irlmp_connect_request()
430 hashbin_get_first(irlmp->cachelog); in irlmp_connect_request()
437 spin_unlock_irqrestore(&irlmp->cachelog->hb_spinlock, flags); in irlmp_connect_request()
439 lap = hashbin_lock_find(irlmp->links, saddr, NULL); in irlmp_connect_request()
474 lsap = hashbin_remove(irlmp->unconnected_lsaps, (long) self, NULL); in irlmp_connect_request()
634 spin_lock_irqsave(&irlmp->unconnected_lsaps->hb_spinlock, flags); in irlmp_dup()
638 if ((!hashbin_find(irlmp->unconnected_lsaps, (long) orig, NULL)) || in irlmp_dup()
642 spin_unlock_irqrestore(&irlmp->unconnected_lsaps->hb_spinlock, in irlmp_dup()
651 spin_unlock_irqrestore(&irlmp->unconnected_lsaps->hb_spinlock, in irlmp_dup()
659 spin_unlock_irqrestore(&irlmp->unconnected_lsaps->hb_spinlock, flags); in irlmp_dup()
666 hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) new, in irlmp_dup()
729 hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) self, in irlmp_disconnect_request()
779 hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) lsap, in irlmp_disconnect_indication()
820 lap = (struct lap_cb *) hashbin_get_first(irlmp->links); in irlmp_do_expiry()
826 irlmp_expire_discoveries(irlmp->cachelog, lap->saddr, in irlmp_do_expiry()
829 lap = (struct lap_cb *) hashbin_get_next(irlmp->links); in irlmp_do_expiry()
853 data_hintsp = (__u16 *) irlmp->discovery_cmd.data.hints; in irlmp_do_discovery()
854 put_unaligned(irlmp->hints.word, data_hintsp); in irlmp_do_discovery()
861 irlmp->discovery_cmd.data.charset = CS_ASCII; in irlmp_do_discovery()
862 strncpy(irlmp->discovery_cmd.data.info, sysctl_devname, in irlmp_do_discovery()
864 irlmp->discovery_cmd.name_len = strlen(irlmp->discovery_cmd.data.info); in irlmp_do_discovery()
865 irlmp->discovery_cmd.nslots = nslots; in irlmp_do_discovery()
870 lap = (struct lap_cb *) hashbin_get_first(irlmp->links); in irlmp_do_discovery()
879 lap = (struct lap_cb *) hashbin_get_next(irlmp->links); in irlmp_do_discovery()
895 irlmp_discovery_confirm(irlmp->cachelog, DISCOVERY_LOG); in irlmp_discovery_request()
942 return irlmp_copy_discoveries(irlmp->cachelog, pn, mask, TRUE); in irlmp_get_discoveries()
1025 client = (irlmp_client_t *) hashbin_get_first(irlmp->clients); in irlmp_discovery_confirm()
1026 while (NULL != hashbin_find_next(irlmp->clients, (long) client, NULL, in irlmp_discovery_confirm()
1057 client = (irlmp_client_t *) hashbin_get_first(irlmp->clients); in irlmp_discovery_expiry()
1058 while (NULL != hashbin_find_next(irlmp->clients, (long) client, NULL, in irlmp_discovery_expiry()
1088 IRDA_ASSERT(irlmp != NULL, return NULL;); in irlmp_get_discovery_response()
1090 put_unaligned(irlmp->hints.word, (__u16 *)irlmp->discovery_rsp.data.hints); in irlmp_get_discovery_response()
1097 irlmp->discovery_rsp.data.charset = CS_ASCII; in irlmp_get_discovery_response()
1099 strncpy(irlmp->discovery_rsp.data.info, sysctl_devname, in irlmp_get_discovery_response()
1101 irlmp->discovery_rsp.name_len = strlen(irlmp->discovery_rsp.data.info); in irlmp_get_discovery_response()
1103 return &irlmp->discovery_rsp; in irlmp_get_discovery_response()
1235 lap = (struct lap_cb *) hashbin_get_first(irlmp->links); in irlmp_connless_data_request()
1249 lap = (struct lap_cb *) hashbin_get_next(irlmp->links); in irlmp_connless_data_request()
1495 hashbin_insert(irlmp->services, (irda_queue_t *) service, in irlmp_register_service()
1498 irlmp->hints.word |= hints; in irlmp_register_service()
1522 service = hashbin_lock_find(irlmp->services, (long) handle, NULL); in irlmp_unregister_service()
1528 hashbin_remove_this(irlmp->services, (irda_queue_t *) service); in irlmp_unregister_service()
1532 irlmp->hints.word = 0; in irlmp_unregister_service()
1535 spin_lock_irqsave(&irlmp->services->hb_spinlock, flags); in irlmp_unregister_service()
1536 service = (irlmp_service_t *) hashbin_get_first(irlmp->services); in irlmp_unregister_service()
1538 irlmp->hints.word |= service->hints.word; in irlmp_unregister_service()
1540 service = (irlmp_service_t *)hashbin_get_next(irlmp->services); in irlmp_unregister_service()
1542 spin_unlock_irqrestore(&irlmp->services->hb_spinlock, flags); in irlmp_unregister_service()
1562 IRDA_ASSERT(irlmp != NULL, return NULL;); in irlmp_register_client()
1577 hashbin_insert(irlmp->clients, (irda_queue_t *) client, in irlmp_register_client()
1601 client = hashbin_lock_find(irlmp->clients, (long) handle, NULL); in irlmp_update_client()
1632 client = hashbin_lock_find(irlmp->clients, (long) handle, NULL); in irlmp_unregister_client()
1639 hashbin_remove_this(irlmp->clients, (irda_queue_t *) client); in irlmp_unregister_client()
1663 IRDA_ASSERT(irlmp != NULL, return TRUE;); in irlmp_slsap_inuse()
1664 IRDA_ASSERT(irlmp->magic == LMP_MAGIC, return TRUE;); in irlmp_slsap_inuse()
1684 spin_lock_irqsave_nested(&irlmp->links->hb_spinlock, flags, in irlmp_slsap_inuse()
1686 lap = (struct lap_cb *) hashbin_get_first(irlmp->links); in irlmp_slsap_inuse()
1711 lap = (struct lap_cb *) hashbin_get_next(irlmp->links); in irlmp_slsap_inuse()
1713 spin_unlock_irqrestore(&irlmp->links->hb_spinlock, flags); in irlmp_slsap_inuse()
1721 spin_lock_irqsave(&irlmp->unconnected_lsaps->hb_spinlock, flags); in irlmp_slsap_inuse()
1723 self = (struct lsap_cb *) hashbin_get_first(irlmp->unconnected_lsaps); in irlmp_slsap_inuse()
1731 self = (struct lsap_cb*) hashbin_get_next(irlmp->unconnected_lsaps); in irlmp_slsap_inuse()
1733 spin_unlock_irqrestore(&irlmp->unconnected_lsaps->hb_spinlock, flags); in irlmp_slsap_inuse()
1743 spin_unlock_irqrestore(&irlmp->links->hb_spinlock, flags); in irlmp_slsap_inuse()
1749 spin_unlock_irqrestore(&irlmp->unconnected_lsaps->hb_spinlock, flags); in irlmp_slsap_inuse()
1764 IRDA_ASSERT(irlmp != NULL, return -1;); in irlmp_find_free_slsap()
1765 IRDA_ASSERT(irlmp->magic == LMP_MAGIC, return -1;); in irlmp_find_free_slsap()
1784 irlmp->last_lsap_sel++; in irlmp_find_free_slsap()
1787 if (irlmp->last_lsap_sel > LSAP_MAX) { in irlmp_find_free_slsap()
1789 irlmp->last_lsap_sel = 0x10; in irlmp_find_free_slsap()
1804 } while (irlmp_slsap_inuse(irlmp->last_lsap_sel)); in irlmp_find_free_slsap()
1807 lsap_sel = irlmp->last_lsap_sel; in irlmp_find_free_slsap()
1892 iter->hashbin = irlmp->unconnected_lsaps; in irlmp_seq_start()
1900 iter->hashbin = irlmp->links; in irlmp_seq_start()
1911 iter->hashbin = irlmp->unconnected_lsaps; in irlmp_seq_next()
1917 iter->hashbin = irlmp->links; in irlmp_seq_next()
1926 if (iter->hashbin == irlmp->unconnected_lsaps) in irlmp_seq_next()
1951 else if (iter->hashbin == irlmp->unconnected_lsaps) { in irlmp_seq_show()
1961 } else if (iter->hashbin == irlmp->links) { in irlmp_seq_show()
2011 IRDA_ASSERT(irlmp != NULL, return -EINVAL;); in irlmp_seq_open()