Lines Matching refs:info

129 static void dtl1_write_wakeup(struct dtl1_info *info)  in dtl1_write_wakeup()  argument
131 if (!info) { in dtl1_write_wakeup()
136 if (test_bit(XMIT_WAITING, &(info->tx_state))) { in dtl1_write_wakeup()
137 set_bit(XMIT_WAKEUP, &(info->tx_state)); in dtl1_write_wakeup()
141 if (test_and_set_bit(XMIT_SENDING, &(info->tx_state))) { in dtl1_write_wakeup()
142 set_bit(XMIT_WAKEUP, &(info->tx_state)); in dtl1_write_wakeup()
147 unsigned int iobase = info->p_dev->resource[0]->start; in dtl1_write_wakeup()
151 clear_bit(XMIT_WAKEUP, &(info->tx_state)); in dtl1_write_wakeup()
153 if (!pcmcia_dev_present(info->p_dev)) in dtl1_write_wakeup()
156 skb = skb_dequeue(&(info->txq)); in dtl1_write_wakeup()
164 set_bit(XMIT_WAITING, &(info->tx_state)); in dtl1_write_wakeup()
168 skb_queue_head(&(info->txq), skb); in dtl1_write_wakeup()
171 info->hdev->stat.byte_tx += len; in dtl1_write_wakeup()
173 } while (test_bit(XMIT_WAKEUP, &(info->tx_state))); in dtl1_write_wakeup()
175 clear_bit(XMIT_SENDING, &(info->tx_state)); in dtl1_write_wakeup()
179 static void dtl1_control(struct dtl1_info *info, struct sk_buff *skb) in dtl1_control() argument
191 if (((info->flowmask & 0x07) == 0) && ((flowmask & 0x07) != 0)) { in dtl1_control()
192 clear_bit(XMIT_WAITING, &(info->tx_state)); in dtl1_control()
193 dtl1_write_wakeup(info); in dtl1_control()
196 info->flowmask = flowmask; in dtl1_control()
202 static void dtl1_receive(struct dtl1_info *info) in dtl1_receive() argument
208 if (!info) { in dtl1_receive()
213 iobase = info->p_dev->resource[0]->start; in dtl1_receive()
216 info->hdev->stat.byte_rx++; in dtl1_receive()
219 if (info->rx_skb == NULL) { in dtl1_receive()
220 info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC); in dtl1_receive()
221 if (!info->rx_skb) { in dtl1_receive()
223 info->rx_state = RECV_WAIT_NSH; in dtl1_receive()
224 info->rx_count = NSHL; in dtl1_receive()
229 skb_put_u8(info->rx_skb, inb(iobase + UART_RX)); in dtl1_receive()
230 nsh = (struct nsh *)info->rx_skb->data; in dtl1_receive()
232 info->rx_count--; in dtl1_receive()
234 if (info->rx_count == 0) { in dtl1_receive()
236 switch (info->rx_state) { in dtl1_receive()
238 info->rx_state = RECV_WAIT_DATA; in dtl1_receive()
239 info->rx_count = nsh->len + (nsh->len & 0x0001); in dtl1_receive()
242 hci_skb_pkt_type(info->rx_skb) = nsh->type; in dtl1_receive()
246 info->rx_skb->tail--; in dtl1_receive()
247 info->rx_skb->len--; in dtl1_receive()
251 skb_pull(info->rx_skb, NSHL); in dtl1_receive()
253 switch (hci_skb_pkt_type(info->rx_skb)) { in dtl1_receive()
256 dtl1_control(info, info->rx_skb); in dtl1_receive()
262 hci_skb_pkt_type(info->rx_skb) &= 0x0f; in dtl1_receive()
263 hci_recv_frame(info->hdev, info->rx_skb); in dtl1_receive()
268 hci_skb_pkt_type(info->rx_skb)); in dtl1_receive()
269 kfree_skb(info->rx_skb); in dtl1_receive()
273 info->rx_state = RECV_WAIT_NSH; in dtl1_receive()
274 info->rx_count = NSHL; in dtl1_receive()
275 info->rx_skb = NULL; in dtl1_receive()
291 struct dtl1_info *info = dev_inst; in dtl1_interrupt() local
298 if (!info || !info->hdev) in dtl1_interrupt()
302 iobase = info->p_dev->resource[0]->start; in dtl1_interrupt()
304 spin_lock(&(info->lock)); in dtl1_interrupt()
319 dtl1_receive(info); in dtl1_interrupt()
324 dtl1_write_wakeup(info); in dtl1_interrupt()
342 if (info->ri_latch ^ (msr & UART_MSR_RI)) { in dtl1_interrupt()
343 info->ri_latch = msr & UART_MSR_RI; in dtl1_interrupt()
344 clear_bit(XMIT_WAITING, &(info->tx_state)); in dtl1_interrupt()
345 dtl1_write_wakeup(info); in dtl1_interrupt()
349 spin_unlock(&(info->lock)); in dtl1_interrupt()
367 struct dtl1_info *info = hci_get_drvdata(hdev); in dtl1_hci_flush() local
370 skb_queue_purge(&(info->txq)); in dtl1_hci_flush()
386 struct dtl1_info *info = hci_get_drvdata(hdev); in dtl1_hci_send_frame() local
421 skb_queue_tail(&(info->txq), s); in dtl1_hci_send_frame()
423 dtl1_write_wakeup(info); in dtl1_hci_send_frame()
435 static int dtl1_open(struct dtl1_info *info) in dtl1_open() argument
438 unsigned int iobase = info->p_dev->resource[0]->start; in dtl1_open()
441 spin_lock_init(&(info->lock)); in dtl1_open()
443 skb_queue_head_init(&(info->txq)); in dtl1_open()
445 info->rx_state = RECV_WAIT_NSH; in dtl1_open()
446 info->rx_count = NSHL; in dtl1_open()
447 info->rx_skb = NULL; in dtl1_open()
449 set_bit(XMIT_WAITING, &(info->tx_state)); in dtl1_open()
458 info->hdev = hdev; in dtl1_open()
461 hci_set_drvdata(hdev, info); in dtl1_open()
462 SET_HCIDEV_DEV(hdev, &info->p_dev->dev); in dtl1_open()
469 spin_lock_irqsave(&(info->lock), flags); in dtl1_open()
481 info->ri_latch = inb(info->p_dev->resource[0]->start + UART_MSR) in dtl1_open()
487 spin_unlock_irqrestore(&(info->lock), flags); in dtl1_open()
495 info->hdev = NULL; in dtl1_open()
504 static int dtl1_close(struct dtl1_info *info) in dtl1_close() argument
507 unsigned int iobase = info->p_dev->resource[0]->start; in dtl1_close()
508 struct hci_dev *hdev = info->hdev; in dtl1_close()
515 spin_lock_irqsave(&(info->lock), flags); in dtl1_close()
523 spin_unlock_irqrestore(&(info->lock), flags); in dtl1_close()
533 struct dtl1_info *info; in dtl1_probe() local
536 info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); in dtl1_probe()
537 if (!info) in dtl1_probe()
540 info->p_dev = link; in dtl1_probe()
541 link->priv = info; in dtl1_probe()
551 struct dtl1_info *info = link->priv; in dtl1_detach() local
553 dtl1_close(info); in dtl1_detach()
570 struct dtl1_info *info = link->priv; in dtl1_config() local
587 ret = dtl1_open(info); in dtl1_config()