25 #include <linux/kernel.h>
26 #include <linux/module.h>
28 #include <linux/slab.h>
29 #include <linux/types.h>
30 #include <linux/sched.h>
31 #include <linux/errno.h>
68 #define REG_PC_RRT 0x10
69 #define REG_PC_WRT 0x11
70 #define REG_RTC_STAT 0x12
71 #define REG_RTC_SET 0x12
72 #define REG_INTRD 0x13
73 #define REG_CL_INTRD 0x13
74 #define REG_EN_INTRD 0x14
75 #define REG_MD_STAT 0x20
85 skb->
data[0] = (skb->
len & 0x0000ff);
86 skb->
data[1] = (skb->
len & 0x00ff00) >> 8;
87 skb->
data[2] = (skb->
len & 0xff0000) >> 16;
97 data->
hdev->stat.byte_tx += skb->
len;
115 err = btsdio_tx_packet(data, skb);
117 data->
hdev->stat.err_tx++;
126 static int btsdio_rx_packet(
struct btsdio_data *data)
138 len =
hdr[0] | (
hdr[1] << 8) | (
hdr[2] << 16);
139 if (len < 4 || len > 65543)
158 data->
hdev->stat.byte_rx +=
len;
160 skb->
dev = (
void *) data->
hdev;
183 if (btsdio_rx_packet(data) < 0) {
184 data->
hdev->stat.err_rx++;
226 static int btsdio_close(
struct hci_dev *hdev)
247 static int btsdio_flush(
struct hci_dev *hdev)
258 static int btsdio_send_frame(
struct sk_buff *skb)
292 static int btsdio_probe(
struct sdio_func *func,
300 BT_DBG(
"func %p id %p class 0x%04x", func,
id, func->
class);
315 skb_queue_head_init(&data->
txq);
322 hci_set_drvdata(hdev, data);
333 hdev->
open = btsdio_open;
334 hdev->
close = btsdio_close;
335 hdev->
flush = btsdio_flush;
336 hdev->
send = btsdio_send_frame;
349 static void btsdio_remove(
struct sdio_func *func)
370 .probe = btsdio_probe,
371 .remove = btsdio_remove,
372 .id_table = btsdio_table,
375 static int __init btsdio_init(
void)
382 static void __exit btsdio_exit(
void)