|
Lines 103-108
static void rfcomm_dev_destruct(struct t
Link Here
|
| 103 |
module_put(THIS_MODULE); |
103 |
module_put(THIS_MODULE); |
| 104 |
} |
104 |
} |
| 105 |
|
105 |
|
|
|
106 |
static struct device *rfcomm_get_device(struct rfcomm_dev *dev) |
| 107 |
{ |
| 108 |
struct hci_dev *hdev; |
| 109 |
struct hci_conn *conn; |
| 110 |
|
| 111 |
hdev = hci_get_route(&dev->dst, &dev->src); |
| 112 |
if (!hdev) |
| 113 |
return NULL; |
| 114 |
|
| 115 |
conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &dev->dst); |
| 116 |
|
| 117 |
hci_dev_put(hdev); |
| 118 |
|
| 119 |
return conn ? &conn->dev : NULL; |
| 120 |
} |
| 121 |
|
| 106 |
/* device-specific initialization: open the dlc */ |
122 |
/* device-specific initialization: open the dlc */ |
| 107 |
static int rfcomm_dev_activate(struct tty_port *port, struct tty_struct *tty) |
123 |
static int rfcomm_dev_activate(struct tty_port *port, struct tty_struct *tty) |
| 108 |
{ |
124 |
{ |
|
Lines 169-190
static struct rfcomm_dev *rfcomm_dev_get
Link Here
|
| 169 |
return dev; |
185 |
return dev; |
| 170 |
} |
186 |
} |
| 171 |
|
187 |
|
| 172 |
static struct device *rfcomm_get_device(struct rfcomm_dev *dev) |
|
|
| 173 |
{ |
| 174 |
struct hci_dev *hdev; |
| 175 |
struct hci_conn *conn; |
| 176 |
|
| 177 |
hdev = hci_get_route(&dev->dst, &dev->src); |
| 178 |
if (!hdev) |
| 179 |
return NULL; |
| 180 |
|
| 181 |
conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &dev->dst); |
| 182 |
|
| 183 |
hci_dev_put(hdev); |
| 184 |
|
| 185 |
return conn ? &conn->dev : NULL; |
| 186 |
} |
| 187 |
|
| 188 |
static ssize_t show_address(struct device *tty_dev, struct device_attribute *attr, char *buf) |
188 |
static ssize_t show_address(struct device *tty_dev, struct device_attribute *attr, char *buf) |
| 189 |
{ |
189 |
{ |
| 190 |
struct rfcomm_dev *dev = dev_get_drvdata(tty_dev); |
190 |
struct rfcomm_dev *dev = dev_get_drvdata(tty_dev); |