• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/net/irda/

Lines Matching defs:irlmp

3  * Filename:      irlmp.c
43 #include <net/irda/irlmp.h>
52 struct irlmp_cb *irlmp = NULL;
80 /* Initialize the irlmp structure. */
81 irlmp = kzalloc( sizeof(struct irlmp_cb), GFP_KERNEL);
82 if (irlmp == NULL)
85 irlmp->magic = LMP_MAGIC;
87 irlmp->clients = hashbin_new(HB_LOCK);
88 irlmp->services = hashbin_new(HB_LOCK);
89 irlmp->links = hashbin_new(HB_LOCK);
90 irlmp->unconnected_lsaps = hashbin_new(HB_LOCK);
91 irlmp->cachelog = hashbin_new(HB_NOLOCK);
93 if ((irlmp->clients == NULL) ||
94 (irlmp->services == NULL) ||
95 (irlmp->links == NULL) ||
96 (irlmp->unconnected_lsaps == NULL) ||
97 (irlmp->cachelog == NULL)) {
101 spin_lock_init(&irlmp->cachelog->hb_spinlock);
103 irlmp->last_lsap_sel = 0x0f; /* Reserved 0x00-0x0f */
106 init_timer(&irlmp->discovery_timer);
110 irlmp_start_discovery_timer(irlmp,
125 IRDA_ASSERT(irlmp != NULL, return;);
126 IRDA_ASSERT(irlmp->magic == LMP_MAGIC, return;);
128 del_timer(&irlmp->discovery_timer);
130 hashbin_delete(irlmp->links, (FREE_FUNC) kfree);
131 hashbin_delete(irlmp->unconnected_lsaps, (FREE_FUNC) kfree);
132 hashbin_delete(irlmp->clients, (FREE_FUNC) kfree);
133 hashbin_delete(irlmp->services, (FREE_FUNC) kfree);
134 hashbin_delete(irlmp->cachelog, (FREE_FUNC) kfree);
137 kfree(irlmp);
138 irlmp = NULL;
152 IRDA_ASSERT(irlmp != NULL, return NULL;);
153 IRDA_ASSERT(irlmp->magic == LMP_MAGIC, return NULL;);
191 hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) self,
261 lsap = hashbin_remove(irlmp->unconnected_lsaps, (long) self,
285 IRDA_ASSERT(irlmp != NULL, return;);
286 IRDA_ASSERT(irlmp->magic == LMP_MAGIC, return;);
319 hashbin_insert(irlmp->links, (irda_queue_t *) lap, lap->saddr, NULL);
344 link = hashbin_remove(irlmp->links, saddr, NULL);
354 irlmp_expire_discoveries(irlmp->cachelog, link->saddr, TRUE);
424 spin_lock_irqsave(&irlmp->cachelog->hb_spinlock, flags);
426 discovery = hashbin_find(irlmp->cachelog, daddr, NULL);
430 hashbin_get_first(irlmp->cachelog);
437 spin_unlock_irqrestore(&irlmp->cachelog->hb_spinlock, flags);
439 lap = hashbin_lock_find(irlmp->links, saddr, NULL);
474 lsap = hashbin_remove(irlmp->unconnected_lsaps, (long) self, NULL);
634 spin_lock_irqsave(&irlmp->unconnected_lsaps->hb_spinlock, flags);
638 if ((!hashbin_find(irlmp->unconnected_lsaps, (long) orig, NULL)) ||
642 spin_unlock_irqrestore(&irlmp->unconnected_lsaps->hb_spinlock,
651 spin_unlock_irqrestore(&irlmp->unconnected_lsaps->hb_spinlock,
659 spin_unlock_irqrestore(&irlmp->unconnected_lsaps->hb_spinlock, flags);
666 hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) new,
729 hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) self,
779 hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) lsap,
820 lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
826 irlmp_expire_discoveries(irlmp->cachelog, lap->saddr,
829 lap = (struct lap_cb *) hashbin_get_next(irlmp->links);
853 data_hintsp = (__u16 *) irlmp->discovery_cmd.data.hints;
854 put_unaligned(irlmp->hints.word, data_hintsp);
861 irlmp->discovery_cmd.data.charset = CS_ASCII;
862 strncpy(irlmp->discovery_cmd.data.info, sysctl_devname,
864 irlmp->discovery_cmd.name_len = strlen(irlmp->discovery_cmd.data.info);
865 irlmp->discovery_cmd.nslots = nslots;
870 lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
879 lap = (struct lap_cb *) hashbin_get_next(irlmp->links);
895 irlmp_discovery_confirm(irlmp->cachelog, DISCOVERY_LOG);
942 return(irlmp_copy_discoveries(irlmp->cachelog, pn, mask, TRUE));
1025 client = (irlmp_client_t *) hashbin_get_first(irlmp->clients);
1026 while (NULL != hashbin_find_next(irlmp->clients, (long) client, NULL,
1057 client = (irlmp_client_t *) hashbin_get_first(irlmp->clients);
1058 while (NULL != hashbin_find_next(irlmp->clients, (long) client, NULL,
1088 IRDA_ASSERT(irlmp != NULL, return NULL;);
1090 put_unaligned(irlmp->hints.word, (__u16 *)irlmp->discovery_rsp.data.hints);
1097 irlmp->discovery_rsp.data.charset = CS_ASCII;
1099 strncpy(irlmp->discovery_rsp.data.info, sysctl_devname,
1101 irlmp->discovery_rsp.name_len = strlen(irlmp->discovery_rsp.data.info);
1103 return &irlmp->discovery_rsp;
1235 lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
1249 lap = (struct lap_cb *) hashbin_get_next(irlmp->links);
1419 hashbin_insert(irlmp->services, (irda_queue_t *) service,
1422 irlmp->hints.word |= hints;
1446 service = hashbin_lock_find(irlmp->services, (long) handle, NULL);
1452 hashbin_remove_this(irlmp->services, (irda_queue_t *) service);
1456 irlmp->hints.word = 0;
1459 spin_lock_irqsave(&irlmp->services->hb_spinlock, flags);
1460 service = (irlmp_service_t *) hashbin_get_first(irlmp->services);
1462 irlmp->hints.word |= service->hints.word;
1464 service = (irlmp_service_t *)hashbin_get_next(irlmp->services);
1466 spin_unlock_irqrestore(&irlmp->services->hb_spinlock, flags);
1486 IRDA_ASSERT(irlmp != NULL, return NULL;);
1501 hashbin_insert(irlmp->clients, (irda_queue_t *) client,
1525 client = hashbin_lock_find(irlmp->clients, (long) handle, NULL);
1556 client = hashbin_lock_find(irlmp->clients, (long) handle, NULL);
1563 hashbin_remove_this(irlmp->clients, (irda_queue_t *) client);
1587 IRDA_ASSERT(irlmp != NULL, return TRUE;);
1588 IRDA_ASSERT(irlmp->magic == LMP_MAGIC, return TRUE;);
1608 spin_lock_irqsave_nested(&irlmp->links->hb_spinlock, flags,
1610 lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
1615 * irlmp->links is never taken while another IrDA
1635 lap = (struct lap_cb *) hashbin_get_next(irlmp->links);
1637 spin_unlock_irqrestore(&irlmp->links->hb_spinlock, flags);
1645 spin_lock_irqsave(&irlmp->unconnected_lsaps->hb_spinlock, flags);
1647 self = (struct lsap_cb *) hashbin_get_first(irlmp->unconnected_lsaps);
1655 self = (struct lsap_cb*) hashbin_get_next(irlmp->unconnected_lsaps);
1657 spin_unlock_irqrestore(&irlmp->unconnected_lsaps->hb_spinlock, flags);
1667 spin_unlock_irqrestore(&irlmp->links->hb_spinlock, flags);
1673 spin_unlock_irqrestore(&irlmp->unconnected_lsaps->hb_spinlock, flags);
1688 IRDA_ASSERT(irlmp != NULL, return -1;);
1689 IRDA_ASSERT(irlmp->magic == LMP_MAGIC, return -1;);
1708 irlmp->last_lsap_sel++;
1711 if (irlmp->last_lsap_sel > LSAP_MAX) {
1713 irlmp->last_lsap_sel = 0x10;
1728 } while (irlmp_slsap_inuse(irlmp->last_lsap_sel));
1731 lsap_sel = irlmp->last_lsap_sel;
1816 iter->hashbin = irlmp->unconnected_lsaps;
1824 iter->hashbin = irlmp->links;
1835 iter->hashbin = irlmp->unconnected_lsaps;
1841 iter->hashbin = irlmp->links;
1850 if (iter->hashbin == irlmp->unconnected_lsaps)
1875 else if (iter->hashbin == irlmp->unconnected_lsaps) {
1885 } else if (iter->hashbin == irlmp->links) {
1935 IRDA_ASSERT(irlmp != NULL, return -EINVAL;);