Lines Matching refs:dlc
62 struct rfcomm_dlc *dlc; member
74 static void rfcomm_dev_data_ready(struct rfcomm_dlc *dlc, struct sk_buff *skb);
75 static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err);
76 static void rfcomm_dev_modem_status(struct rfcomm_dlc *dlc, u8 v24_sig);
83 struct rfcomm_dlc *dlc = dev->dlc; in rfcomm_dev_destruct() local
85 BT_DBG("dev %p dlc %p", dev, dlc); in rfcomm_dev_destruct()
87 rfcomm_dlc_lock(dlc); in rfcomm_dev_destruct()
89 if (dlc->owner == dev) in rfcomm_dev_destruct()
90 dlc->owner = NULL; in rfcomm_dev_destruct()
91 rfcomm_dlc_unlock(dlc); in rfcomm_dev_destruct()
93 rfcomm_dlc_put(dlc); in rfcomm_dev_destruct()
115 err = rfcomm_dlc_open(dev->dlc, &dev->src, &dev->dst, dev->channel); in rfcomm_dev_activate()
126 return (dev->dlc->state == BT_CONNECTED); in rfcomm_dev_carrier_raised()
138 rfcomm_dlc_close(dev->dlc, 0); in rfcomm_dev_shutdown()
218 struct rfcomm_dlc *dlc) in __rfcomm_dev_add() argument
277 rfcomm_dlc_lock(dlc); in __rfcomm_dev_add()
280 struct sock *sk = dlc->owner; in __rfcomm_dev_add()
285 rfcomm_dlc_throttle(dlc); in __rfcomm_dev_add()
294 dlc->data_ready = rfcomm_dev_data_ready; in __rfcomm_dev_add()
295 dlc->state_change = rfcomm_dev_state_change; in __rfcomm_dev_add()
296 dlc->modem_status = rfcomm_dev_modem_status; in __rfcomm_dev_add()
298 dlc->owner = dev; in __rfcomm_dev_add()
299 dev->dlc = dlc; in __rfcomm_dev_add()
301 rfcomm_dev_modem_status(dlc, dlc->remote_v24_sig); in __rfcomm_dev_add()
303 rfcomm_dlc_unlock(dlc); in __rfcomm_dev_add()
318 static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc) in rfcomm_dev_add() argument
325 dev = __rfcomm_dev_add(req, dlc); in rfcomm_dev_add()
327 rfcomm_dlc_put(dlc); in rfcomm_dev_add()
354 struct rfcomm_dlc *dlc = dev->dlc; in rfcomm_room() local
359 return max(0, pending) * dlc->mtu; in rfcomm_room()
394 struct rfcomm_dlc *dlc; in __rfcomm_create_dev() local
410 dlc = rfcomm_pi(sk)->dlc; in __rfcomm_create_dev()
411 rfcomm_dlc_hold(dlc); in __rfcomm_create_dev()
414 dlc = rfcomm_dlc_exists(&req.src, &req.dst, req.channel); in __rfcomm_create_dev()
415 if (IS_ERR(dlc)) in __rfcomm_create_dev()
416 return PTR_ERR(dlc); in __rfcomm_create_dev()
417 if (dlc) in __rfcomm_create_dev()
419 dlc = rfcomm_dlc_alloc(GFP_KERNEL); in __rfcomm_create_dev()
420 if (!dlc) in __rfcomm_create_dev()
424 id = rfcomm_dev_add(&req, dlc); in __rfcomm_create_dev()
464 rfcomm_dlc_close(dev->dlc, 0); in __rfcomm_release_dev()
533 (di + n)->state = dev->dlc->state; in rfcomm_get_dev_list()
570 di.state = dev->dlc->state; in rfcomm_get_dev_info()
603 static void rfcomm_dev_data_ready(struct rfcomm_dlc *dlc, struct sk_buff *skb) in rfcomm_dev_data_ready() argument
605 struct rfcomm_dev *dev = dlc->owner; in rfcomm_dev_data_ready()
617 BT_DBG("dlc %p len %d", dlc, skb->len); in rfcomm_dev_data_ready()
625 static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err) in rfcomm_dev_state_change() argument
627 struct rfcomm_dev *dev = dlc->owner; in rfcomm_dev_state_change()
631 BT_DBG("dlc %p dev %p err %d", dlc, dev, err); in rfcomm_dev_state_change()
634 if (dlc->state == BT_CONNECTED) { in rfcomm_dev_state_change()
638 } else if (dlc->state == BT_CLOSED) in rfcomm_dev_state_change()
642 static void rfcomm_dev_modem_status(struct rfcomm_dlc *dlc, u8 v24_sig) in rfcomm_dev_modem_status() argument
644 struct rfcomm_dev *dev = dlc->owner; in rfcomm_dev_modem_status()
648 BT_DBG("dlc %p dev %p v24_sig 0x%02x", dlc, dev, v24_sig); in rfcomm_dev_modem_status()
668 rfcomm_dlc_lock(dev->dlc); in rfcomm_tty_copy_pending()
676 rfcomm_dlc_unlock(dev->dlc); in rfcomm_tty_copy_pending()
691 rfcomm_dlc_lock(dev->dlc); in rfcomm_tty_cleanup()
693 rfcomm_dlc_unlock(dev->dlc); in rfcomm_tty_cleanup()
699 skb_queue_purge(&dev->dlc->tx_queue); in rfcomm_tty_cleanup()
711 struct rfcomm_dlc *dlc; in rfcomm_tty_install() local
718 dlc = dev->dlc; in rfcomm_tty_install()
721 rfcomm_dlc_lock(dlc); in rfcomm_tty_install()
723 rfcomm_dlc_unlock(dlc); in rfcomm_tty_install()
767 rfcomm_dlc_unthrottle(dev->dlc); in rfcomm_tty_open()
776 BT_DBG("tty %p dev %p dlc %p opened %d", tty, dev, dev->dlc, in rfcomm_tty_close()
786 struct rfcomm_dlc *dlc = dev->dlc; in rfcomm_tty_write() local
793 size = min_t(size_t, count, dlc->mtu); in rfcomm_tty_write()
803 rfcomm_dlc_send_noerror(dlc, skb); in rfcomm_tty_write()
817 if (dev && dev->dlc) in rfcomm_tty_write_room()
872 if (!dev || !dev->dlc || !dev->dlc->session) in rfcomm_tty_set_termios()
993 rfcomm_send_rpn(dev->dlc->session, 1, dev->dlc->dlci, baud, in rfcomm_tty_set_termios()
1004 rfcomm_dlc_throttle(dev->dlc); in rfcomm_tty_throttle()
1013 rfcomm_dlc_unthrottle(dev->dlc); in rfcomm_tty_unthrottle()
1022 if (!dev || !dev->dlc) in rfcomm_tty_chars_in_buffer()
1025 if (!skb_queue_empty(&dev->dlc->tx_queue)) in rfcomm_tty_chars_in_buffer()
1026 return dev->dlc->mtu; in rfcomm_tty_chars_in_buffer()
1037 if (!dev || !dev->dlc) in rfcomm_tty_flush_buffer()
1040 skb_queue_purge(&dev->dlc->tx_queue); in rfcomm_tty_flush_buffer()
1075 struct rfcomm_dlc *dlc = dev->dlc; in rfcomm_tty_tiocmset() local
1080 rfcomm_dlc_get_modem_status(dlc, &v24_sig); in rfcomm_tty_tiocmset()
1100 rfcomm_dlc_set_modem_status(dlc, v24_sig); in rfcomm_tty_tiocmset()