Lines 86-92
Link Here
|
86 |
int rtbt_hci_dev_send(struct sk_buff *skb) |
86 |
int rtbt_hci_dev_send(struct sk_buff *skb) |
87 |
{ |
87 |
{ |
88 |
struct hci_dev *hdev = (struct hci_dev *)skb->dev; |
88 |
struct hci_dev *hdev = (struct hci_dev *)skb->dev; |
89 |
struct rtbt_os_ctrl *os_ctrl = (struct rtbt_os_ctrl *)hdev->driver_data; |
89 |
struct rtbt_os_ctrl *os_ctrl = (struct rtbt_os_ctrl *)hci_get_drvdata(hdev); |
90 |
struct rtbt_hps_ops *hps_ops; |
90 |
struct rtbt_hps_ops *hps_ops; |
91 |
unsigned char pkt_type; |
91 |
unsigned char pkt_type; |
92 |
int status; |
92 |
int status; |
Lines 136-142
Link Here
|
136 |
|
136 |
|
137 |
case HCI_SCODATA_PKT: |
137 |
case HCI_SCODATA_PKT: |
138 |
printk("-->%s():sco len=%d,time=0x%lx\n", __FUNCTION__, skb->len, jiffies); |
138 |
printk("-->%s():sco len=%d,time=0x%lx\n", __FUNCTION__, skb->len, jiffies); |
139 |
os_ctrl->sco_tx_seq = bt_cb(skb)->tx_seq; |
139 |
os_ctrl->sco_tx_seq = bt_cb(skb)->control.txseq; |
140 |
os_ctrl->sco_time_hci = jiffies; |
140 |
os_ctrl->sco_time_hci = jiffies; |
141 |
|
141 |
|
142 |
status = hps_ops->hci_sco_data(os_ctrl->dev_ctrl, skb->data, skb->len); |
142 |
status = hps_ops->hci_sco_data(os_ctrl->dev_ctrl, skb->data, skb->len); |
Lines 223-229
Link Here
|
223 |
int rtbt_hci_dev_open(struct hci_dev *hdev) |
223 |
int rtbt_hci_dev_open(struct hci_dev *hdev) |
224 |
{ |
224 |
{ |
225 |
NTSTATUS status = STATUS_FAILURE; |
225 |
NTSTATUS status = STATUS_FAILURE; |
226 |
struct rtbt_os_ctrl *os_ctrl = (struct rtbt_os_ctrl *)hdev->driver_data; |
226 |
struct rtbt_os_ctrl *os_ctrl = (struct rtbt_os_ctrl *)hci_get_drvdata(hdev); |
227 |
//struct rtbt_hps_ops *hps_ops; |
227 |
//struct rtbt_hps_ops *hps_ops; |
228 |
|
228 |
|
229 |
printk("-->%s()\n", __FUNCTION__); |
229 |
printk("-->%s()\n", __FUNCTION__); |
Lines 251-257
Link Here
|
251 |
int rtbt_hci_dev_close(struct hci_dev *hdev) |
251 |
int rtbt_hci_dev_close(struct hci_dev *hdev) |
252 |
{ |
252 |
{ |
253 |
NTSTATUS status = STATUS_FAILURE; |
253 |
NTSTATUS status = STATUS_FAILURE; |
254 |
struct rtbt_os_ctrl *os_ctrl = (struct rtbt_os_ctrl *)hdev->driver_data; |
254 |
struct rtbt_os_ctrl *os_ctrl = (struct rtbt_os_ctrl *)hci_get_drvdata(hdev); |
255 |
|
255 |
|
256 |
printk("--->%s()\n", __FUNCTION__); |
256 |
printk("--->%s()\n", __FUNCTION__); |
257 |
|
257 |
|
Lines 295-301
Link Here
|
295 |
|
295 |
|
296 |
printk("--->%s()\n", __FUNCTION__); |
296 |
printk("--->%s()\n", __FUNCTION__); |
297 |
|
297 |
|
298 |
__hci_dev_hold(hdev); |
298 |
hci_dev_hold(hdev); |
299 |
|
299 |
|
300 |
//rtbt_hci_dev_close(hciDev); |
300 |
//rtbt_hci_dev_close(hciDev); |
301 |
/* un-register HCI device */ |
301 |
/* un-register HCI device */ |
Lines 304-313
Link Here
|
304 |
return -1; |
304 |
return -1; |
305 |
} |
305 |
} |
306 |
|
306 |
|
307 |
if (hci_unregister_dev(hdev) < 0) |
307 |
/*if (hci_unregister_dev(hdev) < 0) |
308 |
printk("Can't unregister HCI device %s\n", hdev->name); |
308 |
printk("Can't unregister HCI device %s\n", hdev->name); |
309 |
|
309 |
*/ |
310 |
__hci_dev_put(hdev); |
310 |
hci_unregister_dev(hdev); |
|
|
311 |
hci_dev_put(hdev); |
311 |
|
312 |
|
312 |
printk("<---%s():Success\n", __FUNCTION__); |
313 |
printk("<---%s():Success\n", __FUNCTION__); |
313 |
return 0; |
314 |
return 0; |
Lines 319-325
Link Here
|
319 |
|
320 |
|
320 |
printk("--->%s()\n", __FUNCTION__); |
321 |
printk("--->%s()\n", __FUNCTION__); |
321 |
|
322 |
|
322 |
__hci_dev_hold(hdev); |
323 |
hci_dev_hold(hdev); |
323 |
|
324 |
|
324 |
/* Register HCI device */ |
325 |
/* Register HCI device */ |
325 |
if (hci_register_dev(hdev) < 0) { |
326 |
if (hci_register_dev(hdev) < 0) { |
Lines 327-333
Link Here
|
327 |
return -ENODEV; |
328 |
return -ENODEV; |
328 |
} |
329 |
} |
329 |
|
330 |
|
330 |
__hci_dev_put(hdev); |
331 |
hci_dev_put(hdev); |
331 |
|
332 |
|
332 |
printk("<---%s():Success\n", __FUNCTION__); |
333 |
printk("<---%s():Success\n", __FUNCTION__); |
333 |
return 0; |
334 |
return 0; |
Lines 396-410
Link Here
|
396 |
os_ctrl->if_dev = if_dev; |
397 |
os_ctrl->if_dev = if_dev; |
397 |
os_ctrl->hps_ops->recv = rtbt_hci_dev_receive; |
398 |
os_ctrl->hps_ops->recv = rtbt_hci_dev_receive; |
398 |
|
399 |
|
399 |
hdev->driver_data = os_ctrl; |
400 |
hci_set_drvdata(hdev, os_ctrl); |
400 |
hdev->open = rtbt_hci_dev_open; |
401 |
hdev->open = rtbt_hci_dev_open; |
401 |
hdev->close = rtbt_hci_dev_close; |
402 |
hdev->close = rtbt_hci_dev_close; |
402 |
hdev->flush = rtbt_hci_dev_flush; |
403 |
hdev->flush = rtbt_hci_dev_flush; |
403 |
hdev->send = rtbt_hci_dev_send; |
404 |
hdev->send = rtbt_hci_dev_send; |
404 |
hdev->destruct = rtbt_hci_dev_destruct; |
405 |
// hdev->destruct = rtbt_hci_dev_destruct; |
405 |
hdev->ioctl = rtbt_hci_dev_ioctl; |
406 |
hdev->ioctl = rtbt_hci_dev_ioctl; |
406 |
|
407 |
|
407 |
hdev->owner = THIS_MODULE; |
408 |
// hdev->owner = THIS_MODULE; |
408 |
|
409 |
|
409 |
printk("<--%s():alloc hdev(0x%lx) done\n", __FUNCTION__, (ULONG)hdev); |
410 |
printk("<--%s():alloc hdev(0x%lx) done\n", __FUNCTION__, (ULONG)hdev); |
410 |
|
411 |
|