linux/net/bluetooth/rfcomm/tty.c

/*
   RFCOMM implementation for Linux Bluetooth stack (BlueZ).
   Copyright (C) 2002 Maxim Krasnyansky <[email protected]>
   Copyright (C) 2002 Marcel Holtmann <[email protected]>

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License version 2 as
   published by the Free Software Foundation;

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
   SOFTWARE IS DISCLAIMED.
*/

/*
 * RFCOMM TTY.
 */

#include <linux/module.h>

#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>

#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/rfcomm.h>

#define RFCOMM_TTY_PORTS
#define RFCOMM_TTY_MAJOR
#define RFCOMM_TTY_MINOR

static DEFINE_MUTEX(rfcomm_ioctl_mutex);
static struct tty_driver *rfcomm_tty_driver;

struct rfcomm_dev {};

static LIST_HEAD(rfcomm_dev_list);
static DEFINE_MUTEX(rfcomm_dev_lock);

static void rfcomm_dev_data_ready(struct rfcomm_dlc *dlc, struct sk_buff *skb);
static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err);
static void rfcomm_dev_modem_status(struct rfcomm_dlc *dlc, u8 v24_sig);

/* ---- Device functions ---- */

static void rfcomm_dev_destruct(struct tty_port *port)
{}

/* device-specific initialization: open the dlc */
static int rfcomm_dev_activate(struct tty_port *port, struct tty_struct *tty)
{}

/* we block the open until the dlc->state becomes BT_CONNECTED */
static bool rfcomm_dev_carrier_raised(struct tty_port *port)
{}

/* device-specific cleanup: close the dlc */
static void rfcomm_dev_shutdown(struct tty_port *port)
{}

static const struct tty_port_operations rfcomm_port_ops =;

static struct rfcomm_dev *__rfcomm_dev_lookup(int id)
{}

static struct rfcomm_dev *rfcomm_dev_get(int id)
{}

static void rfcomm_reparent_device(struct rfcomm_dev *dev)
{}

static ssize_t address_show(struct device *tty_dev,
			    struct device_attribute *attr, char *buf)
{}

static ssize_t channel_show(struct device *tty_dev,
			    struct device_attribute *attr, char *buf)
{}

static DEVICE_ATTR_RO(address);
static DEVICE_ATTR_RO(channel);

static struct rfcomm_dev *__rfcomm_dev_add(struct rfcomm_dev_req *req,
					   struct rfcomm_dlc *dlc)
{}

static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
{}

/* ---- Send buffer ---- */
static inline unsigned int rfcomm_room(struct rfcomm_dev *dev)
{}

static void rfcomm_wfree(struct sk_buff *skb)
{}

static void rfcomm_set_owner_w(struct sk_buff *skb, struct rfcomm_dev *dev)
{}

static struct sk_buff *rfcomm_wmalloc(struct rfcomm_dev *dev, unsigned long size, gfp_t priority)
{}

/* ---- Device IOCTLs ---- */

#define NOCAP_FLAGS

static int __rfcomm_create_dev(struct sock *sk, void __user *arg)
{}

static int __rfcomm_release_dev(void __user *arg)
{}

static int rfcomm_create_dev(struct sock *sk, void __user *arg)
{}

static int rfcomm_release_dev(void __user *arg)
{}

static int rfcomm_get_dev_list(void __user *arg)
{}

static int rfcomm_get_dev_info(void __user *arg)
{}

int rfcomm_dev_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)
{}

/* ---- DLC callbacks ---- */
static void rfcomm_dev_data_ready(struct rfcomm_dlc *dlc, struct sk_buff *skb)
{}

static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err)
{}

static void rfcomm_dev_modem_status(struct rfcomm_dlc *dlc, u8 v24_sig)
{}

/* ---- TTY functions ---- */
static void rfcomm_tty_copy_pending(struct rfcomm_dev *dev)
{}

/* do the reverse of install, clearing the tty fields and releasing the
 * reference to tty_port
 */
static void rfcomm_tty_cleanup(struct tty_struct *tty)
{}

/* we acquire the tty_port reference since it's here the tty is first used
 * by setting the termios. We also populate the driver_data field and install
 * the tty port
 */
static int rfcomm_tty_install(struct tty_driver *driver, struct tty_struct *tty)
{}

static int rfcomm_tty_open(struct tty_struct *tty, struct file *filp)
{}

static void rfcomm_tty_close(struct tty_struct *tty, struct file *filp)
{}

static ssize_t rfcomm_tty_write(struct tty_struct *tty, const u8 *buf,
				size_t count)
{}

static unsigned int rfcomm_tty_write_room(struct tty_struct *tty)
{}

static int rfcomm_tty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
{}

static void rfcomm_tty_set_termios(struct tty_struct *tty,
				   const struct ktermios *old)
{}

static void rfcomm_tty_throttle(struct tty_struct *tty)
{}

static void rfcomm_tty_unthrottle(struct tty_struct *tty)
{}

static unsigned int rfcomm_tty_chars_in_buffer(struct tty_struct *tty)
{}

static void rfcomm_tty_flush_buffer(struct tty_struct *tty)
{}

static void rfcomm_tty_send_xchar(struct tty_struct *tty, u8 ch)
{}

static void rfcomm_tty_wait_until_sent(struct tty_struct *tty, int timeout)
{}

static void rfcomm_tty_hangup(struct tty_struct *tty)
{}

static int rfcomm_tty_tiocmget(struct tty_struct *tty)
{}

static int rfcomm_tty_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear)
{}

/* ---- TTY structure ---- */

static const struct tty_operations rfcomm_ops =;

int __init rfcomm_init_ttys(void)
{}

void rfcomm_cleanup_ttys(void)
{}