• 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.36/drivers/bluetooth/

Lines Matching defs:hu

89 static inline void hci_uart_tx_complete(struct hci_uart *hu, int pkt_type)
91 struct hci_dev *hdev = hu->hdev;
109 static inline struct sk_buff *hci_uart_dequeue(struct hci_uart *hu)
111 struct sk_buff *skb = hu->tx_skb;
114 skb = hu->proto->dequeue(hu);
116 hu->tx_skb = NULL;
121 int hci_uart_tx_wakeup(struct hci_uart *hu)
123 struct tty_struct *tty = hu->tty;
124 struct hci_dev *hdev = hu->hdev;
127 if (test_and_set_bit(HCI_UART_SENDING, &hu->tx_state)) {
128 set_bit(HCI_UART_TX_WAKEUP, &hu->tx_state);
135 clear_bit(HCI_UART_TX_WAKEUP, &hu->tx_state);
137 while ((skb = hci_uart_dequeue(hu))) {
146 hu->tx_skb = skb;
150 hci_uart_tx_complete(hu, bt_cb(skb)->pkt_type);
154 if (test_bit(HCI_UART_TX_WAKEUP, &hu->tx_state))
157 clear_bit(HCI_UART_SENDING, &hu->tx_state);
177 struct hci_uart *hu = (struct hci_uart *) hdev->driver_data;
178 struct tty_struct *tty = hu->tty;
182 if (hu->tx_skb) {
183 kfree_skb(hu->tx_skb); hu->tx_skb = NULL;
190 if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
191 hu->proto->flush(hu);
213 struct hci_uart *hu;
223 hu = (struct hci_uart *) hdev->driver_data;
227 hu->proto->enqueue(hu, skb);
229 hci_uart_tx_wakeup(hu);
255 struct hci_uart *hu = (void *) tty->disc_data;
259 if (hu)
267 if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) {
272 tty->disc_data = hu;
273 hu->tty = tty;
276 spin_lock_init(&hu->rx_lock);
295 struct hci_uart *hu = (void *)tty->disc_data;
302 if (hu) {
303 struct hci_dev *hdev = hu->hdev;
308 if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
309 hu->proto->close(hu);
326 struct hci_uart *hu = (void *)tty->disc_data;
330 if (!hu)
335 if (tty != hu->tty)
338 if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
339 hci_uart_tx_wakeup(hu);
356 struct hci_uart *hu = (void *)tty->disc_data;
358 if (!hu || tty != hu->tty)
361 if (!test_bit(HCI_UART_PROTO_SET, &hu->flags))
364 spin_lock(&hu->rx_lock);
365 hu->proto->recv(hu, (void *) data, count);
366 hu->hdev->stat.byte_rx += count;
367 spin_unlock(&hu->rx_lock);
372 static int hci_uart_register_dev(struct hci_uart *hu)
385 hu->hdev = hdev;
388 hdev->driver_data = hu;
401 if (test_bit(HCI_UART_RAW_DEVICE, &hu->hdev_flags))
413 static int hci_uart_set_proto(struct hci_uart *hu, int id)
422 err = p->open(hu);
426 hu->proto = p;
428 err = hci_uart_register_dev(hu);
430 p->close(hu);
453 struct hci_uart *hu = (void *)tty->disc_data;
459 if (!hu)
464 if (!test_and_set_bit(HCI_UART_PROTO_SET, &hu->flags)) {
465 err = hci_uart_set_proto(hu, arg);
467 clear_bit(HCI_UART_PROTO_SET, &hu->flags);
475 if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
476 return hu->proto->id;
480 if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
481 return hu->hdev->id;
485 if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
487 hu->hdev_flags = arg;
491 return hu->hdev_flags;