• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6/drivers/bluetooth/

Lines Matching refs:ll

97 	struct ll_struct *ll = hu->priv;
116 skb_queue_tail(&ll->txq, skb);
124 struct ll_struct *ll;
128 ll = kzalloc(sizeof(*ll), GFP_ATOMIC);
129 if (!ll)
132 skb_queue_head_init(&ll->txq);
133 skb_queue_head_init(&ll->tx_wait_q);
134 spin_lock_init(&ll->hcill_lock);
136 ll->hcill_state = HCILL_AWAKE;
138 hu->priv = ll;
146 struct ll_struct *ll = hu->priv;
150 skb_queue_purge(&ll->tx_wait_q);
151 skb_queue_purge(&ll->txq);
159 struct ll_struct *ll = hu->priv;
163 skb_queue_purge(&ll->tx_wait_q);
164 skb_queue_purge(&ll->txq);
166 kfree_skb(ll->rx_skb);
170 kfree(ll);
182 static void __ll_do_awake(struct ll_struct *ll)
186 while ((skb = skb_dequeue(&ll->tx_wait_q)))
187 skb_queue_tail(&ll->txq, skb);
189 ll->hcill_state = HCILL_AWAKE;
198 struct ll_struct *ll = hu->priv;
203 spin_lock_irqsave(&ll->hcill_lock, flags);
205 switch (ll->hcill_state) {
228 BT_ERR("received HCILL_WAKE_UP_IND in state %ld", ll->hcill_state);
233 __ll_do_awake(ll);
236 spin_unlock_irqrestore(&ll->hcill_lock, flags);
248 struct ll_struct *ll = hu->priv;
253 spin_lock_irqsave(&ll->hcill_lock, flags);
256 if (ll->hcill_state != HCILL_AWAKE)
257 BT_ERR("ERR: HCILL_GO_TO_SLEEP_IND in state %ld", ll->hcill_state);
266 ll->hcill_state = HCILL_ASLEEP;
269 spin_unlock_irqrestore(&ll->hcill_lock, flags);
281 struct ll_struct *ll = hu->priv;
286 spin_lock_irqsave(&ll->hcill_lock, flags);
289 if (ll->hcill_state != HCILL_ASLEEP_TO_AWAKE)
290 BT_ERR("received HCILL_WAKE_UP_ACK in state %ld", ll->hcill_state);
293 __ll_do_awake(ll);
295 spin_unlock_irqrestore(&ll->hcill_lock, flags);
306 struct ll_struct *ll = hu->priv;
314 spin_lock_irqsave(&ll->hcill_lock, flags);
317 switch (ll->hcill_state) {
320 skb_queue_tail(&ll->txq, skb);
325 skb_queue_tail(&ll->tx_wait_q, skb);
331 ll->hcill_state = HCILL_ASLEEP_TO_AWAKE;
336 skb_queue_tail(&ll->tx_wait_q, skb);
339 BT_ERR("illegal hcill state: %ld (losing packet)", ll->hcill_state);
344 spin_unlock_irqrestore(&ll->hcill_lock, flags);
349 static inline int ll_check_data_len(struct ll_struct *ll, int len)
351 register int room = skb_tailroom(ll->rx_skb);
356 hci_recv_frame(ll->rx_skb);
359 kfree_skb(ll->rx_skb);
361 ll->rx_state = HCILL_W4_DATA;
362 ll->rx_count = len;
366 ll->rx_state = HCILL_W4_PACKET_TYPE;
367 ll->rx_skb = NULL;
368 ll->rx_count = 0;
376 struct ll_struct *ll = hu->priv;
383 BT_DBG("hu %p count %d rx_state %ld rx_count %ld", hu, count, ll->rx_state, ll->rx_count);
387 if (ll->rx_count) {
388 len = min_t(unsigned int, ll->rx_count, count);
389 memcpy(skb_put(ll->rx_skb, len), ptr, len);
390 ll->rx_count -= len; count -= len; ptr += len;
392 if (ll->rx_count)
395 switch (ll->rx_state) {
398 hci_recv_frame(ll->rx_skb);
400 ll->rx_state = HCILL_W4_PACKET_TYPE;
401 ll->rx_skb = NULL;
405 eh = hci_event_hdr(ll->rx_skb);
409 ll_check_data_len(ll, eh->plen);
413 ah = hci_acl_hdr(ll->rx_skb);
418 ll_check_data_len(ll, dlen);
422 sh = hci_sco_hdr(ll->rx_skb);
426 ll_check_data_len(ll, sh->dlen);
435 ll->rx_state = HCILL_W4_EVENT_HDR;
436 ll->rx_count = HCI_EVENT_HDR_SIZE;
442 ll->rx_state = HCILL_W4_ACL_HDR;
443 ll->rx_count = HCI_ACL_HDR_SIZE;
449 ll->rx_state = HCILL_W4_SCO_HDR;
450 ll->rx_count = HCI_SCO_HDR_SIZE;
463 BT_ERR("received HCILL_GO_TO_SLEEP_ACK (in state %ld)", ll->hcill_state);
489 ll->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC);
490 if (!ll->rx_skb) {
492 ll->rx_state = HCILL_W4_PACKET_TYPE;
493 ll->rx_count = 0;
497 ll->rx_skb->dev = (void *) hu->hdev;
498 bt_cb(ll->rx_skb)->pkt_type = type;
506 struct ll_struct *ll = hu->priv;
507 return skb_dequeue(&ll->txq);