Lines Matching refs:dlc
63 struct rfcomm_dlc *dlc; member
75 static void rfcomm_dev_data_ready(struct rfcomm_dlc *dlc, struct sk_buff *skb);
76 static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err);
77 static void rfcomm_dev_modem_status(struct rfcomm_dlc *dlc, u8 v24_sig);
84 struct rfcomm_dlc *dlc = dev->dlc; in rfcomm_dev_destruct() local
86 BT_DBG("dev %p dlc %p", dev, dlc); in rfcomm_dev_destruct()
88 rfcomm_dlc_lock(dlc); in rfcomm_dev_destruct()
90 if (dlc->owner == dev) in rfcomm_dev_destruct()
91 dlc->owner = NULL; in rfcomm_dev_destruct()
92 rfcomm_dlc_unlock(dlc); in rfcomm_dev_destruct()
94 rfcomm_dlc_put(dlc); in rfcomm_dev_destruct()
116 err = rfcomm_dlc_open(dev->dlc, &dev->src, &dev->dst, dev->channel); in rfcomm_dev_activate()
127 return (dev->dlc->state == BT_CONNECTED); in rfcomm_dev_carrier_raised()
139 rfcomm_dlc_close(dev->dlc, 0); in rfcomm_dev_shutdown()
217 struct rfcomm_dlc *dlc) in __rfcomm_dev_add() argument
276 rfcomm_dlc_lock(dlc); in __rfcomm_dev_add()
279 struct sock *sk = dlc->owner; in __rfcomm_dev_add()
284 rfcomm_dlc_throttle(dlc); in __rfcomm_dev_add()
293 dlc->data_ready = rfcomm_dev_data_ready; in __rfcomm_dev_add()
294 dlc->state_change = rfcomm_dev_state_change; in __rfcomm_dev_add()
295 dlc->modem_status = rfcomm_dev_modem_status; in __rfcomm_dev_add()
297 dlc->owner = dev; in __rfcomm_dev_add()
298 dev->dlc = dlc; in __rfcomm_dev_add()
300 rfcomm_dev_modem_status(dlc, dlc->remote_v24_sig); in __rfcomm_dev_add()
302 rfcomm_dlc_unlock(dlc); in __rfcomm_dev_add()
317 static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc) in rfcomm_dev_add() argument
324 dev = __rfcomm_dev_add(req, dlc); in rfcomm_dev_add()
326 rfcomm_dlc_put(dlc); in rfcomm_dev_add()
353 struct rfcomm_dlc *dlc = dev->dlc; in rfcomm_room() local
358 return max(0, pending) * dlc->mtu; in rfcomm_room()
393 struct rfcomm_dlc *dlc; in __rfcomm_create_dev() local
409 dlc = rfcomm_pi(sk)->dlc; in __rfcomm_create_dev()
410 rfcomm_dlc_hold(dlc); in __rfcomm_create_dev()
413 dlc = rfcomm_dlc_exists(&req.src, &req.dst, req.channel); in __rfcomm_create_dev()
414 if (IS_ERR(dlc)) in __rfcomm_create_dev()
415 return PTR_ERR(dlc); in __rfcomm_create_dev()
416 else if (dlc) { in __rfcomm_create_dev()
417 rfcomm_dlc_put(dlc); in __rfcomm_create_dev()
420 dlc = rfcomm_dlc_alloc(GFP_KERNEL); in __rfcomm_create_dev()
421 if (!dlc) in __rfcomm_create_dev()
425 id = rfcomm_dev_add(&req, dlc); in __rfcomm_create_dev()
465 rfcomm_dlc_close(dev->dlc, 0); in __rfcomm_release_dev()
534 (di + n)->state = dev->dlc->state; in rfcomm_get_dev_list()
571 di.state = dev->dlc->state; in rfcomm_get_dev_info()
604 static void rfcomm_dev_data_ready(struct rfcomm_dlc *dlc, struct sk_buff *skb) in rfcomm_dev_data_ready() argument
606 struct rfcomm_dev *dev = dlc->owner; in rfcomm_dev_data_ready()
618 BT_DBG("dlc %p len %d", dlc, skb->len); in rfcomm_dev_data_ready()
626 static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err) in rfcomm_dev_state_change() argument
628 struct rfcomm_dev *dev = dlc->owner; in rfcomm_dev_state_change()
632 BT_DBG("dlc %p dev %p err %d", dlc, dev, err); in rfcomm_dev_state_change()
635 if (dlc->state == BT_CONNECTED) { in rfcomm_dev_state_change()
639 } else if (dlc->state == BT_CLOSED) in rfcomm_dev_state_change()
643 static void rfcomm_dev_modem_status(struct rfcomm_dlc *dlc, u8 v24_sig) in rfcomm_dev_modem_status() argument
645 struct rfcomm_dev *dev = dlc->owner; in rfcomm_dev_modem_status()
649 BT_DBG("dlc %p dev %p v24_sig 0x%02x", dlc, dev, v24_sig); in rfcomm_dev_modem_status()
669 rfcomm_dlc_lock(dev->dlc); in rfcomm_tty_copy_pending()
677 rfcomm_dlc_unlock(dev->dlc); in rfcomm_tty_copy_pending()
692 rfcomm_dlc_lock(dev->dlc); in rfcomm_tty_cleanup()
694 rfcomm_dlc_unlock(dev->dlc); in rfcomm_tty_cleanup()
700 skb_queue_purge(&dev->dlc->tx_queue); in rfcomm_tty_cleanup()
712 struct rfcomm_dlc *dlc; in rfcomm_tty_install() local
719 dlc = dev->dlc; in rfcomm_tty_install()
722 rfcomm_dlc_lock(dlc); in rfcomm_tty_install()
724 rfcomm_dlc_unlock(dlc); in rfcomm_tty_install()
768 rfcomm_dlc_unthrottle(dev->dlc); in rfcomm_tty_open()
777 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(uint, 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()
883 if (!dev || !dev->dlc || !dev->dlc->session) in rfcomm_tty_set_termios()
1004 rfcomm_send_rpn(dev->dlc->session, 1, dev->dlc->dlci, baud, in rfcomm_tty_set_termios()
1015 rfcomm_dlc_throttle(dev->dlc); in rfcomm_tty_throttle()
1024 rfcomm_dlc_unthrottle(dev->dlc); in rfcomm_tty_unthrottle()
1033 if (!dev || !dev->dlc) in rfcomm_tty_chars_in_buffer()
1036 if (!skb_queue_empty(&dev->dlc->tx_queue)) in rfcomm_tty_chars_in_buffer()
1037 return dev->dlc->mtu; in rfcomm_tty_chars_in_buffer()
1048 if (!dev || !dev->dlc) in rfcomm_tty_flush_buffer()
1051 skb_queue_purge(&dev->dlc->tx_queue); in rfcomm_tty_flush_buffer()
1086 struct rfcomm_dlc *dlc = dev->dlc; in rfcomm_tty_tiocmset() local
1091 rfcomm_dlc_get_modem_status(dlc, &v24_sig); in rfcomm_tty_tiocmset()
1111 rfcomm_dlc_set_modem_status(dlc, v24_sig); in rfcomm_tty_tiocmset()