• 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 refs:self

149 	struct lsap_cb *self;
165 self = kzalloc(sizeof(struct lsap_cb), GFP_ATOMIC);
166 if (self == NULL) {
171 self->magic = LMP_LSAP_MAGIC;
172 self->slsap_sel = slsap_sel;
177 self->dlsap_sel = LSAP_CONNLESS;
178 self->pid = pid;
181 self->dlsap_sel = LSAP_ANY;
182 /* self->connected = FALSE; -> already NULL via memset() */
184 init_timer(&self->watchdog_timer);
186 self->notify = *notify;
188 self->lsap_state = LSAP_DISCONNECTED;
191 hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) self,
192 (long) self, NULL);
194 return self;
199 * Function __irlmp_close_lsap (self)
203 static void __irlmp_close_lsap(struct lsap_cb *self)
207 IRDA_ASSERT(self != NULL, return;);
208 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return;);
213 self->magic = 0;
214 del_timer(&self->watchdog_timer); /* Important! */
216 if (self->conn_skb)
217 dev_kfree_skb(self->conn_skb);
219 kfree(self);
223 * Function irlmp_close_lsap (self)
228 void irlmp_close_lsap(struct lsap_cb *self)
233 IRDA_ASSERT(self != NULL, return;);
234 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return;);
240 lap = self->lap;
247 if(self->lsap_state != LSAP_DISCONNECTED) {
248 self->lsap_state = LSAP_DISCONNECTED;
249 irlmp_do_lap_event(self->lap,
253 lsap = hashbin_remove(lap->lsaps, (long) self, NULL);
258 self->lap = NULL;
261 lsap = hashbin_remove(irlmp->unconnected_lsaps, (long) self,
270 __irlmp_close_lsap(self);
370 int irlmp_connect_request(struct lsap_cb *self, __u8 dlsap_sel,
379 IRDA_ASSERT(self != NULL, return -EBADR;);
380 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return -EBADR;);
384 __func__, self->slsap_sel, dlsap_sel, saddr, daddr);
386 if (test_bit(0, &self->connected)) {
410 self->dlsap_sel = dlsap_sel;
468 self->lap = lap;
474 lsap = hashbin_remove(irlmp->unconnected_lsaps, (long) self, NULL);
481 hashbin_insert(self->lap->lsaps, (irda_queue_t *) self, (long) self,
484 set_bit(0, &self->connected); /* TRUE */
490 self->qos = *qos;
492 irlmp_do_lsap_event(self, LM_CONNECT_REQUEST, tx_skb);
508 * Function irlmp_connect_indication (self)
513 void irlmp_connect_indication(struct lsap_cb *self, struct sk_buff *skb)
519 IRDA_ASSERT(self != NULL, return;);
520 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return;);
522 IRDA_ASSERT(self->lap != NULL, return;);
525 __func__, self->slsap_sel, self->dlsap_sel);
527 /* Note : self->lap is set in irlmp_link_data_indication(),
529 * Similarly, self->dlsap_sel is usually set in irlmp_find_lsap().
532 self->qos = *self->lap->qos;
534 max_seg_size = self->lap->qos->data_size.value-LMP_HEADER;
535 lap_header_size = IRLAP_GET_HEADER_SIZE(self->lap->irlap);
541 if (self->notify.connect_indication) {
544 self->notify.connect_indication(self->notify.instance, self,
545 &self->qos, max_seg_size,
556 int irlmp_connect_response(struct lsap_cb *self, struct sk_buff *userdata)
558 IRDA_ASSERT(self != NULL, return -1;);
559 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return -1;);
566 __func__, self->slsap_sel, self->dlsap_sel);
572 irlmp_do_lsap_event(self, LM_CONNECT_RESPONSE, userdata);
586 void irlmp_connect_confirm(struct lsap_cb *self, struct sk_buff *skb)
595 IRDA_ASSERT(self != NULL, return;);
596 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return;);
597 IRDA_ASSERT(self->lap != NULL, return;);
599 self->qos = *self->lap->qos;
601 max_seg_size = self->lap->qos->data_size.value-LMP_HEADER;
602 lap_header_size = IRLAP_GET_HEADER_SIZE(self->lap->irlap);
611 if (self->notify.connect_confirm) {
614 self->notify.connect_confirm(self->notify.instance, self,
615 &self->qos, max_seg_size,
683 int irlmp_disconnect_request(struct lsap_cb *self, struct sk_buff *userdata)
687 IRDA_ASSERT(self != NULL, return -1;);
688 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return -1;);
695 if (! test_and_clear_bit(0, &self->connected)) {
707 irlmp_do_lsap_event(self, LM_DISCONNECT_REQUEST, userdata);
716 IRDA_ASSERT(self->lap != NULL, return -1;);
717 IRDA_ASSERT(self->lap->magic == LMP_LAP_MAGIC, return -1;);
718 IRDA_ASSERT(self->lap->lsaps != NULL, return -1;);
720 lsap = hashbin_remove(self->lap->lsaps, (long) self, NULL);
722 self->lap->cache.valid = FALSE;
727 IRDA_ASSERT(lsap == self, return -1;);
729 hashbin_insert(irlmp->unconnected_lsaps, (irda_queue_t *) self,
730 (long) self, NULL);
733 self->dlsap_sel = LSAP_ANY;
734 self->lap = NULL;
745 void irlmp_disconnect_indication(struct lsap_cb *self, LM_REASON reason,
751 IRDA_ASSERT(self != NULL, return;);
752 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return;);
755 __func__, self->slsap_sel, self->dlsap_sel);
761 if (! test_and_clear_bit(0, &self->connected)) {
769 IRDA_ASSERT(self->lap != NULL, return;);
770 IRDA_ASSERT(self->lap->lsaps != NULL, return;);
772 lsap = hashbin_remove(self->lap->lsaps, (long) self, NULL);
774 self->lap->cache.valid = FALSE;
778 IRDA_ASSERT(lsap == self, return;);
782 self->dlsap_sel = LSAP_ANY;
783 self->lap = NULL;
788 if (self->notify.disconnect_indication) {
792 self->notify.disconnect_indication(self->notify.instance,
793 self, reason, skb);
1006 * Function irlmp_discovery_confirm ( self, log)
1107 * Function irlmp_data_request (self, skb)
1119 int irlmp_data_request(struct lsap_cb *self, struct sk_buff *userdata)
1123 IRDA_ASSERT(self != NULL, return -1;);
1124 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return -1;);
1130 ret = irlmp_do_lsap_event(self, LM_DATA_REQUEST, userdata);
1145 void irlmp_data_indication(struct lsap_cb *self, struct sk_buff *skb)
1150 if (self->notify.data_indication) {
1153 self->notify.data_indication(self->notify.instance, self, skb);
1158 * Function irlmp_udata_request (self, skb)
1160 int irlmp_udata_request(struct lsap_cb *self, struct sk_buff *userdata)
1172 ret = irlmp_do_lsap_event(self, LM_UDATA_REQUEST, userdata);
1181 * Function irlmp_udata_indication (self, skb)
1186 void irlmp_udata_indication(struct lsap_cb *self, struct sk_buff *skb)
1190 IRDA_ASSERT(self != NULL, return;);
1191 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return;);
1197 if (self->notify.udata_indication) {
1200 self->notify.udata_indication(self->notify.instance, self,
1206 * Function irlmp_connless_data_request (self, skb)
1209 int irlmp_connless_data_request(struct lsap_cb *self, struct sk_buff *userdata,
1225 if(self != NULL)
1226 userdata->data[0] = self->pid;
1258 * Function irlmp_connless_data_indication (self, skb)
1264 void irlmp_connless_data_indication(struct lsap_cb *self, struct sk_buff *skb)
1268 IRDA_ASSERT(self != NULL, return;);
1269 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return;);
1275 if (self->notify.udata_indication) {
1278 self->notify.udata_indication(self->notify.instance, self,
1291 void irlmp_status_indication(struct lap_cb *self,
1298 curr = (struct lsap_cb *) hashbin_get_first( self->lsaps);
1299 while (NULL != hashbin_find_next(self->lsaps, (long) curr, NULL,
1325 void irlmp_flow_indication(struct lap_cb *self, LOCAL_FLOW flow)
1331 IRDA_ASSERT(self->magic == LMP_LAP_MAGIC, return;);
1336 lsap_todo = HASHBIN_GET_SIZE(self->lsaps);
1344 (IRLAP_GET_TX_QUEUE_LEN(self->irlap) < LAP_HIGH_THRESHOLD)) {
1346 next = self->flow_next;
1349 next = (struct lsap_cb *) hashbin_get_first(self->lsaps);
1351 curr = hashbin_find_next(self->lsaps, (long) next, NULL,
1352 (void *) &self->flow_next);
1356 IRDA_DEBUG(4, "%s() : curr is %p, next was %p and is now %p, still %d to go - queue len = %d\n", __func__, curr, next, self->flow_next, lsap_todo, IRLAP_GET_TX_QUEUE_LEN(self->irlap));
1583 struct lsap_cb *self;
1620 self = (struct lsap_cb *) hashbin_get_first(lap->lsaps);
1621 while (self != NULL) {
1622 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC,
1625 if ((self->slsap_sel == slsap_sel)) {
1627 self->slsap_sel);
1630 self = (struct lsap_cb*) hashbin_get_next(lap->lsaps);
1647 self = (struct lsap_cb *) hashbin_get_first(irlmp->unconnected_lsaps);
1648 while (self != NULL) {
1649 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, goto erruncon;);
1650 if ((self->slsap_sel == slsap_sel)) {
1652 self->slsap_sel);
1655 self = (struct lsap_cb*) hashbin_get_next(irlmp->unconnected_lsaps);
1869 struct lsap_cb *self = v;
1876 self = v;
1877 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return -EINVAL; );
1879 irlsap_state[ self->lsap_state]);
1882 self->slsap_sel, self->dlsap_sel);
1883 seq_printf(seq, "(%s)", self->notify.name);
1903 for (self = (struct lsap_cb *) hashbin_get_first(lap->lsaps);
1904 self != NULL;
1905 self = (struct lsap_cb *)hashbin_get_next(lap->lsaps)) {
1906 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC,
1909 irlsap_state[ self->lsap_state]);
1912 self->slsap_sel, self->dlsap_sel);
1913 seq_printf(seq, "(%s)", self->notify.name);