Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
drivers/bluetooth/btrtl.c
void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev) { set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); /* Enable central-peripheral role (able to create new connections with * an existing connection in slave role). */ /* Enable WBS supported for ...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/btrtl.c
int btrtl_shutdown_realtek(struct hci_dev *hdev) { struct sk_buff *skb; int ret; skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT); if (IS_ERR(skb)) { ret = PTR_ERR(skb); bt_dev_err(hdev, "HCI reset during shutdown failed"); return ret; } kfree_skb(skb); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/btrtl.h
static inline struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev, const char *postfix) { return ERR_PTR(-EOPNOTSUPP); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/btrtl.h
static inline int btrtl_setup_realtek(struct hci_dev *hdev) { return -EOPNOTSUPP; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/btrtl.h
static inline int btrtl_get_uart_settings(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev, unsigned int *controller_baudrate, u32 *device_baudrate, ...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/btsdio.c
static int btsdio_flush(struct hci_dev *hdev) { struct btsdio_data *data = hci_get_drvdata(hdev); BT_DBG("%s", hdev->name); skb_queue_purge(&data->txq); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static inline void __fill_isoc_descriptor_msbc(struct urb *urb, int len, int mtu, struct btusb_data *data) { int i = 0, offset = 0; unsigned int interval; BT_DBG("len %d mtu %d", len, mtu); if (test_bit(BTUSB_ALT6_CO...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static inline void __fill_isoc_descriptor(struct urb *urb, int len, int mtu) { int i, offset = 0; BT_DBG("len %d mtu %d", len, mtu); for (i = 0; i < BTUSB_MAX_ISOC_FRAMES && len >= mtu; i++, offset += mtu, len -= mtu) { urb->iso_frame_desc[i].offset = offset; urb->iso_frame_desc[i].length = mtu;...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static void btusb_isoc_tx_complete(struct urb *urb) { struct sk_buff *skb = urb->context; struct hci_dev *hdev = (struct hci_dev *)skb->dev; BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status, urb->actual_length); if (!test_bit(HCI_RUNNING, &hdev->flags)) goto done; if (!urb-...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static void btusb_stop_traffic(struct btusb_data *data) { usb_kill_anchored_urbs(&data->intr_anchor); usb_kill_anchored_urbs(&data->bulk_anchor); usb_kill_anchored_urbs(&data->isoc_anchor); usb_kill_anchored_urbs(&data->diag_anchor); usb_kill_anchored_urbs(&data->ctrl_anchor); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static struct urb *alloc_ctrl_urb(struct hci_dev *hdev, struct sk_buff *skb) { struct btusb_data *data = hci_get_drvdata(hdev); struct usb_ctrlrequest *dr; struct urb *urb; unsigned int pipe; urb = usb_alloc_urb(0, GFP_KERNEL); if (!urb) return ERR_PTR(-ENOMEM); dr = kmalloc(sizeof(*dr), GFP_KERNEL...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static void btusb_waker(struct work_struct *work) { struct btusb_data *data = container_of(work, struct btusb_data, waker); int err; err = usb_autopm_get_interface(data->intf); if (err < 0) return; usb_autopm_put_interface(data->intf); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static int inject_cmd_complete(struct hci_dev *hdev, __u16 opcode) { struct sk_buff *skb; struct hci_event_hdr *hdr; struct hci_ev_cmd_complete *evt; skb = bt_skb_alloc(sizeof(*hdr) + sizeof(*evt) + 1, GFP_KERNEL); if (!skb) return -ENOMEM; hdr = skb_put(skb, sizeof(*hdr)); hdr->evt = HCI_EV_CMD_CO...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static int btusb_setup_realtek(struct hci_dev *hdev) { struct btusb_data *data = hci_get_drvdata(hdev); int ret; ret = btrtl_setup_realtek(hdev); if (btrealtek_test_flag(data->hdev, REALTEK_ALT6_CONTINUOUS_TX_CHIP)) set_bit(BTUSB_ALT6_CONTINUOUS_TX, &data->flags); return ret; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static int btusb_mtk_func_query(struct hci_dev *hdev) { struct btmtk_hci_wmt_params wmt_params; int status, err; u8 param = 0; wmt_params.op = BTMTK_WMT_FUNC_CTRL; wmt_params.flag = 4; wmt_params.dlen = sizeof(param); wmt_params.data = &param; wmt_params.status = &status; err = btusb_mtk_hci_wmt_syn...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static int btusb_mtk_reg_read(struct btusb_data *data, u32 reg, u32 *val) { int pipe, err, size = sizeof(u32); void *buf; buf = kzalloc(size, GFP_KERNEL); if (!buf) return -ENOMEM; pipe = usb_rcvctrlpipe(data->udev, 0); err = usb_control_msg(data->udev, pipe, 0x63, USB_TYPE_VENDOR | USB_DIR_IN,...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static int btusb_mtk_id_get(struct btusb_data *data, u32 reg, u32 *id) { return btusb_mtk_reg_read(data, reg, id); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static int marvell_config_oob_wake(struct hci_dev *hdev) { struct sk_buff *skb; struct btusb_data *data = hci_get_drvdata(hdev); struct device *dev = &data->udev->dev; u16 pin, gap, opcode; int ret; u8 cmd[5]; if (of_property_read_u16(dev->of_node, "marvell,wakeup-pin", &pin) || of_property_read_u1...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static bool btusb_qca_need_patch(struct usb_device *udev) { struct qca_version ver; if (btusb_qca_send_vendor_req(udev, QCA_GET_TARGET_VERSION, &ver, sizeof(ver)) < 0) return false; return !(le32_to_cpu(ver.rom_version) & ~0xffffU); }
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static bool btusb_wakeup(struct hci_dev *hdev) { struct btusb_data *data = hci_get_drvdata(hdev); return device_may_wakeup(&data->udev->dev); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static ssize_t force_poll_sync_read(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { struct btusb_data *data = file->private_data; char buf[3]; buf[0] = data->poll_sync ? 'Y' : 'N'; buf[1] = '\n'; buf[2] = '\0'; return simple_read_from_buffer(user...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/btusb.c
static ssize_t force_poll_sync_write(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { struct btusb_data *data = file->private_data; bool enable; int err; err = kstrtobool_from_user(user_buf, count, &enable); ...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/dtl1_cs.c
static void dtl1_write_wakeup(struct dtl1_info *info) { if (!info) { BT_ERR("Unknown device"); return; } if (test_bit(XMIT_WAITING, &(info->tx_state))) { set_bit(XMIT_WAKEUP, &(info->tx_state)); return; } if (test_and_set_bit(XMIT_SENDING, &(info->tx_state))) { set_bit(XMIT_WAKEUP, &(inf...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/dtl1_cs.c
static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) { struct dtl1_info *info = hci_get_drvdata(hdev); struct sk_buff *s; struct nsh nsh; switch (hci_skb_pkt_type(skb)) { case HCI_COMMAND_PKT: hdev->stat.cmd_tx++; nsh.type = 0x81; break; case HCI_ACLDATA_PKT: hdev->stat...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_ag6xx.c
int __exit ag6xx_deinit(void) { return hci_uart_unregister_proto(&ag6xx_proto); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_ath.c
static void ath_hci_uart_work(struct work_struct *work) { int status; struct ath_struct *ath; struct hci_uart *hu; struct tty_struct *tty; ath = container_of(work, struct ath_struct, ctxtsw); hu = ath->hu; tty = hu->tty; if (ath->cur_sleep) { status = ath_wakeup_ar3k(tty); if (!(status & TIOC...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_ath.c
static int ath_open(struct hci_uart *hu) { struct ath_struct *ath; BT_DBG("hu %p", hu); if (!hci_uart_has_flow_control(hu)) return -EOPNOTSUPP; ath = kzalloc(sizeof(*ath), GFP_KERNEL); if (!ath) return -ENOMEM; skb_queue_head_init(&ath->txq); hu->priv = ath; ath->hu = hu; INIT_WORK(&ath...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm.c
static int bcm_gpio_set_power(struct bcm_device *dev, bool powered) { int err; if (powered && !dev->res_enabled) { if (dev->supplies[0].supply) { err = regulator_bulk_enable(BCM_NUM_SUPPLIES, dev->supplies); if (err) return err; } /* LPO clock needs to be 32.768 kHz */ err = c...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm.c
static irqreturn_t bcm_host_wake(int irq, void *data) { struct bcm_device *bdev = data; bt_dev_dbg(bdev, "Host wake IRQ"); pm_runtime_get(bdev->dev); pm_runtime_mark_last_busy(bdev->dev); pm_runtime_put_autosuspend(bdev->dev); return IRQ_HANDLED; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm.c
static int bcm_request_irq(struct bcm_data *bcm) { struct bcm_device *bdev = bcm->dev; int err; mutex_lock(&bcm_device_lock); if (!bcm_device_exists(bdev)) { err = -ENODEV; goto unlock; } if (bdev->irq <= 0) { err = -EOPNOTSUPP; goto unlock; } err = devm_request_irq(bdev->dev, bdev->...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm.c
static inline int bcm_setup_sleep(struct hci_uart *hu) { return 0; } #endif
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm.c
static int bcm_resume_device(struct device *dev) { struct bcm_device *bdev = dev_get_drvdata(dev); int err; bt_dev_dbg(bdev, ""); err = bdev->set_device_wakeup(bdev, true); if (err) { dev_err(dev, "Failed to power up\n"); return err; } bt_dev_dbg(bdev, "resume, delaying 15 ms"); msleep(15); ...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm.c
static int bcm_suspend(struct device *dev) { struct bcm_device *bdev = dev_get_drvdata(dev); int error; bt_dev_dbg(bdev, "suspend: is_suspended %d", bdev->is_suspended); mutex_lock(&bcm_device_lock); if (!bdev->hu) goto unlock; if (pm_runtime_active(dev)) bcm_suspend_device(dev); if (device_m...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm.c
static int bcm_resource(struct acpi_resource *ares, void *data) { struct bcm_device *dev = data; struct acpi_resource_extended_irq *irq; struct acpi_resource_gpio *gpio; struct acpi_resource_uart_serialbus *sb; switch (ares->type) { case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: irq = &ares->data.extended_irq;...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm.c
static inline int bcm_apple_get_resources(struct bcm_device *dev) { return -EOPNOTSUPP; } #endif
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm.c
static int bcm_acpi_probe(struct bcm_device *dev) { LIST_HEAD(resources); const struct acpi_gpio_mapping *gpio_mapping = acpi_bcm_int_last_gpios; struct resource_entry *entry; int ret; dev->gpio_int_idx = -1; ret = acpi_dev_get_resources(ACPI_COMPANION(dev->dev), &resources, ...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm.c
static int bcm_serdev_probe(struct serdev_device *serdev) { struct bcm_device *bcmdev; const struct bcm_device_data *data; int err; bcmdev = devm_kzalloc(&serdev->dev, sizeof(*bcmdev), GFP_KERNEL); if (!bcmdev) return -ENOMEM; bcmdev->dev = &serdev->dev; #ifdef CONFIG_PM bcmdev->hu = &bcmdev->serdev...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm.c
static void bcm_serdev_remove(struct serdev_device *serdev) { struct bcm_device *bcmdev = serdev_device_get_drvdata(serdev); hci_uart_unregister_device(&bcmdev->serdev_hu); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int bcm4377_extract_msgid(struct bcm4377_data *bcm4377, struct bcm4377_transfer_ring *ring, u16 raw_msgid, u8 *msgid) { u8 generation = FIELD_GET(BCM4377_MSGID_GENERATION, raw_msgid); *msgid = FIELD_GET(BCM4377_MSGID_ID, raw_msgid); if (ge...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static void bcm4377_handle_ack(struct bcm4377_data *bcm4377, struct bcm4377_transfer_ring *ring, u16 raw_msgid) { unsigned long flags; u8 msgid; spin_lock_irqsave(&ring->lock, flags); if (bcm4377_extract_msgid(bcm4377, ring, raw_msgid, &msgid)) ...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static irqreturn_t bcm4377_irq(int irq, void *data) { struct bcm4377_data *bcm4377 = data; u32 bootstage, rti_status; bootstage = ioread32(bcm4377->bar2 + BCM4377_BAR2_BOOTSTAGE); rti_status = ioread32(bcm4377->bar2 + BCM4377_BAR2_RTI_STATUS); if (bootstage != bcm4377->bootstage || rti_status != bcm4377->r...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int bcm4377_destroy_completion_ring(struct bcm4377_data *bcm4377, struct bcm4377_completion_ring *ring) { struct bcm4377_destroy_completion_ring_msg msg; int ret; memset(&msg, 0, sizeof(msg)); msg.msg_type = BCM4377_CONTROL_MSG_DESTROY_COMPLETION_RING; msg.ring_id = cp...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int __bcm4378_send_calibration_chunk(struct bcm4377_data *bcm4377, const void *data, size_t data_len, u16 blocks_left) { struct bcm4378_hci_send_calibration_cmd cmd; struct sk_buff *skb; if (data_len > sizeof(cmd.data...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int bcm4378_send_calibration(struct bcm4377_data *bcm4377) { if ((strcmp(bcm4377->stepping, "b1") == 0) || strcmp(bcm4377->stepping, "b3") == 0) return __bcm4378_send_calibration(bcm4377, bcm4377->taurus_beamforming_cal_blob, ...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int bcm4378_send_ptb_chunk(struct bcm4377_data *bcm4377, const void *data, size_t data_len, u16 blocks_left) { struct bcm4378_hci_send_ptb_cmd cmd; struct sk_buff *skb; if (data_len > BCM4378_PTB_CHUNK_SIZE) return -EINVAL; memset...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int bcm4378_send_ptb(struct bcm4377_data *bcm4377, const struct firmware *fw) { size_t chunks = DIV_ROUND_UP(fw->size, (size_t)BCM4378_PTB_CHUNK_SIZE); size_t i, left, transfer_len; int ret; for (i = 0, left = fw->size; i < chunks; ++i, left -= transfer_len) { transfer_l...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int bcm4377_hci_close(struct hci_dev *hdev) { struct bcm4377_data *bcm4377 = hci_get_drvdata(hdev); dev_dbg(&bcm4377->pdev->dev, "destroying rings in hci_close\n"); bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->acl_d2h_ring); bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->acl_h2d_ring); bcm4377...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int bcm4377_check_bdaddr(struct bcm4377_data *bcm4377) { struct hci_rp_read_bd_addr *bda; struct sk_buff *skb; skb = __hci_cmd_sync(bcm4377->hdev, HCI_OP_READ_BD_ADDR, 0, NULL, HCI_INIT_TIMEOUT); if (IS_ERR(skb)) { int err = PTR_ERR(skb); dev_err(&bcm4377->pdev->dev, "HC...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int bcm4377_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) { struct bcm4377_data *bcm4377 = hci_get_drvdata(hdev); struct bcm4377_transfer_ring *ring; int ret; switch (hci_skb_pkt_type(skb)) { case HCI_COMMAND_PKT: hdev->stat.cmd_tx++; ring = &bcm4377->hci_h2d_ring; break; c...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int bcm4377_parse_otp_board_params(struct bcm4377_data *bcm4377, char tag, const char *val, size_t len) { if (tag != 'V') return 0; if (len >= sizeof(bcm4377->vendor)) return -EINVAL; strscpy(bcm4377->vendor, val,...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int bcm4377_parse_otp_str(struct bcm4377_data *bcm4377, const u8 *str, enum bcm4377_otp_params_type type) { const char *p; int ret; p = skip_spaces(str); while (*p) { char tag = *p++; const char *end; size_t len; if (*p++ != '=') return -EINVAL; ...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int bcm4377_parse_otp_sys_vendor(struct bcm4377_data *bcm4377, u8 *otp, size_t size) { int idx = 4; const char *chip_params; const char *board_params; int ret; if (size < 6) return -EINVAL; if (get_unaligned_le32(otp) != BCM4377_OTP_VENDOR_HDR) return...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int bcm4377_parse_otp(struct bcm4377_data *bcm4377) { u8 *otp; int i; int ret = -ENOENT; otp = kzalloc(BCM4377_OTP_SIZE, GFP_KERNEL); if (!otp) return -ENOMEM; for (i = 0; i < BCM4377_OTP_SIZE; ++i) otp[i] = ioread8(bcm4377->bar0 + bcm4377->hw->otp_offset + i); i = 0; while (i < (BCM4...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int bcm4377_init_cfg(struct bcm4377_data *bcm4377) { int ret; u32 ctrl; ret = pci_write_config_dword(bcm4377->pdev, BCM4377_PCIECFG_BAR0_WINDOW1, bcm4377->hw->bar0_window1); if (ret) return ret; ret = pci_write_config_dword(bcm4377->pdev, BCM4377_PCIECFG_BAR0_WINDO...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static int bcm4377_probe_dmi(struct bcm4377_data *bcm4377) { const struct dmi_system_id *board_type_dmi_id; board_type_dmi_id = dmi_first_match(bcm4377_dmi_board_table); if (board_type_dmi_id && board_type_dmi_id->driver_data) { bcm4377->board_type = board_type_dmi_id->driver_data; dev_dbg(&bcm4377->pde...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static void bcm4377_disable_aspm(struct bcm4377_data *bcm4377) { pci_disable_link_state(bcm4377->pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1); pcie_capability_clear_word(bcm4377->pdev, PCI_EXP_LNKCTL, PCI_EXP_LNKCTL_ASPMC); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcm4377.c
static void bcm4377_pci_free_irq_vectors(void *data) { pci_free_irq_vectors(data); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcsp.c
static int bcsp_flush(struct hci_uart *hu) { BT_DBG("hu %p", hu); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcsp.c
static void bcsp_handle_le_pkt(struct hci_uart *hu) { struct bcsp_struct *bcsp = hu->priv; u8 conf_pkt[4] = {0xad, 0xef, 0xac, 0xed}; u8 conf_rsp_pkt[4] = {0xde, 0xad, 0xd0, 0xd0}; u8 sync_pkt[4] = {0xda, 0xdc, 0xed, 0xed}; if (bcsp->rx_skb->data[1] >> 4 == 4 && bcsp->rx_skb->data[2] == 0 && !memcmp(&b...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcsp.c
static void bcsp_timed_event(struct timer_list *t) { struct bcsp_struct *bcsp = from_timer(bcsp, t, tbcsp); struct hci_uart *hu = bcsp->hu; struct sk_buff *skb; unsigned long flags; BT_DBG("hu %p retransmitting %u pkts", hu, bcsp->unack.qlen); spin_lock_irqsave_nested(&bcsp->unack.lock, flags, SINGLE_DEPT...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_bcsp.c
int __init bcsp_init(void) { return hci_uart_register_proto(&bcsp); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_h4.c
static int h4_flush(struct hci_uart *hu) { struct h4_struct *h4 = hu->priv; BT_DBG("hu %p", hu); skb_queue_purge(&h4->txq); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_h4.c
int __init h4_init(void) { return hci_uart_register_proto(&h4p); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static u8 h5_cfg_field(struct h5 *h5) { return h5->tx_win & 0x07; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static void h5_timed_event(struct timer_list *t) { const unsigned char sync_req[] = {0x01, 0x7e}; unsigned char conf_req[3] = {0x03, 0xfc}; struct h5 *h5 = from_timer(h5, t, timer); struct hci_uart *hu = h5->hu; struct sk_buff *skb; unsigned long flags; BT_DBG("%s", hu->hdev->name); if (h5->state == ...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static int h5_open(struct hci_uart *hu) { struct h5 *h5; const unsigned char sync[] = {0x01, 0x7e}; BT_DBG("hu %p", hu); if (hu->serdev) { h5 = serdev_device_get_drvdata(hu->serdev); } else { h5 = kzalloc(sizeof(*h5), GFP_KERNEL); if (!h5) return -ENOMEM; } hu->priv = h5; h5->hu = h...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static int h5_close(struct hci_uart *hu) { struct h5 *h5 = hu->priv; del_timer_sync(&h5->timer); skb_queue_purge(&h5->unack); skb_queue_purge(&h5->rel); skb_queue_purge(&h5->unrel); kfree_skb(h5->rx_skb); h5->rx_skb = NULL; if (h5->vnd && h5->vnd->close) h5->vnd->close(h5); if (!hu->serdev) ...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static void h5_pkt_cull(struct h5 *h5) { struct sk_buff *skb, *tmp; unsigned long flags; int i, to_remove; u8 seq; spin_lock_irqsave(&h5->unack.lock, flags); to_remove = skb_queue_len(&h5->unack); if (to_remove == 0) goto unlock; seq = h5->tx_seq; while (to_remove > 0) { if (h5->rx_ack ==...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static void h5_complete_rx_pkt(struct hci_uart *hu) { struct h5 *h5 = hu->priv; const unsigned char *hdr = h5->rx_skb->data; if (H5_HDR_RELIABLE(hdr)) { h5->tx_ack = (h5->tx_ack + 1) % 8; set_bit(H5_TX_ACK_REQ, &h5->flags); hci_uart_tx_wakeup(hu); } h5->rx_ack = H5_HDR_ACK(hdr); h5_pkt_cull(h...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static int h5_rx_crc(struct hci_uart *hu, unsigned char c) { h5_complete_rx_pkt(hu); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static int h5_rx_3wire_hdr(struct hci_uart *hu, unsigned char c) { struct h5 *h5 = hu->priv; const unsigned char *hdr = h5->rx_skb->data; BT_DBG("%s rx: seq %u ack %u crc %u rel %u type %u len %u", hu->hdev->name, H5_HDR_SEQ(hdr), H5_HDR_ACK(hdr), H5_HDR_CRC(hdr), H5_HDR_RELIABLE(hdr), H5_HDR_...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static int h5_rx_pkt_start(struct hci_uart *hu, unsigned char c) { struct h5 *h5 = hu->priv; if (c == SLIP_DELIMITER) return 1; h5->rx_func = h5_rx_3wire_hdr; h5->rx_pending = 4; h5->rx_skb = bt_skb_alloc(H5_MAX_LEN, GFP_ATOMIC); if (!h5->rx_skb) { bt_dev_err(hu->hdev, "Can't allocate mem for ne...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static int h5_rx_delimiter(struct hci_uart *hu, unsigned char c) { struct h5 *h5 = hu->priv; if (c == SLIP_DELIMITER) h5->rx_func = h5_rx_pkt_start; return 1; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static int h5_enqueue(struct hci_uart *hu, struct sk_buff *skb) { struct h5 *h5 = hu->priv; if (skb->len > 0xfff) { bt_dev_err(hu->hdev, "Packet too long (%u bytes)", skb->len); kfree_skb(skb); return 0; } if (h5->state != H5_ACTIVE) { bt_dev_err(hu->hdev, "Ignoring HCI data in non-active sta...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static void h5_slip_one_byte(struct sk_buff *skb, u8 c) { const char esc_delim[2] = {SLIP_ESC, SLIP_ESC_DELIM}; const char esc_esc[2] = {SLIP_ESC, SLIP_ESC_ESC}; switch (c) { case SLIP_DELIMITER: skb_put_data(skb, &esc_delim, 2); break; case SLIP_ESC: skb_put_data(skb, &esc_esc, 2); break; ...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static bool valid_packet_type(u8 type) { switch (type) { case HCI_ACLDATA_PKT: case HCI_COMMAND_PKT: case HCI_SCODATA_PKT: case HCI_ISODATA_PKT: case HCI_3WIRE_LINK_PKT: case HCI_3WIRE_ACK_PKT: return true; default: return false; } }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static int h5_flush(struct hci_uart *hu) { BT_DBG("hu %p", hu); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static int h5_serdev_probe(struct serdev_device *serdev) { struct device *dev = &serdev->dev; struct h5 *h5; const struct h5_device_data *data; h5 = devm_kzalloc(dev, sizeof(*h5), GFP_KERNEL); if (!h5) return -ENOMEM; h5->hu = &h5->serdev_hu; h5->serdev_hu.serdev = serdev; serdev_device_set_drvda...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static void h5_serdev_remove(struct serdev_device *serdev) { struct h5 *h5 = serdev_device_get_drvdata(serdev); hci_uart_unregister_device(&h5->serdev_hu); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static int __maybe_unused h5_serdev_suspend(struct device *dev) { struct h5 *h5 = dev_get_drvdata(dev); int ret = 0; if (h5->vnd && h5->vnd->suspend) ret = h5->vnd->suspend(h5); return ret; }
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static void h5_btrtl_close(struct h5 *h5) { if (!test_bit(H5_WAKEUP_DISABLE, &h5->flags)) pm_runtime_disable(&h5->hu->serdev->dev); gpiod_set_value_cansleep(h5->device_wake_gpio, 0); gpiod_set_value_cansleep(h5->enable_gpio, 0); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
static void h5_btrtl_reprobe_worker(struct work_struct *work) { struct h5_btrtl_reprobe *reprobe = container_of(work, struct h5_btrtl_reprobe, work); int ret; ret = device_reprobe(reprobe->dev); if (ret && ret != -EPROBE_DEFER) dev_err(reprobe->dev, "Reprobe error %d\n", ret); put_device(reprobe-...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_h5.c
int __init h5_init(void) { serdev_device_driver_register(&h5_serdev_driver); return hci_uart_register_proto(&h5p); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_intel.c
static u8 intel_convert_speed(unsigned int speed) { switch (speed) { case 9600: return 0x00; case 19200: return 0x01; case 38400: return 0x02; case 57600: return 0x03; case 115200: return 0x04; case 230400: return 0x05; case 460800: return 0x06; case 921600: return 0x0...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_intel.c
static int intel_lpm_host_wake(struct hci_uart *hu) { static const u8 lpm_resume_ack[] = {LPM_OP_RESUME_ACK, 0x00}; struct intel_data *intel = hu->priv; struct sk_buff *skb; hci_uart_set_flow_control(hu, false); clear_bit(STATE_SUSPENDED, &intel->flags); skb = bt_skb_alloc(sizeof(lpm_resume_ack), GFP_KER...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_intel.c
static irqreturn_t intel_irq(int irq, void *dev_id) { struct intel_device *idev = dev_id; dev_info(&idev->pdev->dev, "hci_intel irq\n"); mutex_lock(&idev->hu_lock); if (idev->hu) intel_lpm_host_wake(idev->hu); mutex_unlock(&idev->hu_lock); pm_runtime_get(&idev->pdev->dev); pm_runtime_mark_last_busy...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_intel.c
static int intel_open(struct hci_uart *hu) { struct intel_data *intel; BT_DBG("hu %p", hu); if (!hci_uart_has_flow_control(hu)) return -EOPNOTSUPP; intel = kzalloc(sizeof(*intel), GFP_KERNEL); if (!intel) return -ENOMEM; skb_queue_head_init(&intel->txq); INIT_WORK(&intel->busy_work, intel_bus...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_intel.c
static int inject_cmd_complete(struct hci_dev *hdev, __u16 opcode) { struct sk_buff *skb; struct hci_event_hdr *hdr; struct hci_ev_cmd_complete *evt; skb = bt_skb_alloc(sizeof(*hdr) + sizeof(*evt) + 1, GFP_KERNEL); if (!skb) return -ENOMEM; hdr = skb_put(skb, sizeof(*hdr)); hdr->evt = HCI_EV_CMD_CO...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_intel.c
static int intel_set_baudrate(struct hci_uart *hu, unsigned int speed) { struct intel_data *intel = hu->priv; struct hci_dev *hdev = hu->hdev; u8 speed_cmd[] = {0x06, 0xfc, 0x01, 0x00}; struct sk_buff *skb; int err; err = intel_wait_booting(hu); clear_bit(STATE_BOOTING, &intel->flags); /* In case of ...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_intel.c
static int intel_recv_event(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_uart *hu = hci_get_drvdata(hdev); struct intel_data *intel = hu->priv; struct hci_event_hdr *hdr; if (!test_bit(STATE_BOOTLOADER, &intel->flags) && !test_bit(STATE_BOOTING, &intel->flags)) goto recv; hdr = (void *)...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_intel.c
static void intel_recv_lpm_notify(struct hci_dev *hdev, int value) { struct hci_uart *hu = hci_get_drvdata(hdev); struct intel_data *intel = hu->priv; bt_dev_dbg(hdev, "TX idle notification (%d)", value); if (value) { set_bit(STATE_TX_ACTIVE, &intel->flags); schedule_work(&intel->busy_work); } else...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_intel.c
static struct sk_buff *intel_dequeue(struct hci_uart *hu) { struct intel_data *intel = hu->priv; struct sk_buff *skb; skb = skb_dequeue(&intel->txq); if (!skb) return skb; if (test_bit(STATE_BOOTLOADER, &intel->flags) && (hci_skb_pkt_type(skb) == HCI_COMMAND_PKT)) { struct hci_command_hdr *cmd...
[ 1, 0 ]
Linux Kernel
drivers/bluetooth/hci_intel.c
static int intel_suspend_device(struct device *dev) { struct intel_device *idev = dev_get_drvdata(dev); mutex_lock(&idev->hu_lock); if (idev->hu) intel_lpm_suspend(idev->hu); mutex_unlock(&idev->hu_lock); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_intel.c
static int intel_remove(struct platform_device *pdev) { struct intel_device *idev = platform_get_drvdata(pdev); device_wakeup_disable(&pdev->dev); mutex_lock(&intel_device_list_lock); list_del(&idev->list); mutex_unlock(&intel_device_list_lock); dev_info(&pdev->dev, "unregistered.\n"); return 0; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_intel.c
int __init intel_init(void) { int err; err = platform_driver_register(&intel_driver); if (err) return err; return hci_uart_register_proto(&intel_proto); }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_ldisc.c
int hci_uart_unregister_proto(const struct hci_uart_proto *p) { if (p->id >= HCI_UART_MAX_PROTO) return -EINVAL; if (!hup[p->id]) return -EINVAL; hup[p->id] = NULL; return 0; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_ldisc.c
static const struct hci_uart_proto *hci_uart_get_proto(unsigned int id) { if (id >= HCI_UART_MAX_PROTO) return NULL; return hup[id]; }
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_ldisc.c
void hci_uart_init_work(struct work_struct *work) { struct hci_uart *hu = container_of(work, struct hci_uart, init_ready); int err; struct hci_dev *hdev; if (!test_and_clear_bit(HCI_UART_INIT_PENDING, &hu->hdev_flags)) return; err = hci_register_dev(hu->hdev); if (err < 0) { BT_ERR("Can't registe...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_ldisc.c
static int hci_uart_flush(struct hci_dev *hdev) { struct hci_uart *hu = hci_get_drvdata(hdev); struct tty_struct *tty = hu->tty; BT_DBG("hdev %p tty %p", hdev, tty); if (hu->tx_skb) { kfree_skb(hu->tx_skb); hu->tx_skb = NULL; } tty_ldisc_flush(tty); tty_driver_flush_buffer(tty); percpu_down_...
[ 0, 0 ]
Linux Kernel
drivers/bluetooth/hci_ldisc.c
bool hci_uart_has_flow_control(struct hci_uart *hu) { if (hu->serdev) return true; if (hu->tty->driver->ops->tiocmget && hu->tty->driver->ops->tiocmset) return true; return false; }
[ 1, 0 ]