hdev 50 drivers/bluetooth/bfusb.c struct hci_dev *hdev; hdev 137 drivers/bluetooth/bfusb.c data->hdev->name, urb, err); hdev 182 drivers/bluetooth/bfusb.c if (!test_bit(HCI_RUNNING, &data->hdev->flags)) hdev 186 drivers/bluetooth/bfusb.c data->hdev->stat.byte_tx += skb->len; hdev 188 drivers/bluetooth/bfusb.c data->hdev->stat.err_tx++; hdev 236 drivers/bluetooth/bfusb.c data->hdev->name, urb, err); hdev 250 drivers/bluetooth/bfusb.c BT_ERR("%s error in block", data->hdev->name); hdev 262 drivers/bluetooth/bfusb.c BT_ERR("%s unexpected start block", data->hdev->name); hdev 268 drivers/bluetooth/bfusb.c BT_ERR("%s no packet type found", data->hdev->name); hdev 280 drivers/bluetooth/bfusb.c BT_ERR("%s event block is too short", data->hdev->name); hdev 290 drivers/bluetooth/bfusb.c BT_ERR("%s data block is too short", data->hdev->name); hdev 300 drivers/bluetooth/bfusb.c BT_ERR("%s audio block is too short", data->hdev->name); hdev 308 drivers/bluetooth/bfusb.c BT_ERR("%s no memory for the packet", data->hdev->name); hdev 317 drivers/bluetooth/bfusb.c BT_ERR("%s unexpected continuation block", data->hdev->name); hdev 326 drivers/bluetooth/bfusb.c hci_recv_frame(data->hdev, data->reassembly); hdev 345 drivers/bluetooth/bfusb.c if (!test_bit(HCI_RUNNING, &data->hdev->flags)) hdev 351 drivers/bluetooth/bfusb.c data->hdev->stat.byte_rx += count; hdev 370 drivers/bluetooth/bfusb.c data->hdev->name); hdev 395 drivers/bluetooth/bfusb.c data->hdev->name, urb, err); hdev 402 drivers/bluetooth/bfusb.c static int bfusb_open(struct hci_dev *hdev) hdev 404 drivers/bluetooth/bfusb.c struct bfusb_data *data = hci_get_drvdata(hdev); hdev 408 drivers/bluetooth/bfusb.c BT_DBG("hdev %p bfusb %p", hdev, data); hdev 423 drivers/bluetooth/bfusb.c static int bfusb_flush(struct hci_dev *hdev) hdev 425 drivers/bluetooth/bfusb.c struct bfusb_data *data = hci_get_drvdata(hdev); hdev 427 drivers/bluetooth/bfusb.c BT_DBG("hdev %p bfusb %p", hdev, data); hdev 434 drivers/bluetooth/bfusb.c static int bfusb_close(struct hci_dev *hdev) hdev 436 drivers/bluetooth/bfusb.c struct bfusb_data *data = hci_get_drvdata(hdev); hdev 439 drivers/bluetooth/bfusb.c BT_DBG("hdev %p bfusb %p", hdev, data); hdev 445 drivers/bluetooth/bfusb.c bfusb_flush(hdev); hdev 450 drivers/bluetooth/bfusb.c static int bfusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 452 drivers/bluetooth/bfusb.c struct bfusb_data *data = hci_get_drvdata(hdev); hdev 457 drivers/bluetooth/bfusb.c BT_DBG("hdev %p skb %p type %d len %d", hdev, skb, hdev 462 drivers/bluetooth/bfusb.c hdev->stat.cmd_tx++; hdev 465 drivers/bluetooth/bfusb.c hdev->stat.acl_tx++; hdev 468 drivers/bluetooth/bfusb.c hdev->stat.sco_tx++; hdev 605 drivers/bluetooth/bfusb.c struct hci_dev *hdev; hdev 655 drivers/bluetooth/bfusb.c hdev = hci_alloc_dev(); hdev 656 drivers/bluetooth/bfusb.c if (!hdev) { hdev 661 drivers/bluetooth/bfusb.c data->hdev = hdev; hdev 663 drivers/bluetooth/bfusb.c hdev->bus = HCI_USB; hdev 664 drivers/bluetooth/bfusb.c hci_set_drvdata(hdev, data); hdev 665 drivers/bluetooth/bfusb.c SET_HCIDEV_DEV(hdev, &intf->dev); hdev 667 drivers/bluetooth/bfusb.c hdev->open = bfusb_open; hdev 668 drivers/bluetooth/bfusb.c hdev->close = bfusb_close; hdev 669 drivers/bluetooth/bfusb.c hdev->flush = bfusb_flush; hdev 670 drivers/bluetooth/bfusb.c hdev->send = bfusb_send_frame; hdev 672 drivers/bluetooth/bfusb.c set_bit(HCI_QUIRK_BROKEN_LOCAL_COMMANDS, &hdev->quirks); hdev 674 drivers/bluetooth/bfusb.c if (hci_register_dev(hdev) < 0) { hdev 676 drivers/bluetooth/bfusb.c hci_free_dev(hdev); hdev 694 drivers/bluetooth/bfusb.c struct hci_dev *hdev = data->hdev; hdev 698 drivers/bluetooth/bfusb.c if (!hdev) hdev 703 drivers/bluetooth/bfusb.c bfusb_close(hdev); hdev 705 drivers/bluetooth/bfusb.c hci_unregister_dev(hdev); hdev 706 drivers/bluetooth/bfusb.c hci_free_dev(hdev); hdev 67 drivers/bluetooth/bluecard_cs.c struct hci_dev *hdev; hdev 327 drivers/bluetooth/bluecard_cs.c info->hdev->stat.byte_tx += len; hdev 436 drivers/bluetooth/bluecard_cs.c info->hdev->stat.err_rx++; hdev 478 drivers/bluetooth/bluecard_cs.c hci_recv_frame(info->hdev, info->rx_skb); hdev 491 drivers/bluetooth/bluecard_cs.c info->hdev->stat.byte_rx += len; hdev 501 drivers/bluetooth/bluecard_cs.c if (!info || !info->hdev) hdev 560 drivers/bluetooth/bluecard_cs.c static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud) hdev 562 drivers/bluetooth/bluecard_cs.c struct bluecard_info *info = hci_get_drvdata(hdev); hdev 609 drivers/bluetooth/bluecard_cs.c static int bluecard_hci_flush(struct hci_dev *hdev) hdev 611 drivers/bluetooth/bluecard_cs.c struct bluecard_info *info = hci_get_drvdata(hdev); hdev 620 drivers/bluetooth/bluecard_cs.c static int bluecard_hci_open(struct hci_dev *hdev) hdev 622 drivers/bluetooth/bluecard_cs.c struct bluecard_info *info = hci_get_drvdata(hdev); hdev 626 drivers/bluetooth/bluecard_cs.c bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE); hdev 635 drivers/bluetooth/bluecard_cs.c static int bluecard_hci_close(struct hci_dev *hdev) hdev 637 drivers/bluetooth/bluecard_cs.c struct bluecard_info *info = hci_get_drvdata(hdev); hdev 640 drivers/bluetooth/bluecard_cs.c bluecard_hci_flush(hdev); hdev 652 drivers/bluetooth/bluecard_cs.c static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 654 drivers/bluetooth/bluecard_cs.c struct bluecard_info *info = hci_get_drvdata(hdev); hdev 658 drivers/bluetooth/bluecard_cs.c hdev->stat.cmd_tx++; hdev 661 drivers/bluetooth/bluecard_cs.c hdev->stat.acl_tx++; hdev 664 drivers/bluetooth/bluecard_cs.c hdev->stat.sco_tx++; hdev 685 drivers/bluetooth/bluecard_cs.c struct hci_dev *hdev; hdev 699 drivers/bluetooth/bluecard_cs.c hdev = hci_alloc_dev(); hdev 700 drivers/bluetooth/bluecard_cs.c if (!hdev) { hdev 705 drivers/bluetooth/bluecard_cs.c info->hdev = hdev; hdev 707 drivers/bluetooth/bluecard_cs.c hdev->bus = HCI_PCCARD; hdev 708 drivers/bluetooth/bluecard_cs.c hci_set_drvdata(hdev, info); hdev 709 drivers/bluetooth/bluecard_cs.c SET_HCIDEV_DEV(hdev, &info->p_dev->dev); hdev 711 drivers/bluetooth/bluecard_cs.c hdev->open = bluecard_hci_open; hdev 712 drivers/bluetooth/bluecard_cs.c hdev->close = bluecard_hci_close; hdev 713 drivers/bluetooth/bluecard_cs.c hdev->flush = bluecard_hci_flush; hdev 714 drivers/bluetooth/bluecard_cs.c hdev->send = bluecard_hci_send_frame; hdev 784 drivers/bluetooth/bluecard_cs.c if (hci_register_dev(hdev) < 0) { hdev 786 drivers/bluetooth/bluecard_cs.c info->hdev = NULL; hdev 787 drivers/bluetooth/bluecard_cs.c hci_free_dev(hdev); hdev 798 drivers/bluetooth/bluecard_cs.c struct hci_dev *hdev = info->hdev; hdev 800 drivers/bluetooth/bluecard_cs.c if (!hdev) hdev 803 drivers/bluetooth/bluecard_cs.c bluecard_hci_close(hdev); hdev 814 drivers/bluetooth/bluecard_cs.c hci_unregister_dev(hdev); hdev 815 drivers/bluetooth/bluecard_cs.c hci_free_dev(hdev); hdev 37 drivers/bluetooth/bpa10x.c struct hci_dev *hdev; hdev 49 drivers/bluetooth/bpa10x.c struct hci_dev *hdev = (struct hci_dev *) skb->dev; hdev 51 drivers/bluetooth/bpa10x.c BT_DBG("%s urb %p status %d count %d", hdev->name, hdev 54 drivers/bluetooth/bpa10x.c if (!test_bit(HCI_RUNNING, &hdev->flags)) hdev 58 drivers/bluetooth/bpa10x.c hdev->stat.byte_tx += urb->transfer_buffer_length; hdev 60 drivers/bluetooth/bpa10x.c hdev->stat.err_tx++; hdev 86 drivers/bluetooth/bpa10x.c struct hci_dev *hdev = urb->context; hdev 87 drivers/bluetooth/bpa10x.c struct bpa10x_data *data = hci_get_drvdata(hdev); hdev 90 drivers/bluetooth/bpa10x.c BT_DBG("%s urb %p status %d count %d", hdev->name, hdev 93 drivers/bluetooth/bpa10x.c if (!test_bit(HCI_RUNNING, &hdev->flags)) hdev 99 drivers/bluetooth/bpa10x.c data->rx_skb[idx] = h4_recv_buf(hdev, data->rx_skb[idx], hdev 105 drivers/bluetooth/bpa10x.c bt_dev_err(hdev, "corrupted event packet"); hdev 106 drivers/bluetooth/bpa10x.c hdev->stat.err_rx++; hdev 115 drivers/bluetooth/bpa10x.c bt_dev_err(hdev, "urb %p failed to resubmit (%d)", urb, -err); hdev 120 drivers/bluetooth/bpa10x.c static inline int bpa10x_submit_intr_urb(struct hci_dev *hdev) hdev 122 drivers/bluetooth/bpa10x.c struct bpa10x_data *data = hci_get_drvdata(hdev); hdev 128 drivers/bluetooth/bpa10x.c BT_DBG("%s", hdev->name); hdev 143 drivers/bluetooth/bpa10x.c bpa10x_rx_complete, hdev, 1); hdev 151 drivers/bluetooth/bpa10x.c bt_dev_err(hdev, "urb %p submission failed (%d)", urb, -err); hdev 160 drivers/bluetooth/bpa10x.c static inline int bpa10x_submit_bulk_urb(struct hci_dev *hdev) hdev 162 drivers/bluetooth/bpa10x.c struct bpa10x_data *data = hci_get_drvdata(hdev); hdev 168 drivers/bluetooth/bpa10x.c BT_DBG("%s", hdev->name); hdev 183 drivers/bluetooth/bpa10x.c buf, size, bpa10x_rx_complete, hdev); hdev 191 drivers/bluetooth/bpa10x.c bt_dev_err(hdev, "urb %p submission failed (%d)", urb, -err); hdev 200 drivers/bluetooth/bpa10x.c static int bpa10x_open(struct hci_dev *hdev) hdev 202 drivers/bluetooth/bpa10x.c struct bpa10x_data *data = hci_get_drvdata(hdev); hdev 205 drivers/bluetooth/bpa10x.c BT_DBG("%s", hdev->name); hdev 207 drivers/bluetooth/bpa10x.c err = bpa10x_submit_intr_urb(hdev); hdev 211 drivers/bluetooth/bpa10x.c err = bpa10x_submit_bulk_urb(hdev); hdev 223 drivers/bluetooth/bpa10x.c static int bpa10x_close(struct hci_dev *hdev) hdev 225 drivers/bluetooth/bpa10x.c struct bpa10x_data *data = hci_get_drvdata(hdev); hdev 227 drivers/bluetooth/bpa10x.c BT_DBG("%s", hdev->name); hdev 234 drivers/bluetooth/bpa10x.c static int bpa10x_flush(struct hci_dev *hdev) hdev 236 drivers/bluetooth/bpa10x.c struct bpa10x_data *data = hci_get_drvdata(hdev); hdev 238 drivers/bluetooth/bpa10x.c BT_DBG("%s", hdev->name); hdev 245 drivers/bluetooth/bpa10x.c static int bpa10x_setup(struct hci_dev *hdev) hdev 250 drivers/bluetooth/bpa10x.c BT_DBG("%s", hdev->name); hdev 253 drivers/bluetooth/bpa10x.c skb = __hci_cmd_sync(hdev, 0xfc0e, sizeof(req), req, HCI_INIT_TIMEOUT); hdev 257 drivers/bluetooth/bpa10x.c bt_dev_info(hdev, "%s", (char *)(skb->data + 1)); hdev 259 drivers/bluetooth/bpa10x.c hci_set_fw_info(hdev, "%s", skb->data + 1); hdev 265 drivers/bluetooth/bpa10x.c static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 267 drivers/bluetooth/bpa10x.c struct bpa10x_data *data = hci_get_drvdata(hdev); hdev 273 drivers/bluetooth/bpa10x.c BT_DBG("%s", hdev->name); hdev 275 drivers/bluetooth/bpa10x.c skb->dev = (void *) hdev; hdev 303 drivers/bluetooth/bpa10x.c hdev->stat.cmd_tx++; hdev 312 drivers/bluetooth/bpa10x.c hdev->stat.acl_tx++; hdev 321 drivers/bluetooth/bpa10x.c hdev->stat.sco_tx++; hdev 333 drivers/bluetooth/bpa10x.c bt_dev_err(hdev, "urb %p submission failed", urb); hdev 343 drivers/bluetooth/bpa10x.c static int bpa10x_set_diag(struct hci_dev *hdev, bool enable) hdev 348 drivers/bluetooth/bpa10x.c BT_DBG("%s", hdev->name); hdev 350 drivers/bluetooth/bpa10x.c if (!test_bit(HCI_RUNNING, &hdev->flags)) hdev 354 drivers/bluetooth/bpa10x.c skb = __hci_cmd_sync(hdev, 0xfc0e, sizeof(req), req, HCI_INIT_TIMEOUT); hdev 366 drivers/bluetooth/bpa10x.c struct hci_dev *hdev; hdev 383 drivers/bluetooth/bpa10x.c hdev = hci_alloc_dev(); hdev 384 drivers/bluetooth/bpa10x.c if (!hdev) hdev 387 drivers/bluetooth/bpa10x.c hdev->bus = HCI_USB; hdev 388 drivers/bluetooth/bpa10x.c hci_set_drvdata(hdev, data); hdev 390 drivers/bluetooth/bpa10x.c data->hdev = hdev; hdev 392 drivers/bluetooth/bpa10x.c SET_HCIDEV_DEV(hdev, &intf->dev); hdev 394 drivers/bluetooth/bpa10x.c hdev->open = bpa10x_open; hdev 395 drivers/bluetooth/bpa10x.c hdev->close = bpa10x_close; hdev 396 drivers/bluetooth/bpa10x.c hdev->flush = bpa10x_flush; hdev 397 drivers/bluetooth/bpa10x.c hdev->setup = bpa10x_setup; hdev 398 drivers/bluetooth/bpa10x.c hdev->send = bpa10x_send_frame; hdev 399 drivers/bluetooth/bpa10x.c hdev->set_diag = bpa10x_set_diag; hdev 401 drivers/bluetooth/bpa10x.c set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); hdev 403 drivers/bluetooth/bpa10x.c err = hci_register_dev(hdev); hdev 405 drivers/bluetooth/bpa10x.c hci_free_dev(hdev); hdev 425 drivers/bluetooth/bpa10x.c hci_unregister_dev(data->hdev); hdev 427 drivers/bluetooth/bpa10x.c hci_free_dev(data->hdev); hdev 73 drivers/bluetooth/bt3c_cs.c struct hci_dev *hdev; hdev 210 drivers/bluetooth/bt3c_cs.c info->hdev->stat.byte_tx += len; hdev 233 drivers/bluetooth/bt3c_cs.c info->hdev->stat.byte_rx++; hdev 273 drivers/bluetooth/bt3c_cs.c info->hdev->stat.err_rx++; hdev 318 drivers/bluetooth/bt3c_cs.c hci_recv_frame(info->hdev, info->rx_skb); hdev 341 drivers/bluetooth/bt3c_cs.c if (!info || !info->hdev) hdev 358 drivers/bluetooth/bt3c_cs.c bt_dev_info(info->hdev, "Antenna %s", hdev 385 drivers/bluetooth/bt3c_cs.c static int bt3c_hci_flush(struct hci_dev *hdev) hdev 387 drivers/bluetooth/bt3c_cs.c struct bt3c_info *info = hci_get_drvdata(hdev); hdev 396 drivers/bluetooth/bt3c_cs.c static int bt3c_hci_open(struct hci_dev *hdev) hdev 402 drivers/bluetooth/bt3c_cs.c static int bt3c_hci_close(struct hci_dev *hdev) hdev 404 drivers/bluetooth/bt3c_cs.c bt3c_hci_flush(hdev); hdev 410 drivers/bluetooth/bt3c_cs.c static int bt3c_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 412 drivers/bluetooth/bt3c_cs.c struct bt3c_info *info = hci_get_drvdata(hdev); hdev 417 drivers/bluetooth/bt3c_cs.c hdev->stat.cmd_tx++; hdev 420 drivers/bluetooth/bt3c_cs.c hdev->stat.acl_tx++; hdev 423 drivers/bluetooth/bt3c_cs.c hdev->stat.sco_tx++; hdev 541 drivers/bluetooth/bt3c_cs.c struct hci_dev *hdev; hdev 553 drivers/bluetooth/bt3c_cs.c hdev = hci_alloc_dev(); hdev 554 drivers/bluetooth/bt3c_cs.c if (!hdev) { hdev 559 drivers/bluetooth/bt3c_cs.c info->hdev = hdev; hdev 561 drivers/bluetooth/bt3c_cs.c hdev->bus = HCI_PCCARD; hdev 562 drivers/bluetooth/bt3c_cs.c hci_set_drvdata(hdev, info); hdev 563 drivers/bluetooth/bt3c_cs.c SET_HCIDEV_DEV(hdev, &info->p_dev->dev); hdev 565 drivers/bluetooth/bt3c_cs.c hdev->open = bt3c_hci_open; hdev 566 drivers/bluetooth/bt3c_cs.c hdev->close = bt3c_hci_close; hdev 567 drivers/bluetooth/bt3c_cs.c hdev->flush = bt3c_hci_flush; hdev 568 drivers/bluetooth/bt3c_cs.c hdev->send = bt3c_hci_send_frame; hdev 590 drivers/bluetooth/bt3c_cs.c err = hci_register_dev(hdev); hdev 599 drivers/bluetooth/bt3c_cs.c info->hdev = NULL; hdev 600 drivers/bluetooth/bt3c_cs.c hci_free_dev(hdev); hdev 607 drivers/bluetooth/bt3c_cs.c struct hci_dev *hdev = info->hdev; hdev 609 drivers/bluetooth/bt3c_cs.c if (!hdev) hdev 612 drivers/bluetooth/bt3c_cs.c bt3c_hci_close(hdev); hdev 614 drivers/bluetooth/bt3c_cs.c hci_unregister_dev(hdev); hdev 615 drivers/bluetooth/bt3c_cs.c hci_free_dev(hdev); hdev 29 drivers/bluetooth/btbcm.c int btbcm_check_bdaddr(struct hci_dev *hdev) hdev 34 drivers/bluetooth/btbcm.c skb = __hci_cmd_sync(hdev, HCI_OP_READ_BD_ADDR, 0, NULL, hdev 38 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Reading device address failed (%d)", err); hdev 43 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Device address length mismatch"); hdev 80 drivers/bluetooth/btbcm.c bt_dev_info(hdev, "BCM: Using default device address (%pMR)", hdev 82 drivers/bluetooth/btbcm.c set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); hdev 91 drivers/bluetooth/btbcm.c int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) hdev 96 drivers/bluetooth/btbcm.c skb = __hci_cmd_sync(hdev, 0xfc01, 6, bdaddr, HCI_INIT_TIMEOUT); hdev 99 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Change address command failed (%d)", err); hdev 108 drivers/bluetooth/btbcm.c int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw) hdev 118 drivers/bluetooth/btbcm.c skb = __hci_cmd_sync(hdev, 0xfc2e, 0, NULL, HCI_INIT_TIMEOUT); hdev 121 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Download Minidrv command failed (%d)", hdev 141 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Patch is corrupted"); hdev 152 drivers/bluetooth/btbcm.c skb = __hci_cmd_sync(hdev, opcode, cmd->plen, cmd_param, hdev 156 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Patch command %04x failed (%d)", hdev 171 drivers/bluetooth/btbcm.c static int btbcm_reset(struct hci_dev *hdev) hdev 175 drivers/bluetooth/btbcm.c skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT); hdev 178 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Reset failed (%d)", err); hdev 189 drivers/bluetooth/btbcm.c static struct sk_buff *btbcm_read_local_name(struct hci_dev *hdev) hdev 193 drivers/bluetooth/btbcm.c skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_NAME, 0, NULL, hdev 196 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Reading local name failed (%ld)", hdev 202 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Local name length mismatch"); hdev 210 drivers/bluetooth/btbcm.c static struct sk_buff *btbcm_read_local_version(struct hci_dev *hdev) hdev 214 drivers/bluetooth/btbcm.c skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL, hdev 217 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Reading local version info failed (%ld)", hdev 223 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Local version length mismatch"); hdev 231 drivers/bluetooth/btbcm.c static struct sk_buff *btbcm_read_verbose_config(struct hci_dev *hdev) hdev 235 drivers/bluetooth/btbcm.c skb = __hci_cmd_sync(hdev, 0xfc79, 0, NULL, HCI_INIT_TIMEOUT); hdev 237 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Read verbose config info failed (%ld)", hdev 243 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Verbose config length mismatch"); hdev 251 drivers/bluetooth/btbcm.c static struct sk_buff *btbcm_read_controller_features(struct hci_dev *hdev) hdev 255 drivers/bluetooth/btbcm.c skb = __hci_cmd_sync(hdev, 0xfc6e, 0, NULL, HCI_INIT_TIMEOUT); hdev 257 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Read controller features failed (%ld)", hdev 263 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Controller features length mismatch"); hdev 271 drivers/bluetooth/btbcm.c static struct sk_buff *btbcm_read_usb_product(struct hci_dev *hdev) hdev 275 drivers/bluetooth/btbcm.c skb = __hci_cmd_sync(hdev, 0xfc5a, 0, NULL, HCI_INIT_TIMEOUT); hdev 277 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: Read USB product info failed (%ld)", hdev 283 drivers/bluetooth/btbcm.c bt_dev_err(hdev, "BCM: USB product length mismatch"); hdev 291 drivers/bluetooth/btbcm.c static int btbcm_read_info(struct hci_dev *hdev) hdev 296 drivers/bluetooth/btbcm.c skb = btbcm_read_verbose_config(hdev); hdev 300 drivers/bluetooth/btbcm.c bt_dev_info(hdev, "BCM: chip id %u", skb->data[1]); hdev 304 drivers/bluetooth/btbcm.c skb = btbcm_read_controller_features(hdev); hdev 308 drivers/bluetooth/btbcm.c bt_dev_info(hdev, "BCM: features 0x%2.2x", skb->data[1]); hdev 312 drivers/bluetooth/btbcm.c skb = btbcm_read_local_name(hdev); hdev 316 drivers/bluetooth/btbcm.c bt_dev_info(hdev, "%s", (char *)(skb->data + 1)); hdev 359 drivers/bluetooth/btbcm.c int btbcm_initialize(struct hci_dev *hdev, char *fw_name, size_t len, hdev 370 drivers/bluetooth/btbcm.c err = btbcm_reset(hdev); hdev 375 drivers/bluetooth/btbcm.c skb = btbcm_read_local_version(hdev); hdev 386 drivers/bluetooth/btbcm.c err = btbcm_read_info(hdev); hdev 395 drivers/bluetooth/btbcm.c bcm_subver_table = (hdev->bus == HCI_USB) ? bcm_usb_subver_table : hdev 405 drivers/bluetooth/btbcm.c if (hdev->bus == HCI_USB) { hdev 407 drivers/bluetooth/btbcm.c skb = btbcm_read_usb_product(hdev); hdev 421 drivers/bluetooth/btbcm.c bt_dev_info(hdev, "%s (%3.3u.%3.3u.%3.3u) build %4.4u", hdev 429 drivers/bluetooth/btbcm.c int btbcm_finalize(struct hci_dev *hdev) hdev 435 drivers/bluetooth/btbcm.c err = btbcm_initialize(hdev, fw_name, sizeof(fw_name), true); hdev 439 drivers/bluetooth/btbcm.c btbcm_check_bdaddr(hdev); hdev 441 drivers/bluetooth/btbcm.c set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); hdev 447 drivers/bluetooth/btbcm.c set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); hdev 453 drivers/bluetooth/btbcm.c int btbcm_setup_patchram(struct hci_dev *hdev) hdev 461 drivers/bluetooth/btbcm.c err = btbcm_initialize(hdev, fw_name, sizeof(fw_name), false); hdev 465 drivers/bluetooth/btbcm.c err = request_firmware(&fw, fw_name, &hdev->dev); hdev 467 drivers/bluetooth/btbcm.c bt_dev_info(hdev, "BCM: Patch %s not found", fw_name); hdev 471 drivers/bluetooth/btbcm.c btbcm_patchram(hdev, fw); hdev 476 drivers/bluetooth/btbcm.c err = btbcm_initialize(hdev, fw_name, sizeof(fw_name), true); hdev 481 drivers/bluetooth/btbcm.c skb = btbcm_read_local_name(hdev); hdev 485 drivers/bluetooth/btbcm.c bt_dev_info(hdev, "%s", (char *)(skb->data + 1)); hdev 489 drivers/bluetooth/btbcm.c btbcm_check_bdaddr(hdev); hdev 491 drivers/bluetooth/btbcm.c set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); hdev 497 drivers/bluetooth/btbcm.c int btbcm_setup_apple(struct hci_dev *hdev) hdev 503 drivers/bluetooth/btbcm.c err = btbcm_reset(hdev); hdev 508 drivers/bluetooth/btbcm.c skb = btbcm_read_verbose_config(hdev); hdev 510 drivers/bluetooth/btbcm.c bt_dev_info(hdev, "BCM: chip id %u build %4.4u", hdev 516 drivers/bluetooth/btbcm.c skb = btbcm_read_usb_product(hdev); hdev 518 drivers/bluetooth/btbcm.c bt_dev_info(hdev, "BCM: product %4.4x:%4.4x", hdev 525 drivers/bluetooth/btbcm.c skb = btbcm_read_controller_features(hdev); hdev 527 drivers/bluetooth/btbcm.c bt_dev_info(hdev, "BCM: features 0x%2.2x", skb->data[1]); hdev 532 drivers/bluetooth/btbcm.c skb = btbcm_read_local_name(hdev); hdev 534 drivers/bluetooth/btbcm.c bt_dev_info(hdev, "%s", (char *)(skb->data + 1)); hdev 538 drivers/bluetooth/btbcm.c set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); hdev 54 drivers/bluetooth/btbcm.h int btbcm_check_bdaddr(struct hci_dev *hdev); hdev 55 drivers/bluetooth/btbcm.h int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr); hdev 56 drivers/bluetooth/btbcm.h int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw); hdev 58 drivers/bluetooth/btbcm.h int btbcm_setup_patchram(struct hci_dev *hdev); hdev 59 drivers/bluetooth/btbcm.h int btbcm_setup_apple(struct hci_dev *hdev); hdev 61 drivers/bluetooth/btbcm.h int btbcm_initialize(struct hci_dev *hdev, char *fw_name, size_t len, hdev 63 drivers/bluetooth/btbcm.h int btbcm_finalize(struct hci_dev *hdev); hdev 67 drivers/bluetooth/btbcm.h static inline int btbcm_check_bdaddr(struct hci_dev *hdev) hdev 72 drivers/bluetooth/btbcm.h static inline int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) hdev 77 drivers/bluetooth/btbcm.h static inline int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw) hdev 82 drivers/bluetooth/btbcm.h static inline int btbcm_setup_patchram(struct hci_dev *hdev) hdev 87 drivers/bluetooth/btbcm.h static inline int btbcm_setup_apple(struct hci_dev *hdev) hdev 92 drivers/bluetooth/btbcm.h static inline int btbcm_initialize(struct hci_dev *hdev, char *fw_name, hdev 98 drivers/bluetooth/btbcm.h static inline int btbcm_finalize(struct hci_dev *hdev) hdev 23 drivers/bluetooth/btintel.c int btintel_check_bdaddr(struct hci_dev *hdev) hdev 28 drivers/bluetooth/btintel.c skb = __hci_cmd_sync(hdev, HCI_OP_READ_BD_ADDR, 0, NULL, hdev 32 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Reading Intel device address failed (%d)", hdev 38 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Intel device address length mismatch"); hdev 51 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Found Intel default device address (%pMR)", hdev 53 drivers/bluetooth/btintel.c set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); hdev 62 drivers/bluetooth/btintel.c int btintel_enter_mfg(struct hci_dev *hdev) hdev 67 drivers/bluetooth/btintel.c skb = __hci_cmd_sync(hdev, 0xfc11, 2, param, HCI_CMD_TIMEOUT); hdev 69 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Entering manufacturer mode failed (%ld)", hdev 79 drivers/bluetooth/btintel.c int btintel_exit_mfg(struct hci_dev *hdev, bool reset, bool patched) hdev 92 drivers/bluetooth/btintel.c skb = __hci_cmd_sync(hdev, 0xfc11, 2, param, HCI_CMD_TIMEOUT); hdev 94 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Exiting manufacturer mode failed (%ld)", hdev 104 drivers/bluetooth/btintel.c int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) hdev 109 drivers/bluetooth/btintel.c skb = __hci_cmd_sync(hdev, 0xfc31, 6, bdaddr, HCI_INIT_TIMEOUT); hdev 112 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Changing Intel device address failed (%d)", hdev 122 drivers/bluetooth/btintel.c int btintel_set_diag(struct hci_dev *hdev, bool enable) hdev 138 drivers/bluetooth/btintel.c skb = __hci_cmd_sync(hdev, 0xfc43, 3, param, HCI_INIT_TIMEOUT); hdev 143 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Changing Intel diagnostic mode failed (%d)", hdev 150 drivers/bluetooth/btintel.c btintel_set_event_mask(hdev, enable); hdev 155 drivers/bluetooth/btintel.c int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable) hdev 159 drivers/bluetooth/btintel.c err = btintel_enter_mfg(hdev); hdev 163 drivers/bluetooth/btintel.c ret = btintel_set_diag(hdev, enable); hdev 165 drivers/bluetooth/btintel.c err = btintel_exit_mfg(hdev, false, false); hdev 173 drivers/bluetooth/btintel.c void btintel_hw_error(struct hci_dev *hdev, u8 code) hdev 178 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Hardware error 0x%2.2x", code); hdev 180 drivers/bluetooth/btintel.c skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT); hdev 182 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Reset after hardware error failed (%ld)", hdev 188 drivers/bluetooth/btintel.c skb = __hci_cmd_sync(hdev, 0xfc22, 1, &type, HCI_INIT_TIMEOUT); hdev 190 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Retrieving Intel exception info failed (%ld)", hdev 196 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Exception info size mismatch"); hdev 201 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Exception info %s", (char *)(skb->data + 1)); hdev 207 drivers/bluetooth/btintel.c void btintel_version_info(struct hci_dev *hdev, struct intel_version *ver) hdev 222 drivers/bluetooth/btintel.c bt_dev_info(hdev, "%s revision %u.%u build %u week %u %u", hdev 229 drivers/bluetooth/btintel.c int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, u32 plen, hdev 239 drivers/bluetooth/btintel.c skb = __hci_cmd_sync(hdev, 0xfc09, fragment_len + 1, hdev 254 drivers/bluetooth/btintel.c int btintel_load_ddc_config(struct hci_dev *hdev, const char *ddc_name) hdev 261 drivers/bluetooth/btintel.c err = request_firmware_direct(&fw, ddc_name, &hdev->dev); hdev 263 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Failed to load Intel DDC file %s (%d)", hdev 268 drivers/bluetooth/btintel.c bt_dev_info(hdev, "Found Intel DDC parameters: %s", ddc_name); hdev 278 drivers/bluetooth/btintel.c skb = __hci_cmd_sync(hdev, 0xfc8b, cmd_plen, fw_ptr, hdev 281 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Failed to send Intel_Write_DDC (%ld)", hdev 293 drivers/bluetooth/btintel.c bt_dev_info(hdev, "Applying Intel DDC parameters completed"); hdev 299 drivers/bluetooth/btintel.c int btintel_set_event_mask(struct hci_dev *hdev, bool debug) hdev 308 drivers/bluetooth/btintel.c skb = __hci_cmd_sync(hdev, 0xfc52, 8, mask, HCI_INIT_TIMEOUT); hdev 311 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Setting Intel event mask failed (%d)", err); hdev 320 drivers/bluetooth/btintel.c int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug) hdev 324 drivers/bluetooth/btintel.c err = btintel_enter_mfg(hdev); hdev 328 drivers/bluetooth/btintel.c ret = btintel_set_event_mask(hdev, debug); hdev 330 drivers/bluetooth/btintel.c err = btintel_exit_mfg(hdev, false, false); hdev 338 drivers/bluetooth/btintel.c int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver) hdev 342 drivers/bluetooth/btintel.c skb = __hci_cmd_sync(hdev, 0xfc05, 0, NULL, HCI_CMD_TIMEOUT); hdev 344 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Reading Intel version information failed (%ld)", hdev 350 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Intel version event size mismatch"); hdev 370 drivers/bluetooth/btintel.c struct hci_dev *hdev; hdev 418 drivers/bluetooth/btintel.c bt_dev_dbg(ctx->hdev, "Register (0x%x) read", le32_to_cpu(cp.addr)); hdev 420 drivers/bluetooth/btintel.c skb = hci_cmd_sync(ctx->hdev, ctx->op_read, sizeof(cp), &cp, hdev 424 drivers/bluetooth/btintel.c bt_dev_err(ctx->hdev, "regmap: Register (0x%x) read error (%d)", hdev 430 drivers/bluetooth/btintel.c bt_dev_err(ctx->hdev, "regmap: Register (0x%x) read error, bad len", hdev 439 drivers/bluetooth/btintel.c bt_dev_err(ctx->hdev, "regmap: Register (0x%x) read error, bad addr", hdev 490 drivers/bluetooth/btintel.c bt_dev_dbg(ctx->hdev, "Register (0x%x) write", le32_to_cpu(cp->addr)); hdev 492 drivers/bluetooth/btintel.c skb = hci_cmd_sync(ctx->hdev, ctx->op_write, plen, cp, HCI_CMD_TIMEOUT); hdev 495 drivers/bluetooth/btintel.c bt_dev_err(ctx->hdev, "regmap: Register (0x%x) write error (%d)", hdev 538 drivers/bluetooth/btintel.c struct regmap *btintel_regmap_init(struct hci_dev *hdev, u16 opcode_read, hdev 543 drivers/bluetooth/btintel.c bt_dev_info(hdev, "regmap: Init R%x-W%x region", opcode_read, hdev 552 drivers/bluetooth/btintel.c ctx->hdev = hdev; hdev 554 drivers/bluetooth/btintel.c return regmap_init(&hdev->dev, ®map_ibt, ctx, ®map_ibt_cfg); hdev 558 drivers/bluetooth/btintel.c int btintel_send_intel_reset(struct hci_dev *hdev, u32 boot_param) hdev 565 drivers/bluetooth/btintel.c skb = __hci_cmd_sync(hdev, 0xfc01, sizeof(params), ¶ms, hdev 568 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Failed to send Intel Reset command"); hdev 578 drivers/bluetooth/btintel.c int btintel_read_boot_params(struct hci_dev *hdev, hdev 583 drivers/bluetooth/btintel.c skb = __hci_cmd_sync(hdev, 0xfc0d, 0, NULL, HCI_INIT_TIMEOUT); hdev 585 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Reading Intel boot parameters failed (%ld)", hdev 591 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Intel boot parameters size mismatch"); hdev 601 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Intel boot parameters command failed (%02x)", hdev 606 drivers/bluetooth/btintel.c bt_dev_info(hdev, "Device revision is %u", hdev 609 drivers/bluetooth/btintel.c bt_dev_info(hdev, "Secure boot is %s", hdev 612 drivers/bluetooth/btintel.c bt_dev_info(hdev, "OTP lock is %s", hdev 615 drivers/bluetooth/btintel.c bt_dev_info(hdev, "API lock is %s", hdev 618 drivers/bluetooth/btintel.c bt_dev_info(hdev, "Debug lock is %s", hdev 621 drivers/bluetooth/btintel.c bt_dev_info(hdev, "Minimum firmware build %u week %u %u", hdev 629 drivers/bluetooth/btintel.c int btintel_download_firmware(struct hci_dev *hdev, const struct firmware *fw, hdev 639 drivers/bluetooth/btintel.c err = btintel_secure_send(hdev, 0x00, 128, fw->data); hdev 641 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Failed to send firmware header (%d)", err); hdev 648 drivers/bluetooth/btintel.c err = btintel_secure_send(hdev, 0x03, 256, fw->data + 128); hdev 650 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Failed to send firmware pkey (%d)", err); hdev 657 drivers/bluetooth/btintel.c err = btintel_secure_send(hdev, 0x02, 256, fw->data + 388); hdev 659 drivers/bluetooth/btintel.c bt_dev_err(hdev, "Failed to send firmware signature (%d)", err); hdev 680 drivers/bluetooth/btintel.c bt_dev_dbg(hdev, "boot_param=0x%x", *boot_param); hdev 694 drivers/bluetooth/btintel.c err = btintel_secure_send(hdev, 0x01, frag_len, fw_ptr); hdev 696 drivers/bluetooth/btintel.c bt_dev_err(hdev, hdev 67 drivers/bluetooth/btintel.h int btintel_check_bdaddr(struct hci_dev *hdev); hdev 68 drivers/bluetooth/btintel.h int btintel_enter_mfg(struct hci_dev *hdev); hdev 69 drivers/bluetooth/btintel.h int btintel_exit_mfg(struct hci_dev *hdev, bool reset, bool patched); hdev 70 drivers/bluetooth/btintel.h int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr); hdev 71 drivers/bluetooth/btintel.h int btintel_set_diag(struct hci_dev *hdev, bool enable); hdev 72 drivers/bluetooth/btintel.h int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable); hdev 73 drivers/bluetooth/btintel.h void btintel_hw_error(struct hci_dev *hdev, u8 code); hdev 75 drivers/bluetooth/btintel.h void btintel_version_info(struct hci_dev *hdev, struct intel_version *ver); hdev 76 drivers/bluetooth/btintel.h int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, u32 plen, hdev 78 drivers/bluetooth/btintel.h int btintel_load_ddc_config(struct hci_dev *hdev, const char *ddc_name); hdev 79 drivers/bluetooth/btintel.h int btintel_set_event_mask(struct hci_dev *hdev, bool debug); hdev 80 drivers/bluetooth/btintel.h int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug); hdev 81 drivers/bluetooth/btintel.h int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver); hdev 83 drivers/bluetooth/btintel.h struct regmap *btintel_regmap_init(struct hci_dev *hdev, u16 opcode_read, hdev 85 drivers/bluetooth/btintel.h int btintel_send_intel_reset(struct hci_dev *hdev, u32 boot_param); hdev 86 drivers/bluetooth/btintel.h int btintel_read_boot_params(struct hci_dev *hdev, hdev 92 drivers/bluetooth/btintel.h static inline int btintel_check_bdaddr(struct hci_dev *hdev) hdev 97 drivers/bluetooth/btintel.h static inline int btintel_enter_mfg(struct hci_dev *hdev) hdev 102 drivers/bluetooth/btintel.h static inline int btintel_exit_mfg(struct hci_dev *hdev, bool reset, bool patched) hdev 107 drivers/bluetooth/btintel.h static inline int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) hdev 112 drivers/bluetooth/btintel.h static inline int btintel_set_diag(struct hci_dev *hdev, bool enable) hdev 117 drivers/bluetooth/btintel.h static inline int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable) hdev 122 drivers/bluetooth/btintel.h static inline void btintel_hw_error(struct hci_dev *hdev, u8 code) hdev 126 drivers/bluetooth/btintel.h static inline void btintel_version_info(struct hci_dev *hdev, hdev 131 drivers/bluetooth/btintel.h static inline int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, hdev 137 drivers/bluetooth/btintel.h static inline int btintel_load_ddc_config(struct hci_dev *hdev, hdev 143 drivers/bluetooth/btintel.h static inline int btintel_set_event_mask(struct hci_dev *hdev, bool debug) hdev 148 drivers/bluetooth/btintel.h static inline int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug) hdev 153 drivers/bluetooth/btintel.h static inline int btintel_read_version(struct hci_dev *hdev, hdev 159 drivers/bluetooth/btintel.h static inline struct regmap *btintel_regmap_init(struct hci_dev *hdev, hdev 166 drivers/bluetooth/btintel.h static inline int btintel_send_intel_reset(struct hci_dev *hdev, hdev 172 drivers/bluetooth/btintel.h static inline int btintel_read_boot_params(struct hci_dev *hdev, hdev 152 drivers/bluetooth/btmrvl_debugfs.c void btmrvl_debugfs_init(struct hci_dev *hdev) hdev 154 drivers/bluetooth/btmrvl_debugfs.c struct btmrvl_private *priv = hci_get_drvdata(hdev); hdev 157 drivers/bluetooth/btmrvl_debugfs.c if (!hdev->debugfs) hdev 168 drivers/bluetooth/btmrvl_debugfs.c dbg->config_dir = debugfs_create_dir("config", hdev->debugfs); hdev 183 drivers/bluetooth/btmrvl_debugfs.c dbg->status_dir = debugfs_create_dir("status", hdev->debugfs); hdev 194 drivers/bluetooth/btmrvl_debugfs.c void btmrvl_debugfs_remove(struct hci_dev *hdev) hdev 196 drivers/bluetooth/btmrvl_debugfs.c struct btmrvl_private *priv = hci_get_drvdata(hdev); hdev 185 drivers/bluetooth/btmrvl_drv.h void btmrvl_debugfs_init(struct hci_dev *hdev); hdev 186 drivers/bluetooth/btmrvl_drv.h void btmrvl_debugfs_remove(struct hci_dev *hdev); hdev 427 drivers/bluetooth/btmrvl_main.c static int btmrvl_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 429 drivers/bluetooth/btmrvl_main.c struct btmrvl_private *priv = hci_get_drvdata(hdev); hdev 440 drivers/bluetooth/btmrvl_main.c hdev->stat.cmd_tx++; hdev 444 drivers/bluetooth/btmrvl_main.c hdev->stat.acl_tx++; hdev 448 drivers/bluetooth/btmrvl_main.c hdev->stat.sco_tx++; hdev 460 drivers/bluetooth/btmrvl_main.c static int btmrvl_flush(struct hci_dev *hdev) hdev 462 drivers/bluetooth/btmrvl_main.c struct btmrvl_private *priv = hci_get_drvdata(hdev); hdev 469 drivers/bluetooth/btmrvl_main.c static int btmrvl_close(struct hci_dev *hdev) hdev 471 drivers/bluetooth/btmrvl_main.c struct btmrvl_private *priv = hci_get_drvdata(hdev); hdev 478 drivers/bluetooth/btmrvl_main.c static int btmrvl_open(struct hci_dev *hdev) hdev 542 drivers/bluetooth/btmrvl_main.c static int btmrvl_setup(struct hci_dev *hdev) hdev 544 drivers/bluetooth/btmrvl_main.c struct btmrvl_private *priv = hci_get_drvdata(hdev); hdev 567 drivers/bluetooth/btmrvl_main.c static int btmrvl_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) hdev 577 drivers/bluetooth/btmrvl_main.c skb = __hci_cmd_sync(hdev, BT_CMD_SET_BDADDR, sizeof(buf), buf, hdev 582 drivers/bluetooth/btmrvl_main.c hdev->name, ret); hdev 671 drivers/bluetooth/btmrvl_main.c struct hci_dev *hdev = NULL; hdev 674 drivers/bluetooth/btmrvl_main.c hdev = hci_alloc_dev(); hdev 675 drivers/bluetooth/btmrvl_main.c if (!hdev) { hdev 680 drivers/bluetooth/btmrvl_main.c priv->btmrvl_dev.hcidev = hdev; hdev 681 drivers/bluetooth/btmrvl_main.c hci_set_drvdata(hdev, priv); hdev 683 drivers/bluetooth/btmrvl_main.c hdev->bus = HCI_SDIO; hdev 684 drivers/bluetooth/btmrvl_main.c hdev->open = btmrvl_open; hdev 685 drivers/bluetooth/btmrvl_main.c hdev->close = btmrvl_close; hdev 686 drivers/bluetooth/btmrvl_main.c hdev->flush = btmrvl_flush; hdev 687 drivers/bluetooth/btmrvl_main.c hdev->send = btmrvl_send_frame; hdev 688 drivers/bluetooth/btmrvl_main.c hdev->setup = btmrvl_setup; hdev 689 drivers/bluetooth/btmrvl_main.c hdev->set_bdaddr = btmrvl_set_bdaddr; hdev 691 drivers/bluetooth/btmrvl_main.c hdev->dev_type = priv->btmrvl_dev.dev_type; hdev 693 drivers/bluetooth/btmrvl_main.c ret = hci_register_dev(hdev); hdev 700 drivers/bluetooth/btmrvl_main.c btmrvl_debugfs_init(hdev); hdev 706 drivers/bluetooth/btmrvl_main.c hci_free_dev(hdev); hdev 765 drivers/bluetooth/btmrvl_main.c struct hci_dev *hdev; hdev 767 drivers/bluetooth/btmrvl_main.c hdev = priv->btmrvl_dev.hcidev; hdev 775 drivers/bluetooth/btmrvl_main.c btmrvl_debugfs_remove(hdev); hdev 778 drivers/bluetooth/btmrvl_main.c hci_unregister_dev(hdev); hdev 780 drivers/bluetooth/btmrvl_main.c hci_free_dev(hdev); hdev 764 drivers/bluetooth/btmrvl_sdio.c struct hci_dev *hdev = priv->btmrvl_dev.hcidev; hdev 843 drivers/bluetooth/btmrvl_sdio.c hci_recv_frame(hdev, skb); hdev 845 drivers/bluetooth/btmrvl_sdio.c hci_recv_frame(hdev, skb); hdev 848 drivers/bluetooth/btmrvl_sdio.c hdev->stat.byte_rx += buf_len; hdev 857 drivers/bluetooth/btmrvl_sdio.c hci_recv_frame(hdev, skb); hdev 859 drivers/bluetooth/btmrvl_sdio.c hdev->stat.byte_rx += buf_len; hdev 873 drivers/bluetooth/btmrvl_sdio.c hdev->stat.err_rx++; hdev 156 drivers/bluetooth/btmtksdio.c struct hci_dev *hdev; hdev 169 drivers/bluetooth/btmtksdio.c static int mtk_hci_wmt_sync(struct hci_dev *hdev, hdev 172 drivers/bluetooth/btmtksdio.c struct btmtksdio_dev *bdev = hci_get_drvdata(hdev); hdev 193 drivers/bluetooth/btmtksdio.c err = __hci_cmd_send(hdev, 0xfc6f, hlen, &wc); hdev 211 drivers/bluetooth/btmtksdio.c bt_dev_err(hdev, "Execution of wmt command interrupted"); hdev 217 drivers/bluetooth/btmtksdio.c bt_dev_err(hdev, "Execution of wmt command timed out"); hdev 225 drivers/bluetooth/btmtksdio.c bt_dev_err(hdev, "Wrong op received %d expected %d", hdev 286 drivers/bluetooth/btmtksdio.c bdev->hdev->stat.byte_tx += skb->len; hdev 317 drivers/bluetooth/btmtksdio.c bdev->hdev->stat.err_tx++; hdev 329 drivers/bluetooth/btmtksdio.c static int btmtksdio_recv_event(struct hci_dev *hdev, struct sk_buff *skb) hdev 331 drivers/bluetooth/btmtksdio.c struct btmtksdio_dev *bdev = hci_get_drvdata(hdev); hdev 353 drivers/bluetooth/btmtksdio.c err = hci_recv_frame(hdev, skb); hdev 413 drivers/bluetooth/btmtksdio.c bt_dev_err(bdev->hdev, "Rx size in sdio header is mismatched "); hdev 432 drivers/bluetooth/btmtksdio.c bt_dev_err(bdev->hdev, "Invalid bt type 0x%02x", hdev 439 drivers/bluetooth/btmtksdio.c bt_dev_err(bdev->hdev, "The size of bt header is mismatched"); hdev 459 drivers/bluetooth/btmtksdio.c bt_dev_err(bdev->hdev, "The size of bt payload is mismatched"); hdev 467 drivers/bluetooth/btmtksdio.c (&pkts[i])->recv(bdev->hdev, skb); hdev 469 drivers/bluetooth/btmtksdio.c bdev->hdev->stat.byte_rx += rx_size; hdev 514 drivers/bluetooth/btmtksdio.c bt_dev_err(bdev->hdev, "CHISR is 0"); hdev 517 drivers/bluetooth/btmtksdio.c bt_dev_dbg(bdev->hdev, "Get fw own back"); hdev 522 drivers/bluetooth/btmtksdio.c bt_dev_warn(bdev->hdev, "Tx fifo overflow"); hdev 528 drivers/bluetooth/btmtksdio.c bdev->hdev->stat.err_rx++; hdev 538 drivers/bluetooth/btmtksdio.c static int btmtksdio_open(struct hci_dev *hdev) hdev 540 drivers/bluetooth/btmtksdio.c struct btmtksdio_dev *bdev = hci_get_drvdata(hdev); hdev 558 drivers/bluetooth/btmtksdio.c bt_dev_err(bdev->hdev, "Cannot get ownership from device"); hdev 619 drivers/bluetooth/btmtksdio.c static int btmtksdio_close(struct hci_dev *hdev) hdev 621 drivers/bluetooth/btmtksdio.c struct btmtksdio_dev *bdev = hci_get_drvdata(hdev); hdev 638 drivers/bluetooth/btmtksdio.c bt_dev_err(bdev->hdev, "Cannot return ownership to device"); hdev 647 drivers/bluetooth/btmtksdio.c static int btmtksdio_flush(struct hci_dev *hdev) hdev 649 drivers/bluetooth/btmtksdio.c struct btmtksdio_dev *bdev = hci_get_drvdata(hdev); hdev 658 drivers/bluetooth/btmtksdio.c static int btmtksdio_func_query(struct hci_dev *hdev) hdev 671 drivers/bluetooth/btmtksdio.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 673 drivers/bluetooth/btmtksdio.c bt_dev_err(hdev, "Failed to query function status (%d)", err); hdev 680 drivers/bluetooth/btmtksdio.c static int mtk_setup_firmware(struct hci_dev *hdev, const char *fwname) hdev 689 drivers/bluetooth/btmtksdio.c err = request_firmware(&fw, fwname, &hdev->dev); hdev 691 drivers/bluetooth/btmtksdio.c bt_dev_err(hdev, "Failed to load firmware file (%d)", err); hdev 724 drivers/bluetooth/btmtksdio.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 726 drivers/bluetooth/btmtksdio.c bt_dev_err(hdev, "Failed to send wmt patch dwnld (%d)", hdev 742 drivers/bluetooth/btmtksdio.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 744 drivers/bluetooth/btmtksdio.c bt_dev_err(hdev, "Failed to send wmt rst (%d)", err); hdev 756 drivers/bluetooth/btmtksdio.c static int btmtksdio_setup(struct hci_dev *hdev) hdev 758 drivers/bluetooth/btmtksdio.c struct btmtksdio_dev *bdev = hci_get_drvdata(hdev); hdev 776 drivers/bluetooth/btmtksdio.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 778 drivers/bluetooth/btmtksdio.c bt_dev_err(hdev, "Failed to query firmware status (%d)", err); hdev 783 drivers/bluetooth/btmtksdio.c bt_dev_info(hdev, "Firmware already downloaded"); hdev 788 drivers/bluetooth/btmtksdio.c err = mtk_setup_firmware(hdev, bdev->data->fwname); hdev 794 drivers/bluetooth/btmtksdio.c err = readx_poll_timeout(btmtksdio_func_query, hdev, status, hdev 806 drivers/bluetooth/btmtksdio.c bt_dev_info(hdev, "function already on"); hdev 817 drivers/bluetooth/btmtksdio.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 819 drivers/bluetooth/btmtksdio.c bt_dev_err(hdev, "Failed to send wmt func ctrl (%d)", err); hdev 831 drivers/bluetooth/btmtksdio.c skb = __hci_cmd_sync(hdev, 0xfc7a, sizeof(tci_sleep), &tci_sleep, hdev 835 drivers/bluetooth/btmtksdio.c bt_dev_err(hdev, "Failed to apply low power setting (%d)", err); hdev 861 drivers/bluetooth/btmtksdio.c bt_dev_info(hdev, "Device setup in %llu usecs", duration); hdev 866 drivers/bluetooth/btmtksdio.c static int btmtksdio_shutdown(struct hci_dev *hdev) hdev 868 drivers/bluetooth/btmtksdio.c struct btmtksdio_dev *bdev = hci_get_drvdata(hdev); hdev 885 drivers/bluetooth/btmtksdio.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 887 drivers/bluetooth/btmtksdio.c bt_dev_err(hdev, "Failed to send wmt func ctrl (%d)", err); hdev 897 drivers/bluetooth/btmtksdio.c static int btmtksdio_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 899 drivers/bluetooth/btmtksdio.c struct btmtksdio_dev *bdev = hci_get_drvdata(hdev); hdev 903 drivers/bluetooth/btmtksdio.c hdev->stat.cmd_tx++; hdev 907 drivers/bluetooth/btmtksdio.c hdev->stat.acl_tx++; hdev 911 drivers/bluetooth/btmtksdio.c hdev->stat.sco_tx++; hdev 929 drivers/bluetooth/btmtksdio.c struct hci_dev *hdev; hdev 947 drivers/bluetooth/btmtksdio.c hdev = hci_alloc_dev(); hdev 948 drivers/bluetooth/btmtksdio.c if (!hdev) { hdev 953 drivers/bluetooth/btmtksdio.c bdev->hdev = hdev; hdev 955 drivers/bluetooth/btmtksdio.c hdev->bus = HCI_SDIO; hdev 956 drivers/bluetooth/btmtksdio.c hci_set_drvdata(hdev, bdev); hdev 958 drivers/bluetooth/btmtksdio.c hdev->open = btmtksdio_open; hdev 959 drivers/bluetooth/btmtksdio.c hdev->close = btmtksdio_close; hdev 960 drivers/bluetooth/btmtksdio.c hdev->flush = btmtksdio_flush; hdev 961 drivers/bluetooth/btmtksdio.c hdev->setup = btmtksdio_setup; hdev 962 drivers/bluetooth/btmtksdio.c hdev->shutdown = btmtksdio_shutdown; hdev 963 drivers/bluetooth/btmtksdio.c hdev->send = btmtksdio_send_frame; hdev 964 drivers/bluetooth/btmtksdio.c SET_HCIDEV_DEV(hdev, &func->dev); hdev 966 drivers/bluetooth/btmtksdio.c hdev->manufacturer = 70; hdev 967 drivers/bluetooth/btmtksdio.c set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks); hdev 969 drivers/bluetooth/btmtksdio.c err = hci_register_dev(hdev); hdev 972 drivers/bluetooth/btmtksdio.c hci_free_dev(hdev); hdev 1003 drivers/bluetooth/btmtksdio.c struct hci_dev *hdev; hdev 1011 drivers/bluetooth/btmtksdio.c hdev = bdev->hdev; hdev 1014 drivers/bluetooth/btmtksdio.c hci_unregister_dev(hdev); hdev 1015 drivers/bluetooth/btmtksdio.c hci_free_dev(hdev); hdev 1039 drivers/bluetooth/btmtksdio.c bt_dev_info(bdev->hdev, "status (%d) return ownership to device", err); hdev 1066 drivers/bluetooth/btmtksdio.c bt_dev_info(bdev->hdev, "status (%d) get ownership from device", err); hdev 116 drivers/bluetooth/btmtkuart.c struct hci_dev *hdev; hdev 149 drivers/bluetooth/btmtkuart.c static int mtk_hci_wmt_sync(struct hci_dev *hdev, hdev 152 drivers/bluetooth/btmtkuart.c struct btmtkuart_dev *bdev = hci_get_drvdata(hdev); hdev 173 drivers/bluetooth/btmtkuart.c err = __hci_cmd_send(hdev, 0xfc6f, hlen, &wc); hdev 191 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Execution of wmt command interrupted"); hdev 197 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Execution of wmt command timed out"); hdev 205 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Wrong op received %d expected %d", hdev 239 drivers/bluetooth/btmtkuart.c static int mtk_setup_firmware(struct hci_dev *hdev, const char *fwname) hdev 248 drivers/bluetooth/btmtkuart.c err = request_firmware(&fw, fwname, &hdev->dev); hdev 250 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Failed to load firmware file (%d)", err); hdev 283 drivers/bluetooth/btmtkuart.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 285 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Failed to send wmt patch dwnld (%d)", hdev 301 drivers/bluetooth/btmtkuart.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 303 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Failed to send wmt rst (%d)", err); hdev 315 drivers/bluetooth/btmtkuart.c static int btmtkuart_recv_event(struct hci_dev *hdev, struct sk_buff *skb) hdev 317 drivers/bluetooth/btmtkuart.c struct btmtkuart_dev *bdev = hci_get_drvdata(hdev); hdev 339 drivers/bluetooth/btmtkuart.c err = hci_recv_frame(hdev, skb); hdev 373 drivers/bluetooth/btmtkuart.c struct hci_dev *hdev = bdev->hdev; hdev 387 drivers/bluetooth/btmtkuart.c hdev->stat.byte_tx += len; hdev 397 drivers/bluetooth/btmtkuart.c hdev->stat.cmd_tx++; hdev 400 drivers/bluetooth/btmtkuart.c hdev->stat.acl_tx++; hdev 403 drivers/bluetooth/btmtkuart.c hdev->stat.sco_tx++; hdev 450 drivers/bluetooth/btmtkuart.c bt_dev_err(bdev->hdev, "stp format unexpect (%d, %d)", hdev 471 drivers/bluetooth/btmtkuart.c static int btmtkuart_recv(struct hci_dev *hdev, const u8 *data, size_t count) hdev 473 drivers/bluetooth/btmtkuart.c struct btmtkuart_dev *bdev = hci_get_drvdata(hdev); hdev 502 drivers/bluetooth/btmtkuart.c bdev->rx_skb = h4_recv_buf(bdev->hdev, bdev->rx_skb, p_h4, hdev 507 drivers/bluetooth/btmtkuart.c bt_dev_err(bdev->hdev, hdev 526 drivers/bluetooth/btmtkuart.c err = btmtkuart_recv(bdev->hdev, data, count); hdev 530 drivers/bluetooth/btmtkuart.c bdev->hdev->stat.byte_rx += count; hdev 547 drivers/bluetooth/btmtkuart.c static int btmtkuart_open(struct hci_dev *hdev) hdev 549 drivers/bluetooth/btmtkuart.c struct btmtkuart_dev *bdev = hci_get_drvdata(hdev); hdev 555 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Unable to open UART device %s", hdev 569 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Unable to set baudrate UART device %s", hdev 606 drivers/bluetooth/btmtkuart.c static int btmtkuart_close(struct hci_dev *hdev) hdev 608 drivers/bluetooth/btmtkuart.c struct btmtkuart_dev *bdev = hci_get_drvdata(hdev); hdev 621 drivers/bluetooth/btmtkuart.c static int btmtkuart_flush(struct hci_dev *hdev) hdev 623 drivers/bluetooth/btmtkuart.c struct btmtkuart_dev *bdev = hci_get_drvdata(hdev); hdev 640 drivers/bluetooth/btmtkuart.c static int btmtkuart_func_query(struct hci_dev *hdev) hdev 653 drivers/bluetooth/btmtkuart.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 655 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Failed to query function status (%d)", err); hdev 662 drivers/bluetooth/btmtkuart.c static int btmtkuart_change_baudrate(struct hci_dev *hdev) hdev 664 drivers/bluetooth/btmtkuart.c struct btmtkuart_dev *bdev = hci_get_drvdata(hdev); hdev 680 drivers/bluetooth/btmtkuart.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 682 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Failed to device baudrate (%d)", err); hdev 689 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Failed to set up host baudrate (%d)", hdev 715 drivers/bluetooth/btmtkuart.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 717 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Failed to test new baudrate (%d)", hdev 727 drivers/bluetooth/btmtkuart.c static int btmtkuart_setup(struct hci_dev *hdev) hdev 729 drivers/bluetooth/btmtkuart.c struct btmtkuart_dev *bdev = hci_get_drvdata(hdev); hdev 750 drivers/bluetooth/btmtkuart.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 752 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Failed to wakeup the chip (%d)", err); hdev 760 drivers/bluetooth/btmtkuart.c btmtkuart_change_baudrate(hdev); hdev 769 drivers/bluetooth/btmtkuart.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 771 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Failed to query firmware status (%d)", err); hdev 776 drivers/bluetooth/btmtkuart.c bt_dev_info(hdev, "Firmware already downloaded"); hdev 781 drivers/bluetooth/btmtkuart.c err = mtk_setup_firmware(hdev, bdev->data->fwname); hdev 787 drivers/bluetooth/btmtkuart.c err = readx_poll_timeout(btmtkuart_func_query, hdev, status, hdev 799 drivers/bluetooth/btmtkuart.c bt_dev_info(hdev, "function already on"); hdev 810 drivers/bluetooth/btmtkuart.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 812 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Failed to send wmt func ctrl (%d)", err); hdev 824 drivers/bluetooth/btmtkuart.c skb = __hci_cmd_sync(hdev, 0xfc7a, sizeof(tci_sleep), &tci_sleep, hdev 828 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Failed to apply low power setting (%d)", err); hdev 837 drivers/bluetooth/btmtkuart.c bt_dev_info(hdev, "Device setup in %llu usecs", duration); hdev 842 drivers/bluetooth/btmtkuart.c static int btmtkuart_shutdown(struct hci_dev *hdev) hdev 855 drivers/bluetooth/btmtkuart.c err = mtk_hci_wmt_sync(hdev, &wmt_params); hdev 857 drivers/bluetooth/btmtkuart.c bt_dev_err(hdev, "Failed to send wmt func ctrl (%d)", err); hdev 864 drivers/bluetooth/btmtkuart.c static int btmtkuart_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 866 drivers/bluetooth/btmtkuart.c struct btmtkuart_dev *bdev = hci_get_drvdata(hdev); hdev 969 drivers/bluetooth/btmtkuart.c struct hci_dev *hdev; hdev 993 drivers/bluetooth/btmtkuart.c hdev = hci_alloc_dev(); hdev 994 drivers/bluetooth/btmtkuart.c if (!hdev) { hdev 999 drivers/bluetooth/btmtkuart.c bdev->hdev = hdev; hdev 1001 drivers/bluetooth/btmtkuart.c hdev->bus = HCI_UART; hdev 1002 drivers/bluetooth/btmtkuart.c hci_set_drvdata(hdev, bdev); hdev 1004 drivers/bluetooth/btmtkuart.c hdev->open = btmtkuart_open; hdev 1005 drivers/bluetooth/btmtkuart.c hdev->close = btmtkuart_close; hdev 1006 drivers/bluetooth/btmtkuart.c hdev->flush = btmtkuart_flush; hdev 1007 drivers/bluetooth/btmtkuart.c hdev->setup = btmtkuart_setup; hdev 1008 drivers/bluetooth/btmtkuart.c hdev->shutdown = btmtkuart_shutdown; hdev 1009 drivers/bluetooth/btmtkuart.c hdev->send = btmtkuart_send_frame; hdev 1010 drivers/bluetooth/btmtkuart.c SET_HCIDEV_DEV(hdev, &serdev->dev); hdev 1012 drivers/bluetooth/btmtkuart.c hdev->manufacturer = 70; hdev 1013 drivers/bluetooth/btmtkuart.c set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks); hdev 1063 drivers/bluetooth/btmtkuart.c err = hci_register_dev(hdev); hdev 1066 drivers/bluetooth/btmtkuart.c hci_free_dev(hdev); hdev 1082 drivers/bluetooth/btmtkuart.c struct hci_dev *hdev = bdev->hdev; hdev 1089 drivers/bluetooth/btmtkuart.c hci_unregister_dev(hdev); hdev 1090 drivers/bluetooth/btmtkuart.c hci_free_dev(hdev); hdev 17 drivers/bluetooth/btqca.c int qca_read_soc_version(struct hci_dev *hdev, u32 *soc_version) hdev 25 drivers/bluetooth/btqca.c bt_dev_dbg(hdev, "QCA Version Request"); hdev 28 drivers/bluetooth/btqca.c skb = __hci_cmd_sync_ev(hdev, EDL_PATCH_CMD_OPCODE, EDL_PATCH_CMD_LEN, hdev 32 drivers/bluetooth/btqca.c bt_dev_err(hdev, "Reading QCA version information failed (%d)", hdev 38 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA Version size mismatch len %d", skb->len); hdev 45 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA TLV with no header"); hdev 52 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA Wrong packet received %d %d", edl->cresp, hdev 60 drivers/bluetooth/btqca.c BT_DBG("%s: Product:0x%08x", hdev->name, le32_to_cpu(ver->product_id)); hdev 61 drivers/bluetooth/btqca.c BT_DBG("%s: Patch :0x%08x", hdev->name, le16_to_cpu(ver->patch_ver)); hdev 62 drivers/bluetooth/btqca.c BT_DBG("%s: ROM :0x%08x", hdev->name, le16_to_cpu(ver->rome_ver)); hdev 63 drivers/bluetooth/btqca.c BT_DBG("%s: SOC :0x%08x", hdev->name, le32_to_cpu(ver->soc_id)); hdev 77 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA Failed to get version (%d)", err); hdev 83 drivers/bluetooth/btqca.c static int qca_send_reset(struct hci_dev *hdev) hdev 88 drivers/bluetooth/btqca.c bt_dev_dbg(hdev, "QCA HCI_RESET"); hdev 90 drivers/bluetooth/btqca.c skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT); hdev 93 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA Reset failed (%d)", err); hdev 102 drivers/bluetooth/btqca.c int qca_send_pre_shutdown_cmd(struct hci_dev *hdev) hdev 107 drivers/bluetooth/btqca.c bt_dev_dbg(hdev, "QCA pre shutdown cmd"); hdev 109 drivers/bluetooth/btqca.c skb = __hci_cmd_sync_ev(hdev, QCA_PRE_SHUTDOWN_CMD, 0, hdev 114 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA preshutdown_cmd failed (%d)", err); hdev 225 drivers/bluetooth/btqca.c static int qca_tlv_send_segment(struct hci_dev *hdev, int seg_size, hdev 239 drivers/bluetooth/btqca.c return __hci_cmd_send(hdev, EDL_PATCH_CMD_OPCODE, seg_size + 2, hdev 242 drivers/bluetooth/btqca.c skb = __hci_cmd_sync_ev(hdev, EDL_PATCH_CMD_OPCODE, seg_size + 2, cmd, hdev 246 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA Failed to send TLV segment (%d)", err); hdev 251 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA TLV response size mismatch"); hdev 258 drivers/bluetooth/btqca.c bt_dev_err(hdev, "TLV with no header"); hdev 267 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA TLV with error stat 0x%x rtype 0x%x (0x%x)", hdev 278 drivers/bluetooth/btqca.c static int qca_inject_cmd_complete_event(struct hci_dev *hdev) hdev 300 drivers/bluetooth/btqca.c return hci_recv_frame(hdev, skb); hdev 303 drivers/bluetooth/btqca.c static int qca_download_firmware(struct hci_dev *hdev, hdev 310 drivers/bluetooth/btqca.c bt_dev_info(hdev, "QCA Downloading %s", config->fwname); hdev 312 drivers/bluetooth/btqca.c ret = request_firmware(&fw, config->fwname, &hdev->dev); hdev 314 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA Failed to request file: %s (%d)", hdev 326 drivers/bluetooth/btqca.c bt_dev_dbg(hdev, "Send segment %d, size %d", i++, segsize); hdev 333 drivers/bluetooth/btqca.c ret = qca_tlv_send_segment(hdev, segsize, segment, hdev 349 drivers/bluetooth/btqca.c ret = qca_inject_cmd_complete_event(hdev); hdev 357 drivers/bluetooth/btqca.c int qca_set_bdaddr_rome(struct hci_dev *hdev, const bdaddr_t *bdaddr) hdev 367 drivers/bluetooth/btqca.c skb = __hci_cmd_sync_ev(hdev, EDL_NVM_ACCESS_OPCODE, sizeof(cmd), cmd, hdev 371 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA Change address command failed (%d)", err); hdev 381 drivers/bluetooth/btqca.c int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, hdev 389 drivers/bluetooth/btqca.c bt_dev_dbg(hdev, "QCA setup on UART"); hdev 408 drivers/bluetooth/btqca.c err = qca_download_firmware(hdev, &config); hdev 410 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA Failed to download patch (%d)", err); hdev 429 drivers/bluetooth/btqca.c err = qca_download_firmware(hdev, &config); hdev 431 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA Failed to download NVM (%d)", err); hdev 436 drivers/bluetooth/btqca.c err = qca_send_reset(hdev); hdev 438 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA Failed to run HCI_RESET (%d)", err); hdev 442 drivers/bluetooth/btqca.c bt_dev_info(hdev, "QCA setup on UART is completed"); hdev 448 drivers/bluetooth/btqca.c int qca_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) hdev 453 drivers/bluetooth/btqca.c skb = __hci_cmd_sync_ev(hdev, EDL_WRITE_BD_ADDR_OPCODE, 6, bdaddr, hdev 457 drivers/bluetooth/btqca.c bt_dev_err(hdev, "QCA Change address cmd failed (%d)", err); hdev 133 drivers/bluetooth/btqca.h int qca_set_bdaddr_rome(struct hci_dev *hdev, const bdaddr_t *bdaddr); hdev 134 drivers/bluetooth/btqca.h int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, hdev 137 drivers/bluetooth/btqca.h int qca_read_soc_version(struct hci_dev *hdev, u32 *soc_version); hdev 138 drivers/bluetooth/btqca.h int qca_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr); hdev 139 drivers/bluetooth/btqca.h int qca_send_pre_shutdown_cmd(struct hci_dev *hdev); hdev 146 drivers/bluetooth/btqca.h static inline int qca_set_bdaddr_rome(struct hci_dev *hdev, const bdaddr_t *bdaddr) hdev 151 drivers/bluetooth/btqca.h static inline int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, hdev 158 drivers/bluetooth/btqca.h static inline int qca_read_soc_version(struct hci_dev *hdev, u32 *soc_version) hdev 163 drivers/bluetooth/btqca.h static inline int qca_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) hdev 173 drivers/bluetooth/btqca.h static inline int qca_send_pre_shutdown_cmd(struct hci_dev *hdev) hdev 21 drivers/bluetooth/btqcomsmd.c struct hci_dev *hdev; hdev 27 drivers/bluetooth/btqcomsmd.c static int btqcomsmd_recv(struct hci_dev *hdev, unsigned int type, hdev 35 drivers/bluetooth/btqcomsmd.c hdev->stat.err_rx++; hdev 42 drivers/bluetooth/btqcomsmd.c return hci_recv_frame(hdev, skb); hdev 50 drivers/bluetooth/btqcomsmd.c btq->hdev->stat.byte_rx += count; hdev 51 drivers/bluetooth/btqcomsmd.c return btqcomsmd_recv(btq->hdev, HCI_ACLDATA_PKT, data, count); hdev 59 drivers/bluetooth/btqcomsmd.c btq->hdev->stat.byte_rx += count; hdev 60 drivers/bluetooth/btqcomsmd.c return btqcomsmd_recv(btq->hdev, HCI_EVENT_PKT, data, count); hdev 63 drivers/bluetooth/btqcomsmd.c static int btqcomsmd_send(struct hci_dev *hdev, struct sk_buff *skb) hdev 65 drivers/bluetooth/btqcomsmd.c struct btqcomsmd *btq = hci_get_drvdata(hdev); hdev 72 drivers/bluetooth/btqcomsmd.c hdev->stat.err_tx++; hdev 75 drivers/bluetooth/btqcomsmd.c hdev->stat.acl_tx++; hdev 76 drivers/bluetooth/btqcomsmd.c hdev->stat.byte_tx += skb->len; hdev 81 drivers/bluetooth/btqcomsmd.c hdev->stat.err_tx++; hdev 84 drivers/bluetooth/btqcomsmd.c hdev->stat.cmd_tx++; hdev 85 drivers/bluetooth/btqcomsmd.c hdev->stat.byte_tx += skb->len; hdev 98 drivers/bluetooth/btqcomsmd.c static int btqcomsmd_open(struct hci_dev *hdev) hdev 103 drivers/bluetooth/btqcomsmd.c static int btqcomsmd_close(struct hci_dev *hdev) hdev 108 drivers/bluetooth/btqcomsmd.c static int btqcomsmd_setup(struct hci_dev *hdev) hdev 112 drivers/bluetooth/btqcomsmd.c skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT); hdev 120 drivers/bluetooth/btqcomsmd.c set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); hdev 128 drivers/bluetooth/btqcomsmd.c struct hci_dev *hdev; hdev 148 drivers/bluetooth/btqcomsmd.c hdev = hci_alloc_dev(); hdev 149 drivers/bluetooth/btqcomsmd.c if (!hdev) hdev 152 drivers/bluetooth/btqcomsmd.c hci_set_drvdata(hdev, btq); hdev 153 drivers/bluetooth/btqcomsmd.c btq->hdev = hdev; hdev 154 drivers/bluetooth/btqcomsmd.c SET_HCIDEV_DEV(hdev, &pdev->dev); hdev 156 drivers/bluetooth/btqcomsmd.c hdev->bus = HCI_SMD; hdev 157 drivers/bluetooth/btqcomsmd.c hdev->open = btqcomsmd_open; hdev 158 drivers/bluetooth/btqcomsmd.c hdev->close = btqcomsmd_close; hdev 159 drivers/bluetooth/btqcomsmd.c hdev->send = btqcomsmd_send; hdev 160 drivers/bluetooth/btqcomsmd.c hdev->setup = btqcomsmd_setup; hdev 161 drivers/bluetooth/btqcomsmd.c hdev->set_bdaddr = qca_set_bdaddr_rome; hdev 163 drivers/bluetooth/btqcomsmd.c ret = hci_register_dev(hdev); hdev 165 drivers/bluetooth/btqcomsmd.c hci_free_dev(hdev); hdev 178 drivers/bluetooth/btqcomsmd.c hci_unregister_dev(btq->hdev); hdev 179 drivers/bluetooth/btqcomsmd.c hci_free_dev(btq->hdev); hdev 31 drivers/bluetooth/btrsi.c struct hci_dev *hdev; hdev 34 drivers/bluetooth/btrsi.c static int rsi_hci_open(struct hci_dev *hdev) hdev 39 drivers/bluetooth/btrsi.c static int rsi_hci_close(struct hci_dev *hdev) hdev 44 drivers/bluetooth/btrsi.c static int rsi_hci_flush(struct hci_dev *hdev) hdev 49 drivers/bluetooth/btrsi.c static int rsi_hci_send_pkt(struct hci_dev *hdev, struct sk_buff *skb) hdev 51 drivers/bluetooth/btrsi.c struct rsi_hci_adapter *h_adapter = hci_get_drvdata(hdev); hdev 56 drivers/bluetooth/btrsi.c hdev->stat.cmd_tx++; hdev 59 drivers/bluetooth/btrsi.c hdev->stat.acl_tx++; hdev 62 drivers/bluetooth/btrsi.c hdev->stat.sco_tx++; hdev 93 drivers/bluetooth/btrsi.c struct hci_dev *hdev = h_adapter->hdev; hdev 103 drivers/bluetooth/btrsi.c h_adapter->hdev->stat.byte_rx += skb->len; hdev 107 drivers/bluetooth/btrsi.c return hci_recv_frame(hdev, skb); hdev 113 drivers/bluetooth/btrsi.c struct hci_dev *hdev; hdev 124 drivers/bluetooth/btrsi.c hdev = hci_alloc_dev(); hdev 125 drivers/bluetooth/btrsi.c if (!hdev) { hdev 130 drivers/bluetooth/btrsi.c h_adapter->hdev = hdev; hdev 133 drivers/bluetooth/btrsi.c hdev->bus = HCI_SDIO; hdev 135 drivers/bluetooth/btrsi.c hdev->bus = HCI_USB; hdev 137 drivers/bluetooth/btrsi.c hci_set_drvdata(hdev, h_adapter); hdev 138 drivers/bluetooth/btrsi.c hdev->dev_type = HCI_PRIMARY; hdev 139 drivers/bluetooth/btrsi.c hdev->open = rsi_hci_open; hdev 140 drivers/bluetooth/btrsi.c hdev->close = rsi_hci_close; hdev 141 drivers/bluetooth/btrsi.c hdev->flush = rsi_hci_flush; hdev 142 drivers/bluetooth/btrsi.c hdev->send = rsi_hci_send_pkt; hdev 144 drivers/bluetooth/btrsi.c err = hci_register_dev(hdev); hdev 147 drivers/bluetooth/btrsi.c hci_free_dev(hdev); hdev 153 drivers/bluetooth/btrsi.c h_adapter->hdev = NULL; hdev 161 drivers/bluetooth/btrsi.c struct hci_dev *hdev; hdev 166 drivers/bluetooth/btrsi.c hdev = h_adapter->hdev; hdev 167 drivers/bluetooth/btrsi.c if (hdev) { hdev 168 drivers/bluetooth/btrsi.c hci_unregister_dev(hdev); hdev 169 drivers/bluetooth/btrsi.c hci_free_dev(hdev); hdev 170 drivers/bluetooth/btrsi.c h_adapter->hdev = NULL; hdev 181 drivers/bluetooth/btrtl.c static struct sk_buff *btrtl_read_local_version(struct hci_dev *hdev) hdev 185 drivers/bluetooth/btrtl.c skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL, hdev 188 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "HCI_OP_READ_LOCAL_VERSION failed (%ld)", hdev 194 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "HCI_OP_READ_LOCAL_VERSION event length mismatch"); hdev 202 drivers/bluetooth/btrtl.c static int rtl_read_rom_version(struct hci_dev *hdev, u8 *version) hdev 208 drivers/bluetooth/btrtl.c skb = __hci_cmd_sync(hdev, 0xfc6d, 0, NULL, HCI_INIT_TIMEOUT); hdev 210 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "Read ROM version failed (%ld)", hdev 216 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "version event length mismatch"); hdev 222 drivers/bluetooth/btrtl.c rtl_dev_info(hdev, "rom_version status=%x version=%x", hdev 231 drivers/bluetooth/btrtl.c static int rtlbt_parse_firmware(struct hci_dev *hdev, hdev 266 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "extension section signature mismatch"); hdev 287 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "found instruction with length 0"); hdev 300 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "failed to find version instruction"); hdev 311 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "unknown project id %d", project_id); hdev 317 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "firmware is for %x but this is a %x", hdev 325 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "bad EPATCH signature"); hdev 359 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "didn't find patch for chip id %d", hdev 384 drivers/bluetooth/btrtl.c static int rtl_download_firmware(struct hci_dev *hdev, hdev 416 drivers/bluetooth/btrtl.c skb = __hci_cmd_sync(hdev, 0xfc20, frag_len + 1, dl_cmd, hdev 419 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "download fw command failed (%ld)", hdev 426 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "download fw event length mismatch"); hdev 436 drivers/bluetooth/btrtl.c skb = btrtl_read_local_version(hdev); hdev 439 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "read local version failed"); hdev 444 drivers/bluetooth/btrtl.c rtl_dev_info(hdev, "fw version 0x%04x%04x", hdev 453 drivers/bluetooth/btrtl.c static int rtl_load_file(struct hci_dev *hdev, const char *name, u8 **buff) hdev 458 drivers/bluetooth/btrtl.c rtl_dev_info(hdev, "loading %s", name); hdev 459 drivers/bluetooth/btrtl.c ret = request_firmware(&fw, name, &hdev->dev); hdev 472 drivers/bluetooth/btrtl.c static int btrtl_setup_rtl8723a(struct hci_dev *hdev, hdev 482 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "unexpected EPATCH signature!"); hdev 486 drivers/bluetooth/btrtl.c return rtl_download_firmware(hdev, btrtl_dev->fw_data, hdev 490 drivers/bluetooth/btrtl.c static int btrtl_setup_rtl8723b(struct hci_dev *hdev, hdev 497 drivers/bluetooth/btrtl.c ret = rtlbt_parse_firmware(hdev, btrtl_dev, &fw_data); hdev 517 drivers/bluetooth/btrtl.c rtl_dev_info(hdev, "cfg_sz %d, total sz %d", btrtl_dev->cfg_len, ret); hdev 519 drivers/bluetooth/btrtl.c ret = rtl_download_firmware(hdev, fw_data, ret); hdev 534 drivers/bluetooth/btrtl.c struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev, hdev 551 drivers/bluetooth/btrtl.c skb = btrtl_read_local_version(hdev); hdev 558 drivers/bluetooth/btrtl.c rtl_dev_info(hdev, "examining hci_ver=%02x hci_rev=%04x lmp_ver=%02x lmp_subver=%04x", hdev 568 drivers/bluetooth/btrtl.c hdev->bus); hdev 571 drivers/bluetooth/btrtl.c rtl_dev_info(hdev, "unknown IC info, lmp subver %04x, hci rev %04x, hci ver %04x", hdev 577 drivers/bluetooth/btrtl.c ret = rtl_read_rom_version(hdev, &btrtl_dev->rom_version); hdev 582 drivers/bluetooth/btrtl.c btrtl_dev->fw_len = rtl_load_file(hdev, btrtl_dev->ic_info->fw_name, hdev 585 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "firmware file %s not found", hdev 599 drivers/bluetooth/btrtl.c btrtl_dev->cfg_len = rtl_load_file(hdev, cfg_name, hdev 603 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "mandatory config file %s not found", hdev 619 drivers/bluetooth/btrtl.c int btrtl_download_firmware(struct hci_dev *hdev, hdev 629 drivers/bluetooth/btrtl.c rtl_dev_info(hdev, "assuming no firmware upload needed"); hdev 636 drivers/bluetooth/btrtl.c return btrtl_setup_rtl8723a(hdev, btrtl_dev); hdev 641 drivers/bluetooth/btrtl.c return btrtl_setup_rtl8723b(hdev, btrtl_dev); hdev 643 drivers/bluetooth/btrtl.c rtl_dev_info(hdev, "assuming no firmware upload needed"); hdev 649 drivers/bluetooth/btrtl.c int btrtl_setup_realtek(struct hci_dev *hdev) hdev 654 drivers/bluetooth/btrtl.c btrtl_dev = btrtl_initialize(hdev, NULL); hdev 658 drivers/bluetooth/btrtl.c ret = btrtl_download_firmware(hdev, btrtl_dev); hdev 665 drivers/bluetooth/btrtl.c set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); hdev 671 drivers/bluetooth/btrtl.c int btrtl_shutdown_realtek(struct hci_dev *hdev) hdev 679 drivers/bluetooth/btrtl.c skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT); hdev 682 drivers/bluetooth/btrtl.c bt_dev_err(hdev, "HCI reset during shutdown failed"); hdev 728 drivers/bluetooth/btrtl.c int btrtl_get_uart_settings(struct hci_dev *hdev, hdev 740 drivers/bluetooth/btrtl.c rtl_dev_warn(hdev, "no config loaded"); hdev 746 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "invalid config magic"); hdev 751 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "config is too short"); hdev 761 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "invalid UART config entry"); hdev 778 drivers/bluetooth/btrtl.c rtl_dev_dbg(hdev, "skipping config entry 0x%x (len %u)", hdev 787 drivers/bluetooth/btrtl.c rtl_dev_err(hdev, "no UART config entry found"); hdev 791 drivers/bluetooth/btrtl.c rtl_dev_dbg(hdev, "device baudrate = 0x%08x", *device_baudrate); hdev 792 drivers/bluetooth/btrtl.c rtl_dev_dbg(hdev, "controller baudrate = %u", *controller_baudrate); hdev 793 drivers/bluetooth/btrtl.c rtl_dev_dbg(hdev, "flow control %d", *flow_control); hdev 52 drivers/bluetooth/btrtl.h struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev, hdev 55 drivers/bluetooth/btrtl.h int btrtl_download_firmware(struct hci_dev *hdev, hdev 57 drivers/bluetooth/btrtl.h int btrtl_setup_realtek(struct hci_dev *hdev); hdev 58 drivers/bluetooth/btrtl.h int btrtl_shutdown_realtek(struct hci_dev *hdev); hdev 59 drivers/bluetooth/btrtl.h int btrtl_get_uart_settings(struct hci_dev *hdev, hdev 66 drivers/bluetooth/btrtl.h static inline struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev, hdev 76 drivers/bluetooth/btrtl.h static inline int btrtl_download_firmware(struct hci_dev *hdev, hdev 82 drivers/bluetooth/btrtl.h static inline int btrtl_setup_realtek(struct hci_dev *hdev) hdev 87 drivers/bluetooth/btrtl.h static inline int btrtl_shutdown_realtek(struct hci_dev *hdev) hdev 92 drivers/bluetooth/btrtl.h static inline int btrtl_get_uart_settings(struct hci_dev *hdev, hdev 44 drivers/bluetooth/btsdio.c struct hci_dev *hdev; hdev 68 drivers/bluetooth/btsdio.c BT_DBG("%s", data->hdev->name); hdev 84 drivers/bluetooth/btsdio.c data->hdev->stat.byte_tx += skb->len; hdev 97 drivers/bluetooth/btsdio.c BT_DBG("%s", data->hdev->name); hdev 104 drivers/bluetooth/btsdio.c data->hdev->stat.err_tx++; hdev 119 drivers/bluetooth/btsdio.c BT_DBG("%s", data->hdev->name); hdev 146 drivers/bluetooth/btsdio.c data->hdev->stat.byte_rx += len; hdev 150 drivers/bluetooth/btsdio.c err = hci_recv_frame(data->hdev, skb); hdev 164 drivers/bluetooth/btsdio.c BT_DBG("%s", data->hdev->name); hdev 171 drivers/bluetooth/btsdio.c data->hdev->stat.err_rx++; hdev 177 drivers/bluetooth/btsdio.c static int btsdio_open(struct hci_dev *hdev) hdev 179 drivers/bluetooth/btsdio.c struct btsdio_data *data = hci_get_drvdata(hdev); hdev 182 drivers/bluetooth/btsdio.c BT_DBG("%s", hdev->name); hdev 207 drivers/bluetooth/btsdio.c static int btsdio_close(struct hci_dev *hdev) hdev 209 drivers/bluetooth/btsdio.c struct btsdio_data *data = hci_get_drvdata(hdev); hdev 211 drivers/bluetooth/btsdio.c BT_DBG("%s", hdev->name); hdev 225 drivers/bluetooth/btsdio.c static int btsdio_flush(struct hci_dev *hdev) hdev 227 drivers/bluetooth/btsdio.c struct btsdio_data *data = hci_get_drvdata(hdev); hdev 229 drivers/bluetooth/btsdio.c BT_DBG("%s", hdev->name); hdev 236 drivers/bluetooth/btsdio.c static int btsdio_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 238 drivers/bluetooth/btsdio.c struct btsdio_data *data = hci_get_drvdata(hdev); hdev 240 drivers/bluetooth/btsdio.c BT_DBG("%s", hdev->name); hdev 244 drivers/bluetooth/btsdio.c hdev->stat.cmd_tx++; hdev 248 drivers/bluetooth/btsdio.c hdev->stat.acl_tx++; hdev 252 drivers/bluetooth/btsdio.c hdev->stat.sco_tx++; hdev 270 drivers/bluetooth/btsdio.c struct hci_dev *hdev; hdev 304 drivers/bluetooth/btsdio.c hdev = hci_alloc_dev(); hdev 305 drivers/bluetooth/btsdio.c if (!hdev) hdev 308 drivers/bluetooth/btsdio.c hdev->bus = HCI_SDIO; hdev 309 drivers/bluetooth/btsdio.c hci_set_drvdata(hdev, data); hdev 312 drivers/bluetooth/btsdio.c hdev->dev_type = HCI_AMP; hdev 314 drivers/bluetooth/btsdio.c hdev->dev_type = HCI_PRIMARY; hdev 316 drivers/bluetooth/btsdio.c data->hdev = hdev; hdev 318 drivers/bluetooth/btsdio.c SET_HCIDEV_DEV(hdev, &func->dev); hdev 320 drivers/bluetooth/btsdio.c hdev->open = btsdio_open; hdev 321 drivers/bluetooth/btsdio.c hdev->close = btsdio_close; hdev 322 drivers/bluetooth/btsdio.c hdev->flush = btsdio_flush; hdev 323 drivers/bluetooth/btsdio.c hdev->send = btsdio_send_frame; hdev 326 drivers/bluetooth/btsdio.c set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); hdev 328 drivers/bluetooth/btsdio.c err = hci_register_dev(hdev); hdev 330 drivers/bluetooth/btsdio.c hci_free_dev(hdev); hdev 342 drivers/bluetooth/btsdio.c struct hci_dev *hdev; hdev 349 drivers/bluetooth/btsdio.c hdev = data->hdev; hdev 353 drivers/bluetooth/btsdio.c hci_unregister_dev(hdev); hdev 355 drivers/bluetooth/btsdio.c hci_free_dev(hdev); hdev 444 drivers/bluetooth/btusb.c struct hci_dev *hdev; hdev 489 drivers/bluetooth/btusb.c int (*recv_event)(struct hci_dev *hdev, struct sk_buff *skb); hdev 492 drivers/bluetooth/btusb.c int (*setup_on_usb)(struct hci_dev *hdev); hdev 499 drivers/bluetooth/btusb.c static void btusb_intel_cmd_timeout(struct hci_dev *hdev) hdev 501 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 508 drivers/bluetooth/btusb.c bt_dev_err(hdev, "No way to reset. Ignoring and continuing"); hdev 520 drivers/bluetooth/btusb.c bt_dev_err(hdev, "last reset failed? Not resetting again"); hdev 524 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Initiating HW reset via gpio"); hdev 530 drivers/bluetooth/btusb.c static void btusb_rtl_cmd_timeout(struct hci_dev *hdev) hdev 532 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 539 drivers/bluetooth/btusb.c bt_dev_err(hdev, "No gpio to reset Realtek device, ignoring"); hdev 550 drivers/bluetooth/btusb.c bt_dev_err(hdev, "last reset failed? Not resetting again"); hdev 554 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Reset Realtek device via gpio"); hdev 623 drivers/bluetooth/btusb.c data->recv_event(data->hdev, skb); hdev 681 drivers/bluetooth/btusb.c hci_recv_frame(data->hdev, skb); hdev 737 drivers/bluetooth/btusb.c hci_recv_frame(data->hdev, skb); hdev 750 drivers/bluetooth/btusb.c struct hci_dev *hdev = urb->context; hdev 751 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 754 drivers/bluetooth/btusb.c BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status, hdev 757 drivers/bluetooth/btusb.c if (!test_bit(HCI_RUNNING, &hdev->flags)) hdev 761 drivers/bluetooth/btusb.c hdev->stat.byte_rx += urb->actual_length; hdev 765 drivers/bluetooth/btusb.c bt_dev_err(hdev, "corrupted event packet"); hdev 766 drivers/bluetooth/btusb.c hdev->stat.err_rx++; hdev 785 drivers/bluetooth/btusb.c bt_dev_err(hdev, "urb %p failed to resubmit (%d)", hdev 791 drivers/bluetooth/btusb.c static int btusb_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags) hdev 793 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 799 drivers/bluetooth/btusb.c BT_DBG("%s", hdev->name); hdev 819 drivers/bluetooth/btusb.c btusb_intr_complete, hdev, data->intr_ep->bInterval); hdev 828 drivers/bluetooth/btusb.c bt_dev_err(hdev, "urb %p submission failed (%d)", hdev 840 drivers/bluetooth/btusb.c struct hci_dev *hdev = urb->context; hdev 841 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 844 drivers/bluetooth/btusb.c BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status, hdev 847 drivers/bluetooth/btusb.c if (!test_bit(HCI_RUNNING, &hdev->flags)) hdev 851 drivers/bluetooth/btusb.c hdev->stat.byte_rx += urb->actual_length; hdev 855 drivers/bluetooth/btusb.c bt_dev_err(hdev, "corrupted ACL packet"); hdev 856 drivers/bluetooth/btusb.c hdev->stat.err_rx++; hdev 875 drivers/bluetooth/btusb.c bt_dev_err(hdev, "urb %p failed to resubmit (%d)", hdev 881 drivers/bluetooth/btusb.c static int btusb_submit_bulk_urb(struct hci_dev *hdev, gfp_t mem_flags) hdev 883 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 889 drivers/bluetooth/btusb.c BT_DBG("%s", hdev->name); hdev 907 drivers/bluetooth/btusb.c btusb_bulk_complete, hdev); hdev 917 drivers/bluetooth/btusb.c bt_dev_err(hdev, "urb %p submission failed (%d)", hdev 929 drivers/bluetooth/btusb.c struct hci_dev *hdev = urb->context; hdev 930 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 933 drivers/bluetooth/btusb.c BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status, hdev 936 drivers/bluetooth/btusb.c if (!test_bit(HCI_RUNNING, &hdev->flags)) hdev 947 drivers/bluetooth/btusb.c hdev->stat.byte_rx += length; hdev 951 drivers/bluetooth/btusb.c bt_dev_err(hdev, "corrupted SCO packet"); hdev 952 drivers/bluetooth/btusb.c hdev->stat.err_rx++; hdev 971 drivers/bluetooth/btusb.c bt_dev_err(hdev, "urb %p failed to resubmit (%d)", hdev 998 drivers/bluetooth/btusb.c static int btusb_submit_isoc_urb(struct hci_dev *hdev, gfp_t mem_flags) hdev 1000 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 1006 drivers/bluetooth/btusb.c BT_DBG("%s", hdev->name); hdev 1027 drivers/bluetooth/btusb.c hdev, data->isoc_rx_ep->bInterval); hdev 1039 drivers/bluetooth/btusb.c bt_dev_err(hdev, "urb %p submission failed (%d)", hdev 1051 drivers/bluetooth/btusb.c struct hci_dev *hdev = urb->context; hdev 1052 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 1055 drivers/bluetooth/btusb.c BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status, hdev 1065 drivers/bluetooth/btusb.c hci_recv_diag(hdev, skb); hdev 1084 drivers/bluetooth/btusb.c bt_dev_err(hdev, "urb %p failed to resubmit (%d)", hdev 1090 drivers/bluetooth/btusb.c static int btusb_submit_diag_urb(struct hci_dev *hdev, gfp_t mem_flags) hdev 1092 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 1098 drivers/bluetooth/btusb.c BT_DBG("%s", hdev->name); hdev 1116 drivers/bluetooth/btusb.c btusb_diag_complete, hdev); hdev 1126 drivers/bluetooth/btusb.c bt_dev_err(hdev, "urb %p submission failed (%d)", hdev 1139 drivers/bluetooth/btusb.c struct hci_dev *hdev = (struct hci_dev *)skb->dev; hdev 1140 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 1143 drivers/bluetooth/btusb.c BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status, hdev 1146 drivers/bluetooth/btusb.c if (!test_bit(HCI_RUNNING, &hdev->flags)) hdev 1150 drivers/bluetooth/btusb.c hdev->stat.byte_tx += urb->transfer_buffer_length; hdev 1152 drivers/bluetooth/btusb.c hdev->stat.err_tx++; hdev 1167 drivers/bluetooth/btusb.c struct hci_dev *hdev = (struct hci_dev *)skb->dev; hdev 1169 drivers/bluetooth/btusb.c BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status, hdev 1172 drivers/bluetooth/btusb.c if (!test_bit(HCI_RUNNING, &hdev->flags)) hdev 1176 drivers/bluetooth/btusb.c hdev->stat.byte_tx += urb->transfer_buffer_length; hdev 1178 drivers/bluetooth/btusb.c hdev->stat.err_tx++; hdev 1186 drivers/bluetooth/btusb.c static int btusb_open(struct hci_dev *hdev) hdev 1188 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 1191 drivers/bluetooth/btusb.c BT_DBG("%s", hdev->name); hdev 1201 drivers/bluetooth/btusb.c err = data->setup_on_usb(hdev); hdev 1218 drivers/bluetooth/btusb.c err = btusb_submit_intr_urb(hdev, GFP_KERNEL); hdev 1222 drivers/bluetooth/btusb.c err = btusb_submit_bulk_urb(hdev, GFP_KERNEL); hdev 1229 drivers/bluetooth/btusb.c btusb_submit_bulk_urb(hdev, GFP_KERNEL); hdev 1232 drivers/bluetooth/btusb.c if (!btusb_submit_diag_urb(hdev, GFP_KERNEL)) hdev 1256 drivers/bluetooth/btusb.c static int btusb_close(struct hci_dev *hdev) hdev 1258 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 1261 drivers/bluetooth/btusb.c BT_DBG("%s", hdev->name); hdev 1291 drivers/bluetooth/btusb.c static int btusb_flush(struct hci_dev *hdev) hdev 1293 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 1295 drivers/bluetooth/btusb.c BT_DBG("%s", hdev->name); hdev 1303 drivers/bluetooth/btusb.c static struct urb *alloc_ctrl_urb(struct hci_dev *hdev, struct sk_buff *skb) hdev 1305 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 1331 drivers/bluetooth/btusb.c skb->dev = (void *)hdev; hdev 1336 drivers/bluetooth/btusb.c static struct urb *alloc_bulk_urb(struct hci_dev *hdev, struct sk_buff *skb) hdev 1338 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 1354 drivers/bluetooth/btusb.c skb->dev = (void *)hdev; hdev 1359 drivers/bluetooth/btusb.c static struct urb *alloc_isoc_urb(struct hci_dev *hdev, struct sk_buff *skb) hdev 1361 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 1383 drivers/bluetooth/btusb.c skb->dev = (void *)hdev; hdev 1388 drivers/bluetooth/btusb.c static int submit_tx_urb(struct hci_dev *hdev, struct urb *urb) hdev 1390 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 1398 drivers/bluetooth/btusb.c bt_dev_err(hdev, "urb %p submission failed (%d)", hdev 1410 drivers/bluetooth/btusb.c static int submit_or_queue_tx_urb(struct hci_dev *hdev, struct urb *urb) hdev 1412 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 1423 drivers/bluetooth/btusb.c return submit_tx_urb(hdev, urb); hdev 1432 drivers/bluetooth/btusb.c static int btusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 1436 drivers/bluetooth/btusb.c BT_DBG("%s", hdev->name); hdev 1440 drivers/bluetooth/btusb.c urb = alloc_ctrl_urb(hdev, skb); hdev 1444 drivers/bluetooth/btusb.c hdev->stat.cmd_tx++; hdev 1445 drivers/bluetooth/btusb.c return submit_or_queue_tx_urb(hdev, urb); hdev 1448 drivers/bluetooth/btusb.c urb = alloc_bulk_urb(hdev, skb); hdev 1452 drivers/bluetooth/btusb.c hdev->stat.acl_tx++; hdev 1453 drivers/bluetooth/btusb.c return submit_or_queue_tx_urb(hdev, urb); hdev 1456 drivers/bluetooth/btusb.c if (hci_conn_num(hdev, SCO_LINK) < 1) hdev 1459 drivers/bluetooth/btusb.c urb = alloc_isoc_urb(hdev, skb); hdev 1463 drivers/bluetooth/btusb.c hdev->stat.sco_tx++; hdev 1464 drivers/bluetooth/btusb.c return submit_tx_urb(hdev, urb); hdev 1470 drivers/bluetooth/btusb.c static void btusb_notify(struct hci_dev *hdev, unsigned int evt) hdev 1472 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 1474 drivers/bluetooth/btusb.c BT_DBG("%s evt %d", hdev->name, evt); hdev 1476 drivers/bluetooth/btusb.c if (hci_conn_num(hdev, SCO_LINK) != data->sco_num) { hdev 1477 drivers/bluetooth/btusb.c data->sco_num = hci_conn_num(hdev, SCO_LINK); hdev 1482 drivers/bluetooth/btusb.c static inline int __set_isoc_interface(struct hci_dev *hdev, int altsetting) hdev 1484 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 1494 drivers/bluetooth/btusb.c bt_dev_err(hdev, "setting interface failed (%d)", -err); hdev 1518 drivers/bluetooth/btusb.c bt_dev_err(hdev, "invalid SCO descriptors"); hdev 1528 drivers/bluetooth/btusb.c struct hci_dev *hdev = data->hdev; hdev 1544 drivers/bluetooth/btusb.c if (hdev->voice_setting & 0x0020) { hdev 1572 drivers/bluetooth/btusb.c if (__set_isoc_interface(hdev, new_alts) < 0) hdev 1577 drivers/bluetooth/btusb.c if (btusb_submit_isoc_urb(hdev, GFP_KERNEL) < 0) hdev 1580 drivers/bluetooth/btusb.c btusb_submit_isoc_urb(hdev, GFP_KERNEL); hdev 1586 drivers/bluetooth/btusb.c __set_isoc_interface(hdev, 0); hdev 1604 drivers/bluetooth/btusb.c static int btusb_setup_bcm92035(struct hci_dev *hdev) hdev 1609 drivers/bluetooth/btusb.c BT_DBG("%s", hdev->name); hdev 1611 drivers/bluetooth/btusb.c skb = __hci_cmd_sync(hdev, 0xfc3b, 1, &val, HCI_INIT_TIMEOUT); hdev 1613 drivers/bluetooth/btusb.c bt_dev_err(hdev, "BCM92035 command failed (%ld)", PTR_ERR(skb)); hdev 1620 drivers/bluetooth/btusb.c static int btusb_setup_csr(struct hci_dev *hdev) hdev 1625 drivers/bluetooth/btusb.c BT_DBG("%s", hdev->name); hdev 1627 drivers/bluetooth/btusb.c skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL, hdev 1631 drivers/bluetooth/btusb.c bt_dev_err(hdev, "CSR: Local version failed (%d)", err); hdev 1636 drivers/bluetooth/btusb.c bt_dev_err(hdev, "CSR: Local version length mismatch"); hdev 1649 drivers/bluetooth/btusb.c clear_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); hdev 1654 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks); hdev 1662 drivers/bluetooth/btusb.c static const struct firmware *btusb_setup_intel_get_fw(struct hci_dev *hdev, hdev 1675 drivers/bluetooth/btusb.c ret = request_firmware(&fw, fwname, &hdev->dev); hdev 1678 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Intel firmware file request failed (%d)", hdev 1683 drivers/bluetooth/btusb.c bt_dev_err(hdev, "failed to open Intel firmware file: %s (%d)", hdev 1691 drivers/bluetooth/btusb.c if (request_firmware(&fw, fwname, &hdev->dev) < 0) { hdev 1692 drivers/bluetooth/btusb.c bt_dev_err(hdev, "failed to open default fw file: %s", hdev 1698 drivers/bluetooth/btusb.c bt_dev_info(hdev, "Intel Bluetooth firmware file: %s", fwname); hdev 1703 drivers/bluetooth/btusb.c static int btusb_setup_intel_patching(struct hci_dev *hdev, hdev 1722 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Intel fw corrupted: invalid cmd read"); hdev 1736 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Intel fw corrupted: invalid cmd len"); hdev 1769 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Intel fw corrupted: invalid evt len"); hdev 1783 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Intel fw corrupted: invalid evt read"); hdev 1787 drivers/bluetooth/btusb.c skb = __hci_cmd_sync_ev(hdev, le16_to_cpu(cmd->opcode), cmd->plen, hdev 1790 drivers/bluetooth/btusb.c bt_dev_err(hdev, "sending Intel patch command (0x%4.4x) failed (%ld)", hdev 1800 drivers/bluetooth/btusb.c bt_dev_err(hdev, "mismatch event length (opcode 0x%4.4x)", hdev 1807 drivers/bluetooth/btusb.c bt_dev_err(hdev, "mismatch event parameter (opcode 0x%4.4x)", hdev 1817 drivers/bluetooth/btusb.c static int btusb_setup_intel(struct hci_dev *hdev) hdev 1825 drivers/bluetooth/btusb.c BT_DBG("%s", hdev->name); hdev 1835 drivers/bluetooth/btusb.c skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT); hdev 1837 drivers/bluetooth/btusb.c bt_dev_err(hdev, "sending initial HCI reset command failed (%ld)", hdev 1849 drivers/bluetooth/btusb.c err = btintel_read_version(hdev, &ver); hdev 1853 drivers/bluetooth/btusb.c bt_dev_info(hdev, "read Intel version: %02x%02x%02x%02x%02x%02x%02x%02x%02x", hdev 1863 drivers/bluetooth/btusb.c bt_dev_info(hdev, "Intel device is already patched. " hdev 1874 drivers/bluetooth/btusb.c fw = btusb_setup_intel_get_fw(hdev, &ver); hdev 1883 drivers/bluetooth/btusb.c err = btintel_enter_mfg(hdev); hdev 1914 drivers/bluetooth/btusb.c ret = btusb_setup_intel_patching(hdev, fw, &fw_ptr, hdev 1928 drivers/bluetooth/btusb.c err = btintel_exit_mfg(hdev, true, true); hdev 1932 drivers/bluetooth/btusb.c bt_dev_info(hdev, "Intel firmware patch completed and activated"); hdev 1938 drivers/bluetooth/btusb.c err = btintel_exit_mfg(hdev, false, false); hdev 1942 drivers/bluetooth/btusb.c bt_dev_info(hdev, "Intel firmware patch completed"); hdev 1952 drivers/bluetooth/btusb.c err = btintel_exit_mfg(hdev, true, false); hdev 1956 drivers/bluetooth/btusb.c bt_dev_info(hdev, "Intel firmware patch completed and deactivated"); hdev 1962 drivers/bluetooth/btusb.c btintel_set_event_mask_mfg(hdev, false); hdev 1964 drivers/bluetooth/btusb.c btintel_check_bdaddr(hdev); hdev 1968 drivers/bluetooth/btusb.c static int inject_cmd_complete(struct hci_dev *hdev, __u16 opcode) hdev 1990 drivers/bluetooth/btusb.c return hci_recv_frame(hdev, skb); hdev 2034 drivers/bluetooth/btusb.c static int btusb_recv_event_intel(struct hci_dev *hdev, struct sk_buff *skb) hdev 2036 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 2066 drivers/bluetooth/btusb.c return hci_recv_frame(hdev, skb); hdev 2069 drivers/bluetooth/btusb.c static int btusb_send_frame_intel(struct hci_dev *hdev, struct sk_buff *skb) hdev 2071 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 2074 drivers/bluetooth/btusb.c BT_DBG("%s", hdev->name); hdev 2087 drivers/bluetooth/btusb.c urb = alloc_bulk_urb(hdev, skb); hdev 2089 drivers/bluetooth/btusb.c urb = alloc_ctrl_urb(hdev, skb); hdev 2097 drivers/bluetooth/btusb.c inject_cmd_complete(hdev, opcode); hdev 2099 drivers/bluetooth/btusb.c urb = alloc_ctrl_urb(hdev, skb); hdev 2104 drivers/bluetooth/btusb.c hdev->stat.cmd_tx++; hdev 2105 drivers/bluetooth/btusb.c return submit_or_queue_tx_urb(hdev, urb); hdev 2108 drivers/bluetooth/btusb.c urb = alloc_bulk_urb(hdev, skb); hdev 2112 drivers/bluetooth/btusb.c hdev->stat.acl_tx++; hdev 2113 drivers/bluetooth/btusb.c return submit_or_queue_tx_urb(hdev, urb); hdev 2116 drivers/bluetooth/btusb.c if (hci_conn_num(hdev, SCO_LINK) < 1) hdev 2119 drivers/bluetooth/btusb.c urb = alloc_isoc_urb(hdev, skb); hdev 2123 drivers/bluetooth/btusb.c hdev->stat.sco_tx++; hdev 2124 drivers/bluetooth/btusb.c return submit_tx_urb(hdev, urb); hdev 2159 drivers/bluetooth/btusb.c static int btusb_setup_intel_new(struct hci_dev *hdev) hdev 2161 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 2171 drivers/bluetooth/btusb.c BT_DBG("%s", hdev->name); hdev 2185 drivers/bluetooth/btusb.c err = btintel_read_version(hdev, &ver); hdev 2193 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Unsupported Intel hardware platform (%u)", hdev 2213 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Unsupported Intel hardware variant (%u)", hdev 2218 drivers/bluetooth/btusb.c btintel_version_info(hdev, &ver); hdev 2235 drivers/bluetooth/btusb.c btintel_check_bdaddr(hdev); hdev 2243 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Unsupported Intel firmware variant (%u)", hdev 2251 drivers/bluetooth/btusb.c err = btintel_read_boot_params(hdev, ¶ms); hdev 2260 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Unsupported Intel firmware loading method (%u)", hdev 2269 drivers/bluetooth/btusb.c bt_dev_info(hdev, "No device address configured"); hdev 2270 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); hdev 2297 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Unsupported Intel firmware naming"); hdev 2301 drivers/bluetooth/btusb.c err = request_firmware(&fw, fwname, &hdev->dev); hdev 2303 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Failed to load Intel firmware file (%d)", err); hdev 2307 drivers/bluetooth/btusb.c bt_dev_info(hdev, "Found device firmware: %s", fwname); hdev 2315 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Unsupported Intel firmware naming"); hdev 2320 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Invalid size of firmware file (%zu)", hdev 2329 drivers/bluetooth/btusb.c err = btintel_download_firmware(hdev, fw, &boot_param); hdev 2335 drivers/bluetooth/btusb.c bt_dev_info(hdev, "Waiting for firmware download to complete"); hdev 2352 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Firmware loading interrupted"); hdev 2357 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Firmware loading timeout"); hdev 2363 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Firmware loading failed"); hdev 2372 drivers/bluetooth/btusb.c bt_dev_info(hdev, "Firmware loaded in %llu usecs", duration); hdev 2384 drivers/bluetooth/btusb.c err = btintel_send_intel_reset(hdev, boot_param); hdev 2395 drivers/bluetooth/btusb.c bt_dev_info(hdev, "Waiting for device to boot"); hdev 2402 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Device boot interrupted"); hdev 2407 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Device boot timeout"); hdev 2415 drivers/bluetooth/btusb.c bt_dev_info(hdev, "Device booted in %llu usecs", duration); hdev 2425 drivers/bluetooth/btusb.c btintel_load_ddc_config(hdev, fwname); hdev 2434 drivers/bluetooth/btusb.c btintel_set_event_mask(hdev, false); hdev 2439 drivers/bluetooth/btusb.c static int btusb_shutdown_intel(struct hci_dev *hdev) hdev 2452 drivers/bluetooth/btusb.c skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT); hdev 2455 drivers/bluetooth/btusb.c bt_dev_err(hdev, "HCI reset during shutdown failed"); hdev 2464 drivers/bluetooth/btusb.c skb = __hci_cmd_sync(hdev, 0xfc3f, 0, NULL, HCI_INIT_TIMEOUT); hdev 2467 drivers/bluetooth/btusb.c bt_dev_err(hdev, "turning off Intel device LED failed"); hdev 2475 drivers/bluetooth/btusb.c static int btusb_shutdown_intel_new(struct hci_dev *hdev) hdev 2483 drivers/bluetooth/btusb.c skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT); hdev 2485 drivers/bluetooth/btusb.c bt_dev_err(hdev, "HCI reset during shutdown failed"); hdev 2556 drivers/bluetooth/btusb.c struct hci_dev *hdev = urb->context; hdev 2557 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 2563 drivers/bluetooth/btusb.c hdev->stat.byte_rx += urb->actual_length; hdev 2570 drivers/bluetooth/btusb.c hdev->stat.err_rx++; hdev 2593 drivers/bluetooth/btusb.c err = hci_recv_frame(hdev, skb); hdev 2633 drivers/bluetooth/btusb.c bt_dev_err(hdev, "urb %p failed to resubmit (%d)", hdev 2639 drivers/bluetooth/btusb.c static int btusb_mtk_submit_wmt_recv_urb(struct hci_dev *hdev) hdev 2641 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 2673 drivers/bluetooth/btusb.c buf, size, btusb_mtk_wmt_recv, hdev); hdev 2681 drivers/bluetooth/btusb.c bt_dev_err(hdev, "urb %p submission failed (%d)", hdev 2691 drivers/bluetooth/btusb.c static int btusb_mtk_hci_wmt_sync(struct hci_dev *hdev, hdev 2694 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 2703 drivers/bluetooth/btusb.c err = btusb_mtk_submit_wmt_recv_urb(hdev); hdev 2721 drivers/bluetooth/btusb.c err = __hci_cmd_send(hdev, 0xfc6f, hlen, &wc); hdev 2740 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Execution of wmt command interrupted"); hdev 2746 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Execution of wmt command timed out"); hdev 2754 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Wrong op received %d expected %d", hdev 2788 drivers/bluetooth/btusb.c static int btusb_mtk_setup_firmware(struct hci_dev *hdev, const char *fwname) hdev 2797 drivers/bluetooth/btusb.c err = request_firmware(&fw, fwname, &hdev->dev); hdev 2799 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Failed to load firmware file (%d)", err); hdev 2832 drivers/bluetooth/btusb.c err = btusb_mtk_hci_wmt_sync(hdev, &wmt_params); hdev 2834 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Failed to send wmt patch dwnld (%d)", hdev 2850 drivers/bluetooth/btusb.c err = btusb_mtk_hci_wmt_sync(hdev, &wmt_params); hdev 2852 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Failed to send wmt rst (%d)", err); hdev 2865 drivers/bluetooth/btusb.c static int btusb_mtk_func_query(struct hci_dev *hdev) hdev 2878 drivers/bluetooth/btusb.c err = btusb_mtk_hci_wmt_sync(hdev, &wmt_params); hdev 2880 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Failed to query function status (%d)", err); hdev 2917 drivers/bluetooth/btusb.c static int btusb_mtk_setup(struct hci_dev *hdev) hdev 2919 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 2934 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Failed to get device id (%d)", err); hdev 2946 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Unsupported support hardware variant (%08x)", hdev 2958 drivers/bluetooth/btusb.c err = btusb_mtk_hci_wmt_sync(hdev, &wmt_params); hdev 2960 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Failed to query firmware status (%d)", err); hdev 2965 drivers/bluetooth/btusb.c bt_dev_info(hdev, "firmware already downloaded"); hdev 2970 drivers/bluetooth/btusb.c err = btusb_mtk_setup_firmware(hdev, fwname); hdev 2975 drivers/bluetooth/btusb.c err = readx_poll_timeout(btusb_mtk_func_query, hdev, status, hdev 2987 drivers/bluetooth/btusb.c bt_dev_info(hdev, "function already on"); hdev 2999 drivers/bluetooth/btusb.c err = btusb_mtk_hci_wmt_sync(hdev, &wmt_params); hdev 3001 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Failed to send wmt func ctrl (%d)", err); hdev 3013 drivers/bluetooth/btusb.c skb = __hci_cmd_sync(hdev, 0xfc7a, sizeof(tci_sleep), &tci_sleep, hdev 3017 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Failed to apply low power setting (%d)", err); hdev 3026 drivers/bluetooth/btusb.c bt_dev_info(hdev, "Device setup in %llu usecs", duration); hdev 3031 drivers/bluetooth/btusb.c static int btusb_mtk_shutdown(struct hci_dev *hdev) hdev 3044 drivers/bluetooth/btusb.c err = btusb_mtk_hci_wmt_sync(hdev, &wmt_params); hdev 3046 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Failed to send wmt func ctrl (%d)", err); hdev 3059 drivers/bluetooth/btusb.c static int marvell_config_oob_wake(struct hci_dev *hdev) hdev 3062 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 3083 drivers/bluetooth/btusb.c bt_dev_err(hdev, "%s: No memory\n", __func__); hdev 3090 drivers/bluetooth/btusb.c ret = btusb_send_frame(hdev, skb); hdev 3092 drivers/bluetooth/btusb.c bt_dev_err(hdev, "%s: configuration failed\n", __func__); hdev 3101 drivers/bluetooth/btusb.c static int btusb_set_bdaddr_marvell(struct hci_dev *hdev, hdev 3112 drivers/bluetooth/btusb.c skb = __hci_cmd_sync(hdev, 0xfc22, sizeof(buf), buf, HCI_INIT_TIMEOUT); hdev 3115 drivers/bluetooth/btusb.c bt_dev_err(hdev, "changing Marvell device address failed (%ld)", hdev 3124 drivers/bluetooth/btusb.c static int btusb_set_bdaddr_ath3012(struct hci_dev *hdev, hdev 3137 drivers/bluetooth/btusb.c skb = __hci_cmd_sync(hdev, 0xfc0b, sizeof(buf), buf, HCI_INIT_TIMEOUT); hdev 3140 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Change address command failed (%ld)", ret); hdev 3216 drivers/bluetooth/btusb.c static int btusb_setup_qca_download_fw(struct hci_dev *hdev, hdev 3220 drivers/bluetooth/btusb.c struct btusb_data *btdata = hci_get_drvdata(hdev); hdev 3244 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Failed to send headers (%d)", err); hdev 3260 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Failed to send body at %zd of %zd (%d)", hdev 3266 drivers/bluetooth/btusb.c bt_dev_err(hdev, "Failed to get bulk buffer"); hdev 3280 drivers/bluetooth/btusb.c static int btusb_setup_qca_load_rampatch(struct hci_dev *hdev, hdev 3296 drivers/bluetooth/btusb.c err = request_firmware(&fw, fwname, &hdev->dev); hdev 3298 drivers/bluetooth/btusb.c bt_dev_err(hdev, "failed to request rampatch file: %s (%d)", hdev 3303 drivers/bluetooth/btusb.c bt_dev_info(hdev, "using rampatch file: %s", fwname); hdev 3309 drivers/bluetooth/btusb.c bt_dev_info(hdev, "QCA: patch rome 0x%x build 0x%x, " hdev 3314 drivers/bluetooth/btusb.c bt_dev_err(hdev, "rampatch file version did not match with firmware"); hdev 3319 drivers/bluetooth/btusb.c err = btusb_setup_qca_download_fw(hdev, fw, info->rampatch_hdr); hdev 3327 drivers/bluetooth/btusb.c static int btusb_setup_qca_load_nvm(struct hci_dev *hdev, hdev 3338 drivers/bluetooth/btusb.c err = request_firmware(&fw, fwname, &hdev->dev); hdev 3340 drivers/bluetooth/btusb.c bt_dev_err(hdev, "failed to request NVM file: %s (%d)", hdev 3345 drivers/bluetooth/btusb.c bt_dev_info(hdev, "using NVM file: %s", fwname); hdev 3347 drivers/bluetooth/btusb.c err = btusb_setup_qca_download_fw(hdev, fw, info->nvm_hdr); hdev 3366 drivers/bluetooth/btusb.c static int btusb_setup_qca(struct hci_dev *hdev) hdev 3368 drivers/bluetooth/btusb.c struct btusb_data *btdata = hci_get_drvdata(hdev); hdev 3391 drivers/bluetooth/btusb.c bt_dev_err(hdev, "don't support firmware rome 0x%x", ver_rom); hdev 3401 drivers/bluetooth/btusb.c err = btusb_setup_qca_load_rampatch(hdev, &ver, info); hdev 3407 drivers/bluetooth/btusb.c err = btusb_setup_qca_load_nvm(hdev, &ver, info); hdev 3416 drivers/bluetooth/btusb.c static inline int __set_diag_interface(struct hci_dev *hdev) hdev 3418 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 3445 drivers/bluetooth/btusb.c bt_dev_err(hdev, "invalid diagnostic descriptors"); hdev 3452 drivers/bluetooth/btusb.c static struct urb *alloc_diag_urb(struct hci_dev *hdev, bool enable) hdev 3454 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 3480 drivers/bluetooth/btusb.c skb->dev = (void *)hdev; hdev 3485 drivers/bluetooth/btusb.c static int btusb_bcm_set_diag(struct hci_dev *hdev, bool enable) hdev 3487 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 3493 drivers/bluetooth/btusb.c if (!test_bit(HCI_RUNNING, &hdev->flags)) hdev 3496 drivers/bluetooth/btusb.c urb = alloc_diag_urb(hdev, enable); hdev 3500 drivers/bluetooth/btusb.c return submit_or_queue_tx_urb(hdev, urb); hdev 3529 drivers/bluetooth/btusb.c static int btusb_config_oob_wake(struct hci_dev *hdev) hdev 3531 drivers/bluetooth/btusb.c struct btusb_data *data = hci_get_drvdata(hdev); hdev 3543 drivers/bluetooth/btusb.c bt_dev_dbg(hdev, "%s: no OOB Wakeup IRQ in DT", __func__); hdev 3548 drivers/bluetooth/btusb.c ret = devm_request_irq(&hdev->dev, irq, btusb_oob_wake_handler, hdev 3551 drivers/bluetooth/btusb.c bt_dev_err(hdev, "%s: IRQ request failed", __func__); hdev 3557 drivers/bluetooth/btusb.c bt_dev_err(hdev, "%s: failed to init_wakeup", __func__); hdev 3562 drivers/bluetooth/btusb.c bt_dev_info(hdev, "OOB Wake-on-BT configured at IRQ %u", irq); hdev 3579 drivers/bluetooth/btusb.c struct hci_dev *hdev; hdev 3676 drivers/bluetooth/btusb.c hdev = hci_alloc_dev(); hdev 3677 drivers/bluetooth/btusb.c if (!hdev) hdev 3680 drivers/bluetooth/btusb.c hdev->bus = HCI_USB; hdev 3681 drivers/bluetooth/btusb.c hci_set_drvdata(hdev, data); hdev 3684 drivers/bluetooth/btusb.c hdev->dev_type = HCI_AMP; hdev 3686 drivers/bluetooth/btusb.c hdev->dev_type = HCI_PRIMARY; hdev 3688 drivers/bluetooth/btusb.c data->hdev = hdev; hdev 3690 drivers/bluetooth/btusb.c SET_HCIDEV_DEV(hdev, &intf->dev); hdev 3701 drivers/bluetooth/btusb.c hdev->open = btusb_open; hdev 3702 drivers/bluetooth/btusb.c hdev->close = btusb_close; hdev 3703 drivers/bluetooth/btusb.c hdev->flush = btusb_flush; hdev 3704 drivers/bluetooth/btusb.c hdev->send = btusb_send_frame; hdev 3705 drivers/bluetooth/btusb.c hdev->notify = btusb_notify; hdev 3708 drivers/bluetooth/btusb.c err = btusb_config_oob_wake(hdev); hdev 3714 drivers/bluetooth/btusb.c err = marvell_config_oob_wake(hdev); hdev 3720 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks); hdev 3723 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks); hdev 3726 drivers/bluetooth/btusb.c hdev->setup = btusb_setup_bcm92035; hdev 3730 drivers/bluetooth/btusb.c hdev->manufacturer = 15; hdev 3731 drivers/bluetooth/btusb.c hdev->setup = btbcm_setup_patchram; hdev 3732 drivers/bluetooth/btusb.c hdev->set_diag = btusb_bcm_set_diag; hdev 3733 drivers/bluetooth/btusb.c hdev->set_bdaddr = btbcm_set_bdaddr; hdev 3740 drivers/bluetooth/btusb.c hdev->manufacturer = 15; hdev 3741 drivers/bluetooth/btusb.c hdev->setup = btbcm_setup_apple; hdev 3742 drivers/bluetooth/btusb.c hdev->set_diag = btusb_bcm_set_diag; hdev 3750 drivers/bluetooth/btusb.c hdev->manufacturer = 2; hdev 3751 drivers/bluetooth/btusb.c hdev->setup = btusb_setup_intel; hdev 3752 drivers/bluetooth/btusb.c hdev->shutdown = btusb_shutdown_intel; hdev 3753 drivers/bluetooth/btusb.c hdev->set_diag = btintel_set_diag_mfg; hdev 3754 drivers/bluetooth/btusb.c hdev->set_bdaddr = btintel_set_bdaddr; hdev 3755 drivers/bluetooth/btusb.c hdev->cmd_timeout = btusb_intel_cmd_timeout; hdev 3756 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); hdev 3757 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); hdev 3758 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks); hdev 3762 drivers/bluetooth/btusb.c hdev->manufacturer = 2; hdev 3763 drivers/bluetooth/btusb.c hdev->send = btusb_send_frame_intel; hdev 3764 drivers/bluetooth/btusb.c hdev->setup = btusb_setup_intel_new; hdev 3765 drivers/bluetooth/btusb.c hdev->shutdown = btusb_shutdown_intel_new; hdev 3766 drivers/bluetooth/btusb.c hdev->hw_error = btintel_hw_error; hdev 3767 drivers/bluetooth/btusb.c hdev->set_diag = btintel_set_diag; hdev 3768 drivers/bluetooth/btusb.c hdev->set_bdaddr = btintel_set_bdaddr; hdev 3769 drivers/bluetooth/btusb.c hdev->cmd_timeout = btusb_intel_cmd_timeout; hdev 3770 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); hdev 3771 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); hdev 3772 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks); hdev 3776 drivers/bluetooth/btusb.c hdev->set_bdaddr = btusb_set_bdaddr_marvell; hdev 3780 drivers/bluetooth/btusb.c hdev->setup = btusb_mtk_setup; hdev 3781 drivers/bluetooth/btusb.c hdev->shutdown = btusb_mtk_shutdown; hdev 3782 drivers/bluetooth/btusb.c hdev->manufacturer = 70; hdev 3783 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks); hdev 3788 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_FIXUP_INQUIRY_MODE, &hdev->quirks); hdev 3789 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_BROKEN_LOCAL_COMMANDS, &hdev->quirks); hdev 3793 drivers/bluetooth/btusb.c hdev->manufacturer = 2; hdev 3794 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); hdev 3799 drivers/bluetooth/btusb.c hdev->set_bdaddr = btusb_set_bdaddr_ath3012; hdev 3800 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); hdev 3801 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); hdev 3806 drivers/bluetooth/btusb.c hdev->set_bdaddr = btusb_set_bdaddr_ath3012; hdev 3807 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); hdev 3813 drivers/bluetooth/btusb.c hdev->setup = btrtl_setup_realtek; hdev 3814 drivers/bluetooth/btusb.c hdev->shutdown = btrtl_shutdown_realtek; hdev 3815 drivers/bluetooth/btusb.c hdev->cmd_timeout = btusb_rtl_cmd_timeout; hdev 3838 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); hdev 3842 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks); hdev 3850 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); hdev 3859 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); hdev 3863 drivers/bluetooth/btusb.c hdev->setup = btusb_setup_csr; hdev 3865 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); hdev 3873 drivers/bluetooth/btusb.c set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); hdev 3898 drivers/bluetooth/btusb.c __set_diag_interface(hdev); hdev 3907 drivers/bluetooth/btusb.c err = hci_register_dev(hdev); hdev 3918 drivers/bluetooth/btusb.c hci_free_dev(hdev); hdev 3925 drivers/bluetooth/btusb.c struct hci_dev *hdev; hdev 3932 drivers/bluetooth/btusb.c hdev = data->hdev; hdev 3941 drivers/bluetooth/btusb.c hci_unregister_dev(hdev); hdev 3964 drivers/bluetooth/btusb.c hci_free_dev(hdev); hdev 4026 drivers/bluetooth/btusb.c data->hdev->name, urb, -err); hdev 4047 drivers/bluetooth/btusb.c struct hci_dev *hdev = data->hdev; hdev 4061 drivers/bluetooth/btusb.c if (!test_bit(HCI_RUNNING, &hdev->flags)) hdev 4065 drivers/bluetooth/btusb.c err = btusb_submit_intr_urb(hdev, GFP_NOIO); hdev 4073 drivers/bluetooth/btusb.c err = btusb_submit_bulk_urb(hdev, GFP_NOIO); hdev 4079 drivers/bluetooth/btusb.c btusb_submit_bulk_urb(hdev, GFP_NOIO); hdev 4083 drivers/bluetooth/btusb.c if (btusb_submit_isoc_urb(hdev, GFP_NOIO) < 0) hdev 4086 drivers/bluetooth/btusb.c btusb_submit_isoc_urb(hdev, GFP_NOIO); hdev 40 drivers/bluetooth/btwilink.c struct hci_dev *hdev; hdev 49 drivers/bluetooth/btwilink.c struct hci_dev *hdev = hst->hdev; hdev 54 drivers/bluetooth/btwilink.c hdev->stat.cmd_tx++; hdev 58 drivers/bluetooth/btwilink.c hdev->stat.acl_tx++; hdev 62 drivers/bluetooth/btwilink.c hdev->stat.sco_tx++; hdev 98 drivers/bluetooth/btwilink.c err = hci_recv_frame(lhst->hdev, skb); hdev 104 drivers/bluetooth/btwilink.c lhst->hdev->stat.byte_rx += skb->len; hdev 136 drivers/bluetooth/btwilink.c static int ti_st_open(struct hci_dev *hdev) hdev 142 drivers/bluetooth/btwilink.c BT_DBG("%s %p", hdev->name, hdev); hdev 145 drivers/bluetooth/btwilink.c hst = hci_get_drvdata(hdev); hdev 214 drivers/bluetooth/btwilink.c static int ti_st_close(struct hci_dev *hdev) hdev 217 drivers/bluetooth/btwilink.c struct ti_st *hst = hci_get_drvdata(hdev); hdev 231 drivers/bluetooth/btwilink.c static int ti_st_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 237 drivers/bluetooth/btwilink.c hst = hci_get_drvdata(hdev); hdev 242 drivers/bluetooth/btwilink.c BT_DBG("%s: type %d len %d", hdev->name, hci_skb_pkt_type(skb), hdev 258 drivers/bluetooth/btwilink.c hdev->stat.byte_tx += len; hdev 267 drivers/bluetooth/btwilink.c struct hci_dev *hdev; hdev 275 drivers/bluetooth/btwilink.c hdev = hci_alloc_dev(); hdev 276 drivers/bluetooth/btwilink.c if (!hdev) hdev 279 drivers/bluetooth/btwilink.c BT_DBG("hdev %p", hdev); hdev 281 drivers/bluetooth/btwilink.c hst->hdev = hdev; hdev 282 drivers/bluetooth/btwilink.c hdev->bus = HCI_UART; hdev 283 drivers/bluetooth/btwilink.c hci_set_drvdata(hdev, hst); hdev 284 drivers/bluetooth/btwilink.c hdev->open = ti_st_open; hdev 285 drivers/bluetooth/btwilink.c hdev->close = ti_st_close; hdev 286 drivers/bluetooth/btwilink.c hdev->flush = NULL; hdev 287 drivers/bluetooth/btwilink.c hdev->send = ti_st_send_frame; hdev 289 drivers/bluetooth/btwilink.c err = hci_register_dev(hdev); hdev 292 drivers/bluetooth/btwilink.c hci_free_dev(hdev); hdev 296 drivers/bluetooth/btwilink.c BT_DBG("HCI device registered (hdev %p)", hdev); hdev 304 drivers/bluetooth/btwilink.c struct hci_dev *hdev; hdev 310 drivers/bluetooth/btwilink.c BT_DBG("%s", hst->hdev->name); hdev 312 drivers/bluetooth/btwilink.c hdev = hst->hdev; hdev 313 drivers/bluetooth/btwilink.c ti_st_close(hdev); hdev 314 drivers/bluetooth/btwilink.c hci_unregister_dev(hdev); hdev 316 drivers/bluetooth/btwilink.c hci_free_dev(hdev); hdev 68 drivers/bluetooth/dtl1_cs.c struct hci_dev *hdev; hdev 171 drivers/bluetooth/dtl1_cs.c info->hdev->stat.byte_tx += len; hdev 216 drivers/bluetooth/dtl1_cs.c info->hdev->stat.byte_rx++; hdev 263 drivers/bluetooth/dtl1_cs.c hci_recv_frame(info->hdev, info->rx_skb); hdev 298 drivers/bluetooth/dtl1_cs.c if (!info || !info->hdev) hdev 359 drivers/bluetooth/dtl1_cs.c static int dtl1_hci_open(struct hci_dev *hdev) hdev 365 drivers/bluetooth/dtl1_cs.c static int dtl1_hci_flush(struct hci_dev *hdev) hdev 367 drivers/bluetooth/dtl1_cs.c struct dtl1_info *info = hci_get_drvdata(hdev); hdev 376 drivers/bluetooth/dtl1_cs.c static int dtl1_hci_close(struct hci_dev *hdev) hdev 378 drivers/bluetooth/dtl1_cs.c dtl1_hci_flush(hdev); hdev 384 drivers/bluetooth/dtl1_cs.c static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 386 drivers/bluetooth/dtl1_cs.c struct dtl1_info *info = hci_get_drvdata(hdev); hdev 392 drivers/bluetooth/dtl1_cs.c hdev->stat.cmd_tx++; hdev 396 drivers/bluetooth/dtl1_cs.c hdev->stat.acl_tx++; hdev 400 drivers/bluetooth/dtl1_cs.c hdev->stat.sco_tx++; hdev 439 drivers/bluetooth/dtl1_cs.c struct hci_dev *hdev; hdev 452 drivers/bluetooth/dtl1_cs.c hdev = hci_alloc_dev(); hdev 453 drivers/bluetooth/dtl1_cs.c if (!hdev) { hdev 458 drivers/bluetooth/dtl1_cs.c info->hdev = hdev; hdev 460 drivers/bluetooth/dtl1_cs.c hdev->bus = HCI_PCCARD; hdev 461 drivers/bluetooth/dtl1_cs.c hci_set_drvdata(hdev, info); hdev 462 drivers/bluetooth/dtl1_cs.c SET_HCIDEV_DEV(hdev, &info->p_dev->dev); hdev 464 drivers/bluetooth/dtl1_cs.c hdev->open = dtl1_hci_open; hdev 465 drivers/bluetooth/dtl1_cs.c hdev->close = dtl1_hci_close; hdev 466 drivers/bluetooth/dtl1_cs.c hdev->flush = dtl1_hci_flush; hdev 467 drivers/bluetooth/dtl1_cs.c hdev->send = dtl1_hci_send_frame; hdev 493 drivers/bluetooth/dtl1_cs.c if (hci_register_dev(hdev) < 0) { hdev 495 drivers/bluetooth/dtl1_cs.c info->hdev = NULL; hdev 496 drivers/bluetooth/dtl1_cs.c hci_free_dev(hdev); hdev 508 drivers/bluetooth/dtl1_cs.c struct hci_dev *hdev = info->hdev; hdev 510 drivers/bluetooth/dtl1_cs.c if (!hdev) hdev 513 drivers/bluetooth/dtl1_cs.c dtl1_hci_close(hdev); hdev 525 drivers/bluetooth/dtl1_cs.c hci_unregister_dev(hdev); hdev 526 drivers/bluetooth/dtl1_cs.c hci_free_dev(hdev); hdev 17 drivers/bluetooth/h4_recv.h int (*recv)(struct hci_dev *hdev, struct sk_buff *skb); hdev 41 drivers/bluetooth/h4_recv.h static inline struct sk_buff *h4_recv_buf(struct hci_dev *hdev, hdev 135 drivers/bluetooth/h4_recv.h (&pkts[i])->recv(hdev, skb); hdev 140 drivers/bluetooth/h4_recv.h (&pkts[i])->recv(hdev, skb); hdev 108 drivers/bluetooth/hci_ag6xx.c ag6xx->rx_skb = h4_recv_buf(hu->hdev, ag6xx->rx_skb, data, count, hdev 113 drivers/bluetooth/hci_ag6xx.c bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err); hdev 121 drivers/bluetooth/hci_ag6xx.c static int intel_mem_write(struct hci_dev *hdev, u32 addr, u32 plen, hdev 137 drivers/bluetooth/hci_ag6xx.c skb = __hci_cmd_sync(hdev, 0xfc8e, fragment_len + 6, cmd_param, hdev 153 drivers/bluetooth/hci_ag6xx.c struct hci_dev *hdev = hu->hdev; hdev 162 drivers/bluetooth/hci_ag6xx.c hu->hdev->set_diag = btintel_set_diag; hdev 163 drivers/bluetooth/hci_ag6xx.c hu->hdev->set_bdaddr = btintel_set_bdaddr; hdev 165 drivers/bluetooth/hci_ag6xx.c err = btintel_enter_mfg(hdev); hdev 169 drivers/bluetooth/hci_ag6xx.c err = btintel_read_version(hdev, &ver); hdev 173 drivers/bluetooth/hci_ag6xx.c btintel_version_info(hdev, &ver); hdev 179 drivers/bluetooth/hci_ag6xx.c bt_dev_err(hdev, "Unsupported Intel hardware platform: 0x%X", hdev 188 drivers/bluetooth/hci_ag6xx.c bt_dev_err(hdev, "Unsupported Intel hardware variant: 0x%x", hdev 196 drivers/bluetooth/hci_ag6xx.c err = request_firmware(&fw, fwname, &hdev->dev); hdev 198 drivers/bluetooth/hci_ag6xx.c bt_dev_err(hdev, "Failed to open Intel bddata file: %s (%d)", hdev 204 drivers/bluetooth/hci_ag6xx.c bt_dev_info(hdev, "Applying bddata (%s)", fwname); hdev 206 drivers/bluetooth/hci_ag6xx.c skb = __hci_cmd_sync_ev(hdev, 0xfc2f, fw->size, fw->data, hdev 209 drivers/bluetooth/hci_ag6xx.c bt_dev_err(hdev, "Applying bddata failed (%ld)", PTR_ERR(skb)); hdev 222 drivers/bluetooth/hci_ag6xx.c bt_dev_info(hdev, "Device is already patched. patch num: %02x", hdev 234 drivers/bluetooth/hci_ag6xx.c err = request_firmware(&fw, fwname, &hdev->dev); hdev 236 drivers/bluetooth/hci_ag6xx.c bt_dev_err(hdev, "Failed to open Intel patch file: %s(%d)", hdev 242 drivers/bluetooth/hci_ag6xx.c bt_dev_info(hdev, "Patching firmware file (%s)", fwname); hdev 259 drivers/bluetooth/hci_ag6xx.c bt_dev_info(hdev, "Patching complete"); hdev 268 drivers/bluetooth/hci_ag6xx.c bt_dev_info(hdev, "Invalid patch len (%d)", plen); hdev 272 drivers/bluetooth/hci_ag6xx.c bt_dev_info(hdev, "Patching %td/%zu", (fw_ptr - fw->data), hdev 275 drivers/bluetooth/hci_ag6xx.c err = intel_mem_write(hdev, addr, plen, pbn->data); hdev 277 drivers/bluetooth/hci_ag6xx.c bt_dev_err(hdev, "Patching failed"); hdev 288 drivers/bluetooth/hci_ag6xx.c err = btintel_exit_mfg(hdev, true, patched); hdev 295 drivers/bluetooth/hci_ag6xx.c btintel_set_event_mask_mfg(hdev, false); hdev 297 drivers/bluetooth/hci_ag6xx.c btintel_check_bdaddr(hdev); hdev 147 drivers/bluetooth/hci_ath.c static int ath_vendor_cmd(struct hci_dev *hdev, uint8_t opcode, uint16_t index, hdev 161 drivers/bluetooth/hci_ath.c skb = __hci_cmd_sync(hdev, 0xfc0b, dlen + 4, &cmd, HCI_INIT_TIMEOUT); hdev 169 drivers/bluetooth/hci_ath.c static int ath_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) hdev 171 drivers/bluetooth/hci_ath.c return ath_vendor_cmd(hdev, OP_WRITE_TAG, INDEX_BDADDR, bdaddr, hdev 179 drivers/bluetooth/hci_ath.c hu->hdev->set_bdaddr = ath_set_bdaddr; hdev 194 drivers/bluetooth/hci_ath.c ath->rx_skb = h4_recv_buf(hu->hdev, ath->rx_skb, data, count, hdev 198 drivers/bluetooth/hci_ath.c bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err); hdev 143 drivers/bluetooth/hci_bcm.c struct hci_dev *hdev = hu->hdev; hdev 152 drivers/bluetooth/hci_bcm.c bt_dev_dbg(hdev, "Set Controller clock (%d)", clock.type); hdev 157 drivers/bluetooth/hci_bcm.c skb = __hci_cmd_sync(hdev, 0xfc45, 1, &clock, HCI_INIT_TIMEOUT); hdev 160 drivers/bluetooth/hci_bcm.c bt_dev_err(hdev, "BCM: failed to write clock (%d)", hdev 168 drivers/bluetooth/hci_bcm.c bt_dev_dbg(hdev, "Set Controller UART speed to %d bit/s", speed); hdev 176 drivers/bluetooth/hci_bcm.c skb = __hci_cmd_sync(hdev, 0xfc18, sizeof(param), ¶m, hdev 180 drivers/bluetooth/hci_bcm.c bt_dev_err(hdev, "BCM: failed to write update baudrate (%d)", hdev 360 drivers/bluetooth/hci_bcm.c skb = __hci_cmd_sync(hu->hdev, 0xfc27, sizeof(sleep_params), hdev 364 drivers/bluetooth/hci_bcm.c bt_dev_err(hu->hdev, "Sleep VSC failed (%d)", err); hdev 369 drivers/bluetooth/hci_bcm.c bt_dev_dbg(hu->hdev, "Set Sleep Parameters VSC succeeded"); hdev 378 drivers/bluetooth/hci_bcm.c static int bcm_set_diag(struct hci_dev *hdev, bool enable) hdev 380 drivers/bluetooth/hci_bcm.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 384 drivers/bluetooth/hci_bcm.c if (!test_bit(HCI_RUNNING, &hdev->flags)) hdev 407 drivers/bluetooth/hci_bcm.c bt_dev_dbg(hu->hdev, "hu %p", hu); hdev 475 drivers/bluetooth/hci_bcm.c bt_dev_dbg(hu->hdev, "hu %p", hu); hdev 498 drivers/bluetooth/hci_bcm.c bt_dev_err(hu->hdev, "Failed to power down"); hdev 516 drivers/bluetooth/hci_bcm.c bt_dev_dbg(hu->hdev, "hu %p", hu); hdev 531 drivers/bluetooth/hci_bcm.c bt_dev_dbg(hu->hdev, "hu %p", hu); hdev 533 drivers/bluetooth/hci_bcm.c hu->hdev->set_diag = bcm_set_diag; hdev 534 drivers/bluetooth/hci_bcm.c hu->hdev->set_bdaddr = btbcm_set_bdaddr; hdev 536 drivers/bluetooth/hci_bcm.c err = btbcm_initialize(hu->hdev, fw_name, sizeof(fw_name), false); hdev 540 drivers/bluetooth/hci_bcm.c err = request_firmware(&fw, fw_name, &hu->hdev->dev); hdev 542 drivers/bluetooth/hci_bcm.c bt_dev_info(hu->hdev, "BCM: Patch %s not found", fw_name); hdev 546 drivers/bluetooth/hci_bcm.c err = btbcm_patchram(hu->hdev, fw); hdev 548 drivers/bluetooth/hci_bcm.c bt_dev_info(hu->hdev, "BCM: Patch failed (%d)", err); hdev 580 drivers/bluetooth/hci_bcm.c err = btbcm_finalize(hu->hdev); hdev 635 drivers/bluetooth/hci_bcm.c bcm->rx_skb = h4_recv_buf(hu->hdev, bcm->rx_skb, data, count, hdev 639 drivers/bluetooth/hci_bcm.c bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err); hdev 660 drivers/bluetooth/hci_bcm.c bt_dev_dbg(hu->hdev, "hu %p skb %p", hu, skb); hdev 548 drivers/bluetooth/hci_bcsp.c hci_recv_frame(hu->hdev, bcsp->rx_skb); hdev 562 drivers/bluetooth/hci_bcsp.c hci_recv_frame(hu->hdev, bcsp->rx_skb); hdev 116 drivers/bluetooth/hci_h4.c h4->rx_skb = h4_recv_buf(hu->hdev, h4->rx_skb, data, count, hdev 120 drivers/bluetooth/hci_h4.c bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err); hdev 155 drivers/bluetooth/hci_h4.c struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb, hdev 159 drivers/bluetooth/hci_h4.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 260 drivers/bluetooth/hci_h4.c (&pkts[i])->recv(hdev, skb); hdev 268 drivers/bluetooth/hci_h4.c (&pkts[i])->recv(hdev, skb); hdev 141 drivers/bluetooth/hci_h5.c BT_DBG("%s", hu->hdev->name); hdev 194 drivers/bluetooth/hci_h5.c hci_reset_dev(hu->hdev); hdev 321 drivers/bluetooth/hci_h5.c BT_DBG("%s", hu->hdev->name); hdev 393 drivers/bluetooth/hci_h5.c hci_recv_frame(hu->hdev, h5->rx_skb); hdev 434 drivers/bluetooth/hci_h5.c hu->hdev->name, H5_HDR_SEQ(hdr), H5_HDR_ACK(hdr), hdev 481 drivers/bluetooth/hci_h5.c h5->rx_skb->dev = (void *)hu->hdev; hdev 544 drivers/bluetooth/hci_h5.c BT_DBG("%s pending %zu count %d", hu->hdev->name, h5->rx_pending, hdev 689 drivers/bluetooth/hci_h5.c hu->hdev->name, H5_HDR_SEQ(hdr), H5_HDR_ACK(hdr), hdev 864 drivers/bluetooth/hci_h5.c btrtl_dev = btrtl_initialize(h5->hu->hdev, h5->id); hdev 868 drivers/bluetooth/hci_h5.c err = btrtl_get_uart_settings(h5->hu->hdev, btrtl_dev, hdev 875 drivers/bluetooth/hci_h5.c skb = __hci_cmd_sync(h5->hu->hdev, 0xfc17, sizeof(baudrate_data), hdev 878 drivers/bluetooth/hci_h5.c rtl_dev_err(h5->hu->hdev, "set baud rate command failed\n"); hdev 890 drivers/bluetooth/hci_h5.c err = btrtl_download_firmware(h5->hu->hdev, btrtl_dev); hdev 117 drivers/bluetooth/hci_intel.c bt_dev_err(hu->hdev, "Device boot interrupted"); hdev 122 drivers/bluetooth/hci_intel.c bt_dev_err(hu->hdev, "Device boot timeout"); hdev 140 drivers/bluetooth/hci_intel.c bt_dev_err(hu->hdev, "LPM transaction interrupted"); hdev 145 drivers/bluetooth/hci_intel.c bt_dev_err(hu->hdev, "LPM transaction timeout"); hdev 165 drivers/bluetooth/hci_intel.c bt_dev_dbg(hu->hdev, "Suspending"); hdev 169 drivers/bluetooth/hci_intel.c bt_dev_err(hu->hdev, "Failed to alloc memory for LPM packet"); hdev 188 drivers/bluetooth/hci_intel.c bt_dev_err(hu->hdev, "Device suspend error"); hdev 192 drivers/bluetooth/hci_intel.c bt_dev_dbg(hu->hdev, "Suspended"); hdev 208 drivers/bluetooth/hci_intel.c bt_dev_dbg(hu->hdev, "Resuming"); hdev 214 drivers/bluetooth/hci_intel.c bt_dev_err(hu->hdev, "Failed to alloc memory for LPM packet"); hdev 232 drivers/bluetooth/hci_intel.c bt_dev_err(hu->hdev, "Device resume error"); hdev 236 drivers/bluetooth/hci_intel.c bt_dev_dbg(hu->hdev, "Resumed"); hdev 254 drivers/bluetooth/hci_intel.c bt_dev_err(hu->hdev, "Failed to alloc memory for LPM packet"); hdev 265 drivers/bluetooth/hci_intel.c bt_dev_dbg(hu->hdev, "Resumed by controller"); hdev 443 drivers/bluetooth/hci_intel.c static int inject_cmd_complete(struct hci_dev *hdev, __u16 opcode) hdev 465 drivers/bluetooth/hci_intel.c return hci_recv_frame(hdev, skb); hdev 471 drivers/bluetooth/hci_intel.c struct hci_dev *hdev = hu->hdev; hdev 487 drivers/bluetooth/hci_intel.c bt_dev_info(hdev, "Change controller speed to %d", speed); hdev 491 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Unsupported speed"); hdev 498 drivers/bluetooth/hci_intel.c skb = __hci_cmd_sync(hdev, 0xfc05, 0, NULL, HCI_CMD_TIMEOUT); hdev 500 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Reading Intel version information failed (%ld)", hdev 508 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Failed to alloc memory for baudrate packet"); hdev 532 drivers/bluetooth/hci_intel.c struct hci_dev *hdev = hu->hdev; hdev 546 drivers/bluetooth/hci_intel.c bt_dev_dbg(hdev, "start intel_setup"); hdev 548 drivers/bluetooth/hci_intel.c hu->hdev->set_diag = btintel_set_diag; hdev 549 drivers/bluetooth/hci_intel.c hu->hdev->set_bdaddr = btintel_set_bdaddr; hdev 587 drivers/bluetooth/hci_intel.c err = btintel_read_version(hdev, &ver); hdev 595 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Unsupported Intel hardware platform (%u)", hdev 612 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Unsupported Intel hardware variant (%u)", hdev 617 drivers/bluetooth/hci_intel.c btintel_version_info(hdev, &ver); hdev 634 drivers/bluetooth/hci_intel.c btintel_check_bdaddr(hdev); hdev 642 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Unsupported Intel firmware variant (%u)", hdev 650 drivers/bluetooth/hci_intel.c err = btintel_read_boot_params(hdev, ¶ms); hdev 659 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Unsupported Intel firmware loading method (%u)", hdev 668 drivers/bluetooth/hci_intel.c bt_dev_info(hdev, "No device address configured"); hdev 669 drivers/bluetooth/hci_intel.c set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); hdev 706 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Unsupported Intel hardware variant (%u)", hdev 711 drivers/bluetooth/hci_intel.c err = request_firmware(&fw, fwname, &hdev->dev); hdev 713 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Failed to load Intel firmware file (%d)", hdev 718 drivers/bluetooth/hci_intel.c bt_dev_info(hdev, "Found device firmware: %s", fwname); hdev 735 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Unsupported Intel hardware variant (%u)", hdev 741 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Invalid size of firmware file (%zu)", hdev 750 drivers/bluetooth/hci_intel.c err = btintel_download_firmware(hdev, fw, &boot_param); hdev 756 drivers/bluetooth/hci_intel.c bt_dev_info(hdev, "Waiting for firmware download to complete"); hdev 773 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Firmware loading interrupted"); hdev 779 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Firmware loading timeout"); hdev 785 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Firmware loading failed"); hdev 794 drivers/bluetooth/hci_intel.c bt_dev_info(hdev, "Firmware loaded in %llu usecs", duration); hdev 813 drivers/bluetooth/hci_intel.c err = btintel_send_intel_reset(hdev, boot_param); hdev 824 drivers/bluetooth/hci_intel.c bt_dev_info(hdev, "Waiting for device to boot"); hdev 836 drivers/bluetooth/hci_intel.c bt_dev_info(hdev, "Device booted in %llu usecs", duration); hdev 858 drivers/bluetooth/hci_intel.c btintel_load_ddc_config(hdev, fwname); hdev 860 drivers/bluetooth/hci_intel.c skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_CMD_TIMEOUT); hdev 871 drivers/bluetooth/hci_intel.c bt_dev_info(hdev, "Setup complete"); hdev 878 drivers/bluetooth/hci_intel.c static int intel_recv_event(struct hci_dev *hdev, struct sk_buff *skb) hdev 880 drivers/bluetooth/hci_intel.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 913 drivers/bluetooth/hci_intel.c return hci_recv_frame(hdev, skb); hdev 916 drivers/bluetooth/hci_intel.c static void intel_recv_lpm_notify(struct hci_dev *hdev, int value) hdev 918 drivers/bluetooth/hci_intel.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 921 drivers/bluetooth/hci_intel.c bt_dev_dbg(hdev, "TX idle notification (%d)", value); hdev 931 drivers/bluetooth/hci_intel.c static int intel_recv_lpm(struct hci_dev *hdev, struct sk_buff *skb) hdev 934 drivers/bluetooth/hci_intel.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 940 drivers/bluetooth/hci_intel.c bt_dev_err(hu->hdev, "Invalid LPM notification packet"); hdev 943 drivers/bluetooth/hci_intel.c intel_recv_lpm_notify(hdev, lpm->data[0]); hdev 956 drivers/bluetooth/hci_intel.c bt_dev_err(hdev, "Unknown LPM opcode (%02x)", lpm->opcode); hdev 986 drivers/bluetooth/hci_intel.c intel->rx_skb = h4_recv_buf(hu->hdev, intel->rx_skb, data, count, hdev 991 drivers/bluetooth/hci_intel.c bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err); hdev 1051 drivers/bluetooth/hci_intel.c inject_cmd_complete(hu->hdev, opcode); hdev 80 drivers/bluetooth/hci_ldisc.c struct hci_dev *hdev = hu->hdev; hdev 85 drivers/bluetooth/hci_ldisc.c hdev->stat.cmd_tx++; hdev 89 drivers/bluetooth/hci_ldisc.c hdev->stat.acl_tx++; hdev 93 drivers/bluetooth/hci_ldisc.c hdev->stat.sco_tx++; hdev 150 drivers/bluetooth/hci_ldisc.c struct hci_dev *hdev = hu->hdev; hdev 165 drivers/bluetooth/hci_ldisc.c hdev->stat.byte_tx += len; hdev 188 drivers/bluetooth/hci_ldisc.c struct hci_dev *hdev; hdev 193 drivers/bluetooth/hci_ldisc.c err = hci_register_dev(hu->hdev); hdev 198 drivers/bluetooth/hci_ldisc.c hdev = hu->hdev; hdev 199 drivers/bluetooth/hci_ldisc.c hu->hdev = NULL; hdev 200 drivers/bluetooth/hci_ldisc.c hci_free_dev(hdev); hdev 226 drivers/bluetooth/hci_ldisc.c static int hci_uart_flush(struct hci_dev *hdev) hdev 228 drivers/bluetooth/hci_ldisc.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 231 drivers/bluetooth/hci_ldisc.c BT_DBG("hdev %p tty %p", hdev, tty); hdev 252 drivers/bluetooth/hci_ldisc.c static int hci_uart_open(struct hci_dev *hdev) hdev 254 drivers/bluetooth/hci_ldisc.c BT_DBG("%s %p", hdev->name, hdev); hdev 257 drivers/bluetooth/hci_ldisc.c hdev->flush = hci_uart_flush; hdev 263 drivers/bluetooth/hci_ldisc.c static int hci_uart_close(struct hci_dev *hdev) hdev 265 drivers/bluetooth/hci_ldisc.c BT_DBG("hdev %p", hdev); hdev 267 drivers/bluetooth/hci_ldisc.c hci_uart_flush(hdev); hdev 268 drivers/bluetooth/hci_ldisc.c hdev->flush = NULL; hdev 273 drivers/bluetooth/hci_ldisc.c static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 275 drivers/bluetooth/hci_ldisc.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 277 drivers/bluetooth/hci_ldisc.c BT_DBG("%s: type %d len %d", hdev->name, hci_skb_pkt_type(skb), hdev 386 drivers/bluetooth/hci_ldisc.c BT_DBG("%s: New tty speeds: %d/%d", hu->hdev->name, hdev 390 drivers/bluetooth/hci_ldisc.c static int hci_uart_setup(struct hci_dev *hdev) hdev 392 drivers/bluetooth/hci_ldisc.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 429 drivers/bluetooth/hci_ldisc.c skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL, hdev 433 drivers/bluetooth/hci_ldisc.c hdev->name, PTR_ERR(skb)); hdev 439 drivers/bluetooth/hci_ldisc.c hdev->name); hdev 448 drivers/bluetooth/hci_ldisc.c hdev->set_bdaddr = btintel_set_bdaddr; hdev 449 drivers/bluetooth/hci_ldisc.c btintel_check_bdaddr(hdev); hdev 454 drivers/bluetooth/hci_ldisc.c hdev->set_bdaddr = btbcm_set_bdaddr; hdev 455 drivers/bluetooth/hci_ldisc.c btbcm_check_bdaddr(hdev); hdev 522 drivers/bluetooth/hci_ldisc.c struct hci_dev *hdev; hdev 532 drivers/bluetooth/hci_ldisc.c hdev = hu->hdev; hdev 533 drivers/bluetooth/hci_ldisc.c if (hdev) hdev 534 drivers/bluetooth/hci_ldisc.c hci_uart_close(hdev); hdev 543 drivers/bluetooth/hci_ldisc.c if (hdev) { hdev 545 drivers/bluetooth/hci_ldisc.c hci_unregister_dev(hdev); hdev 546 drivers/bluetooth/hci_ldisc.c hci_free_dev(hdev); hdev 616 drivers/bluetooth/hci_ldisc.c if (hu->hdev) hdev 617 drivers/bluetooth/hci_ldisc.c hu->hdev->stat.byte_rx += count; hdev 624 drivers/bluetooth/hci_ldisc.c struct hci_dev *hdev; hdev 630 drivers/bluetooth/hci_ldisc.c hdev = hci_alloc_dev(); hdev 631 drivers/bluetooth/hci_ldisc.c if (!hdev) { hdev 636 drivers/bluetooth/hci_ldisc.c hu->hdev = hdev; hdev 638 drivers/bluetooth/hci_ldisc.c hdev->bus = HCI_UART; hdev 639 drivers/bluetooth/hci_ldisc.c hci_set_drvdata(hdev, hu); hdev 646 drivers/bluetooth/hci_ldisc.c hdev->manufacturer = hu->proto->manufacturer; hdev 648 drivers/bluetooth/hci_ldisc.c hdev->open = hci_uart_open; hdev 649 drivers/bluetooth/hci_ldisc.c hdev->close = hci_uart_close; hdev 650 drivers/bluetooth/hci_ldisc.c hdev->flush = hci_uart_flush; hdev 651 drivers/bluetooth/hci_ldisc.c hdev->send = hci_uart_send_frame; hdev 652 drivers/bluetooth/hci_ldisc.c hdev->setup = hci_uart_setup; hdev 653 drivers/bluetooth/hci_ldisc.c SET_HCIDEV_DEV(hdev, hu->tty->dev); hdev 656 drivers/bluetooth/hci_ldisc.c set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); hdev 659 drivers/bluetooth/hci_ldisc.c set_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks); hdev 662 drivers/bluetooth/hci_ldisc.c set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); hdev 665 drivers/bluetooth/hci_ldisc.c hdev->dev_type = HCI_AMP; hdev 667 drivers/bluetooth/hci_ldisc.c hdev->dev_type = HCI_PRIMARY; hdev 674 drivers/bluetooth/hci_ldisc.c hu->hdev = NULL; hdev 675 drivers/bluetooth/hci_ldisc.c hci_free_dev(hdev); hdev 682 drivers/bluetooth/hci_ldisc.c if (hci_register_dev(hdev) < 0) { hdev 685 drivers/bluetooth/hci_ldisc.c hu->hdev = NULL; hdev 686 drivers/bluetooth/hci_ldisc.c hci_free_dev(hdev); hdev 776 drivers/bluetooth/hci_ldisc.c err = hu->hdev->id; hdev 357 drivers/bluetooth/hci_ll.c static int ll_recv_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 359 drivers/bluetooth/hci_ll.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 369 drivers/bluetooth/hci_ll.c bt_dev_err(hdev, "received HCILL_GO_TO_SLEEP_ACK in state %ld", hdev 432 drivers/bluetooth/hci_ll.c ll->rx_skb = h4_recv_buf(hu->hdev, ll->rx_skb, data, count, hdev 436 drivers/bluetooth/hci_ll.c bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err); hdev 452 drivers/bluetooth/hci_ll.c static int read_local_version(struct hci_dev *hdev) hdev 459 drivers/bluetooth/hci_ll.c skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL, hdev 462 drivers/bluetooth/hci_ll.c bt_dev_err(hdev, "Reading TI version information failed (%ld)", hdev 481 drivers/bluetooth/hci_ll.c bt_dev_err(hdev, "Failed to read TI version info: %d", err); hdev 495 drivers/bluetooth/hci_ll.c bt_dev_warn(lldev->hu.hdev, hdev 500 drivers/bluetooth/hci_ll.c bt_dev_dbg(lldev->hu.hdev, "command type %d", cmd->prefix); hdev 502 drivers/bluetooth/hci_ll.c skb = __hci_cmd_sync(lldev->hu.hdev, cmd->opcode, cmd->plen, hdev 505 drivers/bluetooth/hci_ll.c bt_dev_err(lldev->hu.hdev, "send command failed"); hdev 526 drivers/bluetooth/hci_ll.c version = read_local_version(lldev->hu.hdev); hdev 542 drivers/bluetooth/hci_ll.c bt_dev_err(lldev->hu.hdev, "request_firmware failed(errno %d) for %s", hdev 555 drivers/bluetooth/hci_ll.c bt_dev_dbg(lldev->hu.hdev, " action size %d, type %d ", hdev 563 drivers/bluetooth/hci_ll.c bt_dev_dbg(lldev->hu.hdev, "S"); hdev 571 drivers/bluetooth/hci_ll.c bt_dev_dbg(lldev->hu.hdev, "W"); hdev 574 drivers/bluetooth/hci_ll.c bt_dev_info(lldev->hu.hdev, "sleep command in scr"); hdev 590 drivers/bluetooth/hci_ll.c static int ll_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) hdev 600 drivers/bluetooth/hci_ll.c skb = __hci_cmd_sync(hdev, HCI_VS_WRITE_BD_ADDR, sizeof(bdaddr_t), hdev 620 drivers/bluetooth/hci_ll.c hu->hdev->set_bdaddr = ll_set_bdaddr; hdev 631 drivers/bluetooth/hci_ll.c bt_dev_err(hu->hdev, "Failed to get CTS"); hdev 640 drivers/bluetooth/hci_ll.c bt_dev_err(hu->hdev, "download firmware failed, retrying..."); hdev 651 drivers/bluetooth/hci_ll.c set_bit(HCI_QUIRK_INVALID_BDADDR, &hu->hdev->quirks); hdev 653 drivers/bluetooth/hci_ll.c err = ll_set_bdaddr(hu->hdev, &lldev->bdaddr); hdev 655 drivers/bluetooth/hci_ll.c set_bit(HCI_QUIRK_INVALID_BDADDR, &hu->hdev->quirks); hdev 670 drivers/bluetooth/hci_ll.c skb = __hci_cmd_sync(hu->hdev, HCI_VS_UPDATE_UART_HCI_BAUDRATE, hdev 152 drivers/bluetooth/hci_mrvl.c bt_dev_err(hu->hdev, "Unable to alloc ack/nak packet"); hdev 161 drivers/bluetooth/hci_mrvl.c static int mrvl_recv_fw_req(struct hci_dev *hdev, struct sk_buff *skb) hdev 164 drivers/bluetooth/hci_mrvl.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 169 drivers/bluetooth/hci_mrvl.c bt_dev_err(hdev, "Corrupted mrvl header"); hdev 177 drivers/bluetooth/hci_mrvl.c bt_dev_err(hdev, "Received unexpected firmware request"); hdev 193 drivers/bluetooth/hci_mrvl.c static int mrvl_recv_chip_ver(struct hci_dev *hdev, struct sk_buff *skb) hdev 196 drivers/bluetooth/hci_mrvl.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 202 drivers/bluetooth/hci_mrvl.c bt_dev_err(hdev, "Corrupted mrvl header"); hdev 210 drivers/bluetooth/hci_mrvl.c bt_dev_err(hdev, "Received unexpected chip version"); hdev 217 drivers/bluetooth/hci_mrvl.c bt_dev_info(hdev, "Controller id = %x, rev = %x", mrvl->id, mrvl->rev); hdev 257 drivers/bluetooth/hci_mrvl.c mrvl->rx_skb = h4_recv_buf(hu->hdev, mrvl->rx_skb, data, count, hdev 262 drivers/bluetooth/hci_mrvl.c bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err); hdev 270 drivers/bluetooth/hci_mrvl.c static int mrvl_load_firmware(struct hci_dev *hdev, const char *name) hdev 272 drivers/bluetooth/hci_mrvl.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 278 drivers/bluetooth/hci_mrvl.c err = request_firmware(&fw, name, &hdev->dev); hdev 280 drivers/bluetooth/hci_mrvl.c bt_dev_err(hdev, "Failed to load firmware file %s", name); hdev 287 drivers/bluetooth/hci_mrvl.c bt_dev_info(hdev, "Loading %s", name); hdev 301 drivers/bluetooth/hci_mrvl.c bt_dev_err(hdev, "Firmware load interrupted"); hdev 305 drivers/bluetooth/hci_mrvl.c bt_dev_err(hdev, "Firmware request timeout"); hdev 310 drivers/bluetooth/hci_mrvl.c bt_dev_dbg(hdev, "Firmware request, expecting %d bytes", hdev 319 drivers/bluetooth/hci_mrvl.c bt_dev_info(hdev, "Firmware loading complete"); hdev 321 drivers/bluetooth/hci_mrvl.c bt_dev_err(hdev, "Firmware loading failure"); hdev 329 drivers/bluetooth/hci_mrvl.c bt_dev_dbg(hdev, "Adjusting tx_len to %d", hdev 335 drivers/bluetooth/hci_mrvl.c bt_dev_err(hdev, "Failed to alloc mem for FW packet"); hdev 360 drivers/bluetooth/hci_mrvl.c err = mrvl_load_firmware(hu->hdev, "mrvl/helper_uart_3000000.bin"); hdev 362 drivers/bluetooth/hci_mrvl.c bt_dev_err(hu->hdev, "Unable to download firmware helper"); hdev 376 drivers/bluetooth/hci_mrvl.c err = mrvl_load_firmware(hu->hdev, "mrvl/uart8897_bt.bin"); hdev 348 drivers/bluetooth/hci_nokia.c hu->hdev->name, err); hdev 367 drivers/bluetooth/hci_nokia.c skb = __hci_cmd_sync(hu->hdev, opcode, cmd->plen, hdev 373 drivers/bluetooth/hci_nokia.c hu->hdev->name, opcode, err); hdev 446 drivers/bluetooth/hci_nokia.c hu->hdev->set_bdaddr = btbcm_set_bdaddr; hdev 447 drivers/bluetooth/hci_nokia.c set_bit(HCI_QUIRK_INVALID_BDADDR, &hu->hdev->quirks); hdev 531 drivers/bluetooth/hci_nokia.c static int nokia_recv_negotiation_packet(struct hci_dev *hdev, hdev 534 drivers/bluetooth/hci_nokia.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 569 drivers/bluetooth/hci_nokia.c static int nokia_recv_alive_packet(struct hci_dev *hdev, struct sk_buff *skb) hdev 571 drivers/bluetooth/hci_nokia.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 604 drivers/bluetooth/hci_nokia.c static int nokia_recv_radio(struct hci_dev *hdev, struct sk_buff *skb) hdev 610 drivers/bluetooth/hci_nokia.c return hci_recv_frame(hdev, skb); hdev 632 drivers/bluetooth/hci_nokia.c btdev->rx_skb = h4_recv_buf(hu->hdev, btdev->rx_skb, data, count, hdev 167 drivers/bluetooth/hci_qca.c static int qca_power_off(struct hci_dev *hdev); hdev 544 drivers/bluetooth/hci_qca.c static void qca_debugfs_init(struct hci_dev *hdev) hdev 546 drivers/bluetooth/hci_qca.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 551 drivers/bluetooth/hci_qca.c if (!hdev->debugfs) hdev 554 drivers/bluetooth/hci_qca.c ibs_dir = debugfs_create_dir("ibs", hdev->debugfs); hdev 828 drivers/bluetooth/hci_qca.c static int qca_ibs_sleep_ind(struct hci_dev *hdev, struct sk_buff *skb) hdev 830 drivers/bluetooth/hci_qca.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 840 drivers/bluetooth/hci_qca.c static int qca_ibs_wake_ind(struct hci_dev *hdev, struct sk_buff *skb) hdev 842 drivers/bluetooth/hci_qca.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 852 drivers/bluetooth/hci_qca.c static int qca_ibs_wake_ack(struct hci_dev *hdev, struct sk_buff *skb) hdev 854 drivers/bluetooth/hci_qca.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 864 drivers/bluetooth/hci_qca.c static int qca_recv_acl_data(struct hci_dev *hdev, struct sk_buff *skb) hdev 872 drivers/bluetooth/hci_qca.c return hci_recv_diag(hdev, skb); hdev 874 drivers/bluetooth/hci_qca.c return hci_recv_frame(hdev, skb); hdev 877 drivers/bluetooth/hci_qca.c static int qca_recv_event(struct hci_dev *hdev, struct sk_buff *skb) hdev 879 drivers/bluetooth/hci_qca.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 903 drivers/bluetooth/hci_qca.c return hci_recv_frame(hdev, skb); hdev 943 drivers/bluetooth/hci_qca.c qca->rx_skb = h4_recv_buf(hu->hdev, qca->rx_skb, data, count, hdev 947 drivers/bluetooth/hci_qca.c bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err); hdev 998 drivers/bluetooth/hci_qca.c static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate) hdev 1000 drivers/bluetooth/hci_qca.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 1012 drivers/bluetooth/hci_qca.c bt_dev_err(hdev, "Failed to allocate baudrate packet"); hdev 1065 drivers/bluetooth/hci_qca.c bt_dev_dbg(hu->hdev, "sending power pulse %02x to controller", cmd); hdev 1071 drivers/bluetooth/hci_qca.c bt_dev_err(hu->hdev, "failed to send power pulse %02x", cmd); hdev 1151 drivers/bluetooth/hci_qca.c bt_dev_dbg(hu->hdev, "Set UART speed to %d", speed); hdev 1152 drivers/bluetooth/hci_qca.c ret = qca_set_baudrate(hu->hdev, qca_baudrate); hdev 1168 drivers/bluetooth/hci_qca.c bt_dev_err(hu->hdev, hdev 1197 drivers/bluetooth/hci_qca.c bt_dev_err(hu->hdev, "failed to open port"); hdev 1221 drivers/bluetooth/hci_qca.c bt_dev_err(hu->hdev, "failed to open port"); hdev 1232 drivers/bluetooth/hci_qca.c struct hci_dev *hdev = hu->hdev; hdev 1250 drivers/bluetooth/hci_qca.c set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); hdev 1253 drivers/bluetooth/hci_qca.c bt_dev_info(hdev, "setting up wcn3990"); hdev 1258 drivers/bluetooth/hci_qca.c set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks); hdev 1259 drivers/bluetooth/hci_qca.c set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); hdev 1260 drivers/bluetooth/hci_qca.c hu->hdev->shutdown = qca_power_off; hdev 1265 drivers/bluetooth/hci_qca.c ret = qca_read_soc_version(hdev, &soc_ver); hdev 1269 drivers/bluetooth/hci_qca.c bt_dev_info(hdev, "ROME setup"); hdev 1285 drivers/bluetooth/hci_qca.c ret = qca_read_soc_version(hdev, &soc_ver); hdev 1290 drivers/bluetooth/hci_qca.c bt_dev_info(hdev, "QCA controller version 0x%08x", soc_ver); hdev 1292 drivers/bluetooth/hci_qca.c ret = qca_uart_setup(hdev, qca_baudrate, soc_type, soc_ver, hdev 1296 drivers/bluetooth/hci_qca.c qca_debugfs_init(hdev); hdev 1310 drivers/bluetooth/hci_qca.c hu->hdev->set_bdaddr = qca_set_bdaddr; hdev 1312 drivers/bluetooth/hci_qca.c hu->hdev->set_bdaddr = qca_set_bdaddr_rome; hdev 1373 drivers/bluetooth/hci_qca.c static int qca_power_off(struct hci_dev *hdev) hdev 1375 drivers/bluetooth/hci_qca.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 1378 drivers/bluetooth/hci_qca.c qca_send_pre_shutdown_cmd(hdev); hdev 28 drivers/bluetooth/hci_serdev.c struct hci_dev *hdev = hu->hdev; hdev 33 drivers/bluetooth/hci_serdev.c hdev->stat.cmd_tx++; hdev 37 drivers/bluetooth/hci_serdev.c hdev->stat.acl_tx++; hdev 41 drivers/bluetooth/hci_serdev.c hdev->stat.sco_tx++; hdev 63 drivers/bluetooth/hci_serdev.c struct hci_dev *hdev = hu->hdev; hdev 77 drivers/bluetooth/hci_serdev.c hdev->stat.byte_tx += len; hdev 96 drivers/bluetooth/hci_serdev.c static int hci_uart_flush(struct hci_dev *hdev) hdev 98 drivers/bluetooth/hci_serdev.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 100 drivers/bluetooth/hci_serdev.c BT_DBG("hdev %p serdev %p", hdev, hu->serdev); hdev 116 drivers/bluetooth/hci_serdev.c static int hci_uart_open(struct hci_dev *hdev) hdev 118 drivers/bluetooth/hci_serdev.c BT_DBG("%s %p", hdev->name, hdev); hdev 121 drivers/bluetooth/hci_serdev.c hdev->flush = hci_uart_flush; hdev 127 drivers/bluetooth/hci_serdev.c static int hci_uart_close(struct hci_dev *hdev) hdev 129 drivers/bluetooth/hci_serdev.c BT_DBG("hdev %p", hdev); hdev 131 drivers/bluetooth/hci_serdev.c hci_uart_flush(hdev); hdev 132 drivers/bluetooth/hci_serdev.c hdev->flush = NULL; hdev 138 drivers/bluetooth/hci_serdev.c static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 140 drivers/bluetooth/hci_serdev.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 142 drivers/bluetooth/hci_serdev.c BT_DBG("%s: type %d len %d", hdev->name, hci_skb_pkt_type(skb), hdev 152 drivers/bluetooth/hci_serdev.c static int hci_uart_setup(struct hci_dev *hdev) hdev 154 drivers/bluetooth/hci_serdev.c struct hci_uart *hu = hci_get_drvdata(hdev); hdev 182 drivers/bluetooth/hci_serdev.c bt_dev_err(hdev, "Failed to set baudrate"); hdev 193 drivers/bluetooth/hci_serdev.c skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL, hdev 196 drivers/bluetooth/hci_serdev.c bt_dev_err(hdev, "Reading local version info failed (%ld)", hdev 202 drivers/bluetooth/hci_serdev.c bt_dev_err(hdev, "Event length mismatch for version info"); hdev 257 drivers/bluetooth/hci_serdev.c if (hu->hdev) hdev 258 drivers/bluetooth/hci_serdev.c hu->hdev->stat.byte_rx += count; hdev 272 drivers/bluetooth/hci_serdev.c struct hci_dev *hdev; hdev 290 drivers/bluetooth/hci_serdev.c hdev = hci_alloc_dev(); hdev 291 drivers/bluetooth/hci_serdev.c if (!hdev) { hdev 297 drivers/bluetooth/hci_serdev.c hu->hdev = hdev; hdev 299 drivers/bluetooth/hci_serdev.c hdev->bus = HCI_UART; hdev 300 drivers/bluetooth/hci_serdev.c hci_set_drvdata(hdev, hu); hdev 311 drivers/bluetooth/hci_serdev.c hdev->manufacturer = hu->proto->manufacturer; hdev 313 drivers/bluetooth/hci_serdev.c hdev->open = hci_uart_open; hdev 314 drivers/bluetooth/hci_serdev.c hdev->close = hci_uart_close; hdev 315 drivers/bluetooth/hci_serdev.c hdev->flush = hci_uart_flush; hdev 316 drivers/bluetooth/hci_serdev.c hdev->send = hci_uart_send_frame; hdev 317 drivers/bluetooth/hci_serdev.c hdev->setup = hci_uart_setup; hdev 318 drivers/bluetooth/hci_serdev.c SET_HCIDEV_DEV(hdev, &hu->serdev->dev); hdev 321 drivers/bluetooth/hci_serdev.c set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); hdev 324 drivers/bluetooth/hci_serdev.c set_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks); hdev 327 drivers/bluetooth/hci_serdev.c hdev->dev_type = HCI_AMP; hdev 329 drivers/bluetooth/hci_serdev.c hdev->dev_type = HCI_PRIMARY; hdev 334 drivers/bluetooth/hci_serdev.c if (hci_register_dev(hdev) < 0) { hdev 345 drivers/bluetooth/hci_serdev.c hci_free_dev(hdev); hdev 357 drivers/bluetooth/hci_serdev.c struct hci_dev *hdev = hu->hdev; hdev 360 drivers/bluetooth/hci_serdev.c hci_unregister_dev(hdev); hdev 361 drivers/bluetooth/hci_serdev.c hci_free_dev(hdev); hdev 67 drivers/bluetooth/hci_uart.h struct hci_dev *hdev; hdev 122 drivers/bluetooth/hci_uart.h int (*recv)(struct hci_dev *hdev, struct sk_buff *skb); hdev 146 drivers/bluetooth/hci_uart.h struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb, hdev 33 drivers/bluetooth/hci_vhci.c struct hci_dev *hdev; hdev 42 drivers/bluetooth/hci_vhci.c static int vhci_open_dev(struct hci_dev *hdev) hdev 47 drivers/bluetooth/hci_vhci.c static int vhci_close_dev(struct hci_dev *hdev) hdev 49 drivers/bluetooth/hci_vhci.c struct vhci_data *data = hci_get_drvdata(hdev); hdev 56 drivers/bluetooth/hci_vhci.c static int vhci_flush(struct hci_dev *hdev) hdev 58 drivers/bluetooth/hci_vhci.c struct vhci_data *data = hci_get_drvdata(hdev); hdev 65 drivers/bluetooth/hci_vhci.c static int vhci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 67 drivers/bluetooth/hci_vhci.c struct vhci_data *data = hci_get_drvdata(hdev); hdev 78 drivers/bluetooth/hci_vhci.c struct hci_dev *hdev; hdev 82 drivers/bluetooth/hci_vhci.c if (data->hdev) hdev 99 drivers/bluetooth/hci_vhci.c hdev = hci_alloc_dev(); hdev 100 drivers/bluetooth/hci_vhci.c if (!hdev) { hdev 105 drivers/bluetooth/hci_vhci.c data->hdev = hdev; hdev 107 drivers/bluetooth/hci_vhci.c hdev->bus = HCI_VIRTUAL; hdev 108 drivers/bluetooth/hci_vhci.c hdev->dev_type = dev_type; hdev 109 drivers/bluetooth/hci_vhci.c hci_set_drvdata(hdev, data); hdev 111 drivers/bluetooth/hci_vhci.c hdev->open = vhci_open_dev; hdev 112 drivers/bluetooth/hci_vhci.c hdev->close = vhci_close_dev; hdev 113 drivers/bluetooth/hci_vhci.c hdev->flush = vhci_flush; hdev 114 drivers/bluetooth/hci_vhci.c hdev->send = vhci_send_frame; hdev 118 drivers/bluetooth/hci_vhci.c set_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks); hdev 122 drivers/bluetooth/hci_vhci.c set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); hdev 124 drivers/bluetooth/hci_vhci.c if (hci_register_dev(hdev) < 0) { hdev 126 drivers/bluetooth/hci_vhci.c hci_free_dev(hdev); hdev 127 drivers/bluetooth/hci_vhci.c data->hdev = NULL; hdev 136 drivers/bluetooth/hci_vhci.c put_unaligned_le16(hdev->id, skb_put(skb, 2)); hdev 181 drivers/bluetooth/hci_vhci.c if (!data->hdev) { hdev 188 drivers/bluetooth/hci_vhci.c ret = hci_recv_frame(data->hdev, skb); hdev 227 drivers/bluetooth/hci_vhci.c if (!data->hdev) hdev 230 drivers/bluetooth/hci_vhci.c data->hdev->stat.byte_tx += len; hdev 234 drivers/bluetooth/hci_vhci.c data->hdev->stat.cmd_tx++; hdev 237 drivers/bluetooth/hci_vhci.c data->hdev->stat.acl_tx++; hdev 240 drivers/bluetooth/hci_vhci.c data->hdev->stat.sco_tx++; hdev 332 drivers/bluetooth/hci_vhci.c struct hci_dev *hdev; hdev 336 drivers/bluetooth/hci_vhci.c hdev = data->hdev; hdev 338 drivers/bluetooth/hci_vhci.c if (hdev) { hdev 339 drivers/bluetooth/hci_vhci.c hci_unregister_dev(hdev); hdev 340 drivers/bluetooth/hci_vhci.c hci_free_dev(hdev); hdev 83 drivers/crypto/img-hash.c struct img_hash_dev *hdev; hdev 110 drivers/crypto/img-hash.c struct img_hash_dev *hdev; hdev 147 drivers/crypto/img-hash.c static inline u32 img_hash_read(struct img_hash_dev *hdev, u32 offset) hdev 149 drivers/crypto/img-hash.c return readl_relaxed(hdev->io_base + offset); hdev 152 drivers/crypto/img-hash.c static inline void img_hash_write(struct img_hash_dev *hdev, hdev 155 drivers/crypto/img-hash.c writel_relaxed(value, hdev->io_base + offset); hdev 158 drivers/crypto/img-hash.c static inline u32 img_hash_read_result_queue(struct img_hash_dev *hdev) hdev 160 drivers/crypto/img-hash.c return be32_to_cpu(img_hash_read(hdev, CR_RESULT_QUEUE)); hdev 163 drivers/crypto/img-hash.c static void img_hash_start(struct img_hash_dev *hdev, bool dma) hdev 165 drivers/crypto/img-hash.c struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); hdev 176 drivers/crypto/img-hash.c dev_dbg(hdev->dev, "Starting hash process\n"); hdev 177 drivers/crypto/img-hash.c img_hash_write(hdev, CR_CONTROL, cr); hdev 186 drivers/crypto/img-hash.c img_hash_read(hdev, CR_CONTROL); hdev 189 drivers/crypto/img-hash.c static int img_hash_xmit_cpu(struct img_hash_dev *hdev, const u8 *buf, hdev 195 drivers/crypto/img-hash.c dev_dbg(hdev->dev, "xmit_cpu: length: %zu bytes\n", length); hdev 198 drivers/crypto/img-hash.c hdev->flags |= DRIVER_FLAGS_FINAL; hdev 203 drivers/crypto/img-hash.c writel_relaxed(buffer[count], hdev->cpu_addr); hdev 210 drivers/crypto/img-hash.c struct img_hash_dev *hdev = (struct img_hash_dev *)data; hdev 211 drivers/crypto/img-hash.c struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); hdev 214 drivers/crypto/img-hash.c img_hash_xmit_cpu(hdev, ctx->buffer, ctx->bufcnt, 0); hdev 218 drivers/crypto/img-hash.c tasklet_schedule(&hdev->dma_task); hdev 221 drivers/crypto/img-hash.c static int img_hash_xmit_dma(struct img_hash_dev *hdev, struct scatterlist *sg) hdev 224 drivers/crypto/img-hash.c struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); hdev 226 drivers/crypto/img-hash.c ctx->dma_ct = dma_map_sg(hdev->dev, sg, 1, DMA_TO_DEVICE); hdev 228 drivers/crypto/img-hash.c dev_err(hdev->dev, "Invalid DMA sg\n"); hdev 229 drivers/crypto/img-hash.c hdev->err = -EINVAL; hdev 233 drivers/crypto/img-hash.c desc = dmaengine_prep_slave_sg(hdev->dma_lch, hdev 239 drivers/crypto/img-hash.c dev_err(hdev->dev, "Null DMA descriptor\n"); hdev 240 drivers/crypto/img-hash.c hdev->err = -EINVAL; hdev 241 drivers/crypto/img-hash.c dma_unmap_sg(hdev->dev, sg, 1, DMA_TO_DEVICE); hdev 245 drivers/crypto/img-hash.c desc->callback_param = hdev; hdev 247 drivers/crypto/img-hash.c dma_async_issue_pending(hdev->dma_lch); hdev 252 drivers/crypto/img-hash.c static int img_hash_write_via_cpu(struct img_hash_dev *hdev) hdev 254 drivers/crypto/img-hash.c struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); hdev 256 drivers/crypto/img-hash.c ctx->bufcnt = sg_copy_to_buffer(hdev->req->src, sg_nents(ctx->sg), hdev 257 drivers/crypto/img-hash.c ctx->buffer, hdev->req->nbytes); hdev 259 drivers/crypto/img-hash.c ctx->total = hdev->req->nbytes; hdev 262 drivers/crypto/img-hash.c hdev->flags |= (DRIVER_FLAGS_CPU | DRIVER_FLAGS_FINAL); hdev 264 drivers/crypto/img-hash.c img_hash_start(hdev, false); hdev 266 drivers/crypto/img-hash.c return img_hash_xmit_cpu(hdev, ctx->buffer, ctx->total, 1); hdev 288 drivers/crypto/img-hash.c hash[i] = img_hash_read_result_queue(ctx->hdev); hdev 294 drivers/crypto/img-hash.c struct img_hash_dev *hdev = ctx->hdev; hdev 298 drivers/crypto/img-hash.c if (DRIVER_FLAGS_FINAL & hdev->flags) hdev 301 drivers/crypto/img-hash.c dev_warn(hdev->dev, "Hash failed with error %d\n", err); hdev 305 drivers/crypto/img-hash.c hdev->flags &= ~(DRIVER_FLAGS_DMA_READY | DRIVER_FLAGS_OUTPUT_READY | hdev 312 drivers/crypto/img-hash.c static int img_hash_write_via_dma(struct img_hash_dev *hdev) hdev 314 drivers/crypto/img-hash.c struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); hdev 316 drivers/crypto/img-hash.c img_hash_start(hdev, true); hdev 318 drivers/crypto/img-hash.c dev_dbg(hdev->dev, "xmit dma size: %d\n", ctx->total); hdev 321 drivers/crypto/img-hash.c hdev->flags |= DRIVER_FLAGS_FINAL; hdev 323 drivers/crypto/img-hash.c hdev->flags |= DRIVER_FLAGS_DMA_ACTIVE | DRIVER_FLAGS_FINAL; hdev 325 drivers/crypto/img-hash.c tasklet_schedule(&hdev->dma_task); hdev 330 drivers/crypto/img-hash.c static int img_hash_dma_init(struct img_hash_dev *hdev) hdev 335 drivers/crypto/img-hash.c hdev->dma_lch = dma_request_slave_channel(hdev->dev, "tx"); hdev 336 drivers/crypto/img-hash.c if (!hdev->dma_lch) { hdev 337 drivers/crypto/img-hash.c dev_err(hdev->dev, "Couldn't acquire a slave DMA channel.\n"); hdev 341 drivers/crypto/img-hash.c dma_conf.dst_addr = hdev->bus_addr; hdev 346 drivers/crypto/img-hash.c err = dmaengine_slave_config(hdev->dma_lch, &dma_conf); hdev 348 drivers/crypto/img-hash.c dev_err(hdev->dev, "Couldn't configure DMA slave.\n"); hdev 349 drivers/crypto/img-hash.c dma_release_channel(hdev->dma_lch); hdev 358 drivers/crypto/img-hash.c struct img_hash_dev *hdev = (struct img_hash_dev *)d; hdev 359 drivers/crypto/img-hash.c struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); hdev 364 drivers/crypto/img-hash.c if (!hdev->req || !ctx->sg) hdev 385 drivers/crypto/img-hash.c if (img_hash_xmit_dma(hdev, &tsg)) { hdev 386 drivers/crypto/img-hash.c dev_err(hdev->dev, "DMA failed, falling back to CPU"); hdev 388 drivers/crypto/img-hash.c hdev->err = 0; hdev 389 drivers/crypto/img-hash.c img_hash_xmit_cpu(hdev, addr + ctx->offset, hdev 421 drivers/crypto/img-hash.c img_hash_dma_callback(hdev); hdev 428 drivers/crypto/img-hash.c static int img_hash_write_via_dma_stop(struct img_hash_dev *hdev) hdev 430 drivers/crypto/img-hash.c struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); hdev 433 drivers/crypto/img-hash.c dma_unmap_sg(hdev->dev, ctx->sg, ctx->dma_ct, DMA_TO_DEVICE); hdev 438 drivers/crypto/img-hash.c static int img_hash_process_data(struct img_hash_dev *hdev) hdev 440 drivers/crypto/img-hash.c struct ahash_request *req = hdev->req; hdev 447 drivers/crypto/img-hash.c dev_dbg(hdev->dev, "process data request(%d bytes) using DMA\n", hdev 449 drivers/crypto/img-hash.c err = img_hash_write_via_dma(hdev); hdev 451 drivers/crypto/img-hash.c dev_dbg(hdev->dev, "process data request(%d bytes) using CPU\n", hdev 453 drivers/crypto/img-hash.c err = img_hash_write_via_cpu(hdev); hdev 458 drivers/crypto/img-hash.c static int img_hash_hw_init(struct img_hash_dev *hdev) hdev 463 drivers/crypto/img-hash.c img_hash_write(hdev, CR_RESET, CR_RESET_SET); hdev 464 drivers/crypto/img-hash.c img_hash_write(hdev, CR_RESET, CR_RESET_UNSET); hdev 465 drivers/crypto/img-hash.c img_hash_write(hdev, CR_INTENAB, CR_INT_NEW_RESULTS_SET); hdev 467 drivers/crypto/img-hash.c nbits = (u64)hdev->req->nbytes << 3; hdev 470 drivers/crypto/img-hash.c img_hash_write(hdev, CR_MESSAGE_LENGTH_H, u); hdev 471 drivers/crypto/img-hash.c img_hash_write(hdev, CR_MESSAGE_LENGTH_L, l); hdev 473 drivers/crypto/img-hash.c if (!(DRIVER_FLAGS_INIT & hdev->flags)) { hdev 474 drivers/crypto/img-hash.c hdev->flags |= DRIVER_FLAGS_INIT; hdev 475 drivers/crypto/img-hash.c hdev->err = 0; hdev 477 drivers/crypto/img-hash.c dev_dbg(hdev->dev, "hw initialized, nbits: %llx\n", nbits); hdev 494 drivers/crypto/img-hash.c static int img_hash_handle_queue(struct img_hash_dev *hdev, hdev 502 drivers/crypto/img-hash.c spin_lock_irqsave(&hdev->lock, flags); hdev 505 drivers/crypto/img-hash.c res = ahash_enqueue_request(&hdev->queue, req); hdev 507 drivers/crypto/img-hash.c if (DRIVER_FLAGS_BUSY & hdev->flags) { hdev 508 drivers/crypto/img-hash.c spin_unlock_irqrestore(&hdev->lock, flags); hdev 512 drivers/crypto/img-hash.c backlog = crypto_get_backlog(&hdev->queue); hdev 513 drivers/crypto/img-hash.c async_req = crypto_dequeue_request(&hdev->queue); hdev 515 drivers/crypto/img-hash.c hdev->flags |= DRIVER_FLAGS_BUSY; hdev 517 drivers/crypto/img-hash.c spin_unlock_irqrestore(&hdev->lock, flags); hdev 526 drivers/crypto/img-hash.c hdev->req = req; hdev 530 drivers/crypto/img-hash.c dev_info(hdev->dev, "processing req, op: %lu, bytes: %d\n", hdev 533 drivers/crypto/img-hash.c err = img_hash_hw_init(hdev); hdev 536 drivers/crypto/img-hash.c err = img_hash_process_data(hdev); hdev 621 drivers/crypto/img-hash.c struct img_hash_dev *hdev = NULL; hdev 626 drivers/crypto/img-hash.c if (!tctx->hdev) { hdev 628 drivers/crypto/img-hash.c hdev = tmp; hdev 631 drivers/crypto/img-hash.c tctx->hdev = hdev; hdev 634 drivers/crypto/img-hash.c hdev = tctx->hdev; hdev 638 drivers/crypto/img-hash.c ctx->hdev = hdev; hdev 667 drivers/crypto/img-hash.c err = img_hash_handle_queue(tctx->hdev, req); hdev 724 drivers/crypto/img-hash.c struct img_hash_dev *hdev = dev_id; hdev 727 drivers/crypto/img-hash.c reg = img_hash_read(hdev, CR_INTSTAT); hdev 728 drivers/crypto/img-hash.c img_hash_write(hdev, CR_INTCLEAR, reg); hdev 731 drivers/crypto/img-hash.c dev_dbg(hdev->dev, "IRQ CR_INT_NEW_RESULTS_SET\n"); hdev 732 drivers/crypto/img-hash.c if (DRIVER_FLAGS_BUSY & hdev->flags) { hdev 733 drivers/crypto/img-hash.c hdev->flags |= DRIVER_FLAGS_OUTPUT_READY; hdev 734 drivers/crypto/img-hash.c if (!(DRIVER_FLAGS_CPU & hdev->flags)) hdev 735 drivers/crypto/img-hash.c hdev->flags |= DRIVER_FLAGS_DMA_READY; hdev 736 drivers/crypto/img-hash.c tasklet_schedule(&hdev->done_task); hdev 738 drivers/crypto/img-hash.c dev_warn(hdev->dev, hdev 742 drivers/crypto/img-hash.c dev_warn(hdev->dev, hdev 745 drivers/crypto/img-hash.c dev_warn(hdev->dev, hdev 748 drivers/crypto/img-hash.c dev_warn(hdev->dev, hdev 861 drivers/crypto/img-hash.c static int img_register_algs(struct img_hash_dev *hdev) hdev 879 drivers/crypto/img-hash.c static int img_unregister_algs(struct img_hash_dev *hdev) hdev 890 drivers/crypto/img-hash.c struct img_hash_dev *hdev = (struct img_hash_dev *)data; hdev 893 drivers/crypto/img-hash.c if (hdev->err == -EINVAL) { hdev 894 drivers/crypto/img-hash.c err = hdev->err; hdev 898 drivers/crypto/img-hash.c if (!(DRIVER_FLAGS_BUSY & hdev->flags)) { hdev 899 drivers/crypto/img-hash.c img_hash_handle_queue(hdev, NULL); hdev 903 drivers/crypto/img-hash.c if (DRIVER_FLAGS_CPU & hdev->flags) { hdev 904 drivers/crypto/img-hash.c if (DRIVER_FLAGS_OUTPUT_READY & hdev->flags) { hdev 905 drivers/crypto/img-hash.c hdev->flags &= ~DRIVER_FLAGS_OUTPUT_READY; hdev 908 drivers/crypto/img-hash.c } else if (DRIVER_FLAGS_DMA_READY & hdev->flags) { hdev 909 drivers/crypto/img-hash.c if (DRIVER_FLAGS_DMA_ACTIVE & hdev->flags) { hdev 910 drivers/crypto/img-hash.c hdev->flags &= ~DRIVER_FLAGS_DMA_ACTIVE; hdev 911 drivers/crypto/img-hash.c img_hash_write_via_dma_stop(hdev); hdev 912 drivers/crypto/img-hash.c if (hdev->err) { hdev 913 drivers/crypto/img-hash.c err = hdev->err; hdev 917 drivers/crypto/img-hash.c if (DRIVER_FLAGS_OUTPUT_READY & hdev->flags) { hdev 918 drivers/crypto/img-hash.c hdev->flags &= ~(DRIVER_FLAGS_DMA_READY | hdev 926 drivers/crypto/img-hash.c img_hash_finish_req(hdev->req, err); hdev 937 drivers/crypto/img-hash.c struct img_hash_dev *hdev; hdev 943 drivers/crypto/img-hash.c hdev = devm_kzalloc(dev, sizeof(*hdev), GFP_KERNEL); hdev 944 drivers/crypto/img-hash.c if (hdev == NULL) hdev 947 drivers/crypto/img-hash.c spin_lock_init(&hdev->lock); hdev 949 drivers/crypto/img-hash.c hdev->dev = dev; hdev 951 drivers/crypto/img-hash.c platform_set_drvdata(pdev, hdev); hdev 953 drivers/crypto/img-hash.c INIT_LIST_HEAD(&hdev->list); hdev 955 drivers/crypto/img-hash.c tasklet_init(&hdev->done_task, img_hash_done_task, (unsigned long)hdev); hdev 956 drivers/crypto/img-hash.c tasklet_init(&hdev->dma_task, img_hash_dma_task, (unsigned long)hdev); hdev 958 drivers/crypto/img-hash.c crypto_init_queue(&hdev->queue, IMG_HASH_QUEUE_LENGTH); hdev 961 drivers/crypto/img-hash.c hdev->io_base = devm_platform_ioremap_resource(pdev, 0); hdev 962 drivers/crypto/img-hash.c if (IS_ERR(hdev->io_base)) { hdev 963 drivers/crypto/img-hash.c err = PTR_ERR(hdev->io_base); hdev 971 drivers/crypto/img-hash.c hdev->cpu_addr = devm_ioremap_resource(dev, hash_res); hdev 972 drivers/crypto/img-hash.c if (IS_ERR(hdev->cpu_addr)) { hdev 974 drivers/crypto/img-hash.c err = PTR_ERR(hdev->cpu_addr); hdev 977 drivers/crypto/img-hash.c hdev->bus_addr = hash_res->start; hdev 986 drivers/crypto/img-hash.c dev_name(dev), hdev); hdev 993 drivers/crypto/img-hash.c hdev->hash_clk = devm_clk_get(&pdev->dev, "hash"); hdev 994 drivers/crypto/img-hash.c if (IS_ERR(hdev->hash_clk)) { hdev 996 drivers/crypto/img-hash.c err = PTR_ERR(hdev->hash_clk); hdev 1000 drivers/crypto/img-hash.c hdev->sys_clk = devm_clk_get(&pdev->dev, "sys"); hdev 1001 drivers/crypto/img-hash.c if (IS_ERR(hdev->sys_clk)) { hdev 1003 drivers/crypto/img-hash.c err = PTR_ERR(hdev->sys_clk); hdev 1007 drivers/crypto/img-hash.c err = clk_prepare_enable(hdev->hash_clk); hdev 1011 drivers/crypto/img-hash.c err = clk_prepare_enable(hdev->sys_clk); hdev 1015 drivers/crypto/img-hash.c err = img_hash_dma_init(hdev); hdev 1020 drivers/crypto/img-hash.c dma_chan_name(hdev->dma_lch)); hdev 1023 drivers/crypto/img-hash.c list_add_tail(&hdev->list, &img_hash.dev_list); hdev 1026 drivers/crypto/img-hash.c err = img_register_algs(hdev); hdev 1035 drivers/crypto/img-hash.c list_del(&hdev->list); hdev 1037 drivers/crypto/img-hash.c dma_release_channel(hdev->dma_lch); hdev 1039 drivers/crypto/img-hash.c clk_disable_unprepare(hdev->sys_clk); hdev 1041 drivers/crypto/img-hash.c clk_disable_unprepare(hdev->hash_clk); hdev 1043 drivers/crypto/img-hash.c tasklet_kill(&hdev->done_task); hdev 1044 drivers/crypto/img-hash.c tasklet_kill(&hdev->dma_task); hdev 1051 drivers/crypto/img-hash.c struct img_hash_dev *hdev; hdev 1053 drivers/crypto/img-hash.c hdev = platform_get_drvdata(pdev); hdev 1055 drivers/crypto/img-hash.c list_del(&hdev->list); hdev 1058 drivers/crypto/img-hash.c img_unregister_algs(hdev); hdev 1060 drivers/crypto/img-hash.c tasklet_kill(&hdev->done_task); hdev 1061 drivers/crypto/img-hash.c tasklet_kill(&hdev->dma_task); hdev 1063 drivers/crypto/img-hash.c dma_release_channel(hdev->dma_lch); hdev 1065 drivers/crypto/img-hash.c clk_disable_unprepare(hdev->hash_clk); hdev 1066 drivers/crypto/img-hash.c clk_disable_unprepare(hdev->sys_clk); hdev 1074 drivers/crypto/img-hash.c struct img_hash_dev *hdev = dev_get_drvdata(dev); hdev 1076 drivers/crypto/img-hash.c clk_disable_unprepare(hdev->hash_clk); hdev 1077 drivers/crypto/img-hash.c clk_disable_unprepare(hdev->sys_clk); hdev 1084 drivers/crypto/img-hash.c struct img_hash_dev *hdev = dev_get_drvdata(dev); hdev 1087 drivers/crypto/img-hash.c ret = clk_prepare_enable(hdev->hash_clk); hdev 1091 drivers/crypto/img-hash.c ret = clk_prepare_enable(hdev->sys_clk); hdev 1093 drivers/crypto/img-hash.c clk_disable_unprepare(hdev->hash_clk); hdev 115 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev; hdev 123 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev; hdev 194 drivers/crypto/stm32/stm32-hash.c static inline u32 stm32_hash_read(struct stm32_hash_dev *hdev, u32 offset) hdev 196 drivers/crypto/stm32/stm32-hash.c return readl_relaxed(hdev->io_base + offset); hdev 199 drivers/crypto/stm32/stm32-hash.c static inline void stm32_hash_write(struct stm32_hash_dev *hdev, hdev 202 drivers/crypto/stm32/stm32-hash.c writel_relaxed(value, hdev->io_base + offset); hdev 205 drivers/crypto/stm32/stm32-hash.c static inline int stm32_hash_wait_busy(struct stm32_hash_dev *hdev) hdev 209 drivers/crypto/stm32/stm32-hash.c return readl_relaxed_poll_timeout(hdev->io_base + HASH_SR, status, hdev 213 drivers/crypto/stm32/stm32-hash.c static void stm32_hash_set_nblw(struct stm32_hash_dev *hdev, int length) hdev 217 drivers/crypto/stm32/stm32-hash.c reg = stm32_hash_read(hdev, HASH_STR); hdev 220 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_STR, reg); hdev 223 drivers/crypto/stm32/stm32-hash.c static int stm32_hash_write_key(struct stm32_hash_dev *hdev) hdev 225 drivers/crypto/stm32/stm32-hash.c struct crypto_ahash *tfm = crypto_ahash_reqtfm(hdev->req); hdev 232 drivers/crypto/stm32/stm32-hash.c stm32_hash_set_nblw(hdev, keylen); hdev 235 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_DIN, *(u32 *)key); hdev 240 drivers/crypto/stm32/stm32-hash.c reg = stm32_hash_read(hdev, HASH_STR); hdev 242 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_STR, reg); hdev 250 drivers/crypto/stm32/stm32-hash.c static void stm32_hash_write_ctrl(struct stm32_hash_dev *hdev) hdev 252 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_request_ctx *rctx = ahash_request_ctx(hdev->req); hdev 253 drivers/crypto/stm32/stm32-hash.c struct crypto_ahash *tfm = crypto_ahash_reqtfm(hdev->req); hdev 258 drivers/crypto/stm32/stm32-hash.c if (!(hdev->flags & HASH_FLAGS_INIT)) { hdev 279 drivers/crypto/stm32/stm32-hash.c hdev->flags |= HASH_FLAGS_HMAC; hdev 285 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_IMR, HASH_DCIE); hdev 287 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_CR, reg); hdev 289 drivers/crypto/stm32/stm32-hash.c hdev->flags |= HASH_FLAGS_INIT; hdev 291 drivers/crypto/stm32/stm32-hash.c dev_dbg(hdev->dev, "Write Control %x\n", reg); hdev 329 drivers/crypto/stm32/stm32-hash.c static int stm32_hash_xmit_cpu(struct stm32_hash_dev *hdev, hdev 337 drivers/crypto/stm32/stm32-hash.c hdev->flags |= HASH_FLAGS_FINAL; hdev 341 drivers/crypto/stm32/stm32-hash.c dev_dbg(hdev->dev, "%s: length: %zd, final: %x len32 %i\n", hdev 344 drivers/crypto/stm32/stm32-hash.c hdev->flags |= HASH_FLAGS_CPU; hdev 346 drivers/crypto/stm32/stm32-hash.c stm32_hash_write_ctrl(hdev); hdev 348 drivers/crypto/stm32/stm32-hash.c if (stm32_hash_wait_busy(hdev)) hdev 351 drivers/crypto/stm32/stm32-hash.c if ((hdev->flags & HASH_FLAGS_HMAC) && hdev 352 drivers/crypto/stm32/stm32-hash.c (!(hdev->flags & HASH_FLAGS_HMAC_KEY))) { hdev 353 drivers/crypto/stm32/stm32-hash.c hdev->flags |= HASH_FLAGS_HMAC_KEY; hdev 354 drivers/crypto/stm32/stm32-hash.c stm32_hash_write_key(hdev); hdev 355 drivers/crypto/stm32/stm32-hash.c if (stm32_hash_wait_busy(hdev)) hdev 360 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_DIN, buffer[count]); hdev 363 drivers/crypto/stm32/stm32-hash.c stm32_hash_set_nblw(hdev, length); hdev 364 drivers/crypto/stm32/stm32-hash.c reg = stm32_hash_read(hdev, HASH_STR); hdev 366 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_STR, reg); hdev 367 drivers/crypto/stm32/stm32-hash.c if (hdev->flags & HASH_FLAGS_HMAC) { hdev 368 drivers/crypto/stm32/stm32-hash.c if (stm32_hash_wait_busy(hdev)) hdev 370 drivers/crypto/stm32/stm32-hash.c stm32_hash_write_key(hdev); hdev 378 drivers/crypto/stm32/stm32-hash.c static int stm32_hash_update_cpu(struct stm32_hash_dev *hdev) hdev 380 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_request_ctx *rctx = ahash_request_ctx(hdev->req); hdev 383 drivers/crypto/stm32/stm32-hash.c dev_dbg(hdev->dev, "%s flags %lx\n", __func__, rctx->flags); hdev 392 drivers/crypto/stm32/stm32-hash.c err = stm32_hash_xmit_cpu(hdev, rctx->buffer, bufcnt, 0); hdev 400 drivers/crypto/stm32/stm32-hash.c err = stm32_hash_xmit_cpu(hdev, rctx->buffer, bufcnt, hdev 407 drivers/crypto/stm32/stm32-hash.c static int stm32_hash_xmit_dma(struct stm32_hash_dev *hdev, hdev 415 drivers/crypto/stm32/stm32-hash.c in_desc = dmaengine_prep_slave_sg(hdev->dma_lch, sg, 1, hdev 419 drivers/crypto/stm32/stm32-hash.c dev_err(hdev->dev, "dmaengine_prep_slave error\n"); hdev 423 drivers/crypto/stm32/stm32-hash.c reinit_completion(&hdev->dma_completion); hdev 425 drivers/crypto/stm32/stm32-hash.c in_desc->callback_param = hdev; hdev 427 drivers/crypto/stm32/stm32-hash.c hdev->flags |= HASH_FLAGS_FINAL; hdev 428 drivers/crypto/stm32/stm32-hash.c hdev->flags |= HASH_FLAGS_DMA_ACTIVE; hdev 430 drivers/crypto/stm32/stm32-hash.c reg = stm32_hash_read(hdev, HASH_CR); hdev 439 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_CR, reg); hdev 441 drivers/crypto/stm32/stm32-hash.c stm32_hash_set_nblw(hdev, length); hdev 448 drivers/crypto/stm32/stm32-hash.c dma_async_issue_pending(hdev->dma_lch); hdev 450 drivers/crypto/stm32/stm32-hash.c if (!wait_for_completion_timeout(&hdev->dma_completion, hdev 454 drivers/crypto/stm32/stm32-hash.c if (dma_async_is_tx_complete(hdev->dma_lch, cookie, hdev 459 drivers/crypto/stm32/stm32-hash.c dev_err(hdev->dev, "DMA Error %i\n", err); hdev 460 drivers/crypto/stm32/stm32-hash.c dmaengine_terminate_all(hdev->dma_lch); hdev 469 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = param; hdev 471 drivers/crypto/stm32/stm32-hash.c complete(&hdev->dma_completion); hdev 473 drivers/crypto/stm32/stm32-hash.c hdev->flags |= HASH_FLAGS_DMA_READY; hdev 476 drivers/crypto/stm32/stm32-hash.c static int stm32_hash_hmac_dma_send(struct stm32_hash_dev *hdev) hdev 478 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_request_ctx *rctx = ahash_request_ctx(hdev->req); hdev 479 drivers/crypto/stm32/stm32-hash.c struct crypto_ahash *tfm = crypto_ahash_reqtfm(hdev->req); hdev 483 drivers/crypto/stm32/stm32-hash.c if (ctx->keylen < HASH_DMA_THRESHOLD || (hdev->dma_mode == 1)) { hdev 484 drivers/crypto/stm32/stm32-hash.c err = stm32_hash_write_key(hdev); hdev 485 drivers/crypto/stm32/stm32-hash.c if (stm32_hash_wait_busy(hdev)) hdev 488 drivers/crypto/stm32/stm32-hash.c if (!(hdev->flags & HASH_FLAGS_HMAC_KEY)) hdev 492 drivers/crypto/stm32/stm32-hash.c rctx->dma_ct = dma_map_sg(hdev->dev, &rctx->sg_key, 1, hdev 495 drivers/crypto/stm32/stm32-hash.c dev_err(hdev->dev, "dma_map_sg error\n"); hdev 499 drivers/crypto/stm32/stm32-hash.c err = stm32_hash_xmit_dma(hdev, &rctx->sg_key, ctx->keylen, 0); hdev 501 drivers/crypto/stm32/stm32-hash.c dma_unmap_sg(hdev->dev, &rctx->sg_key, 1, DMA_TO_DEVICE); hdev 507 drivers/crypto/stm32/stm32-hash.c static int stm32_hash_dma_init(struct stm32_hash_dev *hdev) hdev 515 drivers/crypto/stm32/stm32-hash.c dma_conf.dst_addr = hdev->phys_base + HASH_DIN; hdev 517 drivers/crypto/stm32/stm32-hash.c dma_conf.src_maxburst = hdev->dma_maxburst; hdev 518 drivers/crypto/stm32/stm32-hash.c dma_conf.dst_maxburst = hdev->dma_maxburst; hdev 521 drivers/crypto/stm32/stm32-hash.c hdev->dma_lch = dma_request_slave_channel(hdev->dev, "in"); hdev 522 drivers/crypto/stm32/stm32-hash.c if (!hdev->dma_lch) { hdev 523 drivers/crypto/stm32/stm32-hash.c dev_err(hdev->dev, "Couldn't acquire a slave DMA channel.\n"); hdev 527 drivers/crypto/stm32/stm32-hash.c err = dmaengine_slave_config(hdev->dma_lch, &dma_conf); hdev 529 drivers/crypto/stm32/stm32-hash.c dma_release_channel(hdev->dma_lch); hdev 530 drivers/crypto/stm32/stm32-hash.c hdev->dma_lch = NULL; hdev 531 drivers/crypto/stm32/stm32-hash.c dev_err(hdev->dev, "Couldn't configure DMA slave.\n"); hdev 535 drivers/crypto/stm32/stm32-hash.c init_completion(&hdev->dma_completion); hdev 540 drivers/crypto/stm32/stm32-hash.c static int stm32_hash_dma_send(struct stm32_hash_dev *hdev) hdev 542 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_request_ctx *rctx = ahash_request_ctx(hdev->req); hdev 548 drivers/crypto/stm32/stm32-hash.c rctx->sg = hdev->req->src; hdev 549 drivers/crypto/stm32/stm32-hash.c rctx->total = hdev->req->nbytes; hdev 556 drivers/crypto/stm32/stm32-hash.c stm32_hash_write_ctrl(hdev); hdev 558 drivers/crypto/stm32/stm32-hash.c if (hdev->flags & HASH_FLAGS_HMAC) { hdev 559 drivers/crypto/stm32/stm32-hash.c err = stm32_hash_hmac_dma_send(hdev); hdev 569 drivers/crypto/stm32/stm32-hash.c if (hdev->dma_mode == 1) { hdev 587 drivers/crypto/stm32/stm32-hash.c rctx->dma_ct = dma_map_sg(hdev->dev, sg, 1, hdev 590 drivers/crypto/stm32/stm32-hash.c dev_err(hdev->dev, "dma_map_sg error\n"); hdev 594 drivers/crypto/stm32/stm32-hash.c err = stm32_hash_xmit_dma(hdev, sg, len, hdev 597 drivers/crypto/stm32/stm32-hash.c dma_unmap_sg(hdev->dev, sg, 1, DMA_TO_DEVICE); hdev 603 drivers/crypto/stm32/stm32-hash.c if (hdev->dma_mode == 1) { hdev 604 drivers/crypto/stm32/stm32-hash.c if (stm32_hash_wait_busy(hdev)) hdev 606 drivers/crypto/stm32/stm32-hash.c reg = stm32_hash_read(hdev, HASH_CR); hdev 609 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_CR, reg); hdev 614 drivers/crypto/stm32/stm32-hash.c writesl(hdev->io_base + HASH_DIN, buffer, hdev 617 drivers/crypto/stm32/stm32-hash.c stm32_hash_set_nblw(hdev, ncp); hdev 618 drivers/crypto/stm32/stm32-hash.c reg = stm32_hash_read(hdev, HASH_STR); hdev 620 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_STR, reg); hdev 624 drivers/crypto/stm32/stm32-hash.c if (hdev->flags & HASH_FLAGS_HMAC) { hdev 625 drivers/crypto/stm32/stm32-hash.c if (stm32_hash_wait_busy(hdev)) hdev 627 drivers/crypto/stm32/stm32-hash.c err = stm32_hash_hmac_dma_send(hdev); hdev 635 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = NULL, *tmp; hdev 638 drivers/crypto/stm32/stm32-hash.c if (!ctx->hdev) { hdev 640 drivers/crypto/stm32/stm32-hash.c hdev = tmp; hdev 643 drivers/crypto/stm32/stm32-hash.c ctx->hdev = hdev; hdev 645 drivers/crypto/stm32/stm32-hash.c hdev = ctx->hdev; hdev 650 drivers/crypto/stm32/stm32-hash.c return hdev; hdev 657 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = stm32_hash_find_dev(ctx); hdev 664 drivers/crypto/stm32/stm32-hash.c if (hdev->dma_mode == 1) hdev 684 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = stm32_hash_find_dev(ctx); hdev 686 drivers/crypto/stm32/stm32-hash.c rctx->hdev = hdev; hdev 719 drivers/crypto/stm32/stm32-hash.c dev_dbg(hdev->dev, "%s Flags %lx\n", __func__, rctx->flags); hdev 724 drivers/crypto/stm32/stm32-hash.c static int stm32_hash_update_req(struct stm32_hash_dev *hdev) hdev 726 drivers/crypto/stm32/stm32-hash.c return stm32_hash_update_cpu(hdev); hdev 729 drivers/crypto/stm32/stm32-hash.c static int stm32_hash_final_req(struct stm32_hash_dev *hdev) hdev 731 drivers/crypto/stm32/stm32-hash.c struct ahash_request *req = hdev->req; hdev 739 drivers/crypto/stm32/stm32-hash.c err = stm32_hash_dma_send(hdev); hdev 741 drivers/crypto/stm32/stm32-hash.c err = stm32_hash_xmit_cpu(hdev, rctx->buffer, buflen, 1); hdev 771 drivers/crypto/stm32/stm32-hash.c hash[i] = be32_to_cpu(stm32_hash_read(rctx->hdev, hdev 790 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = rctx->hdev; hdev 792 drivers/crypto/stm32/stm32-hash.c if (!err && (HASH_FLAGS_FINAL & hdev->flags)) { hdev 795 drivers/crypto/stm32/stm32-hash.c hdev->flags &= ~(HASH_FLAGS_FINAL | HASH_FLAGS_CPU | hdev 804 drivers/crypto/stm32/stm32-hash.c pm_runtime_mark_last_busy(hdev->dev); hdev 805 drivers/crypto/stm32/stm32-hash.c pm_runtime_put_autosuspend(hdev->dev); hdev 807 drivers/crypto/stm32/stm32-hash.c crypto_finalize_hash_request(hdev->engine, req, err); hdev 810 drivers/crypto/stm32/stm32-hash.c static int stm32_hash_hw_init(struct stm32_hash_dev *hdev, hdev 813 drivers/crypto/stm32/stm32-hash.c pm_runtime_get_sync(hdev->dev); hdev 815 drivers/crypto/stm32/stm32-hash.c if (!(HASH_FLAGS_INIT & hdev->flags)) { hdev 816 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_CR, HASH_CR_INIT); hdev 817 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_STR, 0); hdev 818 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_DIN, 0); hdev 819 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_IMR, 0); hdev 820 drivers/crypto/stm32/stm32-hash.c hdev->err = 0; hdev 829 drivers/crypto/stm32/stm32-hash.c static int stm32_hash_handle_queue(struct stm32_hash_dev *hdev, hdev 832 drivers/crypto/stm32/stm32-hash.c return crypto_transfer_hash_request_to_engine(hdev->engine, req); hdev 840 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = stm32_hash_find_dev(ctx); hdev 843 drivers/crypto/stm32/stm32-hash.c if (!hdev) hdev 846 drivers/crypto/stm32/stm32-hash.c hdev->req = req; hdev 850 drivers/crypto/stm32/stm32-hash.c dev_dbg(hdev->dev, "processing new req, op: %lu, nbytes %d\n", hdev 853 drivers/crypto/stm32/stm32-hash.c return stm32_hash_hw_init(hdev, rctx); hdev 861 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = stm32_hash_find_dev(ctx); hdev 865 drivers/crypto/stm32/stm32-hash.c if (!hdev) hdev 868 drivers/crypto/stm32/stm32-hash.c hdev->req = req; hdev 873 drivers/crypto/stm32/stm32-hash.c err = stm32_hash_update_req(hdev); hdev 875 drivers/crypto/stm32/stm32-hash.c err = stm32_hash_final_req(hdev); hdev 888 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = ctx->hdev; hdev 892 drivers/crypto/stm32/stm32-hash.c return stm32_hash_handle_queue(hdev, req); hdev 927 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = stm32_hash_find_dev(ctx); hdev 932 drivers/crypto/stm32/stm32-hash.c if (hdev->dma_lch && stm32_hash_dma_aligned_data(req)) hdev 958 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = stm32_hash_find_dev(ctx); hdev 962 drivers/crypto/stm32/stm32-hash.c pm_runtime_get_sync(hdev->dev); hdev 964 drivers/crypto/stm32/stm32-hash.c while ((stm32_hash_read(hdev, HASH_SR) & HASH_SR_BUSY)) hdev 973 drivers/crypto/stm32/stm32-hash.c *preg++ = stm32_hash_read(hdev, HASH_IMR); hdev 974 drivers/crypto/stm32/stm32-hash.c *preg++ = stm32_hash_read(hdev, HASH_STR); hdev 975 drivers/crypto/stm32/stm32-hash.c *preg++ = stm32_hash_read(hdev, HASH_CR); hdev 977 drivers/crypto/stm32/stm32-hash.c *preg++ = stm32_hash_read(hdev, HASH_CSR(i)); hdev 979 drivers/crypto/stm32/stm32-hash.c pm_runtime_mark_last_busy(hdev->dev); hdev 980 drivers/crypto/stm32/stm32-hash.c pm_runtime_put_autosuspend(hdev->dev); hdev 991 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = stm32_hash_find_dev(ctx); hdev 1000 drivers/crypto/stm32/stm32-hash.c pm_runtime_get_sync(hdev->dev); hdev 1002 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_IMR, *preg++); hdev 1003 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_STR, *preg++); hdev 1004 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_CR, *preg); hdev 1006 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_CR, reg); hdev 1009 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_CSR(i), *preg++); hdev 1011 drivers/crypto/stm32/stm32-hash.c pm_runtime_mark_last_busy(hdev->dev); hdev 1012 drivers/crypto/stm32/stm32-hash.c pm_runtime_put_autosuspend(hdev->dev); hdev 1080 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = dev_id; hdev 1082 drivers/crypto/stm32/stm32-hash.c if (HASH_FLAGS_CPU & hdev->flags) { hdev 1083 drivers/crypto/stm32/stm32-hash.c if (HASH_FLAGS_OUTPUT_READY & hdev->flags) { hdev 1084 drivers/crypto/stm32/stm32-hash.c hdev->flags &= ~HASH_FLAGS_OUTPUT_READY; hdev 1087 drivers/crypto/stm32/stm32-hash.c } else if (HASH_FLAGS_DMA_READY & hdev->flags) { hdev 1088 drivers/crypto/stm32/stm32-hash.c if (HASH_FLAGS_DMA_ACTIVE & hdev->flags) { hdev 1089 drivers/crypto/stm32/stm32-hash.c hdev->flags &= ~HASH_FLAGS_DMA_ACTIVE; hdev 1098 drivers/crypto/stm32/stm32-hash.c stm32_hash_finish_req(hdev->req, 0); hdev 1105 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = dev_id; hdev 1108 drivers/crypto/stm32/stm32-hash.c reg = stm32_hash_read(hdev, HASH_SR); hdev 1111 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_SR, reg); hdev 1112 drivers/crypto/stm32/stm32-hash.c hdev->flags |= HASH_FLAGS_OUTPUT_READY; hdev 1114 drivers/crypto/stm32/stm32-hash.c stm32_hash_write(hdev, HASH_IMR, 0); hdev 1331 drivers/crypto/stm32/stm32-hash.c static int stm32_hash_register_algs(struct stm32_hash_dev *hdev) hdev 1336 drivers/crypto/stm32/stm32-hash.c for (i = 0; i < hdev->pdata->algs_info_size; i++) { hdev 1337 drivers/crypto/stm32/stm32-hash.c for (j = 0; j < hdev->pdata->algs_info[i].size; j++) { hdev 1339 drivers/crypto/stm32/stm32-hash.c &hdev->pdata->algs_info[i].algs_list[j]); hdev 1347 drivers/crypto/stm32/stm32-hash.c dev_err(hdev->dev, "Algo %d : %d failed\n", i, j); hdev 1351 drivers/crypto/stm32/stm32-hash.c &hdev->pdata->algs_info[i].algs_list[j]); hdev 1357 drivers/crypto/stm32/stm32-hash.c static int stm32_hash_unregister_algs(struct stm32_hash_dev *hdev) hdev 1361 drivers/crypto/stm32/stm32-hash.c for (i = 0; i < hdev->pdata->algs_info_size; i++) { hdev 1362 drivers/crypto/stm32/stm32-hash.c for (j = 0; j < hdev->pdata->algs_info[i].size; j++) hdev 1364 drivers/crypto/stm32/stm32-hash.c &hdev->pdata->algs_info[i].algs_list[j]); hdev 1412 drivers/crypto/stm32/stm32-hash.c static int stm32_hash_get_of_match(struct stm32_hash_dev *hdev, hdev 1415 drivers/crypto/stm32/stm32-hash.c hdev->pdata = of_device_get_match_data(dev); hdev 1416 drivers/crypto/stm32/stm32-hash.c if (!hdev->pdata) { hdev 1422 drivers/crypto/stm32/stm32-hash.c &hdev->dma_maxburst)) { hdev 1424 drivers/crypto/stm32/stm32-hash.c hdev->dma_maxburst = 0; hdev 1432 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev; hdev 1437 drivers/crypto/stm32/stm32-hash.c hdev = devm_kzalloc(dev, sizeof(*hdev), GFP_KERNEL); hdev 1438 drivers/crypto/stm32/stm32-hash.c if (!hdev) hdev 1442 drivers/crypto/stm32/stm32-hash.c hdev->io_base = devm_ioremap_resource(dev, res); hdev 1443 drivers/crypto/stm32/stm32-hash.c if (IS_ERR(hdev->io_base)) hdev 1444 drivers/crypto/stm32/stm32-hash.c return PTR_ERR(hdev->io_base); hdev 1446 drivers/crypto/stm32/stm32-hash.c hdev->phys_base = res->start; hdev 1448 drivers/crypto/stm32/stm32-hash.c ret = stm32_hash_get_of_match(hdev, dev); hdev 1458 drivers/crypto/stm32/stm32-hash.c dev_name(dev), hdev); hdev 1464 drivers/crypto/stm32/stm32-hash.c hdev->clk = devm_clk_get(&pdev->dev, NULL); hdev 1465 drivers/crypto/stm32/stm32-hash.c if (IS_ERR(hdev->clk)) { hdev 1467 drivers/crypto/stm32/stm32-hash.c PTR_ERR(hdev->clk)); hdev 1468 drivers/crypto/stm32/stm32-hash.c return PTR_ERR(hdev->clk); hdev 1471 drivers/crypto/stm32/stm32-hash.c ret = clk_prepare_enable(hdev->clk); hdev 1484 drivers/crypto/stm32/stm32-hash.c hdev->rst = devm_reset_control_get(&pdev->dev, NULL); hdev 1485 drivers/crypto/stm32/stm32-hash.c if (!IS_ERR(hdev->rst)) { hdev 1486 drivers/crypto/stm32/stm32-hash.c reset_control_assert(hdev->rst); hdev 1488 drivers/crypto/stm32/stm32-hash.c reset_control_deassert(hdev->rst); hdev 1491 drivers/crypto/stm32/stm32-hash.c hdev->dev = dev; hdev 1493 drivers/crypto/stm32/stm32-hash.c platform_set_drvdata(pdev, hdev); hdev 1495 drivers/crypto/stm32/stm32-hash.c ret = stm32_hash_dma_init(hdev); hdev 1500 drivers/crypto/stm32/stm32-hash.c list_add_tail(&hdev->list, &stm32_hash.dev_list); hdev 1504 drivers/crypto/stm32/stm32-hash.c hdev->engine = crypto_engine_alloc_init(dev, 1); hdev 1505 drivers/crypto/stm32/stm32-hash.c if (!hdev->engine) { hdev 1510 drivers/crypto/stm32/stm32-hash.c ret = crypto_engine_start(hdev->engine); hdev 1514 drivers/crypto/stm32/stm32-hash.c hdev->dma_mode = stm32_hash_read(hdev, HASH_HWCFGR); hdev 1517 drivers/crypto/stm32/stm32-hash.c ret = stm32_hash_register_algs(hdev); hdev 1522 drivers/crypto/stm32/stm32-hash.c stm32_hash_read(hdev, HASH_VER), hdev->dma_mode); hdev 1530 drivers/crypto/stm32/stm32-hash.c crypto_engine_exit(hdev->engine); hdev 1533 drivers/crypto/stm32/stm32-hash.c list_del(&hdev->list); hdev 1536 drivers/crypto/stm32/stm32-hash.c if (hdev->dma_lch) hdev 1537 drivers/crypto/stm32/stm32-hash.c dma_release_channel(hdev->dma_lch); hdev 1542 drivers/crypto/stm32/stm32-hash.c clk_disable_unprepare(hdev->clk); hdev 1549 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev; hdev 1552 drivers/crypto/stm32/stm32-hash.c hdev = platform_get_drvdata(pdev); hdev 1553 drivers/crypto/stm32/stm32-hash.c if (!hdev) hdev 1556 drivers/crypto/stm32/stm32-hash.c ret = pm_runtime_get_sync(hdev->dev); hdev 1560 drivers/crypto/stm32/stm32-hash.c stm32_hash_unregister_algs(hdev); hdev 1562 drivers/crypto/stm32/stm32-hash.c crypto_engine_exit(hdev->engine); hdev 1565 drivers/crypto/stm32/stm32-hash.c list_del(&hdev->list); hdev 1568 drivers/crypto/stm32/stm32-hash.c if (hdev->dma_lch) hdev 1569 drivers/crypto/stm32/stm32-hash.c dma_release_channel(hdev->dma_lch); hdev 1571 drivers/crypto/stm32/stm32-hash.c pm_runtime_disable(hdev->dev); hdev 1572 drivers/crypto/stm32/stm32-hash.c pm_runtime_put_noidle(hdev->dev); hdev 1574 drivers/crypto/stm32/stm32-hash.c clk_disable_unprepare(hdev->clk); hdev 1582 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = dev_get_drvdata(dev); hdev 1584 drivers/crypto/stm32/stm32-hash.c clk_disable_unprepare(hdev->clk); hdev 1591 drivers/crypto/stm32/stm32-hash.c struct stm32_hash_dev *hdev = dev_get_drvdata(dev); hdev 1594 drivers/crypto/stm32/stm32-hash.c ret = clk_prepare_enable(hdev->clk); hdev 1596 drivers/crypto/stm32/stm32-hash.c dev_err(hdev->dev, "Failed to prepare_enable clock\n"); hdev 34 drivers/hid/hid-a4tech.c static int a4_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 38 drivers/hid/hid-a4tech.c struct a4tech_sc *a4 = hid_get_drvdata(hdev); hdev 56 drivers/hid/hid-a4tech.c static int a4_input_mapped(struct hid_device *hdev, struct hid_input *hi, hdev 60 drivers/hid/hid-a4tech.c struct a4tech_sc *a4 = hid_get_drvdata(hdev); hdev 73 drivers/hid/hid-a4tech.c static int a4_event(struct hid_device *hdev, struct hid_field *field, hdev 76 drivers/hid/hid-a4tech.c struct a4tech_sc *a4 = hid_get_drvdata(hdev); hdev 79 drivers/hid/hid-a4tech.c if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput) hdev 113 drivers/hid/hid-a4tech.c static int a4_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 118 drivers/hid/hid-a4tech.c a4 = devm_kzalloc(&hdev->dev, sizeof(*a4), GFP_KERNEL); hdev 120 drivers/hid/hid-a4tech.c hid_err(hdev, "can't alloc device descriptor\n"); hdev 126 drivers/hid/hid-a4tech.c hid_set_drvdata(hdev, a4); hdev 128 drivers/hid/hid-a4tech.c ret = hid_parse(hdev); hdev 130 drivers/hid/hid-a4tech.c hid_err(hdev, "parse failed\n"); hdev 134 drivers/hid/hid-a4tech.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 136 drivers/hid/hid-a4tech.c hid_err(hdev, "hw start failed\n"); hdev 19 drivers/hid/hid-accutouch.c static int accutouch_input_mapping(struct hid_device *hdev, hdev 98 drivers/hid/hid-alps.c struct hid_device *hdev; hdev 164 drivers/hid/hid-alps.c static int t4_read_write_register(struct hid_device *hdev, u32 address, hdev 194 drivers/hid/hid-alps.c ret = hid_hw_raw_request(hdev, T4_FEATURE_REPORT_ID, input, hdev 199 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed to read command (%d)\n", ret); hdev 210 drivers/hid/hid-alps.c ret = hid_hw_raw_request(hdev, T4_FEATURE_REPORT_ID, readbuf, hdev 214 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed read register (%d)\n", ret); hdev 221 drivers/hid/hid-alps.c dev_err(&hdev->dev, "read register address error (%x,%x)\n", hdev 227 drivers/hid/hid-alps.c dev_err(&hdev->dev, "read register size error (%x)\n", hdev 234 drivers/hid/hid-alps.c dev_err(&hdev->dev, "read register checksum error (%x,%x)\n", hdev 251 drivers/hid/hid-alps.c static int u1_read_write_register(struct hid_device *hdev, u32 address, hdev 280 drivers/hid/hid-alps.c ret = hid_hw_raw_request(hdev, U1_FEATURE_REPORT_ID, input, hdev 285 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed to read command (%d)\n", ret); hdev 296 drivers/hid/hid-alps.c ret = hid_hw_raw_request(hdev, U1_FEATURE_REPORT_ID, readbuf, hdev 301 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed read register (%d)\n", ret); hdev 433 drivers/hid/hid-alps.c static int alps_raw_event(struct hid_device *hdev, hdev 437 drivers/hid/hid-alps.c struct alps_dev *hdata = hid_get_drvdata(hdev); hdev 439 drivers/hid/hid-alps.c switch (hdev->product) { hdev 450 drivers/hid/hid-alps.c static int __maybe_unused alps_post_reset(struct hid_device *hdev) hdev 453 drivers/hid/hid-alps.c struct alps_dev *data = hid_get_drvdata(hdev); hdev 457 drivers/hid/hid-alps.c ret = t4_read_write_register(hdev, T4_PRM_FEED_CONFIG_1, hdev 460 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed T4_PRM_FEED_CONFIG_1 (%d)\n", hdev 465 drivers/hid/hid-alps.c ret = t4_read_write_register(hdev, T4_PRM_FEED_CONFIG_4, hdev 468 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed T4_PRM_FEED_CONFIG_4 (%d)\n", hdev 474 drivers/hid/hid-alps.c ret = u1_read_write_register(hdev, hdev 478 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed to change TP mode (%d)\n", hdev 491 drivers/hid/hid-alps.c static int __maybe_unused alps_post_resume(struct hid_device *hdev) hdev 493 drivers/hid/hid-alps.c return alps_post_reset(hdev); hdev 496 drivers/hid/hid-alps.c static int u1_init(struct hid_device *hdev, struct alps_dev *pri_data) hdev 503 drivers/hid/hid-alps.c ret = u1_read_write_register(hdev, ADDRESS_U1_DEV_CTRL_1, hdev 506 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed U1_DEV_CTRL_1 (%d)\n", ret); hdev 512 drivers/hid/hid-alps.c ret = u1_read_write_register(hdev, ADDRESS_U1_DEV_CTRL_1, hdev 515 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed to change TP mode (%d)\n", ret); hdev 519 drivers/hid/hid-alps.c ret = u1_read_write_register(hdev, ADDRESS_U1_NUM_SENS_X, hdev 522 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed U1_NUM_SENS_X (%d)\n", ret); hdev 526 drivers/hid/hid-alps.c ret = u1_read_write_register(hdev, ADDRESS_U1_NUM_SENS_Y, hdev 529 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed U1_NUM_SENS_Y (%d)\n", ret); hdev 533 drivers/hid/hid-alps.c ret = u1_read_write_register(hdev, ADDRESS_U1_PITCH_SENS_X, hdev 536 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed U1_PITCH_SENS_X (%d)\n", ret); hdev 540 drivers/hid/hid-alps.c ret = u1_read_write_register(hdev, ADDRESS_U1_PITCH_SENS_Y, hdev 543 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed U1_PITCH_SENS_Y (%d)\n", ret); hdev 547 drivers/hid/hid-alps.c ret = u1_read_write_register(hdev, ADDRESS_U1_RESO_DWN_ABS, hdev 550 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed U1_RESO_DWN_ABS (%d)\n", ret); hdev 565 drivers/hid/hid-alps.c ret = u1_read_write_register(hdev, ADDRESS_U1_PAD_BTN, hdev 568 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed U1_PAD_BTN (%d)\n", ret); hdev 580 drivers/hid/hid-alps.c ret = u1_read_write_register(hdev, ADDRESS_U1_DEVICE_TYP, hdev 583 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed U1_DEVICE_TYP (%d)\n", ret); hdev 588 drivers/hid/hid-alps.c ret = u1_read_write_register(hdev, ADDRESS_U1_DEV_CTRL_1, hdev 591 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed SP mode (%d)\n", ret); hdev 595 drivers/hid/hid-alps.c ret = u1_read_write_register(hdev, ADDRESS_U1_SP_BTN, hdev 598 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed U1_SP_BTN (%d)\n", ret); hdev 608 drivers/hid/hid-alps.c static int T4_init(struct hid_device *hdev, struct alps_dev *pri_data) hdev 613 drivers/hid/hid-alps.c ret = t4_read_write_register(hdev, T4_PRM_ID_CONFIG_3, &tmp, 0, true); hdev 615 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed T4_PRM_ID_CONFIG_3 (%d)\n", ret); hdev 628 drivers/hid/hid-alps.c ret = t4_read_write_register(hdev, PRM_SYS_CONFIG_1, &tmp, 0, true); hdev 630 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed PRM_SYS_CONFIG_1 (%d)\n", ret); hdev 634 drivers/hid/hid-alps.c ret = t4_read_write_register(hdev, PRM_SYS_CONFIG_1, NULL, tmp, false); hdev 636 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed PRM_SYS_CONFIG_1 (%d)\n", ret); hdev 640 drivers/hid/hid-alps.c ret = t4_read_write_register(hdev, T4_PRM_FEED_CONFIG_1, hdev 643 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed T4_PRM_FEED_CONFIG_1 (%d)\n", ret); hdev 647 drivers/hid/hid-alps.c ret = t4_read_write_register(hdev, T4_PRM_FEED_CONFIG_4, NULL, hdev 650 drivers/hid/hid-alps.c dev_err(&hdev->dev, "failed T4_PRM_FEED_CONFIG_4 (%d)\n", ret); hdev 673 drivers/hid/hid-alps.c static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi) hdev 675 drivers/hid/hid-alps.c struct alps_dev *data = hid_get_drvdata(hdev); hdev 682 drivers/hid/hid-alps.c hid_dbg(hdev, "Opening low level driver\n"); hdev 683 drivers/hid/hid-alps.c ret = hid_hw_open(hdev); hdev 688 drivers/hid/hid-alps.c hid_device_io_start(hdev); hdev 691 drivers/hid/hid-alps.c ret = T4_init(hdev, data); hdev 694 drivers/hid/hid-alps.c ret = u1_init(hdev, data); hdev 746 drivers/hid/hid-alps.c input_set_drvdata(input2, hdev); hdev 768 drivers/hid/hid-alps.c hid_device_io_stop(hdev); hdev 769 drivers/hid/hid-alps.c hid_hw_close(hdev); hdev 773 drivers/hid/hid-alps.c static int alps_input_mapping(struct hid_device *hdev, hdev 780 drivers/hid/hid-alps.c static int alps_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 784 drivers/hid/hid-alps.c data = devm_kzalloc(&hdev->dev, sizeof(struct alps_dev), GFP_KERNEL); hdev 788 drivers/hid/hid-alps.c data->hdev = hdev; hdev 789 drivers/hid/hid-alps.c hid_set_drvdata(hdev, data); hdev 791 drivers/hid/hid-alps.c hdev->quirks |= HID_QUIRK_NO_INIT_REPORTS; hdev 793 drivers/hid/hid-alps.c ret = hid_parse(hdev); hdev 795 drivers/hid/hid-alps.c hid_err(hdev, "parse failed\n"); hdev 799 drivers/hid/hid-alps.c switch (hdev->product) { hdev 812 drivers/hid/hid-alps.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 814 drivers/hid/hid-alps.c hid_err(hdev, "hw start failed\n"); hdev 821 drivers/hid/hid-alps.c static void alps_remove(struct hid_device *hdev) hdev 823 drivers/hid/hid-alps.c hid_hw_stop(hdev); hdev 276 drivers/hid/hid-apple.c static int apple_event(struct hid_device *hdev, struct hid_field *field, hdev 279 drivers/hid/hid-apple.c struct apple_sc *asc = hid_get_drvdata(hdev); hdev 281 drivers/hid/hid-apple.c if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput || hdev 293 drivers/hid/hid-apple.c hidinput_apple_event(hdev, field->hidinput->input, hdev 304 drivers/hid/hid-apple.c static __u8 *apple_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 307 drivers/hid/hid-apple.c struct apple_sc *asc = hid_get_drvdata(hdev); hdev 311 drivers/hid/hid-apple.c hid_info(hdev, hdev 338 drivers/hid/hid-apple.c static int apple_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 356 drivers/hid/hid-apple.c static int apple_input_mapped(struct hid_device *hdev, struct hid_input *hi, hdev 360 drivers/hid/hid-apple.c struct apple_sc *asc = hid_get_drvdata(hdev); hdev 374 drivers/hid/hid-apple.c static int apple_probe(struct hid_device *hdev, hdev 382 drivers/hid/hid-apple.c asc = devm_kzalloc(&hdev->dev, sizeof(*asc), GFP_KERNEL); hdev 384 drivers/hid/hid-apple.c hid_err(hdev, "can't alloc apple descriptor\n"); hdev 390 drivers/hid/hid-apple.c hid_set_drvdata(hdev, asc); hdev 392 drivers/hid/hid-apple.c ret = hid_parse(hdev); hdev 394 drivers/hid/hid-apple.c hid_err(hdev, "parse failed\n"); hdev 403 drivers/hid/hid-apple.c ret = hid_hw_start(hdev, connect_mask); hdev 405 drivers/hid/hid-apple.c hid_err(hdev, "hw start failed\n"); hdev 92 drivers/hid/hid-asus.c struct hid_device *hdev; hdev 109 drivers/hid/hid-asus.c struct hid_device *hdev; hdev 260 drivers/hid/hid-asus.c static int asus_event(struct hid_device *hdev, struct hid_field *field, hdev 266 drivers/hid/hid-asus.c hid_warn(hdev, "Unmapped Asus vendor usagepage code 0x%02x\n", hdev 273 drivers/hid/hid-asus.c static int asus_raw_event(struct hid_device *hdev, hdev 276 drivers/hid/hid-asus.c struct asus_drvdata *drvdata = hid_get_drvdata(hdev); hdev 287 drivers/hid/hid-asus.c static int asus_kbd_set_report(struct hid_device *hdev, u8 *buf, size_t buf_size) hdev 296 drivers/hid/hid-asus.c ret = hid_hw_raw_request(hdev, FEATURE_KBD_REPORT_ID, dmabuf, hdev 304 drivers/hid/hid-asus.c static int asus_kbd_init(struct hid_device *hdev) hdev 310 drivers/hid/hid-asus.c ret = asus_kbd_set_report(hdev, buf, sizeof(buf)); hdev 312 drivers/hid/hid-asus.c hid_err(hdev, "Asus failed to send init command: %d\n", ret); hdev 317 drivers/hid/hid-asus.c static int asus_kbd_get_functions(struct hid_device *hdev, hdev 324 drivers/hid/hid-asus.c ret = asus_kbd_set_report(hdev, buf, sizeof(buf)); hdev 326 drivers/hid/hid-asus.c hid_err(hdev, "Asus failed to send configuration command: %d\n", ret); hdev 334 drivers/hid/hid-asus.c ret = hid_hw_raw_request(hdev, FEATURE_KBD_REPORT_ID, readbuf, hdev 338 drivers/hid/hid-asus.c hid_err(hdev, "Asus failed to request functions: %d\n", ret); hdev 380 drivers/hid/hid-asus.c ret = asus_kbd_set_report(led->hdev, buf, sizeof(buf)); hdev 382 drivers/hid/hid-asus.c hid_err(led->hdev, "Asus failed to set keyboard backlight: %d\n", ret); hdev 389 drivers/hid/hid-asus.c static bool asus_kbd_wmi_led_control_present(struct hid_device *hdev) hdev 399 drivers/hid/hid-asus.c hid_dbg(hdev, "WMI backlight check: rc %d value %x", ret, value); hdev 406 drivers/hid/hid-asus.c static int asus_kbd_register_leds(struct hid_device *hdev) hdev 408 drivers/hid/hid-asus.c struct asus_drvdata *drvdata = hid_get_drvdata(hdev); hdev 413 drivers/hid/hid-asus.c ret = asus_kbd_init(hdev); hdev 418 drivers/hid/hid-asus.c ret = asus_kbd_get_functions(hdev, &kbd_func); hdev 426 drivers/hid/hid-asus.c drvdata->kbd_backlight = devm_kzalloc(&hdev->dev, hdev 434 drivers/hid/hid-asus.c drvdata->kbd_backlight->hdev = hdev; hdev 441 drivers/hid/hid-asus.c ret = devm_led_classdev_register(&hdev->dev, &drvdata->kbd_backlight->cdev); hdev 444 drivers/hid/hid-asus.c devm_kfree(&hdev->dev, drvdata->kbd_backlight); hdev 507 drivers/hid/hid-asus.c ret = hid_hw_raw_request(drvdata->hdev, BATTERY_REPORT_ID, hdev 560 drivers/hid/hid-asus.c val->strval = drvdata->hdev->name; hdev 570 drivers/hid/hid-asus.c static int asus_battery_probe(struct hid_device *hdev) hdev 572 drivers/hid/hid-asus.c struct asus_drvdata *drvdata = hid_get_drvdata(hdev); hdev 585 drivers/hid/hid-asus.c drvdata->battery_desc.name = devm_kasprintf(&hdev->dev, GFP_KERNEL, hdev 587 drivers/hid/hid-asus.c strlen(hdev->uniq) ? hdev 588 drivers/hid/hid-asus.c hdev->uniq : dev_name(&hdev->dev)); hdev 594 drivers/hid/hid-asus.c drvdata->battery = devm_power_supply_register(&hdev->dev, hdev 599 drivers/hid/hid-asus.c hid_err(hdev, "Unable to register battery device\n"); hdev 603 drivers/hid/hid-asus.c power_supply_powers(drvdata->battery, &hdev->dev); hdev 608 drivers/hid/hid-asus.c static int asus_input_configured(struct hid_device *hdev, struct hid_input *hi) hdev 611 drivers/hid/hid-asus.c struct asus_drvdata *drvdata = hid_get_drvdata(hdev); hdev 644 drivers/hid/hid-asus.c hid_err(hdev, "Asus input mt init slots failed: %d\n", ret); hdev 652 drivers/hid/hid-asus.c !asus_kbd_wmi_led_control_present(hdev) && hdev 653 drivers/hid/hid-asus.c asus_kbd_register_leds(hdev)) hdev 654 drivers/hid/hid-asus.c hid_warn(hdev, "Failed to initialize backlight.\n"); hdev 661 drivers/hid/hid-asus.c static int asus_input_mapping(struct hid_device *hdev, hdev 666 drivers/hid/hid-asus.c struct asus_drvdata *drvdata = hid_get_drvdata(hdev); hdev 788 drivers/hid/hid-asus.c static int asus_start_multitouch(struct hid_device *hdev) hdev 798 drivers/hid/hid-asus.c hid_err(hdev, "Asus failed to alloc dma buf: %d\n", ret); hdev 802 drivers/hid/hid-asus.c ret = hid_hw_raw_request(hdev, dmabuf[0], dmabuf, sizeof(buf), hdev 808 drivers/hid/hid-asus.c hid_err(hdev, "Asus failed to start multitouch: %d\n", ret); hdev 815 drivers/hid/hid-asus.c static int __maybe_unused asus_reset_resume(struct hid_device *hdev) hdev 817 drivers/hid/hid-asus.c struct asus_drvdata *drvdata = hid_get_drvdata(hdev); hdev 820 drivers/hid/hid-asus.c return asus_start_multitouch(hdev); hdev 825 drivers/hid/hid-asus.c static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 830 drivers/hid/hid-asus.c drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL); hdev 832 drivers/hid/hid-asus.c hid_err(hdev, "Can't alloc Asus descriptor\n"); hdev 836 drivers/hid/hid-asus.c hid_set_drvdata(hdev, drvdata); hdev 844 drivers/hid/hid-asus.c if (strstr(hdev->name, "T90CHI")) { hdev 853 drivers/hid/hid-asus.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 876 drivers/hid/hid-asus.c hdev->quirks |= HID_QUIRK_MULTI_INPUT; hdev 881 drivers/hid/hid-asus.c hdev->quirks |= HID_QUIRK_NO_INIT_REPORTS; hdev 883 drivers/hid/hid-asus.c drvdata->hdev = hdev; hdev 886 drivers/hid/hid-asus.c ret = asus_battery_probe(hdev); hdev 888 drivers/hid/hid-asus.c hid_err(hdev, hdev 894 drivers/hid/hid-asus.c ret = hid_parse(hdev); hdev 896 drivers/hid/hid-asus.c hid_err(hdev, "Asus hid parse failed: %d\n", ret); hdev 902 drivers/hid/hid-asus.c hdev->collection->usage == HID_GD_MOUSE) hdev 905 drivers/hid/hid-asus.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 907 drivers/hid/hid-asus.c hid_err(hdev, "Asus hw start failed: %d\n", ret); hdev 912 drivers/hid/hid-asus.c hid_err(hdev, "Asus input not registered\n"); hdev 924 drivers/hid/hid-asus.c ret = asus_start_multitouch(hdev); hdev 931 drivers/hid/hid-asus.c hid_hw_stop(hdev); hdev 935 drivers/hid/hid-asus.c static void asus_remove(struct hid_device *hdev) hdev 937 drivers/hid/hid-asus.c struct asus_drvdata *drvdata = hid_get_drvdata(hdev); hdev 944 drivers/hid/hid-asus.c hid_hw_stop(hdev); hdev 952 drivers/hid/hid-asus.c static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 955 drivers/hid/hid-asus.c struct asus_drvdata *drvdata = hid_get_drvdata(hdev); hdev 959 drivers/hid/hid-asus.c hid_info(hdev, "Fixing up Asus notebook report descriptor\n"); hdev 966 drivers/hid/hid-asus.c hid_info(hdev, "Fixing up Asus T100 keyb report descriptor\n"); hdev 995 drivers/hid/hid-asus.c hid_info(hdev, "Fixing up %s keyb report descriptor\n", hdev 1013 drivers/hid/hid-asus.c new_rdesc = devm_kzalloc(&hdev->dev, new_size, GFP_KERNEL); hdev 1017 drivers/hid/hid-asus.c hid_info(hdev, "Fixing up Asus G752 keyb report descriptor\n"); hdev 21 drivers/hid/hid-aureal.c static __u8 *aureal_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 25 drivers/hid/hid-aureal.c dev_info(&hdev->dev, "fixing Aureal Cy se W-01RN USB_V3.1 report descriptor.\n"); hdev 127 drivers/hid/hid-axff.c static int ax_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 131 drivers/hid/hid-axff.c dev_dbg(&hdev->dev, "ACRUX HID hardware probe...\n"); hdev 133 drivers/hid/hid-axff.c error = hid_parse(hdev); hdev 135 drivers/hid/hid-axff.c hid_err(hdev, "parse failed\n"); hdev 139 drivers/hid/hid-axff.c error = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); hdev 141 drivers/hid/hid-axff.c hid_err(hdev, "hw start failed\n"); hdev 145 drivers/hid/hid-axff.c error = axff_init(hdev); hdev 151 drivers/hid/hid-axff.c hid_warn(hdev, hdev 160 drivers/hid/hid-axff.c error = hid_hw_open(hdev); hdev 162 drivers/hid/hid-axff.c dev_err(&hdev->dev, "hw open failed\n"); hdev 163 drivers/hid/hid-axff.c hid_hw_stop(hdev); hdev 170 drivers/hid/hid-axff.c static void ax_remove(struct hid_device *hdev) hdev 172 drivers/hid/hid-axff.c hid_hw_close(hdev); hdev 173 drivers/hid/hid-axff.c hid_hw_stop(hdev); hdev 26 drivers/hid/hid-belkin.c static int belkin_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 30 drivers/hid/hid-belkin.c unsigned long quirks = (unsigned long)hid_get_drvdata(hdev); hdev 46 drivers/hid/hid-belkin.c static int belkin_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 51 drivers/hid/hid-belkin.c hid_set_drvdata(hdev, (void *)quirks); hdev 53 drivers/hid/hid-belkin.c ret = hid_parse(hdev); hdev 55 drivers/hid/hid-belkin.c hid_err(hdev, "parse failed\n"); hdev 59 drivers/hid/hid-belkin.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT | hdev 62 drivers/hid/hid-belkin.c hid_err(hdev, "hw start failed\n"); hdev 115 drivers/hid/hid-betopff.c static int betop_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 120 drivers/hid/hid-betopff.c hdev->quirks |= HID_QUIRK_MULTI_INPUT; hdev 122 drivers/hid/hid-betopff.c ret = hid_parse(hdev); hdev 124 drivers/hid/hid-betopff.c hid_err(hdev, "parse failed\n"); hdev 128 drivers/hid/hid-betopff.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); hdev 130 drivers/hid/hid-betopff.c hid_err(hdev, "hw start failed\n"); hdev 134 drivers/hid/hid-betopff.c betopff_init(hdev); hdev 25 drivers/hid/hid-cherry.c static __u8 *ch_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 29 drivers/hid/hid-cherry.c hid_info(hdev, "fixing up Cherry Cymotion report descriptor\n"); hdev 38 drivers/hid/hid-cherry.c static int ch_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 26 drivers/hid/hid-chicony.c static int ch_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 58 drivers/hid/hid-chicony.c static __u8 *ch_switch12_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 61 drivers/hid/hid-chicony.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 66 drivers/hid/hid-chicony.c switch (hdev->product) { hdev 70 drivers/hid/hid-chicony.c hid_info(hdev, "Fixing up report descriptor\n"); hdev 1840 drivers/hid/hid-core.c bool hid_match_one_id(const struct hid_device *hdev, hdev 1843 drivers/hid/hid-core.c return (id->bus == HID_BUS_ANY || id->bus == hdev->bus) && hdev 1844 drivers/hid/hid-core.c (id->group == HID_GROUP_ANY || id->group == hdev->group) && hdev 1845 drivers/hid/hid-core.c (id->vendor == HID_ANY_ID || id->vendor == hdev->vendor) && hdev 1846 drivers/hid/hid-core.c (id->product == HID_ANY_ID || id->product == hdev->product); hdev 1849 drivers/hid/hid-core.c const struct hid_device_id *hid_match_id(const struct hid_device *hdev, hdev 1853 drivers/hid/hid-core.c if (hid_match_one_id(hdev, id)) hdev 1865 drivers/hid/hid-core.c static bool hid_hiddev(struct hid_device *hdev) hdev 1867 drivers/hid/hid-core.c return !!hid_match_id(hdev, hid_hiddev_list); hdev 1877 drivers/hid/hid-core.c struct hid_device *hdev = to_hid_device(dev); hdev 1879 drivers/hid/hid-core.c if (off >= hdev->rsize) hdev 1882 drivers/hid/hid-core.c if (off + count > hdev->rsize) hdev 1883 drivers/hid/hid-core.c count = hdev->rsize - off; hdev 1885 drivers/hid/hid-core.c memcpy(buf, hdev->rdesc + off, count); hdev 1894 drivers/hid/hid-core.c struct hid_device *hdev = to_hid_device(dev); hdev 1896 drivers/hid/hid-core.c return sprintf(buf, "%02x\n", hdev->country & 0xff); hdev 1910 drivers/hid/hid-core.c int hid_connect(struct hid_device *hdev, unsigned int connect_mask) hdev 1922 drivers/hid/hid-core.c if (hdev->quirks & HID_QUIRK_HIDDEV_FORCE) hdev 1924 drivers/hid/hid-core.c if (hdev->quirks & HID_QUIRK_HIDINPUT_FORCE) hdev 1926 drivers/hid/hid-core.c if (hdev->bus != BUS_USB) hdev 1928 drivers/hid/hid-core.c if (hid_hiddev(hdev)) hdev 1931 drivers/hid/hid-core.c if ((connect_mask & HID_CONNECT_HIDINPUT) && !hidinput_connect(hdev, hdev 1933 drivers/hid/hid-core.c hdev->claimed |= HID_CLAIMED_INPUT; hdev 1935 drivers/hid/hid-core.c if ((connect_mask & HID_CONNECT_HIDDEV) && hdev->hiddev_connect && hdev 1936 drivers/hid/hid-core.c !hdev->hiddev_connect(hdev, hdev 1938 drivers/hid/hid-core.c hdev->claimed |= HID_CLAIMED_HIDDEV; hdev 1939 drivers/hid/hid-core.c if ((connect_mask & HID_CONNECT_HIDRAW) && !hidraw_connect(hdev)) hdev 1940 drivers/hid/hid-core.c hdev->claimed |= HID_CLAIMED_HIDRAW; hdev 1943 drivers/hid/hid-core.c hdev->claimed |= HID_CLAIMED_DRIVER; hdev 1947 drivers/hid/hid-core.c if (!hdev->claimed && !hdev->driver->raw_event) { hdev 1948 drivers/hid/hid-core.c hid_err(hdev, "device has no listeners, quitting\n"); hdev 1952 drivers/hid/hid-core.c if ((hdev->claimed & HID_CLAIMED_INPUT) && hdev 1953 drivers/hid/hid-core.c (connect_mask & HID_CONNECT_FF) && hdev->ff_init) hdev 1954 drivers/hid/hid-core.c hdev->ff_init(hdev); hdev 1957 drivers/hid/hid-core.c if (hdev->claimed & HID_CLAIMED_INPUT) hdev 1959 drivers/hid/hid-core.c if (hdev->claimed & HID_CLAIMED_HIDDEV) hdev 1961 drivers/hid/hid-core.c ((struct hiddev *)hdev->hiddev)->minor); hdev 1962 drivers/hid/hid-core.c if (hdev->claimed & HID_CLAIMED_HIDRAW) hdev 1964 drivers/hid/hid-core.c ((struct hidraw *)hdev->hidraw)->minor); hdev 1967 drivers/hid/hid-core.c for (i = 0; i < hdev->maxcollection; i++) { hdev 1968 drivers/hid/hid-core.c struct hid_collection *col = &hdev->collection[i]; hdev 1977 drivers/hid/hid-core.c switch (hdev->bus) { hdev 1991 drivers/hid/hid-core.c ret = device_create_file(&hdev->dev, &dev_attr_country); hdev 1993 drivers/hid/hid-core.c hid_warn(hdev, hdev 1996 drivers/hid/hid-core.c hid_info(hdev, "%s: %s HID v%x.%02x %s [%s] on %s\n", hdev 1997 drivers/hid/hid-core.c buf, bus, hdev->version >> 8, hdev->version & 0xff, hdev 1998 drivers/hid/hid-core.c type, hdev->name, hdev->phys); hdev 2004 drivers/hid/hid-core.c void hid_disconnect(struct hid_device *hdev) hdev 2006 drivers/hid/hid-core.c device_remove_file(&hdev->dev, &dev_attr_country); hdev 2007 drivers/hid/hid-core.c if (hdev->claimed & HID_CLAIMED_INPUT) hdev 2008 drivers/hid/hid-core.c hidinput_disconnect(hdev); hdev 2009 drivers/hid/hid-core.c if (hdev->claimed & HID_CLAIMED_HIDDEV) hdev 2010 drivers/hid/hid-core.c hdev->hiddev_disconnect(hdev); hdev 2011 drivers/hid/hid-core.c if (hdev->claimed & HID_CLAIMED_HIDRAW) hdev 2012 drivers/hid/hid-core.c hidraw_disconnect(hdev); hdev 2013 drivers/hid/hid-core.c hdev->claimed = 0; hdev 2026 drivers/hid/hid-core.c int hid_hw_start(struct hid_device *hdev, unsigned int connect_mask) hdev 2030 drivers/hid/hid-core.c error = hdev->ll_driver->start(hdev); hdev 2035 drivers/hid/hid-core.c error = hid_connect(hdev, connect_mask); hdev 2037 drivers/hid/hid-core.c hdev->ll_driver->stop(hdev); hdev 2053 drivers/hid/hid-core.c void hid_hw_stop(struct hid_device *hdev) hdev 2055 drivers/hid/hid-core.c hid_disconnect(hdev); hdev 2056 drivers/hid/hid-core.c hdev->ll_driver->stop(hdev); hdev 2068 drivers/hid/hid-core.c int hid_hw_open(struct hid_device *hdev) hdev 2072 drivers/hid/hid-core.c ret = mutex_lock_killable(&hdev->ll_open_lock); hdev 2076 drivers/hid/hid-core.c if (!hdev->ll_open_count++) { hdev 2077 drivers/hid/hid-core.c ret = hdev->ll_driver->open(hdev); hdev 2079 drivers/hid/hid-core.c hdev->ll_open_count--; hdev 2082 drivers/hid/hid-core.c mutex_unlock(&hdev->ll_open_lock); hdev 2096 drivers/hid/hid-core.c void hid_hw_close(struct hid_device *hdev) hdev 2098 drivers/hid/hid-core.c mutex_lock(&hdev->ll_open_lock); hdev 2099 drivers/hid/hid-core.c if (!--hdev->ll_open_count) hdev 2100 drivers/hid/hid-core.c hdev->ll_driver->close(hdev); hdev 2101 drivers/hid/hid-core.c mutex_unlock(&hdev->ll_open_lock); hdev 2171 drivers/hid/hid-core.c const struct hid_device_id *hid_match_device(struct hid_device *hdev, hdev 2178 drivers/hid/hid-core.c if (hid_match_one_id(hdev, &dynid->id)) { hdev 2185 drivers/hid/hid-core.c return hid_match_id(hdev, hdrv->id_table); hdev 2192 drivers/hid/hid-core.c struct hid_device *hdev = to_hid_device(dev); hdev 2194 drivers/hid/hid-core.c return hid_match_device(hdev, hdrv) != NULL; hdev 2223 drivers/hid/hid-core.c struct hid_device *hdev = to_hid_device(dev); hdev 2227 drivers/hid/hid-core.c if (down_interruptible(&hdev->driver_input_lock)) { hdev 2231 drivers/hid/hid-core.c hdev->io_started = false; hdev 2233 drivers/hid/hid-core.c clear_bit(ffs(HID_STAT_REPROBED), &hdev->status); hdev 2235 drivers/hid/hid-core.c if (!hdev->driver) { hdev 2236 drivers/hid/hid-core.c id = hid_match_device(hdev, hdrv); hdev 2243 drivers/hid/hid-core.c if (!hdrv->match(hdev, hid_ignore_special_drivers)) { hdev 2260 drivers/hid/hid-core.c hdev->quirks = hid_lookup_quirk(hdev); hdev 2261 drivers/hid/hid-core.c hdev->driver = hdrv; hdev 2263 drivers/hid/hid-core.c ret = hdrv->probe(hdev, id); hdev 2265 drivers/hid/hid-core.c ret = hid_open_report(hdev); hdev 2267 drivers/hid/hid-core.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 2270 drivers/hid/hid-core.c hid_close_report(hdev); hdev 2271 drivers/hid/hid-core.c hdev->driver = NULL; hdev 2275 drivers/hid/hid-core.c if (!hdev->io_started) hdev 2276 drivers/hid/hid-core.c up(&hdev->driver_input_lock); hdev 2283 drivers/hid/hid-core.c struct hid_device *hdev = to_hid_device(dev); hdev 2287 drivers/hid/hid-core.c if (down_interruptible(&hdev->driver_input_lock)) { hdev 2291 drivers/hid/hid-core.c hdev->io_started = false; hdev 2293 drivers/hid/hid-core.c hdrv = hdev->driver; hdev 2296 drivers/hid/hid-core.c hdrv->remove(hdev); hdev 2298 drivers/hid/hid-core.c hid_hw_stop(hdev); hdev 2299 drivers/hid/hid-core.c hid_close_report(hdev); hdev 2300 drivers/hid/hid-core.c hdev->driver = NULL; hdev 2303 drivers/hid/hid-core.c if (!hdev->io_started) hdev 2304 drivers/hid/hid-core.c up(&hdev->driver_input_lock); hdev 2312 drivers/hid/hid-core.c struct hid_device *hdev = container_of(dev, struct hid_device, dev); hdev 2315 drivers/hid/hid-core.c hdev->bus, hdev->group, hdev->vendor, hdev->product); hdev 2335 drivers/hid/hid-core.c struct hid_device *hdev = to_hid_device(dev); hdev 2338 drivers/hid/hid-core.c hdev->bus, hdev->vendor, hdev->product)) hdev 2341 drivers/hid/hid-core.c if (add_uevent_var(env, "HID_NAME=%s", hdev->name)) hdev 2344 drivers/hid/hid-core.c if (add_uevent_var(env, "HID_PHYS=%s", hdev->phys)) hdev 2347 drivers/hid/hid-core.c if (add_uevent_var(env, "HID_UNIQ=%s", hdev->uniq)) hdev 2351 drivers/hid/hid-core.c hdev->bus, hdev->group, hdev->vendor, hdev->product)) hdev 2368 drivers/hid/hid-core.c int hid_add_device(struct hid_device *hdev) hdev 2373 drivers/hid/hid-core.c if (WARN_ON(hdev->status & HID_STAT_ADDED)) hdev 2376 drivers/hid/hid-core.c hdev->quirks = hid_lookup_quirk(hdev); hdev 2380 drivers/hid/hid-core.c if (hid_ignore(hdev)) hdev 2386 drivers/hid/hid-core.c if (!hdev->ll_driver->raw_request) { hdev 2387 drivers/hid/hid-core.c hid_err(hdev, "transport driver missing .raw_request()\n"); hdev 2395 drivers/hid/hid-core.c ret = hdev->ll_driver->parse(hdev); hdev 2398 drivers/hid/hid-core.c if (!hdev->dev_rdesc) hdev 2405 drivers/hid/hid-core.c hdev->group = HID_GROUP_GENERIC; hdev 2406 drivers/hid/hid-core.c } else if (!hdev->group && hdev 2407 drivers/hid/hid-core.c !(hdev->quirks & HID_QUIRK_HAVE_SPECIAL_DRIVER)) { hdev 2408 drivers/hid/hid-core.c ret = hid_scan_report(hdev); hdev 2410 drivers/hid/hid-core.c hid_warn(hdev, "bad device descriptor (%d)\n", ret); hdev 2415 drivers/hid/hid-core.c dev_set_name(&hdev->dev, "%04X:%04X:%04X.%04X", hdev->bus, hdev 2416 drivers/hid/hid-core.c hdev->vendor, hdev->product, atomic_inc_return(&id)); hdev 2418 drivers/hid/hid-core.c hid_debug_register(hdev, dev_name(&hdev->dev)); hdev 2419 drivers/hid/hid-core.c ret = device_add(&hdev->dev); hdev 2421 drivers/hid/hid-core.c hdev->status |= HID_STAT_ADDED; hdev 2423 drivers/hid/hid-core.c hid_debug_unregister(hdev); hdev 2440 drivers/hid/hid-core.c struct hid_device *hdev; hdev 2443 drivers/hid/hid-core.c hdev = kzalloc(sizeof(*hdev), GFP_KERNEL); hdev 2444 drivers/hid/hid-core.c if (hdev == NULL) hdev 2447 drivers/hid/hid-core.c device_initialize(&hdev->dev); hdev 2448 drivers/hid/hid-core.c hdev->dev.release = hid_device_release; hdev 2449 drivers/hid/hid-core.c hdev->dev.bus = &hid_bus_type; hdev 2450 drivers/hid/hid-core.c device_enable_async_suspend(&hdev->dev); hdev 2452 drivers/hid/hid-core.c hid_close_report(hdev); hdev 2454 drivers/hid/hid-core.c init_waitqueue_head(&hdev->debug_wait); hdev 2455 drivers/hid/hid-core.c INIT_LIST_HEAD(&hdev->debug_list); hdev 2456 drivers/hid/hid-core.c spin_lock_init(&hdev->debug_list_lock); hdev 2457 drivers/hid/hid-core.c sema_init(&hdev->driver_input_lock, 1); hdev 2458 drivers/hid/hid-core.c mutex_init(&hdev->ll_open_lock); hdev 2460 drivers/hid/hid-core.c return hdev; hdev 2464 drivers/hid/hid-core.c static void hid_remove_device(struct hid_device *hdev) hdev 2466 drivers/hid/hid-core.c if (hdev->status & HID_STAT_ADDED) { hdev 2467 drivers/hid/hid-core.c device_del(&hdev->dev); hdev 2468 drivers/hid/hid-core.c hid_debug_unregister(hdev); hdev 2469 drivers/hid/hid-core.c hdev->status &= ~HID_STAT_ADDED; hdev 2471 drivers/hid/hid-core.c kfree(hdev->dev_rdesc); hdev 2472 drivers/hid/hid-core.c hdev->dev_rdesc = NULL; hdev 2473 drivers/hid/hid-core.c hdev->dev_rsize = 0; hdev 2484 drivers/hid/hid-core.c void hid_destroy_device(struct hid_device *hdev) hdev 2486 drivers/hid/hid-core.c hid_remove_device(hdev); hdev 2487 drivers/hid/hid-core.c put_device(&hdev->dev); hdev 2495 drivers/hid/hid-core.c struct hid_device *hdev = to_hid_device(dev); hdev 2497 drivers/hid/hid-core.c if (hdev->driver == hdrv && hdev 2498 drivers/hid/hid-core.c !hdrv->match(hdev, hid_ignore_special_drivers) && hdev 2499 drivers/hid/hid-core.c !test_and_set_bit(ffs(HID_STAT_REPROBED), &hdev->status)) hdev 688 drivers/hid/hid-corsair.c static __u8 *corsair_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 691 drivers/hid/hid-corsair.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 701 drivers/hid/hid-corsair.c switch (hdev->product) { hdev 706 drivers/hid/hid-corsair.c hid_info(hdev, "Fixing up report descriptor\n"); hdev 106 drivers/hid/hid-cougar.c static __u8 *cougar_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 111 drivers/hid/hid-cougar.c hid_info(hdev, hdev 119 drivers/hid/hid-cougar.c static struct cougar_shared *cougar_get_shared_data(struct hid_device *hdev) hdev 125 drivers/hid/hid-cougar.c if (hid_compare_device_paths(hdev, shared->dev, '/')) { hdev 159 drivers/hid/hid-cougar.c static int cougar_bind_shared_data(struct hid_device *hdev, hdev 167 drivers/hid/hid-cougar.c shared = cougar_get_shared_data(hdev); hdev 176 drivers/hid/hid-cougar.c shared->dev = hdev; hdev 182 drivers/hid/hid-cougar.c error = devm_add_action(&hdev->dev, cougar_remove_shared_data, cougar); hdev 194 drivers/hid/hid-cougar.c static int cougar_probe(struct hid_device *hdev, hdev 202 drivers/hid/hid-cougar.c cougar = devm_kzalloc(&hdev->dev, sizeof(*cougar), GFP_KERNEL); hdev 205 drivers/hid/hid-cougar.c hid_set_drvdata(hdev, cougar); hdev 207 drivers/hid/hid-cougar.c error = hid_parse(hdev); hdev 209 drivers/hid/hid-cougar.c hid_err(hdev, "parse failed\n"); hdev 213 drivers/hid/hid-cougar.c if (hdev->collection->usage == COUGAR_VENDOR_USAGE) { hdev 219 drivers/hid/hid-cougar.c error = hid_hw_start(hdev, connect_mask); hdev 221 drivers/hid/hid-cougar.c hid_err(hdev, "hw start failed\n"); hdev 225 drivers/hid/hid-cougar.c error = cougar_bind_shared_data(hdev, cougar); hdev 233 drivers/hid/hid-cougar.c if (hdev->collection->usage == HID_GD_KEYBOARD) { hdev 234 drivers/hid/hid-cougar.c list_for_each_entry_safe(hidinput, next, &hdev->inputs, list) { hdev 241 drivers/hid/hid-cougar.c } else if (hdev->collection->usage == COUGAR_VENDOR_USAGE) { hdev 244 drivers/hid/hid-cougar.c error = hid_hw_open(hdev); hdev 251 drivers/hid/hid-cougar.c hid_hw_stop(hdev); hdev 258 drivers/hid/hid-cougar.c static int cougar_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 266 drivers/hid/hid-cougar.c cougar = hid_get_drvdata(hdev); hdev 286 drivers/hid/hid-cougar.c hid_warn(hdev, "unmapped special key code %0x: ignoring\n", code); hdev 290 drivers/hid/hid-cougar.c static void cougar_remove(struct hid_device *hdev) hdev 292 drivers/hid/hid-cougar.c struct cougar *cougar = hid_get_drvdata(hdev); hdev 299 drivers/hid/hid-cougar.c hid_hw_close(hdev); hdev 301 drivers/hid/hid-cougar.c hid_hw_stop(hdev); hdev 155 drivers/hid/hid-cp2112.c struct hid_device *hdev; hdev 181 drivers/hid/hid-cp2112.c struct hid_device *hdev = dev->hdev; hdev 187 drivers/hid/hid-cp2112.c ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, hdev 191 drivers/hid/hid-cp2112.c hid_err(hdev, "error requesting GPIO config: %d\n", ret); hdev 200 drivers/hid/hid-cp2112.c ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, hdev 204 drivers/hid/hid-cp2112.c hid_err(hdev, "error setting GPIO config: %d\n", ret); hdev 220 drivers/hid/hid-cp2112.c struct hid_device *hdev = dev->hdev; hdev 230 drivers/hid/hid-cp2112.c ret = hid_hw_raw_request(hdev, CP2112_GPIO_SET, buf, hdev 234 drivers/hid/hid-cp2112.c hid_err(hdev, "error setting GPIO values: %d\n", ret); hdev 242 drivers/hid/hid-cp2112.c struct hid_device *hdev = dev->hdev; hdev 248 drivers/hid/hid-cp2112.c ret = hid_hw_raw_request(hdev, CP2112_GPIO_GET, buf, hdev 252 drivers/hid/hid-cp2112.c hid_err(hdev, "error requesting GPIO values: %d\n", ret); hdev 280 drivers/hid/hid-cp2112.c struct hid_device *hdev = dev->hdev; hdev 286 drivers/hid/hid-cp2112.c ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, hdev 290 drivers/hid/hid-cp2112.c hid_err(hdev, "error requesting GPIO config: %d\n", ret); hdev 297 drivers/hid/hid-cp2112.c ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, hdev 301 drivers/hid/hid-cp2112.c hid_err(hdev, "error setting GPIO config: %d\n", ret); hdev 320 drivers/hid/hid-cp2112.c static int cp2112_hid_get(struct hid_device *hdev, unsigned char report_number, hdev 330 drivers/hid/hid-cp2112.c ret = hid_hw_raw_request(hdev, report_number, buf, count, hdev 337 drivers/hid/hid-cp2112.c static int cp2112_hid_output(struct hid_device *hdev, u8 *data, size_t count, hdev 348 drivers/hid/hid-cp2112.c ret = hid_hw_output_report(hdev, buf, count); hdev 350 drivers/hid/hid-cp2112.c ret = hid_hw_raw_request(hdev, buf[0], buf, count, report_type, hdev 382 drivers/hid/hid-cp2112.c struct hid_device *hdev = dev->hdev; hdev 390 drivers/hid/hid-cp2112.c ret = cp2112_hid_output(hdev, buf, 2, HID_OUTPUT_REPORT); hdev 392 drivers/hid/hid-cp2112.c hid_warn(hdev, "Error requesting status: %d\n", ret); hdev 405 drivers/hid/hid-cp2112.c struct hid_device *hdev = dev->hdev; hdev 416 drivers/hid/hid-cp2112.c ret = cp2112_hid_output(hdev, &report.report, sizeof(report), hdev 419 drivers/hid/hid-cp2112.c hid_warn(hdev, "Error requesting data: %d\n", ret); hdev 427 drivers/hid/hid-cp2112.c hid_dbg(hdev, "read %d of %zd bytes requested\n", hdev 521 drivers/hid/hid-cp2112.c struct hid_device *hdev = dev->hdev; hdev 529 drivers/hid/hid-cp2112.c hid_dbg(hdev, "I2C %d messages\n", num); hdev 533 drivers/hid/hid-cp2112.c hid_dbg(hdev, "I2C read %#04x len %d\n", hdev 539 drivers/hid/hid-cp2112.c hid_dbg(hdev, "I2C write %#04x len %d\n", hdev 550 drivers/hid/hid-cp2112.c hid_dbg(hdev, "I2C write-read %#04x wlen %d rlen %d\n", hdev 559 drivers/hid/hid-cp2112.c hid_err(hdev, hdev 564 drivers/hid/hid-cp2112.c ret = hid_hw_power(hdev, PM_HINT_FULLON); hdev 566 drivers/hid/hid-cp2112.c hid_err(hdev, "power management error: %d\n", ret); hdev 570 drivers/hid/hid-cp2112.c ret = cp2112_hid_output(hdev, buf, count, HID_OUTPUT_REPORT); hdev 572 drivers/hid/hid-cp2112.c hid_warn(hdev, "Error starting transaction: %d\n", ret); hdev 586 drivers/hid/hid-cp2112.c hid_warn(hdev, "Transfer timed out, cancelling.\n"); hdev 590 drivers/hid/hid-cp2112.c ret = cp2112_hid_output(hdev, buf, 2, HID_OUTPUT_REPORT); hdev 592 drivers/hid/hid-cp2112.c hid_warn(hdev, "Error cancelling transaction: %d\n", hdev 604 drivers/hid/hid-cp2112.c hid_err(hdev, "read returned 0\n"); hdev 618 drivers/hid/hid-cp2112.c hid_err(hdev, "long read: %d > %zd\n", hdev 629 drivers/hid/hid-cp2112.c hid_hw_power(hdev, PM_HINT_NORMAL); hdev 630 drivers/hid/hid-cp2112.c hid_dbg(hdev, "I2C transfer finished: %d\n", ret); hdev 639 drivers/hid/hid-cp2112.c struct hid_device *hdev = dev->hdev; hdev 647 drivers/hid/hid-cp2112.c hid_dbg(hdev, "%s addr 0x%x flags 0x%x cmd 0x%x size %d\n", hdev 722 drivers/hid/hid-cp2112.c hid_warn(hdev, "Unsupported transaction %d\n", size); hdev 729 drivers/hid/hid-cp2112.c ret = hid_hw_power(hdev, PM_HINT_FULLON); hdev 731 drivers/hid/hid-cp2112.c hid_err(hdev, "power management error: %d\n", ret); hdev 735 drivers/hid/hid-cp2112.c ret = cp2112_hid_output(hdev, buf, count, HID_OUTPUT_REPORT); hdev 737 drivers/hid/hid-cp2112.c hid_warn(hdev, "Error starting transaction: %d\n", ret); hdev 751 drivers/hid/hid-cp2112.c hid_warn(hdev, "Transfer timed out, cancelling.\n"); hdev 755 drivers/hid/hid-cp2112.c ret = cp2112_hid_output(hdev, buf, 2, HID_OUTPUT_REPORT); hdev 757 drivers/hid/hid-cp2112.c hid_warn(hdev, "Error cancelling transaction: %d\n", hdev 776 drivers/hid/hid-cp2112.c hid_warn(hdev, "short read: %d < %zd\n", ret, read_length); hdev 804 drivers/hid/hid-cp2112.c hid_hw_power(hdev, PM_HINT_NORMAL); hdev 805 drivers/hid/hid-cp2112.c hid_dbg(hdev, "transfer finished: %d\n", ret); hdev 827 drivers/hid/hid-cp2112.c static int cp2112_get_usb_config(struct hid_device *hdev, hdev 832 drivers/hid/hid-cp2112.c ret = cp2112_hid_get(hdev, CP2112_USB_CONFIG, (u8 *)cfg, sizeof(*cfg), hdev 835 drivers/hid/hid-cp2112.c hid_err(hdev, "error reading usb config: %d\n", ret); hdev 844 drivers/hid/hid-cp2112.c static int cp2112_set_usb_config(struct hid_device *hdev, hdev 851 drivers/hid/hid-cp2112.c ret = cp2112_hid_output(hdev, (u8 *)cfg, sizeof(*cfg), hdev 854 drivers/hid/hid-cp2112.c hid_err(hdev, "error writing usb config: %d\n", ret); hdev 863 drivers/hid/hid-cp2112.c static void chmod_sysfs_attrs(struct hid_device *hdev); hdev 870 drivers/hid/hid-cp2112.c struct hid_device *hdev = to_hid_device(kdev); \ hdev 872 drivers/hid/hid-cp2112.c int ret = cp2112_get_usb_config(hdev, &cfg); \ hdev 876 drivers/hid/hid-cp2112.c ret = cp2112_set_usb_config(hdev, &cfg); \ hdev 879 drivers/hid/hid-cp2112.c chmod_sysfs_attrs(hdev); \ hdev 885 drivers/hid/hid-cp2112.c struct hid_device *hdev = to_hid_device(kdev); \ hdev 887 drivers/hid/hid-cp2112.c int ret = cp2112_get_usb_config(hdev, &cfg); \ hdev 950 drivers/hid/hid-cp2112.c struct hid_device *hdev = to_hid_device(kdev); hdev 964 drivers/hid/hid-cp2112.c ret = cp2112_hid_output(hdev, &report.report, report.length + 1, hdev 967 drivers/hid/hid-cp2112.c hid_err(hdev, "error writing %s string: %d\n", kattr->attr.name, hdev 974 drivers/hid/hid-cp2112.c chmod_sysfs_attrs(hdev); hdev 981 drivers/hid/hid-cp2112.c struct hid_device *hdev = to_hid_device(kdev); hdev 988 drivers/hid/hid-cp2112.c ret = cp2112_hid_get(hdev, attr->report, &report.report, hdev 991 drivers/hid/hid-cp2112.c hid_err(hdev, "error reading %s string: %d\n", kattr->attr.name, hdev 999 drivers/hid/hid-cp2112.c hid_err(hdev, "invalid %s string length: %d\n", hdev 1044 drivers/hid/hid-cp2112.c static void chmod_sysfs_attrs(struct hid_device *hdev) hdev 1050 drivers/hid/hid-cp2112.c ret = cp2112_hid_get(hdev, CP2112_LOCK_BYTE, buf, sizeof(buf), hdev 1053 drivers/hid/hid-cp2112.c hid_err(hdev, "error reading lock byte: %d\n", ret); hdev 1059 drivers/hid/hid-cp2112.c ret = sysfs_chmod_file(&hdev->dev.kobj, *attr, mode); hdev 1061 drivers/hid/hid-cp2112.c hid_err(hdev, "error chmoding sysfs file %s\n", hdev 1233 drivers/hid/hid-cp2112.c static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 1240 drivers/hid/hid-cp2112.c dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL); hdev 1244 drivers/hid/hid-cp2112.c dev->in_out_buffer = devm_kzalloc(&hdev->dev, CP2112_REPORT_MAX_LENGTH, hdev 1251 drivers/hid/hid-cp2112.c ret = hid_parse(hdev); hdev 1253 drivers/hid/hid-cp2112.c hid_err(hdev, "parse failed\n"); hdev 1257 drivers/hid/hid-cp2112.c ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW); hdev 1259 drivers/hid/hid-cp2112.c hid_err(hdev, "hw start failed\n"); hdev 1263 drivers/hid/hid-cp2112.c ret = hid_hw_open(hdev); hdev 1265 drivers/hid/hid-cp2112.c hid_err(hdev, "hw open failed\n"); hdev 1269 drivers/hid/hid-cp2112.c ret = hid_hw_power(hdev, PM_HINT_FULLON); hdev 1271 drivers/hid/hid-cp2112.c hid_err(hdev, "power management error: %d\n", ret); hdev 1275 drivers/hid/hid-cp2112.c ret = cp2112_hid_get(hdev, CP2112_GET_VERSION_INFO, buf, sizeof(buf), hdev 1278 drivers/hid/hid-cp2112.c hid_err(hdev, "error requesting version\n"); hdev 1284 drivers/hid/hid-cp2112.c hid_info(hdev, "Part Number: 0x%02X Device Version: 0x%02X\n", hdev 1287 drivers/hid/hid-cp2112.c ret = cp2112_hid_get(hdev, CP2112_SMBUS_CONFIG, (u8 *)&config, hdev 1290 drivers/hid/hid-cp2112.c hid_err(hdev, "error requesting SMBus config\n"); hdev 1298 drivers/hid/hid-cp2112.c ret = cp2112_hid_output(hdev, (u8 *)&config, sizeof(config), hdev 1301 drivers/hid/hid-cp2112.c hid_err(hdev, "error setting SMBus config\n"); hdev 1307 drivers/hid/hid-cp2112.c hid_set_drvdata(hdev, (void *)dev); hdev 1308 drivers/hid/hid-cp2112.c dev->hdev = hdev; hdev 1313 drivers/hid/hid-cp2112.c dev->adap.dev.parent = &hdev->dev; hdev 1316 drivers/hid/hid-cp2112.c ((struct hidraw *)hdev->hidraw)->minor); hdev 1320 drivers/hid/hid-cp2112.c hid_device_io_start(hdev); hdev 1322 drivers/hid/hid-cp2112.c hid_device_io_stop(hdev); hdev 1325 drivers/hid/hid-cp2112.c hid_err(hdev, "error registering i2c adapter\n"); hdev 1329 drivers/hid/hid-cp2112.c hid_dbg(hdev, "adapter registered\n"); hdev 1339 drivers/hid/hid-cp2112.c dev->gc.parent = &hdev->dev; hdev 1343 drivers/hid/hid-cp2112.c hid_err(hdev, "error registering gpio chip\n"); hdev 1347 drivers/hid/hid-cp2112.c ret = sysfs_create_group(&hdev->dev.kobj, &cp2112_attr_group); hdev 1349 drivers/hid/hid-cp2112.c hid_err(hdev, "error creating sysfs attrs\n"); hdev 1353 drivers/hid/hid-cp2112.c chmod_sysfs_attrs(hdev); hdev 1354 drivers/hid/hid-cp2112.c hid_hw_power(hdev, PM_HINT_NORMAL); hdev 1366 drivers/hid/hid-cp2112.c sysfs_remove_group(&hdev->dev.kobj, &cp2112_attr_group); hdev 1372 drivers/hid/hid-cp2112.c hid_hw_power(hdev, PM_HINT_NORMAL); hdev 1374 drivers/hid/hid-cp2112.c hid_hw_close(hdev); hdev 1376 drivers/hid/hid-cp2112.c hid_hw_stop(hdev); hdev 1380 drivers/hid/hid-cp2112.c static void cp2112_remove(struct hid_device *hdev) hdev 1382 drivers/hid/hid-cp2112.c struct cp2112_device *dev = hid_get_drvdata(hdev); hdev 1385 drivers/hid/hid-cp2112.c sysfs_remove_group(&hdev->dev.kobj, &cp2112_attr_group); hdev 1405 drivers/hid/hid-cp2112.c hid_hw_close(hdev); hdev 1406 drivers/hid/hid-cp2112.c hid_hw_stop(hdev); hdev 1409 drivers/hid/hid-cp2112.c static int cp2112_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 1412 drivers/hid/hid-cp2112.c struct cp2112_device *dev = hid_get_drvdata(hdev); hdev 1417 drivers/hid/hid-cp2112.c hid_dbg(hdev, "xfer status: %02x %02x %04x %04x\n", hdev 1450 drivers/hid/hid-cp2112.c hid_dbg(hdev, "read response: %02x %02x\n", data[1], data[2]); hdev 1460 drivers/hid/hid-cp2112.c hid_err(hdev, "unknown report\n"); hdev 30 drivers/hid/hid-cypress.c static __u8 *cp_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 33 drivers/hid/hid-cypress.c unsigned long quirks = (unsigned long)hid_get_drvdata(hdev); hdev 51 drivers/hid/hid-cypress.c static int cp_input_mapped(struct hid_device *hdev, struct hid_input *hi, hdev 55 drivers/hid/hid-cypress.c unsigned long quirks = (unsigned long)hid_get_drvdata(hdev); hdev 68 drivers/hid/hid-cypress.c static int cp_event(struct hid_device *hdev, struct hid_field *field, hdev 71 drivers/hid/hid-cypress.c unsigned long quirks = (unsigned long)hid_get_drvdata(hdev); hdev 73 drivers/hid/hid-cypress.c if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput || hdev 82 drivers/hid/hid-cypress.c hid_set_drvdata(hdev, (void *)quirks); hdev 96 drivers/hid/hid-cypress.c static int cp_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 101 drivers/hid/hid-cypress.c hid_set_drvdata(hdev, (void *)quirks); hdev 103 drivers/hid/hid-cypress.c ret = hid_parse(hdev); hdev 105 drivers/hid/hid-cypress.c hid_err(hdev, "parse failed\n"); hdev 109 drivers/hid/hid-cypress.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 111 drivers/hid/hid-cypress.c hid_err(hdev, "hw start failed\n"); hdev 651 drivers/hid/hid-debug.c void hid_debug_event(struct hid_device *hdev, char *buf) hdev 656 drivers/hid/hid-debug.c spin_lock_irqsave(&hdev->debug_list_lock, flags); hdev 657 drivers/hid/hid-debug.c list_for_each_entry(list, &hdev->debug_list, node) hdev 659 drivers/hid/hid-debug.c spin_unlock_irqrestore(&hdev->debug_list_lock, flags); hdev 661 drivers/hid/hid-debug.c wake_up_interruptible(&hdev->debug_wait); hdev 695 drivers/hid/hid-debug.c void hid_dump_input(struct hid_device *hdev, struct hid_usage *usage, __s32 value) hdev 706 drivers/hid/hid-debug.c hid_debug_event(hdev, buf); hdev 709 drivers/hid/hid-debug.c wake_up_interruptible(&hdev->debug_wait); hdev 1035 drivers/hid/hid-debug.c struct hid_device *hdev = f->private; hdev 1036 drivers/hid/hid-debug.c const __u8 *rdesc = hdev->rdesc; hdev 1037 drivers/hid/hid-debug.c unsigned rsize = hdev->rsize; hdev 1041 drivers/hid/hid-debug.c rdesc = hdev->dev_rdesc; hdev 1042 drivers/hid/hid-debug.c rsize = hdev->dev_rsize; hdev 1051 drivers/hid/hid-debug.c if (down_interruptible(&hdev->driver_input_lock)) hdev 1054 drivers/hid/hid-debug.c hid_dump_device(hdev, f); hdev 1056 drivers/hid/hid-debug.c hid_dump_input_mapping(hdev, f); hdev 1058 drivers/hid/hid-debug.c up(&hdev->driver_input_lock); hdev 1079 drivers/hid/hid-debug.c list->hdev = (struct hid_device *) inode->i_private; hdev 1083 drivers/hid/hid-debug.c spin_lock_irqsave(&list->hdev->debug_list_lock, flags); hdev 1084 drivers/hid/hid-debug.c list_add_tail(&list->node, &list->hdev->debug_list); hdev 1085 drivers/hid/hid-debug.c spin_unlock_irqrestore(&list->hdev->debug_list_lock, flags); hdev 1100 drivers/hid/hid-debug.c add_wait_queue(&list->hdev->debug_wait, &wait); hdev 1119 drivers/hid/hid-debug.c if (!list->hdev || !list->hdev->debug) { hdev 1133 drivers/hid/hid-debug.c remove_wait_queue(&list->hdev->debug_wait, &wait); hdev 1155 drivers/hid/hid-debug.c poll_wait(file, &list->hdev->debug_wait, wait); hdev 1158 drivers/hid/hid-debug.c if (!list->hdev->debug) hdev 1168 drivers/hid/hid-debug.c spin_lock_irqsave(&list->hdev->debug_list_lock, flags); hdev 1170 drivers/hid/hid-debug.c spin_unlock_irqrestore(&list->hdev->debug_list_lock, flags); hdev 1189 drivers/hid/hid-debug.c void hid_debug_register(struct hid_device *hdev, const char *name) hdev 1191 drivers/hid/hid-debug.c hdev->debug_dir = debugfs_create_dir(name, hid_debug_root); hdev 1192 drivers/hid/hid-debug.c hdev->debug_rdesc = debugfs_create_file("rdesc", 0400, hdev 1193 drivers/hid/hid-debug.c hdev->debug_dir, hdev, &hid_debug_rdesc_fops); hdev 1194 drivers/hid/hid-debug.c hdev->debug_events = debugfs_create_file("events", 0400, hdev 1195 drivers/hid/hid-debug.c hdev->debug_dir, hdev, &hid_debug_events_fops); hdev 1196 drivers/hid/hid-debug.c hdev->debug = 1; hdev 1199 drivers/hid/hid-debug.c void hid_debug_unregister(struct hid_device *hdev) hdev 1201 drivers/hid/hid-debug.c hdev->debug = 0; hdev 1202 drivers/hid/hid-debug.c wake_up_interruptible(&hdev->debug_wait); hdev 1203 drivers/hid/hid-debug.c debugfs_remove(hdev->debug_rdesc); hdev 1204 drivers/hid/hid-debug.c debugfs_remove(hdev->debug_events); hdev 1205 drivers/hid/hid-debug.c debugfs_remove(hdev->debug_dir); hdev 231 drivers/hid/hid-dr.c static __u8 *dr_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 234 drivers/hid/hid-dr.c switch (hdev->product) { hdev 248 drivers/hid/hid-dr.c static int dr_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 269 drivers/hid/hid-dr.c static int dr_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 273 drivers/hid/hid-dr.c dev_dbg(&hdev->dev, "DragonRise Inc. HID hardware probe..."); hdev 275 drivers/hid/hid-dr.c ret = hid_parse(hdev); hdev 277 drivers/hid/hid-dr.c hid_err(hdev, "parse failed\n"); hdev 281 drivers/hid/hid-dr.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); hdev 283 drivers/hid/hid-dr.c hid_err(hdev, "hw start failed\n"); hdev 287 drivers/hid/hid-dr.c switch (hdev->product) { hdev 289 drivers/hid/hid-dr.c ret = drff_init(hdev); hdev 291 drivers/hid/hid-dr.c dev_err(&hdev->dev, "force feedback init failed\n"); hdev 292 drivers/hid/hid-dr.c hid_hw_stop(hdev); hdev 51 drivers/hid/hid-elan.c static int is_not_elan_touchpad(struct hid_device *hdev) hdev 53 drivers/hid/hid-elan.c if (hdev->bus == BUS_USB) { hdev 54 drivers/hid/hid-elan.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 63 drivers/hid/hid-elan.c static int elan_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 67 drivers/hid/hid-elan.c if (is_not_elan_touchpad(hdev)) hdev 79 drivers/hid/hid-elan.c static int elan_get_device_param(struct hid_device *hdev, hdev 90 drivers/hid/hid-elan.c ret = hid_hw_raw_request(hdev, ELAN_FEATURE_REPORT, dmabuf, hdev 94 drivers/hid/hid-elan.c hid_err(hdev, "Set report error for parm %d: %d\n", param, ret); hdev 98 drivers/hid/hid-elan.c ret = hid_hw_raw_request(hdev, ELAN_FEATURE_REPORT, dmabuf, hdev 102 drivers/hid/hid-elan.c hid_err(hdev, "Get report error for parm %d: %d\n", param, ret); hdev 118 drivers/hid/hid-elan.c static int elan_get_device_params(struct hid_device *hdev) hdev 120 drivers/hid/hid-elan.c struct elan_drvdata *drvdata = hid_get_drvdata(hdev); hdev 128 drivers/hid/hid-elan.c ret = elan_get_device_param(hdev, dmabuf, ELAN_PARAM_MAX_X); hdev 134 drivers/hid/hid-elan.c ret = elan_get_device_param(hdev, dmabuf, ELAN_PARAM_MAX_Y); hdev 140 drivers/hid/hid-elan.c ret = elan_get_device_param(hdev, dmabuf, ELAN_PARAM_RES); hdev 152 drivers/hid/hid-elan.c static int elan_input_configured(struct hid_device *hdev, struct hid_input *hi) hdev 156 drivers/hid/hid-elan.c struct elan_drvdata *drvdata = hid_get_drvdata(hdev); hdev 158 drivers/hid/hid-elan.c if (is_not_elan_touchpad(hdev)) hdev 161 drivers/hid/hid-elan.c ret = elan_get_device_params(hdev); hdev 165 drivers/hid/hid-elan.c input = devm_input_allocate_device(&hdev->dev); hdev 170 drivers/hid/hid-elan.c input->phys = hdev->phys; hdev 171 drivers/hid/hid-elan.c input->uniq = hdev->uniq; hdev 172 drivers/hid/hid-elan.c input->id.bustype = hdev->bus; hdev 173 drivers/hid/hid-elan.c input->id.vendor = hdev->vendor; hdev 174 drivers/hid/hid-elan.c input->id.product = hdev->product; hdev 175 drivers/hid/hid-elan.c input->id.version = hdev->version; hdev 176 drivers/hid/hid-elan.c input->dev.parent = &hdev->dev; hdev 190 drivers/hid/hid-elan.c hid_err(hdev, "Failed to init elan MT slots: %d\n", ret); hdev 199 drivers/hid/hid-elan.c hid_err(hdev, "Failed to register elan input device: %d\n", hdev 359 drivers/hid/hid-elan.c static int elan_raw_event(struct hid_device *hdev, hdev 362 drivers/hid/hid-elan.c struct elan_drvdata *drvdata = hid_get_drvdata(hdev); hdev 364 drivers/hid/hid-elan.c if (is_not_elan_touchpad(hdev)) hdev 384 drivers/hid/hid-elan.c static int elan_start_multitouch(struct hid_device *hdev) hdev 398 drivers/hid/hid-elan.c ret = hid_hw_raw_request(hdev, dmabuf[0], dmabuf, sizeof(buf), hdev 404 drivers/hid/hid-elan.c hid_err(hdev, "Failed to start multitouch: %d\n", ret); hdev 414 drivers/hid/hid-elan.c struct hid_device *hdev = to_hid_device(dev); hdev 415 drivers/hid/hid-elan.c struct elan_drvdata *drvdata = hid_get_drvdata(hdev); hdev 426 drivers/hid/hid-elan.c struct hid_device *hdev = to_hid_device(dev); hdev 427 drivers/hid/hid-elan.c struct elan_drvdata *drvdata = hid_get_drvdata(hdev); hdev 440 drivers/hid/hid-elan.c ret = hid_hw_raw_request(hdev, dmabuf[0], dmabuf, ELAN_LED_REPORT_SIZE, hdev 446 drivers/hid/hid-elan.c hid_err(hdev, "Failed to set mute led brightness: %d\n", ret); hdev 454 drivers/hid/hid-elan.c static int elan_init_mute_led(struct hid_device *hdev) hdev 456 drivers/hid/hid-elan.c struct elan_drvdata *drvdata = hid_get_drvdata(hdev); hdev 463 drivers/hid/hid-elan.c mute_led->dev = &hdev->dev; hdev 465 drivers/hid/hid-elan.c return devm_led_classdev_register(&hdev->dev, mute_led); hdev 468 drivers/hid/hid-elan.c static int elan_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 473 drivers/hid/hid-elan.c drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL); hdev 478 drivers/hid/hid-elan.c hid_set_drvdata(hdev, drvdata); hdev 480 drivers/hid/hid-elan.c ret = hid_parse(hdev); hdev 482 drivers/hid/hid-elan.c hid_err(hdev, "Hid Parse failed\n"); hdev 486 drivers/hid/hid-elan.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 488 drivers/hid/hid-elan.c hid_err(hdev, "Hid hw start failed\n"); hdev 492 drivers/hid/hid-elan.c if (is_not_elan_touchpad(hdev)) hdev 496 drivers/hid/hid-elan.c hid_err(hdev, "Input device is not registered\n"); hdev 501 drivers/hid/hid-elan.c ret = elan_start_multitouch(hdev); hdev 506 drivers/hid/hid-elan.c ret = elan_init_mute_led(hdev); hdev 513 drivers/hid/hid-elan.c hid_hw_stop(hdev); hdev 517 drivers/hid/hid-elan.c static void elan_remove(struct hid_device *hdev) hdev 519 drivers/hid/hid-elan.c hid_hw_stop(hdev); hdev 38 drivers/hid/hid-elecom.c static void mouse_button_fixup(struct hid_device *hdev, hdev 46 drivers/hid/hid-elecom.c hid_info(hdev, "Fixing up Elecom mouse button count\n"); hdev 53 drivers/hid/hid-elecom.c static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 56 drivers/hid/hid-elecom.c switch (hdev->product) { hdev 61 drivers/hid/hid-elecom.c hid_info(hdev, "Fixing up Elecom BM084 report descriptor\n"); hdev 68 drivers/hid/hid-elecom.c mouse_button_fixup(hdev, rdesc, *rsize, 6); hdev 74 drivers/hid/hid-elecom.c mouse_button_fixup(hdev, rdesc, *rsize, 8); hdev 39 drivers/hid/hid-elo.c static int elo_input_configured(struct hid_device *hdev, hdev 80 drivers/hid/hid-elo.c static int elo_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 85 drivers/hid/hid-elo.c if (!(hdev->claimed & HID_CLAIMED_INPUT) || list_empty(&hdev->inputs)) hdev 88 drivers/hid/hid-elo.c hidinput = list_first_entry(&hdev->inputs, struct hid_input, list); hdev 99 drivers/hid/hid-elo.c hid_info(hdev, "unknown report type %d\n", report->id); hdev 227 drivers/hid/hid-elo.c static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 237 drivers/hid/hid-elo.c priv->usbdev = interface_to_usbdev(to_usb_interface(hdev->dev.parent)); hdev 239 drivers/hid/hid-elo.c hid_set_drvdata(hdev, priv); hdev 241 drivers/hid/hid-elo.c ret = hid_parse(hdev); hdev 243 drivers/hid/hid-elo.c hid_err(hdev, "parse failed\n"); hdev 247 drivers/hid/hid-elo.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 249 drivers/hid/hid-elo.c hid_err(hdev, "hw start failed\n"); hdev 254 drivers/hid/hid-elo.c hid_info(hdev, "broken firmware found, installing workaround\n"); hdev 264 drivers/hid/hid-elo.c static void elo_remove(struct hid_device *hdev) hdev 266 drivers/hid/hid-elo.c struct elo_priv *priv = hid_get_drvdata(hdev); hdev 268 drivers/hid/hid-elo.c hid_hw_stop(hdev); hdev 106 drivers/hid/hid-emsff.c static int ems_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 110 drivers/hid/hid-emsff.c ret = hid_parse(hdev); hdev 112 drivers/hid/hid-emsff.c hid_err(hdev, "parse failed\n"); hdev 116 drivers/hid/hid-emsff.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); hdev 118 drivers/hid/hid-emsff.c hid_err(hdev, "hw start failed\n"); hdev 122 drivers/hid/hid-emsff.c ret = emsff_init(hdev); hdev 124 drivers/hid/hid-emsff.c dev_err(&hdev->dev, "force feedback init failed\n"); hdev 125 drivers/hid/hid-emsff.c hid_hw_stop(hdev); hdev 25 drivers/hid/hid-ezkey.c static int ez_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 47 drivers/hid/hid-ezkey.c static int ez_event(struct hid_device *hdev, struct hid_field *field, hdev 50 drivers/hid/hid-ezkey.c if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput || hdev 128 drivers/hid/hid-gaff.c static inline int gaff_init(struct hid_device *hdev) hdev 134 drivers/hid/hid-gaff.c static int ga_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 138 drivers/hid/hid-gaff.c dev_dbg(&hdev->dev, "Greenasia HID hardware probe..."); hdev 140 drivers/hid/hid-gaff.c ret = hid_parse(hdev); hdev 142 drivers/hid/hid-gaff.c hid_err(hdev, "parse failed\n"); hdev 146 drivers/hid/hid-gaff.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); hdev 148 drivers/hid/hid-gaff.c hid_err(hdev, "hw start failed\n"); hdev 152 drivers/hid/hid-gaff.c gaff_init(hdev); hdev 60 drivers/hid/hid-gembird.c static __u8 *gembird_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 72 drivers/hid/hid-gembird.c new_rdesc = devm_kzalloc(&hdev->dev, new_size, GFP_KERNEL); hdev 76 drivers/hid/hid-gembird.c dev_info(&hdev->dev, hdev 29 drivers/hid/hid-generic.c struct hid_device *hdev = data; hdev 34 drivers/hid/hid-generic.c return hid_match_device(hdev, hdrv) != NULL; hdev 37 drivers/hid/hid-generic.c static bool hid_generic_match(struct hid_device *hdev, hdev 43 drivers/hid/hid-generic.c if (hdev->quirks & HID_QUIRK_HAVE_SPECIAL_DRIVER) hdev 50 drivers/hid/hid-generic.c if (bus_for_each_drv(&hid_bus_type, NULL, hdev, __check_hid_generic)) hdev 56 drivers/hid/hid-generic.c static int hid_generic_probe(struct hid_device *hdev, hdev 61 drivers/hid/hid-generic.c hdev->quirks |= HID_QUIRK_INPUT_PER_APP; hdev 63 drivers/hid/hid-generic.c ret = hid_parse(hdev); hdev 67 drivers/hid/hid-generic.c return hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 27 drivers/hid/hid-gfrm.c static int gfrm_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 31 drivers/hid/hid-gfrm.c unsigned long hdev_type = (unsigned long) hid_get_drvdata(hdev); hdev 50 drivers/hid/hid-gfrm.c static int gfrm_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 53 drivers/hid/hid-gfrm.c unsigned long hdev_type = (unsigned long) hid_get_drvdata(hdev); hdev 68 drivers/hid/hid-gfrm.c ret = hid_report_raw_event(hdev, HID_INPUT_REPORT, search_key_dn, hdev 76 drivers/hid/hid-gfrm.c ret = hid_report_raw_event(hdev, HID_INPUT_REPORT, search_key_up, hdev 98 drivers/hid/hid-gfrm.c static int gfrm_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 102 drivers/hid/hid-gfrm.c hid_set_drvdata(hdev, (void *) id->driver_data); hdev 104 drivers/hid/hid-gfrm.c ret = hid_parse(hdev); hdev 114 drivers/hid/hid-gfrm.c if (!hid_register_report(hdev, HID_INPUT_REPORT, hdev 121 drivers/hid/hid-gfrm.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 281 drivers/hid/hid-google-hammer.c struct hid_device *hdev; hdev 300 drivers/hid/hid-google-hammer.c ret = hid_hw_power(led->hdev, PM_HINT_FULLON); hdev 302 drivers/hid/hid-google-hammer.c hid_err(led->hdev, "failed: device not resumed %d\n", ret); hdev 306 drivers/hid/hid-google-hammer.c ret = hid_hw_output_report(led->hdev, led->buf, sizeof(led->buf)); hdev 308 drivers/hid/hid-google-hammer.c ret = hid_hw_raw_request(led->hdev, 0, led->buf, hdev 313 drivers/hid/hid-google-hammer.c hid_err(led->hdev, "failed to set keyboard backlight: %d\n", hdev 317 drivers/hid/hid-google-hammer.c hid_hw_power(led->hdev, PM_HINT_NORMAL); hdev 322 drivers/hid/hid-google-hammer.c static int hammer_register_leds(struct hid_device *hdev) hdev 326 drivers/hid/hid-google-hammer.c kbd_backlight = devm_kzalloc(&hdev->dev, hdev 332 drivers/hid/hid-google-hammer.c kbd_backlight->hdev = hdev; hdev 342 drivers/hid/hid-google-hammer.c return devm_led_classdev_register(&hdev->dev, &kbd_backlight->cdev); hdev 352 drivers/hid/hid-google-hammer.c static int hammer_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 357 drivers/hid/hid-google-hammer.c if (hdev->product == USB_DEVICE_ID_GOOGLE_WHISKERS && hdev 400 drivers/hid/hid-google-hammer.c static bool hammer_is_keyboard_interface(struct hid_device *hdev) hdev 402 drivers/hid/hid-google-hammer.c struct hid_report_enum *re = &hdev->report_enum[HID_INPUT_REPORT]; hdev 412 drivers/hid/hid-google-hammer.c static bool hammer_has_backlight_control(struct hid_device *hdev) hdev 414 drivers/hid/hid-google-hammer.c struct hid_report_enum *re = &hdev->report_enum[HID_OUTPUT_REPORT]; hdev 434 drivers/hid/hid-google-hammer.c static int hammer_probe(struct hid_device *hdev, hdev 445 drivers/hid/hid-google-hammer.c if (hdev->product == USB_DEVICE_ID_GOOGLE_WHISKERS && hdev 446 drivers/hid/hid-google-hammer.c hammer_is_keyboard_interface(hdev)) hdev 447 drivers/hid/hid-google-hammer.c hdev->quirks |= HID_QUIRK_ALWAYS_POLL; hdev 449 drivers/hid/hid-google-hammer.c error = hid_parse(hdev); hdev 453 drivers/hid/hid-google-hammer.c error = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 457 drivers/hid/hid-google-hammer.c if (hammer_has_backlight_control(hdev)) { hdev 458 drivers/hid/hid-google-hammer.c error = hammer_register_leds(hdev); hdev 460 drivers/hid/hid-google-hammer.c hid_warn(hdev, hdev 45 drivers/hid/hid-gt683r.c struct hid_device *hdev; hdev 63 drivers/hid/hid-gt683r.c struct hid_device *hdev = to_hid_device(dev); hdev 64 drivers/hid/hid-gt683r.c struct gt683r_led *led = hid_get_drvdata(hdev); hdev 82 drivers/hid/hid-gt683r.c struct hid_device *hdev = to_hid_device(dev->parent); hdev 83 drivers/hid/hid-gt683r.c struct gt683r_led *led = hid_get_drvdata(hdev); hdev 100 drivers/hid/hid-gt683r.c struct hid_device *hdev = to_hid_device(dev->parent); hdev 101 drivers/hid/hid-gt683r.c struct gt683r_led *led = hid_get_drvdata(hdev); hdev 126 drivers/hid/hid-gt683r.c ret = hid_hw_raw_request(led->hdev, msg[0], msg, GT683R_BUFFER_SIZE, hdev 129 drivers/hid/hid-gt683r.c hid_err(led->hdev, hdev 222 drivers/hid/hid-gt683r.c static int gt683r_led_probe(struct hid_device *hdev, hdev 231 drivers/hid/hid-gt683r.c led = devm_kzalloc(&hdev->dev, sizeof(*led), GFP_KERNEL); hdev 239 drivers/hid/hid-gt683r.c led->hdev = hdev; hdev 240 drivers/hid/hid-gt683r.c hid_set_drvdata(hdev, led); hdev 242 drivers/hid/hid-gt683r.c ret = hid_parse(hdev); hdev 244 drivers/hid/hid-gt683r.c hid_err(hdev, "hid parsing failed\n"); hdev 248 drivers/hid/hid-gt683r.c ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW); hdev 250 drivers/hid/hid-gt683r.c hid_err(hdev, "hw start failed\n"); hdev 255 drivers/hid/hid-gt683r.c name_sz = strlen(dev_name(&hdev->dev)) + hdev 258 drivers/hid/hid-gt683r.c name = devm_kzalloc(&hdev->dev, name_sz, GFP_KERNEL); hdev 265 drivers/hid/hid-gt683r.c dev_name(&hdev->dev), gt683r_panel_names[i]); hdev 271 drivers/hid/hid-gt683r.c ret = led_classdev_register(&hdev->dev, &led->led_devs[i]); hdev 273 drivers/hid/hid-gt683r.c hid_err(hdev, "could not register led device\n"); hdev 283 drivers/hid/hid-gt683r.c hid_hw_stop(hdev); hdev 287 drivers/hid/hid-gt683r.c static void gt683r_led_remove(struct hid_device *hdev) hdev 290 drivers/hid/hid-gt683r.c struct gt683r_led *led = hid_get_drvdata(hdev); hdev 295 drivers/hid/hid-gt683r.c hid_hw_stop(hdev); hdev 24 drivers/hid/hid-gyration.c static int gyration_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 54 drivers/hid/hid-gyration.c static int gyration_event(struct hid_device *hdev, struct hid_field *field, hdev 58 drivers/hid/hid-gyration.c if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput) hdev 105 drivers/hid/hid-holtek-kbd.c static __u8 *holtek_kbd_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 108 drivers/hid/hid-holtek-kbd.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 140 drivers/hid/hid-holtek-kbd.c static int holtek_kbd_probe(struct hid_device *hdev, hdev 143 drivers/hid/hid-holtek-kbd.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 144 drivers/hid/hid-holtek-kbd.c int ret = hid_parse(hdev); hdev 147 drivers/hid/hid-holtek-kbd.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 151 drivers/hid/hid-holtek-kbd.c list_for_each_entry(hidinput, &hdev->inputs, list) { hdev 32 drivers/hid/hid-holtek-mouse.c static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 35 drivers/hid/hid-holtek-mouse.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 40 drivers/hid/hid-holtek-mouse.c switch (hdev->product) { hdev 46 drivers/hid/hid-holtek-mouse.c hid_info(hdev, "Fixing up report descriptor\n"); hdev 55 drivers/hid/hid-holtek-mouse.c hid_info(hdev, "Fixing up report descriptor\n"); hdev 181 drivers/hid/hid-holtekff.c static int holtek_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 185 drivers/hid/hid-holtekff.c ret = hid_parse(hdev); hdev 187 drivers/hid/hid-holtekff.c hid_err(hdev, "parse failed\n"); hdev 191 drivers/hid/hid-holtekff.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); hdev 193 drivers/hid/hid-holtekff.c hid_err(hdev, "hw start failed\n"); hdev 197 drivers/hid/hid-holtekff.c holtekff_init(hdev); hdev 164 drivers/hid/hid-icade.c static int icade_event(struct hid_device *hdev, struct hid_field *field, hdev 169 drivers/hid/hid-icade.c if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput || hdev 188 drivers/hid/hid-icade.c static int icade_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 211 drivers/hid/hid-icade.c static int icade_input_mapped(struct hid_device *hdev, struct hid_input *hi, hdev 325 drivers/hid/hid-input.c static unsigned find_battery_quirk(struct hid_device *hdev) hdev 330 drivers/hid/hid-input.c match = hid_match_id(hdev, hid_battery_quirks); hdev 14 drivers/hid/hid-ite.c static int ite_event(struct hid_device *hdev, struct hid_field *field, hdev 19 drivers/hid/hid-ite.c if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput) hdev 19 drivers/hid/hid-jabra.c static int jabra_input_mapping(struct hid_device *hdev, hdev 20 drivers/hid/hid-kensington.c static int ks_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 27 drivers/hid/hid-keytouch.c static __u8 *keytouch_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 30 drivers/hid/hid-keytouch.c hid_info(hdev, "fixing up Keytouch IEC report descriptor\n"); hdev 557 drivers/hid/hid-kye.c static __u8 *kye_consumer_control_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 571 drivers/hid/hid-kye.c hid_info(hdev, "fixing up %s report descriptor\n", device_name); hdev 577 drivers/hid/hid-kye.c static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 580 drivers/hid/hid-kye.c switch (hdev->product) { hdev 595 drivers/hid/hid-kye.c hid_info(hdev, hdev 642 drivers/hid/hid-kye.c rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 104, hdev 646 drivers/hid/hid-kye.c rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 83, hdev 650 drivers/hid/hid-kye.c rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 104, hdev 665 drivers/hid/hid-kye.c static int kye_tablet_enable(struct hid_device *hdev) hdev 672 drivers/hid/hid-kye.c list = &hdev->report_enum[HID_FEATURE_REPORT].report_list; hdev 680 drivers/hid/hid-kye.c hid_err(hdev, "tablet-enabling feature report not found\n"); hdev 685 drivers/hid/hid-kye.c hid_err(hdev, "invalid tablet-enabling feature report\n"); hdev 698 drivers/hid/hid-kye.c hid_hw_request(hdev, report, HID_REQ_SET_REPORT); hdev 703 drivers/hid/hid-kye.c static int kye_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 707 drivers/hid/hid-kye.c ret = hid_parse(hdev); hdev 709 drivers/hid/hid-kye.c hid_err(hdev, "parse failed\n"); hdev 713 drivers/hid/hid-kye.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 715 drivers/hid/hid-kye.c hid_err(hdev, "hw start failed\n"); hdev 726 drivers/hid/hid-kye.c ret = kye_tablet_enable(hdev); hdev 728 drivers/hid/hid-kye.c hid_err(hdev, "tablet enabling failed\n"); hdev 737 drivers/hid/hid-kye.c if (hid_hw_open(hdev)) hdev 738 drivers/hid/hid-kye.c hid_hw_close(hdev); hdev 744 drivers/hid/hid-kye.c hid_hw_stop(hdev); hdev 20 drivers/hid/hid-lcpower.c static int ts_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 98 drivers/hid/hid-led.c struct hid_device *hdev; hdev 126 drivers/hid/hid-led.c ret = hid_hw_raw_request(ldev->hdev, buf[0], ldev->buf, hdev 131 drivers/hid/hid-led.c ret = hid_hw_output_report(ldev->hdev, ldev->buf, hdev 156 drivers/hid/hid-led.c ret = hid_hw_raw_request(ldev->hdev, buf[0], ldev->buf, hdev 163 drivers/hid/hid-led.c ret = hid_hw_raw_request(ldev->hdev, buf[0], ldev->buf, hdev 427 drivers/hid/hid-led.c return devm_led_classdev_register(&rgb->ldev->hdev->dev, &led->cdev); hdev 448 drivers/hid/hid-led.c static int hidled_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 454 drivers/hid/hid-led.c ldev = devm_kzalloc(&hdev->dev, sizeof(*ldev), GFP_KERNEL); hdev 458 drivers/hid/hid-led.c ldev->buf = devm_kmalloc(&hdev->dev, MAX_REPORT_SIZE, GFP_KERNEL); hdev 462 drivers/hid/hid-led.c ret = hid_parse(hdev); hdev 466 drivers/hid/hid-led.c ldev->hdev = hdev; hdev 482 drivers/hid/hid-led.c ldev->rgb = devm_kcalloc(&hdev->dev, ldev->config->num_leds, hdev 487 drivers/hid/hid-led.c ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW); hdev 491 drivers/hid/hid-led.c minor = ((struct hidraw *) hdev->hidraw)->minor; hdev 498 drivers/hid/hid-led.c hid_hw_stop(hdev); hdev 503 drivers/hid/hid-led.c hid_info(hdev, "%s initialized\n", ldev->config->name); hdev 64 drivers/hid/hid-lenovo.c static __u8 *lenovo_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 67 drivers/hid/hid-lenovo.c switch (hdev->product) { hdev 84 drivers/hid/hid-lenovo.c static int lenovo_input_mapping_tpkbd(struct hid_device *hdev, hdev 90 drivers/hid/hid-lenovo.c hid_set_drvdata(hdev, (void *)1); hdev 97 drivers/hid/hid-lenovo.c static int lenovo_input_mapping_cptkbd(struct hid_device *hdev, hdev 171 drivers/hid/hid-lenovo.c static int lenovo_input_mapping_scrollpoint(struct hid_device *hdev, hdev 182 drivers/hid/hid-lenovo.c static int lenovo_input_mapping(struct hid_device *hdev, hdev 186 drivers/hid/hid-lenovo.c switch (hdev->product) { hdev 188 drivers/hid/hid-lenovo.c return lenovo_input_mapping_tpkbd(hdev, hi, field, hdev 192 drivers/hid/hid-lenovo.c return lenovo_input_mapping_cptkbd(hdev, hi, field, hdev 200 drivers/hid/hid-lenovo.c return lenovo_input_mapping_scrollpoint(hdev, hi, field, hdev 210 drivers/hid/hid-lenovo.c static int lenovo_send_cmd_cptkbd(struct hid_device *hdev, hdev 224 drivers/hid/hid-lenovo.c switch (hdev->product) { hdev 226 drivers/hid/hid-lenovo.c ret = hid_hw_raw_request(hdev, 0x13, buf, 3, hdev 230 drivers/hid/hid-lenovo.c ret = hid_hw_output_report(hdev, buf, 3); hdev 242 drivers/hid/hid-lenovo.c static void lenovo_features_set_cptkbd(struct hid_device *hdev) hdev 245 drivers/hid/hid-lenovo.c struct lenovo_drvdata_cptkbd *cptkbd_data = hid_get_drvdata(hdev); hdev 247 drivers/hid/hid-lenovo.c ret = lenovo_send_cmd_cptkbd(hdev, 0x05, cptkbd_data->fn_lock); hdev 249 drivers/hid/hid-lenovo.c hid_err(hdev, "Fn-lock setting failed: %d\n", ret); hdev 251 drivers/hid/hid-lenovo.c ret = lenovo_send_cmd_cptkbd(hdev, 0x02, cptkbd_data->sensitivity); hdev 253 drivers/hid/hid-lenovo.c hid_err(hdev, "Sensitivity setting failed: %d\n", ret); hdev 260 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 261 drivers/hid/hid-lenovo.c struct lenovo_drvdata_cptkbd *cptkbd_data = hid_get_drvdata(hdev); hdev 271 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 272 drivers/hid/hid-lenovo.c struct lenovo_drvdata_cptkbd *cptkbd_data = hid_get_drvdata(hdev); hdev 281 drivers/hid/hid-lenovo.c lenovo_features_set_cptkbd(hdev); hdev 290 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 291 drivers/hid/hid-lenovo.c struct lenovo_drvdata_cptkbd *cptkbd_data = hid_get_drvdata(hdev); hdev 302 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 303 drivers/hid/hid-lenovo.c struct lenovo_drvdata_cptkbd *cptkbd_data = hid_get_drvdata(hdev); hdev 310 drivers/hid/hid-lenovo.c lenovo_features_set_cptkbd(hdev); hdev 337 drivers/hid/hid-lenovo.c static int lenovo_raw_event(struct hid_device *hdev, hdev 345 drivers/hid/hid-lenovo.c if (unlikely(hdev->product == USB_DEVICE_ID_LENOVO_CUSBKBD hdev 357 drivers/hid/hid-lenovo.c static int lenovo_event_cptkbd(struct hid_device *hdev, hdev 360 drivers/hid/hid-lenovo.c struct lenovo_drvdata_cptkbd *cptkbd_data = hid_get_drvdata(hdev); hdev 392 drivers/hid/hid-lenovo.c static int lenovo_event(struct hid_device *hdev, struct hid_field *field, hdev 395 drivers/hid/hid-lenovo.c switch (hdev->product) { hdev 398 drivers/hid/hid-lenovo.c return lenovo_event_cptkbd(hdev, field, usage, value); hdev 404 drivers/hid/hid-lenovo.c static int lenovo_features_set_tpkbd(struct hid_device *hdev) hdev 407 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 409 drivers/hid/hid-lenovo.c report = hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[4]; hdev 419 drivers/hid/hid-lenovo.c hid_hw_request(hdev, report, HID_REQ_SET_REPORT); hdev 427 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 428 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 438 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 439 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 448 drivers/hid/hid-lenovo.c lenovo_features_set_tpkbd(hdev); hdev 457 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 458 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 468 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 469 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 478 drivers/hid/hid-lenovo.c lenovo_features_set_tpkbd(hdev); hdev 487 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 488 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 498 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 499 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 508 drivers/hid/hid-lenovo.c lenovo_features_set_tpkbd(hdev); hdev 517 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 518 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 528 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 529 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 538 drivers/hid/hid-lenovo.c lenovo_features_set_tpkbd(hdev); hdev 547 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 548 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 559 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 560 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 567 drivers/hid/hid-lenovo.c lenovo_features_set_tpkbd(hdev); hdev 576 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 577 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 588 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 589 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 596 drivers/hid/hid-lenovo.c lenovo_features_set_tpkbd(hdev); hdev 649 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 650 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 665 drivers/hid/hid-lenovo.c struct hid_device *hdev = to_hid_device(dev); hdev 666 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 678 drivers/hid/hid-lenovo.c report = hdev->report_enum[HID_OUTPUT_REPORT].report_id_hash[3]; hdev 681 drivers/hid/hid-lenovo.c hid_hw_request(hdev, report, HID_REQ_SET_REPORT); hdev 684 drivers/hid/hid-lenovo.c static int lenovo_probe_tpkbd(struct hid_device *hdev) hdev 686 drivers/hid/hid-lenovo.c struct device *dev = &hdev->dev; hdev 697 drivers/hid/hid-lenovo.c if (!hid_get_drvdata(hdev)) hdev 700 drivers/hid/hid-lenovo.c hid_set_drvdata(hdev, NULL); hdev 704 drivers/hid/hid-lenovo.c if (!hid_validate_values(hdev, HID_FEATURE_REPORT, 4, i, 1)) hdev 707 drivers/hid/hid-lenovo.c if (!hid_validate_values(hdev, HID_OUTPUT_REPORT, 3, 0, 2)) hdev 710 drivers/hid/hid-lenovo.c ret = sysfs_create_group(&hdev->dev.kobj, &lenovo_attr_group_tpkbd); hdev 712 drivers/hid/hid-lenovo.c hid_warn(hdev, "Could not create sysfs group: %d\n", ret); hdev 714 drivers/hid/hid-lenovo.c data_pointer = devm_kzalloc(&hdev->dev, hdev 718 drivers/hid/hid-lenovo.c hid_err(hdev, "Could not allocate memory for driver data\n"); hdev 727 drivers/hid/hid-lenovo.c name_mute = devm_kzalloc(&hdev->dev, name_sz, GFP_KERNEL); hdev 728 drivers/hid/hid-lenovo.c name_micmute = devm_kzalloc(&hdev->dev, name_sz, GFP_KERNEL); hdev 730 drivers/hid/hid-lenovo.c hid_err(hdev, "Could not allocate memory for led data\n"); hdev 737 drivers/hid/hid-lenovo.c hid_set_drvdata(hdev, data_pointer); hdev 759 drivers/hid/hid-lenovo.c lenovo_features_set_tpkbd(hdev); hdev 763 drivers/hid/hid-lenovo.c sysfs_remove_group(&hdev->dev.kobj, &lenovo_attr_group_tpkbd); hdev 767 drivers/hid/hid-lenovo.c static int lenovo_probe_cptkbd(struct hid_device *hdev) hdev 773 drivers/hid/hid-lenovo.c if (hdev->product == USB_DEVICE_ID_LENOVO_CUSBKBD hdev 774 drivers/hid/hid-lenovo.c && hdev->type != HID_TYPE_USBMOUSE) { hdev 775 drivers/hid/hid-lenovo.c hid_dbg(hdev, "Ignoring keyboard half of device\n"); hdev 779 drivers/hid/hid-lenovo.c cptkbd_data = devm_kzalloc(&hdev->dev, hdev 783 drivers/hid/hid-lenovo.c hid_err(hdev, "can't alloc keyboard descriptor\n"); hdev 786 drivers/hid/hid-lenovo.c hid_set_drvdata(hdev, cptkbd_data); hdev 792 drivers/hid/hid-lenovo.c ret = lenovo_send_cmd_cptkbd(hdev, 0x01, 0x03); hdev 794 drivers/hid/hid-lenovo.c hid_warn(hdev, "Failed to switch F7/9/11 mode: %d\n", ret); hdev 797 drivers/hid/hid-lenovo.c ret = lenovo_send_cmd_cptkbd(hdev, 0x09, 0x01); hdev 799 drivers/hid/hid-lenovo.c hid_warn(hdev, "Failed to switch middle button: %d\n", ret); hdev 805 drivers/hid/hid-lenovo.c lenovo_features_set_cptkbd(hdev); hdev 807 drivers/hid/hid-lenovo.c ret = sysfs_create_group(&hdev->dev.kobj, &lenovo_attr_group_cptkbd); hdev 809 drivers/hid/hid-lenovo.c hid_warn(hdev, "Could not create sysfs group: %d\n", ret); hdev 814 drivers/hid/hid-lenovo.c static int lenovo_probe(struct hid_device *hdev, hdev 819 drivers/hid/hid-lenovo.c ret = hid_parse(hdev); hdev 821 drivers/hid/hid-lenovo.c hid_err(hdev, "hid_parse failed\n"); hdev 825 drivers/hid/hid-lenovo.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 827 drivers/hid/hid-lenovo.c hid_err(hdev, "hid_hw_start failed\n"); hdev 831 drivers/hid/hid-lenovo.c switch (hdev->product) { hdev 833 drivers/hid/hid-lenovo.c ret = lenovo_probe_tpkbd(hdev); hdev 837 drivers/hid/hid-lenovo.c ret = lenovo_probe_cptkbd(hdev); hdev 848 drivers/hid/hid-lenovo.c hid_hw_stop(hdev); hdev 853 drivers/hid/hid-lenovo.c static void lenovo_remove_tpkbd(struct hid_device *hdev) hdev 855 drivers/hid/hid-lenovo.c struct lenovo_drvdata_tpkbd *data_pointer = hid_get_drvdata(hdev); hdev 864 drivers/hid/hid-lenovo.c sysfs_remove_group(&hdev->dev.kobj, hdev 871 drivers/hid/hid-lenovo.c static void lenovo_remove_cptkbd(struct hid_device *hdev) hdev 873 drivers/hid/hid-lenovo.c sysfs_remove_group(&hdev->dev.kobj, hdev 877 drivers/hid/hid-lenovo.c static void lenovo_remove(struct hid_device *hdev) hdev 879 drivers/hid/hid-lenovo.c switch (hdev->product) { hdev 881 drivers/hid/hid-lenovo.c lenovo_remove_tpkbd(hdev); hdev 885 drivers/hid/hid-lenovo.c lenovo_remove_cptkbd(hdev); hdev 889 drivers/hid/hid-lenovo.c hid_hw_stop(hdev); hdev 892 drivers/hid/hid-lenovo.c static int lenovo_input_configured(struct hid_device *hdev, hdev 895 drivers/hid/hid-lenovo.c switch (hdev->product) { hdev 430 drivers/hid/hid-lg.c static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 433 drivers/hid/hid-lg.c struct lg_drv_data *drv_data = hid_get_drvdata(hdev); hdev 437 drivers/hid/hid-lg.c hid_info(hdev, hdev 445 drivers/hid/hid-lg.c hid_info(hdev, hdev 450 drivers/hid/hid-lg.c switch (hdev->product) { hdev 454 drivers/hid/hid-lg.c hid_info(hdev, hdev 459 drivers/hid/hid-lg.c hid_info(hdev, hdev 467 drivers/hid/hid-lg.c hid_info(hdev, hdev 477 drivers/hid/hid-lg.c hid_info(hdev, hdev 486 drivers/hid/hid-lg.c hid_info(hdev, hdev 495 drivers/hid/hid-lg.c hid_info(hdev, hdev 504 drivers/hid/hid-lg.c hid_info(hdev, hdev 513 drivers/hid/hid-lg.c hid_info(hdev, hdev 523 drivers/hid/hid-lg.c hid_info(hdev, "fixing up Logitech Speed Force Wireless report descriptor\n"); hdev 648 drivers/hid/hid-lg.c static int lg_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 664 drivers/hid/hid-lg.c struct lg_drv_data *drv_data = hid_get_drvdata(hdev); hdev 667 drivers/hid/hid-lg.c if (hdev->product == USB_DEVICE_ID_LOGITECH_RECEIVER && hdev 671 drivers/hid/hid-lg.c if (hdev->product == USB_DEVICE_ID_DINOVO_MINI && hdev 701 drivers/hid/hid-lg.c static int lg_input_mapped(struct hid_device *hdev, struct hid_input *hi, hdev 705 drivers/hid/hid-lg.c struct lg_drv_data *drv_data = hid_get_drvdata(hdev); hdev 719 drivers/hid/hid-lg.c switch (hdev->product) { hdev 742 drivers/hid/hid-lg.c static int lg_event(struct hid_device *hdev, struct hid_field *field, hdev 745 drivers/hid/hid-lg.c struct lg_drv_data *drv_data = hid_get_drvdata(hdev); hdev 753 drivers/hid/hid-lg.c return lg4ff_adjust_input_event(hdev, field, usage, value, drv_data); hdev 759 drivers/hid/hid-lg.c static int lg_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 762 drivers/hid/hid-lg.c struct lg_drv_data *drv_data = hid_get_drvdata(hdev); hdev 765 drivers/hid/hid-lg.c return lg4ff_raw_event(hdev, report, rd, size, drv_data); hdev 770 drivers/hid/hid-lg.c static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 772 drivers/hid/hid-lg.c struct usb_interface *iface = to_usb_interface(hdev->dev.parent); hdev 779 drivers/hid/hid-lg.c if ((hdev->product == USB_DEVICE_ID_LOGITECH_G29_WHEEL) && hdev 787 drivers/hid/hid-lg.c hid_err(hdev, "Insufficient memory, cannot allocate driver data\n"); hdev 792 drivers/hid/hid-lg.c hid_set_drvdata(hdev, (void *)drv_data); hdev 795 drivers/hid/hid-lg.c hdev->quirks |= HID_QUIRK_NOGET; hdev 797 drivers/hid/hid-lg.c ret = hid_parse(hdev); hdev 799 drivers/hid/hid-lg.c hid_err(hdev, "parse failed\n"); hdev 806 drivers/hid/hid-lg.c ret = hid_hw_start(hdev, connect_mask); hdev 808 drivers/hid/hid-lg.c hid_err(hdev, "hw start failed\n"); hdev 813 drivers/hid/hid-lg.c if (hdev->product == USB_DEVICE_ID_LOGITECH_WII_WHEEL) { hdev 824 drivers/hid/hid-lg.c ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(cbuf), hdev 837 drivers/hid/hid-lg.c ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(cbuf), hdev 844 drivers/hid/hid-lg.c ret = lgff_init(hdev); hdev 846 drivers/hid/hid-lg.c ret = lg2ff_init(hdev); hdev 848 drivers/hid/hid-lg.c ret = lg3ff_init(hdev); hdev 850 drivers/hid/hid-lg.c ret = lg4ff_init(hdev); hdev 858 drivers/hid/hid-lg.c hid_hw_stop(hdev); hdev 864 drivers/hid/hid-lg.c static void lg_remove(struct hid_device *hdev) hdev 866 drivers/hid/hid-lg.c struct lg_drv_data *drv_data = hid_get_drvdata(hdev); hdev 868 drivers/hid/hid-lg.c lg4ff_deinit(hdev); hdev 869 drivers/hid/hid-lg.c hid_hw_stop(hdev); hdev 11 drivers/hid/hid-lg.h int lgff_init(struct hid_device *hdev); hdev 13 drivers/hid/hid-lg.h static inline int lgff_init(struct hid_device *hdev) { return -1; } hdev 17 drivers/hid/hid-lg.h int lg2ff_init(struct hid_device *hdev); hdev 19 drivers/hid/hid-lg.h static inline int lg2ff_init(struct hid_device *hdev) { return -1; } hdev 23 drivers/hid/hid-lg.h int lg3ff_init(struct hid_device *hdev); hdev 25 drivers/hid/hid-lg.h static inline int lg3ff_init(struct hid_device *hdev) { return -1; } hdev 326 drivers/hid/hid-lg4ff.c int lg4ff_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 10 drivers/hid/hid-lg4ff.h int lg4ff_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 12 drivers/hid/hid-lg4ff.h int lg4ff_init(struct hid_device *hdev); hdev 13 drivers/hid/hid-lg4ff.h int lg4ff_deinit(struct hid_device *hdev); hdev 17 drivers/hid/hid-lg4ff.h static inline int lg4ff_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 19 drivers/hid/hid-lg4ff.h static inline int lg4ff_init(struct hid_device *hdev) { return -1; } hdev 20 drivers/hid/hid-lg4ff.h static inline int lg4ff_deinit(struct hid_device *hdev) { return -1; } hdev 154 drivers/hid/hid-logitech-dj.c struct hid_device *hdev; hdev 527 drivers/hid/hid-logitech-dj.c static struct dj_receiver_dev *dj_find_receiver_dev(struct hid_device *hdev, hdev 542 drivers/hid/hid-logitech-dj.c hid_compare_device_paths(hdev, djrcv_dev->mouse, sep)) { hdev 547 drivers/hid/hid-logitech-dj.c hid_compare_device_paths(hdev, djrcv_dev->keyboard, sep)) { hdev 552 drivers/hid/hid-logitech-dj.c hid_compare_device_paths(hdev, djrcv_dev->hidpp, sep)) { hdev 570 drivers/hid/hid-logitech-dj.c static void dj_put_receiver_dev(struct hid_device *hdev) hdev 572 drivers/hid/hid-logitech-dj.c struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev); hdev 576 drivers/hid/hid-logitech-dj.c if (djrcv_dev->mouse == hdev) hdev 578 drivers/hid/hid-logitech-dj.c if (djrcv_dev->keyboard == hdev) hdev 580 drivers/hid/hid-logitech-dj.c if (djrcv_dev->hidpp == hdev) hdev 588 drivers/hid/hid-logitech-dj.c static struct dj_receiver_dev *dj_get_receiver_dev(struct hid_device *hdev, hdev 597 drivers/hid/hid-logitech-dj.c djrcv_dev = dj_find_receiver_dev(hdev, type); hdev 619 drivers/hid/hid-logitech-dj.c djrcv_dev->keyboard = hdev; hdev 621 drivers/hid/hid-logitech-dj.c djrcv_dev->mouse = hdev; hdev 623 drivers/hid/hid-logitech-dj.c djrcv_dev->hidpp = hdev; hdev 625 drivers/hid/hid-logitech-dj.c hid_set_drvdata(hdev, djrcv_dev); hdev 644 drivers/hid/hid-logitech-dj.c hid_destroy_device(dj_dev->hdev); hdev 725 drivers/hid/hid-logitech-dj.c dj_dev->hdev = dj_hiddev; hdev 869 drivers/hid/hid-logitech-dj.c static void logi_hidpp_dev_conn_notif_equad(struct hid_device *hdev, hdev 873 drivers/hid/hid-logitech-dj.c struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev); hdev 894 drivers/hid/hid-logitech-dj.c static void logi_hidpp_dev_conn_notif_27mhz(struct hid_device *hdev, hdev 913 drivers/hid/hid-logitech-dj.c hid_warn(hdev, "%s: unexpected device-index %d", __func__, hdev 918 drivers/hid/hid-logitech-dj.c static void logi_hidpp_recv_queue_notif(struct hid_device *hdev, hdev 922 drivers/hid/hid-logitech-dj.c struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev); hdev 933 drivers/hid/hid-logitech-dj.c logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); hdev 936 drivers/hid/hid-logitech-dj.c hid_info(hdev, "Non Logitech device connected on slot %d\n", hdev 943 drivers/hid/hid-logitech-dj.c logi_hidpp_dev_conn_notif_27mhz(hdev, hidpp_report, &workitem); hdev 947 drivers/hid/hid-logitech-dj.c logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); hdev 951 drivers/hid/hid-logitech-dj.c logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); hdev 958 drivers/hid/hid-logitech-dj.c logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); hdev 962 drivers/hid/hid-logitech-dj.c logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); hdev 969 drivers/hid/hid-logitech-dj.c logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); hdev 973 drivers/hid/hid-logitech-dj.c logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); hdev 978 drivers/hid/hid-logitech-dj.c logi_hidpp_dev_conn_notif_equad(hdev, hidpp_report, &workitem); hdev 984 drivers/hid/hid-logitech-dj.c hid_warn(hdev, hdev 992 drivers/hid/hid-logitech-dj.c hid_info(hdev, "device of type %s (0x%02x) connected on slot %d", hdev 1015 drivers/hid/hid-logitech-dj.c if (hid_input_report(djdev->hdev, hdev 1040 drivers/hid/hid-logitech-dj.c if (hid_input_report(dj_device->hdev, hdev 1051 drivers/hid/hid-logitech-dj.c if (hid_input_report(dj_dev->hdev, HID_INPUT_REPORT, data, size, 1)) hdev 1055 drivers/hid/hid-logitech-dj.c static void logi_dj_recv_forward_input_report(struct hid_device *hdev, hdev 1058 drivers/hid/hid-logitech-dj.c struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev); hdev 1065 drivers/hid/hid-logitech-dj.c hid_err(hdev, "Unexpected input report number %d\n", report); hdev 1088 drivers/hid/hid-logitech-dj.c struct hid_device *hdev = djrcv_dev->hidpp; hdev 1094 drivers/hid/hid-logitech-dj.c output_report_enum = &hdev->report_enum[HID_OUTPUT_REPORT]; hdev 1098 drivers/hid/hid-logitech-dj.c hid_err(hdev, "%s: unable to find dj report\n", __func__); hdev 1105 drivers/hid/hid-logitech-dj.c hid_hw_request(hdev, report, HID_REQ_SET_REPORT); hdev 1162 drivers/hid/hid-logitech-dj.c struct hid_device *hdev = djrcv_dev->hidpp; hdev 1209 drivers/hid/hid-logitech-dj.c hid_hw_raw_request(hdev, REPORT_ID_HIDPP_SHORT, buf, hdev 1316 drivers/hid/hid-logitech-dj.c djdev->hdev->version = 0x0111; hdev 1317 drivers/hid/hid-logitech-dj.c djdev->hdev->country = 0x00; hdev 1402 drivers/hid/hid-logitech-dj.c static int logi_dj_dj_event(struct hid_device *hdev, hdev 1406 drivers/hid/hid-logitech-dj.c struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev); hdev 1436 drivers/hid/hid-logitech-dj.c hid_err(hdev, "%s: invalid device index:%d\n", hdev 1472 drivers/hid/hid-logitech-dj.c static int logi_dj_hidpp_event(struct hid_device *hdev, hdev 1476 drivers/hid/hid-logitech-dj.c struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev); hdev 1508 drivers/hid/hid-logitech-dj.c hid_err(hdev, "%s: invalid device index:%d\n", __func__, hdev 1525 drivers/hid/hid-logitech-dj.c dj_dev->hdev->product) { hdev 1539 drivers/hid/hid-logitech-dj.c logi_hidpp_recv_queue_notif(hdev, hidpp_report); hdev 1549 drivers/hid/hid-logitech-dj.c static int logi_dj_raw_event(struct hid_device *hdev, hdev 1553 drivers/hid/hid-logitech-dj.c struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev); hdev 1559 drivers/hid/hid-logitech-dj.c if (!hdev->report_enum[HID_INPUT_REPORT].numbered) { hdev 1570 drivers/hid/hid-logitech-dj.c logi_dj_recv_forward_input_report(hdev, data, size); hdev 1587 drivers/hid/hid-logitech-dj.c logi_dj_recv_forward_input_report(hdev, mouse_report, hdev 1597 drivers/hid/hid-logitech-dj.c hid_err(hdev, "Short DJ report bad size (%d)", size); hdev 1600 drivers/hid/hid-logitech-dj.c return logi_dj_dj_event(hdev, report, data, size); hdev 1603 drivers/hid/hid-logitech-dj.c hid_err(hdev, "Long DJ report bad size (%d)", size); hdev 1606 drivers/hid/hid-logitech-dj.c return logi_dj_dj_event(hdev, report, data, size); hdev 1609 drivers/hid/hid-logitech-dj.c hid_err(hdev, "Short HID++ report bad size (%d)", size); hdev 1612 drivers/hid/hid-logitech-dj.c return logi_dj_hidpp_event(hdev, report, data, size); hdev 1615 drivers/hid/hid-logitech-dj.c hid_err(hdev, "Long HID++ report bad size (%d)", size); hdev 1618 drivers/hid/hid-logitech-dj.c return logi_dj_hidpp_event(hdev, report, data, size); hdev 1621 drivers/hid/hid-logitech-dj.c logi_dj_recv_forward_input_report(hdev, data, size); hdev 1626 drivers/hid/hid-logitech-dj.c static int logi_dj_probe(struct hid_device *hdev, hdev 1643 drivers/hid/hid-logitech-dj.c retval = hid_parse(hdev); hdev 1645 drivers/hid/hid-logitech-dj.c hid_err(hdev, "%s: parse failed\n", __func__); hdev 1663 drivers/hid/hid-logitech-dj.c if (hid_is_using_ll_driver(hdev, &usb_hid_driver)) { hdev 1664 drivers/hid/hid-logitech-dj.c intf = to_usb_interface(hdev->dev.parent); hdev 1667 drivers/hid/hid-logitech-dj.c hdev->quirks |= HID_QUIRK_INPUT_PER_APP; hdev 1668 drivers/hid/hid-logitech-dj.c return hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 1672 drivers/hid/hid-logitech-dj.c rep_enum = &hdev->report_enum[HID_INPUT_REPORT]; hdev 1697 drivers/hid/hid-logitech-dj.c djrcv_dev = dj_get_receiver_dev(hdev, id->driver_data, hdev 1700 drivers/hid/hid-logitech-dj.c hid_err(hdev, "%s: dj_get_receiver_dev failed\n", __func__); hdev 1709 drivers/hid/hid-logitech-dj.c retval = hid_hw_start(hdev, HID_CONNECT_HIDRAW|HID_CONNECT_HIDDEV); hdev 1711 drivers/hid/hid-logitech-dj.c hid_err(hdev, "%s: hid_hw_start returned error\n", __func__); hdev 1718 drivers/hid/hid-logitech-dj.c hid_err(hdev, "%s: logi_dj_recv_switch_to_dj_mode returned error:%d\n", hdev 1725 drivers/hid/hid-logitech-dj.c retval = hid_hw_open(hdev); hdev 1727 drivers/hid/hid-logitech-dj.c hid_err(hdev, "%s: hid_hw_open returned error:%d\n", hdev 1733 drivers/hid/hid-logitech-dj.c hid_device_io_start(hdev); hdev 1741 drivers/hid/hid-logitech-dj.c hid_err(hdev, "%s: logi_dj_recv_query_paired_devices error:%d\n", hdev 1754 drivers/hid/hid-logitech-dj.c hid_hw_stop(hdev); hdev 1757 drivers/hid/hid-logitech-dj.c dj_put_receiver_dev(hdev); hdev 1762 drivers/hid/hid-logitech-dj.c static int logi_dj_reset_resume(struct hid_device *hdev) hdev 1765 drivers/hid/hid-logitech-dj.c struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev); hdev 1767 drivers/hid/hid-logitech-dj.c if (!djrcv_dev || djrcv_dev->hidpp != hdev) hdev 1772 drivers/hid/hid-logitech-dj.c hid_err(hdev, "%s: logi_dj_recv_switch_to_dj_mode returned error:%d\n", hdev 1780 drivers/hid/hid-logitech-dj.c static void logi_dj_remove(struct hid_device *hdev) hdev 1782 drivers/hid/hid-logitech-dj.c struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev); hdev 1790 drivers/hid/hid-logitech-dj.c return hid_hw_stop(hdev); hdev 1802 drivers/hid/hid-logitech-dj.c hid_hw_close(hdev); hdev 1803 drivers/hid/hid-logitech-dj.c hid_hw_stop(hdev); hdev 1818 drivers/hid/hid-logitech-dj.c hid_destroy_device(dj_dev->hdev); hdev 1823 drivers/hid/hid-logitech-dj.c dj_put_receiver_dev(hdev); hdev 211 drivers/hid/hid-logitech-hidpp.c static int __hidpp_send_report(struct hid_device *hdev, hdev 214 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 238 drivers/hid/hid-logitech-hidpp.c ret = hid_hw_output_report(hdev, (u8 *)hidpp_report, fields_count); hdev 240 drivers/hid/hid-logitech-hidpp.c ret = hid_hw_raw_request(hdev, hidpp_report->report_id, hdev 801 drivers/hid/hid-logitech-hidpp.c struct hid_device *hdev = hidpp->hid_dev; hdev 810 drivers/hid/hid-logitech-hidpp.c snprintf(hdev->uniq, sizeof(hdev->uniq), "%04x-%4phD", hdev 811 drivers/hid/hid-logitech-hidpp.c hdev->product, &serial); hdev 812 drivers/hid/hid-logitech-hidpp.c dbg_hid("HID++ Unifying: Got serial: %s\n", hdev->uniq); hdev 818 drivers/hid/hid-logitech-hidpp.c snprintf(hdev->name, sizeof(hdev->name), "%s", name); hdev 2203 drivers/hid/hid-logitech-hidpp.c static int wtp_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 2322 drivers/hid/hid-logitech-hidpp.c static int wtp_raw_event(struct hid_device *hdev, u8 *data, int size) hdev 2324 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 2335 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "Received HID report of bad size (%d)", hdev 2394 drivers/hid/hid-logitech-hidpp.c static int wtp_allocate(struct hid_device *hdev, const struct hid_device_id *id) hdev 2396 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 2399 drivers/hid/hid-logitech-hidpp.c wd = devm_kzalloc(&hdev->dev, sizeof(struct wtp_data), hdev 2409 drivers/hid/hid-logitech-hidpp.c static int wtp_connect(struct hid_device *hdev, bool connected) hdev 2411 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 2418 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "Can not get wtp config: %d\n", ret); hdev 2471 drivers/hid/hid-logitech-hidpp.c static int m560_send_config_command(struct hid_device *hdev, bool connected) hdev 2476 drivers/hid/hid-logitech-hidpp.c hidpp_dev = hid_get_drvdata(hdev); hdev 2489 drivers/hid/hid-logitech-hidpp.c static int m560_raw_event(struct hid_device *hdev, u8 *data, int size) hdev 2491 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 2495 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "error in parameter\n"); hdev 2500 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "error in report\n"); hdev 2535 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "error in report\n"); hdev 2567 drivers/hid/hid-logitech-hidpp.c v = hid_snto32(hid_field_extract(hdev, data+3, 0, 12), 12); hdev 2570 drivers/hid/hid-logitech-hidpp.c v = hid_snto32(hid_field_extract(hdev, data+3, 12, 12), 12); hdev 2603 drivers/hid/hid-logitech-hidpp.c static int m560_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 2651 drivers/hid/hid-logitech-hidpp.c static int k400_allocate(struct hid_device *hdev) hdev 2653 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 2656 drivers/hid/hid-logitech-hidpp.c k400 = devm_kzalloc(&hdev->dev, sizeof(struct k400_private_data), hdev 2666 drivers/hid/hid-logitech-hidpp.c static int k400_connect(struct hid_device *hdev, bool connected) hdev 2668 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 2975 drivers/hid/hid-logitech-hidpp.c static u8 *hidpp_report_fixup(struct hid_device *hdev, u8 *rdesc, hdev 2978 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 2984 drivers/hid/hid-logitech-hidpp.c if (hdev->group == HID_GROUP_LOGITECH_27MHZ_DEVICE || hdev 2991 drivers/hid/hid-logitech-hidpp.c static int hidpp_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 2995 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 3001 drivers/hid/hid-logitech-hidpp.c return wtp_input_mapping(hdev, hi, field, usage, bit, max); hdev 3004 drivers/hid/hid-logitech-hidpp.c return m560_input_mapping(hdev, hi, field, usage, bit, max); hdev 3009 drivers/hid/hid-logitech-hidpp.c static int hidpp_input_mapped(struct hid_device *hdev, struct hid_input *hi, hdev 3013 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 3048 drivers/hid/hid-logitech-hidpp.c static int hidpp_input_configured(struct hid_device *hdev, hdev 3051 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 3138 drivers/hid/hid-logitech-hidpp.c static int hidpp_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 3141 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 3151 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "received hid++ report of bad size (%d)", hdev 3159 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "received hid++ report of bad size (%d)", hdev 3167 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "received hid++ report of bad size (%d)", hdev 3181 drivers/hid/hid-logitech-hidpp.c return wtp_raw_event(hdev, data, size); hdev 3183 drivers/hid/hid-logitech-hidpp.c return m560_raw_event(hdev, data, size); hdev 3188 drivers/hid/hid-logitech-hidpp.c static int hidpp_event(struct hid_device *hdev, struct hid_field *field, hdev 3194 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 3292 drivers/hid/hid-logitech-hidpp.c static void hidpp_overwrite_name(struct hid_device *hdev) hdev 3294 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 3303 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "unable to retrieve the name of the device"); hdev 3306 drivers/hid/hid-logitech-hidpp.c snprintf(hdev->name, sizeof(hdev->name), "%s", name); hdev 3326 drivers/hid/hid-logitech-hidpp.c static struct input_dev *hidpp_allocate_input(struct hid_device *hdev) hdev 3328 drivers/hid/hid-logitech-hidpp.c struct input_dev *input_dev = devm_input_allocate_device(&hdev->dev); hdev 3329 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 3334 drivers/hid/hid-logitech-hidpp.c input_set_drvdata(input_dev, hdev); hdev 3339 drivers/hid/hid-logitech-hidpp.c input_dev->phys = hdev->phys; hdev 3340 drivers/hid/hid-logitech-hidpp.c input_dev->uniq = hdev->uniq; hdev 3341 drivers/hid/hid-logitech-hidpp.c input_dev->id.bustype = hdev->bus; hdev 3342 drivers/hid/hid-logitech-hidpp.c input_dev->id.vendor = hdev->vendor; hdev 3343 drivers/hid/hid-logitech-hidpp.c input_dev->id.product = hdev->product; hdev 3344 drivers/hid/hid-logitech-hidpp.c input_dev->id.version = hdev->version; hdev 3345 drivers/hid/hid-logitech-hidpp.c input_dev->dev.parent = &hdev->dev; hdev 3352 drivers/hid/hid-logitech-hidpp.c struct hid_device *hdev = hidpp->hid_dev; hdev 3369 drivers/hid/hid-logitech-hidpp.c ret = wtp_connect(hdev, connected); hdev 3373 drivers/hid/hid-logitech-hidpp.c ret = m560_send_config_command(hdev, connected); hdev 3377 drivers/hid/hid-logitech-hidpp.c ret = k400_connect(hdev, connected); hdev 3405 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "Can not get the protocol version.\n"); hdev 3410 drivers/hid/hid-logitech-hidpp.c if (hidpp->name == hdev->name && hidpp->protocol_major >= 2) { hdev 3413 drivers/hid/hid-logitech-hidpp.c devm_name = devm_kasprintf(&hdev->dev, GFP_KERNEL, hdev 3445 drivers/hid/hid-logitech-hidpp.c input = hidpp_allocate_input(hdev); hdev 3447 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "cannot allocate new input device: %d\n", ret); hdev 3471 drivers/hid/hid-logitech-hidpp.c static int hidpp_get_report_length(struct hid_device *hdev, int id) hdev 3476 drivers/hid/hid-logitech-hidpp.c re = &(hdev->report_enum[HID_OUTPUT_REPORT]); hdev 3484 drivers/hid/hid-logitech-hidpp.c static bool hidpp_validate_device(struct hid_device *hdev) hdev 3486 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 3490 drivers/hid/hid-logitech-hidpp.c report_length = hidpp_get_report_length(hdev, id); hdev 3499 drivers/hid/hid-logitech-hidpp.c report_length = hidpp_get_report_length(hdev, id); hdev 3508 drivers/hid/hid-logitech-hidpp.c report_length = hidpp_get_report_length(hdev, id); hdev 3521 drivers/hid/hid-logitech-hidpp.c hid_warn(hdev, "not enough values in hidpp report %d\n", id); hdev 3525 drivers/hid/hid-logitech-hidpp.c static bool hidpp_application_equals(struct hid_device *hdev, hdev 3531 drivers/hid/hid-logitech-hidpp.c report_list = &hdev->report_enum[HID_INPUT_REPORT].report_list; hdev 3536 drivers/hid/hid-logitech-hidpp.c static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 3545 drivers/hid/hid-logitech-hidpp.c hidpp = devm_kzalloc(&hdev->dev, sizeof(*hidpp), GFP_KERNEL); hdev 3549 drivers/hid/hid-logitech-hidpp.c hidpp->hid_dev = hdev; hdev 3550 drivers/hid/hid-logitech-hidpp.c hidpp->name = hdev->name; hdev 3552 drivers/hid/hid-logitech-hidpp.c hid_set_drvdata(hdev, hidpp); hdev 3554 drivers/hid/hid-logitech-hidpp.c ret = hid_parse(hdev); hdev 3556 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "%s:parse failed\n", __func__); hdev 3563 drivers/hid/hid-logitech-hidpp.c if (!hidpp_validate_device(hdev)) { hdev 3564 drivers/hid/hid-logitech-hidpp.c hid_set_drvdata(hdev, NULL); hdev 3565 drivers/hid/hid-logitech-hidpp.c devm_kfree(&hdev->dev, hidpp); hdev 3566 drivers/hid/hid-logitech-hidpp.c return hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 3573 drivers/hid/hid-logitech-hidpp.c hidpp_application_equals(hdev, HID_GD_MOUSE)) hdev 3578 drivers/hid/hid-logitech-hidpp.c hidpp_application_equals(hdev, HID_GD_KEYBOARD)) hdev 3587 drivers/hid/hid-logitech-hidpp.c ret = wtp_allocate(hdev, id); hdev 3591 drivers/hid/hid-logitech-hidpp.c ret = k400_allocate(hdev); hdev 3601 drivers/hid/hid-logitech-hidpp.c ret = sysfs_create_group(&hdev->dev.kobj, &ps_attribute_group); hdev 3603 drivers/hid/hid-logitech-hidpp.c hid_warn(hdev, "Cannot allocate sysfs group for %s\n", hdev 3604 drivers/hid/hid-logitech-hidpp.c hdev->name); hdev 3610 drivers/hid/hid-logitech-hidpp.c ret = hid_hw_start(hdev, 0); hdev 3612 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "hw start failed\n"); hdev 3616 drivers/hid/hid-logitech-hidpp.c ret = hid_hw_open(hdev); hdev 3618 drivers/hid/hid-logitech-hidpp.c dev_err(&hdev->dev, "%s:hid_hw_open returned error:%d\n", hdev 3620 drivers/hid/hid-logitech-hidpp.c hid_hw_stop(hdev); hdev 3625 drivers/hid/hid-logitech-hidpp.c hid_device_io_start(hdev); hdev 3635 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "Device not connected"); hdev 3639 drivers/hid/hid-logitech-hidpp.c hidpp_overwrite_name(hdev); hdev 3655 drivers/hid/hid-logitech-hidpp.c hid_device_io_stop(hdev); hdev 3656 drivers/hid/hid-logitech-hidpp.c hid_hw_close(hdev); hdev 3657 drivers/hid/hid-logitech-hidpp.c hid_hw_stop(hdev); hdev 3663 drivers/hid/hid-logitech-hidpp.c ret = hid_hw_start(hdev, connect_mask); hdev 3665 drivers/hid/hid-logitech-hidpp.c hid_err(hdev, "%s:hid_hw_start returned error\n", __func__); hdev 3680 drivers/hid/hid-logitech-hidpp.c hid_hw_close(hdev); hdev 3682 drivers/hid/hid-logitech-hidpp.c hid_hw_stop(hdev); hdev 3684 drivers/hid/hid-logitech-hidpp.c sysfs_remove_group(&hdev->dev.kobj, &ps_attribute_group); hdev 3690 drivers/hid/hid-logitech-hidpp.c static void hidpp_remove(struct hid_device *hdev) hdev 3692 drivers/hid/hid-logitech-hidpp.c struct hidpp_device *hidpp = hid_get_drvdata(hdev); hdev 3695 drivers/hid/hid-logitech-hidpp.c return hid_hw_stop(hdev); hdev 3697 drivers/hid/hid-logitech-hidpp.c sysfs_remove_group(&hdev->dev.kobj, &ps_attribute_group); hdev 3699 drivers/hid/hid-logitech-hidpp.c hid_hw_stop(hdev); hdev 21 drivers/hid/hid-macally.c static __u8 *macally_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 25 drivers/hid/hid-macally.c hid_info(hdev, hdev 308 drivers/hid/hid-magicmouse.c static int magicmouse_raw_event(struct hid_device *hdev, hdev 311 drivers/hid/hid-magicmouse.c struct magicmouse_sc *msc = hid_get_drvdata(hdev); hdev 323 drivers/hid/hid-magicmouse.c hid_warn(hdev, "invalid size value (%d) for TRACKPAD_REPORT_ID\n", hdev 345 drivers/hid/hid-magicmouse.c hid_warn(hdev, "invalid size value (%d) for TRACKPAD2_USB_REPORT_ID\n", hdev 361 drivers/hid/hid-magicmouse.c hid_warn(hdev, "invalid size value (%d) for MOUSE_REPORT_ID\n", hdev 387 drivers/hid/hid-magicmouse.c magicmouse_raw_event(hdev, report, data + 2, data[1]); hdev 388 drivers/hid/hid-magicmouse.c magicmouse_raw_event(hdev, report, data + 2 + data[1], hdev 411 drivers/hid/hid-magicmouse.c static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hdev) hdev 541 drivers/hid/hid-magicmouse.c static int magicmouse_input_mapping(struct hid_device *hdev, hdev 545 drivers/hid/hid-magicmouse.c struct magicmouse_sc *msc = hid_get_drvdata(hdev); hdev 559 drivers/hid/hid-magicmouse.c static int magicmouse_input_configured(struct hid_device *hdev, hdev 563 drivers/hid/hid-magicmouse.c struct magicmouse_sc *msc = hid_get_drvdata(hdev); hdev 566 drivers/hid/hid-magicmouse.c ret = magicmouse_setup_input(msc->input, hdev); hdev 568 drivers/hid/hid-magicmouse.c hid_err(hdev, "magicmouse setup input failed (%d)\n", ret); hdev 578 drivers/hid/hid-magicmouse.c static int magicmouse_probe(struct hid_device *hdev, hdev 593 drivers/hid/hid-magicmouse.c hdev->type != HID_TYPE_USBMOUSE) hdev 596 drivers/hid/hid-magicmouse.c msc = devm_kzalloc(&hdev->dev, sizeof(*msc), GFP_KERNEL); hdev 598 drivers/hid/hid-magicmouse.c hid_err(hdev, "can't alloc magicmouse descriptor\n"); hdev 605 drivers/hid/hid-magicmouse.c hid_set_drvdata(hdev, msc); hdev 607 drivers/hid/hid-magicmouse.c ret = hid_parse(hdev); hdev 609 drivers/hid/hid-magicmouse.c hid_err(hdev, "magicmouse hid parse failed\n"); hdev 613 drivers/hid/hid-magicmouse.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 615 drivers/hid/hid-magicmouse.c hid_err(hdev, "magicmouse hw start failed\n"); hdev 620 drivers/hid/hid-magicmouse.c hid_err(hdev, "magicmouse input not registered\n"); hdev 626 drivers/hid/hid-magicmouse.c report = hid_register_report(hdev, HID_INPUT_REPORT, hdev 630 drivers/hid/hid-magicmouse.c report = hid_register_report(hdev, HID_INPUT_REPORT, hdev 633 drivers/hid/hid-magicmouse.c report = hid_register_report(hdev, HID_INPUT_REPORT, hdev 636 drivers/hid/hid-magicmouse.c report = hid_register_report(hdev, HID_INPUT_REPORT, hdev 638 drivers/hid/hid-magicmouse.c report = hid_register_report(hdev, HID_INPUT_REPORT, hdev 643 drivers/hid/hid-magicmouse.c hid_err(hdev, "unable to register touch report\n"); hdev 676 drivers/hid/hid-magicmouse.c ret = hid_hw_raw_request(hdev, buf[0], buf, feature_size, hdev 680 drivers/hid/hid-magicmouse.c hid_err(hdev, "unable to request touch data (%d)\n", ret); hdev 686 drivers/hid/hid-magicmouse.c hid_hw_stop(hdev); hdev 140 drivers/hid/hid-maltron.c static __u8 *maltron_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 145 drivers/hid/hid-maltron.c hid_info(hdev, "Replacing Maltron L90 keyboard report descriptor\n"); hdev 33 drivers/hid/hid-microsoft.c struct hid_device *hdev; hdev 59 drivers/hid/hid-microsoft.c static __u8 *ms_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 62 drivers/hid/hid-microsoft.c struct ms_data *ms = hid_get_drvdata(hdev); hdev 71 drivers/hid/hid-microsoft.c hid_info(hdev, "fixing up Microsoft Wireless Receiver Model 1028 report descriptor\n"); hdev 185 drivers/hid/hid-microsoft.c static int ms_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 189 drivers/hid/hid-microsoft.c struct ms_data *ms = hid_get_drvdata(hdev); hdev 212 drivers/hid/hid-microsoft.c static int ms_input_mapped(struct hid_device *hdev, struct hid_input *hi, hdev 216 drivers/hid/hid-microsoft.c struct ms_data *ms = hid_get_drvdata(hdev); hdev 225 drivers/hid/hid-microsoft.c static int ms_event(struct hid_device *hdev, struct hid_field *field, hdev 228 drivers/hid/hid-microsoft.c struct ms_data *ms = hid_get_drvdata(hdev); hdev 232 drivers/hid/hid-microsoft.c if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput || hdev 287 drivers/hid/hid-microsoft.c struct hid_device *hdev = ms->hdev; hdev 305 drivers/hid/hid-microsoft.c ret = hid_hw_output_report(hdev, (__u8 *)r, sizeof(*r)); hdev 307 drivers/hid/hid-microsoft.c hid_warn(hdev, "failed to send FF report\n"); hdev 329 drivers/hid/hid-microsoft.c static int ms_init_ff(struct hid_device *hdev) hdev 333 drivers/hid/hid-microsoft.c struct ms_data *ms = hid_get_drvdata(hdev); hdev 335 drivers/hid/hid-microsoft.c if (list_empty(&hdev->inputs)) { hdev 336 drivers/hid/hid-microsoft.c hid_err(hdev, "no inputs found\n"); hdev 339 drivers/hid/hid-microsoft.c hidinput = list_entry(hdev->inputs.next, struct hid_input, list); hdev 345 drivers/hid/hid-microsoft.c ms->hdev = hdev; hdev 348 drivers/hid/hid-microsoft.c ms->output_report_dmabuf = devm_kzalloc(&hdev->dev, hdev 358 drivers/hid/hid-microsoft.c static void ms_remove_ff(struct hid_device *hdev) hdev 360 drivers/hid/hid-microsoft.c struct ms_data *ms = hid_get_drvdata(hdev); hdev 368 drivers/hid/hid-microsoft.c static int ms_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 374 drivers/hid/hid-microsoft.c ms = devm_kzalloc(&hdev->dev, sizeof(*ms), GFP_KERNEL); hdev 380 drivers/hid/hid-microsoft.c hid_set_drvdata(hdev, ms); hdev 383 drivers/hid/hid-microsoft.c hdev->quirks |= HID_QUIRK_NOGET; hdev 386 drivers/hid/hid-microsoft.c hdev->quirks |= HID_QUIRK_INPUT_PER_APP; hdev 388 drivers/hid/hid-microsoft.c ret = hid_parse(hdev); hdev 390 drivers/hid/hid-microsoft.c hid_err(hdev, "parse failed\n"); hdev 394 drivers/hid/hid-microsoft.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT | ((quirks & MS_HIDINPUT) ? hdev 397 drivers/hid/hid-microsoft.c hid_err(hdev, "hw start failed\n"); hdev 401 drivers/hid/hid-microsoft.c ret = ms_init_ff(hdev); hdev 403 drivers/hid/hid-microsoft.c hid_err(hdev, "could not initialize ff, continuing anyway"); hdev 410 drivers/hid/hid-microsoft.c static void ms_remove(struct hid_device *hdev) hdev 412 drivers/hid/hid-microsoft.c hid_hw_stop(hdev); hdev 413 drivers/hid/hid-microsoft.c ms_remove_ff(hdev); hdev 21 drivers/hid/hid-monterey.c static __u8 *mr_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 25 drivers/hid/hid-monterey.c hid_info(hdev, "fixing up button/consumer in HID report descriptor\n"); hdev 33 drivers/hid/hid-monterey.c static int mr_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 161 drivers/hid/hid-multitouch.c struct hid_device *hdev; /* hid_device we're attached to */ hdev 384 drivers/hid/hid-multitouch.c struct hid_device *hdev = to_hid_device(dev); hdev 385 drivers/hid/hid-multitouch.c struct mt_device *td = hid_get_drvdata(hdev); hdev 394 drivers/hid/hid-multitouch.c struct hid_device *hdev = to_hid_device(dev); hdev 395 drivers/hid/hid-multitouch.c struct mt_device *td = hid_get_drvdata(hdev); hdev 425 drivers/hid/hid-multitouch.c static void mt_get_feature(struct hid_device *hdev, struct hid_report *report) hdev 435 drivers/hid/hid-multitouch.c if (hdev->quirks & HID_QUIRK_NO_INIT_REPORTS) hdev 442 drivers/hid/hid-multitouch.c ret = hid_hw_raw_request(hdev, report->id, buf, size, hdev 445 drivers/hid/hid-multitouch.c dev_warn(&hdev->dev, "failed to fetch feature %d\n", hdev 448 drivers/hid/hid-multitouch.c ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT, buf, hdev 451 drivers/hid/hid-multitouch.c dev_warn(&hdev->dev, "failed to report feature\n"); hdev 457 drivers/hid/hid-multitouch.c static void mt_feature_mapping(struct hid_device *hdev, hdev 460 drivers/hid/hid-multitouch.c struct mt_device *td = hid_get_drvdata(hdev); hdev 464 drivers/hid/hid-multitouch.c mt_get_feature(hdev, field->report); hdev 477 drivers/hid/hid-multitouch.c dev_err(&hdev->dev, "HID_DG_BUTTONTYPE out of range\n"); hdev 481 drivers/hid/hid-multitouch.c mt_get_feature(hdev, field->report); hdev 489 drivers/hid/hid-multitouch.c mt_get_feature(hdev, field->report); hdev 504 drivers/hid/hid-multitouch.c static struct mt_usages *mt_allocate_usage(struct hid_device *hdev, hdev 509 drivers/hid/hid-multitouch.c usage = devm_kzalloc(&hdev->dev, sizeof(*usage), GFP_KERNEL); hdev 538 drivers/hid/hid-multitouch.c mt_application = devm_kzalloc(&td->hdev->dev, sizeof(*mt_application), hdev 596 drivers/hid/hid-multitouch.c rdata = devm_kzalloc(&td->hdev->dev, sizeof(*rdata), GFP_KERNEL); hdev 604 drivers/hid/hid-multitouch.c devm_kfree(&td->hdev->dev, rdata); hdev 643 drivers/hid/hid-multitouch.c static void mt_store_field(struct hid_device *hdev, hdev 652 drivers/hid/hid-multitouch.c usage = mt_allocate_usage(hdev, application); hdev 670 drivers/hid/hid-multitouch.c hid_dbg(hdev, hdev 674 drivers/hid/hid-multitouch.c usage = mt_allocate_usage(hdev, application); hdev 685 drivers/hid/hid-multitouch.c mt_store_field(hdev, app, \ hdev 689 drivers/hid/hid-multitouch.c static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 693 drivers/hid/hid-multitouch.c struct mt_device *td = hid_get_drvdata(hdev); hdev 1243 drivers/hid/hid-multitouch.c static int mt_touch_input_configured(struct hid_device *hdev, hdev 1247 drivers/hid/hid-multitouch.c struct mt_device *td = hid_get_drvdata(hdev); hdev 1290 drivers/hid/hid-multitouch.c static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 1294 drivers/hid/hid-multitouch.c struct mt_device *td = hid_get_drvdata(hdev); hdev 1300 drivers/hid/hid-multitouch.c hid_err(hdev, "failed to allocate data for report\n"); hdev 1349 drivers/hid/hid-multitouch.c return mt_touch_input_mapping(hdev, hi, field, usage, bit, max, hdev 1363 drivers/hid/hid-multitouch.c static int mt_input_mapped(struct hid_device *hdev, struct hid_input *hi, hdev 1367 drivers/hid/hid-multitouch.c struct mt_device *td = hid_get_drvdata(hdev); hdev 1410 drivers/hid/hid-multitouch.c static bool mt_need_to_apply_feature(struct hid_device *hdev, hdev 1418 drivers/hid/hid-multitouch.c struct mt_device *td = hid_get_drvdata(hdev); hdev 1440 drivers/hid/hid-multitouch.c hid_err(hdev, hdev 1444 drivers/hid/hid-multitouch.c hid_hw_raw_request(hdev, report->id, buf, report_len, hdev 1481 drivers/hid/hid-multitouch.c static void mt_set_modes(struct hid_device *hdev, enum latency_mode latency, hdev 1491 drivers/hid/hid-multitouch.c rep_enum = &hdev->report_enum[HID_FEATURE_REPORT]; hdev 1503 drivers/hid/hid-multitouch.c if (mt_need_to_apply_feature(hdev, hdev 1515 drivers/hid/hid-multitouch.c hid_hw_request(hdev, rep, HID_REQ_SET_REPORT); hdev 1542 drivers/hid/hid-multitouch.c static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi) hdev 1544 drivers/hid/hid-multitouch.c struct mt_device *td = hid_get_drvdata(hdev); hdev 1555 drivers/hid/hid-multitouch.c hid_err(hdev, "failed to allocate data for report\n"); hdev 1562 drivers/hid/hid-multitouch.c ret = mt_touch_input_configured(hdev, hi, hdev 1582 drivers/hid/hid-multitouch.c hi->input->name = hdev->name; hdev 1601 drivers/hid/hid-multitouch.c strlen(hdev->name) + strlen(suffix) + 2, hdev 1604 drivers/hid/hid-multitouch.c sprintf(name, "%s %s", hdev->name, suffix); hdev 1622 drivers/hid/hid-multitouch.c static void mt_fix_const_fields(struct hid_device *hdev, unsigned int usage) hdev 1628 drivers/hid/hid-multitouch.c &hdev->report_enum[HID_INPUT_REPORT].report_list, hdev 1671 drivers/hid/hid-multitouch.c struct hid_device *hdev = td->hdev; hdev 1680 drivers/hid/hid-multitouch.c mt_release_contacts(hdev); hdev 1684 drivers/hid/hid-multitouch.c static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 1697 drivers/hid/hid-multitouch.c td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL); hdev 1699 drivers/hid/hid-multitouch.c dev_err(&hdev->dev, "cannot allocate multitouch data\n"); hdev 1702 drivers/hid/hid-multitouch.c td->hdev = hdev; hdev 1705 drivers/hid/hid-multitouch.c hid_set_drvdata(hdev, td); hdev 1716 drivers/hid/hid-multitouch.c hdev->quirks |= HID_QUIRK_NO_INPUT_SYNC; hdev 1723 drivers/hid/hid-multitouch.c hdev->quirks |= HID_QUIRK_INPUT_PER_APP; hdev 1726 drivers/hid/hid-multitouch.c hdev->quirks |= HID_QUIRK_MULTI_INPUT; hdev 1729 drivers/hid/hid-multitouch.c hdev->quirks &= ~HID_QUIRK_INPUT_PER_APP; hdev 1730 drivers/hid/hid-multitouch.c hdev->quirks |= HID_QUIRK_MULTI_INPUT; hdev 1735 drivers/hid/hid-multitouch.c ret = hid_parse(hdev); hdev 1740 drivers/hid/hid-multitouch.c mt_fix_const_fields(hdev, HID_DG_CONTACTID); hdev 1742 drivers/hid/hid-multitouch.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 1746 drivers/hid/hid-multitouch.c ret = sysfs_create_group(&hdev->dev.kobj, &mt_attribute_group); hdev 1748 drivers/hid/hid-multitouch.c dev_warn(&hdev->dev, "Cannot allocate sysfs group for %s\n", hdev 1749 drivers/hid/hid-multitouch.c hdev->name); hdev 1751 drivers/hid/hid-multitouch.c mt_set_modes(hdev, HID_LATENCY_NORMAL, true, true); hdev 1757 drivers/hid/hid-multitouch.c static int mt_reset_resume(struct hid_device *hdev) hdev 1759 drivers/hid/hid-multitouch.c mt_release_contacts(hdev); hdev 1760 drivers/hid/hid-multitouch.c mt_set_modes(hdev, HID_LATENCY_NORMAL, true, true); hdev 1764 drivers/hid/hid-multitouch.c static int mt_resume(struct hid_device *hdev) hdev 1770 drivers/hid/hid-multitouch.c hid_hw_idle(hdev, 0, 0, HID_REQ_SET_IDLE); hdev 1776 drivers/hid/hid-multitouch.c static void mt_remove(struct hid_device *hdev) hdev 1778 drivers/hid/hid-multitouch.c struct mt_device *td = hid_get_drvdata(hdev); hdev 1782 drivers/hid/hid-multitouch.c sysfs_remove_group(&hdev->dev.kobj, &mt_attribute_group); hdev 1783 drivers/hid/hid-multitouch.c hid_hw_stop(hdev); hdev 32 drivers/hid/hid-nti.c static __u8 *nti_usbsun_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 36 drivers/hid/hid-nti.c hid_info(hdev, "fixing up NTI USB-SUN keyboard adapter report descriptor\n"); hdev 109 drivers/hid/hid-ntrig.c static inline int ntrig_get_mode(struct hid_device *hdev) hdev 111 drivers/hid/hid-ntrig.c struct hid_report *report = hdev->report_enum[HID_FEATURE_REPORT]. hdev 118 drivers/hid/hid-ntrig.c hid_hw_request(hdev, report, HID_REQ_GET_REPORT); hdev 119 drivers/hid/hid-ntrig.c hid_hw_wait(hdev); hdev 123 drivers/hid/hid-ntrig.c static inline void ntrig_set_mode(struct hid_device *hdev, const int mode) hdev 131 drivers/hid/hid-ntrig.c report = hdev->report_enum[HID_FEATURE_REPORT]. hdev 137 drivers/hid/hid-ntrig.c hid_hw_request(hdev, report, HID_REQ_GET_REPORT); hdev 140 drivers/hid/hid-ntrig.c static void ntrig_report_version(struct hid_device *hdev) hdev 144 drivers/hid/hid-ntrig.c struct usb_device *usb_dev = hid_to_usb_dev(hdev); hdev 160 drivers/hid/hid-ntrig.c hid_info(hdev, "Firmware version: %s (%02x%02x %02x%02x)\n", hdev 172 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 173 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 184 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 185 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 196 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 197 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 208 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 209 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 220 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 221 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 232 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 233 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 255 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 256 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 267 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 268 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 291 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 292 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 301 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 302 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 324 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 325 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 336 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 337 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 360 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 361 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 372 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 373 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 396 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 397 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 406 drivers/hid/hid-ntrig.c struct hid_device *hdev = to_hid_device(dev); hdev 407 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 454 drivers/hid/hid-ntrig.c static int ntrig_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 458 drivers/hid/hid-ntrig.c struct ntrig_data *nd = hid_get_drvdata(hdev); hdev 545 drivers/hid/hid-ntrig.c static int ntrig_input_mapped(struct hid_device *hdev, struct hid_input *hi, hdev 893 drivers/hid/hid-ntrig.c static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 900 drivers/hid/hid-ntrig.c hdev->quirks |= HID_QUIRK_MULTI_INPUT hdev 905 drivers/hid/hid-ntrig.c hid_err(hdev, "cannot allocate N-Trig data\n"); hdev 920 drivers/hid/hid-ntrig.c hid_set_drvdata(hdev, nd); hdev 922 drivers/hid/hid-ntrig.c ret = hid_parse(hdev); hdev 924 drivers/hid/hid-ntrig.c hid_err(hdev, "parse failed\n"); hdev 928 drivers/hid/hid-ntrig.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); hdev 930 drivers/hid/hid-ntrig.c hid_err(hdev, "hw start failed\n"); hdev 935 drivers/hid/hid-ntrig.c report = hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0x0a]; hdev 939 drivers/hid/hid-ntrig.c hid_hw_wait(hdev); hdev 940 drivers/hid/hid-ntrig.c hid_hw_request(hdev, report, HID_REQ_GET_REPORT); hdev 946 drivers/hid/hid-ntrig.c if (ntrig_get_mode(hdev) >= 4) hdev 947 drivers/hid/hid-ntrig.c ntrig_set_mode(hdev, 3); hdev 950 drivers/hid/hid-ntrig.c ntrig_report_version(hdev); hdev 952 drivers/hid/hid-ntrig.c ret = sysfs_create_group(&hdev->dev.kobj, hdev 955 drivers/hid/hid-ntrig.c hid_err(hdev, "cannot create sysfs group\n"); hdev 963 drivers/hid/hid-ntrig.c static void ntrig_remove(struct hid_device *hdev) hdev 965 drivers/hid/hid-ntrig.c sysfs_remove_group(&hdev->dev.kobj, hdev 967 drivers/hid/hid-ntrig.c hid_hw_stop(hdev); hdev 968 drivers/hid/hid-ntrig.c kfree(hid_get_drvdata(hdev)); hdev 25 drivers/hid/hid-ortek.c static __u8 *ortek_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 29 drivers/hid/hid-ortek.c hid_info(hdev, "Fixing up logical maximum in report descriptor (Ortek)\n"); hdev 32 drivers/hid/hid-ortek.c hid_info(hdev, "Fixing up logical maximum in report descriptor (Skycable)\n"); hdev 18 drivers/hid/hid-penmount.c static int penmount_input_mapping(struct hid_device *hdev, hdev 22 drivers/hid/hid-petalynx.c static __u8 *pl_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 28 drivers/hid/hid-petalynx.c hid_info(hdev, "fixing up Petalynx Maxter Remote report descriptor\n"); hdev 37 drivers/hid/hid-petalynx.c static int pl_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 67 drivers/hid/hid-petalynx.c static int pl_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 71 drivers/hid/hid-petalynx.c hdev->quirks |= HID_QUIRK_NOGET; hdev 73 drivers/hid/hid-petalynx.c ret = hid_parse(hdev); hdev 75 drivers/hid/hid-petalynx.c hid_err(hdev, "parse failed\n"); hdev 79 drivers/hid/hid-petalynx.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 81 drivers/hid/hid-petalynx.c hid_err(hdev, "hw start failed\n"); hdev 65 drivers/hid/hid-picolcd.h struct hid_device *hdev; hdev 130 drivers/hid/hid-picolcd.h struct hid_report *picolcd_report(int id, struct hid_device *hdev, int dir); hdev 134 drivers/hid/hid-picolcd.h struct hid_device *hdev, struct hid_report *report); hdev 142 drivers/hid/hid-picolcd.h struct hid_device *hdev, struct hid_report *report, hdev 153 drivers/hid/hid-picolcd.h struct hid_device *hdev, struct hid_report *report) hdev 157 drivers/hid/hid-picolcd.h struct hid_device *hdev, struct hid_report *report, hdev 297 drivers/hid/hid-picolcd.h int picolcd_reset(struct hid_device *hdev); hdev 298 drivers/hid/hid-picolcd.h struct picolcd_pending *picolcd_send_and_wait(struct hid_device *hdev, hdev 26 drivers/hid/hid-picolcd_backlight.c struct hid_report *report = picolcd_out_report(REPORT_BRIGHTNESS, data->hdev); hdev 37 drivers/hid/hid-picolcd_backlight.c hid_hw_request(data->hdev, report, HID_REQ_SET_REPORT); hdev 55 drivers/hid/hid-picolcd_backlight.c struct device *dev = &data->hdev->dev; hdev 108 drivers/hid/hid-picolcd_cir.c rdev->device_name = data->hdev->name; hdev 109 drivers/hid/hid-picolcd_cir.c rdev->input_phys = data->hdev->phys; hdev 110 drivers/hid/hid-picolcd_cir.c rdev->input_id.bustype = data->hdev->bus; hdev 111 drivers/hid/hid-picolcd_cir.c rdev->input_id.vendor = data->hdev->vendor; hdev 112 drivers/hid/hid-picolcd_cir.c rdev->input_id.product = data->hdev->product; hdev 113 drivers/hid/hid-picolcd_cir.c rdev->input_id.version = data->hdev->version; hdev 114 drivers/hid/hid-picolcd_cir.c rdev->dev.parent = &data->hdev->dev; hdev 53 drivers/hid/hid-picolcd_core.c struct hid_report *picolcd_report(int id, struct hid_device *hdev, int dir) hdev 55 drivers/hid/hid-picolcd_core.c struct list_head *feature_report_list = &hdev->report_enum[dir].report_list; hdev 62 drivers/hid/hid-picolcd_core.c hid_warn(hdev, "No report with id 0x%x found\n", id); hdev 68 drivers/hid/hid-picolcd_core.c struct picolcd_pending *picolcd_send_and_wait(struct hid_device *hdev, hdev 71 drivers/hid/hid-picolcd_core.c struct picolcd_data *data = hid_get_drvdata(hdev); hdev 73 drivers/hid/hid-picolcd_core.c struct hid_report *report = picolcd_out_report(report_id, hdev); hdev 102 drivers/hid/hid-picolcd_core.c hid_hw_request(data->hdev, report, HID_REQ_SET_REPORT); hdev 180 drivers/hid/hid-picolcd_core.c static int picolcd_check_version(struct hid_device *hdev) hdev 182 drivers/hid/hid-picolcd_core.c struct picolcd_data *data = hid_get_drvdata(hdev); hdev 189 drivers/hid/hid-picolcd_core.c verinfo = picolcd_send_and_wait(hdev, REPORT_VERSION, NULL, 0); hdev 191 drivers/hid/hid-picolcd_core.c hid_err(hdev, "no version response from PicoLCD\n"); hdev 199 drivers/hid/hid-picolcd_core.c hid_info(hdev, "PicoLCD, bootloader version %d.%d\n", hdev 202 drivers/hid/hid-picolcd_core.c hid_info(hdev, "PicoLCD, firmware version %d.%d\n", hdev 206 drivers/hid/hid-picolcd_core.c hid_err(hdev, "confused, got unexpected version response from PicoLCD\n"); hdev 216 drivers/hid/hid-picolcd_core.c int picolcd_reset(struct hid_device *hdev) hdev 218 drivers/hid/hid-picolcd_core.c struct picolcd_data *data = hid_get_drvdata(hdev); hdev 219 drivers/hid/hid-picolcd_core.c struct hid_report *report = picolcd_out_report(REPORT_RESET, hdev); hdev 227 drivers/hid/hid-picolcd_core.c if (hdev->product == USB_DEVICE_ID_PICOLCD_BOOTLOADER) hdev 236 drivers/hid/hid-picolcd_core.c hid_hw_request(hdev, report, HID_REQ_SET_REPORT); hdev 239 drivers/hid/hid-picolcd_core.c error = picolcd_check_version(hdev); hdev 274 drivers/hid/hid-picolcd_core.c report = picolcd_out_report(REPORT_EXIT_FLASHER, data->hdev); hdev 277 drivers/hid/hid-picolcd_core.c report = picolcd_out_report(REPORT_EXIT_KEYBOARD, data->hdev); hdev 288 drivers/hid/hid-picolcd_core.c hid_hw_request(data->hdev, report, HID_REQ_SET_REPORT); hdev 327 drivers/hid/hid-picolcd_core.c static int picolcd_raw_event(struct hid_device *hdev, hdev 330 drivers/hid/hid-picolcd_core.c struct picolcd_data *data = hid_get_drvdata(hdev); hdev 338 drivers/hid/hid-picolcd_core.c hid_warn(hdev, "invalid size value (%d) for picolcd raw event (%d)\n", hdev 363 drivers/hid/hid-picolcd_core.c picolcd_debug_raw_event(data, hdev, report, raw_data, size); hdev 368 drivers/hid/hid-picolcd_core.c static int picolcd_suspend(struct hid_device *hdev, pm_message_t message) hdev 373 drivers/hid/hid-picolcd_core.c picolcd_suspend_backlight(hid_get_drvdata(hdev)); hdev 378 drivers/hid/hid-picolcd_core.c static int picolcd_resume(struct hid_device *hdev) hdev 381 drivers/hid/hid-picolcd_core.c ret = picolcd_resume_backlight(hid_get_drvdata(hdev)); hdev 387 drivers/hid/hid-picolcd_core.c static int picolcd_reset_resume(struct hid_device *hdev) hdev 390 drivers/hid/hid-picolcd_core.c ret = picolcd_reset(hdev); hdev 393 drivers/hid/hid-picolcd_core.c ret = picolcd_fb_reset(hid_get_drvdata(hdev), 0); hdev 396 drivers/hid/hid-picolcd_core.c ret = picolcd_resume_lcd(hid_get_drvdata(hdev)); hdev 399 drivers/hid/hid-picolcd_core.c ret = picolcd_resume_backlight(hid_get_drvdata(hdev)); hdev 402 drivers/hid/hid-picolcd_core.c picolcd_leds_set(hid_get_drvdata(hdev)); hdev 411 drivers/hid/hid-picolcd_core.c struct hid_device *hdev = data->hdev; hdev 419 drivers/hid/hid-picolcd_core.c hid_err(hdev, "unsupported KEY_STATE report\n"); hdev 425 drivers/hid/hid-picolcd_core.c hid_err(hdev, "failed to allocate input device\n"); hdev 428 drivers/hid/hid-picolcd_core.c input_set_drvdata(idev, hdev); hdev 430 drivers/hid/hid-picolcd_core.c idev->name = hdev->name; hdev 431 drivers/hid/hid-picolcd_core.c idev->phys = hdev->phys; hdev 432 drivers/hid/hid-picolcd_core.c idev->uniq = hdev->uniq; hdev 433 drivers/hid/hid-picolcd_core.c idev->id.bustype = hdev->bus; hdev 434 drivers/hid/hid-picolcd_core.c idev->id.vendor = hdev->vendor; hdev 435 drivers/hid/hid-picolcd_core.c idev->id.product = hdev->product; hdev 436 drivers/hid/hid-picolcd_core.c idev->id.version = hdev->version; hdev 437 drivers/hid/hid-picolcd_core.c idev->dev.parent = &hdev->dev; hdev 447 drivers/hid/hid-picolcd_core.c hid_err(hdev, "error registering the input device\n"); hdev 464 drivers/hid/hid-picolcd_core.c static int picolcd_probe_lcd(struct hid_device *hdev, struct picolcd_data *data) hdev 469 drivers/hid/hid-picolcd_core.c error = picolcd_init_keys(data, picolcd_in_report(REPORT_KEY_STATE, hdev)); hdev 474 drivers/hid/hid-picolcd_core.c error = picolcd_init_cir(data, picolcd_in_report(REPORT_IR_DATA, hdev)); hdev 484 drivers/hid/hid-picolcd_core.c error = picolcd_init_lcd(data, picolcd_out_report(REPORT_CONTRAST, hdev)); hdev 489 drivers/hid/hid-picolcd_core.c error = picolcd_init_backlight(data, picolcd_out_report(REPORT_BRIGHTNESS, hdev)); hdev 494 drivers/hid/hid-picolcd_core.c error = picolcd_init_leds(data, picolcd_out_report(REPORT_LED_STATE, hdev)); hdev 498 drivers/hid/hid-picolcd_core.c picolcd_init_devfs(data, picolcd_out_report(REPORT_EE_READ, hdev), hdev 499 drivers/hid/hid-picolcd_core.c picolcd_out_report(REPORT_EE_WRITE, hdev), hdev 500 drivers/hid/hid-picolcd_core.c picolcd_out_report(REPORT_READ_MEMORY, hdev), hdev 501 drivers/hid/hid-picolcd_core.c picolcd_out_report(REPORT_WRITE_MEMORY, hdev), hdev 502 drivers/hid/hid-picolcd_core.c picolcd_out_report(REPORT_RESET, hdev)); hdev 514 drivers/hid/hid-picolcd_core.c static int picolcd_probe_bootloader(struct hid_device *hdev, struct picolcd_data *data) hdev 517 drivers/hid/hid-picolcd_core.c picolcd_out_report(REPORT_BL_READ_MEMORY, hdev), hdev 518 drivers/hid/hid-picolcd_core.c picolcd_out_report(REPORT_BL_WRITE_MEMORY, hdev), NULL); hdev 522 drivers/hid/hid-picolcd_core.c static int picolcd_probe(struct hid_device *hdev, hdev 536 drivers/hid/hid-picolcd_core.c hid_err(hdev, "can't allocate space for Minibox PicoLCD device data\n"); hdev 542 drivers/hid/hid-picolcd_core.c data->hdev = hdev; hdev 544 drivers/hid/hid-picolcd_core.c if (hdev->product == USB_DEVICE_ID_PICOLCD_BOOTLOADER) hdev 546 drivers/hid/hid-picolcd_core.c hid_set_drvdata(hdev, data); hdev 549 drivers/hid/hid-picolcd_core.c error = hid_parse(hdev); hdev 551 drivers/hid/hid-picolcd_core.c hid_err(hdev, "device report parse failed\n"); hdev 555 drivers/hid/hid-picolcd_core.c error = hid_hw_start(hdev, 0); hdev 557 drivers/hid/hid-picolcd_core.c hid_err(hdev, "hardware start failed\n"); hdev 561 drivers/hid/hid-picolcd_core.c error = hid_hw_open(hdev); hdev 563 drivers/hid/hid-picolcd_core.c hid_err(hdev, "failed to open input interrupt pipe for key and IR events\n"); hdev 567 drivers/hid/hid-picolcd_core.c error = device_create_file(&hdev->dev, &dev_attr_operation_mode_delay); hdev 569 drivers/hid/hid-picolcd_core.c hid_err(hdev, "failed to create sysfs attributes\n"); hdev 573 drivers/hid/hid-picolcd_core.c error = device_create_file(&hdev->dev, &dev_attr_operation_mode); hdev 575 drivers/hid/hid-picolcd_core.c hid_err(hdev, "failed to create sysfs attributes\n"); hdev 580 drivers/hid/hid-picolcd_core.c error = picolcd_probe_bootloader(hdev, data); hdev 582 drivers/hid/hid-picolcd_core.c error = picolcd_probe_lcd(hdev, data); hdev 590 drivers/hid/hid-picolcd_core.c device_remove_file(&hdev->dev, &dev_attr_operation_mode); hdev 592 drivers/hid/hid-picolcd_core.c device_remove_file(&hdev->dev, &dev_attr_operation_mode_delay); hdev 594 drivers/hid/hid-picolcd_core.c hid_hw_close(hdev); hdev 596 drivers/hid/hid-picolcd_core.c hid_hw_stop(hdev); hdev 602 drivers/hid/hid-picolcd_core.c static void picolcd_remove(struct hid_device *hdev) hdev 604 drivers/hid/hid-picolcd_core.c struct picolcd_data *data = hid_get_drvdata(hdev); hdev 613 drivers/hid/hid-picolcd_core.c device_remove_file(&hdev->dev, &dev_attr_operation_mode); hdev 614 drivers/hid/hid-picolcd_core.c device_remove_file(&hdev->dev, &dev_attr_operation_mode_delay); hdev 615 drivers/hid/hid-picolcd_core.c hid_hw_close(hdev); hdev 616 drivers/hid/hid-picolcd_core.c hid_hw_stop(hdev); hdev 50 drivers/hid/hid-picolcd_debugfs.c picolcd_reset(data->hdev); hdev 91 drivers/hid/hid-picolcd_debugfs.c resp = picolcd_send_and_wait(data->hdev, REPORT_EE_READ, raw_data, hdev 133 drivers/hid/hid-picolcd_debugfs.c resp = picolcd_send_and_wait(data->hdev, REPORT_EE_WRITE, raw_data, hdev 191 drivers/hid/hid-picolcd_debugfs.c resp = picolcd_send_and_wait(data->hdev, report_id, raw_data, len_off+1); hdev 246 drivers/hid/hid-picolcd_debugfs.c resp = picolcd_send_and_wait(data->hdev, report_id, raw_data, len_off); hdev 277 drivers/hid/hid-picolcd_debugfs.c resp = picolcd_send_and_wait(data->hdev, report_id, raw_data, hdev 385 drivers/hid/hid-picolcd_debugfs.c struct hid_device *hdev, struct hid_report *report) hdev 393 drivers/hid/hid-picolcd_debugfs.c if (list_empty(&hdev->debug_list)) hdev 408 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 412 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 419 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 421 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 427 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 429 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 435 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 437 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 443 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 446 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 452 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 460 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 467 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 473 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 476 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 478 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 484 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 487 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 489 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 494 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 499 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 506 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 519 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 526 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 531 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 537 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 543 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 550 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 555 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 557 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 562 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 571 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 573 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 578 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 587 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 595 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 599 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 604 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 609 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 614 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 619 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 624 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 628 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 633 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 636 drivers/hid/hid-picolcd_debugfs.c wake_up_interruptible(&hdev->debug_wait); hdev 642 drivers/hid/hid-picolcd_debugfs.c struct hid_device *hdev, struct hid_report *report, hdev 649 drivers/hid/hid-picolcd_debugfs.c if (list_empty(&hdev->debug_list)) hdev 661 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 668 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 674 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 683 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 689 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 692 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 696 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 698 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 702 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 709 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 712 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 714 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 717 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 720 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 722 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 725 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 732 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 737 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 739 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 744 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 753 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 755 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 760 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 769 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 774 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 777 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 782 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 788 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 794 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 800 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 803 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 806 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 811 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 814 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 817 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 822 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 825 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 830 drivers/hid/hid-picolcd_debugfs.c hid_debug_event(hdev, buff); hdev 833 drivers/hid/hid-picolcd_debugfs.c wake_up_interruptible(&hdev->debug_wait); hdev 842 drivers/hid/hid-picolcd_debugfs.c struct hid_device *hdev = data->hdev; hdev 849 drivers/hid/hid-picolcd_debugfs.c hdev->debug_dir, data, &picolcd_debug_reset_fops); hdev 855 drivers/hid/hid-picolcd_debugfs.c hdev->debug_dir, data, &picolcd_debug_eeprom_fops); hdev 865 drivers/hid/hid-picolcd_debugfs.c hdev->debug_dir, data, &picolcd_debug_flash_fops); hdev 867 drivers/hid/hid-picolcd_debugfs.c hid_warn(hdev, "Unexpected FLASH access reports, please submit rdesc for review\n"); hdev 98 drivers/hid/hid-picolcd_fb.c report1 = picolcd_out_report(REPORT_LCD_CMD_DATA, data->hdev); hdev 101 drivers/hid/hid-picolcd_fb.c report2 = picolcd_out_report(REPORT_LCD_DATA, data->hdev); hdev 134 drivers/hid/hid-picolcd_fb.c hid_hw_request(data->hdev, report1, HID_REQ_SET_REPORT); hdev 135 drivers/hid/hid-picolcd_fb.c hid_hw_request(data->hdev, report2, HID_REQ_SET_REPORT); hdev 187 drivers/hid/hid-picolcd_fb.c struct hid_report *report = picolcd_out_report(REPORT_LCD_CMD, data->hdev); hdev 205 drivers/hid/hid-picolcd_fb.c hid_hw_request(data->hdev, report, HID_REQ_SET_REPORT); hdev 261 drivers/hid/hid-picolcd_fb.c hid_hw_wait(data->hdev); hdev 279 drivers/hid/hid-picolcd_fb.c hid_hw_wait(data->hdev); hdev 501 drivers/hid/hid-picolcd_fb.c struct device *dev = &data->hdev->dev; hdev 591 drivers/hid/hid-picolcd_fb.c device_remove_file(&data->hdev->dev, &dev_attr_fb_update_rate); hdev 29 drivers/hid/hid-picolcd_lcd.c struct hid_report *report = picolcd_out_report(REPORT_CONTRAST, data->hdev); hdev 39 drivers/hid/hid-picolcd_lcd.c hid_hw_request(data->hdev, report, HID_REQ_SET_REPORT); hdev 57 drivers/hid/hid-picolcd_lcd.c struct device *dev = &data->hdev->dev; hdev 39 drivers/hid/hid-picolcd_leds.c report = picolcd_out_report(REPORT_LED_STATE, data->hdev); hdev 46 drivers/hid/hid-picolcd_leds.c hid_hw_request(data->hdev, report, HID_REQ_SET_REPORT); hdev 54 drivers/hid/hid-picolcd_leds.c struct hid_device *hdev; hdev 59 drivers/hid/hid-picolcd_leds.c hdev = to_hid_device(dev); hdev 60 drivers/hid/hid-picolcd_leds.c data = hid_get_drvdata(hdev); hdev 81 drivers/hid/hid-picolcd_leds.c struct hid_device *hdev; hdev 86 drivers/hid/hid-picolcd_leds.c hdev = to_hid_device(dev); hdev 87 drivers/hid/hid-picolcd_leds.c data = hid_get_drvdata(hdev); hdev 98 drivers/hid/hid-picolcd_leds.c struct device *dev = &data->hdev->dev; hdev 178 drivers/hid/hid-pl.c static int pl_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 183 drivers/hid/hid-pl.c hdev->quirks |= HID_QUIRK_MULTI_INPUT; hdev 185 drivers/hid/hid-pl.c ret = hid_parse(hdev); hdev 187 drivers/hid/hid-pl.c hid_err(hdev, "parse failed\n"); hdev 191 drivers/hid/hid-pl.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); hdev 193 drivers/hid/hid-pl.c hid_err(hdev, "hw start failed\n"); hdev 197 drivers/hid/hid-pl.c plff_init(hdev); hdev 39 drivers/hid/hid-plantronics.c static int plantronics_input_mapping(struct hid_device *hdev, hdev 46 drivers/hid/hid-plantronics.c unsigned long plt_type = (unsigned long)hid_get_drvdata(hdev); hdev 97 drivers/hid/hid-plantronics.c hid_dbg(hdev, "usage: %08x (appl: %08x) - defaulted\n", hdev 103 drivers/hid/hid-plantronics.c hid_dbg(hdev, "usage: %08x (appl: %08x) - mapped to key %d\n", hdev 108 drivers/hid/hid-plantronics.c static unsigned long plantronics_device_type(struct hid_device *hdev) hdev 111 drivers/hid/hid-plantronics.c unsigned long plt_type = hdev->product; hdev 118 drivers/hid/hid-plantronics.c for (i = 0; i < hdev->maxcollection; i++) { hdev 119 drivers/hid/hid-plantronics.c col_page = hdev->collection[i].usage & HID_USAGE_PAGE; hdev 121 drivers/hid/hid-plantronics.c plt_type = hdev->collection[i].usage; hdev 125 drivers/hid/hid-plantronics.c plt_type = hdev->collection[i].usage; hdev 129 drivers/hid/hid-plantronics.c hid_dbg(hdev, "plt_type decoded as: %08lx\n", plt_type); hdev 133 drivers/hid/hid-plantronics.c static int plantronics_probe(struct hid_device *hdev, hdev 138 drivers/hid/hid-plantronics.c ret = hid_parse(hdev); hdev 140 drivers/hid/hid-plantronics.c hid_err(hdev, "parse failed\n"); hdev 144 drivers/hid/hid-plantronics.c hid_set_drvdata(hdev, (void *)plantronics_device_type(hdev)); hdev 146 drivers/hid/hid-plantronics.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT | hdev 149 drivers/hid/hid-plantronics.c hid_err(hdev, "hw start failed\n"); hdev 38 drivers/hid/hid-prodikeys.c struct hid_device *hdev; hdev 102 drivers/hid/hid-prodikeys.c struct hid_device *hdev = to_hid_device(dev); hdev 103 drivers/hid/hid-prodikeys.c struct pk_device *pk = hid_get_drvdata(hdev); hdev 115 drivers/hid/hid-prodikeys.c struct hid_device *hdev = to_hid_device(dev); hdev 116 drivers/hid/hid-prodikeys.c struct pk_device *pk = hid_get_drvdata(hdev); hdev 139 drivers/hid/hid-prodikeys.c struct hid_device *hdev = to_hid_device(dev); hdev 140 drivers/hid/hid-prodikeys.c struct pk_device *pk = hid_get_drvdata(hdev); hdev 152 drivers/hid/hid-prodikeys.c struct hid_device *hdev = to_hid_device(dev); hdev 153 drivers/hid/hid-prodikeys.c struct pk_device *pk = hid_get_drvdata(hdev); hdev 178 drivers/hid/hid-prodikeys.c struct hid_device *hdev = to_hid_device(dev); hdev 179 drivers/hid/hid-prodikeys.c struct pk_device *pk = hid_get_drvdata(hdev); hdev 191 drivers/hid/hid-prodikeys.c struct hid_device *hdev = to_hid_device(dev); hdev 192 drivers/hid/hid-prodikeys.c struct pk_device *pk = hid_get_drvdata(hdev); hdev 273 drivers/hid/hid-prodikeys.c struct hid_device *hdev = pm->pk->hdev; hdev 277 drivers/hid/hid-prodikeys.c &hdev->report_enum[HID_OUTPUT_REPORT].report_list, list) { hdev 282 drivers/hid/hid-prodikeys.c hid_err(hdev, "output report is empty\n"); hdev 286 drivers/hid/hid-prodikeys.c hid_err(hdev, "field count too low\n"); hdev 298 drivers/hid/hid-prodikeys.c struct hid_device *hdev = pm->pk->hdev; hdev 303 drivers/hid/hid-prodikeys.c hid_hw_request(hdev, report, HID_REQ_SET_REPORT); hdev 625 drivers/hid/hid-prodikeys.c err = snd_card_new(&pm->pk->hdev->dev, index[dev], id[dev], hdev 663 drivers/hid/hid-prodikeys.c err = device_create_file(&pm->pk->hdev->dev, hdev 671 drivers/hid/hid-prodikeys.c err = device_create_file(&pm->pk->hdev->dev, hdev 679 drivers/hid/hid-prodikeys.c err = device_create_file(&pm->pk->hdev->dev, hdev 709 drivers/hid/hid-prodikeys.c device_remove_file(&pm->pk->hdev->dev, sysfs_device_attr_octave); hdev 711 drivers/hid/hid-prodikeys.c device_remove_file(&pm->pk->hdev->dev, sysfs_device_attr_sustain); hdev 713 drivers/hid/hid-prodikeys.c device_remove_file(&pm->pk->hdev->dev, sysfs_device_attr_channel); hdev 727 drivers/hid/hid-prodikeys.c device_remove_file(&pm->pk->hdev->dev, hdev 729 drivers/hid/hid-prodikeys.c device_remove_file(&pm->pk->hdev->dev, hdev 731 drivers/hid/hid-prodikeys.c device_remove_file(&pm->pk->hdev->dev, hdev 744 drivers/hid/hid-prodikeys.c static __u8 *pk_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 750 drivers/hid/hid-prodikeys.c hid_info(hdev, hdev 758 drivers/hid/hid-prodikeys.c static int pk_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 762 drivers/hid/hid-prodikeys.c struct pk_device *pk = hid_get_drvdata(hdev); hdev 777 drivers/hid/hid-prodikeys.c static int pk_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 780 drivers/hid/hid-prodikeys.c struct pk_device *pk = hid_get_drvdata(hdev); hdev 798 drivers/hid/hid-prodikeys.c static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 801 drivers/hid/hid-prodikeys.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 809 drivers/hid/hid-prodikeys.c hid_err(hdev, "can't alloc descriptor\n"); hdev 813 drivers/hid/hid-prodikeys.c pk->hdev = hdev; hdev 817 drivers/hid/hid-prodikeys.c hid_err(hdev, "can't alloc descriptor\n"); hdev 826 drivers/hid/hid-prodikeys.c hid_set_drvdata(hdev, pk); hdev 828 drivers/hid/hid-prodikeys.c ret = hid_parse(hdev); hdev 830 drivers/hid/hid-prodikeys.c hid_err(hdev, "hid parse failed\n"); hdev 835 drivers/hid/hid-prodikeys.c hdev->quirks |= HID_QUIRK_NOGET; hdev 838 drivers/hid/hid-prodikeys.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 840 drivers/hid/hid-prodikeys.c hid_err(hdev, "hw start failed\n"); hdev 850 drivers/hid/hid-prodikeys.c hid_hw_stop(hdev); hdev 859 drivers/hid/hid-prodikeys.c static void pk_remove(struct hid_device *hdev) hdev 861 drivers/hid/hid-prodikeys.c struct pk_device *pk = hid_get_drvdata(hdev); hdev 870 drivers/hid/hid-prodikeys.c hid_hw_stop(hdev); hdev 925 drivers/hid/hid-quirks.c bool hid_ignore(struct hid_device *hdev) hdev 929 drivers/hid/hid-quirks.c if (hdev->quirks & HID_QUIRK_NO_IGNORE) hdev 931 drivers/hid/hid-quirks.c if (hdev->quirks & HID_QUIRK_IGNORE) hdev 934 drivers/hid/hid-quirks.c switch (hdev->vendor) { hdev 937 drivers/hid/hid-quirks.c if (hdev->product >= USB_DEVICE_ID_CODEMERCS_IOW_FIRST && hdev 938 drivers/hid/hid-quirks.c hdev->product <= USB_DEVICE_ID_CODEMERCS_IOW_LAST) hdev 942 drivers/hid/hid-quirks.c if (hdev->product >= USB_DEVICE_ID_LOGITECH_HARMONY_FIRST && hdev 943 drivers/hid/hid-quirks.c hdev->product <= USB_DEVICE_ID_LOGITECH_HARMONY_LAST) hdev 952 drivers/hid/hid-quirks.c if (hdev->product == USB_DEVICE_ID_LOGITECH_AUDIOHUB && hdev 953 drivers/hid/hid-quirks.c !strcmp(hdev->name, "HOLTEK B-LINK USB Audio ")) hdev 957 drivers/hid/hid-quirks.c if (hdev->product >= USB_DEVICE_ID_SOUNDGRAPH_IMON_FIRST && hdev 958 drivers/hid/hid-quirks.c hdev->product <= USB_DEVICE_ID_SOUNDGRAPH_IMON_LAST) hdev 962 drivers/hid/hid-quirks.c if (hdev->product >= USB_DEVICE_ID_HANWANG_TABLET_FIRST && hdev 963 drivers/hid/hid-quirks.c hdev->product <= USB_DEVICE_ID_HANWANG_TABLET_LAST) hdev 967 drivers/hid/hid-quirks.c if (hdev->product == USB_DEVICE_ID_JESS_YUREX && hdev 968 drivers/hid/hid-quirks.c hdev->type == HID_TYPE_USBNONE) hdev 973 drivers/hid/hid-quirks.c if ((hdev->product >= USB_DEVICE_ID_VELLEMAN_K8055_FIRST && hdev 974 drivers/hid/hid-quirks.c hdev->product <= USB_DEVICE_ID_VELLEMAN_K8055_LAST) || hdev 975 drivers/hid/hid-quirks.c (hdev->product >= USB_DEVICE_ID_VELLEMAN_K8061_FIRST && hdev 976 drivers/hid/hid-quirks.c hdev->product <= USB_DEVICE_ID_VELLEMAN_K8061_LAST)) hdev 986 drivers/hid/hid-quirks.c if (hdev->product == USB_DEVICE_ID_ATMEL_V_USB && hdev 987 drivers/hid/hid-quirks.c hdev->bus == BUS_USB && hdev 988 drivers/hid/hid-quirks.c strncmp(hdev->name, "www.masterkit.ru MA901", 22) == 0) hdev 997 drivers/hid/hid-quirks.c if ((hdev->product == 0x0401 || hdev->product == 0x0400)) hdev 999 drivers/hid/hid-quirks.c if (!strncmp(hdev->name, elan_acpi_id[i].id, hdev 1005 drivers/hid/hid-quirks.c if (hdev->type == HID_TYPE_USBMOUSE && hdev 1006 drivers/hid/hid-quirks.c hid_match_id(hdev, hid_mouse_ignore_list)) hdev 1009 drivers/hid/hid-quirks.c return !!hid_match_id(hdev, hid_ignore_list); hdev 1035 drivers/hid/hid-quirks.c static struct hid_device_id *hid_exists_dquirk(const struct hid_device *hdev) hdev 1041 drivers/hid/hid-quirks.c if (hid_match_one_id(hdev, &q->hid_bl_item)) { hdev 1071 drivers/hid/hid-quirks.c struct hid_device *hdev; hdev 1076 drivers/hid/hid-quirks.c hdev = kzalloc(sizeof(*hdev), GFP_KERNEL); hdev 1077 drivers/hid/hid-quirks.c if (!hdev) hdev 1086 drivers/hid/hid-quirks.c hdev->bus = q_new->hid_bl_item.bus = id->bus; hdev 1087 drivers/hid/hid-quirks.c hdev->group = q_new->hid_bl_item.group = id->group; hdev 1088 drivers/hid/hid-quirks.c hdev->vendor = q_new->hid_bl_item.vendor = id->vendor; hdev 1089 drivers/hid/hid-quirks.c hdev->product = q_new->hid_bl_item.product = id->product; hdev 1096 drivers/hid/hid-quirks.c if (hid_match_one_id(hdev, &q->hid_bl_item)) { hdev 1113 drivers/hid/hid-quirks.c kfree(hdev); hdev 1199 drivers/hid/hid-quirks.c static unsigned long hid_gets_squirk(const struct hid_device *hdev) hdev 1204 drivers/hid/hid-quirks.c if (hid_match_id(hdev, hid_ignore_list)) hdev 1207 drivers/hid/hid-quirks.c if (hid_match_id(hdev, hid_have_special_driver)) hdev 1210 drivers/hid/hid-quirks.c bl_entry = hid_match_id(hdev, hid_quirks); hdev 1216 drivers/hid/hid-quirks.c quirks, hdev->vendor, hdev->product); hdev 1229 drivers/hid/hid-quirks.c unsigned long hid_lookup_quirk(const struct hid_device *hdev) hdev 1235 drivers/hid/hid-quirks.c if (hdev->bus == BUS_USB && hdev 1236 drivers/hid/hid-quirks.c hdev->vendor == USB_VENDOR_ID_NCR && hdev 1237 drivers/hid/hid-quirks.c hdev->product >= USB_DEVICE_ID_NCR_FIRST && hdev 1238 drivers/hid/hid-quirks.c hdev->product <= USB_DEVICE_ID_NCR_LAST) hdev 1242 drivers/hid/hid-quirks.c if (hdev->bus == BUS_USB && hdev->vendor == USB_VENDOR_ID_JABRA) { hdev 1243 drivers/hid/hid-quirks.c switch (hdev->product) { hdev 1245 drivers/hid/hid-quirks.c if (hdev->version < 0x0111) hdev 1249 drivers/hid/hid-quirks.c if (hdev->version < 0x0214) hdev 1256 drivers/hid/hid-quirks.c quirk_entry = hid_exists_dquirk(hdev); hdev 1260 drivers/hid/hid-quirks.c quirks = hid_gets_squirk(hdev); hdev 36 drivers/hid/hid-redragon.c static __u8 *redragon_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 40 drivers/hid/hid-redragon.c dev_info(&hdev->dev, "Fixing Redragon ASURA report descriptor.\n"); hdev 19 drivers/hid/hid-retrode.c static int retrode_input_configured(struct hid_device *hdev, hdev 42 drivers/hid/hid-retrode.c hid_err(hdev, "Got unhandled report id %d\n", field->report->id); hdev 47 drivers/hid/hid-retrode.c name = devm_kasprintf(&hdev->dev, GFP_KERNEL, hdev 51 drivers/hid/hid-retrode.c name = devm_kasprintf(&hdev->dev, GFP_KERNEL, hdev 62 drivers/hid/hid-retrode.c static int retrode_probe(struct hid_device *hdev, hdev 69 drivers/hid/hid-retrode.c hdev->quirks |= HID_QUIRK_MULTI_INPUT; hdev 71 drivers/hid/hid-retrode.c ret = hid_parse(hdev); hdev 75 drivers/hid/hid-retrode.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 95 drivers/hid/hid-rmi.c struct hid_device *hdev; hdev 105 drivers/hid/hid-rmi.c static int rmi_write_report(struct hid_device *hdev, u8 *report, int len); hdev 121 drivers/hid/hid-rmi.c static int rmi_set_page(struct hid_device *hdev, u8 page) hdev 123 drivers/hid/hid-rmi.c struct rmi_data *data = hid_get_drvdata(hdev); hdev 131 drivers/hid/hid-rmi.c retval = rmi_write_report(hdev, data->writeReport, hdev 134 drivers/hid/hid-rmi.c dev_err(&hdev->dev, hdev 143 drivers/hid/hid-rmi.c static int rmi_set_mode(struct hid_device *hdev, u8 mode) hdev 153 drivers/hid/hid-rmi.c ret = hid_hw_raw_request(hdev, RMI_SET_RMI_MODE_REPORT_ID, buf, hdev 157 drivers/hid/hid-rmi.c dev_err(&hdev->dev, "unable to set rmi mode to %d (%d)\n", mode, hdev 165 drivers/hid/hid-rmi.c static int rmi_write_report(struct hid_device *hdev, u8 *report, int len) hdev 167 drivers/hid/hid-rmi.c struct rmi_data *data = hid_get_drvdata(hdev); hdev 174 drivers/hid/hid-rmi.c ret = hid_hw_raw_request(hdev, report[0], report, hdev 177 drivers/hid/hid-rmi.c ret = hid_hw_output_report(hdev, (void *)report, len); hdev 181 drivers/hid/hid-rmi.c dev_err(&hdev->dev, "failed to write hid report (%d)\n", ret); hdev 192 drivers/hid/hid-rmi.c struct hid_device *hdev = data->hdev; hdev 202 drivers/hid/hid-rmi.c ret = rmi_set_page(hdev, RMI_PAGE(addr)); hdev 217 drivers/hid/hid-rmi.c ret = rmi_write_report(hdev, data->writeReport, hdev 221 drivers/hid/hid-rmi.c dev_err(&hdev->dev, hdev 233 drivers/hid/hid-rmi.c hid_warn(hdev, "%s: timeout elapsed\n", hdev 265 drivers/hid/hid-rmi.c struct hid_device *hdev = data->hdev; hdev 271 drivers/hid/hid-rmi.c ret = rmi_set_page(hdev, RMI_PAGE(addr)); hdev 282 drivers/hid/hid-rmi.c ret = rmi_write_report(hdev, data->writeReport, hdev 285 drivers/hid/hid-rmi.c dev_err(&hdev->dev, hdev 297 drivers/hid/hid-rmi.c static int rmi_reset_attn_mode(struct hid_device *hdev) hdev 299 drivers/hid/hid-rmi.c struct rmi_data *data = hid_get_drvdata(hdev); hdev 303 drivers/hid/hid-rmi.c ret = rmi_set_mode(hdev, RMI_MODE_ATTN_REPORTS); hdev 319 drivers/hid/hid-rmi.c rmi_reset_attn_mode(hdata->hdev); hdev 322 drivers/hid/hid-rmi.c static int rmi_input_event(struct hid_device *hdev, u8 *data, int size) hdev 324 drivers/hid/hid-rmi.c struct rmi_data *hdata = hid_get_drvdata(hdev); hdev 342 drivers/hid/hid-rmi.c static int rmi_read_data_event(struct hid_device *hdev, u8 *data, int size) hdev 344 drivers/hid/hid-rmi.c struct rmi_data *hdata = hid_get_drvdata(hdev); hdev 347 drivers/hid/hid-rmi.c hid_dbg(hdev, "no read request pending\n"); hdev 359 drivers/hid/hid-rmi.c static int rmi_check_sanity(struct hid_device *hdev, u8 *data, int size) hdev 375 drivers/hid/hid-rmi.c static int rmi_raw_event(struct hid_device *hdev, hdev 378 drivers/hid/hid-rmi.c struct rmi_data *hdata = hid_get_drvdata(hdev); hdev 383 drivers/hid/hid-rmi.c size = rmi_check_sanity(hdev, data, size); hdev 389 drivers/hid/hid-rmi.c return rmi_read_data_event(hdev, data, size); hdev 391 drivers/hid/hid-rmi.c return rmi_input_event(hdev, data, size); hdev 399 drivers/hid/hid-rmi.c static int rmi_event(struct hid_device *hdev, struct hid_field *field, hdev 402 drivers/hid/hid-rmi.c struct rmi_data *data = hid_get_drvdata(hdev); hdev 442 drivers/hid/hid-rmi.c static int rmi_suspend(struct hid_device *hdev, pm_message_t message) hdev 444 drivers/hid/hid-rmi.c struct rmi_data *data = hid_get_drvdata(hdev); hdev 453 drivers/hid/hid-rmi.c hid_warn(hdev, "Failed to suspend device: %d\n", ret); hdev 460 drivers/hid/hid-rmi.c static int rmi_post_resume(struct hid_device *hdev) hdev 462 drivers/hid/hid-rmi.c struct rmi_data *data = hid_get_drvdata(hdev); hdev 470 drivers/hid/hid-rmi.c ret = hid_hw_open(hdev); hdev 474 drivers/hid/hid-rmi.c ret = rmi_reset_attn_mode(hdev); hdev 480 drivers/hid/hid-rmi.c hid_warn(hdev, "Failed to resume device: %d\n", ret); hdev 485 drivers/hid/hid-rmi.c hid_hw_close(hdev); hdev 493 drivers/hid/hid-rmi.c struct hid_device *hdev = data->hdev; hdev 495 drivers/hid/hid-rmi.c return rmi_reset_attn_mode(hdev); hdev 498 drivers/hid/hid-rmi.c static int rmi_input_configured(struct hid_device *hdev, struct hid_input *hi) hdev 500 drivers/hid/hid-rmi.c struct rmi_data *data = hid_get_drvdata(hdev); hdev 509 drivers/hid/hid-rmi.c hid_dbg(hdev, "Opening low level driver\n"); hdev 510 drivers/hid/hid-rmi.c ret = hid_hw_open(hdev); hdev 515 drivers/hid/hid-rmi.c hid_device_io_start(hdev); hdev 517 drivers/hid/hid-rmi.c ret = rmi_set_mode(hdev, RMI_MODE_ATTN_REPORTS); hdev 519 drivers/hid/hid-rmi.c dev_err(&hdev->dev, "failed to set rmi mode\n"); hdev 523 drivers/hid/hid-rmi.c ret = rmi_set_page(hdev, 0); hdev 525 drivers/hid/hid-rmi.c dev_err(&hdev->dev, "failed to set page select to 0.\n"); hdev 531 drivers/hid/hid-rmi.c dev_err(&hdev->dev, "failed to register transport driver\n"); hdev 538 drivers/hid/hid-rmi.c hid_device_io_stop(hdev); hdev 539 drivers/hid/hid-rmi.c hid_hw_close(hdev); hdev 543 drivers/hid/hid-rmi.c static int rmi_input_mapping(struct hid_device *hdev, hdev 547 drivers/hid/hid-rmi.c struct rmi_data *data = hid_get_drvdata(hdev); hdev 564 drivers/hid/hid-rmi.c static int rmi_check_valid_report_id(struct hid_device *hdev, unsigned type, hdev 569 drivers/hid/hid-rmi.c *report = hdev->report_enum[type].report_id_hash[id]; hdev 623 drivers/hid/hid-rmi.c static int rmi_setup_irq_domain(struct hid_device *hdev) hdev 625 drivers/hid/hid-rmi.c struct rmi_data *hdata = hid_get_drvdata(hdev); hdev 628 drivers/hid/hid-rmi.c hdata->domain = irq_domain_create_linear(hdev->dev.fwnode, 1, hdev 633 drivers/hid/hid-rmi.c ret = devm_add_action_or_reset(&hdev->dev, &rmi_irq_teardown, hdata); hdev 639 drivers/hid/hid-rmi.c hid_err(hdev, "Can't allocate an IRQ\n"); hdev 646 drivers/hid/hid-rmi.c static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 655 drivers/hid/hid-rmi.c data = devm_kzalloc(&hdev->dev, sizeof(struct rmi_data), GFP_KERNEL); hdev 660 drivers/hid/hid-rmi.c data->hdev = hdev; hdev 662 drivers/hid/hid-rmi.c hid_set_drvdata(hdev, data); hdev 664 drivers/hid/hid-rmi.c hdev->quirks |= HID_QUIRK_NO_INIT_REPORTS; hdev 665 drivers/hid/hid-rmi.c hdev->quirks |= HID_QUIRK_NO_INPUT_SYNC; hdev 667 drivers/hid/hid-rmi.c ret = hid_parse(hdev); hdev 669 drivers/hid/hid-rmi.c hid_err(hdev, "parse failed\n"); hdev 680 drivers/hid/hid-rmi.c if (!rmi_check_valid_report_id(hdev, HID_FEATURE_REPORT, hdev 682 drivers/hid/hid-rmi.c hid_dbg(hdev, "device does not have set mode feature report\n"); hdev 686 drivers/hid/hid-rmi.c if (!rmi_check_valid_report_id(hdev, HID_INPUT_REPORT, hdev 688 drivers/hid/hid-rmi.c hid_dbg(hdev, "device does not have attention input report\n"); hdev 694 drivers/hid/hid-rmi.c if (!rmi_check_valid_report_id(hdev, HID_OUTPUT_REPORT, hdev 696 drivers/hid/hid-rmi.c hid_dbg(hdev, hdev 706 drivers/hid/hid-rmi.c data->writeReport = devm_kzalloc(&hdev->dev, alloc_size, GFP_KERNEL); hdev 708 drivers/hid/hid-rmi.c hid_err(hdev, "failed to allocate buffer for HID reports\n"); hdev 718 drivers/hid/hid-rmi.c ret = rmi_setup_irq_domain(hdev); hdev 720 drivers/hid/hid-rmi.c hid_err(hdev, "failed to allocate IRQ domain\n"); hdev 727 drivers/hid/hid-rmi.c data->xport.dev = hdev->dev.parent; hdev 734 drivers/hid/hid-rmi.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 736 drivers/hid/hid-rmi.c hid_err(hdev, "hw start failed\n"); hdev 743 drivers/hid/hid-rmi.c static void rmi_remove(struct hid_device *hdev) hdev 745 drivers/hid/hid-rmi.c struct rmi_data *hdata = hid_get_drvdata(hdev); hdev 754 drivers/hid/hid-rmi.c hid_hw_stop(hdev); hdev 286 drivers/hid/hid-roccat-arvo.c static int arvo_init_specials(struct hid_device *hdev) hdev 288 drivers/hid/hid-roccat-arvo.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 295 drivers/hid/hid-roccat-arvo.c hid_set_drvdata(hdev, NULL); hdev 301 drivers/hid/hid-roccat-arvo.c hid_err(hdev, "can't alloc device descriptor\n"); hdev 304 drivers/hid/hid-roccat-arvo.c hid_set_drvdata(hdev, arvo); hdev 308 drivers/hid/hid-roccat-arvo.c hid_err(hdev, "couldn't init struct arvo_device\n"); hdev 312 drivers/hid/hid-roccat-arvo.c retval = roccat_connect(arvo_class, hdev, hdev 315 drivers/hid/hid-roccat-arvo.c hid_err(hdev, "couldn't init char dev\n"); hdev 327 drivers/hid/hid-roccat-arvo.c static void arvo_remove_specials(struct hid_device *hdev) hdev 329 drivers/hid/hid-roccat-arvo.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 336 drivers/hid/hid-roccat-arvo.c arvo = hid_get_drvdata(hdev); hdev 342 drivers/hid/hid-roccat-arvo.c static int arvo_probe(struct hid_device *hdev, hdev 347 drivers/hid/hid-roccat-arvo.c retval = hid_parse(hdev); hdev 349 drivers/hid/hid-roccat-arvo.c hid_err(hdev, "parse failed\n"); hdev 353 drivers/hid/hid-roccat-arvo.c retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 355 drivers/hid/hid-roccat-arvo.c hid_err(hdev, "hw start failed\n"); hdev 359 drivers/hid/hid-roccat-arvo.c retval = arvo_init_specials(hdev); hdev 361 drivers/hid/hid-roccat-arvo.c hid_err(hdev, "couldn't install keyboard\n"); hdev 368 drivers/hid/hid-roccat-arvo.c hid_hw_stop(hdev); hdev 373 drivers/hid/hid-roccat-arvo.c static void arvo_remove(struct hid_device *hdev) hdev 375 drivers/hid/hid-roccat-arvo.c arvo_remove_specials(hdev); hdev 376 drivers/hid/hid-roccat-arvo.c hid_hw_stop(hdev); hdev 400 drivers/hid/hid-roccat-arvo.c static int arvo_raw_event(struct hid_device *hdev, hdev 403 drivers/hid/hid-roccat-arvo.c struct arvo_device *arvo = hid_get_drvdata(hdev); hdev 266 drivers/hid/hid-roccat-isku.c static int isku_init_specials(struct hid_device *hdev) hdev 268 drivers/hid/hid-roccat-isku.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 275 drivers/hid/hid-roccat-isku.c hid_set_drvdata(hdev, NULL); hdev 281 drivers/hid/hid-roccat-isku.c hid_err(hdev, "can't alloc device descriptor\n"); hdev 284 drivers/hid/hid-roccat-isku.c hid_set_drvdata(hdev, isku); hdev 288 drivers/hid/hid-roccat-isku.c hid_err(hdev, "couldn't init struct isku_device\n"); hdev 292 drivers/hid/hid-roccat-isku.c retval = roccat_connect(isku_class, hdev, hdev 295 drivers/hid/hid-roccat-isku.c hid_err(hdev, "couldn't init char dev\n"); hdev 307 drivers/hid/hid-roccat-isku.c static void isku_remove_specials(struct hid_device *hdev) hdev 309 drivers/hid/hid-roccat-isku.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 316 drivers/hid/hid-roccat-isku.c isku = hid_get_drvdata(hdev); hdev 322 drivers/hid/hid-roccat-isku.c static int isku_probe(struct hid_device *hdev, hdev 327 drivers/hid/hid-roccat-isku.c retval = hid_parse(hdev); hdev 329 drivers/hid/hid-roccat-isku.c hid_err(hdev, "parse failed\n"); hdev 333 drivers/hid/hid-roccat-isku.c retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 335 drivers/hid/hid-roccat-isku.c hid_err(hdev, "hw start failed\n"); hdev 339 drivers/hid/hid-roccat-isku.c retval = isku_init_specials(hdev); hdev 341 drivers/hid/hid-roccat-isku.c hid_err(hdev, "couldn't install keyboard\n"); hdev 348 drivers/hid/hid-roccat-isku.c hid_hw_stop(hdev); hdev 353 drivers/hid/hid-roccat-isku.c static void isku_remove(struct hid_device *hdev) hdev 355 drivers/hid/hid-roccat-isku.c isku_remove_specials(hdev); hdev 356 drivers/hid/hid-roccat-isku.c hid_hw_stop(hdev); hdev 395 drivers/hid/hid-roccat-isku.c static int isku_raw_event(struct hid_device *hdev, hdev 398 drivers/hid/hid-roccat-isku.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 399 drivers/hid/hid-roccat-isku.c struct isku_device *isku = hid_get_drvdata(hdev); hdev 685 drivers/hid/hid-roccat-kone.c static int kone_init_specials(struct hid_device *hdev) hdev 687 drivers/hid/hid-roccat-kone.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 698 drivers/hid/hid-roccat-kone.c hid_set_drvdata(hdev, kone); hdev 702 drivers/hid/hid-roccat-kone.c hid_err(hdev, "couldn't init struct kone_device\n"); hdev 706 drivers/hid/hid-roccat-kone.c retval = roccat_connect(kone_class, hdev, hdev 709 drivers/hid/hid-roccat-kone.c hid_err(hdev, "couldn't init char dev\n"); hdev 716 drivers/hid/hid-roccat-kone.c hid_set_drvdata(hdev, NULL); hdev 725 drivers/hid/hid-roccat-kone.c static void kone_remove_specials(struct hid_device *hdev) hdev 727 drivers/hid/hid-roccat-kone.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 732 drivers/hid/hid-roccat-kone.c kone = hid_get_drvdata(hdev); hdev 735 drivers/hid/hid-roccat-kone.c kfree(hid_get_drvdata(hdev)); hdev 739 drivers/hid/hid-roccat-kone.c static int kone_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 743 drivers/hid/hid-roccat-kone.c retval = hid_parse(hdev); hdev 745 drivers/hid/hid-roccat-kone.c hid_err(hdev, "parse failed\n"); hdev 749 drivers/hid/hid-roccat-kone.c retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 751 drivers/hid/hid-roccat-kone.c hid_err(hdev, "hw start failed\n"); hdev 755 drivers/hid/hid-roccat-kone.c retval = kone_init_specials(hdev); hdev 757 drivers/hid/hid-roccat-kone.c hid_err(hdev, "couldn't install mouse\n"); hdev 764 drivers/hid/hid-roccat-kone.c hid_hw_stop(hdev); hdev 769 drivers/hid/hid-roccat-kone.c static void kone_remove(struct hid_device *hdev) hdev 771 drivers/hid/hid-roccat-kone.c kone_remove_specials(hdev); hdev 772 drivers/hid/hid-roccat-kone.c hid_hw_stop(hdev); hdev 829 drivers/hid/hid-roccat-kone.c static int kone_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 832 drivers/hid/hid-roccat-kone.c struct kone_device *kone = hid_get_drvdata(hdev); hdev 374 drivers/hid/hid-roccat-koneplus.c static int koneplus_init_specials(struct hid_device *hdev) hdev 376 drivers/hid/hid-roccat-koneplus.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 386 drivers/hid/hid-roccat-koneplus.c hid_err(hdev, "can't alloc device descriptor\n"); hdev 389 drivers/hid/hid-roccat-koneplus.c hid_set_drvdata(hdev, koneplus); hdev 393 drivers/hid/hid-roccat-koneplus.c hid_err(hdev, "couldn't init struct koneplus_device\n"); hdev 397 drivers/hid/hid-roccat-koneplus.c retval = roccat_connect(koneplus_class, hdev, hdev 400 drivers/hid/hid-roccat-koneplus.c hid_err(hdev, "couldn't init char dev\n"); hdev 406 drivers/hid/hid-roccat-koneplus.c hid_set_drvdata(hdev, NULL); hdev 415 drivers/hid/hid-roccat-koneplus.c static void koneplus_remove_specials(struct hid_device *hdev) hdev 417 drivers/hid/hid-roccat-koneplus.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 422 drivers/hid/hid-roccat-koneplus.c koneplus = hid_get_drvdata(hdev); hdev 429 drivers/hid/hid-roccat-koneplus.c static int koneplus_probe(struct hid_device *hdev, hdev 434 drivers/hid/hid-roccat-koneplus.c retval = hid_parse(hdev); hdev 436 drivers/hid/hid-roccat-koneplus.c hid_err(hdev, "parse failed\n"); hdev 440 drivers/hid/hid-roccat-koneplus.c retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 442 drivers/hid/hid-roccat-koneplus.c hid_err(hdev, "hw start failed\n"); hdev 446 drivers/hid/hid-roccat-koneplus.c retval = koneplus_init_specials(hdev); hdev 448 drivers/hid/hid-roccat-koneplus.c hid_err(hdev, "couldn't install mouse\n"); hdev 455 drivers/hid/hid-roccat-koneplus.c hid_hw_stop(hdev); hdev 460 drivers/hid/hid-roccat-koneplus.c static void koneplus_remove(struct hid_device *hdev) hdev 462 drivers/hid/hid-roccat-koneplus.c koneplus_remove_specials(hdev); hdev 463 drivers/hid/hid-roccat-koneplus.c hid_hw_stop(hdev); hdev 507 drivers/hid/hid-roccat-koneplus.c static int koneplus_raw_event(struct hid_device *hdev, hdev 510 drivers/hid/hid-roccat-koneplus.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 511 drivers/hid/hid-roccat-koneplus.c struct koneplus_device *koneplus = hid_get_drvdata(hdev); hdev 75 drivers/hid/hid-roccat-konepure.c static int konepure_init_specials(struct hid_device *hdev) hdev 77 drivers/hid/hid-roccat-konepure.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 84 drivers/hid/hid-roccat-konepure.c hid_set_drvdata(hdev, NULL); hdev 90 drivers/hid/hid-roccat-konepure.c hid_err(hdev, "can't alloc device descriptor\n"); hdev 93 drivers/hid/hid-roccat-konepure.c hid_set_drvdata(hdev, konepure); hdev 97 drivers/hid/hid-roccat-konepure.c hid_err(hdev, "couldn't init KonePure device\n"); hdev 101 drivers/hid/hid-roccat-konepure.c retval = roccat_connect(konepure_class, hdev, hdev 104 drivers/hid/hid-roccat-konepure.c hid_err(hdev, "couldn't init char dev\n"); hdev 116 drivers/hid/hid-roccat-konepure.c static void konepure_remove_specials(struct hid_device *hdev) hdev 118 drivers/hid/hid-roccat-konepure.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 125 drivers/hid/hid-roccat-konepure.c konepure = hid_get_drvdata(hdev); hdev 131 drivers/hid/hid-roccat-konepure.c static int konepure_probe(struct hid_device *hdev, hdev 136 drivers/hid/hid-roccat-konepure.c retval = hid_parse(hdev); hdev 138 drivers/hid/hid-roccat-konepure.c hid_err(hdev, "parse failed\n"); hdev 142 drivers/hid/hid-roccat-konepure.c retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 144 drivers/hid/hid-roccat-konepure.c hid_err(hdev, "hw start failed\n"); hdev 148 drivers/hid/hid-roccat-konepure.c retval = konepure_init_specials(hdev); hdev 150 drivers/hid/hid-roccat-konepure.c hid_err(hdev, "couldn't install mouse\n"); hdev 157 drivers/hid/hid-roccat-konepure.c hid_hw_stop(hdev); hdev 162 drivers/hid/hid-roccat-konepure.c static void konepure_remove(struct hid_device *hdev) hdev 164 drivers/hid/hid-roccat-konepure.c konepure_remove_specials(hdev); hdev 165 drivers/hid/hid-roccat-konepure.c hid_hw_stop(hdev); hdev 168 drivers/hid/hid-roccat-konepure.c static int konepure_raw_event(struct hid_device *hdev, hdev 171 drivers/hid/hid-roccat-konepure.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 172 drivers/hid/hid-roccat-konepure.c struct roccat_common2_device *konepure = hid_get_drvdata(hdev); hdev 443 drivers/hid/hid-roccat-kovaplus.c static int kovaplus_init_specials(struct hid_device *hdev) hdev 445 drivers/hid/hid-roccat-kovaplus.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 455 drivers/hid/hid-roccat-kovaplus.c hid_err(hdev, "can't alloc device descriptor\n"); hdev 458 drivers/hid/hid-roccat-kovaplus.c hid_set_drvdata(hdev, kovaplus); hdev 462 drivers/hid/hid-roccat-kovaplus.c hid_err(hdev, "couldn't init struct kovaplus_device\n"); hdev 466 drivers/hid/hid-roccat-kovaplus.c retval = roccat_connect(kovaplus_class, hdev, hdev 469 drivers/hid/hid-roccat-kovaplus.c hid_err(hdev, "couldn't init char dev\n"); hdev 476 drivers/hid/hid-roccat-kovaplus.c hid_set_drvdata(hdev, NULL); hdev 485 drivers/hid/hid-roccat-kovaplus.c static void kovaplus_remove_specials(struct hid_device *hdev) hdev 487 drivers/hid/hid-roccat-kovaplus.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 492 drivers/hid/hid-roccat-kovaplus.c kovaplus = hid_get_drvdata(hdev); hdev 499 drivers/hid/hid-roccat-kovaplus.c static int kovaplus_probe(struct hid_device *hdev, hdev 504 drivers/hid/hid-roccat-kovaplus.c retval = hid_parse(hdev); hdev 506 drivers/hid/hid-roccat-kovaplus.c hid_err(hdev, "parse failed\n"); hdev 510 drivers/hid/hid-roccat-kovaplus.c retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 512 drivers/hid/hid-roccat-kovaplus.c hid_err(hdev, "hw start failed\n"); hdev 516 drivers/hid/hid-roccat-kovaplus.c retval = kovaplus_init_specials(hdev); hdev 518 drivers/hid/hid-roccat-kovaplus.c hid_err(hdev, "couldn't install mouse\n"); hdev 525 drivers/hid/hid-roccat-kovaplus.c hid_hw_stop(hdev); hdev 530 drivers/hid/hid-roccat-kovaplus.c static void kovaplus_remove(struct hid_device *hdev) hdev 532 drivers/hid/hid-roccat-kovaplus.c kovaplus_remove_specials(hdev); hdev 533 drivers/hid/hid-roccat-kovaplus.c hid_hw_stop(hdev); hdev 598 drivers/hid/hid-roccat-kovaplus.c static int kovaplus_raw_event(struct hid_device *hdev, hdev 601 drivers/hid/hid-roccat-kovaplus.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 602 drivers/hid/hid-roccat-kovaplus.c struct kovaplus_device *kovaplus = hid_get_drvdata(hdev); hdev 115 drivers/hid/hid-roccat-lua.c static int lua_init_specials(struct hid_device *hdev) hdev 117 drivers/hid/hid-roccat-lua.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 124 drivers/hid/hid-roccat-lua.c hid_err(hdev, "can't alloc device descriptor\n"); hdev 127 drivers/hid/hid-roccat-lua.c hid_set_drvdata(hdev, lua); hdev 131 drivers/hid/hid-roccat-lua.c hid_err(hdev, "couldn't init struct lua_device\n"); hdev 137 drivers/hid/hid-roccat-lua.c hid_err(hdev, "cannot create sysfs files\n"); hdev 147 drivers/hid/hid-roccat-lua.c static void lua_remove_specials(struct hid_device *hdev) hdev 149 drivers/hid/hid-roccat-lua.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 154 drivers/hid/hid-roccat-lua.c lua = hid_get_drvdata(hdev); hdev 158 drivers/hid/hid-roccat-lua.c static int lua_probe(struct hid_device *hdev, hdev 163 drivers/hid/hid-roccat-lua.c retval = hid_parse(hdev); hdev 165 drivers/hid/hid-roccat-lua.c hid_err(hdev, "parse failed\n"); hdev 169 drivers/hid/hid-roccat-lua.c retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 171 drivers/hid/hid-roccat-lua.c hid_err(hdev, "hw start failed\n"); hdev 175 drivers/hid/hid-roccat-lua.c retval = lua_init_specials(hdev); hdev 177 drivers/hid/hid-roccat-lua.c hid_err(hdev, "couldn't install mouse\n"); hdev 184 drivers/hid/hid-roccat-lua.c hid_hw_stop(hdev); hdev 189 drivers/hid/hid-roccat-lua.c static void lua_remove(struct hid_device *hdev) hdev 191 drivers/hid/hid-roccat-lua.c lua_remove_specials(hdev); hdev 192 drivers/hid/hid-roccat-lua.c hid_hw_stop(hdev); hdev 393 drivers/hid/hid-roccat-pyra.c static int pyra_init_specials(struct hid_device *hdev) hdev 395 drivers/hid/hid-roccat-pyra.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 405 drivers/hid/hid-roccat-pyra.c hid_err(hdev, "can't alloc device descriptor\n"); hdev 408 drivers/hid/hid-roccat-pyra.c hid_set_drvdata(hdev, pyra); hdev 412 drivers/hid/hid-roccat-pyra.c hid_err(hdev, "couldn't init struct pyra_device\n"); hdev 416 drivers/hid/hid-roccat-pyra.c retval = roccat_connect(pyra_class, hdev, hdev 419 drivers/hid/hid-roccat-pyra.c hid_err(hdev, "couldn't init char dev\n"); hdev 425 drivers/hid/hid-roccat-pyra.c hid_set_drvdata(hdev, NULL); hdev 434 drivers/hid/hid-roccat-pyra.c static void pyra_remove_specials(struct hid_device *hdev) hdev 436 drivers/hid/hid-roccat-pyra.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 441 drivers/hid/hid-roccat-pyra.c pyra = hid_get_drvdata(hdev); hdev 444 drivers/hid/hid-roccat-pyra.c kfree(hid_get_drvdata(hdev)); hdev 448 drivers/hid/hid-roccat-pyra.c static int pyra_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 452 drivers/hid/hid-roccat-pyra.c retval = hid_parse(hdev); hdev 454 drivers/hid/hid-roccat-pyra.c hid_err(hdev, "parse failed\n"); hdev 458 drivers/hid/hid-roccat-pyra.c retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 460 drivers/hid/hid-roccat-pyra.c hid_err(hdev, "hw start failed\n"); hdev 464 drivers/hid/hid-roccat-pyra.c retval = pyra_init_specials(hdev); hdev 466 drivers/hid/hid-roccat-pyra.c hid_err(hdev, "couldn't install mouse\n"); hdev 472 drivers/hid/hid-roccat-pyra.c hid_hw_stop(hdev); hdev 477 drivers/hid/hid-roccat-pyra.c static void pyra_remove(struct hid_device *hdev) hdev 479 drivers/hid/hid-roccat-pyra.c pyra_remove_specials(hdev); hdev 480 drivers/hid/hid-roccat-pyra.c hid_hw_stop(hdev); hdev 541 drivers/hid/hid-roccat-pyra.c static int pyra_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 544 drivers/hid/hid-roccat-pyra.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 545 drivers/hid/hid-roccat-pyra.c struct pyra_device *pyra = hid_get_drvdata(hdev); hdev 83 drivers/hid/hid-roccat-ryos.c static int ryos_init_specials(struct hid_device *hdev) hdev 85 drivers/hid/hid-roccat-ryos.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 92 drivers/hid/hid-roccat-ryos.c hid_set_drvdata(hdev, NULL); hdev 98 drivers/hid/hid-roccat-ryos.c hid_err(hdev, "can't alloc device descriptor\n"); hdev 101 drivers/hid/hid-roccat-ryos.c hid_set_drvdata(hdev, ryos); hdev 105 drivers/hid/hid-roccat-ryos.c hid_err(hdev, "couldn't init Ryos device\n"); hdev 109 drivers/hid/hid-roccat-ryos.c retval = roccat_connect(ryos_class, hdev, hdev 112 drivers/hid/hid-roccat-ryos.c hid_err(hdev, "couldn't init char dev\n"); hdev 124 drivers/hid/hid-roccat-ryos.c static void ryos_remove_specials(struct hid_device *hdev) hdev 126 drivers/hid/hid-roccat-ryos.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 133 drivers/hid/hid-roccat-ryos.c ryos = hid_get_drvdata(hdev); hdev 139 drivers/hid/hid-roccat-ryos.c static int ryos_probe(struct hid_device *hdev, hdev 144 drivers/hid/hid-roccat-ryos.c retval = hid_parse(hdev); hdev 146 drivers/hid/hid-roccat-ryos.c hid_err(hdev, "parse failed\n"); hdev 150 drivers/hid/hid-roccat-ryos.c retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 152 drivers/hid/hid-roccat-ryos.c hid_err(hdev, "hw start failed\n"); hdev 156 drivers/hid/hid-roccat-ryos.c retval = ryos_init_specials(hdev); hdev 158 drivers/hid/hid-roccat-ryos.c hid_err(hdev, "couldn't install mouse\n"); hdev 165 drivers/hid/hid-roccat-ryos.c hid_hw_stop(hdev); hdev 170 drivers/hid/hid-roccat-ryos.c static void ryos_remove(struct hid_device *hdev) hdev 172 drivers/hid/hid-roccat-ryos.c ryos_remove_specials(hdev); hdev 173 drivers/hid/hid-roccat-ryos.c hid_hw_stop(hdev); hdev 176 drivers/hid/hid-roccat-ryos.c static int ryos_raw_event(struct hid_device *hdev, hdev 179 drivers/hid/hid-roccat-ryos.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 180 drivers/hid/hid-roccat-ryos.c struct roccat_common2_device *ryos = hid_get_drvdata(hdev); hdev 55 drivers/hid/hid-roccat-savu.c static int savu_init_specials(struct hid_device *hdev) hdev 57 drivers/hid/hid-roccat-savu.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 64 drivers/hid/hid-roccat-savu.c hid_set_drvdata(hdev, NULL); hdev 70 drivers/hid/hid-roccat-savu.c hid_err(hdev, "can't alloc device descriptor\n"); hdev 73 drivers/hid/hid-roccat-savu.c hid_set_drvdata(hdev, savu); hdev 77 drivers/hid/hid-roccat-savu.c hid_err(hdev, "couldn't init Savu device\n"); hdev 81 drivers/hid/hid-roccat-savu.c retval = roccat_connect(savu_class, hdev, hdev 84 drivers/hid/hid-roccat-savu.c hid_err(hdev, "couldn't init char dev\n"); hdev 96 drivers/hid/hid-roccat-savu.c static void savu_remove_specials(struct hid_device *hdev) hdev 98 drivers/hid/hid-roccat-savu.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 105 drivers/hid/hid-roccat-savu.c savu = hid_get_drvdata(hdev); hdev 111 drivers/hid/hid-roccat-savu.c static int savu_probe(struct hid_device *hdev, hdev 116 drivers/hid/hid-roccat-savu.c retval = hid_parse(hdev); hdev 118 drivers/hid/hid-roccat-savu.c hid_err(hdev, "parse failed\n"); hdev 122 drivers/hid/hid-roccat-savu.c retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 124 drivers/hid/hid-roccat-savu.c hid_err(hdev, "hw start failed\n"); hdev 128 drivers/hid/hid-roccat-savu.c retval = savu_init_specials(hdev); hdev 130 drivers/hid/hid-roccat-savu.c hid_err(hdev, "couldn't install mouse\n"); hdev 137 drivers/hid/hid-roccat-savu.c hid_hw_stop(hdev); hdev 142 drivers/hid/hid-roccat-savu.c static void savu_remove(struct hid_device *hdev) hdev 144 drivers/hid/hid-roccat-savu.c savu_remove_specials(hdev); hdev 145 drivers/hid/hid-roccat-savu.c hid_hw_stop(hdev); hdev 166 drivers/hid/hid-roccat-savu.c static int savu_raw_event(struct hid_device *hdev, hdev 169 drivers/hid/hid-roccat-savu.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 170 drivers/hid/hid-roccat-savu.c struct roccat_common2_device *savu = hid_get_drvdata(hdev); hdev 36 drivers/hid/hid-saitek.c static int saitek_probe(struct hid_device *hdev, hdev 43 drivers/hid/hid-saitek.c ssc = devm_kzalloc(&hdev->dev, sizeof(*ssc), GFP_KERNEL); hdev 45 drivers/hid/hid-saitek.c hid_err(hdev, "can't alloc saitek descriptor\n"); hdev 52 drivers/hid/hid-saitek.c hid_set_drvdata(hdev, ssc); hdev 54 drivers/hid/hid-saitek.c ret = hid_parse(hdev); hdev 56 drivers/hid/hid-saitek.c hid_err(hdev, "parse failed\n"); hdev 60 drivers/hid/hid-saitek.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 62 drivers/hid/hid-saitek.c hid_err(hdev, "hw start failed\n"); hdev 69 drivers/hid/hid-saitek.c static __u8 *saitek_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 72 drivers/hid/hid-saitek.c struct saitek_sc *ssc = hid_get_drvdata(hdev); hdev 79 drivers/hid/hid-saitek.c hid_info(hdev, "Fixing up Saitek PS1000 report descriptor\n"); hdev 93 drivers/hid/hid-saitek.c static int saitek_raw_event(struct hid_device *hdev, hdev 96 drivers/hid/hid-saitek.c struct saitek_sc *ssc = hid_get_drvdata(hdev); hdev 112 drivers/hid/hid-saitek.c hid_dbg(hdev, "entered mode %d\n", mode); hdev 135 drivers/hid/hid-saitek.c hid_dbg(hdev, "entered mode %d\n", mode); hdev 150 drivers/hid/hid-saitek.c static int saitek_event(struct hid_device *hdev, struct hid_field *field, hdev 153 drivers/hid/hid-saitek.c struct saitek_sc *ssc = hid_get_drvdata(hdev); hdev 51 drivers/hid/hid-samsung.c static inline void samsung_irda_dev_trace(struct hid_device *hdev, hdev 54 drivers/hid/hid-samsung.c hid_info(hdev, "fixing up Samsung IrDA %d byte report descriptor\n", hdev 58 drivers/hid/hid-samsung.c static __u8 *samsung_irda_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 65 drivers/hid/hid-samsung.c samsung_irda_dev_trace(hdev, 184); hdev 73 drivers/hid/hid-samsung.c samsung_irda_dev_trace(hdev, 203); hdev 79 drivers/hid/hid-samsung.c samsung_irda_dev_trace(hdev, 135); hdev 85 drivers/hid/hid-samsung.c samsung_irda_dev_trace(hdev, 171); hdev 95 drivers/hid/hid-samsung.c static int samsung_kbd_mouse_input_mapping(struct hid_device *hdev, hdev 99 drivers/hid/hid-samsung.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 128 drivers/hid/hid-samsung.c static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 131 drivers/hid/hid-samsung.c if (USB_DEVICE_ID_SAMSUNG_IR_REMOTE == hdev->product) hdev 132 drivers/hid/hid-samsung.c rdesc = samsung_irda_report_fixup(hdev, rdesc, rsize); hdev 136 drivers/hid/hid-samsung.c static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 142 drivers/hid/hid-samsung.c if (USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE == hdev->product) hdev 143 drivers/hid/hid-samsung.c ret = samsung_kbd_mouse_input_mapping(hdev, hdev 149 drivers/hid/hid-samsung.c static int samsung_probe(struct hid_device *hdev, hdev 155 drivers/hid/hid-samsung.c ret = hid_parse(hdev); hdev 157 drivers/hid/hid-samsung.c hid_err(hdev, "parse failed\n"); hdev 161 drivers/hid/hid-samsung.c if (USB_DEVICE_ID_SAMSUNG_IR_REMOTE == hdev->product) { hdev 162 drivers/hid/hid-samsung.c if (hdev->rsize == 184) { hdev 169 drivers/hid/hid-samsung.c ret = hid_hw_start(hdev, cmask); hdev 171 drivers/hid/hid-samsung.c hid_err(hdev, "hw start failed\n"); hdev 203 drivers/hid/hid-sensor-custom.c hid_err(sensor_inst->hsdev->hdev, hdev 218 drivers/hid/hid-sensor-custom.c hid_err(sensor_inst->hsdev->hdev, hdev 421 drivers/hid/hid-sensor-custom.c hid_err(sensor_inst->hsdev->hdev, "Skipped remaining data\n"); hdev 425 drivers/hid/hid-sensor-custom.c hid_dbg(sensor_inst->hsdev->hdev, "%s received %d of %d\n", __func__, hdev 561 drivers/hid/hid-sensor-custom.c struct hid_device *hdev = hsdev->hdev; hdev 570 drivers/hid/hid-sensor-custom.c &hdev->report_enum[j], j); hdev 56 drivers/hid/hid-sensor-hub.c static struct hid_report *sensor_hub_report(int id, struct hid_device *hdev, hdev 61 drivers/hid/hid-sensor-hub.c list_for_each_entry(report, &hdev->report_enum[dir].report_list, list) { hdev 65 drivers/hid/hid-sensor-hub.c hid_warn(hdev, "No report with id 0x%x found\n", id); hdev 70 drivers/hid/hid-sensor-hub.c static int sensor_hub_get_physical_device_count(struct hid_device *hdev) hdev 75 drivers/hid/hid-sensor-hub.c for (i = 0; i < hdev->maxcollection; ++i) { hdev 76 drivers/hid/hid-sensor-hub.c struct hid_collection *collection = &hdev->collection[i]; hdev 99 drivers/hid/hid-sensor-hub.c struct hid_device *hdev, hdev 106 drivers/hid/hid-sensor-hub.c struct sensor_hub_data *pdata = hid_get_drvdata(hdev); hdev 133 drivers/hid/hid-sensor-hub.c struct sensor_hub_data *pdata = hid_get_drvdata(hsdev->hdev); hdev 174 drivers/hid/hid-sensor-hub.c struct sensor_hub_data *pdata = hid_get_drvdata(hsdev->hdev); hdev 195 drivers/hid/hid-sensor-hub.c struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev); hdev 203 drivers/hid/hid-sensor-hub.c report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); hdev 224 drivers/hid/hid-sensor-hub.c hid_hw_request(hsdev->hdev, report, HID_REQ_SET_REPORT); hdev 225 drivers/hid/hid-sensor-hub.c hid_hw_wait(hsdev->hdev); hdev 238 drivers/hid/hid-sensor-hub.c struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev); hdev 248 drivers/hid/hid-sensor-hub.c report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); hdev 254 drivers/hid/hid-sensor-hub.c hid_hw_request(hsdev->hdev, report, HID_REQ_GET_REPORT); hdev 255 drivers/hid/hid-sensor-hub.c hid_hw_wait(hsdev->hdev); hdev 292 drivers/hid/hid-sensor-hub.c struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev); hdev 297 drivers/hid/hid-sensor-hub.c report = sensor_hub_report(report_id, hsdev->hdev, hdev 315 drivers/hid/hid-sensor-hub.c hid_hw_request(hsdev->hdev, report, HID_REQ_GET_REPORT); hdev 355 drivers/hid/hid-sensor-hub.c report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); hdev 381 drivers/hid/hid-sensor-hub.c struct hid_device *hdev = hsdev->hdev; hdev 391 drivers/hid/hid-sensor-hub.c report_enum = &hdev->report_enum[type]; hdev 421 drivers/hid/hid-sensor-hub.c static int sensor_hub_suspend(struct hid_device *hdev, pm_message_t message) hdev 423 drivers/hid/hid-sensor-hub.c struct sensor_hub_data *pdata = hid_get_drvdata(hdev); hdev 427 drivers/hid/hid-sensor-hub.c hid_dbg(hdev, " sensor_hub_suspend\n"); hdev 439 drivers/hid/hid-sensor-hub.c static int sensor_hub_resume(struct hid_device *hdev) hdev 441 drivers/hid/hid-sensor-hub.c struct sensor_hub_data *pdata = hid_get_drvdata(hdev); hdev 445 drivers/hid/hid-sensor-hub.c hid_dbg(hdev, " sensor_hub_resume\n"); hdev 457 drivers/hid/hid-sensor-hub.c static int sensor_hub_reset_resume(struct hid_device *hdev) hdev 466 drivers/hid/hid-sensor-hub.c static int sensor_hub_raw_event(struct hid_device *hdev, hdev 472 drivers/hid/hid-sensor-hub.c struct sensor_hub_data *pdata = hid_get_drvdata(hdev); hdev 479 drivers/hid/hid-sensor-hub.c hid_dbg(hdev, "sensor_hub_raw_event report id:0x%x size:%d type:%d\n", hdev 481 drivers/hid/hid-sensor-hub.c hid_dbg(hdev, "maxfield:%d\n", report->maxfield); hdev 491 drivers/hid/hid-sensor-hub.c hid_dbg(hdev, "%d collection_index:%x hid:%x sz:%x\n", hdev 498 drivers/hid/hid-sensor-hub.c collection = &hdev->collection[ hdev 500 drivers/hid/hid-sensor-hub.c hid_dbg(hdev, "collection->usage %x\n", hdev 503 drivers/hid/hid-sensor-hub.c callback = sensor_hub_get_callback(hdev, hdev 515 drivers/hid/hid-sensor-hub.c hid_dbg(hdev, "data was pending ...\n"); hdev 546 drivers/hid/hid-sensor-hub.c struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev); hdev 550 drivers/hid/hid-sensor-hub.c ret = hid_hw_open(hsdev->hdev); hdev 552 drivers/hid/hid-sensor-hub.c hid_err(hsdev->hdev, "failed to open hid device\n"); hdev 566 drivers/hid/hid-sensor-hub.c struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev); hdev 571 drivers/hid/hid-sensor-hub.c hid_hw_close(hsdev->hdev); hdev 576 drivers/hid/hid-sensor-hub.c static __u8 *sensor_hub_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 583 drivers/hid/hid-sensor-hub.c if (hdev->product == USB_DEVICE_ID_TEXAS_INSTRUMENTS_LENOVO_YOGA && hdev 598 drivers/hid/hid-sensor-hub.c static int sensor_hub_probe(struct hid_device *hdev, hdev 610 drivers/hid/hid-sensor-hub.c sd = devm_kzalloc(&hdev->dev, sizeof(*sd), GFP_KERNEL); hdev 612 drivers/hid/hid-sensor-hub.c hid_err(hdev, "cannot allocate Sensor data\n"); hdev 616 drivers/hid/hid-sensor-hub.c hid_set_drvdata(hdev, sd); hdev 622 drivers/hid/hid-sensor-hub.c ret = hid_parse(hdev); hdev 624 drivers/hid/hid-sensor-hub.c hid_err(hdev, "parse failed\n"); hdev 627 drivers/hid/hid-sensor-hub.c INIT_LIST_HEAD(&hdev->inputs); hdev 629 drivers/hid/hid-sensor-hub.c ret = hid_hw_start(hdev, 0); hdev 631 drivers/hid/hid-sensor-hub.c hid_err(hdev, "hw start failed\n"); hdev 637 drivers/hid/hid-sensor-hub.c dev_cnt = sensor_hub_get_physical_device_count(hdev); hdev 639 drivers/hid/hid-sensor-hub.c hid_err(hdev, "Invalid Physical device count\n"); hdev 643 drivers/hid/hid-sensor-hub.c sd->hid_sensor_hub_client_devs = devm_kcalloc(&hdev->dev, hdev 648 drivers/hid/hid-sensor-hub.c hid_err(hdev, "Failed to allocate memory for mfd cells\n"); hdev 653 drivers/hid/hid-sensor-hub.c for (i = 0; i < hdev->maxcollection; ++i) { hdev 654 drivers/hid/hid-sensor-hub.c struct hid_collection *collection = &hdev->collection[i]; hdev 659 drivers/hid/hid-sensor-hub.c hsdev = devm_kzalloc(&hdev->dev, sizeof(*hsdev), hdev 662 drivers/hid/hid-sensor-hub.c hid_err(hdev, "cannot allocate hid_sensor_hub_device\n"); hdev 666 drivers/hid/hid-sensor-hub.c hsdev->hdev = hdev; hdev 667 drivers/hid/hid-sensor-hub.c hsdev->vendor_id = hdev->vendor; hdev 668 drivers/hid/hid-sensor-hub.c hsdev->product_id = hdev->product; hdev 670 drivers/hid/hid-sensor-hub.c hsdev->mutex_ptr = devm_kzalloc(&hdev->dev, hdev 682 drivers/hid/hid-sensor-hub.c name = devm_kasprintf(&hdev->dev, GFP_KERNEL, hdev 686 drivers/hid/hid-sensor-hub.c hid_err(hdev, "Failed MFD device name\n"); hdev 698 drivers/hid/hid-sensor-hub.c hid_dbg(hdev, "Adding %s:%d\n", name, hdev 713 drivers/hid/hid-sensor-hub.c ret = mfd_add_hotplug_devices(&hdev->dev, hdev 722 drivers/hid/hid-sensor-hub.c hid_hw_stop(hdev); hdev 727 drivers/hid/hid-sensor-hub.c static void sensor_hub_remove(struct hid_device *hdev) hdev 729 drivers/hid/hid-sensor-hub.c struct sensor_hub_data *data = hid_get_drvdata(hdev); hdev 733 drivers/hid/hid-sensor-hub.c hid_dbg(hdev, " hardware removed\n"); hdev 734 drivers/hid/hid-sensor-hub.c hid_hw_close(hdev); hdev 735 drivers/hid/hid-sensor-hub.c hid_hw_stop(hdev); hdev 744 drivers/hid/hid-sensor-hub.c mfd_remove_devices(&hdev->dev); hdev 118 drivers/hid/hid-sjoy.c static int sjoy_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 122 drivers/hid/hid-sjoy.c hdev->quirks |= id->driver_data; hdev 124 drivers/hid/hid-sjoy.c ret = hid_parse(hdev); hdev 126 drivers/hid/hid-sjoy.c hid_err(hdev, "parse failed\n"); hdev 130 drivers/hid/hid-sjoy.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); hdev 132 drivers/hid/hid-sjoy.c hid_err(hdev, "hw start failed\n"); hdev 136 drivers/hid/hid-sjoy.c sjoyff_init(hdev); hdev 541 drivers/hid/hid-sony.c struct hid_device *hdev; hdev 608 drivers/hid/hid-sony.c struct hid_device *hdev = to_hid_device(dev); hdev 609 drivers/hid/hid-sony.c struct sony_sc *sc = hid_get_drvdata(hdev); hdev 618 drivers/hid/hid-sony.c struct hid_device *hdev = to_hid_device(dev); hdev 619 drivers/hid/hid-sony.c struct sony_sc *sc = hid_get_drvdata(hdev); hdev 645 drivers/hid/hid-sony.c struct hid_device *hdev = to_hid_device(dev); hdev 646 drivers/hid/hid-sony.c struct sony_sc *sc = hid_get_drvdata(hdev); hdev 657 drivers/hid/hid-sony.c struct hid_device *hdev = to_hid_device(dev); hdev 658 drivers/hid/hid-sony.c struct sony_sc *sc = hid_get_drvdata(hdev); hdev 665 drivers/hid/hid-sony.c static u8 *motion_fixup(struct hid_device *hdev, u8 *rdesc, hdev 672 drivers/hid/hid-sony.c static u8 *ps3remote_fixup(struct hid_device *hdev, u8 *rdesc, hdev 679 drivers/hid/hid-sony.c static int ps3remote_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 713 drivers/hid/hid-sony.c static int navigation_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 761 drivers/hid/hid-sony.c static int sixaxis_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 809 drivers/hid/hid-sony.c static int ds4_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 840 drivers/hid/hid-sony.c static u8 *sony_report_fixup(struct hid_device *hdev, u8 *rdesc, hdev 843 drivers/hid/hid-sony.c struct sony_sc *sc = hid_get_drvdata(hdev); hdev 859 drivers/hid/hid-sony.c hid_info(hdev, "Fixing up Sony RF Receiver report descriptor\n"); hdev 865 drivers/hid/hid-sony.c return motion_fixup(hdev, rdesc, rsize); hdev 868 drivers/hid/hid-sony.c return ps3remote_fixup(hdev, rdesc, rsize); hdev 881 drivers/hid/hid-sony.c hid_info(hdev, "Fixing up USB dongle report descriptor\n"); hdev 942 drivers/hid/hid-sony.c struct hid_input *hidinput = list_entry(sc->hdev->inputs.next, hdev 1200 drivers/hid/hid-sony.c static int sony_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 1203 drivers/hid/hid-sony.c struct sony_sc *sc = hid_get_drvdata(hdev); hdev 1246 drivers/hid/hid-sony.c hid_dbg(sc->hdev, "DualShock 4 input report's CRC check failed, received crc 0x%0x != 0x%0x\n", hdev 1277 drivers/hid/hid-sony.c hid_info(sc->hdev, "DualShock 4 USB dongle: controller connected\n"); hdev 1292 drivers/hid/hid-sony.c hid_info(sc->hdev, "DualShock 4 USB dongle: controller disconnected\n"); hdev 1322 drivers/hid/hid-sony.c static int sony_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 1326 drivers/hid/hid-sony.c struct sony_sc *sc = hid_get_drvdata(hdev); hdev 1352 drivers/hid/hid-sony.c return ps3remote_mapping(hdev, hi, field, usage, bit, max); hdev 1355 drivers/hid/hid-sony.c return navigation_mapping(hdev, hi, field, usage, bit, max); hdev 1358 drivers/hid/hid-sony.c return sixaxis_mapping(hdev, hi, field, usage, bit, max); hdev 1361 drivers/hid/hid-sony.c return ds4_mapping(hdev, hi, field, usage, bit, max); hdev 1375 drivers/hid/hid-sony.c sc->touchpad = devm_input_allocate_device(&sc->hdev->dev); hdev 1380 drivers/hid/hid-sony.c sc->touchpad->dev.parent = &sc->hdev->dev; hdev 1381 drivers/hid/hid-sony.c sc->touchpad->phys = sc->hdev->phys; hdev 1382 drivers/hid/hid-sony.c sc->touchpad->uniq = sc->hdev->uniq; hdev 1383 drivers/hid/hid-sony.c sc->touchpad->id.bustype = sc->hdev->bus; hdev 1384 drivers/hid/hid-sony.c sc->touchpad->id.vendor = sc->hdev->vendor; hdev 1385 drivers/hid/hid-sony.c sc->touchpad->id.product = sc->hdev->product; hdev 1386 drivers/hid/hid-sony.c sc->touchpad->id.version = sc->hdev->version; hdev 1391 drivers/hid/hid-sony.c name_sz = strlen(sc->hdev->name) + sizeof(DS4_TOUCHPAD_SUFFIX); hdev 1392 drivers/hid/hid-sony.c name = devm_kzalloc(&sc->hdev->dev, name_sz, GFP_KERNEL); hdev 1395 drivers/hid/hid-sony.c snprintf(name, name_sz, "%s" DS4_TOUCHPAD_SUFFIX, sc->hdev->name); hdev 1439 drivers/hid/hid-sony.c sc->sensor_dev = devm_input_allocate_device(&sc->hdev->dev); hdev 1444 drivers/hid/hid-sony.c sc->sensor_dev->dev.parent = &sc->hdev->dev; hdev 1445 drivers/hid/hid-sony.c sc->sensor_dev->phys = sc->hdev->phys; hdev 1446 drivers/hid/hid-sony.c sc->sensor_dev->uniq = sc->hdev->uniq; hdev 1447 drivers/hid/hid-sony.c sc->sensor_dev->id.bustype = sc->hdev->bus; hdev 1448 drivers/hid/hid-sony.c sc->sensor_dev->id.vendor = sc->hdev->vendor; hdev 1449 drivers/hid/hid-sony.c sc->sensor_dev->id.product = sc->hdev->product; hdev 1450 drivers/hid/hid-sony.c sc->sensor_dev->id.version = sc->hdev->version; hdev 1455 drivers/hid/hid-sony.c name_sz = strlen(sc->hdev->name) + sizeof(SENSOR_SUFFIX); hdev 1456 drivers/hid/hid-sony.c name = devm_kzalloc(&sc->hdev->dev, name_sz, GFP_KERNEL); hdev 1459 drivers/hid/hid-sony.c snprintf(name, name_sz, "%s" SENSOR_SUFFIX, sc->hdev->name); hdev 1510 drivers/hid/hid-sony.c static int sixaxis_set_operational_usb(struct hid_device *hdev) hdev 1512 drivers/hid/hid-sony.c struct sony_sc *sc = hid_get_drvdata(hdev); hdev 1522 drivers/hid/hid-sony.c ret = hid_hw_raw_request(hdev, 0xf2, buf, SIXAXIS_REPORT_0xF2_SIZE, hdev 1525 drivers/hid/hid-sony.c hid_err(hdev, "can't set operational mode: step 1\n"); hdev 1533 drivers/hid/hid-sony.c ret = hid_hw_raw_request(hdev, 0xf5, buf, SIXAXIS_REPORT_0xF5_SIZE, hdev 1536 drivers/hid/hid-sony.c hid_err(hdev, "can't set operational mode: step 2\n"); hdev 1547 drivers/hid/hid-sony.c ret = hid_hw_output_report(hdev, buf, 1); hdev 1549 drivers/hid/hid-sony.c hid_info(hdev, "can't set operational mode: step 3, ignoring\n"); hdev 1559 drivers/hid/hid-sony.c static int sixaxis_set_operational_bt(struct hid_device *hdev) hdev 1569 drivers/hid/hid-sony.c ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(report), hdev 1604 drivers/hid/hid-sony.c ret = hid_hw_raw_request(sc->hdev, 0x02, buf, hdev 1621 drivers/hid/hid-sony.c ret = hid_hw_raw_request(sc->hdev, 0x05, buf, hdev 1633 drivers/hid/hid-sony.c hid_warn(sc->hdev, "DualShock 4 calibration report's CRC check failed, received crc 0x%0x != 0x%0x\n", hdev 1636 drivers/hid/hid-sony.c hid_warn(sc->hdev, "Retrying DualShock 4 get calibration report request\n"); hdev 1736 drivers/hid/hid-sony.c hid_err(sc->hdev, "DualShock 4 USB dongle: calibration failed, disabling device\n"); hdev 1739 drivers/hid/hid-sony.c hid_info(sc->hdev, "DualShock 4 USB dongle: calibration completed\n"); hdev 1757 drivers/hid/hid-sony.c ret = hid_hw_raw_request(sc->hdev, 0xA3, buf, hdev 1825 drivers/hid/hid-sony.c struct hid_device *hdev = sc->hdev; hdev 1827 drivers/hid/hid-sony.c &hdev->report_enum[HID_OUTPUT_REPORT].report_list; hdev 1841 drivers/hid/hid-sony.c hid_hw_request(hdev, report, HID_REQ_SET_REPORT); hdev 1856 drivers/hid/hid-sony.c struct hid_device *hdev = to_hid_device(dev); hdev 1862 drivers/hid/hid-sony.c drv_data = hid_get_drvdata(hdev); hdev 1864 drivers/hid/hid-sony.c hid_err(hdev, "No device data\n"); hdev 1898 drivers/hid/hid-sony.c struct hid_device *hdev = to_hid_device(dev); hdev 1903 drivers/hid/hid-sony.c drv_data = hid_get_drvdata(hdev); hdev 1905 drivers/hid/hid-sony.c hid_err(hdev, "No device data\n"); hdev 1921 drivers/hid/hid-sony.c struct hid_device *hdev = to_hid_device(dev); hdev 1922 drivers/hid/hid-sony.c struct sony_sc *drv_data = hid_get_drvdata(hdev); hdev 1927 drivers/hid/hid-sony.c hid_err(hdev, "No device data\n"); hdev 1966 drivers/hid/hid-sony.c struct hid_device *hdev = sc->hdev; hdev 1987 drivers/hid/hid-sony.c if (!hid_validate_values(hdev, HID_OUTPUT_REPORT, 0, 0, 7)) hdev 2029 drivers/hid/hid-sony.c name_sz = strlen(dev_name(&hdev->dev)) + name_len + 1; hdev 2034 drivers/hid/hid-sony.c name_sz = strlen(dev_name(&hdev->dev)) + strlen(ds4_name_str[n]) + 2; hdev 2036 drivers/hid/hid-sony.c led = devm_kzalloc(&hdev->dev, sizeof(struct led_classdev) + name_sz, GFP_KERNEL); hdev 2038 drivers/hid/hid-sony.c hid_err(hdev, "Couldn't allocate memory for LED %d\n", n); hdev 2044 drivers/hid/hid-sony.c snprintf(name, name_sz, name_fmt, dev_name(&hdev->dev), hdev 2047 drivers/hid/hid-sony.c snprintf(name, name_sz, name_fmt, dev_name(&hdev->dev), n + 1); hdev 2060 drivers/hid/hid-sony.c ret = devm_led_classdev_register(&hdev->dev, led); hdev 2062 drivers/hid/hid-sony.c hid_err(hdev, "Failed to register LED %d\n", n); hdev 2123 drivers/hid/hid-sony.c hid_hw_output_report(sc->hdev, (u8 *)report, hdev 2126 drivers/hid/hid-sony.c hid_hw_raw_request(sc->hdev, report->report_id, (u8 *)report, hdev 2133 drivers/hid/hid-sony.c struct hid_device *hdev = sc->hdev; hdev 2180 drivers/hid/hid-sony.c hid_hw_output_report(hdev, buf, DS4_OUTPUT_REPORT_0x05_SIZE); hdev 2189 drivers/hid/hid-sony.c hid_hw_output_report(hdev, buf, DS4_OUTPUT_REPORT_0x11_SIZE); hdev 2195 drivers/hid/hid-sony.c struct hid_device *hdev = sc->hdev; hdev 2210 drivers/hid/hid-sony.c hid_hw_output_report(hdev, (u8 *)report, MOTION_REPORT_0x02_SIZE); hdev 2231 drivers/hid/hid-sony.c devm_kmalloc(&sc->hdev->dev, hdev 2235 drivers/hid/hid-sony.c sc->output_report_dmabuf = devm_kmalloc(&sc->hdev->dev, hdev 2239 drivers/hid/hid-sony.c sc->output_report_dmabuf = devm_kmalloc(&sc->hdev->dev, hdev 2243 drivers/hid/hid-sony.c sc->output_report_dmabuf = devm_kmalloc(&sc->hdev->dev, hdev 2277 drivers/hid/hid-sony.c if (list_empty(&sc->hdev->inputs)) { hdev 2278 drivers/hid/hid-sony.c hid_err(sc->hdev, "no inputs found\n"); hdev 2281 drivers/hid/hid-sony.c hidinput = list_entry(sc->hdev->inputs.next, struct hid_input, list); hdev 2343 drivers/hid/hid-sony.c struct hid_device *hdev = sc->hdev; hdev 2357 drivers/hid/hid-sony.c sc->battery_desc.name = devm_kasprintf(&hdev->dev, GFP_KERNEL, hdev 2362 drivers/hid/hid-sony.c sc->battery = devm_power_supply_register(&hdev->dev, &sc->battery_desc, hdev 2366 drivers/hid/hid-sony.c hid_err(hdev, "Unable to register battery device\n"); hdev 2370 drivers/hid/hid-sony.c power_supply_powers(sc->battery, &hdev->dev); hdev 2410 drivers/hid/hid-sony.c hid_info(sc->hdev, hdev 2442 drivers/hid/hid-sony.c ret = strlen(sc->hdev->uniq); hdev 2446 drivers/hid/hid-sony.c ret = sscanf(sc->hdev->uniq, hdev 2473 drivers/hid/hid-sony.c hid_warn(sc->hdev, "UNIQ does not contain a MAC address; duplicate check skipped\n"); hdev 2486 drivers/hid/hid-sony.c ret = hid_hw_raw_request(sc->hdev, 0x81, buf, hdev 2491 drivers/hid/hid-sony.c hid_err(sc->hdev, "failed to retrieve feature report 0x81 with the DualShock 4 MAC address\n"); hdev 2498 drivers/hid/hid-sony.c snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq), hdev 2511 drivers/hid/hid-sony.c ret = hid_hw_raw_request(sc->hdev, 0xf2, buf, hdev 2516 drivers/hid/hid-sony.c hid_err(sc->hdev, "failed to retrieve feature report 0xf2 with the Sixaxis MAC address\n"); hdev 2528 drivers/hid/hid-sony.c snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq), hdev 2600 drivers/hid/hid-sony.c static int sony_input_configured(struct hid_device *hdev, hdev 2603 drivers/hid/hid-sony.c struct sony_sc *sc = hid_get_drvdata(hdev); hdev 2609 drivers/hid/hid-sony.c hid_err(hdev, "failed to allocate the device id\n"); hdev 2619 drivers/hid/hid-sony.c hid_err(hdev, "failed to allocate the output report buffer\n"); hdev 2640 drivers/hid/hid-sony.c hdev->quirks |= HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP; hdev 2641 drivers/hid/hid-sony.c hdev->quirks |= HID_QUIRK_SKIP_OUTPUT_REPORT_ID; hdev 2644 drivers/hid/hid-sony.c ret = sixaxis_set_operational_usb(hdev); hdev 2646 drivers/hid/hid-sony.c hid_err(hdev, "Failed to set controller into operational mode\n"); hdev 2656 drivers/hid/hid-sony.c hdev->quirks |= HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP; hdev 2658 drivers/hid/hid-sony.c ret = sixaxis_set_operational_bt(hdev); hdev 2660 drivers/hid/hid-sony.c hid_err(hdev, "Failed to set controller into operational mode\n"); hdev 2672 drivers/hid/hid-sony.c hdev->quirks |= HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP; hdev 2673 drivers/hid/hid-sony.c hdev->quirks |= HID_QUIRK_SKIP_OUTPUT_REPORT_ID; hdev 2676 drivers/hid/hid-sony.c ret = sixaxis_set_operational_usb(hdev); hdev 2678 drivers/hid/hid-sony.c hid_err(hdev, "Failed to set controller into operational mode\n"); hdev 2684 drivers/hid/hid-sony.c hid_err(sc->hdev, hdev 2695 drivers/hid/hid-sony.c hdev->quirks |= HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP; hdev 2697 drivers/hid/hid-sony.c ret = sixaxis_set_operational_bt(hdev); hdev 2699 drivers/hid/hid-sony.c hid_err(hdev, "Failed to set controller into operational mode\n"); hdev 2705 drivers/hid/hid-sony.c hid_err(sc->hdev, hdev 2714 drivers/hid/hid-sony.c hid_err(hdev, "Failed to get calibration data from Dualshock 4\n"); hdev 2720 drivers/hid/hid-sony.c hid_err(sc->hdev, "Failed to get version data from Dualshock 4\n"); hdev 2724 drivers/hid/hid-sony.c ret = device_create_file(&sc->hdev->dev, &dev_attr_firmware_version); hdev 2729 drivers/hid/hid-sony.c hid_err(sc->hdev, "can't create sysfs firmware_version attribute err: %d\n", ret); hdev 2733 drivers/hid/hid-sony.c ret = device_create_file(&sc->hdev->dev, &dev_attr_hardware_version); hdev 2736 drivers/hid/hid-sony.c hid_err(sc->hdev, "can't create sysfs hardware_version attribute err: %d\n", ret); hdev 2746 drivers/hid/hid-sony.c hid_err(sc->hdev, hdev 2754 drivers/hid/hid-sony.c hid_err(sc->hdev, hdev 2761 drivers/hid/hid-sony.c ret = device_create_file(&sc->hdev->dev, &dev_attr_bt_poll_interval); hdev 2763 drivers/hid/hid-sony.c hid_warn(sc->hdev, hdev 2783 drivers/hid/hid-sony.c hid_err(sc->hdev, hdev 2807 drivers/hid/hid-sony.c ret = hid_hw_open(hdev); hdev 2809 drivers/hid/hid-sony.c hid_err(hdev, "hw open failed\n"); hdev 2822 drivers/hid/hid-sony.c hid_hw_close(hdev); hdev 2829 drivers/hid/hid-sony.c device_remove_file(&sc->hdev->dev, &dev_attr_bt_poll_interval); hdev 2831 drivers/hid/hid-sony.c device_remove_file(&sc->hdev->dev, &dev_attr_firmware_version); hdev 2833 drivers/hid/hid-sony.c device_remove_file(&sc->hdev->dev, &dev_attr_hardware_version); hdev 2840 drivers/hid/hid-sony.c static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 2847 drivers/hid/hid-sony.c if (!strcmp(hdev->name, "FutureMax Dance Mat")) hdev 2850 drivers/hid/hid-sony.c if (!strcmp(hdev->name, "SHANWAN PS3 GamePad")) hdev 2853 drivers/hid/hid-sony.c sc = devm_kzalloc(&hdev->dev, sizeof(*sc), GFP_KERNEL); hdev 2855 drivers/hid/hid-sony.c hid_err(hdev, "can't alloc sony descriptor\n"); hdev 2862 drivers/hid/hid-sony.c hid_set_drvdata(hdev, sc); hdev 2863 drivers/hid/hid-sony.c sc->hdev = hdev; hdev 2865 drivers/hid/hid-sony.c ret = hid_parse(hdev); hdev 2867 drivers/hid/hid-sony.c hid_err(hdev, "parse failed\n"); hdev 2883 drivers/hid/hid-sony.c hdev->version |= 0x8000; hdev 2885 drivers/hid/hid-sony.c ret = hid_hw_start(hdev, connect_mask); hdev 2887 drivers/hid/hid-sony.c hid_err(hdev, "hw start failed\n"); hdev 2899 drivers/hid/hid-sony.c if (!(hdev->claimed & HID_CLAIMED_INPUT)) { hdev 2900 drivers/hid/hid-sony.c hid_err(hdev, "failed to claim input\n"); hdev 2901 drivers/hid/hid-sony.c hid_hw_stop(hdev); hdev 2908 drivers/hid/hid-sony.c static void sony_remove(struct hid_device *hdev) hdev 2910 drivers/hid/hid-sony.c struct sony_sc *sc = hid_get_drvdata(hdev); hdev 2912 drivers/hid/hid-sony.c hid_hw_close(hdev); hdev 2915 drivers/hid/hid-sony.c device_remove_file(&sc->hdev->dev, &dev_attr_bt_poll_interval); hdev 2918 drivers/hid/hid-sony.c device_remove_file(&sc->hdev->dev, &dev_attr_firmware_version); hdev 2921 drivers/hid/hid-sony.c device_remove_file(&sc->hdev->dev, &dev_attr_hardware_version); hdev 2929 drivers/hid/hid-sony.c hid_hw_stop(hdev); hdev 2934 drivers/hid/hid-sony.c static int sony_suspend(struct hid_device *hdev, pm_message_t message) hdev 2940 drivers/hid/hid-sony.c struct sony_sc *sc = hid_get_drvdata(hdev); hdev 2950 drivers/hid/hid-sony.c static int sony_resume(struct hid_device *hdev) hdev 2952 drivers/hid/hid-sony.c struct sony_sc *sc = hid_get_drvdata(hdev); hdev 2960 drivers/hid/hid-sony.c sixaxis_set_operational_usb(sc->hdev); hdev 24 drivers/hid/hid-speedlink.c static int speedlink_input_mapping(struct hid_device *hdev, hdev 42 drivers/hid/hid-speedlink.c static int speedlink_event(struct hid_device *hdev, struct hid_field *field, hdev 115 drivers/hid/hid-steam.c struct hid_device *hdev, *client_hdev; hdev 136 drivers/hid/hid-steam.c r = steam->hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0]; hdev 150 drivers/hid/hid-steam.c ret = hid_hw_raw_request(steam->hdev, 0x00, hdev 167 drivers/hid/hid-steam.c r = steam->hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0]; hdev 185 drivers/hid/hid-steam.c ret = hid_hw_raw_request(steam->hdev, 0, hdev 195 drivers/hid/hid-steam.c hid_err(steam->hdev, "%s: error %d (%*ph)\n", __func__, hdev 357 drivers/hid/hid-steam.c steam->battery_desc.name = devm_kasprintf(&steam->hdev->dev, hdev 369 drivers/hid/hid-steam.c battery = power_supply_register(&steam->hdev->dev, hdev 373 drivers/hid/hid-steam.c hid_err(steam->hdev, hdev 379 drivers/hid/hid-steam.c power_supply_powers(battery, &steam->hdev->dev); hdev 385 drivers/hid/hid-steam.c struct hid_device *hdev = steam->hdev; hdev 402 drivers/hid/hid-steam.c input->dev.parent = &hdev->dev; hdev 409 drivers/hid/hid-steam.c input->phys = hdev->phys; hdev 411 drivers/hid/hid-steam.c input->id.bustype = hdev->bus; hdev 412 drivers/hid/hid-steam.c input->id.vendor = hdev->vendor; hdev 413 drivers/hid/hid-steam.c input->id.product = hdev->product; hdev 414 drivers/hid/hid-steam.c input->id.version = hdev->version; hdev 521 drivers/hid/hid-steam.c hid_info(steam->hdev, "Steam Controller '%s' connected", hdev 552 drivers/hid/hid-steam.c hid_info(steam->hdev, "Steam Controller '%s' disconnected", hdev 576 drivers/hid/hid-steam.c hid_err(steam->hdev, hdev 585 drivers/hid/hid-steam.c static bool steam_is_valve_interface(struct hid_device *hdev) hdev 600 drivers/hid/hid-steam.c rep_enum = &hdev->report_enum[HID_FEATURE_REPORT]; hdev 604 drivers/hid/hid-steam.c static int steam_client_ll_parse(struct hid_device *hdev) hdev 606 drivers/hid/hid-steam.c struct steam_device *steam = hdev->driver_data; hdev 608 drivers/hid/hid-steam.c return hid_parse_report(hdev, steam->hdev->dev_rdesc, hdev 609 drivers/hid/hid-steam.c steam->hdev->dev_rsize); hdev 612 drivers/hid/hid-steam.c static int steam_client_ll_start(struct hid_device *hdev) hdev 617 drivers/hid/hid-steam.c static void steam_client_ll_stop(struct hid_device *hdev) hdev 621 drivers/hid/hid-steam.c static int steam_client_ll_open(struct hid_device *hdev) hdev 623 drivers/hid/hid-steam.c struct steam_device *steam = hdev->driver_data; hdev 634 drivers/hid/hid-steam.c static void steam_client_ll_close(struct hid_device *hdev) hdev 636 drivers/hid/hid-steam.c struct steam_device *steam = hdev->driver_data; hdev 655 drivers/hid/hid-steam.c static int steam_client_ll_raw_request(struct hid_device *hdev, hdev 660 drivers/hid/hid-steam.c struct steam_device *steam = hdev->driver_data; hdev 662 drivers/hid/hid-steam.c return hid_hw_raw_request(steam->hdev, reportnum, buf, count, hdev 675 drivers/hid/hid-steam.c static struct hid_device *steam_create_client_hid(struct hid_device *hdev) hdev 684 drivers/hid/hid-steam.c client_hdev->dev.parent = hdev->dev.parent; hdev 685 drivers/hid/hid-steam.c client_hdev->bus = hdev->bus; hdev 686 drivers/hid/hid-steam.c client_hdev->vendor = hdev->vendor; hdev 687 drivers/hid/hid-steam.c client_hdev->product = hdev->product; hdev 688 drivers/hid/hid-steam.c client_hdev->version = hdev->version; hdev 689 drivers/hid/hid-steam.c client_hdev->type = hdev->type; hdev 690 drivers/hid/hid-steam.c client_hdev->country = hdev->country; hdev 691 drivers/hid/hid-steam.c strlcpy(client_hdev->name, hdev->name, hdev 693 drivers/hid/hid-steam.c strlcpy(client_hdev->phys, hdev->phys, hdev 704 drivers/hid/hid-steam.c static int steam_probe(struct hid_device *hdev, hdev 710 drivers/hid/hid-steam.c ret = hid_parse(hdev); hdev 712 drivers/hid/hid-steam.c hid_err(hdev, hdev 721 drivers/hid/hid-steam.c if (hdev->group == HID_GROUP_STEAM) hdev 722 drivers/hid/hid-steam.c return hid_hw_start(hdev, HID_CONNECT_HIDRAW); hdev 727 drivers/hid/hid-steam.c if (!steam_is_valve_interface(hdev)) hdev 728 drivers/hid/hid-steam.c return hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 730 drivers/hid/hid-steam.c steam = devm_kzalloc(&hdev->dev, sizeof(*steam), GFP_KERNEL); hdev 735 drivers/hid/hid-steam.c steam->hdev = hdev; hdev 736 drivers/hid/hid-steam.c hid_set_drvdata(hdev, steam); hdev 742 drivers/hid/hid-steam.c steam->client_hdev = steam_create_client_hid(hdev); hdev 753 drivers/hid/hid-steam.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_HIDRAW); hdev 761 drivers/hid/hid-steam.c ret = hid_hw_open(hdev); hdev 763 drivers/hid/hid-steam.c hid_err(hdev, hdev 770 drivers/hid/hid-steam.c hid_info(hdev, "Steam wireless receiver connected"); hdev 779 drivers/hid/hid-steam.c hid_err(hdev, hdev 791 drivers/hid/hid-steam.c hid_hw_stop(hdev); hdev 797 drivers/hid/hid-steam.c hid_err(hdev, "%s: failed with error %d\n", hdev 802 drivers/hid/hid-steam.c static void steam_remove(struct hid_device *hdev) hdev 804 drivers/hid/hid-steam.c struct steam_device *steam = hid_get_drvdata(hdev); hdev 806 drivers/hid/hid-steam.c if (!steam || hdev->group == HID_GROUP_STEAM) { hdev 807 drivers/hid/hid-steam.c hid_hw_stop(hdev); hdev 815 drivers/hid/hid-steam.c hid_info(hdev, "Steam wireless receiver disconnected"); hdev 817 drivers/hid/hid-steam.c hid_hw_close(hdev); hdev 818 drivers/hid/hid-steam.c hid_hw_stop(hdev); hdev 1015 drivers/hid/hid-steam.c static int steam_raw_event(struct hid_device *hdev, hdev 1019 drivers/hid/hid-steam.c struct steam_device *steam = hid_get_drvdata(hdev); hdev 109 drivers/hid/hid-steelseries.c static void steelseries_srws1_set_leds(struct hid_device *hdev, __u16 leds) hdev 111 drivers/hid/hid-steelseries.c struct list_head *report_list = &hdev->report_enum[HID_OUTPUT_REPORT].report_list; hdev 132 drivers/hid/hid-steelseries.c hid_hw_request(hdev, report, HID_REQ_SET_REPORT); hdev 225 drivers/hid/hid-steelseries.c static int steelseries_srws1_probe(struct hid_device *hdev, hdev 236 drivers/hid/hid-steelseries.c hid_err(hdev, "can't alloc SRW-S1 memory\n"); hdev 240 drivers/hid/hid-steelseries.c hid_set_drvdata(hdev, drv_data); hdev 242 drivers/hid/hid-steelseries.c ret = hid_parse(hdev); hdev 244 drivers/hid/hid-steelseries.c hid_err(hdev, "parse failed\n"); hdev 248 drivers/hid/hid-steelseries.c if (!hid_validate_values(hdev, HID_OUTPUT_REPORT, 0, 0, 16)) { hdev 253 drivers/hid/hid-steelseries.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 255 drivers/hid/hid-steelseries.c hid_err(hdev, "hw start failed\n"); hdev 264 drivers/hid/hid-steelseries.c steelseries_srws1_set_leds(hdev, 0); hdev 266 drivers/hid/hid-steelseries.c name_sz = strlen(hdev->uniq) + 16; hdev 271 drivers/hid/hid-steelseries.c hid_err(hdev, "can't allocate memory for LED ALL\n"); hdev 276 drivers/hid/hid-steelseries.c snprintf(name, name_sz, "SRWS1::%s::RPMALL", hdev->uniq); hdev 284 drivers/hid/hid-steelseries.c ret = led_classdev_register(&hdev->dev, led); hdev 292 drivers/hid/hid-steelseries.c hid_err(hdev, "can't allocate memory for LED %d\n", i); hdev 297 drivers/hid/hid-steelseries.c snprintf(name, name_sz, "SRWS1::%s::RPM%d", hdev->uniq, i+1); hdev 305 drivers/hid/hid-steelseries.c ret = led_classdev_register(&hdev->dev, led); hdev 308 drivers/hid/hid-steelseries.c hid_err(hdev, "failed to register LED %d. Aborting.\n", i); hdev 329 drivers/hid/hid-steelseries.c static void steelseries_srws1_remove(struct hid_device *hdev) hdev 334 drivers/hid/hid-steelseries.c struct steelseries_srws1_data *drv_data = hid_get_drvdata(hdev); hdev 349 drivers/hid/hid-steelseries.c hid_hw_stop(hdev); hdev 355 drivers/hid/hid-steelseries.c static __u8 *steelseries_srws1_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 360 drivers/hid/hid-steelseries.c hid_info(hdev, "Fixing up Steelseries SRW-S1 report descriptor\n"); hdev 21 drivers/hid/hid-sunplus.c static __u8 *sp_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 26 drivers/hid/hid-sunplus.c hid_info(hdev, "fixing up Sunplus Wireless Desktop report descriptor\n"); hdev 35 drivers/hid/hid-sunplus.c static int sp_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 22 drivers/hid/hid-tivo.c static int tivo_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 217 drivers/hid/hid-tmff.c static int tm_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 221 drivers/hid/hid-tmff.c ret = hid_parse(hdev); hdev 223 drivers/hid/hid-tmff.c hid_err(hdev, "parse failed\n"); hdev 227 drivers/hid/hid-tmff.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); hdev 229 drivers/hid/hid-tmff.c hid_err(hdev, "hw start failed\n"); hdev 233 drivers/hid/hid-tmff.c tmff_init(hdev, (void *)id->driver_data); hdev 26 drivers/hid/hid-topseed.c static int ts_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 61 drivers/hid/hid-twinhan.c static int twinhan_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 60 drivers/hid/hid-u2fzero.c struct hid_device *hdev; hdev 80 drivers/hid/hid-u2fzero.c ret = hid_hw_output_report(dev->hdev, dev->buf_out, hdev 109 drivers/hid/hid-u2fzero.c struct hid_device *hdev = dev->hdev; hdev 121 drivers/hid/hid-u2fzero.c hid_err(hdev, "usb_submit_urb failed: %d", ret); hdev 125 drivers/hid/hid-u2fzero.c ret = hid_hw_output_report(dev->hdev, dev->buf_out, hdev 129 drivers/hid/hid-u2fzero.c hid_err(hdev, "hid_hw_output_report failed: %d", ret); hdev 137 drivers/hid/hid-u2fzero.c hid_err(hdev, "urb submission timed out"); hdev 196 drivers/hid/hid-u2fzero.c hid_dbg(dev->hdev, "device not present"); hdev 216 drivers/hid/hid-u2fzero.c dev->led_name = devm_kasprintf(&dev->hdev->dev, GFP_KERNEL, hdev 226 drivers/hid/hid-u2fzero.c return devm_led_classdev_register(&dev->hdev->dev, &dev->ldev); hdev 232 drivers/hid/hid-u2fzero.c dev->rng_name = devm_kasprintf(&dev->hdev->dev, GFP_KERNEL, hdev 241 drivers/hid/hid-u2fzero.c return devm_hwrng_register(&dev->hdev->dev, &dev->hwrng); hdev 246 drivers/hid/hid-u2fzero.c struct hid_device *hdev = dev->hdev; hdev 248 drivers/hid/hid-u2fzero.c struct usbhid_device *usbhid = hdev->driver_data; hdev 252 drivers/hid/hid-u2fzero.c if (dev->hdev->bus != BUS_USB) hdev 255 drivers/hid/hid-u2fzero.c udev = hid_to_usb_dev(hdev); hdev 282 drivers/hid/hid-u2fzero.c static int u2fzero_probe(struct hid_device *hdev, hdev 289 drivers/hid/hid-u2fzero.c if (!hid_is_using_ll_driver(hdev, &usb_hid_driver)) hdev 292 drivers/hid/hid-u2fzero.c dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL); hdev 296 drivers/hid/hid-u2fzero.c dev->buf_out = devm_kmalloc(&hdev->dev, hdev 301 drivers/hid/hid-u2fzero.c dev->buf_in = devm_kmalloc(&hdev->dev, hdev 306 drivers/hid/hid-u2fzero.c ret = hid_parse(hdev); hdev 310 drivers/hid/hid-u2fzero.c dev->hdev = hdev; hdev 311 drivers/hid/hid-u2fzero.c hid_set_drvdata(hdev, dev); hdev 314 drivers/hid/hid-u2fzero.c ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW); hdev 322 drivers/hid/hid-u2fzero.c minor = ((struct hidraw *) hdev->hidraw)->minor; hdev 326 drivers/hid/hid-u2fzero.c hid_hw_stop(hdev); hdev 330 drivers/hid/hid-u2fzero.c hid_info(hdev, "U2F Zero LED initialised\n"); hdev 334 drivers/hid/hid-u2fzero.c hid_hw_stop(hdev); hdev 338 drivers/hid/hid-u2fzero.c hid_info(hdev, "U2F Zero RNG initialised\n"); hdev 343 drivers/hid/hid-u2fzero.c static void u2fzero_remove(struct hid_device *hdev) hdev 345 drivers/hid/hid-u2fzero.c struct u2fzero_device *dev = hid_get_drvdata(hdev); hdev 351 drivers/hid/hid-u2fzero.c hid_hw_stop(hdev); hdev 72 drivers/hid/hid-uclogic-core.c static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 75 drivers/hid/hid-uclogic-core.c struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev); hdev 84 drivers/hid/hid-uclogic-core.c static int uclogic_input_mapping(struct hid_device *hdev, hdev 91 drivers/hid/hid-uclogic-core.c struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev); hdev 102 drivers/hid/hid-uclogic-core.c static int uclogic_input_configured(struct hid_device *hdev, hdev 105 drivers/hid/hid-uclogic-core.c struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev); hdev 149 drivers/hid/hid-uclogic-core.c len = strlen(hdev->name) + 2 + strlen(suffix); hdev 152 drivers/hid/hid-uclogic-core.c snprintf(name, len, "%s %s", hdev->name, suffix); hdev 160 drivers/hid/hid-uclogic-core.c static int uclogic_probe(struct hid_device *hdev, hdev 171 drivers/hid/hid-uclogic-core.c hdev->quirks |= HID_QUIRK_MULTI_INPUT; hdev 174 drivers/hid/hid-uclogic-core.c drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL); hdev 181 drivers/hid/hid-uclogic-core.c hid_set_drvdata(hdev, drvdata); hdev 184 drivers/hid/hid-uclogic-core.c rc = uclogic_params_init(&drvdata->params, hdev); hdev 186 drivers/hid/hid-uclogic-core.c hid_err(hdev, "failed probing parameters: %d\n", rc); hdev 190 drivers/hid/hid-uclogic-core.c hid_dbg(hdev, "parameters:\n" UCLOGIC_PARAMS_FMT_STR, hdev 193 drivers/hid/hid-uclogic-core.c hid_info(hdev, "interface is invalid, ignoring\n"); hdev 203 drivers/hid/hid-uclogic-core.c hid_err(hdev, hdev 209 drivers/hid/hid-uclogic-core.c rc = hid_parse(hdev); hdev 211 drivers/hid/hid-uclogic-core.c hid_err(hdev, "parse failed\n"); hdev 215 drivers/hid/hid-uclogic-core.c rc = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 217 drivers/hid/hid-uclogic-core.c hid_err(hdev, "hw start failed\n"); hdev 230 drivers/hid/hid-uclogic-core.c static int uclogic_resume(struct hid_device *hdev) hdev 236 drivers/hid/hid-uclogic-core.c rc = uclogic_params_init(¶ms, hdev); hdev 238 drivers/hid/hid-uclogic-core.c hid_err(hdev, "failed to re-initialize the device\n"); hdev 246 drivers/hid/hid-uclogic-core.c static int uclogic_raw_event(struct hid_device *hdev, hdev 250 drivers/hid/hid-uclogic-core.c struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev); hdev 345 drivers/hid/hid-uclogic-core.c static void uclogic_remove(struct hid_device *hdev) hdev 347 drivers/hid/hid-uclogic-core.c struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev); hdev 350 drivers/hid/hid-uclogic-core.c hid_hw_stop(hdev); hdev 64 drivers/hid/hid-uclogic-params.c static int uclogic_params_get_str_desc(__u8 **pbuf, struct hid_device *hdev, hdev 68 drivers/hid/hid-uclogic-params.c struct usb_device *udev = hid_to_usb_dev(hdev); hdev 72 drivers/hid/hid-uclogic-params.c if (hdev == NULL) { hdev 89 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, "string descriptor #%hhu not found\n", idx); hdev 92 drivers/hid/hid-uclogic-params.c hid_err(hdev, hdev 139 drivers/hid/hid-uclogic-params.c struct hid_device *hdev) hdev 153 drivers/hid/hid-uclogic-params.c if (pen == NULL || pfound == NULL || hdev == NULL) { hdev 164 drivers/hid/hid-uclogic-params.c rc = uclogic_params_get_str_desc(&buf, hdev, 100, len); hdev 166 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, hdev 170 drivers/hid/hid-uclogic-params.c hid_err(hdev, "failed retrieving pen parameters: %d\n", rc); hdev 173 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, hdev 267 drivers/hid/hid-uclogic-params.c struct hid_device *hdev) hdev 281 drivers/hid/hid-uclogic-params.c if (pen == NULL || pfound == NULL || hdev == NULL) { hdev 292 drivers/hid/hid-uclogic-params.c rc = uclogic_params_get_str_desc(&buf, hdev, 200, len); hdev 294 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, hdev 298 drivers/hid/hid-uclogic-params.c hid_err(hdev, "failed retrieving pen parameters: %d\n", rc); hdev 301 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, hdev 317 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, hdev 448 drivers/hid/hid-uclogic-params.c struct hid_device *hdev) hdev 452 drivers/hid/hid-uclogic-params.c struct usb_device *usb_dev = hid_to_usb_dev(hdev); hdev 457 drivers/hid/hid-uclogic-params.c if (frame == NULL || pfound == NULL || hdev == NULL) { hdev 473 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, hdev 478 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, hdev 482 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, "generic buttons enabled\n"); hdev 630 drivers/hid/hid-uclogic-params.c struct hid_device *hdev, hdev 640 drivers/hid/hid-uclogic-params.c if (params == NULL || hdev == NULL || hdev 647 drivers/hid/hid-uclogic-params.c if (hdev->dev_rsize == orig_desc_size) { hdev 648 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, hdev 657 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, hdev 659 drivers/hid/hid-uclogic-params.c hdev->dev_rsize, orig_desc_size); hdev 705 drivers/hid/hid-uclogic-params.c struct hid_device *hdev) hdev 708 drivers/hid/hid-uclogic-params.c struct usb_device *udev = hid_to_usb_dev(hdev); hdev 709 drivers/hid/hid-uclogic-params.c struct usb_interface *iface = to_usb_interface(hdev->dev.parent); hdev 719 drivers/hid/hid-uclogic-params.c if (params == NULL || hdev == NULL) { hdev 741 drivers/hid/hid-uclogic-params.c hid_err(hdev, hdev 748 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, hdev 752 drivers/hid/hid-uclogic-params.c rc = uclogic_params_pen_init_v2(&p.pen, &found, hdev); hdev 754 drivers/hid/hid-uclogic-params.c hid_err(hdev, hdev 758 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, "pen v2 parameters found\n"); hdev 766 drivers/hid/hid-uclogic-params.c hid_err(hdev, hdev 775 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, "pen v2 parameters not found\n"); hdev 779 drivers/hid/hid-uclogic-params.c rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev); hdev 781 drivers/hid/hid-uclogic-params.c hid_err(hdev, hdev 785 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, "pen v1 parameters found\n"); hdev 789 drivers/hid/hid-uclogic-params.c &found, hdev); hdev 791 drivers/hid/hid-uclogic-params.c hid_err(hdev, "v1 buttonpad probing failed: %d\n", rc); hdev 794 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, "buttonpad v1 parameters%s found\n", hdev 802 drivers/hid/hid-uclogic-params.c hid_dbg(hdev, "pen v1 parameters not found\n"); hdev 832 drivers/hid/hid-uclogic-params.c struct hid_device *hdev) hdev 835 drivers/hid/hid-uclogic-params.c struct usb_device *udev = hid_to_usb_dev(hdev); hdev 837 drivers/hid/hid-uclogic-params.c struct usb_interface *iface = to_usb_interface(hdev->dev.parent); hdev 844 drivers/hid/hid-uclogic-params.c if (params == NULL || hdev == NULL || hdev 845 drivers/hid/hid-uclogic-params.c !hid_is_using_ll_driver(hdev, &usb_hid_driver)) { hdev 856 drivers/hid/hid-uclogic-params.c &p, hdev, \ hdev 883 drivers/hid/hid-uclogic-params.c switch (VID_PID(hdev->vendor, hdev->product)) { hdev 898 drivers/hid/hid-uclogic-params.c if (hdev->dev_rsize == UCLOGIC_RDESC_WP5540U_V2_ORIG_SIZE) { hdev 902 drivers/hid/hid-uclogic-params.c &found, hdev); hdev 904 drivers/hid/hid-uclogic-params.c hid_err(hdev, hdev 910 drivers/hid/hid-uclogic-params.c hid_warn(hdev, hdev 994 drivers/hid/hid-uclogic-params.c rc = uclogic_params_huion_init(&p, hdev); hdev 1009 drivers/hid/hid-uclogic-params.c rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev); hdev 1011 drivers/hid/hid-uclogic-params.c hid_err(hdev, "pen probing failed: %d\n", rc); hdev 1015 drivers/hid/hid-uclogic-params.c hid_warn(hdev, "pen parameters not found"); hdev 1028 drivers/hid/hid-uclogic-params.c rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev); hdev 1030 drivers/hid/hid-uclogic-params.c hid_err(hdev, "pen probing failed: %d\n", rc); hdev 1054 drivers/hid/hid-uclogic-params.c rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev); hdev 1056 drivers/hid/hid-uclogic-params.c hid_err(hdev, "pen probing failed: %d\n", rc); hdev 1065 drivers/hid/hid-uclogic-params.c hid_err(hdev, hdev 1075 drivers/hid/hid-uclogic-params.c hid_warn(hdev, "pen parameters not found"); hdev 1088 drivers/hid/hid-uclogic-params.c rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev); hdev 1090 drivers/hid/hid-uclogic-params.c hid_err(hdev, "pen probing failed: %d\n", rc); hdev 1099 drivers/hid/hid-uclogic-params.c hid_err(hdev, hdev 1105 drivers/hid/hid-uclogic-params.c hid_warn(hdev, "pen parameters not found"); hdev 161 drivers/hid/hid-uclogic-params.h struct hid_device *hdev); hdev 73 drivers/hid/hid-udraw-ps3.c struct hid_device *hdev; hdev 101 drivers/hid/hid-udraw-ps3.c static int udraw_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 104 drivers/hid/hid-udraw-ps3.c struct udraw *udraw = hid_get_drvdata(hdev); hdev 268 drivers/hid/hid-udraw-ps3.c return hid_hw_open(udraw->hdev); hdev 275 drivers/hid/hid-udraw-ps3.c hid_hw_close(udraw->hdev); hdev 278 drivers/hid/hid-udraw-ps3.c static struct input_dev *allocate_and_setup(struct hid_device *hdev, hdev 283 drivers/hid/hid-udraw-ps3.c input_dev = devm_input_allocate_device(&hdev->dev); hdev 288 drivers/hid/hid-udraw-ps3.c input_dev->phys = hdev->phys; hdev 289 drivers/hid/hid-udraw-ps3.c input_dev->dev.parent = &hdev->dev; hdev 292 drivers/hid/hid-udraw-ps3.c input_dev->uniq = hdev->uniq; hdev 293 drivers/hid/hid-udraw-ps3.c input_dev->id.bustype = hdev->bus; hdev 294 drivers/hid/hid-udraw-ps3.c input_dev->id.vendor = hdev->vendor; hdev 295 drivers/hid/hid-udraw-ps3.c input_dev->id.product = hdev->product; hdev 296 drivers/hid/hid-udraw-ps3.c input_dev->id.version = hdev->version; hdev 297 drivers/hid/hid-udraw-ps3.c input_set_drvdata(input_dev, hid_get_drvdata(hdev)); hdev 303 drivers/hid/hid-udraw-ps3.c struct hid_device *hdev) hdev 307 drivers/hid/hid-udraw-ps3.c input_dev = allocate_and_setup(hdev, DEVICE_NAME " Touchpad"); hdev 330 drivers/hid/hid-udraw-ps3.c struct hid_device *hdev) hdev 334 drivers/hid/hid-udraw-ps3.c input_dev = allocate_and_setup(hdev, DEVICE_NAME " Pen"); hdev 358 drivers/hid/hid-udraw-ps3.c struct hid_device *hdev) hdev 362 drivers/hid/hid-udraw-ps3.c input_dev = allocate_and_setup(hdev, DEVICE_NAME " Accelerometer"); hdev 381 drivers/hid/hid-udraw-ps3.c struct hid_device *hdev) hdev 385 drivers/hid/hid-udraw-ps3.c input_dev = allocate_and_setup(hdev, DEVICE_NAME " Joypad"); hdev 407 drivers/hid/hid-udraw-ps3.c static int udraw_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 412 drivers/hid/hid-udraw-ps3.c udraw = devm_kzalloc(&hdev->dev, sizeof(struct udraw), GFP_KERNEL); hdev 416 drivers/hid/hid-udraw-ps3.c udraw->hdev = hdev; hdev 420 drivers/hid/hid-udraw-ps3.c hid_set_drvdata(hdev, udraw); hdev 422 drivers/hid/hid-udraw-ps3.c ret = hid_parse(hdev); hdev 424 drivers/hid/hid-udraw-ps3.c hid_err(hdev, "parse failed\n"); hdev 428 drivers/hid/hid-udraw-ps3.c if (!udraw_setup_joypad(udraw, hdev) || hdev 429 drivers/hid/hid-udraw-ps3.c !udraw_setup_touch(udraw, hdev) || hdev 430 drivers/hid/hid-udraw-ps3.c !udraw_setup_pen(udraw, hdev) || hdev 431 drivers/hid/hid-udraw-ps3.c !udraw_setup_accel(udraw, hdev)) { hdev 432 drivers/hid/hid-udraw-ps3.c hid_err(hdev, "could not allocate interfaces\n"); hdev 441 drivers/hid/hid-udraw-ps3.c hid_err(hdev, "failed to register interfaces\n"); hdev 445 drivers/hid/hid-udraw-ps3.c ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW | HID_CONNECT_DRIVER); hdev 447 drivers/hid/hid-udraw-ps3.c hid_err(hdev, "hw start failed\n"); hdev 73 drivers/hid/hid-viewsonic.c static __u8 *viewsonic_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 76 drivers/hid/hid-viewsonic.c switch (hdev->product) { hdev 602 drivers/hid/hid-waltop.c static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 605 drivers/hid/hid-waltop.c switch (hdev->product) { hdev 652 drivers/hid/hid-waltop.c static int waltop_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 671 drivers/hid/hid-waltop.c if (hdev->product == USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET && hdev 22 drivers/hid/hid-wiimote-core.c static int wiimote_hid_send(struct hid_device *hdev, __u8 *buffer, hdev 28 drivers/hid/hid-wiimote-core.c if (!hdev->ll_driver->output_report) hdev 35 drivers/hid/hid-wiimote-core.c ret = hid_hw_output_report(hdev, buf, count); hdev 54 drivers/hid/hid-wiimote-core.c ret = wiimote_hid_send(wdata->hdev, hdev 77 drivers/hid/hid-wiimote-core.c hid_warn(wdata->hdev, "Sending too large output report\n"); hdev 105 drivers/hid/hid-wiimote-core.c hid_warn(wdata->hdev, "Output queue is full"); hdev 317 drivers/hid/hid-wiimote-core.c hid_warn(wdata->hdev, "Invalid length %d wmem request\n", size); hdev 342 drivers/hid/hid-wiimote-core.c hid_warn(wdata->hdev, "Invalid length %d rmem request\n", size); hdev 441 drivers/hid/hid-wiimote-core.c hid_dbg(wdata->hdev, "extension ID: %6phC\n", rmem); hdev 519 drivers/hid/hid-wiimote-core.c hid_dbg(wdata->hdev, "motion plus ID: %6phC\n", rmem); hdev 524 drivers/hid/hid-wiimote-core.c hid_info(wdata->hdev, "unknown motion plus ID: %6phC\n", rmem); hdev 540 drivers/hid/hid-wiimote-core.c hid_dbg(wdata->hdev, "mapped motion plus ID: %6phC\n", rmem); hdev 643 drivers/hid/hid-wiimote-core.c wdata->input->dev.parent = &wdata->hdev->dev; hdev 644 drivers/hid/hid-wiimote-core.c wdata->input->id.bustype = wdata->hdev->bus; hdev 645 drivers/hid/hid-wiimote-core.c wdata->input->id.vendor = wdata->hdev->vendor; hdev 646 drivers/hid/hid-wiimote-core.c wdata->input->id.product = wdata->hdev->product; hdev 647 drivers/hid/hid-wiimote-core.c wdata->input->id.version = wdata->hdev->version; hdev 816 drivers/hid/hid-wiimote-core.c vendor = wdata->hdev->vendor; hdev 817 drivers/hid/hid-wiimote-core.c product = wdata->hdev->product; hdev 818 drivers/hid/hid-wiimote-core.c name = wdata->hdev->name; hdev 854 drivers/hid/hid-wiimote-core.c hid_info(wdata->hdev, "cannot detect device; NAME: %s VID: %04x PID: %04x EXT: %04x\n", hdev 857 drivers/hid/hid-wiimote-core.c hid_info(wdata->hdev, "detected device: %s\n", hdev 922 drivers/hid/hid-wiimote-core.c hid_info(wdata->hdev, "detected extension: Nintendo Wii Motion Plus\n"); hdev 973 drivers/hid/hid-wiimote-core.c hid_dbg(wdata->hdev, "state left: !EXT && MP\n"); hdev 997 drivers/hid/hid-wiimote-core.c hid_dbg(wdata->hdev, "state left: EXT && !MP\n"); hdev 1024 drivers/hid/hid-wiimote-core.c hid_dbg(wdata->hdev, "state left: !EXT && !MP\n"); hdev 1054 drivers/hid/hid-wiimote-core.c hid_dbg(wdata->hdev, "state left: EXT && MP\n"); hdev 1101 drivers/hid/hid-wiimote-core.c hid_dbg(wdata->hdev, "detect extensions..\n"); hdev 1134 drivers/hid/hid-wiimote-core.c hid_info(wdata->hdev, "cannot detect extension; %6phC\n", hdev 1141 drivers/hid/hid-wiimote-core.c hid_info(wdata->hdev, "detected extension: %s\n", hdev 1151 drivers/hid/hid-wiimote-core.c hid_info(wdata->hdev, "detected extension: Nintendo Wii Motion Plus\n"); hdev 1199 drivers/hid/hid-wiimote-core.c hid_dbg(wdata->hdev, "detected extensions: MP: %d EXT: %d\n", hdev 1218 drivers/hid/hid-wiimote-core.c kobject_uevent(&wdata->hdev->dev.kobj, KOBJ_CHANGE); hdev 1325 drivers/hid/hid-wiimote-core.c hid_dbg(wdata->hdev, "MP hotplug: 1\n"); hdev 1331 drivers/hid/hid-wiimote-core.c hid_dbg(wdata->hdev, "MP hotplug: 0\n"); hdev 1427 drivers/hid/hid-wiimote-core.c hid_dbg(wdata->hdev, "EXT hotplug: 1\n"); hdev 1433 drivers/hid/hid-wiimote-core.c hid_dbg(wdata->hdev, "EXT hotplug: 0\n"); hdev 1485 drivers/hid/hid-wiimote-core.c hid_warn(wdata->hdev, "Remote error %hhu on req %hhu\n", err, hdev 1617 drivers/hid/hid-wiimote-core.c static int wiimote_hid_event(struct hid_device *hdev, struct hid_report *report, hdev 1620 drivers/hid/hid-wiimote-core.c struct wiimote_data *wdata = hid_get_drvdata(hdev); hdev 1639 drivers/hid/hid-wiimote-core.c hid_warn(hdev, "Unhandled report %hhu size %d\n", raw_data[0], hdev 1733 drivers/hid/hid-wiimote-core.c static struct wiimote_data *wiimote_create(struct hid_device *hdev) hdev 1741 drivers/hid/hid-wiimote-core.c wdata->hdev = hdev; hdev 1742 drivers/hid/hid-wiimote-core.c hid_set_drvdata(hdev, wdata); hdev 1773 drivers/hid/hid-wiimote-core.c device_remove_file(&wdata->hdev->dev, &dev_attr_devtype); hdev 1774 drivers/hid/hid-wiimote-core.c device_remove_file(&wdata->hdev->dev, &dev_attr_extension); hdev 1780 drivers/hid/hid-wiimote-core.c hid_hw_close(wdata->hdev); hdev 1781 drivers/hid/hid-wiimote-core.c hid_hw_stop(wdata->hdev); hdev 1786 drivers/hid/hid-wiimote-core.c static int wiimote_hid_probe(struct hid_device *hdev, hdev 1792 drivers/hid/hid-wiimote-core.c hdev->quirks |= HID_QUIRK_NO_INIT_REPORTS; hdev 1794 drivers/hid/hid-wiimote-core.c wdata = wiimote_create(hdev); hdev 1796 drivers/hid/hid-wiimote-core.c hid_err(hdev, "Can't alloc device\n"); hdev 1800 drivers/hid/hid-wiimote-core.c ret = hid_parse(hdev); hdev 1802 drivers/hid/hid-wiimote-core.c hid_err(hdev, "HID parse failed\n"); hdev 1806 drivers/hid/hid-wiimote-core.c ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW); hdev 1808 drivers/hid/hid-wiimote-core.c hid_err(hdev, "HW start failed\n"); hdev 1812 drivers/hid/hid-wiimote-core.c ret = hid_hw_open(hdev); hdev 1814 drivers/hid/hid-wiimote-core.c hid_err(hdev, "cannot start hardware I/O\n"); hdev 1818 drivers/hid/hid-wiimote-core.c ret = device_create_file(&hdev->dev, &dev_attr_extension); hdev 1820 drivers/hid/hid-wiimote-core.c hid_err(hdev, "cannot create sysfs attribute\n"); hdev 1824 drivers/hid/hid-wiimote-core.c ret = device_create_file(&hdev->dev, &dev_attr_devtype); hdev 1826 drivers/hid/hid-wiimote-core.c hid_err(hdev, "cannot create sysfs attribute\n"); hdev 1834 drivers/hid/hid-wiimote-core.c hid_info(hdev, "New device registered\n"); hdev 1846 drivers/hid/hid-wiimote-core.c device_remove_file(&wdata->hdev->dev, &dev_attr_extension); hdev 1848 drivers/hid/hid-wiimote-core.c hid_hw_close(hdev); hdev 1850 drivers/hid/hid-wiimote-core.c hid_hw_stop(hdev); hdev 1858 drivers/hid/hid-wiimote-core.c static void wiimote_hid_remove(struct hid_device *hdev) hdev 1860 drivers/hid/hid-wiimote-core.c struct wiimote_data *wdata = hid_get_drvdata(hdev); hdev 1862 drivers/hid/hid-wiimote-core.c hid_info(hdev, "Device removed\n"); hdev 185 drivers/hid/hid-wiimote-debug.c dbg->wdata->hdev->debug_dir, dbg, &wiidebug_eeprom_fops); hdev 190 drivers/hid/hid-wiimote-debug.c dbg->wdata->hdev->debug_dir, dbg, &wiidebug_drm_fops); hdev 246 drivers/hid/hid-wiimote-modules.c wdata->hdev->uniq); hdev 250 drivers/hid/hid-wiimote-modules.c wdata->battery = power_supply_register(&wdata->hdev->dev, hdev 254 drivers/hid/hid-wiimote-modules.c hid_err(wdata->hdev, "cannot register battery device\n"); hdev 259 drivers/hid/hid-wiimote-modules.c power_supply_powers(wdata->battery, &wdata->hdev->dev); hdev 341 drivers/hid/hid-wiimote-modules.c struct device *dev = &wdata->hdev->dev; hdev 493 drivers/hid/hid-wiimote-modules.c wdata->accel->dev.parent = &wdata->hdev->dev; hdev 494 drivers/hid/hid-wiimote-modules.c wdata->accel->id.bustype = wdata->hdev->bus; hdev 495 drivers/hid/hid-wiimote-modules.c wdata->accel->id.vendor = wdata->hdev->vendor; hdev 496 drivers/hid/hid-wiimote-modules.c wdata->accel->id.product = wdata->hdev->product; hdev 497 drivers/hid/hid-wiimote-modules.c wdata->accel->id.version = wdata->hdev->version; hdev 510 drivers/hid/hid-wiimote-modules.c hid_err(wdata->hdev, "cannot register input device\n"); hdev 745 drivers/hid/hid-wiimote-modules.c wdata->ir->dev.parent = &wdata->hdev->dev; hdev 746 drivers/hid/hid-wiimote-modules.c wdata->ir->id.bustype = wdata->hdev->bus; hdev 747 drivers/hid/hid-wiimote-modules.c wdata->ir->id.vendor = wdata->hdev->vendor; hdev 748 drivers/hid/hid-wiimote-modules.c wdata->ir->id.product = wdata->hdev->product; hdev 749 drivers/hid/hid-wiimote-modules.c wdata->ir->id.version = wdata->hdev->version; hdev 772 drivers/hid/hid-wiimote-modules.c hid_err(wdata->hdev, "cannot register input device\n"); hdev 940 drivers/hid/hid-wiimote-modules.c wdata->extension.input->dev.parent = &wdata->hdev->dev; hdev 941 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.bustype = wdata->hdev->bus; hdev 942 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.vendor = wdata->hdev->vendor; hdev 943 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.product = wdata->hdev->product; hdev 944 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.version = wdata->hdev->version; hdev 1215 drivers/hid/hid-wiimote-modules.c wdata->extension.input->dev.parent = &wdata->hdev->dev; hdev 1216 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.bustype = wdata->hdev->bus; hdev 1217 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.vendor = wdata->hdev->vendor; hdev 1218 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.product = wdata->hdev->product; hdev 1219 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.version = wdata->hdev->version; hdev 1483 drivers/hid/hid-wiimote-modules.c ret = device_create_file(&wdata->hdev->dev, hdev 1486 drivers/hid/hid-wiimote-modules.c hid_err(wdata->hdev, "cannot create sysfs attribute\n"); hdev 1493 drivers/hid/hid-wiimote-modules.c wdata->extension.input->dev.parent = &wdata->hdev->dev; hdev 1494 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.bustype = wdata->hdev->bus; hdev 1495 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.vendor = wdata->hdev->vendor; hdev 1496 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.product = wdata->hdev->product; hdev 1497 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.version = wdata->hdev->version; hdev 1524 drivers/hid/hid-wiimote-modules.c device_remove_file(&wdata->hdev->dev, hdev 1540 drivers/hid/hid-wiimote-modules.c device_remove_file(&wdata->hdev->dev, hdev 1872 drivers/hid/hid-wiimote-modules.c ret = device_create_file(&wdata->hdev->dev, hdev 1875 drivers/hid/hid-wiimote-modules.c hid_err(wdata->hdev, "cannot create sysfs attribute\n"); hdev 1881 drivers/hid/hid-wiimote-modules.c wdata->extension.input->dev.parent = &wdata->hdev->dev; hdev 1882 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.bustype = wdata->hdev->bus; hdev 1883 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.vendor = wdata->hdev->vendor; hdev 1884 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.product = wdata->hdev->product; hdev 1885 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.version = wdata->hdev->version; hdev 1914 drivers/hid/hid-wiimote-modules.c device_remove_file(&wdata->hdev->dev, hdev 1933 drivers/hid/hid-wiimote-modules.c device_remove_file(&wdata->hdev->dev, hdev 2101 drivers/hid/hid-wiimote-modules.c wdata->extension.input->dev.parent = &wdata->hdev->dev; hdev 2102 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.bustype = wdata->hdev->bus; hdev 2103 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.vendor = wdata->hdev->vendor; hdev 2104 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.product = wdata->hdev->product; hdev 2105 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.version = wdata->hdev->version; hdev 2331 drivers/hid/hid-wiimote-modules.c wdata->extension.input->dev.parent = &wdata->hdev->dev; hdev 2332 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.bustype = wdata->hdev->bus; hdev 2333 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.vendor = wdata->hdev->vendor; hdev 2334 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.product = wdata->hdev->product; hdev 2335 drivers/hid/hid-wiimote-modules.c wdata->extension.input->id.version = wdata->hdev->version; hdev 2566 drivers/hid/hid-wiimote-modules.c wdata->mp->dev.parent = &wdata->hdev->dev; hdev 2567 drivers/hid/hid-wiimote-modules.c wdata->mp->id.bustype = wdata->hdev->bus; hdev 2568 drivers/hid/hid-wiimote-modules.c wdata->mp->id.vendor = wdata->hdev->vendor; hdev 2569 drivers/hid/hid-wiimote-modules.c wdata->mp->id.product = wdata->hdev->product; hdev 2570 drivers/hid/hid-wiimote-modules.c wdata->mp->id.version = wdata->hdev->version; hdev 144 drivers/hid/hid-wiimote.h struct hid_device *hdev; hdev 25 drivers/hid/hid-xinmo.c static int xinmo_event(struct hid_device *hdev, struct hid_field *field, hdev 104 drivers/hid/hid-zpff.c static int zp_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 108 drivers/hid/hid-zpff.c ret = hid_parse(hdev); hdev 110 drivers/hid/hid-zpff.c hid_err(hdev, "parse failed\n"); hdev 114 drivers/hid/hid-zpff.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); hdev 116 drivers/hid/hid-zpff.c hid_err(hdev, "hw start failed\n"); hdev 120 drivers/hid/hid-zpff.c zpff_init(hdev); hdev 27 drivers/hid/hid-zydacron.c static __u8 *zc_report_fixup(struct hid_device *hdev, __u8 *rdesc, hdev 34 drivers/hid/hid-zydacron.c hid_info(hdev, hdev 45 drivers/hid/hid-zydacron.c static int zc_input_mapping(struct hid_device *hdev, struct hid_input *hi, hdev 50 drivers/hid/hid-zydacron.c struct zc_device *zc = hid_get_drvdata(hdev); hdev 109 drivers/hid/hid-zydacron.c static int zc_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 112 drivers/hid/hid-zydacron.c struct zc_device *zc = hid_get_drvdata(hdev); hdev 164 drivers/hid/hid-zydacron.c static int zc_probe(struct hid_device *hdev, const struct hid_device_id *id) hdev 169 drivers/hid/hid-zydacron.c zc = devm_kzalloc(&hdev->dev, sizeof(*zc), GFP_KERNEL); hdev 171 drivers/hid/hid-zydacron.c hid_err(hdev, "can't alloc descriptor\n"); hdev 175 drivers/hid/hid-zydacron.c hid_set_drvdata(hdev, zc); hdev 177 drivers/hid/hid-zydacron.c ret = hid_parse(hdev); hdev 179 drivers/hid/hid-zydacron.c hid_err(hdev, "parse failed\n"); hdev 183 drivers/hid/hid-zydacron.c ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); hdev 185 drivers/hid/hid-zydacron.c hid_err(hdev, "hw start failed\n"); hdev 162 drivers/hid/wacom.h struct hid_device *hdev; hdev 230 drivers/hid/wacom.h void wacom_wac_usage_mapping(struct hid_device *hdev, hdev 232 drivers/hid/wacom.h void wacom_wac_event(struct hid_device *hdev, struct hid_field *field, hdev 234 drivers/hid/wacom.h void wacom_wac_report(struct hid_device *hdev, struct hid_report *report); hdev 22 drivers/hid/wacom_sys.c static int wacom_get_report(struct hid_device *hdev, u8 type, u8 *buf, hdev 28 drivers/hid/wacom_sys.c retval = hid_hw_raw_request(hdev, buf[0], buf, size, type, hdev 33 drivers/hid/wacom_sys.c hid_err(hdev, "wacom_get_report: ran out of retries " hdev 39 drivers/hid/wacom_sys.c static int wacom_set_report(struct hid_device *hdev, u8 type, u8 *buf, hdev 45 drivers/hid/wacom_sys.c retval = hid_hw_raw_request(hdev, buf[0], buf, size, type, hdev 50 drivers/hid/wacom_sys.c hid_err(hdev, "wacom_set_report: ran out of retries " hdev 56 drivers/hid/wacom_sys.c static void wacom_wac_queue_insert(struct hid_device *hdev, hdev 64 drivers/hid/wacom_sys.c hid_warn(hdev, "%s: kfifo has filled, starting to drop events\n", __func__); hdev 73 drivers/hid/wacom_sys.c static void wacom_wac_queue_flush(struct hid_device *hdev, hdev 82 drivers/hid/wacom_sys.c err = hid_report_raw_event(hdev, HID_INPUT_REPORT, buf, size, false); hdev 84 drivers/hid/wacom_sys.c hid_warn(hdev, "%s: unable to flush event due to error %d\n", hdev 90 drivers/hid/wacom_sys.c static int wacom_wac_pen_serial_enforce(struct hid_device *hdev, hdev 93 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 121 drivers/hid/wacom_sys.c value = hid_field_extract(hdev, raw_data+1, offset + j * size, size); hdev 150 drivers/hid/wacom_sys.c wacom_wac_queue_flush(hdev, &wacom_wac->pen_fifo); hdev 152 drivers/hid/wacom_sys.c wacom_wac_queue_insert(hdev, &wacom_wac->pen_fifo, hdev 158 drivers/hid/wacom_sys.c static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report, hdev 161 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 166 drivers/hid/wacom_sys.c if (wacom_wac_pen_serial_enforce(hdev, report, raw_data, size)) hdev 180 drivers/hid/wacom_sys.c return hid_hw_open(wacom->hdev); hdev 191 drivers/hid/wacom_sys.c if (wacom->hdev) hdev 192 drivers/hid/wacom_sys.c hid_hw_close(wacom->hdev); hdev 211 drivers/hid/wacom_sys.c static void wacom_hid_usage_quirk(struct hid_device *hdev, hdev 214 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 222 drivers/hid/wacom_sys.c if (hdev->vendor == USB_VENDOR_ID_WACOM && hdev 223 drivers/hid/wacom_sys.c hdev->product == 0x4200 && hdev 286 drivers/hid/wacom_sys.c if (hdev->vendor == USB_VENDOR_ID_WACOM && hdev 287 drivers/hid/wacom_sys.c hdev->product == 0x0358 && hdev 294 drivers/hid/wacom_sys.c static void wacom_feature_mapping(struct hid_device *hdev, hdev 297 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 305 drivers/hid/wacom_sys.c wacom_hid_usage_quirk(hdev, field, usage); hdev 320 drivers/hid/wacom_sys.c ret = wacom_get_report(hdev, HID_FEATURE_REPORT, hdev 323 drivers/hid/wacom_sys.c ret = hid_report_raw_event(hdev, hdev 329 drivers/hid/wacom_sys.c hid_warn(hdev, "wacom_feature_mapping: " hdev 340 drivers/hid/wacom_sys.c dev_err(&hdev->dev, "HID_DG_INPUTMODE out of range\n"); hdev 381 drivers/hid/wacom_sys.c ret = wacom_get_report(hdev, HID_FEATURE_REPORT, hdev 384 drivers/hid/wacom_sys.c ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT, hdev 387 drivers/hid/wacom_sys.c hid_warn(hdev, "%s: could not retrieve sensor offsets\n", hdev 427 drivers/hid/wacom_sys.c static void wacom_usage_mapping(struct hid_device *hdev, hdev 430 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 448 drivers/hid/wacom_sys.c wacom_hid_usage_quirk(hdev, field, usage); hdev 480 drivers/hid/wacom_sys.c wacom_wac_usage_mapping(hdev, field, usage); hdev 483 drivers/hid/wacom_sys.c static void wacom_post_parse_hid(struct hid_device *hdev, hdev 486 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 511 drivers/hid/wacom_sys.c static void wacom_parse_hid(struct hid_device *hdev, hdev 519 drivers/hid/wacom_sys.c rep_enum = &hdev->report_enum[HID_FEATURE_REPORT]; hdev 527 drivers/hid/wacom_sys.c wacom_feature_mapping(hdev, hreport->field[i], hdev 534 drivers/hid/wacom_sys.c rep_enum = &hdev->report_enum[HID_INPUT_REPORT]; hdev 542 drivers/hid/wacom_sys.c wacom_usage_mapping(hdev, hreport->field[i], hdev 546 drivers/hid/wacom_sys.c wacom_post_parse_hid(hdev, features); hdev 549 drivers/hid/wacom_sys.c static int wacom_hid_set_device_mode(struct hid_device *hdev) hdev 551 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 559 drivers/hid/wacom_sys.c re = &(hdev->report_enum[HID_FEATURE_REPORT]); hdev 563 drivers/hid/wacom_sys.c hid_hw_request(hdev, r, HID_REQ_SET_REPORT); hdev 568 drivers/hid/wacom_sys.c static int wacom_set_device_mode(struct hid_device *hdev, hdev 580 drivers/hid/wacom_sys.c re = &(hdev->report_enum[HID_FEATURE_REPORT]); hdev 595 drivers/hid/wacom_sys.c error = wacom_set_report(hdev, HID_FEATURE_REPORT, rep_data, hdev 598 drivers/hid/wacom_sys.c error = wacom_get_report(hdev, HID_FEATURE_REPORT, hdev 609 drivers/hid/wacom_sys.c static int wacom_bt_query_tablet_data(struct hid_device *hdev, u8 speed, hdev 612 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 620 drivers/hid/wacom_sys.c ret = wacom_set_report(hdev, HID_FEATURE_REPORT, rep_data, 2, hdev 627 drivers/hid/wacom_sys.c ret = wacom_set_report(hdev, HID_FEATURE_REPORT, hdev 640 drivers/hid/wacom_sys.c hid_warn(hdev, "failed to poke device, command %d, err %d\n", hdev 652 drivers/hid/wacom_sys.c ret = wacom_set_report(hdev, HID_FEATURE_REPORT, rep_data, 2, hdev 671 drivers/hid/wacom_sys.c struct hid_device *hdev = wacom->hdev; hdev 675 drivers/hid/wacom_sys.c if (hdev->bus == BUS_BLUETOOTH) hdev 676 drivers/hid/wacom_sys.c return wacom_bt_query_tablet_data(hdev, 1, features); hdev 702 drivers/hid/wacom_sys.c wacom_set_device_mode(hdev, wacom_wac); hdev 705 drivers/hid/wacom_sys.c return wacom_hid_set_device_mode(hdev); hdev 710 drivers/hid/wacom_sys.c static void wacom_retrieve_hid_descriptor(struct hid_device *hdev, hdev 713 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 737 drivers/hid/wacom_sys.c wacom_parse_hid(hdev, features); hdev 750 drivers/hid/wacom_sys.c static bool wacom_are_sibling(struct hid_device *hdev, hdev 753 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 757 drivers/hid/wacom_sys.c __u32 oVid = features->oVid ? features->oVid : hdev->vendor; hdev 758 drivers/hid/wacom_sys.c __u32 oPid = features->oPid ? features->oPid : hdev->product; hdev 771 drivers/hid/wacom_sys.c if (hdev->vendor == sibling->vendor && hdev->product == sibling->product) { hdev 772 drivers/hid/wacom_sys.c if (!hid_compare_device_paths(hdev, sibling, '/')) hdev 775 drivers/hid/wacom_sys.c if (!hid_compare_device_paths(hdev, sibling, '.')) hdev 816 drivers/hid/wacom_sys.c static struct wacom_hdev_data *wacom_get_hdev_data(struct hid_device *hdev) hdev 822 drivers/hid/wacom_sys.c if (hid_compare_device_paths(hdev, data->dev, '/')) { hdev 830 drivers/hid/wacom_sys.c if (wacom_are_sibling(hdev, data->dev)) { hdev 861 drivers/hid/wacom_sys.c if (wacom_wac->shared->touch == wacom->hdev) hdev 863 drivers/hid/wacom_sys.c else if (wacom_wac->shared->pen == wacom->hdev) hdev 871 drivers/hid/wacom_sys.c static int wacom_add_shared_data(struct hid_device *hdev) hdev 873 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 880 drivers/hid/wacom_sys.c data = wacom_get_hdev_data(hdev); hdev 889 drivers/hid/wacom_sys.c data->dev = hdev; hdev 895 drivers/hid/wacom_sys.c retval = devm_add_action(&hdev->dev, wacom_remove_shared_data, wacom); hdev 903 drivers/hid/wacom_sys.c wacom_wac->shared->touch = hdev; hdev 905 drivers/hid/wacom_sys.c wacom_wac->shared->pen = hdev; hdev 956 drivers/hid/wacom_sys.c wacom_get_report(wacom->hdev, HID_FEATURE_REPORT, hdev 987 drivers/hid/wacom_sys.c retval = wacom_set_report(wacom->hdev, HID_FEATURE_REPORT, buf, buf_size, hdev 1008 drivers/hid/wacom_sys.c retval = wacom_set_report(wacom->hdev, HID_FEATURE_REPORT, buf, 2, hdev 1019 drivers/hid/wacom_sys.c retval = wacom_set_report(wacom->hdev, HID_FEATURE_REPORT, hdev 1028 drivers/hid/wacom_sys.c wacom_set_report(wacom->hdev, HID_FEATURE_REPORT, buf, 2, hdev 1039 drivers/hid/wacom_sys.c struct hid_device *hdev = to_hid_device(dev); hdev 1040 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 1067 drivers/hid/wacom_sys.c struct hid_device *hdev = to_hid_device(dev);\ hdev 1068 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); \ hdev 1103 drivers/hid/wacom_sys.c struct hid_device *hdev = to_hid_device(dev);\ hdev 1104 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); \ hdev 1126 drivers/hid/wacom_sys.c struct hid_device *hdev = to_hid_device(dev); hdev 1127 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 1132 drivers/hid/wacom_sys.c if (hdev->bus == BUS_BLUETOOTH) { hdev 1261 drivers/hid/wacom_sys.c devres_add(&wacom->hdev->dev, devres); hdev 1269 drivers/hid/wacom_sys.c return __wacom_devm_sysfs_create_group(wacom, &wacom->hdev->dev.kobj, hdev 1350 drivers/hid/wacom_sys.c hid_err(wacom->hdev, hdev 1375 drivers/hid/wacom_sys.c hid_err(wacom->hdev, hdev 1435 drivers/hid/wacom_sys.c error = devm_add_action_or_reset(&wacom->hdev->dev, hdev 1502 drivers/hid/wacom_sys.c struct device *dev = &wacom->hdev->dev; hdev 1564 drivers/hid/wacom_sys.c hid_err(wacom->hdev, hdev 1585 drivers/hid/wacom_sys.c hid_err(wacom->hdev, hdev 1602 drivers/hid/wacom_sys.c hid_err(wacom->hdev, hdev 1622 drivers/hid/wacom_sys.c hid_err(wacom->hdev, hdev 1636 drivers/hid/wacom_sys.c hid_err(wacom->hdev, hdev 1647 drivers/hid/wacom_sys.c hid_err(wacom->hdev, hdev 1658 drivers/hid/wacom_sys.c hid_err(wacom->hdev, hdev 1732 drivers/hid/wacom_sys.c struct device *dev = &wacom->hdev->dev; hdev 1760 drivers/hid/wacom_sys.c power_supply_powers(ps_bat, &wacom->hdev->dev); hdev 1783 drivers/hid/wacom_sys.c devres_release_group(&wacom->hdev->dev, hdev 1793 drivers/hid/wacom_sys.c struct hid_device *hdev = to_hid_device(dev); hdev 1794 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 1803 drivers/hid/wacom_sys.c struct hid_device *hdev = to_hid_device(dev); hdev 1804 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 1813 drivers/hid/wacom_sys.c wacom_bt_query_tablet_data(hdev, new_speed, &wacom->wacom_wac.features); hdev 1827 drivers/hid/wacom_sys.c struct hid_device *hdev = to_hid_device(dev); hdev 1828 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 1867 drivers/hid/wacom_sys.c remote->remotes[index].group.name = devm_kasprintf(&wacom->hdev->dev, hdev 1877 drivers/hid/wacom_sys.c hid_err(wacom->hdev, hdev 1898 drivers/hid/wacom_sys.c retval = wacom_set_report(wacom->hdev, HID_OUTPUT_REPORT, buf, hdev 1911 drivers/hid/wacom_sys.c struct hid_device *hdev = to_hid_device(dev); hdev 1912 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 1918 drivers/hid/wacom_sys.c hid_info(wacom->hdev, "remote: unrecognized unpair code: %s\n", hdev 1963 drivers/hid/wacom_sys.c remote = devm_kzalloc(&wacom->hdev->dev, sizeof(*wacom->remote), hdev 1976 drivers/hid/wacom_sys.c hid_err(wacom->hdev, "failed allocating remote_fifo\n"); hdev 1987 drivers/hid/wacom_sys.c &wacom->hdev->dev.kobj); hdev 1994 drivers/hid/wacom_sys.c hid_err(wacom->hdev, hdev 2004 drivers/hid/wacom_sys.c error = devm_add_action_or_reset(&wacom->hdev->dev, hdev 2015 drivers/hid/wacom_sys.c struct hid_device *hdev = wacom->hdev; hdev 2018 drivers/hid/wacom_sys.c input_dev = devm_input_allocate_device(&hdev->dev); hdev 2023 drivers/hid/wacom_sys.c input_dev->phys = hdev->phys; hdev 2024 drivers/hid/wacom_sys.c input_dev->dev.parent = &hdev->dev; hdev 2027 drivers/hid/wacom_sys.c input_dev->uniq = hdev->uniq; hdev 2028 drivers/hid/wacom_sys.c input_dev->id.bustype = hdev->bus; hdev 2029 drivers/hid/wacom_sys.c input_dev->id.vendor = hdev->vendor; hdev 2030 drivers/hid/wacom_sys.c input_dev->id.product = wacom_wac->pid ? wacom_wac->pid : hdev->product; hdev 2031 drivers/hid/wacom_sys.c input_dev->id.version = hdev->version; hdev 2161 drivers/hid/wacom_sys.c static size_t wacom_compute_pktlen(struct hid_device *hdev) hdev 2167 drivers/hid/wacom_sys.c report_enum = hdev->report_enum + HID_INPUT_REPORT; hdev 2186 drivers/hid/wacom_sys.c char *product_name = wacom->hdev->name; hdev 2188 drivers/hid/wacom_sys.c if (hid_is_using_ll_driver(wacom->hdev, &usb_hid_driver)) { hdev 2189 drivers/hid/wacom_sys.c struct usb_interface *intf = to_usb_interface(wacom->hdev->dev.parent); hdev 2194 drivers/hid/wacom_sys.c if (wacom->hdev->bus == BUS_I2C) { hdev 2196 drivers/hid/wacom_sys.c features->name, wacom->hdev->product); hdev 2235 drivers/hid/wacom_sys.c struct hid_device *hdev = wacom->hdev; hdev 2240 drivers/hid/wacom_sys.c devres_release_group(&hdev->dev, wacom); hdev 2273 drivers/hid/wacom_sys.c struct hid_device *hdev = wacom->hdev; hdev 2277 drivers/hid/wacom_sys.c features->pktlen = wacom_compute_pktlen(hdev); hdev 2281 drivers/hid/wacom_sys.c if (!devres_open_group(&hdev->dev, wacom, GFP_KERNEL)) hdev 2309 drivers/hid/wacom_sys.c wacom_retrieve_hid_descriptor(hdev, features); hdev 2316 drivers/hid/wacom_sys.c dev_warn(&hdev->dev, "Unknown device_type for '%s'. %s.", hdev 2317 drivers/hid/wacom_sys.c hdev->name, hdev 2338 drivers/hid/wacom_sys.c error = wacom_add_shared_data(hdev); hdev 2367 drivers/hid/wacom_sys.c error = hid_hw_start(hdev, connect_mask); hdev 2369 drivers/hid/wacom_sys.c hid_err(hdev, "hw start failed\n"); hdev 2388 drivers/hid/wacom_sys.c error = hid_hw_open(hdev); hdev 2391 drivers/hid/wacom_sys.c devres_close_group(&hdev->dev, wacom); hdev 2396 drivers/hid/wacom_sys.c hid_hw_stop(hdev); hdev 2432 drivers/hid/wacom_sys.c hid_info(wacom->hdev, "wireless tablet disconnected\n"); hdev 2436 drivers/hid/wacom_sys.c hid_info(wacom->hdev, "wireless tablet connected with PID %x\n", hdev 2447 drivers/hid/wacom_sys.c hid_info(wacom->hdev, "ignoring unknown PID.\n"); hdev 2504 drivers/hid/wacom_sys.c devres_release_group(&wacom->hdev->dev, hdev 2508 drivers/hid/wacom_sys.c devres_release_group(&wacom->hdev->dev, hdev 2523 drivers/hid/wacom_sys.c struct device *dev = &wacom->hdev->dev; hdev 2624 drivers/hid/wacom_sys.c hid_err(wacom->hdev, hdev 2667 drivers/hid/wacom_sys.c hid_hw_stop(wacom1->hdev); hdev 2675 drivers/hid/wacom_sys.c hid_hw_stop(wacom2->hdev); hdev 2695 drivers/hid/wacom_sys.c static int wacom_probe(struct hid_device *hdev, hdev 2698 drivers/hid/wacom_sys.c struct usb_interface *intf = to_usb_interface(hdev->dev.parent); hdev 2708 drivers/hid/wacom_sys.c hdev->quirks |= HID_QUIRK_NO_INIT_REPORTS; hdev 2711 drivers/hid/wacom_sys.c hdev->quirks &= ~HID_QUIRK_NOGET; hdev 2713 drivers/hid/wacom_sys.c wacom = devm_kzalloc(&hdev->dev, sizeof(struct wacom), GFP_KERNEL); hdev 2717 drivers/hid/wacom_sys.c hid_set_drvdata(hdev, wacom); hdev 2718 drivers/hid/wacom_sys.c wacom->hdev = hdev; hdev 2724 drivers/hid/wacom_sys.c if (features->check_for_hid_type && features->hid_type != hdev->type) hdev 2744 drivers/hid/wacom_sys.c error = hid_parse(hdev); hdev 2746 drivers/hid/wacom_sys.c hid_err(hdev, "parse failed\n"); hdev 2754 drivers/hid/wacom_sys.c if (hdev->bus == BUS_BLUETOOTH) { hdev 2755 drivers/hid/wacom_sys.c error = device_create_file(&hdev->dev, &dev_attr_speed); hdev 2757 drivers/hid/wacom_sys.c hid_warn(hdev, hdev 2765 drivers/hid/wacom_sys.c static void wacom_remove(struct hid_device *hdev) hdev 2767 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2772 drivers/hid/wacom_sys.c hid_hw_close(hdev); hdev 2774 drivers/hid/wacom_sys.c hid_hw_stop(hdev); hdev 2781 drivers/hid/wacom_sys.c if (hdev->bus == BUS_BLUETOOTH) hdev 2782 drivers/hid/wacom_sys.c device_remove_file(&hdev->dev, &dev_attr_speed); hdev 2794 drivers/hid/wacom_sys.c static int wacom_resume(struct hid_device *hdev) hdev 2796 drivers/hid/wacom_sys.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2809 drivers/hid/wacom_sys.c static int wacom_reset_resume(struct hid_device *hdev) hdev 2811 drivers/hid/wacom_sys.c return wacom_resume(hdev); hdev 465 drivers/hid/wacom_wac.c re = &(wacom->hdev->report_enum[HID_FEATURE_REPORT]); hdev 471 drivers/hid/wacom_wac.c hid_hw_request(wacom->hdev, r, HID_REQ_GET_REPORT); hdev 1059 drivers/hid/wacom_wac.c hid_dbg(wacom->hdev, "%s: received unknown report #%d", hdev 1164 drivers/hid/wacom_wac.c hid_err(wacom->hdev, "Can't queue Remote status event.\n"); hdev 1883 drivers/hid/wacom_wac.c static void wacom_wac_battery_usage_mapping(struct hid_device *hdev, hdev 1886 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 1900 drivers/hid/wacom_wac.c static void wacom_wac_battery_event(struct hid_device *hdev, struct hid_field *field, hdev 1903 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 1934 drivers/hid/wacom_wac.c static void wacom_wac_battery_pre_report(struct hid_device *hdev, hdev 1940 drivers/hid/wacom_wac.c static void wacom_wac_battery_report(struct hid_device *hdev, hdev 1943 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 1959 drivers/hid/wacom_wac.c static void wacom_wac_pad_usage_mapping(struct hid_device *hdev, hdev 1962 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2066 drivers/hid/wacom_wac.c static void wacom_wac_pad_event(struct hid_device *hdev, struct hid_field *field, hdev 2069 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2098 drivers/hid/wacom_wac.c if (hdev->vendor == 0x56a && hdev 2099 drivers/hid/wacom_wac.c (hdev->product == 0x34d || hdev->product == 0x34e || /* MobileStudio Pro */ hdev 2100 drivers/hid/wacom_wac.c hdev->product == 0x357 || hdev->product == 0x358 || /* Intuos Pro 2 */ hdev 2101 drivers/hid/wacom_wac.c hdev->product == 0x392 || /* Intuos Pro 2 */ hdev 2102 drivers/hid/wacom_wac.c hdev->product == 0x398 || hdev->product == 0x399 || /* MobileStudio Pro */ hdev 2103 drivers/hid/wacom_wac.c hdev->product == 0x3AA)) { /* MobileStudio Pro */ hdev 2106 drivers/hid/wacom_wac.c if (hdev->product == 0x357 || hdev->product == 0x358 || hdev 2107 drivers/hid/wacom_wac.c hdev->product == 0x392) hdev 2109 drivers/hid/wacom_wac.c else if (hdev->product == 0x34d || hdev->product == 0x34e || hdev 2110 drivers/hid/wacom_wac.c hdev->product == 0x398 || hdev->product == 0x399 || hdev 2111 drivers/hid/wacom_wac.c hdev->product == 0x3AA) hdev 2164 drivers/hid/wacom_wac.c static void wacom_wac_pad_pre_report(struct hid_device *hdev, hdev 2167 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2173 drivers/hid/wacom_wac.c static void wacom_wac_pad_report(struct hid_device *hdev, hdev 2176 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2190 drivers/hid/wacom_wac.c static void wacom_wac_pen_usage_mapping(struct hid_device *hdev, hdev 2193 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2269 drivers/hid/wacom_wac.c static void wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field, hdev 2272 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2353 drivers/hid/wacom_wac.c hid_warn(hdev, "%s: overriding existing left offset " hdev 2360 drivers/hid/wacom_wac.c hid_warn(hdev, "%s: overriding existing right offset " hdev 2367 drivers/hid/wacom_wac.c hid_warn(hdev, "%s: overriding existing top offset " hdev 2374 drivers/hid/wacom_wac.c hid_warn(hdev, "%s: overriding existing bottom offset " hdev 2397 drivers/hid/wacom_wac.c static void wacom_wac_pen_pre_report(struct hid_device *hdev, hdev 2400 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2407 drivers/hid/wacom_wac.c static void wacom_wac_pen_report(struct hid_device *hdev, hdev 2410 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2473 drivers/hid/wacom_wac.c static void wacom_wac_finger_usage_mapping(struct hid_device *hdev, hdev 2476 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2569 drivers/hid/wacom_wac.c static void wacom_wac_finger_event(struct hid_device *hdev, hdev 2572 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2613 drivers/hid/wacom_wac.c static void wacom_wac_finger_pre_report(struct hid_device *hdev, hdev 2616 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2664 drivers/hid/wacom_wac.c static void wacom_wac_finger_report(struct hid_device *hdev, hdev 2667 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2689 drivers/hid/wacom_wac.c void wacom_wac_usage_mapping(struct hid_device *hdev, hdev 2692 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2701 drivers/hid/wacom_wac.c wacom_wac_battery_usage_mapping(hdev, field, usage); hdev 2703 drivers/hid/wacom_wac.c wacom_wac_pad_usage_mapping(hdev, field, usage); hdev 2705 drivers/hid/wacom_wac.c wacom_wac_pen_usage_mapping(hdev, field, usage); hdev 2707 drivers/hid/wacom_wac.c wacom_wac_finger_usage_mapping(hdev, field, usage); hdev 2710 drivers/hid/wacom_wac.c void wacom_wac_event(struct hid_device *hdev, struct hid_field *field, hdev 2713 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2723 drivers/hid/wacom_wac.c wacom_wac_battery_event(hdev, field, usage, value); hdev 2725 drivers/hid/wacom_wac.c wacom_wac_pad_event(hdev, field, usage, value); hdev 2727 drivers/hid/wacom_wac.c wacom_wac_pen_event(hdev, field, usage, value); hdev 2729 drivers/hid/wacom_wac.c wacom_wac_finger_event(hdev, field, usage, value); hdev 2732 drivers/hid/wacom_wac.c static void wacom_report_events(struct hid_device *hdev, hdev 2750 drivers/hid/wacom_wac.c wacom_wac_event(hdev, field, &field->usage[n], hdev 2758 drivers/hid/wacom_wac.c static int wacom_wac_collection(struct hid_device *hdev, struct hid_report *report, hdev 2762 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2764 drivers/hid/wacom_wac.c wacom_report_events(hdev, report, collection_index, field_index); hdev 2777 drivers/hid/wacom_wac.c wacom_wac_pen_report(hdev, report); hdev 2779 drivers/hid/wacom_wac.c wacom_wac_finger_report(hdev, report); hdev 2784 drivers/hid/wacom_wac.c void wacom_wac_report(struct hid_device *hdev, struct hid_report *report) hdev 2786 drivers/hid/wacom_wac.c struct wacom *wacom = hid_get_drvdata(hdev); hdev 2810 drivers/hid/wacom_wac.c wacom_wac_battery_pre_report(hdev, report); hdev 2813 drivers/hid/wacom_wac.c wacom_wac_pad_pre_report(hdev, report); hdev 2815 drivers/hid/wacom_wac.c wacom_wac_pen_pre_report(hdev, report); hdev 2817 drivers/hid/wacom_wac.c wacom_wac_finger_pre_report(hdev, report); hdev 2823 drivers/hid/wacom_wac.c if (wacom_wac_collection(hdev, report, hdev 2830 drivers/hid/wacom_wac.c wacom_wac_battery_report(hdev, report); hdev 2833 drivers/hid/wacom_wac.c wacom_wac_pad_report(hdev, report, field); hdev 3524 drivers/hid/wacom_wac.c if (wacom->hdev->bus == BUS_BLUETOOTH) hdev 3549 drivers/hid/wacom_wac.c if (wacom->hdev->product == 0x382 || wacom->hdev->product == 0x37d) { hdev 3913 drivers/hid/wacom_wac.c hid_err(wacom->hdev, "can't find LED %d in group %d\n", hdev 3962 drivers/hid/wacom_wac.c hid_err(wacom->hdev, "can't find current LED %d in group %d\n", hdev 3977 drivers/hid/wacom_wac.c hid_err(wacom->hdev, "can't find next LED in group %d\n", hdev 585 drivers/hwmon/hwmon.c struct device *hdev; hdev 604 drivers/hwmon/hwmon.c hdev = &hwdev->dev; hdev 635 drivers/hwmon/hwmon.c hdev->groups = hwdev->groups; hdev 637 drivers/hwmon/hwmon.c hdev->groups = groups; hdev 641 drivers/hwmon/hwmon.c hdev->class = &hwmon_class; hdev 642 drivers/hwmon/hwmon.c hdev->parent = dev; hdev 643 drivers/hwmon/hwmon.c hdev->of_node = dev ? dev->of_node : NULL; hdev 645 drivers/hwmon/hwmon.c dev_set_drvdata(hdev, drvdata); hdev 646 drivers/hwmon/hwmon.c dev_set_name(hdev, HWMON_ID_FORMAT, id); hdev 647 drivers/hwmon/hwmon.c err = device_register(hdev); hdev 665 drivers/hwmon/hwmon.c err = hwmon_thermal_add_sensor(hdev, j); hdev 667 drivers/hwmon/hwmon.c device_unregister(hdev); hdev 681 drivers/hwmon/hwmon.c return hdev; hdev 684 drivers/hwmon/hwmon.c hwmon_dev_release(hdev); hdev 414 drivers/iio/common/hid-sensors/hid-sensor-attributes.c hid_dbg(hsdev->hdev, "Report latency attributes: %x:%x\n", hdev 493 drivers/iio/common/hid-sensors/hid-sensor-attributes.c hid_dbg(hsdev->hdev, "common attributes: %x:%x, %x:%x, %x:%x %x:%x %x:%x\n", hdev 139 drivers/media/platform/qcom/venus/hfi_venus.c static void venus_set_state(struct venus_hfi_device *hdev, hdev 142 drivers/media/platform/qcom/venus/hfi_venus.c mutex_lock(&hdev->lock); hdev 143 drivers/media/platform/qcom/venus/hfi_venus.c hdev->state = state; hdev 144 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 147 drivers/media/platform/qcom/venus/hfi_venus.c static bool venus_is_valid_state(struct venus_hfi_device *hdev) hdev 149 drivers/media/platform/qcom/venus/hfi_venus.c return hdev->state != VENUS_STATE_DEINIT; hdev 152 drivers/media/platform/qcom/venus/hfi_venus.c static void venus_dump_packet(struct venus_hfi_device *hdev, const void *packet) hdev 163 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_write_queue(struct venus_hfi_device *hdev, hdev 179 drivers/media/platform/qcom/venus/hfi_venus.c venus_dump_packet(hdev, packet); hdev 232 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_read_queue(struct venus_hfi_device *hdev, hdev 320 drivers/media/platform/qcom/venus/hfi_venus.c venus_dump_packet(hdev, pkt); hdev 325 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_alloc(struct venus_hfi_device *hdev, struct mem_desc *desc, hdev 328 drivers/media/platform/qcom/venus/hfi_venus.c struct device *dev = hdev->core->dev; hdev 341 drivers/media/platform/qcom/venus/hfi_venus.c static void venus_free(struct venus_hfi_device *hdev, struct mem_desc *mem) hdev 343 drivers/media/platform/qcom/venus/hfi_venus.c struct device *dev = hdev->core->dev; hdev 348 drivers/media/platform/qcom/venus/hfi_venus.c static void venus_writel(struct venus_hfi_device *hdev, u32 reg, u32 value) hdev 350 drivers/media/platform/qcom/venus/hfi_venus.c writel(value, hdev->core->base + reg); hdev 353 drivers/media/platform/qcom/venus/hfi_venus.c static u32 venus_readl(struct venus_hfi_device *hdev, u32 reg) hdev 355 drivers/media/platform/qcom/venus/hfi_venus.c return readl(hdev->core->base + reg); hdev 358 drivers/media/platform/qcom/venus/hfi_venus.c static void venus_set_registers(struct venus_hfi_device *hdev) hdev 360 drivers/media/platform/qcom/venus/hfi_venus.c const struct venus_resources *res = hdev->core->res; hdev 366 drivers/media/platform/qcom/venus/hfi_venus.c venus_writel(hdev, tbl[i].reg, tbl[i].value); hdev 369 drivers/media/platform/qcom/venus/hfi_venus.c static void venus_soft_int(struct venus_hfi_device *hdev) hdev 371 drivers/media/platform/qcom/venus/hfi_venus.c venus_writel(hdev, CPU_IC_SOFTINT, BIT(CPU_IC_SOFTINT_H2A_SHIFT)); hdev 374 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_iface_cmdq_write_nolock(struct venus_hfi_device *hdev, hdev 377 drivers/media/platform/qcom/venus/hfi_venus.c struct device *dev = hdev->core->dev; hdev 383 drivers/media/platform/qcom/venus/hfi_venus.c if (!venus_is_valid_state(hdev)) hdev 387 drivers/media/platform/qcom/venus/hfi_venus.c hdev->last_packet_type = cmd_packet->pkt_type; hdev 389 drivers/media/platform/qcom/venus/hfi_venus.c queue = &hdev->queues[IFACEQ_CMD_IDX]; hdev 391 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_write_queue(hdev, queue, pkt, &rx_req); hdev 398 drivers/media/platform/qcom/venus/hfi_venus.c venus_soft_int(hdev); hdev 403 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_iface_cmdq_write(struct venus_hfi_device *hdev, void *pkt) hdev 407 drivers/media/platform/qcom/venus/hfi_venus.c mutex_lock(&hdev->lock); hdev 408 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_cmdq_write_nolock(hdev, pkt); hdev 409 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 417 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(core); hdev 431 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_cmdq_write(hdev, pkt); hdev 438 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_boot_core(struct venus_hfi_device *hdev) hdev 440 drivers/media/platform/qcom/venus/hfi_venus.c struct device *dev = hdev->core->dev; hdev 446 drivers/media/platform/qcom/venus/hfi_venus.c venus_writel(hdev, VIDC_CTRL_INIT, BIT(VIDC_CTRL_INIT_CTRL_SHIFT)); hdev 447 drivers/media/platform/qcom/venus/hfi_venus.c venus_writel(hdev, WRAPPER_INTR_MASK, WRAPPER_INTR_MASK_A2HVCODEC_MASK); hdev 448 drivers/media/platform/qcom/venus/hfi_venus.c venus_writel(hdev, CPU_CS_SCIACMDARG3, 1); hdev 451 drivers/media/platform/qcom/venus/hfi_venus.c ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0); hdev 468 drivers/media/platform/qcom/venus/hfi_venus.c static u32 venus_hwversion(struct venus_hfi_device *hdev) hdev 470 drivers/media/platform/qcom/venus/hfi_venus.c struct device *dev = hdev->core->dev; hdev 471 drivers/media/platform/qcom/venus/hfi_venus.c u32 ver = venus_readl(hdev, WRAPPER_HW_VERSION); hdev 485 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_run(struct venus_hfi_device *hdev) hdev 487 drivers/media/platform/qcom/venus/hfi_venus.c struct device *dev = hdev->core->dev; hdev 494 drivers/media/platform/qcom/venus/hfi_venus.c venus_set_registers(hdev); hdev 496 drivers/media/platform/qcom/venus/hfi_venus.c venus_writel(hdev, UC_REGION_ADDR, hdev->ifaceq_table.da); hdev 497 drivers/media/platform/qcom/venus/hfi_venus.c venus_writel(hdev, UC_REGION_SIZE, SHARED_QSIZE); hdev 498 drivers/media/platform/qcom/venus/hfi_venus.c venus_writel(hdev, CPU_CS_SCIACMDARG2, hdev->ifaceq_table.da); hdev 499 drivers/media/platform/qcom/venus/hfi_venus.c venus_writel(hdev, CPU_CS_SCIACMDARG1, 0x01); hdev 500 drivers/media/platform/qcom/venus/hfi_venus.c if (hdev->sfr.da) hdev 501 drivers/media/platform/qcom/venus/hfi_venus.c venus_writel(hdev, SFR_ADDR, hdev->sfr.da); hdev 503 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_boot_core(hdev); hdev 509 drivers/media/platform/qcom/venus/hfi_venus.c venus_hwversion(hdev); hdev 514 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_halt_axi(struct venus_hfi_device *hdev) hdev 516 drivers/media/platform/qcom/venus/hfi_venus.c void __iomem *base = hdev->core->base; hdev 517 drivers/media/platform/qcom/venus/hfi_venus.c struct device *dev = hdev->core->dev; hdev 521 drivers/media/platform/qcom/venus/hfi_venus.c if (IS_V4(hdev->core)) { hdev 522 drivers/media/platform/qcom/venus/hfi_venus.c val = venus_readl(hdev, WRAPPER_CPU_AXI_HALT); hdev 524 drivers/media/platform/qcom/venus/hfi_venus.c venus_writel(hdev, WRAPPER_CPU_AXI_HALT, val); hdev 540 drivers/media/platform/qcom/venus/hfi_venus.c val = venus_readl(hdev, VBIF_AXI_HALT_CTRL0); hdev 542 drivers/media/platform/qcom/venus/hfi_venus.c venus_writel(hdev, VBIF_AXI_HALT_CTRL0, val); hdev 557 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_power_off(struct venus_hfi_device *hdev) hdev 561 drivers/media/platform/qcom/venus/hfi_venus.c if (!hdev->power_enabled) hdev 564 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_set_hw_state_suspend(hdev->core); hdev 568 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_halt_axi(hdev); hdev 572 drivers/media/platform/qcom/venus/hfi_venus.c hdev->power_enabled = false; hdev 577 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_power_on(struct venus_hfi_device *hdev) hdev 581 drivers/media/platform/qcom/venus/hfi_venus.c if (hdev->power_enabled) hdev 584 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_set_hw_state_resume(hdev->core); hdev 588 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_run(hdev); hdev 592 drivers/media/platform/qcom/venus/hfi_venus.c hdev->power_enabled = true; hdev 597 drivers/media/platform/qcom/venus/hfi_venus.c venus_set_hw_state_suspend(hdev->core); hdev 599 drivers/media/platform/qcom/venus/hfi_venus.c hdev->power_enabled = false; hdev 603 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_iface_msgq_read_nolock(struct venus_hfi_device *hdev, hdev 610 drivers/media/platform/qcom/venus/hfi_venus.c if (!venus_is_valid_state(hdev)) hdev 613 drivers/media/platform/qcom/venus/hfi_venus.c queue = &hdev->queues[IFACEQ_MSG_IDX]; hdev 615 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_read_queue(hdev, queue, pkt, &tx_req); hdev 620 drivers/media/platform/qcom/venus/hfi_venus.c venus_soft_int(hdev); hdev 625 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_iface_msgq_read(struct venus_hfi_device *hdev, void *pkt) hdev 629 drivers/media/platform/qcom/venus/hfi_venus.c mutex_lock(&hdev->lock); hdev 630 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_msgq_read_nolock(hdev, pkt); hdev 631 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 636 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_iface_dbgq_read_nolock(struct venus_hfi_device *hdev, hdev 643 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_is_valid_state(hdev); hdev 647 drivers/media/platform/qcom/venus/hfi_venus.c queue = &hdev->queues[IFACEQ_DBG_IDX]; hdev 649 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_read_queue(hdev, queue, pkt, &tx_req); hdev 654 drivers/media/platform/qcom/venus/hfi_venus.c venus_soft_int(hdev); hdev 659 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_iface_dbgq_read(struct venus_hfi_device *hdev, void *pkt) hdev 666 drivers/media/platform/qcom/venus/hfi_venus.c mutex_lock(&hdev->lock); hdev 667 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_dbgq_read_nolock(hdev, pkt); hdev 668 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 689 drivers/media/platform/qcom/venus/hfi_venus.c static void venus_interface_queues_release(struct venus_hfi_device *hdev) hdev 691 drivers/media/platform/qcom/venus/hfi_venus.c mutex_lock(&hdev->lock); hdev 693 drivers/media/platform/qcom/venus/hfi_venus.c venus_free(hdev, &hdev->ifaceq_table); hdev 694 drivers/media/platform/qcom/venus/hfi_venus.c venus_free(hdev, &hdev->sfr); hdev 696 drivers/media/platform/qcom/venus/hfi_venus.c memset(hdev->queues, 0, sizeof(hdev->queues)); hdev 697 drivers/media/platform/qcom/venus/hfi_venus.c memset(&hdev->ifaceq_table, 0, sizeof(hdev->ifaceq_table)); hdev 698 drivers/media/platform/qcom/venus/hfi_venus.c memset(&hdev->sfr, 0, sizeof(hdev->sfr)); hdev 700 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 703 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_interface_queues_init(struct venus_hfi_device *hdev) hdev 713 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_alloc(hdev, &desc, ALIGNED_QUEUE_SIZE); hdev 717 drivers/media/platform/qcom/venus/hfi_venus.c hdev->ifaceq_table = desc; hdev 721 drivers/media/platform/qcom/venus/hfi_venus.c queue = &hdev->queues[i]; hdev 727 drivers/media/platform/qcom/venus/hfi_venus.c IFACEQ_GET_QHDR_START_ADDR(hdev->ifaceq_table.kva, i); hdev 741 drivers/media/platform/qcom/venus/hfi_venus.c tbl_hdr = hdev->ifaceq_table.kva; hdev 753 drivers/media/platform/qcom/venus/hfi_venus.c queue = &hdev->queues[IFACEQ_DBG_IDX]; hdev 756 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_alloc(hdev, &desc, ALIGNED_SFR_SIZE); hdev 758 drivers/media/platform/qcom/venus/hfi_venus.c hdev->sfr.da = 0; hdev 760 drivers/media/platform/qcom/venus/hfi_venus.c hdev->sfr = desc; hdev 761 drivers/media/platform/qcom/venus/hfi_venus.c sfr = hdev->sfr.kva; hdev 771 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_sys_set_debug(struct venus_hfi_device *hdev, u32 debug) hdev 781 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_cmdq_write(hdev, pkt); hdev 788 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_sys_set_coverage(struct venus_hfi_device *hdev, u32 mode) hdev 798 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_cmdq_write(hdev, pkt); hdev 805 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_sys_set_idle_message(struct venus_hfi_device *hdev, hdev 819 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_cmdq_write(hdev, pkt); hdev 826 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_sys_set_power_control(struct venus_hfi_device *hdev, hdev 837 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_cmdq_write(hdev, pkt); hdev 844 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_get_queue_size(struct venus_hfi_device *hdev, hdev 852 drivers/media/platform/qcom/venus/hfi_venus.c qhdr = hdev->queues[index].qhdr; hdev 859 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_sys_set_default_properties(struct venus_hfi_device *hdev) hdev 861 drivers/media/platform/qcom/venus/hfi_venus.c struct device *dev = hdev->core->dev; hdev 864 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_sys_set_debug(hdev, venus_fw_debug); hdev 873 drivers/media/platform/qcom/venus/hfi_venus.c if (IS_V4(hdev->core)) hdev 876 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_sys_set_idle_message(hdev, venus_sys_idle_indicator); hdev 880 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_sys_set_power_control(hdev, venus_fw_low_power_mode); hdev 890 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(inst->core); hdev 895 drivers/media/platform/qcom/venus/hfi_venus.c return venus_iface_cmdq_write(hdev, &pkt); hdev 898 drivers/media/platform/qcom/venus/hfi_venus.c static void venus_flush_debug_queue(struct venus_hfi_device *hdev) hdev 900 drivers/media/platform/qcom/venus/hfi_venus.c struct device *dev = hdev->core->dev; hdev 901 drivers/media/platform/qcom/venus/hfi_venus.c void *packet = hdev->dbg_buf; hdev 903 drivers/media/platform/qcom/venus/hfi_venus.c while (!venus_iface_dbgq_read(hdev, packet)) { hdev 914 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_prepare_power_collapse(struct venus_hfi_device *hdev, hdev 921 drivers/media/platform/qcom/venus/hfi_venus.c init_completion(&hdev->pwr_collapse_prep); hdev 925 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_cmdq_write(hdev, &pkt); hdev 932 drivers/media/platform/qcom/venus/hfi_venus.c ret = wait_for_completion_timeout(&hdev->pwr_collapse_prep, timeout); hdev 934 drivers/media/platform/qcom/venus/hfi_venus.c venus_flush_debug_queue(hdev); hdev 941 drivers/media/platform/qcom/venus/hfi_venus.c static int venus_are_queues_empty(struct venus_hfi_device *hdev) hdev 945 drivers/media/platform/qcom/venus/hfi_venus.c ret1 = venus_get_queue_size(hdev, IFACEQ_MSG_IDX); hdev 949 drivers/media/platform/qcom/venus/hfi_venus.c ret2 = venus_get_queue_size(hdev, IFACEQ_CMD_IDX); hdev 959 drivers/media/platform/qcom/venus/hfi_venus.c static void venus_sfr_print(struct venus_hfi_device *hdev) hdev 961 drivers/media/platform/qcom/venus/hfi_venus.c struct device *dev = hdev->core->dev; hdev 962 drivers/media/platform/qcom/venus/hfi_venus.c struct hfi_sfr *sfr = hdev->sfr.kva; hdev 979 drivers/media/platform/qcom/venus/hfi_venus.c static void venus_process_msg_sys_error(struct venus_hfi_device *hdev, hdev 987 drivers/media/platform/qcom/venus/hfi_venus.c venus_set_state(hdev, VENUS_STATE_DEINIT); hdev 995 drivers/media/platform/qcom/venus/hfi_venus.c venus_halt_axi(hdev); hdev 996 drivers/media/platform/qcom/venus/hfi_venus.c venus_sfr_print(hdev); hdev 1001 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(core); hdev 1006 drivers/media/platform/qcom/venus/hfi_venus.c if (!hdev) hdev 1009 drivers/media/platform/qcom/venus/hfi_venus.c res = hdev->core->res; hdev 1010 drivers/media/platform/qcom/venus/hfi_venus.c pkt = hdev->pkt_buf; hdev 1012 drivers/media/platform/qcom/venus/hfi_venus.c if (hdev->irq_status & WRAPPER_INTR_STATUS_A2HWD_MASK) { hdev 1013 drivers/media/platform/qcom/venus/hfi_venus.c venus_sfr_print(hdev); hdev 1017 drivers/media/platform/qcom/venus/hfi_venus.c while (!venus_iface_msgq_read(hdev, pkt)) { hdev 1021 drivers/media/platform/qcom/venus/hfi_venus.c venus_process_msg_sys_error(hdev, pkt); hdev 1027 drivers/media/platform/qcom/venus/hfi_venus.c hdev); hdev 1030 drivers/media/platform/qcom/venus/hfi_venus.c complete(&hdev->release_resource); hdev 1033 drivers/media/platform/qcom/venus/hfi_venus.c complete(&hdev->pwr_collapse_prep); hdev 1040 drivers/media/platform/qcom/venus/hfi_venus.c venus_flush_debug_queue(hdev); hdev 1047 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(core); hdev 1050 drivers/media/platform/qcom/venus/hfi_venus.c if (!hdev) hdev 1053 drivers/media/platform/qcom/venus/hfi_venus.c status = venus_readl(hdev, WRAPPER_INTR_STATUS); hdev 1058 drivers/media/platform/qcom/venus/hfi_venus.c hdev->irq_status = status; hdev 1060 drivers/media/platform/qcom/venus/hfi_venus.c venus_writel(hdev, CPU_CS_A2HSOFTINTCLR, 1); hdev 1061 drivers/media/platform/qcom/venus/hfi_venus.c venus_writel(hdev, WRAPPER_INTR_CLEAR, status); hdev 1068 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(core); hdev 1076 drivers/media/platform/qcom/venus/hfi_venus.c venus_set_state(hdev, VENUS_STATE_INIT); hdev 1078 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_cmdq_write(hdev, &pkt); hdev 1084 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_cmdq_write(hdev, &version_pkt); hdev 1088 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_sys_set_default_properties(hdev); hdev 1097 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(core); hdev 1099 drivers/media/platform/qcom/venus/hfi_venus.c venus_set_state(hdev, VENUS_STATE_DEINIT); hdev 1100 drivers/media/platform/qcom/venus/hfi_venus.c hdev->suspended = true; hdev 1101 drivers/media/platform/qcom/venus/hfi_venus.c hdev->power_enabled = false; hdev 1108 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(core); hdev 1113 drivers/media/platform/qcom/venus/hfi_venus.c return venus_iface_cmdq_write(hdev, &pkt); hdev 1118 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(core); hdev 1126 drivers/media/platform/qcom/venus/hfi_venus.c return venus_iface_cmdq_write(hdev, &pkt); hdev 1132 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(inst->core); hdev 1140 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_cmdq_write(hdev, &pkt); hdev 1147 drivers/media/platform/qcom/venus/hfi_venus.c venus_flush_debug_queue(hdev); hdev 1153 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(inst->core); hdev 1154 drivers/media/platform/qcom/venus/hfi_venus.c struct device *dev = hdev->core->dev; hdev 1157 drivers/media/platform/qcom/venus/hfi_venus.c if (venus_sys_set_coverage(hdev, venus_fw_coverage)) hdev 1166 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(inst->core); hdev 1168 drivers/media/platform/qcom/venus/hfi_venus.c venus_flush_debug_queue(hdev); hdev 1175 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(inst->core); hdev 1183 drivers/media/platform/qcom/venus/hfi_venus.c return venus_iface_cmdq_write(hdev, &pkt); hdev 1204 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(inst->core); hdev 1215 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_cmdq_write(hdev, &pkt); hdev 1223 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_cmdq_write(hdev, &pkt); hdev 1234 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(inst->core); hdev 1242 drivers/media/platform/qcom/venus/hfi_venus.c return venus_iface_cmdq_write(hdev, &pkt); hdev 1248 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(inst->core); hdev 1262 drivers/media/platform/qcom/venus/hfi_venus.c return venus_iface_cmdq_write(hdev, pkt); hdev 1268 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(inst->core); hdev 1282 drivers/media/platform/qcom/venus/hfi_venus.c return venus_iface_cmdq_write(hdev, pkt); hdev 1298 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(inst->core); hdev 1309 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_iface_cmdq_write(hdev, pkt); hdev 1319 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(inst->core); hdev 1330 drivers/media/platform/qcom/venus/hfi_venus.c return venus_iface_cmdq_write(hdev, pkt); hdev 1336 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(inst->core); hdev 1349 drivers/media/platform/qcom/venus/hfi_venus.c return venus_iface_cmdq_write(hdev, pkt); hdev 1354 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(inst->core); hdev 1362 drivers/media/platform/qcom/venus/hfi_venus.c return venus_iface_cmdq_write(hdev, &pkt); hdev 1367 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(core); hdev 1370 drivers/media/platform/qcom/venus/hfi_venus.c mutex_lock(&hdev->lock); hdev 1372 drivers/media/platform/qcom/venus/hfi_venus.c if (!hdev->suspended) hdev 1375 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_power_on(hdev); hdev 1379 drivers/media/platform/qcom/venus/hfi_venus.c hdev->suspended = false; hdev 1381 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 1388 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(core); hdev 1393 drivers/media/platform/qcom/venus/hfi_venus.c if (!hdev->power_enabled || hdev->suspended) hdev 1396 drivers/media/platform/qcom/venus/hfi_venus.c mutex_lock(&hdev->lock); hdev 1397 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_is_valid_state(hdev); hdev 1398 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 1405 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_prepare_power_collapse(hdev, true); hdev 1411 drivers/media/platform/qcom/venus/hfi_venus.c mutex_lock(&hdev->lock); hdev 1413 drivers/media/platform/qcom/venus/hfi_venus.c if (hdev->last_packet_type != HFI_CMD_SYS_PC_PREP) { hdev 1414 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 1418 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_are_queues_empty(hdev); hdev 1420 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 1424 drivers/media/platform/qcom/venus/hfi_venus.c ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0); hdev 1426 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 1430 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_power_off(hdev); hdev 1432 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 1436 drivers/media/platform/qcom/venus/hfi_venus.c hdev->suspended = true; hdev 1438 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 1443 drivers/media/platform/qcom/venus/hfi_venus.c static bool venus_cpu_and_video_core_idle(struct venus_hfi_device *hdev) hdev 1447 drivers/media/platform/qcom/venus/hfi_venus.c cpu_status = venus_readl(hdev, WRAPPER_CPU_STATUS); hdev 1448 drivers/media/platform/qcom/venus/hfi_venus.c ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0); hdev 1457 drivers/media/platform/qcom/venus/hfi_venus.c static bool venus_cpu_idle_and_pc_ready(struct venus_hfi_device *hdev) hdev 1461 drivers/media/platform/qcom/venus/hfi_venus.c cpu_status = venus_readl(hdev, WRAPPER_CPU_STATUS); hdev 1462 drivers/media/platform/qcom/venus/hfi_venus.c ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0); hdev 1473 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(core); hdev 1479 drivers/media/platform/qcom/venus/hfi_venus.c if (!hdev->power_enabled || hdev->suspended) hdev 1482 drivers/media/platform/qcom/venus/hfi_venus.c mutex_lock(&hdev->lock); hdev 1483 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_is_valid_state(hdev); hdev 1484 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 1491 drivers/media/platform/qcom/venus/hfi_venus.c ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0); hdev 1503 drivers/media/platform/qcom/venus/hfi_venus.c ret = readx_poll_timeout(venus_cpu_and_video_core_idle, hdev, val, val, hdev 1508 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_prepare_power_collapse(hdev, false); hdev 1514 drivers/media/platform/qcom/venus/hfi_venus.c ret = readx_poll_timeout(venus_cpu_idle_and_pc_ready, hdev, val, val, hdev 1520 drivers/media/platform/qcom/venus/hfi_venus.c mutex_lock(&hdev->lock); hdev 1522 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_power_off(hdev); hdev 1525 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 1529 drivers/media/platform/qcom/venus/hfi_venus.c hdev->suspended = true; hdev 1531 drivers/media/platform/qcom/venus/hfi_venus.c mutex_unlock(&hdev->lock); hdev 1577 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev = to_hfi_priv(core); hdev 1579 drivers/media/platform/qcom/venus/hfi_venus.c venus_interface_queues_release(hdev); hdev 1580 drivers/media/platform/qcom/venus/hfi_venus.c mutex_destroy(&hdev->lock); hdev 1581 drivers/media/platform/qcom/venus/hfi_venus.c kfree(hdev); hdev 1588 drivers/media/platform/qcom/venus/hfi_venus.c struct venus_hfi_device *hdev; hdev 1591 drivers/media/platform/qcom/venus/hfi_venus.c hdev = kzalloc(sizeof(*hdev), GFP_KERNEL); hdev 1592 drivers/media/platform/qcom/venus/hfi_venus.c if (!hdev) hdev 1595 drivers/media/platform/qcom/venus/hfi_venus.c mutex_init(&hdev->lock); hdev 1597 drivers/media/platform/qcom/venus/hfi_venus.c hdev->core = core; hdev 1598 drivers/media/platform/qcom/venus/hfi_venus.c hdev->suspended = true; hdev 1599 drivers/media/platform/qcom/venus/hfi_venus.c core->priv = hdev; hdev 1605 drivers/media/platform/qcom/venus/hfi_venus.c ret = venus_interface_queues_init(hdev); hdev 1612 drivers/media/platform/qcom/venus/hfi_venus.c kfree(hdev); hdev 12 drivers/misc/habanalabs/asid.c int hl_asid_init(struct hl_device *hdev) hdev 14 drivers/misc/habanalabs/asid.c hdev->asid_bitmap = kcalloc(BITS_TO_LONGS(hdev->asic_prop.max_asid), hdev 15 drivers/misc/habanalabs/asid.c sizeof(*hdev->asid_bitmap), GFP_KERNEL); hdev 16 drivers/misc/habanalabs/asid.c if (!hdev->asid_bitmap) hdev 19 drivers/misc/habanalabs/asid.c mutex_init(&hdev->asid_mutex); hdev 22 drivers/misc/habanalabs/asid.c set_bit(0, hdev->asid_bitmap); hdev 27 drivers/misc/habanalabs/asid.c void hl_asid_fini(struct hl_device *hdev) hdev 29 drivers/misc/habanalabs/asid.c mutex_destroy(&hdev->asid_mutex); hdev 30 drivers/misc/habanalabs/asid.c kfree(hdev->asid_bitmap); hdev 33 drivers/misc/habanalabs/asid.c unsigned long hl_asid_alloc(struct hl_device *hdev) hdev 37 drivers/misc/habanalabs/asid.c mutex_lock(&hdev->asid_mutex); hdev 39 drivers/misc/habanalabs/asid.c found = find_first_zero_bit(hdev->asid_bitmap, hdev 40 drivers/misc/habanalabs/asid.c hdev->asic_prop.max_asid); hdev 41 drivers/misc/habanalabs/asid.c if (found == hdev->asic_prop.max_asid) hdev 44 drivers/misc/habanalabs/asid.c set_bit(found, hdev->asid_bitmap); hdev 46 drivers/misc/habanalabs/asid.c mutex_unlock(&hdev->asid_mutex); hdev 51 drivers/misc/habanalabs/asid.c void hl_asid_free(struct hl_device *hdev, unsigned long asid) hdev 53 drivers/misc/habanalabs/asid.c if (WARN((asid == 0 || asid >= hdev->asic_prop.max_asid), hdev 56 drivers/misc/habanalabs/asid.c clear_bit(asid, hdev->asid_bitmap); hdev 14 drivers/misc/habanalabs/command_buffer.c static void cb_fini(struct hl_device *hdev, struct hl_cb *cb) hdev 16 drivers/misc/habanalabs/command_buffer.c hdev->asic_funcs->asic_dma_free_coherent(hdev, cb->size, hdev 22 drivers/misc/habanalabs/command_buffer.c static void cb_do_release(struct hl_device *hdev, struct hl_cb *cb) hdev 25 drivers/misc/habanalabs/command_buffer.c spin_lock(&hdev->cb_pool_lock); hdev 26 drivers/misc/habanalabs/command_buffer.c list_add(&cb->pool_list, &hdev->cb_pool); hdev 27 drivers/misc/habanalabs/command_buffer.c spin_unlock(&hdev->cb_pool_lock); hdev 29 drivers/misc/habanalabs/command_buffer.c cb_fini(hdev, cb); hdev 35 drivers/misc/habanalabs/command_buffer.c struct hl_device *hdev; hdev 39 drivers/misc/habanalabs/command_buffer.c hdev = cb->hdev; hdev 43 drivers/misc/habanalabs/command_buffer.c cb_do_release(hdev, cb); hdev 46 drivers/misc/habanalabs/command_buffer.c static struct hl_cb *hl_cb_alloc(struct hl_device *hdev, u32 cb_size, hdev 69 drivers/misc/habanalabs/command_buffer.c p = hdev->asic_funcs->asic_dma_alloc_coherent(hdev, cb_size, hdev 72 drivers/misc/habanalabs/command_buffer.c p = hdev->asic_funcs->asic_dma_alloc_coherent(hdev, cb_size, hdev 76 drivers/misc/habanalabs/command_buffer.c dev_err(hdev->dev, hdev 89 drivers/misc/habanalabs/command_buffer.c int hl_cb_create(struct hl_device *hdev, struct hl_cb_mgr *mgr, hdev 100 drivers/misc/habanalabs/command_buffer.c if ((hdev->disabled) || ((atomic_read(&hdev->in_reset)) && hdev 102 drivers/misc/habanalabs/command_buffer.c dev_warn_ratelimited(hdev->dev, hdev 109 drivers/misc/habanalabs/command_buffer.c dev_err(hdev->dev, hdev 121 drivers/misc/habanalabs/command_buffer.c cb_size <= hdev->asic_prop.cb_pool_cb_size) { hdev 123 drivers/misc/habanalabs/command_buffer.c spin_lock(&hdev->cb_pool_lock); hdev 124 drivers/misc/habanalabs/command_buffer.c if (!list_empty(&hdev->cb_pool)) { hdev 125 drivers/misc/habanalabs/command_buffer.c cb = list_first_entry(&hdev->cb_pool, typeof(*cb), hdev 128 drivers/misc/habanalabs/command_buffer.c spin_unlock(&hdev->cb_pool_lock); hdev 131 drivers/misc/habanalabs/command_buffer.c spin_unlock(&hdev->cb_pool_lock); hdev 132 drivers/misc/habanalabs/command_buffer.c dev_dbg(hdev->dev, "CB pool is empty\n"); hdev 137 drivers/misc/habanalabs/command_buffer.c cb = hl_cb_alloc(hdev, cb_size, ctx_id); hdev 144 drivers/misc/habanalabs/command_buffer.c cb->hdev = hdev; hdev 152 drivers/misc/habanalabs/command_buffer.c dev_err(hdev->dev, "Failed to allocate IDR for a new CB\n"); hdev 173 drivers/misc/habanalabs/command_buffer.c cb_do_release(hdev, cb); hdev 180 drivers/misc/habanalabs/command_buffer.c int hl_cb_destroy(struct hl_device *hdev, struct hl_cb_mgr *mgr, u64 cb_handle) hdev 202 drivers/misc/habanalabs/command_buffer.c dev_err(hdev->dev, hdev 213 drivers/misc/habanalabs/command_buffer.c struct hl_device *hdev = hpriv->hdev; hdev 217 drivers/misc/habanalabs/command_buffer.c if (hl_device_disabled_or_in_reset(hdev)) { hdev 218 drivers/misc/habanalabs/command_buffer.c dev_warn_ratelimited(hdev->dev, hdev 220 drivers/misc/habanalabs/command_buffer.c atomic_read(&hdev->in_reset) ? "in_reset" : "disabled"); hdev 226 drivers/misc/habanalabs/command_buffer.c rc = hl_cb_create(hdev, &hpriv->cb_mgr, args->in.cb_size, hdev 232 drivers/misc/habanalabs/command_buffer.c rc = hl_cb_destroy(hdev, &hpriv->cb_mgr, hdev 269 drivers/misc/habanalabs/command_buffer.c struct hl_device *hdev = hpriv->hdev; hdev 278 drivers/misc/habanalabs/command_buffer.c cb = hl_cb_get(hdev, &hpriv->cb_mgr, handle); hdev 280 drivers/misc/habanalabs/command_buffer.c dev_err(hdev->dev, hdev 287 drivers/misc/habanalabs/command_buffer.c dev_err(hdev->dev, hdev 297 drivers/misc/habanalabs/command_buffer.c dev_err(hdev->dev, hdev 319 drivers/misc/habanalabs/command_buffer.c rc = hdev->asic_funcs->cb_mmap(hdev, vma, cb->kernel_address, hdev 339 drivers/misc/habanalabs/command_buffer.c struct hl_cb *hl_cb_get(struct hl_device *hdev, struct hl_cb_mgr *mgr, hdev 349 drivers/misc/habanalabs/command_buffer.c dev_warn(hdev->dev, hdev 373 drivers/misc/habanalabs/command_buffer.c void hl_cb_mgr_fini(struct hl_device *hdev, struct hl_cb_mgr *mgr) hdev 383 drivers/misc/habanalabs/command_buffer.c dev_err(hdev->dev, hdev 391 drivers/misc/habanalabs/command_buffer.c struct hl_cb *hl_cb_kernel_create(struct hl_device *hdev, u32 cb_size) hdev 397 drivers/misc/habanalabs/command_buffer.c rc = hl_cb_create(hdev, &hdev->kernel_cb_mgr, cb_size, &cb_handle, hdev 400 drivers/misc/habanalabs/command_buffer.c dev_err(hdev->dev, hdev 406 drivers/misc/habanalabs/command_buffer.c cb = hl_cb_get(hdev, &hdev->kernel_cb_mgr, (u32) cb_handle); hdev 415 drivers/misc/habanalabs/command_buffer.c hl_cb_destroy(hdev, &hdev->kernel_cb_mgr, cb_handle << PAGE_SHIFT); hdev 420 drivers/misc/habanalabs/command_buffer.c int hl_cb_pool_init(struct hl_device *hdev) hdev 425 drivers/misc/habanalabs/command_buffer.c INIT_LIST_HEAD(&hdev->cb_pool); hdev 426 drivers/misc/habanalabs/command_buffer.c spin_lock_init(&hdev->cb_pool_lock); hdev 428 drivers/misc/habanalabs/command_buffer.c for (i = 0 ; i < hdev->asic_prop.cb_pool_cb_cnt ; i++) { hdev 429 drivers/misc/habanalabs/command_buffer.c cb = hl_cb_alloc(hdev, hdev->asic_prop.cb_pool_cb_size, hdev 433 drivers/misc/habanalabs/command_buffer.c list_add(&cb->pool_list, &hdev->cb_pool); hdev 435 drivers/misc/habanalabs/command_buffer.c hl_cb_pool_fini(hdev); hdev 443 drivers/misc/habanalabs/command_buffer.c int hl_cb_pool_fini(struct hl_device *hdev) hdev 447 drivers/misc/habanalabs/command_buffer.c list_for_each_entry_safe(cb, tmp, &hdev->cb_pool, pool_list) { hdev 449 drivers/misc/habanalabs/command_buffer.c cb_fini(hdev, cb); hdev 15 drivers/misc/habanalabs/command_submission.c static long _hl_cs_wait_ioctl(struct hl_device *hdev, hdev 29 drivers/misc/habanalabs/command_submission.c return dev_name(hl_fence->hdev->dev); hdev 81 drivers/misc/habanalabs/command_submission.c struct hl_device *hdev = hpriv->hdev; hdev 97 drivers/misc/habanalabs/command_submission.c rc = hdev->asic_funcs->cs_parser(hdev, &parser); hdev 123 drivers/misc/habanalabs/command_submission.c static void free_job(struct hl_device *hdev, struct hl_cs_job *job) hdev 128 drivers/misc/habanalabs/command_submission.c hl_userptr_delete_list(hdev, &job->userptr_list); hdev 151 drivers/misc/habanalabs/command_submission.c hl_debugfs_remove_job(hdev, job); hdev 163 drivers/misc/habanalabs/command_submission.c struct hl_device *hdev = cs->ctx->hdev; hdev 177 drivers/misc/habanalabs/command_submission.c free_job(hdev, job); hdev 181 drivers/misc/habanalabs/command_submission.c hdev->asic_funcs->hw_queues_lock(hdev); hdev 183 drivers/misc/habanalabs/command_submission.c hdev->cs_active_cnt--; hdev 184 drivers/misc/habanalabs/command_submission.c if (!hdev->cs_active_cnt) { hdev 187 drivers/misc/habanalabs/command_submission.c ts = &hdev->idle_busy_ts_arr[hdev->idle_busy_ts_idx++]; hdev 190 drivers/misc/habanalabs/command_submission.c if (hdev->idle_busy_ts_idx == HL_IDLE_BUSY_TS_ARR_SIZE) hdev 191 drivers/misc/habanalabs/command_submission.c hdev->idle_busy_ts_idx = 0; hdev 192 drivers/misc/habanalabs/command_submission.c } else if (hdev->cs_active_cnt < 0) { hdev 193 drivers/misc/habanalabs/command_submission.c dev_crit(hdev->dev, "CS active cnt %d is negative\n", hdev 194 drivers/misc/habanalabs/command_submission.c hdev->cs_active_cnt); hdev 197 drivers/misc/habanalabs/command_submission.c hdev->asic_funcs->hw_queues_unlock(hdev); hdev 201 drivers/misc/habanalabs/command_submission.c spin_lock(&hdev->hw_queues_mirror_lock); hdev 204 drivers/misc/habanalabs/command_submission.c spin_unlock(&hdev->hw_queues_mirror_lock); hdev 211 drivers/misc/habanalabs/command_submission.c (hdev->timeout_jiffies != MAX_SCHEDULE_TIMEOUT)) { hdev 217 drivers/misc/habanalabs/command_submission.c spin_lock(&hdev->hw_queues_mirror_lock); hdev 221 drivers/misc/habanalabs/command_submission.c &hdev->hw_queues_mirror_list, hdev 227 drivers/misc/habanalabs/command_submission.c hdev->timeout_jiffies); hdev 230 drivers/misc/habanalabs/command_submission.c spin_unlock(&hdev->hw_queues_mirror_lock); hdev 255 drivers/misc/habanalabs/command_submission.c struct hl_device *hdev; hdev 271 drivers/misc/habanalabs/command_submission.c hdev = cs->ctx->hdev; hdev 275 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, "User %d command submission %llu got stuck!\n", hdev 280 drivers/misc/habanalabs/command_submission.c if (hdev->reset_on_lockup) hdev 281 drivers/misc/habanalabs/command_submission.c hl_device_reset(hdev, false, false); hdev 284 drivers/misc/habanalabs/command_submission.c static int allocate_cs(struct hl_device *hdev, struct hl_ctx *ctx, hdev 310 drivers/misc/habanalabs/command_submission.c fence->hdev = hdev; hdev 320 drivers/misc/habanalabs/command_submission.c dev_dbg(hdev->dev, hdev 352 drivers/misc/habanalabs/command_submission.c static void cs_rollback(struct hl_device *hdev, struct hl_cs *cs) hdev 357 drivers/misc/habanalabs/command_submission.c free_job(hdev, job); hdev 360 drivers/misc/habanalabs/command_submission.c void hl_cs_rollback_all(struct hl_device *hdev) hdev 365 drivers/misc/habanalabs/command_submission.c flush_workqueue(hdev->cq_wq); hdev 368 drivers/misc/habanalabs/command_submission.c list_for_each_entry_safe(cs, tmp, &hdev->hw_queues_mirror_list, hdev 372 drivers/misc/habanalabs/command_submission.c dev_warn_ratelimited(hdev->dev, "Killing CS %d.%llu\n", hdev 374 drivers/misc/habanalabs/command_submission.c cs_rollback(hdev, cs); hdev 384 drivers/misc/habanalabs/command_submission.c struct hl_device *hdev = cs->ctx->hdev; hdev 387 drivers/misc/habanalabs/command_submission.c free_job(hdev, job); hdev 390 drivers/misc/habanalabs/command_submission.c static struct hl_cb *validate_queue_index(struct hl_device *hdev, hdev 395 drivers/misc/habanalabs/command_submission.c struct asic_fixed_properties *asic = &hdev->asic_prop; hdev 407 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, "Queue index %d is invalid\n", hdev 413 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, hdev 425 drivers/misc/habanalabs/command_submission.c cb = hl_cb_get(hdev, cb_mgr, cb_handle); hdev 427 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, "CB handle 0x%x invalid\n", cb_handle); hdev 432 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, "CB size %u invalid\n", chunk->cb_size); hdev 447 drivers/misc/habanalabs/command_submission.c struct hl_cs_job *hl_cs_allocate_job(struct hl_device *hdev, bool ext_queue) hdev 468 drivers/misc/habanalabs/command_submission.c struct hl_device *hdev = hpriv->hdev; hdev 480 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, hdev 496 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, "Failed to copy cs chunk array from user\n"); hdev 502 drivers/misc/habanalabs/command_submission.c hl_ctx_get(hdev, hpriv->ctx); hdev 504 drivers/misc/habanalabs/command_submission.c rc = allocate_cs(hdev, hpriv->ctx, &cs); hdev 519 drivers/misc/habanalabs/command_submission.c cb = validate_queue_index(hdev, &hpriv->cb_mgr, chunk, hdev 529 drivers/misc/habanalabs/command_submission.c job = hl_cs_allocate_job(hdev, ext_queue); hdev 531 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, "Failed to allocate a new job\n"); hdev 562 drivers/misc/habanalabs/command_submission.c hl_debugfs_add_job(hdev, job); hdev 566 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, hdev 574 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, hdev 583 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, hdev 598 drivers/misc/habanalabs/command_submission.c cs_rollback(hdev, cs); hdev 612 drivers/misc/habanalabs/command_submission.c struct hl_device *hdev = hpriv->hdev; hdev 621 drivers/misc/habanalabs/command_submission.c if (hl_device_disabled_or_in_reset(hdev)) { hdev 622 drivers/misc/habanalabs/command_submission.c dev_warn_ratelimited(hdev->dev, hdev 624 drivers/misc/habanalabs/command_submission.c atomic_read(&hdev->in_reset) ? "in_reset" : "disabled"); hdev 640 drivers/misc/habanalabs/command_submission.c rc = hdev->asic_funcs->context_switch(hdev, ctx->asid); hdev 642 drivers/misc/habanalabs/command_submission.c dev_err_ratelimited(hdev->dev, hdev 661 drivers/misc/habanalabs/command_submission.c hdev->asic_funcs->restore_phase_topology(hdev); hdev 664 drivers/misc/habanalabs/command_submission.c dev_dbg(hdev->dev, hdev 675 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, hdev 683 drivers/misc/habanalabs/command_submission.c ret = _hl_cs_wait_ioctl(hdev, ctx, hdev 684 drivers/misc/habanalabs/command_submission.c jiffies_to_usecs(hdev->timeout_jiffies), hdev 687 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, hdev 699 drivers/misc/habanalabs/command_submission.c rc = hl_poll_timeout_memory(hdev, hdev 701 drivers/misc/habanalabs/command_submission.c 100, jiffies_to_usecs(hdev->timeout_jiffies), false); hdev 704 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, hdev 714 drivers/misc/habanalabs/command_submission.c dev_err(hdev->dev, hdev 731 drivers/misc/habanalabs/command_submission.c hl_device_reset(hdev, false, false); hdev 736 drivers/misc/habanalabs/command_submission.c static long _hl_cs_wait_ioctl(struct hl_device *hdev, hdev 748 drivers/misc/habanalabs/command_submission.c hl_ctx_get(hdev, ctx); hdev 770 drivers/misc/habanalabs/command_submission.c struct hl_device *hdev = hpriv->hdev; hdev 775 drivers/misc/habanalabs/command_submission.c rc = _hl_cs_wait_ioctl(hdev, hpriv->ctx, args->in.timeout_us, seq); hdev 780 drivers/misc/habanalabs/command_submission.c dev_err_ratelimited(hdev->dev, hdev 14 drivers/misc/habanalabs/context.c struct hl_device *hdev = ctx->hdev; hdev 35 drivers/misc/habanalabs/context.c if ((hdev->in_debug) && (hdev->compute_ctx == ctx)) hdev 36 drivers/misc/habanalabs/context.c hl_device_set_debug_mode(hdev, false); hdev 39 drivers/misc/habanalabs/context.c hl_asid_free(hdev, ctx->asid); hdev 59 drivers/misc/habanalabs/context.c int hl_ctx_create(struct hl_device *hdev, struct hl_fpriv *hpriv) hdev 76 drivers/misc/habanalabs/context.c dev_err(hdev->dev, "Failed to allocate IDR for a new CTX\n"); hdev 82 drivers/misc/habanalabs/context.c rc = hl_ctx_init(hdev, ctx, false); hdev 93 drivers/misc/habanalabs/context.c hdev->compute_ctx = ctx; hdev 107 drivers/misc/habanalabs/context.c void hl_ctx_free(struct hl_device *hdev, struct hl_ctx *ctx) hdev 112 drivers/misc/habanalabs/context.c dev_warn(hdev->dev, hdev 117 drivers/misc/habanalabs/context.c int hl_ctx_init(struct hl_device *hdev, struct hl_ctx *ctx, bool is_kernel_ctx) hdev 121 drivers/misc/habanalabs/context.c ctx->hdev = hdev; hdev 134 drivers/misc/habanalabs/context.c dev_err(hdev->dev, "Failed to init mmu ctx module\n"); hdev 138 drivers/misc/habanalabs/context.c ctx->asid = hl_asid_alloc(hdev); hdev 140 drivers/misc/habanalabs/context.c dev_err(hdev->dev, "No free ASID, failed to create context\n"); hdev 146 drivers/misc/habanalabs/context.c dev_err(hdev->dev, "Failed to init mem ctx module\n"); hdev 156 drivers/misc/habanalabs/context.c hl_asid_free(hdev, ctx->asid); hdev 161 drivers/misc/habanalabs/context.c void hl_ctx_get(struct hl_device *hdev, struct hl_ctx *ctx) hdev 173 drivers/misc/habanalabs/context.c struct hl_device *hdev = ctx->hdev; hdev 179 drivers/misc/habanalabs/context.c dev_notice_ratelimited(hdev->dev, hdev 188 drivers/misc/habanalabs/context.c dev_dbg(hdev->dev, hdev 225 drivers/misc/habanalabs/context.c void hl_ctx_mgr_fini(struct hl_device *hdev, struct hl_ctx_mgr *mgr) hdev 234 drivers/misc/habanalabs/context.c hl_ctx_free(hdev, ctx); hdev 21 drivers/misc/habanalabs/debugfs.c static int hl_debugfs_i2c_read(struct hl_device *hdev, u8 i2c_bus, u8 i2c_addr, hdev 27 drivers/misc/habanalabs/debugfs.c if (hl_device_disabled_or_in_reset(hdev)) hdev 38 drivers/misc/habanalabs/debugfs.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 42 drivers/misc/habanalabs/debugfs.c dev_err(hdev->dev, "Failed to read from I2C, error %d\n", rc); hdev 47 drivers/misc/habanalabs/debugfs.c static int hl_debugfs_i2c_write(struct hl_device *hdev, u8 i2c_bus, u8 i2c_addr, hdev 53 drivers/misc/habanalabs/debugfs.c if (hl_device_disabled_or_in_reset(hdev)) hdev 65 drivers/misc/habanalabs/debugfs.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 69 drivers/misc/habanalabs/debugfs.c dev_err(hdev->dev, "Failed to write to I2C, error %d\n", rc); hdev 74 drivers/misc/habanalabs/debugfs.c static void hl_debugfs_led_set(struct hl_device *hdev, u8 led, u8 state) hdev 79 drivers/misc/habanalabs/debugfs.c if (hl_device_disabled_or_in_reset(hdev)) hdev 89 drivers/misc/habanalabs/debugfs.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 93 drivers/misc/habanalabs/debugfs.c dev_err(hdev->dev, "Failed to set LED %d, error %d\n", led, rc); hdev 238 drivers/misc/habanalabs/debugfs.c if (!dev_entry->hdev->mmu_enable) hdev 271 drivers/misc/habanalabs/debugfs.c vm = &ctx->hdev->vm; hdev 306 drivers/misc/habanalabs/debugfs.c return ctx->hdev->asic_prop.mmu_pgt_addr + hdev 307 drivers/misc/habanalabs/debugfs.c (ctx->asid * ctx->hdev->asic_prop.mmu_hop_table_size); hdev 313 drivers/misc/habanalabs/debugfs.c return hop_addr + ctx->hdev->asic_prop.mmu_pte_size * hdev 320 drivers/misc/habanalabs/debugfs.c return hop_addr + ctx->hdev->asic_prop.mmu_pte_size * hdev 327 drivers/misc/habanalabs/debugfs.c return hop_addr + ctx->hdev->asic_prop.mmu_pte_size * hdev 334 drivers/misc/habanalabs/debugfs.c return hop_addr + ctx->hdev->asic_prop.mmu_pte_size * hdev 341 drivers/misc/habanalabs/debugfs.c return hop_addr + ctx->hdev->asic_prop.mmu_pte_size * hdev 357 drivers/misc/habanalabs/debugfs.c struct hl_device *hdev = dev_entry->hdev; hdev 367 drivers/misc/habanalabs/debugfs.c if (!hdev->mmu_enable) hdev 371 drivers/misc/habanalabs/debugfs.c ctx = hdev->kernel_ctx; hdev 373 drivers/misc/habanalabs/debugfs.c ctx = hdev->compute_ctx; hdev 376 drivers/misc/habanalabs/debugfs.c dev_err(hdev->dev, "no ctx available\n"); hdev 386 drivers/misc/habanalabs/debugfs.c hop0_pte = hdev->asic_funcs->read_pte(hdev, hop0_pte_addr); hdev 393 drivers/misc/habanalabs/debugfs.c hop1_pte = hdev->asic_funcs->read_pte(hdev, hop1_pte_addr); hdev 400 drivers/misc/habanalabs/debugfs.c hop2_pte = hdev->asic_funcs->read_pte(hdev, hop2_pte_addr); hdev 407 drivers/misc/habanalabs/debugfs.c hop3_pte = hdev->asic_funcs->read_pte(hdev, hop3_pte_addr); hdev 416 drivers/misc/habanalabs/debugfs.c hop4_pte = hdev->asic_funcs->read_pte(hdev, hop4_pte_addr); hdev 452 drivers/misc/habanalabs/debugfs.c dev_err(hdev->dev, "virt addr 0x%llx is not mapped to phys addr\n", hdev 466 drivers/misc/habanalabs/debugfs.c struct hl_device *hdev = dev_entry->hdev; hdev 471 drivers/misc/habanalabs/debugfs.c if (!hdev->mmu_enable) hdev 498 drivers/misc/habanalabs/debugfs.c dev_err(hdev->dev, "usage: echo <asid> <0xaddr> > mmu\n"); hdev 507 drivers/misc/habanalabs/debugfs.c struct hl_device *hdev = dev_entry->hdev; hdev 509 drivers/misc/habanalabs/debugfs.c hdev->asic_funcs->is_device_idle(hdev, NULL, s); hdev 514 drivers/misc/habanalabs/debugfs.c static bool hl_is_device_va(struct hl_device *hdev, u64 addr) hdev 516 drivers/misc/habanalabs/debugfs.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 518 drivers/misc/habanalabs/debugfs.c if (!hdev->mmu_enable) hdev 521 drivers/misc/habanalabs/debugfs.c if (hdev->dram_supports_virtual_memory && hdev 533 drivers/misc/habanalabs/debugfs.c static int device_va_to_pa(struct hl_device *hdev, u64 virt_addr, hdev 536 drivers/misc/habanalabs/debugfs.c struct hl_ctx *ctx = hdev->compute_ctx; hdev 542 drivers/misc/habanalabs/debugfs.c dev_err(hdev->dev, "no ctx available\n"); hdev 551 drivers/misc/habanalabs/debugfs.c hop_pte = hdev->asic_funcs->read_pte(hdev, hop_pte_addr); hdev 558 drivers/misc/habanalabs/debugfs.c hop_pte = hdev->asic_funcs->read_pte(hdev, hop_pte_addr); hdev 565 drivers/misc/habanalabs/debugfs.c hop_pte = hdev->asic_funcs->read_pte(hdev, hop_pte_addr); hdev 572 drivers/misc/habanalabs/debugfs.c hop_pte = hdev->asic_funcs->read_pte(hdev, hop_pte_addr); hdev 580 drivers/misc/habanalabs/debugfs.c hop_pte = hdev->asic_funcs->read_pte(hdev, hop_pte_addr); hdev 593 drivers/misc/habanalabs/debugfs.c dev_err(hdev->dev, "virt addr 0x%llx is not mapped to phys addr\n", hdev 605 drivers/misc/habanalabs/debugfs.c struct hl_device *hdev = entry->hdev; hdev 614 drivers/misc/habanalabs/debugfs.c if (hl_is_device_va(hdev, addr)) { hdev 615 drivers/misc/habanalabs/debugfs.c rc = device_va_to_pa(hdev, addr, &addr); hdev 620 drivers/misc/habanalabs/debugfs.c rc = hdev->asic_funcs->debugfs_read32(hdev, addr, &val); hdev 622 drivers/misc/habanalabs/debugfs.c dev_err(hdev->dev, "Failed to read from 0x%010llx\n", addr); hdev 635 drivers/misc/habanalabs/debugfs.c struct hl_device *hdev = entry->hdev; hdev 644 drivers/misc/habanalabs/debugfs.c if (hl_is_device_va(hdev, addr)) { hdev 645 drivers/misc/habanalabs/debugfs.c rc = device_va_to_pa(hdev, addr, &addr); hdev 650 drivers/misc/habanalabs/debugfs.c rc = hdev->asic_funcs->debugfs_write32(hdev, addr, value); hdev 652 drivers/misc/habanalabs/debugfs.c dev_err(hdev->dev, "Failed to write 0x%08x to 0x%010llx\n", hdev 664 drivers/misc/habanalabs/debugfs.c struct hl_device *hdev = entry->hdev; hdev 671 drivers/misc/habanalabs/debugfs.c if (hdev->pdev->current_state == PCI_D0) hdev 673 drivers/misc/habanalabs/debugfs.c else if (hdev->pdev->current_state == PCI_D3hot) hdev 688 drivers/misc/habanalabs/debugfs.c struct hl_device *hdev = entry->hdev; hdev 697 drivers/misc/habanalabs/debugfs.c pci_set_power_state(hdev->pdev, PCI_D0); hdev 698 drivers/misc/habanalabs/debugfs.c pci_restore_state(hdev->pdev); hdev 699 drivers/misc/habanalabs/debugfs.c rc = pci_enable_device(hdev->pdev); hdev 701 drivers/misc/habanalabs/debugfs.c pci_save_state(hdev->pdev); hdev 702 drivers/misc/habanalabs/debugfs.c pci_disable_device(hdev->pdev); hdev 703 drivers/misc/habanalabs/debugfs.c pci_set_power_state(hdev->pdev, PCI_D3hot); hdev 705 drivers/misc/habanalabs/debugfs.c dev_dbg(hdev->dev, "invalid power state value %u\n", value); hdev 716 drivers/misc/habanalabs/debugfs.c struct hl_device *hdev = entry->hdev; hdev 724 drivers/misc/habanalabs/debugfs.c rc = hl_debugfs_i2c_read(hdev, entry->i2c_bus, entry->i2c_addr, hdev 727 drivers/misc/habanalabs/debugfs.c dev_err(hdev->dev, hdev 744 drivers/misc/habanalabs/debugfs.c struct hl_device *hdev = entry->hdev; hdev 752 drivers/misc/habanalabs/debugfs.c rc = hl_debugfs_i2c_write(hdev, entry->i2c_bus, entry->i2c_addr, hdev 755 drivers/misc/habanalabs/debugfs.c dev_err(hdev->dev, hdev 768 drivers/misc/habanalabs/debugfs.c struct hl_device *hdev = entry->hdev; hdev 778 drivers/misc/habanalabs/debugfs.c hl_debugfs_led_set(hdev, 0, value); hdev 787 drivers/misc/habanalabs/debugfs.c struct hl_device *hdev = entry->hdev; hdev 797 drivers/misc/habanalabs/debugfs.c hl_debugfs_led_set(hdev, 1, value); hdev 806 drivers/misc/habanalabs/debugfs.c struct hl_device *hdev = entry->hdev; hdev 816 drivers/misc/habanalabs/debugfs.c hl_debugfs_led_set(hdev, 2, value); hdev 833 drivers/misc/habanalabs/debugfs.c struct hl_device *hdev = entry->hdev; hdev 843 drivers/misc/habanalabs/debugfs.c hdev->disabled = true; hdev 845 drivers/misc/habanalabs/debugfs.c hdev->disabled = false; hdev 847 drivers/misc/habanalabs/debugfs.c hdev->asic_funcs->suspend(hdev); hdev 849 drivers/misc/habanalabs/debugfs.c hdev->asic_funcs->resume(hdev); hdev 851 drivers/misc/habanalabs/debugfs.c hdev->device_cpu_disabled = true; hdev 853 drivers/misc/habanalabs/debugfs.c dev_err(hdev->dev, hdev 938 drivers/misc/habanalabs/debugfs.c void hl_debugfs_add_device(struct hl_device *hdev) hdev 940 drivers/misc/habanalabs/debugfs.c struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; hdev 946 drivers/misc/habanalabs/debugfs.c dev_entry->hdev = hdev; hdev 966 drivers/misc/habanalabs/debugfs.c dev_entry->root = debugfs_create_dir(dev_name(hdev->dev), hdev 1044 drivers/misc/habanalabs/debugfs.c void hl_debugfs_remove_device(struct hl_device *hdev) hdev 1046 drivers/misc/habanalabs/debugfs.c struct hl_dbg_device_entry *entry = &hdev->hl_debugfs; hdev 1056 drivers/misc/habanalabs/debugfs.c struct hl_dbg_device_entry *dev_entry = &hpriv->hdev->hl_debugfs; hdev 1065 drivers/misc/habanalabs/debugfs.c struct hl_dbg_device_entry *dev_entry = &hpriv->hdev->hl_debugfs; hdev 1074 drivers/misc/habanalabs/debugfs.c struct hl_dbg_device_entry *dev_entry = &cb->hdev->hl_debugfs; hdev 1083 drivers/misc/habanalabs/debugfs.c struct hl_dbg_device_entry *dev_entry = &cb->hdev->hl_debugfs; hdev 1092 drivers/misc/habanalabs/debugfs.c struct hl_dbg_device_entry *dev_entry = &cs->ctx->hdev->hl_debugfs; hdev 1101 drivers/misc/habanalabs/debugfs.c struct hl_dbg_device_entry *dev_entry = &cs->ctx->hdev->hl_debugfs; hdev 1108 drivers/misc/habanalabs/debugfs.c void hl_debugfs_add_job(struct hl_device *hdev, struct hl_cs_job *job) hdev 1110 drivers/misc/habanalabs/debugfs.c struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; hdev 1117 drivers/misc/habanalabs/debugfs.c void hl_debugfs_remove_job(struct hl_device *hdev, struct hl_cs_job *job) hdev 1119 drivers/misc/habanalabs/debugfs.c struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; hdev 1126 drivers/misc/habanalabs/debugfs.c void hl_debugfs_add_userptr(struct hl_device *hdev, struct hl_userptr *userptr) hdev 1128 drivers/misc/habanalabs/debugfs.c struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; hdev 1135 drivers/misc/habanalabs/debugfs.c void hl_debugfs_remove_userptr(struct hl_device *hdev, hdev 1138 drivers/misc/habanalabs/debugfs.c struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; hdev 1145 drivers/misc/habanalabs/debugfs.c void hl_debugfs_add_ctx_mem_hash(struct hl_device *hdev, struct hl_ctx *ctx) hdev 1147 drivers/misc/habanalabs/debugfs.c struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; hdev 1154 drivers/misc/habanalabs/debugfs.c void hl_debugfs_remove_ctx_mem_hash(struct hl_device *hdev, struct hl_ctx *ctx) hdev 1156 drivers/misc/habanalabs/debugfs.c struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; hdev 19 drivers/misc/habanalabs/device.c bool hl_device_disabled_or_in_reset(struct hl_device *hdev) hdev 21 drivers/misc/habanalabs/device.c if ((hdev->disabled) || (atomic_read(&hdev->in_reset))) hdev 27 drivers/misc/habanalabs/device.c enum hl_device_status hl_device_status(struct hl_device *hdev) hdev 31 drivers/misc/habanalabs/device.c if (hdev->disabled) hdev 33 drivers/misc/habanalabs/device.c else if (atomic_read(&hdev->in_reset)) hdev 44 drivers/misc/habanalabs/device.c struct hl_device *hdev; hdev 49 drivers/misc/habanalabs/device.c hdev = hpriv->hdev; hdev 58 drivers/misc/habanalabs/device.c mutex_lock(&hdev->fpriv_list_lock); hdev 60 drivers/misc/habanalabs/device.c hdev->compute_ctx = NULL; hdev 61 drivers/misc/habanalabs/device.c mutex_unlock(&hdev->fpriv_list_lock); hdev 88 drivers/misc/habanalabs/device.c hl_cb_mgr_fini(hpriv->hdev, &hpriv->cb_mgr); hdev 89 drivers/misc/habanalabs/device.c hl_ctx_mgr_fini(hpriv->hdev, &hpriv->ctx_mgr); hdev 101 drivers/misc/habanalabs/device.c struct hl_device *hdev; hdev 105 drivers/misc/habanalabs/device.c hdev = hpriv->hdev; hdev 107 drivers/misc/habanalabs/device.c mutex_lock(&hdev->fpriv_list_lock); hdev 109 drivers/misc/habanalabs/device.c mutex_unlock(&hdev->fpriv_list_lock); hdev 172 drivers/misc/habanalabs/device.c static int device_init_cdev(struct hl_device *hdev, struct class *hclass, hdev 185 drivers/misc/habanalabs/device.c (*dev)->devt = MKDEV(hdev->major, minor); hdev 188 drivers/misc/habanalabs/device.c dev_set_drvdata(*dev, hdev); hdev 194 drivers/misc/habanalabs/device.c static int device_cdev_sysfs_add(struct hl_device *hdev) hdev 198 drivers/misc/habanalabs/device.c rc = cdev_device_add(&hdev->cdev, hdev->dev); hdev 200 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 205 drivers/misc/habanalabs/device.c rc = cdev_device_add(&hdev->cdev_ctrl, hdev->dev_ctrl); hdev 207 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 213 drivers/misc/habanalabs/device.c rc = hl_sysfs_init(hdev); hdev 215 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "failed to initialize sysfs\n"); hdev 219 drivers/misc/habanalabs/device.c hdev->cdev_sysfs_created = true; hdev 224 drivers/misc/habanalabs/device.c cdev_device_del(&hdev->cdev_ctrl, hdev->dev_ctrl); hdev 226 drivers/misc/habanalabs/device.c cdev_device_del(&hdev->cdev, hdev->dev); hdev 230 drivers/misc/habanalabs/device.c static void device_cdev_sysfs_del(struct hl_device *hdev) hdev 233 drivers/misc/habanalabs/device.c if (!hdev->cdev_sysfs_created) { hdev 234 drivers/misc/habanalabs/device.c kfree(hdev->dev_ctrl); hdev 235 drivers/misc/habanalabs/device.c kfree(hdev->dev); hdev 239 drivers/misc/habanalabs/device.c hl_sysfs_fini(hdev); hdev 240 drivers/misc/habanalabs/device.c cdev_device_del(&hdev->cdev_ctrl, hdev->dev_ctrl); hdev 241 drivers/misc/habanalabs/device.c cdev_device_del(&hdev->cdev, hdev->dev); hdev 252 drivers/misc/habanalabs/device.c static int device_early_init(struct hl_device *hdev) hdev 256 drivers/misc/habanalabs/device.c switch (hdev->asic_type) { hdev 258 drivers/misc/habanalabs/device.c goya_set_asic_funcs(hdev); hdev 259 drivers/misc/habanalabs/device.c strlcpy(hdev->asic_name, "GOYA", sizeof(hdev->asic_name)); hdev 262 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "Unrecognized ASIC type %d\n", hdev 263 drivers/misc/habanalabs/device.c hdev->asic_type); hdev 267 drivers/misc/habanalabs/device.c rc = hdev->asic_funcs->early_init(hdev); hdev 271 drivers/misc/habanalabs/device.c rc = hl_asid_init(hdev); hdev 275 drivers/misc/habanalabs/device.c hdev->cq_wq = alloc_workqueue("hl-free-jobs", WQ_UNBOUND, 0); hdev 276 drivers/misc/habanalabs/device.c if (hdev->cq_wq == NULL) { hdev 277 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "Failed to allocate CQ workqueue\n"); hdev 282 drivers/misc/habanalabs/device.c hdev->eq_wq = alloc_workqueue("hl-events", WQ_UNBOUND, 0); hdev 283 drivers/misc/habanalabs/device.c if (hdev->eq_wq == NULL) { hdev 284 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "Failed to allocate EQ workqueue\n"); hdev 289 drivers/misc/habanalabs/device.c hdev->hl_chip_info = kzalloc(sizeof(struct hwmon_chip_info), hdev 291 drivers/misc/habanalabs/device.c if (!hdev->hl_chip_info) { hdev 296 drivers/misc/habanalabs/device.c hdev->idle_busy_ts_arr = kmalloc_array(HL_IDLE_BUSY_TS_ARR_SIZE, hdev 299 drivers/misc/habanalabs/device.c if (!hdev->idle_busy_ts_arr) { hdev 304 drivers/misc/habanalabs/device.c hl_cb_mgr_init(&hdev->kernel_cb_mgr); hdev 306 drivers/misc/habanalabs/device.c mutex_init(&hdev->send_cpu_message_lock); hdev 307 drivers/misc/habanalabs/device.c mutex_init(&hdev->debug_lock); hdev 308 drivers/misc/habanalabs/device.c mutex_init(&hdev->mmu_cache_lock); hdev 309 drivers/misc/habanalabs/device.c INIT_LIST_HEAD(&hdev->hw_queues_mirror_list); hdev 310 drivers/misc/habanalabs/device.c spin_lock_init(&hdev->hw_queues_mirror_lock); hdev 311 drivers/misc/habanalabs/device.c INIT_LIST_HEAD(&hdev->fpriv_list); hdev 312 drivers/misc/habanalabs/device.c mutex_init(&hdev->fpriv_list_lock); hdev 313 drivers/misc/habanalabs/device.c atomic_set(&hdev->in_reset, 0); hdev 318 drivers/misc/habanalabs/device.c kfree(hdev->hl_chip_info); hdev 320 drivers/misc/habanalabs/device.c destroy_workqueue(hdev->eq_wq); hdev 322 drivers/misc/habanalabs/device.c destroy_workqueue(hdev->cq_wq); hdev 324 drivers/misc/habanalabs/device.c hl_asid_fini(hdev); hdev 326 drivers/misc/habanalabs/device.c if (hdev->asic_funcs->early_fini) hdev 327 drivers/misc/habanalabs/device.c hdev->asic_funcs->early_fini(hdev); hdev 338 drivers/misc/habanalabs/device.c static void device_early_fini(struct hl_device *hdev) hdev 340 drivers/misc/habanalabs/device.c mutex_destroy(&hdev->mmu_cache_lock); hdev 341 drivers/misc/habanalabs/device.c mutex_destroy(&hdev->debug_lock); hdev 342 drivers/misc/habanalabs/device.c mutex_destroy(&hdev->send_cpu_message_lock); hdev 344 drivers/misc/habanalabs/device.c mutex_destroy(&hdev->fpriv_list_lock); hdev 346 drivers/misc/habanalabs/device.c hl_cb_mgr_fini(hdev, &hdev->kernel_cb_mgr); hdev 348 drivers/misc/habanalabs/device.c kfree(hdev->idle_busy_ts_arr); hdev 349 drivers/misc/habanalabs/device.c kfree(hdev->hl_chip_info); hdev 351 drivers/misc/habanalabs/device.c destroy_workqueue(hdev->eq_wq); hdev 352 drivers/misc/habanalabs/device.c destroy_workqueue(hdev->cq_wq); hdev 354 drivers/misc/habanalabs/device.c hl_asid_fini(hdev); hdev 356 drivers/misc/habanalabs/device.c if (hdev->asic_funcs->early_fini) hdev 357 drivers/misc/habanalabs/device.c hdev->asic_funcs->early_fini(hdev); hdev 362 drivers/misc/habanalabs/device.c struct hl_device *hdev = container_of(work, struct hl_device, hdev 365 drivers/misc/habanalabs/device.c mutex_lock(&hdev->fpriv_list_lock); hdev 367 drivers/misc/habanalabs/device.c if (!hdev->compute_ctx) hdev 368 drivers/misc/habanalabs/device.c hl_device_set_frequency(hdev, PLL_LOW); hdev 370 drivers/misc/habanalabs/device.c mutex_unlock(&hdev->fpriv_list_lock); hdev 372 drivers/misc/habanalabs/device.c schedule_delayed_work(&hdev->work_freq, hdev 378 drivers/misc/habanalabs/device.c struct hl_device *hdev = container_of(work, struct hl_device, hdev 381 drivers/misc/habanalabs/device.c if (hl_device_disabled_or_in_reset(hdev)) hdev 384 drivers/misc/habanalabs/device.c if (!hdev->asic_funcs->send_heartbeat(hdev)) hdev 387 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "Device heartbeat failed!\n"); hdev 388 drivers/misc/habanalabs/device.c hl_device_reset(hdev, true, false); hdev 393 drivers/misc/habanalabs/device.c schedule_delayed_work(&hdev->work_heartbeat, hdev 405 drivers/misc/habanalabs/device.c static int device_late_init(struct hl_device *hdev) hdev 409 drivers/misc/habanalabs/device.c if (hdev->asic_funcs->late_init) { hdev 410 drivers/misc/habanalabs/device.c rc = hdev->asic_funcs->late_init(hdev); hdev 412 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 418 drivers/misc/habanalabs/device.c hdev->high_pll = hdev->asic_prop.high_pll; hdev 421 drivers/misc/habanalabs/device.c hdev->curr_pll_profile = PLL_LOW; hdev 423 drivers/misc/habanalabs/device.c if (hdev->pm_mng_profile == PM_AUTO) hdev 424 drivers/misc/habanalabs/device.c hdev->asic_funcs->set_pll_profile(hdev, PLL_LOW); hdev 426 drivers/misc/habanalabs/device.c hdev->asic_funcs->set_pll_profile(hdev, PLL_LAST); hdev 428 drivers/misc/habanalabs/device.c INIT_DELAYED_WORK(&hdev->work_freq, set_freq_to_low_job); hdev 429 drivers/misc/habanalabs/device.c schedule_delayed_work(&hdev->work_freq, hdev 432 drivers/misc/habanalabs/device.c if (hdev->heartbeat) { hdev 433 drivers/misc/habanalabs/device.c INIT_DELAYED_WORK(&hdev->work_heartbeat, hl_device_heartbeat); hdev 434 drivers/misc/habanalabs/device.c schedule_delayed_work(&hdev->work_heartbeat, hdev 438 drivers/misc/habanalabs/device.c hdev->late_init_done = true; hdev 449 drivers/misc/habanalabs/device.c static void device_late_fini(struct hl_device *hdev) hdev 451 drivers/misc/habanalabs/device.c if (!hdev->late_init_done) hdev 454 drivers/misc/habanalabs/device.c cancel_delayed_work_sync(&hdev->work_freq); hdev 455 drivers/misc/habanalabs/device.c if (hdev->heartbeat) hdev 456 drivers/misc/habanalabs/device.c cancel_delayed_work_sync(&hdev->work_heartbeat); hdev 458 drivers/misc/habanalabs/device.c if (hdev->asic_funcs->late_fini) hdev 459 drivers/misc/habanalabs/device.c hdev->asic_funcs->late_fini(hdev); hdev 461 drivers/misc/habanalabs/device.c hdev->late_init_done = false; hdev 464 drivers/misc/habanalabs/device.c uint32_t hl_device_utilization(struct hl_device *hdev, uint32_t period_ms) hdev 468 drivers/misc/habanalabs/device.c u32 overlap_cnt = 0, last_index = hdev->idle_busy_ts_idx; hdev 474 drivers/misc/habanalabs/device.c ts = &hdev->idle_busy_ts_arr[last_index]; hdev 485 drivers/misc/habanalabs/device.c ts = &hdev->idle_busy_ts_arr[last_index]; hdev 549 drivers/misc/habanalabs/device.c ts = &hdev->idle_busy_ts_arr[last_index]; hdev 573 drivers/misc/habanalabs/device.c int hl_device_set_frequency(struct hl_device *hdev, enum hl_pll_frequency freq) hdev 575 drivers/misc/habanalabs/device.c if ((hdev->pm_mng_profile == PM_MANUAL) || hdev 576 drivers/misc/habanalabs/device.c (hdev->curr_pll_profile == freq)) hdev 579 drivers/misc/habanalabs/device.c dev_dbg(hdev->dev, "Changing device frequency to %s\n", hdev 582 drivers/misc/habanalabs/device.c hdev->asic_funcs->set_pll_profile(hdev, freq); hdev 584 drivers/misc/habanalabs/device.c hdev->curr_pll_profile = freq; hdev 589 drivers/misc/habanalabs/device.c int hl_device_set_debug_mode(struct hl_device *hdev, bool enable) hdev 593 drivers/misc/habanalabs/device.c mutex_lock(&hdev->debug_lock); hdev 596 drivers/misc/habanalabs/device.c if (!hdev->in_debug) { hdev 597 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 603 drivers/misc/habanalabs/device.c if (!hdev->hard_reset_pending) hdev 604 drivers/misc/habanalabs/device.c hdev->asic_funcs->halt_coresight(hdev); hdev 606 drivers/misc/habanalabs/device.c hdev->in_debug = 0; hdev 611 drivers/misc/habanalabs/device.c if (hdev->in_debug) { hdev 612 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 618 drivers/misc/habanalabs/device.c hdev->in_debug = 1; hdev 621 drivers/misc/habanalabs/device.c mutex_unlock(&hdev->debug_lock); hdev 635 drivers/misc/habanalabs/device.c int hl_device_suspend(struct hl_device *hdev) hdev 639 drivers/misc/habanalabs/device.c pci_save_state(hdev->pdev); hdev 642 drivers/misc/habanalabs/device.c rc = atomic_cmpxchg(&hdev->in_reset, 0, 1); hdev 644 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "Can't suspend while in reset\n"); hdev 649 drivers/misc/habanalabs/device.c hdev->disabled = true; hdev 655 drivers/misc/habanalabs/device.c hdev->asic_funcs->hw_queues_lock(hdev); hdev 656 drivers/misc/habanalabs/device.c hdev->asic_funcs->hw_queues_unlock(hdev); hdev 659 drivers/misc/habanalabs/device.c mutex_lock(&hdev->send_cpu_message_lock); hdev 660 drivers/misc/habanalabs/device.c mutex_unlock(&hdev->send_cpu_message_lock); hdev 662 drivers/misc/habanalabs/device.c rc = hdev->asic_funcs->suspend(hdev); hdev 664 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 668 drivers/misc/habanalabs/device.c pci_disable_device(hdev->pdev); hdev 669 drivers/misc/habanalabs/device.c pci_set_power_state(hdev->pdev, PCI_D3hot); hdev 683 drivers/misc/habanalabs/device.c int hl_device_resume(struct hl_device *hdev) hdev 687 drivers/misc/habanalabs/device.c pci_set_power_state(hdev->pdev, PCI_D0); hdev 688 drivers/misc/habanalabs/device.c pci_restore_state(hdev->pdev); hdev 689 drivers/misc/habanalabs/device.c rc = pci_enable_device_mem(hdev->pdev); hdev 691 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 696 drivers/misc/habanalabs/device.c pci_set_master(hdev->pdev); hdev 698 drivers/misc/habanalabs/device.c rc = hdev->asic_funcs->resume(hdev); hdev 700 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "Failed to resume device after suspend\n"); hdev 705 drivers/misc/habanalabs/device.c hdev->disabled = false; hdev 706 drivers/misc/habanalabs/device.c atomic_set(&hdev->in_reset, 0); hdev 708 drivers/misc/habanalabs/device.c rc = hl_device_reset(hdev, true, false); hdev 710 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "Failed to reset device during resume\n"); hdev 717 drivers/misc/habanalabs/device.c pci_clear_master(hdev->pdev); hdev 718 drivers/misc/habanalabs/device.c pci_disable_device(hdev->pdev); hdev 723 drivers/misc/habanalabs/device.c static void device_kill_open_processes(struct hl_device *hdev) hdev 729 drivers/misc/habanalabs/device.c if (hdev->pldm) hdev 737 drivers/misc/habanalabs/device.c if (!list_empty(&hdev->fpriv_list)) hdev 740 drivers/misc/habanalabs/device.c mutex_lock(&hdev->fpriv_list_lock); hdev 745 drivers/misc/habanalabs/device.c list_for_each_entry(hpriv, &hdev->fpriv_list, dev_node) { hdev 748 drivers/misc/habanalabs/device.c dev_info(hdev->dev, "Killing user process pid=%d\n", hdev 757 drivers/misc/habanalabs/device.c mutex_unlock(&hdev->fpriv_list_lock); hdev 767 drivers/misc/habanalabs/device.c while ((!list_empty(&hdev->fpriv_list)) && (pending_cnt)) { hdev 768 drivers/misc/habanalabs/device.c dev_info(hdev->dev, hdev 776 drivers/misc/habanalabs/device.c if (!list_empty(&hdev->fpriv_list)) hdev 777 drivers/misc/habanalabs/device.c dev_crit(hdev->dev, hdev 785 drivers/misc/habanalabs/device.c struct hl_device *hdev = device_reset_work->hdev; hdev 787 drivers/misc/habanalabs/device.c hl_device_reset(hdev, true, true); hdev 809 drivers/misc/habanalabs/device.c int hl_device_reset(struct hl_device *hdev, bool hard_reset, hdev 814 drivers/misc/habanalabs/device.c if (!hdev->init_done) { hdev 815 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 827 drivers/misc/habanalabs/device.c rc = atomic_cmpxchg(&hdev->in_reset, 0, 1); hdev 832 drivers/misc/habanalabs/device.c hdev->disabled = true; hdev 837 drivers/misc/habanalabs/device.c hdev->asic_funcs->hw_queues_lock(hdev); hdev 838 drivers/misc/habanalabs/device.c hdev->asic_funcs->hw_queues_unlock(hdev); hdev 841 drivers/misc/habanalabs/device.c mutex_lock(&hdev->fpriv_list_lock); hdev 842 drivers/misc/habanalabs/device.c mutex_unlock(&hdev->fpriv_list_lock); hdev 844 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "Going to RESET device!\n"); hdev 851 drivers/misc/habanalabs/device.c hdev->hard_reset_pending = true; hdev 867 drivers/misc/habanalabs/device.c device_reset_work->hdev = hdev; hdev 874 drivers/misc/habanalabs/device.c device_late_fini(hdev); hdev 880 drivers/misc/habanalabs/device.c mutex_lock(&hdev->send_cpu_message_lock); hdev 881 drivers/misc/habanalabs/device.c mutex_unlock(&hdev->send_cpu_message_lock); hdev 889 drivers/misc/habanalabs/device.c hdev->asic_funcs->halt_engines(hdev, hard_reset); hdev 892 drivers/misc/habanalabs/device.c hl_cs_rollback_all(hdev); hdev 899 drivers/misc/habanalabs/device.c device_kill_open_processes(hdev); hdev 902 drivers/misc/habanalabs/device.c if ((hard_reset) && (hl_ctx_put(hdev->kernel_ctx) == 1)) hdev 903 drivers/misc/habanalabs/device.c hdev->kernel_ctx = NULL; hdev 906 drivers/misc/habanalabs/device.c hdev->asic_funcs->hw_fini(hdev, hard_reset); hdev 909 drivers/misc/habanalabs/device.c hl_vm_fini(hdev); hdev 910 drivers/misc/habanalabs/device.c hl_mmu_fini(hdev); hdev 911 drivers/misc/habanalabs/device.c hl_eq_reset(hdev, &hdev->event_queue); hdev 915 drivers/misc/habanalabs/device.c hl_hw_queue_reset(hdev, hard_reset); hdev 916 drivers/misc/habanalabs/device.c for (i = 0 ; i < hdev->asic_prop.completion_queues_count ; i++) hdev 917 drivers/misc/habanalabs/device.c hl_cq_reset(hdev, &hdev->completion_queue[i]); hdev 919 drivers/misc/habanalabs/device.c hdev->idle_busy_ts_idx = 0; hdev 920 drivers/misc/habanalabs/device.c hdev->idle_busy_ts_arr[0].busy_to_idle_ts = ktime_set(0, 0); hdev 921 drivers/misc/habanalabs/device.c hdev->idle_busy_ts_arr[0].idle_to_busy_ts = ktime_set(0, 0); hdev 923 drivers/misc/habanalabs/device.c if (hdev->cs_active_cnt) hdev 924 drivers/misc/habanalabs/device.c dev_crit(hdev->dev, "CS active cnt %d is not 0 during reset\n", hdev 925 drivers/misc/habanalabs/device.c hdev->cs_active_cnt); hdev 927 drivers/misc/habanalabs/device.c mutex_lock(&hdev->fpriv_list_lock); hdev 930 drivers/misc/habanalabs/device.c if (hdev->compute_ctx) { hdev 931 drivers/misc/habanalabs/device.c atomic_set(&hdev->compute_ctx->thread_ctx_switch_token, 1); hdev 932 drivers/misc/habanalabs/device.c hdev->compute_ctx->thread_ctx_switch_wait_token = 0; hdev 935 drivers/misc/habanalabs/device.c mutex_unlock(&hdev->fpriv_list_lock); hdev 940 drivers/misc/habanalabs/device.c hdev->device_cpu_disabled = false; hdev 941 drivers/misc/habanalabs/device.c hdev->hard_reset_pending = false; hdev 943 drivers/misc/habanalabs/device.c if (hdev->kernel_ctx) { hdev 944 drivers/misc/habanalabs/device.c dev_crit(hdev->dev, hdev 950 drivers/misc/habanalabs/device.c rc = hl_mmu_init(hdev); hdev 952 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 958 drivers/misc/habanalabs/device.c hdev->kernel_ctx = kzalloc(sizeof(*hdev->kernel_ctx), hdev 960 drivers/misc/habanalabs/device.c if (!hdev->kernel_ctx) { hdev 965 drivers/misc/habanalabs/device.c hdev->compute_ctx = NULL; hdev 967 drivers/misc/habanalabs/device.c rc = hl_ctx_init(hdev, hdev->kernel_ctx, true); hdev 969 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 971 drivers/misc/habanalabs/device.c kfree(hdev->kernel_ctx); hdev 972 drivers/misc/habanalabs/device.c hdev->kernel_ctx = NULL; hdev 977 drivers/misc/habanalabs/device.c rc = hdev->asic_funcs->hw_init(hdev); hdev 979 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 984 drivers/misc/habanalabs/device.c hdev->disabled = false; hdev 987 drivers/misc/habanalabs/device.c rc = hdev->asic_funcs->test_queues(hdev); hdev 989 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 995 drivers/misc/habanalabs/device.c rc = device_late_init(hdev); hdev 997 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 1002 drivers/misc/habanalabs/device.c rc = hl_vm_init(hdev); hdev 1004 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 1009 drivers/misc/habanalabs/device.c hl_set_max_power(hdev, hdev->max_power); hdev 1011 drivers/misc/habanalabs/device.c rc = hdev->asic_funcs->soft_reset_late_init(hdev); hdev 1013 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 1019 drivers/misc/habanalabs/device.c atomic_set(&hdev->in_reset, 0); hdev 1022 drivers/misc/habanalabs/device.c hdev->hard_reset_cnt++; hdev 1024 drivers/misc/habanalabs/device.c hdev->soft_reset_cnt++; hdev 1026 drivers/misc/habanalabs/device.c dev_warn(hdev->dev, "Successfully finished resetting the device\n"); hdev 1031 drivers/misc/habanalabs/device.c hdev->disabled = true; hdev 1034 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 1036 drivers/misc/habanalabs/device.c hdev->hard_reset_cnt++; hdev 1038 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 1040 drivers/misc/habanalabs/device.c hdev->soft_reset_cnt++; hdev 1045 drivers/misc/habanalabs/device.c atomic_set(&hdev->in_reset, 0); hdev 1059 drivers/misc/habanalabs/device.c int hl_device_init(struct hl_device *hdev, struct class *hclass) hdev 1065 drivers/misc/habanalabs/device.c name = kasprintf(GFP_KERNEL, "hl%d", hdev->id / 2); hdev 1072 drivers/misc/habanalabs/device.c rc = device_init_cdev(hdev, hclass, hdev->id, &hl_ops, name, hdev 1073 drivers/misc/habanalabs/device.c &hdev->cdev, &hdev->dev); hdev 1080 drivers/misc/habanalabs/device.c name = kasprintf(GFP_KERNEL, "hl_controlD%d", hdev->id / 2); hdev 1087 drivers/misc/habanalabs/device.c rc = device_init_cdev(hdev, hclass, hdev->id_control, &hl_ctrl_ops, hdev 1088 drivers/misc/habanalabs/device.c name, &hdev->cdev_ctrl, &hdev->dev_ctrl); hdev 1096 drivers/misc/habanalabs/device.c rc = device_early_init(hdev); hdev 1104 drivers/misc/habanalabs/device.c rc = hdev->asic_funcs->sw_init(hdev); hdev 1113 drivers/misc/habanalabs/device.c rc = hl_hw_queues_create(hdev); hdev 1115 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "failed to initialize kernel queues\n"); hdev 1124 drivers/misc/habanalabs/device.c hdev->completion_queue = hdev 1125 drivers/misc/habanalabs/device.c kcalloc(hdev->asic_prop.completion_queues_count, hdev 1126 drivers/misc/habanalabs/device.c sizeof(*hdev->completion_queue), GFP_KERNEL); hdev 1128 drivers/misc/habanalabs/device.c if (!hdev->completion_queue) { hdev 1129 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "failed to allocate completion queues\n"); hdev 1135 drivers/misc/habanalabs/device.c i < hdev->asic_prop.completion_queues_count; hdev 1137 drivers/misc/habanalabs/device.c rc = hl_cq_init(hdev, &hdev->completion_queue[i], i); hdev 1139 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 1150 drivers/misc/habanalabs/device.c rc = hl_eq_init(hdev, &hdev->event_queue); hdev 1152 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "failed to initialize event queue\n"); hdev 1157 drivers/misc/habanalabs/device.c rc = hl_mmu_init(hdev); hdev 1159 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "Failed to initialize MMU S/W structures\n"); hdev 1164 drivers/misc/habanalabs/device.c hdev->kernel_ctx = kzalloc(sizeof(*hdev->kernel_ctx), GFP_KERNEL); hdev 1165 drivers/misc/habanalabs/device.c if (!hdev->kernel_ctx) { hdev 1170 drivers/misc/habanalabs/device.c hdev->compute_ctx = NULL; hdev 1172 drivers/misc/habanalabs/device.c rc = hl_ctx_init(hdev, hdev->kernel_ctx, true); hdev 1174 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "failed to initialize kernel context\n"); hdev 1175 drivers/misc/habanalabs/device.c kfree(hdev->kernel_ctx); hdev 1179 drivers/misc/habanalabs/device.c rc = hl_cb_pool_init(hdev); hdev 1181 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "failed to initialize CB pool\n"); hdev 1185 drivers/misc/habanalabs/device.c hl_debugfs_add_device(hdev); hdev 1187 drivers/misc/habanalabs/device.c if (hdev->asic_funcs->get_hw_state(hdev) == HL_DEVICE_HW_STATE_DIRTY) { hdev 1188 drivers/misc/habanalabs/device.c dev_info(hdev->dev, hdev 1190 drivers/misc/habanalabs/device.c hdev->asic_funcs->halt_engines(hdev, true); hdev 1191 drivers/misc/habanalabs/device.c hdev->asic_funcs->hw_fini(hdev, true); hdev 1200 drivers/misc/habanalabs/device.c rc = hdev->asic_funcs->hw_init(hdev); hdev 1202 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "failed to initialize the H/W\n"); hdev 1207 drivers/misc/habanalabs/device.c hdev->disabled = false; hdev 1210 drivers/misc/habanalabs/device.c rc = hdev->asic_funcs->test_queues(hdev); hdev 1212 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "Failed to detect if device is alive\n"); hdev 1217 drivers/misc/habanalabs/device.c rc = device_late_init(hdev); hdev 1219 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "Failed late initialization\n"); hdev 1224 drivers/misc/habanalabs/device.c dev_info(hdev->dev, "Found %s device with %lluGB DRAM\n", hdev 1225 drivers/misc/habanalabs/device.c hdev->asic_name, hdev 1226 drivers/misc/habanalabs/device.c hdev->asic_prop.dram_size / 1024 / 1024 / 1024); hdev 1228 drivers/misc/habanalabs/device.c rc = hl_vm_init(hdev); hdev 1230 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "Failed to initialize memory module\n"); hdev 1241 drivers/misc/habanalabs/device.c rc = device_cdev_sysfs_add(hdev); hdev 1243 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 1255 drivers/misc/habanalabs/device.c rc = hl_hwmon_init(hdev); hdev 1257 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "Failed to initialize hwmon\n"); hdev 1262 drivers/misc/habanalabs/device.c dev_notice(hdev->dev, hdev 1265 drivers/misc/habanalabs/device.c hdev->init_done = true; hdev 1270 drivers/misc/habanalabs/device.c if (hl_ctx_put(hdev->kernel_ctx) != 1) hdev 1271 drivers/misc/habanalabs/device.c dev_err(hdev->dev, hdev 1274 drivers/misc/habanalabs/device.c hl_mmu_fini(hdev); hdev 1276 drivers/misc/habanalabs/device.c hl_eq_fini(hdev, &hdev->event_queue); hdev 1279 drivers/misc/habanalabs/device.c hl_cq_fini(hdev, &hdev->completion_queue[i]); hdev 1280 drivers/misc/habanalabs/device.c kfree(hdev->completion_queue); hdev 1282 drivers/misc/habanalabs/device.c hl_hw_queues_destroy(hdev); hdev 1284 drivers/misc/habanalabs/device.c hdev->asic_funcs->sw_fini(hdev); hdev 1286 drivers/misc/habanalabs/device.c device_early_fini(hdev); hdev 1288 drivers/misc/habanalabs/device.c kfree(hdev->dev_ctrl); hdev 1290 drivers/misc/habanalabs/device.c kfree(hdev->dev); hdev 1292 drivers/misc/habanalabs/device.c hdev->disabled = true; hdev 1294 drivers/misc/habanalabs/device.c device_cdev_sysfs_add(hdev); hdev 1295 drivers/misc/habanalabs/device.c if (hdev->pdev) hdev 1296 drivers/misc/habanalabs/device.c dev_err(&hdev->pdev->dev, hdev 1298 drivers/misc/habanalabs/device.c hdev->id / 2); hdev 1301 drivers/misc/habanalabs/device.c hdev->id / 2); hdev 1313 drivers/misc/habanalabs/device.c void hl_device_fini(struct hl_device *hdev) hdev 1318 drivers/misc/habanalabs/device.c dev_info(hdev->dev, "Removing device\n"); hdev 1329 drivers/misc/habanalabs/device.c rc = atomic_cmpxchg(&hdev->in_reset, 0, 1); hdev 1332 drivers/misc/habanalabs/device.c rc = atomic_cmpxchg(&hdev->in_reset, 0, 1); hdev 1340 drivers/misc/habanalabs/device.c hdev->disabled = true; hdev 1345 drivers/misc/habanalabs/device.c hdev->asic_funcs->hw_queues_lock(hdev); hdev 1346 drivers/misc/habanalabs/device.c hdev->asic_funcs->hw_queues_unlock(hdev); hdev 1349 drivers/misc/habanalabs/device.c mutex_lock(&hdev->fpriv_list_lock); hdev 1350 drivers/misc/habanalabs/device.c mutex_unlock(&hdev->fpriv_list_lock); hdev 1352 drivers/misc/habanalabs/device.c hdev->hard_reset_pending = true; hdev 1354 drivers/misc/habanalabs/device.c hl_hwmon_fini(hdev); hdev 1356 drivers/misc/habanalabs/device.c device_late_fini(hdev); hdev 1358 drivers/misc/habanalabs/device.c hl_debugfs_remove_device(hdev); hdev 1365 drivers/misc/habanalabs/device.c hdev->asic_funcs->halt_engines(hdev, true); hdev 1368 drivers/misc/habanalabs/device.c hl_cs_rollback_all(hdev); hdev 1374 drivers/misc/habanalabs/device.c device_kill_open_processes(hdev); hdev 1376 drivers/misc/habanalabs/device.c hl_cb_pool_fini(hdev); hdev 1379 drivers/misc/habanalabs/device.c if ((hdev->kernel_ctx) && (hl_ctx_put(hdev->kernel_ctx) != 1)) hdev 1380 drivers/misc/habanalabs/device.c dev_err(hdev->dev, "kernel ctx is still alive\n"); hdev 1383 drivers/misc/habanalabs/device.c hdev->asic_funcs->hw_fini(hdev, true); hdev 1385 drivers/misc/habanalabs/device.c hl_vm_fini(hdev); hdev 1387 drivers/misc/habanalabs/device.c hl_mmu_fini(hdev); hdev 1389 drivers/misc/habanalabs/device.c hl_eq_fini(hdev, &hdev->event_queue); hdev 1391 drivers/misc/habanalabs/device.c for (i = 0 ; i < hdev->asic_prop.completion_queues_count ; i++) hdev 1392 drivers/misc/habanalabs/device.c hl_cq_fini(hdev, &hdev->completion_queue[i]); hdev 1393 drivers/misc/habanalabs/device.c kfree(hdev->completion_queue); hdev 1395 drivers/misc/habanalabs/device.c hl_hw_queues_destroy(hdev); hdev 1398 drivers/misc/habanalabs/device.c hdev->asic_funcs->sw_fini(hdev); hdev 1400 drivers/misc/habanalabs/device.c device_early_fini(hdev); hdev 1403 drivers/misc/habanalabs/device.c device_cdev_sysfs_del(hdev); hdev 1421 drivers/misc/habanalabs/device.c inline u32 hl_rreg(struct hl_device *hdev, u32 reg) hdev 1423 drivers/misc/habanalabs/device.c return readl(hdev->rmmio + reg); hdev 1436 drivers/misc/habanalabs/device.c inline void hl_wreg(struct hl_device *hdev, u32 reg, u32 val) hdev 1438 drivers/misc/habanalabs/device.c writel(val, hdev->rmmio + reg); hdev 22 drivers/misc/habanalabs/firmware_if.c int hl_fw_push_fw_to_device(struct hl_device *hdev, const char *fw_name, hdev 30 drivers/misc/habanalabs/firmware_if.c rc = request_firmware(&fw, fw_name, hdev->dev); hdev 32 drivers/misc/habanalabs/firmware_if.c dev_err(hdev->dev, "Firmware file %s is not found!\n", fw_name); hdev 38 drivers/misc/habanalabs/firmware_if.c dev_err(hdev->dev, "Illegal %s firmware size %zu\n", hdev 44 drivers/misc/habanalabs/firmware_if.c dev_dbg(hdev->dev, "%s firmware size == %zu\n", fw_name, fw_size); hdev 55 drivers/misc/habanalabs/firmware_if.c int hl_fw_send_pci_access_msg(struct hl_device *hdev, u32 opcode) hdev 61 drivers/misc/habanalabs/firmware_if.c return hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, hdev 65 drivers/misc/habanalabs/firmware_if.c int hl_fw_send_cpu_message(struct hl_device *hdev, u32 hw_queue_id, u32 *msg, hdev 73 drivers/misc/habanalabs/firmware_if.c pkt = hdev->asic_funcs->cpu_accessible_dma_pool_alloc(hdev, len, hdev 76 drivers/misc/habanalabs/firmware_if.c dev_err(hdev->dev, hdev 83 drivers/misc/habanalabs/firmware_if.c mutex_lock(&hdev->send_cpu_message_lock); hdev 85 drivers/misc/habanalabs/firmware_if.c if (hdev->disabled) hdev 88 drivers/misc/habanalabs/firmware_if.c if (hdev->device_cpu_disabled) { hdev 93 drivers/misc/habanalabs/firmware_if.c rc = hl_hw_queue_send_cb_no_cmpl(hdev, hw_queue_id, len, pkt_dma_addr); hdev 95 drivers/misc/habanalabs/firmware_if.c dev_err(hdev->dev, "Failed to send CB on CPU PQ (%d)\n", rc); hdev 99 drivers/misc/habanalabs/firmware_if.c rc = hl_poll_timeout_memory(hdev, &pkt->fence, tmp, hdev 103 drivers/misc/habanalabs/firmware_if.c hl_hw_queue_inc_ci_kernel(hdev, hw_queue_id); hdev 106 drivers/misc/habanalabs/firmware_if.c dev_err(hdev->dev, "Device CPU packet timeout (0x%x)\n", tmp); hdev 107 drivers/misc/habanalabs/firmware_if.c hdev->device_cpu_disabled = true; hdev 115 drivers/misc/habanalabs/firmware_if.c dev_err(hdev->dev, "F/W ERROR %d for CPU packet %d\n", hdev 125 drivers/misc/habanalabs/firmware_if.c mutex_unlock(&hdev->send_cpu_message_lock); hdev 127 drivers/misc/habanalabs/firmware_if.c hdev->asic_funcs->cpu_accessible_dma_pool_free(hdev, len, pkt); hdev 132 drivers/misc/habanalabs/firmware_if.c int hl_fw_test_cpu_queue(struct hl_device *hdev) hdev 142 drivers/misc/habanalabs/firmware_if.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &test_pkt, hdev 147 drivers/misc/habanalabs/firmware_if.c dev_info(hdev->dev, hdev 150 drivers/misc/habanalabs/firmware_if.c dev_err(hdev->dev, hdev 153 drivers/misc/habanalabs/firmware_if.c dev_err(hdev->dev, "CPU queue test failed, error %d\n", rc); hdev 159 drivers/misc/habanalabs/firmware_if.c void *hl_fw_cpu_accessible_dma_pool_alloc(struct hl_device *hdev, size_t size, hdev 164 drivers/misc/habanalabs/firmware_if.c kernel_addr = gen_pool_alloc(hdev->cpu_accessible_dma_pool, size); hdev 166 drivers/misc/habanalabs/firmware_if.c *dma_handle = hdev->cpu_accessible_dma_address + hdev 167 drivers/misc/habanalabs/firmware_if.c (kernel_addr - (u64) (uintptr_t) hdev->cpu_accessible_dma_mem); hdev 172 drivers/misc/habanalabs/firmware_if.c void hl_fw_cpu_accessible_dma_pool_free(struct hl_device *hdev, size_t size, hdev 175 drivers/misc/habanalabs/firmware_if.c gen_pool_free(hdev->cpu_accessible_dma_pool, (u64) (uintptr_t) vaddr, hdev 179 drivers/misc/habanalabs/firmware_if.c int hl_fw_send_heartbeat(struct hl_device *hdev) hdev 189 drivers/misc/habanalabs/firmware_if.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &hb_pkt, hdev 198 drivers/misc/habanalabs/firmware_if.c int hl_fw_armcp_info_get(struct hl_device *hdev) hdev 200 drivers/misc/habanalabs/firmware_if.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 208 drivers/misc/habanalabs/firmware_if.c hdev->asic_funcs->cpu_accessible_dma_pool_alloc(hdev, hdev 212 drivers/misc/habanalabs/firmware_if.c dev_err(hdev->dev, hdev 224 drivers/misc/habanalabs/firmware_if.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 227 drivers/misc/habanalabs/firmware_if.c dev_err(hdev->dev, hdev 235 drivers/misc/habanalabs/firmware_if.c rc = hl_build_hwmon_channel_info(hdev, prop->armcp_info.sensors); hdev 237 drivers/misc/habanalabs/firmware_if.c dev_err(hdev->dev, hdev 244 drivers/misc/habanalabs/firmware_if.c hdev->asic_funcs->cpu_accessible_dma_pool_free(hdev, hdev 250 drivers/misc/habanalabs/firmware_if.c int hl_fw_get_eeprom_data(struct hl_device *hdev, void *data, size_t max_size) hdev 259 drivers/misc/habanalabs/firmware_if.c hdev->asic_funcs->cpu_accessible_dma_pool_alloc(hdev, hdev 262 drivers/misc/habanalabs/firmware_if.c dev_err(hdev->dev, hdev 274 drivers/misc/habanalabs/firmware_if.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 278 drivers/misc/habanalabs/firmware_if.c dev_err(hdev->dev, hdev 287 drivers/misc/habanalabs/firmware_if.c hdev->asic_funcs->cpu_accessible_dma_pool_free(hdev, max_size, hdev 327 drivers/misc/habanalabs/goya/goya.c static int goya_mmu_clear_pgt_range(struct hl_device *hdev); hdev 328 drivers/misc/habanalabs/goya/goya.c static int goya_mmu_set_dram_default_page(struct hl_device *hdev); hdev 329 drivers/misc/habanalabs/goya/goya.c static int goya_mmu_add_mappings_for_device_cpu(struct hl_device *hdev); hdev 330 drivers/misc/habanalabs/goya/goya.c static void goya_mmu_prepare(struct hl_device *hdev, u32 asid); hdev 332 drivers/misc/habanalabs/goya/goya.c void goya_get_fixed_properties(struct hl_device *hdev) hdev 334 drivers/misc/habanalabs/goya/goya.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 371 drivers/misc/habanalabs/goya/goya.c if (hdev->pldm) hdev 407 drivers/misc/habanalabs/goya/goya.c static int goya_pci_bars_map(struct hl_device *hdev) hdev 413 drivers/misc/habanalabs/goya/goya.c rc = hl_pci_bars_map(hdev, name, is_wc); hdev 417 drivers/misc/habanalabs/goya/goya.c hdev->rmmio = hdev->pcie_bar[SRAM_CFG_BAR_ID] + hdev 423 drivers/misc/habanalabs/goya/goya.c static u64 goya_set_ddr_bar_base(struct hl_device *hdev, u64 addr) hdev 425 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 433 drivers/misc/habanalabs/goya/goya.c rc = hl_pci_set_dram_bar_base(hdev, 1, 4, addr); hdev 453 drivers/misc/habanalabs/goya/goya.c static int goya_init_iatu(struct hl_device *hdev) hdev 455 drivers/misc/habanalabs/goya/goya.c return hl_pci_init_iatu(hdev, SRAM_BASE_ADDR, DRAM_PHYS_BASE, hdev 470 drivers/misc/habanalabs/goya/goya.c static int goya_early_init(struct hl_device *hdev) hdev 472 drivers/misc/habanalabs/goya/goya.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 473 drivers/misc/habanalabs/goya/goya.c struct pci_dev *pdev = hdev->pdev; hdev 477 drivers/misc/habanalabs/goya/goya.c goya_get_fixed_properties(hdev); hdev 481 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 491 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 502 drivers/misc/habanalabs/goya/goya.c rc = hl_pci_init(hdev, 48); hdev 506 drivers/misc/habanalabs/goya/goya.c if (!hdev->pldm) { hdev 509 drivers/misc/habanalabs/goya/goya.c dev_warn(hdev->dev, hdev 524 drivers/misc/habanalabs/goya/goya.c static int goya_early_fini(struct hl_device *hdev) hdev 526 drivers/misc/habanalabs/goya/goya.c hl_pci_fini(hdev); hdev 531 drivers/misc/habanalabs/goya/goya.c static void goya_mmu_prepare_reg(struct hl_device *hdev, u64 reg, u32 asid) hdev 538 drivers/misc/habanalabs/goya/goya.c static void goya_qman0_set_security(struct hl_device *hdev, bool secure) hdev 540 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 559 drivers/misc/habanalabs/goya/goya.c static void goya_fetch_psoc_frequency(struct hl_device *hdev) hdev 561 drivers/misc/habanalabs/goya/goya.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 569 drivers/misc/habanalabs/goya/goya.c int goya_late_init(struct hl_device *hdev) hdev 571 drivers/misc/habanalabs/goya/goya.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 574 drivers/misc/habanalabs/goya/goya.c goya_fetch_psoc_frequency(hdev); hdev 576 drivers/misc/habanalabs/goya/goya.c rc = goya_mmu_clear_pgt_range(hdev); hdev 578 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 583 drivers/misc/habanalabs/goya/goya.c rc = goya_mmu_set_dram_default_page(hdev); hdev 585 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Failed to set DRAM default page %d\n", rc); hdev 589 drivers/misc/habanalabs/goya/goya.c rc = goya_mmu_add_mappings_for_device_cpu(hdev); hdev 593 drivers/misc/habanalabs/goya/goya.c rc = goya_init_cpu_queues(hdev); hdev 597 drivers/misc/habanalabs/goya/goya.c rc = goya_test_cpu_queue(hdev); hdev 601 drivers/misc/habanalabs/goya/goya.c rc = goya_armcp_info_get(hdev); hdev 603 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Failed to get armcp info %d\n", rc); hdev 613 drivers/misc/habanalabs/goya/goya.c rc = hl_fw_send_pci_access_msg(hdev, ARMCP_PACKET_ENABLE_PCI_ACCESS); hdev 615 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 633 drivers/misc/habanalabs/goya/goya.c void goya_late_fini(struct hl_device *hdev) hdev 638 drivers/misc/habanalabs/goya/goya.c if (!hdev->hl_chip_info->info) hdev 641 drivers/misc/habanalabs/goya/goya.c channel_info_arr = hdev->hl_chip_info->info; hdev 651 drivers/misc/habanalabs/goya/goya.c hdev->hl_chip_info->info = NULL; hdev 660 drivers/misc/habanalabs/goya/goya.c static int goya_sw_init(struct hl_device *hdev) hdev 677 drivers/misc/habanalabs/goya/goya.c hdev->asic_specific = goya; hdev 680 drivers/misc/habanalabs/goya/goya.c hdev->dma_pool = dma_pool_create(dev_name(hdev->dev), hdev 681 drivers/misc/habanalabs/goya/goya.c &hdev->pdev->dev, GOYA_DMA_POOL_BLK_SIZE, 8, 0); hdev 682 drivers/misc/habanalabs/goya/goya.c if (!hdev->dma_pool) { hdev 683 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to create DMA pool\n"); hdev 688 drivers/misc/habanalabs/goya/goya.c hdev->cpu_accessible_dma_mem = hdev 689 drivers/misc/habanalabs/goya/goya.c hdev->asic_funcs->asic_dma_alloc_coherent(hdev, hdev 691 drivers/misc/habanalabs/goya/goya.c &hdev->cpu_accessible_dma_address, hdev 694 drivers/misc/habanalabs/goya/goya.c if (!hdev->cpu_accessible_dma_mem) { hdev 699 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "cpu accessible memory at bus address %pad\n", hdev 700 drivers/misc/habanalabs/goya/goya.c &hdev->cpu_accessible_dma_address); hdev 702 drivers/misc/habanalabs/goya/goya.c hdev->cpu_accessible_dma_pool = gen_pool_create(ilog2(32), -1); hdev 703 drivers/misc/habanalabs/goya/goya.c if (!hdev->cpu_accessible_dma_pool) { hdev 704 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 710 drivers/misc/habanalabs/goya/goya.c rc = gen_pool_add(hdev->cpu_accessible_dma_pool, hdev 711 drivers/misc/habanalabs/goya/goya.c (uintptr_t) hdev->cpu_accessible_dma_mem, hdev 714 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 725 drivers/misc/habanalabs/goya/goya.c gen_pool_destroy(hdev->cpu_accessible_dma_pool); hdev 727 drivers/misc/habanalabs/goya/goya.c hdev->asic_funcs->asic_dma_free_coherent(hdev, hdev 729 drivers/misc/habanalabs/goya/goya.c hdev->cpu_accessible_dma_mem, hdev 730 drivers/misc/habanalabs/goya/goya.c hdev->cpu_accessible_dma_address); hdev 732 drivers/misc/habanalabs/goya/goya.c dma_pool_destroy(hdev->dma_pool); hdev 745 drivers/misc/habanalabs/goya/goya.c static int goya_sw_fini(struct hl_device *hdev) hdev 747 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 749 drivers/misc/habanalabs/goya/goya.c gen_pool_destroy(hdev->cpu_accessible_dma_pool); hdev 751 drivers/misc/habanalabs/goya/goya.c hdev->asic_funcs->asic_dma_free_coherent(hdev, hdev 753 drivers/misc/habanalabs/goya/goya.c hdev->cpu_accessible_dma_mem, hdev 754 drivers/misc/habanalabs/goya/goya.c hdev->cpu_accessible_dma_address); hdev 756 drivers/misc/habanalabs/goya/goya.c dma_pool_destroy(hdev->dma_pool); hdev 763 drivers/misc/habanalabs/goya/goya.c static void goya_init_dma_qman(struct hl_device *hdev, int dma_id, hdev 766 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 811 drivers/misc/habanalabs/goya/goya.c static void goya_init_dma_ch(struct hl_device *hdev, int dma_id) hdev 845 drivers/misc/habanalabs/goya/goya.c void goya_init_dma_qmans(struct hl_device *hdev) hdev 847 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 854 drivers/misc/habanalabs/goya/goya.c q = &hdev->kernel_queues[0]; hdev 857 drivers/misc/habanalabs/goya/goya.c goya_init_dma_qman(hdev, i, q->bus_address); hdev 858 drivers/misc/habanalabs/goya/goya.c goya_init_dma_ch(hdev, i); hdev 870 drivers/misc/habanalabs/goya/goya.c static void goya_disable_external_queues(struct hl_device *hdev) hdev 872 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 884 drivers/misc/habanalabs/goya/goya.c static int goya_stop_queue(struct hl_device *hdev, u32 cfg_reg, hdev 897 drivers/misc/habanalabs/goya/goya.c hdev, hdev 910 drivers/misc/habanalabs/goya/goya.c hdev, hdev 918 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 934 drivers/misc/habanalabs/goya/goya.c static int goya_stop_external_queues(struct hl_device *hdev) hdev 938 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 943 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 949 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop DMA QMAN 0\n"); hdev 953 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 959 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop DMA QMAN 1\n"); hdev 963 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 969 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop DMA QMAN 2\n"); hdev 973 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 979 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop DMA QMAN 3\n"); hdev 983 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 989 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop DMA QMAN 4\n"); hdev 1004 drivers/misc/habanalabs/goya/goya.c int goya_init_cpu_queues(struct hl_device *hdev) hdev 1006 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 1009 drivers/misc/habanalabs/goya/goya.c struct hl_hw_queue *cpu_pq = &hdev->kernel_queues[GOYA_QUEUE_ID_CPU_PQ]; hdev 1012 drivers/misc/habanalabs/goya/goya.c if (!hdev->cpu_queues_enable) hdev 1018 drivers/misc/habanalabs/goya/goya.c eq = &hdev->event_queue; hdev 1046 drivers/misc/habanalabs/goya/goya.c hdev, hdev 1054 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 1063 drivers/misc/habanalabs/goya/goya.c static void goya_set_pll_refclk(struct hl_device *hdev) hdev 1101 drivers/misc/habanalabs/goya/goya.c static void goya_disable_clk_rlx(struct hl_device *hdev) hdev 1107 drivers/misc/habanalabs/goya/goya.c static void _goya_tpc_mbist_workaround(struct hl_device *hdev, u8 tpc_id) hdev 1125 drivers/misc/habanalabs/goya/goya.c dev_warn(hdev->dev, "TPC%d MBIST ACTIVE is not cleared\n", hdev 1145 drivers/misc/habanalabs/goya/goya.c hdev, hdev 1153 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 1172 drivers/misc/habanalabs/goya/goya.c static void goya_tpc_mbist_workaround(struct hl_device *hdev) hdev 1174 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 1177 drivers/misc/habanalabs/goya/goya.c if (hdev->pldm) hdev 1186 drivers/misc/habanalabs/goya/goya.c _goya_tpc_mbist_workaround(hdev, i); hdev 1199 drivers/misc/habanalabs/goya/goya.c static void goya_init_golden_registers(struct hl_device *hdev) hdev 1201 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 1491 drivers/misc/habanalabs/goya/goya.c static void goya_init_mme_qman(struct hl_device *hdev) hdev 1508 drivers/misc/habanalabs/goya/goya.c qman_base_addr = hdev->asic_prop.sram_base_address + hdev 1541 drivers/misc/habanalabs/goya/goya.c static void goya_init_mme_cmdq(struct hl_device *hdev) hdev 1558 drivers/misc/habanalabs/goya/goya.c qman_base_addr = hdev->asic_prop.sram_base_address + hdev 1581 drivers/misc/habanalabs/goya/goya.c void goya_init_mme_qmans(struct hl_device *hdev) hdev 1583 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 1595 drivers/misc/habanalabs/goya/goya.c goya_init_mme_qman(hdev); hdev 1596 drivers/misc/habanalabs/goya/goya.c goya_init_mme_cmdq(hdev); hdev 1601 drivers/misc/habanalabs/goya/goya.c static void goya_init_tpc_qman(struct hl_device *hdev, u32 base_off, int tpc_id) hdev 1619 drivers/misc/habanalabs/goya/goya.c qman_base_addr = hdev->asic_prop.sram_base_address + base_off; hdev 1651 drivers/misc/habanalabs/goya/goya.c static void goya_init_tpc_cmdq(struct hl_device *hdev, int tpc_id) hdev 1688 drivers/misc/habanalabs/goya/goya.c void goya_init_tpc_qmans(struct hl_device *hdev) hdev 1690 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 1709 drivers/misc/habanalabs/goya/goya.c goya_init_tpc_qman(hdev, TPC0_QMAN_BASE_OFFSET, 0); hdev 1710 drivers/misc/habanalabs/goya/goya.c goya_init_tpc_qman(hdev, TPC1_QMAN_BASE_OFFSET, 1); hdev 1711 drivers/misc/habanalabs/goya/goya.c goya_init_tpc_qman(hdev, TPC2_QMAN_BASE_OFFSET, 2); hdev 1712 drivers/misc/habanalabs/goya/goya.c goya_init_tpc_qman(hdev, TPC3_QMAN_BASE_OFFSET, 3); hdev 1713 drivers/misc/habanalabs/goya/goya.c goya_init_tpc_qman(hdev, TPC4_QMAN_BASE_OFFSET, 4); hdev 1714 drivers/misc/habanalabs/goya/goya.c goya_init_tpc_qman(hdev, TPC5_QMAN_BASE_OFFSET, 5); hdev 1715 drivers/misc/habanalabs/goya/goya.c goya_init_tpc_qman(hdev, TPC6_QMAN_BASE_OFFSET, 6); hdev 1716 drivers/misc/habanalabs/goya/goya.c goya_init_tpc_qman(hdev, TPC7_QMAN_BASE_OFFSET, 7); hdev 1719 drivers/misc/habanalabs/goya/goya.c goya_init_tpc_cmdq(hdev, i); hdev 1730 drivers/misc/habanalabs/goya/goya.c static void goya_disable_internal_queues(struct hl_device *hdev) hdev 1732 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 1777 drivers/misc/habanalabs/goya/goya.c static int goya_stop_internal_queues(struct hl_device *hdev) hdev 1779 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 1791 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1797 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop MME QMAN\n"); hdev 1801 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1807 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop MME CMDQ\n"); hdev 1815 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1821 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 0 QMAN\n"); hdev 1825 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1831 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 0 CMDQ\n"); hdev 1835 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1841 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 1 QMAN\n"); hdev 1845 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1851 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 1 CMDQ\n"); hdev 1855 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1861 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 2 QMAN\n"); hdev 1865 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1871 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 2 CMDQ\n"); hdev 1875 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1881 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 3 QMAN\n"); hdev 1885 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1891 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 3 CMDQ\n"); hdev 1895 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1901 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 4 QMAN\n"); hdev 1905 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1911 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 4 CMDQ\n"); hdev 1915 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1921 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 5 QMAN\n"); hdev 1925 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1931 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 5 CMDQ\n"); hdev 1935 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1941 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 6 QMAN\n"); hdev 1945 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1951 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 6 CMDQ\n"); hdev 1955 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1961 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 7 QMAN\n"); hdev 1965 drivers/misc/habanalabs/goya/goya.c rc = goya_stop_queue(hdev, hdev 1971 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to stop TPC 7 CMDQ\n"); hdev 1978 drivers/misc/habanalabs/goya/goya.c static void goya_dma_stall(struct hl_device *hdev) hdev 1980 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 1992 drivers/misc/habanalabs/goya/goya.c static void goya_tpc_stall(struct hl_device *hdev) hdev 1994 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 2009 drivers/misc/habanalabs/goya/goya.c static void goya_mme_stall(struct hl_device *hdev) hdev 2011 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 2019 drivers/misc/habanalabs/goya/goya.c static int goya_enable_msix(struct hl_device *hdev) hdev 2021 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 2022 drivers/misc/habanalabs/goya/goya.c int cq_cnt = hdev->asic_prop.completion_queues_count; hdev 2028 drivers/misc/habanalabs/goya/goya.c rc = pci_alloc_irq_vectors(hdev->pdev, GOYA_MSIX_ENTRIES, hdev 2031 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2038 drivers/misc/habanalabs/goya/goya.c irq = pci_irq_vector(hdev->pdev, i); hdev 2040 drivers/misc/habanalabs/goya/goya.c &hdev->completion_queue[i]); hdev 2042 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Failed to request IRQ %d", irq); hdev 2047 drivers/misc/habanalabs/goya/goya.c irq = pci_irq_vector(hdev->pdev, GOYA_EVENT_QUEUE_MSIX_IDX); hdev 2051 drivers/misc/habanalabs/goya/goya.c &hdev->event_queue); hdev 2053 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Failed to request IRQ %d", irq); hdev 2062 drivers/misc/habanalabs/goya/goya.c free_irq(pci_irq_vector(hdev->pdev, i), hdev 2063 drivers/misc/habanalabs/goya/goya.c &hdev->completion_queue[i]); hdev 2065 drivers/misc/habanalabs/goya/goya.c pci_free_irq_vectors(hdev->pdev); hdev 2069 drivers/misc/habanalabs/goya/goya.c static void goya_sync_irqs(struct hl_device *hdev) hdev 2071 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 2078 drivers/misc/habanalabs/goya/goya.c for (i = 0 ; i < hdev->asic_prop.completion_queues_count ; i++) hdev 2079 drivers/misc/habanalabs/goya/goya.c synchronize_irq(pci_irq_vector(hdev->pdev, i)); hdev 2081 drivers/misc/habanalabs/goya/goya.c synchronize_irq(pci_irq_vector(hdev->pdev, GOYA_EVENT_QUEUE_MSIX_IDX)); hdev 2084 drivers/misc/habanalabs/goya/goya.c static void goya_disable_msix(struct hl_device *hdev) hdev 2086 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 2092 drivers/misc/habanalabs/goya/goya.c goya_sync_irqs(hdev); hdev 2094 drivers/misc/habanalabs/goya/goya.c irq = pci_irq_vector(hdev->pdev, GOYA_EVENT_QUEUE_MSIX_IDX); hdev 2095 drivers/misc/habanalabs/goya/goya.c free_irq(irq, &hdev->event_queue); hdev 2097 drivers/misc/habanalabs/goya/goya.c for (i = 0 ; i < hdev->asic_prop.completion_queues_count ; i++) { hdev 2098 drivers/misc/habanalabs/goya/goya.c irq = pci_irq_vector(hdev->pdev, i); hdev 2099 drivers/misc/habanalabs/goya/goya.c free_irq(irq, &hdev->completion_queue[i]); hdev 2102 drivers/misc/habanalabs/goya/goya.c pci_free_irq_vectors(hdev->pdev); hdev 2107 drivers/misc/habanalabs/goya/goya.c static void goya_enable_timestamp(struct hl_device *hdev) hdev 2120 drivers/misc/habanalabs/goya/goya.c static void goya_disable_timestamp(struct hl_device *hdev) hdev 2126 drivers/misc/habanalabs/goya/goya.c static void goya_halt_engines(struct hl_device *hdev, bool hard_reset) hdev 2130 drivers/misc/habanalabs/goya/goya.c dev_info(hdev->dev, hdev 2133 drivers/misc/habanalabs/goya/goya.c if (hdev->pldm) { hdev 2152 drivers/misc/habanalabs/goya/goya.c goya_stop_external_queues(hdev); hdev 2153 drivers/misc/habanalabs/goya/goya.c goya_stop_internal_queues(hdev); hdev 2157 drivers/misc/habanalabs/goya/goya.c goya_dma_stall(hdev); hdev 2158 drivers/misc/habanalabs/goya/goya.c goya_tpc_stall(hdev); hdev 2159 drivers/misc/habanalabs/goya/goya.c goya_mme_stall(hdev); hdev 2163 drivers/misc/habanalabs/goya/goya.c goya_disable_external_queues(hdev); hdev 2164 drivers/misc/habanalabs/goya/goya.c goya_disable_internal_queues(hdev); hdev 2166 drivers/misc/habanalabs/goya/goya.c goya_disable_timestamp(hdev); hdev 2169 drivers/misc/habanalabs/goya/goya.c goya_disable_msix(hdev); hdev 2170 drivers/misc/habanalabs/goya/goya.c goya_mmu_remove_device_cpu_mappings(hdev); hdev 2172 drivers/misc/habanalabs/goya/goya.c goya_sync_irqs(hdev); hdev 2184 drivers/misc/habanalabs/goya/goya.c static int goya_push_uboot_to_device(struct hl_device *hdev) hdev 2190 drivers/misc/habanalabs/goya/goya.c dst = hdev->pcie_bar[SRAM_CFG_BAR_ID] + UBOOT_FW_OFFSET; hdev 2192 drivers/misc/habanalabs/goya/goya.c return hl_fw_push_fw_to_device(hdev, fw_name, dst); hdev 2203 drivers/misc/habanalabs/goya/goya.c static int goya_push_linux_to_device(struct hl_device *hdev) hdev 2209 drivers/misc/habanalabs/goya/goya.c dst = hdev->pcie_bar[DDR_BAR_ID] + LINUX_FW_OFFSET; hdev 2211 drivers/misc/habanalabs/goya/goya.c return hl_fw_push_fw_to_device(hdev, fw_name, dst); hdev 2214 drivers/misc/habanalabs/goya/goya.c static int goya_pldm_init_cpu(struct hl_device *hdev) hdev 2220 drivers/misc/habanalabs/goya/goya.c goya_init_golden_registers(hdev); hdev 2233 drivers/misc/habanalabs/goya/goya.c rc = goya_push_uboot_to_device(hdev); hdev 2237 drivers/misc/habanalabs/goya/goya.c rc = goya_push_linux_to_device(hdev); hdev 2261 drivers/misc/habanalabs/goya/goya.c static void goya_read_device_fw_version(struct hl_device *hdev, hdev 2271 drivers/misc/habanalabs/goya/goya.c dest = hdev->asic_prop.uboot_ver; hdev 2276 drivers/misc/habanalabs/goya/goya.c dest = hdev->asic_prop.preboot_ver; hdev 2280 drivers/misc/habanalabs/goya/goya.c dev_warn(hdev->dev, "Undefined FW component: %d\n", fwc); hdev 2287 drivers/misc/habanalabs/goya/goya.c memcpy_fromio(dest, hdev->pcie_bar[SRAM_CFG_BAR_ID] + ver_off, hdev 2290 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "%s version offset (0x%x) is above SRAM\n", hdev 2296 drivers/misc/habanalabs/goya/goya.c static int goya_init_cpu(struct hl_device *hdev, u32 cpu_timeout) hdev 2298 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 2302 drivers/misc/habanalabs/goya/goya.c if (!hdev->cpu_enable) hdev 2312 drivers/misc/habanalabs/goya/goya.c if (goya_set_ddr_bar_base(hdev, DRAM_PHYS_BASE) == U64_MAX) { hdev 2313 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2318 drivers/misc/habanalabs/goya/goya.c if (hdev->pldm) { hdev 2319 drivers/misc/habanalabs/goya/goya.c rc = goya_pldm_init_cpu(hdev); hdev 2328 drivers/misc/habanalabs/goya/goya.c hdev, hdev 2337 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Error in ARM u-boot!"); hdev 2340 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2344 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2348 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2352 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2356 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2360 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2364 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2369 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2374 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2383 drivers/misc/habanalabs/goya/goya.c goya_read_device_fw_version(hdev, FW_COMP_UBOOT); hdev 2384 drivers/misc/habanalabs/goya/goya.c goya_read_device_fw_version(hdev, FW_COMP_PREBOOT); hdev 2386 drivers/misc/habanalabs/goya/goya.c if (!hdev->fw_loading) { hdev 2387 drivers/misc/habanalabs/goya/goya.c dev_info(hdev->dev, "Skip loading FW\n"); hdev 2394 drivers/misc/habanalabs/goya/goya.c rc = goya_push_linux_to_device(hdev); hdev 2401 drivers/misc/habanalabs/goya/goya.c hdev, hdev 2410 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2413 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2419 drivers/misc/habanalabs/goya/goya.c dev_info(hdev->dev, "Successfully loaded firmware to device\n"); hdev 2427 drivers/misc/habanalabs/goya/goya.c static int goya_mmu_update_asid_hop0_addr(struct hl_device *hdev, u32 asid, hdev 2433 drivers/misc/habanalabs/goya/goya.c if (hdev->pldm) hdev 2443 drivers/misc/habanalabs/goya/goya.c hdev, hdev 2451 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2459 drivers/misc/habanalabs/goya/goya.c int goya_mmu_init(struct hl_device *hdev) hdev 2461 drivers/misc/habanalabs/goya/goya.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 2462 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 2466 drivers/misc/habanalabs/goya/goya.c if (!hdev->mmu_enable) hdev 2472 drivers/misc/habanalabs/goya/goya.c hdev->dram_supports_virtual_memory = true; hdev 2473 drivers/misc/habanalabs/goya/goya.c hdev->dram_default_page_mapping = true; hdev 2479 drivers/misc/habanalabs/goya/goya.c rc = goya_mmu_update_asid_hop0_addr(hdev, i, hop0_addr); hdev 2481 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2498 drivers/misc/habanalabs/goya/goya.c hdev->asic_funcs->mmu_invalidate_cache(hdev, true); hdev 2517 drivers/misc/habanalabs/goya/goya.c static int goya_hw_init(struct hl_device *hdev) hdev 2519 drivers/misc/habanalabs/goya/goya.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 2522 drivers/misc/habanalabs/goya/goya.c dev_info(hdev->dev, "Starting initialization of H/W\n"); hdev 2535 drivers/misc/habanalabs/goya/goya.c rc = goya_init_cpu(hdev, GOYA_CPU_TIMEOUT_USEC); hdev 2537 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to initialize CPU\n"); hdev 2541 drivers/misc/habanalabs/goya/goya.c goya_tpc_mbist_workaround(hdev); hdev 2543 drivers/misc/habanalabs/goya/goya.c goya_init_golden_registers(hdev); hdev 2549 drivers/misc/habanalabs/goya/goya.c if (goya_set_ddr_bar_base(hdev, DRAM_PHYS_BASE + hdev 2552 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2557 drivers/misc/habanalabs/goya/goya.c rc = goya_mmu_init(hdev); hdev 2561 drivers/misc/habanalabs/goya/goya.c goya_init_security(hdev); hdev 2563 drivers/misc/habanalabs/goya/goya.c goya_init_dma_qmans(hdev); hdev 2565 drivers/misc/habanalabs/goya/goya.c goya_init_mme_qmans(hdev); hdev 2567 drivers/misc/habanalabs/goya/goya.c goya_init_tpc_qmans(hdev); hdev 2569 drivers/misc/habanalabs/goya/goya.c goya_enable_timestamp(hdev); hdev 2572 drivers/misc/habanalabs/goya/goya.c rc = goya_enable_msix(hdev); hdev 2582 drivers/misc/habanalabs/goya/goya.c goya_disable_internal_queues(hdev); hdev 2583 drivers/misc/habanalabs/goya/goya.c goya_disable_external_queues(hdev); hdev 2595 drivers/misc/habanalabs/goya/goya.c static void goya_hw_fini(struct hl_device *hdev, bool hard_reset) hdev 2597 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 2600 drivers/misc/habanalabs/goya/goya.c if (hdev->pldm) hdev 2606 drivers/misc/habanalabs/goya/goya.c goya_set_ddr_bar_base(hdev, DRAM_PHYS_BASE); hdev 2607 drivers/misc/habanalabs/goya/goya.c goya_disable_clk_rlx(hdev); hdev 2608 drivers/misc/habanalabs/goya/goya.c goya_set_pll_refclk(hdev); hdev 2611 drivers/misc/habanalabs/goya/goya.c dev_info(hdev->dev, hdev 2616 drivers/misc/habanalabs/goya/goya.c dev_info(hdev->dev, hdev 2630 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2656 drivers/misc/habanalabs/goya/goya.c if (!hdev->pldm) { hdev 2664 drivers/misc/habanalabs/goya/goya.c dev_info(hdev->dev, hdev 2669 drivers/misc/habanalabs/goya/goya.c hdev, hdev 2676 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2681 drivers/misc/habanalabs/goya/goya.c int goya_suspend(struct hl_device *hdev) hdev 2685 drivers/misc/habanalabs/goya/goya.c rc = hl_fw_send_pci_access_msg(hdev, ARMCP_PACKET_DISABLE_PCI_ACCESS); hdev 2687 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Failed to disable PCI access from CPU\n"); hdev 2692 drivers/misc/habanalabs/goya/goya.c int goya_resume(struct hl_device *hdev) hdev 2694 drivers/misc/habanalabs/goya/goya.c return goya_init_iatu(hdev); hdev 2697 drivers/misc/habanalabs/goya/goya.c static int goya_cb_mmap(struct hl_device *hdev, struct vm_area_struct *vma, hdev 2708 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "remap_pfn_range error %d", rc); hdev 2713 drivers/misc/habanalabs/goya/goya.c void goya_ring_doorbell(struct hl_device *hdev, u32 hw_queue_id, u32 pi) hdev 2780 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "H/W queue %d is invalid. Can't set pi\n", hdev 2795 drivers/misc/habanalabs/goya/goya.c void goya_pqe_write(struct hl_device *hdev, __le64 *pqe, struct hl_bd *bd) hdev 2801 drivers/misc/habanalabs/goya/goya.c static void *goya_dma_alloc_coherent(struct hl_device *hdev, size_t size, hdev 2804 drivers/misc/habanalabs/goya/goya.c void *kernel_addr = dma_alloc_coherent(&hdev->pdev->dev, size, hdev 2814 drivers/misc/habanalabs/goya/goya.c static void goya_dma_free_coherent(struct hl_device *hdev, size_t size, hdev 2820 drivers/misc/habanalabs/goya/goya.c dma_free_coherent(&hdev->pdev->dev, size, cpu_addr, fixed_dma_handle); hdev 2823 drivers/misc/habanalabs/goya/goya.c void *goya_get_int_queue_base(struct hl_device *hdev, u32 queue_id, hdev 2829 drivers/misc/habanalabs/goya/goya.c *dma_handle = hdev->asic_prop.sram_base_address; hdev 2831 drivers/misc/habanalabs/goya/goya.c base = (void *) hdev->pcie_bar[SRAM_CFG_BAR_ID]; hdev 2871 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Got invalid queue id %d\n", queue_id); hdev 2881 drivers/misc/habanalabs/goya/goya.c static int goya_send_job_on_qman0(struct hl_device *hdev, struct hl_cs_job *job) hdev 2890 drivers/misc/habanalabs/goya/goya.c if (hdev->pldm) hdev 2895 drivers/misc/habanalabs/goya/goya.c if (!hdev->asic_funcs->is_device_idle(hdev, NULL, NULL)) { hdev 2896 drivers/misc/habanalabs/goya/goya.c dev_err_ratelimited(hdev->dev, hdev 2901 drivers/misc/habanalabs/goya/goya.c fence_ptr = hdev->asic_funcs->asic_dma_pool_zalloc(hdev, 4, GFP_KERNEL, hdev 2904 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2909 drivers/misc/habanalabs/goya/goya.c goya_qman0_set_security(hdev, true); hdev 2923 drivers/misc/habanalabs/goya/goya.c rc = hl_hw_queue_send_cb_no_cmpl(hdev, GOYA_QUEUE_ID_DMA_0, hdev 2926 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Failed to send CB on QMAN0, %d\n", rc); hdev 2930 drivers/misc/habanalabs/goya/goya.c rc = hl_poll_timeout_memory(hdev, fence_ptr, tmp, hdev 2934 drivers/misc/habanalabs/goya/goya.c hl_hw_queue_inc_ci_kernel(hdev, GOYA_QUEUE_ID_DMA_0); hdev 2937 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "QMAN0 Job timeout (0x%x)\n", tmp); hdev 2942 drivers/misc/habanalabs/goya/goya.c hdev->asic_funcs->asic_dma_pool_free(hdev, (void *) fence_ptr, hdev 2945 drivers/misc/habanalabs/goya/goya.c goya_qman0_set_security(hdev, false); hdev 2950 drivers/misc/habanalabs/goya/goya.c int goya_send_cpu_message(struct hl_device *hdev, u32 *msg, u16 len, hdev 2953 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 2961 drivers/misc/habanalabs/goya/goya.c return hl_fw_send_cpu_message(hdev, GOYA_QUEUE_ID_CPU_PQ, msg, len, hdev 2965 drivers/misc/habanalabs/goya/goya.c int goya_test_queue(struct hl_device *hdev, u32 hw_queue_id) hdev 2976 drivers/misc/habanalabs/goya/goya.c fence_ptr = hdev->asic_funcs->asic_dma_pool_zalloc(hdev, 4, GFP_KERNEL, hdev 2979 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 2986 drivers/misc/habanalabs/goya/goya.c fence_pkt = hdev->asic_funcs->asic_dma_pool_zalloc(hdev, hdev 2990 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3003 drivers/misc/habanalabs/goya/goya.c rc = hl_hw_queue_send_cb_no_cmpl(hdev, hw_queue_id, hdev 3007 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3012 drivers/misc/habanalabs/goya/goya.c rc = hl_poll_timeout_memory(hdev, fence_ptr, tmp, (tmp == fence_val), hdev 3015 drivers/misc/habanalabs/goya/goya.c hl_hw_queue_inc_ci_kernel(hdev, hw_queue_id); hdev 3018 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3023 drivers/misc/habanalabs/goya/goya.c dev_info(hdev->dev, "queue test on H/W queue %d succeeded\n", hdev 3028 drivers/misc/habanalabs/goya/goya.c hdev->asic_funcs->asic_dma_pool_free(hdev, (void *) fence_pkt, hdev 3031 drivers/misc/habanalabs/goya/goya.c hdev->asic_funcs->asic_dma_pool_free(hdev, (void *) fence_ptr, hdev 3036 drivers/misc/habanalabs/goya/goya.c int goya_test_cpu_queue(struct hl_device *hdev) hdev 3038 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 3047 drivers/misc/habanalabs/goya/goya.c return hl_fw_test_cpu_queue(hdev); hdev 3050 drivers/misc/habanalabs/goya/goya.c int goya_test_queues(struct hl_device *hdev) hdev 3055 drivers/misc/habanalabs/goya/goya.c rc = goya_test_queue(hdev, i); hdev 3063 drivers/misc/habanalabs/goya/goya.c static void *goya_dma_pool_zalloc(struct hl_device *hdev, size_t size, hdev 3071 drivers/misc/habanalabs/goya/goya.c kernel_addr = dma_pool_zalloc(hdev->dma_pool, mem_flags, dma_handle); hdev 3080 drivers/misc/habanalabs/goya/goya.c static void goya_dma_pool_free(struct hl_device *hdev, void *vaddr, hdev 3086 drivers/misc/habanalabs/goya/goya.c dma_pool_free(hdev->dma_pool, vaddr, fixed_dma_addr); hdev 3089 drivers/misc/habanalabs/goya/goya.c void *goya_cpu_accessible_dma_pool_alloc(struct hl_device *hdev, size_t size, hdev 3094 drivers/misc/habanalabs/goya/goya.c vaddr = hl_fw_cpu_accessible_dma_pool_alloc(hdev, size, dma_handle); hdev 3095 drivers/misc/habanalabs/goya/goya.c *dma_handle = (*dma_handle) - hdev->cpu_accessible_dma_address + hdev 3101 drivers/misc/habanalabs/goya/goya.c void goya_cpu_accessible_dma_pool_free(struct hl_device *hdev, size_t size, hdev 3104 drivers/misc/habanalabs/goya/goya.c hl_fw_cpu_accessible_dma_pool_free(hdev, size, vaddr); hdev 3107 drivers/misc/habanalabs/goya/goya.c static int goya_dma_map_sg(struct hl_device *hdev, struct scatterlist *sgl, hdev 3113 drivers/misc/habanalabs/goya/goya.c if (!dma_map_sg(&hdev->pdev->dev, sgl, nents, dir)) hdev 3123 drivers/misc/habanalabs/goya/goya.c static void goya_dma_unmap_sg(struct hl_device *hdev, struct scatterlist *sgl, hdev 3133 drivers/misc/habanalabs/goya/goya.c dma_unmap_sg(&hdev->pdev->dev, sgl, nents, dir); hdev 3136 drivers/misc/habanalabs/goya/goya.c u32 goya_get_dma_desc_list_size(struct hl_device *hdev, struct sg_table *sgt) hdev 3177 drivers/misc/habanalabs/goya/goya.c static int goya_pin_memory_before_cs(struct hl_device *hdev, hdev 3185 drivers/misc/habanalabs/goya/goya.c if (hl_userptr_is_pinned(hdev, addr, le32_to_cpu(user_dma_pkt->tsize), hdev 3193 drivers/misc/habanalabs/goya/goya.c rc = hl_pin_host_memory(hdev, addr, le32_to_cpu(user_dma_pkt->tsize), hdev 3200 drivers/misc/habanalabs/goya/goya.c rc = hdev->asic_funcs->asic_dma_map_sg(hdev, userptr->sgt->sgl, hdev 3203 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to map sgt with DMA region\n"); hdev 3212 drivers/misc/habanalabs/goya/goya.c goya_get_dma_desc_list_size(hdev, userptr->sgt); hdev 3217 drivers/misc/habanalabs/goya/goya.c hl_unpin_host_memory(hdev, userptr); hdev 3223 drivers/misc/habanalabs/goya/goya.c static int goya_validate_dma_pkt_host(struct hl_device *hdev, hdev 3246 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "DMA direction is HOST --> DRAM\n"); hdev 3256 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "DMA direction is DRAM --> HOST\n"); hdev 3264 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "DMA direction is HOST --> SRAM\n"); hdev 3273 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "DMA direction is SRAM --> HOST\n"); hdev 3279 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "DMA direction is undefined\n"); hdev 3286 drivers/misc/habanalabs/goya/goya.c hdev->asic_prop.sram_user_base_address, hdev 3287 drivers/misc/habanalabs/goya/goya.c hdev->asic_prop.sram_end_address)) { hdev 3289 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3298 drivers/misc/habanalabs/goya/goya.c hdev->asic_prop.dram_user_base_address, hdev 3299 drivers/misc/habanalabs/goya/goya.c hdev->asic_prop.dram_end_address)) { hdev 3301 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3314 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3319 drivers/misc/habanalabs/goya/goya.c rc = goya_pin_memory_before_cs(hdev, parser, user_dma_pkt, hdev 3326 drivers/misc/habanalabs/goya/goya.c static int goya_validate_dma_pkt_no_host(struct hl_device *hdev, hdev 3339 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "DMA direction is DRAM --> SRAM\n"); hdev 3343 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "DMA direction is SRAM --> DRAM\n"); hdev 3350 drivers/misc/habanalabs/goya/goya.c hdev->asic_prop.sram_user_base_address, hdev 3351 drivers/misc/habanalabs/goya/goya.c hdev->asic_prop.sram_end_address)) { hdev 3352 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "SRAM address 0x%llx + 0x%x is invalid\n", hdev 3359 drivers/misc/habanalabs/goya/goya.c hdev->asic_prop.dram_user_base_address, hdev 3360 drivers/misc/habanalabs/goya/goya.c hdev->asic_prop.dram_end_address)) { hdev 3361 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "DRAM address 0x%llx + 0x%x is invalid\n", hdev 3371 drivers/misc/habanalabs/goya/goya.c static int goya_validate_dma_pkt_no_mmu(struct hl_device *hdev, hdev 3379 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "DMA packet details:\n"); hdev 3380 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "source == 0x%llx\n", hdev 3382 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "destination == 0x%llx\n", hdev 3384 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "size == %u\n", le32_to_cpu(user_dma_pkt->tsize)); hdev 3395 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3401 drivers/misc/habanalabs/goya/goya.c rc = goya_validate_dma_pkt_no_host(hdev, parser, user_dma_pkt); hdev 3403 drivers/misc/habanalabs/goya/goya.c rc = goya_validate_dma_pkt_host(hdev, parser, user_dma_pkt); hdev 3408 drivers/misc/habanalabs/goya/goya.c static int goya_validate_dma_pkt_mmu(struct hl_device *hdev, hdev 3412 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "DMA packet details:\n"); hdev 3413 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "source == 0x%llx\n", hdev 3415 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "destination == 0x%llx\n", hdev 3417 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "size == %u\n", le32_to_cpu(user_dma_pkt->tsize)); hdev 3426 drivers/misc/habanalabs/goya/goya.c hdev->asic_prop.va_space_host_start_address, hdev 3427 drivers/misc/habanalabs/goya/goya.c hdev->asic_prop.va_space_host_end_address)) { hdev 3428 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3434 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3444 drivers/misc/habanalabs/goya/goya.c static int goya_validate_wreg32(struct hl_device *hdev, hdev 3448 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 3455 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "WREG32 packet details:\n"); hdev 3456 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "reg_offset == 0x%x\n", reg_offset); hdev 3457 drivers/misc/habanalabs/goya/goya.c dev_dbg(hdev->dev, "value == 0x%x\n", hdev 3461 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "WREG32 packet with illegal address 0x%x\n", hdev 3480 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "WREG32 packet with illegal value 0x%x\n", hdev 3488 drivers/misc/habanalabs/goya/goya.c static int goya_validate_cb(struct hl_device *hdev, hdev 3513 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3526 drivers/misc/habanalabs/goya/goya.c rc = goya_validate_wreg32(hdev, hdev 3531 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3537 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3543 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "User not allowed to use CP_DMA\n"); hdev 3548 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "User not allowed to use STOP\n"); hdev 3554 drivers/misc/habanalabs/goya/goya.c rc = goya_validate_dma_pkt_mmu(hdev, parser, hdev 3557 drivers/misc/habanalabs/goya/goya.c rc = goya_validate_dma_pkt_no_mmu(hdev, parser, hdev 3569 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Invalid packet header 0x%x\n", hdev 3589 drivers/misc/habanalabs/goya/goya.c static int goya_patch_dma_packet(struct hl_device *hdev, hdev 3636 drivers/misc/habanalabs/goya/goya.c (hl_userptr_is_pinned(hdev, addr, hdev 3639 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Userptr 0x%llx + 0x%x NOT mapped\n", hdev 3705 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3719 drivers/misc/habanalabs/goya/goya.c static int goya_patch_cb(struct hl_device *hdev, hdev 3747 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3755 drivers/misc/habanalabs/goya/goya.c rc = goya_patch_dma_packet(hdev, parser, hdev 3765 drivers/misc/habanalabs/goya/goya.c rc = goya_validate_wreg32(hdev, parser, hdev 3770 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3776 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3782 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "User not allowed to use CP_DMA\n"); hdev 3787 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "User not allowed to use STOP\n"); hdev 3800 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Invalid packet header 0x%x\n", hdev 3813 drivers/misc/habanalabs/goya/goya.c static int goya_parse_cb_mmu(struct hl_device *hdev, hdev 3829 drivers/misc/habanalabs/goya/goya.c rc = hl_cb_create(hdev, &hdev->kernel_cb_mgr, hdev 3834 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3841 drivers/misc/habanalabs/goya/goya.c parser->patched_cb = hl_cb_get(hdev, &hdev->kernel_cb_mgr, hdev 3864 drivers/misc/habanalabs/goya/goya.c rc = goya_validate_cb(hdev, parser, true); hdev 3873 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "user CB size mismatch\n"); hdev 3886 drivers/misc/habanalabs/goya/goya.c hl_cb_destroy(hdev, &hdev->kernel_cb_mgr, hdev 3892 drivers/misc/habanalabs/goya/goya.c static int goya_parse_cb_no_mmu(struct hl_device *hdev, hdev 3898 drivers/misc/habanalabs/goya/goya.c rc = goya_validate_cb(hdev, parser, false); hdev 3903 drivers/misc/habanalabs/goya/goya.c rc = hl_cb_create(hdev, &hdev->kernel_cb_mgr, hdev 3907 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3913 drivers/misc/habanalabs/goya/goya.c parser->patched_cb = hl_cb_get(hdev, &hdev->kernel_cb_mgr, hdev 3923 drivers/misc/habanalabs/goya/goya.c rc = goya_patch_cb(hdev, parser); hdev 3935 drivers/misc/habanalabs/goya/goya.c hl_cb_destroy(hdev, &hdev->kernel_cb_mgr, hdev 3940 drivers/misc/habanalabs/goya/goya.c hl_userptr_delete_list(hdev, parser->job_userptr_list); hdev 3944 drivers/misc/habanalabs/goya/goya.c static int goya_parse_cb_no_ext_queue(struct hl_device *hdev, hdev 3947 drivers/misc/habanalabs/goya/goya.c struct asic_fixed_properties *asic_prop = &hdev->asic_prop; hdev 3948 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 3968 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 3975 drivers/misc/habanalabs/goya/goya.c int goya_cs_parser(struct hl_device *hdev, struct hl_cs_parser *parser) hdev 3977 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 3980 drivers/misc/habanalabs/goya/goya.c return goya_parse_cb_no_ext_queue(hdev, parser); hdev 3983 drivers/misc/habanalabs/goya/goya.c return goya_parse_cb_mmu(hdev, parser); hdev 3985 drivers/misc/habanalabs/goya/goya.c return goya_parse_cb_no_mmu(hdev, parser); hdev 3988 drivers/misc/habanalabs/goya/goya.c void goya_add_end_of_cb_packets(struct hl_device *hdev, u64 kernel_address, hdev 4013 drivers/misc/habanalabs/goya/goya.c void goya_update_eq_ci(struct hl_device *hdev, u32 val) hdev 4018 drivers/misc/habanalabs/goya/goya.c void goya_restore_phase_topology(struct hl_device *hdev) hdev 4023 drivers/misc/habanalabs/goya/goya.c static void goya_clear_sm_regs(struct hl_device *hdev) hdev 4058 drivers/misc/habanalabs/goya/goya.c static int goya_debugfs_read32(struct hl_device *hdev, u64 addr, u32 *val) hdev 4060 drivers/misc/habanalabs/goya/goya.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 4070 drivers/misc/habanalabs/goya/goya.c *val = readl(hdev->pcie_bar[SRAM_CFG_BAR_ID] + hdev 4074 drivers/misc/habanalabs/goya/goya.c (addr < DRAM_PHYS_BASE + hdev->asic_prop.dram_size)) { hdev 4079 drivers/misc/habanalabs/goya/goya.c ddr_bar_addr = goya_set_ddr_bar_base(hdev, bar_base_addr); hdev 4081 drivers/misc/habanalabs/goya/goya.c *val = readl(hdev->pcie_bar[DDR_BAR_ID] + hdev 4084 drivers/misc/habanalabs/goya/goya.c ddr_bar_addr = goya_set_ddr_bar_base(hdev, hdev 4115 drivers/misc/habanalabs/goya/goya.c static int goya_debugfs_write32(struct hl_device *hdev, u64 addr, u32 val) hdev 4117 drivers/misc/habanalabs/goya/goya.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 4127 drivers/misc/habanalabs/goya/goya.c writel(val, hdev->pcie_bar[SRAM_CFG_BAR_ID] + hdev 4131 drivers/misc/habanalabs/goya/goya.c (addr < DRAM_PHYS_BASE + hdev->asic_prop.dram_size)) { hdev 4136 drivers/misc/habanalabs/goya/goya.c ddr_bar_addr = goya_set_ddr_bar_base(hdev, bar_base_addr); hdev 4138 drivers/misc/habanalabs/goya/goya.c writel(val, hdev->pcie_bar[DDR_BAR_ID] + hdev 4141 drivers/misc/habanalabs/goya/goya.c ddr_bar_addr = goya_set_ddr_bar_base(hdev, hdev 4157 drivers/misc/habanalabs/goya/goya.c static u64 goya_read_pte(struct hl_device *hdev, u64 addr) hdev 4159 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 4161 drivers/misc/habanalabs/goya/goya.c if (hdev->hard_reset_pending) hdev 4164 drivers/misc/habanalabs/goya/goya.c return readq(hdev->pcie_bar[DDR_BAR_ID] + hdev 4168 drivers/misc/habanalabs/goya/goya.c static void goya_write_pte(struct hl_device *hdev, u64 addr, u64 val) hdev 4170 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 4172 drivers/misc/habanalabs/goya/goya.c if (hdev->hard_reset_pending) hdev 4175 drivers/misc/habanalabs/goya/goya.c writeq(val, hdev->pcie_bar[DDR_BAR_ID] + hdev 4364 drivers/misc/habanalabs/goya/goya.c static void goya_print_razwi_info(struct hl_device *hdev) hdev 4367 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Illegal write to LBW\n"); hdev 4372 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Illegal read from LBW\n"); hdev 4377 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Illegal write to HBW\n"); hdev 4382 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Illegal read from HBW\n"); hdev 4387 drivers/misc/habanalabs/goya/goya.c static void goya_print_mmu_error_info(struct hl_device *hdev) hdev 4389 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 4402 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "MMU page fault on va 0x%llx\n", addr); hdev 4408 drivers/misc/habanalabs/goya/goya.c static void goya_print_irq_info(struct hl_device *hdev, u16 event_type, hdev 4414 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Received H/W interrupt %d [\"%s\"]\n", hdev 4418 drivers/misc/habanalabs/goya/goya.c goya_print_razwi_info(hdev); hdev 4419 drivers/misc/habanalabs/goya/goya.c goya_print_mmu_error_info(hdev); hdev 4423 drivers/misc/habanalabs/goya/goya.c static int goya_unmask_irq_arr(struct hl_device *hdev, u32 *irq_arr, hdev 4441 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "too many elements in IRQ array\n"); hdev 4463 drivers/misc/habanalabs/goya/goya.c rc = goya_send_cpu_message(hdev, (u32 *) pkt, total_pkt_size, hdev 4467 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to unmask IRQ array\n"); hdev 4474 drivers/misc/habanalabs/goya/goya.c static int goya_soft_reset_late_init(struct hl_device *hdev) hdev 4480 drivers/misc/habanalabs/goya/goya.c return goya_unmask_irq_arr(hdev, goya_all_events, hdev 4484 drivers/misc/habanalabs/goya/goya.c static int goya_unmask_irq(struct hl_device *hdev, u16 event_type) hdev 4496 drivers/misc/habanalabs/goya/goya.c rc = goya_send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 4500 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "failed to unmask RAZWI IRQ %d", event_type); hdev 4505 drivers/misc/habanalabs/goya/goya.c void goya_handle_eqe(struct hl_device *hdev, struct hl_eq_entry *eq_entry) hdev 4510 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 4539 drivers/misc/habanalabs/goya/goya.c goya_print_irq_info(hdev, event_type, false); hdev 4540 drivers/misc/habanalabs/goya/goya.c hl_device_reset(hdev, true, false); hdev 4570 drivers/misc/habanalabs/goya/goya.c goya_print_irq_info(hdev, event_type, true); hdev 4571 drivers/misc/habanalabs/goya/goya.c goya_unmask_irq(hdev, event_type); hdev 4584 drivers/misc/habanalabs/goya/goya.c goya_print_irq_info(hdev, event_type, false); hdev 4585 drivers/misc/habanalabs/goya/goya.c goya_unmask_irq(hdev, event_type); hdev 4589 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Received invalid H/W interrupt %d\n", hdev 4595 drivers/misc/habanalabs/goya/goya.c void *goya_get_events_stat(struct hl_device *hdev, bool aggregate, u32 *size) hdev 4597 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 4608 drivers/misc/habanalabs/goya/goya.c static int goya_memset_device_memory(struct hl_device *hdev, u64 addr, u64 size, hdev 4620 drivers/misc/habanalabs/goya/goya.c cb = hl_cb_kernel_create(hdev, cb_size); hdev 4650 drivers/misc/habanalabs/goya/goya.c job = hl_cs_allocate_job(hdev, true); hdev 4652 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Failed to allocate a new job\n"); hdev 4665 drivers/misc/habanalabs/goya/goya.c hl_debugfs_add_job(hdev, job); hdev 4667 drivers/misc/habanalabs/goya/goya.c rc = goya_send_job_on_qman0(hdev, job); hdev 4669 drivers/misc/habanalabs/goya/goya.c hl_debugfs_remove_job(hdev, job); hdev 4675 drivers/misc/habanalabs/goya/goya.c hl_cb_destroy(hdev, &hdev->kernel_cb_mgr, cb->id << PAGE_SHIFT); hdev 4680 drivers/misc/habanalabs/goya/goya.c int goya_context_switch(struct hl_device *hdev, u32 asid) hdev 4682 drivers/misc/habanalabs/goya/goya.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 4684 drivers/misc/habanalabs/goya/goya.c u32 size = hdev->pldm ? 0x10000 : prop->sram_size; hdev 4690 drivers/misc/habanalabs/goya/goya.c rc = goya_memset_device_memory(hdev, addr, size, val, false); hdev 4692 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Failed to clear SRAM in context switch\n"); hdev 4709 drivers/misc/habanalabs/goya/goya.c goya_mmu_prepare(hdev, asid); hdev 4711 drivers/misc/habanalabs/goya/goya.c goya_clear_sm_regs(hdev); hdev 4716 drivers/misc/habanalabs/goya/goya.c static int goya_mmu_clear_pgt_range(struct hl_device *hdev) hdev 4718 drivers/misc/habanalabs/goya/goya.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 4719 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 4727 drivers/misc/habanalabs/goya/goya.c return goya_memset_device_memory(hdev, addr, size, 0, true); hdev 4730 drivers/misc/habanalabs/goya/goya.c static int goya_mmu_set_dram_default_page(struct hl_device *hdev) hdev 4732 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 4733 drivers/misc/habanalabs/goya/goya.c u64 addr = hdev->asic_prop.mmu_dram_default_page_addr; hdev 4740 drivers/misc/habanalabs/goya/goya.c return goya_memset_device_memory(hdev, addr, size, val, true); hdev 4743 drivers/misc/habanalabs/goya/goya.c static int goya_mmu_add_mappings_for_device_cpu(struct hl_device *hdev) hdev 4745 drivers/misc/habanalabs/goya/goya.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 4746 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 4754 drivers/misc/habanalabs/goya/goya.c rc = hl_mmu_map(hdev->kernel_ctx, prop->dram_base_address + off, hdev 4757 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, "Map failed for address 0x%llx\n", hdev 4763 drivers/misc/habanalabs/goya/goya.c if (!(hdev->cpu_accessible_dma_address & (PAGE_SIZE_2MB - 1))) { hdev 4764 drivers/misc/habanalabs/goya/goya.c rc = hl_mmu_map(hdev->kernel_ctx, VA_CPU_ACCESSIBLE_MEM_ADDR, hdev 4765 drivers/misc/habanalabs/goya/goya.c hdev->cpu_accessible_dma_address, PAGE_SIZE_2MB); hdev 4768 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 4775 drivers/misc/habanalabs/goya/goya.c rc = hl_mmu_map(hdev->kernel_ctx, hdev 4777 drivers/misc/habanalabs/goya/goya.c hdev->cpu_accessible_dma_address + cpu_off, hdev 4780 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 4788 drivers/misc/habanalabs/goya/goya.c goya_mmu_prepare_reg(hdev, mmCPU_IF_ARUSER_OVR, HL_KERNEL_ASID_ID); hdev 4789 drivers/misc/habanalabs/goya/goya.c goya_mmu_prepare_reg(hdev, mmCPU_IF_AWUSER_OVR, HL_KERNEL_ASID_ID); hdev 4802 drivers/misc/habanalabs/goya/goya.c if (hl_mmu_unmap(hdev->kernel_ctx, hdev 4805 drivers/misc/habanalabs/goya/goya.c dev_warn_ratelimited(hdev->dev, hdev 4810 drivers/misc/habanalabs/goya/goya.c if (hl_mmu_unmap(hdev->kernel_ctx, hdev 4812 drivers/misc/habanalabs/goya/goya.c dev_warn_ratelimited(hdev->dev, hdev 4819 drivers/misc/habanalabs/goya/goya.c void goya_mmu_remove_device_cpu_mappings(struct hl_device *hdev) hdev 4821 drivers/misc/habanalabs/goya/goya.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 4822 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 4834 drivers/misc/habanalabs/goya/goya.c if (!(hdev->cpu_accessible_dma_address & (PAGE_SIZE_2MB - 1))) { hdev 4835 drivers/misc/habanalabs/goya/goya.c if (hl_mmu_unmap(hdev->kernel_ctx, VA_CPU_ACCESSIBLE_MEM_ADDR, hdev 4837 drivers/misc/habanalabs/goya/goya.c dev_warn(hdev->dev, hdev 4841 drivers/misc/habanalabs/goya/goya.c if (hl_mmu_unmap(hdev->kernel_ctx, hdev 4844 drivers/misc/habanalabs/goya/goya.c dev_warn_ratelimited(hdev->dev, hdev 4850 drivers/misc/habanalabs/goya/goya.c if (hl_mmu_unmap(hdev->kernel_ctx, hdev 4852 drivers/misc/habanalabs/goya/goya.c dev_warn_ratelimited(hdev->dev, hdev 4859 drivers/misc/habanalabs/goya/goya.c static void goya_mmu_prepare(struct hl_device *hdev, u32 asid) hdev 4861 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 4874 drivers/misc/habanalabs/goya/goya.c goya_mmu_prepare_reg(hdev, goya_mmu_regs[i], asid); hdev 4877 drivers/misc/habanalabs/goya/goya.c static void goya_mmu_invalidate_cache(struct hl_device *hdev, bool is_hard) hdev 4879 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 4890 drivers/misc/habanalabs/goya/goya.c if (hdev->pldm) hdev 4895 drivers/misc/habanalabs/goya/goya.c mutex_lock(&hdev->mmu_cache_lock); hdev 4901 drivers/misc/habanalabs/goya/goya.c hdev, hdev 4908 drivers/misc/habanalabs/goya/goya.c mutex_unlock(&hdev->mmu_cache_lock); hdev 4911 drivers/misc/habanalabs/goya/goya.c dev_notice_ratelimited(hdev->dev, hdev 4915 drivers/misc/habanalabs/goya/goya.c static void goya_mmu_invalidate_cache_range(struct hl_device *hdev, hdev 4918 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 4929 drivers/misc/habanalabs/goya/goya.c if (hdev->pldm) hdev 4934 drivers/misc/habanalabs/goya/goya.c mutex_lock(&hdev->mmu_cache_lock); hdev 4951 drivers/misc/habanalabs/goya/goya.c hdev, hdev 4958 drivers/misc/habanalabs/goya/goya.c mutex_unlock(&hdev->mmu_cache_lock); hdev 4961 drivers/misc/habanalabs/goya/goya.c dev_notice_ratelimited(hdev->dev, hdev 4965 drivers/misc/habanalabs/goya/goya.c int goya_send_heartbeat(struct hl_device *hdev) hdev 4967 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 4972 drivers/misc/habanalabs/goya/goya.c return hl_fw_send_heartbeat(hdev); hdev 4975 drivers/misc/habanalabs/goya/goya.c int goya_armcp_info_get(struct hl_device *hdev) hdev 4977 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 4978 drivers/misc/habanalabs/goya/goya.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 4985 drivers/misc/habanalabs/goya/goya.c rc = hl_fw_armcp_info_get(hdev); hdev 4993 drivers/misc/habanalabs/goya/goya.c dev_err(hdev->dev, hdev 5010 drivers/misc/habanalabs/goya/goya.c static bool goya_is_device_idle(struct hl_device *hdev, u32 *mask, hdev 5088 drivers/misc/habanalabs/goya/goya.c static void goya_hw_queues_lock(struct hl_device *hdev) hdev 5090 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 5095 drivers/misc/habanalabs/goya/goya.c static void goya_hw_queues_unlock(struct hl_device *hdev) hdev 5097 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 5102 drivers/misc/habanalabs/goya/goya.c static u32 goya_get_pci_id(struct hl_device *hdev) hdev 5104 drivers/misc/habanalabs/goya/goya.c return hdev->pdev->device; hdev 5107 drivers/misc/habanalabs/goya/goya.c static int goya_get_eeprom_data(struct hl_device *hdev, void *data, hdev 5110 drivers/misc/habanalabs/goya/goya.c struct goya_device *goya = hdev->asic_specific; hdev 5115 drivers/misc/habanalabs/goya/goya.c return hl_fw_get_eeprom_data(hdev, data, max_size); hdev 5118 drivers/misc/habanalabs/goya/goya.c static enum hl_device_hw_state goya_get_hw_state(struct hl_device *hdev) hdev 5188 drivers/misc/habanalabs/goya/goya.c void goya_set_asic_funcs(struct hl_device *hdev) hdev 5190 drivers/misc/habanalabs/goya/goya.c hdev->asic_funcs = &goya_funcs; hdev 172 drivers/misc/habanalabs/goya/goyaP.h void goya_get_fixed_properties(struct hl_device *hdev); hdev 173 drivers/misc/habanalabs/goya/goyaP.h int goya_mmu_init(struct hl_device *hdev); hdev 174 drivers/misc/habanalabs/goya/goyaP.h void goya_init_dma_qmans(struct hl_device *hdev); hdev 175 drivers/misc/habanalabs/goya/goyaP.h void goya_init_mme_qmans(struct hl_device *hdev); hdev 176 drivers/misc/habanalabs/goya/goyaP.h void goya_init_tpc_qmans(struct hl_device *hdev); hdev 177 drivers/misc/habanalabs/goya/goyaP.h int goya_init_cpu_queues(struct hl_device *hdev); hdev 178 drivers/misc/habanalabs/goya/goyaP.h void goya_init_security(struct hl_device *hdev); hdev 179 drivers/misc/habanalabs/goya/goyaP.h int goya_late_init(struct hl_device *hdev); hdev 180 drivers/misc/habanalabs/goya/goyaP.h void goya_late_fini(struct hl_device *hdev); hdev 182 drivers/misc/habanalabs/goya/goyaP.h void goya_ring_doorbell(struct hl_device *hdev, u32 hw_queue_id, u32 pi); hdev 183 drivers/misc/habanalabs/goya/goyaP.h void goya_pqe_write(struct hl_device *hdev, __le64 *pqe, struct hl_bd *bd); hdev 184 drivers/misc/habanalabs/goya/goyaP.h void goya_update_eq_ci(struct hl_device *hdev, u32 val); hdev 185 drivers/misc/habanalabs/goya/goyaP.h void goya_restore_phase_topology(struct hl_device *hdev); hdev 186 drivers/misc/habanalabs/goya/goyaP.h int goya_context_switch(struct hl_device *hdev, u32 asid); hdev 188 drivers/misc/habanalabs/goya/goyaP.h int goya_debugfs_i2c_read(struct hl_device *hdev, u8 i2c_bus, hdev 190 drivers/misc/habanalabs/goya/goyaP.h int goya_debugfs_i2c_write(struct hl_device *hdev, u8 i2c_bus, hdev 192 drivers/misc/habanalabs/goya/goyaP.h void goya_debugfs_led_set(struct hl_device *hdev, u8 led, u8 state); hdev 194 drivers/misc/habanalabs/goya/goyaP.h int goya_test_queue(struct hl_device *hdev, u32 hw_queue_id); hdev 195 drivers/misc/habanalabs/goya/goyaP.h int goya_test_queues(struct hl_device *hdev); hdev 196 drivers/misc/habanalabs/goya/goyaP.h int goya_test_cpu_queue(struct hl_device *hdev); hdev 197 drivers/misc/habanalabs/goya/goyaP.h int goya_send_cpu_message(struct hl_device *hdev, u32 *msg, u16 len, hdev 200 drivers/misc/habanalabs/goya/goyaP.h long goya_get_temperature(struct hl_device *hdev, int sensor_index, u32 attr); hdev 201 drivers/misc/habanalabs/goya/goyaP.h long goya_get_voltage(struct hl_device *hdev, int sensor_index, u32 attr); hdev 202 drivers/misc/habanalabs/goya/goyaP.h long goya_get_current(struct hl_device *hdev, int sensor_index, u32 attr); hdev 203 drivers/misc/habanalabs/goya/goyaP.h long goya_get_fan_speed(struct hl_device *hdev, int sensor_index, u32 attr); hdev 204 drivers/misc/habanalabs/goya/goyaP.h long goya_get_pwm_info(struct hl_device *hdev, int sensor_index, u32 attr); hdev 205 drivers/misc/habanalabs/goya/goyaP.h void goya_set_pwm_info(struct hl_device *hdev, int sensor_index, u32 attr, hdev 207 drivers/misc/habanalabs/goya/goyaP.h u64 goya_get_max_power(struct hl_device *hdev); hdev 208 drivers/misc/habanalabs/goya/goyaP.h void goya_set_max_power(struct hl_device *hdev, u64 value); hdev 210 drivers/misc/habanalabs/goya/goyaP.h void goya_set_pll_profile(struct hl_device *hdev, enum hl_pll_frequency freq); hdev 211 drivers/misc/habanalabs/goya/goyaP.h void goya_add_device_attr(struct hl_device *hdev, hdev 213 drivers/misc/habanalabs/goya/goyaP.h int goya_armcp_info_get(struct hl_device *hdev); hdev 214 drivers/misc/habanalabs/goya/goyaP.h int goya_debug_coresight(struct hl_device *hdev, void *data); hdev 215 drivers/misc/habanalabs/goya/goyaP.h void goya_halt_coresight(struct hl_device *hdev); hdev 217 drivers/misc/habanalabs/goya/goyaP.h int goya_suspend(struct hl_device *hdev); hdev 218 drivers/misc/habanalabs/goya/goyaP.h int goya_resume(struct hl_device *hdev); hdev 220 drivers/misc/habanalabs/goya/goyaP.h void goya_handle_eqe(struct hl_device *hdev, struct hl_eq_entry *eq_entry); hdev 221 drivers/misc/habanalabs/goya/goyaP.h void *goya_get_events_stat(struct hl_device *hdev, bool aggregate, u32 *size); hdev 223 drivers/misc/habanalabs/goya/goyaP.h void goya_add_end_of_cb_packets(struct hl_device *hdev, u64 kernel_address, hdev 225 drivers/misc/habanalabs/goya/goyaP.h int goya_cs_parser(struct hl_device *hdev, struct hl_cs_parser *parser); hdev 226 drivers/misc/habanalabs/goya/goyaP.h void *goya_get_int_queue_base(struct hl_device *hdev, u32 queue_id, hdev 228 drivers/misc/habanalabs/goya/goyaP.h u32 goya_get_dma_desc_list_size(struct hl_device *hdev, struct sg_table *sgt); hdev 229 drivers/misc/habanalabs/goya/goyaP.h int goya_send_heartbeat(struct hl_device *hdev); hdev 230 drivers/misc/habanalabs/goya/goyaP.h void *goya_cpu_accessible_dma_pool_alloc(struct hl_device *hdev, size_t size, hdev 232 drivers/misc/habanalabs/goya/goyaP.h void goya_cpu_accessible_dma_pool_free(struct hl_device *hdev, size_t size, hdev 234 drivers/misc/habanalabs/goya/goyaP.h void goya_mmu_remove_device_cpu_mappings(struct hl_device *hdev); hdev 200 drivers/misc/habanalabs/goya/goya_coresight.c static int goya_coresight_timeout(struct hl_device *hdev, u64 addr, hdev 206 drivers/misc/habanalabs/goya/goya_coresight.c if (hdev->pldm) hdev 212 drivers/misc/habanalabs/goya/goya_coresight.c hdev, hdev 220 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, hdev 229 drivers/misc/habanalabs/goya/goya_coresight.c static int goya_config_stm(struct hl_device *hdev, hdev 237 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, "Invalid register index in STM\n"); hdev 284 drivers/misc/habanalabs/goya/goya_coresight.c rc = goya_coresight_timeout(hdev, base_reg + 0xE80, 23, false); hdev 286 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, hdev 298 drivers/misc/habanalabs/goya/goya_coresight.c static int goya_config_etf(struct hl_device *hdev, hdev 307 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, "Invalid register index in ETF\n"); hdev 321 drivers/misc/habanalabs/goya/goya_coresight.c rc = goya_coresight_timeout(hdev, base_reg + 0x304, 6, false); hdev 323 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, hdev 329 drivers/misc/habanalabs/goya/goya_coresight.c rc = goya_coresight_timeout(hdev, base_reg + 0xC, 2, true); hdev 331 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, hdev 359 drivers/misc/habanalabs/goya/goya_coresight.c static int goya_etr_validate_address(struct hl_device *hdev, u64 addr, hdev 362 drivers/misc/habanalabs/goya/goya_coresight.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 365 drivers/misc/habanalabs/goya/goya_coresight.c if (hdev->mmu_enable) { hdev 376 drivers/misc/habanalabs/goya/goya_coresight.c static int goya_config_etr(struct hl_device *hdev, hdev 392 drivers/misc/habanalabs/goya/goya_coresight.c rc = goya_coresight_timeout(hdev, base_reg + 0x304, 6, false); hdev 394 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, "Failed to %s ETR on timeout, error %d\n", hdev 399 drivers/misc/habanalabs/goya/goya_coresight.c rc = goya_coresight_timeout(hdev, base_reg + 0xC, 2, true); hdev 401 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, "Failed to %s ETR on timeout, error %d\n", hdev 415 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, hdev 420 drivers/misc/habanalabs/goya/goya_coresight.c if (!goya_etr_validate_address(hdev, hdev 422 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, "buffer address is not valid\n"); hdev 463 drivers/misc/habanalabs/goya/goya_coresight.c static int goya_config_funnel(struct hl_device *hdev, hdev 469 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, "Invalid register index in FUNNEL\n"); hdev 482 drivers/misc/habanalabs/goya/goya_coresight.c static int goya_config_bmon(struct hl_device *hdev, hdev 490 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, "Invalid register index in BMON\n"); hdev 554 drivers/misc/habanalabs/goya/goya_coresight.c static int goya_config_spmu(struct hl_device *hdev, hdev 567 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, "Invalid register index in SPMU\n"); hdev 580 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, hdev 586 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, hdev 611 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, hdev 617 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, hdev 639 drivers/misc/habanalabs/goya/goya_coresight.c int goya_debug_coresight(struct hl_device *hdev, void *data) hdev 647 drivers/misc/habanalabs/goya/goya_coresight.c rc = goya_config_stm(hdev, params); hdev 650 drivers/misc/habanalabs/goya/goya_coresight.c rc = goya_config_etf(hdev, params); hdev 653 drivers/misc/habanalabs/goya/goya_coresight.c rc = goya_config_etr(hdev, params); hdev 656 drivers/misc/habanalabs/goya/goya_coresight.c rc = goya_config_funnel(hdev, params); hdev 659 drivers/misc/habanalabs/goya/goya_coresight.c rc = goya_config_bmon(hdev, params); hdev 662 drivers/misc/habanalabs/goya/goya_coresight.c rc = goya_config_spmu(hdev, params); hdev 669 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, "Unknown coresight id %d\n", params->op); hdev 679 drivers/misc/habanalabs/goya/goya_coresight.c void goya_halt_coresight(struct hl_device *hdev) hdev 686 drivers/misc/habanalabs/goya/goya_coresight.c rc = goya_config_etf(hdev, ¶ms); hdev 688 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, "halt ETF failed, %d/%d\n", rc, i); hdev 691 drivers/misc/habanalabs/goya/goya_coresight.c rc = goya_config_etr(hdev, ¶ms); hdev 693 drivers/misc/habanalabs/goya/goya_coresight.c dev_err(hdev->dev, "halt ETR failed, %d\n", rc); hdev 10 drivers/misc/habanalabs/goya/goya_hwmgr.c void goya_set_pll_profile(struct hl_device *hdev, enum hl_pll_frequency freq) hdev 12 drivers/misc/habanalabs/goya/goya_hwmgr.c struct goya_device *goya = hdev->asic_specific; hdev 16 drivers/misc/habanalabs/goya/goya_hwmgr.c hl_set_frequency(hdev, MME_PLL, hdev->high_pll); hdev 17 drivers/misc/habanalabs/goya/goya_hwmgr.c hl_set_frequency(hdev, TPC_PLL, hdev->high_pll); hdev 18 drivers/misc/habanalabs/goya/goya_hwmgr.c hl_set_frequency(hdev, IC_PLL, hdev->high_pll); hdev 21 drivers/misc/habanalabs/goya/goya_hwmgr.c hl_set_frequency(hdev, MME_PLL, GOYA_PLL_FREQ_LOW); hdev 22 drivers/misc/habanalabs/goya/goya_hwmgr.c hl_set_frequency(hdev, TPC_PLL, GOYA_PLL_FREQ_LOW); hdev 23 drivers/misc/habanalabs/goya/goya_hwmgr.c hl_set_frequency(hdev, IC_PLL, GOYA_PLL_FREQ_LOW); hdev 26 drivers/misc/habanalabs/goya/goya_hwmgr.c hl_set_frequency(hdev, MME_PLL, goya->mme_clk); hdev 27 drivers/misc/habanalabs/goya/goya_hwmgr.c hl_set_frequency(hdev, TPC_PLL, goya->tpc_clk); hdev 28 drivers/misc/habanalabs/goya/goya_hwmgr.c hl_set_frequency(hdev, IC_PLL, goya->ic_clk); hdev 31 drivers/misc/habanalabs/goya/goya_hwmgr.c dev_err(hdev->dev, "unknown frequency setting\n"); hdev 38 drivers/misc/habanalabs/goya/goya_hwmgr.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 41 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hl_device_disabled_or_in_reset(hdev)) hdev 44 drivers/misc/habanalabs/goya/goya_hwmgr.c value = hl_get_frequency(hdev, MME_PLL, false); hdev 55 drivers/misc/habanalabs/goya/goya_hwmgr.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 56 drivers/misc/habanalabs/goya/goya_hwmgr.c struct goya_device *goya = hdev->asic_specific; hdev 60 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hl_device_disabled_or_in_reset(hdev)) { hdev 65 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hdev->pm_mng_profile == PM_AUTO) { hdev 77 drivers/misc/habanalabs/goya/goya_hwmgr.c hl_set_frequency(hdev, MME_PLL, value); hdev 87 drivers/misc/habanalabs/goya/goya_hwmgr.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 90 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hl_device_disabled_or_in_reset(hdev)) hdev 93 drivers/misc/habanalabs/goya/goya_hwmgr.c value = hl_get_frequency(hdev, TPC_PLL, false); hdev 104 drivers/misc/habanalabs/goya/goya_hwmgr.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 105 drivers/misc/habanalabs/goya/goya_hwmgr.c struct goya_device *goya = hdev->asic_specific; hdev 109 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hl_device_disabled_or_in_reset(hdev)) { hdev 114 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hdev->pm_mng_profile == PM_AUTO) { hdev 126 drivers/misc/habanalabs/goya/goya_hwmgr.c hl_set_frequency(hdev, TPC_PLL, value); hdev 136 drivers/misc/habanalabs/goya/goya_hwmgr.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 139 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hl_device_disabled_or_in_reset(hdev)) hdev 142 drivers/misc/habanalabs/goya/goya_hwmgr.c value = hl_get_frequency(hdev, IC_PLL, false); hdev 153 drivers/misc/habanalabs/goya/goya_hwmgr.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 154 drivers/misc/habanalabs/goya/goya_hwmgr.c struct goya_device *goya = hdev->asic_specific; hdev 158 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hl_device_disabled_or_in_reset(hdev)) { hdev 163 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hdev->pm_mng_profile == PM_AUTO) { hdev 175 drivers/misc/habanalabs/goya/goya_hwmgr.c hl_set_frequency(hdev, IC_PLL, value); hdev 185 drivers/misc/habanalabs/goya/goya_hwmgr.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 188 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hl_device_disabled_or_in_reset(hdev)) hdev 191 drivers/misc/habanalabs/goya/goya_hwmgr.c value = hl_get_frequency(hdev, MME_PLL, true); hdev 202 drivers/misc/habanalabs/goya/goya_hwmgr.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 205 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hl_device_disabled_or_in_reset(hdev)) hdev 208 drivers/misc/habanalabs/goya/goya_hwmgr.c value = hl_get_frequency(hdev, TPC_PLL, true); hdev 219 drivers/misc/habanalabs/goya/goya_hwmgr.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 222 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hl_device_disabled_or_in_reset(hdev)) hdev 225 drivers/misc/habanalabs/goya/goya_hwmgr.c value = hl_get_frequency(hdev, IC_PLL, true); hdev 236 drivers/misc/habanalabs/goya/goya_hwmgr.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 238 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hl_device_disabled_or_in_reset(hdev)) hdev 242 drivers/misc/habanalabs/goya/goya_hwmgr.c (hdev->pm_mng_profile == PM_AUTO) ? "auto" : hdev 243 drivers/misc/habanalabs/goya/goya_hwmgr.c (hdev->pm_mng_profile == PM_MANUAL) ? "manual" : hdev 250 drivers/misc/habanalabs/goya/goya_hwmgr.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 252 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hl_device_disabled_or_in_reset(hdev)) { hdev 257 drivers/misc/habanalabs/goya/goya_hwmgr.c mutex_lock(&hdev->fpriv_list_lock); hdev 259 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hdev->compute_ctx) { hdev 260 drivers/misc/habanalabs/goya/goya_hwmgr.c dev_err(hdev->dev, hdev 268 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hdev->pm_mng_profile == PM_MANUAL) { hdev 269 drivers/misc/habanalabs/goya/goya_hwmgr.c hdev->curr_pll_profile = PLL_HIGH; hdev 270 drivers/misc/habanalabs/goya/goya_hwmgr.c hl_device_set_frequency(hdev, PLL_LOW); hdev 271 drivers/misc/habanalabs/goya/goya_hwmgr.c hdev->pm_mng_profile = PM_AUTO; hdev 274 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hdev->pm_mng_profile == PM_AUTO) { hdev 280 drivers/misc/habanalabs/goya/goya_hwmgr.c hdev->pm_mng_profile = PM_MANUAL; hdev 282 drivers/misc/habanalabs/goya/goya_hwmgr.c mutex_unlock(&hdev->fpriv_list_lock); hdev 287 drivers/misc/habanalabs/goya/goya_hwmgr.c flush_delayed_work(&hdev->work_freq); hdev 292 drivers/misc/habanalabs/goya/goya_hwmgr.c dev_err(hdev->dev, "value should be auto or manual\n"); hdev 297 drivers/misc/habanalabs/goya/goya_hwmgr.c mutex_unlock(&hdev->fpriv_list_lock); hdev 305 drivers/misc/habanalabs/goya/goya_hwmgr.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 307 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hl_device_disabled_or_in_reset(hdev)) hdev 310 drivers/misc/habanalabs/goya/goya_hwmgr.c return sprintf(buf, "%u\n", hdev->high_pll); hdev 316 drivers/misc/habanalabs/goya/goya_hwmgr.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 320 drivers/misc/habanalabs/goya/goya_hwmgr.c if (hl_device_disabled_or_in_reset(hdev)) { hdev 332 drivers/misc/habanalabs/goya/goya_hwmgr.c hdev->high_pll = value; hdev 359 drivers/misc/habanalabs/goya/goya_hwmgr.c void goya_add_device_attr(struct hl_device *hdev, hdev 18 drivers/misc/habanalabs/goya/goya_security.c static void goya_pb_set_block(struct hl_device *hdev, u64 base) hdev 28 drivers/misc/habanalabs/goya/goya_security.c static void goya_init_mme_protection_bits(struct hl_device *hdev) hdev 37 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmACC_MS_ECC_MEM_0_BASE); hdev 38 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmACC_MS_ECC_MEM_1_BASE); hdev 39 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmACC_MS_ECC_MEM_2_BASE); hdev 40 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmACC_MS_ECC_MEM_3_BASE); hdev 42 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSBA_ECC_MEM_BASE); hdev 43 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSBB_ECC_MEM_BASE); hdev 45 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME1_RTR_BASE); hdev 46 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME1_RD_REGULATOR_BASE); hdev 47 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME1_WR_REGULATOR_BASE); hdev 48 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME2_RTR_BASE); hdev 49 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME2_RD_REGULATOR_BASE); hdev 50 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME2_WR_REGULATOR_BASE); hdev 51 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME3_RTR_BASE); hdev 52 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME3_RD_REGULATOR_BASE); hdev 53 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME3_WR_REGULATOR_BASE); hdev 55 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME4_RTR_BASE); hdev 56 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME4_RD_REGULATOR_BASE); hdev 57 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME4_WR_REGULATOR_BASE); hdev 59 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME5_RTR_BASE); hdev 60 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME5_RD_REGULATOR_BASE); hdev 61 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME5_WR_REGULATOR_BASE); hdev 63 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME6_RTR_BASE); hdev 64 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME6_RD_REGULATOR_BASE); hdev 65 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmMME6_WR_REGULATOR_BASE); hdev 272 drivers/misc/habanalabs/goya/goya_security.c static void goya_init_dma_protection_bits(struct hl_device *hdev) hdev 277 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmDMA_NRTR_BASE); hdev 278 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmDMA_RD_REGULATOR_BASE); hdev 279 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmDMA_WR_REGULATOR_BASE); hdev 357 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmDMA_CH_0_BASE); hdev 435 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmDMA_CH_1_BASE); hdev 513 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmDMA_CH_2_BASE); hdev 591 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmDMA_CH_3_BASE); hdev 669 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmDMA_CH_4_BASE); hdev 672 drivers/misc/habanalabs/goya/goya_security.c static void goya_init_tpc_protection_bits(struct hl_device *hdev) hdev 677 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC0_RD_REGULATOR_BASE); hdev 678 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC0_WR_REGULATOR_BASE); hdev 874 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC1_RTR_BASE); hdev 875 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC1_RD_REGULATOR_BASE); hdev 876 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC1_WR_REGULATOR_BASE); hdev 1056 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC2_RTR_BASE); hdev 1057 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC2_RD_REGULATOR_BASE); hdev 1058 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC2_WR_REGULATOR_BASE); hdev 1238 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC3_RTR_BASE); hdev 1239 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC3_RD_REGULATOR_BASE); hdev 1240 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC3_WR_REGULATOR_BASE); hdev 1420 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC4_RTR_BASE); hdev 1421 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC4_RD_REGULATOR_BASE); hdev 1422 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC4_WR_REGULATOR_BASE); hdev 1602 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC5_RTR_BASE); hdev 1603 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC5_RD_REGULATOR_BASE); hdev 1604 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC5_WR_REGULATOR_BASE); hdev 1784 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC6_RTR_BASE); hdev 1785 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC6_RD_REGULATOR_BASE); hdev 1786 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC6_WR_REGULATOR_BASE); hdev 1966 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC7_NRTR_BASE); hdev 1967 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC7_RD_REGULATOR_BASE); hdev 1968 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC7_WR_REGULATOR_BASE); hdev 2158 drivers/misc/habanalabs/goya/goya_security.c static void goya_init_protection_bits(struct hl_device *hdev) hdev 2182 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmPCI_NRTR_BASE); hdev 2183 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmPCI_RD_REGULATOR_BASE); hdev 2184 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmPCI_WR_REGULATOR_BASE); hdev 2186 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y0_X0_BANK_BASE); hdev 2187 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y0_X0_RTR_BASE); hdev 2188 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y0_X1_BANK_BASE); hdev 2189 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y0_X1_RTR_BASE); hdev 2190 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y0_X2_BANK_BASE); hdev 2191 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y0_X2_RTR_BASE); hdev 2192 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y0_X3_BANK_BASE); hdev 2193 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y0_X3_RTR_BASE); hdev 2194 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y0_X4_BANK_BASE); hdev 2195 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y0_X4_RTR_BASE); hdev 2197 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y1_X0_BANK_BASE); hdev 2198 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y1_X0_RTR_BASE); hdev 2199 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y1_X1_BANK_BASE); hdev 2200 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y1_X1_RTR_BASE); hdev 2201 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y1_X2_BANK_BASE); hdev 2202 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y1_X2_RTR_BASE); hdev 2203 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y1_X3_BANK_BASE); hdev 2204 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y1_X3_RTR_BASE); hdev 2205 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y1_X4_BANK_BASE); hdev 2206 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y1_X4_RTR_BASE); hdev 2208 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y2_X0_BANK_BASE); hdev 2209 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y2_X0_RTR_BASE); hdev 2210 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y2_X1_BANK_BASE); hdev 2211 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y2_X1_RTR_BASE); hdev 2212 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y2_X2_BANK_BASE); hdev 2213 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y2_X2_RTR_BASE); hdev 2214 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y2_X3_BANK_BASE); hdev 2215 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y2_X3_RTR_BASE); hdev 2216 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y2_X4_BANK_BASE); hdev 2217 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y2_X4_RTR_BASE); hdev 2219 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y3_X0_BANK_BASE); hdev 2220 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y3_X0_RTR_BASE); hdev 2221 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y3_X1_BANK_BASE); hdev 2222 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y3_X1_RTR_BASE); hdev 2223 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y3_X2_BANK_BASE); hdev 2224 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y3_X2_RTR_BASE); hdev 2225 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y3_X3_BANK_BASE); hdev 2226 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y3_X3_RTR_BASE); hdev 2227 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y3_X4_BANK_BASE); hdev 2228 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y3_X4_RTR_BASE); hdev 2230 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y4_X0_BANK_BASE); hdev 2231 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y4_X0_RTR_BASE); hdev 2232 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y4_X1_BANK_BASE); hdev 2233 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y4_X1_RTR_BASE); hdev 2234 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y4_X2_BANK_BASE); hdev 2235 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y4_X2_RTR_BASE); hdev 2236 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y4_X3_BANK_BASE); hdev 2237 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y4_X3_RTR_BASE); hdev 2238 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y4_X4_BANK_BASE); hdev 2239 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y4_X4_RTR_BASE); hdev 2241 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y5_X0_BANK_BASE); hdev 2242 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y5_X0_RTR_BASE); hdev 2243 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y5_X1_BANK_BASE); hdev 2244 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y5_X1_RTR_BASE); hdev 2245 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y5_X2_BANK_BASE); hdev 2246 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y5_X2_RTR_BASE); hdev 2247 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y5_X3_BANK_BASE); hdev 2248 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y5_X3_RTR_BASE); hdev 2249 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y5_X4_BANK_BASE); hdev 2250 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmSRAM_Y5_X4_RTR_BASE); hdev 2252 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmPCIE_WRAP_BASE); hdev 2253 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmPCIE_CORE_BASE); hdev 2254 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmPCIE_DB_CFG_BASE); hdev 2255 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmPCIE_DB_CMD_BASE); hdev 2256 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmPCIE_AUX_BASE); hdev 2257 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmPCIE_DB_RSV_BASE); hdev 2258 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmPCIE_PHY_BASE); hdev 2259 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC0_NRTR_BASE); hdev 2260 drivers/misc/habanalabs/goya/goya_security.c goya_pb_set_block(hdev, mmTPC_PLL_BASE); hdev 2268 drivers/misc/habanalabs/goya/goya_security.c goya_init_mme_protection_bits(hdev); hdev 2270 drivers/misc/habanalabs/goya/goya_security.c goya_init_dma_protection_bits(hdev); hdev 2272 drivers/misc/habanalabs/goya/goya_security.c goya_init_tpc_protection_bits(hdev); hdev 2284 drivers/misc/habanalabs/goya/goya_security.c void goya_init_security(struct hl_device *hdev) hdev 2286 drivers/misc/habanalabs/goya/goya_security.c struct goya_device *goya = hdev->asic_specific; hdev 3025 drivers/misc/habanalabs/goya/goya_security.c goya_init_protection_bits(hdev); hdev 231 drivers/misc/habanalabs/habanalabs.h struct hl_device *hdev; hdev 270 drivers/misc/habanalabs/habanalabs.h struct hl_device *hdev; hdev 366 drivers/misc/habanalabs/habanalabs.h struct hl_device *hdev; hdev 383 drivers/misc/habanalabs/habanalabs.h struct hl_device *hdev; hdev 507 drivers/misc/habanalabs/habanalabs.h int (*early_init)(struct hl_device *hdev); hdev 508 drivers/misc/habanalabs/habanalabs.h int (*early_fini)(struct hl_device *hdev); hdev 509 drivers/misc/habanalabs/habanalabs.h int (*late_init)(struct hl_device *hdev); hdev 510 drivers/misc/habanalabs/habanalabs.h void (*late_fini)(struct hl_device *hdev); hdev 511 drivers/misc/habanalabs/habanalabs.h int (*sw_init)(struct hl_device *hdev); hdev 512 drivers/misc/habanalabs/habanalabs.h int (*sw_fini)(struct hl_device *hdev); hdev 513 drivers/misc/habanalabs/habanalabs.h int (*hw_init)(struct hl_device *hdev); hdev 514 drivers/misc/habanalabs/habanalabs.h void (*hw_fini)(struct hl_device *hdev, bool hard_reset); hdev 515 drivers/misc/habanalabs/habanalabs.h void (*halt_engines)(struct hl_device *hdev, bool hard_reset); hdev 516 drivers/misc/habanalabs/habanalabs.h int (*suspend)(struct hl_device *hdev); hdev 517 drivers/misc/habanalabs/habanalabs.h int (*resume)(struct hl_device *hdev); hdev 518 drivers/misc/habanalabs/habanalabs.h int (*cb_mmap)(struct hl_device *hdev, struct vm_area_struct *vma, hdev 520 drivers/misc/habanalabs/habanalabs.h void (*ring_doorbell)(struct hl_device *hdev, u32 hw_queue_id, u32 pi); hdev 521 drivers/misc/habanalabs/habanalabs.h void (*pqe_write)(struct hl_device *hdev, __le64 *pqe, hdev 523 drivers/misc/habanalabs/habanalabs.h void* (*asic_dma_alloc_coherent)(struct hl_device *hdev, size_t size, hdev 525 drivers/misc/habanalabs/habanalabs.h void (*asic_dma_free_coherent)(struct hl_device *hdev, size_t size, hdev 527 drivers/misc/habanalabs/habanalabs.h void* (*get_int_queue_base)(struct hl_device *hdev, u32 queue_id, hdev 529 drivers/misc/habanalabs/habanalabs.h int (*test_queues)(struct hl_device *hdev); hdev 530 drivers/misc/habanalabs/habanalabs.h void* (*asic_dma_pool_zalloc)(struct hl_device *hdev, size_t size, hdev 532 drivers/misc/habanalabs/habanalabs.h void (*asic_dma_pool_free)(struct hl_device *hdev, void *vaddr, hdev 534 drivers/misc/habanalabs/habanalabs.h void* (*cpu_accessible_dma_pool_alloc)(struct hl_device *hdev, hdev 536 drivers/misc/habanalabs/habanalabs.h void (*cpu_accessible_dma_pool_free)(struct hl_device *hdev, hdev 538 drivers/misc/habanalabs/habanalabs.h void (*hl_dma_unmap_sg)(struct hl_device *hdev, hdev 541 drivers/misc/habanalabs/habanalabs.h int (*cs_parser)(struct hl_device *hdev, struct hl_cs_parser *parser); hdev 542 drivers/misc/habanalabs/habanalabs.h int (*asic_dma_map_sg)(struct hl_device *hdev, hdev 545 drivers/misc/habanalabs/habanalabs.h u32 (*get_dma_desc_list_size)(struct hl_device *hdev, hdev 547 drivers/misc/habanalabs/habanalabs.h void (*add_end_of_cb_packets)(struct hl_device *hdev, hdev 550 drivers/misc/habanalabs/habanalabs.h void (*update_eq_ci)(struct hl_device *hdev, u32 val); hdev 551 drivers/misc/habanalabs/habanalabs.h int (*context_switch)(struct hl_device *hdev, u32 asid); hdev 552 drivers/misc/habanalabs/habanalabs.h void (*restore_phase_topology)(struct hl_device *hdev); hdev 553 drivers/misc/habanalabs/habanalabs.h int (*debugfs_read32)(struct hl_device *hdev, u64 addr, u32 *val); hdev 554 drivers/misc/habanalabs/habanalabs.h int (*debugfs_write32)(struct hl_device *hdev, u64 addr, u32 val); hdev 555 drivers/misc/habanalabs/habanalabs.h void (*add_device_attr)(struct hl_device *hdev, hdev 557 drivers/misc/habanalabs/habanalabs.h void (*handle_eqe)(struct hl_device *hdev, hdev 559 drivers/misc/habanalabs/habanalabs.h void (*set_pll_profile)(struct hl_device *hdev, hdev 561 drivers/misc/habanalabs/habanalabs.h void* (*get_events_stat)(struct hl_device *hdev, bool aggregate, hdev 563 drivers/misc/habanalabs/habanalabs.h u64 (*read_pte)(struct hl_device *hdev, u64 addr); hdev 564 drivers/misc/habanalabs/habanalabs.h void (*write_pte)(struct hl_device *hdev, u64 addr, u64 val); hdev 565 drivers/misc/habanalabs/habanalabs.h void (*mmu_invalidate_cache)(struct hl_device *hdev, bool is_hard); hdev 566 drivers/misc/habanalabs/habanalabs.h void (*mmu_invalidate_cache_range)(struct hl_device *hdev, bool is_hard, hdev 568 drivers/misc/habanalabs/habanalabs.h int (*send_heartbeat)(struct hl_device *hdev); hdev 569 drivers/misc/habanalabs/habanalabs.h int (*debug_coresight)(struct hl_device *hdev, void *data); hdev 570 drivers/misc/habanalabs/habanalabs.h bool (*is_device_idle)(struct hl_device *hdev, u32 *mask, hdev 572 drivers/misc/habanalabs/habanalabs.h int (*soft_reset_late_init)(struct hl_device *hdev); hdev 573 drivers/misc/habanalabs/habanalabs.h void (*hw_queues_lock)(struct hl_device *hdev); hdev 574 drivers/misc/habanalabs/habanalabs.h void (*hw_queues_unlock)(struct hl_device *hdev); hdev 575 drivers/misc/habanalabs/habanalabs.h u32 (*get_pci_id)(struct hl_device *hdev); hdev 576 drivers/misc/habanalabs/habanalabs.h int (*get_eeprom_data)(struct hl_device *hdev, void *data, hdev 578 drivers/misc/habanalabs/habanalabs.h int (*send_cpu_message)(struct hl_device *hdev, u32 *msg, hdev 580 drivers/misc/habanalabs/habanalabs.h enum hl_device_hw_state (*get_hw_state)(struct hl_device *hdev); hdev 581 drivers/misc/habanalabs/habanalabs.h int (*pci_bars_map)(struct hl_device *hdev); hdev 582 drivers/misc/habanalabs/habanalabs.h u64 (*set_dram_bar_base)(struct hl_device *hdev, u64 addr); hdev 583 drivers/misc/habanalabs/habanalabs.h int (*init_iatu)(struct hl_device *hdev); hdev 584 drivers/misc/habanalabs/habanalabs.h u32 (*rreg)(struct hl_device *hdev, u32 reg); hdev 585 drivers/misc/habanalabs/habanalabs.h void (*wreg)(struct hl_device *hdev, u32 reg, u32 val); hdev 586 drivers/misc/habanalabs/habanalabs.h void (*halt_coresight)(struct hl_device *hdev); hdev 649 drivers/misc/habanalabs/habanalabs.h struct hl_device *hdev; hdev 926 drivers/misc/habanalabs/habanalabs.h struct hl_device *hdev; hdev 995 drivers/misc/habanalabs/habanalabs.h struct hl_device *hdev; hdev 1031 drivers/misc/habanalabs/habanalabs.h u32 hl_rreg(struct hl_device *hdev, u32 reg); hdev 1032 drivers/misc/habanalabs/habanalabs.h void hl_wreg(struct hl_device *hdev, u32 reg, u32 val); hdev 1034 drivers/misc/habanalabs/habanalabs.h #define RREG32(reg) hdev->asic_funcs->rreg(hdev, (reg)) hdev 1035 drivers/misc/habanalabs/habanalabs.h #define WREG32(reg, v) hdev->asic_funcs->wreg(hdev, (reg), (v)) hdev 1037 drivers/misc/habanalabs/habanalabs.h hdev->asic_funcs->rreg(hdev, (reg))) hdev 1058 drivers/misc/habanalabs/habanalabs.h #define hl_poll_timeout(hdev, addr, val, cond, sleep_us, timeout_us) \ hdev 1061 drivers/misc/habanalabs/habanalabs.h if (hdev->pdev) \ hdev 1094 drivers/misc/habanalabs/habanalabs.h #define hl_poll_timeout_memory(hdev, addr, val, cond, sleep_us, timeout_us, \ hdev 1098 drivers/misc/habanalabs/habanalabs.h if (hdev->pdev) \ hdev 1125 drivers/misc/habanalabs/habanalabs.h #define hl_poll_timeout_device_memory(hdev, addr, val, cond, sleep_us, \ hdev 1129 drivers/misc/habanalabs/habanalabs.h if (hdev->pdev) \ hdev 1159 drivers/misc/habanalabs/habanalabs.h struct hl_device *hdev; hdev 1426 drivers/misc/habanalabs/habanalabs.h bool hl_device_disabled_or_in_reset(struct hl_device *hdev); hdev 1427 drivers/misc/habanalabs/habanalabs.h enum hl_device_status hl_device_status(struct hl_device *hdev); hdev 1428 drivers/misc/habanalabs/habanalabs.h int hl_device_set_debug_mode(struct hl_device *hdev, bool enable); hdev 1431 drivers/misc/habanalabs/habanalabs.h void destroy_hdev(struct hl_device *hdev); hdev 1432 drivers/misc/habanalabs/habanalabs.h int hl_hw_queues_create(struct hl_device *hdev); hdev 1433 drivers/misc/habanalabs/habanalabs.h void hl_hw_queues_destroy(struct hl_device *hdev); hdev 1434 drivers/misc/habanalabs/habanalabs.h int hl_hw_queue_send_cb_no_cmpl(struct hl_device *hdev, u32 hw_queue_id, hdev 1438 drivers/misc/habanalabs/habanalabs.h void hl_hw_queue_inc_ci_kernel(struct hl_device *hdev, u32 hw_queue_id); hdev 1440 drivers/misc/habanalabs/habanalabs.h void hl_hw_queue_reset(struct hl_device *hdev, bool hard_reset); hdev 1445 drivers/misc/habanalabs/habanalabs.h int hl_cq_init(struct hl_device *hdev, struct hl_cq *q, u32 hw_queue_id); hdev 1446 drivers/misc/habanalabs/habanalabs.h void hl_cq_fini(struct hl_device *hdev, struct hl_cq *q); hdev 1447 drivers/misc/habanalabs/habanalabs.h int hl_eq_init(struct hl_device *hdev, struct hl_eq *q); hdev 1448 drivers/misc/habanalabs/habanalabs.h void hl_eq_fini(struct hl_device *hdev, struct hl_eq *q); hdev 1449 drivers/misc/habanalabs/habanalabs.h void hl_cq_reset(struct hl_device *hdev, struct hl_cq *q); hdev 1450 drivers/misc/habanalabs/habanalabs.h void hl_eq_reset(struct hl_device *hdev, struct hl_eq *q); hdev 1455 drivers/misc/habanalabs/habanalabs.h int hl_asid_init(struct hl_device *hdev); hdev 1456 drivers/misc/habanalabs/habanalabs.h void hl_asid_fini(struct hl_device *hdev); hdev 1457 drivers/misc/habanalabs/habanalabs.h unsigned long hl_asid_alloc(struct hl_device *hdev); hdev 1458 drivers/misc/habanalabs/habanalabs.h void hl_asid_free(struct hl_device *hdev, unsigned long asid); hdev 1460 drivers/misc/habanalabs/habanalabs.h int hl_ctx_create(struct hl_device *hdev, struct hl_fpriv *hpriv); hdev 1461 drivers/misc/habanalabs/habanalabs.h void hl_ctx_free(struct hl_device *hdev, struct hl_ctx *ctx); hdev 1462 drivers/misc/habanalabs/habanalabs.h int hl_ctx_init(struct hl_device *hdev, struct hl_ctx *ctx, bool is_kernel_ctx); hdev 1464 drivers/misc/habanalabs/habanalabs.h void hl_ctx_get(struct hl_device *hdev, struct hl_ctx *ctx); hdev 1468 drivers/misc/habanalabs/habanalabs.h void hl_ctx_mgr_fini(struct hl_device *hdev, struct hl_ctx_mgr *mgr); hdev 1470 drivers/misc/habanalabs/habanalabs.h int hl_device_init(struct hl_device *hdev, struct class *hclass); hdev 1471 drivers/misc/habanalabs/habanalabs.h void hl_device_fini(struct hl_device *hdev); hdev 1472 drivers/misc/habanalabs/habanalabs.h int hl_device_suspend(struct hl_device *hdev); hdev 1473 drivers/misc/habanalabs/habanalabs.h int hl_device_resume(struct hl_device *hdev); hdev 1474 drivers/misc/habanalabs/habanalabs.h int hl_device_reset(struct hl_device *hdev, bool hard_reset, hdev 1478 drivers/misc/habanalabs/habanalabs.h int hl_device_set_frequency(struct hl_device *hdev, enum hl_pll_frequency freq); hdev 1479 drivers/misc/habanalabs/habanalabs.h uint32_t hl_device_utilization(struct hl_device *hdev, uint32_t period_ms); hdev 1481 drivers/misc/habanalabs/habanalabs.h int hl_build_hwmon_channel_info(struct hl_device *hdev, hdev 1484 drivers/misc/habanalabs/habanalabs.h int hl_sysfs_init(struct hl_device *hdev); hdev 1485 drivers/misc/habanalabs/habanalabs.h void hl_sysfs_fini(struct hl_device *hdev); hdev 1487 drivers/misc/habanalabs/habanalabs.h int hl_hwmon_init(struct hl_device *hdev); hdev 1488 drivers/misc/habanalabs/habanalabs.h void hl_hwmon_fini(struct hl_device *hdev); hdev 1490 drivers/misc/habanalabs/habanalabs.h int hl_cb_create(struct hl_device *hdev, struct hl_cb_mgr *mgr, u32 cb_size, hdev 1492 drivers/misc/habanalabs/habanalabs.h int hl_cb_destroy(struct hl_device *hdev, struct hl_cb_mgr *mgr, u64 cb_handle); hdev 1494 drivers/misc/habanalabs/habanalabs.h struct hl_cb *hl_cb_get(struct hl_device *hdev, struct hl_cb_mgr *mgr, hdev 1498 drivers/misc/habanalabs/habanalabs.h void hl_cb_mgr_fini(struct hl_device *hdev, struct hl_cb_mgr *mgr); hdev 1499 drivers/misc/habanalabs/habanalabs.h struct hl_cb *hl_cb_kernel_create(struct hl_device *hdev, u32 cb_size); hdev 1500 drivers/misc/habanalabs/habanalabs.h int hl_cb_pool_init(struct hl_device *hdev); hdev 1501 drivers/misc/habanalabs/habanalabs.h int hl_cb_pool_fini(struct hl_device *hdev); hdev 1503 drivers/misc/habanalabs/habanalabs.h void hl_cs_rollback_all(struct hl_device *hdev); hdev 1504 drivers/misc/habanalabs/habanalabs.h struct hl_cs_job *hl_cs_allocate_job(struct hl_device *hdev, bool ext_queue); hdev 1506 drivers/misc/habanalabs/habanalabs.h void goya_set_asic_funcs(struct hl_device *hdev); hdev 1511 drivers/misc/habanalabs/habanalabs.h int hl_vm_init(struct hl_device *hdev); hdev 1512 drivers/misc/habanalabs/habanalabs.h void hl_vm_fini(struct hl_device *hdev); hdev 1514 drivers/misc/habanalabs/habanalabs.h int hl_pin_host_memory(struct hl_device *hdev, u64 addr, u64 size, hdev 1516 drivers/misc/habanalabs/habanalabs.h int hl_unpin_host_memory(struct hl_device *hdev, struct hl_userptr *userptr); hdev 1517 drivers/misc/habanalabs/habanalabs.h void hl_userptr_delete_list(struct hl_device *hdev, hdev 1519 drivers/misc/habanalabs/habanalabs.h bool hl_userptr_is_pinned(struct hl_device *hdev, u64 addr, u32 size, hdev 1523 drivers/misc/habanalabs/habanalabs.h int hl_mmu_init(struct hl_device *hdev); hdev 1524 drivers/misc/habanalabs/habanalabs.h void hl_mmu_fini(struct hl_device *hdev); hdev 1532 drivers/misc/habanalabs/habanalabs.h int hl_fw_push_fw_to_device(struct hl_device *hdev, const char *fw_name, hdev 1534 drivers/misc/habanalabs/habanalabs.h int hl_fw_send_pci_access_msg(struct hl_device *hdev, u32 opcode); hdev 1535 drivers/misc/habanalabs/habanalabs.h int hl_fw_send_cpu_message(struct hl_device *hdev, u32 hw_queue_id, u32 *msg, hdev 1537 drivers/misc/habanalabs/habanalabs.h int hl_fw_test_cpu_queue(struct hl_device *hdev); hdev 1538 drivers/misc/habanalabs/habanalabs.h void *hl_fw_cpu_accessible_dma_pool_alloc(struct hl_device *hdev, size_t size, hdev 1540 drivers/misc/habanalabs/habanalabs.h void hl_fw_cpu_accessible_dma_pool_free(struct hl_device *hdev, size_t size, hdev 1542 drivers/misc/habanalabs/habanalabs.h int hl_fw_send_heartbeat(struct hl_device *hdev); hdev 1543 drivers/misc/habanalabs/habanalabs.h int hl_fw_armcp_info_get(struct hl_device *hdev); hdev 1544 drivers/misc/habanalabs/habanalabs.h int hl_fw_get_eeprom_data(struct hl_device *hdev, void *data, size_t max_size); hdev 1546 drivers/misc/habanalabs/habanalabs.h int hl_pci_bars_map(struct hl_device *hdev, const char * const name[3], hdev 1548 drivers/misc/habanalabs/habanalabs.h int hl_pci_iatu_write(struct hl_device *hdev, u32 addr, u32 data); hdev 1549 drivers/misc/habanalabs/habanalabs.h int hl_pci_set_dram_bar_base(struct hl_device *hdev, u8 inbound_region, u8 bar, hdev 1551 drivers/misc/habanalabs/habanalabs.h int hl_pci_init_iatu(struct hl_device *hdev, u64 sram_base_address, hdev 1554 drivers/misc/habanalabs/habanalabs.h int hl_pci_init(struct hl_device *hdev, u8 dma_mask); hdev 1555 drivers/misc/habanalabs/habanalabs.h void hl_pci_fini(struct hl_device *hdev); hdev 1556 drivers/misc/habanalabs/habanalabs.h int hl_pci_set_dma_mask(struct hl_device *hdev, u8 dma_mask); hdev 1558 drivers/misc/habanalabs/habanalabs.h long hl_get_frequency(struct hl_device *hdev, u32 pll_index, bool curr); hdev 1559 drivers/misc/habanalabs/habanalabs.h void hl_set_frequency(struct hl_device *hdev, u32 pll_index, u64 freq); hdev 1560 drivers/misc/habanalabs/habanalabs.h long hl_get_temperature(struct hl_device *hdev, int sensor_index, u32 attr); hdev 1561 drivers/misc/habanalabs/habanalabs.h long hl_get_voltage(struct hl_device *hdev, int sensor_index, u32 attr); hdev 1562 drivers/misc/habanalabs/habanalabs.h long hl_get_current(struct hl_device *hdev, int sensor_index, u32 attr); hdev 1563 drivers/misc/habanalabs/habanalabs.h long hl_get_fan_speed(struct hl_device *hdev, int sensor_index, u32 attr); hdev 1564 drivers/misc/habanalabs/habanalabs.h long hl_get_pwm_info(struct hl_device *hdev, int sensor_index, u32 attr); hdev 1565 drivers/misc/habanalabs/habanalabs.h void hl_set_pwm_info(struct hl_device *hdev, int sensor_index, u32 attr, hdev 1567 drivers/misc/habanalabs/habanalabs.h u64 hl_get_max_power(struct hl_device *hdev); hdev 1568 drivers/misc/habanalabs/habanalabs.h void hl_set_max_power(struct hl_device *hdev, u64 value); hdev 1574 drivers/misc/habanalabs/habanalabs.h void hl_debugfs_add_device(struct hl_device *hdev); hdev 1575 drivers/misc/habanalabs/habanalabs.h void hl_debugfs_remove_device(struct hl_device *hdev); hdev 1582 drivers/misc/habanalabs/habanalabs.h void hl_debugfs_add_job(struct hl_device *hdev, struct hl_cs_job *job); hdev 1583 drivers/misc/habanalabs/habanalabs.h void hl_debugfs_remove_job(struct hl_device *hdev, struct hl_cs_job *job); hdev 1584 drivers/misc/habanalabs/habanalabs.h void hl_debugfs_add_userptr(struct hl_device *hdev, struct hl_userptr *userptr); hdev 1585 drivers/misc/habanalabs/habanalabs.h void hl_debugfs_remove_userptr(struct hl_device *hdev, hdev 1587 drivers/misc/habanalabs/habanalabs.h void hl_debugfs_add_ctx_mem_hash(struct hl_device *hdev, struct hl_ctx *ctx); hdev 1588 drivers/misc/habanalabs/habanalabs.h void hl_debugfs_remove_ctx_mem_hash(struct hl_device *hdev, struct hl_ctx *ctx); hdev 1600 drivers/misc/habanalabs/habanalabs.h static inline void hl_debugfs_add_device(struct hl_device *hdev) hdev 1604 drivers/misc/habanalabs/habanalabs.h static inline void hl_debugfs_remove_device(struct hl_device *hdev) hdev 1632 drivers/misc/habanalabs/habanalabs.h static inline void hl_debugfs_add_job(struct hl_device *hdev, hdev 1637 drivers/misc/habanalabs/habanalabs.h static inline void hl_debugfs_remove_job(struct hl_device *hdev, hdev 1642 drivers/misc/habanalabs/habanalabs.h static inline void hl_debugfs_add_userptr(struct hl_device *hdev, hdev 1647 drivers/misc/habanalabs/habanalabs.h static inline void hl_debugfs_remove_userptr(struct hl_device *hdev, hdev 1652 drivers/misc/habanalabs/habanalabs.h static inline void hl_debugfs_add_ctx_mem_hash(struct hl_device *hdev, hdev 1657 drivers/misc/habanalabs/habanalabs.h static inline void hl_debugfs_remove_ctx_mem_hash(struct hl_device *hdev, hdev 84 drivers/misc/habanalabs/habanalabs_drv.c struct hl_device *hdev; hdev 89 drivers/misc/habanalabs/habanalabs_drv.c hdev = idr_find(&hl_devs_idr, iminor(inode)); hdev 92 drivers/misc/habanalabs/habanalabs_drv.c if (!hdev) { hdev 102 drivers/misc/habanalabs/habanalabs_drv.c hpriv->hdev = hdev; hdev 114 drivers/misc/habanalabs/habanalabs_drv.c mutex_lock(&hdev->fpriv_list_lock); hdev 116 drivers/misc/habanalabs/habanalabs_drv.c if (hl_device_disabled_or_in_reset(hdev)) { hdev 117 drivers/misc/habanalabs/habanalabs_drv.c dev_err_ratelimited(hdev->dev, hdev 119 drivers/misc/habanalabs/habanalabs_drv.c dev_name(hdev->dev)); hdev 124 drivers/misc/habanalabs/habanalabs_drv.c if (hdev->in_debug) { hdev 125 drivers/misc/habanalabs/habanalabs_drv.c dev_err_ratelimited(hdev->dev, hdev 127 drivers/misc/habanalabs/habanalabs_drv.c dev_name(hdev->dev)); hdev 132 drivers/misc/habanalabs/habanalabs_drv.c if (hdev->compute_ctx) { hdev 133 drivers/misc/habanalabs/habanalabs_drv.c dev_dbg_ratelimited(hdev->dev, hdev 135 drivers/misc/habanalabs/habanalabs_drv.c dev_name(hdev->dev)); hdev 140 drivers/misc/habanalabs/habanalabs_drv.c rc = hl_ctx_create(hdev, hpriv); hdev 142 drivers/misc/habanalabs/habanalabs_drv.c dev_err(hdev->dev, "Failed to create context %d\n", rc); hdev 151 drivers/misc/habanalabs/habanalabs_drv.c hl_device_set_frequency(hdev, PLL_HIGH); hdev 153 drivers/misc/habanalabs/habanalabs_drv.c list_add(&hpriv->dev_node, &hdev->fpriv_list); hdev 154 drivers/misc/habanalabs/habanalabs_drv.c mutex_unlock(&hdev->fpriv_list_lock); hdev 161 drivers/misc/habanalabs/habanalabs_drv.c mutex_unlock(&hdev->fpriv_list_lock); hdev 163 drivers/misc/habanalabs/habanalabs_drv.c hl_cb_mgr_fini(hpriv->hdev, &hpriv->cb_mgr); hdev 164 drivers/misc/habanalabs/habanalabs_drv.c hl_ctx_mgr_fini(hpriv->hdev, &hpriv->ctx_mgr); hdev 175 drivers/misc/habanalabs/habanalabs_drv.c struct hl_device *hdev; hdev 180 drivers/misc/habanalabs/habanalabs_drv.c hdev = idr_find(&hl_devs_idr, iminor(inode)); hdev 183 drivers/misc/habanalabs/habanalabs_drv.c if (!hdev) { hdev 193 drivers/misc/habanalabs/habanalabs_drv.c mutex_lock(&hdev->fpriv_list_lock); hdev 195 drivers/misc/habanalabs/habanalabs_drv.c if (hl_device_disabled_or_in_reset(hdev)) { hdev 196 drivers/misc/habanalabs/habanalabs_drv.c dev_err_ratelimited(hdev->dev_ctrl, hdev 198 drivers/misc/habanalabs/habanalabs_drv.c dev_name(hdev->dev_ctrl)); hdev 203 drivers/misc/habanalabs/habanalabs_drv.c list_add(&hpriv->dev_node, &hdev->fpriv_list); hdev 204 drivers/misc/habanalabs/habanalabs_drv.c mutex_unlock(&hdev->fpriv_list_lock); hdev 206 drivers/misc/habanalabs/habanalabs_drv.c hpriv->hdev = hdev; hdev 217 drivers/misc/habanalabs/habanalabs_drv.c mutex_unlock(&hdev->fpriv_list_lock); hdev 222 drivers/misc/habanalabs/habanalabs_drv.c static void set_driver_behavior_per_device(struct hl_device *hdev) hdev 224 drivers/misc/habanalabs/habanalabs_drv.c hdev->mmu_enable = 1; hdev 225 drivers/misc/habanalabs/habanalabs_drv.c hdev->cpu_enable = 1; hdev 226 drivers/misc/habanalabs/habanalabs_drv.c hdev->fw_loading = 1; hdev 227 drivers/misc/habanalabs/habanalabs_drv.c hdev->cpu_queues_enable = 1; hdev 228 drivers/misc/habanalabs/habanalabs_drv.c hdev->heartbeat = 1; hdev 230 drivers/misc/habanalabs/habanalabs_drv.c hdev->reset_pcilink = 0; hdev 248 drivers/misc/habanalabs/habanalabs_drv.c struct hl_device *hdev; hdev 253 drivers/misc/habanalabs/habanalabs_drv.c hdev = kzalloc(sizeof(*hdev), GFP_KERNEL); hdev 254 drivers/misc/habanalabs/habanalabs_drv.c if (!hdev) hdev 261 drivers/misc/habanalabs/habanalabs_drv.c hdev->asic_type = get_asic_type(pdev->device); hdev 262 drivers/misc/habanalabs/habanalabs_drv.c if (hdev->asic_type == ASIC_INVALID) { hdev 268 drivers/misc/habanalabs/habanalabs_drv.c hdev->asic_type = asic_type; hdev 271 drivers/misc/habanalabs/habanalabs_drv.c hdev->major = hl_major; hdev 272 drivers/misc/habanalabs/habanalabs_drv.c hdev->reset_on_lockup = reset_on_lockup; hdev 273 drivers/misc/habanalabs/habanalabs_drv.c hdev->pldm = 0; hdev 275 drivers/misc/habanalabs/habanalabs_drv.c set_driver_behavior_per_device(hdev); hdev 278 drivers/misc/habanalabs/habanalabs_drv.c hdev->timeout_jiffies = msecs_to_jiffies(timeout_locked * 1000); hdev 280 drivers/misc/habanalabs/habanalabs_drv.c hdev->timeout_jiffies = MAX_SCHEDULE_TIMEOUT; hdev 282 drivers/misc/habanalabs/habanalabs_drv.c hdev->disabled = true; hdev 283 drivers/misc/habanalabs/habanalabs_drv.c hdev->pdev = pdev; /* can be NULL in case of simulator device */ hdev 286 drivers/misc/habanalabs/habanalabs_drv.c hdev->dma_mask = 32; hdev 293 drivers/misc/habanalabs/habanalabs_drv.c main_id = idr_alloc(&hl_devs_idr, hdev, 0, HL_MAX_MINORS, hdev 297 drivers/misc/habanalabs/habanalabs_drv.c ctrl_id = idr_alloc(&hl_devs_idr, hdev, main_id + 1, hdev 316 drivers/misc/habanalabs/habanalabs_drv.c hdev->id = main_id; hdev 317 drivers/misc/habanalabs/habanalabs_drv.c hdev->id_control = ctrl_id; hdev 319 drivers/misc/habanalabs/habanalabs_drv.c *dev = hdev; hdev 324 drivers/misc/habanalabs/habanalabs_drv.c kfree(hdev); hdev 334 drivers/misc/habanalabs/habanalabs_drv.c void destroy_hdev(struct hl_device *hdev) hdev 338 drivers/misc/habanalabs/habanalabs_drv.c idr_remove(&hl_devs_idr, hdev->id); hdev 339 drivers/misc/habanalabs/habanalabs_drv.c idr_remove(&hl_devs_idr, hdev->id_control); hdev 342 drivers/misc/habanalabs/habanalabs_drv.c kfree(hdev); hdev 347 drivers/misc/habanalabs/habanalabs_drv.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 351 drivers/misc/habanalabs/habanalabs_drv.c if (!hdev) { hdev 356 drivers/misc/habanalabs/habanalabs_drv.c return hl_device_suspend(hdev); hdev 361 drivers/misc/habanalabs/habanalabs_drv.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 365 drivers/misc/habanalabs/habanalabs_drv.c if (!hdev) { hdev 370 drivers/misc/habanalabs/habanalabs_drv.c return hl_device_resume(hdev); hdev 386 drivers/misc/habanalabs/habanalabs_drv.c struct hl_device *hdev; hdev 393 drivers/misc/habanalabs/habanalabs_drv.c rc = create_hdev(&hdev, pdev, ASIC_INVALID, -1); hdev 397 drivers/misc/habanalabs/habanalabs_drv.c pci_set_drvdata(pdev, hdev); hdev 399 drivers/misc/habanalabs/habanalabs_drv.c rc = hl_device_init(hdev, hl_class); hdev 410 drivers/misc/habanalabs/habanalabs_drv.c destroy_hdev(hdev); hdev 424 drivers/misc/habanalabs/habanalabs_drv.c struct hl_device *hdev; hdev 426 drivers/misc/habanalabs/habanalabs_drv.c hdev = pci_get_drvdata(pdev); hdev 427 drivers/misc/habanalabs/habanalabs_drv.c if (!hdev) hdev 430 drivers/misc/habanalabs/habanalabs_drv.c hl_device_fini(hdev); hdev 433 drivers/misc/habanalabs/habanalabs_drv.c destroy_hdev(hdev); hdev 26 drivers/misc/habanalabs/habanalabs_ioctl.c static int device_status_info(struct hl_device *hdev, struct hl_info_args *args) hdev 35 drivers/misc/habanalabs/habanalabs_ioctl.c dev_stat.status = hl_device_status(hdev); hdev 41 drivers/misc/habanalabs/habanalabs_ioctl.c static int hw_ip_info(struct hl_device *hdev, struct hl_info_args *args) hdev 46 drivers/misc/habanalabs/habanalabs_ioctl.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 57 drivers/misc/habanalabs/habanalabs_ioctl.c hw_ip.device_id = hdev->asic_funcs->get_pci_id(hdev); hdev 78 drivers/misc/habanalabs/habanalabs_ioctl.c static int hw_events_info(struct hl_device *hdev, bool aggregate, hdev 88 drivers/misc/habanalabs/habanalabs_ioctl.c arr = hdev->asic_funcs->get_events_stat(hdev, aggregate, &size); hdev 95 drivers/misc/habanalabs/habanalabs_ioctl.c struct hl_device *hdev = hpriv->hdev; hdev 99 drivers/misc/habanalabs/habanalabs_ioctl.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 108 drivers/misc/habanalabs/habanalabs_ioctl.c atomic64_read(&hdev->dram_used_mem); hdev 117 drivers/misc/habanalabs/habanalabs_ioctl.c static int hw_idle(struct hl_device *hdev, struct hl_info_args *args) hdev 126 drivers/misc/habanalabs/habanalabs_ioctl.c hw_idle.is_idle = hdev->asic_funcs->is_device_idle(hdev, hdev 133 drivers/misc/habanalabs/habanalabs_ioctl.c static int debug_coresight(struct hl_device *hdev, struct hl_debug_args *args) hdev 157 drivers/misc/habanalabs/habanalabs_ioctl.c dev_err(hdev->dev, "failed to copy input debug data\n"); hdev 175 drivers/misc/habanalabs/habanalabs_ioctl.c rc = hdev->asic_funcs->debug_coresight(hdev, params); hdev 177 drivers/misc/habanalabs/habanalabs_ioctl.c dev_err(hdev->dev, hdev 186 drivers/misc/habanalabs/habanalabs_ioctl.c dev_err(hdev->dev, hdev 201 drivers/misc/habanalabs/habanalabs_ioctl.c static int device_utilization(struct hl_device *hdev, struct hl_info_args *args) hdev 212 drivers/misc/habanalabs/habanalabs_ioctl.c dev_err(hdev->dev, hdev 218 drivers/misc/habanalabs/habanalabs_ioctl.c device_util.utilization = hl_device_utilization(hdev, args->period_ms); hdev 228 drivers/misc/habanalabs/habanalabs_ioctl.c struct hl_device *hdev = hpriv->hdev; hdev 237 drivers/misc/habanalabs/habanalabs_ioctl.c return hw_ip_info(hdev, args); hdev 240 drivers/misc/habanalabs/habanalabs_ioctl.c return device_status_info(hdev, args); hdev 246 drivers/misc/habanalabs/habanalabs_ioctl.c if (hl_device_disabled_or_in_reset(hdev)) { hdev 249 drivers/misc/habanalabs/habanalabs_ioctl.c atomic_read(&hdev->in_reset) ? "in_reset" : "disabled"); hdev 255 drivers/misc/habanalabs/habanalabs_ioctl.c rc = hw_events_info(hdev, false, args); hdev 263 drivers/misc/habanalabs/habanalabs_ioctl.c rc = hw_idle(hdev, args); hdev 267 drivers/misc/habanalabs/habanalabs_ioctl.c rc = device_utilization(hdev, args); hdev 271 drivers/misc/habanalabs/habanalabs_ioctl.c rc = hw_events_info(hdev, true, args); hdev 285 drivers/misc/habanalabs/habanalabs_ioctl.c return _hl_info_ioctl(hpriv, data, hpriv->hdev->dev); hdev 290 drivers/misc/habanalabs/habanalabs_ioctl.c return _hl_info_ioctl(hpriv, data, hpriv->hdev->dev_ctrl); hdev 296 drivers/misc/habanalabs/habanalabs_ioctl.c struct hl_device *hdev = hpriv->hdev; hdev 299 drivers/misc/habanalabs/habanalabs_ioctl.c if (hl_device_disabled_or_in_reset(hdev)) { hdev 300 drivers/misc/habanalabs/habanalabs_ioctl.c dev_warn_ratelimited(hdev->dev, hdev 302 drivers/misc/habanalabs/habanalabs_ioctl.c atomic_read(&hdev->in_reset) ? "in_reset" : "disabled"); hdev 314 drivers/misc/habanalabs/habanalabs_ioctl.c if (!hdev->in_debug) { hdev 315 drivers/misc/habanalabs/habanalabs_ioctl.c dev_err_ratelimited(hdev->dev, hdev 321 drivers/misc/habanalabs/habanalabs_ioctl.c rc = debug_coresight(hdev, args); hdev 324 drivers/misc/habanalabs/habanalabs_ioctl.c rc = hl_device_set_debug_mode(hdev, (bool) args->enable); hdev 327 drivers/misc/habanalabs/habanalabs_ioctl.c dev_err(hdev->dev, "Invalid request %d\n", args->op); hdev 355 drivers/misc/habanalabs/habanalabs_ioctl.c struct hl_device *hdev = hpriv->hdev; hdev 364 drivers/misc/habanalabs/habanalabs_ioctl.c if (hdev->hard_reset_pending) { hdev 365 drivers/misc/habanalabs/habanalabs_ioctl.c dev_crit_ratelimited(hdev->dev_ctrl, hdev 427 drivers/misc/habanalabs/habanalabs_ioctl.c struct hl_device *hdev = hpriv->hdev; hdev 434 drivers/misc/habanalabs/habanalabs_ioctl.c dev_err(hdev->dev, "invalid ioctl: pid=%d, nr=0x%02x\n", hdev 439 drivers/misc/habanalabs/habanalabs_ioctl.c return _hl_ioctl(filep, cmd, arg, ioctl, hdev->dev); hdev 445 drivers/misc/habanalabs/habanalabs_ioctl.c struct hl_device *hdev = hpriv->hdev; hdev 452 drivers/misc/habanalabs/habanalabs_ioctl.c dev_err(hdev->dev_ctrl, "invalid ioctl: pid=%d, nr=0x%02x\n", hdev 457 drivers/misc/habanalabs/habanalabs_ioctl.c return _hl_ioctl(filep, cmd, arg, ioctl, hdev->dev_ctrl); hdev 39 drivers/misc/habanalabs/hw_queue.c struct hl_device *hdev = cs->ctx->hdev; hdev 43 drivers/misc/habanalabs/hw_queue.c hdev->asic_funcs->hw_queues_lock(hdev); hdev 45 drivers/misc/habanalabs/hw_queue.c if (hdev->disabled) hdev 48 drivers/misc/habanalabs/hw_queue.c q = &hdev->kernel_queues[0]; hdev 57 drivers/misc/habanalabs/hw_queue.c hdev->asic_funcs->hw_queues_unlock(hdev); hdev 76 drivers/misc/habanalabs/hw_queue.c static void ext_queue_submit_bd(struct hl_device *hdev, struct hl_hw_queue *q, hdev 88 drivers/misc/habanalabs/hw_queue.c hdev->asic_funcs->ring_doorbell(hdev, q->hw_queue_id, q->pi); hdev 109 drivers/misc/habanalabs/hw_queue.c static int ext_queue_sanity_checks(struct hl_device *hdev, hdev 114 drivers/misc/habanalabs/hw_queue.c &hdev->completion_queue[q->hw_queue_id].free_slots_cnt; hdev 121 drivers/misc/habanalabs/hw_queue.c dev_dbg(hdev->dev, "Queue %d doesn't have room for %d CBs\n", hdev 135 drivers/misc/habanalabs/hw_queue.c dev_dbg(hdev->dev, "No space for %d on CQ %d\n", hdev 158 drivers/misc/habanalabs/hw_queue.c static int int_queue_sanity_checks(struct hl_device *hdev, hdev 168 drivers/misc/habanalabs/hw_queue.c dev_dbg(hdev->dev, "Queue %d doesn't have room for %d CBs\n", hdev 187 drivers/misc/habanalabs/hw_queue.c int hl_hw_queue_send_cb_no_cmpl(struct hl_device *hdev, u32 hw_queue_id, hdev 190 drivers/misc/habanalabs/hw_queue.c struct hl_hw_queue *q = &hdev->kernel_queues[hw_queue_id]; hdev 202 drivers/misc/habanalabs/hw_queue.c hdev->asic_funcs->hw_queues_lock(hdev); hdev 204 drivers/misc/habanalabs/hw_queue.c if (hdev->disabled) { hdev 209 drivers/misc/habanalabs/hw_queue.c rc = ext_queue_sanity_checks(hdev, q, 1, false); hdev 213 drivers/misc/habanalabs/hw_queue.c ext_queue_submit_bd(hdev, q, 0, cb_size, cb_ptr); hdev 217 drivers/misc/habanalabs/hw_queue.c hdev->asic_funcs->hw_queues_unlock(hdev); hdev 232 drivers/misc/habanalabs/hw_queue.c struct hl_device *hdev = job->cs->ctx->hdev; hdev 233 drivers/misc/habanalabs/hw_queue.c struct hl_hw_queue *q = &hdev->kernel_queues[job->hw_queue_id]; hdev 265 drivers/misc/habanalabs/hw_queue.c cq = &hdev->completion_queue[q->hw_queue_id]; hdev 268 drivers/misc/habanalabs/hw_queue.c hdev->asic_funcs->add_end_of_cb_packets(hdev, cb->kernel_address, len, hdev 277 drivers/misc/habanalabs/hw_queue.c ext_queue_submit_bd(hdev, q, ctl, len, ptr); hdev 290 drivers/misc/habanalabs/hw_queue.c struct hl_device *hdev = job->cs->ctx->hdev; hdev 291 drivers/misc/habanalabs/hw_queue.c struct hl_hw_queue *q = &hdev->kernel_queues[job->hw_queue_id]; hdev 305 drivers/misc/habanalabs/hw_queue.c hdev->asic_funcs->pqe_write(hdev, pi, &bd); hdev 307 drivers/misc/habanalabs/hw_queue.c hdev->asic_funcs->ring_doorbell(hdev, q->hw_queue_id, q->pi); hdev 318 drivers/misc/habanalabs/hw_queue.c struct hl_device *hdev = cs->ctx->hdev; hdev 323 drivers/misc/habanalabs/hw_queue.c hdev->asic_funcs->hw_queues_lock(hdev); hdev 325 drivers/misc/habanalabs/hw_queue.c if (hl_device_disabled_or_in_reset(hdev)) { hdev 326 drivers/misc/habanalabs/hw_queue.c dev_err(hdev->dev, hdev 332 drivers/misc/habanalabs/hw_queue.c q = &hdev->kernel_queues[0]; hdev 337 drivers/misc/habanalabs/hw_queue.c rc = ext_queue_sanity_checks(hdev, q, hdev 345 drivers/misc/habanalabs/hw_queue.c rc = int_queue_sanity_checks(hdev, q, hdev 353 drivers/misc/habanalabs/hw_queue.c spin_lock(&hdev->hw_queues_mirror_lock); hdev 354 drivers/misc/habanalabs/hw_queue.c list_add_tail(&cs->mirror_node, &hdev->hw_queues_mirror_list); hdev 357 drivers/misc/habanalabs/hw_queue.c if ((hdev->timeout_jiffies != MAX_SCHEDULE_TIMEOUT) && hdev 358 drivers/misc/habanalabs/hw_queue.c (list_first_entry(&hdev->hw_queues_mirror_list, hdev 361 drivers/misc/habanalabs/hw_queue.c schedule_delayed_work(&cs->work_tdr, hdev->timeout_jiffies); hdev 362 drivers/misc/habanalabs/hw_queue.c spin_unlock(&hdev->hw_queues_mirror_lock); hdev 364 drivers/misc/habanalabs/hw_queue.c spin_unlock(&hdev->hw_queues_mirror_lock); hdev 367 drivers/misc/habanalabs/hw_queue.c if (!hdev->cs_active_cnt++) { hdev 370 drivers/misc/habanalabs/hw_queue.c ts = &hdev->idle_busy_ts_arr[hdev->idle_busy_ts_idx]; hdev 387 drivers/misc/habanalabs/hw_queue.c q = &hdev->kernel_queues[0]; hdev 392 drivers/misc/habanalabs/hw_queue.c &hdev->completion_queue[i].free_slots_cnt; hdev 399 drivers/misc/habanalabs/hw_queue.c hdev->asic_funcs->hw_queues_unlock(hdev); hdev 410 drivers/misc/habanalabs/hw_queue.c void hl_hw_queue_inc_ci_kernel(struct hl_device *hdev, u32 hw_queue_id) hdev 412 drivers/misc/habanalabs/hw_queue.c struct hl_hw_queue *q = &hdev->kernel_queues[hw_queue_id]; hdev 417 drivers/misc/habanalabs/hw_queue.c static int ext_and_cpu_hw_queue_init(struct hl_device *hdev, hdev 424 drivers/misc/habanalabs/hw_queue.c p = hdev->asic_funcs->cpu_accessible_dma_pool_alloc(hdev, hdev 428 drivers/misc/habanalabs/hw_queue.c p = hdev->asic_funcs->asic_dma_alloc_coherent(hdev, hdev 441 drivers/misc/habanalabs/hw_queue.c dev_err(hdev->dev, hdev 456 drivers/misc/habanalabs/hw_queue.c hdev->asic_funcs->cpu_accessible_dma_pool_free(hdev, hdev 460 drivers/misc/habanalabs/hw_queue.c hdev->asic_funcs->asic_dma_free_coherent(hdev, hdev 468 drivers/misc/habanalabs/hw_queue.c static int int_hw_queue_init(struct hl_device *hdev, struct hl_hw_queue *q) hdev 472 drivers/misc/habanalabs/hw_queue.c p = hdev->asic_funcs->get_int_queue_base(hdev, q->hw_queue_id, hdev 475 drivers/misc/habanalabs/hw_queue.c dev_err(hdev->dev, hdev 488 drivers/misc/habanalabs/hw_queue.c static int cpu_hw_queue_init(struct hl_device *hdev, struct hl_hw_queue *q) hdev 490 drivers/misc/habanalabs/hw_queue.c return ext_and_cpu_hw_queue_init(hdev, q, true); hdev 493 drivers/misc/habanalabs/hw_queue.c static int ext_hw_queue_init(struct hl_device *hdev, struct hl_hw_queue *q) hdev 495 drivers/misc/habanalabs/hw_queue.c return ext_and_cpu_hw_queue_init(hdev, q, false); hdev 508 drivers/misc/habanalabs/hw_queue.c static int hw_queue_init(struct hl_device *hdev, struct hl_hw_queue *q, hdev 519 drivers/misc/habanalabs/hw_queue.c rc = ext_hw_queue_init(hdev, q); hdev 523 drivers/misc/habanalabs/hw_queue.c rc = int_hw_queue_init(hdev, q); hdev 527 drivers/misc/habanalabs/hw_queue.c rc = cpu_hw_queue_init(hdev, q); hdev 535 drivers/misc/habanalabs/hw_queue.c dev_crit(hdev->dev, "wrong queue type %d during init\n", hdev 557 drivers/misc/habanalabs/hw_queue.c static void hw_queue_fini(struct hl_device *hdev, struct hl_hw_queue *q) hdev 586 drivers/misc/habanalabs/hw_queue.c hdev->asic_funcs->cpu_accessible_dma_pool_free(hdev, hdev 590 drivers/misc/habanalabs/hw_queue.c hdev->asic_funcs->asic_dma_free_coherent(hdev, hdev 596 drivers/misc/habanalabs/hw_queue.c int hl_hw_queues_create(struct hl_device *hdev) hdev 598 drivers/misc/habanalabs/hw_queue.c struct asic_fixed_properties *asic = &hdev->asic_prop; hdev 602 drivers/misc/habanalabs/hw_queue.c hdev->kernel_queues = kcalloc(HL_MAX_QUEUES, hdev 603 drivers/misc/habanalabs/hw_queue.c sizeof(*hdev->kernel_queues), GFP_KERNEL); hdev 605 drivers/misc/habanalabs/hw_queue.c if (!hdev->kernel_queues) { hdev 606 drivers/misc/habanalabs/hw_queue.c dev_err(hdev->dev, "Not enough memory for H/W queues\n"); hdev 611 drivers/misc/habanalabs/hw_queue.c for (i = 0, q_ready_cnt = 0, q = hdev->kernel_queues; hdev 615 drivers/misc/habanalabs/hw_queue.c rc = hw_queue_init(hdev, q, i); hdev 617 drivers/misc/habanalabs/hw_queue.c dev_err(hdev->dev, hdev 626 drivers/misc/habanalabs/hw_queue.c for (i = 0, q = hdev->kernel_queues ; i < q_ready_cnt ; i++, q++) hdev 627 drivers/misc/habanalabs/hw_queue.c hw_queue_fini(hdev, q); hdev 629 drivers/misc/habanalabs/hw_queue.c kfree(hdev->kernel_queues); hdev 634 drivers/misc/habanalabs/hw_queue.c void hl_hw_queues_destroy(struct hl_device *hdev) hdev 639 drivers/misc/habanalabs/hw_queue.c for (i = 0, q = hdev->kernel_queues ; i < HL_MAX_QUEUES ; i++, q++) hdev 640 drivers/misc/habanalabs/hw_queue.c hw_queue_fini(hdev, q); hdev 642 drivers/misc/habanalabs/hw_queue.c kfree(hdev->kernel_queues); hdev 645 drivers/misc/habanalabs/hw_queue.c void hl_hw_queue_reset(struct hl_device *hdev, bool hard_reset) hdev 650 drivers/misc/habanalabs/hw_queue.c for (i = 0, q = hdev->kernel_queues ; i < HL_MAX_QUEUES ; i++, q++) { hdev 16 drivers/misc/habanalabs/hwmon.c int hl_build_hwmon_channel_info(struct hl_device *hdev, hdev 35 drivers/misc/habanalabs/hwmon.c dev_err(hdev->dev, hdev 92 drivers/misc/habanalabs/hwmon.c hdev->hl_chip_info->info = hdev 115 drivers/misc/habanalabs/hwmon.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 117 drivers/misc/habanalabs/hwmon.c if (hl_device_disabled_or_in_reset(hdev)) hdev 133 drivers/misc/habanalabs/hwmon.c *val = hl_get_temperature(hdev, channel, attr); hdev 145 drivers/misc/habanalabs/hwmon.c *val = hl_get_voltage(hdev, channel, attr); hdev 157 drivers/misc/habanalabs/hwmon.c *val = hl_get_current(hdev, channel, attr); hdev 168 drivers/misc/habanalabs/hwmon.c *val = hl_get_fan_speed(hdev, channel, attr); hdev 178 drivers/misc/habanalabs/hwmon.c *val = hl_get_pwm_info(hdev, channel, attr); hdev 189 drivers/misc/habanalabs/hwmon.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 191 drivers/misc/habanalabs/hwmon.c if (hl_device_disabled_or_in_reset(hdev)) hdev 203 drivers/misc/habanalabs/hwmon.c hl_set_pwm_info(hdev, channel, attr, val); hdev 268 drivers/misc/habanalabs/hwmon.c long hl_get_temperature(struct hl_device *hdev, int sensor_index, u32 attr) hdev 281 drivers/misc/habanalabs/hwmon.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 285 drivers/misc/habanalabs/hwmon.c dev_err(hdev->dev, hdev 294 drivers/misc/habanalabs/hwmon.c long hl_get_voltage(struct hl_device *hdev, int sensor_index, u32 attr) hdev 307 drivers/misc/habanalabs/hwmon.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 311 drivers/misc/habanalabs/hwmon.c dev_err(hdev->dev, hdev 320 drivers/misc/habanalabs/hwmon.c long hl_get_current(struct hl_device *hdev, int sensor_index, u32 attr) hdev 333 drivers/misc/habanalabs/hwmon.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 337 drivers/misc/habanalabs/hwmon.c dev_err(hdev->dev, hdev 346 drivers/misc/habanalabs/hwmon.c long hl_get_fan_speed(struct hl_device *hdev, int sensor_index, u32 attr) hdev 359 drivers/misc/habanalabs/hwmon.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 363 drivers/misc/habanalabs/hwmon.c dev_err(hdev->dev, hdev 372 drivers/misc/habanalabs/hwmon.c long hl_get_pwm_info(struct hl_device *hdev, int sensor_index, u32 attr) hdev 385 drivers/misc/habanalabs/hwmon.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 389 drivers/misc/habanalabs/hwmon.c dev_err(hdev->dev, hdev 398 drivers/misc/habanalabs/hwmon.c void hl_set_pwm_info(struct hl_device *hdev, int sensor_index, u32 attr, hdev 412 drivers/misc/habanalabs/hwmon.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 416 drivers/misc/habanalabs/hwmon.c dev_err(hdev->dev, hdev 421 drivers/misc/habanalabs/hwmon.c int hl_hwmon_init(struct hl_device *hdev) hdev 423 drivers/misc/habanalabs/hwmon.c struct device *dev = hdev->pdev ? &hdev->pdev->dev : hdev->dev; hdev 424 drivers/misc/habanalabs/hwmon.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 427 drivers/misc/habanalabs/hwmon.c if ((hdev->hwmon_initialized) || !(hdev->fw_loading)) hdev 430 drivers/misc/habanalabs/hwmon.c if (hdev->hl_chip_info->info) { hdev 431 drivers/misc/habanalabs/hwmon.c hdev->hl_chip_info->ops = &hl_hwmon_ops; hdev 433 drivers/misc/habanalabs/hwmon.c hdev->hwmon_dev = hwmon_device_register_with_info(dev, hdev 434 drivers/misc/habanalabs/hwmon.c prop->armcp_info.card_name, hdev, hdev 435 drivers/misc/habanalabs/hwmon.c hdev->hl_chip_info, NULL); hdev 436 drivers/misc/habanalabs/hwmon.c if (IS_ERR(hdev->hwmon_dev)) { hdev 437 drivers/misc/habanalabs/hwmon.c rc = PTR_ERR(hdev->hwmon_dev); hdev 438 drivers/misc/habanalabs/hwmon.c dev_err(hdev->dev, hdev 443 drivers/misc/habanalabs/hwmon.c dev_info(hdev->dev, "%s: add sensors information\n", hdev 444 drivers/misc/habanalabs/hwmon.c dev_name(hdev->hwmon_dev)); hdev 446 drivers/misc/habanalabs/hwmon.c hdev->hwmon_initialized = true; hdev 448 drivers/misc/habanalabs/hwmon.c dev_info(hdev->dev, "no available sensors\n"); hdev 454 drivers/misc/habanalabs/hwmon.c void hl_hwmon_fini(struct hl_device *hdev) hdev 456 drivers/misc/habanalabs/hwmon.c if (!hdev->hwmon_initialized) hdev 459 drivers/misc/habanalabs/hwmon.c hwmon_device_unregister(hdev->hwmon_dev); hdev 21 drivers/misc/habanalabs/irq.c struct hl_device *hdev; hdev 61 drivers/misc/habanalabs/irq.c struct hl_device *hdev = eqe_work->hdev; hdev 63 drivers/misc/habanalabs/irq.c hdev->asic_funcs->handle_eqe(hdev, &eqe_work->eq_entry); hdev 78 drivers/misc/habanalabs/irq.c struct hl_device *hdev = cq->hdev; hdev 85 drivers/misc/habanalabs/irq.c if (hdev->disabled) { hdev 86 drivers/misc/habanalabs/irq.c dev_dbg(hdev->dev, hdev 117 drivers/misc/habanalabs/irq.c queue = &hdev->kernel_queues[cq->hw_queue_id]; hdev 119 drivers/misc/habanalabs/irq.c if ((shadow_index_valid) && (!hdev->disabled)) { hdev 121 drivers/misc/habanalabs/irq.c queue_work(hdev->cq_wq, &job->finish_work); hdev 154 drivers/misc/habanalabs/irq.c struct hl_device *hdev = eq->hdev; hdev 177 drivers/misc/habanalabs/irq.c if (hdev->disabled) { hdev 178 drivers/misc/habanalabs/irq.c dev_warn(hdev->dev, hdev 187 drivers/misc/habanalabs/irq.c handle_eqe_work->hdev = hdev; hdev 192 drivers/misc/habanalabs/irq.c queue_work(hdev->eq_wq, &handle_eqe_work->eq_work); hdev 202 drivers/misc/habanalabs/irq.c hdev->asic_funcs->update_eq_ci(hdev, eq->ci); hdev 218 drivers/misc/habanalabs/irq.c int hl_cq_init(struct hl_device *hdev, struct hl_cq *q, u32 hw_queue_id) hdev 224 drivers/misc/habanalabs/irq.c p = hdev->asic_funcs->asic_dma_alloc_coherent(hdev, HL_CQ_SIZE_IN_BYTES, hdev 229 drivers/misc/habanalabs/irq.c q->hdev = hdev; hdev 248 drivers/misc/habanalabs/irq.c void hl_cq_fini(struct hl_device *hdev, struct hl_cq *q) hdev 250 drivers/misc/habanalabs/irq.c hdev->asic_funcs->asic_dma_free_coherent(hdev, HL_CQ_SIZE_IN_BYTES, hdev 254 drivers/misc/habanalabs/irq.c void hl_cq_reset(struct hl_device *hdev, struct hl_cq *q) hdev 280 drivers/misc/habanalabs/irq.c int hl_eq_init(struct hl_device *hdev, struct hl_eq *q) hdev 286 drivers/misc/habanalabs/irq.c p = hdev->asic_funcs->cpu_accessible_dma_pool_alloc(hdev, hdev 292 drivers/misc/habanalabs/irq.c q->hdev = hdev; hdev 307 drivers/misc/habanalabs/irq.c void hl_eq_fini(struct hl_device *hdev, struct hl_eq *q) hdev 309 drivers/misc/habanalabs/irq.c flush_workqueue(hdev->eq_wq); hdev 311 drivers/misc/habanalabs/irq.c hdev->asic_funcs->cpu_accessible_dma_pool_free(hdev, hdev 316 drivers/misc/habanalabs/irq.c void hl_eq_reset(struct hl_device *hdev, struct hl_eq *q) hdev 56 drivers/misc/habanalabs/memory.c struct hl_device *hdev = ctx->hdev; hdev 57 drivers/misc/habanalabs/memory.c struct hl_vm *vm = &hdev->vm; hdev 65 drivers/misc/habanalabs/memory.c page_size = hdev->asic_prop.dram_page_size; hdev 75 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 111 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 127 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "Failed to get handle for page\n"); hdev 138 drivers/misc/habanalabs/memory.c atomic64_add(phys_pg_pack->total_size, &hdev->dram_used_mem); hdev 174 drivers/misc/habanalabs/memory.c static int get_userptr_from_host_va(struct hl_device *hdev, hdev 186 drivers/misc/habanalabs/memory.c rc = hl_pin_host_memory(hdev, args->map_host.host_virt_addr, hdev 189 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "Failed to pin host memory\n"); hdev 193 drivers/misc/habanalabs/memory.c rc = hdev->asic_funcs->asic_dma_map_sg(hdev, userptr->sgt->sgl, hdev 196 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "failed to map sgt with DMA region\n"); hdev 209 drivers/misc/habanalabs/memory.c hl_unpin_host_memory(hdev, userptr); hdev 227 drivers/misc/habanalabs/memory.c static void free_userptr(struct hl_device *hdev, struct hl_userptr *userptr) hdev 229 drivers/misc/habanalabs/memory.c hl_unpin_host_memory(hdev, userptr); hdev 266 drivers/misc/habanalabs/memory.c static void free_phys_pg_pack(struct hl_device *hdev, hdev 269 drivers/misc/habanalabs/memory.c struct hl_vm *vm = &hdev->vm; hdev 306 drivers/misc/habanalabs/memory.c struct hl_device *hdev = ctx->hdev; hdev 307 drivers/misc/habanalabs/memory.c struct hl_vm *vm = &hdev->vm; hdev 314 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "handle %u is mapped, cannot free\n", hdev 329 drivers/misc/habanalabs/memory.c atomic64_sub(phys_pg_pack->total_size, &hdev->dram_used_mem); hdev 331 drivers/misc/habanalabs/memory.c free_phys_pg_pack(hdev, phys_pg_pack); hdev 334 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 354 drivers/misc/habanalabs/memory.c static void clear_va_list_locked(struct hl_device *hdev, hdev 376 drivers/misc/habanalabs/memory.c static void print_va_list_locked(struct hl_device *hdev, hdev 382 drivers/misc/habanalabs/memory.c dev_dbg(hdev->dev, "print va list:\n"); hdev 385 drivers/misc/habanalabs/memory.c dev_dbg(hdev->dev, hdev 404 drivers/misc/habanalabs/memory.c static void merge_va_blocks_locked(struct hl_device *hdev, hdev 441 drivers/misc/habanalabs/memory.c static int add_va_block_locked(struct hl_device *hdev, hdev 447 drivers/misc/habanalabs/memory.c print_va_list_locked(hdev, va_list); hdev 453 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 476 drivers/misc/habanalabs/memory.c merge_va_blocks_locked(hdev, va_list, va_block); hdev 478 drivers/misc/habanalabs/memory.c print_va_list_locked(hdev, va_list); hdev 494 drivers/misc/habanalabs/memory.c static inline int add_va_block(struct hl_device *hdev, hdev 500 drivers/misc/habanalabs/memory.c rc = add_va_block_locked(hdev, &va_range->list, start, end); hdev 521 drivers/misc/habanalabs/memory.c static u64 get_va_block(struct hl_device *hdev, hdev 540 drivers/misc/habanalabs/memory.c page_size = hdev->asic_prop.dram_page_size; hdev 546 drivers/misc/habanalabs/memory.c print_va_list_locked(hdev, &va_range->list); hdev 580 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "no available va block for size %llu\n", hdev 604 drivers/misc/habanalabs/memory.c add_va_block_locked(hdev, &va_range->list, prev_start, hdev 607 drivers/misc/habanalabs/memory.c print_va_list_locked(hdev, &va_range->list); hdev 748 drivers/misc/habanalabs/memory.c struct hl_device *hdev = ctx->hdev; hdev 758 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 775 drivers/misc/habanalabs/memory.c dev_warn_ratelimited(hdev->dev, hdev 789 drivers/misc/habanalabs/memory.c struct hl_device *hdev = ctx->hdev; hdev 790 drivers/misc/habanalabs/memory.c struct hl_vm *vm = &hdev->vm; hdev 799 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "no match for handle %u\n", handle); hdev 827 drivers/misc/habanalabs/memory.c struct hl_device *hdev = ctx->hdev; hdev 828 drivers/misc/habanalabs/memory.c struct hl_vm *vm = &hdev->vm; hdev 842 drivers/misc/habanalabs/memory.c rc = get_userptr_from_host_va(hdev, args, &userptr); hdev 844 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "failed to get userptr from va\n"); hdev 851 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 866 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 887 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 900 drivers/misc/habanalabs/memory.c ret_vaddr = get_va_block(hdev, hdev 904 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "no available va block for handle %u\n", hdev 915 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "mapping page pack failed for handle %u\n", hdev 920 drivers/misc/habanalabs/memory.c hdev->asic_funcs->mmu_invalidate_cache(hdev, false); hdev 936 drivers/misc/habanalabs/memory.c free_phys_pg_pack(hdev, phys_pg_pack); hdev 941 drivers/misc/habanalabs/memory.c if (add_va_block(hdev, hdev 945 drivers/misc/habanalabs/memory.c dev_warn(hdev->dev, hdev 955 drivers/misc/habanalabs/memory.c free_phys_pg_pack(hdev, phys_pg_pack); hdev 958 drivers/misc/habanalabs/memory.c free_userptr(hdev, userptr); hdev 976 drivers/misc/habanalabs/memory.c struct hl_device *hdev = ctx->hdev; hdev 995 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 1013 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 1023 drivers/misc/habanalabs/memory.c dev_warn(hdev->dev, hdev 1031 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "vaddr 0x%llx is not mapped\n", vaddr); hdev 1045 drivers/misc/habanalabs/memory.c dev_warn_ratelimited(hdev->dev, hdev 1051 drivers/misc/habanalabs/memory.c if (hdev->pldm) hdev 1055 drivers/misc/habanalabs/memory.c hdev->asic_funcs->mmu_invalidate_cache(hdev, true); hdev 1064 drivers/misc/habanalabs/memory.c rc = add_va_block(hdev, va_range, vaddr, hdev 1067 drivers/misc/habanalabs/memory.c dev_warn(hdev->dev, hdev 1076 drivers/misc/habanalabs/memory.c free_phys_pg_pack(hdev, phys_pg_pack); hdev 1077 drivers/misc/habanalabs/memory.c free_userptr(hdev, userptr); hdev 1084 drivers/misc/habanalabs/memory.c free_phys_pg_pack(hdev, phys_pg_pack); hdev 1095 drivers/misc/habanalabs/memory.c struct hl_device *hdev = hpriv->hdev; hdev 1104 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 1142 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "Unknown opcode for memory IOCTL\n"); hdev 1154 drivers/misc/habanalabs/memory.c struct hl_device *hdev = hpriv->hdev; hdev 1160 drivers/misc/habanalabs/memory.c if (hl_device_disabled_or_in_reset(hdev)) { hdev 1161 drivers/misc/habanalabs/memory.c dev_warn_ratelimited(hdev->dev, hdev 1163 drivers/misc/habanalabs/memory.c atomic_read(&hdev->in_reset) ? "in_reset" : "disabled"); hdev 1167 drivers/misc/habanalabs/memory.c if (!hdev->mmu_enable) hdev 1172 drivers/misc/habanalabs/memory.c if (!hdev->dram_supports_virtual_memory) { hdev 1173 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "DRAM alloc is not supported\n"); hdev 1179 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 1207 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "Unknown opcode for memory IOCTL\n"); hdev 1228 drivers/misc/habanalabs/memory.c int hl_pin_host_memory(struct hl_device *hdev, u64 addr, u64 size, hdev 1236 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "size to pin is invalid - %llu\n", size); hdev 1241 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "user pointer is invalid - 0x%llx\n", addr); hdev 1251 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 1269 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "Failed to create frame vector\n"); hdev 1277 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 1286 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 1302 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "failed to create SG table from pages\n"); hdev 1306 drivers/misc/habanalabs/memory.c hl_debugfs_add_userptr(hdev, userptr); hdev 1329 drivers/misc/habanalabs/memory.c int hl_unpin_host_memory(struct hl_device *hdev, struct hl_userptr *userptr) hdev 1333 drivers/misc/habanalabs/memory.c hl_debugfs_remove_userptr(hdev, userptr); hdev 1336 drivers/misc/habanalabs/memory.c hdev->asic_funcs->hl_dma_unmap_sg(hdev, hdev 1369 drivers/misc/habanalabs/memory.c void hl_userptr_delete_list(struct hl_device *hdev, hdev 1375 drivers/misc/habanalabs/memory.c hl_unpin_host_memory(hdev, userptr); hdev 1393 drivers/misc/habanalabs/memory.c bool hl_userptr_is_pinned(struct hl_device *hdev, u64 addr, hdev 1417 drivers/misc/habanalabs/memory.c static int hl_va_range_init(struct hl_device *hdev, hdev 1435 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "too small vm range for va list\n"); hdev 1439 drivers/misc/habanalabs/memory.c rc = add_va_block(hdev, va_range, start, end); hdev 1442 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "Failed to init host va list\n"); hdev 1470 drivers/misc/habanalabs/memory.c struct hl_device *hdev = ctx->hdev; hdev 1475 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "failed to init context %d\n", ctx->asid); hdev 1484 drivers/misc/habanalabs/memory.c rc = hl_va_range_init(hdev, &ctx->host_va_range, host_range_start, hdev 1487 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "failed to init host vm range\n"); hdev 1493 drivers/misc/habanalabs/memory.c rc = hl_va_range_init(hdev, &ctx->dram_va_range, dram_range_start, hdev 1496 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "failed to init dram vm range\n"); hdev 1500 drivers/misc/habanalabs/memory.c hl_debugfs_add_ctx_mem_hash(hdev, ctx); hdev 1508 drivers/misc/habanalabs/memory.c clear_va_list_locked(hdev, &ctx->host_va_range.list); hdev 1520 drivers/misc/habanalabs/memory.c struct asic_fixed_properties *prop = &ctx->hdev->asic_prop; hdev 1533 drivers/misc/habanalabs/memory.c if (ctx->hdev->mmu_enable) { hdev 1559 drivers/misc/habanalabs/memory.c static void hl_va_range_fini(struct hl_device *hdev, hdev 1565 drivers/misc/habanalabs/memory.c dev_warn(hdev->dev, hdev 1571 drivers/misc/habanalabs/memory.c dev_warn(hdev->dev, hdev 1580 drivers/misc/habanalabs/memory.c dev_warn(hdev->dev, hdev 1588 drivers/misc/habanalabs/memory.c clear_va_list_locked(hdev, &va_range->list); hdev 1617 drivers/misc/habanalabs/memory.c struct hl_device *hdev = ctx->hdev; hdev 1618 drivers/misc/habanalabs/memory.c struct hl_vm *vm = &hdev->vm; hdev 1624 drivers/misc/habanalabs/memory.c hl_debugfs_remove_ctx_mem_hash(hdev, ctx); hdev 1627 drivers/misc/habanalabs/memory.c dev_notice(hdev->dev, "ctx is freed while it has va in use\n"); hdev 1630 drivers/misc/habanalabs/memory.c dev_dbg(hdev->dev, hdev 1639 drivers/misc/habanalabs/memory.c dev_dbg(hdev->dev, hdev 1643 drivers/misc/habanalabs/memory.c &hdev->dram_used_mem); hdev 1644 drivers/misc/habanalabs/memory.c free_phys_pg_pack(hdev, phys_pg_list); hdev 1649 drivers/misc/habanalabs/memory.c hl_va_range_fini(hdev, &ctx->dram_va_range); hdev 1650 drivers/misc/habanalabs/memory.c hl_va_range_fini(hdev, &ctx->host_va_range); hdev 1666 drivers/misc/habanalabs/memory.c int hl_vm_init(struct hl_device *hdev) hdev 1668 drivers/misc/habanalabs/memory.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 1669 drivers/misc/habanalabs/memory.c struct hl_vm *vm = &hdev->vm; hdev 1674 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, "Failed to create dram page pool\n"); hdev 1685 drivers/misc/habanalabs/memory.c dev_err(hdev->dev, hdev 1693 drivers/misc/habanalabs/memory.c atomic64_set(&hdev->dram_used_mem, 0); hdev 1715 drivers/misc/habanalabs/memory.c void hl_vm_fini(struct hl_device *hdev) hdev 1717 drivers/misc/habanalabs/memory.c struct hl_vm *vm = &hdev->vm; hdev 1727 drivers/misc/habanalabs/memory.c dev_warn(hdev->dev, "dram_pg_pool was not destroyed on %s\n", hdev 30 drivers/misc/habanalabs/mmu.c struct hl_device *hdev = ctx->hdev; hdev 33 drivers/misc/habanalabs/mmu.c gen_pool_free(hdev->mmu_pgt_pool, pgt_info->phys_addr, hdev 34 drivers/misc/habanalabs/mmu.c hdev->asic_prop.mmu_hop_table_size); hdev 42 drivers/misc/habanalabs/mmu.c struct hl_device *hdev = ctx->hdev; hdev 43 drivers/misc/habanalabs/mmu.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 51 drivers/misc/habanalabs/mmu.c phys_addr = (u64) gen_pool_alloc(hdev->mmu_pgt_pool, hdev 54 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, "failed to allocate page\n"); hdev 72 drivers/misc/habanalabs/mmu.c gen_pool_free(hdev->mmu_pgt_pool, phys_addr, prop->mmu_hop_table_size); hdev 81 drivers/misc/habanalabs/mmu.c return ctx->hdev->asic_prop.mmu_pgt_addr + hdev 82 drivers/misc/habanalabs/mmu.c (ctx->asid * ctx->hdev->asic_prop.mmu_hop_table_size); hdev 87 drivers/misc/habanalabs/mmu.c return (u64) (uintptr_t) ctx->hdev->mmu_shadow_hop0 + hdev 88 drivers/misc/habanalabs/mmu.c (ctx->asid * ctx->hdev->asic_prop.mmu_hop_table_size); hdev 95 drivers/misc/habanalabs/mmu.c ctx->hdev->asic_funcs->read_pte(ctx->hdev, get_phys_hop0_addr(ctx)); hdev 111 drivers/misc/habanalabs/mmu.c ctx->hdev->asic_funcs->write_pte(ctx->hdev, hdev 122 drivers/misc/habanalabs/mmu.c ctx->hdev->asic_funcs->write_pte(ctx->hdev, hdev 170 drivers/misc/habanalabs/mmu.c return hop_addr + ctx->hdev->asic_prop.mmu_pte_size * hdev 223 drivers/misc/habanalabs/mmu.c u64 page_mask = (ctx->hdev->asic_prop.mmu_hop_table_size - 1); hdev 238 drivers/misc/habanalabs/mmu.c struct hl_device *hdev = ctx->hdev; hdev 239 drivers/misc/habanalabs/mmu.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 244 drivers/misc/habanalabs/mmu.c if ((!hdev->dram_supports_virtual_memory) || hdev 245 drivers/misc/habanalabs/mmu.c (!hdev->dram_default_page_mapping) || hdev 264 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, "failed to alloc hop 1\n"); hdev 273 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, "failed to alloc hop 2\n"); hdev 283 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, "failed to alloc hop 3, i: %d\n", i); hdev 338 drivers/misc/habanalabs/mmu.c struct hl_device *hdev = ctx->hdev; hdev 339 drivers/misc/habanalabs/mmu.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 344 drivers/misc/habanalabs/mmu.c if ((!hdev->dram_supports_virtual_memory) || hdev 345 drivers/misc/habanalabs/mmu.c (!hdev->dram_default_page_mapping) || hdev 395 drivers/misc/habanalabs/mmu.c int hl_mmu_init(struct hl_device *hdev) hdev 397 drivers/misc/habanalabs/mmu.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 400 drivers/misc/habanalabs/mmu.c if (!hdev->mmu_enable) hdev 405 drivers/misc/habanalabs/mmu.c hdev->mmu_pgt_pool = hdev 408 drivers/misc/habanalabs/mmu.c if (!hdev->mmu_pgt_pool) { hdev 409 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, "Failed to create page gen pool\n"); hdev 413 drivers/misc/habanalabs/mmu.c rc = gen_pool_add(hdev->mmu_pgt_pool, prop->mmu_pgt_addr + hdev 418 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, "Failed to add memory to page gen pool\n"); hdev 422 drivers/misc/habanalabs/mmu.c hdev->mmu_shadow_hop0 = kvmalloc_array(prop->max_asid, hdev 425 drivers/misc/habanalabs/mmu.c if (!hdev->mmu_shadow_hop0) { hdev 433 drivers/misc/habanalabs/mmu.c gen_pool_destroy(hdev->mmu_pgt_pool); hdev 448 drivers/misc/habanalabs/mmu.c void hl_mmu_fini(struct hl_device *hdev) hdev 450 drivers/misc/habanalabs/mmu.c if (!hdev->mmu_enable) hdev 453 drivers/misc/habanalabs/mmu.c kvfree(hdev->mmu_shadow_hop0); hdev 454 drivers/misc/habanalabs/mmu.c gen_pool_destroy(hdev->mmu_pgt_pool); hdev 469 drivers/misc/habanalabs/mmu.c struct hl_device *hdev = ctx->hdev; hdev 471 drivers/misc/habanalabs/mmu.c if (!hdev->mmu_enable) hdev 493 drivers/misc/habanalabs/mmu.c struct hl_device *hdev = ctx->hdev; hdev 498 drivers/misc/habanalabs/mmu.c if (!hdev->mmu_enable) hdev 504 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, "ctx is freed while it has pgts in use\n"); hdev 507 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, hdev 518 drivers/misc/habanalabs/mmu.c struct hl_device *hdev = ctx->hdev; hdev 519 drivers/misc/habanalabs/mmu.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 567 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, hdev 585 drivers/misc/habanalabs/mmu.c if (hdev->dram_default_page_mapping && is_dram_addr) { hdev 590 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, hdev 597 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, hdev 644 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, "virt addr 0x%llx is not mapped to phys addr\n", hdev 669 drivers/misc/habanalabs/mmu.c struct hl_device *hdev = ctx->hdev; hdev 674 drivers/misc/habanalabs/mmu.c if (!hdev->mmu_enable) hdev 686 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, hdev 710 drivers/misc/habanalabs/mmu.c struct hl_device *hdev = ctx->hdev; hdev 711 drivers/misc/habanalabs/mmu.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 736 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, "DRAM mapping should use huge pages only\n"); hdev 774 drivers/misc/habanalabs/mmu.c if (hdev->dram_default_page_mapping && is_dram_addr) { hdev 780 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, hdev 788 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, hdev 794 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, hdev 798 drivers/misc/habanalabs/mmu.c dev_dbg(hdev->dev, "hop0 pte: 0x%llx (0x%llx)\n", hdev 800 drivers/misc/habanalabs/mmu.c dev_dbg(hdev->dev, "hop1 pte: 0x%llx (0x%llx)\n", hdev 802 drivers/misc/habanalabs/mmu.c dev_dbg(hdev->dev, "hop2 pte: 0x%llx (0x%llx)\n", hdev 804 drivers/misc/habanalabs/mmu.c dev_dbg(hdev->dev, "hop3 pte: 0x%llx (0x%llx)\n", hdev 808 drivers/misc/habanalabs/mmu.c dev_dbg(hdev->dev, "hop4 pte: 0x%llx (0x%llx)\n", hdev 892 drivers/misc/habanalabs/mmu.c struct hl_device *hdev = ctx->hdev; hdev 897 drivers/misc/habanalabs/mmu.c if (!hdev->mmu_enable) hdev 909 drivers/misc/habanalabs/mmu.c dev_err(hdev->dev, hdev 941 drivers/misc/habanalabs/mmu.c dev_warn_ratelimited(hdev->dev, hdev 25 drivers/misc/habanalabs/pci.c int hl_pci_bars_map(struct hl_device *hdev, const char * const name[3], hdev 28 drivers/misc/habanalabs/pci.c struct pci_dev *pdev = hdev->pdev; hdev 33 drivers/misc/habanalabs/pci.c dev_err(hdev->dev, "Cannot obtain PCI resources\n"); hdev 39 drivers/misc/habanalabs/pci.c hdev->pcie_bar[bar] = is_wc[i] ? hdev 42 drivers/misc/habanalabs/pci.c if (!hdev->pcie_bar[bar]) { hdev 43 drivers/misc/habanalabs/pci.c dev_err(hdev->dev, "pci_ioremap%s_bar failed for %s\n", hdev 55 drivers/misc/habanalabs/pci.c if (hdev->pcie_bar[bar]) hdev 56 drivers/misc/habanalabs/pci.c iounmap(hdev->pcie_bar[bar]); hdev 70 drivers/misc/habanalabs/pci.c static void hl_pci_bars_unmap(struct hl_device *hdev) hdev 72 drivers/misc/habanalabs/pci.c struct pci_dev *pdev = hdev->pdev; hdev 77 drivers/misc/habanalabs/pci.c iounmap(hdev->pcie_bar[bar]); hdev 89 drivers/misc/habanalabs/pci.c static int hl_pci_elbi_write(struct hl_device *hdev, u64 addr, u32 data) hdev 91 drivers/misc/habanalabs/pci.c struct pci_dev *pdev = hdev->pdev; hdev 96 drivers/misc/habanalabs/pci.c if (hdev->pldm) hdev 127 drivers/misc/habanalabs/pci.c dev_err(hdev->dev, "Error writing to ELBI\n"); hdev 132 drivers/misc/habanalabs/pci.c dev_err(hdev->dev, "ELBI write didn't finish in time\n"); hdev 136 drivers/misc/habanalabs/pci.c dev_err(hdev->dev, "ELBI write has undefined bits in status\n"); hdev 146 drivers/misc/habanalabs/pci.c int hl_pci_iatu_write(struct hl_device *hdev, u32 addr, u32 data) hdev 148 drivers/misc/habanalabs/pci.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 154 drivers/misc/habanalabs/pci.c rc = hl_pci_elbi_write(hdev, prop->pcie_aux_dbi_reg_addr, 0x00300000); hdev 155 drivers/misc/habanalabs/pci.c rc |= hl_pci_elbi_write(hdev, prop->pcie_dbi_base_address + dbi_offset, hdev 168 drivers/misc/habanalabs/pci.c static void hl_pci_reset_link_through_bridge(struct hl_device *hdev) hdev 170 drivers/misc/habanalabs/pci.c struct pci_dev *pdev = hdev->pdev; hdev 196 drivers/misc/habanalabs/pci.c int hl_pci_set_dram_bar_base(struct hl_device *hdev, u8 inbound_region, u8 bar, hdev 199 drivers/misc/habanalabs/pci.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 214 drivers/misc/habanalabs/pci.c dev_err(hdev->dev, "Invalid inbound region %d\n", hdev 220 drivers/misc/habanalabs/pci.c dev_err(hdev->dev, "Invalid PCI BAR %d\n", bar); hdev 225 drivers/misc/habanalabs/pci.c rc = hl_pci_iatu_write(hdev, offset + 0x14, lower_32_bits(addr)); hdev 226 drivers/misc/habanalabs/pci.c rc |= hl_pci_iatu_write(hdev, offset + 0x18, upper_32_bits(addr)); hdev 227 drivers/misc/habanalabs/pci.c rc |= hl_pci_iatu_write(hdev, offset + 0x0, 0); hdev 229 drivers/misc/habanalabs/pci.c rc |= hl_pci_iatu_write(hdev, offset + 0x4, 0xC0080000 | (bar << 8)); hdev 232 drivers/misc/habanalabs/pci.c rc |= hl_pci_elbi_write(hdev, prop->pcie_aux_dbi_reg_addr, 0); hdev 233 drivers/misc/habanalabs/pci.c rc |= hl_pci_elbi_write(hdev, prop->pcie_aux_dbi_reg_addr + 4, 0); hdev 236 drivers/misc/habanalabs/pci.c dev_err(hdev->dev, "failed to map DRAM bar to 0x%08llx\n", hdev 255 drivers/misc/habanalabs/pci.c int hl_pci_init_iatu(struct hl_device *hdev, u64 sram_base_address, hdev 259 drivers/misc/habanalabs/pci.c struct asic_fixed_properties *prop = &hdev->asic_prop; hdev 264 drivers/misc/habanalabs/pci.c rc = hl_pci_iatu_write(hdev, 0x114, lower_32_bits(sram_base_address)); hdev 265 drivers/misc/habanalabs/pci.c rc |= hl_pci_iatu_write(hdev, 0x118, upper_32_bits(sram_base_address)); hdev 266 drivers/misc/habanalabs/pci.c rc |= hl_pci_iatu_write(hdev, 0x100, 0); hdev 268 drivers/misc/habanalabs/pci.c rc |= hl_pci_iatu_write(hdev, 0x104, 0xC0080000); hdev 271 drivers/misc/habanalabs/pci.c if (!hdev->asic_funcs->set_dram_bar_base) hdev 273 drivers/misc/habanalabs/pci.c if (hdev->asic_funcs->set_dram_bar_base(hdev, dram_base_address) == hdev 280 drivers/misc/habanalabs/pci.c rc |= hl_pci_iatu_write(hdev, 0x008, hdev 282 drivers/misc/habanalabs/pci.c rc |= hl_pci_iatu_write(hdev, 0x00C, hdev 284 drivers/misc/habanalabs/pci.c rc |= hl_pci_iatu_write(hdev, 0x010, lower_32_bits(host_phys_end_addr)); hdev 285 drivers/misc/habanalabs/pci.c rc |= hl_pci_iatu_write(hdev, 0x014, 0); hdev 286 drivers/misc/habanalabs/pci.c rc |= hl_pci_iatu_write(hdev, 0x018, 0); hdev 287 drivers/misc/habanalabs/pci.c rc |= hl_pci_iatu_write(hdev, 0x020, upper_32_bits(host_phys_end_addr)); hdev 289 drivers/misc/habanalabs/pci.c rc |= hl_pci_iatu_write(hdev, 0x000, 0x00002000); hdev 291 drivers/misc/habanalabs/pci.c rc |= hl_pci_iatu_write(hdev, 0x004, 0x80000000); hdev 294 drivers/misc/habanalabs/pci.c rc |= hl_pci_elbi_write(hdev, prop->pcie_aux_dbi_reg_addr, 0); hdev 295 drivers/misc/habanalabs/pci.c rc |= hl_pci_elbi_write(hdev, prop->pcie_aux_dbi_reg_addr + 4, 0); hdev 313 drivers/misc/habanalabs/pci.c int hl_pci_set_dma_mask(struct hl_device *hdev, u8 dma_mask) hdev 315 drivers/misc/habanalabs/pci.c struct pci_dev *pdev = hdev->pdev; hdev 321 drivers/misc/habanalabs/pci.c dev_warn(hdev->dev, hdev 325 drivers/misc/habanalabs/pci.c dma_mask = hdev->dma_mask; hdev 329 drivers/misc/habanalabs/pci.c dev_err(hdev->dev, hdev 341 drivers/misc/habanalabs/pci.c hdev->dma_mask = dma_mask; hdev 345 drivers/misc/habanalabs/pci.c dev_err(hdev->dev, hdev 363 drivers/misc/habanalabs/pci.c int hl_pci_init(struct hl_device *hdev, u8 dma_mask) hdev 365 drivers/misc/habanalabs/pci.c struct pci_dev *pdev = hdev->pdev; hdev 368 drivers/misc/habanalabs/pci.c rc = hl_pci_set_dma_mask(hdev, dma_mask); hdev 372 drivers/misc/habanalabs/pci.c if (hdev->reset_pcilink) hdev 373 drivers/misc/habanalabs/pci.c hl_pci_reset_link_through_bridge(hdev); hdev 377 drivers/misc/habanalabs/pci.c dev_err(hdev->dev, "can't enable PCI device\n"); hdev 383 drivers/misc/habanalabs/pci.c rc = hdev->asic_funcs->init_iatu(hdev); hdev 385 drivers/misc/habanalabs/pci.c dev_err(hdev->dev, "Failed to initialize iATU\n"); hdev 389 drivers/misc/habanalabs/pci.c rc = hdev->asic_funcs->pci_bars_map(hdev); hdev 391 drivers/misc/habanalabs/pci.c dev_err(hdev->dev, "Failed to initialize PCI BARs\n"); hdev 410 drivers/misc/habanalabs/pci.c void hl_pci_fini(struct hl_device *hdev) hdev 412 drivers/misc/habanalabs/pci.c hl_pci_bars_unmap(hdev); hdev 414 drivers/misc/habanalabs/pci.c pci_clear_master(hdev->pdev); hdev 415 drivers/misc/habanalabs/pci.c pci_disable_device(hdev->pdev); hdev 15 drivers/misc/habanalabs/sysfs.c long hl_get_frequency(struct hl_device *hdev, u32 pll_index, bool curr) hdev 31 drivers/misc/habanalabs/sysfs.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 35 drivers/misc/habanalabs/sysfs.c dev_err(hdev->dev, hdev 44 drivers/misc/habanalabs/sysfs.c void hl_set_frequency(struct hl_device *hdev, u32 pll_index, u64 freq) hdev 56 drivers/misc/habanalabs/sysfs.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 60 drivers/misc/habanalabs/sysfs.c dev_err(hdev->dev, hdev 65 drivers/misc/habanalabs/sysfs.c u64 hl_get_max_power(struct hl_device *hdev) hdev 76 drivers/misc/habanalabs/sysfs.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 80 drivers/misc/habanalabs/sysfs.c dev_err(hdev->dev, "Failed to get max power, error %d\n", rc); hdev 87 drivers/misc/habanalabs/sysfs.c void hl_set_max_power(struct hl_device *hdev, u64 value) hdev 98 drivers/misc/habanalabs/sysfs.c rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), hdev 102 drivers/misc/habanalabs/sysfs.c dev_err(hdev->dev, "Failed to set max power, error %d\n", rc); hdev 108 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 110 drivers/misc/habanalabs/sysfs.c return sprintf(buf, "%s\n", hdev->asic_prop.uboot_ver); hdev 116 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 118 drivers/misc/habanalabs/sysfs.c return sprintf(buf, "%s", hdev->asic_prop.armcp_info.kernel_version); hdev 124 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 126 drivers/misc/habanalabs/sysfs.c return sprintf(buf, "%s\n", hdev->asic_prop.armcp_info.armcp_version); hdev 132 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 135 drivers/misc/habanalabs/sysfs.c hdev->asic_prop.armcp_info.cpld_version); hdev 141 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 144 drivers/misc/habanalabs/sysfs.c hdev->asic_prop.armcp_info.infineon_version); hdev 150 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 152 drivers/misc/habanalabs/sysfs.c return sprintf(buf, "%s\n", hdev->asic_prop.armcp_info.fuse_version); hdev 158 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 160 drivers/misc/habanalabs/sysfs.c return sprintf(buf, "%s", hdev->asic_prop.armcp_info.thermal_version); hdev 166 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 168 drivers/misc/habanalabs/sysfs.c return sprintf(buf, "%s\n", hdev->asic_prop.preboot_ver); hdev 175 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 186 drivers/misc/habanalabs/sysfs.c hl_device_reset(hdev, false, false); hdev 196 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 207 drivers/misc/habanalabs/sysfs.c hl_device_reset(hdev, true, false); hdev 216 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 219 drivers/misc/habanalabs/sysfs.c switch (hdev->asic_type) { hdev 224 drivers/misc/habanalabs/sysfs.c dev_err(hdev->dev, "Unrecognized ASIC type %d\n", hdev 225 drivers/misc/habanalabs/sysfs.c hdev->asic_type); hdev 235 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 238 drivers/misc/habanalabs/sysfs.c pci_domain_nr(hdev->pdev->bus), hdev 239 drivers/misc/habanalabs/sysfs.c hdev->pdev->bus->number, hdev 240 drivers/misc/habanalabs/sysfs.c PCI_SLOT(hdev->pdev->devfn), hdev 241 drivers/misc/habanalabs/sysfs.c PCI_FUNC(hdev->pdev->devfn)); hdev 247 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 250 drivers/misc/habanalabs/sysfs.c if (atomic_read(&hdev->in_reset)) hdev 252 drivers/misc/habanalabs/sysfs.c else if (hdev->disabled) hdev 263 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 265 drivers/misc/habanalabs/sysfs.c return sprintf(buf, "%d\n", hdev->soft_reset_cnt); hdev 271 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 273 drivers/misc/habanalabs/sysfs.c return sprintf(buf, "%d\n", hdev->hard_reset_cnt); hdev 279 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 282 drivers/misc/habanalabs/sysfs.c if (hl_device_disabled_or_in_reset(hdev)) hdev 285 drivers/misc/habanalabs/sysfs.c val = hl_get_max_power(hdev); hdev 293 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 297 drivers/misc/habanalabs/sysfs.c if (hl_device_disabled_or_in_reset(hdev)) { hdev 309 drivers/misc/habanalabs/sysfs.c hdev->max_power = value; hdev 310 drivers/misc/habanalabs/sysfs.c hl_set_max_power(hdev, value); hdev 321 drivers/misc/habanalabs/sysfs.c struct hl_device *hdev = dev_get_drvdata(dev); hdev 332 drivers/misc/habanalabs/sysfs.c rc = hdev->asic_funcs->get_eeprom_data(hdev, data, max_size); hdev 405 drivers/misc/habanalabs/sysfs.c int hl_sysfs_init(struct hl_device *hdev) hdev 409 drivers/misc/habanalabs/sysfs.c hdev->pm_mng_profile = PM_AUTO; hdev 410 drivers/misc/habanalabs/sysfs.c hdev->max_power = hdev->asic_prop.max_power_default; hdev 412 drivers/misc/habanalabs/sysfs.c hdev->asic_funcs->add_device_attr(hdev, &hl_dev_clks_attr_group); hdev 414 drivers/misc/habanalabs/sysfs.c rc = device_add_groups(hdev->dev, hl_dev_attr_groups); hdev 416 drivers/misc/habanalabs/sysfs.c dev_err(hdev->dev, hdev 424 drivers/misc/habanalabs/sysfs.c void hl_sysfs_fini(struct hl_device *hdev) hdev 426 drivers/misc/habanalabs/sysfs.c device_remove_groups(hdev->dev, hl_dev_attr_groups); hdev 333 drivers/net/ethernet/google/gve/gve_adminq.c struct device *hdev = &priv->pdev->dev; hdev 343 drivers/net/ethernet/google/gve/gve_adminq.c page_list = dma_alloc_coherent(hdev, size, &page_list_bus, GFP_KERNEL); hdev 358 drivers/net/ethernet/google/gve/gve_adminq.c dma_free_coherent(hdev, size, page_list, page_list_bus); hdev 100 drivers/net/ethernet/google/gve/gve_rx.c struct device *hdev = &priv->pdev->dev; hdev 118 drivers/net/ethernet/google/gve/gve_rx.c rx->data.data_ring = dma_alloc_coherent(hdev, bytes, hdev 134 drivers/net/ethernet/google/gve/gve_rx.c dma_alloc_coherent(hdev, hdev 153 drivers/net/ethernet/google/gve/gve_rx.c rx->desc.desc_ring = dma_alloc_coherent(hdev, bytes, &rx->desc.bus, hdev 167 drivers/net/ethernet/google/gve/gve_rx.c dma_free_coherent(hdev, sizeof(*rx->q_resources), hdev 174 drivers/net/ethernet/google/gve/gve_rx.c dma_free_coherent(hdev, bytes, rx->data.data_ring, rx->data.data_bus); hdev 148 drivers/net/ethernet/google/gve/gve_tx.c struct device *hdev = &priv->pdev->dev; hdev 157 drivers/net/ethernet/google/gve/gve_tx.c dma_free_coherent(hdev, sizeof(*tx->q_resources), hdev 166 drivers/net/ethernet/google/gve/gve_tx.c dma_free_coherent(hdev, bytes, tx->desc, tx->bus); hdev 188 drivers/net/ethernet/google/gve/gve_tx.c struct device *hdev = &priv->pdev->dev; hdev 205 drivers/net/ethernet/google/gve/gve_tx.c tx->desc = dma_alloc_coherent(hdev, bytes, &tx->bus, GFP_KERNEL); hdev 216 drivers/net/ethernet/google/gve/gve_tx.c dma_alloc_coherent(hdev, hdev 233 drivers/net/ethernet/google/gve/gve_tx.c dma_free_coherent(hdev, bytes, tx->desc, tx->bus); hdev 97 drivers/net/ethernet/hisilicon/hns/hnae.c struct hnae_ae_dev *hdev = cls_to_ae_dev(dev); hdev 99 drivers/net/ethernet/hisilicon/hns/hnae.c if (dev_of_node(hdev->dev)) hdev 100 drivers/net/ethernet/hisilicon/hns/hnae.c return (data == &hdev->dev->of_node->fwnode); hdev 101 drivers/net/ethernet/hisilicon/hns/hnae.c else if (is_acpi_node(hdev->dev->fwnode)) hdev 102 drivers/net/ethernet/hisilicon/hns/hnae.c return (data == hdev->dev->fwnode); hdev 402 drivers/net/ethernet/hisilicon/hns/hnae.c int hnae_ae_register(struct hnae_ae_dev *hdev, struct module *owner) hdev 407 drivers/net/ethernet/hisilicon/hns/hnae.c if (!hdev->dev) hdev 410 drivers/net/ethernet/hisilicon/hns/hnae.c if (!hdev->ops || !hdev->ops->get_handle || hdev 411 drivers/net/ethernet/hisilicon/hns/hnae.c !hdev->ops->toggle_ring_irq || hdev 412 drivers/net/ethernet/hisilicon/hns/hnae.c !hdev->ops->get_status || !hdev->ops->adjust_link) hdev 415 drivers/net/ethernet/hisilicon/hns/hnae.c hdev->owner = owner; hdev 416 drivers/net/ethernet/hisilicon/hns/hnae.c hdev->id = (int)atomic_inc_return(&id); hdev 417 drivers/net/ethernet/hisilicon/hns/hnae.c hdev->cls_dev.parent = hdev->dev; hdev 418 drivers/net/ethernet/hisilicon/hns/hnae.c hdev->cls_dev.class = hnae_class; hdev 419 drivers/net/ethernet/hisilicon/hns/hnae.c hdev->cls_dev.release = hnae_release; hdev 420 drivers/net/ethernet/hisilicon/hns/hnae.c (void)dev_set_name(&hdev->cls_dev, "hnae%d", hdev->id); hdev 421 drivers/net/ethernet/hisilicon/hns/hnae.c ret = device_register(&hdev->cls_dev); hdev 427 drivers/net/ethernet/hisilicon/hns/hnae.c INIT_LIST_HEAD(&hdev->handle_list); hdev 428 drivers/net/ethernet/hisilicon/hns/hnae.c spin_lock_init(&hdev->lock); hdev 432 drivers/net/ethernet/hisilicon/hns/hnae.c dev_dbg(hdev->dev, hdev 433 drivers/net/ethernet/hisilicon/hns/hnae.c "has not notifier for AE: %s\n", hdev->name); hdev 443 drivers/net/ethernet/hisilicon/hns/hnae.c void hnae_ae_unregister(struct hnae_ae_dev *hdev) hdev 445 drivers/net/ethernet/hisilicon/hns/hnae.c device_unregister(&hdev->cls_dev); hdev 116 drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h struct hclgevf_dev *hdev; hdev 62 drivers/net/ethernet/hisilicon/hns3/hnae3.h #define hnae3_dev_roce_supported(hdev) \ hdev 63 drivers/net/ethernet/hisilicon/hns3/hnae3.h hnae3_get_bit((hdev)->ae_dev->flag, HNAE3_DEV_SUPPORT_ROCE_B) hdev 65 drivers/net/ethernet/hisilicon/hns3/hnae3.h #define hnae3_dev_dcb_supported(hdev) \ hdev 66 drivers/net/ethernet/hisilicon/hns3/hnae3.h hnae3_get_bit((hdev)->ae_dev->flag, HNAE3_DEV_SUPPORT_DCB_B) hdev 68 drivers/net/ethernet/hisilicon/hns3/hnae3.h #define hnae3_dev_fd_supported(hdev) \ hdev 69 drivers/net/ethernet/hisilicon/hns3/hnae3.h hnae3_get_bit((hdev)->ae_dev->flag, HNAE3_DEV_SUPPORT_FD_B) hdev 71 drivers/net/ethernet/hisilicon/hns3/hnae3.h #define hnae3_dev_gro_supported(hdev) \ hdev 72 drivers/net/ethernet/hisilicon/hns3/hnae3.h hnae3_get_bit((hdev)->ae_dev->flag, HNAE3_DEV_SUPPORT_GRO_B) hdev 61 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c static int hclge_alloc_cmd_queue(struct hclge_dev *hdev, int ring_type) hdev 63 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c struct hclge_hw *hw = &hdev->hw; hdev 69 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c ring->dev = hdev; hdev 73 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c dev_err(&hdev->pdev->dev, "descriptor %s alloc error %d\n", hdev 104 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c struct hclge_dev *hdev = ring->dev; hdev 105 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c struct hclge_hw *hw = &hdev->hw; hdev 139 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c struct hclge_dev *hdev = container_of(hw, struct hclge_dev, hw); hdev 148 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c dev_warn(&hdev->pdev->dev, "wrong cmd head (%d, %d-%d)\n", head, hdev 150 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c dev_warn(&hdev->pdev->dev, hdev 152 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c set_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state); hdev 153 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c dev_warn(&hdev->pdev->dev, hdev 260 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c struct hclge_dev *hdev = container_of(hw, struct hclge_dev, hw); hdev 271 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c if (test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state)) { hdev 328 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c dev_warn(&hdev->pdev->dev, hdev 353 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c int hclge_cmd_queue_init(struct hclge_dev *hdev) hdev 358 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c spin_lock_init(&hdev->hw.cmq.csq.lock); hdev 359 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c spin_lock_init(&hdev->hw.cmq.crq.lock); hdev 362 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c hdev->hw.cmq.csq.desc_num = HCLGE_NIC_CMQ_DESC_NUM; hdev 363 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c hdev->hw.cmq.crq.desc_num = HCLGE_NIC_CMQ_DESC_NUM; hdev 366 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c hdev->hw.cmq.tx_timeout = HCLGE_CMDQ_TX_TIMEOUT; hdev 369 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c ret = hclge_alloc_cmd_queue(hdev, HCLGE_TYPE_CSQ); hdev 371 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c dev_err(&hdev->pdev->dev, hdev 376 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c ret = hclge_alloc_cmd_queue(hdev, HCLGE_TYPE_CRQ); hdev 378 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c dev_err(&hdev->pdev->dev, hdev 385 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c hclge_free_cmd_desc(&hdev->hw.cmq.csq); hdev 389 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c static int hclge_firmware_compat_config(struct hclge_dev *hdev) hdev 403 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 406 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c int hclge_cmd_init(struct hclge_dev *hdev) hdev 411 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c spin_lock_bh(&hdev->hw.cmq.csq.lock); hdev 412 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c spin_lock(&hdev->hw.cmq.crq.lock); hdev 414 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c hdev->hw.cmq.csq.next_to_clean = 0; hdev 415 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c hdev->hw.cmq.csq.next_to_use = 0; hdev 416 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c hdev->hw.cmq.crq.next_to_clean = 0; hdev 417 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c hdev->hw.cmq.crq.next_to_use = 0; hdev 419 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c hclge_cmd_init_regs(&hdev->hw); hdev 421 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c spin_unlock(&hdev->hw.cmq.crq.lock); hdev 422 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c spin_unlock_bh(&hdev->hw.cmq.csq.lock); hdev 424 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c clear_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state); hdev 429 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c if ((hclge_is_reset_pending(hdev))) { hdev 434 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c ret = hclge_cmd_query_firmware_version(&hdev->hw, &version); hdev 436 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c dev_err(&hdev->pdev->dev, hdev 440 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c hdev->fw_version = version; hdev 442 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c dev_info(&hdev->pdev->dev, "The firmware version is %lu.%lu.%lu.%lu\n", hdev 455 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c ret = hclge_firmware_compat_config(hdev); hdev 457 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c dev_warn(&hdev->pdev->dev, hdev 464 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c set_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state); hdev 496 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c void hclge_cmd_uninit(struct hclge_dev *hdev) hdev 498 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c spin_lock_bh(&hdev->hw.cmq.csq.lock); hdev 499 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c spin_lock(&hdev->hw.cmq.crq.lock); hdev 500 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c set_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state); hdev 501 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c hclge_cmd_uninit_regs(&hdev->hw); hdev 502 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c spin_unlock(&hdev->hw.cmq.crq.lock); hdev 503 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c spin_unlock_bh(&hdev->hw.cmq.csq.lock); hdev 505 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c hclge_destroy_cmd_queue(&hdev->hw); hdev 1066 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h int hclge_cmd_init(struct hclge_dev *hdev); hdev 1093 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h int hclge_cmd_set_promisc_mode(struct hclge_dev *hdev, hdev 1101 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h void hclge_cmd_uninit(struct hclge_dev *hdev); hdev 1102 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h int hclge_cmd_queue_init(struct hclge_dev *hdev); hdev 10 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c static int hclge_ieee_ets_to_tm_info(struct hclge_dev *hdev, hdev 18 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hdev->tm_info.tc_info[i].tc_sch_mode = hdev 20 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hdev->tm_info.pg_info[0].tc_dwrr[i] = 0; hdev 23 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hdev->tm_info.tc_info[i].tc_sch_mode = hdev 25 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hdev->tm_info.pg_info[0].tc_dwrr[i] = hdev 38 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hclge_tm_prio_tc_info_update(hdev, ets->prio_tc); hdev 43 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c static void hclge_tm_info_to_ieee_ets(struct hclge_dev *hdev, hdev 50 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ets->ets_cap = hdev->tc_max; hdev 53 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ets->prio_tc[i] = hdev->tm_info.prio_tc[i]; hdev 54 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ets->tc_tx_bw[i] = hdev->tm_info.pg_info[0].tc_dwrr[i]; hdev 56 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c if (hdev->tm_info.tc_info[i].tc_sch_mode == hdev 68 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c struct hclge_dev *hdev = vport->back; hdev 70 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hclge_tm_info_to_ieee_ets(hdev, ets); hdev 75 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c static int hclge_dcb_common_validate(struct hclge_dev *hdev, u8 num_tc, hdev 80 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c if (num_tc > hdev->tc_max) { hdev 81 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c dev_err(&hdev->pdev->dev, hdev 83 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c num_tc, hdev->tc_max); hdev 89 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c dev_err(&hdev->pdev->dev, hdev 96 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c if (num_tc > hdev->vport[0].alloc_tqps) { hdev 97 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c dev_err(&hdev->pdev->dev, hdev 99 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c num_tc, hdev->vport[0].alloc_tqps); hdev 106 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c static int hclge_ets_validate(struct hclge_dev *hdev, struct ieee_ets *ets, hdev 116 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c if (ets->prio_tc[i] != hdev->tm_info.prio_tc[i]) hdev 123 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_dcb_common_validate(hdev, max_tc + 1, ets->prio_tc); hdev 127 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c for (i = 0; i < hdev->tc_max; i++) { hdev 130 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c if (hdev->tm_info.tc_info[i].tc_sch_mode != hdev 135 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c if (hdev->tm_info.tc_info[i].tc_sch_mode != hdev 151 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c if (*tc != hdev->tm_info.num_tc) hdev 157 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c static int hclge_map_update(struct hclge_dev *hdev) hdev 161 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_tm_schd_setup_hw(hdev); hdev 165 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_pause_setup_hw(hdev, false); hdev 169 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_buffer_alloc(hdev); hdev 173 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hclge_rss_indir_init_cfg(hdev); hdev 175 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c return hclge_rss_init_hw(hdev); hdev 178 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c static int hclge_client_setup_tc(struct hclge_dev *hdev) hdev 180 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c struct hclge_vport *vport = hdev->vport; hdev 186 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c for (i = 0; i < hdev->num_vmdq_vport + 1; i++) { hdev 193 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = client->ops->setup_tc(handle, hdev->tm_info.num_tc); hdev 201 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c static int hclge_notify_down_uinit(struct hclge_dev *hdev) hdev 205 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_notify_client(hdev, HNAE3_DOWN_CLIENT); hdev 209 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c return hclge_notify_client(hdev, HNAE3_UNINIT_CLIENT); hdev 212 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c static int hclge_notify_init_up(struct hclge_dev *hdev) hdev 216 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_notify_client(hdev, HNAE3_INIT_CLIENT); hdev 220 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c return hclge_notify_client(hdev, HNAE3_UP_CLIENT); hdev 227 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c struct hclge_dev *hdev = vport->back; hdev 232 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c if (!(hdev->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) || hdev 233 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE) hdev 236 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_ets_validate(hdev, ets, &num_tc, &map_changed); hdev 243 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_notify_down_uinit(hdev); hdev 248 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hclge_tm_schd_info_update(hdev, num_tc); hdev 250 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_ieee_ets_to_tm_info(hdev, ets); hdev 255 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_map_update(hdev); hdev 259 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_client_setup_tc(hdev); hdev 263 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_notify_init_up(hdev); hdev 268 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c return hclge_tm_dwrr_cfg(hdev); hdev 274 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hclge_notify_init_up(hdev); hdev 283 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c struct hclge_dev *hdev = vport->back; hdev 288 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c pfc->pfc_cap = hdev->pfc_max; hdev 289 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c prio_tc = hdev->tm_info.prio_tc; hdev 290 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c pfc_map = hdev->tm_info.hw_pfc_map; hdev 293 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c for (i = 0; i < hdev->tm_info.num_tc; i++) { hdev 300 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_pfc_tx_stats_get(hdev, requests); hdev 304 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_pfc_rx_stats_get(hdev, indications); hdev 319 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c struct hclge_dev *hdev = vport->back; hdev 323 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c if (!(hdev->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) || hdev 324 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE) hdev 327 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c if (pfc->pfc_en == hdev->tm_info.pfc_en) hdev 330 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c prio_tc = hdev->tm_info.prio_tc; hdev 333 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c for (i = 0; i < hdev->tm_info.num_tc; i++) { hdev 342 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hdev->tm_info.hw_pfc_map = pfc_map; hdev 343 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hdev->tm_info.pfc_en = pfc->pfc_en; hdev 347 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c pfc->pfc_en, pfc_map, hdev->tm_info.num_tc); hdev 349 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hclge_tm_pfc_info_update(hdev); hdev 351 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_pause_setup_hw(hdev, false); hdev 355 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_notify_client(hdev, HNAE3_DOWN_CLIENT); hdev 359 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_buffer_alloc(hdev); hdev 361 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hclge_notify_client(hdev, HNAE3_UP_CLIENT); hdev 365 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c return hclge_notify_client(hdev, HNAE3_UP_CLIENT); hdev 372 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c struct hclge_dev *hdev = vport->back; hdev 374 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c if (hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE) hdev 377 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c return hdev->dcbx_cap; hdev 384 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c struct hclge_dev *hdev = vport->back; hdev 394 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hdev->dcbx_cap = mode; hdev 403 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c struct hclge_dev *hdev = vport->back; hdev 406 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c if (hdev->flag & HCLGE_FLAG_DCB_ENABLE) hdev 409 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_dcb_common_validate(hdev, tc, prio_tc); hdev 413 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_notify_down_uinit(hdev); hdev 417 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hclge_tm_schd_info_update(hdev, tc); hdev 418 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hclge_tm_prio_tc_info_update(hdev, prio_tc); hdev 420 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_tm_init_hw(hdev, false); hdev 424 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ret = hclge_client_setup_tc(hdev); hdev 428 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hdev->flag &= ~HCLGE_FLAG_DCB_ENABLE; hdev 431 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hdev->flag |= HCLGE_FLAG_MQPRIO_ENABLE; hdev 433 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hdev->flag &= ~HCLGE_FLAG_MQPRIO_ENABLE; hdev 435 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c return hclge_notify_init_up(hdev); hdev 438 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hclge_notify_init_up(hdev); hdev 453 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c void hclge_dcb_ops_set(struct hclge_dev *hdev) hdev 455 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c struct hclge_vport *vport = hdev->vport; hdev 461 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c if (!hnae3_dev_dcb_supported(hdev) || hdev 467 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c hdev->dcbx_cap = DCB_CAP_DCBX_VER_IEEE | DCB_CAP_DCBX_HOST; hdev 10 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.h void hclge_dcb_ops_set(struct hclge_dev *hdev); hdev 12 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.h static inline void hclge_dcb_ops_set(struct hclge_dev *hdev) {} hdev 74 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static int hclge_dbg_get_dfx_bd_num(struct hclge_dev *hdev, int offset) hdev 83 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_query_bd_num_cmd_send(hdev, desc); hdev 85 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, hdev 95 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static int hclge_dbg_cmd_send(struct hclge_dev *hdev, hdev 112 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, desc_src, bd_num); hdev 114 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, hdev 119 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_dump_reg_common(struct hclge_dev *hdev, hdev 141 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c bd_num = hclge_dbg_get_dfx_bd_num(hdev, reg_msg->offset); hdev 143 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, "get cmd(%d) bd num(%d) failed\n", hdev 151 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, "call kzalloc failed\n"); hdev 156 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_dbg_cmd_send(hdev, desc, index, bd_num, reg_msg->cmd); hdev 170 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "%s: 0x%x\n", hdev 180 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_dump_dcb(struct hclge_dev *hdev, const char *cmd_buf) hdev 182 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c struct device *dev = &hdev->pdev->dev; hdev 193 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, hdev 198 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_dbg_cmd_send(hdev, desc, qset_id, 1, hdev 209 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_dbg_cmd_send(hdev, desc, pri_id, 1, HCLGE_OPC_PRI_DFX_STS); hdev 218 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_dbg_cmd_send(hdev, desc, pg_id, 1, HCLGE_OPC_PG_DFX_STS); hdev 227 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_dbg_cmd_send(hdev, desc, port_id, 1, hdev 236 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_dbg_cmd_send(hdev, desc, nq_id, 1, HCLGE_OPC_SCH_NQ_CNT); hdev 242 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_dbg_cmd_send(hdev, desc, nq_id, 1, HCLGE_OPC_SCH_RQ_CNT); hdev 248 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_dbg_cmd_send(hdev, desc, 0, 2, HCLGE_OPC_TM_INTERNAL_STS); hdev 260 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_dbg_cmd_send(hdev, desc, port_id, 1, hdev 268 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_dbg_cmd_send(hdev, desc, port_id, 1, hdev 280 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_dump_reg_cmd(struct hclge_dev *hdev, const char *cmd_buf) hdev 290 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_dump_reg_common(hdev, reg_info, cmd_buf); hdev 296 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_dump_dcb(hdev, &cmd_buf[sizeof("dcb")]); hdev 301 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "unknown command\n"); hdev 306 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_title_idx_print(struct hclge_dev *hdev, bool flag, int index, hdev 311 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "%s(%d): %s\n", title_buf, index, hdev 314 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "%s(%d): %s\n", title_buf, index, hdev 318 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_dump_tc(struct hclge_dev *hdev) hdev 324 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c if (!hnae3_dev_dcb_supported(hdev)) { hdev 325 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, hdev 332 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 334 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, "dump tc fail, ret = %d\n", ret); hdev 340 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "dump tc\n"); hdev 341 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "weight_offset: %u\n", hdev 345 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_title_idx_print(hdev, ets_weight->tc_weight[i], i, hdev 349 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_dump_tm_pg(struct hclge_dev *hdev) hdev 360 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 365 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PG_C pg_id: %u\n", pg_shap_cfg_cmd->pg_id); hdev 366 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PG_C pg_shapping: 0x%x\n", hdev 371 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 376 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PG_P pg_id: %u\n", pg_shap_cfg_cmd->pg_id); hdev 377 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PG_P pg_shapping: 0x%x\n", hdev 382 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 387 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PORT port_shapping: 0x%x\n", hdev 392 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 396 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PG_SCH pg_id: %u\n", desc.data[0]); hdev 400 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 404 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PRI_SCH pri_id: %u\n", desc.data[0]); hdev 408 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 412 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "QS_SCH qs_id: %u\n", desc.data[0]); hdev 414 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c if (!hnae3_dev_dcb_supported(hdev)) { hdev 415 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, hdev 422 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 427 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "BP_TO_QSET tc_id: %u\n", hdev 429 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "BP_TO_QSET qs_group_id: 0x%x\n", hdev 431 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "BP_TO_QSET qs_bit_map: 0x%x\n", hdev 436 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, "dump tm_pg fail(0x%x), ret = %d\n", hdev 440 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_dump_tm(struct hclge_dev *hdev) hdev 455 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 460 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "dump tm\n"); hdev 461 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PG_TO_PRI gp_id: %u\n", hdev 463 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PG_TO_PRI map: 0x%x\n", hdev 468 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 473 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "QS_TO_PRI qs_id: %u\n", hdev 475 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "QS_TO_PRI priority: %u\n", hdev 477 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "QS_TO_PRI link_vld: %u\n", hdev 482 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 487 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "NQ_TO_QS nq_id: %u\n", nq_to_qs_map->nq_id); hdev 488 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "NQ_TO_QS qset_id: 0x%x\n", hdev 493 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 498 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PG pg_id: %u\n", pg_weight->pg_id); hdev 499 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PG dwrr: %u\n", pg_weight->dwrr); hdev 503 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 508 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "QS qs_id: %u\n", qs_weight->qs_id); hdev 509 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "QS dwrr: %u\n", qs_weight->dwrr); hdev 513 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 518 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PRI pri_id: %u\n", priority_weight->pri_id); hdev 519 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PRI dwrr: %u\n", priority_weight->dwrr); hdev 523 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 528 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PRI_C pri_id: %u\n", shap_cfg_cmd->pri_id); hdev 529 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PRI_C pri_shapping: 0x%x\n", hdev 534 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 539 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PRI_P pri_id: %u\n", shap_cfg_cmd->pri_id); hdev 540 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PRI_P pri_shapping: 0x%x\n", hdev 543 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_dump_tm_pg(hdev); hdev 548 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, "dump tm fail(0x%x), ret = %d\n", hdev 552 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_dump_tm_map(struct hclge_dev *hdev, hdev 574 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 583 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 592 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 597 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "queue_id | qset_id | pri_id | tc_id\n"); hdev 598 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "%04d | %04d | %02d | %02d\n", hdev 601 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c if (!hnae3_dev_dcb_supported(hdev)) { hdev 602 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, hdev 613 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 620 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "index | tm bp qset maping:\n"); hdev 624 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, hdev 637 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, "dump tqp map fail(0x%x), ret = %d\n", hdev 641 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_dump_qos_pause_cfg(struct hclge_dev *hdev) hdev 649 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 651 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, "dump checksum fail, ret = %d\n", hdev 657 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "dump qos pause cfg\n"); hdev 658 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "pause_trans_gap: 0x%x\n", hdev 660 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "pause_trans_time: 0x%x\n", hdev 664 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_dump_qos_pri_map(struct hclge_dev *hdev) hdev 672 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 674 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, hdev 680 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "dump qos pri map\n"); hdev 681 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "vlan_to_pri: 0x%x\n", pri_map->vlan_pri); hdev 682 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "pri_0_to_tc: 0x%x\n", pri_map->pri0_tc); hdev 683 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "pri_1_to_tc: 0x%x\n", pri_map->pri1_tc); hdev 684 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "pri_2_to_tc: 0x%x\n", pri_map->pri2_tc); hdev 685 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "pri_3_to_tc: 0x%x\n", pri_map->pri3_tc); hdev 686 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "pri_4_to_tc: 0x%x\n", pri_map->pri4_tc); hdev 687 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "pri_5_to_tc: 0x%x\n", pri_map->pri5_tc); hdev 688 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "pri_6_to_tc: 0x%x\n", pri_map->pri6_tc); hdev 689 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "pri_7_to_tc: 0x%x\n", pri_map->pri7_tc); hdev 692 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_dump_qos_buf_cfg(struct hclge_dev *hdev) hdev 706 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, desc, 1); hdev 710 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "dump qos buf cfg\n"); hdev 714 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "tx_packet_buf_tc_%d: 0x%x\n", i, hdev 719 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, desc, 1); hdev 723 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "\n"); hdev 726 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "rx_packet_buf_tc_%d: 0x%x\n", i, hdev 729 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "rx_share_buf: 0x%x\n", hdev 734 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, desc, 1); hdev 739 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "\n"); hdev 740 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "rx_com_wl: high: 0x%x, low: 0x%x\n", hdev 745 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, desc, 1); hdev 750 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, hdev 753 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "\n"); hdev 755 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c if (!hnae3_dev_dcb_supported(hdev)) { hdev 756 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, hdev 764 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, desc, 2); hdev 770 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, hdev 776 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, hdev 785 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, desc, 2); hdev 789 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "\n"); hdev 792 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, hdev 799 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, hdev 807 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, hdev 811 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_dump_mng_table(struct hclge_dev *hdev) hdev 818 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "mng tab:\n"); hdev 827 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "%s", printf_buf); hdev 835 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 837 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, hdev 871 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "%s", printf_buf); hdev 875 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_fd_tcam_read(struct hclge_dev *hdev, u8 stage, hdev 899 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, desc, 3); hdev 903 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, " read result tcam key %s(%u):\n", hdev 909 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "%08x\n", *req++); hdev 914 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "%08x\n", *req++); hdev 919 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "%08x\n", *req++); hdev 922 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_fd_tcam(struct hclge_dev *hdev) hdev 926 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c for (i = 0; i < hdev->fd_cfg.rule_num[0]; i++) { hdev 927 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_fd_tcam_read(hdev, 0, true, i); hdev 928 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_fd_tcam_read(hdev, 0, false, i); hdev 932 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_dump_rst_info(struct hclge_dev *hdev) hdev 934 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "PF reset count: %u\n", hdev 935 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hdev->rst_stats.pf_rst_cnt); hdev 936 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "FLR reset count: %u\n", hdev 937 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hdev->rst_stats.flr_rst_cnt); hdev 938 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "GLOBAL reset count: %u\n", hdev 939 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hdev->rst_stats.global_rst_cnt); hdev 940 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "IMP reset count: %u\n", hdev 941 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hdev->rst_stats.imp_rst_cnt); hdev 942 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "reset done count: %u\n", hdev 943 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hdev->rst_stats.reset_done_cnt); hdev 944 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "HW reset done count: %u\n", hdev 945 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hdev->rst_stats.hw_reset_done_cnt); hdev 946 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "reset count: %u\n", hdev 947 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hdev->rst_stats.reset_cnt); hdev 948 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "reset count: %u\n", hdev 949 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hdev->rst_stats.reset_cnt); hdev 950 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "reset fail count: %u\n", hdev 951 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hdev->rst_stats.reset_fail_cnt); hdev 952 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "vector0 interrupt enable status: 0x%x\n", hdev 953 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_read_dev(&hdev->hw, HCLGE_MISC_VECTOR_REG_BASE)); hdev 954 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "reset interrupt source: 0x%x\n", hdev 955 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_read_dev(&hdev->hw, HCLGE_MISC_RESET_STS_REG)); hdev 956 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "reset interrupt status: 0x%x\n", hdev 957 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_read_dev(&hdev->hw, HCLGE_MISC_VECTOR_INT_STS)); hdev 958 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "hardware reset status: 0x%x\n", hdev 959 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_read_dev(&hdev->hw, HCLGE_GLOBAL_RESET_REG)); hdev 960 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "handshake status: 0x%x\n", hdev 961 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_read_dev(&hdev->hw, HCLGE_NIC_CSQ_DEPTH_REG)); hdev 962 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "function reset status: 0x%x\n", hdev 963 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_read_dev(&hdev->hw, HCLGE_FUN_RST_ING)); hdev 966 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_get_m7_stats_info(struct hclge_dev *hdev) hdev 977 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 979 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, hdev 990 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, hdev 996 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_dbg_cmd_send(hdev, desc_tmp, 0, bd_num, hdev 1000 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, hdev 1006 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "0x%08x 0x%08x 0x%08x\n", hdev 1010 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "0x%08x 0x%08x 0x%08x\n", hdev 1023 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_ncl_config_data_print(struct hclge_dev *hdev, hdev 1037 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "0x%04x | 0x%08x\n", hdev 1052 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_dump_ncl_config(struct hclge_dev *hdev, hdev 1068 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, "Invalid offset or length.\n"); hdev 1072 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_err(&hdev->pdev->dev, "Non-positive offset or length.\n"); hdev 1076 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "offset | data\n"); hdev 1084 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c ret = hclge_dbg_cmd_send(hdev, desc, data0, bd_num, hdev 1089 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_ncl_config_data_print(hdev, desc, &offset, &length); hdev 1096 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c static void hclge_dbg_dump_mac_tnl_status(struct hclge_dev *hdev) hdev 1103 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "Recently generated mac tnl interruption:\n"); hdev 1105 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c while (kfifo_get(&hdev->mac_tnl_log, &stats)) { hdev 1107 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "[%07lu.%03lu] status = 0x%x\n", hdev 1119 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c struct hclge_dev *hdev = vport->back; hdev 1122 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_fd_tcam(hdev); hdev 1124 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_dump_tc(hdev); hdev 1126 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_dump_tm_map(hdev, &cmd_buf[sizeof(DUMP_TM_MAP)]); hdev 1128 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_dump_tm(hdev); hdev 1130 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_dump_qos_pause_cfg(hdev); hdev 1132 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_dump_qos_pri_map(hdev); hdev 1134 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_dump_qos_buf_cfg(hdev); hdev 1136 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_dump_mng_table(hdev); hdev 1138 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_dump_reg_cmd(hdev, &cmd_buf[sizeof(DUMP_REG)]); hdev 1140 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_dump_rst_info(hdev); hdev 1142 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_get_m7_stats_info(hdev); hdev 1144 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_dump_ncl_config(hdev, hdev 1147 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c hclge_dbg_dump_mac_tnl_status(hdev); hdev 1149 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c dev_info(&hdev->pdev->dev, "unknown command\n"); hdev 658 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_cmd_query_error(struct hclge_dev *hdev, hdev 661 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 672 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], desc_num); hdev 679 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_clear_mac_tnl_int(struct hclge_dev *hdev) hdev 686 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 689 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_config_common_hw_err_int(struct hclge_dev *hdev, bool en) hdev 691 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 718 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], 2); hdev 726 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_config_ncsi_hw_err_int(struct hclge_dev *hdev, bool en) hdev 728 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 732 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c if (hdev->pdev->revision < 0x21) hdev 740 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 748 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_config_igu_egu_hw_err_int(struct hclge_dev *hdev, bool en) hdev 750 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 761 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 774 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 781 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_config_ncsi_hw_err_int(hdev, en); hdev 786 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_config_ppp_error_interrupt(struct hclge_dev *hdev, u32 cmd, hdev 789 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 811 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c if (hdev->pdev->revision >= 0x21) hdev 828 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], 2); hdev 835 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_config_ppp_hw_err_int(struct hclge_dev *hdev, bool en) hdev 839 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_config_ppp_error_interrupt(hdev, HCLGE_PPP_CMD0_INT_CMD, hdev 844 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_config_ppp_error_interrupt(hdev, HCLGE_PPP_CMD1_INT_CMD, hdev 850 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_config_tm_hw_err_int(struct hclge_dev *hdev, bool en) hdev 852 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 861 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 868 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_query_error(hdev, &desc, HCLGE_TM_QCN_MEM_INT_CFG, 0); hdev 878 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 886 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_config_mac_err_int(struct hclge_dev *hdev, bool en) hdev 888 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 899 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 907 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c int hclge_config_mac_tnl_int(struct hclge_dev *hdev, bool en) hdev 919 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 922 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_config_ppu_error_interrupts(struct hclge_dev *hdev, u32 cmd, hdev 925 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 976 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], desc_num); hdev 981 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_config_ppu_hw_err_int(struct hclge_dev *hdev, bool en) hdev 983 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 986 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_config_ppu_error_interrupts(hdev, HCLGE_PPU_MPF_ECC_INT_CMD, hdev 994 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_config_ppu_error_interrupts(hdev, hdev 1002 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_config_ppu_error_interrupts(hdev, hdev 1010 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_config_ssu_hw_err_int(struct hclge_dev *hdev, bool en) hdev 1012 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1031 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], 2); hdev 1044 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c if (hdev->pdev->revision >= 0x21) hdev 1059 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], 2); hdev 1075 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_query_bd_num(struct hclge_dev *hdev, bool is_ras, hdev 1078 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1095 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc_bd, 1); hdev 1121 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_handle_mpf_ras_error(struct hclge_dev *hdev, hdev 1125 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct hnae3_ae_dev *ae_dev = hdev->ae_dev; hdev 1126 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1134 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], num); hdev 1264 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], num); hdev 1279 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_handle_pf_ras_error(struct hclge_dev *hdev, hdev 1283 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct hnae3_ae_dev *ae_dev = hdev->ae_dev; hdev 1284 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1292 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], num); hdev 1332 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c hclge_report_hw_error(hdev, HNAE3_PPU_POISON_ERROR); hdev 1337 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], num); hdev 1344 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_handle_all_ras_errors(struct hclge_dev *hdev) hdev 1351 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_query_bd_num(hdev, true, &mpf_bd_num, &pf_bd_num); hdev 1361 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_handle_mpf_ras_error(hdev, desc, mpf_bd_num); hdev 1369 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_handle_pf_ras_error(hdev, desc, pf_bd_num); hdev 1375 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_log_rocee_axi_error(struct hclge_dev *hdev) hdev 1377 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1390 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], 3); hdev 1411 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_log_rocee_ecc_error(struct hclge_dev *hdev) hdev 1413 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1417 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_query_error(hdev, &desc[0], hdev 1435 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_log_rocee_ovf_error(struct hclge_dev *hdev) hdev 1437 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1442 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_query_error(hdev, &desc[0], HCLGE_ROCEE_PF_RAS_INT_CMD, hdev 1482 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c hclge_log_and_clear_rocee_ras_error(struct hclge_dev *hdev) hdev 1485 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1491 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_query_error(hdev, &desc[0], hdev 1510 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_log_rocee_axi_error(hdev); hdev 1519 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_log_rocee_ecc_error(hdev); hdev 1525 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_log_rocee_ovf_error(hdev); hdev 1535 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], 1); hdev 1545 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c int hclge_config_rocee_ras_interrupt(struct hclge_dev *hdev, bool en) hdev 1547 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1551 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c if (hdev->pdev->revision < 0x21 || !hnae3_dev_roce_supported(hdev)) hdev 1560 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c hclge_log_and_clear_rocee_ras_error(hdev); hdev 1565 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 1574 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct hclge_dev *hdev = ae_dev->priv; hdev 1577 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) || hdev 1578 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c hdev->pdev->revision < 0x21) hdev 1581 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c reset_type = hclge_log_and_clear_rocee_ras_error(hdev); hdev 1618 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c int hclge_config_nic_hw_error(struct hclge_dev *hdev, bool state) hdev 1625 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = module->config_err_int(hdev, state); hdev 1637 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct hclge_dev *hdev = ae_dev->priv; hdev 1638 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1641 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c if (!test_bit(HCLGE_STATE_SERVICE_INITED, &hdev->state)) { hdev 1647 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c status = hclge_read_dev(&hdev->hw, HCLGE_RAS_PF_OTHER_INT_STS_REG); hdev 1660 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c hclge_handle_all_ras_errors(hdev); hdev 1664 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c if (hdev->pdev->revision >= 0x21 && hdev 1670 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) hdev 1680 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_clear_hw_msix_error(struct hclge_dev *hdev, hdev 1692 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c return hclge_cmd_send(&hdev->hw, &desc[0], bd_num); hdev 1704 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_query_over_8bd_err_info(struct hclge_dev *hdev, u16 *vf_id, hdev 1712 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 1730 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static void hclge_handle_over_8bd_err(struct hclge_dev *hdev, hdev 1733 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1738 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_query_over_8bd_err_info(hdev, &vf_id, &q_id); hdev 1749 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c if (vf_id >= hdev->num_alloc_vport) { hdev 1761 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_inform_reset_assert_to_vf(&hdev->vport[vf_id]); hdev 1764 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c hdev->vport->vport_id, ret); hdev 1779 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_handle_mpf_msix_error(struct hclge_dev *hdev, hdev 1784 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1791 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], mpf_bd_num); hdev 1814 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_clear_hw_msix_error(hdev, desc, true, mpf_bd_num); hdev 1830 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_handle_pf_msix_error(struct hclge_dev *hdev, hdev 1835 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1843 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], pf_bd_num); hdev 1874 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c hclge_handle_over_8bd_err(hdev, reset_requests); hdev 1877 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_clear_hw_msix_error(hdev, desc, false, pf_bd_num); hdev 1884 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c static int hclge_handle_all_hw_msix_error(struct hclge_dev *hdev, hdev 1888 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1895 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_query_bd_num(hdev, false, &mpf_bd_num, &pf_bd_num); hdev 1906 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_handle_mpf_msix_error(hdev, desc, mpf_bd_num, hdev 1912 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_handle_pf_msix_error(hdev, desc, pf_bd_num, reset_requests); hdev 1919 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_cmd_send(&hdev->hw, &desc[0], 1); hdev 1934 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c kfifo_put(&hdev->mac_tnl_log, mac_tnl_stats); hdev 1935 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_clear_mac_tnl_int(hdev); hdev 1946 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c int hclge_handle_hw_msix_error(struct hclge_dev *hdev, hdev 1949 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1951 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c if (!test_bit(HCLGE_STATE_SERVICE_INITED, &hdev->state)) { hdev 1957 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c return hclge_handle_all_hw_msix_error(hdev, reset_requests); hdev 1964 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct hclge_dev *hdev = ae_dev->priv; hdev 1965 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c struct device *dev = &hdev->pdev->dev; hdev 1972 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c status = hclge_read_dev(&hdev->hw, HCLGE_RAS_PF_OTHER_INT_STS_REG); hdev 1975 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_query_bd_num(hdev, false, &mpf_bd_num, &pf_bd_num); hdev 1987 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_clear_hw_msix_error(hdev, desc, true, mpf_bd_num); hdev 1996 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c ret = hclge_clear_hw_msix_error(hdev, desc, false, pf_bd_num); hdev 2006 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c hclge_handle_all_ras_errors(hdev); hdev 120 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h int (*config_err_int)(struct hclge_dev *hdev, bool en); hdev 129 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h int hclge_config_mac_tnl_int(struct hclge_dev *hdev, bool en); hdev 130 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h int hclge_config_nic_hw_error(struct hclge_dev *hdev, bool state); hdev 131 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h int hclge_config_rocee_ras_interrupt(struct hclge_dev *hdev, bool en); hdev 134 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h int hclge_handle_hw_msix_error(struct hclge_dev *hdev, hdev 58 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_mac_mtu(struct hclge_dev *hdev, int new_mps); hdev 59 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_init_vlan_config(struct hclge_dev *hdev); hdev 60 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_sync_vlan_filter(struct hclge_dev *hdev); hdev 63 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_umv_space(struct hclge_dev *hdev, u16 space_size, hdev 65 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_rfs_filter_expire(struct hclge_dev *hdev); hdev 69 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_default_loopback(struct hclge_dev *hdev); hdev 414 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_mac_update_stats_defective(struct hclge_dev *hdev) hdev 418 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c u64 *data = (u64 *)(&hdev->hw_stats.mac_stats); hdev 425 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, desc, HCLGE_MAC_CMD_NUM); hdev 427 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 453 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_mac_update_stats_complete(struct hclge_dev *hdev, u32 desc_num) hdev 455 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c u64 *data = (u64 *)(&hdev->hw_stats.mac_stats); hdev 469 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, desc, desc_num); hdev 497 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_mac_query_reg_num(struct hclge_dev *hdev, u32 *desc_num) hdev 505 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 518 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_mac_update_stats(struct hclge_dev *hdev) hdev 523 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_mac_query_reg_num(hdev, &desc_num); hdev 527 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_mac_update_stats_complete(hdev, desc_num); hdev 529 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_mac_update_stats_defective(hdev); hdev 531 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "query mac reg num fail!\n"); hdev 540 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 554 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, desc, 1); hdev 556 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 574 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, desc, 1); hdev 576 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 672 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_update_stats_for_all(struct hclge_dev *hdev) hdev 677 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c handle = &hdev->vport[0].nic; hdev 681 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 687 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c status = hclge_mac_update_stats(hdev); hdev 689 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 697 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 700 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (test_and_set_bit(HCLGE_STATE_STATISTICS_UPDATING, &hdev->state)) hdev 703 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c status = hclge_mac_update_stats(hdev); hdev 705 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 711 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 715 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_STATISTICS_UPDATING, &hdev->state); hdev 726 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 737 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->pdev->revision >= 0x21 || hdev 738 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hw.mac.speed == HCLGE_MAC_SPEED_10M || hdev 739 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hw.mac.speed == HCLGE_MAC_SPEED_100M || hdev 740 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hw.mac.speed == HCLGE_MAC_SPEED_1G) { hdev 749 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->hw.mac.phydev) { hdev 801 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 804 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c p = hclge_comm_get_stats(&hdev->hw_stats.mac_stats, g_mac_stats_string, hdev 813 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 817 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mac_stats->tx_pause_cnt = hdev->hw_stats.mac_stats.mac_tx_mac_pause_num; hdev 818 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mac_stats->rx_pause_cnt = hdev->hw_stats.mac_stats.mac_rx_mac_pause_num; hdev 821 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_parse_func_status(struct hclge_dev *hdev, hdev 829 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->flag |= HCLGE_FLAG_MAIN; hdev 831 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->flag &= ~HCLGE_FLAG_MAIN; hdev 836 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_query_function_status(struct hclge_dev *hdev) hdev 849 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 851 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 862 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_parse_func_status(hdev, req); hdev 867 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_query_pf_resource(struct hclge_dev *hdev) hdev 874 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 876 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 882 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_tqps = __le16_to_cpu(req->tqp_num); hdev 883 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->pkt_buf_size = __le16_to_cpu(req->buf_size) << HCLGE_BUF_UNIT_S; hdev 886 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->tx_buf_size = hdev 889 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->tx_buf_size = HCLGE_DEFAULT_TX_BUF; hdev 891 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->tx_buf_size = roundup(hdev->tx_buf_size, HCLGE_BUF_SIZE_UNIT); hdev 894 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->dv_buf_size = hdev 897 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->dv_buf_size = HCLGE_DEFAULT_DV; hdev 899 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->dv_buf_size = roundup(hdev->dv_buf_size, HCLGE_BUF_SIZE_UNIT); hdev 901 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hnae3_dev_roce_supported(hdev)) { hdev 902 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->roce_base_msix_offset = hdev 905 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_roce_msi = hdev 910 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_nic_msi = hdev->num_roce_msi; hdev 915 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_msi = hdev->num_roce_msi + hdev 916 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->roce_base_msix_offset; hdev 918 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_msi = hdev 922 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_nic_msi = hdev->num_msi; hdev 925 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->num_nic_msi < HNAE3_MIN_VECTOR_NUM) { hdev 926 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 928 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_nic_msi); hdev 972 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 973 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c u32 speed_ability = hdev->hw.mac.speed_ability; hdev 1121 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_parse_fiber_link_mode(struct hclge_dev *hdev, hdev 1124 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_mac *mac = &hdev->hw.mac; hdev 1133 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->pdev->revision >= 0x21) hdev 1141 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_parse_backplane_link_mode(struct hclge_dev *hdev, hdev 1144 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_mac *mac = &hdev->hw.mac; hdev 1147 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->pdev->revision >= 0x21) hdev 1154 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_parse_copper_link_mode(struct hclge_dev *hdev, hdev 1157 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c unsigned long *supported = hdev->hw.mac.supported; hdev 1185 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_parse_link_mode(struct hclge_dev *hdev, u8 speed_ability) hdev 1187 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c u8 media_type = hdev->hw.mac.media_type; hdev 1190 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_parse_fiber_link_mode(hdev, speed_ability); hdev 1192 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_parse_copper_link_mode(hdev, speed_ability); hdev 1194 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_parse_backplane_link_mode(hdev, speed_ability); hdev 1260 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_cfg(struct hclge_dev *hdev, struct hclge_cfg *hcfg) hdev 1281 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, desc, HCLGE_PF_CFG_DESC_NUM); hdev 1283 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "get config failed %d.\n", ret); hdev 1292 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_cap(struct hclge_dev *hdev) hdev 1296 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_query_function_status(hdev); hdev 1298 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 1304 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_query_pf_resource(hdev); hdev 1306 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "query pf resource error %d.\n", ret); hdev 1311 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_init_kdump_kernel_config(struct hclge_dev *hdev) hdev 1319 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, hdev 1323 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_tqps = hdev->num_vmdq_vport + hdev->num_req_vfs + 1; hdev 1324 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_tx_desc = HCLGE_MIN_TX_DESC; hdev 1325 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_rx_desc = HCLGE_MIN_RX_DESC; hdev 1328 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_configure(struct hclge_dev *hdev) hdev 1334 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_cfg(hdev, &cfg); hdev 1336 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "get mac mode error %d.\n", ret); hdev 1340 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_vmdq_vport = cfg.vmdq_vport_num; hdev 1341 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->base_tqp_pid = 0; hdev 1342 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->rss_size_max = cfg.rss_size_max; hdev 1343 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->rx_buf_len = cfg.rx_buf_len; hdev 1344 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ether_addr_copy(hdev->hw.mac.mac_addr, cfg.mac_addr); hdev 1345 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hw.mac.media_type = cfg.media_type; hdev 1346 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hw.mac.phy_addr = cfg.phy_addr; hdev 1347 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_tx_desc = cfg.tqp_desc_num; hdev 1348 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_rx_desc = cfg.tqp_desc_num; hdev 1349 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->tm_info.num_pg = 1; hdev 1350 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->tc_max = cfg.tc_num; hdev 1351 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->tm_info.hw_pfc_map = 0; hdev 1352 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->wanted_umv_size = cfg.umv_space; hdev 1354 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hnae3_dev_fd_supported(hdev)) { hdev 1355 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_en = true; hdev 1356 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_active_type = HCLGE_FD_RULE_NONE; hdev 1359 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_parse_speed(cfg.default_speed, &hdev->hw.mac.speed); hdev 1361 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "Get wrong speed ret=%d.\n", ret); hdev 1365 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_parse_link_mode(hdev, cfg.speed_ability); hdev 1367 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if ((hdev->tc_max > HNAE3_MAX_TC) || hdev 1368 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c (hdev->tc_max < 1)) { hdev 1369 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, "TC num = %d.\n", hdev 1370 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->tc_max); hdev 1371 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->tc_max = 1; hdev 1375 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hnae3_dev_dcb_supported(hdev)) { hdev 1376 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->tc_max = 1; hdev 1377 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->pfc_max = 0; hdev 1379 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->pfc_max = hdev->tc_max; hdev 1382 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->tm_info.num_tc = 1; hdev 1385 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->tm_info.num_tc; i++) hdev 1386 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hnae3_set_bit(hdev->hw_tc_map, i, 1); hdev 1388 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->tx_sch_mode = HCLGE_FLAG_TC_BASE_SCH_MODE; hdev 1390 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_init_kdump_kernel_config(hdev); hdev 1393 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c i = cpumask_weight(cpumask_of_node(dev_to_node(&hdev->pdev->dev))); hdev 1394 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c i = i ? PCI_FUNC(hdev->pdev->devfn) % i : 0; hdev 1395 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c cpumask_set_cpu(cpumask_local_spread(i, dev_to_node(&hdev->pdev->dev)), hdev 1396 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c &hdev->affinity_mask); hdev 1401 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_config_tso(struct hclge_dev *hdev, unsigned int tso_mss_min, hdev 1422 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 1425 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_config_gro(struct hclge_dev *hdev, bool en) hdev 1431 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hnae3_dev_gro_supported(hdev)) hdev 1439 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 1441 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 1447 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_alloc_tqps(struct hclge_dev *hdev) hdev 1452 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->htqp = devm_kcalloc(&hdev->pdev->dev, hdev->num_tqps, hdev 1454 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hdev->htqp) hdev 1457 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c tqp = hdev->htqp; hdev 1459 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_tqps; i++) { hdev 1460 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c tqp->dev = &hdev->pdev->dev; hdev 1464 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c tqp->q.buf_size = hdev->rx_buf_len; hdev 1465 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c tqp->q.tx_desc_num = hdev->num_tx_desc; hdev 1466 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c tqp->q.rx_desc_num = hdev->num_rx_desc; hdev 1467 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c tqp->q.io_base = hdev->hw.io_base + HCLGE_TQP_REG_OFFSET + hdev 1476 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_map_tqps_to_func(struct hclge_dev *hdev, u16 func_id, hdev 1493 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 1495 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "TQP map failed %d.\n", ret); hdev 1503 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 1506 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0, alloced = 0; i < hdev->num_tqps && hdev 1508 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hdev->htqp[i].alloced) { hdev 1509 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->htqp[i].q.handle = &vport->nic; hdev 1510 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->htqp[i].q.tqp_index = alloced; hdev 1511 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->htqp[i].q.tx_desc_num = kinfo->num_tx_desc; hdev 1512 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->htqp[i].q.rx_desc_num = kinfo->num_rx_desc; hdev 1513 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c kinfo->tqp[alloced] = &hdev->htqp[i].q; hdev 1514 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->htqp[i].alloced = true; hdev 1519 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c kinfo->rss_size = min_t(u16, hdev->rss_size_max, hdev 1520 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vport->alloc_tqps / hdev->tm_info.num_tc); hdev 1524 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c (hdev->num_nic_msi - 1) / hdev->tm_info.num_tc); hdev 1535 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 1541 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c kinfo->rx_buf_len = hdev->rx_buf_len; hdev 1543 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c kinfo->tqp = devm_kcalloc(&hdev->pdev->dev, num_tqps, hdev 1550 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "fail to assign TQPs %d.\n", ret); hdev 1555 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_map_tqp_to_vport(struct hclge_dev *hdev, hdev 1570 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_map_tqps_to_func(hdev, vport->vport_id, q->index, hdev 1579 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_map_tqp(struct hclge_dev *hdev) hdev 1581 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_vport *vport = hdev->vport; hdev 1584 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c num_vport = hdev->num_vmdq_vport + hdev->num_req_vfs + 1; hdev 1588 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_map_tqp_to_vport(hdev, vport); hdev 1601 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 1604 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c nic->pdev = hdev->pdev; hdev 1606 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c nic->numa_node_mask = hdev->numa_node_mask; hdev 1609 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_tx_desc, hdev->num_rx_desc); hdev 1611 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "knic setup failed %d\n", ret); hdev 1616 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_alloc_vport(struct hclge_dev *hdev) hdev 1618 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct pci_dev *pdev = hdev->pdev; hdev 1626 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c num_vport = hdev->num_vmdq_vport + hdev->num_req_vfs + 1; hdev 1628 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->num_tqps < num_vport) { hdev 1629 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "tqps(%d) is less than vports(%d)", hdev 1630 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_tqps, num_vport); hdev 1635 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c tqp_per_vport = hdev->num_tqps / num_vport; hdev 1636 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c tqp_main_vport = tqp_per_vport + hdev->num_tqps % num_vport; hdev 1643 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->vport = vport; hdev 1644 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_alloc_vport = num_vport; hdev 1647 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_alloc_vfs = hdev->num_req_vfs; hdev 1650 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vport->back = hdev; hdev 1676 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_cmd_alloc_tx_buff(struct hclge_dev *hdev, hdev 1698 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 1700 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "tx buffer alloc cmd failed %d.\n", hdev 1706 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_tx_buffer_alloc(struct hclge_dev *hdev, hdev 1709 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c int ret = hclge_cmd_alloc_tx_buff(hdev, buf_alloc); hdev 1712 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "tx buffer alloc failed %d\n", ret); hdev 1717 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static u32 hclge_get_tc_num(struct hclge_dev *hdev) hdev 1723 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->hw_tc_map & BIT(i)) hdev 1729 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_pfc_priv_num(struct hclge_dev *hdev, hdev 1738 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if ((hdev->tm_info.hw_pfc_map & BIT(i)) && hdev 1747 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_no_pfc_priv_num(struct hclge_dev *hdev, hdev 1756 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->hw_tc_map & BIT(i) && hdev 1757 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c !(hdev->tm_info.hw_pfc_map & BIT(i)) && hdev 1789 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static bool hclge_is_rx_buf_ok(struct hclge_dev *hdev, hdev 1794 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c u32 tc_num = hclge_get_tc_num(hdev); hdev 1799 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c aligned_mps = roundup(hdev->mps, HCLGE_BUF_SIZE_UNIT); hdev 1801 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hnae3_dev_dcb_supported(hdev)) hdev 1803 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->dv_buf_size; hdev 1806 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c + hdev->dv_buf_size; hdev 1818 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hnae3_dev_dcb_supported(hdev)) { hdev 1819 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c buf_alloc->s_buf.self.high = shared_buf - hdev->dv_buf_size; hdev 1829 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hnae3_dev_dcb_supported(hdev)) { hdev 1830 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hi_thrd = shared_buf - hdev->dv_buf_size; hdev 1855 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_tx_buffer_calc(struct hclge_dev *hdev, hdev 1860 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c total_size = hdev->pkt_buf_size; hdev 1866 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->hw_tc_map & BIT(i)) { hdev 1867 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (total_size < hdev->tx_buf_size) hdev 1870 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c priv->tx_buf_size = hdev->tx_buf_size; hdev 1881 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static bool hclge_rx_buf_calc_all(struct hclge_dev *hdev, bool max, hdev 1884 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c u32 rx_all = hdev->pkt_buf_size - hclge_get_tx_buff_alloced(buf_alloc); hdev 1885 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c u32 aligned_mps = round_up(hdev->mps, HCLGE_BUF_SIZE_UNIT); hdev 1896 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!(hdev->hw_tc_map & BIT(i))) hdev 1901 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->tm_info.hw_pfc_map & BIT(i)) { hdev 1911 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c priv->buf_size = priv->wl.high + hdev->dv_buf_size; hdev 1914 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_is_rx_buf_ok(hdev, buf_alloc, rx_all); hdev 1917 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static bool hclge_drop_nopfc_buf_till_fit(struct hclge_dev *hdev, hdev 1920 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c u32 rx_all = hdev->pkt_buf_size - hclge_get_tx_buff_alloced(buf_alloc); hdev 1921 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c int no_pfc_priv_num = hclge_get_no_pfc_priv_num(hdev, buf_alloc); hdev 1929 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->hw_tc_map & mask && hdev 1930 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c !(hdev->tm_info.hw_pfc_map & mask)) { hdev 1939 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hclge_is_rx_buf_ok(hdev, buf_alloc, rx_all) || hdev 1944 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_is_rx_buf_ok(hdev, buf_alloc, rx_all); hdev 1947 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static bool hclge_drop_pfc_buf_till_fit(struct hclge_dev *hdev, hdev 1950 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c u32 rx_all = hdev->pkt_buf_size - hclge_get_tx_buff_alloced(buf_alloc); hdev 1951 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c int pfc_priv_num = hclge_get_pfc_priv_num(hdev, buf_alloc); hdev 1959 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->hw_tc_map & mask && hdev 1960 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->tm_info.hw_pfc_map & mask) { hdev 1969 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hclge_is_rx_buf_ok(hdev, buf_alloc, rx_all) || hdev 1974 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_is_rx_buf_ok(hdev, buf_alloc, rx_all); hdev 1977 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_only_alloc_priv_buff(struct hclge_dev *hdev, hdev 1984 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c u32 rx_priv = hdev->pkt_buf_size - hclge_get_tx_buff_alloced(buf_alloc); hdev 1985 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c u32 tc_num = hclge_get_tc_num(hdev); hdev 1986 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c u32 half_mps = hdev->mps >> 1; hdev 1996 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c min_rx_priv = hdev->dv_buf_size + COMPENSATE_BUFFER + hdev 2012 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!(hdev->hw_tc_map & BIT(i))) hdev 2017 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c priv->wl.high = rx_priv - hdev->dv_buf_size; hdev 2031 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_rx_buffer_calc(struct hclge_dev *hdev, hdev 2035 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hnae3_dev_dcb_supported(hdev)) { hdev 2036 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c u32 rx_all = hdev->pkt_buf_size; hdev 2039 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hclge_is_rx_buf_ok(hdev, buf_alloc, rx_all)) hdev 2045 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hclge_only_alloc_priv_buff(hdev, buf_alloc)) hdev 2048 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hclge_rx_buf_calc_all(hdev, true, buf_alloc)) hdev 2052 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hclge_rx_buf_calc_all(hdev, false, buf_alloc)) hdev 2055 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hclge_drop_nopfc_buf_till_fit(hdev, buf_alloc)) hdev 2058 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hclge_drop_pfc_buf_till_fit(hdev, buf_alloc)) hdev 2064 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_rx_priv_buf_alloc(struct hclge_dev *hdev, hdev 2089 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 2091 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2097 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_rx_priv_wl_config(struct hclge_dev *hdev, hdev 2133 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, desc, 2); hdev 2135 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2141 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_common_thrd_config(struct hclge_dev *hdev, hdev 2177 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, desc, 2); hdev 2179 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2184 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_common_wl_config(struct hclge_dev *hdev, hdev 2201 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 2203 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2209 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c int hclge_buffer_alloc(struct hclge_dev *hdev) hdev 2218 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_tx_buffer_calc(hdev, pkt_buf); hdev 2220 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2225 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_tx_buffer_alloc(hdev, pkt_buf); hdev 2227 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2232 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_rx_buffer_calc(hdev, pkt_buf); hdev 2234 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2240 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_rx_priv_buf_alloc(hdev, pkt_buf); hdev 2242 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "could not alloc rx priv buffer %d\n", hdev 2247 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hnae3_dev_dcb_supported(hdev)) { hdev 2248 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_rx_priv_wl_config(hdev, pkt_buf); hdev 2250 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2256 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_common_thrd_config(hdev, pkt_buf); hdev 2258 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2265 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_common_wl_config(hdev, pkt_buf); hdev 2267 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2298 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_init_msi(struct hclge_dev *hdev) hdev 2300 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct pci_dev *pdev = hdev->pdev; hdev 2305 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_msi, hdev 2313 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (vectors < hdev->num_msi) hdev 2314 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 2316 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_msi, vectors); hdev 2318 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_msi = vectors; hdev 2319 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_msi_left = vectors; hdev 2321 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->base_msi_vector = pdev->irq; hdev 2322 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->roce_base_vector = hdev->base_msi_vector + hdev 2323 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->roce_base_msix_offset; hdev 2325 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->vector_status = devm_kcalloc(&pdev->dev, hdev->num_msi, hdev 2327 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hdev->vector_status) { hdev 2332 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_msi; i++) hdev 2333 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->vector_status[i] = HCLGE_INVALID_VPORT; hdev 2335 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->vector_irq = devm_kcalloc(&pdev->dev, hdev->num_msi, hdev 2337 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hdev->vector_irq) { hdev 2353 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_cfg_mac_speed_dup_hw(struct hclge_dev *hdev, int speed, hdev 2401 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "invalid speed (%d)\n", speed); hdev 2408 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 2410 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2418 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c int hclge_cfg_mac_speed_dup(struct hclge_dev *hdev, int speed, u8 duplex) hdev 2420 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_mac *mac = &hdev->hw.mac; hdev 2428 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cfg_mac_speed_dup_hw(hdev, speed, duplex); hdev 2432 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hw.mac.speed = speed; hdev 2433 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hw.mac.duplex = duplex; hdev 2442 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 2444 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_cfg_mac_speed_dup(hdev, speed, duplex); hdev 2447 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_autoneg_en(struct hclge_dev *hdev, bool enable) hdev 2461 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 2463 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "auto neg set cmd failed %d.\n", hdev 2472 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 2474 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hdev->hw.mac.support_autoneg) { hdev 2476 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2484 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_set_autoneg_en(hdev, enable); hdev 2490 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 2491 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct phy_device *phydev = hdev->hw.mac.phydev; hdev 2496 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hdev->hw.mac.autoneg; hdev 2502 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 2505 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_dbg(&hdev->pdev->dev, "restart autoneg\n"); hdev 2507 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_notify_client(hdev, HNAE3_DOWN_CLIENT); hdev 2510 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_notify_client(hdev, HNAE3_UP_CLIENT); hdev 2516 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 2518 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->hw.mac.support_autoneg && hdev->hw.mac.autoneg) hdev 2519 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_set_autoneg_en(hdev, !halt); hdev 2524 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_fec_hw(struct hclge_dev *hdev, u32 fec_mode) hdev 2542 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 2544 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "set fec mode failed %d.\n", ret); hdev 2552 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 2553 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_mac *mac = &hdev->hw.mac; hdev 2557 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "unsupported fec mode\n"); hdev 2561 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_fec_hw(hdev, fec_mode); hdev 2573 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 2574 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_mac *mac = &hdev->hw.mac; hdev 2582 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_mac_init(struct hclge_dev *hdev) hdev 2584 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_mac *mac = &hdev->hw.mac; hdev 2587 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->support_sfp_query = true; hdev 2588 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hw.mac.duplex = HCLGE_MAC_FULL; hdev 2589 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cfg_mac_speed_dup_hw(hdev, hdev->hw.mac.speed, hdev 2590 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hw.mac.duplex); hdev 2592 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2597 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->hw.mac.support_autoneg) { hdev 2598 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_autoneg_en(hdev, hdev->hw.mac.autoneg); hdev 2600 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2609 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_fec_hw(hdev, mac->user_fec_mode); hdev 2611 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2617 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_mac_mtu(hdev, hdev->mps); hdev 2619 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "set mtu failed ret=%d\n", ret); hdev 2623 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_default_loopback(hdev); hdev 2627 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_buffer_alloc(hdev); hdev 2629 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 2635 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_mbx_task_schedule(struct hclge_dev *hdev) hdev 2637 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state) && hdev 2638 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c !test_and_set_bit(HCLGE_STATE_MBX_SERVICE_SCHED, &hdev->state)) hdev 2639 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c queue_work_on(cpumask_first(&hdev->affinity_mask), system_wq, hdev 2640 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c &hdev->mbx_service_task); hdev 2643 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_reset_task_schedule(struct hclge_dev *hdev) hdev 2645 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!test_bit(HCLGE_STATE_REMOVING, &hdev->state) && hdev 2646 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c !test_and_set_bit(HCLGE_STATE_RST_SERVICE_SCHED, &hdev->state)) hdev 2647 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c queue_work_on(cpumask_first(&hdev->affinity_mask), system_wq, hdev 2648 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c &hdev->rst_service_task); hdev 2651 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c void hclge_task_schedule(struct hclge_dev *hdev, unsigned long delay_time) hdev 2653 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!test_bit(HCLGE_STATE_DOWN, &hdev->state) && hdev 2654 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c !test_bit(HCLGE_STATE_REMOVING, &hdev->state) && hdev 2655 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c !test_and_set_bit(HCLGE_STATE_SERVICE_SCHED, &hdev->state)) { hdev 2656 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hw_stats.stats_timer++; hdev 2657 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_arfs_expire_timer++; hdev 2658 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mod_delayed_work_on(cpumask_first(&hdev->affinity_mask), hdev 2659 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c system_wq, &hdev->service_task, hdev 2664 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_mac_link_status(struct hclge_dev *hdev) hdev 2672 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 2674 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "get link status cmd failed %d\n", hdev 2685 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_mac_phy_link(struct hclge_dev *hdev) hdev 2690 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (test_bit(HCLGE_STATE_DOWN, &hdev->state)) hdev 2693 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mac_state = hclge_get_mac_link_status(hdev); hdev 2695 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->hw.mac.phydev) { hdev 2696 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->hw.mac.phydev->state == PHY_RUNNING) hdev 2698 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hw.mac.phydev->link; hdev 2709 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_update_link_status(struct hclge_dev *hdev) hdev 2711 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hnae3_client *rclient = hdev->roce_client; hdev 2712 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hnae3_client *client = hdev->nic_client; hdev 2720 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c state = hclge_get_mac_phy_link(hdev); hdev 2721 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (state != hdev->hw.mac.link) { hdev 2722 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_vmdq_vport + 1; i++) { hdev 2723 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c handle = &hdev->vport[i].nic; hdev 2725 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_config_mac_tnl_int(hdev, state); hdev 2726 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c rhandle = &hdev->vport[i].roce; hdev 2731 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hw.mac.link = state; hdev 2759 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_sfp_speed(struct hclge_dev *hdev, u32 *speed) hdev 2767 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 2769 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 2773 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "get sfp speed failed %d\n", ret); hdev 2782 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_sfp_info(struct hclge_dev *hdev, struct hclge_mac *mac) hdev 2793 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 2795 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 2799 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "get sfp info failed %d\n", ret); hdev 2824 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_update_port_info(struct hclge_dev *hdev) hdev 2826 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_mac *mac = &hdev->hw.mac; hdev 2835 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hdev->support_sfp_query) hdev 2838 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->pdev->revision >= 0x21) hdev 2839 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_sfp_info(hdev, mac); hdev 2841 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_sfp_speed(hdev, &speed); hdev 2844 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->support_sfp_query = false; hdev 2850 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->pdev->revision >= 0x21) { hdev 2855 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_cfg_mac_speed_dup(hdev, mac->speed, hdev 2862 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_cfg_mac_speed_dup(hdev, speed, HCLGE_MAC_FULL); hdev 2869 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 2871 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_update_link_status(hdev); hdev 2873 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hdev->hw.mac.link; hdev 2876 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval) hdev 2881 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c rst_src_reg = hclge_read_dev(&hdev->hw, HCLGE_MISC_VECTOR_INT_STS); hdev 2882 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c cmdq_src_reg = hclge_read_dev(&hdev->hw, HCLGE_VECTOR0_CMDQ_SRC_REG); hdev 2883 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c msix_src_reg = hclge_read_dev(&hdev->hw, hdev 2895 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, "IMP reset interrupt\n"); hdev 2896 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HNAE3_IMP_RESET, &hdev->reset_pending); hdev 2897 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state); hdev 2899 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->rst_stats.imp_rst_cnt++; hdev 2904 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, "global reset interrupt\n"); hdev 2905 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state); hdev 2906 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HNAE3_GLOBAL_RESET, &hdev->reset_pending); hdev 2908 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->rst_stats.global_rst_cnt++; hdev 2914 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, "received event 0x%x\n", hdev 2928 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, hdev 2936 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_clear_event_cause(struct hclge_dev *hdev, u32 event_type, hdev 2941 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_write_dev(&hdev->hw, HCLGE_MISC_RESET_STS_REG, regclr); hdev 2944 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_write_dev(&hdev->hw, HCLGE_VECTOR0_CMDQ_SRC_REG, regclr); hdev 2951 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_clear_all_event_cause(struct hclge_dev *hdev) hdev 2953 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_clear_event_cause(hdev, HCLGE_VECTOR0_EVENT_RST, hdev 2957 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_clear_event_cause(hdev, HCLGE_VECTOR0_EVENT_MBX, 0); hdev 2967 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = data; hdev 2971 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_enable_vector(&hdev->misc_vector, false); hdev 2972 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c event_cause = hclge_check_event_cause(hdev, &clearval); hdev 2987 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HNAE3_UNKNOWN_RESET, &hdev->reset_request); hdev 2990 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_reset_task_schedule(hdev); hdev 3002 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_mbx_task_schedule(hdev); hdev 3005 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 3010 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_clear_event_cause(hdev, event_cause, clearval); hdev 3019 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_enable_vector(&hdev->misc_vector, true); hdev 3025 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_free_vector(struct hclge_dev *hdev, int vector_id) hdev 3027 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->vector_status[vector_id] == HCLGE_INVALID_VPORT) { hdev 3028 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 3033 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->vector_status[vector_id] = HCLGE_INVALID_VPORT; hdev 3034 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_msi_left += 1; hdev 3035 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_msi_used -= 1; hdev 3038 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_get_misc_vector(struct hclge_dev *hdev) hdev 3040 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_misc_vector *vector = &hdev->misc_vector; hdev 3042 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vector->vector_irq = pci_irq_vector(hdev->pdev, 0); hdev 3044 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vector->addr = hdev->hw.io_base + HCLGE_MISC_VECTOR_REG_BASE; hdev 3045 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->vector_status[0] = 0; hdev 3047 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_msi_left -= 1; hdev 3048 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_msi_used += 1; hdev 3054 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = container_of(notify, struct hclge_dev, hdev 3057 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c cpumask_copy(&hdev->affinity_mask, mask); hdev 3064 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_misc_affinity_setup(struct hclge_dev *hdev) hdev 3066 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c irq_set_affinity_hint(hdev->misc_vector.vector_irq, hdev 3067 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c &hdev->affinity_mask); hdev 3069 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->affinity_notify.notify = hclge_irq_affinity_notify; hdev 3070 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->affinity_notify.release = hclge_irq_affinity_release; hdev 3071 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c irq_set_affinity_notifier(hdev->misc_vector.vector_irq, hdev 3072 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c &hdev->affinity_notify); hdev 3075 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_misc_affinity_teardown(struct hclge_dev *hdev) hdev 3077 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c irq_set_affinity_notifier(hdev->misc_vector.vector_irq, NULL); hdev 3078 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c irq_set_affinity_hint(hdev->misc_vector.vector_irq, NULL); hdev 3081 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_misc_irq_init(struct hclge_dev *hdev) hdev 3085 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_get_misc_vector(hdev); hdev 3088 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = request_irq(hdev->misc_vector.vector_irq, hclge_misc_irq_handle, hdev 3089 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c 0, "hclge_misc", hdev); hdev 3091 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_free_vector(hdev, 0); hdev 3092 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "request misc irq(%d) fail\n", hdev 3093 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->misc_vector.vector_irq); hdev 3099 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_misc_irq_uninit(struct hclge_dev *hdev) hdev 3101 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c free_irq(hdev->misc_vector.vector_irq, hdev); hdev 3102 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_free_vector(hdev, 0); hdev 3105 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c int hclge_notify_client(struct hclge_dev *hdev, hdev 3108 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hnae3_client *client = hdev->nic_client; hdev 3111 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!test_bit(HCLGE_STATE_NIC_REGISTERED, &hdev->state) || !client) hdev 3117 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_vmdq_vport + 1; i++) { hdev 3118 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hnae3_handle *handle = &hdev->vport[i].nic; hdev 3123 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 3132 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_notify_roce_client(struct hclge_dev *hdev, hdev 3135 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hnae3_client *client = hdev->roce_client; hdev 3139 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!test_bit(HCLGE_STATE_ROCE_REGISTERED, &hdev->state) || !client) hdev 3145 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_vmdq_vport + 1; i++) { hdev 3146 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hnae3_handle *handle = &hdev->vport[i].roce; hdev 3150 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 3160 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_reset_wait(struct hclge_dev *hdev) hdev 3167 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c switch (hdev->reset_type) { hdev 3183 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 3185 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->reset_type); hdev 3189 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->reset_type == HNAE3_FLR_RESET) { hdev 3190 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c while (!test_bit(HNAE3_FLR_DONE, &hdev->flr_state) && hdev 3194 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!test_bit(HNAE3_FLR_DONE, &hdev->flr_state)) { hdev 3195 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 3203 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c val = hclge_read_dev(&hdev->hw, reg); hdev 3206 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c val = hclge_read_dev(&hdev->hw, reg); hdev 3211 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 3212 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c "Wait for reset timeout: %d\n", hdev->reset_type); hdev 3219 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_vf_rst(struct hclge_dev *hdev, int func_id, bool reset) hdev 3231 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 3234 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_all_vf_rst(struct hclge_dev *hdev, bool reset) hdev 3238 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = hdev->num_vmdq_vport + 1; i < hdev->num_alloc_vport; i++) { hdev 3239 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_vport *vport = &hdev->vport[i]; hdev 3243 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_vf_rst(hdev, vport->vport_id, reset); hdev 3245 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 3260 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 3268 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_func_reset_sync_vf(struct hclge_dev *hdev) hdev 3279 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 3287 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "sync with VF fail %d!\n", hdev 3297 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "sync with VF timeout!\n"); hdev 3301 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c void hclge_report_hw_error(struct hclge_dev *hdev, hdev 3304 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hnae3_client *client = hdev->nic_client; hdev 3308 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c !test_bit(HCLGE_STATE_NIC_REGISTERED, &hdev->state)) hdev 3311 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_vmdq_vport + 1; i++) hdev 3312 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c client->ops->process_hw_error(&hdev->vport[i].nic, type); hdev 3315 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_handle_imp_error(struct hclge_dev *hdev) hdev 3319 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c reg_val = hclge_read_dev(&hdev->hw, HCLGE_PF_OTHER_INT_REG); hdev 3321 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_report_hw_error(hdev, HNAE3_IMP_RD_POISON_ERROR); hdev 3323 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_write_dev(&hdev->hw, HCLGE_PF_OTHER_INT_REG, reg_val); hdev 3327 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_report_hw_error(hdev, HNAE3_CMDQ_ECC_ERROR); hdev 3329 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_write_dev(&hdev->hw, HCLGE_PF_OTHER_INT_REG, reg_val); hdev 3333 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c int hclge_func_reset_cmd(struct hclge_dev *hdev, int func_id) hdev 3343 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 3345 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 3351 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_do_reset(struct hclge_dev *hdev) hdev 3353 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hnae3_handle *handle = &hdev->vport[0].nic; hdev 3354 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct pci_dev *pdev = hdev->pdev; hdev 3360 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_read_dev(&hdev->hw, HCLGE_FUN_RST_ING), hdev 3361 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_read_dev(&hdev->hw, HCLGE_GLOBAL_RESET_REG)); hdev 3365 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c switch (hdev->reset_type) { hdev 3367 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c val = hclge_read_dev(&hdev->hw, HCLGE_GLOBAL_RESET_REG); hdev 3369 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_write_dev(&hdev->hw, HCLGE_GLOBAL_RESET_REG, val); hdev 3375 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HNAE3_FUNC_RESET, &hdev->reset_pending); hdev 3376 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_reset_task_schedule(hdev); hdev 3381 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HNAE3_FLR_RESET, &hdev->reset_pending); hdev 3382 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_reset_task_schedule(hdev); hdev 3386 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c "Unsupported reset type: %d\n", hdev->reset_type); hdev 3395 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = ae_dev->priv; hdev 3402 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_handle_hw_msix_error(hdev, addr); hdev 3411 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_enable_vector(&hdev->misc_vector, true); hdev 3432 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->reset_type != HNAE3_NONE_RESET && hdev 3433 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c rst_level < hdev->reset_type) hdev 3439 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_clear_reset_cause(struct hclge_dev *hdev) hdev 3443 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c switch (hdev->reset_type) { hdev 3460 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->pdev->revision == 0x20) hdev 3461 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_write_dev(&hdev->hw, HCLGE_MISC_RESET_STS_REG, hdev 3464 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_enable_vector(&hdev->misc_vector, true); hdev 3467 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_reset_prepare_down(struct hclge_dev *hdev) hdev 3471 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c switch (hdev->reset_type) { hdev 3475 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_all_vf_rst(hdev, true); hdev 3484 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_reset_handshake(struct hclge_dev *hdev, bool enable) hdev 3488 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c reg_val = hclge_read_dev(&hdev->hw, HCLGE_NIC_CSQ_DEPTH_REG); hdev 3494 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_write_dev(&hdev->hw, HCLGE_NIC_CSQ_DEPTH_REG, reg_val); hdev 3497 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_reset_prepare_wait(struct hclge_dev *hdev) hdev 3502 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c switch (hdev->reset_type) { hdev 3507 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_func_reset_sync_vf(hdev); hdev 3511 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_func_reset_cmd(hdev, 0); hdev 3513 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 3523 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state); hdev 3524 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->rst_stats.pf_rst_cnt++; hdev 3530 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_func_reset_sync_vf(hdev); hdev 3534 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state); hdev 3535 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HNAE3_FLR_DOWN, &hdev->flr_state); hdev 3536 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->rst_stats.flr_rst_cnt++; hdev 3539 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_handle_imp_error(hdev); hdev 3540 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c reg_val = hclge_read_dev(&hdev->hw, HCLGE_PF_OTHER_INT_REG); hdev 3541 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_write_dev(&hdev->hw, HCLGE_PF_OTHER_INT_REG, hdev 3550 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_reset_handshake(hdev, true); hdev 3551 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, "prepare wait ok\n"); hdev 3556 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static bool hclge_reset_err_handle(struct hclge_dev *hdev) hdev 3560 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->reset_pending) { hdev 3561 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, "Reset pending %lu\n", hdev 3562 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->reset_pending); hdev 3564 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c } else if (hclge_read_dev(&hdev->hw, HCLGE_MISC_VECTOR_INT_STS) & hdev 3566 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, hdev 3568 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_clear_reset_cause(hdev); hdev 3570 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c } else if (hdev->rst_stats.reset_fail_cnt < MAX_RESET_FAIL_CNT) { hdev 3571 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->rst_stats.reset_fail_cnt++; hdev 3572 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(hdev->reset_type, &hdev->reset_pending); hdev 3573 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, hdev 3575 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->rst_stats.reset_fail_cnt); hdev 3579 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_clear_reset_cause(hdev); hdev 3582 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_reset_handshake(hdev, true); hdev 3584 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "Reset fail!\n"); hdev 3588 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_rst_done(struct hclge_dev *hdev) hdev 3598 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 3604 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 3609 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "assert PF reset done fail %d!\n", hdev 3616 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_reset_prepare_up(struct hclge_dev *hdev) hdev 3620 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c switch (hdev->reset_type) { hdev 3624 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_all_vf_rst(hdev, false); hdev 3629 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_rst_done(hdev); hdev 3636 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_reset_handshake(hdev, false); hdev 3641 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_reset_stack(struct hclge_dev *hdev) hdev 3645 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_notify_client(hdev, HNAE3_UNINIT_CLIENT); hdev 3649 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_reset_ae_dev(hdev->ae_dev); hdev 3653 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_notify_client(hdev, HNAE3_INIT_CLIENT); hdev 3657 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_notify_client(hdev, HNAE3_RESTORE_CLIENT); hdev 3660 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_reset(struct hclge_dev *hdev) hdev 3662 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev); hdev 3669 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ae_dev->reset_type = hdev->reset_type; hdev 3670 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->rst_stats.reset_cnt++; hdev 3672 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_notify_roce_client(hdev, HNAE3_DOWN_CLIENT); hdev 3676 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_reset_prepare_down(hdev); hdev 3681 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_notify_client(hdev, HNAE3_DOWN_CLIENT); hdev 3687 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_reset_prepare_wait(hdev); hdev 3691 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hclge_reset_wait(hdev)) hdev 3694 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->rst_stats.hw_reset_done_cnt++; hdev 3696 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_notify_roce_client(hdev, HNAE3_UNINIT_CLIENT); hdev 3702 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_reset_stack(hdev); hdev 3706 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_clear_reset_cause(hdev); hdev 3708 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_reset_prepare_up(hdev); hdev 3714 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_notify_roce_client(hdev, HNAE3_INIT_CLIENT); hdev 3719 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->rst_stats.reset_fail_cnt < HCLGE_RESET_MAX_FAIL_CNT - 1) hdev 3724 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_notify_client(hdev, HNAE3_UP_CLIENT); hdev 3730 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_notify_roce_client(hdev, HNAE3_UP_CLIENT); hdev 3734 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->last_reset_time = jiffies; hdev 3735 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->rst_stats.reset_fail_cnt = 0; hdev 3736 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->rst_stats.reset_done_cnt++; hdev 3744 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c &hdev->default_reset_request); hdev 3746 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(reset_level, &hdev->reset_request); hdev 3753 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hclge_reset_err_handle(hdev)) hdev 3754 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_reset_task_schedule(hdev); hdev 3760 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = ae_dev->priv; hdev 3778 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c handle = &hdev->vport[0].nic; hdev 3780 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (time_before(jiffies, (hdev->last_reset_time + hdev 3782 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mod_timer(&hdev->reset_timer, jiffies + HCLGE_RESET_INTERVAL); hdev 3784 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c } else if (hdev->default_reset_request) hdev 3785 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->reset_level = hdev 3787 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c &hdev->default_reset_request); hdev 3788 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c else if (time_after(jiffies, (hdev->last_reset_time + 4 * 5 * HZ))) hdev 3789 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->reset_level = HNAE3_FUNC_RESET; hdev 3791 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, "received reset event, reset type is %d\n", hdev 3792 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->reset_level); hdev 3795 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(hdev->reset_level, &hdev->reset_request); hdev 3796 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_reset_task_schedule(hdev); hdev 3798 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->reset_level < HNAE3_GLOBAL_RESET) hdev 3799 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->reset_level++; hdev 3805 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = ae_dev->priv; hdev 3807 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(rst_type, &hdev->default_reset_request); hdev 3812 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = from_timer(hdev, t, reset_timer); hdev 3817 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hdev->default_reset_request) hdev 3820 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, hdev 3822 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_reset_event(hdev->pdev, NULL); hdev 3825 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_reset_subtask(struct hclge_dev *hdev) hdev 3827 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev); hdev 3838 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->last_reset_time = jiffies; hdev 3839 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->reset_type = hclge_get_reset_level(ae_dev, &hdev->reset_pending); hdev 3840 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->reset_type != HNAE3_NONE_RESET) hdev 3841 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_reset(hdev); hdev 3844 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->reset_type = hclge_get_reset_level(ae_dev, &hdev->reset_request); hdev 3845 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->reset_type != HNAE3_NONE_RESET) hdev 3846 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_do_reset(hdev); hdev 3848 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->reset_type = HNAE3_NONE_RESET; hdev 3853 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = hdev 3856 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (test_and_set_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) hdev 3859 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_RST_SERVICE_SCHED, &hdev->state); hdev 3861 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_reset_subtask(hdev); hdev 3863 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_RST_HANDLING, &hdev->state); hdev 3868 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = hdev 3871 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (test_and_set_bit(HCLGE_STATE_MBX_HANDLING, &hdev->state)) hdev 3874 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_MBX_SERVICE_SCHED, &hdev->state); hdev 3876 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_mbx_handler(hdev); hdev 3878 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_MBX_HANDLING, &hdev->state); hdev 3881 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_update_vport_alive(struct hclge_dev *hdev) hdev 3886 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 1; i < hdev->num_alloc_vport; i++) { hdev 3887 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_vport *vport = &hdev->vport[i]; hdev 3900 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = hdev 3903 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_SERVICE_SCHED, &hdev->state); hdev 3905 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->hw_stats.stats_timer >= HCLGE_STATS_TIMER_INTERVAL) { hdev 3906 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_update_stats_for_all(hdev); hdev 3907 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hw_stats.stats_timer = 0; hdev 3910 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_update_port_info(hdev); hdev 3911 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_update_link_status(hdev); hdev 3912 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_update_vport_alive(hdev); hdev 3913 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_sync_vlan_filter(hdev); hdev 3914 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->fd_arfs_expire_timer >= HCLGE_FD_ARFS_EXPIRE_TIMER_INTERVAL) { hdev 3915 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_rfs_filter_expire(hdev); hdev 3916 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_arfs_expire_timer = 0; hdev 3919 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_task_schedule(hdev, round_jiffies_relative(HZ)); hdev 3938 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 3942 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vector_num = min_t(u16, hdev->num_nic_msi - 1, vector_num); hdev 3943 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vector_num = min(hdev->num_msi_left, vector_num); hdev 3946 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 1; i < hdev->num_msi; i++) { hdev 3947 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->vector_status[i] == HCLGE_INVALID_VPORT) { hdev 3948 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vector->vector = pci_irq_vector(hdev->pdev, i); hdev 3949 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vector->io_addr = hdev->hw.io_base + hdev 3954 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->vector_status[i] = vport->vport_id; hdev 3955 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->vector_irq[i] = vector->vector; hdev 3964 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_msi_left -= alloc; hdev 3965 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_msi_used += alloc; hdev 3970 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_vector_index(struct hclge_dev *hdev, int vector) hdev 3974 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_msi; i++) hdev 3975 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (vector == hdev->vector_irq[i]) hdev 3984 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 3987 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vector_id = hclge_get_vector_index(hdev, vector); hdev 3989 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 3994 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_free_vector(hdev, vector_id); hdev 4009 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_rss_algo_key(struct hclge_dev *hdev, hdev 4035 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 4037 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 4046 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_rss_indir_table(struct hclge_dev *hdev, const u8 *indir) hdev 4067 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 4069 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 4078 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_rss_tc_mode(struct hclge_dev *hdev, u16 *tc_valid, hdev 4101 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 4103 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 4125 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_rss_input_tuple(struct hclge_dev *hdev) hdev 4136 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c req->ipv4_tcp_en = hdev->vport[0].rss_tuple_sets.ipv4_tcp_en; hdev 4137 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c req->ipv4_udp_en = hdev->vport[0].rss_tuple_sets.ipv4_udp_en; hdev 4138 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c req->ipv4_sctp_en = hdev->vport[0].rss_tuple_sets.ipv4_sctp_en; hdev 4139 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c req->ipv4_fragment_en = hdev->vport[0].rss_tuple_sets.ipv4_fragment_en; hdev 4140 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c req->ipv6_tcp_en = hdev->vport[0].rss_tuple_sets.ipv6_tcp_en; hdev 4141 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c req->ipv6_udp_en = hdev->vport[0].rss_tuple_sets.ipv6_udp_en; hdev 4142 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c req->ipv6_sctp_en = hdev->vport[0].rss_tuple_sets.ipv6_sctp_en; hdev 4143 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c req->ipv6_fragment_en = hdev->vport[0].rss_tuple_sets.ipv6_fragment_en; hdev 4144 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_get_rss_type(&hdev->vport[0]); hdev 4145 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 4147 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 4189 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 4209 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_rss_algo_key(hdev, hash_algo, key); hdev 4223 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_set_rss_indir_table(hdev, vport->rss_indirection_tbl); hdev 4255 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 4311 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 4313 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 4383 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 4385 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hdev->rss_size_max; hdev 4388 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c int hclge_rss_init_hw(struct hclge_dev *hdev) hdev 4390 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_vport *vport = hdev->vport; hdev 4402 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_rss_indir_table(hdev, rss_indir); hdev 4406 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_rss_algo_key(hdev, hfunc, key); hdev 4410 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_rss_input_tuple(hdev); hdev 4419 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 4431 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!(hdev->hw_tc_map & BIT(i))) hdev 4439 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_set_rss_tc_mode(hdev, tc_valid, tc_size, tc_offset); hdev 4442 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c void hclge_rss_indir_init_cfg(struct hclge_dev *hdev) hdev 4444 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_vport *vport = hdev->vport; hdev 4447 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (j = 0; j < hdev->num_vmdq_vport + 1; j++) { hdev 4454 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_rss_init_cfg(struct hclge_dev *hdev) hdev 4457 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_vport *vport = hdev->vport; hdev 4459 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->pdev->revision >= 0x21) hdev 4462 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_vmdq_vport + 1; i++) { hdev 4486 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_rss_indir_init_cfg(hdev); hdev 4493 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 4525 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c status = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 4527 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 4544 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c status = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 4546 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 4559 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 4562 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vector_id = hclge_get_vector_index(hdev, vector); hdev 4564 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 4576 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 4579 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) hdev 4582 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vector_id = hclge_get_vector_index(hdev, vector); hdev 4598 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c int hclge_cmd_set_promisc_mode(struct hclge_dev *hdev, hdev 4618 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 4620 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 4646 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 4659 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_cmd_set_promisc_mode(hdev, ¶m); hdev 4662 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_fd_mode(struct hclge_dev *hdev, u8 *fd_mode) hdev 4672 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 4674 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "get fd mode fail, ret=%d\n", ret); hdev 4683 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_fd_allocation(struct hclge_dev *hdev, hdev 4697 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 4699 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "query fd allocation fail, ret=%d\n", hdev 4712 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_fd_key_config(struct hclge_dev *hdev, int stage_num) hdev 4722 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c stage = &hdev->fd_cfg.key_cfg[stage_num]; hdev 4732 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 4734 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "set fd key fail, ret=%d\n", ret); hdev 4739 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_init_fd_config(struct hclge_dev *hdev) hdev 4745 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hnae3_dev_fd_supported(hdev)) hdev 4748 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_fd_mode(hdev, &hdev->fd_cfg.fd_mode); hdev 4752 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c switch (hdev->fd_cfg.fd_mode) { hdev 4754 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_cfg.max_key_length = MAX_KEY_LENGTH; hdev 4757 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_cfg.max_key_length = MAX_KEY_LENGTH / 2; hdev 4760 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 4762 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_cfg.fd_mode); hdev 4766 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_cfg.proto_support = hdev 4769 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c key_cfg = &hdev->fd_cfg.key_cfg[HCLGE_FD_STAGE_1]; hdev 4782 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->fd_cfg.max_key_length == MAX_KEY_LENGTH) { hdev 4783 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_cfg.proto_support |= ETHER_FLOW; hdev 4793 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_fd_allocation(hdev, hdev 4794 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c &hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1], hdev 4795 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c &hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_2], hdev 4796 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c &hdev->fd_cfg.cnt_num[HCLGE_FD_STAGE_1], hdev 4797 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c &hdev->fd_cfg.cnt_num[HCLGE_FD_STAGE_2]); hdev 4801 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_set_fd_key_config(hdev, HCLGE_FD_STAGE_1); hdev 4804 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_fd_tcam_config(struct hclge_dev *hdev, u8 stage, bool sel_x, hdev 4837 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, desc, 3); hdev 4839 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 4846 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_fd_ad_config(struct hclge_dev *hdev, u8 stage, int loc, hdev 4878 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 4880 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "fd ad config fail, ret=%d\n", ret); hdev 5049 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_config_key(struct hclge_dev *hdev, u8 stage, hdev 5052 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_fd_key_cfg *key_cfg = &hdev->fd_cfg.key_cfg[stage]; hdev 5079 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c meta_data_region = hdev->fd_cfg.max_key_length / 8 - hdev 5087 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_fd_tcam_config(hdev, stage, false, rule->location, key_y, hdev 5090 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 5096 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_fd_tcam_config(hdev, stage, true, rule->location, key_x, hdev 5099 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 5105 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_config_action(struct hclge_dev *hdev, u8 stage, hdev 5131 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_fd_ad_config(hdev, stage, ad_data.ad_id, &ad_data); hdev 5134 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_fd_check_spec(struct hclge_dev *hdev, hdev 5143 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (fs->location >= hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1]) hdev 5146 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!(fs->flow_type & hdev->fd_cfg.proto_support)) hdev 5151 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "user-def bytes are not supported\n"); hdev 5288 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!(hdev->fd_cfg.proto_support & ETHER_FLOW)) hdev 5300 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static bool hclge_fd_rule_exist(struct hclge_dev *hdev, u16 location) hdev 5305 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_lock_bh(&hdev->fd_rule_lock); hdev 5306 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hlist_for_each_entry_safe(rule, node2, &hdev->fd_rule_list, rule_node) { hdev 5311 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 5317 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_fd_update_rule_list(struct hclge_dev *hdev, hdev 5329 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c &hdev->fd_rule_list, rule_node) { hdev 5338 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hclge_fd_rule_num--; hdev 5341 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hdev->hclge_fd_rule_num) hdev 5342 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_active_type = HCLGE_FD_RULE_NONE; hdev 5343 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(location, hdev->fd_bmap); hdev 5348 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 5359 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hlist_add_head(&new_rule->rule_node, &hdev->fd_rule_list); hdev 5361 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(location, hdev->fd_bmap); hdev 5362 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hclge_fd_rule_num++; hdev 5363 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_active_type = new_rule->rule_type; hdev 5368 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_fd_get_tuple(struct hclge_dev *hdev, hdev 5522 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_fd_config_rule(struct hclge_dev *hdev, hdev 5528 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 5534 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_fd_update_rule_list(hdev, rule, rule->location, true); hdev 5536 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_config_action(hdev, HCLGE_FD_STAGE_1, rule); hdev 5540 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_config_key(hdev, HCLGE_FD_STAGE_1, rule); hdev 5547 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_fd_update_rule_list(hdev, rule, rule->location, false); hdev 5555 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 5563 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hnae3_dev_fd_supported(hdev)) hdev 5566 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hdev->fd_en) { hdev 5567 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 5574 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_fd_check_spec(hdev, fs, &unused); hdev 5576 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "Check fd spec failed\n"); hdev 5587 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (vf > hdev->num_req_vfs) { hdev 5588 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 5590 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vf, hdev->num_req_vfs); hdev 5594 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dst_vport_id = vf ? hdev->vport[vf].vport_id : vport->vport_id; hdev 5595 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c tqps = vf ? hdev->vport[vf].alloc_tqps : vport->alloc_tqps; hdev 5598 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 5612 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_fd_get_tuple(hdev, fs, rule); hdev 5632 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_lock_bh(&hdev->fd_rule_lock); hdev 5633 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_fd_config_rule(hdev, rule); hdev 5635 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 5644 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 5648 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hnae3_dev_fd_supported(hdev)) hdev 5653 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (fs->location >= hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1]) hdev 5656 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hclge_fd_rule_exist(hdev, fs->location)) { hdev 5657 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 5662 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_fd_tcam_config(hdev, HCLGE_FD_STAGE_1, true, fs->location, hdev 5667 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_lock_bh(&hdev->fd_rule_lock); hdev 5668 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_fd_update_rule_list(hdev, NULL, fs->location, false); hdev 5670 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 5679 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 5684 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hnae3_dev_fd_supported(hdev)) hdev 5687 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_lock_bh(&hdev->fd_rule_lock); hdev 5688 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for_each_set_bit(location, hdev->fd_bmap, hdev 5689 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1]) hdev 5690 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_fd_tcam_config(hdev, HCLGE_FD_STAGE_1, true, location, hdev 5694 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hlist_for_each_entry_safe(rule, node, &hdev->fd_rule_list, hdev 5699 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_active_type = HCLGE_FD_RULE_NONE; hdev 5700 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hclge_fd_rule_num = 0; hdev 5701 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c bitmap_zero(hdev->fd_bmap, hdev 5702 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1]); hdev 5705 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 5711 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 5720 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hnae3_dev_fd_supported(hdev)) hdev 5724 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hdev->fd_en) hdev 5727 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_lock_bh(&hdev->fd_rule_lock); hdev 5728 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hlist_for_each_entry_safe(rule, node, &hdev->fd_rule_list, rule_node) { hdev 5729 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_config_action(hdev, HCLGE_FD_STAGE_1, rule); hdev 5731 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_config_key(hdev, HCLGE_FD_STAGE_1, rule); hdev 5734 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 5737 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(rule->location, hdev->fd_bmap); hdev 5740 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hclge_fd_rule_num--; hdev 5744 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->hclge_fd_rule_num) hdev 5745 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_active_type = HCLGE_FD_EP_ACTIVE; hdev 5747 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 5756 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 5758 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hnae3_dev_fd_supported(hdev)) hdev 5761 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c cmd->rule_cnt = hdev->hclge_fd_rule_num; hdev 5762 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c cmd->data = hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1]; hdev 5772 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 5776 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hnae3_dev_fd_supported(hdev)) hdev 5781 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_lock_bh(&hdev->fd_rule_lock); hdev 5783 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hlist_for_each_entry_safe(rule, node2, &hdev->fd_rule_list, rule_node) { hdev 5789 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 5935 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 5967 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 5976 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 5981 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hnae3_dev_fd_supported(hdev)) hdev 5984 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c cmd->data = hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1]; hdev 5986 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_lock_bh(&hdev->fd_rule_lock); hdev 5988 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c &hdev->fd_rule_list, rule_node) { hdev 5990 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 5998 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 6030 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_fd_search_flow_keys(struct hclge_dev *hdev, hdev 6036 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hlist_for_each_entry_safe(rule, node, &hdev->fd_rule_list, rule_node) { hdev 6073 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 6079 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hnae3_dev_fd_supported(hdev)) hdev 6085 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_lock_bh(&hdev->fd_rule_lock); hdev 6090 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->fd_active_type == HCLGE_FD_EP_ACTIVE) { hdev 6091 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 6101 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c rule = hclge_fd_search_flow_keys(hdev, &new_tuples); hdev 6103 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c bit_id = find_first_zero_bit(hdev->fd_bmap, MAX_FD_FILTER_NUM); hdev 6104 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (bit_id >= hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1]) { hdev 6105 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 6112 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 6117 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(bit_id, hdev->fd_bmap); hdev 6122 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_fd_config_rule(hdev, rule); hdev 6124 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 6132 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 6139 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_config_action(hdev, HCLGE_FD_STAGE_1, rule); hdev 6148 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_rfs_filter_expire(struct hclge_dev *hdev) hdev 6151 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hnae3_handle *handle = &hdev->vport[0].nic; hdev 6156 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_lock_bh(&hdev->fd_rule_lock); hdev 6157 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->fd_active_type != HCLGE_FD_ARFS_ACTIVE) { hdev 6158 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 6161 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hlist_for_each_entry_safe(rule, node, &hdev->fd_rule_list, rule_node) { hdev 6166 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hclge_fd_rule_num--; hdev 6167 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(rule->location, hdev->fd_bmap); hdev 6170 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_unlock_bh(&hdev->fd_rule_lock); hdev 6173 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_fd_tcam_config(hdev, HCLGE_FD_STAGE_1, true, hdev 6184 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 6186 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->fd_active_type == HCLGE_FD_ARFS_ACTIVE) hdev 6194 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 6196 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_read_dev(&hdev->hw, HCLGE_GLOBAL_RESET_REG) || hdev 6197 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_read_dev(&hdev->hw, HCLGE_FUN_RST_ING); hdev 6203 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 6205 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state); hdev 6211 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 6213 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hdev->rst_stats.hw_reset_done_cnt; hdev 6219 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 6222 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fd_en = enable; hdev 6223 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear = hdev->fd_active_type == HCLGE_FD_ARFS_ACTIVE; hdev 6230 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_cfg_mac_mode(struct hclge_dev *hdev, bool enable) hdev 6255 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 6257 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6261 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_config_switch_param(struct hclge_dev *hdev, int vfid, hdev 6278 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 6280 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6290 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 6292 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6297 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_phy_link_status_wait(struct hclge_dev *hdev, hdev 6302 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct phy_device *phydev = hdev->hw.mac.phydev; hdev 6309 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6321 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_mac_link_status_wait(struct hclge_dev *hdev, int link_ret) hdev 6329 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_mac_link_status(hdev); hdev 6340 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_mac_phy_link_status_wait(struct hclge_dev *hdev, bool en, hdev 6351 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_phy_link_status_wait(hdev, link_ret); hdev 6353 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_mac_link_status_wait(hdev, link_ret); hdev 6356 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_app_loopback(struct hclge_dev *hdev, bool en) hdev 6366 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 6368 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6385 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 6387 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6392 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_cfg_serdes_loopback(struct hclge_dev *hdev, bool en, hdev 6414 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6426 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 6428 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6437 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 6439 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6447 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "serdes loopback set timeout\n"); hdev 6450 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "serdes loopback set failed in fw\n"); hdev 6456 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_serdes_loopback(struct hclge_dev *hdev, bool en, hdev 6461 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cfg_serdes_loopback(hdev, en, loop_mode); hdev 6465 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_cfg_mac_mode(hdev, en); hdev 6467 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_mac_phy_link_status_wait(hdev, en, FALSE); hdev 6469 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6475 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_enable_phy_loopback(struct hclge_dev *hdev, hdev 6493 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_disable_phy_loopback(struct hclge_dev *hdev, hdev 6505 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_phy_loopback(struct hclge_dev *hdev, bool en) hdev 6507 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct phy_device *phydev = hdev->hw.mac.phydev; hdev 6514 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_enable_phy_loopback(hdev, phydev); hdev 6516 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_disable_phy_loopback(hdev, phydev); hdev 6518 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6523 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_cfg_mac_mode(hdev, en); hdev 6525 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_mac_phy_link_status_wait(hdev, en, TRUE); hdev 6527 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6533 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_tqp_enable(struct hclge_dev *hdev, unsigned int tqp_id, hdev 6547 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 6549 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6559 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 6567 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->pdev->revision >= 0x21) { hdev 6570 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_config_switch_param(hdev, PF_VPORT_ID, switch_param, hdev 6578 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_app_loopback(hdev, en); hdev 6582 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_serdes_loopback(hdev, en, loop_mode); hdev 6585 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_phy_loopback(hdev, en); hdev 6589 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6599 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_tqp_enable(hdev, i, 0, en); hdev 6607 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_default_loopback(struct hclge_dev *hdev) hdev 6611 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_app_loopback(hdev, false); hdev 6615 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cfg_serdes_loopback(hdev, false, HNAE3_LOOP_SERIAL_SERDES); hdev 6619 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_cfg_serdes_loopback(hdev, false, hdev 6642 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 6645 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_task_schedule(hdev, round_jiffies_relative(HZ)); hdev 6650 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HCLGE_STATE_DOWN, &hdev->state); hdev 6651 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c cancel_delayed_work_sync(&hdev->service_task); hdev 6652 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_SERVICE_SCHED, &hdev->state); hdev 6659 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 6662 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_cfg_mac_mode(hdev, true); hdev 6663 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_DOWN, &hdev->state); hdev 6664 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->hw.mac.link = 0; hdev 6669 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_mac_start_phy(hdev); hdev 6677 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 6680 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HCLGE_STATE_DOWN, &hdev->state); hdev 6687 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) && hdev 6688 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->reset_type != HNAE3_FUNC_RESET) { hdev 6689 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_mac_stop_phy(hdev); hdev 6690 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_update_link_status(hdev); hdev 6697 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_config_mac_tnl_int(hdev, false); hdev 6700 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_cfg_mac_mode(hdev, false); hdev 6702 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_mac_stop_phy(hdev); hdev 6706 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_update_link_status(hdev); hdev 6739 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 6742 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6752 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6756 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6761 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6769 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_dbg(&hdev->pdev->dev, hdev 6774 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6782 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_dbg(&hdev->pdev->dev, hdev 6787 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6793 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6863 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 6873 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 6875 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6892 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 6910 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, desc, 3); hdev 6915 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, desc, 1); hdev 6918 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6934 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 6948 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 6964 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, mc_desc, 3); hdev 6974 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 6983 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_init_umv_space(struct hclge_dev *hdev) hdev 6988 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_umv_space(hdev, hdev->wanted_umv_size, &allocated_size, hdev 6993 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (allocated_size < hdev->wanted_umv_size) hdev 6994 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 6996 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->wanted_umv_size, allocated_size); hdev 6998 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_init(&hdev->umv_mutex); hdev 6999 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->max_umv_size = allocated_size; hdev 7004 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->priv_umv_size = hdev->max_umv_size / (hdev->num_req_vfs + 2); hdev 7005 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->share_umv_size = hdev->priv_umv_size + hdev 7006 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->max_umv_size % (hdev->num_req_vfs + 2); hdev 7011 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_uninit_umv_space(struct hclge_dev *hdev) hdev 7015 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->max_umv_size > 0) { hdev 7016 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_umv_space(hdev, hdev->max_umv_size, NULL, hdev 7020 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->max_umv_size = 0; hdev 7022 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_destroy(&hdev->umv_mutex); hdev 7027 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_umv_space(struct hclge_dev *hdev, u16 space_size, hdev 7041 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 7043 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7055 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_reset_umv_space(struct hclge_dev *hdev) hdev 7060 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_alloc_vport; i++) { hdev 7061 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vport = &hdev->vport[i]; hdev 7065 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_lock(&hdev->umv_mutex); hdev 7066 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->share_umv_size = hdev->priv_umv_size + hdev 7067 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->max_umv_size % (hdev->num_req_vfs + 2); hdev 7068 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_unlock(&hdev->umv_mutex); hdev 7073 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 7076 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_lock(&hdev->umv_mutex); hdev 7077 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c is_full = (vport->used_umv_num >= hdev->priv_umv_size && hdev 7078 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->share_umv_size == 0); hdev 7079 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_unlock(&hdev->umv_mutex); hdev 7086 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 7088 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_lock(&hdev->umv_mutex); hdev 7090 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (vport->used_umv_num > hdev->priv_umv_size) hdev 7091 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->share_umv_size++; hdev 7096 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (vport->used_umv_num >= hdev->priv_umv_size && hdev 7097 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->share_umv_size > 0) hdev 7098 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->share_umv_size--; hdev 7101 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_unlock(&hdev->umv_mutex); hdev 7115 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 7125 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7155 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "UC MAC table full(%u)\n", hdev 7156 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->priv_umv_size); hdev 7163 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, "VF %d mac(%pM) exists\n", hdev 7168 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7186 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 7194 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_dbg(&hdev->pdev->dev, "Remove mac err! invalid mac:%pM.\n", hdev 7220 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 7227 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7248 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "mc mac vlan table is full\n"); hdev 7264 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 7271 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_dbg(&hdev->pdev->dev, hdev 7382 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c void hclge_uninit_vport_mac_table(struct hclge_dev *hdev) hdev 7388 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_lock(&hdev->vport_cfg_mutex); hdev 7389 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_alloc_vport; i++) { hdev 7390 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vport = &hdev->vport[i]; hdev 7401 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_unlock(&hdev->vport_cfg_mutex); hdev 7404 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_mac_ethertype_cmd_status(struct hclge_dev *hdev, hdev 7415 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7427 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7432 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7437 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7446 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_add_mgr_tbl(struct hclge_dev *hdev, hdev 7457 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 7459 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7468 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_get_mac_ethertype_cmd_status(hdev, retval, resp_code); hdev 7471 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int init_mgr_tbl(struct hclge_dev *hdev) hdev 7477 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_add_mgr_tbl(hdev, &hclge_mgr_table[i]); hdev 7479 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7492 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 7494 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ether_addr_copy(p, hdev->hw.mac.mac_addr); hdev 7502 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 7509 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7516 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_rm_uc_addr(handle, hdev->hw.mac.mac_addr)) hdev 7517 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 7522 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7527 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_add_uc_addr(handle, hdev->hw.mac.mac_addr)) hdev 7528 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7534 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_pause_addr_cfg(hdev, new_addr); hdev 7536 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7542 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ether_addr_copy(hdev->hw.mac.mac_addr, new_addr); hdev 7551 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 7553 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hdev->hw.mac.phydev) hdev 7556 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return phy_mii_ioctl(hdev->hw.mac.phydev, ifr, cmd); hdev 7559 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_vlan_filter_ctrl(struct hclge_dev *hdev, u8 vlan_type, hdev 7573 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 7575 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "set vlan filter fail, ret =%d.\n", hdev 7596 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 7598 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->pdev->revision >= 0x21) { hdev 7599 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_set_vlan_filter_ctrl(hdev, HCLGE_FILTER_TYPE_VF, hdev 7601 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_set_vlan_filter_ctrl(hdev, HCLGE_FILTER_TYPE_PORT, hdev 7604 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_set_vlan_filter_ctrl(hdev, HCLGE_FILTER_TYPE_VF, hdev 7614 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_vf_vlan_common(struct hclge_dev *hdev, u16 vfid, hdev 7629 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (test_bit(vfid, hdev->vf_vlan_full) && !is_kill) hdev 7653 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, desc, 2); hdev 7655 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7667 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(vfid, hdev->vf_vlan_full); hdev 7668 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 7673 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7689 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7697 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_port_vlan_filter(struct hclge_dev *hdev, __be16 proto, hdev 7718 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 7720 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7725 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_vlan_filter_hw(struct hclge_dev *hdev, __be16 proto, hdev 7735 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_vf_vlan_common(hdev, vport_id, is_kill, vlan_id, hdev 7738 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7746 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c test_bit(vport_id, hdev->vlan_table[vlan_id])) hdev 7749 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!is_kill && test_and_set_bit(vport_id, hdev->vlan_table[vlan_id])) { hdev 7750 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7757 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c !test_and_clear_bit(vport_id, hdev->vlan_table[vlan_id])) { hdev 7758 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7764 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for_each_set_bit(vport_idx, hdev->vlan_table[vlan_id], HCLGE_VPORT_NUM) hdev 7768 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_port_vlan_filter(hdev, proto, vlan_id, hdev 7778 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 7808 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c status = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 7810 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7821 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 7844 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c status = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 7846 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7899 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_vlan_protocol_type(struct hclge_dev *hdev) hdev 7909 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c cpu_to_le16(hdev->vlan_type_cfg.rx_ot_fst_vlan_type); hdev 7911 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c cpu_to_le16(hdev->vlan_type_cfg.rx_ot_sec_vlan_type); hdev 7913 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c cpu_to_le16(hdev->vlan_type_cfg.rx_in_fst_vlan_type); hdev 7915 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c cpu_to_le16(hdev->vlan_type_cfg.rx_in_sec_vlan_type); hdev 7917 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c status = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 7919 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7928 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c tx_req->ot_vlan_type = cpu_to_le16(hdev->vlan_type_cfg.tx_ot_vlan_type); hdev 7929 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c tx_req->in_vlan_type = cpu_to_le16(hdev->vlan_type_cfg.tx_in_vlan_type); hdev 7931 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c status = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 7933 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 7940 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_init_vlan_config(struct hclge_dev *hdev) hdev 7944 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hnae3_handle *handle = &hdev->vport[0].nic; hdev 7949 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->pdev->revision >= 0x21) { hdev 7951 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_alloc_vport; i++) { hdev 7952 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vport = &hdev->vport[i]; hdev 7953 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_vlan_filter_ctrl(hdev, hdev 7962 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_vlan_filter_ctrl(hdev, HCLGE_FILTER_TYPE_PORT, hdev 7968 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_vlan_filter_ctrl(hdev, HCLGE_FILTER_TYPE_VF, hdev 7977 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->vlan_type_cfg.rx_in_fst_vlan_type = HCLGE_DEF_VLAN_TYPE; hdev 7978 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->vlan_type_cfg.rx_in_sec_vlan_type = HCLGE_DEF_VLAN_TYPE; hdev 7979 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->vlan_type_cfg.rx_ot_fst_vlan_type = HCLGE_DEF_VLAN_TYPE; hdev 7980 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->vlan_type_cfg.rx_ot_sec_vlan_type = HCLGE_DEF_VLAN_TYPE; hdev 7981 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->vlan_type_cfg.tx_ot_vlan_type = HCLGE_DEF_VLAN_TYPE; hdev 7982 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->vlan_type_cfg.tx_in_vlan_type = HCLGE_DEF_VLAN_TYPE; hdev 7984 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_vlan_protocol_type(hdev); hdev 7988 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_alloc_vport; i++) { hdev 7991 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vport = &hdev->vport[i]; hdev 8022 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8027 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_vlan_filter_hw(hdev, htons(ETH_P_8021Q), hdev 8031 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 8047 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8052 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_set_vlan_filter_hw(hdev, hdev 8068 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8072 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_set_vlan_filter_hw(hdev, hdev 8086 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c void hclge_uninit_vport_vlan_table(struct hclge_dev *hdev) hdev 8092 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_lock(&hdev->vport_cfg_mutex); hdev 8093 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_alloc_vport; i++) { hdev 8094 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vport = &hdev->vport[i]; hdev 8100 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_unlock(&hdev->vport_cfg_mutex); hdev 8107 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8112 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_lock(&hdev->vport_cfg_mutex); hdev 8113 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_alloc_vport; i++) { hdev 8114 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vport = &hdev->vport[i]; hdev 8120 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_set_vlan_filter_hw(hdev, htons(vlan_proto), hdev 8128 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_set_vlan_filter_hw(hdev, hdev 8136 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_unlock(&hdev->vport_cfg_mutex); hdev 8162 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8167 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_set_vlan_filter_hw(hdev, hdev 8174 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_vlan_filter_hw(hdev, htons(old_info->vlan_proto), hdev 8188 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8199 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_vlan_filter_hw(hdev, hdev 8208 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_vlan_filter_hw(hdev, hdev 8262 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8267 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->pdev->revision == 0x20) hdev 8271 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (vfid >= hdev->num_alloc_vfs || vlan > VLAN_N_VID - 1 || qos > 7) hdev 8276 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vport = &hdev->vport[vfid]; hdev 8289 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_notify_client(hdev, HNAE3_DOWN_CLIENT); hdev 8291 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_notify_client(hdev, HNAE3_UP_CLIENT); hdev 8300 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_push_vf_port_base_vlan_info(&hdev->vport[0], hdev 8312 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8320 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) && is_kill) { hdev 8332 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_vlan_filter_hw(hdev, proto, vport->vport_id, hdev 8353 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_sync_vlan_filter(struct hclge_dev *hdev) hdev 8361 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_alloc_vport; i++) { hdev 8362 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_vport *vport = &hdev->vport[i]; hdev 8367 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_vlan_filter_hw(hdev, htons(ETH_P_8021Q), hdev 8386 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_mac_mtu(struct hclge_dev *hdev, int new_mps) hdev 8397 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 8409 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8418 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_lock(&hdev->vport_lock); hdev 8420 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (vport->vport_id && max_frm_size > hdev->mps) { hdev 8421 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_unlock(&hdev->vport_lock); hdev 8425 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_unlock(&hdev->vport_lock); hdev 8430 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 1; i < hdev->num_alloc_vport; i++) hdev 8431 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (max_frm_size < hdev->vport[i].mps) { hdev 8432 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_unlock(&hdev->vport_lock); hdev 8436 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_notify_client(hdev, HNAE3_DOWN_CLIENT); hdev 8438 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_mac_mtu(hdev, max_frm_size); hdev 8440 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 8445 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->mps = max_frm_size; hdev 8448 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_buffer_alloc(hdev); hdev 8450 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 8454 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_notify_client(hdev, HNAE3_UP_CLIENT); hdev 8455 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_unlock(&hdev->vport_lock); hdev 8459 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_send_reset_tqp_cmd(struct hclge_dev *hdev, u16 queue_id, hdev 8473 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 8475 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 8483 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_reset_status(struct hclge_dev *hdev, u16 queue_id) hdev 8494 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 8496 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 8518 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8526 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_tqp_enable(hdev, queue_id, 0, false); hdev 8528 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "Disable tqp fail, ret = %d\n", ret); hdev 8532 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_send_reset_tqp_cmd(hdev, queue_gid, true); hdev 8534 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 8540 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c reset_status = hclge_get_reset_status(hdev, queue_gid); hdev 8549 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "Reset TQP fail\n"); hdev 8553 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_send_reset_tqp_cmd(hdev, queue_gid, false); hdev 8555 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 8563 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8571 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_send_reset_tqp_cmd(hdev, queue_gid, true); hdev 8573 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 8579 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c reset_status = hclge_get_reset_status(hdev, queue_gid); hdev 8588 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, "Reset TQP fail\n"); hdev 8592 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_send_reset_tqp_cmd(hdev, queue_gid, false); hdev 8594 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 8601 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8603 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hdev->fw_version; hdev 8606 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_set_flowctrl_adv(struct hclge_dev *hdev, u32 rx_en, u32 tx_en) hdev 8608 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct phy_device *phydev = hdev->hw.mac.phydev; hdev 8616 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_cfg_pauseparam(struct hclge_dev *hdev, u32 rx_en, u32 tx_en) hdev 8620 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->tm_info.fc_mode == HCLGE_FC_PFC) hdev 8623 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_mac_pause_en_cfg(hdev, tx_en, rx_en); hdev 8625 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 8631 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c int hclge_cfg_flowctrl(struct hclge_dev *hdev) hdev 8633 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct phy_device *phydev = hdev->hw.mac.phydev; hdev 8660 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_cfg_pauseparam(hdev, rx_pause, tx_pause); hdev 8667 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8668 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct phy_device *phydev = hdev->hw.mac.phydev; hdev 8672 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->tm_info.fc_mode == HCLGE_FC_PFC) { hdev 8678 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->tm_info.fc_mode == HCLGE_FC_RX_PAUSE) { hdev 8681 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c } else if (hdev->tm_info.fc_mode == HCLGE_FC_TX_PAUSE) { hdev 8684 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c } else if (hdev->tm_info.fc_mode == HCLGE_FC_FULL) { hdev 8693 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_record_user_pauseparam(struct hclge_dev *hdev, hdev 8697 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fc_mode_last_time = HCLGE_FC_FULL; hdev 8699 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fc_mode_last_time = HCLGE_FC_RX_PAUSE; hdev 8701 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fc_mode_last_time = HCLGE_FC_TX_PAUSE; hdev 8703 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->fc_mode_last_time = HCLGE_FC_NONE; hdev 8705 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->tm_info.fc_mode = hdev->fc_mode_last_time; hdev 8712 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8713 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct phy_device *phydev = hdev->hw.mac.phydev; hdev 8719 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, hdev 8725 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->tm_info.fc_mode == HCLGE_FC_PFC) { hdev 8726 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, hdev 8731 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_set_flowctrl_adv(hdev, rx_en, tx_en); hdev 8733 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_record_user_pauseparam(hdev, rx_en, tx_en); hdev 8736 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_cfg_pauseparam(hdev, rx_en, tx_en); hdev 8748 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8751 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c *speed = hdev->hw.mac.speed; hdev 8753 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c *duplex = hdev->hw.mac.duplex; hdev 8755 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c *auto_neg = hdev->hw.mac.autoneg; hdev 8762 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8765 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c *media_type = hdev->hw.mac.media_type; hdev 8768 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c *module_type = hdev->hw.mac.module_type; hdev 8775 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 8776 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct phy_device *phydev = hdev->hw.mac.phydev; hdev 8821 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_info_show(struct hclge_dev *hdev) hdev 8823 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct device *dev = &hdev->pdev->dev; hdev 8827 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(dev, "Task queue pairs numbers: %d\n", hdev->num_tqps); hdev 8828 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(dev, "Desc num per TX queue: %d\n", hdev->num_tx_desc); hdev 8829 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(dev, "Desc num per RX queue: %d\n", hdev->num_rx_desc); hdev 8830 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(dev, "Numbers of vports: %d\n", hdev->num_alloc_vport); hdev 8831 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(dev, "Numbers of vmdp vports: %d\n", hdev->num_vmdq_vport); hdev 8832 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(dev, "Numbers of VF for this PF: %d\n", hdev->num_req_vfs); hdev 8833 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(dev, "HW tc map: %d\n", hdev->hw_tc_map); hdev 8834 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(dev, "Total buffer size for TX/RX: %d\n", hdev->pkt_buf_size); hdev 8835 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(dev, "TX buffer size for each TC: %d\n", hdev->tx_buf_size); hdev 8836 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(dev, "DV buffer size for each TC: %d\n", hdev->dv_buf_size); hdev 8838 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->flag & HCLGE_FLAG_MAIN ? "main" : "not main"); hdev 8840 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->flag & HCLGE_FLAG_DCB_ENABLE ? "enable" : "disable"); hdev 8842 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE ? "enable" : "disable"); hdev 8851 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = ae_dev->priv; hdev 8855 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c rst_cnt = hdev->rst_stats.reset_cnt; hdev 8860 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HCLGE_STATE_NIC_REGISTERED, &hdev->state); hdev 8861 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) || hdev 8862 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c rst_cnt != hdev->rst_stats.reset_cnt) { hdev 8868 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_config_nic_hw_error(hdev, true); hdev 8877 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (netif_msg_drv(&hdev->vport->nic)) hdev 8878 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_info_show(hdev); hdev 8883 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_NIC_REGISTERED, &hdev->state); hdev 8884 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c while (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) hdev 8896 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = ae_dev->priv; hdev 8900 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hnae3_dev_roce_supported(hdev) || !hdev->roce_client || hdev 8901 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c !hdev->nic_client) hdev 8904 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c client = hdev->roce_client; hdev 8909 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c rst_cnt = hdev->rst_stats.reset_cnt; hdev 8914 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HCLGE_STATE_ROCE_REGISTERED, &hdev->state); hdev 8915 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) || hdev 8916 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c rst_cnt != hdev->rst_stats.reset_cnt) { hdev 8922 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_config_rocee_ras_interrupt(hdev, true); hdev 8934 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_ROCE_REGISTERED, &hdev->state); hdev 8935 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c while (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) hdev 8938 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->roce_client->ops->uninit_instance(&vport->roce, 0); hdev 8946 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = ae_dev->priv; hdev 8950 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_vmdq_vport + 1; i++) { hdev 8951 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vport = &hdev->vport[i]; hdev 8956 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->nic_client = client; hdev 8968 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hnae3_dev_roce_supported(hdev)) { hdev 8969 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->roce_client = client; hdev 8986 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->nic_client = NULL; hdev 8990 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->roce_client = NULL; hdev 8998 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = ae_dev->priv; hdev 9002 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_vmdq_vport + 1; i++) { hdev 9003 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c vport = &hdev->vport[i]; hdev 9004 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->roce_client) { hdev 9005 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_ROCE_REGISTERED, &hdev->state); hdev 9006 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c while (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) hdev 9009 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->roce_client->ops->uninit_instance(&vport->roce, hdev 9011 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->roce_client = NULL; hdev 9016 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->nic_client && client->ops->uninit_instance) { hdev 9017 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_NIC_REGISTERED, &hdev->state); hdev 9018 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c while (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) hdev 9022 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->nic_client = NULL; hdev 9028 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_pci_init(struct hclge_dev *hdev) hdev 9030 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct pci_dev *pdev = hdev->pdev; hdev 9058 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hw = &hdev->hw; hdev 9066 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->num_req_vfs = pci_sriov_get_totalvfs(pdev); hdev 9078 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_pci_uninit(struct hclge_dev *hdev) hdev 9080 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct pci_dev *pdev = hdev->pdev; hdev 9082 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c pcim_iounmap(pdev, hdev->hw.io_base); hdev 9089 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_state_init(struct hclge_dev *hdev) hdev 9091 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HCLGE_STATE_SERVICE_INITED, &hdev->state); hdev 9092 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HCLGE_STATE_DOWN, &hdev->state); hdev 9093 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_RST_SERVICE_SCHED, &hdev->state); hdev 9094 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_RST_HANDLING, &hdev->state); hdev 9095 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_MBX_SERVICE_SCHED, &hdev->state); hdev 9096 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HCLGE_STATE_MBX_HANDLING, &hdev->state); hdev 9099 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_state_uninit(struct hclge_dev *hdev) hdev 9101 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HCLGE_STATE_DOWN, &hdev->state); hdev 9102 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HCLGE_STATE_REMOVING, &hdev->state); hdev 9104 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->reset_timer.function) hdev 9105 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c del_timer_sync(&hdev->reset_timer); hdev 9106 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->service_task.work.func) hdev 9107 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c cancel_delayed_work_sync(&hdev->service_task); hdev 9108 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->rst_service_task.func) hdev 9109 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c cancel_work_sync(&hdev->rst_service_task); hdev 9110 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->mbx_service_task.func) hdev 9111 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c cancel_work_sync(&hdev->mbx_service_task); hdev 9118 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = ae_dev->priv; hdev 9121 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HNAE3_FLR_DOWN, &hdev->flr_state); hdev 9122 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c clear_bit(HNAE3_FLR_DONE, &hdev->flr_state); hdev 9123 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HNAE3_FLR_RESET, &hdev->default_reset_request); hdev 9124 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_reset_event(hdev->pdev, NULL); hdev 9126 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c while (!test_bit(HNAE3_FLR_DOWN, &hdev->flr_state) && hdev 9130 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!test_bit(HNAE3_FLR_DOWN, &hdev->flr_state)) hdev 9131 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 9137 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = ae_dev->priv; hdev 9139 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HNAE3_FLR_DONE, &hdev->flr_state); hdev 9142 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_clear_resetting_state(struct hclge_dev *hdev) hdev 9146 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_alloc_vport; i++) { hdev 9147 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_vport *vport = &hdev->vport[i]; hdev 9151 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_vf_rst(hdev, vport->vport_id, false); hdev 9153 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_warn(&hdev->pdev->dev, hdev 9162 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev; hdev 9165 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev = devm_kzalloc(&pdev->dev, sizeof(*hdev), GFP_KERNEL); hdev 9166 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!hdev) { hdev 9171 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->pdev = pdev; hdev 9172 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->ae_dev = ae_dev; hdev 9173 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->reset_type = HNAE3_NONE_RESET; hdev 9174 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->reset_level = HNAE3_FUNC_RESET; hdev 9175 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ae_dev->priv = hdev; hdev 9176 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->mps = ETH_FRAME_LEN + ETH_FCS_LEN + 2 * VLAN_HLEN; hdev 9178 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_init(&hdev->vport_lock); hdev 9179 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_init(&hdev->vport_cfg_mutex); hdev 9180 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c spin_lock_init(&hdev->fd_rule_lock); hdev 9182 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_pci_init(hdev); hdev 9189 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_queue_init(hdev); hdev 9196 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_init(hdev); hdev 9200 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_cap(hdev); hdev 9207 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_configure(hdev); hdev 9213 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_init_msi(hdev); hdev 9219 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_misc_irq_init(hdev); hdev 9227 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_alloc_tqps(hdev); hdev 9233 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_alloc_vport(hdev); hdev 9239 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_map_tqp(hdev); hdev 9245 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->hw.mac.media_type == HNAE3_MEDIA_TYPE_COPPER) { hdev 9246 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_mac_mdio_config(hdev); hdev 9248 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 9254 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_init_umv_space(hdev); hdev 9260 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_mac_init(hdev); hdev 9266 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_config_tso(hdev, HCLGE_TSO_MSS_MIN, HCLGE_TSO_MSS_MAX); hdev 9272 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_config_gro(hdev, true); hdev 9276 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_init_vlan_config(hdev); hdev 9282 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_tm_schd_init(hdev); hdev 9288 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_rss_init_cfg(hdev); hdev 9289 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_rss_init_hw(hdev); hdev 9295 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = init_mgr_tbl(hdev); hdev 9301 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_init_fd_config(hdev); hdev 9308 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c INIT_KFIFO(hdev->mac_tnl_log); hdev 9310 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_dcb_ops_set(hdev); hdev 9312 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c timer_setup(&hdev->reset_timer, hclge_reset_timer, 0); hdev 9313 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c INIT_DELAYED_WORK(&hdev->service_task, hclge_service_task); hdev 9314 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c INIT_WORK(&hdev->rst_service_task, hclge_reset_service_task); hdev 9315 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c INIT_WORK(&hdev->mbx_service_task, hclge_mailbox_service_task); hdev 9320 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_misc_affinity_setup(hdev); hdev 9322 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_clear_all_event_cause(hdev); hdev 9323 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_clear_resetting_state(hdev); hdev 9337 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mod_timer(&hdev->reset_timer, jiffies + HCLGE_RESET_INTERVAL); hdev 9341 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_enable_vector(&hdev->misc_vector, true); hdev 9343 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_state_init(hdev); hdev 9344 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hdev->last_reset_time = jiffies; hdev 9346 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, "%s driver initialization finished.\n", hdev 9352 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->hw.mac.phydev) hdev 9353 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mdiobus_unregister(hdev->hw.mac.mdio_bus); hdev 9355 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_misc_irq_uninit(hdev); hdev 9359 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_cmd_uninit(hdev); hdev 9361 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c pcim_iounmap(pdev, hdev->hw.io_base); hdev 9369 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_stats_clear(struct hclge_dev *hdev) hdev 9371 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c memset(&hdev->hw_stats, 0, sizeof(hdev->hw_stats)); hdev 9374 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static void hclge_reset_vport_state(struct hclge_dev *hdev) hdev 9376 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_vport *vport = hdev->vport; hdev 9379 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (i = 0; i < hdev->num_alloc_vport; i++) { hdev 9387 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = ae_dev->priv; hdev 9391 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c set_bit(HCLGE_STATE_DOWN, &hdev->state); hdev 9393 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_stats_clear(hdev); hdev 9394 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c memset(hdev->vlan_table, 0, sizeof(hdev->vlan_table)); hdev 9395 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c memset(hdev->vf_vlan_full, 0, sizeof(hdev->vf_vlan_full)); hdev 9397 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_init(hdev); hdev 9403 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_map_tqp(hdev); hdev 9409 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_reset_umv_space(hdev); hdev 9411 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_mac_init(hdev); hdev 9417 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_config_tso(hdev, HCLGE_TSO_MSS_MIN, HCLGE_TSO_MSS_MAX); hdev 9423 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_config_gro(hdev, true); hdev 9427 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_init_vlan_config(hdev); hdev 9433 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_tm_init_hw(hdev, true); hdev 9439 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_rss_init_hw(hdev); hdev 9445 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = init_mgr_tbl(hdev); hdev 9452 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_init_fd_config(hdev); hdev 9464 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_config_nic_hw_error(hdev, true); hdev 9472 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (hdev->roce_client) { hdev 9473 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_config_rocee_ras_interrupt(hdev, true); hdev 9482 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_reset_vport_state(hdev); hdev 9492 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = ae_dev->priv; hdev 9493 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_mac *mac = &hdev->hw.mac; hdev 9495 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_misc_affinity_teardown(hdev); hdev 9496 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_state_uninit(hdev); hdev 9501 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_uninit_umv_space(hdev); hdev 9504 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_enable_vector(&hdev->misc_vector, false); hdev 9505 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c synchronize_irq(hdev->misc_vector.vector_irq); hdev 9508 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_config_mac_tnl_int(hdev, false); hdev 9509 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_config_nic_hw_error(hdev, false); hdev 9510 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_config_rocee_ras_interrupt(hdev, false); hdev 9512 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_cmd_uninit(hdev); hdev 9513 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_misc_irq_uninit(hdev); hdev 9514 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_pci_uninit(hdev); hdev 9515 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_destroy(&hdev->vport_lock); hdev 9516 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_uninit_vport_mac_table(hdev); hdev 9517 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c hclge_uninit_vport_vlan_table(hdev); hdev 9518 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c mutex_destroy(&hdev->vport_cfg_mutex); hdev 9526 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 9528 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return min_t(u32, hdev->rss_size_max, hdev 9545 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 9548 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c *max_rss_size = hdev->rss_size_max; hdev 9557 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 9569 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_tm_vport_map_update(hdev); hdev 9571 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "tm vport map fail, ret =%d\n", ret); hdev 9581 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c if (!(hdev->hw_tc_map & BIT(i))) hdev 9588 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_set_rss_tc_mode(hdev, tc_valid, tc_size, tc_offset); hdev 9606 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "set rss indir table fail, ret=%d\n", hdev 9613 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_info(&hdev->pdev->dev, hdev 9621 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_regs_num(struct hclge_dev *hdev, u32 *regs_num_32_bit, hdev 9629 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 9631 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 9646 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_32_bit_regs(struct hclge_dev *hdev, u32 regs_num, hdev 9671 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, desc, cmd_num); hdev 9673 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 9700 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_64_bit_regs(struct hclge_dev *hdev, u32 regs_num, hdev 9725 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, desc, cmd_num); hdev 9727 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 9762 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c int hclge_query_bd_num_cmd_send(struct hclge_dev *hdev, struct hclge_desc *desc) hdev 9773 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_cmd_send(&hdev->hw, desc, 4); hdev 9776 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_dfx_reg_bd_num(struct hclge_dev *hdev, hdev 9786 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_query_bd_num_cmd_send(hdev, desc); hdev 9788 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 9804 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_dfx_reg_cmd_send(struct hclge_dev *hdev, hdev 9819 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, desc, bd_num); hdev 9821 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 9849 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_dfx_reg_len(struct hclge_dev *hdev, int *len) hdev 9856 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_dfx_reg_bd_num(hdev, bd_num_list, dfx_reg_type_num); hdev 9858 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 9874 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_get_dfx_reg(struct hclge_dev *hdev, void *data) hdev 9883 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_dfx_reg_bd_num(hdev, bd_num_list, dfx_reg_type_num); hdev 9885 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 9897 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, "%s kzalloc failed\n", __func__); hdev 9903 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_dfx_reg_cmd_send(hdev, desc_src, bd_num, hdev 9906 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 9918 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_fetch_pf_reg(struct hclge_dev *hdev, void *data, hdev 9932 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c *reg++ = hclge_read_dev(&hdev->hw, cmdq_reg_addr_list[i]); hdev 9940 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c *reg++ = hclge_read_dev(&hdev->hw, common_reg_addr_list[i]); hdev 9949 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c *reg++ = hclge_read_dev(&hdev->hw, hdev 9959 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c for (j = 0; j < hdev->num_msi_used - 1; j++) { hdev 9961 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c *reg++ = hclge_read_dev(&hdev->hw, hdev 9967 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c data_num_sum += (reg_num + separator_num) * (hdev->num_msi_used - 1); hdev 9977 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 9982 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_regs_num(hdev, ®s_num_32_bit, ®s_num_64_bit); hdev 9984 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 9989 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_dfx_reg_len(hdev, &dfx_regs_len); hdev 9991 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 10010 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c tqp_intr_lines * (hdev->num_msi_used - 1) + regs_lines_32_bit + hdev 10019 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 10024 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c *version = hdev->fw_version; hdev 10026 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_regs_num(hdev, ®s_num_32_bit, ®s_num_64_bit); hdev 10028 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 10033 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c reg += hclge_fetch_pf_reg(hdev, reg, kinfo); hdev 10035 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_32_bit_regs(hdev, regs_num_32_bit, reg); hdev 10037 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 10047 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_64_bit_regs(hdev, regs_num_64_bit, reg); hdev 10049 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 10059 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_get_dfx_reg(hdev, reg); hdev 10061 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 10065 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c static int hclge_set_led_status(struct hclge_dev *hdev, u8 locate_led_status) hdev 10077 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 10079 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c dev_err(&hdev->pdev->dev, hdev 10095 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 10099 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_set_led_status(hdev, HCLGE_LED_ON); hdev 10101 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_set_led_status(hdev, HCLGE_LED_OFF); hdev 10113 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 10117 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c supported[idx] = hdev->hw.mac.supported[idx]; hdev 10118 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c advertising[idx] = hdev->hw.mac.advertising[idx]; hdev 10125 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c struct hclge_dev *hdev = vport->back; hdev 10127 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c return hclge_config_gro(hdev, enable); hdev 950 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h static inline bool hclge_is_reset_pending(struct hclge_dev *hdev) hdev 952 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h return !!hdev->reset_pending; hdev 956 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h int hclge_cfg_mac_speed_dup(struct hclge_dev *hdev, int speed, u8 duplex); hdev 961 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h int hclge_buffer_alloc(struct hclge_dev *hdev); hdev 962 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h int hclge_rss_init_hw(struct hclge_dev *hdev); hdev 963 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h void hclge_rss_indir_init_cfg(struct hclge_dev *hdev); hdev 965 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h void hclge_mbx_handler(struct hclge_dev *hdev); hdev 968 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h int hclge_cfg_flowctrl(struct hclge_dev *hdev); hdev 969 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h int hclge_func_reset_cmd(struct hclge_dev *hdev, int func_id); hdev 975 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h int hclge_notify_client(struct hclge_dev *hdev, hdev 984 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h void hclge_uninit_vport_mac_table(struct hclge_dev *hdev); hdev 986 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h void hclge_uninit_vport_vlan_table(struct hclge_dev *hdev); hdev 992 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h void hclge_task_schedule(struct hclge_dev *hdev, unsigned long delay_time); hdev 993 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h int hclge_query_bd_num_cmd_send(struct hclge_dev *hdev, hdev 995 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h void hclge_report_hw_error(struct hclge_dev *hdev, hdev 21 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c struct hclge_dev *hdev = vport->back; hdev 28 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 51 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c status = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 53 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 63 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c struct hclge_dev *hdev = vport->back; hdev 77 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c status = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 79 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 88 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c struct hclge_dev *hdev = vport->back; hdev 95 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c if (hdev->reset_type == HNAE3_FUNC_RESET) hdev 97 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c else if (hdev->reset_type == HNAE3_FLR_RESET) hdev 220 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c struct hclge_dev *hdev = vport->back; hdev 247 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 264 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c struct hclge_dev *hdev = vport->back; hdev 280 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 390 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c struct hclge_dev *hdev = vport->back; hdev 395 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c memcpy(&resp_data[4], &hdev->rx_buf_len, sizeof(u16)); hdev 407 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c struct hclge_dev *hdev = vport->back; hdev 410 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c memcpy(&resp_data[0], &hdev->num_tx_desc, sizeof(u16)); hdev 411 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c memcpy(&resp_data[2], &hdev->num_rx_desc, sizeof(u16)); hdev 419 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c struct hclge_dev *hdev = vport->back; hdev 422 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c resp_data[0] = hdev->hw.mac.media_type; hdev 423 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c resp_data[1] = hdev->hw.mac.module_type; hdev 431 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c struct hclge_dev *hdev = vport->back; hdev 438 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c link_status = (u16)hdev->hw.mac.link; hdev 439 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c duplex = hdev->hw.mac.duplex; hdev 441 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c memcpy(&msg_data[2], &hdev->hw.mac.speed, sizeof(u32)); hdev 454 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c struct hclge_dev *hdev = vport->back; hdev 461 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c advertising = hdev->hw.mac.advertising[0]; hdev 462 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c supported = hdev->hw.mac.supported[0]; hdev 489 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c struct hclge_dev *hdev = vport->back; hdev 492 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_warn(&hdev->pdev->dev, "PF received VF reset request from VF %d!", hdev 495 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c ret = hclge_func_reset_cmd(hdev, vport->vport_id); hdev 535 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c struct hclge_dev *hdev = vport->back; hdev 541 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c &hdev->vport[0].rss_hash_key[index * HCLGE_RSS_MBX_RESP_LEN], hdev 548 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c static void hclge_link_fail_parse(struct hclge_dev *hdev, u8 link_fail_code) hdev 552 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_warn(&hdev->pdev->dev, "Reference clock lost!\n"); hdev 555 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_warn(&hdev->pdev->dev, "SFP tx is disabled!\n"); hdev 558 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_warn(&hdev->pdev->dev, "SFP is absent!\n"); hdev 565 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c static void hclge_handle_link_change_event(struct hclge_dev *hdev, hdev 571 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c clear_bit(HCLGE_STATE_SERVICE_SCHED, &hdev->state); hdev 572 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c hclge_task_schedule(hdev, 0); hdev 575 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c hclge_link_fail_parse(hdev, req->msg[LINK_FAIL_CODE_OFFSET]); hdev 585 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c static void hclge_handle_ncsi_error(struct hclge_dev *hdev) hdev 587 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c struct hnae3_ae_dev *ae_dev = hdev->ae_dev; hdev 590 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_warn(&hdev->pdev->dev, "requesting reset due to NCSI error\n"); hdev 591 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c ae_dev->ops->reset_event(hdev->pdev, NULL); hdev 594 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c void hclge_mbx_handler(struct hclge_dev *hdev) hdev 596 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c struct hclge_cmq_ring *crq = &hdev->hw.cmq.crq; hdev 604 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c while (!hclge_cmd_crq_empty(&hdev->hw)) { hdev 605 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c if (test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state)) { hdev 606 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_warn(&hdev->pdev->dev, hdev 616 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_warn(&hdev->pdev->dev, hdev 626 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c vport = &hdev->vport[req->mbx_src_vfid]; hdev 640 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 647 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 654 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 661 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 668 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 675 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 682 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 690 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 697 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 713 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 719 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 726 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 734 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c mutex_lock(&hdev->vport_cfg_mutex); hdev 740 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c mutex_unlock(&hdev->vport_cfg_mutex); hdev 745 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 750 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c hclge_handle_link_change_event(hdev, req); hdev 753 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c hclge_handle_ncsi_error(hdev); hdev 756 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c dev_err(&hdev->pdev->dev, hdev 766 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c hclge_write_dev(&hdev->hw, HCLGE_NIC_CRQ_HEAD_REG, crq->next_to_use); hdev 46 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c struct hclge_dev *hdev = bus->priv; hdev 50 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c if (test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state)) hdev 70 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 72 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c dev_err(&hdev->pdev->dev, hdev 84 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c struct hclge_dev *hdev = bus->priv; hdev 88 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c if (test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state)) hdev 107 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 109 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c dev_err(&hdev->pdev->dev, hdev 116 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c dev_err(&hdev->pdev->dev, "mdio read data error\n"); hdev 123 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c int hclge_mac_mdio_config(struct hclge_dev *hdev) hdev 127 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c struct hclge_mac *mac = &hdev->hw.mac; hdev 132 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c if (hdev->hw.mac.phy_addr == PHY_INEXISTENT) { hdev 133 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c dev_info(&hdev->pdev->dev, hdev 136 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c } else if (hdev->hw.mac.phy_addr >= PHY_MAX_ADDR) { hdev 137 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c dev_err(&hdev->pdev->dev, "phy_addr(%d) is too large.\n", hdev 138 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c hdev->hw.mac.phy_addr); hdev 142 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c mdio_bus = devm_mdiobus_alloc(&hdev->pdev->dev); hdev 150 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c dev_name(&hdev->pdev->dev)); hdev 152 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c mdio_bus->parent = &hdev->pdev->dev; hdev 153 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c mdio_bus->priv = hdev; hdev 179 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c struct hclge_dev *hdev = vport->back; hdev 190 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c ret = hclge_cfg_mac_speed_dup(hdev, speed, duplex); hdev 194 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c ret = hclge_cfg_flowctrl(hdev); hdev 202 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c struct hclge_dev *hdev = vport->back; hdev 203 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c struct net_device *netdev = hdev->vport[0].nic.netdev; hdev 204 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c struct phy_device *phydev = hdev->hw.mac.phydev; hdev 223 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c linkmode_copy(mask, hdev->hw.mac.supported); hdev 242 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c struct hclge_dev *hdev = vport->back; hdev 243 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c struct phy_device *phydev = hdev->hw.mac.phydev; hdev 251 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c void hclge_mac_start_phy(struct hclge_dev *hdev) hdev 253 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c struct phy_device *phydev = hdev->hw.mac.phydev; hdev 261 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c void hclge_mac_stop_phy(struct hclge_dev *hdev) hdev 263 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c struct net_device *netdev = hdev->vport[0].nic.netdev; hdev 7 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.h int hclge_mac_mdio_config(struct hclge_dev *hdev); hdev 10 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.h void hclge_mac_start_phy(struct hclge_dev *hdev); hdev 11 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.h void hclge_mac_stop_phy(struct hclge_dev *hdev); hdev 115 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_pfc_stats_get(struct hclge_dev *hdev, hdev 132 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_cmd_send(&hdev->hw, desc, HCLGE_TM_PFC_PKT_GET_CMD_NUM); hdev 151 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c int hclge_pfc_rx_stats_get(struct hclge_dev *hdev, u64 *stats) hdev 153 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_pfc_stats_get(hdev, HCLGE_OPC_QUERY_PFC_RX_PKT_CNT, stats); hdev 156 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c int hclge_pfc_tx_stats_get(struct hclge_dev *hdev, u64 *stats) hdev 158 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_pfc_stats_get(hdev, HCLGE_OPC_QUERY_PFC_TX_PKT_CNT, stats); hdev 161 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c int hclge_mac_pause_en_cfg(struct hclge_dev *hdev, bool tx, bool rx) hdev 170 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 173 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_pfc_pause_en_cfg(struct hclge_dev *hdev, u8 tx_rx_bitmap, hdev 184 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 187 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_pause_param_cfg(struct hclge_dev *hdev, const u8 *addr, hdev 202 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 205 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c int hclge_pause_addr_cfg(struct hclge_dev *hdev, const u8 *mac_addr) hdev 217 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_cmd_send(&hdev->hw, &desc, 1); hdev 224 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_pause_param_cfg(hdev, mac_addr, trans_gap, trans_time); hdev 227 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_fill_pri_array(struct hclge_dev *hdev, u8 *pri, u8 pri_id) hdev 231 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c tc = hdev->tm_info.prio_tc[pri_id]; hdev 233 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (tc >= hdev->tm_info.num_tc) hdev 250 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_up_to_tc_map(struct hclge_dev *hdev) hdev 260 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_fill_pri_array(hdev, pri, pri_id); hdev 265 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 268 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pg_to_pri_map_cfg(struct hclge_dev *hdev, hdev 281 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 284 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_qs_to_pri_map_cfg(struct hclge_dev *hdev, hdev 298 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 301 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_q_to_qs_map_cfg(struct hclge_dev *hdev, hdev 314 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 317 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pg_weight_cfg(struct hclge_dev *hdev, u8 pg_id, hdev 330 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 333 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pri_weight_cfg(struct hclge_dev *hdev, u8 pri_id, hdev 346 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 349 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_qs_weight_cfg(struct hclge_dev *hdev, u16 qs_id, hdev 362 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 379 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pg_shapping_cfg(struct hclge_dev *hdev, hdev 397 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 400 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_port_shaper_cfg(struct hclge_dev *hdev) hdev 408 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_shaper_para_calc(hdev->hw.mac.speed, hdev 423 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 426 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pri_shapping_cfg(struct hclge_dev *hdev, hdev 445 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 448 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pg_schd_mode_cfg(struct hclge_dev *hdev, u8 pg_id) hdev 454 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->tm_info.pg_info[pg_id].pg_sch_mode == HCLGE_SCH_MODE_DWRR) hdev 461 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 464 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pri_schd_mode_cfg(struct hclge_dev *hdev, u8 pri_id) hdev 470 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->tm_info.tc_info[pri_id].tc_sch_mode == HCLGE_SCH_MODE_DWRR) hdev 477 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 480 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_qs_schd_mode_cfg(struct hclge_dev *hdev, u16 qs_id, u8 mode) hdev 493 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 496 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_qs_bp_cfg(struct hclge_dev *hdev, u8 tc, u8 grp_id, hdev 511 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 517 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_dev *hdev = vport->back; hdev 525 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c min_t(u16, vport->alloc_tqps, hdev->tm_info.num_tc); hdev 526 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c vport->qs_offset = (vport->vport_id ? hdev->tm_info.num_tc : 0) + hdev 529 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c max_rss_size = min_t(u16, hdev->rss_size_max, hdev 535 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c dev_info(&hdev->pdev->dev, "rss changes from %d to %d\n", hdev 546 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c (hdev->num_nic_msi - 1) / hdev 556 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c vport->bw_limit = hdev->tm_info.pg_info[0].bw_limit; hdev 559 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->hw_tc_map & BIT(i) && i < kinfo->num_tc) { hdev 573 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c memcpy(kinfo->prio_tc, hdev->tm_info.prio_tc, hdev 577 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static void hclge_tm_vport_info_update(struct hclge_dev *hdev) hdev 579 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_vport *vport = hdev->vport; hdev 582 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->num_alloc_vport; i++) { hdev 589 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static void hclge_tm_tc_info_init(struct hclge_dev *hdev) hdev 593 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->tm_info.num_tc; i++) { hdev 594 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.tc_info[i].tc_id = i; hdev 595 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.tc_info[i].tc_sch_mode = HCLGE_SCH_MODE_DWRR; hdev 596 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.tc_info[i].pgid = 0; hdev 597 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.tc_info[i].bw_limit = hdev 598 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.pg_info[0].bw_limit; hdev 602 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.prio_tc[i] = hdev 603 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c (i >= hdev->tm_info.num_tc) ? 0 : i; hdev 608 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->tm_info.num_tc > 1 || hdev->tm_info.pfc_en) hdev 609 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->flag |= HCLGE_FLAG_DCB_ENABLE; hdev 611 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->flag &= ~HCLGE_FLAG_DCB_ENABLE; hdev 614 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static void hclge_tm_pg_info_init(struct hclge_dev *hdev) hdev 620 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->tm_info.num_pg; i++) { hdev 623 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.pg_dwrr[i] = i ? 0 : BW_PERCENT; hdev 625 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.pg_info[i].pg_id = i; hdev 626 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.pg_info[i].pg_sch_mode = HCLGE_SCH_MODE_DWRR; hdev 628 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.pg_info[i].bw_limit = HCLGE_ETHER_MAX_RATE; hdev 633 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.pg_info[i].tc_bit_map = hdev->hw_tc_map; hdev 634 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (k = 0; k < hdev->tm_info.num_tc; k++) hdev 635 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.pg_info[i].tc_dwrr[k] = BW_PERCENT; hdev 639 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static void hclge_pfc_info_init(struct hclge_dev *hdev) hdev 641 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (!(hdev->flag & HCLGE_FLAG_DCB_ENABLE)) { hdev 642 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->fc_mode_last_time == HCLGE_FC_PFC) hdev 643 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c dev_warn(&hdev->pdev->dev, hdev 646 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.fc_mode = hdev->fc_mode_last_time; hdev 647 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c } else if (hdev->tm_info.fc_mode != HCLGE_FC_PFC) { hdev 652 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->fc_mode_last_time = hdev->tm_info.fc_mode; hdev 653 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.fc_mode = HCLGE_FC_PFC; hdev 657 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static void hclge_tm_schd_info_init(struct hclge_dev *hdev) hdev 659 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hclge_tm_pg_info_init(hdev); hdev 661 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hclge_tm_tc_info_init(hdev); hdev 663 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hclge_tm_vport_info_update(hdev); hdev 665 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hclge_pfc_info_init(hdev); hdev 668 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pg_to_pri_map(struct hclge_dev *hdev) hdev 673 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->tx_sch_mode != HCLGE_FLAG_TC_BASE_SCH_MODE) hdev 676 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->tm_info.num_pg; i++) { hdev 679 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev, i, hdev->tm_info.pg_info[i].tc_bit_map); hdev 687 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pg_shaper_cfg(struct hclge_dev *hdev) hdev 695 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->tx_sch_mode != HCLGE_FLAG_TC_BASE_SCH_MODE) hdev 699 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->tm_info.num_pg; i++) { hdev 702 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.pg_info[i].bw_limit, hdev 711 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pg_shapping_cfg(hdev, hdev 720 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pg_shapping_cfg(hdev, hdev 730 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pg_dwrr_cfg(struct hclge_dev *hdev) hdev 736 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->tx_sch_mode != HCLGE_FLAG_TC_BASE_SCH_MODE) hdev 740 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->tm_info.num_pg; i++) { hdev 742 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pg_weight_cfg(hdev, i, hdev->tm_info.pg_dwrr[i]); hdev 750 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_vport_q_to_qs_map(struct hclge_dev *hdev, hdev 764 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_q_to_qs_map_cfg(hdev, hdev 775 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pri_q_qs_cfg(struct hclge_dev *hdev) hdev 777 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_vport *vport = hdev->vport; hdev 781 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->tx_sch_mode == HCLGE_FLAG_TC_BASE_SCH_MODE) { hdev 783 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (k = 0; k < hdev->num_alloc_vport; k++) { hdev 789 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev, vport[k].qs_offset + i, i); hdev 794 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c } else if (hdev->tx_sch_mode == HCLGE_FLAG_VNET_BASE_SCH_MODE) { hdev 796 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (k = 0; k < hdev->num_alloc_vport; k++) hdev 799 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev, vport[k].qs_offset + i, k); hdev 808 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->num_alloc_vport; i++) { hdev 809 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_vport_q_to_qs_map(hdev, vport); hdev 819 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pri_tc_base_shaper_cfg(struct hclge_dev *hdev) hdev 826 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->tm_info.num_tc; i++) { hdev 828 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.tc_info[i].bw_limit, hdev 837 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pri_shapping_cfg(hdev, HCLGE_TM_SHAP_C_BUCKET, i, hdev 845 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pri_shapping_cfg(hdev, HCLGE_TM_SHAP_P_BUCKET, i, hdev 856 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_dev *hdev = vport->back; hdev 869 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pri_shapping_cfg(hdev, HCLGE_TM_SHAP_C_BUCKET, hdev 877 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pri_shapping_cfg(hdev, HCLGE_TM_SHAP_P_BUCKET, hdev 888 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_dev *hdev = vport->back; hdev 895 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.tc_info[i].bw_limit, hdev 905 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pri_vnet_base_shaper_cfg(struct hclge_dev *hdev) hdev 907 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_vport *vport = hdev->vport; hdev 912 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->num_alloc_vport; i++) { hdev 927 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pri_shaper_cfg(struct hclge_dev *hdev) hdev 931 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->tx_sch_mode == HCLGE_FLAG_TC_BASE_SCH_MODE) { hdev 932 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pri_tc_base_shaper_cfg(hdev); hdev 936 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pri_vnet_base_shaper_cfg(hdev); hdev 944 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pri_tc_base_dwrr_cfg(struct hclge_dev *hdev) hdev 946 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_vport *vport = hdev->vport; hdev 952 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->tm_info.num_tc; i++) { hdev 954 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c &hdev->tm_info.pg_info[hdev->tm_info.tc_info[i].pgid]; hdev 957 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pri_weight_cfg(hdev, i, dwrr); hdev 961 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (k = 0; k < hdev->num_alloc_vport; k++) { hdev 963 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev, vport[k].qs_offset + i, hdev 973 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_ets_tc_dwrr_cfg(struct hclge_dev *hdev) hdev 990 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (!(hdev->hw_tc_map & BIT(i))) hdev 994 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c &hdev->tm_info.pg_info[hdev->tm_info.tc_info[i].pgid]; hdev 1000 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_cmd_send(&hdev->hw, &desc, 1); hdev 1006 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_dev *hdev = vport->back; hdev 1011 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pri_weight_cfg(hdev, vport->vport_id, vport->dwrr); hdev 1018 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev, vport->qs_offset + i, hdev 1019 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.pg_info[0].tc_dwrr[i]); hdev 1027 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pri_vnet_base_dwrr_cfg(struct hclge_dev *hdev) hdev 1029 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_vport *vport = hdev->vport; hdev 1033 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->num_alloc_vport; i++) { hdev 1044 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_pri_dwrr_cfg(struct hclge_dev *hdev) hdev 1048 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->tx_sch_mode == HCLGE_FLAG_TC_BASE_SCH_MODE) { hdev 1049 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pri_tc_base_dwrr_cfg(hdev); hdev 1053 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (!hnae3_dev_dcb_supported(hdev)) hdev 1056 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_ets_tc_dwrr_cfg(hdev); hdev 1058 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c dev_warn(&hdev->pdev->dev, hdev 1060 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->fw_version); hdev 1066 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pri_vnet_base_dwrr_cfg(hdev); hdev 1074 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_map_cfg(struct hclge_dev *hdev) hdev 1078 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_up_to_tc_map(hdev); hdev 1082 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pg_to_pri_map(hdev); hdev 1086 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_tm_pri_q_qs_cfg(hdev); hdev 1089 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_shaper_cfg(struct hclge_dev *hdev) hdev 1093 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_port_shaper_cfg(hdev); hdev 1097 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pg_shaper_cfg(hdev); hdev 1101 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_tm_pri_shaper_cfg(hdev); hdev 1104 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c int hclge_tm_dwrr_cfg(struct hclge_dev *hdev) hdev 1108 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pg_dwrr_cfg(hdev); hdev 1112 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_tm_pri_dwrr_cfg(hdev); hdev 1115 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_lvl2_schd_mode_cfg(struct hclge_dev *hdev) hdev 1121 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->tx_sch_mode == HCLGE_FLAG_VNET_BASE_SCH_MODE) hdev 1124 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->tm_info.num_pg; i++) { hdev 1125 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pg_schd_mode_cfg(hdev, i); hdev 1136 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_dev *hdev = vport->back; hdev 1143 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pri_schd_mode_cfg(hdev, vport->vport_id); hdev 1148 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c u8 sch_mode = hdev->tm_info.tc_info[i].tc_sch_mode; hdev 1150 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_qs_schd_mode_cfg(hdev, vport->qs_offset + i, hdev 1159 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_lvl34_schd_mode_cfg(struct hclge_dev *hdev) hdev 1161 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_vport *vport = hdev->vport; hdev 1165 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->tx_sch_mode == HCLGE_FLAG_TC_BASE_SCH_MODE) { hdev 1166 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->tm_info.num_tc; i++) { hdev 1167 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_pri_schd_mode_cfg(hdev, i); hdev 1171 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (k = 0; k < hdev->num_alloc_vport; k++) { hdev 1173 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev, vport[k].qs_offset + i, hdev 1180 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->num_alloc_vport; i++) { hdev 1192 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_schd_mode_hw(struct hclge_dev *hdev) hdev 1196 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_lvl2_schd_mode_cfg(hdev); hdev 1200 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_tm_lvl34_schd_mode_cfg(hdev); hdev 1203 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c int hclge_tm_schd_setup_hw(struct hclge_dev *hdev) hdev 1208 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_map_cfg(hdev); hdev 1213 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_shaper_cfg(hdev); hdev 1218 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_dwrr_cfg(hdev); hdev 1223 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_tm_schd_mode_hw(hdev); hdev 1226 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_pause_param_setup_hw(struct hclge_dev *hdev) hdev 1228 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_mac *mac = &hdev->hw.mac; hdev 1230 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_pause_param_cfg(hdev, mac->mac_addr, hdev 1235 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_pfc_setup_hw(struct hclge_dev *hdev) hdev 1239 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->tm_info.fc_mode == HCLGE_FC_PFC) hdev 1243 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_pfc_pause_en_cfg(hdev, enable_bitmap, hdev 1244 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.pfc_en); hdev 1251 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_bp_setup_hw(struct hclge_dev *hdev, u8 tc) hdev 1259 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (k = 0; k < hdev->num_alloc_vport; k++) { hdev 1260 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_vport *vport = &hdev->vport[k]; hdev 1272 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_qs_bp_cfg(hdev, tc, i, qs_bitmap); hdev 1280 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_mac_pause_setup_hw(struct hclge_dev *hdev) hdev 1284 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c switch (hdev->tm_info.fc_mode) { hdev 1310 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_mac_pause_en_cfg(hdev, tx_en, rx_en); hdev 1313 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c static int hclge_tm_bp_setup(struct hclge_dev *hdev) hdev 1318 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->tm_info.num_tc; i++) { hdev 1319 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_bp_setup_hw(hdev, i); hdev 1327 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c int hclge_pause_setup_hw(struct hclge_dev *hdev, bool init) hdev 1331 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_pause_param_setup_hw(hdev); hdev 1335 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_mac_pause_setup_hw(hdev); hdev 1340 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (!hnae3_dev_dcb_supported(hdev)) hdev 1347 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_pfc_setup_hw(hdev); hdev 1349 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c dev_warn(&hdev->pdev->dev, "GE MAC does not support pfc\n"); hdev 1351 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c dev_err(&hdev->pdev->dev, "config pfc failed! ret = %d\n", hdev 1356 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_tm_bp_setup(hdev); hdev 1359 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c void hclge_tm_prio_tc_info_update(struct hclge_dev *hdev, u8 *prio_tc) hdev 1361 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_vport *vport = hdev->vport; hdev 1366 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.prio_tc[i] = prio_tc[i]; hdev 1368 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (k = 0; k < hdev->num_alloc_vport; k++) { hdev 1375 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c void hclge_tm_schd_info_update(struct hclge_dev *hdev, u8 num_tc) hdev 1380 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.num_tc = num_tc; hdev 1382 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c for (i = 0; i < hdev->tm_info.num_tc; i++) hdev 1387 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.num_tc = 1; hdev 1390 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->hw_tc_map = bit_map; hdev 1392 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hclge_tm_schd_info_init(hdev); hdev 1395 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c void hclge_tm_pfc_info_update(struct hclge_dev *hdev) hdev 1400 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->tm_info.num_tc > 1 || hdev->tm_info.pfc_en) hdev 1401 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->flag |= HCLGE_FLAG_DCB_ENABLE; hdev 1403 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->flag &= ~HCLGE_FLAG_DCB_ENABLE; hdev 1405 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hclge_pfc_info_init(hdev); hdev 1408 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c int hclge_tm_init_hw(struct hclge_dev *hdev, bool init) hdev 1412 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if ((hdev->tx_sch_mode != HCLGE_FLAG_TC_BASE_SCH_MODE) && hdev 1413 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c (hdev->tx_sch_mode != HCLGE_FLAG_VNET_BASE_SCH_MODE)) hdev 1416 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_tm_schd_setup_hw(hdev); hdev 1420 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_pause_setup_hw(hdev, init); hdev 1427 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c int hclge_tm_schd_init(struct hclge_dev *hdev) hdev 1430 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.fc_mode = HCLGE_FC_FULL; hdev 1431 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->fc_mode_last_time = hdev->tm_info.fc_mode; hdev 1433 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (hdev->tx_sch_mode != HCLGE_FLAG_TC_BASE_SCH_MODE && hdev 1434 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hdev->tm_info.num_pg != 1) hdev 1437 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c hclge_tm_schd_info_init(hdev); hdev 1439 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_tm_init_hw(hdev, true); hdev 1442 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c int hclge_tm_vport_map_update(struct hclge_dev *hdev) hdev 1444 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c struct hclge_vport *vport = hdev->vport; hdev 1449 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ret = hclge_vport_q_to_qs_map(hdev, vport); hdev 1453 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c if (!(hdev->flag & HCLGE_FLAG_DCB_ENABLE)) hdev 1456 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c return hclge_tm_bp_setup(hdev); hdev 144 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h int hclge_tm_schd_init(struct hclge_dev *hdev); hdev 145 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h int hclge_tm_vport_map_update(struct hclge_dev *hdev); hdev 146 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h int hclge_pause_setup_hw(struct hclge_dev *hdev, bool init); hdev 147 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h int hclge_tm_schd_setup_hw(struct hclge_dev *hdev); hdev 148 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h void hclge_tm_prio_tc_info_update(struct hclge_dev *hdev, u8 *prio_tc); hdev 149 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h void hclge_tm_schd_info_update(struct hclge_dev *hdev, u8 num_tc); hdev 150 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h void hclge_tm_pfc_info_update(struct hclge_dev *hdev); hdev 151 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h int hclge_tm_dwrr_cfg(struct hclge_dev *hdev); hdev 152 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h int hclge_tm_init_hw(struct hclge_dev *hdev, bool init); hdev 153 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h int hclge_mac_pause_en_cfg(struct hclge_dev *hdev, bool tx, bool rx); hdev 154 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h int hclge_pause_addr_cfg(struct hclge_dev *hdev, const u8 *mac_addr); hdev 155 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h int hclge_pfc_rx_stats_get(struct hclge_dev *hdev, u64 *stats); hdev 156 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h int hclge_pfc_tx_stats_get(struct hclge_dev *hdev, u64 *stats); hdev 44 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c struct hclgevf_dev *hdev = container_of(hw, struct hclgevf_dev, hw); hdev 53 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c dev_warn(&hdev->pdev->dev, "wrong cmd head (%d, %d-%d)\n", head, hdev 55 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c dev_warn(&hdev->pdev->dev, hdev 57 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c set_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state); hdev 90 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c struct hclgevf_dev *hdev = ring->dev; hdev 91 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c struct hclgevf_hw *hw = &hdev->hw; hdev 150 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c static int hclgevf_alloc_cmd_queue(struct hclgevf_dev *hdev, int ring_type) hdev 152 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c struct hclgevf_hw *hw = &hdev->hw; hdev 157 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c ring->dev = hdev; hdev 163 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c dev_err(&hdev->pdev->dev, "failed(%d) to alloc %s desc\n", ret, hdev 224 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c struct hclgevf_dev *hdev = (struct hclgevf_dev *)hw->hdev; hdev 237 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c if (test_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state)) { hdev 311 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c dev_warn(&hdev->pdev->dev, hdev 336 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c int hclgevf_cmd_queue_init(struct hclgevf_dev *hdev) hdev 341 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c spin_lock_init(&hdev->hw.cmq.csq.lock); hdev 342 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c spin_lock_init(&hdev->hw.cmq.crq.lock); hdev 344 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hdev->hw.cmq.tx_timeout = HCLGEVF_CMDQ_TX_TIMEOUT; hdev 345 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hdev->hw.cmq.csq.desc_num = HCLGEVF_NIC_CMQ_DESC_NUM; hdev 346 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hdev->hw.cmq.crq.desc_num = HCLGEVF_NIC_CMQ_DESC_NUM; hdev 348 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c ret = hclgevf_alloc_cmd_queue(hdev, HCLGEVF_TYPE_CSQ); hdev 350 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c dev_err(&hdev->pdev->dev, hdev 355 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c ret = hclgevf_alloc_cmd_queue(hdev, HCLGEVF_TYPE_CRQ); hdev 357 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c dev_err(&hdev->pdev->dev, hdev 364 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hclgevf_free_cmd_desc(&hdev->hw.cmq.csq); hdev 368 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c int hclgevf_cmd_init(struct hclgevf_dev *hdev) hdev 373 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c spin_lock_bh(&hdev->hw.cmq.csq.lock); hdev 374 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c spin_lock(&hdev->hw.cmq.crq.lock); hdev 377 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hdev->arq.hdev = hdev; hdev 378 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hdev->arq.head = 0; hdev 379 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hdev->arq.tail = 0; hdev 380 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c atomic_set(&hdev->arq.count, 0); hdev 381 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hdev->hw.cmq.csq.next_to_clean = 0; hdev 382 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hdev->hw.cmq.csq.next_to_use = 0; hdev 383 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hdev->hw.cmq.crq.next_to_clean = 0; hdev 384 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hdev->hw.cmq.crq.next_to_use = 0; hdev 386 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hclgevf_cmd_init_regs(&hdev->hw); hdev 388 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c spin_unlock(&hdev->hw.cmq.crq.lock); hdev 389 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c spin_unlock_bh(&hdev->hw.cmq.csq.lock); hdev 391 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c clear_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state); hdev 396 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c if (hclgevf_is_reset_pending(hdev)) { hdev 402 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c ret = hclgevf_cmd_query_firmware_version(&hdev->hw, &version); hdev 404 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c dev_err(&hdev->pdev->dev, hdev 408 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hdev->fw_version = version; hdev 410 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c dev_info(&hdev->pdev->dev, "The firmware version is %lu.%lu.%lu.%lu\n", hdev 423 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c set_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state); hdev 442 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c void hclgevf_cmd_uninit(struct hclgevf_dev *hdev) hdev 444 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c spin_lock_bh(&hdev->hw.cmq.csq.lock); hdev 445 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c spin_lock(&hdev->hw.cmq.crq.lock); hdev 446 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c clear_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state); hdev 447 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hclgevf_cmd_uninit_regs(&hdev->hw); hdev 448 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c spin_unlock(&hdev->hw.cmq.crq.lock); hdev 449 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c spin_unlock_bh(&hdev->hw.cmq.csq.lock); hdev 450 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hclgevf_free_cmd_desc(&hdev->hw.cmq.csq); hdev 451 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c hclgevf_free_cmd_desc(&hdev->hw.cmq.crq); hdev 276 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h int hclgevf_cmd_init(struct hclgevf_dev *hdev); hdev 277 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h void hclgevf_cmd_uninit(struct hclgevf_dev *hdev); hdev 278 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.h int hclgevf_cmd_queue_init(struct hclgevf_dev *hdev); hdev 16 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_reset_hdev(struct hclgevf_dev *hdev); hdev 101 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 114 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c status = hclgevf_cmd_send(&hdev->hw, &desc, 1); hdev 116 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 128 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c status = hclgevf_cmd_send(&hdev->hw, &desc, 1); hdev 130 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 196 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 201 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 230 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_get_tc_info(struct hclgevf_dev *hdev) hdev 235 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c status = hclgevf_send_mbx_msg(hdev, HCLGE_MBX_GET_TCINFO, 0, NULL, 0, hdev 238 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 244 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->hw_tc_map = resp_msg; hdev 249 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_get_port_base_vlan_filter_state(struct hclgevf_dev *hdev) hdev 251 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hnae3_handle *nic = &hdev->nic; hdev 255 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_send_mbx_msg(hdev, HCLGE_MBX_SET_VLAN, hdev 259 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 270 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_get_queue_info(struct hclgevf_dev *hdev) hdev 276 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c status = hclgevf_send_mbx_msg(hdev, HCLGE_MBX_GET_QINFO, 0, NULL, 0, hdev 280 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 286 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c memcpy(&hdev->num_tqps, &resp_msg[0], sizeof(u16)); hdev 287 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c memcpy(&hdev->rss_size_max, &resp_msg[2], sizeof(u16)); hdev 288 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c memcpy(&hdev->rx_buf_len, &resp_msg[4], sizeof(u16)); hdev 293 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_get_queue_depth(struct hclgevf_dev *hdev) hdev 299 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_send_mbx_msg(hdev, HCLGE_MBX_GET_QDEPTH, 0, NULL, 0, hdev 303 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 309 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c memcpy(&hdev->num_tx_desc, &resp_msg[0], sizeof(u16)); hdev 310 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c memcpy(&hdev->num_rx_desc, &resp_msg[2], sizeof(u16)); hdev 317 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 324 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_send_mbx_msg(hdev, HCLGE_MBX_GET_QID_IN_PF, 0, msg_data, hdev 333 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_get_pf_media_type(struct hclgevf_dev *hdev) hdev 338 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_send_mbx_msg(hdev, HCLGE_MBX_GET_MEDIA_TYPE, 0, NULL, 0, hdev 341 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 347 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->hw.mac.media_type = resp_msg[0]; hdev 348 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->hw.mac.module_type = resp_msg[1]; hdev 353 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_alloc_tqps(struct hclgevf_dev *hdev) hdev 358 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->htqp = devm_kcalloc(&hdev->pdev->dev, hdev->num_tqps, hdev 360 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (!hdev->htqp) hdev 363 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c tqp = hdev->htqp; hdev 365 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c for (i = 0; i < hdev->num_tqps; i++) { hdev 366 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c tqp->dev = &hdev->pdev->dev; hdev 370 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c tqp->q.buf_size = hdev->rx_buf_len; hdev 371 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c tqp->q.tx_desc_num = hdev->num_tx_desc; hdev 372 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c tqp->q.rx_desc_num = hdev->num_rx_desc; hdev 373 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c tqp->q.io_base = hdev->hw.io_base + HCLGEVF_TQP_REG_OFFSET + hdev 382 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_knic_setup(struct hclgevf_dev *hdev) hdev 384 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hnae3_handle *nic = &hdev->nic; hdev 386 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c u16 new_tqps = hdev->num_tqps; hdev 391 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c kinfo->num_tx_desc = hdev->num_tx_desc; hdev 392 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c kinfo->num_rx_desc = hdev->num_rx_desc; hdev 393 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c kinfo->rx_buf_len = hdev->rx_buf_len; hdev 395 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->hw_tc_map & BIT(i)) hdev 399 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c = min_t(u16, hdev->rss_size_max, new_tqps / kinfo->num_tc); hdev 401 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c kinfo->num_tqps = min(new_tqps, hdev->num_tqps); hdev 403 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c kinfo->tqp = devm_kcalloc(&hdev->pdev->dev, kinfo->num_tqps, hdev 409 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->htqp[i].q.handle = &hdev->nic; hdev 410 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->htqp[i].q.tqp_index = i; hdev 411 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c kinfo->tqp[i] = &hdev->htqp[i].q; hdev 417 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c kinfo->num_tqps = min_t(u16, hdev->num_nic_msix - 1, kinfo->num_tqps); hdev 424 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_request_link_info(struct hclgevf_dev *hdev) hdev 429 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c status = hclgevf_send_mbx_msg(hdev, HCLGE_MBX_GET_LINK_STATUS, 0, NULL, hdev 432 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 436 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c void hclgevf_update_link_status(struct hclgevf_dev *hdev, int link_state) hdev 438 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hnae3_handle *rhandle = &hdev->roce; hdev 439 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hnae3_handle *handle = &hdev->nic; hdev 444 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c rclient = hdev->roce_client; hdev 447 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c test_bit(HCLGEVF_STATE_DOWN, &hdev->state) ? 0 : link_state; hdev 449 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (link_state != hdev->hw.mac.link) { hdev 453 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->hw.mac.link = link_state; hdev 457 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_update_link_mode(struct hclgevf_dev *hdev) hdev 465 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_send_mbx_msg(hdev, HCLGE_MBX_GET_LINK_MODE, 0, hdev 469 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_send_mbx_msg(hdev, HCLGE_MBX_GET_LINK_MODE, 0, hdev 474 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_set_handle_info(struct hclgevf_dev *hdev) hdev 476 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hnae3_handle *nic = &hdev->nic; hdev 480 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c nic->pdev = hdev->pdev; hdev 481 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c nic->numa_node_mask = hdev->numa_node_mask; hdev 484 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_knic_setup(hdev); hdev 486 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, "VF knic setup failed %d\n", hdev 491 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_free_vector(struct hclgevf_dev *hdev, int vector_id) hdev 493 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->vector_status[vector_id] == HCLGEVF_INVALID_VPORT) { hdev 494 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_warn(&hdev->pdev->dev, hdev 499 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->vector_status[vector_id] = HCLGEVF_INVALID_VPORT; hdev 500 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_msi_left += 1; hdev 501 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_msi_used -= 1; hdev 507 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 512 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c vector_num = min_t(u16, hdev->num_nic_msix - 1, vector_num); hdev 513 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c vector_num = min(hdev->num_msi_left, vector_num); hdev 516 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c for (i = HCLGEVF_MISC_VECTOR_NUM + 1; i < hdev->num_msi; i++) { hdev 517 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->vector_status[i] == HCLGEVF_INVALID_VPORT) { hdev 518 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c vector->vector = pci_irq_vector(hdev->pdev, i); hdev 519 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c vector->io_addr = hdev->hw.io_base + hdev 522 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->vector_status[i] = 0; hdev 523 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->vector_irq[i] = vector->vector; hdev 532 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_msi_left -= alloc; hdev 533 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_msi_used += alloc; hdev 538 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_get_vector_index(struct hclgevf_dev *hdev, int vector) hdev 542 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c for (i = 0; i < hdev->num_msi; i++) hdev 543 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (vector == hdev->vector_irq[i]) hdev 549 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_set_rss_algo_key(struct hclgevf_dev *hdev, hdev 577 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_cmd_send(&hdev->hw, &desc, 1); hdev 579 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 599 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_set_rss_indir_table(struct hclgevf_dev *hdev) hdev 601 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c const u8 *indir = hdev->rss_cfg.rss_indirection_tbl; hdev 618 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c status = hclgevf_cmd_send(&hdev->hw, &desc, 1); hdev 620 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 630 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_set_rss_tc_mode(struct hclgevf_dev *hdev, u16 rss_size) hdev 647 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c tc_valid[i] = !!(hdev->hw_tc_map & BIT(i)); hdev 661 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c status = hclgevf_cmd_send(&hdev->hw, &desc, 1); hdev 663 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 670 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_get_rss_hash_key(struct hclgevf_dev *hdev) hdev 674 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_rss_cfg *rss_cfg = &hdev->rss_cfg; hdev 683 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_send_mbx_msg(hdev, HCLGE_MBX_GET_RSS_KEY, 0, hdev 688 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 710 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 711 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_rss_cfg *rss_cfg = &hdev->rss_cfg; hdev 738 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_get_rss_hash_key(hdev); hdev 756 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 757 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_rss_cfg *rss_cfg = &hdev->rss_cfg; hdev 778 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_set_rss_algo_key(hdev, rss_cfg->hash_algo, hdev 794 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_set_rss_indir_table(hdev); hdev 825 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 826 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_rss_cfg *rss_cfg = &hdev->rss_cfg; hdev 885 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_cmd_send(&hdev->hw, &desc, 1); hdev 887 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 906 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 907 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_rss_cfg *rss_cfg = &hdev->rss_cfg; hdev 957 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_set_rss_input_tuple(struct hclgevf_dev *hdev, hdev 977 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_cmd_send(&hdev->hw, &desc, 1); hdev 979 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 986 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 987 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_rss_cfg *rss_cfg = &hdev->rss_cfg; hdev 996 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1034 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c status = hclgevf_cmd_send(&hdev->hw, &desc, 1); hdev 1036 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 1056 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1059 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c vector_id = hclgevf_get_vector_index(hdev, vector); hdev 1074 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1077 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state)) hdev 1080 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c vector_id = hclgevf_get_vector_index(hdev, vector); hdev 1099 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1102 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c vector_id = hclgevf_get_vector_index(hdev, vector); hdev 1110 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_free_vector(hdev, vector_id); hdev 1115 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_cmd_set_promisc_mode(struct hclgevf_dev *hdev, hdev 1128 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_cmd_send(&hdev->hw, &desc, 1); hdev 1130 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 1136 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_set_promisc_mode(struct hclgevf_dev *hdev, bool en_bc_pmc) hdev 1138 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_cmd_set_promisc_mode(hdev, en_bc_pmc); hdev 1141 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_tqp_enable(struct hclgevf_dev *hdev, unsigned int tqp_id, hdev 1157 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c status = hclgevf_cmd_send(&hdev->hw, &desc, 1); hdev 1159 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 1179 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1181 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ether_addr_copy(p, hdev->hw.mac.mac_addr); hdev 1187 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1188 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c u8 *old_mac_addr = (u8 *)hdev->hw.mac.mac_addr; hdev 1200 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c status = hclgevf_send_mbx_msg(hdev, HCLGE_MBX_SET_UNICAST, hdev 1204 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ether_addr_copy(hdev->hw.mac.mac_addr, new_mac_addr); hdev 1212 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1214 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_send_mbx_msg(hdev, HCLGE_MBX_SET_UNICAST, hdev 1222 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1224 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_send_mbx_msg(hdev, HCLGE_MBX_SET_UNICAST, hdev 1232 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1234 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_send_mbx_msg(hdev, HCLGE_MBX_SET_MULTICAST, hdev 1242 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1244 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_send_mbx_msg(hdev, HCLGE_MBX_SET_MULTICAST, hdev 1254 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1268 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state) && is_kill) { hdev 1269 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(vlan_id, hdev->vlan_del_fail_bmap); hdev 1276 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_send_mbx_msg(hdev, HCLGE_MBX_SET_VLAN, hdev 1285 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(vlan_id, hdev->vlan_del_fail_bmap); hdev 1290 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_sync_vlan_filter(struct hclgevf_dev *hdev) hdev 1293 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hnae3_handle *handle = &hdev->nic; hdev 1297 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c vlan_id = find_first_bit(hdev->vlan_del_fail_bmap, VLAN_N_VID); hdev 1304 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(vlan_id, hdev->vlan_del_fail_bmap); hdev 1309 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c vlan_id = find_first_bit(hdev->vlan_del_fail_bmap, VLAN_N_VID); hdev 1315 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1319 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_send_mbx_msg(hdev, HCLGE_MBX_SET_VLAN, hdev 1326 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1333 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_tqp_enable(hdev, queue_id, 0, false); hdev 1337 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_send_mbx_msg(hdev, HCLGE_MBX_QUEUE_RESET, 0, msg_data, hdev 1343 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1345 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_send_mbx_msg(hdev, HCLGE_MBX_SET_MTU, 0, (u8 *)&new_mtu, hdev 1349 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_notify_client(struct hclgevf_dev *hdev, hdev 1352 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hnae3_client *client = hdev->nic_client; hdev 1353 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hnae3_handle *handle = &hdev->nic; hdev 1356 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (!test_bit(HCLGEVF_STATE_NIC_REGISTERED, &hdev->state) || hdev 1365 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, "notify nic client failed %d(%d)\n", hdev 1373 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = ae_dev->priv; hdev 1375 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HNAE3_FLR_DONE, &hdev->flr_state); hdev 1378 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_flr_poll_timeout(struct hclgevf_dev *hdev, hdev 1384 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c while (!test_bit(HNAE3_FLR_DONE, &hdev->flr_state) && hdev 1388 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (!test_bit(HNAE3_FLR_DONE, &hdev->flr_state)) { hdev 1389 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 1397 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_reset_wait(struct hclgevf_dev *hdev) hdev 1407 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->reset_type == HNAE3_FLR_RESET) hdev 1408 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_flr_poll_timeout(hdev, hdev 1411 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c else if (hdev->reset_type == HNAE3_VF_RESET) hdev 1412 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = readl_poll_timeout(hdev->hw.io_base + hdev 1418 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = readl_poll_timeout(hdev->hw.io_base + hdev 1426 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 1440 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_reset_handshake(struct hclgevf_dev *hdev, bool enable) hdev 1444 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c reg_val = hclgevf_read_dev(&hdev->hw, HCLGEVF_NIC_CSQ_DEPTH_REG); hdev 1450 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_write_dev(&hdev->hw, HCLGEVF_NIC_CSQ_DEPTH_REG, hdev 1454 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_reset_stack(struct hclgevf_dev *hdev) hdev 1459 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_notify_client(hdev, HNAE3_UNINIT_CLIENT); hdev 1464 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_reset_hdev(hdev); hdev 1466 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 1472 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_notify_client(hdev, HNAE3_INIT_CLIENT); hdev 1476 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_notify_client(hdev, HNAE3_RESTORE_CLIENT); hdev 1481 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_reset_handshake(hdev, false); hdev 1486 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_reset_prepare_wait(struct hclgevf_dev *hdev) hdev 1492 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c switch (hdev->reset_type) { hdev 1494 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_send_mbx_msg(hdev, HCLGE_MBX_RESET, 0, NULL, hdev 1496 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->rst_stats.vf_func_rst_cnt++; hdev 1499 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HNAE3_FLR_DOWN, &hdev->flr_state); hdev 1500 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->rst_stats.flr_rst_cnt++; hdev 1506 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state); hdev 1509 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_reset_handshake(hdev, true); hdev 1510 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_info(&hdev->pdev->dev, "prepare reset(%d) wait done, ret:%d\n", hdev 1511 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->reset_type, ret); hdev 1516 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_reset_err_handle(struct hclgevf_dev *hdev) hdev 1519 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_reset_handshake(hdev, true); hdev 1520 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->rst_stats.rst_fail_cnt++; hdev 1521 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, "failed to reset VF(%d)\n", hdev 1522 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->rst_stats.rst_fail_cnt); hdev 1524 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->rst_stats.rst_fail_cnt < HCLGEVF_RESET_MAX_FAIL_CNT) hdev 1525 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(hdev->reset_type, &hdev->reset_pending); hdev 1527 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hclgevf_is_reset_pending(hdev)) { hdev 1528 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state); hdev 1529 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_reset_task_schedule(hdev); hdev 1533 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_reset(struct hclgevf_dev *hdev) hdev 1535 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev); hdev 1541 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ae_dev->reset_type = hdev->reset_type; hdev 1542 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->rst_stats.rst_cnt++; hdev 1546 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_notify_client(hdev, HNAE3_DOWN_CLIENT); hdev 1552 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_reset_prepare_wait(hdev); hdev 1559 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_reset_wait(hdev); hdev 1562 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 1568 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->rst_stats.hw_rst_done_cnt++; hdev 1573 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_reset_stack(hdev); hdev 1575 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, "failed to reset VF stack\n"); hdev 1580 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_notify_client(hdev, HNAE3_UP_CLIENT); hdev 1586 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->last_reset_time = jiffies; hdev 1588 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->rst_stats.rst_done_cnt++; hdev 1589 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->rst_stats.rst_fail_cnt = 0; hdev 1595 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_reset_err_handle(hdev); hdev 1600 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static enum hnae3_reset_type hclgevf_get_reset_level(struct hclgevf_dev *hdev, hdev 1634 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = ae_dev->priv; hdev 1636 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_info(&hdev->pdev->dev, "received reset request from VF enet\n"); hdev 1638 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->default_reset_request) hdev 1639 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->reset_level = hdev 1640 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_get_reset_level(hdev, hdev 1641 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c &hdev->default_reset_request); hdev 1643 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->reset_level = HNAE3_VF_FUNC_RESET; hdev 1646 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_RESET_REQUESTED, &hdev->reset_state); hdev 1647 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_reset_task_schedule(hdev); hdev 1649 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->last_reset_time = jiffies; hdev 1655 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = ae_dev->priv; hdev 1657 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(rst_type, &hdev->default_reset_request); hdev 1664 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = ae_dev->priv; hdev 1667 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HNAE3_FLR_DOWN, &hdev->flr_state); hdev 1668 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HNAE3_FLR_DONE, &hdev->flr_state); hdev 1669 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HNAE3_FLR_RESET, &hdev->default_reset_request); hdev 1670 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_reset_event(hdev->pdev, NULL); hdev 1672 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c while (!test_bit(HNAE3_FLR_DOWN, &hdev->flr_state) && hdev 1676 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (!test_bit(HNAE3_FLR_DOWN, &hdev->flr_state)) hdev 1677 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 1683 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 1685 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hdev->fw_version; hdev 1688 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_get_misc_vector(struct hclgevf_dev *hdev) hdev 1690 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_misc_vector *vector = &hdev->misc_vector; hdev 1692 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c vector->vector_irq = pci_irq_vector(hdev->pdev, hdev 1694 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c vector->addr = hdev->hw.io_base + HCLGEVF_MISC_VECTOR_REG_BASE; hdev 1696 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->vector_status[HCLGEVF_MISC_VECTOR_NUM] = 0; hdev 1697 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->vector_irq[HCLGEVF_MISC_VECTOR_NUM] = vector->vector_irq; hdev 1699 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_msi_left -= 1; hdev 1700 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_msi_used += 1; hdev 1703 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c void hclgevf_reset_task_schedule(struct hclgevf_dev *hdev) hdev 1705 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (!test_bit(HCLGEVF_STATE_RST_SERVICE_SCHED, &hdev->state) && hdev 1706 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c !test_bit(HCLGEVF_STATE_REMOVING, &hdev->state)) { hdev 1707 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_STATE_RST_SERVICE_SCHED, &hdev->state); hdev 1708 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c schedule_work(&hdev->rst_service_task); hdev 1712 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c void hclgevf_mbx_task_schedule(struct hclgevf_dev *hdev) hdev 1714 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (!test_bit(HCLGEVF_STATE_MBX_SERVICE_SCHED, &hdev->state) && hdev 1715 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c !test_bit(HCLGEVF_STATE_MBX_HANDLING, &hdev->state)) { hdev 1716 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_STATE_MBX_SERVICE_SCHED, &hdev->state); hdev 1717 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c schedule_work(&hdev->mbx_service_task); hdev 1721 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_task_schedule(struct hclgevf_dev *hdev) hdev 1723 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (!test_bit(HCLGEVF_STATE_DOWN, &hdev->state) && hdev 1724 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c !test_and_set_bit(HCLGEVF_STATE_SERVICE_SCHED, &hdev->state)) hdev 1725 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c schedule_work(&hdev->service_task); hdev 1728 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_deferred_task_schedule(struct hclgevf_dev *hdev) hdev 1731 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->mbx_event_pending) hdev 1732 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_mbx_task_schedule(hdev); hdev 1734 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (test_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state)) hdev 1735 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_reset_task_schedule(hdev); hdev 1740 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = from_timer(hdev, t, service_timer); hdev 1742 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c mod_timer(&hdev->service_timer, jiffies + hdev 1745 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->stats_timer++; hdev 1746 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_task_schedule(hdev); hdev 1751 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hdev 1755 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (test_and_set_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state)) hdev 1758 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HCLGEVF_STATE_RST_SERVICE_SCHED, &hdev->state); hdev 1761 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c &hdev->reset_state)) { hdev 1767 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->reset_attempts = 0; hdev 1769 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->last_reset_time = jiffies; hdev 1770 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c while ((hdev->reset_type = hdev 1771 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_get_reset_level(hdev, &hdev->reset_pending)) hdev 1773 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_reset(hdev); hdev 1775 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 1779 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c &hdev->reset_state)) { hdev 1803 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->reset_attempts > 3) { hdev 1805 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HNAE3_VF_FULL_RESET, &hdev->reset_pending); hdev 1808 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state); hdev 1810 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->reset_attempts++; hdev 1812 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(hdev->reset_level, &hdev->reset_pending); hdev 1813 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state); hdev 1815 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_reset_task_schedule(hdev); hdev 1818 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state); hdev 1823 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev; hdev 1825 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev = container_of(work, struct hclgevf_dev, mbx_service_task); hdev 1827 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (test_and_set_bit(HCLGEVF_STATE_MBX_HANDLING, &hdev->state)) hdev 1830 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HCLGEVF_STATE_MBX_SERVICE_SCHED, &hdev->state); hdev 1832 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_mbx_async_handler(hdev); hdev 1834 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HCLGEVF_STATE_MBX_HANDLING, &hdev->state); hdev 1839 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = from_timer(hdev, t, keep_alive_timer); hdev 1841 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c schedule_work(&hdev->keep_alive_task); hdev 1842 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c mod_timer(&hdev->keep_alive_timer, jiffies + hdev 1848 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev; hdev 1852 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev = container_of(work, struct hclgevf_dev, keep_alive_task); hdev 1854 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (test_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state)) hdev 1857 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_send_mbx_msg(hdev, HCLGE_MBX_KEEP_ALIVE, 0, NULL, hdev 1860 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 1867 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev; hdev 1869 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev = container_of(work, struct hclgevf_dev, service_task); hdev 1870 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c handle = &hdev->nic; hdev 1872 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->stats_timer >= HCLGEVF_STATS_TIMER_INTERVAL) { hdev 1874 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->stats_timer = 0; hdev 1880 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_request_link_info(hdev); hdev 1882 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_update_link_mode(hdev); hdev 1884 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_sync_vlan_filter(hdev); hdev 1886 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_deferred_task_schedule(hdev); hdev 1888 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HCLGEVF_STATE_SERVICE_SCHED, &hdev->state); hdev 1891 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_clear_event_cause(struct hclgevf_dev *hdev, u32 regclr) hdev 1893 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_write_dev(&hdev->hw, HCLGEVF_VECTOR0_CMDQ_SRC_REG, regclr); hdev 1896 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static enum hclgevf_evt_cause hclgevf_check_evt_cause(struct hclgevf_dev *hdev, hdev 1902 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c cmdq_stat_reg = hclgevf_read_dev(&hdev->hw, hdev 1906 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c rst_ing_reg = hclgevf_read_dev(&hdev->hw, HCLGEVF_RST_ING); hdev 1907 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_info(&hdev->pdev->dev, hdev 1909 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HNAE3_VF_RESET, &hdev->reset_pending); hdev 1910 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state); hdev 1911 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state); hdev 1913 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->rst_stats.vf_rst_cnt++; hdev 1917 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c val = hclgevf_read_dev(&hdev->hw, HCLGEVF_VF_RST_ING); hdev 1918 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_write_dev(&hdev->hw, HCLGEVF_VF_RST_ING, hdev 1932 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->pdev->revision >= 0x21) hdev 1941 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_dbg(&hdev->pdev->dev, "vector 0 interrupt from unknown source\n"); hdev 1954 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = data; hdev 1957 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_enable_vector(&hdev->misc_vector, false); hdev 1958 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c event_cause = hclgevf_check_evt_cause(hdev, &clearval); hdev 1962 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_reset_task_schedule(hdev); hdev 1965 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_mbx_handler(hdev); hdev 1972 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_clear_event_cause(hdev, clearval); hdev 1973 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_enable_vector(&hdev->misc_vector, true); hdev 1979 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_configure(struct hclgevf_dev *hdev) hdev 1984 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_get_port_base_vlan_filter_state(hdev); hdev 1989 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_get_queue_info(hdev); hdev 1994 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_get_queue_depth(hdev); hdev 1998 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_get_pf_media_type(hdev); hdev 2003 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_get_tc_info(hdev); hdev 2009 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev; hdev 2011 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev = devm_kzalloc(&pdev->dev, sizeof(*hdev), GFP_KERNEL); hdev 2012 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (!hdev) hdev 2015 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->pdev = pdev; hdev 2016 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->ae_dev = ae_dev; hdev 2017 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ae_dev->priv = hdev; hdev 2022 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_init_roce_base_info(struct hclgevf_dev *hdev) hdev 2024 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hnae3_handle *roce = &hdev->roce; hdev 2025 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hnae3_handle *nic = &hdev->nic; hdev 2027 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c roce->rinfo.num_vectors = hdev->num_roce_msix; hdev 2029 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->num_msi_left < roce->rinfo.num_vectors || hdev 2030 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_msi_left == 0) hdev 2033 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c roce->rinfo.base_vector = hdev->roce_base_vector; hdev 2036 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c roce->rinfo.roce_io_base = hdev->hw.io_base; hdev 2045 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_config_gro(struct hclgevf_dev *hdev, bool en) hdev 2051 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (!hnae3_dev_gro_supported(hdev)) hdev 2060 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_cmd_send(&hdev->hw, &desc, 1); hdev 2062 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 2068 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_rss_init_hw(struct hclgevf_dev *hdev) hdev 2070 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_rss_cfg *rss_cfg = &hdev->rss_cfg; hdev 2074 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c rss_cfg->rss_size = hdev->nic.kinfo.rss_size; hdev 2076 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->pdev->revision >= 0x21) { hdev 2081 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_set_rss_algo_key(hdev, rss_cfg->hash_algo, hdev 2103 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_set_rss_input_tuple(hdev, rss_cfg); hdev 2113 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_set_rss_indir_table(hdev); hdev 2117 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_set_rss_tc_mode(hdev, rss_cfg->rss_size); hdev 2120 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_init_vlan_config(struct hclgevf_dev *hdev) hdev 2122 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_set_vlan_filter(&hdev->nic, htons(ETH_P_8021Q), 0, hdev 2128 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2131 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c mod_timer(&hdev->service_timer, jiffies + HZ); hdev 2133 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c del_timer_sync(&hdev->service_timer); hdev 2134 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c cancel_work_sync(&hdev->service_task); hdev 2135 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HCLGEVF_STATE_SERVICE_SCHED, &hdev->state); hdev 2141 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2145 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_request_link_info(hdev); hdev 2147 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_update_link_mode(hdev); hdev 2149 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HCLGEVF_STATE_DOWN, &hdev->state); hdev 2156 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2159 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_STATE_DOWN, &hdev->state); hdev 2161 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->reset_type != HNAE3_VF_RESET) hdev 2167 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_update_link_status(hdev, 0); hdev 2172 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2176 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_send_mbx_msg(hdev, HCLGE_MBX_SET_ALIVE, hdev 2182 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2189 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c mod_timer(&hdev->keep_alive_timer, jiffies + hdev 2197 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2202 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_warn(&hdev->pdev->dev, hdev 2205 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c del_timer_sync(&hdev->keep_alive_timer); hdev 2206 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c cancel_work_sync(&hdev->keep_alive_task); hdev 2209 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_state_init(struct hclgevf_dev *hdev) hdev 2212 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c INIT_WORK(&hdev->mbx_service_task, hclgevf_mailbox_service_task); hdev 2213 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HCLGEVF_STATE_MBX_SERVICE_SCHED, &hdev->state); hdev 2214 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HCLGEVF_STATE_MBX_HANDLING, &hdev->state); hdev 2217 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c timer_setup(&hdev->service_timer, hclgevf_service_timer, 0); hdev 2219 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c INIT_WORK(&hdev->service_task, hclgevf_service_task); hdev 2220 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HCLGEVF_STATE_SERVICE_SCHED, &hdev->state); hdev 2222 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c INIT_WORK(&hdev->rst_service_task, hclgevf_reset_service_task); hdev 2224 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c mutex_init(&hdev->mbx_resp.mbx_mutex); hdev 2227 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_STATE_DOWN, &hdev->state); hdev 2230 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_state_uninit(struct hclgevf_dev *hdev) hdev 2232 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_STATE_DOWN, &hdev->state); hdev 2233 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_STATE_REMOVING, &hdev->state); hdev 2235 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->keep_alive_timer.function) hdev 2236 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c del_timer_sync(&hdev->keep_alive_timer); hdev 2237 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->keep_alive_task.func) hdev 2238 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c cancel_work_sync(&hdev->keep_alive_task); hdev 2239 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->service_timer.function) hdev 2240 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c del_timer_sync(&hdev->service_timer); hdev 2241 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->service_task.func) hdev 2242 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c cancel_work_sync(&hdev->service_task); hdev 2243 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->mbx_service_task.func) hdev 2244 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c cancel_work_sync(&hdev->mbx_service_task); hdev 2245 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->rst_service_task.func) hdev 2246 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c cancel_work_sync(&hdev->rst_service_task); hdev 2248 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c mutex_destroy(&hdev->mbx_resp.mbx_mutex); hdev 2251 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_init_msi(struct hclgevf_dev *hdev) hdev 2253 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct pci_dev *pdev = hdev->pdev; hdev 2257 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hnae3_dev_roce_supported(hdev)) hdev 2259 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->roce_base_msix_offset + 1, hdev 2260 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_msi, hdev 2264 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_msi, hdev 2273 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (vectors < hdev->num_msi) hdev 2274 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_warn(&hdev->pdev->dev, hdev 2276 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_msi, vectors); hdev 2278 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_msi = vectors; hdev 2279 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_msi_left = vectors; hdev 2281 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->base_msi_vector = pdev->irq; hdev 2282 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->roce_base_vector = pdev->irq + hdev->roce_base_msix_offset; hdev 2284 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->vector_status = devm_kcalloc(&pdev->dev, hdev->num_msi, hdev 2286 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (!hdev->vector_status) { hdev 2291 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c for (i = 0; i < hdev->num_msi; i++) hdev 2292 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->vector_status[i] = HCLGEVF_INVALID_VPORT; hdev 2294 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->vector_irq = devm_kcalloc(&pdev->dev, hdev->num_msi, hdev 2296 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (!hdev->vector_irq) { hdev 2297 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c devm_kfree(&pdev->dev, hdev->vector_status); hdev 2305 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_uninit_msi(struct hclgevf_dev *hdev) hdev 2307 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct pci_dev *pdev = hdev->pdev; hdev 2309 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c devm_kfree(&pdev->dev, hdev->vector_status); hdev 2310 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c devm_kfree(&pdev->dev, hdev->vector_irq); hdev 2314 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_misc_irq_init(struct hclgevf_dev *hdev) hdev 2318 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_get_misc_vector(hdev); hdev 2320 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = request_irq(hdev->misc_vector.vector_irq, hclgevf_misc_irq_handle, hdev 2321 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c 0, "hclgevf_cmd", hdev); hdev 2323 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, "VF failed to request misc irq(%d)\n", hdev 2324 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->misc_vector.vector_irq); hdev 2328 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_clear_event_cause(hdev, 0); hdev 2331 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_enable_vector(&hdev->misc_vector, true); hdev 2336 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_misc_irq_uninit(struct hclgevf_dev *hdev) hdev 2339 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_enable_vector(&hdev->misc_vector, false); hdev 2340 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c synchronize_irq(hdev->misc_vector.vector_irq); hdev 2341 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c free_irq(hdev->misc_vector.vector_irq, hdev); hdev 2342 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_free_vector(hdev, 0); hdev 2345 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_info_show(struct hclgevf_dev *hdev) hdev 2347 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct device *dev = &hdev->pdev->dev; hdev 2351 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_info(dev, "Task queue pairs numbers: %d\n", hdev->num_tqps); hdev 2352 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_info(dev, "Desc num per TX queue: %d\n", hdev->num_tx_desc); hdev 2353 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_info(dev, "Desc num per RX queue: %d\n", hdev->num_rx_desc); hdev 2354 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_info(dev, "Numbers of vports: %d\n", hdev->num_alloc_vport); hdev 2355 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_info(dev, "HW tc map: %d\n", hdev->hw_tc_map); hdev 2357 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->hw.mac.media_type); hdev 2365 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = ae_dev->priv; hdev 2368 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = client->ops->init_instance(&hdev->nic); hdev 2372 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_STATE_NIC_REGISTERED, &hdev->state); hdev 2375 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (netif_msg_drv(&hdev->nic)) hdev 2376 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_info_show(hdev); hdev 2384 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = ae_dev->priv; hdev 2387 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (!hnae3_dev_roce_supported(hdev) || !hdev->roce_client || hdev 2388 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c !hdev->nic_client) hdev 2391 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_init_roce_base_info(hdev); hdev 2395 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = client->ops->init_instance(&hdev->roce); hdev 2407 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = ae_dev->priv; hdev 2412 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->nic_client = client; hdev 2413 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->nic.client = client; hdev 2420 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->roce_client); hdev 2426 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hnae3_dev_roce_supported(hdev)) { hdev 2427 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->roce_client = client; hdev 2428 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->roce.client = client; hdev 2443 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->nic_client = NULL; hdev 2444 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->nic.client = NULL; hdev 2447 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->roce_client = NULL; hdev 2448 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->roce.client = NULL; hdev 2455 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = ae_dev->priv; hdev 2458 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->roce_client) { hdev 2459 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->roce_client->ops->uninit_instance(&hdev->roce, 0); hdev 2460 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->roce_client = NULL; hdev 2461 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->roce.client = NULL; hdev 2465 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (client->ops->uninit_instance && hdev->nic_client && hdev 2467 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HCLGEVF_STATE_NIC_REGISTERED, &hdev->state); hdev 2469 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c client->ops->uninit_instance(&hdev->nic, 0); hdev 2470 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->nic_client = NULL; hdev 2471 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->nic.client = NULL; hdev 2475 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_pci_init(struct hclgevf_dev *hdev) hdev 2477 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct pci_dev *pdev = hdev->pdev; hdev 2500 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hw = &hdev->hw; hdev 2501 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hw->hdev = hdev; hdev 2520 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_pci_uninit(struct hclgevf_dev *hdev) hdev 2522 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct pci_dev *pdev = hdev->pdev; hdev 2524 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c pci_iounmap(pdev, hdev->hw.io_base); hdev 2530 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_query_vf_resource(struct hclgevf_dev *hdev) hdev 2537 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_cmd_send(&hdev->hw, &desc, 1); hdev 2539 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 2546 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hnae3_dev_roce_supported(hdev)) { hdev 2547 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->roce_base_msix_offset = hdev 2551 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_roce_msix = hdev 2556 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_nic_msix = hdev->num_roce_msix; hdev 2561 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_msi = hdev->num_roce_msix + hdev 2562 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->roce_base_msix_offset; hdev 2564 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_msi = hdev 2568 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_nic_msix = hdev->num_msi; hdev 2571 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->num_nic_msix < HNAE3_MIN_VECTOR_NUM) { hdev 2572 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 2574 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_nic_msix); hdev 2581 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_pci_reset(struct hclgevf_dev *hdev) hdev 2583 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct pci_dev *pdev = hdev->pdev; hdev 2586 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (hdev->reset_type == HNAE3_VF_FULL_RESET && hdev 2587 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c test_bit(HCLGEVF_STATE_IRQ_INITED, &hdev->state)) { hdev 2588 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_misc_irq_uninit(hdev); hdev 2589 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_uninit_msi(hdev); hdev 2590 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HCLGEVF_STATE_IRQ_INITED, &hdev->state); hdev 2593 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (!test_bit(HCLGEVF_STATE_IRQ_INITED, &hdev->state)) { hdev 2595 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_init_msi(hdev); hdev 2602 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_misc_irq_init(hdev); hdev 2604 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_uninit_msi(hdev); hdev 2610 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_STATE_IRQ_INITED, &hdev->state); hdev 2616 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_reset_hdev(struct hclgevf_dev *hdev) hdev 2618 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct pci_dev *pdev = hdev->pdev; hdev 2621 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_pci_reset(hdev); hdev 2627 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_cmd_init(hdev); hdev 2633 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_rss_init_hw(hdev); hdev 2635 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 2640 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_config_gro(hdev, true); hdev 2644 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_init_vlan_config(hdev); hdev 2646 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 2652 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_set_promisc_mode(hdev, true); hdev 2657 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_info(&hdev->pdev->dev, "Reset done\n"); hdev 2662 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static int hclgevf_init_hdev(struct hclgevf_dev *hdev) hdev 2664 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct pci_dev *pdev = hdev->pdev; hdev 2667 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_pci_init(hdev); hdev 2673 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_cmd_queue_init(hdev); hdev 2679 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_cmd_init(hdev); hdev 2684 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_query_vf_resource(hdev); hdev 2686 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 2691 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_init_msi(hdev); hdev 2697 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_state_init(hdev); hdev 2698 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->reset_level = HNAE3_VF_FUNC_RESET; hdev 2700 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_misc_irq_init(hdev); hdev 2707 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c set_bit(HCLGEVF_STATE_IRQ_INITED, &hdev->state); hdev 2709 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_configure(hdev); hdev 2715 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_alloc_tqps(hdev); hdev 2721 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_set_handle_info(hdev); hdev 2727 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_config_gro(hdev, true); hdev 2737 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_set_promisc_mode(hdev, true); hdev 2743 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_rss_init_hw(hdev); hdev 2745 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 2750 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_init_vlan_config(hdev); hdev 2752 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, hdev 2757 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->last_reset_time = jiffies; hdev 2758 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_info(&hdev->pdev->dev, "finished initializing %s driver\n", hdev 2764 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_misc_irq_uninit(hdev); hdev 2766 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_state_uninit(hdev); hdev 2767 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_uninit_msi(hdev); hdev 2769 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_cmd_uninit(hdev); hdev 2771 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_pci_uninit(hdev); hdev 2772 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c clear_bit(HCLGEVF_STATE_IRQ_INITED, &hdev->state); hdev 2776 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static void hclgevf_uninit_hdev(struct hclgevf_dev *hdev) hdev 2778 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_state_uninit(hdev); hdev 2780 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c if (test_bit(HCLGEVF_STATE_IRQ_INITED, &hdev->state)) { hdev 2781 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_misc_irq_uninit(hdev); hdev 2782 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_uninit_msi(hdev); hdev 2785 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_pci_uninit(hdev); hdev 2786 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_cmd_uninit(hdev); hdev 2792 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev; hdev 2807 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev = ae_dev->priv; hdev 2808 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c timer_setup(&hdev->keep_alive_timer, hclgevf_keep_alive_timer, 0); hdev 2809 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c INIT_WORK(&hdev->keep_alive_task, hclgevf_keep_alive_task); hdev 2816 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = ae_dev->priv; hdev 2818 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_uninit_hdev(hdev); hdev 2822 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c static u32 hclgevf_get_max_channels(struct hclgevf_dev *hdev) hdev 2824 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hnae3_handle *nic = &hdev->nic; hdev 2827 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return min_t(u32, hdev->rss_size_max, hdev 2828 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_tqps / kinfo->num_tc); hdev 2844 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2846 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ch->max_combined = hclgevf_get_max_channels(hdev); hdev 2855 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2857 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c *alloc_tqps = hdev->num_tqps; hdev 2858 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c *max_rss_size = hdev->rss_size_max; hdev 2865 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2870 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c max_rss_size = min_t(u16, hdev->rss_size_max, hdev 2871 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->num_tqps / kinfo->num_tc); hdev 2889 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2899 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c ret = hclgevf_set_rss_tc_mode(hdev, kinfo->rss_size); hdev 2917 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_err(&hdev->pdev->dev, "set rss indir table fail, ret=%d\n", hdev 2924 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c dev_info(&hdev->pdev->dev, hdev 2934 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2936 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hdev->hw.mac.link; hdev 2943 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2946 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c *speed = hdev->hw.mac.speed; hdev 2948 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c *duplex = hdev->hw.mac.duplex; hdev 2953 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c void hclgevf_update_speed_duplex(struct hclgevf_dev *hdev, u32 speed, hdev 2956 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->hw.mac.speed = speed; hdev 2957 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hdev->hw.mac.duplex = duplex; hdev 2962 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2964 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hclgevf_config_gro(hdev, enable); hdev 2970 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2973 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c *media_type = hdev->hw.mac.media_type; hdev 2976 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c *module_type = hdev->hw.mac.module_type; hdev 2981 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2983 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return !!hclgevf_read_dev(&hdev->hw, HCLGEVF_RST_ING); hdev 2988 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2990 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state); hdev 2995 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 2997 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return hdev->rst_stats.hw_rst_done_cnt; hdev 3004 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 3006 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c *supported = hdev->hw.mac.supported; hdev 3007 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c *advertising = hdev->hw.mac.advertising; hdev 3018 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 3025 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c return (cmdq_lines + common_lines + ring_lines * hdev->num_tqps + hdev 3026 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c tqp_intr_lines * (hdev->num_msi_used - 1)) * REG_LEN_PER_LINE; hdev 3032 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); hdev 3036 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c *version = hdev->fw_version; hdev 3042 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c *reg++ = hclgevf_read_dev(&hdev->hw, cmdq_reg_addr_list[i]); hdev 3049 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c *reg++ = hclgevf_read_dev(&hdev->hw, common_reg_addr_list[i]); hdev 3055 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c for (j = 0; j < hdev->num_tqps; j++) { hdev 3057 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c *reg++ = hclgevf_read_dev(&hdev->hw, hdev 3066 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c for (j = 0; j < hdev->num_msi_used - 1; j++) { hdev 3068 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c *reg++ = hclgevf_read_dev(&hdev->hw, hdev 3076 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c void hclgevf_update_port_base_vlan_info(struct hclgevf_dev *hdev, u16 state, hdev 3079 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c struct hnae3_handle *nic = &hdev->nic; hdev 3082 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_notify_client(hdev, HNAE3_DOWN_CLIENT); hdev 3086 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_send_mbx_msg(hdev, HCLGE_MBX_SET_VLAN, hdev 3097 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c hclgevf_notify_client(hdev, HNAE3_UP_CLIENT); hdev 171 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h void *hdev; /* hchgevf device it is part of */ hdev 305 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h static inline bool hclgevf_is_reset_pending(struct hclgevf_dev *hdev) hdev 307 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h return !!hdev->reset_pending; hdev 310 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h int hclgevf_send_mbx_msg(struct hclgevf_dev *hdev, u16 code, u16 subcode, hdev 313 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h void hclgevf_mbx_handler(struct hclgevf_dev *hdev); hdev 314 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h void hclgevf_mbx_async_handler(struct hclgevf_dev *hdev); hdev 316 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h void hclgevf_update_link_status(struct hclgevf_dev *hdev, int link_state); hdev 317 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h void hclgevf_update_speed_duplex(struct hclgevf_dev *hdev, u32 speed, hdev 319 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h void hclgevf_reset_task_schedule(struct hclgevf_dev *hdev); hdev 320 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h void hclgevf_mbx_task_schedule(struct hclgevf_dev *hdev); hdev 321 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h void hclgevf_update_port_base_vlan_info(struct hclgevf_dev *hdev, u16 state, hdev 8 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c static void hclgevf_reset_mbx_resp_status(struct hclgevf_dev *hdev) hdev 13 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hdev->mbx_resp.received_resp = false; hdev 14 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hdev->mbx_resp.origin_mbx_msg = 0; hdev 15 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hdev->mbx_resp.resp_status = 0; hdev 16 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c memset(hdev->mbx_resp.additional_info, 0, HCLGE_MBX_MAX_RESP_DATA_SIZE); hdev 25 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c static int hclgevf_get_mbx_resp(struct hclgevf_dev *hdev, u16 code0, u16 code1, hdev 35 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c dev_err(&hdev->pdev->dev, hdev 42 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c while ((!hdev->mbx_resp.received_resp) && (i < HCLGEVF_MAX_TRY_TIMES)) { hdev 43 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c if (test_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state)) hdev 51 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c dev_err(&hdev->pdev->dev, hdev 53 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c code0, code1, hdev->mbx_resp.received_resp, i); hdev 57 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c mbx_resp = &hdev->mbx_resp; hdev 67 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hclgevf_reset_mbx_resp_status(hdev); hdev 70 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c dev_err(&hdev->pdev->dev, hdev 73 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c dev_err(&hdev->pdev->dev, hdev 82 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c int hclgevf_send_mbx_msg(struct hclgevf_dev *hdev, u16 code, u16 subcode, hdev 94 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c dev_err(&hdev->pdev->dev, hdev 110 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c mutex_lock(&hdev->mbx_resp.mbx_mutex); hdev 111 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hclgevf_reset_mbx_resp_status(hdev); hdev 112 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c status = hclgevf_cmd_send(&hdev->hw, &desc, 1); hdev 114 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c dev_err(&hdev->pdev->dev, hdev 117 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c mutex_unlock(&hdev->mbx_resp.mbx_mutex); hdev 121 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c status = hclgevf_get_mbx_resp(hdev, code, subcode, resp_data, hdev 123 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c mutex_unlock(&hdev->mbx_resp.mbx_mutex); hdev 126 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c status = hclgevf_cmd_send(&hdev->hw, &desc, 1); hdev 128 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c dev_err(&hdev->pdev->dev, hdev 145 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c void hclgevf_mbx_handler(struct hclgevf_dev *hdev) hdev 156 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c resp = &hdev->mbx_resp; hdev 157 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c crq = &hdev->hw.cmq.crq; hdev 159 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c while (!hclgevf_cmd_crq_empty(&hdev->hw)) { hdev 160 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c if (test_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state)) { hdev 161 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c dev_info(&hdev->pdev->dev, "vf crq need init\n"); hdev 170 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c dev_warn(&hdev->pdev->dev, hdev 189 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c dev_warn(&hdev->pdev->dev, hdev 213 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hdev->mbx_event_pending = true; hdev 218 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c if (atomic_read(&hdev->arq.count) >= hdev 220 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c dev_warn(&hdev->pdev->dev, hdev 227 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c msg_q = hdev->arq.msg_q[hdev->arq.tail]; hdev 230 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hclge_mbx_tail_ptr_move_arq(hdev->arq); hdev 231 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c atomic_inc(&hdev->arq.count); hdev 233 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hclgevf_mbx_task_schedule(hdev); hdev 237 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c dev_err(&hdev->pdev->dev, hdev 247 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hclgevf_write_dev(&hdev->hw, HCLGEVF_NIC_CRQ_HEAD_REG, hdev 251 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c void hclgevf_mbx_async_handler(struct hclgevf_dev *hdev) hdev 264 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hdev->mbx_event_pending = false; hdev 266 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c tail = hdev->arq.tail; hdev 269 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c while (tail != hdev->arq.head) { hdev 270 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c if (test_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state)) { hdev 271 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c dev_info(&hdev->pdev->dev, hdev 276 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c msg_q = hdev->arq.msg_q[hdev->arq.head]; hdev 285 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hclgevf_update_link_status(hdev, link_status); hdev 286 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hclgevf_update_speed_duplex(hdev, speed, duplex); hdev 292 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c memcpy(&hdev->hw.mac.supported, &msg_q[2], hdev 295 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c memcpy(&hdev->hw.mac.advertising, &msg_q[2], hdev 305 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c set_bit(reset_type, &hdev->reset_pending); hdev 306 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state); hdev 307 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hclgevf_reset_task_schedule(hdev); hdev 313 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hclgevf_update_port_base_vlan_info(hdev, state, hdev 317 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c dev_err(&hdev->pdev->dev, hdev 323 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c hclge_mbx_head_ptr_move_arq(hdev->arq); hdev 324 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c atomic_dec(&hdev->arq.count); hdev 325 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c msg_q = hdev->arq.msg_q[hdev->arq.head]; hdev 919 drivers/net/hyperv/netvsc_drv.c struct hv_device *hdev = ndev_ctx->device_ctx; hdev 947 drivers/net/hyperv/netvsc_drv.c rndis_filter_device_remove(hdev, nvdev); hdev 956 drivers/net/hyperv/netvsc_drv.c struct hv_device *hdev = ndev_ctx->device_ctx; hdev 961 drivers/net/hyperv/netvsc_drv.c nvdev = rndis_filter_device_add(hdev, dev_info); hdev 997 drivers/net/hyperv/netvsc_drv.c rndis_filter_device_remove(hdev, nvdev); hdev 315 drivers/nfc/mei_phy.c nfc_hci_recv_frame(phy->hdev, skb); hdev 33 drivers/nfc/mei_phy.h struct nfc_hci_dev *hdev; hdev 40 drivers/nfc/microread/i2c.c struct nfc_hci_dev *hdev; hdev 216 drivers/nfc/microread/i2c.c nfc_hci_recv_frame(phy->hdev, NULL); hdev 223 drivers/nfc/microread/i2c.c nfc_hci_recv_frame(phy->hdev, skb); hdev 261 drivers/nfc/microread/i2c.c MICROREAD_I2C_LLC_MAX_PAYLOAD, &phy->hdev); hdev 279 drivers/nfc/microread/i2c.c microread_remove(phy->hdev); hdev 37 drivers/nfc/microread/mei.c &phy->hdev); hdev 51 drivers/nfc/microread/mei.c microread_remove(phy->hdev); hdev 158 drivers/nfc/microread/microread.c struct nfc_hci_dev *hdev; hdev 165 drivers/nfc/microread/microread.c static int microread_open(struct nfc_hci_dev *hdev) hdev 167 drivers/nfc/microread/microread.c struct microread_info *info = nfc_hci_get_clientdata(hdev); hdev 172 drivers/nfc/microread/microread.c static void microread_close(struct nfc_hci_dev *hdev) hdev 174 drivers/nfc/microread/microread.c struct microread_info *info = nfc_hci_get_clientdata(hdev); hdev 179 drivers/nfc/microread/microread.c static int microread_hci_ready(struct nfc_hci_dev *hdev) hdev 185 drivers/nfc/microread/microread.c r = nfc_hci_send_cmd(hdev, MICROREAD_GATE_ID_MREAD_ISO_A, hdev 190 drivers/nfc/microread/microread.c r = nfc_hci_send_cmd(hdev, MICROREAD_GATE_ID_MREAD_ISO_A_3, hdev 198 drivers/nfc/microread/microread.c r = nfc_hci_send_cmd(hdev, MICROREAD_GATE_ID_MREAD_ISO_B, hdev 203 drivers/nfc/microread/microread.c r = nfc_hci_send_cmd(hdev, MICROREAD_GATE_ID_MREAD_NFC_T1, hdev 212 drivers/nfc/microread/microread.c r = nfc_hci_send_cmd(hdev, MICROREAD_GATE_ID_MREAD_NFC_T3, hdev 218 drivers/nfc/microread/microread.c static int microread_xmit(struct nfc_hci_dev *hdev, struct sk_buff *skb) hdev 220 drivers/nfc/microread/microread.c struct microread_info *info = nfc_hci_get_clientdata(hdev); hdev 225 drivers/nfc/microread/microread.c static int microread_start_poll(struct nfc_hci_dev *hdev, hdev 255 drivers/nfc/microread/microread.c hdev->gb = nfc_get_local_general_bytes(hdev->ndev, hdev 256 drivers/nfc/microread/microread.c &hdev->gb_len); hdev 257 drivers/nfc/microread/microread.c if (hdev->gb == NULL || hdev->gb_len == 0) { hdev 263 drivers/nfc/microread/microread.c r = nfc_hci_send_event(hdev, MICROREAD_GATE_ID_MREAD_ISO_A, hdev 269 drivers/nfc/microread/microread.c r = nfc_hci_set_param(hdev, MICROREAD_GATE_ID_P2P_TARGET, hdev 275 drivers/nfc/microread/microread.c r = nfc_hci_set_param(hdev, MICROREAD_GATE_ID_P2P_INITIATOR, hdev 277 drivers/nfc/microread/microread.c hdev->gb, hdev->gb_len); hdev 283 drivers/nfc/microread/microread.c r = nfc_hci_set_param(hdev, MICROREAD_GATE_ID_P2P_TARGET, hdev 285 drivers/nfc/microread/microread.c hdev->gb, hdev->gb_len); hdev 290 drivers/nfc/microread/microread.c r = nfc_hci_set_param(hdev, MICROREAD_GATE_ID_P2P_TARGET, hdev 296 drivers/nfc/microread/microread.c return nfc_hci_send_event(hdev, MICROREAD_GATE_ID_MREAD_ISO_A, hdev 301 drivers/nfc/microread/microread.c static int microread_dep_link_up(struct nfc_hci_dev *hdev, hdev 308 drivers/nfc/microread/microread.c r = nfc_hci_get_param(hdev, target->hci_reader_gate, hdev 318 drivers/nfc/microread/microread.c r = nfc_set_remote_general_bytes(hdev->ndev, rgb_skb->data, hdev 321 drivers/nfc/microread/microread.c r = nfc_dep_link_is_up(hdev->ndev, target->idx, comm_mode, hdev 329 drivers/nfc/microread/microread.c static int microread_dep_link_down(struct nfc_hci_dev *hdev) hdev 331 drivers/nfc/microread/microread.c return nfc_hci_send_event(hdev, MICROREAD_GATE_ID_P2P_INITIATOR, hdev 335 drivers/nfc/microread/microread.c static int microread_target_from_gate(struct nfc_hci_dev *hdev, u8 gate, hdev 349 drivers/nfc/microread/microread.c static int microread_complete_target_discovered(struct nfc_hci_dev *hdev, hdev 399 drivers/nfc/microread/microread.c static int microread_im_transceive(struct nfc_hci_dev *hdev, hdev 404 drivers/nfc/microread/microread.c struct microread_info *info = nfc_hci_get_clientdata(hdev); hdev 413 drivers/nfc/microread/microread.c return nfc_hci_send_event(hdev, target->hci_reader_gate, hdev 451 drivers/nfc/microread/microread.c return nfc_hci_send_cmd_async(hdev, target->hci_reader_gate, hdev 457 drivers/nfc/microread/microread.c static int microread_tm_send(struct nfc_hci_dev *hdev, struct sk_buff *skb) hdev 461 drivers/nfc/microread/microread.c r = nfc_hci_send_event(hdev, MICROREAD_GATE_ID_P2P_TARGET, hdev 470 drivers/nfc/microread/microread.c static void microread_target_discovered(struct nfc_hci_dev *hdev, u8 gate, hdev 537 drivers/nfc/microread/microread.c r = nfc_targets_found(hdev->ndev, targets, 1); hdev 549 drivers/nfc/microread/microread.c static int microread_event_received(struct nfc_hci_dev *hdev, u8 pipe, hdev 553 drivers/nfc/microread/microread.c u8 gate = hdev->pipes[pipe].gate; hdev 560 drivers/nfc/microread/microread.c microread_target_discovered(hdev, gate, skb); hdev 576 drivers/nfc/microread/microread.c r = nfc_tm_data_received(hdev->ndev, skb); hdev 585 drivers/nfc/microread/microread.c r = nfc_tm_activated(hdev->ndev, NFC_PROTO_NFC_DEP_MASK, hdev 605 drivers/nfc/microread/microread.c r = nfc_tm_data_received(hdev->ndev, skb); hdev 612 drivers/nfc/microread/microread.c r = nfc_hci_set_param(hdev, MICROREAD_GATE_ID_P2P_TARGET, hdev 617 drivers/nfc/microread/microread.c r = nfc_hci_send_event(hdev, gate, hdev 647 drivers/nfc/microread/microread.c struct nfc_hci_dev **hdev) hdev 678 drivers/nfc/microread/microread.c info->hdev = nfc_hci_allocate_device(µread_hci_ops, &init_data, hdev 685 drivers/nfc/microread/microread.c if (!info->hdev) { hdev 691 drivers/nfc/microread/microread.c nfc_hci_set_clientdata(info->hdev, info); hdev 693 drivers/nfc/microread/microread.c r = nfc_hci_register_device(info->hdev); hdev 697 drivers/nfc/microread/microread.c *hdev = info->hdev; hdev 702 drivers/nfc/microread/microread.c nfc_hci_free_device(info->hdev); hdev 712 drivers/nfc/microread/microread.c void microread_remove(struct nfc_hci_dev *hdev) hdev 714 drivers/nfc/microread/microread.c struct microread_info *info = nfc_hci_get_clientdata(hdev); hdev 716 drivers/nfc/microread/microread.c nfc_hci_unregister_device(hdev); hdev 717 drivers/nfc/microread/microread.c nfc_hci_free_device(hdev); hdev 15 drivers/nfc/microread/microread.h struct nfc_hci_dev **hdev); hdev 17 drivers/nfc/microread/microread.h void microread_remove(struct nfc_hci_dev *hdev); hdev 151 drivers/nfc/pn544/i2c.c struct nfc_hci_dev *hdev; hdev 508 drivers/nfc/pn544/i2c.c nfc_hci_recv_frame(phy->hdev, NULL); hdev 515 drivers/nfc/pn544/i2c.c nfc_hci_recv_frame(phy->hdev, skb); hdev 557 drivers/nfc/pn544/i2c.c nfc_fw_download_done(phy->hdev->ndev, phy->firmware_name, (u32) -result); hdev 929 drivers/nfc/pn544/i2c.c pn544_hci_i2c_fw_download, &phy->hdev); hdev 946 drivers/nfc/pn544/i2c.c pn544_hci_remove(phy->hdev); hdev 35 drivers/nfc/pn544/mei.c NULL, &phy->hdev); hdev 51 drivers/nfc/pn544/mei.c pn544_hci_remove(phy->hdev); hdev 114 drivers/nfc/pn544/pn544.c struct nfc_hci_dev *hdev; hdev 127 drivers/nfc/pn544/pn544.c static int pn544_hci_open(struct nfc_hci_dev *hdev) hdev 129 drivers/nfc/pn544/pn544.c struct pn544_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 149 drivers/nfc/pn544/pn544.c static void pn544_hci_close(struct nfc_hci_dev *hdev) hdev 151 drivers/nfc/pn544/pn544.c struct pn544_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 166 drivers/nfc/pn544/pn544.c static int pn544_hci_ready(struct nfc_hci_dev *hdev) hdev 252 drivers/nfc/pn544/pn544.c r = nfc_hci_send_cmd(hdev, PN544_SYS_MGMT_GATE, PN544_WRITE, hdev 273 drivers/nfc/pn544/pn544.c r = nfc_hci_set_param(hdev, NFC_HCI_ADMIN_GATE, hdev 279 drivers/nfc/pn544/pn544.c r = nfc_hci_set_param(hdev, PN544_SYS_MGMT_GATE, hdev 285 drivers/nfc/pn544/pn544.c r = nfc_hci_set_param(hdev, NFC_HCI_RF_READER_A_GATE, hdev 290 drivers/nfc/pn544/pn544.c r = nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, hdev 296 drivers/nfc/pn544/pn544.c r = nfc_hci_set_param(hdev, PN544_POLLING_LOOP_MGMT_GATE, hdev 302 drivers/nfc/pn544/pn544.c r = nfc_hci_set_param(hdev, PN544_POLLING_LOOP_MGMT_GATE, hdev 307 drivers/nfc/pn544/pn544.c r = nfc_hci_get_param(hdev, NFC_HCI_ID_MGMT_GATE, hdev 326 drivers/nfc/pn544/pn544.c static int pn544_hci_xmit(struct nfc_hci_dev *hdev, struct sk_buff *skb) hdev 328 drivers/nfc/pn544/pn544.c struct pn544_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 333 drivers/nfc/pn544/pn544.c static int pn544_hci_start_poll(struct nfc_hci_dev *hdev, hdev 347 drivers/nfc/pn544/pn544.c r = nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, hdev 354 drivers/nfc/pn544/pn544.c r = nfc_hci_set_param(hdev, PN544_POLLING_LOOP_MGMT_GATE, hdev 360 drivers/nfc/pn544/pn544.c r = nfc_hci_set_param(hdev, PN544_POLLING_LOOP_MGMT_GATE, hdev 375 drivers/nfc/pn544/pn544.c r = nfc_hci_set_param(hdev, PN544_POLLING_LOOP_MGMT_GATE, hdev 381 drivers/nfc/pn544/pn544.c hdev->gb = nfc_get_local_general_bytes(hdev->ndev, hdev 382 drivers/nfc/pn544/pn544.c &hdev->gb_len); hdev 383 drivers/nfc/pn544/pn544.c pr_debug("generate local bytes %p\n", hdev->gb); hdev 384 drivers/nfc/pn544/pn544.c if (hdev->gb == NULL || hdev->gb_len == 0) { hdev 391 drivers/nfc/pn544/pn544.c r = nfc_hci_send_event(hdev, hdev 397 drivers/nfc/pn544/pn544.c r = nfc_hci_set_param(hdev, hdev 403 drivers/nfc/pn544/pn544.c r = nfc_hci_set_param(hdev, hdev 405 drivers/nfc/pn544/pn544.c PN544_DEP_ATR_REQ, hdev->gb, hdev->gb_len); hdev 409 drivers/nfc/pn544/pn544.c r = nfc_hci_send_event(hdev, hdev 413 drivers/nfc/pn544/pn544.c nfc_hci_send_event(hdev, hdev 419 drivers/nfc/pn544/pn544.c r = nfc_hci_set_param(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE, hdev 424 drivers/nfc/pn544/pn544.c r = nfc_hci_set_param(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE, hdev 425 drivers/nfc/pn544/pn544.c PN544_DEP_ATR_RES, hdev->gb, hdev->gb_len); hdev 429 drivers/nfc/pn544/pn544.c r = nfc_hci_set_param(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE, hdev 435 drivers/nfc/pn544/pn544.c r = nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, hdev 438 drivers/nfc/pn544/pn544.c nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, hdev 444 drivers/nfc/pn544/pn544.c static int pn544_hci_dep_link_up(struct nfc_hci_dev *hdev, hdev 451 drivers/nfc/pn544/pn544.c r = nfc_hci_get_param(hdev, target->hci_reader_gate, hdev 463 drivers/nfc/pn544/pn544.c r = nfc_set_remote_general_bytes(hdev->ndev, rgb_skb->data, hdev 467 drivers/nfc/pn544/pn544.c r = nfc_dep_link_is_up(hdev->ndev, target->idx, comm_mode, hdev 474 drivers/nfc/pn544/pn544.c static int pn544_hci_dep_link_down(struct nfc_hci_dev *hdev) hdev 477 drivers/nfc/pn544/pn544.c return nfc_hci_send_event(hdev, PN544_RF_READER_NFCIP1_INITIATOR_GATE, hdev 481 drivers/nfc/pn544/pn544.c static int pn544_hci_target_from_gate(struct nfc_hci_dev *hdev, u8 gate, hdev 502 drivers/nfc/pn544/pn544.c static int pn544_hci_complete_target_discovered(struct nfc_hci_dev *hdev, hdev 513 drivers/nfc/pn544/pn544.c r = nfc_hci_send_cmd(hdev, hdev 525 drivers/nfc/pn544/pn544.c r = nfc_hci_send_cmd(hdev, NFC_HCI_RF_READER_A_GATE, hdev 529 drivers/nfc/pn544/pn544.c r = nfc_hci_get_param(hdev, PN544_RF_READER_F_GATE, hdev 542 drivers/nfc/pn544/pn544.c r = nfc_hci_send_cmd(hdev, hdev 553 drivers/nfc/pn544/pn544.c r = nfc_hci_send_cmd(hdev, PN544_RF_READER_F_GATE, hdev 564 drivers/nfc/pn544/pn544.c r = nfc_hci_send_cmd(hdev, NFC_HCI_RF_READER_A_GATE, hdev 603 drivers/nfc/pn544/pn544.c static int pn544_hci_im_transceive(struct nfc_hci_dev *hdev, hdev 608 drivers/nfc/pn544/pn544.c struct pn544_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 633 drivers/nfc/pn544/pn544.c return nfc_hci_send_cmd_async(hdev, hdev 648 drivers/nfc/pn544/pn544.c return nfc_hci_send_cmd_async(hdev, target->hci_reader_gate, hdev 653 drivers/nfc/pn544/pn544.c return nfc_hci_send_cmd_async(hdev, target->hci_reader_gate, hdev 659 drivers/nfc/pn544/pn544.c return nfc_hci_send_event(hdev, target->hci_reader_gate, hdev 667 drivers/nfc/pn544/pn544.c static int pn544_hci_tm_send(struct nfc_hci_dev *hdev, struct sk_buff *skb) hdev 674 drivers/nfc/pn544/pn544.c r = nfc_hci_send_event(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE, hdev 682 drivers/nfc/pn544/pn544.c static int pn544_hci_check_presence(struct nfc_hci_dev *hdev, hdev 688 drivers/nfc/pn544/pn544.c return nfc_hci_send_cmd(hdev, target->hci_reader_gate, hdev 696 drivers/nfc/pn544/pn544.c return nfc_hci_send_cmd(hdev, NFC_HCI_RF_READER_A_GATE, hdev 703 drivers/nfc/pn544/pn544.c return nfc_hci_send_cmd(hdev, target->hci_reader_gate, hdev 716 drivers/nfc/pn544/pn544.c static int pn544_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe, u8 event, hdev 720 drivers/nfc/pn544/pn544.c u8 gate = hdev->pipes[pipe].gate; hdev 727 drivers/nfc/pn544/pn544.c r = nfc_hci_target_discovered(hdev, gate); hdev 729 drivers/nfc/pn544/pn544.c r = nfc_hci_get_param(hdev, gate, PN544_DEP_ATR_REQ, hdev 734 drivers/nfc/pn544/pn544.c r = nfc_tm_activated(hdev->ndev, NFC_PROTO_NFC_DEP_MASK, hdev 744 drivers/nfc/pn544/pn544.c r = nfc_hci_send_event(hdev, gate, NFC_HCI_EVT_END_OPERATION, hdev 760 drivers/nfc/pn544/pn544.c return nfc_tm_data_received(hdev->ndev, skb); hdev 771 drivers/nfc/pn544/pn544.c static int pn544_hci_fw_download(struct nfc_hci_dev *hdev, hdev 774 drivers/nfc/pn544/pn544.c struct pn544_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 779 drivers/nfc/pn544/pn544.c return info->fw_download(info->phy_id, firmware_name, hdev->sw_romlib); hdev 782 drivers/nfc/pn544/pn544.c static int pn544_hci_discover_se(struct nfc_hci_dev *hdev) hdev 789 drivers/nfc/pn544/pn544.c r = nfc_hci_send_cmd(hdev, PN544_SYS_MGMT_GATE, PN544_TEST_SWP, hdev 794 drivers/nfc/pn544/pn544.c nfc_add_se(hdev->ndev, se_idx++, NFC_SE_UICC); hdev 799 drivers/nfc/pn544/pn544.c r = nfc_hci_send_event(hdev, PN544_NFC_WI_MGMT_GATE, hdev 803 drivers/nfc/pn544/pn544.c nfc_add_se(hdev->ndev, se_idx++, NFC_SE_EMBEDDED); hdev 810 drivers/nfc/pn544/pn544.c static int pn544_hci_enable_se(struct nfc_hci_dev *hdev, u32 se_idx) hdev 829 drivers/nfc/pn544/pn544.c se = nfc_find_se(hdev->ndev, se_idx); hdev 834 drivers/nfc/pn544/pn544.c r = nfc_hci_send_cmd(hdev, PN544_SYS_MGMT_GATE, hdev 854 drivers/nfc/pn544/pn544.c return nfc_hci_set_param(hdev, PN544_SWP_MGMT_GATE, hdev 857 drivers/nfc/pn544/pn544.c return nfc_hci_set_param(hdev, PN544_NFC_WI_MGMT_GATE, hdev 865 drivers/nfc/pn544/pn544.c static int pn544_hci_disable_se(struct nfc_hci_dev *hdev, u32 se_idx) hdev 870 drivers/nfc/pn544/pn544.c se = nfc_find_se(hdev->ndev, se_idx); hdev 874 drivers/nfc/pn544/pn544.c return nfc_hci_set_param(hdev, PN544_SWP_MGMT_GATE, hdev 877 drivers/nfc/pn544/pn544.c return nfc_hci_set_param(hdev, PN544_NFC_WI_MGMT_GATE, hdev 906 drivers/nfc/pn544/pn544.c fw_download_t fw_download, struct nfc_hci_dev **hdev) hdev 942 drivers/nfc/pn544/pn544.c info->hdev = nfc_hci_allocate_device(&pn544_hci_ops, &init_data, 0, hdev 946 drivers/nfc/pn544/pn544.c if (!info->hdev) { hdev 952 drivers/nfc/pn544/pn544.c nfc_hci_set_clientdata(info->hdev, info); hdev 954 drivers/nfc/pn544/pn544.c r = nfc_hci_register_device(info->hdev); hdev 958 drivers/nfc/pn544/pn544.c *hdev = info->hdev; hdev 963 drivers/nfc/pn544/pn544.c nfc_hci_free_device(info->hdev); hdev 973 drivers/nfc/pn544/pn544.c void pn544_hci_remove(struct nfc_hci_dev *hdev) hdev 975 drivers/nfc/pn544/pn544.c struct pn544_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 977 drivers/nfc/pn544/pn544.c nfc_hci_unregister_device(hdev); hdev 978 drivers/nfc/pn544/pn544.c nfc_hci_free_device(hdev); hdev 21 drivers/nfc/pn544/pn544.h fw_download_t fw_download, struct nfc_hci_dev **hdev); hdev 22 drivers/nfc/pn544/pn544.h void pn544_hci_remove(struct nfc_hci_dev *hdev); hdev 105 drivers/nfc/st21nfca/core.c static int st21nfca_hci_load_session(struct nfc_hci_dev *hdev) hdev 135 drivers/nfc/st21nfca/core.c r = nfc_hci_connect_gate(hdev, NFC_HCI_HOST_CONTROLLER_ID, hdev 142 drivers/nfc/st21nfca/core.c r = nfc_hci_send_cmd(hdev, ST21NFCA_DEVICE_MGNT_GATE, hdev 151 drivers/nfc/st21nfca/core.c r = nfc_hci_send_cmd(hdev, ST21NFCA_DEVICE_MGNT_GATE, hdev 182 drivers/nfc/st21nfca/core.c hdev->init_data.gates[j].pipe = pipe_info[2]; hdev 184 drivers/nfc/st21nfca/core.c hdev->gate2pipe[st21nfca_gates[j].gate] = hdev 186 drivers/nfc/st21nfca/core.c hdev->pipes[pipe_info[2]].gate = hdev 188 drivers/nfc/st21nfca/core.c hdev->pipes[pipe_info[2]].dest_host = hdev 198 drivers/nfc/st21nfca/core.c r = nfc_hci_connect_gate(hdev, NFC_HCI_HOST_CONTROLLER_ID, hdev 206 drivers/nfc/st21nfca/core.c static int st21nfca_hci_open(struct nfc_hci_dev *hdev) hdev 208 drivers/nfc/st21nfca/core.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 228 drivers/nfc/st21nfca/core.c static void st21nfca_hci_close(struct nfc_hci_dev *hdev) hdev 230 drivers/nfc/st21nfca/core.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 244 drivers/nfc/st21nfca/core.c static int st21nfca_hci_ready(struct nfc_hci_dev *hdev) hdev 246 drivers/nfc/st21nfca/core.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 260 drivers/nfc/st21nfca/core.c r = nfc_hci_set_param(hdev, NFC_HCI_ADMIN_GATE, hdev 268 drivers/nfc/st21nfca/core.c r = nfc_hci_get_param(hdev, ST21NFCA_DEVICE_MGNT_GATE, hdev 278 drivers/nfc/st21nfca/core.c r = nfc_hci_set_param(hdev, ST21NFCA_DEVICE_MGNT_GATE, hdev 284 drivers/nfc/st21nfca/core.c r = nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, hdev 289 drivers/nfc/st21nfca/core.c r = nfc_hci_get_param(hdev, NFC_HCI_ID_MGMT_GATE, hdev 308 drivers/nfc/st21nfca/core.c static int st21nfca_hci_xmit(struct nfc_hci_dev *hdev, struct sk_buff *skb) hdev 310 drivers/nfc/st21nfca/core.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 315 drivers/nfc/st21nfca/core.c static int st21nfca_hci_start_poll(struct nfc_hci_dev *hdev, hdev 326 drivers/nfc/st21nfca/core.c r = nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, hdev 336 drivers/nfc/st21nfca/core.c r = nfc_hci_disconnect_gate(hdev, hdev 343 drivers/nfc/st21nfca/core.c r = nfc_hci_disconnect_gate(hdev, hdev 350 drivers/nfc/st21nfca/core.c r = nfc_hci_disconnect_gate(hdev, hdev 355 drivers/nfc/st21nfca/core.c hdev->gb = nfc_get_local_general_bytes(hdev->ndev, hdev 356 drivers/nfc/st21nfca/core.c &hdev->gb_len); hdev 358 drivers/nfc/st21nfca/core.c if (hdev->gb == NULL || hdev->gb_len == 0) { hdev 366 drivers/nfc/st21nfca/core.c r = nfc_hci_set_param(hdev, ST21NFCA_RF_READER_F_GATE, hdev 374 drivers/nfc/st21nfca/core.c r = nfc_hci_set_param(hdev, ST21NFCA_RF_READER_F_GATE, hdev 382 drivers/nfc/st21nfca/core.c r = nfc_hci_disconnect_gate(hdev, hdev 389 drivers/nfc/st21nfca/core.c r = nfc_hci_disconnect_gate(hdev, hdev 395 drivers/nfc/st21nfca/core.c r = nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, hdev 398 drivers/nfc/st21nfca/core.c nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, hdev 403 drivers/nfc/st21nfca/core.c r = nfc_hci_get_param(hdev, ST21NFCA_RF_CARD_F_GATE, hdev 414 drivers/nfc/st21nfca/core.c r = nfc_hci_set_param(hdev, ST21NFCA_RF_CARD_F_GATE, hdev 432 drivers/nfc/st21nfca/core.c r = nfc_hci_set_param(hdev, ST21NFCA_RF_CARD_F_GATE, hdev 445 drivers/nfc/st21nfca/core.c r = nfc_hci_set_param(hdev, ST21NFCA_RF_CARD_F_GATE, hdev 451 drivers/nfc/st21nfca/core.c r = nfc_hci_set_param(hdev, ST21NFCA_RF_CARD_F_GATE, hdev 482 drivers/nfc/st21nfca/core.c r = nfc_hci_set_param(hdev, ST21NFCA_RF_CARD_F_GATE, hdev 489 drivers/nfc/st21nfca/core.c r = nfc_hci_set_param(hdev, ST21NFCA_RF_CARD_F_GATE, hdev 496 drivers/nfc/st21nfca/core.c static void st21nfca_hci_stop_poll(struct nfc_hci_dev *hdev) hdev 498 drivers/nfc/st21nfca/core.c nfc_hci_send_cmd(hdev, ST21NFCA_DEVICE_MGNT_GATE, hdev 502 drivers/nfc/st21nfca/core.c static int st21nfca_get_iso14443_3_atqa(struct nfc_hci_dev *hdev, u16 *atqa) hdev 507 drivers/nfc/st21nfca/core.c r = nfc_hci_get_param(hdev, ST21NFCA_RF_READER_14443_3_A_GATE, hdev 524 drivers/nfc/st21nfca/core.c static int st21nfca_get_iso14443_3_sak(struct nfc_hci_dev *hdev, u8 *sak) hdev 529 drivers/nfc/st21nfca/core.c r = nfc_hci_get_param(hdev, ST21NFCA_RF_READER_14443_3_A_GATE, hdev 546 drivers/nfc/st21nfca/core.c static int st21nfca_get_iso14443_3_uid(struct nfc_hci_dev *hdev, u8 *uid, hdev 552 drivers/nfc/st21nfca/core.c r = nfc_hci_get_param(hdev, ST21NFCA_RF_READER_14443_3_A_GATE, hdev 569 drivers/nfc/st21nfca/core.c static int st21nfca_get_iso15693_inventory(struct nfc_hci_dev *hdev, hdev 575 drivers/nfc/st21nfca/core.c r = nfc_hci_get_param(hdev, ST21NFCA_RF_READER_ISO15693_GATE, hdev 597 drivers/nfc/st21nfca/core.c static int st21nfca_hci_dep_link_up(struct nfc_hci_dev *hdev, hdev 601 drivers/nfc/st21nfca/core.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 604 drivers/nfc/st21nfca/core.c return st21nfca_im_send_atr_req(hdev, gb, gb_len); hdev 607 drivers/nfc/st21nfca/core.c static int st21nfca_hci_dep_link_down(struct nfc_hci_dev *hdev) hdev 609 drivers/nfc/st21nfca/core.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 613 drivers/nfc/st21nfca/core.c return nfc_hci_send_cmd(hdev, ST21NFCA_DEVICE_MGNT_GATE, hdev 617 drivers/nfc/st21nfca/core.c static int st21nfca_hci_target_from_gate(struct nfc_hci_dev *hdev, u8 gate, hdev 631 drivers/nfc/st21nfca/core.c r = st21nfca_get_iso14443_3_atqa(hdev, &atqa); hdev 638 drivers/nfc/st21nfca/core.c r = st21nfca_get_iso14443_3_sak(hdev, &sak); hdev 642 drivers/nfc/st21nfca/core.c r = st21nfca_get_iso14443_3_uid(hdev, uid, &len); hdev 660 drivers/nfc/st21nfca/core.c r = st21nfca_get_iso15693_inventory(hdev, target); hdev 671 drivers/nfc/st21nfca/core.c static int st21nfca_hci_complete_target_discovered(struct nfc_hci_dev *hdev, hdev 679 drivers/nfc/st21nfca/core.c r = nfc_hci_get_param(hdev, ST21NFCA_RF_READER_F_GATE, hdev 713 drivers/nfc/st21nfca/core.c r = nfc_hci_get_param(hdev, ST21NFCA_RF_READER_F_GATE, hdev 760 drivers/nfc/st21nfca/core.c static int st21nfca_hci_im_transceive(struct nfc_hci_dev *hdev, hdev 765 drivers/nfc/st21nfca/core.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 773 drivers/nfc/st21nfca/core.c return st21nfca_im_send_dep_req(hdev, skb); hdev 776 drivers/nfc/st21nfca/core.c return nfc_hci_send_cmd_async(hdev, target->hci_reader_gate, hdev 782 drivers/nfc/st21nfca/core.c return nfc_hci_send_cmd_async(hdev, target->hci_reader_gate, hdev 792 drivers/nfc/st21nfca/core.c return nfc_hci_send_cmd_async(hdev, target->hci_reader_gate, hdev 803 drivers/nfc/st21nfca/core.c static int st21nfca_hci_tm_send(struct nfc_hci_dev *hdev, struct sk_buff *skb) hdev 805 drivers/nfc/st21nfca/core.c return st21nfca_tm_send_dep_res(hdev, skb); hdev 808 drivers/nfc/st21nfca/core.c static int st21nfca_hci_check_presence(struct nfc_hci_dev *hdev, hdev 823 drivers/nfc/st21nfca/core.c return nfc_hci_send_cmd(hdev, target->hci_reader_gate, hdev 826 drivers/nfc/st21nfca/core.c return nfc_hci_send_cmd(hdev, target->hci_reader_gate, hdev 834 drivers/nfc/st21nfca/core.c static void st21nfca_hci_cmd_received(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd, hdev 837 drivers/nfc/st21nfca/core.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 838 drivers/nfc/st21nfca/core.c u8 gate = hdev->pipes[pipe].gate; hdev 845 drivers/nfc/st21nfca/core.c hdev->pipes[pipe].dest_host != NFC_HCI_UICC_HOST_ID) hdev 858 drivers/nfc/st21nfca/core.c static int st21nfca_admin_event_received(struct nfc_hci_dev *hdev, u8 event, hdev 861 drivers/nfc/st21nfca/core.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 880 drivers/nfc/st21nfca/core.c nfc_err(&hdev->ndev->dev, "Unexpected event on admin gate\n"); hdev 891 drivers/nfc/st21nfca/core.c static int st21nfca_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe, hdev 894 drivers/nfc/st21nfca/core.c u8 gate = hdev->pipes[pipe].gate; hdev 895 drivers/nfc/st21nfca/core.c u8 host = hdev->pipes[pipe].dest_host; hdev 901 drivers/nfc/st21nfca/core.c return st21nfca_admin_event_received(hdev, event, skb); hdev 903 drivers/nfc/st21nfca/core.c return st21nfca_dep_event_received(hdev, event, skb); hdev 905 drivers/nfc/st21nfca/core.c return st21nfca_connectivity_event_received(hdev, host, hdev 908 drivers/nfc/st21nfca/core.c return st21nfca_apdu_reader_event_received(hdev, event, skb); hdev 910 drivers/nfc/st21nfca/core.c return st21nfca_hci_loopback_event_received(hdev, event, skb); hdev 941 drivers/nfc/st21nfca/core.c int phy_payload, struct nfc_hci_dev **hdev, hdev 989 drivers/nfc/st21nfca/core.c info->hdev = hdev 995 drivers/nfc/st21nfca/core.c if (!info->hdev) { hdev 1003 drivers/nfc/st21nfca/core.c nfc_hci_set_clientdata(info->hdev, info); hdev 1005 drivers/nfc/st21nfca/core.c r = nfc_hci_register_device(info->hdev); hdev 1009 drivers/nfc/st21nfca/core.c *hdev = info->hdev; hdev 1010 drivers/nfc/st21nfca/core.c st21nfca_dep_init(info->hdev); hdev 1011 drivers/nfc/st21nfca/core.c st21nfca_se_init(info->hdev); hdev 1012 drivers/nfc/st21nfca/core.c st21nfca_vendor_cmds_init(info->hdev); hdev 1017 drivers/nfc/st21nfca/core.c nfc_hci_free_device(info->hdev); hdev 1026 drivers/nfc/st21nfca/core.c void st21nfca_hci_remove(struct nfc_hci_dev *hdev) hdev 1028 drivers/nfc/st21nfca/core.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 1030 drivers/nfc/st21nfca/core.c st21nfca_dep_deinit(hdev); hdev 1031 drivers/nfc/st21nfca/core.c st21nfca_se_deinit(hdev); hdev 1032 drivers/nfc/st21nfca/core.c nfc_hci_unregister_device(hdev); hdev 1033 drivers/nfc/st21nfca/core.c nfc_hci_free_device(hdev); hdev 120 drivers/nfc/st21nfca/dep.c dev = info->hdev->ndev; hdev 125 drivers/nfc/st21nfca/dep.c nfc_hci_send_cmd_async(info->hdev, ST21NFCA_RF_READER_F_GATE, hdev 140 drivers/nfc/st21nfca/dep.c static int st21nfca_tm_send_atr_res(struct nfc_hci_dev *hdev, hdev 147 drivers/nfc/st21nfca/dep.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 174 drivers/nfc/st21nfca/dep.c r = nfc_set_remote_general_bytes(hdev->ndev, atr_res->gbi, hdev 184 drivers/nfc/st21nfca/dep.c r = nfc_hci_send_event(hdev, ST21NFCA_RF_CARD_F_GATE, hdev 190 drivers/nfc/st21nfca/dep.c static int st21nfca_tm_recv_atr_req(struct nfc_hci_dev *hdev, hdev 216 drivers/nfc/st21nfca/dep.c r = st21nfca_tm_send_atr_res(hdev, atr_req); hdev 222 drivers/nfc/st21nfca/dep.c r = nfc_tm_activated(hdev->ndev, NFC_PROTO_NFC_DEP_MASK, hdev 233 drivers/nfc/st21nfca/dep.c static int st21nfca_tm_send_psl_res(struct nfc_hci_dev *hdev, hdev 253 drivers/nfc/st21nfca/dep.c r = nfc_hci_send_event(hdev, ST21NFCA_RF_CARD_F_GATE, hdev 272 drivers/nfc/st21nfca/dep.c r = nfc_hci_send_event(hdev, ST21NFCA_RF_CARD_F_GATE, hdev 279 drivers/nfc/st21nfca/dep.c static int st21nfca_tm_recv_psl_req(struct nfc_hci_dev *hdev, hdev 299 drivers/nfc/st21nfca/dep.c r = st21nfca_tm_send_psl_res(hdev, psl_req); hdev 304 drivers/nfc/st21nfca/dep.c int st21nfca_tm_send_dep_res(struct nfc_hci_dev *hdev, struct sk_buff *skb) hdev 307 drivers/nfc/st21nfca/dep.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 314 drivers/nfc/st21nfca/dep.c r = nfc_hci_send_event(hdev, ST21NFCA_RF_CARD_F_GATE, hdev 322 drivers/nfc/st21nfca/dep.c static int st21nfca_tm_recv_dep_req(struct nfc_hci_dev *hdev, hdev 328 drivers/nfc/st21nfca/dep.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 366 drivers/nfc/st21nfca/dep.c return nfc_tm_data_received(hdev->ndev, skb); hdev 371 drivers/nfc/st21nfca/dep.c static int st21nfca_tm_event_send_data(struct nfc_hci_dev *hdev, hdev 383 drivers/nfc/st21nfca/dep.c r = st21nfca_tm_recv_atr_req(hdev, skb); hdev 386 drivers/nfc/st21nfca/dep.c r = st21nfca_tm_recv_psl_req(hdev, skb); hdev 389 drivers/nfc/st21nfca/dep.c r = st21nfca_tm_recv_dep_req(hdev, skb); hdev 406 drivers/nfc/st21nfca/dep.c int st21nfca_dep_event_received(struct nfc_hci_dev *hdev, hdev 410 drivers/nfc/st21nfca/dep.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 425 drivers/nfc/st21nfca/dep.c r = st21nfca_tm_event_send_data(hdev, skb); hdev 430 drivers/nfc/st21nfca/dep.c nfc_err(&hdev->ndev->dev, "Unexpected event on card f gate\n"); hdev 438 drivers/nfc/st21nfca/dep.c static void st21nfca_im_send_psl_req(struct nfc_hci_dev *hdev, u8 did, u8 bsi, hdev 443 drivers/nfc/st21nfca/dep.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 484 drivers/nfc/st21nfca/dep.c r = nfc_set_remote_general_bytes(info->hdev->ndev, hdev 497 drivers/nfc/st21nfca/dep.c r = nfc_dep_link_is_up(info->hdev->ndev, info->dep_info.idx, hdev 504 drivers/nfc/st21nfca/dep.c st21nfca_im_send_psl_req(info->hdev, atr_res->did, hdev 514 drivers/nfc/st21nfca/dep.c int st21nfca_im_send_atr_req(struct nfc_hci_dev *hdev, u8 *gb, size_t gb_len) hdev 517 drivers/nfc/st21nfca/dep.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 544 drivers/nfc/st21nfca/dep.c target = hdev->ndev->targets; hdev 561 drivers/nfc/st21nfca/dep.c atr_req->length = sizeof(struct st21nfca_atr_req) + hdev->gb_len; hdev 572 drivers/nfc/st21nfca/dep.c return nfc_hci_send_cmd_async(hdev, ST21NFCA_RF_READER_F_GATE, hdev 620 drivers/nfc/st21nfca/dep.c nfc_tm_data_received(info->hdev->ndev, skb); hdev 643 drivers/nfc/st21nfca/dep.c int st21nfca_im_send_dep_req(struct nfc_hci_dev *hdev, struct sk_buff *skb) hdev 645 drivers/nfc/st21nfca/dep.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 658 drivers/nfc/st21nfca/dep.c return nfc_hci_send_cmd_async(hdev, ST21NFCA_RF_READER_F_GATE, hdev 665 drivers/nfc/st21nfca/dep.c void st21nfca_dep_init(struct nfc_hci_dev *hdev) hdev 667 drivers/nfc/st21nfca/dep.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 676 drivers/nfc/st21nfca/dep.c void st21nfca_dep_deinit(struct nfc_hci_dev *hdev) hdev 678 drivers/nfc/st21nfca/dep.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 55 drivers/nfc/st21nfca/i2c.c struct nfc_hci_dev *hdev; hdev 445 drivers/nfc/st21nfca/i2c.c nfc_hci_recv_frame(phy->hdev, NULL); hdev 470 drivers/nfc/st21nfca/i2c.c nfc_hci_recv_frame(phy->hdev, phy->pending_skb); hdev 479 drivers/nfc/st21nfca/i2c.c nfc_hci_recv_frame(phy->hdev, NULL); hdev 563 drivers/nfc/st21nfca/i2c.c &phy->hdev, hdev 573 drivers/nfc/st21nfca/i2c.c st21nfca_hci_remove(phy->hdev); hdev 48 drivers/nfc/st21nfca/se.c static u8 st21nfca_se_get_bwi(struct nfc_hci_dev *hdev) hdev 52 drivers/nfc/st21nfca/se.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 67 drivers/nfc/st21nfca/se.c static void st21nfca_se_get_atr(struct nfc_hci_dev *hdev) hdev 71 drivers/nfc/st21nfca/se.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 73 drivers/nfc/st21nfca/se.c r = nfc_hci_get_param(hdev, ST21NFCA_APDU_READER_GATE, hdev 81 drivers/nfc/st21nfca/se.c ST21NFCA_BWI_TO_TIMEOUT(st21nfca_se_get_bwi(hdev)); hdev 86 drivers/nfc/st21nfca/se.c static int st21nfca_hci_control_se(struct nfc_hci_dev *hdev, u32 se_idx, hdev 89 drivers/nfc/st21nfca/se.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 120 drivers/nfc/st21nfca/se.c r = nfc_hci_send_event(hdev, ST21NFCA_DEVICE_MGNT_GATE, se_event, hdev 132 drivers/nfc/st21nfca/se.c r = nfc_hci_get_param(hdev, NFC_HCI_ADMIN_GATE, hdev 152 drivers/nfc/st21nfca/se.c int st21nfca_hci_discover_se(struct nfc_hci_dev *hdev) hdev 154 drivers/nfc/st21nfca/se.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 157 drivers/nfc/st21nfca/se.c if (test_bit(ST21NFCA_FACTORY_MODE, &hdev->quirks)) hdev 161 drivers/nfc/st21nfca/se.c nfc_add_se(hdev->ndev, NFC_HCI_UICC_HOST_ID, NFC_SE_UICC); hdev 166 drivers/nfc/st21nfca/se.c nfc_add_se(hdev->ndev, ST21NFCA_ESE_HOST_ID, NFC_SE_EMBEDDED); hdev 174 drivers/nfc/st21nfca/se.c int st21nfca_hci_enable_se(struct nfc_hci_dev *hdev, u32 se_idx) hdev 183 drivers/nfc/st21nfca/se.c r = st21nfca_hci_control_se(hdev, se_idx, ST21NFCA_SE_MODE_ON); hdev 185 drivers/nfc/st21nfca/se.c st21nfca_se_get_atr(hdev); hdev 186 drivers/nfc/st21nfca/se.c r = nfc_hci_send_event(hdev, ST21NFCA_APDU_READER_GATE, hdev 195 drivers/nfc/st21nfca/se.c nfc_remove_se(hdev->ndev, se_idx); hdev 203 drivers/nfc/st21nfca/se.c int st21nfca_hci_disable_se(struct nfc_hci_dev *hdev, u32 se_idx) hdev 212 drivers/nfc/st21nfca/se.c r = st21nfca_hci_control_se(hdev, se_idx, ST21NFCA_SE_MODE_OFF); hdev 220 drivers/nfc/st21nfca/se.c int st21nfca_hci_se_io(struct nfc_hci_dev *hdev, u32 se_idx, hdev 224 drivers/nfc/st21nfca/se.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 235 drivers/nfc/st21nfca/se.c return nfc_hci_send_event(hdev, ST21NFCA_APDU_READER_GATE, hdev 266 drivers/nfc/st21nfca/se.c nfc_hci_send_event(info->hdev, ST21NFCA_APDU_READER_GATE, hdev 270 drivers/nfc/st21nfca/se.c nfc_hci_send_event(info->hdev, ST21NFCA_DEVICE_MGNT_GATE, hdev 293 drivers/nfc/st21nfca/se.c int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, hdev 297 drivers/nfc/st21nfca/se.c struct device *dev = &hdev->ndev->dev; hdev 304 drivers/nfc/st21nfca/se.c r = nfc_se_connectivity(hdev->ndev, host); hdev 336 drivers/nfc/st21nfca/se.c r = nfc_se_transaction(hdev->ndev, host, transaction); hdev 339 drivers/nfc/st21nfca/se.c nfc_err(&hdev->ndev->dev, "Unexpected event on connectivity gate\n"); hdev 347 drivers/nfc/st21nfca/se.c int st21nfca_apdu_reader_event_received(struct nfc_hci_dev *hdev, hdev 351 drivers/nfc/st21nfca/se.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 359 drivers/nfc/st21nfca/se.c r = nfc_hci_send_event(hdev, ST21NFCA_DEVICE_MGNT_GATE, hdev 372 drivers/nfc/st21nfca/se.c nfc_err(&hdev->ndev->dev, "Unexpected event on apdu reader gate\n"); hdev 382 drivers/nfc/st21nfca/se.c void st21nfca_se_init(struct nfc_hci_dev *hdev) hdev 384 drivers/nfc/st21nfca/se.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 405 drivers/nfc/st21nfca/se.c void st21nfca_se_deinit(struct nfc_hci_dev *hdev) hdev 407 drivers/nfc/st21nfca/se.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 150 drivers/nfc/st21nfca/st21nfca.h struct nfc_hci_dev *hdev; hdev 168 drivers/nfc/st21nfca/st21nfca.h int phy_payload, struct nfc_hci_dev **hdev, hdev 170 drivers/nfc/st21nfca/st21nfca.h void st21nfca_hci_remove(struct nfc_hci_dev *hdev); hdev 172 drivers/nfc/st21nfca/st21nfca.h int st21nfca_dep_event_received(struct nfc_hci_dev *hdev, hdev 174 drivers/nfc/st21nfca/st21nfca.h int st21nfca_tm_send_dep_res(struct nfc_hci_dev *hdev, struct sk_buff *skb); hdev 176 drivers/nfc/st21nfca/st21nfca.h int st21nfca_im_send_atr_req(struct nfc_hci_dev *hdev, u8 *gb, size_t gb_len); hdev 177 drivers/nfc/st21nfca/st21nfca.h int st21nfca_im_send_dep_req(struct nfc_hci_dev *hdev, struct sk_buff *skb); hdev 178 drivers/nfc/st21nfca/st21nfca.h void st21nfca_dep_init(struct nfc_hci_dev *hdev); hdev 179 drivers/nfc/st21nfca/st21nfca.h void st21nfca_dep_deinit(struct nfc_hci_dev *hdev); hdev 181 drivers/nfc/st21nfca/st21nfca.h int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, hdev 183 drivers/nfc/st21nfca/st21nfca.h int st21nfca_apdu_reader_event_received(struct nfc_hci_dev *hdev, hdev 186 drivers/nfc/st21nfca/st21nfca.h int st21nfca_hci_discover_se(struct nfc_hci_dev *hdev); hdev 187 drivers/nfc/st21nfca/st21nfca.h int st21nfca_hci_enable_se(struct nfc_hci_dev *hdev, u32 se_idx); hdev 188 drivers/nfc/st21nfca/st21nfca.h int st21nfca_hci_disable_se(struct nfc_hci_dev *hdev, u32 se_idx); hdev 189 drivers/nfc/st21nfca/st21nfca.h int st21nfca_hci_se_io(struct nfc_hci_dev *hdev, u32 se_idx, hdev 193 drivers/nfc/st21nfca/st21nfca.h void st21nfca_se_init(struct nfc_hci_dev *hdev); hdev 194 drivers/nfc/st21nfca/st21nfca.h void st21nfca_se_deinit(struct nfc_hci_dev *hdev); hdev 38 drivers/nfc/st21nfca/vendor_cmds.c struct nfc_hci_dev *hdev = nfc_get_drvdata(dev); hdev 47 drivers/nfc/st21nfca/vendor_cmds.c test_and_set_bit(ST21NFCA_FACTORY_MODE, &hdev->quirks); hdev 50 drivers/nfc/st21nfca/vendor_cmds.c clear_bit(ST21NFCA_FACTORY_MODE, &hdev->quirks); hdev 62 drivers/nfc/st21nfca/vendor_cmds.c struct nfc_hci_dev *hdev = nfc_get_drvdata(dev); hdev 64 drivers/nfc/st21nfca/vendor_cmds.c return nfc_hci_disconnect_all_gates(hdev); hdev 70 drivers/nfc/st21nfca/vendor_cmds.c struct nfc_hci_dev *hdev = nfc_get_drvdata(dev); hdev 72 drivers/nfc/st21nfca/vendor_cmds.c return nfc_hci_send_cmd(hdev, ST21NFCA_DEVICE_MGNT_GATE, hdev 80 drivers/nfc/st21nfca/vendor_cmds.c struct nfc_hci_dev *hdev = nfc_get_drvdata(dev); hdev 82 drivers/nfc/st21nfca/vendor_cmds.c return nfc_hci_send_cmd(hdev, ST21NFCA_DEVICE_MGNT_GATE, hdev 91 drivers/nfc/st21nfca/vendor_cmds.c struct nfc_hci_dev *hdev = nfc_get_drvdata(dev); hdev 93 drivers/nfc/st21nfca/vendor_cmds.c r = nfc_hci_send_cmd(hdev, hdev 126 drivers/nfc/st21nfca/vendor_cmds.c struct nfc_hci_dev *hdev = nfc_get_drvdata(dev); hdev 128 drivers/nfc/st21nfca/vendor_cmds.c r = nfc_hci_send_cmd(hdev, hdev 159 drivers/nfc/st21nfca/vendor_cmds.c struct nfc_hci_dev *hdev = nfc_get_drvdata(dev); hdev 161 drivers/nfc/st21nfca/vendor_cmds.c return nfc_hci_send_cmd(hdev, ST21NFCA_DEVICE_MGNT_GATE, hdev 169 drivers/nfc/st21nfca/vendor_cmds.c struct nfc_hci_dev *hdev = nfc_get_drvdata(dev); hdev 171 drivers/nfc/st21nfca/vendor_cmds.c r = nfc_hci_send_cmd_async(hdev, ST21NFCA_DEVICE_MGNT_GATE, hdev 176 drivers/nfc/st21nfca/vendor_cmds.c r = nfc_llc_stop(hdev->llc); hdev 180 drivers/nfc/st21nfca/vendor_cmds.c return nfc_llc_start(hdev->llc); hdev 188 drivers/nfc/st21nfca/vendor_cmds.c struct nfc_hci_dev *hdev = nfc_get_drvdata(dev); hdev 194 drivers/nfc/st21nfca/vendor_cmds.c r = nfc_hci_get_param(hdev, param->gate, param->data, &skb); hdev 222 drivers/nfc/st21nfca/vendor_cmds.c struct nfc_hci_dev *hdev = nfc_get_drvdata(dev); hdev 224 drivers/nfc/st21nfca/vendor_cmds.c return nfc_hci_send_cmd(hdev, hdev 230 drivers/nfc/st21nfca/vendor_cmds.c int st21nfca_hci_loopback_event_received(struct nfc_hci_dev *hdev, u8 event, hdev 233 drivers/nfc/st21nfca/vendor_cmds.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 240 drivers/nfc/st21nfca/vendor_cmds.c nfc_err(&hdev->ndev->dev, "Unexpected event on loopback gate\n"); hdev 252 drivers/nfc/st21nfca/vendor_cmds.c struct nfc_hci_dev *hdev = nfc_get_drvdata(dev); hdev 253 drivers/nfc/st21nfca/vendor_cmds.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 261 drivers/nfc/st21nfca/vendor_cmds.c r = nfc_hci_send_event(hdev, NFC_HCI_LOOPBACK_GATE, hdev 275 drivers/nfc/st21nfca/vendor_cmds.c msg = nfc_vendor_cmd_alloc_reply_skb(hdev->ndev, hdev 356 drivers/nfc/st21nfca/vendor_cmds.c int st21nfca_vendor_cmds_init(struct nfc_hci_dev *hdev) hdev 358 drivers/nfc/st21nfca/vendor_cmds.c struct st21nfca_hci_info *info = nfc_hci_get_clientdata(hdev); hdev 361 drivers/nfc/st21nfca/vendor_cmds.c return nfc_set_vendor_cmds(hdev->ndev, st21nfca_vendor_cmds, hdev 466 drivers/pci/controller/pci-hyperv.c struct hv_device *hdev; hdev 596 drivers/pci/controller/pci-hyperv.c static int wait_for_response(struct hv_device *hdev, hdev 600 drivers/pci/controller/pci-hyperv.c if (hdev->channel->rescind) { hdev 601 drivers/pci/controller/pci-hyperv.c dev_warn_once(&hdev->device, "The device is gone.\n"); hdev 718 drivers/pci/controller/pci-hyperv.c dev_err(&hpdev->hbus->hdev->device, hdev 789 drivers/pci/controller/pci-hyperv.c dev_err(&hpdev->hbus->hdev->device, hdev 963 drivers/pci/controller/pci-hyperv.c ret = vmbus_sendpacket(hbus->hdev->channel, read_blk, hdev 970 drivers/pci/controller/pci-hyperv.c ret = wait_for_response(hbus->hdev, &comp_pkt.comp_pkt.host_event); hdev 976 drivers/pci/controller/pci-hyperv.c dev_err(&hbus->hdev->device, hdev 1053 drivers/pci/controller/pci-hyperv.c ret = vmbus_sendpacket(hbus->hdev->channel, write_blk, pkt_size, hdev 1059 drivers/pci/controller/pci-hyperv.c ret = wait_for_response(hbus->hdev, &comp_pkt.host_event); hdev 1064 drivers/pci/controller/pci-hyperv.c dev_err(&hbus->hdev->device, hdev 1119 drivers/pci/controller/pci-hyperv.c vmbus_sendpacket(hpdev->hbus->hdev->channel, int_pkt, sizeof(*int_pkt), hdev 1213 drivers/pci/controller/pci-hyperv.c params->device_id = (hbus->hdev->dev_instance.b[5] << 24) | hdev 1214 drivers/pci/controller/pci-hyperv.c (hbus->hdev->dev_instance.b[4] << 16) | hdev 1215 drivers/pci/controller/pci-hyperv.c (hbus->hdev->dev_instance.b[7] << 8) | hdev 1216 drivers/pci/controller/pci-hyperv.c (hbus->hdev->dev_instance.b[6] & 0xf8) | hdev 1272 drivers/pci/controller/pci-hyperv.c dev_err(&hbus->hdev->device, hdev 1417 drivers/pci/controller/pci-hyperv.c dev_err(&hbus->hdev->device, hdev 1422 drivers/pci/controller/pci-hyperv.c ret = vmbus_sendpacket(hpdev->hbus->hdev->channel, &ctxt.int_pkts, hdev 1427 drivers/pci/controller/pci-hyperv.c dev_err(&hbus->hdev->device, hdev 1440 drivers/pci/controller/pci-hyperv.c dev_err_once(&hbus->hdev->device, hdev 1456 drivers/pci/controller/pci-hyperv.c if (hbus->hdev->channel->target_cpu == smp_processor_id()) hdev 1462 drivers/pci/controller/pci-hyperv.c dev_err_once(&hbus->hdev->device, hdev 1471 drivers/pci/controller/pci-hyperv.c dev_err(&hbus->hdev->device, hdev 1553 drivers/pci/controller/pci-hyperv.c dev_err(&hbus->hdev->device, hdev 1615 drivers/pci/controller/pci-hyperv.c dev_err(&hbus->hdev->device, hdev 1796 drivers/pci/controller/pci-hyperv.c hbus->pci_bus = pci_create_root_bus(&hbus->hdev->device, hdev 1805 drivers/pci/controller/pci-hyperv.c hbus->pci_bus->msi->dev = &hbus->hdev->device; hdev 1840 drivers/pci/controller/pci-hyperv.c dev_err(&completion->hpdev->hbus->hdev->device, hdev 1892 drivers/pci/controller/pci-hyperv.c ret = vmbus_sendpacket(hbus->hdev->channel, res_req, hdev 1900 drivers/pci/controller/pci-hyperv.c if (wait_for_response(hbus->hdev, &comp_pkt.host_event)) hdev 2037 drivers/pci/controller/pci-hyperv.c dev_err(&hbus->hdev->device, hdev 2202 drivers/pci/controller/pci-hyperv.c vmbus_sendpacket(hbus->hdev->channel, ejct_pkt, hdev 2263 drivers/pci/controller/pci-hyperv.c ret = vmbus_recvpacket_raw(hbus->hdev->channel, buffer, hdev 2313 drivers/pci/controller/pci-hyperv.c dev_err(&hbus->hdev->device, hdev 2348 drivers/pci/controller/pci-hyperv.c dev_warn(&hbus->hdev->device, hdev 2356 drivers/pci/controller/pci-hyperv.c dev_err(&hbus->hdev->device, hdev 2382 drivers/pci/controller/pci-hyperv.c static int hv_pci_protocol_negotiation(struct hv_device *hdev) hdev 2408 drivers/pci/controller/pci-hyperv.c ret = vmbus_sendpacket(hdev->channel, version_req, hdev 2413 drivers/pci/controller/pci-hyperv.c ret = wait_for_response(hdev, &comp_pkt.host_event); hdev 2416 drivers/pci/controller/pci-hyperv.c dev_err(&hdev->device, hdev 2424 drivers/pci/controller/pci-hyperv.c dev_info(&hdev->device, hdev 2431 drivers/pci/controller/pci-hyperv.c dev_err(&hdev->device, hdev 2441 drivers/pci/controller/pci-hyperv.c dev_err(&hdev->device, hdev 2507 drivers/pci/controller/pci-hyperv.c ret = vmbus_allocate_mmio(&hbus->low_mmio_res, hbus->hdev, 0, hdev 2512 drivers/pci/controller/pci-hyperv.c dev_err(&hbus->hdev->device, hdev 2527 drivers/pci/controller/pci-hyperv.c ret = vmbus_allocate_mmio(&hbus->high_mmio_res, hbus->hdev, hdev 2532 drivers/pci/controller/pci-hyperv.c dev_err(&hbus->hdev->device, hdev 2573 drivers/pci/controller/pci-hyperv.c ret = vmbus_allocate_mmio(&hbus->mem_config, hbus->hdev, 0, -1, hdev 2602 drivers/pci/controller/pci-hyperv.c static int hv_pci_enter_d0(struct hv_device *hdev) hdev 2604 drivers/pci/controller/pci-hyperv.c struct hv_pcibus_device *hbus = hv_get_drvdata(hdev); hdev 2627 drivers/pci/controller/pci-hyperv.c ret = vmbus_sendpacket(hdev->channel, d0_entry, sizeof(*d0_entry), hdev 2631 drivers/pci/controller/pci-hyperv.c ret = wait_for_response(hdev, &comp_pkt.host_event); hdev 2637 drivers/pci/controller/pci-hyperv.c dev_err(&hdev->device, hdev 2658 drivers/pci/controller/pci-hyperv.c static int hv_pci_query_relations(struct hv_device *hdev) hdev 2660 drivers/pci/controller/pci-hyperv.c struct hv_pcibus_device *hbus = hv_get_drvdata(hdev); hdev 2673 drivers/pci/controller/pci-hyperv.c ret = vmbus_sendpacket(hdev->channel, &message, sizeof(message), hdev 2676 drivers/pci/controller/pci-hyperv.c ret = wait_for_response(hdev, &comp); hdev 2698 drivers/pci/controller/pci-hyperv.c static int hv_send_resources_allocated(struct hv_device *hdev) hdev 2700 drivers/pci/controller/pci-hyperv.c struct hv_pcibus_device *hbus = hv_get_drvdata(hdev); hdev 2744 drivers/pci/controller/pci-hyperv.c ret = vmbus_sendpacket(hdev->channel, &pkt->message, hdev 2749 drivers/pci/controller/pci-hyperv.c ret = wait_for_response(hdev, &comp_pkt.host_event); hdev 2755 drivers/pci/controller/pci-hyperv.c dev_err(&hdev->device, hdev 2773 drivers/pci/controller/pci-hyperv.c static int hv_send_resources_released(struct hv_device *hdev) hdev 2775 drivers/pci/controller/pci-hyperv.c struct hv_pcibus_device *hbus = hv_get_drvdata(hdev); hdev 2792 drivers/pci/controller/pci-hyperv.c ret = vmbus_sendpacket(hdev->channel, &pkt, sizeof(pkt), 0, hdev 2861 drivers/pci/controller/pci-hyperv.c static int hv_pci_probe(struct hv_device *hdev, hdev 2893 drivers/pci/controller/pci-hyperv.c dom_req = hdev->dev_instance.b[5] << 8 | hdev->dev_instance.b[4]; hdev 2897 drivers/pci/controller/pci-hyperv.c dev_err(&hdev->device, hdev 2904 drivers/pci/controller/pci-hyperv.c dev_info(&hdev->device, hdev 2910 drivers/pci/controller/pci-hyperv.c hbus->hdev = hdev; hdev 2926 drivers/pci/controller/pci-hyperv.c ret = vmbus_open(hdev->channel, pci_ring_size, pci_ring_size, NULL, 0, hdev 2931 drivers/pci/controller/pci-hyperv.c hv_set_drvdata(hdev, hbus); hdev 2933 drivers/pci/controller/pci-hyperv.c ret = hv_pci_protocol_negotiation(hdev); hdev 2944 drivers/pci/controller/pci-hyperv.c dev_err(&hdev->device, hdev 2950 drivers/pci/controller/pci-hyperv.c name = kasprintf(GFP_KERNEL, "%pUL", &hdev->dev_instance); hdev 2967 drivers/pci/controller/pci-hyperv.c ret = hv_pci_query_relations(hdev); hdev 2971 drivers/pci/controller/pci-hyperv.c ret = hv_pci_enter_d0(hdev); hdev 2979 drivers/pci/controller/pci-hyperv.c ret = hv_send_resources_allocated(hdev); hdev 3004 drivers/pci/controller/pci-hyperv.c vmbus_close(hdev->channel); hdev 3014 drivers/pci/controller/pci-hyperv.c static void hv_pci_bus_exit(struct hv_device *hdev) hdev 3016 drivers/pci/controller/pci-hyperv.c struct hv_pcibus_device *hbus = hv_get_drvdata(hdev); hdev 3029 drivers/pci/controller/pci-hyperv.c if (hdev->channel->rescind) hdev 3036 drivers/pci/controller/pci-hyperv.c ret = hv_send_resources_released(hdev); hdev 3038 drivers/pci/controller/pci-hyperv.c dev_err(&hdev->device, hdev 3047 drivers/pci/controller/pci-hyperv.c ret = vmbus_sendpacket(hdev->channel, &pkt.teardown_packet.message, hdev 3062 drivers/pci/controller/pci-hyperv.c static int hv_pci_remove(struct hv_device *hdev) hdev 3066 drivers/pci/controller/pci-hyperv.c hbus = hv_get_drvdata(hdev); hdev 3077 drivers/pci/controller/pci-hyperv.c hv_pci_bus_exit(hdev); hdev 3079 drivers/pci/controller/pci-hyperv.c vmbus_close(hdev->channel); hdev 274 drivers/rtc/rtc-hid-sensor-time.c hid_device_io_start(hsdev->hdev); hdev 281 drivers/rtc/rtc-hid-sensor-time.c hid_device_io_stop(hsdev->hdev); hdev 668 drivers/scsi/hpsa.c struct hpsa_scsi_dev_t *hdev; hdev 674 drivers/scsi/hpsa.c hdev = sdev->hostdata; hdev 675 drivers/scsi/hpsa.c if (!hdev) { hdev 681 drivers/scsi/hpsa.c if (!is_logical_device(hdev)) { hdev 687 drivers/scsi/hpsa.c rlevel = hdev->raid_level; hdev 700 drivers/scsi/hpsa.c struct hpsa_scsi_dev_t *hdev; hdev 707 drivers/scsi/hpsa.c hdev = sdev->hostdata; hdev 708 drivers/scsi/hpsa.c if (!hdev) { hdev 712 drivers/scsi/hpsa.c memcpy(lunid, hdev->scsi3addr, sizeof(lunid)); hdev 722 drivers/scsi/hpsa.c struct hpsa_scsi_dev_t *hdev; hdev 729 drivers/scsi/hpsa.c hdev = sdev->hostdata; hdev 730 drivers/scsi/hpsa.c if (!hdev) { hdev 734 drivers/scsi/hpsa.c memcpy(sn, hdev->device_id, sizeof(sn)); hdev 750 drivers/scsi/hpsa.c struct hpsa_scsi_dev_t *hdev; hdev 757 drivers/scsi/hpsa.c hdev = sdev->hostdata; hdev 758 drivers/scsi/hpsa.c if (!hdev || is_logical_device(hdev) || !hdev->expose_device) { hdev 762 drivers/scsi/hpsa.c sas_address = hdev->sas_address; hdev 773 drivers/scsi/hpsa.c struct hpsa_scsi_dev_t *hdev; hdev 780 drivers/scsi/hpsa.c hdev = sdev->hostdata; hdev 781 drivers/scsi/hpsa.c if (!hdev) { hdev 785 drivers/scsi/hpsa.c offload_enabled = hdev->offload_enabled; hdev 788 drivers/scsi/hpsa.c if (hdev->devtype == TYPE_DISK || hdev->devtype == TYPE_ZBC) hdev 801 drivers/scsi/hpsa.c struct hpsa_scsi_dev_t *hdev; hdev 814 drivers/scsi/hpsa.c hdev = sdev->hostdata; hdev 815 drivers/scsi/hpsa.c if (!hdev) { hdev 820 drivers/scsi/hpsa.c bay = hdev->bay; hdev 823 drivers/scsi/hpsa.c if (i == hdev->active_path_index) hdev 825 drivers/scsi/hpsa.c else if (hdev->path_map & path_map_index) hdev 834 drivers/scsi/hpsa.c hdev->bus, hdev->target, hdev->lun, hdev 835 drivers/scsi/hpsa.c scsi_device_type(hdev->devtype)); hdev 837 drivers/scsi/hpsa.c if (hdev->devtype == TYPE_RAID || is_logical_device(hdev)) { hdev 844 drivers/scsi/hpsa.c box = hdev->box[i]; hdev 845 drivers/scsi/hpsa.c memcpy(&phys_connector, &hdev->phys_connector[i], hdev 855 drivers/scsi/hpsa.c if ((hdev->devtype == TYPE_DISK || hdev->devtype == TYPE_ZBC) && hdev 856 drivers/scsi/hpsa.c hdev->expose_device) { hdev 2157 drivers/scsi/hpsa.c struct hpsa_scsi_dev_t *hdev = NULL; hdev 2159 drivers/scsi/hpsa.c hdev = sdev->hostdata; hdev 2161 drivers/scsi/hpsa.c if (hdev) hdev 2162 drivers/scsi/hpsa.c hdev->was_removed = 1; hdev 119 drivers/usb/core/hub.c if (hub_is_superspeedplus(hub->hdev)) hdev 121 drivers/usb/core/hub.c if (hub_is_superspeed(hub->hdev)) hdev 132 drivers/usb/core/hub.c struct usb_hub *usb_hub_to_struct_hub(struct usb_device *hdev) hdev 134 drivers/usb/core/hub.c if (!hdev || !hdev->actconfig || !hdev->maxchild) hdev 136 drivers/usb/core/hub.c return usb_get_intfdata(hdev->actconfig->interface[0]); hdev 374 drivers/usb/core/hub.c static int get_hub_descriptor(struct usb_device *hdev, hdev 380 drivers/usb/core/hub.c if (hub_is_superspeed(hdev)) { hdev 389 drivers/usb/core/hub.c ret = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), hdev 393 drivers/usb/core/hub.c if (hub_is_superspeed(hdev)) { hdev 410 drivers/usb/core/hub.c static int clear_hub_feature(struct usb_device *hdev, int feature) hdev 412 drivers/usb/core/hub.c return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), hdev 419 drivers/usb/core/hub.c int usb_clear_port_feature(struct usb_device *hdev, int port1, int feature) hdev 421 drivers/usb/core/hub.c return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), hdev 429 drivers/usb/core/hub.c static int set_port_feature(struct usb_device *hdev, int port1, int feature) hdev 431 drivers/usb/core/hub.c return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), hdev 461 drivers/usb/core/hub.c status = set_port_feature(hub->hdev, (selector << 8) | port1, hdev 473 drivers/usb/core/hub.c struct usb_device *hdev = hub->hdev; hdev 478 drivers/usb/core/hub.c if (hdev->state != USB_STATE_CONFIGURED || hub->quiescing) hdev 481 drivers/usb/core/hub.c for (i = 0; i < hdev->maxchild; i++) { hdev 530 drivers/usb/core/hub.c cursor %= hdev->maxchild; hdev 547 drivers/usb/core/hub.c static int get_hub_status(struct usb_device *hdev, hdev 554 drivers/usb/core/hub.c status = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), hdev 565 drivers/usb/core/hub.c static int get_port_status(struct usb_device *hdev, int port1, hdev 572 drivers/usb/core/hub.c status = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), hdev 589 drivers/usb/core/hub.c ret = get_port_status(hub->hdev, port1, &hub->status->port, type, len); hdev 672 drivers/usb/core/hub.c void usb_kick_hub_wq(struct usb_device *hdev) hdev 674 drivers/usb/core/hub.c struct usb_hub *hub = usb_hub_to_struct_hub(hdev); hdev 688 drivers/usb/core/hub.c void usb_wakeup_notification(struct usb_device *hdev, hdev 694 drivers/usb/core/hub.c if (!hdev) hdev 697 drivers/usb/core/hub.c hub = usb_hub_to_struct_hub(hdev); hdev 752 drivers/usb/core/hub.c hub_clear_tt_buffer(struct usb_device *hdev, u16 devinfo, u16 tt) hdev 757 drivers/usb/core/hub.c int status = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), hdev 763 drivers/usb/core/hub.c return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), hdev 784 drivers/usb/core/hub.c struct usb_device *hdev = hub->hdev; hdev 794 drivers/usb/core/hub.c status = hub_clear_tt_buffer(hdev, clear->devinfo, clear->tt); hdev 796 drivers/usb/core/hub.c dev_err(&hdev->dev, hdev 823 drivers/usb/core/hub.c int usb_hub_set_port_power(struct usb_device *hdev, struct usb_hub *hub, hdev 829 drivers/usb/core/hub.c ret = set_port_feature(hdev, port1, USB_PORT_FEAT_POWER); hdev 831 drivers/usb/core/hub.c ret = usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_POWER); hdev 914 drivers/usb/core/hub.c for (port1 = 1; port1 <= hub->hdev->maxchild; port1++) hdev 916 drivers/usb/core/hub.c set_port_feature(hub->hdev, port1, USB_PORT_FEAT_POWER); hdev 918 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 930 drivers/usb/core/hub.c ret = get_hub_status(hub->hdev, &hub->status->hub); hdev 947 drivers/usb/core/hub.c return set_port_feature(hub->hdev, hdev 1018 drivers/usb/core/hub.c struct usb_device *hdev = hub->hdev; hdev 1028 drivers/usb/core/hub.c device_lock(&hdev->dev); hdev 1050 drivers/usb/core/hub.c if (hdev->parent && hub_is_superspeed(hdev)) { hdev 1051 drivers/usb/core/hub.c ret = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), hdev 1053 drivers/usb/core/hub.c hdev->level - 1, 0, NULL, 0, hdev 1090 drivers/usb/core/hub.c hcd = bus_to_hcd(hdev->bus); hdev 1092 drivers/usb/core/hub.c ret = hcd->driver->update_hub_device(hcd, hdev, hdev 1112 drivers/usb/core/hub.c for (port1 = 1; port1 <= hdev->maxchild; ++port1) { hdev 1144 drivers/usb/core/hub.c if (!hub_is_superspeed(hdev)) hdev 1145 drivers/usb/core/hub.c usb_clear_port_feature(hdev, port1, hdev 1159 drivers/usb/core/hub.c if (hub_is_superspeed(hdev) && hdev 1167 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 1172 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 1177 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 1181 drivers/usb/core/hub.c hub_is_superspeed(hub->hdev)) { hdev 1183 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 1218 drivers/usb/core/hub.c if (portchange || (hub_is_superspeed(hub->hdev) && hdev 1256 drivers/usb/core/hub.c device_unlock(&hdev->dev); hdev 1279 drivers/usb/core/hub.c device_unlock(&hdev->dev); hdev 1306 drivers/usb/core/hub.c struct usb_device *hdev = hub->hdev; hdev 1317 drivers/usb/core/hub.c for (i = 0; i < hdev->maxchild; ++i) { hdev 1336 drivers/usb/core/hub.c for (i = 0; i < hub->hdev->maxchild; ++i) hdev 1366 drivers/usb/core/hub.c struct usb_device *hdev = hub->hdev; hdev 1400 drivers/usb/core/hub.c ret = get_hub_descriptor(hdev, hub->descriptor); hdev 1407 drivers/usb/core/hub.c if (hub_is_superspeed(hdev)) hdev 1424 drivers/usb/core/hub.c if (hub_is_superspeed(hdev) || hub_is_superspeedplus(hdev)) { hdev 1427 drivers/usb/core/hub.c if (hdev->parent) hdev 1428 drivers/usb/core/hub.c delay += hdev->parent->hub_delay; hdev 1431 drivers/usb/core/hub.c hdev->hub_delay = min_t(u32, delay, USB_TP_TRANSMISSION_DELAY_MAX); hdev 1445 drivers/usb/core/hub.c if (hub_is_superspeed(hdev)) { hdev 1455 drivers/usb/core/hub.c !(hub_is_superspeed(hdev))) { hdev 1496 drivers/usb/core/hub.c switch (hdev->descriptor.bDeviceProtocol) { hdev 1501 drivers/usb/core/hub.c hub->tt.hub = hdev; hdev 1504 drivers/usb/core/hub.c ret = usb_set_interface(hdev, 0, 1); hdev 1511 drivers/usb/core/hub.c hub->tt.hub = hdev; hdev 1518 drivers/usb/core/hub.c hdev->descriptor.bDeviceProtocol); hdev 1525 drivers/usb/core/hub.c if (hdev->descriptor.bDeviceProtocol != 0) { hdev 1564 drivers/usb/core/hub.c ret = usb_get_std_status(hdev, USB_RECIP_DEVICE, 0, &hubstatus); hdev 1569 drivers/usb/core/hub.c hcd = bus_to_hcd(hdev->bus); hdev 1570 drivers/usb/core/hub.c if (hdev == hdev->bus->root_hub) { hdev 1572 drivers/usb/core/hub.c hdev->bus_mA = hcd->power_budget; hdev 1574 drivers/usb/core/hub.c hdev->bus_mA = full_load * maxchild; hdev 1575 drivers/usb/core/hub.c if (hdev->bus_mA >= full_load) hdev 1578 drivers/usb/core/hub.c hub->mA_per_port = hdev->bus_mA; hdev 1582 drivers/usb/core/hub.c int remaining = hdev->bus_mA - hdev 1611 drivers/usb/core/hub.c if (hdev->actconfig->desc.bmAttributes & USB_CONFIG_ATT_SELFPOWER) hdev 1626 drivers/usb/core/hub.c pipe = usb_rcvintpipe(hdev, endpoint->bEndpointAddress); hdev 1627 drivers/usb/core/hub.c maxp = usb_maxpacket(hdev, pipe, usb_pipeout(pipe)); hdev 1638 drivers/usb/core/hub.c usb_fill_int_urb(hub->urb, hdev, pipe, *hub->buffer, maxp, hub_irq, hdev 1654 drivers/usb/core/hub.c hdev->maxchild = i; hdev 1655 drivers/usb/core/hub.c for (i = 0; i < hdev->maxchild; i++) { hdev 1669 drivers/usb/core/hub.c ret = hcd->driver->update_hub_device(hcd, hdev, hdev 1677 drivers/usb/core/hub.c usb_hub_adjust_deviceremovable(hdev, hub->descriptor); hdev 1693 drivers/usb/core/hub.c usb_put_dev(hub->hdev); hdev 1703 drivers/usb/core/hub.c struct usb_device *hdev = interface_to_usbdev(intf); hdev 1720 drivers/usb/core/hub.c port1 = hdev->maxchild; hdev 1721 drivers/usb/core/hub.c hdev->maxchild = 0; hdev 1730 drivers/usb/core/hub.c if (hub->hdev->speed == USB_SPEED_HIGH) hdev 1769 drivers/usb/core/hub.c struct usb_device *hdev; hdev 1773 drivers/usb/core/hub.c hdev = interface_to_usbdev(intf); hdev 1812 drivers/usb/core/hub.c if (hdev->dev.power.autosuspend_delay >= 0) hdev 1813 drivers/usb/core/hub.c pm_runtime_set_autosuspend_delay(&hdev->dev, 0); hdev 1821 drivers/usb/core/hub.c if (hdev->parent) { /* normal device */ hdev 1822 drivers/usb/core/hub.c usb_enable_autosuspend(hdev); hdev 1824 drivers/usb/core/hub.c const struct hc_driver *drv = bus_to_hcd(hdev->bus)->driver; hdev 1827 drivers/usb/core/hub.c usb_enable_autosuspend(hdev); hdev 1830 drivers/usb/core/hub.c if (hdev->level == MAX_TOPO_LEVEL) { hdev 1837 drivers/usb/core/hub.c if (hdev->parent) { hdev 1857 drivers/usb/core/hub.c hub->hdev = hdev; hdev 1864 drivers/usb/core/hub.c usb_get_dev(hdev); hdev 1870 drivers/usb/core/hub.c if (hdev->speed == USB_SPEED_HIGH) hdev 1891 drivers/usb/core/hub.c struct usb_device *hdev = interface_to_usbdev(intf); hdev 1892 drivers/usb/core/hub.c struct usb_hub *hub = usb_hub_to_struct_hub(hdev); hdev 1901 drivers/usb/core/hub.c if (hdev->devnum <= 0) hdev 1904 drivers/usb/core/hub.c info->nports = hdev->maxchild; hdev 1927 drivers/usb/core/hub.c static int find_port_owner(struct usb_device *hdev, unsigned port1, hdev 1930 drivers/usb/core/hub.c struct usb_hub *hub = usb_hub_to_struct_hub(hdev); hdev 1932 drivers/usb/core/hub.c if (hdev->state == USB_STATE_NOTATTACHED) hdev 1934 drivers/usb/core/hub.c if (port1 == 0 || port1 > hdev->maxchild) hdev 1945 drivers/usb/core/hub.c int usb_hub_claim_port(struct usb_device *hdev, unsigned port1, hdev 1951 drivers/usb/core/hub.c rc = find_port_owner(hdev, port1, &powner); hdev 1961 drivers/usb/core/hub.c int usb_hub_release_port(struct usb_device *hdev, unsigned port1, hdev 1967 drivers/usb/core/hub.c rc = find_port_owner(hdev, port1, &powner); hdev 1977 drivers/usb/core/hub.c void usb_hub_release_all_ports(struct usb_device *hdev, struct usb_dev_state *owner) hdev 1979 drivers/usb/core/hub.c struct usb_hub *hub = usb_hub_to_struct_hub(hdev); hdev 1982 drivers/usb/core/hub.c for (n = 0; n < hdev->maxchild; n++) { hdev 2426 drivers/usb/core/hub.c struct usb_device *hdev = udev->parent; hdev 2432 drivers/usb/core/hub.c if (!hdev) hdev 2462 drivers/usb/core/hub.c if (hub_is_superspeed(hdev)) { hdev 2675 drivers/usb/core/hub.c static int port_speed_is_ssp(struct usb_device *hdev, int speed_id) hdev 2680 drivers/usb/core/hub.c struct usb_ssp_cap_descriptor *ssp_cap = hdev->bos->ssp_cap; hdev 2700 drivers/usb/core/hub.c if (hub->hdev->parent != NULL) /* not a root hub? */ hdev 2702 drivers/usb/core/hub.c hcd = bus_to_hcd(hub->hdev->bus); hdev 2746 drivers/usb/core/hub.c if (!hub_is_superspeed(hub->hdev)) hdev 2772 drivers/usb/core/hub.c if (hub_is_superspeedplus(hub->hdev)) hdev 2817 drivers/usb/core/hub.c if (!hub_is_superspeed(hub->hdev) && hdev 2819 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 2830 drivers/usb/core/hub.c if (hub_is_superspeedplus(hub->hdev)) { hdev 2840 drivers/usb/core/hub.c else if (hub_is_superspeedplus(hub->hdev) && hdev 2841 drivers/usb/core/hub.c port_speed_is_ssp(hub->hdev, ext_portstatus & hdev 2844 drivers/usb/core/hub.c else if (hub_is_superspeed(hub->hdev)) hdev 2864 drivers/usb/core/hub.c if (!hub_is_superspeed(hub->hdev)) { hdev 2888 drivers/usb/core/hub.c status = set_port_feature(hub->hdev, port1, (warm ? hdev 2908 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 2911 drivers/usb/core/hub.c if (!hub_is_superspeed(hub->hdev)) hdev 2914 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 2916 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 2920 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 2963 drivers/usb/core/hub.c if (hub->hdev->quirks & USB_QUIRK_HUB_SLOW_RESET) hdev 2986 drivers/usb/core/hub.c if (!hub_is_superspeed(hub->hdev)) hdev 2997 drivers/usb/core/hub.c if (hub_is_superspeed(hub->hdev)) { hdev 3029 drivers/usb/core/hub.c if (hub_is_superspeed(hub->hdev)) { hdev 3089 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 3092 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 3298 drivers/usb/core/hub.c if (hub_is_superspeed(hub->hdev)) hdev 3313 drivers/usb/core/hub.c status = set_port_feature(hub->hdev, port1, hdev 3352 drivers/usb/core/hub.c usb_mark_last_busy(hub->hdev); hdev 3559 drivers/usb/core/hub.c if (hub_is_superspeed(hub->hdev)) hdev 3562 drivers/usb/core/hub.c status = usb_clear_port_feature(hub->hdev, hdev 3585 drivers/usb/core/hub.c if (hub_is_superspeed(hub->hdev)) { hdev 3587 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 3591 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 3643 drivers/usb/core/hub.c struct usb_device *hdev; hdev 3649 drivers/usb/core/hub.c hdev = hub->hdev; hdev 3651 drivers/usb/core/hub.c if (!hub_is_superspeed(hdev)) { hdev 3654 drivers/usb/core/hub.c usb_clear_port_feature(hdev, port, USB_PORT_FEAT_C_SUSPEND); hdev 3685 drivers/usb/core/hub.c for (port1 = 1; port1 <= hub->hdev->maxchild; ++port1) { hdev 3699 drivers/usb/core/hub.c struct usb_device *hdev = hub->hdev; hdev 3707 drivers/usb/core/hub.c for (port1 = 1; port1 <= hdev->maxchild; port1++) { hdev 3722 drivers/usb/core/hub.c if (hdev->do_remote_wakeup && hub->quirk_check_port_auto_suspend) { hdev 3727 drivers/usb/core/hub.c pm_wakeup_event(&hdev->dev, 2000); hdev 3731 drivers/usb/core/hub.c if (hub_is_superspeed(hdev) && hdev->do_remote_wakeup) { hdev 3733 drivers/usb/core/hub.c for (port1 = 1; port1 <= hdev->maxchild; port1++) { hdev 3734 drivers/usb/core/hub.c set_port_feature(hdev, hdev 3753 drivers/usb/core/hub.c struct usb_device *hdev = hub->hdev; hdev 3759 drivers/usb/core/hub.c if (hdev->parent) hdev 3762 drivers/usb/core/hub.c hcd = bus_to_hcd(hdev->bus); hdev 3774 drivers/usb/core/hub.c for (i = 0; i < hdev->maxchild; ++i) { hdev 4350 drivers/usb/core/hub.c struct usb_device *hdev = hub->hdev; hdev 4354 drivers/usb/core/hub.c if (hub_is_superspeed(hub->hdev)) { hdev 4359 drivers/usb/core/hub.c ret = usb_clear_port_feature(hdev, port1, hdev 4425 drivers/usb/core/hub.c usb_clear_port_feature(hub->hdev, port1, hdev 4538 drivers/usb/core/hub.c struct usb_device *hdev = hub->hdev; hdev 4539 drivers/usb/core/hub.c struct usb_hcd *hcd = bus_to_hcd(hdev->bus); hdev 4551 drivers/usb/core/hub.c if (!hdev->parent) { hdev 4553 drivers/usb/core/hub.c if (port1 == hdev->bus->otg_port) hdev 4554 drivers/usb/core/hub.c hdev->bus->b_hnp_enable = 0; hdev 4633 drivers/usb/core/hub.c if (hdev->tt) { hdev 4634 drivers/usb/core/hub.c udev->tt = hdev->tt; hdev 4635 drivers/usb/core/hub.c udev->ttport = hdev->ttport; hdev 4637 drivers/usb/core/hub.c && hdev->speed == USB_SPEED_HIGH) { hdev 4913 drivers/usb/core/hub.c struct usb_device *hdev = hub->hdev; hdev 4920 drivers/usb/core/hub.c remaining = hdev->bus_mA - hub->descriptor->bHubContrCurrent; hdev 4921 drivers/usb/core/hub.c for (port1 = 1; port1 <= hdev->maxchild; ++port1) { hdev 4940 drivers/usb/core/hub.c else if (port1 != udev->bus->otg_port || hdev->parent) hdev 4963 drivers/usb/core/hub.c struct usb_device *hdev = hub->hdev; hdev 4964 drivers/usb/core/hub.c struct usb_hcd *hcd = bus_to_hcd(hdev->bus); hdev 4971 drivers/usb/core/hub.c if (hcd->usb_phy && !hdev->parent) hdev 5011 drivers/usb/core/hub.c set_port_feature(hdev, port1, USB_PORT_FEAT_POWER); hdev 5017 drivers/usb/core/hub.c if (hub_is_superspeed(hub->hdev)) hdev 5028 drivers/usb/core/hub.c udev = usb_alloc_dev(hdev, hdev->bus, port1); hdev 5037 drivers/usb/core/hub.c udev->level = hdev->level + 1; hdev 5041 drivers/usb/core/hub.c if (hub_is_superspeed(hub->hdev)) hdev 5113 drivers/usb/core/hub.c if (hdev->state == USB_STATE_NOTATTACHED) hdev 5130 drivers/usb/core/hub.c if (hcd->usb_phy && !hdev->parent) hdev 5158 drivers/usb/core/hub.c usb_hub_set_port_power(hdev, hub, port1, false); hdev 5160 drivers/usb/core/hub.c usb_hub_set_port_power(hdev, hub, port1, true); hdev 5164 drivers/usb/core/hub.c if (hub->hdev->parent || hdev 5174 drivers/usb/core/hub.c if (hcd->driver->relinquish_port && !hub->hdev->parent) { hdev 5206 drivers/usb/core/hub.c if (hub->hdev->bus->is_b_host) hdev 5284 drivers/usb/core/hub.c struct usb_device *hdev = hub->hdev; hdev 5295 drivers/usb/core/hub.c usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_CONNECTION); hdev 5303 drivers/usb/core/hub.c usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_ENABLE); hdev 5324 drivers/usb/core/hub.c usb_clear_port_feature(hdev, port1, hdev 5335 drivers/usb/core/hub.c usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_RESET); hdev 5338 drivers/usb/core/hub.c && hub_is_superspeed(hdev)) { hdev 5340 drivers/usb/core/hub.c usb_clear_port_feature(hdev, port1, hdev 5345 drivers/usb/core/hub.c usb_clear_port_feature(hdev, port1, hdev 5350 drivers/usb/core/hub.c usb_clear_port_feature(hdev, port1, hdev 5388 drivers/usb/core/hub.c struct usb_device *hdev; hdev 5397 drivers/usb/core/hub.c hdev = hub->hdev; hdev 5402 drivers/usb/core/hub.c hdev->state, hdev->maxchild, hdev 5409 drivers/usb/core/hub.c usb_lock_device(hdev); hdev 5414 drivers/usb/core/hub.c if (hdev->state == USB_STATE_NOTATTACHED) { hdev 5434 drivers/usb/core/hub.c ret = usb_reset_device(hdev); hdev 5445 drivers/usb/core/hub.c for (i = 1; i <= hdev->maxchild; i++) { hdev 5477 drivers/usb/core/hub.c clear_hub_feature(hdev, C_HUB_LOCAL_POWER); hdev 5489 drivers/usb/core/hub.c clear_hub_feature(hdev, C_HUB_OVER_CURRENT); hdev 5502 drivers/usb/core/hub.c usb_unlock_device(hdev); hdev 6005 drivers/usb/core/hub.c struct usb_device *usb_hub_find_child(struct usb_device *hdev, hdev 6008 drivers/usb/core/hub.c struct usb_hub *hub = usb_hub_to_struct_hub(hdev); hdev 6010 drivers/usb/core/hub.c if (port1 < 1 || port1 > hdev->maxchild) hdev 6016 drivers/usb/core/hub.c void usb_hub_adjust_deviceremovable(struct usb_device *hdev, hdev 6019 drivers/usb/core/hub.c struct usb_hub *hub = usb_hub_to_struct_hub(hdev); hdev 6026 drivers/usb/core/hub.c if (!hub_is_superspeed(hdev)) { hdev 6027 drivers/usb/core/hub.c for (i = 1; i <= hdev->maxchild; i++) { hdev 6043 drivers/usb/core/hub.c for (i = 1; i <= hdev->maxchild; i++) { hdev 6070 drivers/usb/core/hub.c acpi_handle usb_get_hub_port_acpi_handle(struct usb_device *hdev, hdev 6073 drivers/usb/core/hub.c struct usb_hub *hub = usb_hub_to_struct_hub(hdev); hdev 21 drivers/usb/core/hub.h struct usb_device *hdev; hdev 117 drivers/usb/core/hub.h extern int usb_hub_set_port_power(struct usb_device *hdev, struct usb_hub *hub, hdev 119 drivers/usb/core/hub.h extern struct usb_hub *usb_hub_to_struct_hub(struct usb_device *hdev); hdev 122 drivers/usb/core/hub.h extern int usb_clear_port_feature(struct usb_device *hdev, hdev 135 drivers/usb/core/hub.h static inline int hub_is_superspeed(struct usb_device *hdev) hdev 137 drivers/usb/core/hub.h return hdev->descriptor.bDeviceProtocol == USB_HUB_PR_SS; hdev 140 drivers/usb/core/hub.h static inline int hub_is_superspeedplus(struct usb_device *hdev) hdev 142 drivers/usb/core/hub.h return (hdev->descriptor.bDeviceProtocol == USB_HUB_PR_SS && hdev 143 drivers/usb/core/hub.h le16_to_cpu(hdev->descriptor.bcdUSB) >= 0x0310 && hdev 144 drivers/usb/core/hub.h hdev->bos->ssp_cap); hdev 194 drivers/usb/core/port.c struct usb_device *hdev = to_usb_device(dev->parent->parent); hdev 196 drivers/usb/core/port.c struct usb_hub *hub = usb_hub_to_struct_hub(hdev); hdev 220 drivers/usb/core/port.c retval = usb_hub_set_port_power(hdev, hub, port1, true); hdev 234 drivers/usb/core/port.c if (hub_is_superspeed(hdev)) hdev 253 drivers/usb/core/port.c struct usb_device *hdev = to_usb_device(dev->parent->parent); hdev 255 drivers/usb/core/port.c struct usb_hub *hub = usb_hub_to_struct_hub(hdev); hdev 276 drivers/usb/core/port.c retval = usb_hub_set_port_power(hdev, hub, port1, false); hdev 277 drivers/usb/core/port.c usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_CONNECTION); hdev 279 drivers/usb/core/port.c usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_ENABLE); hdev 451 drivers/usb/core/port.c struct usb_device *hdev = to_usb_device(port_dev->dev.parent->parent); hdev 456 drivers/usb/core/port.c hcd = bus_to_hcd(hdev->bus); hdev 481 drivers/usb/core/port.c struct usb_device *hdev = hub->hdev; hdev 495 drivers/usb/core/port.c } else if (!hdev->parent) { hdev 496 drivers/usb/core/port.c struct usb_hcd *hcd = bus_to_hcd(hdev->bus); hdev 505 drivers/usb/core/port.c struct usb_device *parent = hdev->parent; hdev 511 drivers/usb/core/port.c upstream = parent_hub->ports[hdev->portnum - 1]; hdev 534 drivers/usb/core/port.c struct usb_device *hdev = hub->hdev; hdev 551 drivers/usb/core/port.c if (hub_is_superspeed(hdev)) { hdev 559 drivers/usb/core/port.c if (hub_is_superspeed(hub->hdev)) hdev 561 drivers/usb/core/port.c dev_set_name(&port_dev->dev, "%s-port%d", dev_name(&hub->hdev->dev), hdev 26 drivers/usb/core/usb-acpi.c bool usb_acpi_power_manageable(struct usb_device *hdev, int index) hdev 31 drivers/usb/core/usb-acpi.c port_handle = usb_get_hub_port_acpi_handle(hdev, hdev 52 drivers/usb/core/usb-acpi.c int usb_acpi_set_power_state(struct usb_device *hdev, int index, bool enable) hdev 54 drivers/usb/core/usb-acpi.c struct usb_hub *hub = usb_hub_to_struct_hub(hdev); hdev 65 drivers/usb/core/usb-acpi.c port_handle = (acpi_handle) usb_get_hub_port_acpi_handle(hdev, port1); hdev 72 drivers/usb/core/usb.h extern void usb_hub_release_all_ports(struct usb_device *hdev, hdev 202 drivers/usb/core/usb.h extern void usb_hub_adjust_deviceremovable(struct usb_device *hdev, hdev 208 drivers/usb/core/usb.h extern acpi_handle usb_get_hub_port_acpi_handle(struct usb_device *hdev, hdev 834 drivers/usb/host/xhci-mem.c struct usb_device *hdev, hdev 845 drivers/usb/host/xhci-mem.c num_ports = hdev->maxchild; hdev 5008 drivers/usb/host/xhci.c static int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, hdev 5021 drivers/usb/host/xhci.c if (!hdev->parent) hdev 5024 drivers/usb/host/xhci.c vdev = xhci->devs[hdev->slot_id]; hdev 5043 drivers/usb/host/xhci.c if (hdev->speed == USB_SPEED_HIGH && hdev 5044 drivers/usb/host/xhci.c xhci_alloc_tt_info(xhci, vdev, hdev, tt, GFP_ATOMIC)) { hdev 5062 drivers/usb/host/xhci.c else if (hdev->speed == USB_SPEED_FULL) hdev 5069 drivers/usb/host/xhci.c slot_ctx->dev_info2 |= cpu_to_le32(XHCI_MAX_PORTS(hdev->maxchild)); hdev 5080 drivers/usb/host/xhci.c if (xhci->hci_version < 0x100 || hdev->speed == USB_SPEED_HIGH) hdev 5099 drivers/usb/host/xhci.c ret = xhci_configure_endpoint(xhci, hdev, config_cmd, hdev 5102 drivers/usb/host/xhci.c ret = xhci_configure_endpoint(xhci, hdev, config_cmd, hdev 2076 drivers/usb/host/xhci.h struct usb_device *hdev, hdev 42 drivers/usb/misc/lvstest.c struct usb_device *udev, *hdev; hdev 51 drivers/usb/misc/lvstest.c hdev = interface_to_usbdev(intf); hdev 52 drivers/usb/misc/lvstest.c hcd = bus_to_hcd(hdev->bus); hdev 54 drivers/usb/misc/lvstest.c udev = usb_alloc_dev(hdev, hdev->bus, lvs->portnum); hdev 76 drivers/usb/misc/lvstest.c struct usb_device *hdev = udev->parent; hdev 77 drivers/usb/misc/lvstest.c struct usb_hcd *hcd = bus_to_hcd(hdev->bus); hdev 85 drivers/usb/misc/lvstest.c static int lvs_rh_clear_port_feature(struct usb_device *hdev, hdev 88 drivers/usb/misc/lvstest.c return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), hdev 93 drivers/usb/misc/lvstest.c static int lvs_rh_set_port_feature(struct usb_device *hdev, hdev 96 drivers/usb/misc/lvstest.c return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), hdev 105 drivers/usb/misc/lvstest.c struct usb_device *hdev = interface_to_usbdev(intf); hdev 116 drivers/usb/misc/lvstest.c ret = lvs_rh_set_port_feature(hdev, lvs->portnum, hdev 134 drivers/usb/misc/lvstest.c struct usb_device *hdev = interface_to_usbdev(intf); hdev 145 drivers/usb/misc/lvstest.c ret = lvs_rh_clear_port_feature(hdev, lvs->portnum, hdev 163 drivers/usb/misc/lvstest.c struct usb_device *hdev = interface_to_usbdev(intf); hdev 167 drivers/usb/misc/lvstest.c ret = lvs_rh_set_port_feature(hdev, lvs->portnum, hdev 182 drivers/usb/misc/lvstest.c struct usb_device *hdev = interface_to_usbdev(intf); hdev 186 drivers/usb/misc/lvstest.c ret = lvs_rh_set_port_feature(hdev, lvs->portnum, hdev 201 drivers/usb/misc/lvstest.c struct usb_device *hdev = interface_to_usbdev(intf); hdev 215 drivers/usb/misc/lvstest.c ret = lvs_rh_set_port_feature(hdev, lvs->portnum | (val << 8), hdev 230 drivers/usb/misc/lvstest.c struct usb_device *hdev = interface_to_usbdev(intf); hdev 244 drivers/usb/misc/lvstest.c ret = lvs_rh_set_port_feature(hdev, lvs->portnum | (val << 8), hdev 297 drivers/usb/misc/lvstest.c struct usb_device *hdev = interface_to_usbdev(intf); hdev 301 drivers/usb/misc/lvstest.c ret = lvs_rh_set_port_feature(hdev, hdev 330 drivers/usb/misc/lvstest.c struct usb_device *hdev = interface_to_usbdev(intf); hdev 331 drivers/usb/misc/lvstest.c struct usb_hcd *hcd = bus_to_hcd(hdev->bus); hdev 339 drivers/usb/misc/lvstest.c ret = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), hdev 348 drivers/usb/misc/lvstest.c lvs_rh_clear_port_feature(hdev, i, hdev 351 drivers/usb/misc/lvstest.c lvs_rh_clear_port_feature(hdev, i, hdev 354 drivers/usb/misc/lvstest.c lvs_rh_clear_port_feature(hdev, i, hdev 357 drivers/usb/misc/lvstest.c lvs_rh_clear_port_feature(hdev, i, hdev 360 drivers/usb/misc/lvstest.c lvs_rh_clear_port_feature(hdev, i, hdev 395 drivers/usb/misc/lvstest.c struct usb_device *hdev; hdev 402 drivers/usb/misc/lvstest.c hdev = interface_to_usbdev(intf); hdev 410 drivers/usb/misc/lvstest.c if (hdev->descriptor.bDeviceProtocol != USB_HUB_PR_SS || hdev->parent) { hdev 423 drivers/usb/misc/lvstest.c ret = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), hdev 428 drivers/usb/misc/lvstest.c dev_err(&hdev->dev, "wrong root hub descriptor read %d\n", ret); hdev 439 drivers/usb/misc/lvstest.c pipe = usb_rcvintpipe(hdev, endpoint->bEndpointAddress); hdev 440 drivers/usb/misc/lvstest.c maxp = usb_maxpacket(hdev, pipe, usb_pipeout(pipe)); hdev 441 drivers/usb/misc/lvstest.c usb_fill_int_urb(lvs->urb, hdev, pipe, &lvs->buffer[0], maxp, hdev 231 drivers/video/fbdev/hyperv_fb.c static inline int synthvid_send(struct hv_device *hdev, hdev 240 drivers/video/fbdev/hyperv_fb.c ret = vmbus_sendpacket(hdev->channel, msg, hdev 253 drivers/video/fbdev/hyperv_fb.c static int synthvid_send_situ(struct hv_device *hdev) hdev 255 drivers/video/fbdev/hyperv_fb.c struct fb_info *info = hv_get_drvdata(hdev); hdev 275 drivers/video/fbdev/hyperv_fb.c synthvid_send(hdev, &msg); hdev 281 drivers/video/fbdev/hyperv_fb.c static int synthvid_send_ptr(struct hv_device *hdev) hdev 293 drivers/video/fbdev/hyperv_fb.c synthvid_send(hdev, &msg); hdev 309 drivers/video/fbdev/hyperv_fb.c synthvid_send(hdev, &msg); hdev 317 drivers/video/fbdev/hyperv_fb.c struct hv_device *hdev = device_to_hv_device(info->device); hdev 332 drivers/video/fbdev/hyperv_fb.c synthvid_send(hdev, &msg); hdev 343 drivers/video/fbdev/hyperv_fb.c static void synthvid_recv_sub(struct hv_device *hdev) hdev 345 drivers/video/fbdev/hyperv_fb.c struct fb_info *info = hv_get_drvdata(hdev); hdev 366 drivers/video/fbdev/hyperv_fb.c synthvid_send_ptr(hdev); hdev 367 drivers/video/fbdev/hyperv_fb.c synthvid_send_situ(hdev); hdev 379 drivers/video/fbdev/hyperv_fb.c struct hv_device *hdev = ctx; hdev 380 drivers/video/fbdev/hyperv_fb.c struct fb_info *info = hv_get_drvdata(hdev); hdev 394 drivers/video/fbdev/hyperv_fb.c ret = vmbus_recvpacket(hdev->channel, recv_buf, hdev 399 drivers/video/fbdev/hyperv_fb.c synthvid_recv_sub(hdev); hdev 404 drivers/video/fbdev/hyperv_fb.c static int synthvid_negotiate_ver(struct hv_device *hdev, u32 ver) hdev 406 drivers/video/fbdev/hyperv_fb.c struct fb_info *info = hv_get_drvdata(hdev); hdev 417 drivers/video/fbdev/hyperv_fb.c synthvid_send(hdev, msg); hdev 437 drivers/video/fbdev/hyperv_fb.c static int synthvid_connect_vsp(struct hv_device *hdev) hdev 439 drivers/video/fbdev/hyperv_fb.c struct fb_info *info = hv_get_drvdata(hdev); hdev 443 drivers/video/fbdev/hyperv_fb.c ret = vmbus_open(hdev->channel, RING_BUFSIZE, RING_BUFSIZE, hdev 444 drivers/video/fbdev/hyperv_fb.c NULL, 0, synthvid_receive, hdev); hdev 453 drivers/video/fbdev/hyperv_fb.c ret = synthvid_negotiate_ver(hdev, SYNTHVID_VERSION_WIN7); hdev 455 drivers/video/fbdev/hyperv_fb.c ret = synthvid_negotiate_ver(hdev, SYNTHVID_VERSION_WIN8); hdev 467 drivers/video/fbdev/hyperv_fb.c screen_fb_size = hdev->channel->offermsg.offer. hdev 473 drivers/video/fbdev/hyperv_fb.c vmbus_close(hdev->channel); hdev 478 drivers/video/fbdev/hyperv_fb.c static int synthvid_send_config(struct hv_device *hdev) hdev 480 drivers/video/fbdev/hyperv_fb.c struct fb_info *info = hv_get_drvdata(hdev); hdev 493 drivers/video/fbdev/hyperv_fb.c synthvid_send(hdev, msg); hdev 508 drivers/video/fbdev/hyperv_fb.c synthvid_send_ptr(hdev); hdev 509 drivers/video/fbdev/hyperv_fb.c synthvid_send_situ(hdev); hdev 564 drivers/video/fbdev/hyperv_fb.c struct hv_device *hdev = device_to_hv_device(info->device); hdev 566 drivers/video/fbdev/hyperv_fb.c return synthvid_send_situ(hdev); hdev 671 drivers/video/fbdev/hyperv_fb.c static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info) hdev 699 drivers/video/fbdev/hyperv_fb.c ret = vmbus_allocate_mmio(&par->mem, hdev, pot_start, pot_end, hdev 757 drivers/video/fbdev/hyperv_fb.c static int hvfb_probe(struct hv_device *hdev, hdev 764 drivers/video/fbdev/hyperv_fb.c info = framebuffer_alloc(sizeof(struct hvfb_par), &hdev->device); hdev 775 drivers/video/fbdev/hyperv_fb.c hv_set_drvdata(hdev, info); hdev 776 drivers/video/fbdev/hyperv_fb.c ret = synthvid_connect_vsp(hdev); hdev 782 drivers/video/fbdev/hyperv_fb.c ret = hvfb_getmem(hdev, info); hdev 827 drivers/video/fbdev/hyperv_fb.c ret = synthvid_send_config(hdev); hdev 849 drivers/video/fbdev/hyperv_fb.c vmbus_close(hdev->channel); hdev 852 drivers/video/fbdev/hyperv_fb.c hv_set_drvdata(hdev, NULL); hdev 858 drivers/video/fbdev/hyperv_fb.c static int hvfb_remove(struct hv_device *hdev) hdev 860 drivers/video/fbdev/hyperv_fb.c struct fb_info *info = hv_get_drvdata(hdev); hdev 872 drivers/video/fbdev/hyperv_fb.c vmbus_close(hdev->channel); hdev 873 drivers/video/fbdev/hyperv_fb.c hv_set_drvdata(hdev, NULL); hdev 33 include/linux/hid-debug.h struct hid_device *hdev; hdev 68 include/linux/hid-sensor-hub.h struct hid_device *hdev; hdev 626 include/linux/hid.h static inline void *hid_get_drvdata(struct hid_device *hdev) hdev 628 include/linux/hid.h return dev_get_drvdata(&hdev->dev); hdev 631 include/linux/hid.h static inline void hid_set_drvdata(struct hid_device *hdev, void *data) hdev 633 include/linux/hid.h dev_set_drvdata(&hdev->dev, data); hdev 748 include/linux/hid.h int (*raw_event)(struct hid_device *hdev, struct hid_report *report, hdev 751 include/linux/hid.h int (*event)(struct hid_device *hdev, struct hid_field *field, hdev 753 include/linux/hid.h void (*report)(struct hid_device *hdev, struct hid_report *report); hdev 755 include/linux/hid.h __u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf, hdev 758 include/linux/hid.h int (*input_mapping)(struct hid_device *hdev, hdev 761 include/linux/hid.h int (*input_mapped)(struct hid_device *hdev, hdev 764 include/linux/hid.h int (*input_configured)(struct hid_device *hdev, hdev 766 include/linux/hid.h void (*feature_mapping)(struct hid_device *hdev, hdev 770 include/linux/hid.h int (*suspend)(struct hid_device *hdev, pm_message_t message); hdev 771 include/linux/hid.h int (*resume)(struct hid_device *hdev); hdev 772 include/linux/hid.h int (*reset_resume)(struct hid_device *hdev); hdev 797 include/linux/hid.h int (*start)(struct hid_device *hdev); hdev 798 include/linux/hid.h void (*stop)(struct hid_device *hdev); hdev 800 include/linux/hid.h int (*open)(struct hid_device *hdev); hdev 801 include/linux/hid.h void (*close)(struct hid_device *hdev); hdev 803 include/linux/hid.h int (*power)(struct hid_device *hdev, int level); hdev 805 include/linux/hid.h int (*parse)(struct hid_device *hdev); hdev 807 include/linux/hid.h void (*request)(struct hid_device *hdev, hdev 810 include/linux/hid.h int (*wait)(struct hid_device *hdev); hdev 812 include/linux/hid.h int (*raw_request) (struct hid_device *hdev, unsigned char reportnum, hdev 816 include/linux/hid.h int (*output_report) (struct hid_device *hdev, __u8 *buf, size_t len); hdev 818 include/linux/hid.h int (*idle)(struct hid_device *hdev, int report, int idle, int reqtype); hdev 826 include/linux/hid.h static inline bool hid_is_using_ll_driver(struct hid_device *hdev, hdev 829 include/linux/hid.h return hdev->ll_driver == driver; hdev 903 include/linux/hid.h bool hid_match_one_id(const struct hid_device *hdev, hdev 905 include/linux/hid.h const struct hid_device_id *hid_match_id(const struct hid_device *hdev, hdev 907 include/linux/hid.h const struct hid_device_id *hid_match_device(struct hid_device *hdev, hdev 1015 include/linux/hid.h static inline int __must_check hid_parse(struct hid_device *hdev) hdev 1017 include/linux/hid.h return hid_open_report(hdev); hdev 1020 include/linux/hid.h int __must_check hid_hw_start(struct hid_device *hdev, hdev 1022 include/linux/hid.h void hid_hw_stop(struct hid_device *hdev); hdev 1023 include/linux/hid.h int __must_check hid_hw_open(struct hid_device *hdev); hdev 1024 include/linux/hid.h void hid_hw_close(struct hid_device *hdev); hdev 1036 include/linux/hid.h static inline int hid_hw_power(struct hid_device *hdev, int level) hdev 1038 include/linux/hid.h return hdev->ll_driver->power ? hdev->ll_driver->power(hdev, level) : 0; hdev 1049 include/linux/hid.h static inline void hid_hw_request(struct hid_device *hdev, hdev 1052 include/linux/hid.h if (hdev->ll_driver->request) hdev 1053 include/linux/hid.h return hdev->ll_driver->request(hdev, report, reqtype); hdev 1055 include/linux/hid.h __hid_request(hdev, report, reqtype); hdev 1072 include/linux/hid.h static inline int hid_hw_raw_request(struct hid_device *hdev, hdev 1079 include/linux/hid.h return hdev->ll_driver->raw_request(hdev, reportnum, buf, len, hdev 1092 include/linux/hid.h static inline int hid_hw_output_report(struct hid_device *hdev, __u8 *buf, hdev 1098 include/linux/hid.h if (hdev->ll_driver->output_report) hdev 1099 include/linux/hid.h return hdev->ll_driver->output_report(hdev, buf, len); hdev 1112 include/linux/hid.h static inline int hid_hw_idle(struct hid_device *hdev, int report, int idle, hdev 1115 include/linux/hid.h if (hdev->ll_driver->idle) hdev 1116 include/linux/hid.h return hdev->ll_driver->idle(hdev, report, idle, reqtype); hdev 1126 include/linux/hid.h static inline void hid_hw_wait(struct hid_device *hdev) hdev 1128 include/linux/hid.h if (hdev->ll_driver->wait) hdev 1129 include/linux/hid.h hdev->ll_driver->wait(hdev); hdev 1147 include/linux/hid.h unsigned long hid_lookup_quirk(const struct hid_device *hdev); hdev 721 include/linux/usb.h extern struct usb_device *usb_hub_find_child(struct usb_device *hdev, hdev 730 include/linux/usb.h #define usb_hub_for_each_child(hdev, port1, child) \ hdev 731 include/linux/usb.h for (port1 = 1, child = usb_hub_find_child(hdev, port1); \ hdev 732 include/linux/usb.h port1 <= hdev->maxchild; \ hdev 733 include/linux/usb.h child = usb_hub_find_child(hdev, ++port1)) \ hdev 749 include/linux/usb.h extern int usb_acpi_set_power_state(struct usb_device *hdev, int index, hdev 751 include/linux/usb.h extern bool usb_acpi_power_manageable(struct usb_device *hdev, int index); hdev 753 include/linux/usb.h static inline int usb_acpi_set_power_state(struct usb_device *hdev, int index, hdev 755 include/linux/usb.h static inline bool usb_acpi_power_manageable(struct usb_device *hdev, int index) hdev 881 include/linux/usb.h int usb_hub_claim_port(struct usb_device *hdev, unsigned port1, hdev 883 include/linux/usb.h int usb_hub_release_port(struct usb_device *hdev, unsigned port1, hdev 392 include/linux/usb/hcd.h int (*update_hub_device)(struct usb_hcd *, struct usb_device *hdev, hdev 508 include/linux/usb/hcd.h extern void usb_wakeup_notification(struct usb_device *hdev, hdev 141 include/net/bluetooth/bluetooth.h #define bt_dev_info(hdev, fmt, ...) \ hdev 142 include/net/bluetooth/bluetooth.h BT_INFO("%s: " fmt, (hdev)->name, ##__VA_ARGS__) hdev 143 include/net/bluetooth/bluetooth.h #define bt_dev_warn(hdev, fmt, ...) \ hdev 144 include/net/bluetooth/bluetooth.h BT_WARN("%s: " fmt, (hdev)->name, ##__VA_ARGS__) hdev 145 include/net/bluetooth/bluetooth.h #define bt_dev_err(hdev, fmt, ...) \ hdev 146 include/net/bluetooth/bluetooth.h BT_ERR("%s: " fmt, (hdev)->name, ##__VA_ARGS__) hdev 147 include/net/bluetooth/bluetooth.h #define bt_dev_dbg(hdev, fmt, ...) \ hdev 148 include/net/bluetooth/bluetooth.h BT_DBG("%s: " fmt, (hdev)->name, ##__VA_ARGS__) hdev 150 include/net/bluetooth/bluetooth.h #define bt_dev_err_ratelimited(hdev, fmt, ...) \ hdev 151 include/net/bluetooth/bluetooth.h BT_ERR_RATELIMITED("%s: " fmt, (hdev)->name, ##__VA_ARGS__) hdev 302 include/net/bluetooth/bluetooth.h typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status, u16 opcode); hdev 303 include/net/bluetooth/bluetooth.h typedef void (*hci_req_complete_skb_t)(struct hci_dev *hdev, u8 status, hdev 436 include/net/bluetooth/hci_core.h int (*open)(struct hci_dev *hdev); hdev 437 include/net/bluetooth/hci_core.h int (*close)(struct hci_dev *hdev); hdev 438 include/net/bluetooth/hci_core.h int (*flush)(struct hci_dev *hdev); hdev 439 include/net/bluetooth/hci_core.h int (*setup)(struct hci_dev *hdev); hdev 440 include/net/bluetooth/hci_core.h int (*shutdown)(struct hci_dev *hdev); hdev 441 include/net/bluetooth/hci_core.h int (*send)(struct hci_dev *hdev, struct sk_buff *skb); hdev 442 include/net/bluetooth/hci_core.h void (*notify)(struct hci_dev *hdev, unsigned int evt); hdev 443 include/net/bluetooth/hci_core.h void (*hw_error)(struct hci_dev *hdev, u8 code); hdev 444 include/net/bluetooth/hci_core.h int (*post_init)(struct hci_dev *hdev); hdev 445 include/net/bluetooth/hci_core.h int (*set_diag)(struct hci_dev *hdev, bool enable); hdev 446 include/net/bluetooth/hci_core.h int (*set_bdaddr)(struct hci_dev *hdev, const bdaddr_t *bdaddr); hdev 447 include/net/bluetooth/hci_core.h void (*cmd_timeout)(struct hci_dev *hdev); hdev 524 include/net/bluetooth/hci_core.h struct hci_dev *hdev; hdev 575 include/net/bluetooth/hci_core.h #define hci_dev_set_flag(hdev, nr) set_bit((nr), (hdev)->dev_flags) hdev 576 include/net/bluetooth/hci_core.h #define hci_dev_clear_flag(hdev, nr) clear_bit((nr), (hdev)->dev_flags) hdev 577 include/net/bluetooth/hci_core.h #define hci_dev_change_flag(hdev, nr) change_bit((nr), (hdev)->dev_flags) hdev 578 include/net/bluetooth/hci_core.h #define hci_dev_test_flag(hdev, nr) test_bit((nr), (hdev)->dev_flags) hdev 579 include/net/bluetooth/hci_core.h #define hci_dev_test_and_set_flag(hdev, nr) test_and_set_bit((nr), (hdev)->dev_flags) hdev 580 include/net/bluetooth/hci_core.h #define hci_dev_test_and_clear_flag(hdev, nr) test_and_clear_bit((nr), (hdev)->dev_flags) hdev 581 include/net/bluetooth/hci_core.h #define hci_dev_test_and_change_flag(hdev, nr) test_and_change_bit((nr), (hdev)->dev_flags) hdev 583 include/net/bluetooth/hci_core.h #define hci_dev_clear_volatile_flags(hdev) \ hdev 585 include/net/bluetooth/hci_core.h hci_dev_clear_flag(hdev, HCI_LE_SCAN); \ hdev 586 include/net/bluetooth/hci_core.h hci_dev_clear_flag(hdev, HCI_LE_ADV); \ hdev 587 include/net/bluetooth/hci_core.h hci_dev_clear_flag(hdev, HCI_PERIODIC_INQ); \ hdev 591 include/net/bluetooth/hci_core.h int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); hdev 596 include/net/bluetooth/hci_core.h int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags); hdev 599 include/net/bluetooth/hci_core.h static inline int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 614 include/net/bluetooth/hci_core.h static inline void discovery_init(struct hci_dev *hdev) hdev 616 include/net/bluetooth/hci_core.h hdev->discovery.state = DISCOVERY_STOPPED; hdev 617 include/net/bluetooth/hci_core.h INIT_LIST_HEAD(&hdev->discovery.all); hdev 618 include/net/bluetooth/hci_core.h INIT_LIST_HEAD(&hdev->discovery.unknown); hdev 619 include/net/bluetooth/hci_core.h INIT_LIST_HEAD(&hdev->discovery.resolve); hdev 620 include/net/bluetooth/hci_core.h hdev->discovery.report_invalid_rssi = true; hdev 621 include/net/bluetooth/hci_core.h hdev->discovery.rssi = HCI_RSSI_INVALID; hdev 624 include/net/bluetooth/hci_core.h static inline void hci_discovery_filter_clear(struct hci_dev *hdev) hdev 626 include/net/bluetooth/hci_core.h hdev->discovery.result_filtering = false; hdev 627 include/net/bluetooth/hci_core.h hdev->discovery.report_invalid_rssi = true; hdev 628 include/net/bluetooth/hci_core.h hdev->discovery.rssi = HCI_RSSI_INVALID; hdev 629 include/net/bluetooth/hci_core.h hdev->discovery.uuid_count = 0; hdev 630 include/net/bluetooth/hci_core.h kfree(hdev->discovery.uuids); hdev 631 include/net/bluetooth/hci_core.h hdev->discovery.uuids = NULL; hdev 632 include/net/bluetooth/hci_core.h hdev->discovery.scan_start = 0; hdev 633 include/net/bluetooth/hci_core.h hdev->discovery.scan_duration = 0; hdev 636 include/net/bluetooth/hci_core.h bool hci_discovery_active(struct hci_dev *hdev); hdev 638 include/net/bluetooth/hci_core.h void hci_discovery_set_state(struct hci_dev *hdev, int state); hdev 640 include/net/bluetooth/hci_core.h static inline int inquiry_cache_empty(struct hci_dev *hdev) hdev 642 include/net/bluetooth/hci_core.h return list_empty(&hdev->discovery.all); hdev 645 include/net/bluetooth/hci_core.h static inline long inquiry_cache_age(struct hci_dev *hdev) hdev 647 include/net/bluetooth/hci_core.h struct discovery_state *c = &hdev->discovery; hdev 656 include/net/bluetooth/hci_core.h struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, hdev 658 include/net/bluetooth/hci_core.h struct inquiry_entry *hci_inquiry_cache_lookup_unknown(struct hci_dev *hdev, hdev 660 include/net/bluetooth/hci_core.h struct inquiry_entry *hci_inquiry_cache_lookup_resolve(struct hci_dev *hdev, hdev 663 include/net/bluetooth/hci_core.h void hci_inquiry_cache_update_resolve(struct hci_dev *hdev, hdev 665 include/net/bluetooth/hci_core.h u32 hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data, hdev 667 include/net/bluetooth/hci_core.h void hci_inquiry_cache_flush(struct hci_dev *hdev); hdev 698 include/net/bluetooth/hci_core.h struct hci_dev *hdev = conn->hdev; hdev 699 include/net/bluetooth/hci_core.h return hci_dev_test_flag(hdev, HCI_SSP_ENABLED) && hdev 705 include/net/bluetooth/hci_core.h struct hci_dev *hdev = conn->hdev; hdev 706 include/net/bluetooth/hci_core.h return hci_dev_test_flag(hdev, HCI_SC_ENABLED) && hdev 710 include/net/bluetooth/hci_core.h static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c) hdev 712 include/net/bluetooth/hci_core.h struct hci_conn_hash *h = &hdev->conn_hash; hdev 733 include/net/bluetooth/hci_core.h static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c) hdev 735 include/net/bluetooth/hci_core.h struct hci_conn_hash *h = &hdev->conn_hash; hdev 759 include/net/bluetooth/hci_core.h static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type) hdev 761 include/net/bluetooth/hci_core.h struct hci_conn_hash *h = &hdev->conn_hash; hdev 777 include/net/bluetooth/hci_core.h static inline unsigned int hci_conn_count(struct hci_dev *hdev) hdev 779 include/net/bluetooth/hci_core.h struct hci_conn_hash *c = &hdev->conn_hash; hdev 784 include/net/bluetooth/hci_core.h static inline __u8 hci_conn_lookup_type(struct hci_dev *hdev, __u16 handle) hdev 786 include/net/bluetooth/hci_core.h struct hci_conn_hash *h = &hdev->conn_hash; hdev 804 include/net/bluetooth/hci_core.h static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev, hdev 807 include/net/bluetooth/hci_core.h struct hci_conn_hash *h = &hdev->conn_hash; hdev 823 include/net/bluetooth/hci_core.h static inline struct hci_conn *hci_conn_hash_lookup_ba(struct hci_dev *hdev, hdev 826 include/net/bluetooth/hci_core.h struct hci_conn_hash *h = &hdev->conn_hash; hdev 843 include/net/bluetooth/hci_core.h static inline struct hci_conn *hci_conn_hash_lookup_le(struct hci_dev *hdev, hdev 847 include/net/bluetooth/hci_core.h struct hci_conn_hash *h = &hdev->conn_hash; hdev 867 include/net/bluetooth/hci_core.h static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev, hdev 870 include/net/bluetooth/hci_core.h struct hci_conn_hash *h = &hdev->conn_hash; hdev 887 include/net/bluetooth/hci_core.h static inline struct hci_conn *hci_lookup_le_connect(struct hci_dev *hdev) hdev 889 include/net/bluetooth/hci_core.h struct hci_conn_hash *h = &hdev->conn_hash; hdev 911 include/net/bluetooth/hci_core.h struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst, hdev 914 include/net/bluetooth/hci_core.h void hci_conn_hash_flush(struct hci_dev *hdev); hdev 915 include/net/bluetooth/hci_core.h void hci_conn_check_pending(struct hci_dev *hdev); hdev 920 include/net/bluetooth/hci_core.h struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle); hdev 922 include/net/bluetooth/hci_core.h struct hci_conn *hci_connect_le_scan(struct hci_dev *hdev, bdaddr_t *dst, hdev 925 include/net/bluetooth/hci_core.h struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst, hdev 928 include/net/bluetooth/hci_core.h struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst, hdev 930 include/net/bluetooth/hci_core.h struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst, hdev 1012 include/net/bluetooth/hci_core.h queue_delayed_work(conn->hdev->workqueue, hdev 1041 include/net/bluetooth/hci_core.h static inline void *hci_get_drvdata(struct hci_dev *hdev) hdev 1043 include/net/bluetooth/hci_core.h return dev_get_drvdata(&hdev->dev); hdev 1046 include/net/bluetooth/hci_core.h static inline void hci_set_drvdata(struct hci_dev *hdev, void *data) hdev 1048 include/net/bluetooth/hci_core.h dev_set_drvdata(&hdev->dev, data); hdev 1055 include/net/bluetooth/hci_core.h void hci_free_dev(struct hci_dev *hdev); hdev 1056 include/net/bluetooth/hci_core.h int hci_register_dev(struct hci_dev *hdev); hdev 1057 include/net/bluetooth/hci_core.h void hci_unregister_dev(struct hci_dev *hdev); hdev 1058 include/net/bluetooth/hci_core.h int hci_suspend_dev(struct hci_dev *hdev); hdev 1059 include/net/bluetooth/hci_core.h int hci_resume_dev(struct hci_dev *hdev); hdev 1060 include/net/bluetooth/hci_core.h int hci_reset_dev(struct hci_dev *hdev); hdev 1061 include/net/bluetooth/hci_core.h int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb); hdev 1062 include/net/bluetooth/hci_core.h int hci_recv_diag(struct hci_dev *hdev, struct sk_buff *skb); hdev 1063 include/net/bluetooth/hci_core.h __printf(2, 3) void hci_set_hw_info(struct hci_dev *hdev, const char *fmt, ...); hdev 1064 include/net/bluetooth/hci_core.h __printf(2, 3) void hci_set_fw_info(struct hci_dev *hdev, const char *fmt, ...); hdev 1067 include/net/bluetooth/hci_core.h int hci_dev_do_close(struct hci_dev *hdev); hdev 1074 include/net/bluetooth/hci_core.h int hci_get_conn_info(struct hci_dev *hdev, void __user *arg); hdev 1075 include/net/bluetooth/hci_core.h int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); hdev 1091 include/net/bluetooth/hci_core.h struct hci_conn_params *hci_conn_params_lookup(struct hci_dev *hdev, hdev 1093 include/net/bluetooth/hci_core.h struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev, hdev 1095 include/net/bluetooth/hci_core.h void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type); hdev 1096 include/net/bluetooth/hci_core.h void hci_conn_params_clear_disabled(struct hci_dev *hdev); hdev 1102 include/net/bluetooth/hci_core.h void hci_uuids_clear(struct hci_dev *hdev); hdev 1104 include/net/bluetooth/hci_core.h void hci_link_keys_clear(struct hci_dev *hdev); hdev 1105 include/net/bluetooth/hci_core.h struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); hdev 1106 include/net/bluetooth/hci_core.h struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, hdev 1109 include/net/bluetooth/hci_core.h struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1112 include/net/bluetooth/hci_core.h struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1114 include/net/bluetooth/hci_core.h int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type); hdev 1115 include/net/bluetooth/hci_core.h void hci_smp_ltks_clear(struct hci_dev *hdev); hdev 1116 include/net/bluetooth/hci_core.h int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); hdev 1118 include/net/bluetooth/hci_core.h struct smp_irk *hci_find_irk_by_rpa(struct hci_dev *hdev, bdaddr_t *rpa); hdev 1119 include/net/bluetooth/hci_core.h struct smp_irk *hci_find_irk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1121 include/net/bluetooth/hci_core.h struct smp_irk *hci_add_irk(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1123 include/net/bluetooth/hci_core.h void hci_remove_irk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type); hdev 1124 include/net/bluetooth/hci_core.h void hci_smp_irks_clear(struct hci_dev *hdev); hdev 1126 include/net/bluetooth/hci_core.h bool hci_bdaddr_is_paired(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); hdev 1128 include/net/bluetooth/hci_core.h void hci_remote_oob_data_clear(struct hci_dev *hdev); hdev 1129 include/net/bluetooth/hci_core.h struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev, hdev 1131 include/net/bluetooth/hci_core.h int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1134 include/net/bluetooth/hci_core.h int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1137 include/net/bluetooth/hci_core.h void hci_adv_instances_clear(struct hci_dev *hdev); hdev 1138 include/net/bluetooth/hci_core.h struct adv_info *hci_find_adv_instance(struct hci_dev *hdev, u8 instance); hdev 1139 include/net/bluetooth/hci_core.h struct adv_info *hci_get_next_instance(struct hci_dev *hdev, u8 instance); hdev 1140 include/net/bluetooth/hci_core.h int hci_add_adv_instance(struct hci_dev *hdev, u8 instance, u32 flags, hdev 1144 include/net/bluetooth/hci_core.h int hci_remove_adv_instance(struct hci_dev *hdev, u8 instance); hdev 1145 include/net/bluetooth/hci_core.h void hci_adv_instances_set_rpa_expired(struct hci_dev *hdev, bool rpa_expired); hdev 1147 include/net/bluetooth/hci_core.h void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); hdev 1149 include/net/bluetooth/hci_core.h void hci_init_sysfs(struct hci_dev *hdev); hdev 1154 include/net/bluetooth/hci_core.h #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) hdev 1221 include/net/bluetooth/hci_core.h static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1226 include/net/bluetooth/hci_core.h return l2cap_connect_ind(hdev, bdaddr); hdev 1230 include/net/bluetooth/hci_core.h return sco_connect_ind(hdev, bdaddr, flags); hdev 1418 include/net/bluetooth/hci_core.h static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev, hdev 1424 include/net/bluetooth/hci_core.h return hci_find_irk_by_rpa(hdev, bdaddr); hdev 1451 include/net/bluetooth/hci_core.h struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen, hdev 1453 include/net/bluetooth/hci_core.h struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen, hdev 1455 include/net/bluetooth/hci_core.h int __hci_cmd_send(struct hci_dev *hdev, u16 opcode, u32 plen, hdev 1458 include/net/bluetooth/hci_core.h int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, hdev 1463 include/net/bluetooth/hci_core.h void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode); hdev 1465 include/net/bluetooth/hci_core.h struct sk_buff *hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen, hdev 1469 include/net/bluetooth/hci_core.h void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb); hdev 1472 include/net/bluetooth/hci_core.h void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb); hdev 1473 include/net/bluetooth/hci_core.h void hci_send_monitor_ctrl_event(struct hci_dev *hdev, u16 event, hdev 1477 include/net/bluetooth/hci_core.h void hci_sock_dev_event(struct hci_dev *hdev, int event); hdev 1485 include/net/bluetooth/hci_core.h int (*func) (struct sock *sk, struct hci_dev *hdev, void *data, hdev 1496 include/net/bluetooth/hci_core.h void (*hdev_init) (struct sock *sk, struct hci_dev *hdev); hdev 1524 include/net/bluetooth/hci_core.h int mgmt_new_settings(struct hci_dev *hdev); hdev 1525 include/net/bluetooth/hci_core.h void mgmt_index_added(struct hci_dev *hdev); hdev 1526 include/net/bluetooth/hci_core.h void mgmt_index_removed(struct hci_dev *hdev); hdev 1527 include/net/bluetooth/hci_core.h void mgmt_set_powered_failed(struct hci_dev *hdev, int err); hdev 1528 include/net/bluetooth/hci_core.h void mgmt_power_on(struct hci_dev *hdev, int err); hdev 1529 include/net/bluetooth/hci_core.h void __mgmt_power_off(struct hci_dev *hdev); hdev 1530 include/net/bluetooth/hci_core.h void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, hdev 1532 include/net/bluetooth/hci_core.h void mgmt_device_connected(struct hci_dev *hdev, struct hci_conn *conn, hdev 1534 include/net/bluetooth/hci_core.h void mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1537 include/net/bluetooth/hci_core.h void mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1539 include/net/bluetooth/hci_core.h void mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, hdev 1541 include/net/bluetooth/hci_core.h void mgmt_pin_code_request(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 secure); hdev 1542 include/net/bluetooth/hci_core.h void mgmt_pin_code_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1544 include/net/bluetooth/hci_core.h void mgmt_pin_code_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1546 include/net/bluetooth/hci_core.h int mgmt_user_confirm_request(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1549 include/net/bluetooth/hci_core.h int mgmt_user_confirm_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1551 include/net/bluetooth/hci_core.h int mgmt_user_confirm_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1553 include/net/bluetooth/hci_core.h int mgmt_user_passkey_request(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1555 include/net/bluetooth/hci_core.h int mgmt_user_passkey_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1557 include/net/bluetooth/hci_core.h int mgmt_user_passkey_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1559 include/net/bluetooth/hci_core.h int mgmt_user_passkey_notify(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1563 include/net/bluetooth/hci_core.h void mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status); hdev 1564 include/net/bluetooth/hci_core.h void mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status); hdev 1565 include/net/bluetooth/hci_core.h void mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class, hdev 1567 include/net/bluetooth/hci_core.h void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status); hdev 1568 include/net/bluetooth/hci_core.h void mgmt_start_discovery_complete(struct hci_dev *hdev, u8 status); hdev 1569 include/net/bluetooth/hci_core.h void mgmt_stop_discovery_complete(struct hci_dev *hdev, u8 status); hdev 1570 include/net/bluetooth/hci_core.h void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, hdev 1573 include/net/bluetooth/hci_core.h void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, hdev 1575 include/net/bluetooth/hci_core.h void mgmt_discovering(struct hci_dev *hdev, u8 discovering); hdev 1576 include/net/bluetooth/hci_core.h bool mgmt_powering_down(struct hci_dev *hdev); hdev 1577 include/net/bluetooth/hci_core.h void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent); hdev 1578 include/net/bluetooth/hci_core.h void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk, bool persistent); hdev 1579 include/net/bluetooth/hci_core.h void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk, hdev 1581 include/net/bluetooth/hci_core.h void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1585 include/net/bluetooth/hci_core.h bool mgmt_get_connectable(struct hci_dev *hdev); hdev 1586 include/net/bluetooth/hci_core.h void mgmt_set_connectable_complete(struct hci_dev *hdev, u8 status); hdev 1587 include/net/bluetooth/hci_core.h void mgmt_set_discoverable_complete(struct hci_dev *hdev, u8 status); hdev 1588 include/net/bluetooth/hci_core.h u8 mgmt_get_adv_discov_flags(struct hci_dev *hdev); hdev 1589 include/net/bluetooth/hci_core.h void mgmt_advertising_added(struct sock *sk, struct hci_dev *hdev, hdev 1591 include/net/bluetooth/hci_core.h void mgmt_advertising_removed(struct sock *sk, struct hci_dev *hdev, hdev 1593 include/net/bluetooth/hci_core.h int mgmt_phy_configuration_changed(struct hci_dev *hdev, struct sock *skip); hdev 1600 include/net/bluetooth/hci_core.h void hci_copy_identity_address(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 16 include/net/nfc/hci.h int (*open) (struct nfc_hci_dev *hdev); hdev 17 include/net/nfc/hci.h void (*close) (struct nfc_hci_dev *hdev); hdev 18 include/net/nfc/hci.h int (*load_session) (struct nfc_hci_dev *hdev); hdev 19 include/net/nfc/hci.h int (*hci_ready) (struct nfc_hci_dev *hdev); hdev 25 include/net/nfc/hci.h int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); hdev 26 include/net/nfc/hci.h int (*start_poll) (struct nfc_hci_dev *hdev, hdev 28 include/net/nfc/hci.h void (*stop_poll) (struct nfc_hci_dev *hdev); hdev 29 include/net/nfc/hci.h int (*dep_link_up)(struct nfc_hci_dev *hdev, struct nfc_target *target, hdev 31 include/net/nfc/hci.h int (*dep_link_down)(struct nfc_hci_dev *hdev); hdev 32 include/net/nfc/hci.h int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, hdev 34 include/net/nfc/hci.h int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, hdev 36 include/net/nfc/hci.h int (*im_transceive) (struct nfc_hci_dev *hdev, hdev 39 include/net/nfc/hci.h int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb); hdev 40 include/net/nfc/hci.h int (*check_presence)(struct nfc_hci_dev *hdev, hdev 42 include/net/nfc/hci.h int (*event_received)(struct nfc_hci_dev *hdev, u8 pipe, u8 event, hdev 44 include/net/nfc/hci.h void (*cmd_received)(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd, hdev 46 include/net/nfc/hci.h int (*fw_download)(struct nfc_hci_dev *hdev, const char *firmware_name); hdev 162 include/net/nfc/hci.h void nfc_hci_free_device(struct nfc_hci_dev *hdev); hdev 164 include/net/nfc/hci.h int nfc_hci_register_device(struct nfc_hci_dev *hdev); hdev 165 include/net/nfc/hci.h void nfc_hci_unregister_device(struct nfc_hci_dev *hdev); hdev 167 include/net/nfc/hci.h void nfc_hci_set_clientdata(struct nfc_hci_dev *hdev, void *clientdata); hdev 168 include/net/nfc/hci.h void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev); hdev 170 include/net/nfc/hci.h static inline int nfc_hci_set_vendor_cmds(struct nfc_hci_dev *hdev, hdev 174 include/net/nfc/hci.h return nfc_set_vendor_cmds(hdev->ndev, cmds, n_cmds); hdev 177 include/net/nfc/hci.h void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); hdev 181 include/net/nfc/hci.h void nfc_hci_reset_pipes_per_host(struct nfc_hci_dev *hdev, u8 host); hdev 248 include/net/nfc/hci.h void nfc_hci_resp_received(struct nfc_hci_dev *hdev, u8 result, hdev 250 include/net/nfc/hci.h void nfc_hci_cmd_received(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd, hdev 252 include/net/nfc/hci.h void nfc_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe, u8 event, hdev 254 include/net/nfc/hci.h void nfc_hci_recv_frame(struct nfc_hci_dev *hdev, struct sk_buff *skb); hdev 257 include/net/nfc/hci.h int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate, hdev 259 include/net/nfc/hci.h int nfc_hci_disconnect_gate(struct nfc_hci_dev *hdev, u8 gate); hdev 260 include/net/nfc/hci.h int nfc_hci_disconnect_all_gates(struct nfc_hci_dev *hdev); hdev 261 include/net/nfc/hci.h int nfc_hci_get_param(struct nfc_hci_dev *hdev, u8 gate, u8 idx, hdev 263 include/net/nfc/hci.h int nfc_hci_set_param(struct nfc_hci_dev *hdev, u8 gate, u8 idx, hdev 265 include/net/nfc/hci.h int nfc_hci_send_cmd(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, hdev 267 include/net/nfc/hci.h int nfc_hci_send_cmd_async(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, hdev 270 include/net/nfc/hci.h int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, hdev 272 include/net/nfc/hci.h int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); hdev 17 include/net/nfc/llc.h typedef void (*rcv_to_hci_t) (struct nfc_hci_dev *hdev, struct sk_buff *skb); hdev 18 include/net/nfc/llc.h typedef int (*xmit_to_drv_t) (struct nfc_hci_dev *hdev, struct sk_buff *skb); hdev 19 include/net/nfc/llc.h typedef void (*llc_failure_t) (struct nfc_hci_dev *hdev, int err); hdev 23 include/net/nfc/llc.h struct nfc_llc *nfc_llc_allocate(const char *name, struct nfc_hci_dev *hdev, hdev 233 include/sound/hdaudio.h hdac_get_device_id(struct hdac_device *hdev, struct hdac_driver *drv); hdev 250 include/sound/hdaudio.h int (*hdev_attach)(struct hdac_device *hdev); hdev 251 include/sound/hdaudio.h int (*hdev_detach)(struct hdac_device *hdev); hdev 13 include/sound/hdaudio_ext.h struct hdac_device *hdev); hdev 14 include/sound/hdaudio_ext.h void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev); hdev 67 net/bluetooth/6lowpan.c struct hci_dev *hdev; hdev 252 net/bluetooth/6lowpan.c if (conn->hcon->hdev == entry->hdev) { hdev 698 net/bluetooth/6lowpan.c SET_NETDEV_DEV(netdev, &chan->conn->hcon->hdev->dev); hdev 703 net/bluetooth/6lowpan.c (*dev)->hdev = chan->conn->hcon->hdev; hdev 985 net/bluetooth/6lowpan.c struct hci_dev *hdev; hdev 997 net/bluetooth/6lowpan.c hdev = hci_get_route(addr, BDADDR_ANY, BDADDR_LE_PUBLIC); hdev 998 net/bluetooth/6lowpan.c if (!hdev) hdev 1001 net/bluetooth/6lowpan.c hci_dev_lock(hdev); hdev 1002 net/bluetooth/6lowpan.c hcon = hci_conn_hash_lookup_le(hdev, addr, *addr_type); hdev 1003 net/bluetooth/6lowpan.c hci_dev_unlock(hdev); hdev 94 net/bluetooth/a2mp.c struct hci_dev *hdev; hdev 101 net/bluetooth/a2mp.c list_for_each_entry(hdev, &hci_dev_list, list) { hdev 102 net/bluetooth/a2mp.c if (hdev->dev_type == HCI_AMP) { hdev 103 net/bluetooth/a2mp.c cl[i].id = hdev->id; hdev 104 net/bluetooth/a2mp.c cl[i].type = hdev->amp_type; hdev 105 net/bluetooth/a2mp.c if (test_bit(HCI_UP, &hdev->flags)) hdev 106 net/bluetooth/a2mp.c cl[i].status = hdev->amp_status; hdev 138 net/bluetooth/a2mp.c struct hci_dev *hdev; hdev 165 net/bluetooth/a2mp.c list_for_each_entry(hdev, &hci_dev_list, list) { hdev 166 net/bluetooth/a2mp.c if (hdev->dev_type == HCI_AMP) hdev 283 net/bluetooth/a2mp.c static void read_local_amp_info_complete(struct hci_dev *hdev, u8 status, hdev 286 net/bluetooth/a2mp.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 288 net/bluetooth/a2mp.c a2mp_send_getinfo_rsp(hdev); hdev 295 net/bluetooth/a2mp.c struct hci_dev *hdev; hdev 304 net/bluetooth/a2mp.c hdev = hci_dev_get(req->id); hdev 305 net/bluetooth/a2mp.c if (!hdev || hdev->dev_type != HCI_AMP) { hdev 318 net/bluetooth/a2mp.c hci_req_init(&hreq, hdev); hdev 322 net/bluetooth/a2mp.c a2mp_send_getinfo_rsp(hdev); hdev 325 net/bluetooth/a2mp.c if (hdev) hdev 326 net/bluetooth/a2mp.c hci_dev_put(hdev); hdev 363 net/bluetooth/a2mp.c struct hci_dev *hdev; hdev 374 net/bluetooth/a2mp.c hdev = hci_dev_get(req->id); hdev 375 net/bluetooth/a2mp.c if (!hdev || hdev->amp_type == AMP_TYPE_BREDR || tmp) { hdev 392 net/bluetooth/a2mp.c amp_read_loc_assoc(hdev, mgr); hdev 395 net/bluetooth/a2mp.c if (hdev) hdev 396 net/bluetooth/a2mp.c hci_dev_put(hdev); hdev 407 net/bluetooth/a2mp.c struct hci_dev *hdev; hdev 443 net/bluetooth/a2mp.c hdev = hci_dev_get(rsp->id); hdev 444 net/bluetooth/a2mp.c if (!hdev) hdev 447 net/bluetooth/a2mp.c hcon = phylink_add(hdev, mgr, rsp->id, true); hdev 451 net/bluetooth/a2mp.c BT_DBG("Created hcon %p: loc:%d -> rem:%d", hcon, hdev->id, rsp->id); hdev 455 net/bluetooth/a2mp.c amp_create_phylink(hdev, mgr, hcon); hdev 458 net/bluetooth/a2mp.c hci_dev_put(hdev); hdev 469 net/bluetooth/a2mp.c struct hci_dev *hdev; hdev 481 net/bluetooth/a2mp.c hdev = hci_dev_get(req->remote_id); hdev 482 net/bluetooth/a2mp.c if (!hdev || hdev->amp_type == AMP_TYPE_BREDR) { hdev 516 net/bluetooth/a2mp.c hcon = phylink_add(hdev, mgr, req->local_id, false); hdev 518 net/bluetooth/a2mp.c amp_accept_phylink(hdev, mgr, hcon); hdev 525 net/bluetooth/a2mp.c if (hdev) hdev 526 net/bluetooth/a2mp.c hci_dev_put(hdev); hdev 548 net/bluetooth/a2mp.c struct hci_dev *hdev; hdev 560 net/bluetooth/a2mp.c hdev = hci_dev_get(req->remote_id); hdev 561 net/bluetooth/a2mp.c if (!hdev) { hdev 566 net/bluetooth/a2mp.c hcon = hci_conn_hash_lookup_ba(hdev, AMP_LINK, hdev 569 net/bluetooth/a2mp.c bt_dev_err(hdev, "no phys link exist"); hdev 577 net/bluetooth/a2mp.c hci_dev_put(hdev); hdev 890 net/bluetooth/a2mp.c void a2mp_send_getinfo_rsp(struct hci_dev *hdev) hdev 899 net/bluetooth/a2mp.c BT_DBG("%s mgr %p", hdev->name, mgr); hdev 901 net/bluetooth/a2mp.c rsp.id = hdev->id; hdev 904 net/bluetooth/a2mp.c if (hdev->amp_type != AMP_TYPE_BREDR) { hdev 906 net/bluetooth/a2mp.c rsp.total_bw = cpu_to_le32(hdev->amp_total_bw); hdev 907 net/bluetooth/a2mp.c rsp.max_bw = cpu_to_le32(hdev->amp_max_bw); hdev 908 net/bluetooth/a2mp.c rsp.min_latency = cpu_to_le32(hdev->amp_min_latency); hdev 909 net/bluetooth/a2mp.c rsp.pal_cap = cpu_to_le16(hdev->amp_pal_cap); hdev 910 net/bluetooth/a2mp.c rsp.assoc_size = cpu_to_le16(hdev->amp_assoc_size); hdev 917 net/bluetooth/a2mp.c void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status) hdev 920 net/bluetooth/a2mp.c struct amp_assoc *loc_assoc = &hdev->loc_assoc; hdev 928 net/bluetooth/a2mp.c BT_DBG("%s mgr %p", hdev->name, mgr); hdev 937 net/bluetooth/a2mp.c rsp->id = hdev->id; hdev 951 net/bluetooth/a2mp.c void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status) hdev 954 net/bluetooth/a2mp.c struct amp_assoc *loc_assoc = &hdev->loc_assoc; hdev 965 net/bluetooth/a2mp.c BT_DBG("%s mgr %p assoc_len %zu", hdev->name, mgr, len); hdev 977 net/bluetooth/a2mp.c req->local_id = hdev->id; hdev 988 net/bluetooth/a2mp.c void a2mp_send_create_phy_link_rsp(struct hci_dev *hdev, u8 status) hdev 998 net/bluetooth/a2mp.c hs_hcon = hci_conn_hash_lookup_state(hdev, AMP_LINK, BT_CONNECT); hdev 1006 net/bluetooth/a2mp.c BT_DBG("%s mgr %p hs_hcon %p status %u", hdev->name, mgr, hs_hcon, hdev 1009 net/bluetooth/a2mp.c rsp.local_id = hdev->id; hdev 149 net/bluetooth/a2mp.h void a2mp_send_getinfo_rsp(struct hci_dev *hdev); hdev 150 net/bluetooth/a2mp.h void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status); hdev 151 net/bluetooth/a2mp.h void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status); hdev 152 net/bluetooth/a2mp.h void a2mp_send_create_phy_link_rsp(struct hci_dev *hdev, u8 status); hdev 105 net/bluetooth/amp.c struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr, hdev 112 net/bluetooth/amp.c hcon = hci_conn_add(hdev, AMP_LINK, dst, role); hdev 169 net/bluetooth/amp.c struct hci_dev *hdev = conn->hdev; hdev 182 net/bluetooth/amp.c bt_dev_err(hdev, "legacy key type %d", conn->key_type); hdev 189 net/bluetooth/amp.c key = hci_find_link_key(hdev, &conn->dst); hdev 202 net/bluetooth/amp.c bt_dev_err(hdev, "could not derive Generic AMP Key: err %d", err); hdev 216 net/bluetooth/amp.c static void read_local_amp_assoc_complete(struct hci_dev *hdev, u8 status, hdev 220 net/bluetooth/amp.c struct amp_assoc *assoc = &hdev->loc_assoc; hdev 223 net/bluetooth/amp.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 238 net/bluetooth/amp.c amp_read_loc_assoc_frag(hdev, rp->phy_handle); hdev 249 net/bluetooth/amp.c a2mp_send_getampassoc_rsp(hdev, rp->status); hdev 250 net/bluetooth/amp.c a2mp_send_create_phy_link_req(hdev, rp->status); hdev 253 net/bluetooth/amp.c void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle) hdev 256 net/bluetooth/amp.c struct amp_assoc *loc_assoc = &hdev->loc_assoc; hdev 260 net/bluetooth/amp.c BT_DBG("%s handle %d", hdev->name, phy_handle); hdev 263 net/bluetooth/amp.c cp.max_len = cpu_to_le16(hdev->amp_assoc_size); hdev 266 net/bluetooth/amp.c hci_req_init(&req, hdev); hdev 270 net/bluetooth/amp.c a2mp_send_getampassoc_rsp(hdev, A2MP_STATUS_INVALID_CTRL_ID); hdev 273 net/bluetooth/amp.c void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr) hdev 279 net/bluetooth/amp.c memset(&hdev->loc_assoc, 0, sizeof(struct amp_assoc)); hdev 282 net/bluetooth/amp.c cp.max_len = cpu_to_le16(hdev->amp_assoc_size); hdev 285 net/bluetooth/amp.c hci_req_init(&req, hdev); hdev 289 net/bluetooth/amp.c a2mp_send_getampassoc_rsp(hdev, A2MP_STATUS_INVALID_CTRL_ID); hdev 292 net/bluetooth/amp.c void amp_read_loc_assoc_final_data(struct hci_dev *hdev, hdev 302 net/bluetooth/amp.c cp.max_len = cpu_to_le16(hdev->amp_assoc_size); hdev 307 net/bluetooth/amp.c hci_req_init(&req, hdev); hdev 311 net/bluetooth/amp.c a2mp_send_getampassoc_rsp(hdev, A2MP_STATUS_INVALID_CTRL_ID); hdev 314 net/bluetooth/amp.c static void write_remote_amp_assoc_complete(struct hci_dev *hdev, u8 status, hdev 320 net/bluetooth/amp.c hdev->name, rp->status, rp->phy_handle); hdev 325 net/bluetooth/amp.c amp_write_rem_assoc_continue(hdev, rp->phy_handle); hdev 329 net/bluetooth/amp.c static bool amp_write_rem_assoc_frag(struct hci_dev *hdev, hdev 373 net/bluetooth/amp.c hci_req_init(&req, hdev); hdev 382 net/bluetooth/amp.c void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle) hdev 386 net/bluetooth/amp.c BT_DBG("%s phy handle 0x%2.2x", hdev->name, handle); hdev 388 net/bluetooth/amp.c hcon = hci_conn_hash_lookup_handle(hdev, handle); hdev 393 net/bluetooth/amp.c if (amp_write_rem_assoc_frag(hdev, hcon)) hdev 394 net/bluetooth/amp.c a2mp_send_create_phy_link_rsp(hdev, 0); hdev 397 net/bluetooth/amp.c void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle) hdev 401 net/bluetooth/amp.c BT_DBG("%s phy handle 0x%2.2x", hdev->name, handle); hdev 403 net/bluetooth/amp.c hcon = hci_conn_hash_lookup_handle(hdev, handle); hdev 407 net/bluetooth/amp.c BT_DBG("%s phy handle 0x%2.2x hcon %p", hdev->name, handle, hcon); hdev 409 net/bluetooth/amp.c amp_write_rem_assoc_frag(hdev, hcon); hdev 412 net/bluetooth/amp.c static void create_phylink_complete(struct hci_dev *hdev, u8 status, hdev 417 net/bluetooth/amp.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 419 net/bluetooth/amp.c cp = hci_sent_cmd_data(hdev, HCI_OP_CREATE_PHY_LINK); hdev 423 net/bluetooth/amp.c hci_dev_lock(hdev); hdev 428 net/bluetooth/amp.c hcon = hci_conn_hash_lookup_handle(hdev, cp->phy_handle); hdev 432 net/bluetooth/amp.c amp_write_remote_assoc(hdev, cp->phy_handle); hdev 435 net/bluetooth/amp.c hci_dev_unlock(hdev); hdev 438 net/bluetooth/amp.c void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, hdev 446 net/bluetooth/amp.c BT_DBG("%s hcon %p phy handle 0x%2.2x", hdev->name, hcon, hdev 455 net/bluetooth/amp.c hci_req_init(&req, hdev); hdev 460 net/bluetooth/amp.c static void accept_phylink_complete(struct hci_dev *hdev, u8 status, hdev 465 net/bluetooth/amp.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 470 net/bluetooth/amp.c cp = hci_sent_cmd_data(hdev, HCI_OP_ACCEPT_PHY_LINK); hdev 474 net/bluetooth/amp.c amp_write_remote_assoc(hdev, cp->phy_handle); hdev 477 net/bluetooth/amp.c void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, hdev 485 net/bluetooth/amp.c BT_DBG("%s hcon %p phy handle 0x%2.2x", hdev->name, hcon, hdev 494 net/bluetooth/amp.c hci_req_init(&req, hdev); hdev 501 net/bluetooth/amp.c struct hci_dev *bredr_hdev = hci_dev_hold(bredr_hcon->hdev); hdev 516 net/bluetooth/amp.c bredr_chan->local_amp_id = hs_hcon->hdev->id; hdev 518 net/bluetooth/amp.c bredr_chan->conn->mtu = hs_hcon->hdev->block_mtu; hdev 531 net/bluetooth/amp.c struct hci_dev *hdev; hdev 539 net/bluetooth/amp.c hdev = hci_dev_hold(chan->hs_hcon->hdev); hdev 540 net/bluetooth/amp.c if (!hdev) hdev 560 net/bluetooth/amp.c hci_send_cmd(hdev, HCI_OP_CREATE_LOGICAL_LINK, sizeof(cp), hdev 563 net/bluetooth/amp.c hci_send_cmd(hdev, HCI_OP_ACCEPT_LOGICAL_LINK, sizeof(cp), hdev 566 net/bluetooth/amp.c hci_dev_put(hdev); hdev 580 net/bluetooth/amp.c hci_send_cmd(hcon->hdev, HCI_OP_DISCONN_LOGICAL_LINK, sizeof(cp), &cp); hdev 26 net/bluetooth/amp.h struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr, hdev 31 net/bluetooth/amp.h void amp_read_loc_info(struct hci_dev *hdev, struct amp_mgr *mgr); hdev 32 net/bluetooth/amp.h void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle); hdev 33 net/bluetooth/amp.h void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr); hdev 34 net/bluetooth/amp.h void amp_read_loc_assoc_final_data(struct hci_dev *hdev, hdev 36 net/bluetooth/amp.h void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, hdev 38 net/bluetooth/amp.h void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, hdev 54 net/bluetooth/amp.h void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); hdev 55 net/bluetooth/amp.h void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); hdev 66 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 75 net/bluetooth/hci_conn.c irk = hci_get_irk(hdev, bdaddr, bdaddr_type); hdev 81 net/bluetooth/hci_conn.c params = hci_pend_le_action_lookup(&hdev->pend_le_conns, bdaddr, hdev 97 net/bluetooth/hci_conn.c hci_conn_params_del(hdev, bdaddr, bdaddr_type); hdev 102 net/bluetooth/hci_conn.c list_add(¶ms->action, &hdev->pend_le_conns); hdev 105 net/bluetooth/hci_conn.c list_add(¶ms->action, &hdev->pend_le_reports); hdev 111 net/bluetooth/hci_conn.c hci_update_background_scan(hdev); hdev 116 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 119 net/bluetooth/hci_conn.c hci_conn_params_del(conn->hdev, &conn->dst, conn->dst_type); hdev 123 net/bluetooth/hci_conn.c hci_conn_hash_del(hdev, conn); hdev 125 net/bluetooth/hci_conn.c if (hdev->notify) hdev 126 net/bluetooth/hci_conn.c hdev->notify(hdev, HCI_NOTIFY_CONN_DEL); hdev 132 net/bluetooth/hci_conn.c hci_dev_put(hdev); hdev 141 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 144 net/bluetooth/hci_conn.c BT_DBG("%s hcon %p", hdev->name, conn); hdev 146 net/bluetooth/hci_conn.c hci_dev_lock(hdev); hdev 150 net/bluetooth/hci_conn.c list_for_each_entry_rcu(c, &hdev->conn_hash.list, list) { hdev 161 net/bluetooth/hci_conn.c hci_dev_unlock(hdev); hdev 162 net/bluetooth/hci_conn.c hci_dev_put(hdev); hdev 168 net/bluetooth/hci_conn.c BT_DBG("%s hcon %p", conn->hdev->name, conn); hdev 178 net/bluetooth/hci_conn.c hci_dev_hold(conn->hdev); hdev 190 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 202 net/bluetooth/hci_conn.c conn->link_policy = hdev->link_policy; hdev 208 net/bluetooth/hci_conn.c ie = hci_inquiry_cache_lookup(hdev, &conn->dst); hdev 223 net/bluetooth/hci_conn.c if (lmp_rswitch_capable(hdev) && !(hdev->link_mode & HCI_LM_MASTER)) hdev 228 net/bluetooth/hci_conn.c hci_send_cmd(hdev, HCI_OP_CREATE_CONN, sizeof(cp), &cp); hdev 242 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 246 net/bluetooth/hci_conn.c hci_send_cmd(hdev, HCI_OP_READ_CLOCK_OFFSET, sizeof(clkoff_cp), hdev 255 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 268 net/bluetooth/hci_conn.c hci_send_cmd(hdev, HCI_OP_ADD_SCO, sizeof(cp), &cp); hdev 273 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 315 net/bluetooth/hci_conn.c if (hci_send_cmd(hdev, HCI_OP_SETUP_SYNC_CONN, sizeof(cp), &cp) < 0) hdev 324 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 328 net/bluetooth/hci_conn.c hci_dev_lock(hdev); hdev 330 net/bluetooth/hci_conn.c params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type); hdev 338 net/bluetooth/hci_conn.c hci_dev_unlock(hdev); hdev 349 net/bluetooth/hci_conn.c hci_send_cmd(hdev, HCI_OP_LE_CONN_UPDATE, sizeof(cp), &cp); hdev 360 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 372 net/bluetooth/hci_conn.c hci_send_cmd(hdev, HCI_OP_LE_START_ENC, sizeof(cp), &cp); hdev 386 net/bluetooth/hci_conn.c if (lmp_esco_capable(conn->hdev)) hdev 431 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 435 net/bluetooth/hci_conn.c if (!lmp_sniff_capable(hdev) || !lmp_sniff_capable(conn)) hdev 441 net/bluetooth/hci_conn.c if (lmp_sniffsubr_capable(hdev) && lmp_sniffsubr_capable(conn)) { hdev 447 net/bluetooth/hci_conn.c hci_send_cmd(hdev, HCI_OP_SNIFF_SUBRATE, sizeof(cp), &cp); hdev 453 net/bluetooth/hci_conn.c cp.max_interval = cpu_to_le16(hdev->sniff_max_interval); hdev 454 net/bluetooth/hci_conn.c cp.min_interval = cpu_to_le16(hdev->sniff_min_interval); hdev 457 net/bluetooth/hci_conn.c hci_send_cmd(hdev, HCI_OP_SNIFF_MODE, sizeof(cp), &cp); hdev 466 net/bluetooth/hci_conn.c hci_send_cmd(conn->hdev, HCI_OP_USER_CONFIRM_REPLY, sizeof(conn->dst), hdev 474 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 485 net/bluetooth/hci_conn.c hci_send_cmd(hdev, HCI_OP_LE_SET_ADV_ENABLE, sizeof(enable), hdev 494 net/bluetooth/hci_conn.c struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst, hdev 499 net/bluetooth/hci_conn.c BT_DBG("%s dst %pMR", hdev->name, dst); hdev 506 net/bluetooth/hci_conn.c bacpy(&conn->src, &hdev->bdaddr); hdev 507 net/bluetooth/hci_conn.c conn->hdev = hdev; hdev 513 net/bluetooth/hci_conn.c conn->io_capability = hdev->io_capability; hdev 531 net/bluetooth/hci_conn.c conn->pkt_type = hdev->pkt_type & ACL_PTYPE_MASK; hdev 535 net/bluetooth/hci_conn.c hci_copy_identity_address(hdev, &conn->src, &conn->src_type); hdev 538 net/bluetooth/hci_conn.c if (lmp_esco_capable(hdev)) hdev 539 net/bluetooth/hci_conn.c conn->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) | hdev 540 net/bluetooth/hci_conn.c (hdev->esco_type & EDR_ESCO_MASK); hdev 542 net/bluetooth/hci_conn.c conn->pkt_type = hdev->pkt_type & SCO_PTYPE_MASK; hdev 545 net/bluetooth/hci_conn.c conn->pkt_type = hdev->esco_type & ~EDR_ESCO_MASK; hdev 561 net/bluetooth/hci_conn.c hci_dev_hold(hdev); hdev 563 net/bluetooth/hci_conn.c hci_conn_hash_add(hdev, conn); hdev 564 net/bluetooth/hci_conn.c if (hdev->notify) hdev 565 net/bluetooth/hci_conn.c hdev->notify(hdev, HCI_NOTIFY_CONN_ADD); hdev 574 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 576 net/bluetooth/hci_conn.c BT_DBG("%s hcon %p handle %d", hdev->name, conn, conn->handle); hdev 588 net/bluetooth/hci_conn.c hdev->acl_cnt += conn->sent; hdev 592 net/bluetooth/hci_conn.c if (hdev->le_pkts) hdev 593 net/bluetooth/hci_conn.c hdev->le_cnt += conn->sent; hdev 595 net/bluetooth/hci_conn.c hdev->acl_cnt += conn->sent; hdev 622 net/bluetooth/hci_conn.c struct hci_dev *hdev = NULL, *d; hdev 663 net/bluetooth/hci_conn.c hdev = d; break; hdev 667 net/bluetooth/hci_conn.c hdev = d; break; hdev 672 net/bluetooth/hci_conn.c if (hdev) hdev 673 net/bluetooth/hci_conn.c hdev = hci_dev_hold(hdev); hdev 676 net/bluetooth/hci_conn.c return hdev; hdev 683 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 686 net/bluetooth/hci_conn.c params = hci_pend_le_action_lookup(&hdev->pend_le_conns, &conn->dst, hdev 704 net/bluetooth/hci_conn.c mgmt_connect_failed(hdev, &conn->dst, conn->type, hdev 714 net/bluetooth/hci_conn.c hci_update_background_scan(hdev); hdev 719 net/bluetooth/hci_conn.c hci_req_reenable_advertising(hdev); hdev 722 net/bluetooth/hci_conn.c static void create_le_conn_complete(struct hci_dev *hdev, u8 status, u16 opcode) hdev 726 net/bluetooth/hci_conn.c hci_dev_lock(hdev); hdev 728 net/bluetooth/hci_conn.c conn = hci_lookup_le_connect(hdev); hdev 735 net/bluetooth/hci_conn.c bt_dev_err(hdev, "request failed to create LE connection: " hdev 744 net/bluetooth/hci_conn.c hci_dev_unlock(hdev); hdev 749 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 751 net/bluetooth/hci_conn.c return hci_dev_test_flag(hdev, HCI_PRIVACY); hdev 757 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 764 net/bluetooth/hci_conn.c p->scan_interval = cpu_to_le16(hdev->le_scan_interval); hdev 778 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 785 net/bluetooth/hci_conn.c if (bacmp(&req->hdev->random_addr, direct_rpa)) hdev 800 net/bluetooth/hci_conn.c if (use_ext_conn(hdev)) { hdev 817 net/bluetooth/hci_conn.c if (scan_1m(hdev)) { hdev 825 net/bluetooth/hci_conn.c if (scan_2m(hdev)) { hdev 833 net/bluetooth/hci_conn.c if (scan_coded(hdev)) { hdev 850 net/bluetooth/hci_conn.c cp.scan_interval = cpu_to_le16(hdev->le_scan_interval); hdev 873 net/bluetooth/hci_conn.c struct hci_dev *hdev = req->hdev; hdev 877 net/bluetooth/hci_conn.c if (ext_adv_capable(hdev)) { hdev 884 net/bluetooth/hci_conn.c if (hci_get_random_address(hdev, false, conn_use_rpa(conn), NULL, hdev 892 net/bluetooth/hci_conn.c cp.channel_map = hdev->le_adv_channel_map; hdev 905 net/bluetooth/hci_conn.c bacmp(&random_addr, &hdev->random_addr)) { hdev 927 net/bluetooth/hci_conn.c hci_dev_clear_flag(hdev, HCI_LE_ADV); hdev 949 net/bluetooth/hci_conn.c cp.channel_map = hdev->le_adv_channel_map; hdev 961 net/bluetooth/hci_conn.c struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst, hdev 972 net/bluetooth/hci_conn.c if (!hci_dev_test_flag(hdev, HCI_LE_ENABLED)) { hdev 973 net/bluetooth/hci_conn.c if (lmp_le_capable(hdev)) hdev 982 net/bluetooth/hci_conn.c if (hci_lookup_le_connect(hdev)) hdev 990 net/bluetooth/hci_conn.c conn = hci_conn_hash_lookup_le(hdev, dst, dst_type); hdev 1004 net/bluetooth/hci_conn.c irk = hci_find_irk_by_addr(hdev, dst, dst_type); hdev 1013 net/bluetooth/hci_conn.c conn = hci_conn_add(hdev, LE_LINK, dst, role); hdev 1024 net/bluetooth/hci_conn.c hci_req_init(&req, hdev); hdev 1032 net/bluetooth/hci_conn.c if (hci_dev_test_flag(hdev, HCI_LE_ADV)) { hdev 1043 net/bluetooth/hci_conn.c if (hci_dev_test_flag(hdev, HCI_LE_SCAN) && hdev 1044 net/bluetooth/hci_conn.c hdev->le_scan_type == LE_SCAN_ACTIVE) { hdev 1054 net/bluetooth/hci_conn.c params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type); hdev 1061 net/bluetooth/hci_conn.c conn->le_conn_min_interval = hdev->le_conn_min_interval; hdev 1062 net/bluetooth/hci_conn.c conn->le_conn_max_interval = hdev->le_conn_max_interval; hdev 1063 net/bluetooth/hci_conn.c conn->le_conn_latency = hdev->le_conn_latency; hdev 1064 net/bluetooth/hci_conn.c conn->le_supv_timeout = hdev->le_supv_timeout; hdev 1073 net/bluetooth/hci_conn.c if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) { hdev 1075 net/bluetooth/hci_conn.c hci_dev_set_flag(hdev, HCI_LE_SCAN_INTERRUPTED); hdev 1090 net/bluetooth/hci_conn.c static bool is_connected(struct hci_dev *hdev, bdaddr_t *addr, u8 type) hdev 1094 net/bluetooth/hci_conn.c conn = hci_conn_hash_lookup_le(hdev, addr, type); hdev 1105 net/bluetooth/hci_conn.c static int hci_explicit_conn_params_set(struct hci_dev *hdev, hdev 1110 net/bluetooth/hci_conn.c if (is_connected(hdev, addr, addr_type)) hdev 1113 net/bluetooth/hci_conn.c params = hci_conn_params_lookup(hdev, addr, addr_type); hdev 1115 net/bluetooth/hci_conn.c params = hci_conn_params_add(hdev, addr, addr_type); hdev 1131 net/bluetooth/hci_conn.c list_add(¶ms->action, &hdev->pend_le_conns); hdev 1143 net/bluetooth/hci_conn.c struct hci_conn *hci_connect_le_scan(struct hci_dev *hdev, bdaddr_t *dst, hdev 1150 net/bluetooth/hci_conn.c if (!hci_dev_test_flag(hdev, HCI_LE_ENABLED)) { hdev 1151 net/bluetooth/hci_conn.c if (lmp_le_capable(hdev)) hdev 1166 net/bluetooth/hci_conn.c conn = hci_conn_hash_lookup_le(hdev, dst, dst_type); hdev 1175 net/bluetooth/hci_conn.c conn = hci_conn_add(hdev, LE_LINK, dst, HCI_ROLE_MASTER); hdev 1179 net/bluetooth/hci_conn.c if (hci_explicit_conn_params_set(hdev, dst, dst_type) < 0) { hdev 1191 net/bluetooth/hci_conn.c hci_update_background_scan(hdev); hdev 1198 net/bluetooth/hci_conn.c struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst, hdev 1203 net/bluetooth/hci_conn.c if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) { hdev 1204 net/bluetooth/hci_conn.c if (lmp_bredr_capable(hdev)) hdev 1210 net/bluetooth/hci_conn.c acl = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst); hdev 1212 net/bluetooth/hci_conn.c acl = hci_conn_add(hdev, ACL_LINK, dst, HCI_ROLE_MASTER); hdev 1229 net/bluetooth/hci_conn.c struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst, hdev 1235 net/bluetooth/hci_conn.c acl = hci_connect_acl(hdev, dst, BT_SECURITY_LOW, HCI_AT_NO_BONDING); hdev 1239 net/bluetooth/hci_conn.c sco = hci_conn_hash_lookup_ba(hdev, type, dst); hdev 1241 net/bluetooth/hci_conn.c sco = hci_conn_add(hdev, type, dst, HCI_ROLE_MASTER); hdev 1281 net/bluetooth/hci_conn.c if (hci_dev_test_flag(conn->hdev, HCI_SC_ONLY)) { hdev 1317 net/bluetooth/hci_conn.c hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED, hdev 1341 net/bluetooth/hci_conn.c hci_send_cmd(conn->hdev, HCI_OP_SET_CONN_ENCRYPT, sizeof(cp), hdev 1455 net/bluetooth/hci_conn.c hci_send_cmd(conn->hdev, HCI_OP_SWITCH_ROLE, sizeof(cp), &cp); hdev 1465 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 1478 net/bluetooth/hci_conn.c hci_send_cmd(hdev, HCI_OP_EXIT_SNIFF_MODE, sizeof(cp), &cp); hdev 1482 net/bluetooth/hci_conn.c if (hdev->idle_timeout > 0) hdev 1483 net/bluetooth/hci_conn.c queue_delayed_work(hdev->workqueue, &conn->idle_work, hdev 1484 net/bluetooth/hci_conn.c msecs_to_jiffies(hdev->idle_timeout)); hdev 1488 net/bluetooth/hci_conn.c void hci_conn_hash_flush(struct hci_dev *hdev) hdev 1490 net/bluetooth/hci_conn.c struct hci_conn_hash *h = &hdev->conn_hash; hdev 1493 net/bluetooth/hci_conn.c BT_DBG("hdev %s", hdev->name); hdev 1504 net/bluetooth/hci_conn.c void hci_conn_check_pending(struct hci_dev *hdev) hdev 1508 net/bluetooth/hci_conn.c BT_DBG("hdev %s", hdev->name); hdev 1510 net/bluetooth/hci_conn.c hci_dev_lock(hdev); hdev 1512 net/bluetooth/hci_conn.c conn = hci_conn_hash_lookup_state(hdev, ACL_LINK, BT_CONNECT2); hdev 1516 net/bluetooth/hci_conn.c hci_dev_unlock(hdev); hdev 1546 net/bluetooth/hci_conn.c struct hci_dev *hdev; hdev 1561 net/bluetooth/hci_conn.c hdev = hci_dev_get(req.dev_id); hdev 1562 net/bluetooth/hci_conn.c if (!hdev) { hdev 1569 net/bluetooth/hci_conn.c hci_dev_lock(hdev); hdev 1570 net/bluetooth/hci_conn.c list_for_each_entry(c, &hdev->conn_hash.list, list) { hdev 1580 net/bluetooth/hci_conn.c hci_dev_unlock(hdev); hdev 1582 net/bluetooth/hci_conn.c cl->dev_id = hdev->id; hdev 1586 net/bluetooth/hci_conn.c hci_dev_put(hdev); hdev 1594 net/bluetooth/hci_conn.c int hci_get_conn_info(struct hci_dev *hdev, void __user *arg) hdev 1604 net/bluetooth/hci_conn.c hci_dev_lock(hdev); hdev 1605 net/bluetooth/hci_conn.c conn = hci_conn_hash_lookup_ba(hdev, req.type, &req.bdaddr); hdev 1614 net/bluetooth/hci_conn.c hci_dev_unlock(hdev); hdev 1622 net/bluetooth/hci_conn.c int hci_get_auth_info(struct hci_dev *hdev, void __user *arg) hdev 1630 net/bluetooth/hci_conn.c hci_dev_lock(hdev); hdev 1631 net/bluetooth/hci_conn.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &req.bdaddr); hdev 1634 net/bluetooth/hci_conn.c hci_dev_unlock(hdev); hdev 1644 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 1647 net/bluetooth/hci_conn.c BT_DBG("%s hcon %p", hdev->name, conn); hdev 1670 net/bluetooth/hci_conn.c struct hci_dev *hdev = conn->hdev; hdev 1672 net/bluetooth/hci_conn.c BT_DBG("%s hcon %p chan %p", hdev->name, conn, chan); hdev 1710 net/bluetooth/hci_conn.c struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle) hdev 1712 net/bluetooth/hci_conn.c struct hci_conn_hash *h = &hdev->conn_hash; hdev 66 net/bluetooth/hci_core.c struct hci_dev *hdev = file->private_data; hdev 69 net/bluetooth/hci_core.c buf[0] = hci_dev_test_flag(hdev, HCI_DUT_MODE) ? 'Y' : 'N'; hdev 78 net/bluetooth/hci_core.c struct hci_dev *hdev = file->private_data; hdev 83 net/bluetooth/hci_core.c if (!test_bit(HCI_UP, &hdev->flags)) hdev 90 net/bluetooth/hci_core.c if (enable == hci_dev_test_flag(hdev, HCI_DUT_MODE)) hdev 93 net/bluetooth/hci_core.c hci_req_sync_lock(hdev); hdev 95 net/bluetooth/hci_core.c skb = __hci_cmd_sync(hdev, HCI_OP_ENABLE_DUT_MODE, 0, NULL, hdev 98 net/bluetooth/hci_core.c skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, hdev 100 net/bluetooth/hci_core.c hci_req_sync_unlock(hdev); hdev 107 net/bluetooth/hci_core.c hci_dev_change_flag(hdev, HCI_DUT_MODE); hdev 122 net/bluetooth/hci_core.c struct hci_dev *hdev = file->private_data; hdev 125 net/bluetooth/hci_core.c buf[0] = hci_dev_test_flag(hdev, HCI_VENDOR_DIAG) ? 'Y' : 'N'; hdev 134 net/bluetooth/hci_core.c struct hci_dev *hdev = file->private_data; hdev 147 net/bluetooth/hci_core.c if (test_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks) && hdev 148 net/bluetooth/hci_core.c (!test_bit(HCI_RUNNING, &hdev->flags) || hdev 149 net/bluetooth/hci_core.c hci_dev_test_flag(hdev, HCI_USER_CHANNEL))) hdev 152 net/bluetooth/hci_core.c hci_req_sync_lock(hdev); hdev 153 net/bluetooth/hci_core.c err = hdev->set_diag(hdev, enable); hdev 154 net/bluetooth/hci_core.c hci_req_sync_unlock(hdev); hdev 161 net/bluetooth/hci_core.c hci_dev_set_flag(hdev, HCI_VENDOR_DIAG); hdev 163 net/bluetooth/hci_core.c hci_dev_clear_flag(hdev, HCI_VENDOR_DIAG); hdev 175 net/bluetooth/hci_core.c static void hci_debugfs_create_basic(struct hci_dev *hdev) hdev 177 net/bluetooth/hci_core.c debugfs_create_file("dut_mode", 0644, hdev->debugfs, hdev, hdev 180 net/bluetooth/hci_core.c if (hdev->set_diag) hdev 181 net/bluetooth/hci_core.c debugfs_create_file("vendor_diag", 0644, hdev->debugfs, hdev, hdev 187 net/bluetooth/hci_core.c BT_DBG("%s %ld", req->hdev->name, opt); hdev 190 net/bluetooth/hci_core.c set_bit(HCI_RESET, &req->hdev->flags); hdev 197 net/bluetooth/hci_core.c req->hdev->flow_ctl_mode = HCI_FLOW_CTL_MODE_PACKET_BASED; hdev 211 net/bluetooth/hci_core.c req->hdev->flow_ctl_mode = HCI_FLOW_CTL_MODE_BLOCK_BASED; hdev 238 net/bluetooth/hci_core.c if (req->hdev->commands[14] & 0x20) hdev 246 net/bluetooth/hci_core.c struct hci_dev *hdev = req->hdev; hdev 248 net/bluetooth/hci_core.c BT_DBG("%s %ld", hdev->name, opt); hdev 251 net/bluetooth/hci_core.c if (!test_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks)) hdev 254 net/bluetooth/hci_core.c switch (hdev->dev_type) { hdev 262 net/bluetooth/hci_core.c bt_dev_err(hdev, "Unknown device type %d", hdev->dev_type); hdev 303 net/bluetooth/hci_core.c struct hci_dev *hdev = req->hdev; hdev 315 net/bluetooth/hci_core.c if (!lmp_bredr_capable(hdev)) hdev 316 net/bluetooth/hci_core.c hci_dev_set_flag(hdev, HCI_LE_ENABLED); hdev 321 net/bluetooth/hci_core.c struct hci_dev *hdev = req->hdev; hdev 332 net/bluetooth/hci_core.c if (hdev->hci_ver < BLUETOOTH_VER_1_2) hdev 335 net/bluetooth/hci_core.c if (lmp_bredr_capable(hdev)) { hdev 348 net/bluetooth/hci_core.c if (hdev->commands[0] & 0x20) { hdev 357 net/bluetooth/hci_core.c if (hdev->commands[2] & 0x80) hdev 362 net/bluetooth/hci_core.c if (hdev->le_features[0] & HCI_LE_ENCRYPTION) { hdev 368 net/bluetooth/hci_core.c if (lmp_inq_rssi_capable(hdev) || hdev 369 net/bluetooth/hci_core.c test_bit(HCI_QUIRK_FIXUP_INQUIRY_MODE, &hdev->quirks)) hdev 372 net/bluetooth/hci_core.c if (lmp_ext_feat_capable(hdev)) hdev 375 net/bluetooth/hci_core.c if (lmp_esco_capable(hdev)) { hdev 380 net/bluetooth/hci_core.c if (lmp_sniffsubr_capable(hdev)) hdev 383 net/bluetooth/hci_core.c if (lmp_pause_enc_capable(hdev)) hdev 386 net/bluetooth/hci_core.c if (lmp_ext_inq_capable(hdev)) hdev 389 net/bluetooth/hci_core.c if (lmp_no_flush_capable(hdev)) hdev 392 net/bluetooth/hci_core.c if (lmp_lsto_capable(hdev)) hdev 395 net/bluetooth/hci_core.c if (lmp_ssp_capable(hdev)) { hdev 409 net/bluetooth/hci_core.c if (lmp_le_capable(hdev)) hdev 417 net/bluetooth/hci_core.c struct hci_dev *hdev = req->hdev; hdev 419 net/bluetooth/hci_core.c if (hdev->dev_type == HCI_AMP) hdev 422 net/bluetooth/hci_core.c if (lmp_bredr_capable(hdev)) hdev 425 net/bluetooth/hci_core.c hci_dev_clear_flag(hdev, HCI_BREDR_ENABLED); hdev 427 net/bluetooth/hci_core.c if (lmp_le_capable(hdev)) hdev 438 net/bluetooth/hci_core.c if (hdev->hci_ver > BLUETOOTH_VER_1_1 && hdev 439 net/bluetooth/hci_core.c !test_bit(HCI_QUIRK_BROKEN_LOCAL_COMMANDS, &hdev->quirks)) hdev 442 net/bluetooth/hci_core.c if (lmp_ssp_capable(hdev)) { hdev 449 net/bluetooth/hci_core.c hdev->max_page = 0x01; hdev 451 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_SSP_ENABLED)) { hdev 459 net/bluetooth/hci_core.c memset(hdev->eir, 0, sizeof(hdev->eir)); hdev 466 net/bluetooth/hci_core.c if (lmp_inq_rssi_capable(hdev) || hdev 467 net/bluetooth/hci_core.c test_bit(HCI_QUIRK_FIXUP_INQUIRY_MODE, &hdev->quirks)) { hdev 474 net/bluetooth/hci_core.c mode = lmp_ext_inq_capable(hdev) ? 0x02 : 0x01; hdev 479 net/bluetooth/hci_core.c if (lmp_inq_tx_pwr_capable(hdev)) hdev 482 net/bluetooth/hci_core.c if (lmp_ext_feat_capable(hdev)) { hdev 490 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_LINK_SECURITY)) { hdev 501 net/bluetooth/hci_core.c struct hci_dev *hdev = req->hdev; hdev 505 net/bluetooth/hci_core.c if (lmp_rswitch_capable(hdev)) hdev 507 net/bluetooth/hci_core.c if (lmp_hold_capable(hdev)) hdev 509 net/bluetooth/hci_core.c if (lmp_sniff_capable(hdev)) hdev 511 net/bluetooth/hci_core.c if (lmp_park_capable(hdev)) hdev 520 net/bluetooth/hci_core.c struct hci_dev *hdev = req->hdev; hdev 524 net/bluetooth/hci_core.c if (!lmp_bredr_capable(hdev)) hdev 529 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_LE_ENABLED)) { hdev 534 net/bluetooth/hci_core.c if (cp.le != lmp_host_le_capable(hdev)) hdev 541 net/bluetooth/hci_core.c struct hci_dev *hdev = req->hdev; hdev 548 net/bluetooth/hci_core.c if (lmp_csb_master_capable(hdev)) { hdev 559 net/bluetooth/hci_core.c if (lmp_csb_slave_capable(hdev)) { hdev 568 net/bluetooth/hci_core.c if (lmp_ping_capable(hdev) || hdev->le_features[0] & HCI_LE_PING) { hdev 586 net/bluetooth/hci_core.c struct hci_dev *hdev = req->hdev; hdev 591 net/bluetooth/hci_core.c if (hdev->commands[6] & 0x20 && hdev 592 net/bluetooth/hci_core.c !test_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks)) { hdev 600 net/bluetooth/hci_core.c if (hdev->commands[5] & 0x10) hdev 603 net/bluetooth/hci_core.c if (hdev->commands[8] & 0x01) hdev 610 net/bluetooth/hci_core.c if (hdev->commands[13] & 0x01) hdev 613 net/bluetooth/hci_core.c if (lmp_le_capable(hdev)) { hdev 618 net/bluetooth/hci_core.c if (hdev->le_features[0] & HCI_LE_ENCRYPTION) hdev 624 net/bluetooth/hci_core.c if (hdev->le_features[0] & HCI_LE_CONN_PARAM_REQ_PROC) hdev 632 net/bluetooth/hci_core.c if (hdev->le_features[0] & HCI_LE_DATA_LEN_EXT) hdev 638 net/bluetooth/hci_core.c if (hdev->le_features[0] & HCI_LE_EXT_SCAN_POLICY) hdev 646 net/bluetooth/hci_core.c if (hdev->le_features[1] & HCI_LE_CHAN_SEL_ALG2) hdev 654 net/bluetooth/hci_core.c if (hdev->commands[26] & 0x08) hdev 660 net/bluetooth/hci_core.c if (hdev->commands[26] & 0x10) hdev 666 net/bluetooth/hci_core.c if (hdev->commands[27] & 0x04) hdev 674 net/bluetooth/hci_core.c if (hdev->commands[27] & 0x20) hdev 682 net/bluetooth/hci_core.c if (hdev->commands[34] & 0x02) hdev 690 net/bluetooth/hci_core.c if (hdev->commands[34] & 0x04) hdev 696 net/bluetooth/hci_core.c if (hdev->commands[35] & (0x20 | 0x40)) hdev 703 net/bluetooth/hci_core.c if (use_ext_scan(hdev)) hdev 711 net/bluetooth/hci_core.c if (use_ext_conn(hdev)) hdev 719 net/bluetooth/hci_core.c if (ext_adv_capable(hdev)) hdev 728 net/bluetooth/hci_core.c if ((hdev->commands[25] & 0x40) && !ext_adv_capable(hdev)) { hdev 738 net/bluetooth/hci_core.c if (hdev->commands[26] & 0x40) { hdev 744 net/bluetooth/hci_core.c if (hdev->commands[26] & 0x80) { hdev 749 net/bluetooth/hci_core.c if (hdev->commands[34] & 0x40) { hdev 755 net/bluetooth/hci_core.c if (hdev->commands[34] & 0x20) { hdev 760 net/bluetooth/hci_core.c if (hdev->le_features[0] & HCI_LE_DATA_LEN_EXT) { hdev 768 net/bluetooth/hci_core.c if (ext_adv_capable(hdev)) { hdev 778 net/bluetooth/hci_core.c for (p = 2; p < HCI_MAX_PAGES && p <= hdev->max_page; p++) { hdev 791 net/bluetooth/hci_core.c struct hci_dev *hdev = req->hdev; hdev 806 net/bluetooth/hci_core.c if (hdev->commands[6] & 0x80 && hdev 807 net/bluetooth/hci_core.c !test_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks)) { hdev 817 net/bluetooth/hci_core.c if (hdev->commands[22] & 0x04) hdev 821 net/bluetooth/hci_core.c if (hdev->commands[29] & 0x20) hdev 825 net/bluetooth/hci_core.c if (hdev->commands[30] & 0x08) hdev 829 net/bluetooth/hci_core.c if (lmp_sync_train_capable(hdev)) hdev 833 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_SSP_ENABLED) && hdev 834 net/bluetooth/hci_core.c bredr_sc_enabled(hdev)) { hdev 842 net/bluetooth/hci_core.c if (hdev->le_features[0] & HCI_LE_DATA_LEN_EXT) { hdev 845 net/bluetooth/hci_core.c cp.tx_len = cpu_to_le16(hdev->le_max_tx_len); hdev 846 net/bluetooth/hci_core.c cp.tx_time = cpu_to_le16(hdev->le_max_tx_time); hdev 851 net/bluetooth/hci_core.c if (hdev->commands[35] & 0x20) { hdev 855 net/bluetooth/hci_core.c cp.tx_phys = hdev->le_tx_def_phys; hdev 856 net/bluetooth/hci_core.c cp.rx_phys = hdev->le_rx_def_phys; hdev 864 net/bluetooth/hci_core.c static int __hci_init(struct hci_dev *hdev) hdev 868 net/bluetooth/hci_core.c err = __hci_req_sync(hdev, hci_init1_req, 0, HCI_INIT_TIMEOUT, NULL); hdev 872 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_SETUP)) hdev 873 net/bluetooth/hci_core.c hci_debugfs_create_basic(hdev); hdev 875 net/bluetooth/hci_core.c err = __hci_req_sync(hdev, hci_init2_req, 0, HCI_INIT_TIMEOUT, NULL); hdev 883 net/bluetooth/hci_core.c if (hdev->dev_type != HCI_PRIMARY) hdev 886 net/bluetooth/hci_core.c err = __hci_req_sync(hdev, hci_init3_req, 0, HCI_INIT_TIMEOUT, NULL); hdev 890 net/bluetooth/hci_core.c err = __hci_req_sync(hdev, hci_init4_req, 0, HCI_INIT_TIMEOUT, NULL); hdev 906 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_SETUP) && hdev 907 net/bluetooth/hci_core.c !hci_dev_test_flag(hdev, HCI_CONFIG)) hdev 910 net/bluetooth/hci_core.c hci_debugfs_create_common(hdev); hdev 912 net/bluetooth/hci_core.c if (lmp_bredr_capable(hdev)) hdev 913 net/bluetooth/hci_core.c hci_debugfs_create_bredr(hdev); hdev 915 net/bluetooth/hci_core.c if (lmp_le_capable(hdev)) hdev 916 net/bluetooth/hci_core.c hci_debugfs_create_le(hdev); hdev 923 net/bluetooth/hci_core.c struct hci_dev *hdev = req->hdev; hdev 925 net/bluetooth/hci_core.c BT_DBG("%s %ld", hdev->name, opt); hdev 928 net/bluetooth/hci_core.c if (!test_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks)) hdev 935 net/bluetooth/hci_core.c if (hdev->set_bdaddr) hdev 941 net/bluetooth/hci_core.c static int __hci_unconf_init(struct hci_dev *hdev) hdev 945 net/bluetooth/hci_core.c if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks)) hdev 948 net/bluetooth/hci_core.c err = __hci_req_sync(hdev, hci_init0_req, 0, HCI_INIT_TIMEOUT, NULL); hdev 952 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_SETUP)) hdev 953 net/bluetooth/hci_core.c hci_debugfs_create_basic(hdev); hdev 962 net/bluetooth/hci_core.c BT_DBG("%s %x", req->hdev->name, scan); hdev 973 net/bluetooth/hci_core.c BT_DBG("%s %x", req->hdev->name, auth); hdev 984 net/bluetooth/hci_core.c BT_DBG("%s %x", req->hdev->name, encrypt); hdev 995 net/bluetooth/hci_core.c BT_DBG("%s %x", req->hdev->name, policy); hdev 1006 net/bluetooth/hci_core.c struct hci_dev *hdev = NULL, *d; hdev 1016 net/bluetooth/hci_core.c hdev = hci_dev_hold(d); hdev 1021 net/bluetooth/hci_core.c return hdev; hdev 1026 net/bluetooth/hci_core.c bool hci_discovery_active(struct hci_dev *hdev) hdev 1028 net/bluetooth/hci_core.c struct discovery_state *discov = &hdev->discovery; hdev 1040 net/bluetooth/hci_core.c void hci_discovery_set_state(struct hci_dev *hdev, int state) hdev 1042 net/bluetooth/hci_core.c int old_state = hdev->discovery.state; hdev 1044 net/bluetooth/hci_core.c BT_DBG("%s state %u -> %u", hdev->name, hdev->discovery.state, state); hdev 1049 net/bluetooth/hci_core.c hdev->discovery.state = state; hdev 1053 net/bluetooth/hci_core.c hci_update_background_scan(hdev); hdev 1056 net/bluetooth/hci_core.c mgmt_discovering(hdev, 0); hdev 1061 net/bluetooth/hci_core.c mgmt_discovering(hdev, 1); hdev 1070 net/bluetooth/hci_core.c void hci_inquiry_cache_flush(struct hci_dev *hdev) hdev 1072 net/bluetooth/hci_core.c struct discovery_state *cache = &hdev->discovery; hdev 1084 net/bluetooth/hci_core.c struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, hdev 1087 net/bluetooth/hci_core.c struct discovery_state *cache = &hdev->discovery; hdev 1100 net/bluetooth/hci_core.c struct inquiry_entry *hci_inquiry_cache_lookup_unknown(struct hci_dev *hdev, hdev 1103 net/bluetooth/hci_core.c struct discovery_state *cache = &hdev->discovery; hdev 1116 net/bluetooth/hci_core.c struct inquiry_entry *hci_inquiry_cache_lookup_resolve(struct hci_dev *hdev, hdev 1120 net/bluetooth/hci_core.c struct discovery_state *cache = &hdev->discovery; hdev 1135 net/bluetooth/hci_core.c void hci_inquiry_cache_update_resolve(struct hci_dev *hdev, hdev 1138 net/bluetooth/hci_core.c struct discovery_state *cache = &hdev->discovery; hdev 1154 net/bluetooth/hci_core.c u32 hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data, hdev 1157 net/bluetooth/hci_core.c struct discovery_state *cache = &hdev->discovery; hdev 1163 net/bluetooth/hci_core.c hci_remove_remote_oob_data(hdev, &data->bdaddr, BDADDR_BREDR); hdev 1168 net/bluetooth/hci_core.c ie = hci_inquiry_cache_lookup(hdev, &data->bdaddr); hdev 1176 net/bluetooth/hci_core.c hci_inquiry_cache_update_resolve(hdev, ie); hdev 1216 net/bluetooth/hci_core.c static int inquiry_cache_dump(struct hci_dev *hdev, int num, __u8 *buf) hdev 1218 net/bluetooth/hci_core.c struct discovery_state *cache = &hdev->discovery; hdev 1247 net/bluetooth/hci_core.c struct hci_dev *hdev = req->hdev; hdev 1250 net/bluetooth/hci_core.c BT_DBG("%s", hdev->name); hdev 1252 net/bluetooth/hci_core.c if (test_bit(HCI_INQUIRY, &hdev->flags)) hdev 1268 net/bluetooth/hci_core.c struct hci_dev *hdev; hdev 1276 net/bluetooth/hci_core.c hdev = hci_dev_get(ir.dev_id); hdev 1277 net/bluetooth/hci_core.c if (!hdev) hdev 1280 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) { hdev 1285 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) { hdev 1290 net/bluetooth/hci_core.c if (hdev->dev_type != HCI_PRIMARY) { hdev 1295 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) { hdev 1300 net/bluetooth/hci_core.c hci_dev_lock(hdev); hdev 1301 net/bluetooth/hci_core.c if (inquiry_cache_age(hdev) > INQUIRY_CACHE_AGE_MAX || hdev 1302 net/bluetooth/hci_core.c inquiry_cache_empty(hdev) || ir.flags & IREQ_CACHE_FLUSH) { hdev 1303 net/bluetooth/hci_core.c hci_inquiry_cache_flush(hdev); hdev 1306 net/bluetooth/hci_core.c hci_dev_unlock(hdev); hdev 1311 net/bluetooth/hci_core.c err = hci_req_sync(hdev, hci_inq_req, (unsigned long) &ir, hdev 1319 net/bluetooth/hci_core.c if (wait_on_bit(&hdev->flags, HCI_INQUIRY, hdev 1338 net/bluetooth/hci_core.c hci_dev_lock(hdev); hdev 1339 net/bluetooth/hci_core.c ir.num_rsp = inquiry_cache_dump(hdev, max_rsp, buf); hdev 1340 net/bluetooth/hci_core.c hci_dev_unlock(hdev); hdev 1355 net/bluetooth/hci_core.c hci_dev_put(hdev); hdev 1371 net/bluetooth/hci_core.c static void hci_dev_get_bd_addr_from_property(struct hci_dev *hdev) hdev 1373 net/bluetooth/hci_core.c struct fwnode_handle *fwnode = dev_fwnode(hdev->dev.parent); hdev 1382 net/bluetooth/hci_core.c bacpy(&hdev->public_addr, &ba); hdev 1385 net/bluetooth/hci_core.c static int hci_dev_do_open(struct hci_dev *hdev) hdev 1389 net/bluetooth/hci_core.c BT_DBG("%s %p", hdev->name, hdev); hdev 1391 net/bluetooth/hci_core.c hci_req_sync_lock(hdev); hdev 1393 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_UNREGISTER)) { hdev 1398 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_SETUP) && hdev 1399 net/bluetooth/hci_core.c !hci_dev_test_flag(hdev, HCI_CONFIG)) { hdev 1403 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_RFKILLED)) { hdev 1420 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_USER_CHANNEL) && hdev 1421 net/bluetooth/hci_core.c hdev->dev_type == HCI_PRIMARY && hdev 1422 net/bluetooth/hci_core.c !bacmp(&hdev->bdaddr, BDADDR_ANY) && hdev 1423 net/bluetooth/hci_core.c !bacmp(&hdev->static_addr, BDADDR_ANY)) { hdev 1429 net/bluetooth/hci_core.c if (test_bit(HCI_UP, &hdev->flags)) { hdev 1434 net/bluetooth/hci_core.c if (hdev->open(hdev)) { hdev 1439 net/bluetooth/hci_core.c set_bit(HCI_RUNNING, &hdev->flags); hdev 1440 net/bluetooth/hci_core.c hci_sock_dev_event(hdev, HCI_DEV_OPEN); hdev 1442 net/bluetooth/hci_core.c atomic_set(&hdev->cmd_cnt, 1); hdev 1443 net/bluetooth/hci_core.c set_bit(HCI_INIT, &hdev->flags); hdev 1445 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_SETUP) || hdev 1446 net/bluetooth/hci_core.c test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) { hdev 1449 net/bluetooth/hci_core.c hci_sock_dev_event(hdev, HCI_DEV_SETUP); hdev 1451 net/bluetooth/hci_core.c if (hdev->setup) hdev 1452 net/bluetooth/hci_core.c ret = hdev->setup(hdev); hdev 1459 net/bluetooth/hci_core.c &hdev->quirks); hdev 1464 net/bluetooth/hci_core.c if (test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks)) { hdev 1465 net/bluetooth/hci_core.c if (!bacmp(&hdev->public_addr, BDADDR_ANY)) hdev 1466 net/bluetooth/hci_core.c hci_dev_get_bd_addr_from_property(hdev); hdev 1468 net/bluetooth/hci_core.c if (bacmp(&hdev->public_addr, BDADDR_ANY) && hdev 1469 net/bluetooth/hci_core.c hdev->set_bdaddr) { hdev 1470 net/bluetooth/hci_core.c ret = hdev->set_bdaddr(hdev, hdev 1471 net/bluetooth/hci_core.c &hdev->public_addr); hdev 1494 net/bluetooth/hci_core.c if (test_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks) || hdev 1496 net/bluetooth/hci_core.c hci_dev_set_flag(hdev, HCI_UNCONFIGURED); hdev 1506 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) hdev 1507 net/bluetooth/hci_core.c ret = __hci_unconf_init(hdev); hdev 1510 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_CONFIG)) { hdev 1516 net/bluetooth/hci_core.c if (bacmp(&hdev->public_addr, BDADDR_ANY) && hdev 1517 net/bluetooth/hci_core.c hdev->set_bdaddr) hdev 1518 net/bluetooth/hci_core.c ret = hdev->set_bdaddr(hdev, &hdev->public_addr); hdev 1524 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_UNCONFIGURED) && hdev 1525 net/bluetooth/hci_core.c !hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) { hdev 1526 net/bluetooth/hci_core.c ret = __hci_init(hdev); hdev 1527 net/bluetooth/hci_core.c if (!ret && hdev->post_init) hdev 1528 net/bluetooth/hci_core.c ret = hdev->post_init(hdev); hdev 1536 net/bluetooth/hci_core.c if (test_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks) && hdev 1537 net/bluetooth/hci_core.c !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) && hdev 1538 net/bluetooth/hci_core.c hci_dev_test_flag(hdev, HCI_VENDOR_DIAG) && hdev->set_diag) hdev 1539 net/bluetooth/hci_core.c ret = hdev->set_diag(hdev, true); hdev 1541 net/bluetooth/hci_core.c clear_bit(HCI_INIT, &hdev->flags); hdev 1544 net/bluetooth/hci_core.c hci_dev_hold(hdev); hdev 1545 net/bluetooth/hci_core.c hci_dev_set_flag(hdev, HCI_RPA_EXPIRED); hdev 1546 net/bluetooth/hci_core.c hci_adv_instances_set_rpa_expired(hdev, true); hdev 1547 net/bluetooth/hci_core.c set_bit(HCI_UP, &hdev->flags); hdev 1548 net/bluetooth/hci_core.c hci_sock_dev_event(hdev, HCI_DEV_UP); hdev 1549 net/bluetooth/hci_core.c hci_leds_update_powered(hdev, true); hdev 1550 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_SETUP) && hdev 1551 net/bluetooth/hci_core.c !hci_dev_test_flag(hdev, HCI_CONFIG) && hdev 1552 net/bluetooth/hci_core.c !hci_dev_test_flag(hdev, HCI_UNCONFIGURED) && hdev 1553 net/bluetooth/hci_core.c !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) && hdev 1554 net/bluetooth/hci_core.c hci_dev_test_flag(hdev, HCI_MGMT) && hdev 1555 net/bluetooth/hci_core.c hdev->dev_type == HCI_PRIMARY) { hdev 1556 net/bluetooth/hci_core.c ret = __hci_req_hci_power_on(hdev); hdev 1557 net/bluetooth/hci_core.c mgmt_power_on(hdev, ret); hdev 1561 net/bluetooth/hci_core.c flush_work(&hdev->tx_work); hdev 1562 net/bluetooth/hci_core.c flush_work(&hdev->cmd_work); hdev 1563 net/bluetooth/hci_core.c flush_work(&hdev->rx_work); hdev 1565 net/bluetooth/hci_core.c skb_queue_purge(&hdev->cmd_q); hdev 1566 net/bluetooth/hci_core.c skb_queue_purge(&hdev->rx_q); hdev 1568 net/bluetooth/hci_core.c if (hdev->flush) hdev 1569 net/bluetooth/hci_core.c hdev->flush(hdev); hdev 1571 net/bluetooth/hci_core.c if (hdev->sent_cmd) { hdev 1572 net/bluetooth/hci_core.c kfree_skb(hdev->sent_cmd); hdev 1573 net/bluetooth/hci_core.c hdev->sent_cmd = NULL; hdev 1576 net/bluetooth/hci_core.c clear_bit(HCI_RUNNING, &hdev->flags); hdev 1577 net/bluetooth/hci_core.c hci_sock_dev_event(hdev, HCI_DEV_CLOSE); hdev 1579 net/bluetooth/hci_core.c hdev->close(hdev); hdev 1580 net/bluetooth/hci_core.c hdev->flags &= BIT(HCI_RAW); hdev 1584 net/bluetooth/hci_core.c hci_req_sync_unlock(hdev); hdev 1592 net/bluetooth/hci_core.c struct hci_dev *hdev; hdev 1595 net/bluetooth/hci_core.c hdev = hci_dev_get(dev); hdev 1596 net/bluetooth/hci_core.c if (!hdev) hdev 1608 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED) && hdev 1609 net/bluetooth/hci_core.c !hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) { hdev 1619 net/bluetooth/hci_core.c if (hci_dev_test_and_clear_flag(hdev, HCI_AUTO_OFF)) hdev 1620 net/bluetooth/hci_core.c cancel_delayed_work(&hdev->power_off); hdev 1626 net/bluetooth/hci_core.c flush_workqueue(hdev->req_workqueue); hdev 1634 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_USER_CHANNEL) && hdev 1635 net/bluetooth/hci_core.c !hci_dev_test_flag(hdev, HCI_MGMT)) hdev 1636 net/bluetooth/hci_core.c hci_dev_set_flag(hdev, HCI_BONDABLE); hdev 1638 net/bluetooth/hci_core.c err = hci_dev_do_open(hdev); hdev 1641 net/bluetooth/hci_core.c hci_dev_put(hdev); hdev 1646 net/bluetooth/hci_core.c static void hci_pend_le_actions_clear(struct hci_dev *hdev) hdev 1650 net/bluetooth/hci_core.c list_for_each_entry(p, &hdev->le_conn_params, list) { hdev 1662 net/bluetooth/hci_core.c int hci_dev_do_close(struct hci_dev *hdev) hdev 1666 net/bluetooth/hci_core.c BT_DBG("%s %p", hdev->name, hdev); hdev 1668 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_UNREGISTER) && hdev 1669 net/bluetooth/hci_core.c !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) && hdev 1670 net/bluetooth/hci_core.c test_bit(HCI_UP, &hdev->flags)) { hdev 1672 net/bluetooth/hci_core.c if (hdev->shutdown) hdev 1673 net/bluetooth/hci_core.c hdev->shutdown(hdev); hdev 1676 net/bluetooth/hci_core.c cancel_delayed_work(&hdev->power_off); hdev 1678 net/bluetooth/hci_core.c hci_request_cancel_all(hdev); hdev 1679 net/bluetooth/hci_core.c hci_req_sync_lock(hdev); hdev 1681 net/bluetooth/hci_core.c if (!test_and_clear_bit(HCI_UP, &hdev->flags)) { hdev 1682 net/bluetooth/hci_core.c cancel_delayed_work_sync(&hdev->cmd_timer); hdev 1683 net/bluetooth/hci_core.c hci_req_sync_unlock(hdev); hdev 1687 net/bluetooth/hci_core.c hci_leds_update_powered(hdev, false); hdev 1690 net/bluetooth/hci_core.c flush_work(&hdev->tx_work); hdev 1691 net/bluetooth/hci_core.c flush_work(&hdev->rx_work); hdev 1693 net/bluetooth/hci_core.c if (hdev->discov_timeout > 0) { hdev 1694 net/bluetooth/hci_core.c hdev->discov_timeout = 0; hdev 1695 net/bluetooth/hci_core.c hci_dev_clear_flag(hdev, HCI_DISCOVERABLE); hdev 1696 net/bluetooth/hci_core.c hci_dev_clear_flag(hdev, HCI_LIMITED_DISCOVERABLE); hdev 1699 net/bluetooth/hci_core.c if (hci_dev_test_and_clear_flag(hdev, HCI_SERVICE_CACHE)) hdev 1700 net/bluetooth/hci_core.c cancel_delayed_work(&hdev->service_cache); hdev 1702 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_MGMT)) { hdev 1705 net/bluetooth/hci_core.c cancel_delayed_work_sync(&hdev->rpa_expired); hdev 1707 net/bluetooth/hci_core.c list_for_each_entry(adv_instance, &hdev->adv_instances, list) hdev 1714 net/bluetooth/hci_core.c drain_workqueue(hdev->workqueue); hdev 1716 net/bluetooth/hci_core.c hci_dev_lock(hdev); hdev 1718 net/bluetooth/hci_core.c hci_discovery_set_state(hdev, DISCOVERY_STOPPED); hdev 1720 net/bluetooth/hci_core.c auto_off = hci_dev_test_and_clear_flag(hdev, HCI_AUTO_OFF); hdev 1722 net/bluetooth/hci_core.c if (!auto_off && hdev->dev_type == HCI_PRIMARY && hdev 1723 net/bluetooth/hci_core.c !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) && hdev 1724 net/bluetooth/hci_core.c hci_dev_test_flag(hdev, HCI_MGMT)) hdev 1725 net/bluetooth/hci_core.c __mgmt_power_off(hdev); hdev 1727 net/bluetooth/hci_core.c hci_inquiry_cache_flush(hdev); hdev 1728 net/bluetooth/hci_core.c hci_pend_le_actions_clear(hdev); hdev 1729 net/bluetooth/hci_core.c hci_conn_hash_flush(hdev); hdev 1730 net/bluetooth/hci_core.c hci_dev_unlock(hdev); hdev 1732 net/bluetooth/hci_core.c smp_unregister(hdev); hdev 1734 net/bluetooth/hci_core.c hci_sock_dev_event(hdev, HCI_DEV_DOWN); hdev 1736 net/bluetooth/hci_core.c if (hdev->flush) hdev 1737 net/bluetooth/hci_core.c hdev->flush(hdev); hdev 1740 net/bluetooth/hci_core.c skb_queue_purge(&hdev->cmd_q); hdev 1741 net/bluetooth/hci_core.c atomic_set(&hdev->cmd_cnt, 1); hdev 1742 net/bluetooth/hci_core.c if (test_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks) && hdev 1743 net/bluetooth/hci_core.c !auto_off && !hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) { hdev 1744 net/bluetooth/hci_core.c set_bit(HCI_INIT, &hdev->flags); hdev 1745 net/bluetooth/hci_core.c __hci_req_sync(hdev, hci_reset_req, 0, HCI_CMD_TIMEOUT, NULL); hdev 1746 net/bluetooth/hci_core.c clear_bit(HCI_INIT, &hdev->flags); hdev 1750 net/bluetooth/hci_core.c flush_work(&hdev->cmd_work); hdev 1753 net/bluetooth/hci_core.c skb_queue_purge(&hdev->rx_q); hdev 1754 net/bluetooth/hci_core.c skb_queue_purge(&hdev->cmd_q); hdev 1755 net/bluetooth/hci_core.c skb_queue_purge(&hdev->raw_q); hdev 1758 net/bluetooth/hci_core.c if (hdev->sent_cmd) { hdev 1759 net/bluetooth/hci_core.c cancel_delayed_work_sync(&hdev->cmd_timer); hdev 1760 net/bluetooth/hci_core.c kfree_skb(hdev->sent_cmd); hdev 1761 net/bluetooth/hci_core.c hdev->sent_cmd = NULL; hdev 1764 net/bluetooth/hci_core.c clear_bit(HCI_RUNNING, &hdev->flags); hdev 1765 net/bluetooth/hci_core.c hci_sock_dev_event(hdev, HCI_DEV_CLOSE); hdev 1769 net/bluetooth/hci_core.c hdev->close(hdev); hdev 1772 net/bluetooth/hci_core.c hdev->flags &= BIT(HCI_RAW); hdev 1773 net/bluetooth/hci_core.c hci_dev_clear_volatile_flags(hdev); hdev 1776 net/bluetooth/hci_core.c hdev->amp_status = AMP_STATUS_POWERED_DOWN; hdev 1778 net/bluetooth/hci_core.c memset(hdev->eir, 0, sizeof(hdev->eir)); hdev 1779 net/bluetooth/hci_core.c memset(hdev->dev_class, 0, sizeof(hdev->dev_class)); hdev 1780 net/bluetooth/hci_core.c bacpy(&hdev->random_addr, BDADDR_ANY); hdev 1782 net/bluetooth/hci_core.c hci_req_sync_unlock(hdev); hdev 1784 net/bluetooth/hci_core.c hci_dev_put(hdev); hdev 1790 net/bluetooth/hci_core.c struct hci_dev *hdev; hdev 1793 net/bluetooth/hci_core.c hdev = hci_dev_get(dev); hdev 1794 net/bluetooth/hci_core.c if (!hdev) hdev 1797 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) { hdev 1802 net/bluetooth/hci_core.c if (hci_dev_test_and_clear_flag(hdev, HCI_AUTO_OFF)) hdev 1803 net/bluetooth/hci_core.c cancel_delayed_work(&hdev->power_off); hdev 1805 net/bluetooth/hci_core.c err = hci_dev_do_close(hdev); hdev 1808 net/bluetooth/hci_core.c hci_dev_put(hdev); hdev 1812 net/bluetooth/hci_core.c static int hci_dev_do_reset(struct hci_dev *hdev) hdev 1816 net/bluetooth/hci_core.c BT_DBG("%s %p", hdev->name, hdev); hdev 1818 net/bluetooth/hci_core.c hci_req_sync_lock(hdev); hdev 1821 net/bluetooth/hci_core.c skb_queue_purge(&hdev->rx_q); hdev 1822 net/bluetooth/hci_core.c skb_queue_purge(&hdev->cmd_q); hdev 1827 net/bluetooth/hci_core.c drain_workqueue(hdev->workqueue); hdev 1829 net/bluetooth/hci_core.c hci_dev_lock(hdev); hdev 1830 net/bluetooth/hci_core.c hci_inquiry_cache_flush(hdev); hdev 1831 net/bluetooth/hci_core.c hci_conn_hash_flush(hdev); hdev 1832 net/bluetooth/hci_core.c hci_dev_unlock(hdev); hdev 1834 net/bluetooth/hci_core.c if (hdev->flush) hdev 1835 net/bluetooth/hci_core.c hdev->flush(hdev); hdev 1837 net/bluetooth/hci_core.c atomic_set(&hdev->cmd_cnt, 1); hdev 1838 net/bluetooth/hci_core.c hdev->acl_cnt = 0; hdev->sco_cnt = 0; hdev->le_cnt = 0; hdev 1840 net/bluetooth/hci_core.c ret = __hci_req_sync(hdev, hci_reset_req, 0, HCI_INIT_TIMEOUT, NULL); hdev 1842 net/bluetooth/hci_core.c hci_req_sync_unlock(hdev); hdev 1848 net/bluetooth/hci_core.c struct hci_dev *hdev; hdev 1851 net/bluetooth/hci_core.c hdev = hci_dev_get(dev); hdev 1852 net/bluetooth/hci_core.c if (!hdev) hdev 1855 net/bluetooth/hci_core.c if (!test_bit(HCI_UP, &hdev->flags)) { hdev 1860 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) { hdev 1865 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) { hdev 1870 net/bluetooth/hci_core.c err = hci_dev_do_reset(hdev); hdev 1873 net/bluetooth/hci_core.c hci_dev_put(hdev); hdev 1879 net/bluetooth/hci_core.c struct hci_dev *hdev; hdev 1882 net/bluetooth/hci_core.c hdev = hci_dev_get(dev); hdev 1883 net/bluetooth/hci_core.c if (!hdev) hdev 1886 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) { hdev 1891 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) { hdev 1896 net/bluetooth/hci_core.c memset(&hdev->stat, 0, sizeof(struct hci_dev_stats)); hdev 1899 net/bluetooth/hci_core.c hci_dev_put(hdev); hdev 1903 net/bluetooth/hci_core.c static void hci_update_scan_state(struct hci_dev *hdev, u8 scan) hdev 1907 net/bluetooth/hci_core.c BT_DBG("%s scan 0x%02x", hdev->name, scan); hdev 1910 net/bluetooth/hci_core.c conn_changed = !hci_dev_test_and_set_flag(hdev, hdev 1913 net/bluetooth/hci_core.c conn_changed = hci_dev_test_and_clear_flag(hdev, hdev 1917 net/bluetooth/hci_core.c discov_changed = !hci_dev_test_and_set_flag(hdev, hdev 1920 net/bluetooth/hci_core.c hci_dev_clear_flag(hdev, HCI_LIMITED_DISCOVERABLE); hdev 1921 net/bluetooth/hci_core.c discov_changed = hci_dev_test_and_clear_flag(hdev, hdev 1925 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_MGMT)) hdev 1930 net/bluetooth/hci_core.c hci_dev_set_flag(hdev, HCI_BREDR_ENABLED); hdev 1932 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_LE_ENABLED)) hdev 1933 net/bluetooth/hci_core.c hci_req_update_adv_data(hdev, hdev->cur_adv_instance); hdev 1935 net/bluetooth/hci_core.c mgmt_new_settings(hdev); hdev 1941 net/bluetooth/hci_core.c struct hci_dev *hdev; hdev 1948 net/bluetooth/hci_core.c hdev = hci_dev_get(dr.dev_id); hdev 1949 net/bluetooth/hci_core.c if (!hdev) hdev 1952 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) { hdev 1957 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) { hdev 1962 net/bluetooth/hci_core.c if (hdev->dev_type != HCI_PRIMARY) { hdev 1967 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) { hdev 1974 net/bluetooth/hci_core.c err = hci_req_sync(hdev, hci_auth_req, dr.dev_opt, hdev 1979 net/bluetooth/hci_core.c if (!lmp_encrypt_capable(hdev)) { hdev 1984 net/bluetooth/hci_core.c if (!test_bit(HCI_AUTH, &hdev->flags)) { hdev 1986 net/bluetooth/hci_core.c err = hci_req_sync(hdev, hci_auth_req, dr.dev_opt, hdev 1992 net/bluetooth/hci_core.c err = hci_req_sync(hdev, hci_encrypt_req, dr.dev_opt, hdev 1997 net/bluetooth/hci_core.c err = hci_req_sync(hdev, hci_scan_req, dr.dev_opt, hdev 2004 net/bluetooth/hci_core.c hci_update_scan_state(hdev, dr.dev_opt); hdev 2008 net/bluetooth/hci_core.c err = hci_req_sync(hdev, hci_linkpol_req, dr.dev_opt, hdev 2013 net/bluetooth/hci_core.c hdev->link_mode = ((__u16) dr.dev_opt) & hdev 2018 net/bluetooth/hci_core.c if (hdev->pkt_type == (__u16) dr.dev_opt) hdev 2021 net/bluetooth/hci_core.c hdev->pkt_type = (__u16) dr.dev_opt; hdev 2022 net/bluetooth/hci_core.c mgmt_phy_configuration_changed(hdev, NULL); hdev 2026 net/bluetooth/hci_core.c hdev->acl_mtu = *((__u16 *) &dr.dev_opt + 1); hdev 2027 net/bluetooth/hci_core.c hdev->acl_pkts = *((__u16 *) &dr.dev_opt + 0); hdev 2031 net/bluetooth/hci_core.c hdev->sco_mtu = *((__u16 *) &dr.dev_opt + 1); hdev 2032 net/bluetooth/hci_core.c hdev->sco_pkts = *((__u16 *) &dr.dev_opt + 0); hdev 2041 net/bluetooth/hci_core.c hci_dev_put(hdev); hdev 2047 net/bluetooth/hci_core.c struct hci_dev *hdev; hdev 2068 net/bluetooth/hci_core.c list_for_each_entry(hdev, &hci_dev_list, list) { hdev 2069 net/bluetooth/hci_core.c unsigned long flags = hdev->flags; hdev 2075 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_AUTO_OFF)) hdev 2078 net/bluetooth/hci_core.c (dr + n)->dev_id = hdev->id; hdev 2097 net/bluetooth/hci_core.c struct hci_dev *hdev; hdev 2105 net/bluetooth/hci_core.c hdev = hci_dev_get(di.dev_id); hdev 2106 net/bluetooth/hci_core.c if (!hdev) hdev 2113 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_AUTO_OFF)) hdev 2114 net/bluetooth/hci_core.c flags = hdev->flags & ~BIT(HCI_UP); hdev 2116 net/bluetooth/hci_core.c flags = hdev->flags; hdev 2118 net/bluetooth/hci_core.c strcpy(di.name, hdev->name); hdev 2119 net/bluetooth/hci_core.c di.bdaddr = hdev->bdaddr; hdev 2120 net/bluetooth/hci_core.c di.type = (hdev->bus & 0x0f) | ((hdev->dev_type & 0x03) << 4); hdev 2122 net/bluetooth/hci_core.c di.pkt_type = hdev->pkt_type; hdev 2123 net/bluetooth/hci_core.c if (lmp_bredr_capable(hdev)) { hdev 2124 net/bluetooth/hci_core.c di.acl_mtu = hdev->acl_mtu; hdev 2125 net/bluetooth/hci_core.c di.acl_pkts = hdev->acl_pkts; hdev 2126 net/bluetooth/hci_core.c di.sco_mtu = hdev->sco_mtu; hdev 2127 net/bluetooth/hci_core.c di.sco_pkts = hdev->sco_pkts; hdev 2129 net/bluetooth/hci_core.c di.acl_mtu = hdev->le_mtu; hdev 2130 net/bluetooth/hci_core.c di.acl_pkts = hdev->le_pkts; hdev 2134 net/bluetooth/hci_core.c di.link_policy = hdev->link_policy; hdev 2135 net/bluetooth/hci_core.c di.link_mode = hdev->link_mode; hdev 2137 net/bluetooth/hci_core.c memcpy(&di.stat, &hdev->stat, sizeof(di.stat)); hdev 2138 net/bluetooth/hci_core.c memcpy(&di.features, &hdev->features, sizeof(di.features)); hdev 2143 net/bluetooth/hci_core.c hci_dev_put(hdev); hdev 2152 net/bluetooth/hci_core.c struct hci_dev *hdev = data; hdev 2154 net/bluetooth/hci_core.c BT_DBG("%p name %s blocked %d", hdev, hdev->name, blocked); hdev 2156 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) hdev 2160 net/bluetooth/hci_core.c hci_dev_set_flag(hdev, HCI_RFKILLED); hdev 2161 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_SETUP) && hdev 2162 net/bluetooth/hci_core.c !hci_dev_test_flag(hdev, HCI_CONFIG)) hdev 2163 net/bluetooth/hci_core.c hci_dev_do_close(hdev); hdev 2165 net/bluetooth/hci_core.c hci_dev_clear_flag(hdev, HCI_RFKILLED); hdev 2177 net/bluetooth/hci_core.c struct hci_dev *hdev = container_of(work, struct hci_dev, power_on); hdev 2180 net/bluetooth/hci_core.c BT_DBG("%s", hdev->name); hdev 2182 net/bluetooth/hci_core.c if (test_bit(HCI_UP, &hdev->flags) && hdev 2183 net/bluetooth/hci_core.c hci_dev_test_flag(hdev, HCI_MGMT) && hdev 2184 net/bluetooth/hci_core.c hci_dev_test_and_clear_flag(hdev, HCI_AUTO_OFF)) { hdev 2185 net/bluetooth/hci_core.c cancel_delayed_work(&hdev->power_off); hdev 2186 net/bluetooth/hci_core.c hci_req_sync_lock(hdev); hdev 2187 net/bluetooth/hci_core.c err = __hci_req_hci_power_on(hdev); hdev 2188 net/bluetooth/hci_core.c hci_req_sync_unlock(hdev); hdev 2189 net/bluetooth/hci_core.c mgmt_power_on(hdev, err); hdev 2193 net/bluetooth/hci_core.c err = hci_dev_do_open(hdev); hdev 2195 net/bluetooth/hci_core.c hci_dev_lock(hdev); hdev 2196 net/bluetooth/hci_core.c mgmt_set_powered_failed(hdev, err); hdev 2197 net/bluetooth/hci_core.c hci_dev_unlock(hdev); hdev 2205 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_RFKILLED) || hdev 2206 net/bluetooth/hci_core.c hci_dev_test_flag(hdev, HCI_UNCONFIGURED) || hdev 2207 net/bluetooth/hci_core.c (hdev->dev_type == HCI_PRIMARY && hdev 2208 net/bluetooth/hci_core.c !bacmp(&hdev->bdaddr, BDADDR_ANY) && hdev 2209 net/bluetooth/hci_core.c !bacmp(&hdev->static_addr, BDADDR_ANY))) { hdev 2210 net/bluetooth/hci_core.c hci_dev_clear_flag(hdev, HCI_AUTO_OFF); hdev 2211 net/bluetooth/hci_core.c hci_dev_do_close(hdev); hdev 2212 net/bluetooth/hci_core.c } else if (hci_dev_test_flag(hdev, HCI_AUTO_OFF)) { hdev 2213 net/bluetooth/hci_core.c queue_delayed_work(hdev->req_workqueue, &hdev->power_off, hdev 2217 net/bluetooth/hci_core.c if (hci_dev_test_and_clear_flag(hdev, HCI_SETUP)) { hdev 2221 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) hdev 2222 net/bluetooth/hci_core.c set_bit(HCI_RAW, &hdev->flags); hdev 2231 net/bluetooth/hci_core.c mgmt_index_added(hdev); hdev 2232 net/bluetooth/hci_core.c } else if (hci_dev_test_and_clear_flag(hdev, HCI_CONFIG)) { hdev 2236 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) hdev 2237 net/bluetooth/hci_core.c clear_bit(HCI_RAW, &hdev->flags); hdev 2243 net/bluetooth/hci_core.c mgmt_index_added(hdev); hdev 2249 net/bluetooth/hci_core.c struct hci_dev *hdev = container_of(work, struct hci_dev, hdev 2252 net/bluetooth/hci_core.c BT_DBG("%s", hdev->name); hdev 2254 net/bluetooth/hci_core.c hci_dev_do_close(hdev); hdev 2259 net/bluetooth/hci_core.c struct hci_dev *hdev = container_of(work, struct hci_dev, error_reset); hdev 2261 net/bluetooth/hci_core.c BT_DBG("%s", hdev->name); hdev 2263 net/bluetooth/hci_core.c if (hdev->hw_error) hdev 2264 net/bluetooth/hci_core.c hdev->hw_error(hdev, hdev->hw_error_code); hdev 2266 net/bluetooth/hci_core.c bt_dev_err(hdev, "hardware error 0x%2.2x", hdev->hw_error_code); hdev 2268 net/bluetooth/hci_core.c if (hci_dev_do_close(hdev)) hdev 2271 net/bluetooth/hci_core.c hci_dev_do_open(hdev); hdev 2274 net/bluetooth/hci_core.c void hci_uuids_clear(struct hci_dev *hdev) hdev 2278 net/bluetooth/hci_core.c list_for_each_entry_safe(uuid, tmp, &hdev->uuids, list) { hdev 2284 net/bluetooth/hci_core.c void hci_link_keys_clear(struct hci_dev *hdev) hdev 2288 net/bluetooth/hci_core.c list_for_each_entry_rcu(key, &hdev->link_keys, list) { hdev 2294 net/bluetooth/hci_core.c void hci_smp_ltks_clear(struct hci_dev *hdev) hdev 2298 net/bluetooth/hci_core.c list_for_each_entry_rcu(k, &hdev->long_term_keys, list) { hdev 2304 net/bluetooth/hci_core.c void hci_smp_irks_clear(struct hci_dev *hdev) hdev 2308 net/bluetooth/hci_core.c list_for_each_entry_rcu(k, &hdev->identity_resolving_keys, list) { hdev 2314 net/bluetooth/hci_core.c struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr) hdev 2319 net/bluetooth/hci_core.c list_for_each_entry_rcu(k, &hdev->link_keys, list) { hdev 2330 net/bluetooth/hci_core.c static bool hci_persistent_key(struct hci_dev *hdev, struct hci_conn *conn, hdev 2378 net/bluetooth/hci_core.c struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 2384 net/bluetooth/hci_core.c list_for_each_entry_rcu(k, &hdev->long_term_keys, list) { hdev 2398 net/bluetooth/hci_core.c struct smp_irk *hci_find_irk_by_rpa(struct hci_dev *hdev, bdaddr_t *rpa) hdev 2403 net/bluetooth/hci_core.c list_for_each_entry_rcu(irk, &hdev->identity_resolving_keys, list) { hdev 2410 net/bluetooth/hci_core.c list_for_each_entry_rcu(irk, &hdev->identity_resolving_keys, list) { hdev 2411 net/bluetooth/hci_core.c if (smp_irk_matches(hdev, irk->val, rpa)) { hdev 2422 net/bluetooth/hci_core.c struct smp_irk *hci_find_irk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 2432 net/bluetooth/hci_core.c list_for_each_entry_rcu(irk, &hdev->identity_resolving_keys, list) { hdev 2444 net/bluetooth/hci_core.c struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, hdev 2451 net/bluetooth/hci_core.c old_key = hci_find_link_key(hdev, bdaddr); hdev 2460 net/bluetooth/hci_core.c list_add_rcu(&key->list, &hdev->link_keys); hdev 2463 net/bluetooth/hci_core.c BT_DBG("%s key for %pMR type %u", hdev->name, bdaddr, type); hdev 2485 net/bluetooth/hci_core.c *persistent = hci_persistent_key(hdev, conn, type, hdev 2491 net/bluetooth/hci_core.c struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 2498 net/bluetooth/hci_core.c old_key = hci_find_ltk(hdev, bdaddr, addr_type, role); hdev 2505 net/bluetooth/hci_core.c list_add_rcu(&key->list, &hdev->long_term_keys); hdev 2520 net/bluetooth/hci_core.c struct smp_irk *hci_add_irk(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 2525 net/bluetooth/hci_core.c irk = hci_find_irk_by_addr(hdev, bdaddr, addr_type); hdev 2534 net/bluetooth/hci_core.c list_add_rcu(&irk->list, &hdev->identity_resolving_keys); hdev 2543 net/bluetooth/hci_core.c int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr) hdev 2547 net/bluetooth/hci_core.c key = hci_find_link_key(hdev, bdaddr); hdev 2551 net/bluetooth/hci_core.c BT_DBG("%s removing %pMR", hdev->name, bdaddr); hdev 2559 net/bluetooth/hci_core.c int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type) hdev 2564 net/bluetooth/hci_core.c list_for_each_entry_rcu(k, &hdev->long_term_keys, list) { hdev 2568 net/bluetooth/hci_core.c BT_DBG("%s removing %pMR", hdev->name, bdaddr); hdev 2578 net/bluetooth/hci_core.c void hci_remove_irk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type) hdev 2582 net/bluetooth/hci_core.c list_for_each_entry_rcu(k, &hdev->identity_resolving_keys, list) { hdev 2586 net/bluetooth/hci_core.c BT_DBG("%s removing %pMR", hdev->name, bdaddr); hdev 2593 net/bluetooth/hci_core.c bool hci_bdaddr_is_paired(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type) hdev 2600 net/bluetooth/hci_core.c if (hci_find_link_key(hdev, bdaddr)) hdev 2611 net/bluetooth/hci_core.c irk = hci_get_irk(hdev, bdaddr, addr_type); hdev 2618 net/bluetooth/hci_core.c list_for_each_entry_rcu(k, &hdev->long_term_keys, list) { hdev 2632 net/bluetooth/hci_core.c struct hci_dev *hdev = container_of(work, struct hci_dev, hdev 2635 net/bluetooth/hci_core.c if (hdev->sent_cmd) { hdev 2636 net/bluetooth/hci_core.c struct hci_command_hdr *sent = (void *) hdev->sent_cmd->data; hdev 2639 net/bluetooth/hci_core.c bt_dev_err(hdev, "command 0x%4.4x tx timeout", opcode); hdev 2641 net/bluetooth/hci_core.c bt_dev_err(hdev, "command tx timeout"); hdev 2644 net/bluetooth/hci_core.c if (hdev->cmd_timeout) hdev 2645 net/bluetooth/hci_core.c hdev->cmd_timeout(hdev); hdev 2647 net/bluetooth/hci_core.c atomic_set(&hdev->cmd_cnt, 1); hdev 2648 net/bluetooth/hci_core.c queue_work(hdev->workqueue, &hdev->cmd_work); hdev 2651 net/bluetooth/hci_core.c struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev, hdev 2656 net/bluetooth/hci_core.c list_for_each_entry(data, &hdev->remote_oob_data, list) { hdev 2667 net/bluetooth/hci_core.c int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 2672 net/bluetooth/hci_core.c data = hci_find_remote_oob_data(hdev, bdaddr, bdaddr_type); hdev 2676 net/bluetooth/hci_core.c BT_DBG("%s removing %pMR (%u)", hdev->name, bdaddr, bdaddr_type); hdev 2684 net/bluetooth/hci_core.c void hci_remote_oob_data_clear(struct hci_dev *hdev) hdev 2688 net/bluetooth/hci_core.c list_for_each_entry_safe(data, n, &hdev->remote_oob_data, list) { hdev 2694 net/bluetooth/hci_core.c int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 2700 net/bluetooth/hci_core.c data = hci_find_remote_oob_data(hdev, bdaddr, bdaddr_type); hdev 2708 net/bluetooth/hci_core.c list_add(&data->list, &hdev->remote_oob_data); hdev 2735 net/bluetooth/hci_core.c BT_DBG("%s for %pMR", hdev->name, bdaddr); hdev 2741 net/bluetooth/hci_core.c struct adv_info *hci_find_adv_instance(struct hci_dev *hdev, u8 instance) hdev 2745 net/bluetooth/hci_core.c list_for_each_entry(adv_instance, &hdev->adv_instances, list) { hdev 2754 net/bluetooth/hci_core.c struct adv_info *hci_get_next_instance(struct hci_dev *hdev, u8 instance) hdev 2758 net/bluetooth/hci_core.c cur_instance = hci_find_adv_instance(hdev, instance); hdev 2762 net/bluetooth/hci_core.c if (cur_instance == list_last_entry(&hdev->adv_instances, hdev 2764 net/bluetooth/hci_core.c return list_first_entry(&hdev->adv_instances, hdev 2771 net/bluetooth/hci_core.c int hci_remove_adv_instance(struct hci_dev *hdev, u8 instance) hdev 2775 net/bluetooth/hci_core.c adv_instance = hci_find_adv_instance(hdev, instance); hdev 2779 net/bluetooth/hci_core.c BT_DBG("%s removing %dMR", hdev->name, instance); hdev 2781 net/bluetooth/hci_core.c if (hdev->cur_adv_instance == instance) { hdev 2782 net/bluetooth/hci_core.c if (hdev->adv_instance_timeout) { hdev 2783 net/bluetooth/hci_core.c cancel_delayed_work(&hdev->adv_instance_expire); hdev 2784 net/bluetooth/hci_core.c hdev->adv_instance_timeout = 0; hdev 2786 net/bluetooth/hci_core.c hdev->cur_adv_instance = 0x00; hdev 2794 net/bluetooth/hci_core.c hdev->adv_instance_cnt--; hdev 2799 net/bluetooth/hci_core.c void hci_adv_instances_set_rpa_expired(struct hci_dev *hdev, bool rpa_expired) hdev 2803 net/bluetooth/hci_core.c list_for_each_entry_safe(adv_instance, n, &hdev->adv_instances, list) hdev 2808 net/bluetooth/hci_core.c void hci_adv_instances_clear(struct hci_dev *hdev) hdev 2812 net/bluetooth/hci_core.c if (hdev->adv_instance_timeout) { hdev 2813 net/bluetooth/hci_core.c cancel_delayed_work(&hdev->adv_instance_expire); hdev 2814 net/bluetooth/hci_core.c hdev->adv_instance_timeout = 0; hdev 2817 net/bluetooth/hci_core.c list_for_each_entry_safe(adv_instance, n, &hdev->adv_instances, list) { hdev 2823 net/bluetooth/hci_core.c hdev->adv_instance_cnt = 0; hdev 2824 net/bluetooth/hci_core.c hdev->cur_adv_instance = 0x00; hdev 2838 net/bluetooth/hci_core.c int hci_add_adv_instance(struct hci_dev *hdev, u8 instance, u32 flags, hdev 2845 net/bluetooth/hci_core.c adv_instance = hci_find_adv_instance(hdev, instance); hdev 2852 net/bluetooth/hci_core.c if (hdev->adv_instance_cnt >= hdev->le_num_of_adv_sets || hdev 2862 net/bluetooth/hci_core.c list_add(&adv_instance->list, &hdev->adv_instances); hdev 2863 net/bluetooth/hci_core.c hdev->adv_instance_cnt++; hdev 2890 net/bluetooth/hci_core.c BT_DBG("%s for %dMR", hdev->name, instance); hdev 3023 net/bluetooth/hci_core.c struct hci_conn_params *hci_conn_params_lookup(struct hci_dev *hdev, hdev 3028 net/bluetooth/hci_core.c list_for_each_entry(params, &hdev->le_conn_params, list) { hdev 3054 net/bluetooth/hci_core.c struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev, hdev 3059 net/bluetooth/hci_core.c params = hci_conn_params_lookup(hdev, addr, addr_type); hdev 3065 net/bluetooth/hci_core.c bt_dev_err(hdev, "out of memory"); hdev 3072 net/bluetooth/hci_core.c list_add(¶ms->list, &hdev->le_conn_params); hdev 3075 net/bluetooth/hci_core.c params->conn_min_interval = hdev->le_conn_min_interval; hdev 3076 net/bluetooth/hci_core.c params->conn_max_interval = hdev->le_conn_max_interval; hdev 3077 net/bluetooth/hci_core.c params->conn_latency = hdev->le_conn_latency; hdev 3078 net/bluetooth/hci_core.c params->supervision_timeout = hdev->le_supv_timeout; hdev 3099 net/bluetooth/hci_core.c void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type) hdev 3103 net/bluetooth/hci_core.c params = hci_conn_params_lookup(hdev, addr, addr_type); hdev 3109 net/bluetooth/hci_core.c hci_update_background_scan(hdev); hdev 3115 net/bluetooth/hci_core.c void hci_conn_params_clear_disabled(struct hci_dev *hdev) hdev 3119 net/bluetooth/hci_core.c list_for_each_entry_safe(params, tmp, &hdev->le_conn_params, list) { hdev 3139 net/bluetooth/hci_core.c static void hci_conn_params_clear_all(struct hci_dev *hdev) hdev 3143 net/bluetooth/hci_core.c list_for_each_entry_safe(params, tmp, &hdev->le_conn_params, list) hdev 3162 net/bluetooth/hci_core.c void hci_copy_identity_address(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 3165 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR) || hdev 3166 net/bluetooth/hci_core.c !bacmp(&hdev->bdaddr, BDADDR_ANY) || hdev 3167 net/bluetooth/hci_core.c (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED) && hdev 3168 net/bluetooth/hci_core.c bacmp(&hdev->static_addr, BDADDR_ANY))) { hdev 3169 net/bluetooth/hci_core.c bacpy(bdaddr, &hdev->static_addr); hdev 3172 net/bluetooth/hci_core.c bacpy(bdaddr, &hdev->bdaddr); hdev 3180 net/bluetooth/hci_core.c struct hci_dev *hdev; hdev 3182 net/bluetooth/hci_core.c hdev = kzalloc(sizeof(*hdev), GFP_KERNEL); hdev 3183 net/bluetooth/hci_core.c if (!hdev) hdev 3186 net/bluetooth/hci_core.c hdev->pkt_type = (HCI_DM1 | HCI_DH1 | HCI_HV1); hdev 3187 net/bluetooth/hci_core.c hdev->esco_type = (ESCO_HV1); hdev 3188 net/bluetooth/hci_core.c hdev->link_mode = (HCI_LM_ACCEPT); hdev 3189 net/bluetooth/hci_core.c hdev->num_iac = 0x01; /* One IAC support is mandatory */ hdev 3190 net/bluetooth/hci_core.c hdev->io_capability = 0x03; /* No Input No Output */ hdev 3191 net/bluetooth/hci_core.c hdev->manufacturer = 0xffff; /* Default to internal use */ hdev 3192 net/bluetooth/hci_core.c hdev->inq_tx_power = HCI_TX_POWER_INVALID; hdev 3193 net/bluetooth/hci_core.c hdev->adv_tx_power = HCI_TX_POWER_INVALID; hdev 3194 net/bluetooth/hci_core.c hdev->adv_instance_cnt = 0; hdev 3195 net/bluetooth/hci_core.c hdev->cur_adv_instance = 0x00; hdev 3196 net/bluetooth/hci_core.c hdev->adv_instance_timeout = 0; hdev 3198 net/bluetooth/hci_core.c hdev->sniff_max_interval = 800; hdev 3199 net/bluetooth/hci_core.c hdev->sniff_min_interval = 80; hdev 3201 net/bluetooth/hci_core.c hdev->le_adv_channel_map = 0x07; hdev 3202 net/bluetooth/hci_core.c hdev->le_adv_min_interval = 0x0800; hdev 3203 net/bluetooth/hci_core.c hdev->le_adv_max_interval = 0x0800; hdev 3204 net/bluetooth/hci_core.c hdev->le_scan_interval = 0x0060; hdev 3205 net/bluetooth/hci_core.c hdev->le_scan_window = 0x0030; hdev 3206 net/bluetooth/hci_core.c hdev->le_conn_min_interval = 0x0018; hdev 3207 net/bluetooth/hci_core.c hdev->le_conn_max_interval = 0x0028; hdev 3208 net/bluetooth/hci_core.c hdev->le_conn_latency = 0x0000; hdev 3209 net/bluetooth/hci_core.c hdev->le_supv_timeout = 0x002a; hdev 3210 net/bluetooth/hci_core.c hdev->le_def_tx_len = 0x001b; hdev 3211 net/bluetooth/hci_core.c hdev->le_def_tx_time = 0x0148; hdev 3212 net/bluetooth/hci_core.c hdev->le_max_tx_len = 0x001b; hdev 3213 net/bluetooth/hci_core.c hdev->le_max_tx_time = 0x0148; hdev 3214 net/bluetooth/hci_core.c hdev->le_max_rx_len = 0x001b; hdev 3215 net/bluetooth/hci_core.c hdev->le_max_rx_time = 0x0148; hdev 3216 net/bluetooth/hci_core.c hdev->le_max_key_size = SMP_MAX_ENC_KEY_SIZE; hdev 3217 net/bluetooth/hci_core.c hdev->le_min_key_size = SMP_MIN_ENC_KEY_SIZE; hdev 3218 net/bluetooth/hci_core.c hdev->le_tx_def_phys = HCI_LE_SET_PHY_1M; hdev 3219 net/bluetooth/hci_core.c hdev->le_rx_def_phys = HCI_LE_SET_PHY_1M; hdev 3220 net/bluetooth/hci_core.c hdev->le_num_of_adv_sets = HCI_MAX_ADV_INSTANCES; hdev 3222 net/bluetooth/hci_core.c hdev->rpa_timeout = HCI_DEFAULT_RPA_TIMEOUT; hdev 3223 net/bluetooth/hci_core.c hdev->discov_interleaved_timeout = DISCOV_INTERLEAVED_TIMEOUT; hdev 3224 net/bluetooth/hci_core.c hdev->conn_info_min_age = DEFAULT_CONN_INFO_MIN_AGE; hdev 3225 net/bluetooth/hci_core.c hdev->conn_info_max_age = DEFAULT_CONN_INFO_MAX_AGE; hdev 3226 net/bluetooth/hci_core.c hdev->auth_payload_timeout = DEFAULT_AUTH_PAYLOAD_TIMEOUT; hdev 3227 net/bluetooth/hci_core.c hdev->min_enc_key_size = HCI_MIN_ENC_KEY_SIZE; hdev 3229 net/bluetooth/hci_core.c mutex_init(&hdev->lock); hdev 3230 net/bluetooth/hci_core.c mutex_init(&hdev->req_lock); hdev 3232 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->mgmt_pending); hdev 3233 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->blacklist); hdev 3234 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->whitelist); hdev 3235 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->uuids); hdev 3236 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->link_keys); hdev 3237 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->long_term_keys); hdev 3238 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->identity_resolving_keys); hdev 3239 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->remote_oob_data); hdev 3240 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->le_white_list); hdev 3241 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->le_resolv_list); hdev 3242 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->le_conn_params); hdev 3243 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->pend_le_conns); hdev 3244 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->pend_le_reports); hdev 3245 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->conn_hash.list); hdev 3246 net/bluetooth/hci_core.c INIT_LIST_HEAD(&hdev->adv_instances); hdev 3248 net/bluetooth/hci_core.c INIT_WORK(&hdev->rx_work, hci_rx_work); hdev 3249 net/bluetooth/hci_core.c INIT_WORK(&hdev->cmd_work, hci_cmd_work); hdev 3250 net/bluetooth/hci_core.c INIT_WORK(&hdev->tx_work, hci_tx_work); hdev 3251 net/bluetooth/hci_core.c INIT_WORK(&hdev->power_on, hci_power_on); hdev 3252 net/bluetooth/hci_core.c INIT_WORK(&hdev->error_reset, hci_error_reset); hdev 3254 net/bluetooth/hci_core.c INIT_DELAYED_WORK(&hdev->power_off, hci_power_off); hdev 3256 net/bluetooth/hci_core.c skb_queue_head_init(&hdev->rx_q); hdev 3257 net/bluetooth/hci_core.c skb_queue_head_init(&hdev->cmd_q); hdev 3258 net/bluetooth/hci_core.c skb_queue_head_init(&hdev->raw_q); hdev 3260 net/bluetooth/hci_core.c init_waitqueue_head(&hdev->req_wait_q); hdev 3262 net/bluetooth/hci_core.c INIT_DELAYED_WORK(&hdev->cmd_timer, hci_cmd_timeout); hdev 3264 net/bluetooth/hci_core.c hci_request_setup(hdev); hdev 3266 net/bluetooth/hci_core.c hci_init_sysfs(hdev); hdev 3267 net/bluetooth/hci_core.c discovery_init(hdev); hdev 3269 net/bluetooth/hci_core.c return hdev; hdev 3274 net/bluetooth/hci_core.c void hci_free_dev(struct hci_dev *hdev) hdev 3277 net/bluetooth/hci_core.c put_device(&hdev->dev); hdev 3282 net/bluetooth/hci_core.c int hci_register_dev(struct hci_dev *hdev) hdev 3286 net/bluetooth/hci_core.c if (!hdev->open || !hdev->close || !hdev->send) hdev 3292 net/bluetooth/hci_core.c switch (hdev->dev_type) { hdev 3306 net/bluetooth/hci_core.c sprintf(hdev->name, "hci%d", id); hdev 3307 net/bluetooth/hci_core.c hdev->id = id; hdev 3309 net/bluetooth/hci_core.c BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus); hdev 3311 net/bluetooth/hci_core.c hdev->workqueue = alloc_ordered_workqueue("%s", WQ_HIGHPRI, hdev->name); hdev 3312 net/bluetooth/hci_core.c if (!hdev->workqueue) { hdev 3317 net/bluetooth/hci_core.c hdev->req_workqueue = alloc_ordered_workqueue("%s", WQ_HIGHPRI, hdev 3318 net/bluetooth/hci_core.c hdev->name); hdev 3319 net/bluetooth/hci_core.c if (!hdev->req_workqueue) { hdev 3320 net/bluetooth/hci_core.c destroy_workqueue(hdev->workqueue); hdev 3326 net/bluetooth/hci_core.c hdev->debugfs = debugfs_create_dir(hdev->name, bt_debugfs); hdev 3328 net/bluetooth/hci_core.c dev_set_name(&hdev->dev, "%s", hdev->name); hdev 3330 net/bluetooth/hci_core.c error = device_add(&hdev->dev); hdev 3334 net/bluetooth/hci_core.c hci_leds_init(hdev); hdev 3336 net/bluetooth/hci_core.c hdev->rfkill = rfkill_alloc(hdev->name, &hdev->dev, hdev 3338 net/bluetooth/hci_core.c hdev); hdev 3339 net/bluetooth/hci_core.c if (hdev->rfkill) { hdev 3340 net/bluetooth/hci_core.c if (rfkill_register(hdev->rfkill) < 0) { hdev 3341 net/bluetooth/hci_core.c rfkill_destroy(hdev->rfkill); hdev 3342 net/bluetooth/hci_core.c hdev->rfkill = NULL; hdev 3346 net/bluetooth/hci_core.c if (hdev->rfkill && rfkill_blocked(hdev->rfkill)) hdev 3347 net/bluetooth/hci_core.c hci_dev_set_flag(hdev, HCI_RFKILLED); hdev 3349 net/bluetooth/hci_core.c hci_dev_set_flag(hdev, HCI_SETUP); hdev 3350 net/bluetooth/hci_core.c hci_dev_set_flag(hdev, HCI_AUTO_OFF); hdev 3352 net/bluetooth/hci_core.c if (hdev->dev_type == HCI_PRIMARY) { hdev 3356 net/bluetooth/hci_core.c hci_dev_set_flag(hdev, HCI_BREDR_ENABLED); hdev 3360 net/bluetooth/hci_core.c list_add(&hdev->list, &hci_dev_list); hdev 3366 net/bluetooth/hci_core.c if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks)) hdev 3367 net/bluetooth/hci_core.c hci_dev_set_flag(hdev, HCI_UNCONFIGURED); hdev 3369 net/bluetooth/hci_core.c hci_sock_dev_event(hdev, HCI_DEV_REG); hdev 3370 net/bluetooth/hci_core.c hci_dev_hold(hdev); hdev 3372 net/bluetooth/hci_core.c queue_work(hdev->req_workqueue, &hdev->power_on); hdev 3377 net/bluetooth/hci_core.c destroy_workqueue(hdev->workqueue); hdev 3378 net/bluetooth/hci_core.c destroy_workqueue(hdev->req_workqueue); hdev 3380 net/bluetooth/hci_core.c ida_simple_remove(&hci_index_ida, hdev->id); hdev 3387 net/bluetooth/hci_core.c void hci_unregister_dev(struct hci_dev *hdev) hdev 3391 net/bluetooth/hci_core.c BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus); hdev 3393 net/bluetooth/hci_core.c hci_dev_set_flag(hdev, HCI_UNREGISTER); hdev 3395 net/bluetooth/hci_core.c id = hdev->id; hdev 3398 net/bluetooth/hci_core.c list_del(&hdev->list); hdev 3401 net/bluetooth/hci_core.c cancel_work_sync(&hdev->power_on); hdev 3403 net/bluetooth/hci_core.c hci_dev_do_close(hdev); hdev 3405 net/bluetooth/hci_core.c if (!test_bit(HCI_INIT, &hdev->flags) && hdev 3406 net/bluetooth/hci_core.c !hci_dev_test_flag(hdev, HCI_SETUP) && hdev 3407 net/bluetooth/hci_core.c !hci_dev_test_flag(hdev, HCI_CONFIG)) { hdev 3408 net/bluetooth/hci_core.c hci_dev_lock(hdev); hdev 3409 net/bluetooth/hci_core.c mgmt_index_removed(hdev); hdev 3410 net/bluetooth/hci_core.c hci_dev_unlock(hdev); hdev 3415 net/bluetooth/hci_core.c BUG_ON(!list_empty(&hdev->mgmt_pending)); hdev 3417 net/bluetooth/hci_core.c hci_sock_dev_event(hdev, HCI_DEV_UNREG); hdev 3419 net/bluetooth/hci_core.c if (hdev->rfkill) { hdev 3420 net/bluetooth/hci_core.c rfkill_unregister(hdev->rfkill); hdev 3421 net/bluetooth/hci_core.c rfkill_destroy(hdev->rfkill); hdev 3424 net/bluetooth/hci_core.c device_del(&hdev->dev); hdev 3426 net/bluetooth/hci_core.c debugfs_remove_recursive(hdev->debugfs); hdev 3427 net/bluetooth/hci_core.c kfree_const(hdev->hw_info); hdev 3428 net/bluetooth/hci_core.c kfree_const(hdev->fw_info); hdev 3430 net/bluetooth/hci_core.c destroy_workqueue(hdev->workqueue); hdev 3431 net/bluetooth/hci_core.c destroy_workqueue(hdev->req_workqueue); hdev 3433 net/bluetooth/hci_core.c hci_dev_lock(hdev); hdev 3434 net/bluetooth/hci_core.c hci_bdaddr_list_clear(&hdev->blacklist); hdev 3435 net/bluetooth/hci_core.c hci_bdaddr_list_clear(&hdev->whitelist); hdev 3436 net/bluetooth/hci_core.c hci_uuids_clear(hdev); hdev 3437 net/bluetooth/hci_core.c hci_link_keys_clear(hdev); hdev 3438 net/bluetooth/hci_core.c hci_smp_ltks_clear(hdev); hdev 3439 net/bluetooth/hci_core.c hci_smp_irks_clear(hdev); hdev 3440 net/bluetooth/hci_core.c hci_remote_oob_data_clear(hdev); hdev 3441 net/bluetooth/hci_core.c hci_adv_instances_clear(hdev); hdev 3442 net/bluetooth/hci_core.c hci_bdaddr_list_clear(&hdev->le_white_list); hdev 3443 net/bluetooth/hci_core.c hci_bdaddr_list_clear(&hdev->le_resolv_list); hdev 3444 net/bluetooth/hci_core.c hci_conn_params_clear_all(hdev); hdev 3445 net/bluetooth/hci_core.c hci_discovery_filter_clear(hdev); hdev 3446 net/bluetooth/hci_core.c hci_dev_unlock(hdev); hdev 3448 net/bluetooth/hci_core.c hci_dev_put(hdev); hdev 3455 net/bluetooth/hci_core.c int hci_suspend_dev(struct hci_dev *hdev) hdev 3457 net/bluetooth/hci_core.c hci_sock_dev_event(hdev, HCI_DEV_SUSPEND); hdev 3463 net/bluetooth/hci_core.c int hci_resume_dev(struct hci_dev *hdev) hdev 3465 net/bluetooth/hci_core.c hci_sock_dev_event(hdev, HCI_DEV_RESUME); hdev 3471 net/bluetooth/hci_core.c int hci_reset_dev(struct hci_dev *hdev) hdev 3484 net/bluetooth/hci_core.c return hci_recv_frame(hdev, skb); hdev 3489 net/bluetooth/hci_core.c int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 3491 net/bluetooth/hci_core.c if (!hdev || (!test_bit(HCI_UP, &hdev->flags) hdev 3492 net/bluetooth/hci_core.c && !test_bit(HCI_INIT, &hdev->flags))) { hdev 3510 net/bluetooth/hci_core.c skb_queue_tail(&hdev->rx_q, skb); hdev 3511 net/bluetooth/hci_core.c queue_work(hdev->workqueue, &hdev->rx_work); hdev 3518 net/bluetooth/hci_core.c int hci_recv_diag(struct hci_dev *hdev, struct sk_buff *skb) hdev 3526 net/bluetooth/hci_core.c skb_queue_tail(&hdev->rx_q, skb); hdev 3527 net/bluetooth/hci_core.c queue_work(hdev->workqueue, &hdev->rx_work); hdev 3533 net/bluetooth/hci_core.c void hci_set_hw_info(struct hci_dev *hdev, const char *fmt, ...) hdev 3538 net/bluetooth/hci_core.c kfree_const(hdev->hw_info); hdev 3539 net/bluetooth/hci_core.c hdev->hw_info = kvasprintf_const(GFP_KERNEL, fmt, vargs); hdev 3544 net/bluetooth/hci_core.c void hci_set_fw_info(struct hci_dev *hdev, const char *fmt, ...) hdev 3549 net/bluetooth/hci_core.c kfree_const(hdev->fw_info); hdev 3550 net/bluetooth/hci_core.c hdev->fw_info = kvasprintf_const(GFP_KERNEL, fmt, vargs); hdev 3581 net/bluetooth/hci_core.c static void hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev 3585 net/bluetooth/hci_core.c BT_DBG("%s type %d len %d", hdev->name, hci_skb_pkt_type(skb), hdev 3592 net/bluetooth/hci_core.c hci_send_to_monitor(hdev, skb); hdev 3594 net/bluetooth/hci_core.c if (atomic_read(&hdev->promisc)) { hdev 3596 net/bluetooth/hci_core.c hci_send_to_sock(hdev, skb); hdev 3602 net/bluetooth/hci_core.c if (!test_bit(HCI_RUNNING, &hdev->flags)) { hdev 3607 net/bluetooth/hci_core.c err = hdev->send(hdev, skb); hdev 3609 net/bluetooth/hci_core.c bt_dev_err(hdev, "sending frame failed (%d)", err); hdev 3615 net/bluetooth/hci_core.c int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, hdev 3620 net/bluetooth/hci_core.c BT_DBG("%s opcode 0x%4.4x plen %d", hdev->name, opcode, plen); hdev 3622 net/bluetooth/hci_core.c skb = hci_prepare_cmd(hdev, opcode, plen, param); hdev 3624 net/bluetooth/hci_core.c bt_dev_err(hdev, "no memory for command"); hdev 3633 net/bluetooth/hci_core.c skb_queue_tail(&hdev->cmd_q, skb); hdev 3634 net/bluetooth/hci_core.c queue_work(hdev->workqueue, &hdev->cmd_work); hdev 3639 net/bluetooth/hci_core.c int __hci_cmd_send(struct hci_dev *hdev, u16 opcode, u32 plen, hdev 3653 net/bluetooth/hci_core.c bt_dev_err(hdev, "unresponded command not supported"); hdev 3657 net/bluetooth/hci_core.c skb = hci_prepare_cmd(hdev, opcode, plen, param); hdev 3659 net/bluetooth/hci_core.c bt_dev_err(hdev, "no memory for command (opcode 0x%4.4x)", hdev 3664 net/bluetooth/hci_core.c hci_send_frame(hdev, skb); hdev 3671 net/bluetooth/hci_core.c void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode) hdev 3675 net/bluetooth/hci_core.c if (!hdev->sent_cmd) hdev 3678 net/bluetooth/hci_core.c hdr = (void *) hdev->sent_cmd->data; hdev 3683 net/bluetooth/hci_core.c BT_DBG("%s opcode 0x%4.4x", hdev->name, opcode); hdev 3685 net/bluetooth/hci_core.c return hdev->sent_cmd->data + HCI_COMMAND_HDR_SIZE; hdev 3689 net/bluetooth/hci_core.c struct sk_buff *hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen, hdev 3694 net/bluetooth/hci_core.c if (!test_bit(HCI_UP, &hdev->flags)) hdev 3697 net/bluetooth/hci_core.c bt_dev_dbg(hdev, "opcode 0x%4.4x plen %d", opcode, plen); hdev 3699 net/bluetooth/hci_core.c hci_req_sync_lock(hdev); hdev 3700 net/bluetooth/hci_core.c skb = __hci_cmd_sync(hdev, opcode, plen, param, timeout); hdev 3701 net/bluetooth/hci_core.c hci_req_sync_unlock(hdev); hdev 3724 net/bluetooth/hci_core.c struct hci_dev *hdev = conn->hdev; hdev 3732 net/bluetooth/hci_core.c switch (hdev->dev_type) { hdev 3740 net/bluetooth/hci_core.c bt_dev_err(hdev, "unknown dev_type %d", hdev->dev_type); hdev 3747 net/bluetooth/hci_core.c BT_DBG("%s nonfrag skb %p len %d", hdev->name, skb, skb->len); hdev 3752 net/bluetooth/hci_core.c BT_DBG("%s frag %p len %d", hdev->name, skb, skb->len); hdev 3773 net/bluetooth/hci_core.c BT_DBG("%s frag %p len %d", hdev->name, skb, skb->len); hdev 3784 net/bluetooth/hci_core.c struct hci_dev *hdev = chan->conn->hdev; hdev 3786 net/bluetooth/hci_core.c BT_DBG("%s chan %p flags 0x%4.4x", hdev->name, chan, flags); hdev 3790 net/bluetooth/hci_core.c queue_work(hdev->workqueue, &hdev->tx_work); hdev 3796 net/bluetooth/hci_core.c struct hci_dev *hdev = conn->hdev; hdev 3799 net/bluetooth/hci_core.c BT_DBG("%s len %d", hdev->name, skb->len); hdev 3811 net/bluetooth/hci_core.c queue_work(hdev->workqueue, &hdev->tx_work); hdev 3817 net/bluetooth/hci_core.c static struct hci_conn *hci_low_sent(struct hci_dev *hdev, __u8 type, hdev 3820 net/bluetooth/hci_core.c struct hci_conn_hash *h = &hdev->conn_hash; hdev 3843 net/bluetooth/hci_core.c if (hci_conn_num(hdev, type) == num) hdev 3854 net/bluetooth/hci_core.c cnt = hdev->acl_cnt; hdev 3858 net/bluetooth/hci_core.c cnt = hdev->sco_cnt; hdev 3861 net/bluetooth/hci_core.c cnt = hdev->le_mtu ? hdev->le_cnt : hdev->acl_cnt; hdev 3865 net/bluetooth/hci_core.c bt_dev_err(hdev, "unknown link type %d", conn->type); hdev 3877 net/bluetooth/hci_core.c static void hci_link_tx_to(struct hci_dev *hdev, __u8 type) hdev 3879 net/bluetooth/hci_core.c struct hci_conn_hash *h = &hdev->conn_hash; hdev 3882 net/bluetooth/hci_core.c bt_dev_err(hdev, "link tx timeout"); hdev 3889 net/bluetooth/hci_core.c bt_dev_err(hdev, "killing stalled connection %pMR", hdev 3898 net/bluetooth/hci_core.c static struct hci_chan *hci_chan_sent(struct hci_dev *hdev, __u8 type, hdev 3901 net/bluetooth/hci_core.c struct hci_conn_hash *h = &hdev->conn_hash; hdev 3907 net/bluetooth/hci_core.c BT_DBG("%s", hdev->name); hdev 3946 net/bluetooth/hci_core.c if (hci_conn_num(hdev, type) == conn_num) hdev 3957 net/bluetooth/hci_core.c cnt = hdev->acl_cnt; hdev 3960 net/bluetooth/hci_core.c cnt = hdev->block_cnt; hdev 3964 net/bluetooth/hci_core.c cnt = hdev->sco_cnt; hdev 3967 net/bluetooth/hci_core.c cnt = hdev->le_mtu ? hdev->le_cnt : hdev->acl_cnt; hdev 3971 net/bluetooth/hci_core.c bt_dev_err(hdev, "unknown link type %d", chan->conn->type); hdev 3980 net/bluetooth/hci_core.c static void hci_prio_recalculate(struct hci_dev *hdev, __u8 type) hdev 3982 net/bluetooth/hci_core.c struct hci_conn_hash *h = &hdev->conn_hash; hdev 3986 net/bluetooth/hci_core.c BT_DBG("%s", hdev->name); hdev 4022 net/bluetooth/hci_core.c if (hci_conn_num(hdev, type) == num) hdev 4030 net/bluetooth/hci_core.c static inline int __get_blocks(struct hci_dev *hdev, struct sk_buff *skb) hdev 4033 net/bluetooth/hci_core.c return DIV_ROUND_UP(skb->len - HCI_ACL_HDR_SIZE, hdev->block_len); hdev 4036 net/bluetooth/hci_core.c static void __check_timeout(struct hci_dev *hdev, unsigned int cnt) hdev 4038 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) { hdev 4041 net/bluetooth/hci_core.c if (!cnt && time_after(jiffies, hdev->acl_last_tx + hdev 4043 net/bluetooth/hci_core.c hci_link_tx_to(hdev, ACL_LINK); hdev 4047 net/bluetooth/hci_core.c static void hci_sched_acl_pkt(struct hci_dev *hdev) hdev 4049 net/bluetooth/hci_core.c unsigned int cnt = hdev->acl_cnt; hdev 4054 net/bluetooth/hci_core.c __check_timeout(hdev, cnt); hdev 4056 net/bluetooth/hci_core.c while (hdev->acl_cnt && hdev 4057 net/bluetooth/hci_core.c (chan = hci_chan_sent(hdev, ACL_LINK, "e))) { hdev 4072 net/bluetooth/hci_core.c hci_send_frame(hdev, skb); hdev 4073 net/bluetooth/hci_core.c hdev->acl_last_tx = jiffies; hdev 4075 net/bluetooth/hci_core.c hdev->acl_cnt--; hdev 4081 net/bluetooth/hci_core.c if (cnt != hdev->acl_cnt) hdev 4082 net/bluetooth/hci_core.c hci_prio_recalculate(hdev, ACL_LINK); hdev 4085 net/bluetooth/hci_core.c static void hci_sched_acl_blk(struct hci_dev *hdev) hdev 4087 net/bluetooth/hci_core.c unsigned int cnt = hdev->block_cnt; hdev 4093 net/bluetooth/hci_core.c __check_timeout(hdev, cnt); hdev 4095 net/bluetooth/hci_core.c BT_DBG("%s", hdev->name); hdev 4097 net/bluetooth/hci_core.c if (hdev->dev_type == HCI_AMP) hdev 4102 net/bluetooth/hci_core.c while (hdev->block_cnt > 0 && hdev 4103 net/bluetooth/hci_core.c (chan = hci_chan_sent(hdev, type, "e))) { hdev 4117 net/bluetooth/hci_core.c blocks = __get_blocks(hdev, skb); hdev 4118 net/bluetooth/hci_core.c if (blocks > hdev->block_cnt) hdev 4124 net/bluetooth/hci_core.c hci_send_frame(hdev, skb); hdev 4125 net/bluetooth/hci_core.c hdev->acl_last_tx = jiffies; hdev 4127 net/bluetooth/hci_core.c hdev->block_cnt -= blocks; hdev 4135 net/bluetooth/hci_core.c if (cnt != hdev->block_cnt) hdev 4136 net/bluetooth/hci_core.c hci_prio_recalculate(hdev, type); hdev 4139 net/bluetooth/hci_core.c static void hci_sched_acl(struct hci_dev *hdev) hdev 4141 net/bluetooth/hci_core.c BT_DBG("%s", hdev->name); hdev 4144 net/bluetooth/hci_core.c if (!hci_conn_num(hdev, ACL_LINK) && hdev->dev_type == HCI_PRIMARY) hdev 4148 net/bluetooth/hci_core.c if (!hci_conn_num(hdev, AMP_LINK) && hdev->dev_type == HCI_AMP) hdev 4151 net/bluetooth/hci_core.c switch (hdev->flow_ctl_mode) { hdev 4153 net/bluetooth/hci_core.c hci_sched_acl_pkt(hdev); hdev 4157 net/bluetooth/hci_core.c hci_sched_acl_blk(hdev); hdev 4163 net/bluetooth/hci_core.c static void hci_sched_sco(struct hci_dev *hdev) hdev 4169 net/bluetooth/hci_core.c BT_DBG("%s", hdev->name); hdev 4171 net/bluetooth/hci_core.c if (!hci_conn_num(hdev, SCO_LINK)) hdev 4174 net/bluetooth/hci_core.c while (hdev->sco_cnt && (conn = hci_low_sent(hdev, SCO_LINK, "e))) { hdev 4177 net/bluetooth/hci_core.c hci_send_frame(hdev, skb); hdev 4186 net/bluetooth/hci_core.c static void hci_sched_esco(struct hci_dev *hdev) hdev 4192 net/bluetooth/hci_core.c BT_DBG("%s", hdev->name); hdev 4194 net/bluetooth/hci_core.c if (!hci_conn_num(hdev, ESCO_LINK)) hdev 4197 net/bluetooth/hci_core.c while (hdev->sco_cnt && (conn = hci_low_sent(hdev, ESCO_LINK, hdev 4201 net/bluetooth/hci_core.c hci_send_frame(hdev, skb); hdev 4210 net/bluetooth/hci_core.c static void hci_sched_le(struct hci_dev *hdev) hdev 4216 net/bluetooth/hci_core.c BT_DBG("%s", hdev->name); hdev 4218 net/bluetooth/hci_core.c if (!hci_conn_num(hdev, LE_LINK)) hdev 4221 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) { hdev 4224 net/bluetooth/hci_core.c if (!hdev->le_cnt && hdev->le_pkts && hdev 4225 net/bluetooth/hci_core.c time_after(jiffies, hdev->le_last_tx + HZ * 45)) hdev 4226 net/bluetooth/hci_core.c hci_link_tx_to(hdev, LE_LINK); hdev 4229 net/bluetooth/hci_core.c cnt = hdev->le_pkts ? hdev->le_cnt : hdev->acl_cnt; hdev 4231 net/bluetooth/hci_core.c while (cnt && (chan = hci_chan_sent(hdev, LE_LINK, "e))) { hdev 4243 net/bluetooth/hci_core.c hci_send_frame(hdev, skb); hdev 4244 net/bluetooth/hci_core.c hdev->le_last_tx = jiffies; hdev 4252 net/bluetooth/hci_core.c if (hdev->le_pkts) hdev 4253 net/bluetooth/hci_core.c hdev->le_cnt = cnt; hdev 4255 net/bluetooth/hci_core.c hdev->acl_cnt = cnt; hdev 4258 net/bluetooth/hci_core.c hci_prio_recalculate(hdev, LE_LINK); hdev 4263 net/bluetooth/hci_core.c struct hci_dev *hdev = container_of(work, struct hci_dev, tx_work); hdev 4266 net/bluetooth/hci_core.c BT_DBG("%s acl %d sco %d le %d", hdev->name, hdev->acl_cnt, hdev 4267 net/bluetooth/hci_core.c hdev->sco_cnt, hdev->le_cnt); hdev 4269 net/bluetooth/hci_core.c if (!hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) { hdev 4271 net/bluetooth/hci_core.c hci_sched_acl(hdev); hdev 4272 net/bluetooth/hci_core.c hci_sched_sco(hdev); hdev 4273 net/bluetooth/hci_core.c hci_sched_esco(hdev); hdev 4274 net/bluetooth/hci_core.c hci_sched_le(hdev); hdev 4278 net/bluetooth/hci_core.c while ((skb = skb_dequeue(&hdev->raw_q))) hdev 4279 net/bluetooth/hci_core.c hci_send_frame(hdev, skb); hdev 4285 net/bluetooth/hci_core.c static void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb) hdev 4297 net/bluetooth/hci_core.c BT_DBG("%s len %d handle 0x%4.4x flags 0x%4.4x", hdev->name, skb->len, hdev 4300 net/bluetooth/hci_core.c hdev->stat.acl_rx++; hdev 4302 net/bluetooth/hci_core.c hci_dev_lock(hdev); hdev 4303 net/bluetooth/hci_core.c conn = hci_conn_hash_lookup_handle(hdev, handle); hdev 4304 net/bluetooth/hci_core.c hci_dev_unlock(hdev); hdev 4313 net/bluetooth/hci_core.c bt_dev_err(hdev, "ACL packet for unknown connection handle %d", hdev 4321 net/bluetooth/hci_core.c static void hci_scodata_packet(struct hci_dev *hdev, struct sk_buff *skb) hdev 4331 net/bluetooth/hci_core.c BT_DBG("%s len %d handle 0x%4.4x", hdev->name, skb->len, handle); hdev 4333 net/bluetooth/hci_core.c hdev->stat.sco_rx++; hdev 4335 net/bluetooth/hci_core.c hci_dev_lock(hdev); hdev 4336 net/bluetooth/hci_core.c conn = hci_conn_hash_lookup_handle(hdev, handle); hdev 4337 net/bluetooth/hci_core.c hci_dev_unlock(hdev); hdev 4344 net/bluetooth/hci_core.c bt_dev_err(hdev, "SCO packet for unknown connection handle %d", hdev 4351 net/bluetooth/hci_core.c static bool hci_req_is_complete(struct hci_dev *hdev) hdev 4355 net/bluetooth/hci_core.c skb = skb_peek(&hdev->cmd_q); hdev 4362 net/bluetooth/hci_core.c static void hci_resend_last(struct hci_dev *hdev) hdev 4368 net/bluetooth/hci_core.c if (!hdev->sent_cmd) hdev 4371 net/bluetooth/hci_core.c sent = (void *) hdev->sent_cmd->data; hdev 4376 net/bluetooth/hci_core.c skb = skb_clone(hdev->sent_cmd, GFP_KERNEL); hdev 4380 net/bluetooth/hci_core.c skb_queue_head(&hdev->cmd_q, skb); hdev 4381 net/bluetooth/hci_core.c queue_work(hdev->workqueue, &hdev->cmd_work); hdev 4384 net/bluetooth/hci_core.c void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status, hdev 4396 net/bluetooth/hci_core.c if (!hci_sent_cmd_data(hdev, opcode)) { hdev 4403 net/bluetooth/hci_core.c if (test_bit(HCI_INIT, &hdev->flags) && opcode == HCI_OP_RESET) hdev 4404 net/bluetooth/hci_core.c hci_resend_last(hdev); hdev 4410 net/bluetooth/hci_core.c hci_dev_clear_flag(hdev, HCI_CMD_PENDING); hdev 4415 net/bluetooth/hci_core.c if (!status && !hci_req_is_complete(hdev)) hdev 4422 net/bluetooth/hci_core.c if (bt_cb(hdev->sent_cmd)->hci.req_flags & HCI_REQ_SKB) { hdev 4423 net/bluetooth/hci_core.c *req_complete_skb = bt_cb(hdev->sent_cmd)->hci.req_complete_skb; hdev 4427 net/bluetooth/hci_core.c if (bt_cb(hdev->sent_cmd)->hci.req_complete) { hdev 4428 net/bluetooth/hci_core.c *req_complete = bt_cb(hdev->sent_cmd)->hci.req_complete; hdev 4433 net/bluetooth/hci_core.c spin_lock_irqsave(&hdev->cmd_q.lock, flags); hdev 4434 net/bluetooth/hci_core.c while ((skb = __skb_dequeue(&hdev->cmd_q))) { hdev 4436 net/bluetooth/hci_core.c __skb_queue_head(&hdev->cmd_q, skb); hdev 4446 net/bluetooth/hci_core.c spin_unlock_irqrestore(&hdev->cmd_q.lock, flags); hdev 4451 net/bluetooth/hci_core.c struct hci_dev *hdev = container_of(work, struct hci_dev, rx_work); hdev 4454 net/bluetooth/hci_core.c BT_DBG("%s", hdev->name); hdev 4456 net/bluetooth/hci_core.c while ((skb = skb_dequeue(&hdev->rx_q))) { hdev 4458 net/bluetooth/hci_core.c hci_send_to_monitor(hdev, skb); hdev 4460 net/bluetooth/hci_core.c if (atomic_read(&hdev->promisc)) { hdev 4462 net/bluetooth/hci_core.c hci_send_to_sock(hdev, skb); hdev 4471 net/bluetooth/hci_core.c if (hci_dev_test_flag(hdev, HCI_USER_CHANNEL) && hdev 4472 net/bluetooth/hci_core.c !test_bit(HCI_INIT, &hdev->flags)) { hdev 4477 net/bluetooth/hci_core.c if (test_bit(HCI_INIT, &hdev->flags)) { hdev 4490 net/bluetooth/hci_core.c BT_DBG("%s Event packet", hdev->name); hdev 4491 net/bluetooth/hci_core.c hci_event_packet(hdev, skb); hdev 4495 net/bluetooth/hci_core.c BT_DBG("%s ACL data packet", hdev->name); hdev 4496 net/bluetooth/hci_core.c hci_acldata_packet(hdev, skb); hdev 4500 net/bluetooth/hci_core.c BT_DBG("%s SCO data packet", hdev->name); hdev 4501 net/bluetooth/hci_core.c hci_scodata_packet(hdev, skb); hdev 4513 net/bluetooth/hci_core.c struct hci_dev *hdev = container_of(work, struct hci_dev, cmd_work); hdev 4516 net/bluetooth/hci_core.c BT_DBG("%s cmd_cnt %d cmd queued %d", hdev->name, hdev 4517 net/bluetooth/hci_core.c atomic_read(&hdev->cmd_cnt), skb_queue_len(&hdev->cmd_q)); hdev 4520 net/bluetooth/hci_core.c if (atomic_read(&hdev->cmd_cnt)) { hdev 4521 net/bluetooth/hci_core.c skb = skb_dequeue(&hdev->cmd_q); hdev 4525 net/bluetooth/hci_core.c kfree_skb(hdev->sent_cmd); hdev 4527 net/bluetooth/hci_core.c hdev->sent_cmd = skb_clone(skb, GFP_KERNEL); hdev 4528 net/bluetooth/hci_core.c if (hdev->sent_cmd) { hdev 4529 net/bluetooth/hci_core.c if (hci_req_status_pend(hdev)) hdev 4530 net/bluetooth/hci_core.c hci_dev_set_flag(hdev, HCI_CMD_PENDING); hdev 4531 net/bluetooth/hci_core.c atomic_dec(&hdev->cmd_cnt); hdev 4532 net/bluetooth/hci_core.c hci_send_frame(hdev, skb); hdev 4533 net/bluetooth/hci_core.c if (test_bit(HCI_RESET, &hdev->flags)) hdev 4534 net/bluetooth/hci_core.c cancel_delayed_work(&hdev->cmd_timer); hdev 4536 net/bluetooth/hci_core.c schedule_delayed_work(&hdev->cmd_timer, hdev 4539 net/bluetooth/hci_core.c skb_queue_head(&hdev->cmd_q, skb); hdev 4540 net/bluetooth/hci_core.c queue_work(hdev->workqueue, &hdev->cmd_work); hdev 36 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = file->private_data; \ hdev 39 net/bluetooth/hci_debugfs.c buf[0] = test_bit(__quirk, &hdev->quirks) ? 'Y' : 'N'; \ hdev 49 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = file->private_data; \ hdev 53 net/bluetooth/hci_debugfs.c if (test_bit(HCI_UP, &hdev->flags)) \ hdev 60 net/bluetooth/hci_debugfs.c if (enable == test_bit(__quirk, &hdev->quirks)) \ hdev 63 net/bluetooth/hci_debugfs.c change_bit(__quirk, &hdev->quirks); \ hdev 78 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; \ hdev 80 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); \ hdev 81 net/bluetooth/hci_debugfs.c seq_printf(f, "%s\n", hdev->__field ? : ""); \ hdev 82 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); \ hdev 91 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 94 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 95 net/bluetooth/hci_debugfs.c for (p = 0; p < HCI_MAX_PAGES && p <= hdev->max_page; p++) hdev 96 net/bluetooth/hci_debugfs.c seq_printf(f, "%2u: %8ph\n", p, hdev->features[p]); hdev 97 net/bluetooth/hci_debugfs.c if (lmp_le_capable(hdev)) hdev 98 net/bluetooth/hci_debugfs.c seq_printf(f, "LE: %8ph\n", hdev->le_features); hdev 99 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 108 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 110 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 111 net/bluetooth/hci_debugfs.c seq_printf(f, "%4.4x:%4.4x:%4.4x:%4.4x\n", hdev->devid_source, hdev 112 net/bluetooth/hci_debugfs.c hdev->devid_vendor, hdev->devid_product, hdev->devid_version); hdev 113 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 122 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 126 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 127 net/bluetooth/hci_debugfs.c list_for_each_entry(b, &hdev->whitelist, list) hdev 129 net/bluetooth/hci_debugfs.c list_for_each_entry(p, &hdev->le_conn_params, list) { hdev 133 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 142 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 145 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 146 net/bluetooth/hci_debugfs.c list_for_each_entry(b, &hdev->blacklist, list) hdev 148 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 157 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 160 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 161 net/bluetooth/hci_debugfs.c list_for_each_entry(uuid, &hdev->uuids, list) { hdev 173 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 182 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 185 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 186 net/bluetooth/hci_debugfs.c list_for_each_entry(data, &hdev->remote_oob_data, list) { hdev 192 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 201 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 203 net/bluetooth/hci_debugfs.c if (val == 0 || val > hdev->conn_info_max_age) hdev 206 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 207 net/bluetooth/hci_debugfs.c hdev->conn_info_min_age = val; hdev 208 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 215 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 217 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 218 net/bluetooth/hci_debugfs.c *val = hdev->conn_info_min_age; hdev 219 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 229 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 231 net/bluetooth/hci_debugfs.c if (val == 0 || val < hdev->conn_info_min_age) hdev 234 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 235 net/bluetooth/hci_debugfs.c hdev->conn_info_max_age = val; hdev 236 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 243 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 245 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 246 net/bluetooth/hci_debugfs.c *val = hdev->conn_info_max_age; hdev 247 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 258 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = file->private_data; hdev 261 net/bluetooth/hci_debugfs.c buf[0] = hci_dev_test_flag(hdev, HCI_USE_DEBUG_KEYS) ? 'Y': 'N'; hdev 276 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = file->private_data; hdev 279 net/bluetooth/hci_debugfs.c buf[0] = hci_dev_test_flag(hdev, HCI_SC_ONLY) ? 'Y': 'N'; hdev 294 net/bluetooth/hci_debugfs.c void hci_debugfs_create_common(struct hci_dev *hdev) hdev 296 net/bluetooth/hci_debugfs.c debugfs_create_file("features", 0444, hdev->debugfs, hdev, hdev 298 net/bluetooth/hci_debugfs.c debugfs_create_u16("manufacturer", 0444, hdev->debugfs, hdev 299 net/bluetooth/hci_debugfs.c &hdev->manufacturer); hdev 300 net/bluetooth/hci_debugfs.c debugfs_create_u8("hci_version", 0444, hdev->debugfs, &hdev->hci_ver); hdev 301 net/bluetooth/hci_debugfs.c debugfs_create_u16("hci_revision", 0444, hdev->debugfs, &hdev->hci_rev); hdev 302 net/bluetooth/hci_debugfs.c debugfs_create_u8("hardware_error", 0444, hdev->debugfs, hdev 303 net/bluetooth/hci_debugfs.c &hdev->hw_error_code); hdev 304 net/bluetooth/hci_debugfs.c debugfs_create_file("device_id", 0444, hdev->debugfs, hdev, hdev 307 net/bluetooth/hci_debugfs.c debugfs_create_file("device_list", 0444, hdev->debugfs, hdev, hdev 309 net/bluetooth/hci_debugfs.c debugfs_create_file("blacklist", 0444, hdev->debugfs, hdev, hdev 311 net/bluetooth/hci_debugfs.c debugfs_create_file("uuids", 0444, hdev->debugfs, hdev, &uuids_fops); hdev 312 net/bluetooth/hci_debugfs.c debugfs_create_file("remote_oob", 0400, hdev->debugfs, hdev, hdev 315 net/bluetooth/hci_debugfs.c debugfs_create_file("conn_info_min_age", 0644, hdev->debugfs, hdev, hdev 317 net/bluetooth/hci_debugfs.c debugfs_create_file("conn_info_max_age", 0644, hdev->debugfs, hdev, hdev 320 net/bluetooth/hci_debugfs.c if (lmp_ssp_capable(hdev) || lmp_le_capable(hdev)) hdev 321 net/bluetooth/hci_debugfs.c debugfs_create_file("use_debug_keys", 0444, hdev->debugfs, hdev 322 net/bluetooth/hci_debugfs.c hdev, &use_debug_keys_fops); hdev 324 net/bluetooth/hci_debugfs.c if (lmp_sc_capable(hdev) || lmp_le_capable(hdev)) hdev 325 net/bluetooth/hci_debugfs.c debugfs_create_file("sc_only_mode", 0444, hdev->debugfs, hdev 326 net/bluetooth/hci_debugfs.c hdev, &sc_only_mode_fops); hdev 328 net/bluetooth/hci_debugfs.c if (hdev->hw_info) hdev 329 net/bluetooth/hci_debugfs.c debugfs_create_file("hardware_info", 0444, hdev->debugfs, hdev 330 net/bluetooth/hci_debugfs.c hdev, &hardware_info_fops); hdev 332 net/bluetooth/hci_debugfs.c if (hdev->fw_info) hdev 333 net/bluetooth/hci_debugfs.c debugfs_create_file("firmware_info", 0444, hdev->debugfs, hdev 334 net/bluetooth/hci_debugfs.c hdev, &firmware_info_fops); hdev 339 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 340 net/bluetooth/hci_debugfs.c struct discovery_state *cache = &hdev->discovery; hdev 343 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 356 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 365 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 369 net/bluetooth/hci_debugfs.c list_for_each_entry_rcu(key, &hdev->link_keys, list) hdev 381 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 383 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 384 net/bluetooth/hci_debugfs.c seq_printf(f, "0x%.2x%.2x%.2x\n", hdev->dev_class[2], hdev 385 net/bluetooth/hci_debugfs.c hdev->dev_class[1], hdev->dev_class[0]); hdev 386 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 395 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 397 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 398 net/bluetooth/hci_debugfs.c *val = hdev->voice_setting; hdev 399 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 410 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = file->private_data; hdev 413 net/bluetooth/hci_debugfs.c buf[0] = hdev->ssp_debug_mode ? 'Y': 'N'; hdev 427 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 429 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 430 net/bluetooth/hci_debugfs.c hdev->auto_accept_delay = val; hdev 431 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 438 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 443 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 444 net/bluetooth/hci_debugfs.c hdev->min_enc_key_size = val; hdev 445 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 452 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 454 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 455 net/bluetooth/hci_debugfs.c *val = hdev->min_enc_key_size; hdev 456 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 467 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 469 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 470 net/bluetooth/hci_debugfs.c *val = hdev->auto_accept_delay; hdev 471 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 481 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 486 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 487 net/bluetooth/hci_debugfs.c hdev->idle_timeout = val; hdev 488 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 495 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 497 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 498 net/bluetooth/hci_debugfs.c *val = hdev->idle_timeout; hdev 499 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 509 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 511 net/bluetooth/hci_debugfs.c if (val == 0 || val % 2 || val > hdev->sniff_max_interval) hdev 514 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 515 net/bluetooth/hci_debugfs.c hdev->sniff_min_interval = val; hdev 516 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 523 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 525 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 526 net/bluetooth/hci_debugfs.c *val = hdev->sniff_min_interval; hdev 527 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 537 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 539 net/bluetooth/hci_debugfs.c if (val == 0 || val % 2 || val < hdev->sniff_min_interval) hdev 542 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 543 net/bluetooth/hci_debugfs.c hdev->sniff_max_interval = val; hdev 544 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 551 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 553 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 554 net/bluetooth/hci_debugfs.c *val = hdev->sniff_max_interval; hdev 555 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 563 net/bluetooth/hci_debugfs.c void hci_debugfs_create_bredr(struct hci_dev *hdev) hdev 565 net/bluetooth/hci_debugfs.c debugfs_create_file("inquiry_cache", 0444, hdev->debugfs, hdev, hdev 567 net/bluetooth/hci_debugfs.c debugfs_create_file("link_keys", 0400, hdev->debugfs, hdev, hdev 569 net/bluetooth/hci_debugfs.c debugfs_create_file("dev_class", 0444, hdev->debugfs, hdev, hdev 571 net/bluetooth/hci_debugfs.c debugfs_create_file("voice_setting", 0444, hdev->debugfs, hdev, hdev 574 net/bluetooth/hci_debugfs.c if (lmp_ssp_capable(hdev)) { hdev 575 net/bluetooth/hci_debugfs.c debugfs_create_file("ssp_debug_mode", 0444, hdev->debugfs, hdev 576 net/bluetooth/hci_debugfs.c hdev, &ssp_debug_mode_fops); hdev 577 net/bluetooth/hci_debugfs.c debugfs_create_file("min_encrypt_key_size", 0644, hdev->debugfs, hdev 578 net/bluetooth/hci_debugfs.c hdev, &min_encrypt_key_size_fops); hdev 579 net/bluetooth/hci_debugfs.c debugfs_create_file("auto_accept_delay", 0644, hdev->debugfs, hdev 580 net/bluetooth/hci_debugfs.c hdev, &auto_accept_delay_fops); hdev 583 net/bluetooth/hci_debugfs.c if (lmp_sniff_capable(hdev)) { hdev 584 net/bluetooth/hci_debugfs.c debugfs_create_file("idle_timeout", 0644, hdev->debugfs, hdev 585 net/bluetooth/hci_debugfs.c hdev, &idle_timeout_fops); hdev 586 net/bluetooth/hci_debugfs.c debugfs_create_file("sniff_min_interval", 0644, hdev->debugfs, hdev 587 net/bluetooth/hci_debugfs.c hdev, &sniff_min_interval_fops); hdev 588 net/bluetooth/hci_debugfs.c debugfs_create_file("sniff_max_interval", 0644, hdev->debugfs, hdev 589 net/bluetooth/hci_debugfs.c hdev, &sniff_max_interval_fops); hdev 595 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 599 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 601 net/bluetooth/hci_debugfs.c hci_copy_identity_address(hdev, &addr, &addr_type); hdev 604 net/bluetooth/hci_debugfs.c 16, hdev->irk, &hdev->rpa); hdev 606 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 615 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 623 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 624 net/bluetooth/hci_debugfs.c hdev->rpa_timeout = val; hdev 625 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 632 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 634 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 635 net/bluetooth/hci_debugfs.c *val = hdev->rpa_timeout; hdev 636 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 646 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 648 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 649 net/bluetooth/hci_debugfs.c seq_printf(f, "%pMR\n", &hdev->random_addr); hdev 650 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 659 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 661 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 662 net/bluetooth/hci_debugfs.c seq_printf(f, "%pMR\n", &hdev->static_addr); hdev 663 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 674 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = file->private_data; hdev 677 net/bluetooth/hci_debugfs.c buf[0] = hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR) ? 'Y': 'N'; hdev 687 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = file->private_data; hdev 691 net/bluetooth/hci_debugfs.c if (test_bit(HCI_UP, &hdev->flags)) hdev 698 net/bluetooth/hci_debugfs.c if (enable == hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR)) hdev 701 net/bluetooth/hci_debugfs.c hci_dev_change_flag(hdev, HCI_FORCE_STATIC_ADDR); hdev 715 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 718 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 719 net/bluetooth/hci_debugfs.c list_for_each_entry(b, &hdev->le_white_list, list) hdev 721 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 730 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 733 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 734 net/bluetooth/hci_debugfs.c list_for_each_entry(b, &hdev->le_resolv_list, list) hdev 736 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 745 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 749 net/bluetooth/hci_debugfs.c list_for_each_entry_rcu(irk, &hdev->identity_resolving_keys, list) { hdev 763 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = f->private; hdev 767 net/bluetooth/hci_debugfs.c list_for_each_entry_rcu(ltk, &hdev->long_term_keys, list) hdev 781 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 783 net/bluetooth/hci_debugfs.c if (val < 0x0006 || val > 0x0c80 || val > hdev->le_conn_max_interval) hdev 786 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 787 net/bluetooth/hci_debugfs.c hdev->le_conn_min_interval = val; hdev 788 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 795 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 797 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 798 net/bluetooth/hci_debugfs.c *val = hdev->le_conn_min_interval; hdev 799 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 809 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 811 net/bluetooth/hci_debugfs.c if (val < 0x0006 || val > 0x0c80 || val < hdev->le_conn_min_interval) hdev 814 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 815 net/bluetooth/hci_debugfs.c hdev->le_conn_max_interval = val; hdev 816 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 823 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 825 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 826 net/bluetooth/hci_debugfs.c *val = hdev->le_conn_max_interval; hdev 827 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 837 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 842 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 843 net/bluetooth/hci_debugfs.c hdev->le_conn_latency = val; hdev 844 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 851 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 853 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 854 net/bluetooth/hci_debugfs.c *val = hdev->le_conn_latency; hdev 855 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 865 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 870 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 871 net/bluetooth/hci_debugfs.c hdev->le_supv_timeout = val; hdev 872 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 879 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 881 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 882 net/bluetooth/hci_debugfs.c *val = hdev->le_supv_timeout; hdev 883 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 893 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 898 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 899 net/bluetooth/hci_debugfs.c hdev->le_adv_channel_map = val; hdev 900 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 907 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 909 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 910 net/bluetooth/hci_debugfs.c *val = hdev->le_adv_channel_map; hdev 911 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 921 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 923 net/bluetooth/hci_debugfs.c if (val < 0x0020 || val > 0x4000 || val > hdev->le_adv_max_interval) hdev 926 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 927 net/bluetooth/hci_debugfs.c hdev->le_adv_min_interval = val; hdev 928 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 935 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 937 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 938 net/bluetooth/hci_debugfs.c *val = hdev->le_adv_min_interval; hdev 939 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 949 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 951 net/bluetooth/hci_debugfs.c if (val < 0x0020 || val > 0x4000 || val < hdev->le_adv_min_interval) hdev 954 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 955 net/bluetooth/hci_debugfs.c hdev->le_adv_max_interval = val; hdev 956 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 963 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 965 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 966 net/bluetooth/hci_debugfs.c *val = hdev->le_adv_max_interval; hdev 967 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 977 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 982 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 983 net/bluetooth/hci_debugfs.c hdev->auth_payload_timeout = val; hdev 984 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 991 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = data; hdev 993 net/bluetooth/hci_debugfs.c hci_dev_lock(hdev); hdev 994 net/bluetooth/hci_debugfs.c *val = hdev->auth_payload_timeout; hdev 995 net/bluetooth/hci_debugfs.c hci_dev_unlock(hdev); hdev 1009 net/bluetooth/hci_debugfs.c void hci_debugfs_create_le(struct hci_dev *hdev) hdev 1011 net/bluetooth/hci_debugfs.c debugfs_create_file("identity", 0400, hdev->debugfs, hdev, hdev 1013 net/bluetooth/hci_debugfs.c debugfs_create_file("rpa_timeout", 0644, hdev->debugfs, hdev, hdev 1015 net/bluetooth/hci_debugfs.c debugfs_create_file("random_address", 0444, hdev->debugfs, hdev, hdev 1017 net/bluetooth/hci_debugfs.c debugfs_create_file("static_address", 0444, hdev->debugfs, hdev, hdev 1024 net/bluetooth/hci_debugfs.c if (bacmp(&hdev->bdaddr, BDADDR_ANY)) hdev 1026 net/bluetooth/hci_debugfs.c hdev->debugfs, hdev, hdev 1029 net/bluetooth/hci_debugfs.c debugfs_create_u8("white_list_size", 0444, hdev->debugfs, hdev 1030 net/bluetooth/hci_debugfs.c &hdev->le_white_list_size); hdev 1031 net/bluetooth/hci_debugfs.c debugfs_create_file("white_list", 0444, hdev->debugfs, hdev, hdev 1033 net/bluetooth/hci_debugfs.c debugfs_create_u8("resolv_list_size", 0444, hdev->debugfs, hdev 1034 net/bluetooth/hci_debugfs.c &hdev->le_resolv_list_size); hdev 1035 net/bluetooth/hci_debugfs.c debugfs_create_file("resolv_list", 0444, hdev->debugfs, hdev, hdev 1037 net/bluetooth/hci_debugfs.c debugfs_create_file("identity_resolving_keys", 0400, hdev->debugfs, hdev 1038 net/bluetooth/hci_debugfs.c hdev, &identity_resolving_keys_fops); hdev 1039 net/bluetooth/hci_debugfs.c debugfs_create_file("long_term_keys", 0400, hdev->debugfs, hdev, hdev 1041 net/bluetooth/hci_debugfs.c debugfs_create_file("conn_min_interval", 0644, hdev->debugfs, hdev, hdev 1043 net/bluetooth/hci_debugfs.c debugfs_create_file("conn_max_interval", 0644, hdev->debugfs, hdev, hdev 1045 net/bluetooth/hci_debugfs.c debugfs_create_file("conn_latency", 0644, hdev->debugfs, hdev, hdev 1047 net/bluetooth/hci_debugfs.c debugfs_create_file("supervision_timeout", 0644, hdev->debugfs, hdev, hdev 1049 net/bluetooth/hci_debugfs.c debugfs_create_file("adv_channel_map", 0644, hdev->debugfs, hdev, hdev 1051 net/bluetooth/hci_debugfs.c debugfs_create_file("adv_min_interval", 0644, hdev->debugfs, hdev, hdev 1053 net/bluetooth/hci_debugfs.c debugfs_create_file("adv_max_interval", 0644, hdev->debugfs, hdev, hdev 1055 net/bluetooth/hci_debugfs.c debugfs_create_u16("discov_interleaved_timeout", 0644, hdev->debugfs, hdev 1056 net/bluetooth/hci_debugfs.c &hdev->discov_interleaved_timeout); hdev 1057 net/bluetooth/hci_debugfs.c debugfs_create_file("auth_payload_timeout", 0644, hdev->debugfs, hdev, hdev 1061 net/bluetooth/hci_debugfs.c hdev->debugfs, hdev, hdev 1064 net/bluetooth/hci_debugfs.c hdev->debugfs, hdev, hdev 1070 net/bluetooth/hci_debugfs.c struct hci_dev *hdev = conn->hdev; hdev 1073 net/bluetooth/hci_debugfs.c if (IS_ERR_OR_NULL(hdev->debugfs)) hdev 1077 net/bluetooth/hci_debugfs.c conn->debugfs = debugfs_create_dir(name, hdev->debugfs); hdev 25 net/bluetooth/hci_debugfs.h void hci_debugfs_create_common(struct hci_dev *hdev); hdev 26 net/bluetooth/hci_debugfs.h void hci_debugfs_create_bredr(struct hci_dev *hdev); hdev 27 net/bluetooth/hci_debugfs.h void hci_debugfs_create_le(struct hci_dev *hdev); hdev 32 net/bluetooth/hci_debugfs.h static inline void hci_debugfs_create_common(struct hci_dev *hdev) hdev 36 net/bluetooth/hci_debugfs.h static inline void hci_debugfs_create_bredr(struct hci_dev *hdev) hdev 40 net/bluetooth/hci_debugfs.h static inline void hci_debugfs_create_le(struct hci_dev *hdev) hdev 44 net/bluetooth/hci_event.c static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb) hdev 48 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 53 net/bluetooth/hci_event.c clear_bit(HCI_INQUIRY, &hdev->flags); hdev 55 net/bluetooth/hci_event.c wake_up_bit(&hdev->flags, HCI_INQUIRY); hdev 57 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 61 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_LE_SCAN) || hdev 62 net/bluetooth/hci_event.c hdev->le_scan_type != LE_SCAN_ACTIVE) hdev 63 net/bluetooth/hci_event.c hci_discovery_set_state(hdev, DISCOVERY_STOPPED); hdev 64 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 66 net/bluetooth/hci_event.c hci_conn_check_pending(hdev); hdev 69 net/bluetooth/hci_event.c static void hci_cc_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb) hdev 73 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 78 net/bluetooth/hci_event.c hci_dev_set_flag(hdev, HCI_PERIODIC_INQ); hdev 81 net/bluetooth/hci_event.c static void hci_cc_exit_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb) hdev 85 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 90 net/bluetooth/hci_event.c hci_dev_clear_flag(hdev, HCI_PERIODIC_INQ); hdev 92 net/bluetooth/hci_event.c hci_conn_check_pending(hdev); hdev 95 net/bluetooth/hci_event.c static void hci_cc_remote_name_req_cancel(struct hci_dev *hdev, hdev 98 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 101 net/bluetooth/hci_event.c static void hci_cc_role_discovery(struct hci_dev *hdev, struct sk_buff *skb) hdev 106 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 111 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 113 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); hdev 117 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 120 net/bluetooth/hci_event.c static void hci_cc_read_link_policy(struct hci_dev *hdev, struct sk_buff *skb) hdev 125 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 130 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 132 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); hdev 136 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 139 net/bluetooth/hci_event.c static void hci_cc_write_link_policy(struct hci_dev *hdev, struct sk_buff *skb) hdev 145 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 150 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_LINK_POLICY); hdev 154 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 156 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); hdev 160 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 163 net/bluetooth/hci_event.c static void hci_cc_read_def_link_policy(struct hci_dev *hdev, hdev 168 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 173 net/bluetooth/hci_event.c hdev->link_policy = __le16_to_cpu(rp->policy); hdev 176 net/bluetooth/hci_event.c static void hci_cc_write_def_link_policy(struct hci_dev *hdev, hdev 182 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 187 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_DEF_LINK_POLICY); hdev 191 net/bluetooth/hci_event.c hdev->link_policy = get_unaligned_le16(sent); hdev 194 net/bluetooth/hci_event.c static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb) hdev 198 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 200 net/bluetooth/hci_event.c clear_bit(HCI_RESET, &hdev->flags); hdev 206 net/bluetooth/hci_event.c hci_dev_clear_volatile_flags(hdev); hdev 208 net/bluetooth/hci_event.c hci_discovery_set_state(hdev, DISCOVERY_STOPPED); hdev 210 net/bluetooth/hci_event.c hdev->inq_tx_power = HCI_TX_POWER_INVALID; hdev 211 net/bluetooth/hci_event.c hdev->adv_tx_power = HCI_TX_POWER_INVALID; hdev 213 net/bluetooth/hci_event.c memset(hdev->adv_data, 0, sizeof(hdev->adv_data)); hdev 214 net/bluetooth/hci_event.c hdev->adv_data_len = 0; hdev 216 net/bluetooth/hci_event.c memset(hdev->scan_rsp_data, 0, sizeof(hdev->scan_rsp_data)); hdev 217 net/bluetooth/hci_event.c hdev->scan_rsp_data_len = 0; hdev 219 net/bluetooth/hci_event.c hdev->le_scan_type = LE_SCAN_PASSIVE; hdev 221 net/bluetooth/hci_event.c hdev->ssp_debug_mode = 0; hdev 223 net/bluetooth/hci_event.c hci_bdaddr_list_clear(&hdev->le_white_list); hdev 224 net/bluetooth/hci_event.c hci_bdaddr_list_clear(&hdev->le_resolv_list); hdev 227 net/bluetooth/hci_event.c static void hci_cc_read_stored_link_key(struct hci_dev *hdev, hdev 233 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 235 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_READ_STORED_LINK_KEY); hdev 240 net/bluetooth/hci_event.c hdev->stored_max_keys = rp->max_keys; hdev 241 net/bluetooth/hci_event.c hdev->stored_num_keys = rp->num_keys; hdev 245 net/bluetooth/hci_event.c static void hci_cc_delete_stored_link_key(struct hci_dev *hdev, hdev 250 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 255 net/bluetooth/hci_event.c if (rp->num_keys <= hdev->stored_num_keys) hdev 256 net/bluetooth/hci_event.c hdev->stored_num_keys -= rp->num_keys; hdev 258 net/bluetooth/hci_event.c hdev->stored_num_keys = 0; hdev 261 net/bluetooth/hci_event.c static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb) hdev 266 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 268 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_LOCAL_NAME); hdev 272 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 274 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 275 net/bluetooth/hci_event.c mgmt_set_local_name_complete(hdev, sent, status); hdev 277 net/bluetooth/hci_event.c memcpy(hdev->dev_name, sent, HCI_MAX_NAME_LENGTH); hdev 279 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 282 net/bluetooth/hci_event.c static void hci_cc_read_local_name(struct hci_dev *hdev, struct sk_buff *skb) hdev 286 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 291 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_SETUP) || hdev 292 net/bluetooth/hci_event.c hci_dev_test_flag(hdev, HCI_CONFIG)) hdev 293 net/bluetooth/hci_event.c memcpy(hdev->dev_name, rp->name, HCI_MAX_NAME_LENGTH); hdev 296 net/bluetooth/hci_event.c static void hci_cc_write_auth_enable(struct hci_dev *hdev, struct sk_buff *skb) hdev 301 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 303 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_AUTH_ENABLE); hdev 307 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 313 net/bluetooth/hci_event.c set_bit(HCI_AUTH, &hdev->flags); hdev 315 net/bluetooth/hci_event.c clear_bit(HCI_AUTH, &hdev->flags); hdev 318 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 319 net/bluetooth/hci_event.c mgmt_auth_enable_complete(hdev, status); hdev 321 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 324 net/bluetooth/hci_event.c static void hci_cc_write_encrypt_mode(struct hci_dev *hdev, struct sk_buff *skb) hdev 330 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 335 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_ENCRYPT_MODE); hdev 342 net/bluetooth/hci_event.c set_bit(HCI_ENCRYPT, &hdev->flags); hdev 344 net/bluetooth/hci_event.c clear_bit(HCI_ENCRYPT, &hdev->flags); hdev 347 net/bluetooth/hci_event.c static void hci_cc_write_scan_enable(struct hci_dev *hdev, struct sk_buff *skb) hdev 353 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 355 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_SCAN_ENABLE); hdev 361 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 364 net/bluetooth/hci_event.c hdev->discov_timeout = 0; hdev 369 net/bluetooth/hci_event.c set_bit(HCI_ISCAN, &hdev->flags); hdev 371 net/bluetooth/hci_event.c clear_bit(HCI_ISCAN, &hdev->flags); hdev 374 net/bluetooth/hci_event.c set_bit(HCI_PSCAN, &hdev->flags); hdev 376 net/bluetooth/hci_event.c clear_bit(HCI_PSCAN, &hdev->flags); hdev 379 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 382 net/bluetooth/hci_event.c static void hci_cc_read_class_of_dev(struct hci_dev *hdev, struct sk_buff *skb) hdev 386 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 391 net/bluetooth/hci_event.c memcpy(hdev->dev_class, rp->dev_class, 3); hdev 393 net/bluetooth/hci_event.c BT_DBG("%s class 0x%.2x%.2x%.2x", hdev->name, hdev 394 net/bluetooth/hci_event.c hdev->dev_class[2], hdev->dev_class[1], hdev->dev_class[0]); hdev 397 net/bluetooth/hci_event.c static void hci_cc_write_class_of_dev(struct hci_dev *hdev, struct sk_buff *skb) hdev 402 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 404 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_CLASS_OF_DEV); hdev 408 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 411 net/bluetooth/hci_event.c memcpy(hdev->dev_class, sent, 3); hdev 413 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 414 net/bluetooth/hci_event.c mgmt_set_class_of_dev_complete(hdev, sent, status); hdev 416 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 419 net/bluetooth/hci_event.c static void hci_cc_read_voice_setting(struct hci_dev *hdev, struct sk_buff *skb) hdev 424 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 431 net/bluetooth/hci_event.c if (hdev->voice_setting == setting) hdev 434 net/bluetooth/hci_event.c hdev->voice_setting = setting; hdev 436 net/bluetooth/hci_event.c BT_DBG("%s voice setting 0x%4.4x", hdev->name, setting); hdev 438 net/bluetooth/hci_event.c if (hdev->notify) hdev 439 net/bluetooth/hci_event.c hdev->notify(hdev, HCI_NOTIFY_VOICE_SETTING); hdev 442 net/bluetooth/hci_event.c static void hci_cc_write_voice_setting(struct hci_dev *hdev, hdev 449 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 454 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_VOICE_SETTING); hdev 460 net/bluetooth/hci_event.c if (hdev->voice_setting == setting) hdev 463 net/bluetooth/hci_event.c hdev->voice_setting = setting; hdev 465 net/bluetooth/hci_event.c BT_DBG("%s voice setting 0x%4.4x", hdev->name, setting); hdev 467 net/bluetooth/hci_event.c if (hdev->notify) hdev 468 net/bluetooth/hci_event.c hdev->notify(hdev, HCI_NOTIFY_VOICE_SETTING); hdev 471 net/bluetooth/hci_event.c static void hci_cc_read_num_supported_iac(struct hci_dev *hdev, hdev 476 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 481 net/bluetooth/hci_event.c hdev->num_iac = rp->num_iac; hdev 483 net/bluetooth/hci_event.c BT_DBG("%s num iac %d", hdev->name, hdev->num_iac); hdev 486 net/bluetooth/hci_event.c static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb) hdev 491 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 493 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_SSP_MODE); hdev 497 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 501 net/bluetooth/hci_event.c hdev->features[1][0] |= LMP_HOST_SSP; hdev 503 net/bluetooth/hci_event.c hdev->features[1][0] &= ~LMP_HOST_SSP; hdev 506 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 507 net/bluetooth/hci_event.c mgmt_ssp_enable_complete(hdev, sent->mode, status); hdev 510 net/bluetooth/hci_event.c hci_dev_set_flag(hdev, HCI_SSP_ENABLED); hdev 512 net/bluetooth/hci_event.c hci_dev_clear_flag(hdev, HCI_SSP_ENABLED); hdev 515 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 518 net/bluetooth/hci_event.c static void hci_cc_write_sc_support(struct hci_dev *hdev, struct sk_buff *skb) hdev 523 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 525 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_SC_SUPPORT); hdev 529 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 533 net/bluetooth/hci_event.c hdev->features[1][0] |= LMP_HOST_SC; hdev 535 net/bluetooth/hci_event.c hdev->features[1][0] &= ~LMP_HOST_SC; hdev 538 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_MGMT) && !status) { hdev 540 net/bluetooth/hci_event.c hci_dev_set_flag(hdev, HCI_SC_ENABLED); hdev 542 net/bluetooth/hci_event.c hci_dev_clear_flag(hdev, HCI_SC_ENABLED); hdev 545 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 548 net/bluetooth/hci_event.c static void hci_cc_read_local_version(struct hci_dev *hdev, struct sk_buff *skb) hdev 552 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 557 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_SETUP) || hdev 558 net/bluetooth/hci_event.c hci_dev_test_flag(hdev, HCI_CONFIG)) { hdev 559 net/bluetooth/hci_event.c hdev->hci_ver = rp->hci_ver; hdev 560 net/bluetooth/hci_event.c hdev->hci_rev = __le16_to_cpu(rp->hci_rev); hdev 561 net/bluetooth/hci_event.c hdev->lmp_ver = rp->lmp_ver; hdev 562 net/bluetooth/hci_event.c hdev->manufacturer = __le16_to_cpu(rp->manufacturer); hdev 563 net/bluetooth/hci_event.c hdev->lmp_subver = __le16_to_cpu(rp->lmp_subver); hdev 567 net/bluetooth/hci_event.c static void hci_cc_read_local_commands(struct hci_dev *hdev, hdev 572 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 577 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_SETUP) || hdev 578 net/bluetooth/hci_event.c hci_dev_test_flag(hdev, HCI_CONFIG)) hdev 579 net/bluetooth/hci_event.c memcpy(hdev->commands, rp->commands, sizeof(hdev->commands)); hdev 582 net/bluetooth/hci_event.c static void hci_cc_read_auth_payload_timeout(struct hci_dev *hdev, hdev 588 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 593 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 595 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); hdev 599 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 602 net/bluetooth/hci_event.c static void hci_cc_write_auth_payload_timeout(struct hci_dev *hdev, hdev 609 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 614 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_AUTH_PAYLOAD_TO); hdev 618 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 620 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); hdev 624 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 627 net/bluetooth/hci_event.c static void hci_cc_read_local_features(struct hci_dev *hdev, hdev 632 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 637 net/bluetooth/hci_event.c memcpy(hdev->features, rp->features, 8); hdev 642 net/bluetooth/hci_event.c if (hdev->features[0][0] & LMP_3SLOT) hdev 643 net/bluetooth/hci_event.c hdev->pkt_type |= (HCI_DM3 | HCI_DH3); hdev 645 net/bluetooth/hci_event.c if (hdev->features[0][0] & LMP_5SLOT) hdev 646 net/bluetooth/hci_event.c hdev->pkt_type |= (HCI_DM5 | HCI_DH5); hdev 648 net/bluetooth/hci_event.c if (hdev->features[0][1] & LMP_HV2) { hdev 649 net/bluetooth/hci_event.c hdev->pkt_type |= (HCI_HV2); hdev 650 net/bluetooth/hci_event.c hdev->esco_type |= (ESCO_HV2); hdev 653 net/bluetooth/hci_event.c if (hdev->features[0][1] & LMP_HV3) { hdev 654 net/bluetooth/hci_event.c hdev->pkt_type |= (HCI_HV3); hdev 655 net/bluetooth/hci_event.c hdev->esco_type |= (ESCO_HV3); hdev 658 net/bluetooth/hci_event.c if (lmp_esco_capable(hdev)) hdev 659 net/bluetooth/hci_event.c hdev->esco_type |= (ESCO_EV3); hdev 661 net/bluetooth/hci_event.c if (hdev->features[0][4] & LMP_EV4) hdev 662 net/bluetooth/hci_event.c hdev->esco_type |= (ESCO_EV4); hdev 664 net/bluetooth/hci_event.c if (hdev->features[0][4] & LMP_EV5) hdev 665 net/bluetooth/hci_event.c hdev->esco_type |= (ESCO_EV5); hdev 667 net/bluetooth/hci_event.c if (hdev->features[0][5] & LMP_EDR_ESCO_2M) hdev 668 net/bluetooth/hci_event.c hdev->esco_type |= (ESCO_2EV3); hdev 670 net/bluetooth/hci_event.c if (hdev->features[0][5] & LMP_EDR_ESCO_3M) hdev 671 net/bluetooth/hci_event.c hdev->esco_type |= (ESCO_3EV3); hdev 673 net/bluetooth/hci_event.c if (hdev->features[0][5] & LMP_EDR_3S_ESCO) hdev 674 net/bluetooth/hci_event.c hdev->esco_type |= (ESCO_2EV5 | ESCO_3EV5); hdev 677 net/bluetooth/hci_event.c static void hci_cc_read_local_ext_features(struct hci_dev *hdev, hdev 682 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 687 net/bluetooth/hci_event.c if (hdev->max_page < rp->max_page) hdev 688 net/bluetooth/hci_event.c hdev->max_page = rp->max_page; hdev 691 net/bluetooth/hci_event.c memcpy(hdev->features[rp->page], rp->features, 8); hdev 694 net/bluetooth/hci_event.c static void hci_cc_read_flow_control_mode(struct hci_dev *hdev, hdev 699 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 704 net/bluetooth/hci_event.c hdev->flow_ctl_mode = rp->mode; hdev 707 net/bluetooth/hci_event.c static void hci_cc_read_buffer_size(struct hci_dev *hdev, struct sk_buff *skb) hdev 711 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 716 net/bluetooth/hci_event.c hdev->acl_mtu = __le16_to_cpu(rp->acl_mtu); hdev 717 net/bluetooth/hci_event.c hdev->sco_mtu = rp->sco_mtu; hdev 718 net/bluetooth/hci_event.c hdev->acl_pkts = __le16_to_cpu(rp->acl_max_pkt); hdev 719 net/bluetooth/hci_event.c hdev->sco_pkts = __le16_to_cpu(rp->sco_max_pkt); hdev 721 net/bluetooth/hci_event.c if (test_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks)) { hdev 722 net/bluetooth/hci_event.c hdev->sco_mtu = 64; hdev 723 net/bluetooth/hci_event.c hdev->sco_pkts = 8; hdev 726 net/bluetooth/hci_event.c hdev->acl_cnt = hdev->acl_pkts; hdev 727 net/bluetooth/hci_event.c hdev->sco_cnt = hdev->sco_pkts; hdev 729 net/bluetooth/hci_event.c BT_DBG("%s acl mtu %d:%d sco mtu %d:%d", hdev->name, hdev->acl_mtu, hdev 730 net/bluetooth/hci_event.c hdev->acl_pkts, hdev->sco_mtu, hdev->sco_pkts); hdev 733 net/bluetooth/hci_event.c static void hci_cc_read_bd_addr(struct hci_dev *hdev, struct sk_buff *skb) hdev 737 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 742 net/bluetooth/hci_event.c if (test_bit(HCI_INIT, &hdev->flags)) hdev 743 net/bluetooth/hci_event.c bacpy(&hdev->bdaddr, &rp->bdaddr); hdev 745 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_SETUP)) hdev 746 net/bluetooth/hci_event.c bacpy(&hdev->setup_addr, &rp->bdaddr); hdev 749 net/bluetooth/hci_event.c static void hci_cc_read_page_scan_activity(struct hci_dev *hdev, hdev 754 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 759 net/bluetooth/hci_event.c if (test_bit(HCI_INIT, &hdev->flags)) { hdev 760 net/bluetooth/hci_event.c hdev->page_scan_interval = __le16_to_cpu(rp->interval); hdev 761 net/bluetooth/hci_event.c hdev->page_scan_window = __le16_to_cpu(rp->window); hdev 765 net/bluetooth/hci_event.c static void hci_cc_write_page_scan_activity(struct hci_dev *hdev, hdev 771 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 776 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_PAGE_SCAN_ACTIVITY); hdev 780 net/bluetooth/hci_event.c hdev->page_scan_interval = __le16_to_cpu(sent->interval); hdev 781 net/bluetooth/hci_event.c hdev->page_scan_window = __le16_to_cpu(sent->window); hdev 784 net/bluetooth/hci_event.c static void hci_cc_read_page_scan_type(struct hci_dev *hdev, hdev 789 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 794 net/bluetooth/hci_event.c if (test_bit(HCI_INIT, &hdev->flags)) hdev 795 net/bluetooth/hci_event.c hdev->page_scan_type = rp->type; hdev 798 net/bluetooth/hci_event.c static void hci_cc_write_page_scan_type(struct hci_dev *hdev, hdev 804 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 809 net/bluetooth/hci_event.c type = hci_sent_cmd_data(hdev, HCI_OP_WRITE_PAGE_SCAN_TYPE); hdev 811 net/bluetooth/hci_event.c hdev->page_scan_type = *type; hdev 814 net/bluetooth/hci_event.c static void hci_cc_read_data_block_size(struct hci_dev *hdev, hdev 819 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 824 net/bluetooth/hci_event.c hdev->block_mtu = __le16_to_cpu(rp->max_acl_len); hdev 825 net/bluetooth/hci_event.c hdev->block_len = __le16_to_cpu(rp->block_len); hdev 826 net/bluetooth/hci_event.c hdev->num_blocks = __le16_to_cpu(rp->num_blocks); hdev 828 net/bluetooth/hci_event.c hdev->block_cnt = hdev->num_blocks; hdev 830 net/bluetooth/hci_event.c BT_DBG("%s blk mtu %d cnt %d len %d", hdev->name, hdev->block_mtu, hdev 831 net/bluetooth/hci_event.c hdev->block_cnt, hdev->block_len); hdev 834 net/bluetooth/hci_event.c static void hci_cc_read_clock(struct hci_dev *hdev, struct sk_buff *skb) hdev 840 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 848 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 850 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_READ_CLOCK); hdev 855 net/bluetooth/hci_event.c hdev->clock = le32_to_cpu(rp->clock); hdev 859 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); hdev 866 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 869 net/bluetooth/hci_event.c static void hci_cc_read_local_amp_info(struct hci_dev *hdev, hdev 874 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 879 net/bluetooth/hci_event.c hdev->amp_status = rp->amp_status; hdev 880 net/bluetooth/hci_event.c hdev->amp_total_bw = __le32_to_cpu(rp->total_bw); hdev 881 net/bluetooth/hci_event.c hdev->amp_max_bw = __le32_to_cpu(rp->max_bw); hdev 882 net/bluetooth/hci_event.c hdev->amp_min_latency = __le32_to_cpu(rp->min_latency); hdev 883 net/bluetooth/hci_event.c hdev->amp_max_pdu = __le32_to_cpu(rp->max_pdu); hdev 884 net/bluetooth/hci_event.c hdev->amp_type = rp->amp_type; hdev 885 net/bluetooth/hci_event.c hdev->amp_pal_cap = __le16_to_cpu(rp->pal_cap); hdev 886 net/bluetooth/hci_event.c hdev->amp_assoc_size = __le16_to_cpu(rp->max_assoc_size); hdev 887 net/bluetooth/hci_event.c hdev->amp_be_flush_to = __le32_to_cpu(rp->be_flush_to); hdev 888 net/bluetooth/hci_event.c hdev->amp_max_flush_to = __le32_to_cpu(rp->max_flush_to); hdev 891 net/bluetooth/hci_event.c static void hci_cc_read_inq_rsp_tx_power(struct hci_dev *hdev, hdev 896 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 901 net/bluetooth/hci_event.c hdev->inq_tx_power = rp->tx_power; hdev 904 net/bluetooth/hci_event.c static void hci_cc_pin_code_reply(struct hci_dev *hdev, struct sk_buff *skb) hdev 910 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 912 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 914 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 915 net/bluetooth/hci_event.c mgmt_pin_code_reply_complete(hdev, &rp->bdaddr, rp->status); hdev 920 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_PIN_CODE_REPLY); hdev 924 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); hdev 929 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 932 net/bluetooth/hci_event.c static void hci_cc_pin_code_neg_reply(struct hci_dev *hdev, struct sk_buff *skb) hdev 936 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 938 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 940 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 941 net/bluetooth/hci_event.c mgmt_pin_code_neg_reply_complete(hdev, &rp->bdaddr, hdev 944 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 947 net/bluetooth/hci_event.c static void hci_cc_le_read_buffer_size(struct hci_dev *hdev, hdev 952 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 957 net/bluetooth/hci_event.c hdev->le_mtu = __le16_to_cpu(rp->le_mtu); hdev 958 net/bluetooth/hci_event.c hdev->le_pkts = rp->le_max_pkt; hdev 960 net/bluetooth/hci_event.c hdev->le_cnt = hdev->le_pkts; hdev 962 net/bluetooth/hci_event.c BT_DBG("%s le mtu %d:%d", hdev->name, hdev->le_mtu, hdev->le_pkts); hdev 965 net/bluetooth/hci_event.c static void hci_cc_le_read_local_features(struct hci_dev *hdev, hdev 970 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 975 net/bluetooth/hci_event.c memcpy(hdev->le_features, rp->features, 8); hdev 978 net/bluetooth/hci_event.c static void hci_cc_le_read_adv_tx_power(struct hci_dev *hdev, hdev 983 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 988 net/bluetooth/hci_event.c hdev->adv_tx_power = rp->tx_power; hdev 991 net/bluetooth/hci_event.c static void hci_cc_user_confirm_reply(struct hci_dev *hdev, struct sk_buff *skb) hdev 995 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 997 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 999 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 1000 net/bluetooth/hci_event.c mgmt_user_confirm_reply_complete(hdev, &rp->bdaddr, ACL_LINK, 0, hdev 1003 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1006 net/bluetooth/hci_event.c static void hci_cc_user_confirm_neg_reply(struct hci_dev *hdev, hdev 1011 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 1013 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1015 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 1016 net/bluetooth/hci_event.c mgmt_user_confirm_neg_reply_complete(hdev, &rp->bdaddr, hdev 1019 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1022 net/bluetooth/hci_event.c static void hci_cc_user_passkey_reply(struct hci_dev *hdev, struct sk_buff *skb) hdev 1026 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 1028 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1030 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 1031 net/bluetooth/hci_event.c mgmt_user_passkey_reply_complete(hdev, &rp->bdaddr, ACL_LINK, hdev 1034 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1037 net/bluetooth/hci_event.c static void hci_cc_user_passkey_neg_reply(struct hci_dev *hdev, hdev 1042 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 1044 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1046 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 1047 net/bluetooth/hci_event.c mgmt_user_passkey_neg_reply_complete(hdev, &rp->bdaddr, hdev 1050 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1053 net/bluetooth/hci_event.c static void hci_cc_read_local_oob_data(struct hci_dev *hdev, hdev 1058 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 1061 net/bluetooth/hci_event.c static void hci_cc_read_local_oob_ext_data(struct hci_dev *hdev, hdev 1066 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 1069 net/bluetooth/hci_event.c static void hci_cc_le_set_random_addr(struct hci_dev *hdev, struct sk_buff *skb) hdev 1074 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1079 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_RANDOM_ADDR); hdev 1083 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1085 net/bluetooth/hci_event.c bacpy(&hdev->random_addr, sent); hdev 1087 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1090 net/bluetooth/hci_event.c static void hci_cc_le_set_default_phy(struct hci_dev *hdev, struct sk_buff *skb) hdev 1095 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1100 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_DEFAULT_PHY); hdev 1104 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1106 net/bluetooth/hci_event.c hdev->le_tx_def_phys = cp->tx_phys; hdev 1107 net/bluetooth/hci_event.c hdev->le_rx_def_phys = cp->rx_phys; hdev 1109 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1112 net/bluetooth/hci_event.c static void hci_cc_le_set_adv_set_random_addr(struct hci_dev *hdev, hdev 1122 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_ADV_SET_RAND_ADDR); hdev 1126 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1128 net/bluetooth/hci_event.c if (!hdev->cur_adv_instance) { hdev 1130 net/bluetooth/hci_event.c bacpy(&hdev->random_addr, &cp->bdaddr); hdev 1132 net/bluetooth/hci_event.c adv_instance = hci_find_adv_instance(hdev, hdev 1133 net/bluetooth/hci_event.c hdev->cur_adv_instance); hdev 1138 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1141 net/bluetooth/hci_event.c static void hci_cc_le_set_adv_enable(struct hci_dev *hdev, struct sk_buff *skb) hdev 1145 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1150 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_ADV_ENABLE); hdev 1154 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1162 net/bluetooth/hci_event.c hci_dev_set_flag(hdev, HCI_LE_ADV); hdev 1164 net/bluetooth/hci_event.c conn = hci_lookup_le_connect(hdev); hdev 1166 net/bluetooth/hci_event.c queue_delayed_work(hdev->workqueue, hdev 1170 net/bluetooth/hci_event.c hci_dev_clear_flag(hdev, HCI_LE_ADV); hdev 1173 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1176 net/bluetooth/hci_event.c static void hci_cc_le_set_ext_adv_enable(struct hci_dev *hdev, hdev 1182 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1187 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_EXT_ADV_ENABLE); hdev 1191 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1196 net/bluetooth/hci_event.c hci_dev_set_flag(hdev, HCI_LE_ADV); hdev 1198 net/bluetooth/hci_event.c conn = hci_lookup_le_connect(hdev); hdev 1200 net/bluetooth/hci_event.c queue_delayed_work(hdev->workqueue, hdev 1204 net/bluetooth/hci_event.c hci_dev_clear_flag(hdev, HCI_LE_ADV); hdev 1207 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1210 net/bluetooth/hci_event.c static void hci_cc_le_set_scan_param(struct hci_dev *hdev, struct sk_buff *skb) hdev 1215 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1220 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_SCAN_PARAM); hdev 1224 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1226 net/bluetooth/hci_event.c hdev->le_scan_type = cp->type; hdev 1228 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1231 net/bluetooth/hci_event.c static void hci_cc_le_set_ext_scan_param(struct hci_dev *hdev, hdev 1238 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1243 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_EXT_SCAN_PARAMS); hdev 1249 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1251 net/bluetooth/hci_event.c hdev->le_scan_type = phy_param->type; hdev 1253 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1256 net/bluetooth/hci_event.c static bool has_pending_adv_report(struct hci_dev *hdev) hdev 1258 net/bluetooth/hci_event.c struct discovery_state *d = &hdev->discovery; hdev 1263 net/bluetooth/hci_event.c static void clear_pending_adv_report(struct hci_dev *hdev) hdev 1265 net/bluetooth/hci_event.c struct discovery_state *d = &hdev->discovery; hdev 1271 net/bluetooth/hci_event.c static void store_pending_adv_report(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 1275 net/bluetooth/hci_event.c struct discovery_state *d = &hdev->discovery; hdev 1285 net/bluetooth/hci_event.c static void le_set_scan_enable_complete(struct hci_dev *hdev, u8 enable) hdev 1287 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1291 net/bluetooth/hci_event.c hci_dev_set_flag(hdev, HCI_LE_SCAN); hdev 1292 net/bluetooth/hci_event.c if (hdev->le_scan_type == LE_SCAN_ACTIVE) hdev 1293 net/bluetooth/hci_event.c clear_pending_adv_report(hdev); hdev 1301 net/bluetooth/hci_event.c if (has_pending_adv_report(hdev)) { hdev 1302 net/bluetooth/hci_event.c struct discovery_state *d = &hdev->discovery; hdev 1304 net/bluetooth/hci_event.c mgmt_device_found(hdev, &d->last_adv_addr, LE_LINK, hdev 1314 net/bluetooth/hci_event.c cancel_delayed_work(&hdev->le_scan_disable); hdev 1316 net/bluetooth/hci_event.c hci_dev_clear_flag(hdev, HCI_LE_SCAN); hdev 1325 net/bluetooth/hci_event.c if (hci_dev_test_and_clear_flag(hdev, HCI_LE_SCAN_INTERRUPTED)) hdev 1326 net/bluetooth/hci_event.c hci_discovery_set_state(hdev, DISCOVERY_STOPPED); hdev 1327 net/bluetooth/hci_event.c else if (!hci_dev_test_flag(hdev, HCI_LE_ADV) && hdev 1328 net/bluetooth/hci_event.c hdev->discovery.state == DISCOVERY_FINDING) hdev 1329 net/bluetooth/hci_event.c hci_req_reenable_advertising(hdev); hdev 1334 net/bluetooth/hci_event.c bt_dev_err(hdev, "use of reserved LE_Scan_Enable param %d", hdev 1339 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1342 net/bluetooth/hci_event.c static void hci_cc_le_set_scan_enable(struct hci_dev *hdev, hdev 1348 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1353 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_SCAN_ENABLE); hdev 1357 net/bluetooth/hci_event.c le_set_scan_enable_complete(hdev, cp->enable); hdev 1360 net/bluetooth/hci_event.c static void hci_cc_le_set_ext_scan_enable(struct hci_dev *hdev, hdev 1366 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1371 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_EXT_SCAN_ENABLE); hdev 1375 net/bluetooth/hci_event.c le_set_scan_enable_complete(hdev, cp->enable); hdev 1378 net/bluetooth/hci_event.c static void hci_cc_le_read_num_adv_sets(struct hci_dev *hdev, hdev 1383 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x No of Adv sets %u", hdev->name, rp->status, hdev 1389 net/bluetooth/hci_event.c hdev->le_num_of_adv_sets = rp->num_of_sets; hdev 1392 net/bluetooth/hci_event.c static void hci_cc_le_read_white_list_size(struct hci_dev *hdev, hdev 1397 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x size %u", hdev->name, rp->status, rp->size); hdev 1402 net/bluetooth/hci_event.c hdev->le_white_list_size = rp->size; hdev 1405 net/bluetooth/hci_event.c static void hci_cc_le_clear_white_list(struct hci_dev *hdev, hdev 1410 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1415 net/bluetooth/hci_event.c hci_bdaddr_list_clear(&hdev->le_white_list); hdev 1418 net/bluetooth/hci_event.c static void hci_cc_le_add_to_white_list(struct hci_dev *hdev, hdev 1424 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1429 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_LE_ADD_TO_WHITE_LIST); hdev 1433 net/bluetooth/hci_event.c hci_bdaddr_list_add(&hdev->le_white_list, &sent->bdaddr, hdev 1437 net/bluetooth/hci_event.c static void hci_cc_le_del_from_white_list(struct hci_dev *hdev, hdev 1443 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1448 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_LE_DEL_FROM_WHITE_LIST); hdev 1452 net/bluetooth/hci_event.c hci_bdaddr_list_del(&hdev->le_white_list, &sent->bdaddr, hdev 1456 net/bluetooth/hci_event.c static void hci_cc_le_read_supported_states(struct hci_dev *hdev, hdev 1461 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 1466 net/bluetooth/hci_event.c memcpy(hdev->le_states, rp->le_states, 8); hdev 1469 net/bluetooth/hci_event.c static void hci_cc_le_read_def_data_len(struct hci_dev *hdev, hdev 1474 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 1479 net/bluetooth/hci_event.c hdev->le_def_tx_len = le16_to_cpu(rp->tx_len); hdev 1480 net/bluetooth/hci_event.c hdev->le_def_tx_time = le16_to_cpu(rp->tx_time); hdev 1483 net/bluetooth/hci_event.c static void hci_cc_le_write_def_data_len(struct hci_dev *hdev, hdev 1489 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1494 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_LE_WRITE_DEF_DATA_LEN); hdev 1498 net/bluetooth/hci_event.c hdev->le_def_tx_len = le16_to_cpu(sent->tx_len); hdev 1499 net/bluetooth/hci_event.c hdev->le_def_tx_time = le16_to_cpu(sent->tx_time); hdev 1502 net/bluetooth/hci_event.c static void hci_cc_le_add_to_resolv_list(struct hci_dev *hdev, hdev 1508 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1513 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_LE_ADD_TO_RESOLV_LIST); hdev 1517 net/bluetooth/hci_event.c hci_bdaddr_list_add_with_irk(&hdev->le_resolv_list, &sent->bdaddr, hdev 1522 net/bluetooth/hci_event.c static void hci_cc_le_del_from_resolv_list(struct hci_dev *hdev, hdev 1528 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1533 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_LE_DEL_FROM_RESOLV_LIST); hdev 1537 net/bluetooth/hci_event.c hci_bdaddr_list_del_with_irk(&hdev->le_resolv_list, &sent->bdaddr, hdev 1541 net/bluetooth/hci_event.c static void hci_cc_le_clear_resolv_list(struct hci_dev *hdev, hdev 1546 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1551 net/bluetooth/hci_event.c hci_bdaddr_list_clear(&hdev->le_resolv_list); hdev 1554 net/bluetooth/hci_event.c static void hci_cc_le_read_resolv_list_size(struct hci_dev *hdev, hdev 1559 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x size %u", hdev->name, rp->status, rp->size); hdev 1564 net/bluetooth/hci_event.c hdev->le_resolv_list_size = rp->size; hdev 1567 net/bluetooth/hci_event.c static void hci_cc_le_set_addr_resolution_enable(struct hci_dev *hdev, hdev 1572 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1577 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_ADDR_RESOLV_ENABLE); hdev 1581 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1584 net/bluetooth/hci_event.c hci_dev_set_flag(hdev, HCI_LL_RPA_RESOLUTION); hdev 1586 net/bluetooth/hci_event.c hci_dev_clear_flag(hdev, HCI_LL_RPA_RESOLUTION); hdev 1588 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1591 net/bluetooth/hci_event.c static void hci_cc_le_read_max_data_len(struct hci_dev *hdev, hdev 1596 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 1601 net/bluetooth/hci_event.c hdev->le_max_tx_len = le16_to_cpu(rp->tx_len); hdev 1602 net/bluetooth/hci_event.c hdev->le_max_tx_time = le16_to_cpu(rp->tx_time); hdev 1603 net/bluetooth/hci_event.c hdev->le_max_rx_len = le16_to_cpu(rp->rx_len); hdev 1604 net/bluetooth/hci_event.c hdev->le_max_rx_time = le16_to_cpu(rp->rx_time); hdev 1607 net/bluetooth/hci_event.c static void hci_cc_write_le_host_supported(struct hci_dev *hdev, hdev 1613 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1618 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_LE_HOST_SUPPORTED); hdev 1622 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1625 net/bluetooth/hci_event.c hdev->features[1][0] |= LMP_HOST_LE; hdev 1626 net/bluetooth/hci_event.c hci_dev_set_flag(hdev, HCI_LE_ENABLED); hdev 1628 net/bluetooth/hci_event.c hdev->features[1][0] &= ~LMP_HOST_LE; hdev 1629 net/bluetooth/hci_event.c hci_dev_clear_flag(hdev, HCI_LE_ENABLED); hdev 1630 net/bluetooth/hci_event.c hci_dev_clear_flag(hdev, HCI_ADVERTISING); hdev 1634 net/bluetooth/hci_event.c hdev->features[1][0] |= LMP_HOST_LE_BREDR; hdev 1636 net/bluetooth/hci_event.c hdev->features[1][0] &= ~LMP_HOST_LE_BREDR; hdev 1638 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1641 net/bluetooth/hci_event.c static void hci_cc_set_adv_param(struct hci_dev *hdev, struct sk_buff *skb) hdev 1646 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1651 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_ADV_PARAM); hdev 1655 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1656 net/bluetooth/hci_event.c hdev->adv_addr_type = cp->own_address_type; hdev 1657 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1660 net/bluetooth/hci_event.c static void hci_cc_set_ext_adv_param(struct hci_dev *hdev, struct sk_buff *skb) hdev 1666 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 1671 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_EXT_ADV_PARAMS); hdev 1675 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1676 net/bluetooth/hci_event.c hdev->adv_addr_type = cp->own_addr_type; hdev 1677 net/bluetooth/hci_event.c if (!hdev->cur_adv_instance) { hdev 1679 net/bluetooth/hci_event.c hdev->adv_tx_power = rp->tx_power; hdev 1681 net/bluetooth/hci_event.c adv_instance = hci_find_adv_instance(hdev, hdev 1682 net/bluetooth/hci_event.c hdev->cur_adv_instance); hdev 1687 net/bluetooth/hci_event.c hci_req_update_adv_data(hdev, hdev->cur_adv_instance); hdev 1688 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1691 net/bluetooth/hci_event.c static void hci_cc_read_rssi(struct hci_dev *hdev, struct sk_buff *skb) hdev 1696 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 1701 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1703 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); hdev 1707 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1710 net/bluetooth/hci_event.c static void hci_cc_read_tx_power(struct hci_dev *hdev, struct sk_buff *skb) hdev 1716 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); hdev 1721 net/bluetooth/hci_event.c sent = hci_sent_cmd_data(hdev, HCI_OP_READ_TX_POWER); hdev 1725 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1727 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); hdev 1741 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1744 net/bluetooth/hci_event.c static void hci_cc_write_ssp_debug_mode(struct hci_dev *hdev, struct sk_buff *skb) hdev 1749 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1754 net/bluetooth/hci_event.c mode = hci_sent_cmd_data(hdev, HCI_OP_WRITE_SSP_DEBUG_MODE); hdev 1756 net/bluetooth/hci_event.c hdev->ssp_debug_mode = *mode; hdev 1759 net/bluetooth/hci_event.c static void hci_cs_inquiry(struct hci_dev *hdev, __u8 status) hdev 1761 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1764 net/bluetooth/hci_event.c hci_conn_check_pending(hdev); hdev 1768 net/bluetooth/hci_event.c set_bit(HCI_INQUIRY, &hdev->flags); hdev 1771 net/bluetooth/hci_event.c static void hci_cs_create_conn(struct hci_dev *hdev, __u8 status) hdev 1776 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1778 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_CREATE_CONN); hdev 1782 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1784 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); hdev 1786 net/bluetooth/hci_event.c BT_DBG("%s bdaddr %pMR hcon %p", hdev->name, &cp->bdaddr, conn); hdev 1799 net/bluetooth/hci_event.c conn = hci_conn_add(hdev, ACL_LINK, &cp->bdaddr, hdev 1802 net/bluetooth/hci_event.c bt_dev_err(hdev, "no memory for new connection"); hdev 1806 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1809 net/bluetooth/hci_event.c static void hci_cs_add_sco(struct hci_dev *hdev, __u8 status) hdev 1815 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1820 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_ADD_SCO); hdev 1826 net/bluetooth/hci_event.c BT_DBG("%s handle 0x%4.4x", hdev->name, handle); hdev 1828 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1830 net/bluetooth/hci_event.c acl = hci_conn_hash_lookup_handle(hdev, handle); hdev 1841 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1844 net/bluetooth/hci_event.c static void hci_cs_auth_requested(struct hci_dev *hdev, __u8 status) hdev 1849 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1854 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_AUTH_REQUESTED); hdev 1858 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1860 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); hdev 1868 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1871 net/bluetooth/hci_event.c static void hci_cs_set_conn_encrypt(struct hci_dev *hdev, __u8 status) hdev 1876 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 1881 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_SET_CONN_ENCRYPT); hdev 1885 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 1887 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); hdev 1895 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 1898 net/bluetooth/hci_event.c static int hci_outgoing_auth_needed(struct hci_dev *hdev, hdev 1920 net/bluetooth/hci_event.c static int hci_resolve_name(struct hci_dev *hdev, hdev 1932 net/bluetooth/hci_event.c return hci_send_cmd(hdev, HCI_OP_REMOTE_NAME_REQ, sizeof(cp), &cp); hdev 1935 net/bluetooth/hci_event.c static bool hci_resolve_next_name(struct hci_dev *hdev) hdev 1937 net/bluetooth/hci_event.c struct discovery_state *discov = &hdev->discovery; hdev 1943 net/bluetooth/hci_event.c e = hci_inquiry_cache_lookup_resolve(hdev, BDADDR_ANY, NAME_NEEDED); hdev 1947 net/bluetooth/hci_event.c if (hci_resolve_name(hdev, e) == 0) { hdev 1955 net/bluetooth/hci_event.c static void hci_check_pending_name(struct hci_dev *hdev, struct hci_conn *conn, hdev 1958 net/bluetooth/hci_event.c struct discovery_state *discov = &hdev->discovery; hdev 1969 net/bluetooth/hci_event.c mgmt_device_connected(hdev, conn, 0, name, name_len); hdev 1980 net/bluetooth/hci_event.c e = hci_inquiry_cache_lookup_resolve(hdev, bdaddr, NAME_PENDING); hdev 1991 net/bluetooth/hci_event.c mgmt_remote_name(hdev, bdaddr, ACL_LINK, 0x00, hdev 1997 net/bluetooth/hci_event.c if (hci_resolve_next_name(hdev)) hdev 2001 net/bluetooth/hci_event.c hci_discovery_set_state(hdev, DISCOVERY_STOPPED); hdev 2004 net/bluetooth/hci_event.c static void hci_cs_remote_name_req(struct hci_dev *hdev, __u8 status) hdev 2009 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 2016 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_REMOTE_NAME_REQ); hdev 2020 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2022 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); hdev 2024 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 2025 net/bluetooth/hci_event.c hci_check_pending_name(hdev, conn, &cp->bdaddr, NULL, 0); hdev 2030 net/bluetooth/hci_event.c if (!hci_outgoing_auth_needed(hdev, conn)) hdev 2039 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_AUTH_REQUESTED, hdev 2044 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2047 net/bluetooth/hci_event.c static void hci_cs_read_remote_features(struct hci_dev *hdev, __u8 status) hdev 2052 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 2057 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_READ_REMOTE_FEATURES); hdev 2061 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2063 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); hdev 2071 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2074 net/bluetooth/hci_event.c static void hci_cs_read_remote_ext_features(struct hci_dev *hdev, __u8 status) hdev 2079 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 2084 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_READ_REMOTE_EXT_FEATURES); hdev 2088 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2090 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); hdev 2098 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2101 net/bluetooth/hci_event.c static void hci_cs_setup_sync_conn(struct hci_dev *hdev, __u8 status) hdev 2107 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 2112 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_SETUP_SYNC_CONN); hdev 2118 net/bluetooth/hci_event.c BT_DBG("%s handle 0x%4.4x", hdev->name, handle); hdev 2120 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2122 net/bluetooth/hci_event.c acl = hci_conn_hash_lookup_handle(hdev, handle); hdev 2133 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2136 net/bluetooth/hci_event.c static void hci_cs_sniff_mode(struct hci_dev *hdev, __u8 status) hdev 2141 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 2146 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_SNIFF_MODE); hdev 2150 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2152 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); hdev 2160 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2163 net/bluetooth/hci_event.c static void hci_cs_exit_sniff_mode(struct hci_dev *hdev, __u8 status) hdev 2168 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 2173 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_EXIT_SNIFF_MODE); hdev 2177 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2179 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); hdev 2187 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2190 net/bluetooth/hci_event.c static void hci_cs_disconnect(struct hci_dev *hdev, u8 status) hdev 2198 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_DISCONNECT); hdev 2202 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2204 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); hdev 2206 net/bluetooth/hci_event.c mgmt_disconnect_failed(hdev, &conn->dst, conn->type, hdev 2209 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2212 net/bluetooth/hci_event.c static void cs_le_create_conn(struct hci_dev *hdev, bdaddr_t *peer_addr, hdev 2218 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_le(hdev, peer_addr, hdev 2229 net/bluetooth/hci_event.c bacpy(&conn->init_addr, &hdev->random_addr); hdev 2231 net/bluetooth/hci_event.c bacpy(&conn->init_addr, &hdev->bdaddr); hdev 2242 net/bluetooth/hci_event.c queue_delayed_work(conn->hdev->workqueue, hdev 2247 net/bluetooth/hci_event.c static void hci_cs_le_create_conn(struct hci_dev *hdev, u8 status) hdev 2251 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 2260 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_LE_CREATE_CONN); hdev 2264 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2266 net/bluetooth/hci_event.c cs_le_create_conn(hdev, &cp->peer_addr, cp->peer_addr_type, hdev 2269 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2272 net/bluetooth/hci_event.c static void hci_cs_le_ext_create_conn(struct hci_dev *hdev, u8 status) hdev 2276 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 2285 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_LE_EXT_CREATE_CONN); hdev 2289 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2291 net/bluetooth/hci_event.c cs_le_create_conn(hdev, &cp->peer_addr, cp->peer_addr_type, hdev 2294 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2297 net/bluetooth/hci_event.c static void hci_cs_le_read_remote_features(struct hci_dev *hdev, u8 status) hdev 2302 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 2307 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_LE_READ_REMOTE_FEATURES); hdev 2311 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2313 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); hdev 2321 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2324 net/bluetooth/hci_event.c static void hci_cs_le_start_enc(struct hci_dev *hdev, u8 status) hdev 2329 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 2334 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2336 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_LE_START_ENC); hdev 2340 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); hdev 2351 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2354 net/bluetooth/hci_event.c static void hci_cs_switch_role(struct hci_dev *hdev, u8 status) hdev 2359 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 2364 net/bluetooth/hci_event.c cp = hci_sent_cmd_data(hdev, HCI_OP_SWITCH_ROLE); hdev 2368 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2370 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); hdev 2374 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2377 net/bluetooth/hci_event.c static void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 2380 net/bluetooth/hci_event.c struct discovery_state *discov = &hdev->discovery; hdev 2383 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, status); hdev 2385 net/bluetooth/hci_event.c hci_conn_check_pending(hdev); hdev 2387 net/bluetooth/hci_event.c if (!test_and_clear_bit(HCI_INQUIRY, &hdev->flags)) hdev 2391 net/bluetooth/hci_event.c wake_up_bit(&hdev->flags, HCI_INQUIRY); hdev 2393 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_MGMT)) hdev 2396 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2409 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_LE_SCAN) || hdev 2410 net/bluetooth/hci_event.c !test_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks)) hdev 2411 net/bluetooth/hci_event.c hci_discovery_set_state(hdev, DISCOVERY_STOPPED); hdev 2415 net/bluetooth/hci_event.c e = hci_inquiry_cache_lookup_resolve(hdev, BDADDR_ANY, NAME_NEEDED); hdev 2416 net/bluetooth/hci_event.c if (e && hci_resolve_name(hdev, e) == 0) { hdev 2418 net/bluetooth/hci_event.c hci_discovery_set_state(hdev, DISCOVERY_RESOLVING); hdev 2427 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_LE_SCAN) || hdev 2428 net/bluetooth/hci_event.c !test_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks)) hdev 2429 net/bluetooth/hci_event.c hci_discovery_set_state(hdev, DISCOVERY_STOPPED); hdev 2433 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2436 net/bluetooth/hci_event.c static void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 2442 net/bluetooth/hci_event.c BT_DBG("%s num_rsp %d", hdev->name, num_rsp); hdev 2447 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_PERIODIC_INQ)) hdev 2450 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2464 net/bluetooth/hci_event.c flags = hci_inquiry_cache_update(hdev, &data, false); hdev 2466 net/bluetooth/hci_event.c mgmt_device_found(hdev, &info->bdaddr, ACL_LINK, 0x00, hdev 2471 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2474 net/bluetooth/hci_event.c static void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 2479 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 2481 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2483 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); hdev 2488 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ESCO_LINK, &ev->bdaddr); hdev 2503 net/bluetooth/hci_event.c !hci_find_link_key(hdev, &ev->bdaddr)) hdev 2513 net/bluetooth/hci_event.c if (test_bit(HCI_AUTH, &hdev->flags)) hdev 2516 net/bluetooth/hci_event.c if (test_bit(HCI_ENCRYPT, &hdev->flags)) hdev 2523 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_READ_REMOTE_FEATURES, hdev 2526 net/bluetooth/hci_event.c hci_req_update_scan(hdev); hdev 2530 net/bluetooth/hci_event.c if (!conn->out && hdev->hci_ver < BLUETOOTH_VER_2_0) { hdev 2534 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_CHANGE_CONN_PTYPE, sizeof(cp), hdev 2540 net/bluetooth/hci_event.c mgmt_connect_failed(hdev, &conn->dst, conn->type, hdev 2554 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2556 net/bluetooth/hci_event.c hci_conn_check_pending(hdev); hdev 2559 net/bluetooth/hci_event.c static void hci_reject_conn(struct hci_dev *hdev, bdaddr_t *bdaddr) hdev 2565 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_REJECT_CONN_REQ, sizeof(cp), &cp); hdev 2568 net/bluetooth/hci_event.c static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 2571 net/bluetooth/hci_event.c int mask = hdev->link_mode; hdev 2576 net/bluetooth/hci_event.c BT_DBG("%s bdaddr %pMR type 0x%x", hdev->name, &ev->bdaddr, hdev 2579 net/bluetooth/hci_event.c mask |= hci_proto_connect_ind(hdev, &ev->bdaddr, ev->link_type, hdev 2583 net/bluetooth/hci_event.c hci_reject_conn(hdev, &ev->bdaddr); hdev 2587 net/bluetooth/hci_event.c if (hci_bdaddr_list_lookup(&hdev->blacklist, &ev->bdaddr, hdev 2589 net/bluetooth/hci_event.c hci_reject_conn(hdev, &ev->bdaddr); hdev 2597 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT) && hdev 2598 net/bluetooth/hci_event.c !hci_dev_test_flag(hdev, HCI_CONNECTABLE) && hdev 2599 net/bluetooth/hci_event.c !hci_bdaddr_list_lookup(&hdev->whitelist, &ev->bdaddr, hdev 2601 net/bluetooth/hci_event.c hci_reject_conn(hdev, &ev->bdaddr); hdev 2607 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2609 net/bluetooth/hci_event.c ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); hdev 2613 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, hdev 2616 net/bluetooth/hci_event.c conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr, hdev 2619 net/bluetooth/hci_event.c bt_dev_err(hdev, "no memory for new connection"); hdev 2620 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2627 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2630 net/bluetooth/hci_event.c (!(flags & HCI_PROTO_DEFER) && !lmp_esco_capable(hdev))) { hdev 2636 net/bluetooth/hci_event.c if (lmp_rswitch_capable(hdev) && (mask & HCI_LM_MASTER)) hdev 2641 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_ACCEPT_CONN_REQ, sizeof(cp), &cp); hdev 2652 net/bluetooth/hci_event.c cp.content_format = cpu_to_le16(hdev->voice_setting); hdev 2655 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_ACCEPT_SYNC_CONN_REQ, sizeof(cp), hdev 2679 net/bluetooth/hci_event.c static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 2688 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 2690 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2692 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); hdev 2697 net/bluetooth/hci_event.c mgmt_disconnect_failed(hdev, &conn->dst, conn->type, hdev 2711 net/bluetooth/hci_event.c mgmt_device_disconnected(hdev, &conn->dst, conn->type, conn->dst_type, hdev 2716 net/bluetooth/hci_event.c hci_remove_link_key(hdev, &conn->dst); hdev 2718 net/bluetooth/hci_event.c hci_req_update_scan(hdev); hdev 2721 net/bluetooth/hci_event.c params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type); hdev 2732 net/bluetooth/hci_event.c list_add(¶ms->action, &hdev->pend_le_conns); hdev 2733 net/bluetooth/hci_event.c hci_update_background_scan(hdev); hdev 2757 net/bluetooth/hci_event.c hci_req_reenable_advertising(hdev); hdev 2760 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2763 net/bluetooth/hci_event.c static void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 2768 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 2770 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2772 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); hdev 2781 net/bluetooth/hci_event.c bt_dev_info(hdev, "re-auth of legacy device is not possible."); hdev 2801 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_SET_CONN_ENCRYPT, sizeof(cp), hdev 2821 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_SET_CONN_ENCRYPT, sizeof(cp), hdev 2830 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2833 net/bluetooth/hci_event.c static void hci_remote_name_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 2838 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 2840 net/bluetooth/hci_event.c hci_conn_check_pending(hdev); hdev 2842 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2844 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); hdev 2846 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_MGMT)) hdev 2850 net/bluetooth/hci_event.c hci_check_pending_name(hdev, conn, &ev->bdaddr, ev->name, hdev 2853 net/bluetooth/hci_event.c hci_check_pending_name(hdev, conn, &ev->bdaddr, NULL, 0); hdev 2859 net/bluetooth/hci_event.c if (!hci_outgoing_auth_needed(hdev, conn)) hdev 2868 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_AUTH_REQUESTED, sizeof(cp), &cp); hdev 2872 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2875 net/bluetooth/hci_event.c static void read_enc_key_size_complete(struct hci_dev *hdev, u8 status, hdev 2882 net/bluetooth/hci_event.c BT_DBG("%s status 0x%02x", hdev->name, status); hdev 2885 net/bluetooth/hci_event.c bt_dev_err(hdev, "invalid read key size response"); hdev 2892 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2894 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, handle); hdev 2903 net/bluetooth/hci_event.c bt_dev_err(hdev, "failed to read key size for handle %u", hdev 2928 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 2931 net/bluetooth/hci_event.c static void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 2936 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 2938 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 2940 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); hdev 2968 net/bluetooth/hci_event.c hci_dev_set_flag(hdev, HCI_RPA_EXPIRED); hdev 2969 net/bluetooth/hci_event.c hci_adv_instances_set_rpa_expired(hdev, true); hdev 2987 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_SC_ONLY) && hdev 3004 net/bluetooth/hci_event.c if (!(hdev->commands[20] & 0x10)) { hdev 3009 net/bluetooth/hci_event.c hci_req_init(&req, hdev); hdev 3015 net/bluetooth/hci_event.c bt_dev_err(hdev, "sending read key size failed"); hdev 3032 net/bluetooth/hci_event.c ((conn->type == ACL_LINK && lmp_ping_capable(hdev)) || hdev 3033 net/bluetooth/hci_event.c (conn->type == LE_LINK && (hdev->le_features[0] & HCI_LE_PING)))) { hdev 3037 net/bluetooth/hci_event.c cp.timeout = cpu_to_le16(hdev->auth_payload_timeout); hdev 3038 net/bluetooth/hci_event.c hci_send_cmd(conn->hdev, HCI_OP_WRITE_AUTH_PAYLOAD_TO, hdev 3053 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 3056 net/bluetooth/hci_event.c static void hci_change_link_key_complete_evt(struct hci_dev *hdev, hdev 3062 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 3064 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 3066 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); hdev 3076 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 3079 net/bluetooth/hci_event.c static void hci_remote_features_evt(struct hci_dev *hdev, hdev 3085 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 3087 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 3089 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); hdev 3099 net/bluetooth/hci_event.c if (!ev->status && lmp_ext_feat_capable(hdev) && hdev 3104 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_READ_REMOTE_EXT_FEATURES, hdev 3114 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_REMOTE_NAME_REQ, sizeof(cp), &cp); hdev 3116 net/bluetooth/hci_event.c mgmt_device_connected(hdev, conn, 0, NULL, 0); hdev 3118 net/bluetooth/hci_event.c if (!hci_outgoing_auth_needed(hdev, conn)) { hdev 3125 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 3128 net/bluetooth/hci_event.c static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb, hdev 3142 net/bluetooth/hci_event.c hci_cc_inquiry_cancel(hdev, skb); hdev 3146 net/bluetooth/hci_event.c hci_cc_periodic_inq(hdev, skb); hdev 3150 net/bluetooth/hci_event.c hci_cc_exit_periodic_inq(hdev, skb); hdev 3154 net/bluetooth/hci_event.c hci_cc_remote_name_req_cancel(hdev, skb); hdev 3158 net/bluetooth/hci_event.c hci_cc_role_discovery(hdev, skb); hdev 3162 net/bluetooth/hci_event.c hci_cc_read_link_policy(hdev, skb); hdev 3166 net/bluetooth/hci_event.c hci_cc_write_link_policy(hdev, skb); hdev 3170 net/bluetooth/hci_event.c hci_cc_read_def_link_policy(hdev, skb); hdev 3174 net/bluetooth/hci_event.c hci_cc_write_def_link_policy(hdev, skb); hdev 3178 net/bluetooth/hci_event.c hci_cc_reset(hdev, skb); hdev 3182 net/bluetooth/hci_event.c hci_cc_read_stored_link_key(hdev, skb); hdev 3186 net/bluetooth/hci_event.c hci_cc_delete_stored_link_key(hdev, skb); hdev 3190 net/bluetooth/hci_event.c hci_cc_write_local_name(hdev, skb); hdev 3194 net/bluetooth/hci_event.c hci_cc_read_local_name(hdev, skb); hdev 3198 net/bluetooth/hci_event.c hci_cc_write_auth_enable(hdev, skb); hdev 3202 net/bluetooth/hci_event.c hci_cc_write_encrypt_mode(hdev, skb); hdev 3206 net/bluetooth/hci_event.c hci_cc_write_scan_enable(hdev, skb); hdev 3210 net/bluetooth/hci_event.c hci_cc_read_class_of_dev(hdev, skb); hdev 3214 net/bluetooth/hci_event.c hci_cc_write_class_of_dev(hdev, skb); hdev 3218 net/bluetooth/hci_event.c hci_cc_read_voice_setting(hdev, skb); hdev 3222 net/bluetooth/hci_event.c hci_cc_write_voice_setting(hdev, skb); hdev 3226 net/bluetooth/hci_event.c hci_cc_read_num_supported_iac(hdev, skb); hdev 3230 net/bluetooth/hci_event.c hci_cc_write_ssp_mode(hdev, skb); hdev 3234 net/bluetooth/hci_event.c hci_cc_write_sc_support(hdev, skb); hdev 3238 net/bluetooth/hci_event.c hci_cc_read_auth_payload_timeout(hdev, skb); hdev 3242 net/bluetooth/hci_event.c hci_cc_write_auth_payload_timeout(hdev, skb); hdev 3246 net/bluetooth/hci_event.c hci_cc_read_local_version(hdev, skb); hdev 3250 net/bluetooth/hci_event.c hci_cc_read_local_commands(hdev, skb); hdev 3254 net/bluetooth/hci_event.c hci_cc_read_local_features(hdev, skb); hdev 3258 net/bluetooth/hci_event.c hci_cc_read_local_ext_features(hdev, skb); hdev 3262 net/bluetooth/hci_event.c hci_cc_read_buffer_size(hdev, skb); hdev 3266 net/bluetooth/hci_event.c hci_cc_read_bd_addr(hdev, skb); hdev 3270 net/bluetooth/hci_event.c hci_cc_read_page_scan_activity(hdev, skb); hdev 3274 net/bluetooth/hci_event.c hci_cc_write_page_scan_activity(hdev, skb); hdev 3278 net/bluetooth/hci_event.c hci_cc_read_page_scan_type(hdev, skb); hdev 3282 net/bluetooth/hci_event.c hci_cc_write_page_scan_type(hdev, skb); hdev 3286 net/bluetooth/hci_event.c hci_cc_read_data_block_size(hdev, skb); hdev 3290 net/bluetooth/hci_event.c hci_cc_read_flow_control_mode(hdev, skb); hdev 3294 net/bluetooth/hci_event.c hci_cc_read_local_amp_info(hdev, skb); hdev 3298 net/bluetooth/hci_event.c hci_cc_read_clock(hdev, skb); hdev 3302 net/bluetooth/hci_event.c hci_cc_read_inq_rsp_tx_power(hdev, skb); hdev 3306 net/bluetooth/hci_event.c hci_cc_pin_code_reply(hdev, skb); hdev 3310 net/bluetooth/hci_event.c hci_cc_pin_code_neg_reply(hdev, skb); hdev 3314 net/bluetooth/hci_event.c hci_cc_read_local_oob_data(hdev, skb); hdev 3318 net/bluetooth/hci_event.c hci_cc_read_local_oob_ext_data(hdev, skb); hdev 3322 net/bluetooth/hci_event.c hci_cc_le_read_buffer_size(hdev, skb); hdev 3326 net/bluetooth/hci_event.c hci_cc_le_read_local_features(hdev, skb); hdev 3330 net/bluetooth/hci_event.c hci_cc_le_read_adv_tx_power(hdev, skb); hdev 3334 net/bluetooth/hci_event.c hci_cc_user_confirm_reply(hdev, skb); hdev 3338 net/bluetooth/hci_event.c hci_cc_user_confirm_neg_reply(hdev, skb); hdev 3342 net/bluetooth/hci_event.c hci_cc_user_passkey_reply(hdev, skb); hdev 3346 net/bluetooth/hci_event.c hci_cc_user_passkey_neg_reply(hdev, skb); hdev 3350 net/bluetooth/hci_event.c hci_cc_le_set_random_addr(hdev, skb); hdev 3354 net/bluetooth/hci_event.c hci_cc_le_set_adv_enable(hdev, skb); hdev 3358 net/bluetooth/hci_event.c hci_cc_le_set_scan_param(hdev, skb); hdev 3362 net/bluetooth/hci_event.c hci_cc_le_set_scan_enable(hdev, skb); hdev 3366 net/bluetooth/hci_event.c hci_cc_le_read_white_list_size(hdev, skb); hdev 3370 net/bluetooth/hci_event.c hci_cc_le_clear_white_list(hdev, skb); hdev 3374 net/bluetooth/hci_event.c hci_cc_le_add_to_white_list(hdev, skb); hdev 3378 net/bluetooth/hci_event.c hci_cc_le_del_from_white_list(hdev, skb); hdev 3382 net/bluetooth/hci_event.c hci_cc_le_read_supported_states(hdev, skb); hdev 3386 net/bluetooth/hci_event.c hci_cc_le_read_def_data_len(hdev, skb); hdev 3390 net/bluetooth/hci_event.c hci_cc_le_write_def_data_len(hdev, skb); hdev 3394 net/bluetooth/hci_event.c hci_cc_le_add_to_resolv_list(hdev, skb); hdev 3398 net/bluetooth/hci_event.c hci_cc_le_del_from_resolv_list(hdev, skb); hdev 3402 net/bluetooth/hci_event.c hci_cc_le_clear_resolv_list(hdev, skb); hdev 3406 net/bluetooth/hci_event.c hci_cc_le_read_resolv_list_size(hdev, skb); hdev 3410 net/bluetooth/hci_event.c hci_cc_le_set_addr_resolution_enable(hdev, skb); hdev 3414 net/bluetooth/hci_event.c hci_cc_le_read_max_data_len(hdev, skb); hdev 3418 net/bluetooth/hci_event.c hci_cc_write_le_host_supported(hdev, skb); hdev 3422 net/bluetooth/hci_event.c hci_cc_set_adv_param(hdev, skb); hdev 3426 net/bluetooth/hci_event.c hci_cc_read_rssi(hdev, skb); hdev 3430 net/bluetooth/hci_event.c hci_cc_read_tx_power(hdev, skb); hdev 3434 net/bluetooth/hci_event.c hci_cc_write_ssp_debug_mode(hdev, skb); hdev 3438 net/bluetooth/hci_event.c hci_cc_le_set_ext_scan_param(hdev, skb); hdev 3442 net/bluetooth/hci_event.c hci_cc_le_set_ext_scan_enable(hdev, skb); hdev 3446 net/bluetooth/hci_event.c hci_cc_le_set_default_phy(hdev, skb); hdev 3450 net/bluetooth/hci_event.c hci_cc_le_read_num_adv_sets(hdev, skb); hdev 3454 net/bluetooth/hci_event.c hci_cc_set_ext_adv_param(hdev, skb); hdev 3458 net/bluetooth/hci_event.c hci_cc_le_set_ext_adv_enable(hdev, skb); hdev 3462 net/bluetooth/hci_event.c hci_cc_le_set_adv_set_random_addr(hdev, skb); hdev 3466 net/bluetooth/hci_event.c BT_DBG("%s opcode 0x%4.4x", hdev->name, *opcode); hdev 3471 net/bluetooth/hci_event.c cancel_delayed_work(&hdev->cmd_timer); hdev 3473 net/bluetooth/hci_event.c if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) hdev 3474 net/bluetooth/hci_event.c atomic_set(&hdev->cmd_cnt, 1); hdev 3476 net/bluetooth/hci_event.c hci_req_cmd_complete(hdev, *opcode, *status, req_complete, hdev 3479 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_CMD_PENDING)) { hdev 3480 net/bluetooth/hci_event.c bt_dev_err(hdev, hdev 3485 net/bluetooth/hci_event.c if (atomic_read(&hdev->cmd_cnt) && !skb_queue_empty(&hdev->cmd_q)) hdev 3486 net/bluetooth/hci_event.c queue_work(hdev->workqueue, &hdev->cmd_work); hdev 3489 net/bluetooth/hci_event.c static void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb, hdev 3503 net/bluetooth/hci_event.c hci_cs_inquiry(hdev, ev->status); hdev 3507 net/bluetooth/hci_event.c hci_cs_create_conn(hdev, ev->status); hdev 3511 net/bluetooth/hci_event.c hci_cs_disconnect(hdev, ev->status); hdev 3515 net/bluetooth/hci_event.c hci_cs_add_sco(hdev, ev->status); hdev 3519 net/bluetooth/hci_event.c hci_cs_auth_requested(hdev, ev->status); hdev 3523 net/bluetooth/hci_event.c hci_cs_set_conn_encrypt(hdev, ev->status); hdev 3527 net/bluetooth/hci_event.c hci_cs_remote_name_req(hdev, ev->status); hdev 3531 net/bluetooth/hci_event.c hci_cs_read_remote_features(hdev, ev->status); hdev 3535 net/bluetooth/hci_event.c hci_cs_read_remote_ext_features(hdev, ev->status); hdev 3539 net/bluetooth/hci_event.c hci_cs_setup_sync_conn(hdev, ev->status); hdev 3543 net/bluetooth/hci_event.c hci_cs_sniff_mode(hdev, ev->status); hdev 3547 net/bluetooth/hci_event.c hci_cs_exit_sniff_mode(hdev, ev->status); hdev 3551 net/bluetooth/hci_event.c hci_cs_switch_role(hdev, ev->status); hdev 3555 net/bluetooth/hci_event.c hci_cs_le_create_conn(hdev, ev->status); hdev 3559 net/bluetooth/hci_event.c hci_cs_le_read_remote_features(hdev, ev->status); hdev 3563 net/bluetooth/hci_event.c hci_cs_le_start_enc(hdev, ev->status); hdev 3567 net/bluetooth/hci_event.c hci_cs_le_ext_create_conn(hdev, ev->status); hdev 3571 net/bluetooth/hci_event.c BT_DBG("%s opcode 0x%4.4x", hdev->name, *opcode); hdev 3576 net/bluetooth/hci_event.c cancel_delayed_work(&hdev->cmd_timer); hdev 3578 net/bluetooth/hci_event.c if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) hdev 3579 net/bluetooth/hci_event.c atomic_set(&hdev->cmd_cnt, 1); hdev 3588 net/bluetooth/hci_event.c (hdev->sent_cmd && !bt_cb(hdev->sent_cmd)->hci.req_event)) hdev 3589 net/bluetooth/hci_event.c hci_req_cmd_complete(hdev, *opcode, ev->status, req_complete, hdev 3592 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_CMD_PENDING)) { hdev 3593 net/bluetooth/hci_event.c bt_dev_err(hdev, hdev 3598 net/bluetooth/hci_event.c if (atomic_read(&hdev->cmd_cnt) && !skb_queue_empty(&hdev->cmd_q)) hdev 3599 net/bluetooth/hci_event.c queue_work(hdev->workqueue, &hdev->cmd_work); hdev 3602 net/bluetooth/hci_event.c static void hci_hardware_error_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 3606 net/bluetooth/hci_event.c hdev->hw_error_code = ev->code; hdev 3608 net/bluetooth/hci_event.c queue_work(hdev->req_workqueue, &hdev->error_reset); hdev 3611 net/bluetooth/hci_event.c static void hci_role_change_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 3616 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 3618 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 3620 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); hdev 3630 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 3633 net/bluetooth/hci_event.c static void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 3638 net/bluetooth/hci_event.c if (hdev->flow_ctl_mode != HCI_FLOW_CTL_MODE_PACKET_BASED) { hdev 3639 net/bluetooth/hci_event.c bt_dev_err(hdev, "wrong event for mode %d", hdev->flow_ctl_mode); hdev 3645 net/bluetooth/hci_event.c BT_DBG("%s bad parameters", hdev->name); hdev 3649 net/bluetooth/hci_event.c BT_DBG("%s num_hndl %d", hdev->name, ev->num_hndl); hdev 3659 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, handle); hdev 3667 net/bluetooth/hci_event.c hdev->acl_cnt += count; hdev 3668 net/bluetooth/hci_event.c if (hdev->acl_cnt > hdev->acl_pkts) hdev 3669 net/bluetooth/hci_event.c hdev->acl_cnt = hdev->acl_pkts; hdev 3673 net/bluetooth/hci_event.c if (hdev->le_pkts) { hdev 3674 net/bluetooth/hci_event.c hdev->le_cnt += count; hdev 3675 net/bluetooth/hci_event.c if (hdev->le_cnt > hdev->le_pkts) hdev 3676 net/bluetooth/hci_event.c hdev->le_cnt = hdev->le_pkts; hdev 3678 net/bluetooth/hci_event.c hdev->acl_cnt += count; hdev 3679 net/bluetooth/hci_event.c if (hdev->acl_cnt > hdev->acl_pkts) hdev 3680 net/bluetooth/hci_event.c hdev->acl_cnt = hdev->acl_pkts; hdev 3685 net/bluetooth/hci_event.c hdev->sco_cnt += count; hdev 3686 net/bluetooth/hci_event.c if (hdev->sco_cnt > hdev->sco_pkts) hdev 3687 net/bluetooth/hci_event.c hdev->sco_cnt = hdev->sco_pkts; hdev 3691 net/bluetooth/hci_event.c bt_dev_err(hdev, "unknown type %d conn %p", hdev 3697 net/bluetooth/hci_event.c queue_work(hdev->workqueue, &hdev->tx_work); hdev 3700 net/bluetooth/hci_event.c static struct hci_conn *__hci_conn_lookup_handle(struct hci_dev *hdev, hdev 3705 net/bluetooth/hci_event.c switch (hdev->dev_type) { hdev 3707 net/bluetooth/hci_event.c return hci_conn_hash_lookup_handle(hdev, handle); hdev 3709 net/bluetooth/hci_event.c chan = hci_chan_lookup_handle(hdev, handle); hdev 3714 net/bluetooth/hci_event.c bt_dev_err(hdev, "unknown dev_type %d", hdev->dev_type); hdev 3721 net/bluetooth/hci_event.c static void hci_num_comp_blocks_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 3726 net/bluetooth/hci_event.c if (hdev->flow_ctl_mode != HCI_FLOW_CTL_MODE_BLOCK_BASED) { hdev 3727 net/bluetooth/hci_event.c bt_dev_err(hdev, "wrong event for mode %d", hdev->flow_ctl_mode); hdev 3733 net/bluetooth/hci_event.c BT_DBG("%s bad parameters", hdev->name); hdev 3737 net/bluetooth/hci_event.c BT_DBG("%s num_blocks %d num_hndl %d", hdev->name, ev->num_blocks, hdev 3748 net/bluetooth/hci_event.c conn = __hci_conn_lookup_handle(hdev, handle); hdev 3757 net/bluetooth/hci_event.c hdev->block_cnt += block_count; hdev 3758 net/bluetooth/hci_event.c if (hdev->block_cnt > hdev->num_blocks) hdev 3759 net/bluetooth/hci_event.c hdev->block_cnt = hdev->num_blocks; hdev 3763 net/bluetooth/hci_event.c bt_dev_err(hdev, "unknown type %d conn %p", hdev 3769 net/bluetooth/hci_event.c queue_work(hdev->workqueue, &hdev->tx_work); hdev 3772 net/bluetooth/hci_event.c static void hci_mode_change_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 3777 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 3779 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 3781 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); hdev 3797 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 3800 net/bluetooth/hci_event.c static void hci_pin_code_request_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 3805 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 3807 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 3809 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); hdev 3819 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_BONDABLE) && hdev 3821 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_PIN_CODE_NEG_REPLY, hdev 3823 net/bluetooth/hci_event.c } else if (hci_dev_test_flag(hdev, HCI_MGMT)) { hdev 3831 net/bluetooth/hci_event.c mgmt_pin_code_request(hdev, &ev->bdaddr, secure); hdev 3835 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 3870 net/bluetooth/hci_event.c static void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 3877 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 3879 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_MGMT)) hdev 3882 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 3884 net/bluetooth/hci_event.c key = hci_find_link_key(hdev, &ev->bdaddr); hdev 3886 net/bluetooth/hci_event.c BT_DBG("%s link key not found for %pMR", hdev->name, hdev 3891 net/bluetooth/hci_event.c BT_DBG("%s found key type %u for %pMR", hdev->name, key->type, hdev 3894 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); hdev 3901 net/bluetooth/hci_event.c BT_DBG("%s ignoring unauthenticated key", hdev->name); hdev 3909 net/bluetooth/hci_event.c hdev->name); hdev 3919 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_LINK_KEY_REPLY, sizeof(cp), &cp); hdev 3921 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 3926 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_LINK_KEY_NEG_REPLY, 6, &ev->bdaddr); hdev 3927 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 3930 net/bluetooth/hci_event.c static void hci_link_key_notify_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 3938 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 3940 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 3942 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); hdev 3953 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_MGMT)) hdev 3956 net/bluetooth/hci_event.c key = hci_add_link_key(hdev, conn, &ev->bdaddr, ev->link_key, hdev 3967 net/bluetooth/hci_event.c mgmt_new_link_key(hdev, key, persistent); hdev 3975 net/bluetooth/hci_event.c !hci_dev_test_flag(hdev, HCI_KEEP_DEBUG_KEYS)) { hdev 3987 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 3990 net/bluetooth/hci_event.c static void hci_clock_offset_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 3995 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 3997 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 3999 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); hdev 4003 net/bluetooth/hci_event.c ie = hci_inquiry_cache_lookup(hdev, &conn->dst); hdev 4010 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4013 net/bluetooth/hci_event.c static void hci_pkt_type_change_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 4018 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 4020 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4022 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); hdev 4026 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4029 net/bluetooth/hci_event.c static void hci_pscan_rep_mode_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 4034 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 4036 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4038 net/bluetooth/hci_event.c ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); hdev 4044 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4047 net/bluetooth/hci_event.c static void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, hdev 4053 net/bluetooth/hci_event.c BT_DBG("%s num_rsp %d", hdev->name, num_rsp); hdev 4058 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_PERIODIC_INQ)) hdev 4061 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4079 net/bluetooth/hci_event.c flags = hci_inquiry_cache_update(hdev, &data, false); hdev 4081 net/bluetooth/hci_event.c mgmt_device_found(hdev, &info->bdaddr, ACL_LINK, 0x00, hdev 4100 net/bluetooth/hci_event.c flags = hci_inquiry_cache_update(hdev, &data, false); hdev 4102 net/bluetooth/hci_event.c mgmt_device_found(hdev, &info->bdaddr, ACL_LINK, 0x00, hdev 4108 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4111 net/bluetooth/hci_event.c static void hci_remote_ext_features_evt(struct hci_dev *hdev, hdev 4117 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 4119 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4121 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); hdev 4131 net/bluetooth/hci_event.c ie = hci_inquiry_cache_lookup(hdev, &conn->dst); hdev 4161 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_REMOTE_NAME_REQ, sizeof(cp), &cp); hdev 4163 net/bluetooth/hci_event.c mgmt_device_connected(hdev, conn, 0, NULL, 0); hdev 4165 net/bluetooth/hci_event.c if (!hci_outgoing_auth_needed(hdev, conn)) { hdev 4172 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4175 net/bluetooth/hci_event.c static void hci_sync_conn_complete_evt(struct hci_dev *hdev, hdev 4181 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 4183 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4185 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); hdev 4199 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ESCO_LINK, &ev->bdaddr); hdev 4222 net/bluetooth/hci_event.c conn->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) | hdev 4223 net/bluetooth/hci_event.c (hdev->esco_type & EDR_ESCO_MASK); hdev 4239 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4259 net/bluetooth/hci_event.c static void hci_extended_inquiry_result_evt(struct hci_dev *hdev, hdev 4267 net/bluetooth/hci_event.c BT_DBG("%s num_rsp %d", hdev->name, num_rsp); hdev 4272 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_PERIODIC_INQ)) hdev 4275 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4290 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 4297 net/bluetooth/hci_event.c flags = hci_inquiry_cache_update(hdev, &data, name_known); hdev 4301 net/bluetooth/hci_event.c mgmt_device_found(hdev, &info->bdaddr, ACL_LINK, 0x00, hdev 4306 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4309 net/bluetooth/hci_event.c static void hci_key_refresh_complete_evt(struct hci_dev *hdev, hdev 4315 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x handle 0x%4.4x", hdev->name, ev->status, hdev 4318 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4320 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); hdev 4356 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4379 net/bluetooth/hci_event.c struct hci_dev *hdev = conn->hdev; hdev 4382 net/bluetooth/hci_event.c data = hci_find_remote_oob_data(hdev, &conn->dst, BDADDR_BREDR); hdev 4386 net/bluetooth/hci_event.c if (bredr_sc_enabled(hdev)) { hdev 4393 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_SC_ONLY)) hdev 4419 net/bluetooth/hci_event.c static void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 4424 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 4426 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4428 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); hdev 4434 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_MGMT)) hdev 4440 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_BONDABLE) || hdev 4466 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_BONDABLE)) hdev 4472 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_IO_CAPABILITY_REPLY, hdev 4480 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_IO_CAPABILITY_NEG_REPLY, hdev 4485 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4488 net/bluetooth/hci_event.c static void hci_io_capa_reply_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 4493 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 4495 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4497 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); hdev 4505 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4508 net/bluetooth/hci_event.c static void hci_user_confirm_request_evt(struct hci_dev *hdev, hdev 4515 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 4517 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4519 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_MGMT)) hdev 4522 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); hdev 4537 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_USER_CONFIRM_NEG_REPLY, hdev 4561 net/bluetooth/hci_event.c hdev->auto_accept_delay); hdev 4563 net/bluetooth/hci_event.c if (hdev->auto_accept_delay > 0) { hdev 4564 net/bluetooth/hci_event.c int delay = msecs_to_jiffies(hdev->auto_accept_delay); hdev 4565 net/bluetooth/hci_event.c queue_delayed_work(conn->hdev->workqueue, hdev 4570 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_USER_CONFIRM_REPLY, hdev 4576 net/bluetooth/hci_event.c mgmt_user_confirm_request(hdev, &ev->bdaddr, ACL_LINK, 0, hdev 4580 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4583 net/bluetooth/hci_event.c static void hci_user_passkey_request_evt(struct hci_dev *hdev, hdev 4588 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 4590 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 4591 net/bluetooth/hci_event.c mgmt_user_passkey_request(hdev, &ev->bdaddr, ACL_LINK, 0); hdev 4594 net/bluetooth/hci_event.c static void hci_user_passkey_notify_evt(struct hci_dev *hdev, hdev 4600 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 4602 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); hdev 4609 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 4610 net/bluetooth/hci_event.c mgmt_user_passkey_notify(hdev, &conn->dst, conn->type, hdev 4615 net/bluetooth/hci_event.c static void hci_keypress_notify_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 4620 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 4622 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); hdev 4647 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_MGMT)) hdev 4648 net/bluetooth/hci_event.c mgmt_user_passkey_notify(hdev, &conn->dst, conn->type, hdev 4653 net/bluetooth/hci_event.c static void hci_simple_pair_complete_evt(struct hci_dev *hdev, hdev 4659 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 4661 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4663 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); hdev 4681 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4684 net/bluetooth/hci_event.c static void hci_remote_host_features_evt(struct hci_dev *hdev, hdev 4691 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 4693 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4695 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); hdev 4699 net/bluetooth/hci_event.c ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr); hdev 4703 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4706 net/bluetooth/hci_event.c static void hci_remote_oob_data_request_evt(struct hci_dev *hdev, hdev 4712 net/bluetooth/hci_event.c BT_DBG("%s", hdev->name); hdev 4714 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4716 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_MGMT)) hdev 4719 net/bluetooth/hci_event.c data = hci_find_remote_oob_data(hdev, &ev->bdaddr, BDADDR_BREDR); hdev 4724 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_REMOTE_OOB_DATA_NEG_REPLY, hdev 4729 net/bluetooth/hci_event.c if (bredr_sc_enabled(hdev)) { hdev 4733 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_SC_ONLY)) { hdev 4743 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_REMOTE_OOB_EXT_DATA_REPLY, hdev 4752 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_REMOTE_OOB_DATA_REPLY, hdev 4757 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4761 net/bluetooth/hci_event.c static void hci_chan_selected_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 4766 net/bluetooth/hci_event.c BT_DBG("%s handle 0x%2.2x", hdev->name, ev->phy_handle); hdev 4770 net/bluetooth/hci_event.c hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); hdev 4774 net/bluetooth/hci_event.c amp_read_loc_assoc_final_data(hdev, hcon); hdev 4777 net/bluetooth/hci_event.c static void hci_phy_link_complete_evt(struct hci_dev *hdev, hdev 4783 net/bluetooth/hci_event.c BT_DBG("%s handle 0x%2.2x status 0x%2.2x", hdev->name, ev->phy_handle, hdev 4786 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4788 net/bluetooth/hci_event.c hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); hdev 4790 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4796 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4814 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4817 net/bluetooth/hci_event.c static void hci_loglink_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 4825 net/bluetooth/hci_event.c hdev->name, le16_to_cpu(ev->handle), ev->phy_handle, hdev 4828 net/bluetooth/hci_event.c hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); hdev 4847 net/bluetooth/hci_event.c bredr_chan->conn->mtu = hdev->block_mtu; hdev 4855 net/bluetooth/hci_event.c static void hci_disconn_loglink_complete_evt(struct hci_dev *hdev, hdev 4861 net/bluetooth/hci_event.c BT_DBG("%s log handle 0x%4.4x status 0x%2.2x", hdev->name, hdev 4867 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4869 net/bluetooth/hci_event.c hchan = hci_chan_lookup_handle(hdev, le16_to_cpu(ev->handle)); hdev 4876 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4879 net/bluetooth/hci_event.c static void hci_disconn_phylink_complete_evt(struct hci_dev *hdev, hdev 4885 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 4890 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4892 net/bluetooth/hci_event.c hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle); hdev 4898 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 4902 net/bluetooth/hci_event.c static void le_conn_complete_evt(struct hci_dev *hdev, u8 status, hdev 4911 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 4916 net/bluetooth/hci_event.c hci_dev_clear_flag(hdev, HCI_LE_ADV); hdev 4918 net/bluetooth/hci_event.c conn = hci_lookup_le_connect(hdev); hdev 4920 net/bluetooth/hci_event.c conn = hci_conn_add(hdev, LE_LINK, bdaddr, role); hdev 4922 net/bluetooth/hci_event.c bt_dev_err(hdev, "no memory for new connection"); hdev 4939 net/bluetooth/hci_event.c if (hci_dev_test_flag(hdev, HCI_PRIVACY)) { hdev 4941 net/bluetooth/hci_event.c bacpy(&conn->init_addr, &hdev->rpa); hdev 4943 net/bluetooth/hci_event.c hci_copy_identity_address(hdev, hdev 4956 net/bluetooth/hci_event.c conn->resp_addr_type = hdev->adv_addr_type; hdev 4957 net/bluetooth/hci_event.c if (hdev->adv_addr_type == ADDR_LE_DEV_RANDOM) { hdev 4961 net/bluetooth/hci_event.c if (!ext_adv_capable(hdev)) hdev 4962 net/bluetooth/hci_event.c bacpy(&conn->resp_addr, &hdev->random_addr); hdev 4964 net/bluetooth/hci_event.c bacpy(&conn->resp_addr, &hdev->bdaddr); hdev 4975 net/bluetooth/hci_event.c conn->le_conn_min_interval = hdev->le_conn_min_interval; hdev 4976 net/bluetooth/hci_event.c conn->le_conn_max_interval = hdev->le_conn_max_interval; hdev 4988 net/bluetooth/hci_event.c irk = hci_get_irk(hdev, &conn->dst, conn->dst_type); hdev 5005 net/bluetooth/hci_event.c if (hci_bdaddr_list_lookup(&hdev->blacklist, &conn->dst, addr_type)) { hdev 5011 net/bluetooth/hci_event.c mgmt_device_connected(hdev, conn, 0, NULL, 0); hdev 5034 net/bluetooth/hci_event.c (hdev->le_features[0] & HCI_LE_SLAVE_FEATURES)) { hdev 5039 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_LE_READ_REMOTE_FEATURES, hdev 5048 net/bluetooth/hci_event.c params = hci_pend_le_action_lookup(&hdev->pend_le_conns, &conn->dst, hdev 5060 net/bluetooth/hci_event.c hci_update_background_scan(hdev); hdev 5061 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 5064 net/bluetooth/hci_event.c static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 5068 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 5070 net/bluetooth/hci_event.c le_conn_complete_evt(hdev, ev->status, &ev->bdaddr, ev->bdaddr_type, hdev 5077 net/bluetooth/hci_event.c static void hci_le_enh_conn_complete_evt(struct hci_dev *hdev, hdev 5082 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 5084 net/bluetooth/hci_event.c le_conn_complete_evt(hdev, ev->status, &ev->bdaddr, ev->bdaddr_type, hdev 5091 net/bluetooth/hci_event.c static void hci_le_ext_adv_term_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 5096 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 5101 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->conn_handle)); hdev 5105 net/bluetooth/hci_event.c if (hdev->adv_addr_type != ADDR_LE_DEV_RANDOM) hdev 5108 net/bluetooth/hci_event.c if (!hdev->cur_adv_instance) { hdev 5109 net/bluetooth/hci_event.c bacpy(&conn->resp_addr, &hdev->random_addr); hdev 5113 net/bluetooth/hci_event.c adv_instance = hci_find_adv_instance(hdev, hdev->cur_adv_instance); hdev 5119 net/bluetooth/hci_event.c static void hci_le_conn_update_complete_evt(struct hci_dev *hdev, hdev 5125 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 5130 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 5132 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); hdev 5139 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 5143 net/bluetooth/hci_event.c static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev, hdev 5156 net/bluetooth/hci_event.c if (hci_bdaddr_list_lookup(&hdev->blacklist, addr, addr_type)) hdev 5162 net/bluetooth/hci_event.c if (hdev->conn_hash.le_num_slave > 0) hdev 5168 net/bluetooth/hci_event.c params = hci_pend_le_action_lookup(&hdev->pend_le_conns, addr, hdev 5196 net/bluetooth/hci_event.c conn = hci_connect_le(hdev, addr, addr_type, BT_SECURITY_LOW, hdev 5231 net/bluetooth/hci_event.c static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr, hdev 5235 net/bluetooth/hci_event.c struct discovery_state *d = &hdev->discovery; hdev 5250 net/bluetooth/hci_event.c bt_dev_err_ratelimited(hdev, "unknown advertising packet " hdev 5270 net/bluetooth/hci_event.c bt_dev_err_ratelimited(hdev, "advertising data len corrected"); hdev 5289 net/bluetooth/hci_event.c if (!hci_dev_test_flag(hdev, HCI_PRIVACY)) hdev 5296 net/bluetooth/hci_event.c if (!smp_irk_matches(hdev, hdev->irk, direct_addr)) hdev 5301 net/bluetooth/hci_event.c irk = hci_get_irk(hdev, bdaddr, bdaddr_type); hdev 5312 net/bluetooth/hci_event.c conn = check_pending_le_conn(hdev, bdaddr, bdaddr_type, type, hdev 5326 net/bluetooth/hci_event.c if (hdev->le_scan_type == LE_SCAN_PASSIVE) { hdev 5330 net/bluetooth/hci_event.c if (!hci_pend_le_action_lookup(&hdev->pend_le_reports, hdev 5338 net/bluetooth/hci_event.c mgmt_device_found(hdev, bdaddr, LE_LINK, bdaddr_type, NULL, hdev 5368 net/bluetooth/hci_event.c if (!has_pending_adv_report(hdev)) { hdev 5373 net/bluetooth/hci_event.c store_pending_adv_report(hdev, bdaddr, bdaddr_type, hdev 5378 net/bluetooth/hci_event.c mgmt_device_found(hdev, bdaddr, LE_LINK, bdaddr_type, NULL, hdev 5394 net/bluetooth/hci_event.c mgmt_device_found(hdev, &d->last_adv_addr, LE_LINK, hdev 5404 net/bluetooth/hci_event.c store_pending_adv_report(hdev, bdaddr, bdaddr_type, hdev 5412 net/bluetooth/hci_event.c clear_pending_adv_report(hdev); hdev 5413 net/bluetooth/hci_event.c mgmt_device_found(hdev, bdaddr, LE_LINK, bdaddr_type, NULL, hdev 5422 net/bluetooth/hci_event.c mgmt_device_found(hdev, &d->last_adv_addr, LE_LINK, hdev 5425 net/bluetooth/hci_event.c clear_pending_adv_report(hdev); hdev 5428 net/bluetooth/hci_event.c static void hci_le_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 5433 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 5441 net/bluetooth/hci_event.c process_adv_report(hdev, ev->evt_type, &ev->bdaddr, hdev 5445 net/bluetooth/hci_event.c bt_dev_err(hdev, "Dropping invalid advertising data"); hdev 5451 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 5500 net/bluetooth/hci_event.c static void hci_le_ext_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 5505 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 5515 net/bluetooth/hci_event.c process_adv_report(hdev, legacy_evt_type, &ev->bdaddr, hdev 5523 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 5526 net/bluetooth/hci_event.c static void hci_le_remote_feat_complete_evt(struct hci_dev *hdev, hdev 5532 net/bluetooth/hci_event.c BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); hdev 5534 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 5536 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); hdev 5553 net/bluetooth/hci_event.c if ((hdev->le_features[0] & HCI_LE_SLAVE_FEATURES) && hdev 5565 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 5568 net/bluetooth/hci_event.c static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 5576 net/bluetooth/hci_event.c BT_DBG("%s handle 0x%4.4x", hdev->name, __le16_to_cpu(ev->handle)); hdev 5578 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 5580 net/bluetooth/hci_event.c conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); hdev 5584 net/bluetooth/hci_event.c ltk = hci_find_ltk(hdev, &conn->dst, conn->dst_type, conn->role); hdev 5606 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp); hdev 5622 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 5628 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_LE_LTK_NEG_REPLY, sizeof(neg), &neg); hdev 5629 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 5632 net/bluetooth/hci_event.c static void send_conn_param_neg_reply(struct hci_dev *hdev, u16 handle, hdev 5640 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY, sizeof(cp), hdev 5644 net/bluetooth/hci_event.c static void hci_le_remote_conn_param_req_evt(struct hci_dev *hdev, hdev 5658 net/bluetooth/hci_event.c hcon = hci_conn_hash_lookup_handle(hdev, handle); hdev 5660 net/bluetooth/hci_event.c return send_conn_param_neg_reply(hdev, handle, hdev 5664 net/bluetooth/hci_event.c return send_conn_param_neg_reply(hdev, handle, hdev 5671 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 5673 net/bluetooth/hci_event.c params = hci_conn_params_lookup(hdev, &hcon->dst, hdev 5685 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 5687 net/bluetooth/hci_event.c mgmt_new_conn_param(hdev, &hcon->dst, hcon->dst_type, hdev 5699 net/bluetooth/hci_event.c hci_send_cmd(hdev, HCI_OP_LE_CONN_PARAM_REQ_REPLY, sizeof(cp), &cp); hdev 5702 net/bluetooth/hci_event.c static void hci_le_direct_adv_report_evt(struct hci_dev *hdev, hdev 5708 net/bluetooth/hci_event.c hci_dev_lock(hdev); hdev 5713 net/bluetooth/hci_event.c process_adv_report(hdev, ev->evt_type, &ev->bdaddr, hdev 5720 net/bluetooth/hci_event.c hci_dev_unlock(hdev); hdev 5723 net/bluetooth/hci_event.c static void hci_le_meta_evt(struct hci_dev *hdev, struct sk_buff *skb) hdev 5731 net/bluetooth/hci_event.c hci_le_conn_complete_evt(hdev, skb); hdev 5735 net/bluetooth/hci_event.c hci_le_conn_update_complete_evt(hdev, skb); hdev 5739 net/bluetooth/hci_event.c hci_le_adv_report_evt(hdev, skb); hdev 5743 net/bluetooth/hci_event.c hci_le_remote_feat_complete_evt(hdev, skb); hdev 5747 net/bluetooth/hci_event.c hci_le_ltk_request_evt(hdev, skb); hdev 5751 net/bluetooth/hci_event.c hci_le_remote_conn_param_req_evt(hdev, skb); hdev 5755 net/bluetooth/hci_event.c hci_le_direct_adv_report_evt(hdev, skb); hdev 5759 net/bluetooth/hci_event.c hci_le_ext_adv_report_evt(hdev, skb); hdev 5763 net/bluetooth/hci_event.c hci_le_enh_conn_complete_evt(hdev, skb); hdev 5767 net/bluetooth/hci_event.c hci_le_ext_adv_term_evt(hdev, skb); hdev 5775 net/bluetooth/hci_event.c static bool hci_get_cmd_complete(struct hci_dev *hdev, u16 opcode, hdev 5785 net/bluetooth/hci_event.c bt_dev_err(hdev, "too short HCI event"); hdev 5805 net/bluetooth/hci_event.c bt_dev_err(hdev, "last event is not cmd complete (0x%2.2x)", hdev 5811 net/bluetooth/hci_event.c bt_dev_err(hdev, "too short cmd_complete event"); hdev 5827 net/bluetooth/hci_event.c void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb) hdev 5836 net/bluetooth/hci_event.c if (hdev->sent_cmd && bt_cb(hdev->sent_cmd)->hci.req_event == event) { hdev 5837 net/bluetooth/hci_event.c struct hci_command_hdr *cmd_hdr = (void *) hdev->sent_cmd->data; hdev 5839 net/bluetooth/hci_event.c hci_req_cmd_complete(hdev, opcode, status, &req_complete, hdev 5857 net/bluetooth/hci_event.c hci_inquiry_complete_evt(hdev, skb); hdev 5861 net/bluetooth/hci_event.c hci_inquiry_result_evt(hdev, skb); hdev 5865 net/bluetooth/hci_event.c hci_conn_complete_evt(hdev, skb); hdev 5869 net/bluetooth/hci_event.c hci_conn_request_evt(hdev, skb); hdev 5873 net/bluetooth/hci_event.c hci_disconn_complete_evt(hdev, skb); hdev 5877 net/bluetooth/hci_event.c hci_auth_complete_evt(hdev, skb); hdev 5881 net/bluetooth/hci_event.c hci_remote_name_evt(hdev, skb); hdev 5885 net/bluetooth/hci_event.c hci_encrypt_change_evt(hdev, skb); hdev 5889 net/bluetooth/hci_event.c hci_change_link_key_complete_evt(hdev, skb); hdev 5893 net/bluetooth/hci_event.c hci_remote_features_evt(hdev, skb); hdev 5897 net/bluetooth/hci_event.c hci_cmd_complete_evt(hdev, skb, &opcode, &status, hdev 5902 net/bluetooth/hci_event.c hci_cmd_status_evt(hdev, skb, &opcode, &status, &req_complete, hdev 5907 net/bluetooth/hci_event.c hci_hardware_error_evt(hdev, skb); hdev 5911 net/bluetooth/hci_event.c hci_role_change_evt(hdev, skb); hdev 5915 net/bluetooth/hci_event.c hci_num_comp_pkts_evt(hdev, skb); hdev 5919 net/bluetooth/hci_event.c hci_mode_change_evt(hdev, skb); hdev 5923 net/bluetooth/hci_event.c hci_pin_code_request_evt(hdev, skb); hdev 5927 net/bluetooth/hci_event.c hci_link_key_request_evt(hdev, skb); hdev 5931 net/bluetooth/hci_event.c hci_link_key_notify_evt(hdev, skb); hdev 5935 net/bluetooth/hci_event.c hci_clock_offset_evt(hdev, skb); hdev 5939 net/bluetooth/hci_event.c hci_pkt_type_change_evt(hdev, skb); hdev 5943 net/bluetooth/hci_event.c hci_pscan_rep_mode_evt(hdev, skb); hdev 5947 net/bluetooth/hci_event.c hci_inquiry_result_with_rssi_evt(hdev, skb); hdev 5951 net/bluetooth/hci_event.c hci_remote_ext_features_evt(hdev, skb); hdev 5955 net/bluetooth/hci_event.c hci_sync_conn_complete_evt(hdev, skb); hdev 5959 net/bluetooth/hci_event.c hci_extended_inquiry_result_evt(hdev, skb); hdev 5963 net/bluetooth/hci_event.c hci_key_refresh_complete_evt(hdev, skb); hdev 5967 net/bluetooth/hci_event.c hci_io_capa_request_evt(hdev, skb); hdev 5971 net/bluetooth/hci_event.c hci_io_capa_reply_evt(hdev, skb); hdev 5975 net/bluetooth/hci_event.c hci_user_confirm_request_evt(hdev, skb); hdev 5979 net/bluetooth/hci_event.c hci_user_passkey_request_evt(hdev, skb); hdev 5983 net/bluetooth/hci_event.c hci_user_passkey_notify_evt(hdev, skb); hdev 5987 net/bluetooth/hci_event.c hci_keypress_notify_evt(hdev, skb); hdev 5991 net/bluetooth/hci_event.c hci_simple_pair_complete_evt(hdev, skb); hdev 5995 net/bluetooth/hci_event.c hci_remote_host_features_evt(hdev, skb); hdev 5999 net/bluetooth/hci_event.c hci_le_meta_evt(hdev, skb); hdev 6003 net/bluetooth/hci_event.c hci_remote_oob_data_request_evt(hdev, skb); hdev 6008 net/bluetooth/hci_event.c hci_chan_selected_evt(hdev, skb); hdev 6012 net/bluetooth/hci_event.c hci_phy_link_complete_evt(hdev, skb); hdev 6016 net/bluetooth/hci_event.c hci_loglink_complete_evt(hdev, skb); hdev 6020 net/bluetooth/hci_event.c hci_disconn_loglink_complete_evt(hdev, skb); hdev 6024 net/bluetooth/hci_event.c hci_disconn_phylink_complete_evt(hdev, skb); hdev 6029 net/bluetooth/hci_event.c hci_num_comp_blocks_evt(hdev, skb); hdev 6033 net/bluetooth/hci_event.c BT_DBG("%s event 0x%2.2x", hdev->name, event); hdev 6038 net/bluetooth/hci_event.c req_complete(hdev, status, opcode); hdev 6040 net/bluetooth/hci_event.c if (!hci_get_cmd_complete(hdev, opcode, req_evt, orig_skb)) { hdev 6044 net/bluetooth/hci_event.c req_complete_skb(hdev, status, opcode, orig_skb); hdev 6049 net/bluetooth/hci_event.c hdev->stat.evt_rx++; hdev 37 net/bluetooth/hci_request.c void hci_req_init(struct hci_request *req, struct hci_dev *hdev) hdev 40 net/bluetooth/hci_request.c req->hdev = hdev; hdev 49 net/bluetooth/hci_request.c bool hci_req_status_pend(struct hci_dev *hdev) hdev 51 net/bluetooth/hci_request.c return hdev->req_status == HCI_REQ_PEND; hdev 57 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 83 net/bluetooth/hci_request.c spin_lock_irqsave(&hdev->cmd_q.lock, flags); hdev 84 net/bluetooth/hci_request.c skb_queue_splice_tail(&req->cmd_q, &hdev->cmd_q); hdev 85 net/bluetooth/hci_request.c spin_unlock_irqrestore(&hdev->cmd_q.lock, flags); hdev 87 net/bluetooth/hci_request.c queue_work(hdev->workqueue, &hdev->cmd_work); hdev 102 net/bluetooth/hci_request.c static void hci_req_sync_complete(struct hci_dev *hdev, u8 result, u16 opcode, hdev 105 net/bluetooth/hci_request.c BT_DBG("%s result 0x%2.2x", hdev->name, result); hdev 107 net/bluetooth/hci_request.c if (hdev->req_status == HCI_REQ_PEND) { hdev 108 net/bluetooth/hci_request.c hdev->req_result = result; hdev 109 net/bluetooth/hci_request.c hdev->req_status = HCI_REQ_DONE; hdev 111 net/bluetooth/hci_request.c hdev->req_skb = skb_get(skb); hdev 112 net/bluetooth/hci_request.c wake_up_interruptible(&hdev->req_wait_q); hdev 116 net/bluetooth/hci_request.c void hci_req_sync_cancel(struct hci_dev *hdev, int err) hdev 118 net/bluetooth/hci_request.c BT_DBG("%s err 0x%2.2x", hdev->name, err); hdev 120 net/bluetooth/hci_request.c if (hdev->req_status == HCI_REQ_PEND) { hdev 121 net/bluetooth/hci_request.c hdev->req_result = err; hdev 122 net/bluetooth/hci_request.c hdev->req_status = HCI_REQ_CANCELED; hdev 123 net/bluetooth/hci_request.c wake_up_interruptible(&hdev->req_wait_q); hdev 127 net/bluetooth/hci_request.c struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen, hdev 134 net/bluetooth/hci_request.c BT_DBG("%s", hdev->name); hdev 136 net/bluetooth/hci_request.c hci_req_init(&req, hdev); hdev 140 net/bluetooth/hci_request.c hdev->req_status = HCI_REQ_PEND; hdev 146 net/bluetooth/hci_request.c err = wait_event_interruptible_timeout(hdev->req_wait_q, hdev 147 net/bluetooth/hci_request.c hdev->req_status != HCI_REQ_PEND, timeout); hdev 152 net/bluetooth/hci_request.c switch (hdev->req_status) { hdev 154 net/bluetooth/hci_request.c err = -bt_to_errno(hdev->req_result); hdev 158 net/bluetooth/hci_request.c err = -hdev->req_result; hdev 166 net/bluetooth/hci_request.c hdev->req_status = hdev->req_result = 0; hdev 167 net/bluetooth/hci_request.c skb = hdev->req_skb; hdev 168 net/bluetooth/hci_request.c hdev->req_skb = NULL; hdev 170 net/bluetooth/hci_request.c BT_DBG("%s end: err %d", hdev->name, err); hdev 184 net/bluetooth/hci_request.c struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen, hdev 187 net/bluetooth/hci_request.c return __hci_cmd_sync_ev(hdev, opcode, plen, param, 0, timeout); hdev 192 net/bluetooth/hci_request.c int __hci_req_sync(struct hci_dev *hdev, int (*func)(struct hci_request *req, hdev 199 net/bluetooth/hci_request.c BT_DBG("%s start", hdev->name); hdev 201 net/bluetooth/hci_request.c hci_req_init(&req, hdev); hdev 203 net/bluetooth/hci_request.c hdev->req_status = HCI_REQ_PEND; hdev 214 net/bluetooth/hci_request.c hdev->req_status = 0; hdev 233 net/bluetooth/hci_request.c err = wait_event_interruptible_timeout(hdev->req_wait_q, hdev 234 net/bluetooth/hci_request.c hdev->req_status != HCI_REQ_PEND, timeout); hdev 239 net/bluetooth/hci_request.c switch (hdev->req_status) { hdev 241 net/bluetooth/hci_request.c err = -bt_to_errno(hdev->req_result); hdev 243 net/bluetooth/hci_request.c *hci_status = hdev->req_result; hdev 247 net/bluetooth/hci_request.c err = -hdev->req_result; hdev 259 net/bluetooth/hci_request.c kfree_skb(hdev->req_skb); hdev 260 net/bluetooth/hci_request.c hdev->req_skb = NULL; hdev 261 net/bluetooth/hci_request.c hdev->req_status = hdev->req_result = 0; hdev 263 net/bluetooth/hci_request.c BT_DBG("%s end: err %d", hdev->name, err); hdev 268 net/bluetooth/hci_request.c int hci_req_sync(struct hci_dev *hdev, int (*req)(struct hci_request *req, hdev 274 net/bluetooth/hci_request.c if (!test_bit(HCI_UP, &hdev->flags)) hdev 278 net/bluetooth/hci_request.c hci_req_sync_lock(hdev); hdev 279 net/bluetooth/hci_request.c ret = __hci_req_sync(hdev, req, opt, timeout, hci_status); hdev 280 net/bluetooth/hci_request.c hci_req_sync_unlock(hdev); hdev 285 net/bluetooth/hci_request.c struct sk_buff *hci_prepare_cmd(struct hci_dev *hdev, u16 opcode, u32 plen, hdev 315 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 318 net/bluetooth/hci_request.c BT_DBG("%s opcode 0x%4.4x plen %d", hdev->name, opcode, plen); hdev 326 net/bluetooth/hci_request.c skb = hci_prepare_cmd(hdev, opcode, plen, param); hdev 328 net/bluetooth/hci_request.c bt_dev_err(hdev, "no memory for command (opcode 0x%4.4x)", hdev 350 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 354 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) hdev 357 net/bluetooth/hci_request.c if (hdev->hci_ver < BLUETOOTH_VER_1_2) hdev 374 net/bluetooth/hci_request.c if (__cpu_to_le16(hdev->page_scan_interval) != acp.interval || hdev 375 net/bluetooth/hci_request.c __cpu_to_le16(hdev->page_scan_window) != acp.window) hdev 379 net/bluetooth/hci_request.c if (hdev->page_scan_type != type) hdev 391 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 393 net/bluetooth/hci_request.c if (!test_bit(HCI_UP, &hdev->flags) || hdev 394 net/bluetooth/hci_request.c test_bit(HCI_INIT, &hdev->flags) || hdev 395 net/bluetooth/hci_request.c hci_dev_test_flag(hdev, HCI_SETUP) || hdev 396 net/bluetooth/hci_request.c hci_dev_test_flag(hdev, HCI_CONFIG) || hdev 397 net/bluetooth/hci_request.c hci_dev_test_flag(hdev, HCI_AUTO_OFF) || hdev 398 net/bluetooth/hci_request.c hci_dev_test_flag(hdev, HCI_UNREGISTER)) hdev 402 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_LE_ENABLED)) hdev 406 net/bluetooth/hci_request.c if (hdev->discovery.state != DISCOVERY_STOPPED) hdev 416 net/bluetooth/hci_request.c hci_discovery_filter_clear(hdev); hdev 418 net/bluetooth/hci_request.c if (list_empty(&hdev->pend_le_conns) && hdev 419 net/bluetooth/hci_request.c list_empty(&hdev->pend_le_reports)) { hdev 426 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_LE_SCAN)) hdev 431 net/bluetooth/hci_request.c BT_DBG("%s stopping background scanning", hdev->name); hdev 441 net/bluetooth/hci_request.c if (hci_lookup_le_connect(hdev)) hdev 447 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) hdev 452 net/bluetooth/hci_request.c BT_DBG("%s starting background scanning", hdev->name); hdev 458 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 461 net/bluetooth/hci_request.c memcpy(cp.name, hdev->dev_name, sizeof(cp.name)); hdev 468 net/bluetooth/hci_request.c static u8 *create_uuid16_list(struct hci_dev *hdev, u8 *data, ptrdiff_t len) hdev 476 net/bluetooth/hci_request.c list_for_each_entry(uuid, &hdev->uuids, list) { hdev 510 net/bluetooth/hci_request.c static u8 *create_uuid32_list(struct hci_dev *hdev, u8 *data, ptrdiff_t len) hdev 518 net/bluetooth/hci_request.c list_for_each_entry(uuid, &hdev->uuids, list) { hdev 543 net/bluetooth/hci_request.c static u8 *create_uuid128_list(struct hci_dev *hdev, u8 *data, ptrdiff_t len) hdev 551 net/bluetooth/hci_request.c list_for_each_entry(uuid, &hdev->uuids, list) { hdev 576 net/bluetooth/hci_request.c static void create_eir(struct hci_dev *hdev, u8 *data) hdev 581 net/bluetooth/hci_request.c name_len = strlen(hdev->dev_name); hdev 594 net/bluetooth/hci_request.c memcpy(ptr + 2, hdev->dev_name, name_len); hdev 599 net/bluetooth/hci_request.c if (hdev->inq_tx_power != HCI_TX_POWER_INVALID) { hdev 602 net/bluetooth/hci_request.c ptr[2] = (u8) hdev->inq_tx_power; hdev 607 net/bluetooth/hci_request.c if (hdev->devid_source > 0) { hdev 611 net/bluetooth/hci_request.c put_unaligned_le16(hdev->devid_source, ptr + 2); hdev 612 net/bluetooth/hci_request.c put_unaligned_le16(hdev->devid_vendor, ptr + 4); hdev 613 net/bluetooth/hci_request.c put_unaligned_le16(hdev->devid_product, ptr + 6); hdev 614 net/bluetooth/hci_request.c put_unaligned_le16(hdev->devid_version, ptr + 8); hdev 619 net/bluetooth/hci_request.c ptr = create_uuid16_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data)); hdev 620 net/bluetooth/hci_request.c ptr = create_uuid32_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data)); hdev 621 net/bluetooth/hci_request.c ptr = create_uuid128_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data)); hdev 626 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 629 net/bluetooth/hci_request.c if (!hdev_is_powered(hdev)) hdev 632 net/bluetooth/hci_request.c if (!lmp_ext_inq_capable(hdev)) hdev 635 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_SSP_ENABLED)) hdev 638 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_SERVICE_CACHE)) hdev 643 net/bluetooth/hci_request.c create_eir(hdev, cp.data); hdev 645 net/bluetooth/hci_request.c if (memcmp(cp.data, hdev->eir, sizeof(cp.data)) == 0) hdev 648 net/bluetooth/hci_request.c memcpy(hdev->eir, cp.data, sizeof(cp.data)); hdev 655 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 657 net/bluetooth/hci_request.c if (use_ext_scan(hdev)) { hdev 686 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 697 net/bluetooth/hci_request.c list_for_each_entry(b, &hdev->le_white_list, list) { hdev 701 net/bluetooth/hci_request.c if (!hci_pend_le_action_lookup(&hdev->pend_le_conns, hdev 703 net/bluetooth/hci_request.c !hci_pend_le_action_lookup(&hdev->pend_le_reports, hdev 715 net/bluetooth/hci_request.c if (hci_find_irk_by_addr(hdev, &b->bdaddr, b->bdaddr_type)) { hdev 733 net/bluetooth/hci_request.c list_for_each_entry(params, &hdev->pend_le_conns, action) { hdev 734 net/bluetooth/hci_request.c if (hci_bdaddr_list_lookup(&hdev->le_white_list, hdev 738 net/bluetooth/hci_request.c if (white_list_entries >= hdev->le_white_list_size) { hdev 743 net/bluetooth/hci_request.c if (hci_find_irk_by_addr(hdev, ¶ms->addr, hdev 757 net/bluetooth/hci_request.c list_for_each_entry(params, &hdev->pend_le_reports, action) { hdev 758 net/bluetooth/hci_request.c if (hci_bdaddr_list_lookup(&hdev->le_white_list, hdev 762 net/bluetooth/hci_request.c if (white_list_entries >= hdev->le_white_list_size) { hdev 767 net/bluetooth/hci_request.c if (hci_find_irk_by_addr(hdev, ¶ms->addr, hdev 781 net/bluetooth/hci_request.c static bool scan_use_rpa(struct hci_dev *hdev) hdev 783 net/bluetooth/hci_request.c return hci_dev_test_flag(hdev, HCI_PRIVACY); hdev 789 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 794 net/bluetooth/hci_request.c if (use_ext_scan(hdev)) { hdev 810 net/bluetooth/hci_request.c if (scan_1m(hdev) || scan_2m(hdev)) { hdev 822 net/bluetooth/hci_request.c if (scan_coded(hdev)) { hdev 866 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 876 net/bluetooth/hci_request.c if (hci_update_random_address(req, false, scan_use_rpa(hdev), hdev 895 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_PRIVACY) && hdev 896 net/bluetooth/hci_request.c (hdev->le_features[0] & HCI_LE_EXT_SCAN_POLICY)) hdev 899 net/bluetooth/hci_request.c hci_req_start_scan(req, LE_SCAN_PASSIVE, hdev->le_scan_interval, hdev 900 net/bluetooth/hci_request.c hdev->le_scan_window, own_addr_type, filter_policy); hdev 903 net/bluetooth/hci_request.c static u8 get_adv_instance_scan_rsp_len(struct hci_dev *hdev, u8 instance) hdev 911 net/bluetooth/hci_request.c adv_instance = hci_find_adv_instance(hdev, instance); hdev 921 net/bluetooth/hci_request.c static u8 get_cur_adv_instance_scan_rsp_len(struct hci_dev *hdev) hdev 923 net/bluetooth/hci_request.c u8 instance = hdev->cur_adv_instance; hdev 930 net/bluetooth/hci_request.c adv_instance = hci_find_adv_instance(hdev, instance); hdev 942 net/bluetooth/hci_request.c if (ext_adv_capable(req->hdev)) { hdev 957 net/bluetooth/hci_request.c static u32 get_adv_instance_flags(struct hci_dev *hdev, u8 instance) hdev 971 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_ADVERTISING_CONNECTABLE)) hdev 974 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE)) hdev 976 net/bluetooth/hci_request.c else if (hci_dev_test_flag(hdev, HCI_DISCOVERABLE)) hdev 982 net/bluetooth/hci_request.c adv_instance = hci_find_adv_instance(hdev, instance); hdev 991 net/bluetooth/hci_request.c static bool adv_use_rpa(struct hci_dev *hdev, uint32_t flags) hdev 994 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_PRIVACY)) hdev 998 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_LIMITED_PRIVACY)) hdev 1005 net/bluetooth/hci_request.c hci_dev_test_flag(hdev, HCI_BONDABLE)) hdev 1014 net/bluetooth/hci_request.c static bool is_advertising_allowed(struct hci_dev *hdev, bool connectable) hdev 1017 net/bluetooth/hci_request.c if (hci_conn_num(hdev, LE_LINK) == 0) hdev 1021 net/bluetooth/hci_request.c if (hdev->conn_hash.le_num_slave > 0) { hdev 1023 net/bluetooth/hci_request.c if (!connectable && !(hdev->le_states[2] & 0x10)) hdev 1029 net/bluetooth/hci_request.c if (connectable && (!(hdev->le_states[4] & 0x40) || hdev 1030 net/bluetooth/hci_request.c !(hdev->le_states[2] & 0x20))) hdev 1035 net/bluetooth/hci_request.c if (hci_conn_num(hdev, LE_LINK) != hdev->conn_hash.le_num_slave) { hdev 1037 net/bluetooth/hci_request.c if (!connectable && !(hdev->le_states[2] & 0x02)) hdev 1043 net/bluetooth/hci_request.c if (connectable && (!(hdev->le_states[4] & 0x08) || hdev 1044 net/bluetooth/hci_request.c !(hdev->le_states[2] & 0x08))) hdev 1053 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 1060 net/bluetooth/hci_request.c flags = get_adv_instance_flags(hdev, hdev->cur_adv_instance); hdev 1066 net/bluetooth/hci_request.c mgmt_get_connectable(hdev); hdev 1068 net/bluetooth/hci_request.c if (!is_advertising_allowed(hdev, connectable)) hdev 1071 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_LE_ADV)) hdev 1079 net/bluetooth/hci_request.c hci_dev_clear_flag(hdev, HCI_LE_ADV); hdev 1086 net/bluetooth/hci_request.c adv_use_rpa(hdev, flags), hdev 1095 net/bluetooth/hci_request.c adv_min_interval = hdev->le_adv_min_interval; hdev 1096 net/bluetooth/hci_request.c adv_max_interval = hdev->le_adv_max_interval; hdev 1098 net/bluetooth/hci_request.c if (get_cur_adv_instance_scan_rsp_len(hdev)) hdev 1103 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_DISCOVERABLE) || hdev 1104 net/bluetooth/hci_request.c hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE)) { hdev 1108 net/bluetooth/hci_request.c adv_min_interval = hdev->le_adv_min_interval; hdev 1109 net/bluetooth/hci_request.c adv_max_interval = hdev->le_adv_max_interval; hdev 1116 net/bluetooth/hci_request.c cp.channel_map = hdev->le_adv_channel_map; hdev 1123 net/bluetooth/hci_request.c u8 append_local_name(struct hci_dev *hdev, u8 *ptr, u8 ad_len) hdev 1133 net/bluetooth/hci_request.c complete_len = strlen(hdev->dev_name); hdev 1136 net/bluetooth/hci_request.c hdev->dev_name, complete_len + 1); hdev 1139 net/bluetooth/hci_request.c short_len = strlen(hdev->short_name); hdev 1142 net/bluetooth/hci_request.c hdev->short_name, short_len + 1); hdev 1150 net/bluetooth/hci_request.c memcpy(name, hdev->dev_name, HCI_MAX_SHORT_NAME_LENGTH); hdev 1160 net/bluetooth/hci_request.c static u8 append_appearance(struct hci_dev *hdev, u8 *ptr, u8 ad_len) hdev 1162 net/bluetooth/hci_request.c return eir_append_le16(ptr, ad_len, EIR_APPEARANCE, hdev->appearance); hdev 1165 net/bluetooth/hci_request.c static u8 create_default_scan_rsp_data(struct hci_dev *hdev, u8 *ptr) hdev 1169 net/bluetooth/hci_request.c if (hdev->appearance) { hdev 1170 net/bluetooth/hci_request.c scan_rsp_len = append_appearance(hdev, ptr, scan_rsp_len); hdev 1173 net/bluetooth/hci_request.c return append_local_name(hdev, ptr, scan_rsp_len); hdev 1176 net/bluetooth/hci_request.c static u8 create_instance_scan_rsp_data(struct hci_dev *hdev, u8 instance, hdev 1183 net/bluetooth/hci_request.c adv_instance = hci_find_adv_instance(hdev, instance); hdev 1189 net/bluetooth/hci_request.c if ((instance_flags & MGMT_ADV_FLAG_APPEARANCE) && hdev->appearance) { hdev 1190 net/bluetooth/hci_request.c scan_rsp_len = append_appearance(hdev, ptr, scan_rsp_len); hdev 1199 net/bluetooth/hci_request.c scan_rsp_len = append_local_name(hdev, ptr, scan_rsp_len); hdev 1206 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 1209 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_LE_ENABLED)) hdev 1212 net/bluetooth/hci_request.c if (ext_adv_capable(hdev)) { hdev 1218 net/bluetooth/hci_request.c len = create_instance_scan_rsp_data(hdev, instance, hdev 1221 net/bluetooth/hci_request.c len = create_default_scan_rsp_data(hdev, cp.data); hdev 1223 net/bluetooth/hci_request.c if (hdev->scan_rsp_data_len == len && hdev 1224 net/bluetooth/hci_request.c !memcmp(cp.data, hdev->scan_rsp_data, len)) hdev 1227 net/bluetooth/hci_request.c memcpy(hdev->scan_rsp_data, cp.data, sizeof(cp.data)); hdev 1228 net/bluetooth/hci_request.c hdev->scan_rsp_data_len = len; hdev 1243 net/bluetooth/hci_request.c len = create_instance_scan_rsp_data(hdev, instance, hdev 1246 net/bluetooth/hci_request.c len = create_default_scan_rsp_data(hdev, cp.data); hdev 1248 net/bluetooth/hci_request.c if (hdev->scan_rsp_data_len == len && hdev 1249 net/bluetooth/hci_request.c !memcmp(cp.data, hdev->scan_rsp_data, len)) hdev 1252 net/bluetooth/hci_request.c memcpy(hdev->scan_rsp_data, cp.data, sizeof(cp.data)); hdev 1253 net/bluetooth/hci_request.c hdev->scan_rsp_data_len = len; hdev 1261 net/bluetooth/hci_request.c static u8 create_instance_adv_data(struct hci_dev *hdev, u8 instance, u8 *ptr) hdev 1269 net/bluetooth/hci_request.c adv_instance = hci_find_adv_instance(hdev, instance); hdev 1274 net/bluetooth/hci_request.c instance_flags = get_adv_instance_flags(hdev, instance); hdev 1293 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) hdev 1301 net/bluetooth/hci_request.c flags |= mgmt_get_adv_discov_flags(hdev); hdev 1327 net/bluetooth/hci_request.c if (ext_adv_capable(hdev)) { hdev 1331 net/bluetooth/hci_request.c adv_tx_power = hdev->adv_tx_power; hdev 1333 net/bluetooth/hci_request.c adv_tx_power = hdev->adv_tx_power; hdev 1352 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 1355 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_LE_ENABLED)) hdev 1358 net/bluetooth/hci_request.c if (ext_adv_capable(hdev)) { hdev 1363 net/bluetooth/hci_request.c len = create_instance_adv_data(hdev, instance, cp.data); hdev 1366 net/bluetooth/hci_request.c if (hdev->adv_data_len == len && hdev 1367 net/bluetooth/hci_request.c memcmp(cp.data, hdev->adv_data, len) == 0) hdev 1370 net/bluetooth/hci_request.c memcpy(hdev->adv_data, cp.data, sizeof(cp.data)); hdev 1371 net/bluetooth/hci_request.c hdev->adv_data_len = len; hdev 1384 net/bluetooth/hci_request.c len = create_instance_adv_data(hdev, instance, cp.data); hdev 1387 net/bluetooth/hci_request.c if (hdev->adv_data_len == len && hdev 1388 net/bluetooth/hci_request.c memcmp(cp.data, hdev->adv_data, len) == 0) hdev 1391 net/bluetooth/hci_request.c memcpy(hdev->adv_data, cp.data, sizeof(cp.data)); hdev 1392 net/bluetooth/hci_request.c hdev->adv_data_len = len; hdev 1400 net/bluetooth/hci_request.c int hci_req_update_adv_data(struct hci_dev *hdev, u8 instance) hdev 1404 net/bluetooth/hci_request.c hci_req_init(&req, hdev); hdev 1410 net/bluetooth/hci_request.c static void adv_enable_complete(struct hci_dev *hdev, u8 status, u16 opcode) hdev 1412 net/bluetooth/hci_request.c BT_DBG("%s status %u", hdev->name, status); hdev 1415 net/bluetooth/hci_request.c void hci_req_reenable_advertising(struct hci_dev *hdev) hdev 1419 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_ADVERTISING) && hdev 1420 net/bluetooth/hci_request.c list_empty(&hdev->adv_instances)) hdev 1423 net/bluetooth/hci_request.c hci_req_init(&req, hdev); hdev 1425 net/bluetooth/hci_request.c if (hdev->cur_adv_instance) { hdev 1426 net/bluetooth/hci_request.c __hci_req_schedule_adv_instance(&req, hdev->cur_adv_instance, hdev 1429 net/bluetooth/hci_request.c if (ext_adv_capable(hdev)) { hdev 1443 net/bluetooth/hci_request.c struct hci_dev *hdev = container_of(work, struct hci_dev, hdev 1449 net/bluetooth/hci_request.c BT_DBG("%s", hdev->name); hdev 1451 net/bluetooth/hci_request.c hci_dev_lock(hdev); hdev 1453 net/bluetooth/hci_request.c hdev->adv_instance_timeout = 0; hdev 1455 net/bluetooth/hci_request.c instance = hdev->cur_adv_instance; hdev 1459 net/bluetooth/hci_request.c hci_req_init(&req, hdev); hdev 1461 net/bluetooth/hci_request.c hci_req_clear_adv_instance(hdev, NULL, &req, instance, false); hdev 1463 net/bluetooth/hci_request.c if (list_empty(&hdev->adv_instances)) hdev 1469 net/bluetooth/hci_request.c hci_dev_unlock(hdev); hdev 1472 net/bluetooth/hci_request.c int hci_get_random_address(struct hci_dev *hdev, bool require_privacy, hdev 1490 net/bluetooth/hci_request.c !bacmp(&adv_instance->random_addr, &hdev->rpa)) hdev 1495 net/bluetooth/hci_request.c if (!hci_dev_test_and_clear_flag(hdev, HCI_RPA_EXPIRED) && hdev 1496 net/bluetooth/hci_request.c !bacmp(&hdev->random_addr, &hdev->rpa)) hdev 1500 net/bluetooth/hci_request.c err = smp_generate_rpa(hdev, hdev->irk, &hdev->rpa); hdev 1502 net/bluetooth/hci_request.c BT_ERR("%s failed to generate new RPA", hdev->name); hdev 1506 net/bluetooth/hci_request.c bacpy(rand_addr, &hdev->rpa); hdev 1508 net/bluetooth/hci_request.c to = msecs_to_jiffies(hdev->rpa_timeout * 1000); hdev 1510 net/bluetooth/hci_request.c queue_delayed_work(hdev->workqueue, hdev 1513 net/bluetooth/hci_request.c queue_delayed_work(hdev->workqueue, hdev 1514 net/bluetooth/hci_request.c &hdev->rpa_expired, to); hdev 1537 net/bluetooth/hci_request.c if (bacmp(&hdev->bdaddr, &nrpa)) hdev 1561 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 1573 net/bluetooth/hci_request.c adv_instance = hci_find_adv_instance(hdev, instance); hdev 1580 net/bluetooth/hci_request.c flags = get_adv_instance_flags(hdev, instance); hdev 1586 net/bluetooth/hci_request.c mgmt_get_connectable(hdev); hdev 1588 net/bluetooth/hci_request.c if (!is_advertising_allowed(hdev, connectable)) hdev 1595 net/bluetooth/hci_request.c err = hci_get_random_address(hdev, !connectable, hdev 1596 net/bluetooth/hci_request.c adv_use_rpa(hdev, flags), adv_instance, hdev 1613 net/bluetooth/hci_request.c } else if (get_adv_instance_scan_rsp_len(hdev, instance)) { hdev 1626 net/bluetooth/hci_request.c cp.channel_map = hdev->le_adv_channel_map; hdev 1653 net/bluetooth/hci_request.c if (!bacmp(&random_addr, &hdev->random_addr)) hdev 1672 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 1679 net/bluetooth/hci_request.c adv_instance = hci_find_adv_instance(hdev, instance); hdev 1717 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 1720 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_LE_ADV)) hdev 1736 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 1740 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_ADVERTISING) || hdev 1741 net/bluetooth/hci_request.c list_empty(&hdev->adv_instances)) hdev 1744 net/bluetooth/hci_request.c if (hdev->adv_instance_timeout) hdev 1747 net/bluetooth/hci_request.c adv_instance = hci_find_adv_instance(hdev, instance); hdev 1773 net/bluetooth/hci_request.c if (!ext_adv_capable(hdev)) { hdev 1774 net/bluetooth/hci_request.c hdev->adv_instance_timeout = timeout; hdev 1775 net/bluetooth/hci_request.c queue_delayed_work(hdev->req_workqueue, hdev 1776 net/bluetooth/hci_request.c &hdev->adv_instance_expire, hdev 1784 net/bluetooth/hci_request.c if (!force && hdev->cur_adv_instance == instance && hdev 1785 net/bluetooth/hci_request.c hci_dev_test_flag(hdev, HCI_LE_ADV)) hdev 1788 net/bluetooth/hci_request.c hdev->cur_adv_instance = instance; hdev 1789 net/bluetooth/hci_request.c if (ext_adv_capable(hdev)) { hdev 1800 net/bluetooth/hci_request.c static void cancel_adv_timeout(struct hci_dev *hdev) hdev 1802 net/bluetooth/hci_request.c if (hdev->adv_instance_timeout) { hdev 1803 net/bluetooth/hci_request.c hdev->adv_instance_timeout = 0; hdev 1804 net/bluetooth/hci_request.c cancel_delayed_work(&hdev->adv_instance_expire); hdev 1819 net/bluetooth/hci_request.c void hci_req_clear_adv_instance(struct hci_dev *hdev, struct sock *sk, hdev 1828 net/bluetooth/hci_request.c if (!instance || hdev->cur_adv_instance == instance) hdev 1829 net/bluetooth/hci_request.c cancel_adv_timeout(hdev); hdev 1835 net/bluetooth/hci_request.c if (instance && hdev->cur_adv_instance == instance) hdev 1836 net/bluetooth/hci_request.c next_instance = hci_get_next_instance(hdev, instance); hdev 1839 net/bluetooth/hci_request.c list_for_each_entry_safe(adv_instance, n, &hdev->adv_instances, hdev 1845 net/bluetooth/hci_request.c err = hci_remove_adv_instance(hdev, rem_inst); hdev 1847 net/bluetooth/hci_request.c mgmt_advertising_removed(sk, hdev, rem_inst); hdev 1850 net/bluetooth/hci_request.c adv_instance = hci_find_adv_instance(hdev, instance); hdev 1859 net/bluetooth/hci_request.c err = hci_remove_adv_instance(hdev, instance); hdev 1861 net/bluetooth/hci_request.c mgmt_advertising_removed(sk, hdev, instance); hdev 1865 net/bluetooth/hci_request.c if (!req || !hdev_is_powered(hdev) || hdev 1866 net/bluetooth/hci_request.c hci_dev_test_flag(hdev, HCI_ADVERTISING)) hdev 1876 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 1888 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_LE_ADV) || hdev 1889 net/bluetooth/hci_request.c hci_lookup_le_connect(hdev)) { hdev 1891 net/bluetooth/hci_request.c hci_dev_set_flag(hdev, HCI_RPA_EXPIRED); hdev 1901 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 1913 net/bluetooth/hci_request.c if (!hci_dev_test_and_clear_flag(hdev, HCI_RPA_EXPIRED) && hdev 1914 net/bluetooth/hci_request.c !bacmp(&hdev->random_addr, &hdev->rpa)) hdev 1917 net/bluetooth/hci_request.c err = smp_generate_rpa(hdev, hdev->irk, &hdev->rpa); hdev 1919 net/bluetooth/hci_request.c bt_dev_err(hdev, "failed to generate new RPA"); hdev 1923 net/bluetooth/hci_request.c set_random_addr(req, &hdev->rpa); hdev 1925 net/bluetooth/hci_request.c to = msecs_to_jiffies(hdev->rpa_timeout * 1000); hdev 1926 net/bluetooth/hci_request.c queue_delayed_work(hdev->workqueue, &hdev->rpa_expired, to); hdev 1949 net/bluetooth/hci_request.c if (bacmp(&hdev->bdaddr, &nrpa)) hdev 1967 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR) || hdev 1968 net/bluetooth/hci_request.c !bacmp(&hdev->bdaddr, BDADDR_ANY) || hdev 1969 net/bluetooth/hci_request.c (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED) && hdev 1970 net/bluetooth/hci_request.c bacmp(&hdev->static_addr, BDADDR_ANY))) { hdev 1972 net/bluetooth/hci_request.c if (bacmp(&hdev->static_addr, &hdev->random_addr)) hdev 1974 net/bluetooth/hci_request.c &hdev->static_addr); hdev 1986 net/bluetooth/hci_request.c static bool disconnected_whitelist_entries(struct hci_dev *hdev) hdev 1990 net/bluetooth/hci_request.c list_for_each_entry(b, &hdev->whitelist, list) { hdev 1993 net/bluetooth/hci_request.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &b->bdaddr); hdev 2006 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 2009 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) hdev 2012 net/bluetooth/hci_request.c if (!hdev_is_powered(hdev)) hdev 2015 net/bluetooth/hci_request.c if (mgmt_powering_down(hdev)) hdev 2018 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_CONNECTABLE) || hdev 2019 net/bluetooth/hci_request.c disconnected_whitelist_entries(hdev)) hdev 2024 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_DISCOVERABLE)) hdev 2027 net/bluetooth/hci_request.c if (test_bit(HCI_PSCAN, &hdev->flags) == !!(scan & SCAN_PAGE) && hdev 2028 net/bluetooth/hci_request.c test_bit(HCI_ISCAN, &hdev->flags) == !!(scan & SCAN_INQUIRY)) hdev 2036 net/bluetooth/hci_request.c hci_dev_lock(req->hdev); hdev 2038 net/bluetooth/hci_request.c hci_dev_unlock(req->hdev); hdev 2044 net/bluetooth/hci_request.c struct hci_dev *hdev = container_of(work, struct hci_dev, scan_update); hdev 2046 net/bluetooth/hci_request.c hci_req_sync(hdev, update_scan, 0, HCI_CMD_TIMEOUT, NULL); hdev 2051 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 2053 net/bluetooth/hci_request.c hci_dev_lock(hdev); hdev 2061 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) hdev 2062 net/bluetooth/hci_request.c __hci_req_update_adv_data(req, hdev->cur_adv_instance); hdev 2065 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_ADVERTISING) || hdev 2066 net/bluetooth/hci_request.c !list_empty(&hdev->adv_instances)) { hdev 2067 net/bluetooth/hci_request.c if (ext_adv_capable(hdev)) hdev 2068 net/bluetooth/hci_request.c __hci_req_start_ext_adv(req, hdev->cur_adv_instance); hdev 2075 net/bluetooth/hci_request.c hci_dev_unlock(hdev); hdev 2082 net/bluetooth/hci_request.c struct hci_dev *hdev = container_of(work, struct hci_dev, hdev 2086 net/bluetooth/hci_request.c hci_req_sync(hdev, connectable_update, 0, HCI_CMD_TIMEOUT, &status); hdev 2087 net/bluetooth/hci_request.c mgmt_set_connectable_complete(hdev, status); hdev 2090 net/bluetooth/hci_request.c static u8 get_service_classes(struct hci_dev *hdev) hdev 2095 net/bluetooth/hci_request.c list_for_each_entry(uuid, &hdev->uuids, list) hdev 2103 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 2106 net/bluetooth/hci_request.c BT_DBG("%s", hdev->name); hdev 2108 net/bluetooth/hci_request.c if (!hdev_is_powered(hdev)) hdev 2111 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) hdev 2114 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_SERVICE_CACHE)) hdev 2117 net/bluetooth/hci_request.c cod[0] = hdev->minor_class; hdev 2118 net/bluetooth/hci_request.c cod[1] = hdev->major_class; hdev 2119 net/bluetooth/hci_request.c cod[2] = get_service_classes(hdev); hdev 2121 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE)) hdev 2124 net/bluetooth/hci_request.c if (memcmp(cod, hdev->dev_class, 3) == 0) hdev 2132 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 2135 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_DISCOVERABLE)) hdev 2138 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE)) { hdev 2140 net/bluetooth/hci_request.c cp.num_iac = min_t(u8, hdev->num_iac, 2); hdev 2161 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 2163 net/bluetooth/hci_request.c hci_dev_lock(hdev); hdev 2165 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) { hdev 2174 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_ADVERTISING)) { hdev 2180 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_LIMITED_PRIVACY)) { hdev 2181 net/bluetooth/hci_request.c if (ext_adv_capable(hdev)) hdev 2188 net/bluetooth/hci_request.c hci_dev_unlock(hdev); hdev 2195 net/bluetooth/hci_request.c struct hci_dev *hdev = container_of(work, struct hci_dev, hdev 2199 net/bluetooth/hci_request.c hci_req_sync(hdev, discoverable_update, 0, HCI_CMD_TIMEOUT, &status); hdev 2200 net/bluetooth/hci_request.c mgmt_set_discoverable_complete(hdev, status); hdev 2234 net/bluetooth/hci_request.c if (req->hdev->hci_ver < BLUETOOTH_VER_1_2) hdev 2272 net/bluetooth/hci_request.c static void abort_conn_complete(struct hci_dev *hdev, u8 status, u16 opcode) hdev 2283 net/bluetooth/hci_request.c hci_req_init(&req, conn->hdev); hdev 2289 net/bluetooth/hci_request.c bt_dev_err(conn->hdev, "failed to run HCI request: err %d", err); hdev 2298 net/bluetooth/hci_request.c hci_dev_lock(req->hdev); hdev 2300 net/bluetooth/hci_request.c hci_dev_unlock(req->hdev); hdev 2306 net/bluetooth/hci_request.c struct hci_dev *hdev = container_of(work, struct hci_dev, hdev 2312 net/bluetooth/hci_request.c err = hci_req_sync(hdev, update_bg_scan, 0, HCI_CMD_TIMEOUT, &status); hdev 2316 net/bluetooth/hci_request.c hci_dev_lock(hdev); hdev 2318 net/bluetooth/hci_request.c conn = hci_conn_hash_lookup_state(hdev, LE_LINK, BT_CONNECT); hdev 2322 net/bluetooth/hci_request.c hci_dev_unlock(hdev); hdev 2338 net/bluetooth/hci_request.c BT_DBG("%s", req->hdev->name); hdev 2340 net/bluetooth/hci_request.c hci_dev_lock(req->hdev); hdev 2341 net/bluetooth/hci_request.c hci_inquiry_cache_flush(req->hdev); hdev 2342 net/bluetooth/hci_request.c hci_dev_unlock(req->hdev); hdev 2346 net/bluetooth/hci_request.c if (req->hdev->discovery.limited) hdev 2360 net/bluetooth/hci_request.c struct hci_dev *hdev = container_of(work, struct hci_dev, hdev 2364 net/bluetooth/hci_request.c BT_DBG("%s", hdev->name); hdev 2366 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_LE_SCAN)) hdev 2369 net/bluetooth/hci_request.c cancel_delayed_work(&hdev->le_scan_restart); hdev 2371 net/bluetooth/hci_request.c hci_req_sync(hdev, le_scan_disable, 0, HCI_CMD_TIMEOUT, &status); hdev 2373 net/bluetooth/hci_request.c bt_dev_err(hdev, "failed to disable LE scan: status 0x%02x", hdev 2378 net/bluetooth/hci_request.c hdev->discovery.scan_start = 0; hdev 2388 net/bluetooth/hci_request.c if (hdev->discovery.type == DISCOV_TYPE_LE) hdev 2391 net/bluetooth/hci_request.c if (hdev->discovery.type != DISCOV_TYPE_INTERLEAVED) hdev 2394 net/bluetooth/hci_request.c if (test_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks)) { hdev 2395 net/bluetooth/hci_request.c if (!test_bit(HCI_INQUIRY, &hdev->flags) && hdev 2396 net/bluetooth/hci_request.c hdev->discovery.state != DISCOVERY_RESOLVING) hdev 2402 net/bluetooth/hci_request.c hci_req_sync(hdev, bredr_inquiry, DISCOV_INTERLEAVED_INQUIRY_LEN, hdev 2405 net/bluetooth/hci_request.c bt_dev_err(hdev, "inquiry failed: status 0x%02x", status); hdev 2412 net/bluetooth/hci_request.c hci_dev_lock(hdev); hdev 2413 net/bluetooth/hci_request.c hci_discovery_set_state(hdev, DISCOVERY_STOPPED); hdev 2414 net/bluetooth/hci_request.c hci_dev_unlock(hdev); hdev 2419 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 2422 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_LE_SCAN)) hdev 2427 net/bluetooth/hci_request.c if (use_ext_scan(hdev)) { hdev 2450 net/bluetooth/hci_request.c struct hci_dev *hdev = container_of(work, struct hci_dev, hdev 2455 net/bluetooth/hci_request.c BT_DBG("%s", hdev->name); hdev 2457 net/bluetooth/hci_request.c hci_req_sync(hdev, le_scan_restart, 0, HCI_CMD_TIMEOUT, &status); hdev 2459 net/bluetooth/hci_request.c bt_dev_err(hdev, "failed to restart LE scan: status %d", hdev 2464 net/bluetooth/hci_request.c hci_dev_lock(hdev); hdev 2466 net/bluetooth/hci_request.c if (!test_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks) || hdev 2467 net/bluetooth/hci_request.c !hdev->discovery.scan_start) hdev 2475 net/bluetooth/hci_request.c duration = hdev->discovery.scan_duration; hdev 2476 net/bluetooth/hci_request.c scan_start = hdev->discovery.scan_start; hdev 2491 net/bluetooth/hci_request.c queue_delayed_work(hdev->req_workqueue, hdev 2492 net/bluetooth/hci_request.c &hdev->le_scan_disable, timeout); hdev 2495 net/bluetooth/hci_request.c hci_dev_unlock(hdev); hdev 2501 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 2505 net/bluetooth/hci_request.c BT_DBG("%s", hdev->name); hdev 2507 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_LE_ADV)) { hdev 2508 net/bluetooth/hci_request.c hci_dev_lock(hdev); hdev 2513 net/bluetooth/hci_request.c if (hci_lookup_le_connect(hdev)) { hdev 2514 net/bluetooth/hci_request.c hci_dev_unlock(hdev); hdev 2518 net/bluetooth/hci_request.c cancel_adv_timeout(hdev); hdev 2519 net/bluetooth/hci_request.c hci_dev_unlock(hdev); hdev 2528 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) hdev 2535 net/bluetooth/hci_request.c err = hci_update_random_address(req, true, scan_use_rpa(hdev), hdev 2549 net/bluetooth/hci_request.c BT_DBG("%s", req->hdev->name); hdev 2558 net/bluetooth/hci_request.c static void start_discovery(struct hci_dev *hdev, u8 *status) hdev 2562 net/bluetooth/hci_request.c BT_DBG("%s type %u", hdev->name, hdev->discovery.type); hdev 2564 net/bluetooth/hci_request.c switch (hdev->discovery.type) { hdev 2566 net/bluetooth/hci_request.c if (!hci_dev_test_flag(hdev, HCI_INQUIRY)) hdev 2567 net/bluetooth/hci_request.c hci_req_sync(hdev, bredr_inquiry, hdev 2581 net/bluetooth/hci_request.c &hdev->quirks)) { hdev 2587 net/bluetooth/hci_request.c hci_req_sync(hdev, interleaved_discov, hdev 2593 net/bluetooth/hci_request.c timeout = msecs_to_jiffies(hdev->discov_interleaved_timeout); hdev 2594 net/bluetooth/hci_request.c hci_req_sync(hdev, active_scan, DISCOV_LE_SCAN_INT, hdev 2599 net/bluetooth/hci_request.c hci_req_sync(hdev, active_scan, DISCOV_LE_SCAN_INT, hdev 2610 net/bluetooth/hci_request.c BT_DBG("%s timeout %u ms", hdev->name, jiffies_to_msecs(timeout)); hdev 2617 net/bluetooth/hci_request.c if (test_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks) && hdev 2618 net/bluetooth/hci_request.c hdev->discovery.result_filtering) { hdev 2619 net/bluetooth/hci_request.c hdev->discovery.scan_start = jiffies; hdev 2620 net/bluetooth/hci_request.c hdev->discovery.scan_duration = timeout; hdev 2623 net/bluetooth/hci_request.c queue_delayed_work(hdev->req_workqueue, &hdev->le_scan_disable, hdev 2629 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 2630 net/bluetooth/hci_request.c struct discovery_state *d = &hdev->discovery; hdev 2635 net/bluetooth/hci_request.c BT_DBG("%s state %u", hdev->name, hdev->discovery.state); hdev 2638 net/bluetooth/hci_request.c if (test_bit(HCI_INQUIRY, &hdev->flags)) hdev 2641 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) { hdev 2642 net/bluetooth/hci_request.c cancel_delayed_work(&hdev->le_scan_disable); hdev 2649 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) { hdev 2660 net/bluetooth/hci_request.c e = hci_inquiry_cache_lookup_resolve(hdev, BDADDR_ANY, hdev 2676 net/bluetooth/hci_request.c hci_dev_lock(req->hdev); hdev 2678 net/bluetooth/hci_request.c hci_dev_unlock(req->hdev); hdev 2685 net/bluetooth/hci_request.c struct hci_dev *hdev = container_of(work, struct hci_dev, hdev 2689 net/bluetooth/hci_request.c switch (hdev->discovery.state) { hdev 2691 net/bluetooth/hci_request.c start_discovery(hdev, &status); hdev 2692 net/bluetooth/hci_request.c mgmt_start_discovery_complete(hdev, status); hdev 2694 net/bluetooth/hci_request.c hci_discovery_set_state(hdev, DISCOVERY_STOPPED); hdev 2696 net/bluetooth/hci_request.c hci_discovery_set_state(hdev, DISCOVERY_FINDING); hdev 2699 net/bluetooth/hci_request.c hci_req_sync(hdev, stop_discovery, 0, HCI_CMD_TIMEOUT, &status); hdev 2700 net/bluetooth/hci_request.c mgmt_stop_discovery_complete(hdev, status); hdev 2702 net/bluetooth/hci_request.c hci_discovery_set_state(hdev, DISCOVERY_STOPPED); hdev 2712 net/bluetooth/hci_request.c struct hci_dev *hdev = container_of(work, struct hci_dev, hdev 2715 net/bluetooth/hci_request.c BT_DBG("%s", hdev->name); hdev 2717 net/bluetooth/hci_request.c hci_dev_lock(hdev); hdev 2724 net/bluetooth/hci_request.c hci_dev_clear_flag(hdev, HCI_LIMITED_DISCOVERABLE); hdev 2725 net/bluetooth/hci_request.c hci_dev_clear_flag(hdev, HCI_DISCOVERABLE); hdev 2726 net/bluetooth/hci_request.c hdev->discov_timeout = 0; hdev 2728 net/bluetooth/hci_request.c hci_dev_unlock(hdev); hdev 2730 net/bluetooth/hci_request.c hci_req_sync(hdev, discoverable_update, 0, HCI_CMD_TIMEOUT, NULL); hdev 2731 net/bluetooth/hci_request.c mgmt_new_settings(hdev); hdev 2736 net/bluetooth/hci_request.c struct hci_dev *hdev = req->hdev; hdev 2739 net/bluetooth/hci_request.c hci_dev_lock(hdev); hdev 2741 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_SSP_ENABLED) && hdev 2742 net/bluetooth/hci_request.c !lmp_host_ssp_capable(hdev)) { hdev 2747 net/bluetooth/hci_request.c if (bredr_sc_enabled(hdev) && !lmp_host_sc_capable(hdev)) { hdev 2755 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_LE_ENABLED) && hdev 2756 net/bluetooth/hci_request.c lmp_bredr_capable(hdev)) { hdev 2765 net/bluetooth/hci_request.c if (cp.le != lmp_host_le_capable(hdev) || hdev 2766 net/bluetooth/hci_request.c cp.simul != lmp_host_le_br_capable(hdev)) hdev 2771 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_LE_ENABLED)) { hdev 2776 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_ADVERTISING) || hdev 2777 net/bluetooth/hci_request.c list_empty(&hdev->adv_instances)) { hdev 2780 net/bluetooth/hci_request.c if (ext_adv_capable(hdev)) { hdev 2792 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_ADVERTISING)) { hdev 2793 net/bluetooth/hci_request.c if (!ext_adv_capable(hdev)) hdev 2799 net/bluetooth/hci_request.c } else if (!list_empty(&hdev->adv_instances)) { hdev 2802 net/bluetooth/hci_request.c adv_instance = list_first_entry(&hdev->adv_instances, hdev 2810 net/bluetooth/hci_request.c link_sec = hci_dev_test_flag(hdev, HCI_LINK_SECURITY); hdev 2811 net/bluetooth/hci_request.c if (link_sec != test_bit(HCI_AUTH, &hdev->flags)) hdev 2815 net/bluetooth/hci_request.c if (lmp_bredr_capable(hdev)) { hdev 2816 net/bluetooth/hci_request.c if (hci_dev_test_flag(hdev, HCI_FAST_CONNECTABLE)) hdev 2826 net/bluetooth/hci_request.c hci_dev_unlock(hdev); hdev 2830 net/bluetooth/hci_request.c int __hci_req_hci_power_on(struct hci_dev *hdev) hdev 2837 net/bluetooth/hci_request.c smp_register(hdev); hdev 2839 net/bluetooth/hci_request.c return __hci_req_sync(hdev, powered_update_hci, 0, HCI_CMD_TIMEOUT, hdev 2843 net/bluetooth/hci_request.c void hci_request_setup(struct hci_dev *hdev) hdev 2845 net/bluetooth/hci_request.c INIT_WORK(&hdev->discov_update, discov_update); hdev 2846 net/bluetooth/hci_request.c INIT_WORK(&hdev->bg_scan_update, bg_scan_update); hdev 2847 net/bluetooth/hci_request.c INIT_WORK(&hdev->scan_update, scan_update_work); hdev 2848 net/bluetooth/hci_request.c INIT_WORK(&hdev->connectable_update, connectable_update_work); hdev 2849 net/bluetooth/hci_request.c INIT_WORK(&hdev->discoverable_update, discoverable_update_work); hdev 2850 net/bluetooth/hci_request.c INIT_DELAYED_WORK(&hdev->discov_off, discov_off); hdev 2851 net/bluetooth/hci_request.c INIT_DELAYED_WORK(&hdev->le_scan_disable, le_scan_disable_work); hdev 2852 net/bluetooth/hci_request.c INIT_DELAYED_WORK(&hdev->le_scan_restart, le_scan_restart_work); hdev 2853 net/bluetooth/hci_request.c INIT_DELAYED_WORK(&hdev->adv_instance_expire, adv_timeout_expire); hdev 2856 net/bluetooth/hci_request.c void hci_request_cancel_all(struct hci_dev *hdev) hdev 2858 net/bluetooth/hci_request.c hci_req_sync_cancel(hdev, ENODEV); hdev 2860 net/bluetooth/hci_request.c cancel_work_sync(&hdev->discov_update); hdev 2861 net/bluetooth/hci_request.c cancel_work_sync(&hdev->bg_scan_update); hdev 2862 net/bluetooth/hci_request.c cancel_work_sync(&hdev->scan_update); hdev 2863 net/bluetooth/hci_request.c cancel_work_sync(&hdev->connectable_update); hdev 2864 net/bluetooth/hci_request.c cancel_work_sync(&hdev->discoverable_update); hdev 2865 net/bluetooth/hci_request.c cancel_delayed_work_sync(&hdev->discov_off); hdev 2866 net/bluetooth/hci_request.c cancel_delayed_work_sync(&hdev->le_scan_disable); hdev 2867 net/bluetooth/hci_request.c cancel_delayed_work_sync(&hdev->le_scan_restart); hdev 2869 net/bluetooth/hci_request.c if (hdev->adv_instance_timeout) { hdev 2870 net/bluetooth/hci_request.c cancel_delayed_work_sync(&hdev->adv_instance_expire); hdev 2871 net/bluetooth/hci_request.c hdev->adv_instance_timeout = 0; hdev 25 net/bluetooth/hci_request.h #define hci_req_sync_lock(hdev) mutex_lock(&hdev->req_lock) hdev 26 net/bluetooth/hci_request.h #define hci_req_sync_unlock(hdev) mutex_unlock(&hdev->req_lock) hdev 29 net/bluetooth/hci_request.h struct hci_dev *hdev; hdev 38 net/bluetooth/hci_request.h void hci_req_init(struct hci_request *req, struct hci_dev *hdev); hdev 40 net/bluetooth/hci_request.h bool hci_req_status_pend(struct hci_dev *hdev); hdev 47 net/bluetooth/hci_request.h void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status, hdev 51 net/bluetooth/hci_request.h int hci_req_sync(struct hci_dev *hdev, int (*req)(struct hci_request *req, hdev 54 net/bluetooth/hci_request.h int __hci_req_sync(struct hci_dev *hdev, int (*func)(struct hci_request *req, hdev 57 net/bluetooth/hci_request.h void hci_req_sync_cancel(struct hci_dev *hdev, int err); hdev 59 net/bluetooth/hci_request.h struct sk_buff *hci_prepare_cmd(struct hci_dev *hdev, u16 opcode, u32 plen, hdev 62 net/bluetooth/hci_request.h int __hci_req_hci_power_on(struct hci_dev *hdev); hdev 71 net/bluetooth/hci_request.h void hci_req_reenable_advertising(struct hci_dev *hdev); hdev 75 net/bluetooth/hci_request.h int hci_req_update_adv_data(struct hci_dev *hdev, u8 instance); hdev 80 net/bluetooth/hci_request.h void hci_req_clear_adv_instance(struct hci_dev *hdev, struct sock *sk, hdev 88 net/bluetooth/hci_request.h int hci_get_random_address(struct hci_dev *hdev, bool require_privacy, hdev 97 net/bluetooth/hci_request.h static inline void hci_req_update_scan(struct hci_dev *hdev) hdev 99 net/bluetooth/hci_request.h queue_work(hdev->req_workqueue, &hdev->scan_update); hdev 111 net/bluetooth/hci_request.h static inline void hci_update_background_scan(struct hci_dev *hdev) hdev 113 net/bluetooth/hci_request.h queue_work(hdev->req_workqueue, &hdev->bg_scan_update); hdev 116 net/bluetooth/hci_request.h void hci_request_setup(struct hci_dev *hdev); hdev 117 net/bluetooth/hci_request.h void hci_request_cancel_all(struct hci_dev *hdev); hdev 119 net/bluetooth/hci_request.h u8 append_local_name(struct hci_dev *hdev, u8 *ptr, u8 ad_len); hdev 53 net/bluetooth/hci_sock.c struct hci_dev *hdev; hdev 191 net/bluetooth/hci_sock.c void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb) hdev 196 net/bluetooth/hci_sock.c BT_DBG("hdev %p len %d", hdev, skb->len); hdev 203 net/bluetooth/hci_sock.c if (sk->sk_state != BT_BOUND || hci_pi(sk)->hdev != hdev) hdev 297 net/bluetooth/hci_sock.c void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb) hdev 306 net/bluetooth/hci_sock.c BT_DBG("hdev %p len %d", hdev, skb->len); hdev 342 net/bluetooth/hci_sock.c hdr->index = cpu_to_le16(hdev->id); hdev 350 net/bluetooth/hci_sock.c void hci_send_monitor_ctrl_event(struct hci_dev *hdev, u16 event, hdev 357 net/bluetooth/hci_sock.c if (hdev) hdev 358 net/bluetooth/hci_sock.c index = cpu_to_le16(hdev->id); hdev 404 net/bluetooth/hci_sock.c static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event) hdev 419 net/bluetooth/hci_sock.c ni->type = hdev->dev_type; hdev 420 net/bluetooth/hci_sock.c ni->bus = hdev->bus; hdev 421 net/bluetooth/hci_sock.c bacpy(&ni->bdaddr, &hdev->bdaddr); hdev 422 net/bluetooth/hci_sock.c memcpy(ni->name, hdev->name, 8); hdev 436 net/bluetooth/hci_sock.c if (hdev->manufacturer == 0xffff) hdev 447 net/bluetooth/hci_sock.c bacpy(&ii->bdaddr, &hdev->bdaddr); hdev 448 net/bluetooth/hci_sock.c ii->manufacturer = cpu_to_le16(hdev->manufacturer); hdev 477 net/bluetooth/hci_sock.c hdr->index = cpu_to_le16(hdev->id); hdev 532 net/bluetooth/hci_sock.c if (hci_pi(sk)->hdev) hdev 533 net/bluetooth/hci_sock.c hdr->index = cpu_to_le16(hci_pi(sk)->hdev->id); hdev 570 net/bluetooth/hci_sock.c if (hci_pi(sk)->hdev) hdev 571 net/bluetooth/hci_sock.c hdr->index = cpu_to_le16(hci_pi(sk)->hdev->id); hdev 640 net/bluetooth/hci_sock.c struct hci_dev *hdev; hdev 644 net/bluetooth/hci_sock.c list_for_each_entry(hdev, &hci_dev_list, list) { hdev 647 net/bluetooth/hci_sock.c skb = create_monitor_event(hdev, HCI_DEV_REG); hdev 654 net/bluetooth/hci_sock.c if (!test_bit(HCI_RUNNING, &hdev->flags)) hdev 657 net/bluetooth/hci_sock.c skb = create_monitor_event(hdev, HCI_DEV_OPEN); hdev 664 net/bluetooth/hci_sock.c if (test_bit(HCI_UP, &hdev->flags)) hdev 665 net/bluetooth/hci_sock.c skb = create_monitor_event(hdev, HCI_DEV_UP); hdev 666 net/bluetooth/hci_sock.c else if (hci_dev_test_flag(hdev, HCI_SETUP)) hdev 667 net/bluetooth/hci_sock.c skb = create_monitor_event(hdev, HCI_DEV_SETUP); hdev 701 net/bluetooth/hci_sock.c static void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data) hdev 723 net/bluetooth/hci_sock.c hci_send_to_sock(hdev, skb); hdev 727 net/bluetooth/hci_sock.c void hci_sock_dev_event(struct hci_dev *hdev, int event) hdev 729 net/bluetooth/hci_sock.c BT_DBG("hdev %s event %d", hdev->name, event); hdev 735 net/bluetooth/hci_sock.c skb = create_monitor_event(hdev, event); hdev 748 net/bluetooth/hci_sock.c ev.dev_id = hdev->id; hdev 759 net/bluetooth/hci_sock.c if (hci_pi(sk)->hdev == hdev) { hdev 760 net/bluetooth/hci_sock.c hci_pi(sk)->hdev = NULL; hdev 765 net/bluetooth/hci_sock.c hci_dev_put(hdev); hdev 826 net/bluetooth/hci_sock.c struct hci_dev *hdev; hdev 857 net/bluetooth/hci_sock.c hdev = hci_pi(sk)->hdev; hdev 858 net/bluetooth/hci_sock.c if (hdev) { hdev 869 net/bluetooth/hci_sock.c hci_dev_do_close(hdev); hdev 870 net/bluetooth/hci_sock.c hci_dev_clear_flag(hdev, HCI_USER_CHANNEL); hdev 871 net/bluetooth/hci_sock.c mgmt_index_added(hdev); hdev 874 net/bluetooth/hci_sock.c atomic_dec(&hdev->promisc); hdev 875 net/bluetooth/hci_sock.c hci_dev_put(hdev); hdev 888 net/bluetooth/hci_sock.c static int hci_sock_blacklist_add(struct hci_dev *hdev, void __user *arg) hdev 896 net/bluetooth/hci_sock.c hci_dev_lock(hdev); hdev 898 net/bluetooth/hci_sock.c err = hci_bdaddr_list_add(&hdev->blacklist, &bdaddr, BDADDR_BREDR); hdev 900 net/bluetooth/hci_sock.c hci_dev_unlock(hdev); hdev 905 net/bluetooth/hci_sock.c static int hci_sock_blacklist_del(struct hci_dev *hdev, void __user *arg) hdev 913 net/bluetooth/hci_sock.c hci_dev_lock(hdev); hdev 915 net/bluetooth/hci_sock.c err = hci_bdaddr_list_del(&hdev->blacklist, &bdaddr, BDADDR_BREDR); hdev 917 net/bluetooth/hci_sock.c hci_dev_unlock(hdev); hdev 926 net/bluetooth/hci_sock.c struct hci_dev *hdev = hci_pi(sk)->hdev; hdev 928 net/bluetooth/hci_sock.c if (!hdev) hdev 931 net/bluetooth/hci_sock.c if (hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) hdev 934 net/bluetooth/hci_sock.c if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) hdev 937 net/bluetooth/hci_sock.c if (hdev->dev_type != HCI_PRIMARY) hdev 947 net/bluetooth/hci_sock.c return hci_get_conn_info(hdev, (void __user *)arg); hdev 950 net/bluetooth/hci_sock.c return hci_get_auth_info(hdev, (void __user *)arg); hdev 955 net/bluetooth/hci_sock.c return hci_sock_blacklist_add(hdev, (void __user *)arg); hdev 960 net/bluetooth/hci_sock.c return hci_sock_blacklist_del(hdev, (void __user *)arg); hdev 1065 net/bluetooth/hci_sock.c struct hci_dev *hdev = NULL; hdev 1090 net/bluetooth/hci_sock.c if (hci_pi(sk)->hdev) { hdev 1096 net/bluetooth/hci_sock.c hdev = hci_dev_get(haddr.hci_dev); hdev 1097 net/bluetooth/hci_sock.c if (!hdev) { hdev 1102 net/bluetooth/hci_sock.c atomic_inc(&hdev->promisc); hdev 1125 net/bluetooth/hci_sock.c hci_pi(sk)->hdev = hdev; hdev 1137 net/bluetooth/hci_sock.c if (hci_pi(sk)->hdev) { hdev 1152 net/bluetooth/hci_sock.c hdev = hci_dev_get(haddr.hci_dev); hdev 1153 net/bluetooth/hci_sock.c if (!hdev) { hdev 1158 net/bluetooth/hci_sock.c if (test_bit(HCI_INIT, &hdev->flags) || hdev 1159 net/bluetooth/hci_sock.c hci_dev_test_flag(hdev, HCI_SETUP) || hdev 1160 net/bluetooth/hci_sock.c hci_dev_test_flag(hdev, HCI_CONFIG) || hdev 1161 net/bluetooth/hci_sock.c (!hci_dev_test_flag(hdev, HCI_AUTO_OFF) && hdev 1162 net/bluetooth/hci_sock.c test_bit(HCI_UP, &hdev->flags))) { hdev 1164 net/bluetooth/hci_sock.c hci_dev_put(hdev); hdev 1168 net/bluetooth/hci_sock.c if (hci_dev_test_and_set_flag(hdev, HCI_USER_CHANNEL)) { hdev 1170 net/bluetooth/hci_sock.c hci_dev_put(hdev); hdev 1174 net/bluetooth/hci_sock.c mgmt_index_removed(hdev); hdev 1176 net/bluetooth/hci_sock.c err = hci_dev_open(hdev->id); hdev 1188 net/bluetooth/hci_sock.c hci_dev_clear_flag(hdev, HCI_USER_CHANNEL); hdev 1189 net/bluetooth/hci_sock.c mgmt_index_added(hdev); hdev 1190 net/bluetooth/hci_sock.c hci_dev_put(hdev); hdev 1216 net/bluetooth/hci_sock.c hci_pi(sk)->hdev = hdev; hdev 1226 net/bluetooth/hci_sock.c atomic_inc(&hdev->promisc); hdev 1349 net/bluetooth/hci_sock.c struct hci_dev *hdev; hdev 1359 net/bluetooth/hci_sock.c hdev = hci_pi(sk)->hdev; hdev 1360 net/bluetooth/hci_sock.c if (!hdev) { hdev 1366 net/bluetooth/hci_sock.c haddr->hci_dev = hdev->id; hdev 1475 net/bluetooth/hci_sock.c struct hci_dev *hdev = NULL; hdev 1535 net/bluetooth/hci_sock.c hdev = hci_dev_get(index); hdev 1536 net/bluetooth/hci_sock.c if (!hdev) { hdev 1542 net/bluetooth/hci_sock.c if (hci_dev_test_flag(hdev, HCI_SETUP) || hdev 1543 net/bluetooth/hci_sock.c hci_dev_test_flag(hdev, HCI_CONFIG) || hdev 1544 net/bluetooth/hci_sock.c hci_dev_test_flag(hdev, HCI_USER_CHANNEL)) { hdev 1550 net/bluetooth/hci_sock.c if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED) && hdev 1559 net/bluetooth/hci_sock.c if (no_hdev != !hdev) { hdev 1573 net/bluetooth/hci_sock.c if (hdev && chan->hdev_init) hdev 1574 net/bluetooth/hci_sock.c chan->hdev_init(sk, hdev); hdev 1578 net/bluetooth/hci_sock.c err = handler->func(sk, hdev, cp, len); hdev 1585 net/bluetooth/hci_sock.c if (hdev) hdev 1586 net/bluetooth/hci_sock.c hci_dev_put(hdev); hdev 1596 net/bluetooth/hci_sock.c struct hci_dev *hdev; hdev 1654 net/bluetooth/hci_sock.c hdev = hci_dev_get(index); hdev 1655 net/bluetooth/hci_sock.c if (!hdev) { hdev 1660 net/bluetooth/hci_sock.c hdev = NULL; hdev 1668 net/bluetooth/hci_sock.c if (hdev) hdev 1669 net/bluetooth/hci_sock.c hci_dev_put(hdev); hdev 1681 net/bluetooth/hci_sock.c struct hci_dev *hdev; hdev 1721 net/bluetooth/hci_sock.c hdev = hci_pi(sk)->hdev; hdev 1722 net/bluetooth/hci_sock.c if (!hdev) { hdev 1727 net/bluetooth/hci_sock.c if (!test_bit(HCI_UP, &hdev->flags)) { hdev 1757 net/bluetooth/hci_sock.c skb_queue_tail(&hdev->raw_q, skb); hdev 1758 net/bluetooth/hci_sock.c queue_work(hdev->workqueue, &hdev->tx_work); hdev 1778 net/bluetooth/hci_sock.c skb_queue_tail(&hdev->raw_q, skb); hdev 1779 net/bluetooth/hci_sock.c queue_work(hdev->workqueue, &hdev->tx_work); hdev 1786 net/bluetooth/hci_sock.c skb_queue_tail(&hdev->cmd_q, skb); hdev 1787 net/bluetooth/hci_sock.c queue_work(hdev->workqueue, &hdev->cmd_work); hdev 1801 net/bluetooth/hci_sock.c skb_queue_tail(&hdev->raw_q, skb); hdev 1802 net/bluetooth/hci_sock.c queue_work(hdev->workqueue, &hdev->tx_work); hdev 34 net/bluetooth/hci_sysfs.c struct hci_dev *hdev = conn->hdev; hdev 40 net/bluetooth/hci_sysfs.c conn->dev.parent = &hdev->dev; hdev 47 net/bluetooth/hci_sysfs.c struct hci_dev *hdev = conn->hdev; hdev 51 net/bluetooth/hci_sysfs.c dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle); hdev 54 net/bluetooth/hci_sysfs.c bt_dev_err(hdev, "failed to register connection device"); hdev 58 net/bluetooth/hci_sysfs.c hci_dev_hold(hdev); hdev 63 net/bluetooth/hci_sysfs.c struct hci_dev *hdev = conn->hdev; hdev 80 net/bluetooth/hci_sysfs.c hci_dev_put(hdev); hdev 85 net/bluetooth/hci_sysfs.c struct hci_dev *hdev = to_hci_dev(dev); hdev 86 net/bluetooth/hci_sysfs.c kfree(hdev); hdev 95 net/bluetooth/hci_sysfs.c void hci_init_sysfs(struct hci_dev *hdev) hdev 97 net/bluetooth/hci_sysfs.c struct device *dev = &hdev->dev; hdev 872 net/bluetooth/l2cap_core.c if (lmp_no_flush_capable(conn->hcon->hdev) || hdev 913 net/bluetooth/l2cap_core.c lmp_no_flush_capable(hcon->hdev))) hdev 1147 net/bluetooth/l2cap_core.c struct hci_dev *hdev; hdev 1157 net/bluetooth/l2cap_core.c list_for_each_entry(hdev, &hci_dev_list, list) { hdev 1158 net/bluetooth/l2cap_core.c if (hdev->amp_type != AMP_TYPE_BREDR && hdev 1159 net/bluetooth/l2cap_core.c test_bit(HCI_UP, &hdev->flags)) { hdev 1364 net/bluetooth/l2cap_core.c hcon->enc_key_size >= hcon->hdev->min_enc_key_size); hdev 1521 net/bluetooth/l2cap_core.c struct hci_dev *hdev = hcon->hdev; hdev 1523 net/bluetooth/l2cap_core.c BT_DBG("%s conn %p", hdev->name, conn); hdev 1589 net/bluetooth/l2cap_core.c queue_work(hcon->hdev->workqueue, &conn->pending_rx_work); hdev 1635 net/bluetooth/l2cap_core.c struct hci_dev *hdev = conn->hcon->hdev; hdev 1645 net/bluetooth/l2cap_core.c hci_dev_lock(hdev); hdev 1666 net/bluetooth/l2cap_core.c hci_dev_unlock(hdev); hdev 1673 net/bluetooth/l2cap_core.c struct hci_dev *hdev = conn->hcon->hdev; hdev 1675 net/bluetooth/l2cap_core.c hci_dev_lock(hdev); hdev 1684 net/bluetooth/l2cap_core.c hci_dev_unlock(hdev); hdev 3180 net/bluetooth/l2cap_core.c u64 ertm_to = chan->hs_hcon->hdev->amp_be_flush_to; hdev 3982 net/bluetooth/l2cap_core.c struct hci_dev *hdev = conn->hcon->hdev; hdev 3988 net/bluetooth/l2cap_core.c hci_dev_lock(hdev); hdev 3989 net/bluetooth/l2cap_core.c if (hci_dev_test_flag(hdev, HCI_MGMT) && hdev 3991 net/bluetooth/l2cap_core.c mgmt_device_connected(hdev, hcon, 0, NULL, 0); hdev 3992 net/bluetooth/l2cap_core.c hci_dev_unlock(hdev); hdev 4545 net/bluetooth/l2cap_core.c struct hci_dev *hdev; hdev 4567 net/bluetooth/l2cap_core.c hdev = hci_dev_get(req->amp_id); hdev 4568 net/bluetooth/l2cap_core.c if (!hdev) hdev 4571 net/bluetooth/l2cap_core.c if (hdev->dev_type != HCI_AMP || !test_bit(HCI_UP, &hdev->flags)) { hdev 4572 net/bluetooth/l2cap_core.c hci_dev_put(hdev); hdev 4582 net/bluetooth/l2cap_core.c hs_hcon = hci_conn_hash_lookup_ba(hdev, AMP_LINK, hdev 4585 net/bluetooth/l2cap_core.c hci_dev_put(hdev); hdev 4596 net/bluetooth/l2cap_core.c conn->mtu = hdev->block_mtu; hdev 4599 net/bluetooth/l2cap_core.c hci_dev_put(hdev); hdev 5007 net/bluetooth/l2cap_core.c struct hci_dev *hdev; hdev 5008 net/bluetooth/l2cap_core.c hdev = hci_dev_get(req->dest_amp_id); hdev 5009 net/bluetooth/l2cap_core.c if (!hdev || hdev->dev_type != HCI_AMP || hdev 5010 net/bluetooth/l2cap_core.c !test_bit(HCI_UP, &hdev->flags)) { hdev 5011 net/bluetooth/l2cap_core.c if (hdev) hdev 5012 net/bluetooth/l2cap_core.c hci_dev_put(hdev); hdev 5017 net/bluetooth/l2cap_core.c hci_dev_put(hdev); hdev 5320 net/bluetooth/l2cap_core.c mgmt_new_conn_param(hcon->hdev, &hcon->dst, hcon->dst_type, hdev 6505 net/bluetooth/l2cap_core.c chan->conn->mtu = chan->hs_hcon->hdev->block_mtu; hdev 6507 net/bluetooth/l2cap_core.c chan->conn->mtu = chan->conn->hcon->hdev->acl_mtu; hdev 6576 net/bluetooth/l2cap_core.c chan->conn->mtu = chan->hs_hcon->hdev->block_mtu; hdev 6578 net/bluetooth/l2cap_core.c chan->conn->mtu = chan->conn->hcon->hdev->acl_mtu; hdev 7041 net/bluetooth/l2cap_core.c hci_bdaddr_list_lookup(&hcon->hdev->blacklist, &hcon->dst, hdev 7109 net/bluetooth/l2cap_core.c if (hcon->hdev->le_mtu) { hdev 7110 net/bluetooth/l2cap_core.c conn->mtu = hcon->hdev->le_mtu; hdev 7115 net/bluetooth/l2cap_core.c conn->mtu = hcon->hdev->acl_mtu; hdev 7124 net/bluetooth/l2cap_core.c hci_dev_test_flag(hcon->hdev, HCI_HS_ENABLED)) hdev 7127 net/bluetooth/l2cap_core.c if (hci_dev_test_flag(hcon->hdev, HCI_LE_ENABLED) && hdev 7128 net/bluetooth/l2cap_core.c (bredr_sc_enabled(hcon->hdev) || hdev 7129 net/bluetooth/l2cap_core.c hci_dev_test_flag(hcon->hdev, HCI_FORCE_BREDR_SMP))) hdev 7165 net/bluetooth/l2cap_core.c struct hci_dev *hdev; hdev 7171 net/bluetooth/l2cap_core.c hdev = hci_get_route(dst, &chan->src, chan->src_type); hdev 7172 net/bluetooth/l2cap_core.c if (!hdev) hdev 7175 net/bluetooth/l2cap_core.c hci_dev_lock(hdev); hdev 7246 net/bluetooth/l2cap_core.c if (hci_dev_test_flag(hdev, HCI_ADVERTISING)) hdev 7247 net/bluetooth/l2cap_core.c hcon = hci_connect_le(hdev, dst, dst_type, hdev 7252 net/bluetooth/l2cap_core.c hcon = hci_connect_le_scan(hdev, dst, dst_type, hdev 7258 net/bluetooth/l2cap_core.c hcon = hci_connect_acl(hdev, dst, chan->sec_level, auth_type); hdev 7316 net/bluetooth/l2cap_core.c hci_dev_unlock(hdev); hdev 7317 net/bluetooth/l2cap_core.c hci_dev_put(hdev); hdev 7324 net/bluetooth/l2cap_core.c int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr) hdev 7329 net/bluetooth/l2cap_core.c BT_DBG("hdev %s, bdaddr %pMR", hdev->name, bdaddr); hdev 7337 net/bluetooth/l2cap_core.c if (!bacmp(&c->src, &hdev->bdaddr)) { hdev 7391 net/bluetooth/l2cap_core.c struct hci_dev *hdev = hcon->hdev; hdev 7413 net/bluetooth/l2cap_core.c if (hci_bdaddr_list_lookup(&hdev->blacklist, &hcon->dst, dst_type)) hdev 7586 net/bluetooth/l2cap_core.c if (!conn && hcon->hdev->dev_type != HCI_PRIMARY) hdev 853 net/bluetooth/l2cap_sock.c if (!conn || !lmp_no_flush_capable(conn->hcon->hdev)) { hdev 15 net/bluetooth/leds.c struct hci_dev *hdev; hdev 21 net/bluetooth/leds.c void hci_leds_update_powered(struct hci_dev *hdev, bool enabled) hdev 23 net/bluetooth/leds.c if (hdev->power_led) hdev 24 net/bluetooth/leds.c led_trigger_event(hdev->power_led, hdev 49 net/bluetooth/leds.c powered = test_bit(HCI_UP, &htrig->hdev->flags); hdev 56 net/bluetooth/leds.c static struct led_trigger *led_allocate_basic(struct hci_dev *hdev, hdev 62 net/bluetooth/leds.c htrig = devm_kzalloc(&hdev->dev, sizeof(*htrig), GFP_KERNEL); hdev 66 net/bluetooth/leds.c htrig->hdev = hdev; hdev 68 net/bluetooth/leds.c htrig->led_trigger.name = devm_kasprintf(&hdev->dev, GFP_KERNEL, hdev 69 net/bluetooth/leds.c "%s-%s", hdev->name, hdev 74 net/bluetooth/leds.c if (devm_led_trigger_register(&hdev->dev, &htrig->led_trigger)) hdev 80 net/bluetooth/leds.c devm_kfree(&hdev->dev, (void *)htrig->led_trigger.name); hdev 82 net/bluetooth/leds.c devm_kfree(&hdev->dev, htrig); hdev 86 net/bluetooth/leds.c void hci_leds_init(struct hci_dev *hdev) hdev 89 net/bluetooth/leds.c hdev->power_led = led_allocate_basic(hdev, power_activate, "power"); hdev 8 net/bluetooth/leds.h void hci_leds_update_powered(struct hci_dev *hdev, bool enabled); hdev 9 net/bluetooth/leds.h void hci_leds_init(struct hci_dev *hdev); hdev 16 net/bluetooth/leds.h static inline void hci_leds_update_powered(struct hci_dev *hdev, hdev 18 net/bluetooth/leds.h static inline void hci_leds_init(struct hci_dev *hdev) {} hdev 250 net/bluetooth/mgmt.c static int mgmt_index_event(u16 event, struct hci_dev *hdev, void *data, hdev 253 net/bluetooth/mgmt.c return mgmt_send_event(event, hdev, HCI_CHANNEL_CONTROL, data, len, hdev 257 net/bluetooth/mgmt.c static int mgmt_limited_event(u16 event, struct hci_dev *hdev, void *data, hdev 260 net/bluetooth/mgmt.c return mgmt_send_event(event, hdev, HCI_CHANNEL_CONTROL, data, len, hdev 264 net/bluetooth/mgmt.c static int mgmt_event(u16 event, struct hci_dev *hdev, void *data, u16 len, hdev 267 net/bluetooth/mgmt.c return mgmt_send_event(event, hdev, HCI_CHANNEL_CONTROL, data, len, hdev 287 net/bluetooth/mgmt.c static int read_version(struct sock *sk, struct hci_dev *hdev, void *data, hdev 300 net/bluetooth/mgmt.c static int read_commands(struct sock *sk, struct hci_dev *hdev, void *data, hdev 352 net/bluetooth/mgmt.c static int read_index_list(struct sock *sk, struct hci_dev *hdev, void *data, hdev 412 net/bluetooth/mgmt.c static int read_unconf_index_list(struct sock *sk, struct hci_dev *hdev, hdev 472 net/bluetooth/mgmt.c static int read_ext_index_list(struct sock *sk, struct hci_dev *hdev, hdev 546 net/bluetooth/mgmt.c static bool is_configured(struct hci_dev *hdev) hdev 548 net/bluetooth/mgmt.c if (test_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks) && hdev 549 net/bluetooth/mgmt.c !hci_dev_test_flag(hdev, HCI_EXT_CONFIGURED)) hdev 552 net/bluetooth/mgmt.c if ((test_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks) || hdev 553 net/bluetooth/mgmt.c test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks)) && hdev 554 net/bluetooth/mgmt.c !bacmp(&hdev->public_addr, BDADDR_ANY)) hdev 560 net/bluetooth/mgmt.c static __le32 get_missing_options(struct hci_dev *hdev) hdev 564 net/bluetooth/mgmt.c if (test_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks) && hdev 565 net/bluetooth/mgmt.c !hci_dev_test_flag(hdev, HCI_EXT_CONFIGURED)) hdev 568 net/bluetooth/mgmt.c if ((test_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks) || hdev 569 net/bluetooth/mgmt.c test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks)) && hdev 570 net/bluetooth/mgmt.c !bacmp(&hdev->public_addr, BDADDR_ANY)) hdev 576 net/bluetooth/mgmt.c static int new_options(struct hci_dev *hdev, struct sock *skip) hdev 578 net/bluetooth/mgmt.c __le32 options = get_missing_options(hdev); hdev 580 net/bluetooth/mgmt.c return mgmt_limited_event(MGMT_EV_NEW_CONFIG_OPTIONS, hdev, &options, hdev 584 net/bluetooth/mgmt.c static int send_options_rsp(struct sock *sk, u16 opcode, struct hci_dev *hdev) hdev 586 net/bluetooth/mgmt.c __le32 options = get_missing_options(hdev); hdev 588 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, opcode, 0, &options, hdev 592 net/bluetooth/mgmt.c static int read_config_info(struct sock *sk, struct hci_dev *hdev, hdev 598 net/bluetooth/mgmt.c BT_DBG("sock %p %s", sk, hdev->name); hdev 600 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 603 net/bluetooth/mgmt.c rp.manufacturer = cpu_to_le16(hdev->manufacturer); hdev 605 net/bluetooth/mgmt.c if (test_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks)) hdev 608 net/bluetooth/mgmt.c if (hdev->set_bdaddr) hdev 612 net/bluetooth/mgmt.c rp.missing_options = get_missing_options(hdev); hdev 614 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 616 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_READ_CONFIG_INFO, 0, hdev 620 net/bluetooth/mgmt.c static u32 get_supported_phys(struct hci_dev *hdev) hdev 624 net/bluetooth/mgmt.c if (lmp_bredr_capable(hdev)) { hdev 627 net/bluetooth/mgmt.c if (hdev->features[0][0] & LMP_3SLOT) hdev 630 net/bluetooth/mgmt.c if (hdev->features[0][0] & LMP_5SLOT) hdev 633 net/bluetooth/mgmt.c if (lmp_edr_2m_capable(hdev)) { hdev 636 net/bluetooth/mgmt.c if (lmp_edr_3slot_capable(hdev)) hdev 639 net/bluetooth/mgmt.c if (lmp_edr_5slot_capable(hdev)) hdev 642 net/bluetooth/mgmt.c if (lmp_edr_3m_capable(hdev)) { hdev 645 net/bluetooth/mgmt.c if (lmp_edr_3slot_capable(hdev)) hdev 648 net/bluetooth/mgmt.c if (lmp_edr_5slot_capable(hdev)) hdev 654 net/bluetooth/mgmt.c if (lmp_le_capable(hdev)) { hdev 658 net/bluetooth/mgmt.c if (hdev->le_features[1] & HCI_LE_PHY_2M) { hdev 663 net/bluetooth/mgmt.c if (hdev->le_features[1] & HCI_LE_PHY_CODED) { hdev 672 net/bluetooth/mgmt.c static u32 get_selected_phys(struct hci_dev *hdev) hdev 676 net/bluetooth/mgmt.c if (lmp_bredr_capable(hdev)) { hdev 679 net/bluetooth/mgmt.c if (hdev->pkt_type & (HCI_DM3 | HCI_DH3)) hdev 682 net/bluetooth/mgmt.c if (hdev->pkt_type & (HCI_DM5 | HCI_DH5)) hdev 685 net/bluetooth/mgmt.c if (lmp_edr_2m_capable(hdev)) { hdev 686 net/bluetooth/mgmt.c if (!(hdev->pkt_type & HCI_2DH1)) hdev 689 net/bluetooth/mgmt.c if (lmp_edr_3slot_capable(hdev) && hdev 690 net/bluetooth/mgmt.c !(hdev->pkt_type & HCI_2DH3)) hdev 693 net/bluetooth/mgmt.c if (lmp_edr_5slot_capable(hdev) && hdev 694 net/bluetooth/mgmt.c !(hdev->pkt_type & HCI_2DH5)) hdev 697 net/bluetooth/mgmt.c if (lmp_edr_3m_capable(hdev)) { hdev 698 net/bluetooth/mgmt.c if (!(hdev->pkt_type & HCI_3DH1)) hdev 701 net/bluetooth/mgmt.c if (lmp_edr_3slot_capable(hdev) && hdev 702 net/bluetooth/mgmt.c !(hdev->pkt_type & HCI_3DH3)) hdev 705 net/bluetooth/mgmt.c if (lmp_edr_5slot_capable(hdev) && hdev 706 net/bluetooth/mgmt.c !(hdev->pkt_type & HCI_3DH5)) hdev 712 net/bluetooth/mgmt.c if (lmp_le_capable(hdev)) { hdev 713 net/bluetooth/mgmt.c if (hdev->le_tx_def_phys & HCI_LE_SET_PHY_1M) hdev 716 net/bluetooth/mgmt.c if (hdev->le_rx_def_phys & HCI_LE_SET_PHY_1M) hdev 719 net/bluetooth/mgmt.c if (hdev->le_tx_def_phys & HCI_LE_SET_PHY_2M) hdev 722 net/bluetooth/mgmt.c if (hdev->le_rx_def_phys & HCI_LE_SET_PHY_2M) hdev 725 net/bluetooth/mgmt.c if (hdev->le_tx_def_phys & HCI_LE_SET_PHY_CODED) hdev 728 net/bluetooth/mgmt.c if (hdev->le_rx_def_phys & HCI_LE_SET_PHY_CODED) hdev 735 net/bluetooth/mgmt.c static u32 get_configurable_phys(struct hci_dev *hdev) hdev 737 net/bluetooth/mgmt.c return (get_supported_phys(hdev) & ~MGMT_PHY_BR_1M_1SLOT & hdev 741 net/bluetooth/mgmt.c static u32 get_supported_settings(struct hci_dev *hdev) hdev 751 net/bluetooth/mgmt.c if (lmp_bredr_capable(hdev)) { hdev 752 net/bluetooth/mgmt.c if (hdev->hci_ver >= BLUETOOTH_VER_1_2) hdev 757 net/bluetooth/mgmt.c if (lmp_ssp_capable(hdev)) { hdev 762 net/bluetooth/mgmt.c if (lmp_sc_capable(hdev)) hdev 766 net/bluetooth/mgmt.c if (lmp_le_capable(hdev)) { hdev 774 net/bluetooth/mgmt.c if (test_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks) || hdev 775 net/bluetooth/mgmt.c hdev->set_bdaddr) hdev 783 net/bluetooth/mgmt.c static u32 get_current_settings(struct hci_dev *hdev) hdev 787 net/bluetooth/mgmt.c if (hdev_is_powered(hdev)) hdev 790 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_CONNECTABLE)) hdev 793 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_FAST_CONNECTABLE)) hdev 796 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_DISCOVERABLE)) hdev 799 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_BONDABLE)) hdev 802 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) hdev 805 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_LE_ENABLED)) hdev 808 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_LINK_SECURITY)) hdev 811 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_SSP_ENABLED)) hdev 814 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_HS_ENABLED)) hdev 817 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_ADVERTISING)) hdev 820 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_SC_ENABLED)) hdev 823 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_KEEP_DEBUG_KEYS)) hdev 826 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_PRIVACY)) hdev 841 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR) || hdev 842 net/bluetooth/mgmt.c !hci_dev_test_flag(hdev, HCI_BREDR_ENABLED) || hdev 843 net/bluetooth/mgmt.c !bacmp(&hdev->bdaddr, BDADDR_ANY)) { hdev 844 net/bluetooth/mgmt.c if (bacmp(&hdev->static_addr, BDADDR_ANY)) hdev 851 net/bluetooth/mgmt.c static struct mgmt_pending_cmd *pending_find(u16 opcode, struct hci_dev *hdev) hdev 853 net/bluetooth/mgmt.c return mgmt_pending_find(HCI_CHANNEL_CONTROL, opcode, hdev); hdev 857 net/bluetooth/mgmt.c struct hci_dev *hdev, hdev 860 net/bluetooth/mgmt.c return mgmt_pending_find_data(HCI_CHANNEL_CONTROL, opcode, hdev, data); hdev 863 net/bluetooth/mgmt.c u8 mgmt_get_adv_discov_flags(struct hci_dev *hdev) hdev 870 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_SET_DISCOVERABLE, hdev); hdev 878 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE)) hdev 880 net/bluetooth/mgmt.c else if (hci_dev_test_flag(hdev, HCI_DISCOVERABLE)) hdev 887 net/bluetooth/mgmt.c bool mgmt_get_connectable(struct hci_dev *hdev) hdev 894 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_SET_CONNECTABLE, hdev); hdev 901 net/bluetooth/mgmt.c return hci_dev_test_flag(hdev, HCI_CONNECTABLE); hdev 906 net/bluetooth/mgmt.c struct hci_dev *hdev = container_of(work, struct hci_dev, hdev 910 net/bluetooth/mgmt.c if (!hci_dev_test_and_clear_flag(hdev, HCI_SERVICE_CACHE)) hdev 913 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 915 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 920 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 927 net/bluetooth/mgmt.c struct hci_dev *hdev = container_of(work, struct hci_dev, hdev 933 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_RPA_EXPIRED); hdev 935 net/bluetooth/mgmt.c if (!hci_dev_test_flag(hdev, HCI_ADVERTISING)) hdev 942 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 943 net/bluetooth/mgmt.c if (ext_adv_capable(hdev)) hdev 944 net/bluetooth/mgmt.c __hci_req_start_ext_adv(&req, hdev->cur_adv_instance); hdev 950 net/bluetooth/mgmt.c static void mgmt_init_hdev(struct sock *sk, struct hci_dev *hdev) hdev 952 net/bluetooth/mgmt.c if (hci_dev_test_and_set_flag(hdev, HCI_MGMT)) hdev 955 net/bluetooth/mgmt.c INIT_DELAYED_WORK(&hdev->service_cache, service_cache_off); hdev 956 net/bluetooth/mgmt.c INIT_DELAYED_WORK(&hdev->rpa_expired, rpa_expired); hdev 963 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_BONDABLE); hdev 966 net/bluetooth/mgmt.c static int read_controller_info(struct sock *sk, struct hci_dev *hdev, hdev 971 net/bluetooth/mgmt.c BT_DBG("sock %p %s", sk, hdev->name); hdev 973 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 977 net/bluetooth/mgmt.c bacpy(&rp.bdaddr, &hdev->bdaddr); hdev 979 net/bluetooth/mgmt.c rp.version = hdev->hci_ver; hdev 980 net/bluetooth/mgmt.c rp.manufacturer = cpu_to_le16(hdev->manufacturer); hdev 982 net/bluetooth/mgmt.c rp.supported_settings = cpu_to_le32(get_supported_settings(hdev)); hdev 983 net/bluetooth/mgmt.c rp.current_settings = cpu_to_le32(get_current_settings(hdev)); hdev 985 net/bluetooth/mgmt.c memcpy(rp.dev_class, hdev->dev_class, 3); hdev 987 net/bluetooth/mgmt.c memcpy(rp.name, hdev->dev_name, sizeof(hdev->dev_name)); hdev 988 net/bluetooth/mgmt.c memcpy(rp.short_name, hdev->short_name, sizeof(hdev->short_name)); hdev 990 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 992 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_READ_INFO, 0, &rp, hdev 996 net/bluetooth/mgmt.c static u16 append_eir_data_to_buf(struct hci_dev *hdev, u8 *eir) hdev 1001 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) hdev 1003 net/bluetooth/mgmt.c hdev->dev_class, 3); hdev 1005 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_LE_ENABLED)) hdev 1007 net/bluetooth/mgmt.c hdev->appearance); hdev 1009 net/bluetooth/mgmt.c name_len = strlen(hdev->dev_name); hdev 1011 net/bluetooth/mgmt.c hdev->dev_name, name_len); hdev 1013 net/bluetooth/mgmt.c name_len = strlen(hdev->short_name); hdev 1015 net/bluetooth/mgmt.c hdev->short_name, name_len); hdev 1020 net/bluetooth/mgmt.c static int read_ext_controller_info(struct sock *sk, struct hci_dev *hdev, hdev 1027 net/bluetooth/mgmt.c BT_DBG("sock %p %s", sk, hdev->name); hdev 1031 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 1033 net/bluetooth/mgmt.c bacpy(&rp->bdaddr, &hdev->bdaddr); hdev 1035 net/bluetooth/mgmt.c rp->version = hdev->hci_ver; hdev 1036 net/bluetooth/mgmt.c rp->manufacturer = cpu_to_le16(hdev->manufacturer); hdev 1038 net/bluetooth/mgmt.c rp->supported_settings = cpu_to_le32(get_supported_settings(hdev)); hdev 1039 net/bluetooth/mgmt.c rp->current_settings = cpu_to_le32(get_current_settings(hdev)); hdev 1042 net/bluetooth/mgmt.c eir_len = append_eir_data_to_buf(hdev, rp->eir); hdev 1045 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 1056 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_READ_EXT_INFO, 0, rp, hdev 1060 net/bluetooth/mgmt.c static int ext_info_changed(struct hci_dev *hdev, struct sock *skip) hdev 1068 net/bluetooth/mgmt.c eir_len = append_eir_data_to_buf(hdev, ev->eir); hdev 1071 net/bluetooth/mgmt.c return mgmt_limited_event(MGMT_EV_EXT_INFO_CHANGED, hdev, ev, hdev 1076 net/bluetooth/mgmt.c static int send_settings_rsp(struct sock *sk, u16 opcode, struct hci_dev *hdev) hdev 1078 net/bluetooth/mgmt.c __le32 settings = cpu_to_le32(get_current_settings(hdev)); hdev 1080 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, opcode, 0, &settings, hdev 1084 net/bluetooth/mgmt.c static void clean_up_hci_complete(struct hci_dev *hdev, u8 status, u16 opcode) hdev 1086 net/bluetooth/mgmt.c BT_DBG("%s status 0x%02x", hdev->name, status); hdev 1088 net/bluetooth/mgmt.c if (hci_conn_count(hdev) == 0) { hdev 1089 net/bluetooth/mgmt.c cancel_delayed_work(&hdev->power_off); hdev 1090 net/bluetooth/mgmt.c queue_work(hdev->req_workqueue, &hdev->power_off.work); hdev 1094 net/bluetooth/mgmt.c void mgmt_advertising_added(struct sock *sk, struct hci_dev *hdev, u8 instance) hdev 1100 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_ADVERTISING_ADDED, hdev, &ev, sizeof(ev), sk); hdev 1103 net/bluetooth/mgmt.c void mgmt_advertising_removed(struct sock *sk, struct hci_dev *hdev, hdev 1110 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_ADVERTISING_REMOVED, hdev, &ev, sizeof(ev), sk); hdev 1113 net/bluetooth/mgmt.c static void cancel_adv_timeout(struct hci_dev *hdev) hdev 1115 net/bluetooth/mgmt.c if (hdev->adv_instance_timeout) { hdev 1116 net/bluetooth/mgmt.c hdev->adv_instance_timeout = 0; hdev 1117 net/bluetooth/mgmt.c cancel_delayed_work(&hdev->adv_instance_expire); hdev 1121 net/bluetooth/mgmt.c static int clean_up_hci_state(struct hci_dev *hdev) hdev 1128 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 1130 net/bluetooth/mgmt.c if (test_bit(HCI_ISCAN, &hdev->flags) || hdev 1131 net/bluetooth/mgmt.c test_bit(HCI_PSCAN, &hdev->flags)) { hdev 1136 net/bluetooth/mgmt.c hci_req_clear_adv_instance(hdev, NULL, NULL, 0x00, false); hdev 1138 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_LE_ADV)) hdev 1143 net/bluetooth/mgmt.c list_for_each_entry(conn, &hdev->conn_hash.list, list) { hdev 1150 net/bluetooth/mgmt.c hci_discovery_set_state(hdev, DISCOVERY_STOPPING); hdev 1155 net/bluetooth/mgmt.c static int set_powered(struct sock *sk, struct hci_dev *hdev, void *data, hdev 1162 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 1165 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_POWERED, hdev 1168 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 1170 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_SET_POWERED, hdev)) { hdev 1171 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_POWERED, hdev 1176 net/bluetooth/mgmt.c if (!!cp->val == hdev_is_powered(hdev)) { hdev 1177 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_POWERED, hdev); hdev 1181 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_SET_POWERED, hdev, data, len); hdev 1188 net/bluetooth/mgmt.c queue_work(hdev->req_workqueue, &hdev->power_on); hdev 1192 net/bluetooth/mgmt.c err = clean_up_hci_state(hdev); hdev 1194 net/bluetooth/mgmt.c queue_delayed_work(hdev->req_workqueue, &hdev->power_off, hdev 1199 net/bluetooth/mgmt.c cancel_delayed_work(&hdev->power_off); hdev 1200 net/bluetooth/mgmt.c queue_work(hdev->req_workqueue, &hdev->power_off.work); hdev 1206 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 1210 net/bluetooth/mgmt.c static int new_settings(struct hci_dev *hdev, struct sock *skip) hdev 1212 net/bluetooth/mgmt.c __le32 ev = cpu_to_le32(get_current_settings(hdev)); hdev 1214 net/bluetooth/mgmt.c return mgmt_limited_event(MGMT_EV_NEW_SETTINGS, hdev, &ev, hdev 1218 net/bluetooth/mgmt.c int mgmt_new_settings(struct hci_dev *hdev) hdev 1220 net/bluetooth/mgmt.c return new_settings(hdev, NULL); hdev 1225 net/bluetooth/mgmt.c struct hci_dev *hdev; hdev 1233 net/bluetooth/mgmt.c send_settings_rsp(cmd->sk, cmd->opcode, match->hdev); hdev 1279 net/bluetooth/mgmt.c static u8 mgmt_bredr_support(struct hci_dev *hdev) hdev 1281 net/bluetooth/mgmt.c if (!lmp_bredr_capable(hdev)) hdev 1283 net/bluetooth/mgmt.c else if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) hdev 1289 net/bluetooth/mgmt.c static u8 mgmt_le_support(struct hci_dev *hdev) hdev 1291 net/bluetooth/mgmt.c if (!lmp_le_capable(hdev)) hdev 1293 net/bluetooth/mgmt.c else if (!hci_dev_test_flag(hdev, HCI_LE_ENABLED)) hdev 1299 net/bluetooth/mgmt.c void mgmt_set_discoverable_complete(struct hci_dev *hdev, u8 status) hdev 1305 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 1307 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_SET_DISCOVERABLE, hdev); hdev 1314 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_LIMITED_DISCOVERABLE); hdev 1318 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_DISCOVERABLE) && hdev 1319 net/bluetooth/mgmt.c hdev->discov_timeout > 0) { hdev 1320 net/bluetooth/mgmt.c int to = msecs_to_jiffies(hdev->discov_timeout * 1000); hdev 1321 net/bluetooth/mgmt.c queue_delayed_work(hdev->req_workqueue, &hdev->discov_off, to); hdev 1324 net/bluetooth/mgmt.c send_settings_rsp(cmd->sk, MGMT_OP_SET_DISCOVERABLE, hdev); hdev 1325 net/bluetooth/mgmt.c new_settings(hdev, cmd->sk); hdev 1331 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 1334 net/bluetooth/mgmt.c static int set_discoverable(struct sock *sk, struct hci_dev *hdev, void *data, hdev 1342 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 1344 net/bluetooth/mgmt.c if (!hci_dev_test_flag(hdev, HCI_LE_ENABLED) && hdev 1345 net/bluetooth/mgmt.c !hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) hdev 1346 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_DISCOVERABLE, hdev 1350 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_DISCOVERABLE, hdev 1360 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_DISCOVERABLE, hdev 1363 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 1365 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev) && timeout > 0) { hdev 1366 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_DISCOVERABLE, hdev 1371 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_SET_DISCOVERABLE, hdev) || hdev 1372 net/bluetooth/mgmt.c pending_find(MGMT_OP_SET_CONNECTABLE, hdev)) { hdev 1373 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_DISCOVERABLE, hdev 1378 net/bluetooth/mgmt.c if (!hci_dev_test_flag(hdev, HCI_CONNECTABLE)) { hdev 1379 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_DISCOVERABLE, hdev 1384 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 1391 net/bluetooth/mgmt.c if (!!cp->val != hci_dev_test_flag(hdev, HCI_DISCOVERABLE)) { hdev 1392 net/bluetooth/mgmt.c hci_dev_change_flag(hdev, HCI_DISCOVERABLE); hdev 1396 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_DISCOVERABLE, hdev); hdev 1401 net/bluetooth/mgmt.c err = new_settings(hdev, sk); hdev 1410 net/bluetooth/mgmt.c if (!!cp->val == hci_dev_test_flag(hdev, HCI_DISCOVERABLE) && hdev 1411 net/bluetooth/mgmt.c (cp->val == 0x02) == hci_dev_test_flag(hdev, hdev 1413 net/bluetooth/mgmt.c cancel_delayed_work(&hdev->discov_off); hdev 1414 net/bluetooth/mgmt.c hdev->discov_timeout = timeout; hdev 1416 net/bluetooth/mgmt.c if (cp->val && hdev->discov_timeout > 0) { hdev 1417 net/bluetooth/mgmt.c int to = msecs_to_jiffies(hdev->discov_timeout * 1000); hdev 1418 net/bluetooth/mgmt.c queue_delayed_work(hdev->req_workqueue, hdev 1419 net/bluetooth/mgmt.c &hdev->discov_off, to); hdev 1422 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_DISCOVERABLE, hdev); hdev 1426 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_SET_DISCOVERABLE, hdev, data, len); hdev 1436 net/bluetooth/mgmt.c cancel_delayed_work(&hdev->discov_off); hdev 1437 net/bluetooth/mgmt.c hdev->discov_timeout = timeout; hdev 1440 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_DISCOVERABLE); hdev 1442 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_DISCOVERABLE); hdev 1446 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_LIMITED_DISCOVERABLE); hdev 1448 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_LIMITED_DISCOVERABLE); hdev 1450 net/bluetooth/mgmt.c queue_work(hdev->req_workqueue, &hdev->discoverable_update); hdev 1454 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 1458 net/bluetooth/mgmt.c void mgmt_set_connectable_complete(struct hci_dev *hdev, u8 status) hdev 1464 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 1466 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_SET_CONNECTABLE, hdev); hdev 1476 net/bluetooth/mgmt.c send_settings_rsp(cmd->sk, MGMT_OP_SET_CONNECTABLE, hdev); hdev 1477 net/bluetooth/mgmt.c new_settings(hdev, cmd->sk); hdev 1483 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 1486 net/bluetooth/mgmt.c static int set_connectable_update_settings(struct hci_dev *hdev, hdev 1492 net/bluetooth/mgmt.c if (!!val != hci_dev_test_flag(hdev, HCI_CONNECTABLE)) hdev 1496 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_CONNECTABLE); hdev 1498 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_CONNECTABLE); hdev 1499 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_DISCOVERABLE); hdev 1502 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_CONNECTABLE, hdev); hdev 1507 net/bluetooth/mgmt.c hci_req_update_scan(hdev); hdev 1508 net/bluetooth/mgmt.c hci_update_background_scan(hdev); hdev 1509 net/bluetooth/mgmt.c return new_settings(hdev, sk); hdev 1515 net/bluetooth/mgmt.c static int set_connectable(struct sock *sk, struct hci_dev *hdev, void *data, hdev 1522 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 1524 net/bluetooth/mgmt.c if (!hci_dev_test_flag(hdev, HCI_LE_ENABLED) && hdev 1525 net/bluetooth/mgmt.c !hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) hdev 1526 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_CONNECTABLE, hdev 1530 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_CONNECTABLE, hdev 1533 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 1535 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 1536 net/bluetooth/mgmt.c err = set_connectable_update_settings(hdev, sk, cp->val); hdev 1540 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_SET_DISCOVERABLE, hdev) || hdev 1541 net/bluetooth/mgmt.c pending_find(MGMT_OP_SET_CONNECTABLE, hdev)) { hdev 1542 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_CONNECTABLE, hdev 1547 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_SET_CONNECTABLE, hdev, data, len); hdev 1554 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_CONNECTABLE); hdev 1556 net/bluetooth/mgmt.c if (hdev->discov_timeout > 0) hdev 1557 net/bluetooth/mgmt.c cancel_delayed_work(&hdev->discov_off); hdev 1559 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_LIMITED_DISCOVERABLE); hdev 1560 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_DISCOVERABLE); hdev 1561 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_CONNECTABLE); hdev 1564 net/bluetooth/mgmt.c queue_work(hdev->req_workqueue, &hdev->connectable_update); hdev 1568 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 1572 net/bluetooth/mgmt.c static int set_bondable(struct sock *sk, struct hci_dev *hdev, void *data, hdev 1579 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 1582 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_BONDABLE, hdev 1585 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 1588 net/bluetooth/mgmt.c changed = !hci_dev_test_and_set_flag(hdev, HCI_BONDABLE); hdev 1590 net/bluetooth/mgmt.c changed = hci_dev_test_and_clear_flag(hdev, HCI_BONDABLE); hdev 1592 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_BONDABLE, hdev); hdev 1600 net/bluetooth/mgmt.c if (hdev_is_powered(hdev) && hdev 1601 net/bluetooth/mgmt.c hci_dev_test_flag(hdev, HCI_ADVERTISING) && hdev 1602 net/bluetooth/mgmt.c hci_dev_test_flag(hdev, HCI_DISCOVERABLE) && hdev 1603 net/bluetooth/mgmt.c hci_dev_test_flag(hdev, HCI_LIMITED_PRIVACY)) hdev 1604 net/bluetooth/mgmt.c queue_work(hdev->req_workqueue, hdev 1605 net/bluetooth/mgmt.c &hdev->discoverable_update); hdev 1607 net/bluetooth/mgmt.c err = new_settings(hdev, sk); hdev 1611 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 1615 net/bluetooth/mgmt.c static int set_link_security(struct sock *sk, struct hci_dev *hdev, void *data, hdev 1623 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 1625 net/bluetooth/mgmt.c status = mgmt_bredr_support(hdev); hdev 1627 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_LINK_SECURITY, hdev 1631 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_LINK_SECURITY, hdev 1634 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 1636 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 1639 net/bluetooth/mgmt.c if (!!cp->val != hci_dev_test_flag(hdev, HCI_LINK_SECURITY)) { hdev 1640 net/bluetooth/mgmt.c hci_dev_change_flag(hdev, HCI_LINK_SECURITY); hdev 1644 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_LINK_SECURITY, hdev); hdev 1649 net/bluetooth/mgmt.c err = new_settings(hdev, sk); hdev 1654 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_SET_LINK_SECURITY, hdev)) { hdev 1655 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_LINK_SECURITY, hdev 1662 net/bluetooth/mgmt.c if (test_bit(HCI_AUTH, &hdev->flags) == val) { hdev 1663 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_LINK_SECURITY, hdev); hdev 1667 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_SET_LINK_SECURITY, hdev, data, len); hdev 1673 net/bluetooth/mgmt.c err = hci_send_cmd(hdev, HCI_OP_WRITE_AUTH_ENABLE, sizeof(val), &val); hdev 1680 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 1684 net/bluetooth/mgmt.c static int set_ssp(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) hdev 1691 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 1693 net/bluetooth/mgmt.c status = mgmt_bredr_support(hdev); hdev 1695 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_SSP, status); hdev 1697 net/bluetooth/mgmt.c if (!lmp_ssp_capable(hdev)) hdev 1698 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_SSP, hdev 1702 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_SSP, hdev 1705 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 1707 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 1711 net/bluetooth/mgmt.c changed = !hci_dev_test_and_set_flag(hdev, hdev 1714 net/bluetooth/mgmt.c changed = hci_dev_test_and_clear_flag(hdev, hdev 1717 net/bluetooth/mgmt.c changed = hci_dev_test_and_clear_flag(hdev, hdev 1720 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_HS_ENABLED); hdev 1723 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_SSP, hdev); hdev 1728 net/bluetooth/mgmt.c err = new_settings(hdev, sk); hdev 1733 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_SET_SSP, hdev)) { hdev 1734 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_SSP, hdev 1739 net/bluetooth/mgmt.c if (!!cp->val == hci_dev_test_flag(hdev, HCI_SSP_ENABLED)) { hdev 1740 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_SSP, hdev); hdev 1744 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_SET_SSP, hdev, data, len); hdev 1750 net/bluetooth/mgmt.c if (!cp->val && hci_dev_test_flag(hdev, HCI_USE_DEBUG_KEYS)) hdev 1751 net/bluetooth/mgmt.c hci_send_cmd(hdev, HCI_OP_WRITE_SSP_DEBUG_MODE, hdev 1754 net/bluetooth/mgmt.c err = hci_send_cmd(hdev, HCI_OP_WRITE_SSP_MODE, 1, &cp->val); hdev 1761 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 1765 net/bluetooth/mgmt.c static int set_hs(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) hdev 1772 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 1774 net/bluetooth/mgmt.c status = mgmt_bredr_support(hdev); hdev 1776 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, status); hdev 1778 net/bluetooth/mgmt.c if (!lmp_ssp_capable(hdev)) hdev 1779 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, hdev 1782 net/bluetooth/mgmt.c if (!hci_dev_test_flag(hdev, HCI_SSP_ENABLED)) hdev 1783 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, hdev 1787 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, hdev 1790 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 1792 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_SET_SSP, hdev)) { hdev 1793 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, hdev 1799 net/bluetooth/mgmt.c changed = !hci_dev_test_and_set_flag(hdev, HCI_HS_ENABLED); hdev 1801 net/bluetooth/mgmt.c if (hdev_is_powered(hdev)) { hdev 1802 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, hdev 1807 net/bluetooth/mgmt.c changed = hci_dev_test_and_clear_flag(hdev, HCI_HS_ENABLED); hdev 1810 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_HS, hdev); hdev 1815 net/bluetooth/mgmt.c err = new_settings(hdev, sk); hdev 1818 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 1822 net/bluetooth/mgmt.c static void le_enable_complete(struct hci_dev *hdev, u8 status, u16 opcode) hdev 1824 net/bluetooth/mgmt.c struct cmd_lookup match = { NULL, hdev }; hdev 1826 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 1831 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_SET_LE, hdev, cmd_status_rsp, hdev 1836 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_SET_LE, hdev, settings_rsp, &match); hdev 1838 net/bluetooth/mgmt.c new_settings(hdev, match.sk); hdev 1848 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_LE_ENABLED)) { hdev 1850 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 1851 net/bluetooth/mgmt.c if (ext_adv_capable(hdev)) { hdev 1862 net/bluetooth/mgmt.c hci_update_background_scan(hdev); hdev 1866 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 1869 net/bluetooth/mgmt.c static int set_le(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) hdev 1878 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 1880 net/bluetooth/mgmt.c if (!lmp_le_capable(hdev)) hdev 1881 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_LE, hdev 1885 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_LE, hdev 1897 net/bluetooth/mgmt.c if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) { hdev 1899 net/bluetooth/mgmt.c return send_settings_rsp(sk, MGMT_OP_SET_LE, hdev); hdev 1901 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_LE, hdev 1905 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 1908 net/bluetooth/mgmt.c enabled = lmp_host_le_capable(hdev); hdev 1911 net/bluetooth/mgmt.c hci_req_clear_adv_instance(hdev, NULL, NULL, 0x00, true); hdev 1913 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev) || val == enabled) { hdev 1916 net/bluetooth/mgmt.c if (val != hci_dev_test_flag(hdev, HCI_LE_ENABLED)) { hdev 1917 net/bluetooth/mgmt.c hci_dev_change_flag(hdev, HCI_LE_ENABLED); hdev 1921 net/bluetooth/mgmt.c if (!val && hci_dev_test_flag(hdev, HCI_ADVERTISING)) { hdev 1922 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_ADVERTISING); hdev 1926 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_LE, hdev); hdev 1931 net/bluetooth/mgmt.c err = new_settings(hdev, sk); hdev 1936 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_SET_LE, hdev) || hdev 1937 net/bluetooth/mgmt.c pending_find(MGMT_OP_SET_ADVERTISING, hdev)) { hdev 1938 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_LE, hdev 1943 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_SET_LE, hdev, data, len); hdev 1949 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 1957 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_LE_ADV)) hdev 1960 net/bluetooth/mgmt.c if (ext_adv_capable(hdev)) hdev 1972 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 1982 net/bluetooth/mgmt.c static bool pending_eir_or_class(struct hci_dev *hdev) hdev 1986 net/bluetooth/mgmt.c list_for_each_entry(cmd, &hdev->mgmt_pending, list) { hdev 2018 net/bluetooth/mgmt.c static void mgmt_class_complete(struct hci_dev *hdev, u16 mgmt_op, u8 status) hdev 2022 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 2024 net/bluetooth/mgmt.c cmd = pending_find(mgmt_op, hdev); hdev 2029 net/bluetooth/mgmt.c mgmt_status(status), hdev->dev_class, 3); hdev 2034 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 2037 net/bluetooth/mgmt.c static void add_uuid_complete(struct hci_dev *hdev, u8 status, u16 opcode) hdev 2041 net/bluetooth/mgmt.c mgmt_class_complete(hdev, MGMT_OP_ADD_UUID, status); hdev 2044 net/bluetooth/mgmt.c static int add_uuid(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) hdev 2052 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 2054 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 2056 net/bluetooth/mgmt.c if (pending_eir_or_class(hdev)) { hdev 2057 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_UUID, hdev 2072 net/bluetooth/mgmt.c list_add_tail(&uuid->list, &hdev->uuids); hdev 2074 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 2084 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_ADD_UUID, 0, hdev 2085 net/bluetooth/mgmt.c hdev->dev_class, 3); hdev 2089 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_ADD_UUID, hdev, data, len); hdev 2098 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 2102 net/bluetooth/mgmt.c static bool enable_service_cache(struct hci_dev *hdev) hdev 2104 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) hdev 2107 net/bluetooth/mgmt.c if (!hci_dev_test_and_set_flag(hdev, HCI_SERVICE_CACHE)) { hdev 2108 net/bluetooth/mgmt.c queue_delayed_work(hdev->workqueue, &hdev->service_cache, hdev 2116 net/bluetooth/mgmt.c static void remove_uuid_complete(struct hci_dev *hdev, u8 status, u16 opcode) hdev 2120 net/bluetooth/mgmt.c mgmt_class_complete(hdev, MGMT_OP_REMOVE_UUID, status); hdev 2123 net/bluetooth/mgmt.c static int remove_uuid(struct sock *sk, struct hci_dev *hdev, void *data, hdev 2133 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 2135 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 2137 net/bluetooth/mgmt.c if (pending_eir_or_class(hdev)) { hdev 2138 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_REMOVE_UUID, hdev 2144 net/bluetooth/mgmt.c hci_uuids_clear(hdev); hdev 2146 net/bluetooth/mgmt.c if (enable_service_cache(hdev)) { hdev 2147 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 2149 net/bluetooth/mgmt.c 0, hdev->dev_class, 3); hdev 2158 net/bluetooth/mgmt.c list_for_each_entry_safe(match, tmp, &hdev->uuids, list) { hdev 2168 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_REMOVE_UUID, hdev 2174 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 2184 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_REMOVE_UUID, 0, hdev 2185 net/bluetooth/mgmt.c hdev->dev_class, 3); hdev 2189 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_REMOVE_UUID, hdev, data, len); hdev 2198 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 2202 net/bluetooth/mgmt.c static void set_class_complete(struct hci_dev *hdev, u8 status, u16 opcode) hdev 2206 net/bluetooth/mgmt.c mgmt_class_complete(hdev, MGMT_OP_SET_DEV_CLASS, status); hdev 2209 net/bluetooth/mgmt.c static int set_dev_class(struct sock *sk, struct hci_dev *hdev, void *data, hdev 2217 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 2219 net/bluetooth/mgmt.c if (!lmp_bredr_capable(hdev)) hdev 2220 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_DEV_CLASS, hdev 2223 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 2225 net/bluetooth/mgmt.c if (pending_eir_or_class(hdev)) { hdev 2226 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_DEV_CLASS, hdev 2232 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_DEV_CLASS, hdev 2237 net/bluetooth/mgmt.c hdev->major_class = cp->major; hdev 2238 net/bluetooth/mgmt.c hdev->minor_class = cp->minor; hdev 2240 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 2241 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_SET_DEV_CLASS, 0, hdev 2242 net/bluetooth/mgmt.c hdev->dev_class, 3); hdev 2246 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 2248 net/bluetooth/mgmt.c if (hci_dev_test_and_clear_flag(hdev, HCI_SERVICE_CACHE)) { hdev 2249 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 2250 net/bluetooth/mgmt.c cancel_delayed_work_sync(&hdev->service_cache); hdev 2251 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 2262 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_SET_DEV_CLASS, 0, hdev 2263 net/bluetooth/mgmt.c hdev->dev_class, 3); hdev 2267 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_SET_DEV_CLASS, hdev, data, len); hdev 2276 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 2280 net/bluetooth/mgmt.c static int load_link_keys(struct sock *sk, struct hci_dev *hdev, void *data, hdev 2290 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 2292 net/bluetooth/mgmt.c if (!lmp_bredr_capable(hdev)) hdev 2293 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_LINK_KEYS, hdev 2298 net/bluetooth/mgmt.c bt_dev_err(hdev, "load_link_keys: too big key_count value %u", hdev 2300 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_LINK_KEYS, hdev 2306 net/bluetooth/mgmt.c bt_dev_err(hdev, "load_link_keys: expected %u bytes, got %u bytes", hdev 2308 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_LINK_KEYS, hdev 2313 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_LINK_KEYS, hdev 2316 net/bluetooth/mgmt.c BT_DBG("%s debug_keys %u key_count %u", hdev->name, cp->debug_keys, hdev 2323 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, hdev 2328 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 2330 net/bluetooth/mgmt.c hci_link_keys_clear(hdev); hdev 2333 net/bluetooth/mgmt.c changed = !hci_dev_test_and_set_flag(hdev, HCI_KEEP_DEBUG_KEYS); hdev 2335 net/bluetooth/mgmt.c changed = hci_dev_test_and_clear_flag(hdev, hdev 2339 net/bluetooth/mgmt.c new_settings(hdev, NULL); hdev 2350 net/bluetooth/mgmt.c hci_add_link_key(hdev, NULL, &key->addr.bdaddr, key->val, hdev 2354 net/bluetooth/mgmt.c mgmt_cmd_complete(sk, hdev->id, MGMT_OP_LOAD_LINK_KEYS, 0, NULL, 0); hdev 2356 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 2361 net/bluetooth/mgmt.c static int device_unpaired(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 2369 net/bluetooth/mgmt.c return mgmt_event(MGMT_EV_DEVICE_UNPAIRED, hdev, &ev, sizeof(ev), hdev 2373 net/bluetooth/mgmt.c static int unpair_device(struct sock *sk, struct hci_dev *hdev, void *data, hdev 2389 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_UNPAIR_DEVICE, hdev 2394 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_UNPAIR_DEVICE, hdev 2398 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 2400 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 2401 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_UNPAIR_DEVICE, hdev 2416 net/bluetooth/mgmt.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, hdev 2421 net/bluetooth/mgmt.c err = hci_remove_link_key(hdev, &cp->addr.bdaddr); hdev 2423 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 2437 net/bluetooth/mgmt.c err = smp_cancel_and_remove_pairing(hdev, &cp->addr.bdaddr, addr_type); hdev 2439 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_UNPAIR_DEVICE, hdev 2445 net/bluetooth/mgmt.c conn = hci_conn_hash_lookup_le(hdev, &cp->addr.bdaddr, addr_type); hdev 2447 net/bluetooth/mgmt.c hci_conn_params_del(hdev, &cp->addr.bdaddr, addr_type); hdev 2458 net/bluetooth/mgmt.c params = hci_conn_params_lookup(hdev, &cp->addr.bdaddr, addr_type); hdev 2477 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_UNPAIR_DEVICE, 0, hdev 2479 net/bluetooth/mgmt.c device_unpaired(hdev, &cp->addr.bdaddr, cp->addr.type, sk); hdev 2483 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_UNPAIR_DEVICE, hdev, cp, hdev 2497 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 2501 net/bluetooth/mgmt.c static int disconnect(struct sock *sk, struct hci_dev *hdev, void *data, hdev 2517 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_DISCONNECT, hdev 2521 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 2523 net/bluetooth/mgmt.c if (!test_bit(HCI_UP, &hdev->flags)) { hdev 2524 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_DISCONNECT, hdev 2530 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_DISCONNECT, hdev)) { hdev 2531 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_DISCONNECT, hdev 2537 net/bluetooth/mgmt.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, hdev 2540 net/bluetooth/mgmt.c conn = hci_conn_hash_lookup_le(hdev, &cp->addr.bdaddr, hdev 2544 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_DISCONNECT, hdev 2550 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_DISCONNECT, hdev, data, len); hdev 2563 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 2586 net/bluetooth/mgmt.c static int get_connections(struct sock *sk, struct hci_dev *hdev, void *data, hdev 2596 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 2598 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 2599 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_GET_CONNECTIONS, hdev 2605 net/bluetooth/mgmt.c list_for_each_entry(c, &hdev->conn_hash.list, list) { hdev 2617 net/bluetooth/mgmt.c list_for_each_entry(c, &hdev->conn_hash.list, list) { hdev 2630 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_GET_CONNECTIONS, 0, rp, hdev 2636 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 2640 net/bluetooth/mgmt.c static int send_pin_code_neg_reply(struct sock *sk, struct hci_dev *hdev, hdev 2646 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_PIN_CODE_NEG_REPLY, hdev, cp, hdev 2653 net/bluetooth/mgmt.c err = hci_send_cmd(hdev, HCI_OP_PIN_CODE_NEG_REPLY, hdev 2661 net/bluetooth/mgmt.c static int pin_code_reply(struct sock *sk, struct hci_dev *hdev, void *data, hdev 2672 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 2674 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 2675 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_PIN_CODE_REPLY, hdev 2680 net/bluetooth/mgmt.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->addr.bdaddr); hdev 2682 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_PIN_CODE_REPLY, hdev 2692 net/bluetooth/mgmt.c bt_dev_err(hdev, "PIN code is not 16 bytes long"); hdev 2694 net/bluetooth/mgmt.c err = send_pin_code_neg_reply(sk, hdev, &ncp); hdev 2696 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_PIN_CODE_REPLY, hdev 2702 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_PIN_CODE_REPLY, hdev, data, len); hdev 2714 net/bluetooth/mgmt.c err = hci_send_cmd(hdev, HCI_OP_PIN_CODE_REPLY, sizeof(reply), &reply); hdev 2719 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 2723 net/bluetooth/mgmt.c static int set_io_capability(struct sock *sk, struct hci_dev *hdev, void *data, hdev 2731 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_IO_CAPABILITY, hdev 2734 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 2736 net/bluetooth/mgmt.c hdev->io_capability = cp->io_capability; hdev 2738 net/bluetooth/mgmt.c BT_DBG("%s IO capability set to 0x%02x", hdev->name, hdev 2739 net/bluetooth/mgmt.c hdev->io_capability); hdev 2741 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 2743 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_SET_IO_CAPABILITY, 0, hdev 2749 net/bluetooth/mgmt.c struct hci_dev *hdev = conn->hdev; hdev 2752 net/bluetooth/mgmt.c list_for_each_entry(cmd, &hdev->mgmt_pending, list) { hdev 2841 net/bluetooth/mgmt.c static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data, hdev 2858 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_PAIR_DEVICE, hdev 2863 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_PAIR_DEVICE, hdev 2867 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 2869 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 2870 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_PAIR_DEVICE, hdev 2876 net/bluetooth/mgmt.c if (hci_bdaddr_is_paired(hdev, &cp->addr.bdaddr, cp->addr.type)) { hdev 2877 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_PAIR_DEVICE, hdev 2887 net/bluetooth/mgmt.c conn = hci_connect_acl(hdev, &cp->addr.bdaddr, sec_level, hdev 2902 net/bluetooth/mgmt.c p = hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type); hdev 2907 net/bluetooth/mgmt.c conn = hci_connect_le_scan(hdev, &cp->addr.bdaddr, hdev 2924 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_PAIR_DEVICE, hdev 2931 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_PAIR_DEVICE, hdev 2936 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_PAIR_DEVICE, hdev, data, len); hdev 2968 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 2972 net/bluetooth/mgmt.c static int cancel_pair_device(struct sock *sk, struct hci_dev *hdev, void *data, hdev 2982 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 2984 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 2985 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_CANCEL_PAIR_DEVICE, hdev 2990 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_PAIR_DEVICE, hdev); hdev 2992 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_CANCEL_PAIR_DEVICE, hdev 3000 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_CANCEL_PAIR_DEVICE, hdev 3008 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_CANCEL_PAIR_DEVICE, 0, hdev 3011 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 3015 net/bluetooth/mgmt.c static int user_pairing_resp(struct sock *sk, struct hci_dev *hdev, hdev 3023 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 3025 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 3026 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, mgmt_op, hdev 3033 net/bluetooth/mgmt.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &addr->bdaddr); hdev 3035 net/bluetooth/mgmt.c conn = hci_conn_hash_lookup_le(hdev, &addr->bdaddr, hdev 3039 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, mgmt_op, hdev 3048 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, mgmt_op, hdev 3052 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, mgmt_op, hdev 3059 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, mgmt_op, hdev, addr, sizeof(*addr)); hdev 3073 net/bluetooth/mgmt.c err = hci_send_cmd(hdev, hci_op, sizeof(cp), &cp); hdev 3075 net/bluetooth/mgmt.c err = hci_send_cmd(hdev, hci_op, sizeof(addr->bdaddr), hdev 3082 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 3086 net/bluetooth/mgmt.c static int pin_code_neg_reply(struct sock *sk, struct hci_dev *hdev, hdev 3093 net/bluetooth/mgmt.c return user_pairing_resp(sk, hdev, &cp->addr, hdev 3098 net/bluetooth/mgmt.c static int user_confirm_reply(struct sock *sk, struct hci_dev *hdev, void *data, hdev 3106 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_USER_CONFIRM_REPLY, hdev 3109 net/bluetooth/mgmt.c return user_pairing_resp(sk, hdev, &cp->addr, hdev 3114 net/bluetooth/mgmt.c static int user_confirm_neg_reply(struct sock *sk, struct hci_dev *hdev, hdev 3121 net/bluetooth/mgmt.c return user_pairing_resp(sk, hdev, &cp->addr, hdev 3126 net/bluetooth/mgmt.c static int user_passkey_reply(struct sock *sk, struct hci_dev *hdev, void *data, hdev 3133 net/bluetooth/mgmt.c return user_pairing_resp(sk, hdev, &cp->addr, hdev 3138 net/bluetooth/mgmt.c static int user_passkey_neg_reply(struct sock *sk, struct hci_dev *hdev, hdev 3145 net/bluetooth/mgmt.c return user_pairing_resp(sk, hdev, &cp->addr, hdev 3150 net/bluetooth/mgmt.c static void adv_expire(struct hci_dev *hdev, u32 flags) hdev 3156 net/bluetooth/mgmt.c adv_instance = hci_find_adv_instance(hdev, hdev->cur_adv_instance); hdev 3164 net/bluetooth/mgmt.c cancel_adv_timeout(hdev); hdev 3166 net/bluetooth/mgmt.c adv_instance = hci_get_next_instance(hdev, adv_instance->instance); hdev 3170 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 3179 net/bluetooth/mgmt.c static void set_name_complete(struct hci_dev *hdev, u8 status, u16 opcode) hdev 3186 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 3188 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_SET_LOCAL_NAME, hdev); hdev 3195 net/bluetooth/mgmt.c mgmt_cmd_status(cmd->sk, hdev->id, MGMT_OP_SET_LOCAL_NAME, hdev 3198 net/bluetooth/mgmt.c mgmt_cmd_complete(cmd->sk, hdev->id, MGMT_OP_SET_LOCAL_NAME, 0, hdev 3201 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_LE_ADV)) hdev 3202 net/bluetooth/mgmt.c adv_expire(hdev, MGMT_ADV_FLAG_LOCAL_NAME); hdev 3208 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 3211 net/bluetooth/mgmt.c static int set_local_name(struct sock *sk, struct hci_dev *hdev, void *data, hdev 3221 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 3226 net/bluetooth/mgmt.c if (!memcmp(hdev->dev_name, cp->name, sizeof(hdev->dev_name)) && hdev 3227 net/bluetooth/mgmt.c !memcmp(hdev->short_name, cp->short_name, hdev 3228 net/bluetooth/mgmt.c sizeof(hdev->short_name))) { hdev 3229 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_SET_LOCAL_NAME, 0, hdev 3234 net/bluetooth/mgmt.c memcpy(hdev->short_name, cp->short_name, sizeof(hdev->short_name)); hdev 3236 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 3237 net/bluetooth/mgmt.c memcpy(hdev->dev_name, cp->name, sizeof(hdev->dev_name)); hdev 3239 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_SET_LOCAL_NAME, 0, hdev 3244 net/bluetooth/mgmt.c err = mgmt_limited_event(MGMT_EV_LOCAL_NAME_CHANGED, hdev, data, hdev 3246 net/bluetooth/mgmt.c ext_info_changed(hdev, sk); hdev 3251 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_SET_LOCAL_NAME, hdev, data, len); hdev 3257 net/bluetooth/mgmt.c memcpy(hdev->dev_name, cp->name, sizeof(hdev->dev_name)); hdev 3259 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 3261 net/bluetooth/mgmt.c if (lmp_bredr_capable(hdev)) { hdev 3269 net/bluetooth/mgmt.c if (lmp_le_capable(hdev) && hci_dev_test_flag(hdev, HCI_ADVERTISING)) hdev 3270 net/bluetooth/mgmt.c __hci_req_update_scan_rsp_data(&req, hdev->cur_adv_instance); hdev 3277 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 3281 net/bluetooth/mgmt.c static int set_appearance(struct sock *sk, struct hci_dev *hdev, void *data, hdev 3290 net/bluetooth/mgmt.c if (!lmp_le_capable(hdev)) hdev 3291 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_APPEARANCE, hdev 3296 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 3298 net/bluetooth/mgmt.c if (hdev->appearance != apperance) { hdev 3299 net/bluetooth/mgmt.c hdev->appearance = apperance; hdev 3301 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_LE_ADV)) hdev 3302 net/bluetooth/mgmt.c adv_expire(hdev, MGMT_ADV_FLAG_APPEARANCE); hdev 3304 net/bluetooth/mgmt.c ext_info_changed(hdev, sk); hdev 3307 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_SET_APPEARANCE, 0, NULL, hdev 3310 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 3315 net/bluetooth/mgmt.c static int get_phy_configuration(struct sock *sk, struct hci_dev *hdev, hdev 3320 net/bluetooth/mgmt.c BT_DBG("sock %p %s", sk, hdev->name); hdev 3322 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 3326 net/bluetooth/mgmt.c rp.supported_phys = cpu_to_le32(get_supported_phys(hdev)); hdev 3327 net/bluetooth/mgmt.c rp.selected_phys = cpu_to_le32(get_selected_phys(hdev)); hdev 3328 net/bluetooth/mgmt.c rp.configurable_phys = cpu_to_le32(get_configurable_phys(hdev)); hdev 3330 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 3332 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_GET_PHY_CONFIGURATION, 0, hdev 3336 net/bluetooth/mgmt.c int mgmt_phy_configuration_changed(struct hci_dev *hdev, struct sock *skip) hdev 3342 net/bluetooth/mgmt.c ev.selected_phys = cpu_to_le32(get_selected_phys(hdev)); hdev 3344 net/bluetooth/mgmt.c return mgmt_event(MGMT_EV_PHY_CONFIGURATION_CHANGED, hdev, &ev, hdev 3348 net/bluetooth/mgmt.c static void set_default_phy_complete(struct hci_dev *hdev, u8 status, hdev 3355 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 3357 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_SET_PHY_CONFIGURATION, hdev); hdev 3362 net/bluetooth/mgmt.c mgmt_cmd_status(cmd->sk, hdev->id, hdev 3366 net/bluetooth/mgmt.c mgmt_cmd_complete(cmd->sk, hdev->id, hdev 3370 net/bluetooth/mgmt.c mgmt_phy_configuration_changed(hdev, cmd->sk); hdev 3376 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 3379 net/bluetooth/mgmt.c static int set_phy_configuration(struct sock *sk, struct hci_dev *hdev, hdev 3391 net/bluetooth/mgmt.c BT_DBG("sock %p %s", sk, hdev->name); hdev 3393 net/bluetooth/mgmt.c configurable_phys = get_configurable_phys(hdev); hdev 3394 net/bluetooth/mgmt.c supported_phys = get_supported_phys(hdev); hdev 3398 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, hdev 3405 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, hdev 3409 net/bluetooth/mgmt.c if (selected_phys == get_selected_phys(hdev)) hdev 3410 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, hdev 3414 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 3416 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 3417 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, hdev 3423 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_SET_PHY_CONFIGURATION, hdev)) { hdev 3424 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, hdev 3470 net/bluetooth/mgmt.c if (pkt_type != hdev->pkt_type) { hdev 3471 net/bluetooth/mgmt.c hdev->pkt_type = pkt_type; hdev 3476 net/bluetooth/mgmt.c (get_selected_phys(hdev) & MGMT_PHY_LE_MASK)) { hdev 3478 net/bluetooth/mgmt.c mgmt_phy_configuration_changed(hdev, sk); hdev 3480 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 3487 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_SET_PHY_CONFIGURATION, hdev, data, hdev 3494 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 3529 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 3534 net/bluetooth/mgmt.c static void read_local_oob_data_complete(struct hci_dev *hdev, u8 status, hdev 3541 net/bluetooth/mgmt.c BT_DBG("%s status %u", hdev->name, status); hdev 3543 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_READ_LOCAL_OOB_DATA, hdev); hdev 3548 net/bluetooth/mgmt.c mgmt_cmd_status(cmd->sk, hdev->id, MGMT_OP_READ_LOCAL_OOB_DATA, hdev 3559 net/bluetooth/mgmt.c mgmt_cmd_status(cmd->sk, hdev->id, hdev 3573 net/bluetooth/mgmt.c mgmt_cmd_status(cmd->sk, hdev->id, hdev 3586 net/bluetooth/mgmt.c mgmt_cmd_complete(cmd->sk, hdev->id, MGMT_OP_READ_LOCAL_OOB_DATA, hdev 3593 net/bluetooth/mgmt.c static int read_local_oob_data(struct sock *sk, struct hci_dev *hdev, hdev 3600 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 3602 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 3604 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 3605 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_READ_LOCAL_OOB_DATA, hdev 3610 net/bluetooth/mgmt.c if (!lmp_ssp_capable(hdev)) { hdev 3611 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_READ_LOCAL_OOB_DATA, hdev 3616 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_READ_LOCAL_OOB_DATA, hdev)) { hdev 3617 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_READ_LOCAL_OOB_DATA, hdev 3622 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_READ_LOCAL_OOB_DATA, hdev, NULL, 0); hdev 3628 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 3630 net/bluetooth/mgmt.c if (bredr_sc_enabled(hdev)) hdev 3640 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 3644 net/bluetooth/mgmt.c static int add_remote_oob_data(struct sock *sk, struct hci_dev *hdev, hdev 3650 net/bluetooth/mgmt.c BT_DBG("%s ", hdev->name); hdev 3653 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, hdev 3658 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 3665 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 3672 net/bluetooth/mgmt.c err = hci_add_remote_oob_data(hdev, &cp->addr.bdaddr, hdev 3680 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 3694 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 3729 net/bluetooth/mgmt.c err = hci_add_remote_oob_data(hdev, &cp->addr.bdaddr, hdev 3737 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 3741 net/bluetooth/mgmt.c bt_dev_err(hdev, "add_remote_oob_data: invalid len of %u bytes", hdev 3743 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_REMOTE_OOB_DATA, hdev 3748 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 3752 net/bluetooth/mgmt.c static int remove_remote_oob_data(struct sock *sk, struct hci_dev *hdev, hdev 3759 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 3762 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, hdev 3767 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 3770 net/bluetooth/mgmt.c hci_remote_oob_data_clear(hdev); hdev 3775 net/bluetooth/mgmt.c err = hci_remove_remote_oob_data(hdev, &cp->addr.bdaddr, cp->addr.type); hdev 3782 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_REMOVE_REMOTE_OOB_DATA, hdev 3785 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 3789 net/bluetooth/mgmt.c void mgmt_start_discovery_complete(struct hci_dev *hdev, u8 status) hdev 3795 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 3797 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_START_DISCOVERY, hdev); hdev 3799 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_START_SERVICE_DISCOVERY, hdev); hdev 3802 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_START_LIMITED_DISCOVERY, hdev); hdev 3809 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 3812 net/bluetooth/mgmt.c static bool discovery_type_is_valid(struct hci_dev *hdev, uint8_t type, hdev 3817 net/bluetooth/mgmt.c *mgmt_status = mgmt_le_support(hdev); hdev 3822 net/bluetooth/mgmt.c *mgmt_status = mgmt_le_support(hdev); hdev 3827 net/bluetooth/mgmt.c *mgmt_status = mgmt_bredr_support(hdev); hdev 3839 net/bluetooth/mgmt.c static int start_discovery_internal(struct sock *sk, struct hci_dev *hdev, hdev 3847 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 3849 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 3851 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 3852 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, op, hdev 3858 net/bluetooth/mgmt.c if (hdev->discovery.state != DISCOVERY_STOPPED || hdev 3859 net/bluetooth/mgmt.c hci_dev_test_flag(hdev, HCI_PERIODIC_INQ)) { hdev 3860 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, op, MGMT_STATUS_BUSY, hdev 3865 net/bluetooth/mgmt.c if (!discovery_type_is_valid(hdev, cp->type, &status)) { hdev 3866 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, op, status, hdev 3874 net/bluetooth/mgmt.c hci_discovery_filter_clear(hdev); hdev 3876 net/bluetooth/mgmt.c hdev->discovery.type = cp->type; hdev 3877 net/bluetooth/mgmt.c hdev->discovery.report_invalid_rssi = false; hdev 3879 net/bluetooth/mgmt.c hdev->discovery.limited = true; hdev 3881 net/bluetooth/mgmt.c hdev->discovery.limited = false; hdev 3883 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, op, hdev, data, len); hdev 3891 net/bluetooth/mgmt.c hci_discovery_set_state(hdev, DISCOVERY_STARTING); hdev 3892 net/bluetooth/mgmt.c queue_work(hdev->req_workqueue, &hdev->discov_update); hdev 3896 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 3900 net/bluetooth/mgmt.c static int start_discovery(struct sock *sk, struct hci_dev *hdev, hdev 3903 net/bluetooth/mgmt.c return start_discovery_internal(sk, hdev, MGMT_OP_START_DISCOVERY, hdev 3907 net/bluetooth/mgmt.c static int start_limited_discovery(struct sock *sk, struct hci_dev *hdev, hdev 3910 net/bluetooth/mgmt.c return start_discovery_internal(sk, hdev, hdev 3922 net/bluetooth/mgmt.c static int start_service_discovery(struct sock *sk, struct hci_dev *hdev, hdev 3932 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 3934 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 3936 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 3937 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 3944 net/bluetooth/mgmt.c if (hdev->discovery.state != DISCOVERY_STOPPED || hdev 3945 net/bluetooth/mgmt.c hci_dev_test_flag(hdev, HCI_PERIODIC_INQ)) { hdev 3946 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 3955 net/bluetooth/mgmt.c bt_dev_err(hdev, "service_discovery: too big uuid_count value %u", hdev 3957 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 3966 net/bluetooth/mgmt.c bt_dev_err(hdev, "service_discovery: expected %u bytes, got %u bytes", hdev 3968 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 3975 net/bluetooth/mgmt.c if (!discovery_type_is_valid(hdev, cp->type, &status)) { hdev 3976 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 3983 net/bluetooth/mgmt.c hdev, data, len); hdev 3994 net/bluetooth/mgmt.c hci_discovery_filter_clear(hdev); hdev 3996 net/bluetooth/mgmt.c hdev->discovery.result_filtering = true; hdev 3997 net/bluetooth/mgmt.c hdev->discovery.type = cp->type; hdev 3998 net/bluetooth/mgmt.c hdev->discovery.rssi = cp->rssi; hdev 3999 net/bluetooth/mgmt.c hdev->discovery.uuid_count = uuid_count; hdev 4002 net/bluetooth/mgmt.c hdev->discovery.uuids = kmemdup(cp->uuids, uuid_count * 16, hdev 4004 net/bluetooth/mgmt.c if (!hdev->discovery.uuids) { hdev 4005 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 4014 net/bluetooth/mgmt.c hci_discovery_set_state(hdev, DISCOVERY_STARTING); hdev 4015 net/bluetooth/mgmt.c queue_work(hdev->req_workqueue, &hdev->discov_update); hdev 4019 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4023 net/bluetooth/mgmt.c void mgmt_stop_discovery_complete(struct hci_dev *hdev, u8 status) hdev 4029 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4031 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_STOP_DISCOVERY, hdev); hdev 4037 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4040 net/bluetooth/mgmt.c static int stop_discovery(struct sock *sk, struct hci_dev *hdev, void *data, hdev 4047 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 4049 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4051 net/bluetooth/mgmt.c if (!hci_discovery_active(hdev)) { hdev 4052 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_STOP_DISCOVERY, hdev 4058 net/bluetooth/mgmt.c if (hdev->discovery.type != mgmt_cp->type) { hdev 4059 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_STOP_DISCOVERY, hdev 4065 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_STOP_DISCOVERY, hdev, data, len); hdev 4073 net/bluetooth/mgmt.c hci_discovery_set_state(hdev, DISCOVERY_STOPPING); hdev 4074 net/bluetooth/mgmt.c queue_work(hdev->req_workqueue, &hdev->discov_update); hdev 4078 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4082 net/bluetooth/mgmt.c static int confirm_name(struct sock *sk, struct hci_dev *hdev, void *data, hdev 4089 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 4091 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4093 net/bluetooth/mgmt.c if (!hci_discovery_active(hdev)) { hdev 4094 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_CONFIRM_NAME, hdev 4100 net/bluetooth/mgmt.c e = hci_inquiry_cache_lookup_unknown(hdev, &cp->addr.bdaddr); hdev 4102 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_CONFIRM_NAME, hdev 4113 net/bluetooth/mgmt.c hci_inquiry_cache_update_resolve(hdev, e); hdev 4116 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_CONFIRM_NAME, 0, hdev 4120 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4124 net/bluetooth/mgmt.c static int block_device(struct sock *sk, struct hci_dev *hdev, void *data, hdev 4131 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 4134 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_BLOCK_DEVICE, hdev 4138 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4140 net/bluetooth/mgmt.c err = hci_bdaddr_list_add(&hdev->blacklist, &cp->addr.bdaddr, hdev 4147 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_DEVICE_BLOCKED, hdev, &cp->addr, sizeof(cp->addr), hdev 4152 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_BLOCK_DEVICE, status, hdev 4155 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4160 net/bluetooth/mgmt.c static int unblock_device(struct sock *sk, struct hci_dev *hdev, void *data, hdev 4167 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 4170 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_UNBLOCK_DEVICE, hdev 4174 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4176 net/bluetooth/mgmt.c err = hci_bdaddr_list_del(&hdev->blacklist, &cp->addr.bdaddr, hdev 4183 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_DEVICE_UNBLOCKED, hdev, &cp->addr, sizeof(cp->addr), hdev 4188 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_UNBLOCK_DEVICE, status, hdev 4191 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4196 net/bluetooth/mgmt.c static int set_device_id(struct sock *sk, struct hci_dev *hdev, void *data, hdev 4204 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 4209 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_DEVICE_ID, hdev 4212 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4214 net/bluetooth/mgmt.c hdev->devid_source = source; hdev 4215 net/bluetooth/mgmt.c hdev->devid_vendor = __le16_to_cpu(cp->vendor); hdev 4216 net/bluetooth/mgmt.c hdev->devid_product = __le16_to_cpu(cp->product); hdev 4217 net/bluetooth/mgmt.c hdev->devid_version = __le16_to_cpu(cp->version); hdev 4219 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_SET_DEVICE_ID, 0, hdev 4222 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 4226 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4231 net/bluetooth/mgmt.c static void enable_advertising_instance(struct hci_dev *hdev, u8 status, hdev 4237 net/bluetooth/mgmt.c static void set_advertising_complete(struct hci_dev *hdev, u8 status, hdev 4240 net/bluetooth/mgmt.c struct cmd_lookup match = { NULL, hdev }; hdev 4246 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4251 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_SET_ADVERTISING, hdev, hdev 4256 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_LE_ADV)) hdev 4257 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_ADVERTISING); hdev 4259 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_ADVERTISING); hdev 4261 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_SET_ADVERTISING, hdev, settings_rsp, hdev 4264 net/bluetooth/mgmt.c new_settings(hdev, match.sk); hdev 4272 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_ADVERTISING) || hdev 4273 net/bluetooth/mgmt.c list_empty(&hdev->adv_instances)) hdev 4276 net/bluetooth/mgmt.c instance = hdev->cur_adv_instance; hdev 4278 net/bluetooth/mgmt.c adv_instance = list_first_entry_or_null(&hdev->adv_instances, hdev 4286 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 4294 net/bluetooth/mgmt.c bt_dev_err(hdev, "failed to re-configure advertising"); hdev 4297 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4300 net/bluetooth/mgmt.c static int set_advertising(struct sock *sk, struct hci_dev *hdev, void *data, hdev 4309 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 4311 net/bluetooth/mgmt.c status = mgmt_le_support(hdev); hdev 4313 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_ADVERTISING, hdev 4317 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_ADVERTISING, hdev 4320 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4329 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev) || hdev 4330 net/bluetooth/mgmt.c (val == hci_dev_test_flag(hdev, HCI_ADVERTISING) && hdev 4331 net/bluetooth/mgmt.c (cp->val == 0x02) == hci_dev_test_flag(hdev, HCI_ADVERTISING_CONNECTABLE)) || hdev 4332 net/bluetooth/mgmt.c hci_conn_num(hdev, LE_LINK) > 0 || hdev 4333 net/bluetooth/mgmt.c (hci_dev_test_flag(hdev, HCI_LE_SCAN) && hdev 4334 net/bluetooth/mgmt.c hdev->le_scan_type == LE_SCAN_ACTIVE)) { hdev 4338 net/bluetooth/mgmt.c hdev->cur_adv_instance = 0x00; hdev 4339 net/bluetooth/mgmt.c changed = !hci_dev_test_and_set_flag(hdev, HCI_ADVERTISING); hdev 4341 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_ADVERTISING_CONNECTABLE); hdev 4343 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_ADVERTISING_CONNECTABLE); hdev 4345 net/bluetooth/mgmt.c changed = hci_dev_test_and_clear_flag(hdev, HCI_ADVERTISING); hdev 4346 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_ADVERTISING_CONNECTABLE); hdev 4349 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_ADVERTISING, hdev); hdev 4354 net/bluetooth/mgmt.c err = new_settings(hdev, sk); hdev 4359 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_SET_ADVERTISING, hdev) || hdev 4360 net/bluetooth/mgmt.c pending_find(MGMT_OP_SET_LE, hdev)) { hdev 4361 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_ADVERTISING, hdev 4366 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_SET_ADVERTISING, hdev, data, len); hdev 4372 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 4375 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_ADVERTISING_CONNECTABLE); hdev 4377 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_ADVERTISING_CONNECTABLE); hdev 4379 net/bluetooth/mgmt.c cancel_adv_timeout(hdev); hdev 4386 net/bluetooth/mgmt.c hdev->cur_adv_instance = 0x00; hdev 4388 net/bluetooth/mgmt.c if (ext_adv_capable(hdev)) { hdev 4404 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4408 net/bluetooth/mgmt.c static int set_static_address(struct sock *sk, struct hci_dev *hdev, hdev 4414 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 4416 net/bluetooth/mgmt.c if (!lmp_le_capable(hdev)) hdev 4417 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_STATIC_ADDRESS, hdev 4420 net/bluetooth/mgmt.c if (hdev_is_powered(hdev)) hdev 4421 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_STATIC_ADDRESS, hdev 4426 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, hdev 4432 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, hdev 4437 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4439 net/bluetooth/mgmt.c bacpy(&hdev->static_addr, &cp->bdaddr); hdev 4441 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_STATIC_ADDRESS, hdev); hdev 4445 net/bluetooth/mgmt.c err = new_settings(hdev, sk); hdev 4448 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4452 net/bluetooth/mgmt.c static int set_scan_params(struct sock *sk, struct hci_dev *hdev, hdev 4459 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 4461 net/bluetooth/mgmt.c if (!lmp_le_capable(hdev)) hdev 4462 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_SCAN_PARAMS, hdev 4468 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_SCAN_PARAMS, hdev 4474 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_SCAN_PARAMS, hdev 4478 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_SCAN_PARAMS, hdev 4481 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4483 net/bluetooth/mgmt.c hdev->le_scan_interval = interval; hdev 4484 net/bluetooth/mgmt.c hdev->le_scan_window = window; hdev 4486 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_SET_SCAN_PARAMS, 0, hdev 4492 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_LE_SCAN) && hdev 4493 net/bluetooth/mgmt.c hdev->discovery.state == DISCOVERY_STOPPED) { hdev 4496 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 4504 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4509 net/bluetooth/mgmt.c static void fast_connectable_complete(struct hci_dev *hdev, u8 status, hdev 4516 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4518 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_SET_FAST_CONNECTABLE, hdev); hdev 4523 net/bluetooth/mgmt.c mgmt_cmd_status(cmd->sk, hdev->id, MGMT_OP_SET_FAST_CONNECTABLE, hdev 4529 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_FAST_CONNECTABLE); hdev 4531 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_FAST_CONNECTABLE); hdev 4533 net/bluetooth/mgmt.c send_settings_rsp(cmd->sk, MGMT_OP_SET_FAST_CONNECTABLE, hdev); hdev 4534 net/bluetooth/mgmt.c new_settings(hdev, cmd->sk); hdev 4540 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4543 net/bluetooth/mgmt.c static int set_fast_connectable(struct sock *sk, struct hci_dev *hdev, hdev 4551 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 4553 net/bluetooth/mgmt.c if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED) || hdev 4554 net/bluetooth/mgmt.c hdev->hci_ver < BLUETOOTH_VER_1_2) hdev 4555 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_FAST_CONNECTABLE, hdev 4559 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_FAST_CONNECTABLE, hdev 4562 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4564 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_SET_FAST_CONNECTABLE, hdev)) { hdev 4565 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_FAST_CONNECTABLE, hdev 4570 net/bluetooth/mgmt.c if (!!cp->val == hci_dev_test_flag(hdev, HCI_FAST_CONNECTABLE)) { hdev 4572 net/bluetooth/mgmt.c hdev); hdev 4576 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 4577 net/bluetooth/mgmt.c hci_dev_change_flag(hdev, HCI_FAST_CONNECTABLE); hdev 4579 net/bluetooth/mgmt.c hdev); hdev 4580 net/bluetooth/mgmt.c new_settings(hdev, sk); hdev 4584 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_SET_FAST_CONNECTABLE, hdev, hdev 4591 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 4597 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_FAST_CONNECTABLE, hdev 4603 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4608 net/bluetooth/mgmt.c static void set_bredr_complete(struct hci_dev *hdev, u8 status, u16 opcode) hdev 4614 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4616 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_SET_BREDR, hdev); hdev 4626 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_BREDR_ENABLED); hdev 4630 net/bluetooth/mgmt.c send_settings_rsp(cmd->sk, MGMT_OP_SET_BREDR, hdev); hdev 4631 net/bluetooth/mgmt.c new_settings(hdev, cmd->sk); hdev 4637 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4640 net/bluetooth/mgmt.c static int set_bredr(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) hdev 4647 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 4649 net/bluetooth/mgmt.c if (!lmp_bredr_capable(hdev) || !lmp_le_capable(hdev)) hdev 4650 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_BREDR, hdev 4653 net/bluetooth/mgmt.c if (!hci_dev_test_flag(hdev, HCI_LE_ENABLED)) hdev 4654 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_BREDR, hdev 4658 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_BREDR, hdev 4661 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4663 net/bluetooth/mgmt.c if (cp->val == hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) { hdev 4664 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_BREDR, hdev); hdev 4668 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 4670 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_DISCOVERABLE); hdev 4671 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_SSP_ENABLED); hdev 4672 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_LINK_SECURITY); hdev 4673 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_FAST_CONNECTABLE); hdev 4674 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_HS_ENABLED); hdev 4677 net/bluetooth/mgmt.c hci_dev_change_flag(hdev, HCI_BREDR_ENABLED); hdev 4679 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_BREDR, hdev); hdev 4683 net/bluetooth/mgmt.c err = new_settings(hdev, sk); hdev 4689 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_BREDR, hdev 4707 net/bluetooth/mgmt.c if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED) && hdev 4708 net/bluetooth/mgmt.c (bacmp(&hdev->static_addr, BDADDR_ANY) || hdev 4709 net/bluetooth/mgmt.c hci_dev_test_flag(hdev, HCI_SC_ENABLED))) { hdev 4710 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_BREDR, hdev 4716 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_SET_BREDR, hdev)) { hdev 4717 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_BREDR, hdev 4722 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_SET_BREDR, hdev, data, len); hdev 4731 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_BREDR_ENABLED); hdev 4733 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 4741 net/bluetooth/mgmt.c __hci_req_update_adv_data(&req, hdev->cur_adv_instance); hdev 4748 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4752 net/bluetooth/mgmt.c static void sc_enable_complete(struct hci_dev *hdev, u8 status, u16 opcode) hdev 4757 net/bluetooth/mgmt.c BT_DBG("%s status %u", hdev->name, status); hdev 4759 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4761 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_SET_SECURE_CONN, hdev); hdev 4775 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_SC_ENABLED); hdev 4776 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_SC_ONLY); hdev 4779 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_SC_ENABLED); hdev 4780 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_SC_ONLY); hdev 4783 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_SC_ENABLED); hdev 4784 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_SC_ONLY); hdev 4788 net/bluetooth/mgmt.c send_settings_rsp(cmd->sk, MGMT_OP_SET_SECURE_CONN, hdev); hdev 4789 net/bluetooth/mgmt.c new_settings(hdev, cmd->sk); hdev 4794 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4797 net/bluetooth/mgmt.c static int set_secure_conn(struct sock *sk, struct hci_dev *hdev, hdev 4806 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 4808 net/bluetooth/mgmt.c if (!lmp_sc_capable(hdev) && hdev 4809 net/bluetooth/mgmt.c !hci_dev_test_flag(hdev, HCI_LE_ENABLED)) hdev 4810 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_SECURE_CONN, hdev 4813 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_BREDR_ENABLED) && hdev 4814 net/bluetooth/mgmt.c lmp_sc_capable(hdev) && hdev 4815 net/bluetooth/mgmt.c !hci_dev_test_flag(hdev, HCI_SSP_ENABLED)) hdev 4816 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_SECURE_CONN, hdev 4820 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_SECURE_CONN, hdev 4823 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4825 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev) || !lmp_sc_capable(hdev) || hdev 4826 net/bluetooth/mgmt.c !hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) { hdev 4830 net/bluetooth/mgmt.c changed = !hci_dev_test_and_set_flag(hdev, hdev 4833 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_SC_ONLY); hdev 4835 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_SC_ONLY); hdev 4837 net/bluetooth/mgmt.c changed = hci_dev_test_and_clear_flag(hdev, hdev 4839 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_SC_ONLY); hdev 4842 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_SECURE_CONN, hdev); hdev 4847 net/bluetooth/mgmt.c err = new_settings(hdev, sk); hdev 4852 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_SET_SECURE_CONN, hdev)) { hdev 4853 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_SECURE_CONN, hdev 4860 net/bluetooth/mgmt.c if (val == hci_dev_test_flag(hdev, HCI_SC_ENABLED) && hdev 4861 net/bluetooth/mgmt.c (cp->val == 0x02) == hci_dev_test_flag(hdev, HCI_SC_ONLY)) { hdev 4862 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_SECURE_CONN, hdev); hdev 4866 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_SET_SECURE_CONN, hdev, data, len); hdev 4872 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 4881 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4885 net/bluetooth/mgmt.c static int set_debug_keys(struct sock *sk, struct hci_dev *hdev, hdev 4892 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 4895 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_DEBUG_KEYS, hdev 4898 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4901 net/bluetooth/mgmt.c changed = !hci_dev_test_and_set_flag(hdev, HCI_KEEP_DEBUG_KEYS); hdev 4903 net/bluetooth/mgmt.c changed = hci_dev_test_and_clear_flag(hdev, hdev 4907 net/bluetooth/mgmt.c use_changed = !hci_dev_test_and_set_flag(hdev, hdev 4910 net/bluetooth/mgmt.c use_changed = hci_dev_test_and_clear_flag(hdev, hdev 4913 net/bluetooth/mgmt.c if (hdev_is_powered(hdev) && use_changed && hdev 4914 net/bluetooth/mgmt.c hci_dev_test_flag(hdev, HCI_SSP_ENABLED)) { hdev 4916 net/bluetooth/mgmt.c hci_send_cmd(hdev, HCI_OP_WRITE_SSP_DEBUG_MODE, hdev 4920 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_DEBUG_KEYS, hdev); hdev 4925 net/bluetooth/mgmt.c err = new_settings(hdev, sk); hdev 4928 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 4932 net/bluetooth/mgmt.c static int set_privacy(struct sock *sk, struct hci_dev *hdev, void *cp_data, hdev 4939 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 4941 net/bluetooth/mgmt.c if (!lmp_le_capable(hdev)) hdev 4942 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_PRIVACY, hdev 4946 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_PRIVACY, hdev 4949 net/bluetooth/mgmt.c if (hdev_is_powered(hdev)) hdev 4950 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_PRIVACY, hdev 4953 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 4958 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_RPA_RESOLVING); hdev 4961 net/bluetooth/mgmt.c changed = !hci_dev_test_and_set_flag(hdev, HCI_PRIVACY); hdev 4962 net/bluetooth/mgmt.c memcpy(hdev->irk, cp->irk, sizeof(hdev->irk)); hdev 4963 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_RPA_EXPIRED); hdev 4964 net/bluetooth/mgmt.c hci_adv_instances_set_rpa_expired(hdev, true); hdev 4966 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_LIMITED_PRIVACY); hdev 4968 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_LIMITED_PRIVACY); hdev 4970 net/bluetooth/mgmt.c changed = hci_dev_test_and_clear_flag(hdev, HCI_PRIVACY); hdev 4971 net/bluetooth/mgmt.c memset(hdev->irk, 0, sizeof(hdev->irk)); hdev 4972 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_RPA_EXPIRED); hdev 4973 net/bluetooth/mgmt.c hci_adv_instances_set_rpa_expired(hdev, false); hdev 4974 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_LIMITED_PRIVACY); hdev 4977 net/bluetooth/mgmt.c err = send_settings_rsp(sk, MGMT_OP_SET_PRIVACY, hdev); hdev 4982 net/bluetooth/mgmt.c err = new_settings(hdev, sk); hdev 4985 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 5005 net/bluetooth/mgmt.c static int load_irks(struct sock *sk, struct hci_dev *hdev, void *cp_data, hdev 5014 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 5016 net/bluetooth/mgmt.c if (!lmp_le_capable(hdev)) hdev 5017 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_IRKS, hdev 5022 net/bluetooth/mgmt.c bt_dev_err(hdev, "load_irks: too big irk_count value %u", hdev 5024 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_IRKS, hdev 5030 net/bluetooth/mgmt.c bt_dev_err(hdev, "load_irks: expected %u bytes, got %u bytes", hdev 5032 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_IRKS, hdev 5036 net/bluetooth/mgmt.c BT_DBG("%s irk_count %u", hdev->name, irk_count); hdev 5042 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, hdev 5047 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 5049 net/bluetooth/mgmt.c hci_smp_irks_clear(hdev); hdev 5054 net/bluetooth/mgmt.c hci_add_irk(hdev, &irk->addr.bdaddr, hdev 5059 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_RPA_RESOLVING); hdev 5061 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_LOAD_IRKS, 0, NULL, 0); hdev 5063 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 5087 net/bluetooth/mgmt.c static int load_long_term_keys(struct sock *sk, struct hci_dev *hdev, hdev 5096 net/bluetooth/mgmt.c BT_DBG("request for %s", hdev->name); hdev 5098 net/bluetooth/mgmt.c if (!lmp_le_capable(hdev)) hdev 5099 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_LONG_TERM_KEYS, hdev 5104 net/bluetooth/mgmt.c bt_dev_err(hdev, "load_ltks: too big key_count value %u", hdev 5106 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_LONG_TERM_KEYS, hdev 5112 net/bluetooth/mgmt.c bt_dev_err(hdev, "load_keys: expected %u bytes, got %u bytes", hdev 5114 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_LONG_TERM_KEYS, hdev 5118 net/bluetooth/mgmt.c BT_DBG("%s key_count %u", hdev->name, key_count); hdev 5124 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, hdev 5129 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 5131 net/bluetooth/mgmt.c hci_smp_ltks_clear(hdev); hdev 5162 net/bluetooth/mgmt.c hci_add_ltk(hdev, &key->addr.bdaddr, hdev 5167 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_LOAD_LONG_TERM_KEYS, 0, hdev 5170 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 5202 net/bluetooth/mgmt.c static void conn_info_refresh_complete(struct hci_dev *hdev, u8 hci_status, hdev 5213 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 5224 net/bluetooth/mgmt.c cp = hci_sent_cmd_data(hdev, HCI_OP_READ_RSSI); hdev 5226 net/bluetooth/mgmt.c cp = hci_sent_cmd_data(hdev, HCI_OP_READ_TX_POWER); hdev 5233 net/bluetooth/mgmt.c bt_dev_err(hdev, "invalid sent_cmd in conn_info response"); hdev 5238 net/bluetooth/mgmt.c conn = hci_conn_hash_lookup_handle(hdev, handle); hdev 5240 net/bluetooth/mgmt.c bt_dev_err(hdev, "unknown handle (%d) in conn_info response", hdev 5245 net/bluetooth/mgmt.c cmd = pending_find_data(MGMT_OP_GET_CONN_INFO, hdev, conn); hdev 5253 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 5256 net/bluetooth/mgmt.c static int get_conn_info(struct sock *sk, struct hci_dev *hdev, void *data, hdev 5265 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 5272 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_GET_CONN_INFO, hdev 5276 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 5278 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 5279 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_GET_CONN_INFO, hdev 5286 net/bluetooth/mgmt.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, hdev 5289 net/bluetooth/mgmt.c conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->addr.bdaddr); hdev 5292 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_GET_CONN_INFO, hdev 5298 net/bluetooth/mgmt.c if (pending_find_data(MGMT_OP_GET_CONN_INFO, hdev, conn)) { hdev 5299 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_GET_CONN_INFO, hdev 5307 net/bluetooth/mgmt.c conn_info_age = hdev->conn_info_min_age + hdev 5308 net/bluetooth/mgmt.c prandom_u32_max(hdev->conn_info_max_age - hdev 5309 net/bluetooth/mgmt.c hdev->conn_info_min_age); hdev 5322 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 5350 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_GET_CONN_INFO, hdev, hdev 5368 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_GET_CONN_INFO, hdev 5373 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 5381 net/bluetooth/mgmt.c struct hci_dev *hdev; hdev 5390 net/bluetooth/mgmt.c hdev = hci_dev_get(cmd->index); hdev 5391 net/bluetooth/mgmt.c if (hdev) { hdev 5392 net/bluetooth/mgmt.c rp.local_clock = cpu_to_le32(hdev->clock); hdev 5393 net/bluetooth/mgmt.c hci_dev_put(hdev); hdev 5413 net/bluetooth/mgmt.c static void get_clock_info_complete(struct hci_dev *hdev, u8 status, u16 opcode) hdev 5419 net/bluetooth/mgmt.c BT_DBG("%s status %u", hdev->name, status); hdev 5421 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 5423 net/bluetooth/mgmt.c hci_cp = hci_sent_cmd_data(hdev, HCI_OP_READ_CLOCK); hdev 5429 net/bluetooth/mgmt.c conn = hci_conn_hash_lookup_handle(hdev, handle); hdev 5434 net/bluetooth/mgmt.c cmd = pending_find_data(MGMT_OP_GET_CLOCK_INFO, hdev, conn); hdev 5442 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 5445 net/bluetooth/mgmt.c static int get_clock_info(struct sock *sk, struct hci_dev *hdev, void *data, hdev 5456 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 5463 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_GET_CLOCK_INFO, hdev 5467 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 5469 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev)) { hdev 5470 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_GET_CLOCK_INFO, hdev 5477 net/bluetooth/mgmt.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, hdev 5480 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 5490 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_GET_CLOCK_INFO, hdev, data, len); hdev 5498 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 5517 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 5521 net/bluetooth/mgmt.c static bool is_connected(struct hci_dev *hdev, bdaddr_t *addr, u8 type) hdev 5525 net/bluetooth/mgmt.c conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, addr); hdev 5539 net/bluetooth/mgmt.c static int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, hdev 5544 net/bluetooth/mgmt.c params = hci_conn_params_add(hdev, addr, addr_type); hdev 5560 net/bluetooth/mgmt.c list_add(¶ms->action, &hdev->pend_le_conns); hdev 5564 net/bluetooth/mgmt.c list_add(¶ms->action, &hdev->pend_le_conns); hdev 5566 net/bluetooth/mgmt.c list_add(¶ms->action, &hdev->pend_le_reports); hdev 5570 net/bluetooth/mgmt.c if (!is_connected(hdev, addr, addr_type)) hdev 5571 net/bluetooth/mgmt.c list_add(¶ms->action, &hdev->pend_le_conns); hdev 5583 net/bluetooth/mgmt.c static void device_added(struct sock *sk, struct hci_dev *hdev, hdev 5592 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_DEVICE_ADDED, hdev, &ev, sizeof(ev), sk); hdev 5595 net/bluetooth/mgmt.c static int add_device(struct sock *sk, struct hci_dev *hdev, hdev 5602 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 5606 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_ADD_DEVICE, hdev 5611 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_ADD_DEVICE, hdev 5615 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 5620 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 5627 net/bluetooth/mgmt.c err = hci_bdaddr_list_add(&hdev->whitelist, &cp->addr.bdaddr, hdev 5632 net/bluetooth/mgmt.c hci_req_update_scan(hdev); hdev 5652 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_ADD_DEVICE, hdev 5661 net/bluetooth/mgmt.c if (hci_conn_params_set(hdev, &cp->addr.bdaddr, addr_type, hdev 5663 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_ADD_DEVICE, hdev 5669 net/bluetooth/mgmt.c hci_update_background_scan(hdev); hdev 5672 net/bluetooth/mgmt.c device_added(sk, hdev, &cp->addr.bdaddr, cp->addr.type, cp->action); hdev 5674 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_ADD_DEVICE, hdev 5679 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 5683 net/bluetooth/mgmt.c static void device_removed(struct sock *sk, struct hci_dev *hdev, hdev 5691 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_DEVICE_REMOVED, hdev, &ev, sizeof(ev), sk); hdev 5694 net/bluetooth/mgmt.c static int remove_device(struct sock *sk, struct hci_dev *hdev, hdev 5700 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 5702 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 5709 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 5717 net/bluetooth/mgmt.c err = hci_bdaddr_list_del(&hdev->whitelist, hdev 5721 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 5729 net/bluetooth/mgmt.c hci_req_update_scan(hdev); hdev 5731 net/bluetooth/mgmt.c device_removed(sk, hdev, &cp->addr.bdaddr, hdev 5744 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 5751 net/bluetooth/mgmt.c params = hci_conn_params_lookup(hdev, &cp->addr.bdaddr, hdev 5754 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 5763 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 5773 net/bluetooth/mgmt.c hci_update_background_scan(hdev); hdev 5775 net/bluetooth/mgmt.c device_removed(sk, hdev, &cp->addr.bdaddr, cp->addr.type); hdev 5781 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 5788 net/bluetooth/mgmt.c list_for_each_entry_safe(b, btmp, &hdev->whitelist, list) { hdev 5789 net/bluetooth/mgmt.c device_removed(sk, hdev, &b->bdaddr, b->bdaddr_type); hdev 5794 net/bluetooth/mgmt.c hci_req_update_scan(hdev); hdev 5796 net/bluetooth/mgmt.c list_for_each_entry_safe(p, tmp, &hdev->le_conn_params, list) { hdev 5799 net/bluetooth/mgmt.c device_removed(sk, hdev, &p->addr, p->addr_type); hdev 5811 net/bluetooth/mgmt.c hci_update_background_scan(hdev); hdev 5815 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_REMOVE_DEVICE, hdev 5819 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 5823 net/bluetooth/mgmt.c static int load_conn_param(struct sock *sk, struct hci_dev *hdev, void *data, hdev 5832 net/bluetooth/mgmt.c if (!lmp_le_capable(hdev)) hdev 5833 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM, hdev 5838 net/bluetooth/mgmt.c bt_dev_err(hdev, "load_conn_param: too big param_count value %u", hdev 5840 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM, hdev 5846 net/bluetooth/mgmt.c bt_dev_err(hdev, "load_conn_param: expected %u bytes, got %u bytes", hdev 5848 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM, hdev 5852 net/bluetooth/mgmt.c BT_DBG("%s param_count %u", hdev->name, param_count); hdev 5854 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 5856 net/bluetooth/mgmt.c hci_conn_params_clear_disabled(hdev); hdev 5872 net/bluetooth/mgmt.c bt_dev_err(hdev, "ignoring invalid connection parameters"); hdev 5885 net/bluetooth/mgmt.c bt_dev_err(hdev, "ignoring invalid connection parameters"); hdev 5889 net/bluetooth/mgmt.c hci_param = hci_conn_params_add(hdev, ¶m->addr.bdaddr, hdev 5892 net/bluetooth/mgmt.c bt_dev_err(hdev, "failed to add connection parameters"); hdev 5902 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 5904 net/bluetooth/mgmt.c return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM, 0, hdev 5908 net/bluetooth/mgmt.c static int set_external_config(struct sock *sk, struct hci_dev *hdev, hdev 5915 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 5917 net/bluetooth/mgmt.c if (hdev_is_powered(hdev)) hdev 5918 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_EXTERNAL_CONFIG, hdev 5922 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_EXTERNAL_CONFIG, hdev 5925 net/bluetooth/mgmt.c if (!test_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks)) hdev 5926 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_EXTERNAL_CONFIG, hdev 5929 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 5932 net/bluetooth/mgmt.c changed = !hci_dev_test_and_set_flag(hdev, HCI_EXT_CONFIGURED); hdev 5934 net/bluetooth/mgmt.c changed = hci_dev_test_and_clear_flag(hdev, HCI_EXT_CONFIGURED); hdev 5936 net/bluetooth/mgmt.c err = send_options_rsp(sk, MGMT_OP_SET_EXTERNAL_CONFIG, hdev); hdev 5943 net/bluetooth/mgmt.c err = new_options(hdev, sk); hdev 5945 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED) == is_configured(hdev)) { hdev 5946 net/bluetooth/mgmt.c mgmt_index_removed(hdev); hdev 5948 net/bluetooth/mgmt.c if (hci_dev_test_and_change_flag(hdev, HCI_UNCONFIGURED)) { hdev 5949 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_CONFIG); hdev 5950 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_AUTO_OFF); hdev 5952 net/bluetooth/mgmt.c queue_work(hdev->req_workqueue, &hdev->power_on); hdev 5954 net/bluetooth/mgmt.c set_bit(HCI_RAW, &hdev->flags); hdev 5955 net/bluetooth/mgmt.c mgmt_index_added(hdev); hdev 5960 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 5964 net/bluetooth/mgmt.c static int set_public_address(struct sock *sk, struct hci_dev *hdev, hdev 5971 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 5973 net/bluetooth/mgmt.c if (hdev_is_powered(hdev)) hdev 5974 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_PUBLIC_ADDRESS, hdev 5978 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_PUBLIC_ADDRESS, hdev 5981 net/bluetooth/mgmt.c if (!hdev->set_bdaddr) hdev 5982 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_PUBLIC_ADDRESS, hdev 5985 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 5987 net/bluetooth/mgmt.c changed = !!bacmp(&hdev->public_addr, &cp->bdaddr); hdev 5988 net/bluetooth/mgmt.c bacpy(&hdev->public_addr, &cp->bdaddr); hdev 5990 net/bluetooth/mgmt.c err = send_options_rsp(sk, MGMT_OP_SET_PUBLIC_ADDRESS, hdev); hdev 5997 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) hdev 5998 net/bluetooth/mgmt.c err = new_options(hdev, sk); hdev 6000 net/bluetooth/mgmt.c if (is_configured(hdev)) { hdev 6001 net/bluetooth/mgmt.c mgmt_index_removed(hdev); hdev 6003 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_UNCONFIGURED); hdev 6005 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_CONFIG); hdev 6006 net/bluetooth/mgmt.c hci_dev_set_flag(hdev, HCI_AUTO_OFF); hdev 6008 net/bluetooth/mgmt.c queue_work(hdev->req_workqueue, &hdev->power_on); hdev 6012 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 6016 net/bluetooth/mgmt.c static void read_local_oob_ext_data_complete(struct hci_dev *hdev, u8 status, hdev 6026 net/bluetooth/mgmt.c BT_DBG("%s status %u", hdev->name, status); hdev 6028 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_READ_LOCAL_OOB_EXT_DATA, hdev); hdev 6068 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_SC_ONLY)) { hdev 6091 net/bluetooth/mgmt.c hdev->dev_class, 3); hdev 6111 net/bluetooth/mgmt.c err = mgmt_cmd_complete(cmd->sk, hdev->id, hdev 6119 net/bluetooth/mgmt.c err = mgmt_limited_event(MGMT_EV_LOCAL_OOB_DATA_UPDATED, hdev, hdev 6127 net/bluetooth/mgmt.c static int read_local_ssp_oob_req(struct hci_dev *hdev, struct sock *sk, hdev 6134 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_READ_LOCAL_OOB_EXT_DATA, hdev, hdev 6139 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 6141 net/bluetooth/mgmt.c if (bredr_sc_enabled(hdev)) hdev 6155 net/bluetooth/mgmt.c static int read_local_oob_ext_data(struct sock *sk, struct hci_dev *hdev, hdev 6165 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 6167 net/bluetooth/mgmt.c if (hdev_is_powered(hdev)) { hdev 6170 net/bluetooth/mgmt.c status = mgmt_bredr_support(hdev); hdev 6177 net/bluetooth/mgmt.c status = mgmt_le_support(hdev); hdev 6201 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 6206 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_SSP_ENABLED)) { hdev 6207 net/bluetooth/mgmt.c err = read_local_ssp_oob_req(hdev, sk, cp); hdev 6208 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 6217 net/bluetooth/mgmt.c hdev->dev_class, 3); hdev 6221 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_SC_ENABLED) && hdev 6222 net/bluetooth/mgmt.c smp_generate_oob(hdev, hash, rand) < 0) { hdev 6223 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 6238 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_PRIVACY)) { hdev 6239 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 6244 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR) || hdev 6245 net/bluetooth/mgmt.c !bacmp(&hdev->bdaddr, BDADDR_ANY) || hdev 6246 net/bluetooth/mgmt.c (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED) && hdev 6247 net/bluetooth/mgmt.c bacmp(&hdev->static_addr, BDADDR_ANY))) { hdev 6248 net/bluetooth/mgmt.c memcpy(addr, &hdev->static_addr, 6); hdev 6251 net/bluetooth/mgmt.c memcpy(addr, &hdev->bdaddr, 6); hdev 6258 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_ADVERTISING)) hdev 6266 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_SC_ENABLED)) { hdev 6276 net/bluetooth/mgmt.c flags = mgmt_get_adv_discov_flags(hdev); hdev 6278 net/bluetooth/mgmt.c if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED)) hdev 6286 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 6296 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_READ_LOCAL_OOB_EXT_DATA, hdev 6301 net/bluetooth/mgmt.c err = mgmt_limited_event(MGMT_EV_LOCAL_OOB_DATA_UPDATED, hdev, hdev 6311 net/bluetooth/mgmt.c static u32 get_supported_adv_flags(struct hci_dev *hdev) hdev 6325 net/bluetooth/mgmt.c if ((hdev->adv_tx_power != HCI_TX_POWER_INVALID) || hdev 6326 net/bluetooth/mgmt.c ext_adv_capable(hdev)) hdev 6329 net/bluetooth/mgmt.c if (ext_adv_capable(hdev)) { hdev 6332 net/bluetooth/mgmt.c if (hdev->le_features[1] & HCI_LE_PHY_2M) hdev 6335 net/bluetooth/mgmt.c if (hdev->le_features[1] & HCI_LE_PHY_CODED) hdev 6342 net/bluetooth/mgmt.c static int read_adv_features(struct sock *sk, struct hci_dev *hdev, hdev 6352 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 6354 net/bluetooth/mgmt.c if (!lmp_le_capable(hdev)) hdev 6355 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_READ_ADV_FEATURES, hdev 6358 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 6360 net/bluetooth/mgmt.c rp_len = sizeof(*rp) + hdev->adv_instance_cnt; hdev 6363 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 6367 net/bluetooth/mgmt.c supported_flags = get_supported_adv_flags(hdev); hdev 6373 net/bluetooth/mgmt.c rp->num_instances = hdev->adv_instance_cnt; hdev 6376 net/bluetooth/mgmt.c list_for_each_entry(adv_instance, &hdev->adv_instances, list) { hdev 6381 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 6383 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_READ_ADV_FEATURES, hdev 6391 net/bluetooth/mgmt.c static u8 calculate_name_len(struct hci_dev *hdev) hdev 6395 net/bluetooth/mgmt.c return append_local_name(hdev, buf, 0); hdev 6398 net/bluetooth/mgmt.c static u8 tlv_data_max_len(struct hci_dev *hdev, u32 adv_flags, hdev 6413 net/bluetooth/mgmt.c max_len -= calculate_name_len(hdev); hdev 6444 net/bluetooth/mgmt.c static bool tlv_data_is_valid(struct hci_dev *hdev, u32 adv_flags, u8 *data, hdev 6450 net/bluetooth/mgmt.c max_len = tlv_data_max_len(hdev, adv_flags, is_adv_data); hdev 6486 net/bluetooth/mgmt.c static void add_advertising_complete(struct hci_dev *hdev, u8 status, hdev 6497 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 6499 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_ADD_ADVERTISING, hdev); hdev 6501 net/bluetooth/mgmt.c list_for_each_entry_safe(adv_instance, n, &hdev->adv_instances, list) { hdev 6512 net/bluetooth/mgmt.c if (hdev->cur_adv_instance == instance) hdev 6513 net/bluetooth/mgmt.c cancel_adv_timeout(hdev); hdev 6515 net/bluetooth/mgmt.c hci_remove_adv_instance(hdev, instance); hdev 6516 net/bluetooth/mgmt.c mgmt_advertising_removed(cmd ? cmd->sk : NULL, hdev, instance); hdev 6535 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 6538 net/bluetooth/mgmt.c static int add_advertising(struct sock *sk, struct hci_dev *hdev, hdev 6547 net/bluetooth/mgmt.c unsigned int prev_instance_cnt = hdev->adv_instance_cnt; hdev 6554 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 6556 net/bluetooth/mgmt.c status = mgmt_le_support(hdev); hdev 6558 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING, hdev 6562 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING, hdev 6566 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING, hdev 6576 net/bluetooth/mgmt.c supported_flags = get_supported_adv_flags(hdev); hdev 6580 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING, hdev 6583 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 6585 net/bluetooth/mgmt.c if (timeout && !hdev_is_powered(hdev)) { hdev 6586 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING, hdev 6591 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_ADD_ADVERTISING, hdev) || hdev 6592 net/bluetooth/mgmt.c pending_find(MGMT_OP_REMOVE_ADVERTISING, hdev) || hdev 6593 net/bluetooth/mgmt.c pending_find(MGMT_OP_SET_LE, hdev)) { hdev 6594 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING, hdev 6599 net/bluetooth/mgmt.c if (!tlv_data_is_valid(hdev, flags, cp->data, cp->adv_data_len, true) || hdev 6600 net/bluetooth/mgmt.c !tlv_data_is_valid(hdev, flags, cp->data + cp->adv_data_len, hdev 6602 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING, hdev 6607 net/bluetooth/mgmt.c err = hci_add_adv_instance(hdev, cp->instance, flags, hdev 6613 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING, hdev 6621 net/bluetooth/mgmt.c if (hdev->adv_instance_cnt > prev_instance_cnt) hdev 6622 net/bluetooth/mgmt.c mgmt_advertising_added(sk, hdev, cp->instance); hdev 6624 net/bluetooth/mgmt.c if (hdev->cur_adv_instance == cp->instance) { hdev 6630 net/bluetooth/mgmt.c cancel_adv_timeout(hdev); hdev 6632 net/bluetooth/mgmt.c next_instance = hci_get_next_instance(hdev, cp->instance); hdev 6635 net/bluetooth/mgmt.c } else if (!hdev->adv_instance_timeout) { hdev 6646 net/bluetooth/mgmt.c if (!hdev_is_powered(hdev) || hdev 6647 net/bluetooth/mgmt.c hci_dev_test_flag(hdev, HCI_ADVERTISING) || hdev 6650 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_ADD_ADVERTISING, hdev 6658 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_ADD_ADVERTISING, hdev, data, hdev 6665 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 6676 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 6681 net/bluetooth/mgmt.c static void remove_advertising_complete(struct hci_dev *hdev, u8 status, hdev 6690 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 6696 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_REMOVE_ADVERTISING, hdev); hdev 6708 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 6711 net/bluetooth/mgmt.c static int remove_advertising(struct sock *sk, struct hci_dev *hdev, hdev 6720 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 6722 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 6724 net/bluetooth/mgmt.c if (cp->instance && !hci_find_adv_instance(hdev, cp->instance)) { hdev 6725 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, hdev 6731 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_ADD_ADVERTISING, hdev) || hdev 6732 net/bluetooth/mgmt.c pending_find(MGMT_OP_REMOVE_ADVERTISING, hdev) || hdev 6733 net/bluetooth/mgmt.c pending_find(MGMT_OP_SET_LE, hdev)) { hdev 6734 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_REMOVE_ADVERTISING, hdev 6739 net/bluetooth/mgmt.c if (list_empty(&hdev->adv_instances)) { hdev 6740 net/bluetooth/mgmt.c err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_REMOVE_ADVERTISING, hdev 6745 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 6747 net/bluetooth/mgmt.c hci_req_clear_adv_instance(hdev, sk, &req, cp->instance, true); hdev 6749 net/bluetooth/mgmt.c if (list_empty(&hdev->adv_instances)) hdev 6757 net/bluetooth/mgmt.c !hdev_is_powered(hdev) || hdev 6758 net/bluetooth/mgmt.c hci_dev_test_flag(hdev, HCI_ADVERTISING)) { hdev 6761 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, hdev 6767 net/bluetooth/mgmt.c cmd = mgmt_pending_add(sk, MGMT_OP_REMOVE_ADVERTISING, hdev, data, hdev 6779 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 6784 net/bluetooth/mgmt.c static int get_adv_size_info(struct sock *sk, struct hci_dev *hdev, hdev 6792 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 6794 net/bluetooth/mgmt.c if (!lmp_le_capable(hdev)) hdev 6795 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_GET_ADV_SIZE_INFO, hdev 6799 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_GET_ADV_SIZE_INFO, hdev 6807 net/bluetooth/mgmt.c supported_flags = get_supported_adv_flags(hdev); hdev 6809 net/bluetooth/mgmt.c return mgmt_cmd_status(sk, hdev->id, MGMT_OP_GET_ADV_SIZE_INFO, hdev 6814 net/bluetooth/mgmt.c rp.max_adv_data_len = tlv_data_max_len(hdev, flags, true); hdev 6815 net/bluetooth/mgmt.c rp.max_scan_rsp_len = tlv_data_max_len(hdev, flags, false); hdev 6817 net/bluetooth/mgmt.c err = mgmt_cmd_complete(sk, hdev->id, MGMT_OP_GET_ADV_SIZE_INFO, hdev 6919 net/bluetooth/mgmt.c void mgmt_index_added(struct hci_dev *hdev) hdev 6923 net/bluetooth/mgmt.c if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks)) hdev 6926 net/bluetooth/mgmt.c switch (hdev->dev_type) { hdev 6928 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) { hdev 6929 net/bluetooth/mgmt.c mgmt_index_event(MGMT_EV_UNCONF_INDEX_ADDED, hdev, hdev 6933 net/bluetooth/mgmt.c mgmt_index_event(MGMT_EV_INDEX_ADDED, hdev, NULL, 0, hdev 6945 net/bluetooth/mgmt.c ev.bus = hdev->bus; hdev 6947 net/bluetooth/mgmt.c mgmt_index_event(MGMT_EV_EXT_INDEX_ADDED, hdev, &ev, sizeof(ev), hdev 6951 net/bluetooth/mgmt.c void mgmt_index_removed(struct hci_dev *hdev) hdev 6956 net/bluetooth/mgmt.c if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks)) hdev 6959 net/bluetooth/mgmt.c switch (hdev->dev_type) { hdev 6961 net/bluetooth/mgmt.c mgmt_pending_foreach(0, hdev, cmd_complete_rsp, &status); hdev 6963 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED)) { hdev 6964 net/bluetooth/mgmt.c mgmt_index_event(MGMT_EV_UNCONF_INDEX_REMOVED, hdev, hdev 6968 net/bluetooth/mgmt.c mgmt_index_event(MGMT_EV_INDEX_REMOVED, hdev, NULL, 0, hdev 6980 net/bluetooth/mgmt.c ev.bus = hdev->bus; hdev 6982 net/bluetooth/mgmt.c mgmt_index_event(MGMT_EV_EXT_INDEX_REMOVED, hdev, &ev, sizeof(ev), hdev 6987 net/bluetooth/mgmt.c static void restart_le_actions(struct hci_dev *hdev) hdev 6991 net/bluetooth/mgmt.c list_for_each_entry(p, &hdev->le_conn_params, list) { hdev 7000 net/bluetooth/mgmt.c list_add(&p->action, &hdev->pend_le_conns); hdev 7003 net/bluetooth/mgmt.c list_add(&p->action, &hdev->pend_le_reports); hdev 7011 net/bluetooth/mgmt.c void mgmt_power_on(struct hci_dev *hdev, int err) hdev 7013 net/bluetooth/mgmt.c struct cmd_lookup match = { NULL, hdev }; hdev 7017 net/bluetooth/mgmt.c hci_dev_lock(hdev); hdev 7020 net/bluetooth/mgmt.c restart_le_actions(hdev); hdev 7021 net/bluetooth/mgmt.c hci_update_background_scan(hdev); hdev 7024 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_SET_POWERED, hdev, settings_rsp, &match); hdev 7026 net/bluetooth/mgmt.c new_settings(hdev, match.sk); hdev 7031 net/bluetooth/mgmt.c hci_dev_unlock(hdev); hdev 7034 net/bluetooth/mgmt.c void __mgmt_power_off(struct hci_dev *hdev) hdev 7036 net/bluetooth/mgmt.c struct cmd_lookup match = { NULL, hdev }; hdev 7039 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_SET_POWERED, hdev, settings_rsp, &match); hdev 7048 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_UNREGISTER)) hdev 7053 net/bluetooth/mgmt.c mgmt_pending_foreach(0, hdev, cmd_complete_rsp, &status); hdev 7055 net/bluetooth/mgmt.c if (memcmp(hdev->dev_class, zero_cod, sizeof(zero_cod)) != 0) { hdev 7056 net/bluetooth/mgmt.c mgmt_limited_event(MGMT_EV_CLASS_OF_DEV_CHANGED, hdev, hdev 7059 net/bluetooth/mgmt.c ext_info_changed(hdev, NULL); hdev 7062 net/bluetooth/mgmt.c new_settings(hdev, match.sk); hdev 7068 net/bluetooth/mgmt.c void mgmt_set_powered_failed(struct hci_dev *hdev, int err) hdev 7073 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_SET_POWERED, hdev); hdev 7082 net/bluetooth/mgmt.c mgmt_cmd_status(cmd->sk, hdev->id, MGMT_OP_SET_POWERED, status); hdev 7087 net/bluetooth/mgmt.c void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, hdev 7101 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_NEW_LINK_KEY, hdev, &ev, sizeof(ev), NULL); hdev 7123 net/bluetooth/mgmt.c void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent) hdev 7163 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_NEW_LONG_TERM_KEY, hdev, &ev, sizeof(ev), NULL); hdev 7166 net/bluetooth/mgmt.c void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk, bool persistent) hdev 7179 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_NEW_IRK, hdev, &ev, sizeof(ev), NULL); hdev 7182 net/bluetooth/mgmt.c void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk, hdev 7209 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_NEW_CSRK, hdev, &ev, sizeof(ev), NULL); hdev 7212 net/bluetooth/mgmt.c void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 7230 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_NEW_CONN_PARAM, hdev, &ev, sizeof(ev), NULL); hdev 7233 net/bluetooth/mgmt.c void mgmt_device_connected(struct hci_dev *hdev, struct hci_conn *conn, hdev 7266 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_DEVICE_CONNECTED, hdev, buf, hdev 7284 net/bluetooth/mgmt.c struct hci_dev *hdev = data; hdev 7287 net/bluetooth/mgmt.c device_unpaired(hdev, &cp->addr.bdaddr, cp->addr.type, cmd->sk); hdev 7293 net/bluetooth/mgmt.c bool mgmt_powering_down(struct hci_dev *hdev) hdev 7298 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_SET_POWERED, hdev); hdev 7309 net/bluetooth/mgmt.c void mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 7319 net/bluetooth/mgmt.c if (mgmt_powering_down(hdev) && hci_conn_count(hdev) == 1) { hdev 7320 net/bluetooth/mgmt.c cancel_delayed_work(&hdev->power_off); hdev 7321 net/bluetooth/mgmt.c queue_work(hdev->req_workqueue, &hdev->power_off.work); hdev 7330 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_DISCONNECT, hdev, disconnect_rsp, &sk); hdev 7336 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_DEVICE_DISCONNECTED, hdev, &ev, sizeof(ev), sk); hdev 7341 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_UNPAIR_DEVICE, hdev, unpair_device_rsp, hdev 7342 net/bluetooth/mgmt.c hdev); hdev 7345 net/bluetooth/mgmt.c void mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 7352 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_UNPAIR_DEVICE, hdev, unpair_device_rsp, hdev 7353 net/bluetooth/mgmt.c hdev); hdev 7355 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_DISCONNECT, hdev); hdev 7371 net/bluetooth/mgmt.c void mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, hdev 7379 net/bluetooth/mgmt.c if (mgmt_powering_down(hdev) && hci_conn_count(hdev) == 1) { hdev 7380 net/bluetooth/mgmt.c cancel_delayed_work(&hdev->power_off); hdev 7381 net/bluetooth/mgmt.c queue_work(hdev->req_workqueue, &hdev->power_off.work); hdev 7388 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_CONNECT_FAILED, hdev, &ev, sizeof(ev), NULL); hdev 7391 net/bluetooth/mgmt.c void mgmt_pin_code_request(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 secure) hdev 7399 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_PIN_CODE_REQUEST, hdev, &ev, sizeof(ev), NULL); hdev 7402 net/bluetooth/mgmt.c void mgmt_pin_code_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 7407 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_PIN_CODE_REPLY, hdev); hdev 7415 net/bluetooth/mgmt.c void mgmt_pin_code_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 7420 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_PIN_CODE_NEG_REPLY, hdev); hdev 7428 net/bluetooth/mgmt.c int mgmt_user_confirm_request(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 7434 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 7441 net/bluetooth/mgmt.c return mgmt_event(MGMT_EV_USER_CONFIRM_REQUEST, hdev, &ev, sizeof(ev), hdev 7445 net/bluetooth/mgmt.c int mgmt_user_passkey_request(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 7450 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 7455 net/bluetooth/mgmt.c return mgmt_event(MGMT_EV_USER_PASSKEY_REQUEST, hdev, &ev, sizeof(ev), hdev 7459 net/bluetooth/mgmt.c static int user_pairing_resp_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 7465 net/bluetooth/mgmt.c cmd = pending_find(opcode, hdev); hdev 7475 net/bluetooth/mgmt.c int mgmt_user_confirm_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 7478 net/bluetooth/mgmt.c return user_pairing_resp_complete(hdev, bdaddr, link_type, addr_type, hdev 7482 net/bluetooth/mgmt.c int mgmt_user_confirm_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 7485 net/bluetooth/mgmt.c return user_pairing_resp_complete(hdev, bdaddr, link_type, addr_type, hdev 7490 net/bluetooth/mgmt.c int mgmt_user_passkey_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 7493 net/bluetooth/mgmt.c return user_pairing_resp_complete(hdev, bdaddr, link_type, addr_type, hdev 7497 net/bluetooth/mgmt.c int mgmt_user_passkey_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 7500 net/bluetooth/mgmt.c return user_pairing_resp_complete(hdev, bdaddr, link_type, addr_type, hdev 7505 net/bluetooth/mgmt.c int mgmt_user_passkey_notify(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 7511 net/bluetooth/mgmt.c BT_DBG("%s", hdev->name); hdev 7518 net/bluetooth/mgmt.c return mgmt_event(MGMT_EV_PASSKEY_NOTIFY, hdev, &ev, sizeof(ev), NULL); hdev 7533 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_AUTH_FAILED, conn->hdev, &ev, sizeof(ev), hdev 7542 net/bluetooth/mgmt.c void mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status) hdev 7544 net/bluetooth/mgmt.c struct cmd_lookup match = { NULL, hdev }; hdev 7549 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_SET_LINK_SECURITY, hdev, hdev 7554 net/bluetooth/mgmt.c if (test_bit(HCI_AUTH, &hdev->flags)) hdev 7555 net/bluetooth/mgmt.c changed = !hci_dev_test_and_set_flag(hdev, HCI_LINK_SECURITY); hdev 7557 net/bluetooth/mgmt.c changed = hci_dev_test_and_clear_flag(hdev, HCI_LINK_SECURITY); hdev 7559 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_SET_LINK_SECURITY, hdev, settings_rsp, hdev 7563 net/bluetooth/mgmt.c new_settings(hdev, match.sk); hdev 7571 net/bluetooth/mgmt.c struct hci_dev *hdev = req->hdev; hdev 7574 net/bluetooth/mgmt.c if (!lmp_ext_inq_capable(hdev)) hdev 7577 net/bluetooth/mgmt.c memset(hdev->eir, 0, sizeof(hdev->eir)); hdev 7584 net/bluetooth/mgmt.c void mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status) hdev 7586 net/bluetooth/mgmt.c struct cmd_lookup match = { NULL, hdev }; hdev 7593 net/bluetooth/mgmt.c if (enable && hci_dev_test_and_clear_flag(hdev, hdev 7595 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_HS_ENABLED); hdev 7596 net/bluetooth/mgmt.c new_settings(hdev, NULL); hdev 7599 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_SET_SSP, hdev, cmd_status_rsp, hdev 7605 net/bluetooth/mgmt.c changed = !hci_dev_test_and_set_flag(hdev, HCI_SSP_ENABLED); hdev 7607 net/bluetooth/mgmt.c changed = hci_dev_test_and_clear_flag(hdev, HCI_SSP_ENABLED); hdev 7609 net/bluetooth/mgmt.c changed = hci_dev_test_and_clear_flag(hdev, hdev 7612 net/bluetooth/mgmt.c hci_dev_clear_flag(hdev, HCI_HS_ENABLED); hdev 7615 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_SET_SSP, hdev, settings_rsp, &match); hdev 7618 net/bluetooth/mgmt.c new_settings(hdev, match.sk); hdev 7623 net/bluetooth/mgmt.c hci_req_init(&req, hdev); hdev 7625 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_SSP_ENABLED)) { hdev 7626 net/bluetooth/mgmt.c if (hci_dev_test_flag(hdev, HCI_USE_DEBUG_KEYS)) hdev 7647 net/bluetooth/mgmt.c void mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class, hdev 7650 net/bluetooth/mgmt.c struct cmd_lookup match = { NULL, hdev, mgmt_status(status) }; hdev 7652 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_SET_DEV_CLASS, hdev, sk_lookup, &match); hdev 7653 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_ADD_UUID, hdev, sk_lookup, &match); hdev 7654 net/bluetooth/mgmt.c mgmt_pending_foreach(MGMT_OP_REMOVE_UUID, hdev, sk_lookup, &match); hdev 7657 net/bluetooth/mgmt.c mgmt_limited_event(MGMT_EV_CLASS_OF_DEV_CHANGED, hdev, dev_class, hdev 7659 net/bluetooth/mgmt.c ext_info_changed(hdev, NULL); hdev 7666 net/bluetooth/mgmt.c void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status) hdev 7676 net/bluetooth/mgmt.c memcpy(ev.short_name, hdev->short_name, HCI_MAX_SHORT_NAME_LENGTH); hdev 7678 net/bluetooth/mgmt.c cmd = pending_find(MGMT_OP_SET_LOCAL_NAME, hdev); hdev 7680 net/bluetooth/mgmt.c memcpy(hdev->dev_name, name, sizeof(hdev->dev_name)); hdev 7685 net/bluetooth/mgmt.c if (pending_find(MGMT_OP_SET_POWERED, hdev)) hdev 7689 net/bluetooth/mgmt.c mgmt_limited_event(MGMT_EV_LOCAL_NAME_CHANGED, hdev, &ev, sizeof(ev), hdev 7691 net/bluetooth/mgmt.c ext_info_changed(hdev, cmd ? cmd->sk : NULL); hdev 7761 net/bluetooth/mgmt.c static void restart_le_scan(struct hci_dev *hdev) hdev 7764 net/bluetooth/mgmt.c if (!hci_dev_test_flag(hdev, HCI_LE_SCAN)) hdev 7768 net/bluetooth/mgmt.c hdev->discovery.scan_start + hdev 7769 net/bluetooth/mgmt.c hdev->discovery.scan_duration)) hdev 7772 net/bluetooth/mgmt.c queue_delayed_work(hdev->req_workqueue, &hdev->le_scan_restart, hdev 7776 net/bluetooth/mgmt.c static bool is_filter_match(struct hci_dev *hdev, s8 rssi, u8 *eir, hdev 7788 net/bluetooth/mgmt.c if (hdev->discovery.rssi != HCI_RSSI_INVALID && hdev 7790 net/bluetooth/mgmt.c (rssi < hdev->discovery.rssi && hdev 7791 net/bluetooth/mgmt.c !test_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks)))) hdev 7794 net/bluetooth/mgmt.c if (hdev->discovery.uuid_count != 0) { hdev 7798 net/bluetooth/mgmt.c if (!eir_has_uuids(eir, eir_len, hdev->discovery.uuid_count, hdev 7799 net/bluetooth/mgmt.c hdev->discovery.uuids) && hdev 7801 net/bluetooth/mgmt.c hdev->discovery.uuid_count, hdev 7802 net/bluetooth/mgmt.c hdev->discovery.uuids)) hdev 7809 net/bluetooth/mgmt.c if (test_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks)) { hdev 7810 net/bluetooth/mgmt.c restart_le_scan(hdev); hdev 7813 net/bluetooth/mgmt.c if (hdev->discovery.rssi != HCI_RSSI_INVALID && hdev 7814 net/bluetooth/mgmt.c rssi < hdev->discovery.rssi) hdev 7821 net/bluetooth/mgmt.c void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, hdev 7833 net/bluetooth/mgmt.c if (!hci_discovery_active(hdev)) { hdev 7836 net/bluetooth/mgmt.c if (link_type == LE_LINK && list_empty(&hdev->pend_le_reports)) hdev 7840 net/bluetooth/mgmt.c if (hdev->discovery.result_filtering) { hdev 7842 net/bluetooth/mgmt.c if (!is_filter_match(hdev, rssi, eir, eir_len, scan_rsp, hdev 7847 net/bluetooth/mgmt.c if (hdev->discovery.limited) { hdev 7875 net/bluetooth/mgmt.c if (rssi == HCI_RSSI_INVALID && !hdev->discovery.report_invalid_rssi && hdev 7900 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_DEVICE_FOUND, hdev, ev, ev_size, NULL); hdev 7903 net/bluetooth/mgmt.c void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, hdev 7923 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_DEVICE_FOUND, hdev, ev, sizeof(*ev) + eir_len, NULL); hdev 7926 net/bluetooth/mgmt.c void mgmt_discovering(struct hci_dev *hdev, u8 discovering) hdev 7930 net/bluetooth/mgmt.c BT_DBG("%s discovering %u", hdev->name, discovering); hdev 7933 net/bluetooth/mgmt.c ev.type = hdev->discovery.type; hdev 7936 net/bluetooth/mgmt.c mgmt_event(MGMT_EV_DISCOVERING, hdev, &ev, sizeof(ev), NULL); hdev 59 net/bluetooth/mgmt_util.c int mgmt_send_event(u16 event, struct hci_dev *hdev, unsigned short channel, hdev 71 net/bluetooth/mgmt_util.c if (hdev) hdev 72 net/bluetooth/mgmt_util.c hdr->index = cpu_to_le16(hdev->id); hdev 86 net/bluetooth/mgmt_util.c hci_send_monitor_ctrl_event(hdev, event, data, data_len, hdev 185 net/bluetooth/mgmt_util.c struct hci_dev *hdev) hdev 189 net/bluetooth/mgmt_util.c list_for_each_entry(cmd, &hdev->mgmt_pending, list) { hdev 201 net/bluetooth/mgmt_util.c struct hci_dev *hdev, hdev 206 net/bluetooth/mgmt_util.c list_for_each_entry(cmd, &hdev->mgmt_pending, list) { hdev 216 net/bluetooth/mgmt_util.c void mgmt_pending_foreach(u16 opcode, struct hci_dev *hdev, hdev 222 net/bluetooth/mgmt_util.c list_for_each_entry_safe(cmd, tmp, &hdev->mgmt_pending, list) { hdev 231 net/bluetooth/mgmt_util.c struct hci_dev *hdev, hdev 241 net/bluetooth/mgmt_util.c cmd->index = hdev->id; hdev 254 net/bluetooth/mgmt_util.c list_add(&cmd->list, &hdev->mgmt_pending); hdev 34 net/bluetooth/mgmt_util.h int mgmt_send_event(u16 event, struct hci_dev *hdev, unsigned short channel, hdev 41 net/bluetooth/mgmt_util.h struct hci_dev *hdev); hdev 44 net/bluetooth/mgmt_util.h struct hci_dev *hdev, hdev 46 net/bluetooth/mgmt_util.h void mgmt_pending_foreach(u16 opcode, struct hci_dev *hdev, hdev 50 net/bluetooth/mgmt_util.h struct hci_dev *hdev, hdev 2106 net/bluetooth/rfcomm/core.c s = rfcomm_session_get(&conn->hdev->bdaddr, &conn->dst); hdev 178 net/bluetooth/rfcomm/tty.c struct hci_dev *hdev; hdev 181 net/bluetooth/rfcomm/tty.c hdev = hci_get_route(&dev->dst, &dev->src, BDADDR_BREDR); hdev 182 net/bluetooth/rfcomm/tty.c if (!hdev) hdev 188 net/bluetooth/rfcomm/tty.c hci_dev_lock(hdev); hdev 189 net/bluetooth/rfcomm/tty.c conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &dev->dst); hdev 197 net/bluetooth/rfcomm/tty.c hci_dev_unlock(hdev); hdev 198 net/bluetooth/rfcomm/tty.c hci_dev_put(hdev); hdev 106 net/bluetooth/sco.c struct hci_dev *hdev = hcon->hdev; hdev 121 net/bluetooth/sco.c if (hdev->sco_mtu > 0) hdev 122 net/bluetooth/sco.c conn->mtu = hdev->sco_mtu; hdev 218 net/bluetooth/sco.c struct hci_dev *hdev; hdev 223 net/bluetooth/sco.c hdev = hci_get_route(&sco_pi(sk)->dst, &sco_pi(sk)->src, BDADDR_BREDR); hdev 224 net/bluetooth/sco.c if (!hdev) hdev 227 net/bluetooth/sco.c hci_dev_lock(hdev); hdev 229 net/bluetooth/sco.c if (lmp_esco_capable(hdev) && !disable_esco) hdev 235 net/bluetooth/sco.c (!lmp_transp_capable(hdev) || !lmp_esco_capable(hdev))) { hdev 240 net/bluetooth/sco.c hcon = hci_connect_sco(hdev, type, &sco_pi(sk)->dst, hdev 270 net/bluetooth/sco.c hci_dev_unlock(hdev); hdev 271 net/bluetooth/sco.c hci_dev_put(hdev); hdev 729 net/bluetooth/sco.c struct hci_dev *hdev = conn->hdev; hdev 735 net/bluetooth/sco.c if (!lmp_esco_capable(hdev)) { hdev 741 net/bluetooth/sco.c hci_send_cmd(hdev, HCI_OP_ACCEPT_CONN_REQ, sizeof(cp), &cp); hdev 766 net/bluetooth/sco.c hci_send_cmd(hdev, HCI_OP_ACCEPT_SYNC_CONN_REQ, hdev 1082 net/bluetooth/sco.c int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags) hdev 1087 net/bluetooth/sco.c BT_DBG("hdev %s, bdaddr %pMR", hdev->name, bdaddr); hdev 1095 net/bluetooth/sco.c if (!bacmp(&sco_pi(sk)->src, &hdev->bdaddr) || hdev 40 net/bluetooth/smp.c #define SMP_DEV(hdev) \ hdev 41 net/bluetooth/smp.c ((struct smp_dev *)((struct l2cap_chan *)((hdev)->smp_data))->data) hdev 501 net/bluetooth/smp.c bool smp_irk_matches(struct hci_dev *hdev, const u8 irk[16], hdev 504 net/bluetooth/smp.c struct l2cap_chan *chan = hdev->smp_data; hdev 523 net/bluetooth/smp.c int smp_generate_rpa(struct hci_dev *hdev, const u8 irk[16], bdaddr_t *rpa) hdev 525 net/bluetooth/smp.c struct l2cap_chan *chan = hdev->smp_data; hdev 548 net/bluetooth/smp.c int smp_generate_oob(struct hci_dev *hdev, u8 hash[16], u8 rand[16]) hdev 550 net/bluetooth/smp.c struct l2cap_chan *chan = hdev->smp_data; hdev 559 net/bluetooth/smp.c if (hci_dev_test_flag(hdev, HCI_USE_DEBUG_KEYS)) { hdev 664 net/bluetooth/smp.c struct hci_dev *hdev = hcon->hdev; hdev 667 net/bluetooth/smp.c if (hci_dev_test_flag(hdev, HCI_BONDABLE)) { hdev 675 net/bluetooth/smp.c if (hci_dev_test_flag(hdev, HCI_RPA_RESOLVING)) hdev 678 net/bluetooth/smp.c if (hci_dev_test_flag(hdev, HCI_PRIVACY)) hdev 681 net/bluetooth/smp.c if (hci_dev_test_flag(hdev, HCI_SC_ENABLED) && hdev 686 net/bluetooth/smp.c if (hci_dev_test_flag(hdev, HCI_SSP_ENABLED)) { hdev 696 net/bluetooth/smp.c oob_data = hci_find_remote_oob_data(hdev, &hcon->dst, hdev 714 net/bluetooth/smp.c req->max_key_size = hdev->le_max_key_size; hdev 717 net/bluetooth/smp.c req->auth_req = (authreq & AUTH_REQ_MASK(hdev)); hdev 725 net/bluetooth/smp.c rsp->max_key_size = hdev->le_max_key_size; hdev 728 net/bluetooth/smp.c rsp->auth_req = (authreq & AUTH_REQ_MASK(hdev)); hdev 736 net/bluetooth/smp.c struct hci_dev *hdev = conn->hcon->hdev; hdev 739 net/bluetooth/smp.c if (max_key_size > hdev->le_max_key_size || hdev 773 net/bluetooth/smp.c !hci_dev_test_flag(hcon->hdev, HCI_KEEP_DEBUG_KEYS)) { hdev 932 net/bluetooth/smp.c ret = mgmt_user_passkey_request(hcon->hdev, &hcon->dst, hdev 935 net/bluetooth/smp.c ret = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, hdev 939 net/bluetooth/smp.c ret = mgmt_user_passkey_notify(hcon->hdev, &hcon->dst, hdev 989 net/bluetooth/smp.c bt_dev_err(hcon->hdev, "pairing failed " hdev 1026 net/bluetooth/smp.c hci_add_ltk(hcon->hdev, &hcon->dst, hcon->dst_type, hdev 1038 net/bluetooth/smp.c struct hci_dev *hdev = hcon->hdev; hdev 1059 net/bluetooth/smp.c mgmt_new_irk(hdev, smp->remote_irk, persistent); hdev 1068 net/bluetooth/smp.c queue_work(hdev->workqueue, &conn->id_addr_update_work); hdev 1075 net/bluetooth/smp.c mgmt_new_csrk(hdev, smp->csrk, persistent); hdev 1081 net/bluetooth/smp.c mgmt_new_csrk(hdev, smp->slave_csrk, persistent); hdev 1087 net/bluetooth/smp.c mgmt_new_ltk(hdev, smp->ltk, persistent); hdev 1093 net/bluetooth/smp.c mgmt_new_ltk(hdev, smp->slave_ltk, persistent); hdev 1107 net/bluetooth/smp.c key = hci_add_link_key(hdev, smp->conn->hcon, &hcon->dst, hdev 1110 net/bluetooth/smp.c mgmt_new_link_key(hdev, key, persistent); hdev 1115 net/bluetooth/smp.c if (!hci_dev_test_flag(hdev, HCI_KEEP_DEBUG_KEYS) && hdev 1139 net/bluetooth/smp.c smp->ltk = hci_add_ltk(hcon->hdev, &hcon->dst, hcon->dst_type, hdev 1199 net/bluetooth/smp.c struct hci_dev *hdev = hcon->hdev; hdev 1202 net/bluetooth/smp.c key = hci_find_link_key(hdev, &hcon->dst); hdev 1204 net/bluetooth/smp.c bt_dev_err(hdev, "no Link Key found to generate LTK"); hdev 1236 net/bluetooth/smp.c struct hci_dev *hdev = hcon->hdev; hdev 1293 net/bluetooth/smp.c ltk = hci_add_ltk(hdev, &hcon->dst, hcon->dst_type, hdev 1310 net/bluetooth/smp.c memcpy(idinfo.irk, hdev->irk, sizeof(idinfo.irk)); hdev 1495 net/bluetooth/smp.c struct hci_dev *hdev = hcon->hdev; hdev 1567 net/bluetooth/smp.c BT_DBG("%s Starting passkey round %u", hdev->name, hdev 1690 net/bluetooth/smp.c struct hci_dev *hdev = conn->hcon->hdev; hdev 1693 net/bluetooth/smp.c if (hci_dev_test_flag(hdev, HCI_BONDABLE)) { hdev 1698 net/bluetooth/smp.c if (hci_dev_test_flag(hdev, HCI_RPA_RESOLVING)) hdev 1701 net/bluetooth/smp.c if (hci_dev_test_flag(hdev, HCI_PRIVACY)) hdev 1731 net/bluetooth/smp.c struct hci_dev *hdev = conn->hcon->hdev; hdev 1753 net/bluetooth/smp.c auth = req->auth_req & AUTH_REQ_MASK(hdev); hdev 1755 net/bluetooth/smp.c if (!hci_dev_test_flag(hdev, HCI_BONDABLE) && hdev 1759 net/bluetooth/smp.c if (hci_dev_test_flag(hdev, HCI_SC_ONLY) && !(auth & SMP_AUTH_SC)) hdev 1770 net/bluetooth/smp.c if (req->oob_flag == SMP_OOB_PRESENT && SMP_DEV(hdev)->local_oob) hdev 1777 net/bluetooth/smp.c !hci_dev_test_flag(hdev, HCI_FORCE_BREDR_SMP)) hdev 1867 net/bluetooth/smp.c struct hci_dev *hdev = smp->conn->hcon->hdev; hdev 1872 net/bluetooth/smp.c struct l2cap_chan *chan = hdev->smp_data; hdev 1889 net/bluetooth/smp.c if (hci_dev_test_flag(hdev, HCI_USE_DEBUG_KEYS)) { hdev 1923 net/bluetooth/smp.c struct hci_dev *hdev = conn->hcon->hdev; hdev 1943 net/bluetooth/smp.c auth = rsp->auth_req & AUTH_REQ_MASK(hdev); hdev 1945 net/bluetooth/smp.c if (hci_dev_test_flag(hdev, HCI_SC_ONLY) && !(auth & SMP_AUTH_SC)) hdev 1952 net/bluetooth/smp.c if (rsp->oob_flag == SMP_OOB_PRESENT && SMP_DEV(hdev)->local_oob) hdev 2044 net/bluetooth/smp.c struct hci_dev *hdev = hcon->hdev; hdev 2052 net/bluetooth/smp.c if (hci_dev_test_flag(hdev, HCI_SC_ONLY)) { hdev 2053 net/bluetooth/smp.c bt_dev_err(hdev, "refusing legacy fallback in SC-only mode"); hdev 2057 net/bluetooth/smp.c bt_dev_err(hdev, "trying to fall back to legacy SMP"); hdev 2065 net/bluetooth/smp.c auth = req->auth_req & AUTH_REQ_MASK(hdev); hdev 2068 net/bluetooth/smp.c bt_dev_err(hdev, "failed to fall back to legacy SMP"); hdev 2197 net/bluetooth/smp.c err = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, hcon->type, hdev 2212 net/bluetooth/smp.c key = hci_find_ltk(hcon->hdev, &hcon->dst, hcon->dst_type, hcon->role); hdev 2245 net/bluetooth/smp.c hci_find_ltk(hcon->hdev, &hcon->dst, hcon->dst_type, hcon->role)) hdev 2259 net/bluetooth/smp.c struct hci_dev *hdev = hcon->hdev; hdev 2271 net/bluetooth/smp.c auth = rp->auth_req & AUTH_REQ_MASK(hdev); hdev 2273 net/bluetooth/smp.c if (hci_dev_test_flag(hdev, HCI_SC_ONLY) && !(auth & SMP_AUTH_SC)) hdev 2300 net/bluetooth/smp.c if (!hci_dev_test_flag(hdev, HCI_BONDABLE) && hdev 2332 net/bluetooth/smp.c if (!hci_dev_test_flag(hcon->hdev, HCI_LE_ENABLED)) hdev 2347 net/bluetooth/smp.c bt_dev_err(hcon->hdev, "security requested but not available"); hdev 2367 net/bluetooth/smp.c if (hci_dev_test_flag(hcon->hdev, HCI_SC_ENABLED)) { hdev 2369 net/bluetooth/smp.c if (hci_dev_test_flag(hcon->hdev, HCI_SSP_ENABLED)) hdev 2404 net/bluetooth/smp.c int smp_cancel_and_remove_pairing(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 2413 net/bluetooth/smp.c err = hci_remove_ltk(hdev, bdaddr, addr_type); hdev 2414 net/bluetooth/smp.c hci_remove_irk(hdev, bdaddr, addr_type); hdev 2416 net/bluetooth/smp.c hcon = hci_conn_hash_lookup_le(hdev, bdaddr, addr_type); hdev 2476 net/bluetooth/smp.c struct hci_dev *hdev = conn->hcon->hdev; hdev 2497 net/bluetooth/smp.c ltk = hci_add_ltk(hdev, &hcon->dst, hcon->dst_type, SMP_LTK, hdev 2561 net/bluetooth/smp.c bt_dev_err(hcon->hdev, "ignoring IRK with no identity address"); hdev 2573 net/bluetooth/smp.c bt_dev_err(hcon->hdev, hdev 2586 net/bluetooth/smp.c smp->remote_irk = hci_add_irk(conn->hcon->hdev, &smp->id_addr, hdev 2678 net/bluetooth/smp.c struct hci_dev *hdev = hcon->hdev; hdev 2716 net/bluetooth/smp.c struct l2cap_chan *hchan = hdev->smp_data; hdev 2738 net/bluetooth/smp.c BT_DBG("%s selected method 0x%02x", hdev->name, smp->method); hdev 2755 net/bluetooth/smp.c if (mgmt_user_passkey_notify(hdev, &hcon->dst, hcon->type, hdev 2778 net/bluetooth/smp.c if (mgmt_user_passkey_request(hdev, &hcon->dst, hcon->type, hdev 2889 net/bluetooth/smp.c if (!hci_dev_test_flag(hcon->hdev, HCI_LE_ENABLED)) { hdev 2985 net/bluetooth/smp.c bt_dev_err(hcon->hdev, "unexpected SMP command 0x%02x from %pMR", hdev 3008 net/bluetooth/smp.c struct hci_dev *hdev = hcon->hdev; hdev 3027 net/bluetooth/smp.c if (!hci_dev_test_flag(hdev, HCI_SC_ENABLED)) hdev 3032 net/bluetooth/smp.c !hci_dev_test_flag(hdev, HCI_FORCE_BREDR_SMP)) hdev 3036 net/bluetooth/smp.c if (!hci_dev_test_flag(hdev, HCI_LE_ENABLED)) hdev 3053 net/bluetooth/smp.c bt_dev_err(hdev, "unable to create SMP context for BR/EDR"); hdev 3059 net/bluetooth/smp.c BT_DBG("%s starting SMP over BR/EDR", hdev->name); hdev 3214 net/bluetooth/smp.c static struct l2cap_chan *smp_add_cid(struct hci_dev *hdev, u16 cid) hdev 3269 net/bluetooth/smp.c hci_copy_identity_address(hdev, &chan->src, &bdaddr_type); hdev 3276 net/bluetooth/smp.c bacpy(&chan->src, &hdev->bdaddr); hdev 3312 net/bluetooth/smp.c struct hci_dev *hdev = file->private_data; hdev 3315 net/bluetooth/smp.c buf[0] = hci_dev_test_flag(hdev, HCI_FORCE_BREDR_SMP) ? 'Y': 'N'; hdev 3325 net/bluetooth/smp.c struct hci_dev *hdev = file->private_data; hdev 3333 net/bluetooth/smp.c if (enable == hci_dev_test_flag(hdev, HCI_FORCE_BREDR_SMP)) hdev 3339 net/bluetooth/smp.c chan = smp_add_cid(hdev, L2CAP_CID_SMP_BREDR); hdev 3343 net/bluetooth/smp.c hdev->smp_bredr_data = chan; hdev 3347 net/bluetooth/smp.c chan = hdev->smp_bredr_data; hdev 3348 net/bluetooth/smp.c hdev->smp_bredr_data = NULL; hdev 3352 net/bluetooth/smp.c hci_dev_change_flag(hdev, HCI_FORCE_BREDR_SMP); hdev 3368 net/bluetooth/smp.c struct hci_dev *hdev = file->private_data; hdev 3371 net/bluetooth/smp.c snprintf(buf, sizeof(buf), "%2u\n", hdev->le_min_key_size); hdev 3380 net/bluetooth/smp.c struct hci_dev *hdev = file->private_data; hdev 3392 net/bluetooth/smp.c if (key_size > hdev->le_max_key_size || hdev 3396 net/bluetooth/smp.c hdev->le_min_key_size = key_size; hdev 3412 net/bluetooth/smp.c struct hci_dev *hdev = file->private_data; hdev 3415 net/bluetooth/smp.c snprintf(buf, sizeof(buf), "%2u\n", hdev->le_max_key_size); hdev 3424 net/bluetooth/smp.c struct hci_dev *hdev = file->private_data; hdev 3437 net/bluetooth/smp.c key_size < hdev->le_min_key_size) hdev 3440 net/bluetooth/smp.c hdev->le_max_key_size = key_size; hdev 3452 net/bluetooth/smp.c int smp_register(struct hci_dev *hdev) hdev 3456 net/bluetooth/smp.c BT_DBG("%s", hdev->name); hdev 3461 net/bluetooth/smp.c if (!lmp_le_capable(hdev)) hdev 3464 net/bluetooth/smp.c if (WARN_ON(hdev->smp_data)) { hdev 3465 net/bluetooth/smp.c chan = hdev->smp_data; hdev 3466 net/bluetooth/smp.c hdev->smp_data = NULL; hdev 3470 net/bluetooth/smp.c chan = smp_add_cid(hdev, L2CAP_CID_SMP); hdev 3474 net/bluetooth/smp.c hdev->smp_data = chan; hdev 3476 net/bluetooth/smp.c debugfs_create_file("le_min_key_size", 0644, hdev->debugfs, hdev, hdev 3478 net/bluetooth/smp.c debugfs_create_file("le_max_key_size", 0644, hdev->debugfs, hdev, hdev 3488 net/bluetooth/smp.c if (!lmp_sc_capable(hdev)) { hdev 3489 net/bluetooth/smp.c debugfs_create_file("force_bredr_smp", 0644, hdev->debugfs, hdev 3490 net/bluetooth/smp.c hdev, &force_bredr_smp_fops); hdev 3493 net/bluetooth/smp.c if (!hci_dev_test_flag(hdev, HCI_FORCE_BREDR_SMP)) hdev 3497 net/bluetooth/smp.c if (WARN_ON(hdev->smp_bredr_data)) { hdev 3498 net/bluetooth/smp.c chan = hdev->smp_bredr_data; hdev 3499 net/bluetooth/smp.c hdev->smp_bredr_data = NULL; hdev 3503 net/bluetooth/smp.c chan = smp_add_cid(hdev, L2CAP_CID_SMP_BREDR); hdev 3506 net/bluetooth/smp.c chan = hdev->smp_data; hdev 3507 net/bluetooth/smp.c hdev->smp_data = NULL; hdev 3512 net/bluetooth/smp.c hdev->smp_bredr_data = chan; hdev 3517 net/bluetooth/smp.c void smp_unregister(struct hci_dev *hdev) hdev 3521 net/bluetooth/smp.c if (hdev->smp_bredr_data) { hdev 3522 net/bluetooth/smp.c chan = hdev->smp_bredr_data; hdev 3523 net/bluetooth/smp.c hdev->smp_bredr_data = NULL; hdev 3527 net/bluetooth/smp.c if (hdev->smp_data) { hdev 3528 net/bluetooth/smp.c chan = hdev->smp_data; hdev 3529 net/bluetooth/smp.c hdev->smp_data = NULL; hdev 184 net/bluetooth/smp.h int smp_cancel_and_remove_pairing(struct hci_dev *hdev, bdaddr_t *bdaddr, hdev 191 net/bluetooth/smp.h bool smp_irk_matches(struct hci_dev *hdev, const u8 irk[16], hdev 193 net/bluetooth/smp.h int smp_generate_rpa(struct hci_dev *hdev, const u8 irk[16], bdaddr_t *rpa); hdev 194 net/bluetooth/smp.h int smp_generate_oob(struct hci_dev *hdev, u8 hash[16], u8 rand[16]); hdev 196 net/bluetooth/smp.h int smp_register(struct hci_dev *hdev); hdev 197 net/bluetooth/smp.h void smp_unregister(struct hci_dev *hdev); hdev 19 net/nfc/hci/command.c static int nfc_hci_execute_cmd_async(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd, hdev 29 net/nfc/hci/command.c return nfc_hci_hcp_message_tx(hdev, pipe, NFC_HCI_HCP_COMMAND, cmd, hdev 55 net/nfc/hci/command.c static int nfc_hci_execute_cmd(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd, hdev 71 net/nfc/hci/command.c hcp_ew.exec_result = nfc_hci_hcp_message_tx(hdev, pipe, hdev 91 net/nfc/hci/command.c int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, hdev 98 net/nfc/hci/command.c pipe = hdev->gate2pipe[gate]; hdev 102 net/nfc/hci/command.c return nfc_hci_hcp_message_tx(hdev, pipe, NFC_HCI_HCP_EVENT, event, hdev 112 net/nfc/hci/command.c int nfc_hci_send_cmd(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, hdev 119 net/nfc/hci/command.c pipe = hdev->gate2pipe[gate]; hdev 123 net/nfc/hci/command.c return nfc_hci_execute_cmd(hdev, pipe, cmd, param, param_len, skb); hdev 127 net/nfc/hci/command.c int nfc_hci_send_cmd_async(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, hdev 135 net/nfc/hci/command.c pipe = hdev->gate2pipe[gate]; hdev 139 net/nfc/hci/command.c return nfc_hci_execute_cmd_async(hdev, pipe, cmd, param, param_len, hdev 144 net/nfc/hci/command.c int nfc_hci_set_param(struct nfc_hci_dev *hdev, u8 gate, u8 idx, hdev 167 net/nfc/hci/command.c r = nfc_hci_send_cmd(hdev, gate, NFC_HCI_ANY_SET_PARAMETER, hdev 176 net/nfc/hci/command.c int nfc_hci_get_param(struct nfc_hci_dev *hdev, u8 gate, u8 idx, hdev 181 net/nfc/hci/command.c return nfc_hci_send_cmd(hdev, gate, NFC_HCI_ANY_GET_PARAMETER, hdev 186 net/nfc/hci/command.c static int nfc_hci_open_pipe(struct nfc_hci_dev *hdev, u8 pipe) hdev 193 net/nfc/hci/command.c r = nfc_hci_execute_cmd(hdev, pipe, NFC_HCI_ANY_OPEN_PIPE, hdev 206 net/nfc/hci/command.c static int nfc_hci_close_pipe(struct nfc_hci_dev *hdev, u8 pipe) hdev 210 net/nfc/hci/command.c return nfc_hci_execute_cmd(hdev, pipe, NFC_HCI_ANY_CLOSE_PIPE, hdev 214 net/nfc/hci/command.c static u8 nfc_hci_create_pipe(struct nfc_hci_dev *hdev, u8 dest_host, hdev 228 net/nfc/hci/command.c *result = nfc_hci_execute_cmd(hdev, NFC_HCI_ADMIN_PIPE, hdev 243 net/nfc/hci/command.c static int nfc_hci_delete_pipe(struct nfc_hci_dev *hdev, u8 pipe) hdev 247 net/nfc/hci/command.c return nfc_hci_execute_cmd(hdev, NFC_HCI_ADMIN_PIPE, hdev 251 net/nfc/hci/command.c static int nfc_hci_clear_all_pipes(struct nfc_hci_dev *hdev) hdev 261 net/nfc/hci/command.c if (test_bit(NFC_HCI_QUIRK_SHORT_CLEAR, &hdev->quirks)) hdev 264 net/nfc/hci/command.c return nfc_hci_execute_cmd(hdev, NFC_HCI_ADMIN_PIPE, hdev 269 net/nfc/hci/command.c int nfc_hci_disconnect_gate(struct nfc_hci_dev *hdev, u8 gate) hdev 272 net/nfc/hci/command.c u8 pipe = hdev->gate2pipe[gate]; hdev 279 net/nfc/hci/command.c r = nfc_hci_close_pipe(hdev, pipe); hdev 284 net/nfc/hci/command.c r = nfc_hci_delete_pipe(hdev, pipe); hdev 289 net/nfc/hci/command.c hdev->gate2pipe[gate] = NFC_HCI_INVALID_PIPE; hdev 295 net/nfc/hci/command.c int nfc_hci_disconnect_all_gates(struct nfc_hci_dev *hdev) hdev 301 net/nfc/hci/command.c r = nfc_hci_clear_all_pipes(hdev); hdev 305 net/nfc/hci/command.c nfc_hci_reset_pipes(hdev); hdev 311 net/nfc/hci/command.c int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate, hdev 322 net/nfc/hci/command.c if (hdev->gate2pipe[dest_gate] != NFC_HCI_INVALID_PIPE) hdev 336 net/nfc/hci/command.c pipe = nfc_hci_create_pipe(hdev, dest_host, dest_gate, &r); hdev 344 net/nfc/hci/command.c r = nfc_hci_open_pipe(hdev, pipe); hdev 347 net/nfc/hci/command.c if (nfc_hci_delete_pipe(hdev, pipe) < 0) { hdev 354 net/nfc/hci/command.c hdev->pipes[pipe].gate = dest_gate; hdev 355 net/nfc/hci/command.c hdev->pipes[pipe].dest_host = dest_host; hdev 356 net/nfc/hci/command.c hdev->gate2pipe[dest_gate] = pipe; hdev 37 net/nfc/hci/core.c void nfc_hci_reset_pipes(struct nfc_hci_dev *hdev) hdev 42 net/nfc/hci/core.c hdev->pipes[i].gate = NFC_HCI_INVALID_GATE; hdev 43 net/nfc/hci/core.c hdev->pipes[i].dest_host = NFC_HCI_INVALID_HOST; hdev 45 net/nfc/hci/core.c memset(hdev->gate2pipe, NFC_HCI_INVALID_PIPE, sizeof(hdev->gate2pipe)); hdev 49 net/nfc/hci/core.c void nfc_hci_reset_pipes_per_host(struct nfc_hci_dev *hdev, u8 host) hdev 54 net/nfc/hci/core.c if (hdev->pipes[i].dest_host != host) hdev 57 net/nfc/hci/core.c hdev->pipes[i].gate = NFC_HCI_INVALID_GATE; hdev 58 net/nfc/hci/core.c hdev->pipes[i].dest_host = NFC_HCI_INVALID_HOST; hdev 65 net/nfc/hci/core.c struct nfc_hci_dev *hdev = container_of(work, struct nfc_hci_dev, hdev 71 net/nfc/hci/core.c mutex_lock(&hdev->msg_tx_mutex); hdev 72 net/nfc/hci/core.c if (hdev->shutting_down) hdev 75 net/nfc/hci/core.c if (hdev->cmd_pending_msg) { hdev 76 net/nfc/hci/core.c if (timer_pending(&hdev->cmd_timer) == 0) { hdev 77 net/nfc/hci/core.c if (hdev->cmd_pending_msg->cb) hdev 78 net/nfc/hci/core.c hdev->cmd_pending_msg->cb(hdev-> hdev 83 net/nfc/hci/core.c kfree(hdev->cmd_pending_msg); hdev 84 net/nfc/hci/core.c hdev->cmd_pending_msg = NULL; hdev 91 net/nfc/hci/core.c if (list_empty(&hdev->msg_tx_queue)) hdev 94 net/nfc/hci/core.c msg = list_first_entry(&hdev->msg_tx_queue, struct hci_msg, msg_l); hdev 99 net/nfc/hci/core.c r = nfc_llc_xmit_from_hci(hdev->llc, skb); hdev 118 net/nfc/hci/core.c hdev->cmd_pending_msg = msg; hdev 119 net/nfc/hci/core.c mod_timer(&hdev->cmd_timer, jiffies + hdev 120 net/nfc/hci/core.c msecs_to_jiffies(hdev->cmd_pending_msg->completion_delay)); hdev 123 net/nfc/hci/core.c mutex_unlock(&hdev->msg_tx_mutex); hdev 128 net/nfc/hci/core.c struct nfc_hci_dev *hdev = container_of(work, struct nfc_hci_dev, hdev 136 net/nfc/hci/core.c while ((skb = skb_dequeue(&hdev->msg_rx_queue)) != NULL) { hdev 144 net/nfc/hci/core.c nfc_hci_hcp_message_rx(hdev, pipe, type, instruction, skb); hdev 148 net/nfc/hci/core.c static void __nfc_hci_cmd_completion(struct nfc_hci_dev *hdev, int err, hdev 151 net/nfc/hci/core.c del_timer_sync(&hdev->cmd_timer); hdev 153 net/nfc/hci/core.c if (hdev->cmd_pending_msg->cb) hdev 154 net/nfc/hci/core.c hdev->cmd_pending_msg->cb(hdev->cmd_pending_msg->cb_context, hdev 159 net/nfc/hci/core.c kfree(hdev->cmd_pending_msg); hdev 160 net/nfc/hci/core.c hdev->cmd_pending_msg = NULL; hdev 162 net/nfc/hci/core.c schedule_work(&hdev->msg_tx_work); hdev 165 net/nfc/hci/core.c void nfc_hci_resp_received(struct nfc_hci_dev *hdev, u8 result, hdev 168 net/nfc/hci/core.c mutex_lock(&hdev->msg_tx_mutex); hdev 170 net/nfc/hci/core.c if (hdev->cmd_pending_msg == NULL) { hdev 175 net/nfc/hci/core.c __nfc_hci_cmd_completion(hdev, nfc_hci_result_to_errno(result), skb); hdev 178 net/nfc/hci/core.c mutex_unlock(&hdev->msg_tx_mutex); hdev 181 net/nfc/hci/core.c void nfc_hci_cmd_received(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd, hdev 197 net/nfc/hci/core.c gate = hdev->pipes[pipe].gate; hdev 217 net/nfc/hci/core.c hdev->gate2pipe[create_info->dest_gate] = create_info->pipe; hdev 218 net/nfc/hci/core.c hdev->pipes[create_info->pipe].gate = create_info->dest_gate; hdev 219 net/nfc/hci/core.c hdev->pipes[create_info->pipe].dest_host = hdev 240 net/nfc/hci/core.c hdev->pipes[delete_info->pipe].gate = NFC_HCI_INVALID_GATE; hdev 241 net/nfc/hci/core.c hdev->pipes[delete_info->pipe].dest_host = NFC_HCI_INVALID_HOST; hdev 250 net/nfc/hci/core.c nfc_hci_reset_pipes_per_host(hdev, cleared_info->host); hdev 257 net/nfc/hci/core.c if (hdev->ops->cmd_received) hdev 258 net/nfc/hci/core.c hdev->ops->cmd_received(hdev, pipe, cmd, skb); hdev 261 net/nfc/hci/core.c nfc_hci_hcp_message_tx(hdev, pipe, NFC_HCI_HCP_RESPONSE, hdev 284 net/nfc/hci/core.c int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate) hdev 300 net/nfc/hci/core.c r = nfc_hci_get_param(hdev, NFC_HCI_RF_READER_A_GATE, hdev 305 net/nfc/hci/core.c r = nfc_hci_get_param(hdev, NFC_HCI_RF_READER_A_GATE, hdev 325 net/nfc/hci/core.c r = nfc_hci_get_param(hdev, NFC_HCI_RF_READER_A_GATE, hdev 338 net/nfc/hci/core.c if (hdev->ops->complete_target_discovered) { hdev 339 net/nfc/hci/core.c r = hdev->ops->complete_target_discovered(hdev, gate, hdev 349 net/nfc/hci/core.c if (hdev->ops->target_from_gate) hdev 350 net/nfc/hci/core.c r = hdev->ops->target_from_gate(hdev, gate, targets); hdev 356 net/nfc/hci/core.c if (hdev->ops->complete_target_discovered) { hdev 357 net/nfc/hci/core.c r = hdev->ops->complete_target_discovered(hdev, gate, hdev 369 net/nfc/hci/core.c r = nfc_targets_found(hdev->ndev, targets, 1); hdev 381 net/nfc/hci/core.c void nfc_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe, u8 event, hdev 392 net/nfc/hci/core.c gate = hdev->pipes[pipe].gate; hdev 398 net/nfc/hci/core.c if (hdev->ops->event_received) { hdev 399 net/nfc/hci/core.c r = hdev->ops->event_received(hdev, pipe, event, skb); hdev 426 net/nfc/hci/core.c r = nfc_hci_target_discovered(hdev, gate); hdev 439 net/nfc/hci/core.c nfc_hci_driver_failure(hdev, r); hdev 444 net/nfc/hci/core.c struct nfc_hci_dev *hdev = from_timer(hdev, t, cmd_timer); hdev 446 net/nfc/hci/core.c schedule_work(&hdev->msg_tx_work); hdev 449 net/nfc/hci/core.c static int hci_dev_connect_gates(struct nfc_hci_dev *hdev, u8 gate_count, hdev 454 net/nfc/hci/core.c r = nfc_hci_connect_gate(hdev, NFC_HCI_HOST_CONTROLLER_ID, hdev 464 net/nfc/hci/core.c static int hci_dev_session_init(struct nfc_hci_dev *hdev) hdev 469 net/nfc/hci/core.c if (hdev->init_data.gates[0].gate != NFC_HCI_ADMIN_GATE) hdev 472 net/nfc/hci/core.c r = nfc_hci_connect_gate(hdev, NFC_HCI_HOST_CONTROLLER_ID, hdev 473 net/nfc/hci/core.c hdev->init_data.gates[0].gate, hdev 474 net/nfc/hci/core.c hdev->init_data.gates[0].pipe); hdev 478 net/nfc/hci/core.c r = nfc_hci_get_param(hdev, NFC_HCI_ADMIN_GATE, hdev 483 net/nfc/hci/core.c if (skb->len && skb->len == strlen(hdev->init_data.session_id) && hdev 484 net/nfc/hci/core.c (memcmp(hdev->init_data.session_id, skb->data, hdev 485 net/nfc/hci/core.c skb->len) == 0) && hdev->ops->load_session) { hdev 488 net/nfc/hci/core.c r = hdev->ops->load_session(hdev); hdev 494 net/nfc/hci/core.c r = nfc_hci_disconnect_all_gates(hdev); hdev 498 net/nfc/hci/core.c r = hci_dev_connect_gates(hdev, hdev->init_data.gate_count, hdev 499 net/nfc/hci/core.c hdev->init_data.gates); hdev 503 net/nfc/hci/core.c r = nfc_hci_set_param(hdev, NFC_HCI_ADMIN_GATE, hdev 505 net/nfc/hci/core.c hdev->init_data.session_id, hdev 506 net/nfc/hci/core.c strlen(hdev->init_data.session_id)); hdev 512 net/nfc/hci/core.c nfc_hci_disconnect_all_gates(hdev); hdev 520 net/nfc/hci/core.c static int hci_dev_version(struct nfc_hci_dev *hdev) hdev 525 net/nfc/hci/core.c r = nfc_hci_get_param(hdev, NFC_HCI_ID_MGMT_GATE, hdev 539 net/nfc/hci/core.c hdev->sw_romlib = (skb->data[0] & 0xf0) >> 4; hdev 540 net/nfc/hci/core.c hdev->sw_patch = skb->data[0] & 0x0f; hdev 541 net/nfc/hci/core.c hdev->sw_flashlib_major = skb->data[1]; hdev 542 net/nfc/hci/core.c hdev->sw_flashlib_minor = skb->data[2]; hdev 546 net/nfc/hci/core.c r = nfc_hci_get_param(hdev, NFC_HCI_ID_MGMT_GATE, hdev 556 net/nfc/hci/core.c hdev->hw_derivative = (skb->data[0] & 0xe0) >> 5; hdev 557 net/nfc/hci/core.c hdev->hw_version = skb->data[0] & 0x1f; hdev 558 net/nfc/hci/core.c hdev->hw_mpw = (skb->data[1] & 0xc0) >> 6; hdev 559 net/nfc/hci/core.c hdev->hw_software = skb->data[1] & 0x3f; hdev 560 net/nfc/hci/core.c hdev->hw_bsid = skb->data[2]; hdev 565 net/nfc/hci/core.c pr_info("RomLib : %d\n", hdev->sw_romlib); hdev 566 net/nfc/hci/core.c pr_info("Patch : %d\n", hdev->sw_patch); hdev 567 net/nfc/hci/core.c pr_info("FlashLib Major : %d\n", hdev->sw_flashlib_major); hdev 568 net/nfc/hci/core.c pr_info("FlashLib Minor : %d\n", hdev->sw_flashlib_minor); hdev 570 net/nfc/hci/core.c pr_info("Derivative : %d\n", hdev->hw_derivative); hdev 571 net/nfc/hci/core.c pr_info("HW Version : %d\n", hdev->hw_version); hdev 572 net/nfc/hci/core.c pr_info("#MPW : %d\n", hdev->hw_mpw); hdev 573 net/nfc/hci/core.c pr_info("Software : %d\n", hdev->hw_software); hdev 574 net/nfc/hci/core.c pr_info("BSID Version : %d\n", hdev->hw_bsid); hdev 581 net/nfc/hci/core.c struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); hdev 584 net/nfc/hci/core.c if (hdev->ops->open) { hdev 585 net/nfc/hci/core.c r = hdev->ops->open(hdev); hdev 590 net/nfc/hci/core.c r = nfc_llc_start(hdev->llc); hdev 594 net/nfc/hci/core.c r = hci_dev_session_init(hdev); hdev 598 net/nfc/hci/core.c r = nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, hdev 603 net/nfc/hci/core.c if (hdev->ops->hci_ready) { hdev 604 net/nfc/hci/core.c r = hdev->ops->hci_ready(hdev); hdev 609 net/nfc/hci/core.c r = hci_dev_version(hdev); hdev 616 net/nfc/hci/core.c nfc_llc_stop(hdev->llc); hdev 619 net/nfc/hci/core.c if (hdev->ops->close) hdev 620 net/nfc/hci/core.c hdev->ops->close(hdev); hdev 627 net/nfc/hci/core.c struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); hdev 629 net/nfc/hci/core.c nfc_llc_stop(hdev->llc); hdev 631 net/nfc/hci/core.c if (hdev->ops->close) hdev 632 net/nfc/hci/core.c hdev->ops->close(hdev); hdev 634 net/nfc/hci/core.c nfc_hci_reset_pipes(hdev); hdev 642 net/nfc/hci/core.c struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); hdev 644 net/nfc/hci/core.c if (hdev->ops->start_poll) hdev 645 net/nfc/hci/core.c return hdev->ops->start_poll(hdev, im_protocols, tm_protocols); hdev 647 net/nfc/hci/core.c return nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, hdev 654 net/nfc/hci/core.c struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); hdev 656 net/nfc/hci/core.c if (hdev->ops->stop_poll) hdev 657 net/nfc/hci/core.c hdev->ops->stop_poll(hdev); hdev 659 net/nfc/hci/core.c nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, hdev 666 net/nfc/hci/core.c struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); hdev 668 net/nfc/hci/core.c if (!hdev->ops->dep_link_up) hdev 671 net/nfc/hci/core.c return hdev->ops->dep_link_up(hdev, target, comm_mode, hdev 677 net/nfc/hci/core.c struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); hdev 679 net/nfc/hci/core.c if (!hdev->ops->dep_link_down) hdev 682 net/nfc/hci/core.c return hdev->ops->dep_link_down(hdev); hdev 701 net/nfc/hci/core.c struct nfc_hci_dev *hdev = context; hdev 703 net/nfc/hci/core.c switch (hdev->async_cb_type) { hdev 713 net/nfc/hci/core.c hdev->async_cb(hdev->async_cb_context, skb, err); hdev 726 net/nfc/hci/core.c struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); hdev 734 net/nfc/hci/core.c if (hdev->ops->im_transceive) { hdev 735 net/nfc/hci/core.c r = hdev->ops->im_transceive(hdev, target, skb, cb, hdev 743 net/nfc/hci/core.c hdev->async_cb_type = HCI_CB_TYPE_TRANSCEIVE; hdev 744 net/nfc/hci/core.c hdev->async_cb = cb; hdev 745 net/nfc/hci/core.c hdev->async_cb_context = cb_context; hdev 747 net/nfc/hci/core.c r = nfc_hci_send_cmd_async(hdev, target->hci_reader_gate, hdev 749 net/nfc/hci/core.c skb->len, hci_transceive_cb, hdev); hdev 752 net/nfc/hci/core.c if (hdev->ops->im_transceive) { hdev 753 net/nfc/hci/core.c r = hdev->ops->im_transceive(hdev, target, skb, cb, hdev 770 net/nfc/hci/core.c struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); hdev 772 net/nfc/hci/core.c if (!hdev->ops->tm_send) { hdev 777 net/nfc/hci/core.c return hdev->ops->tm_send(hdev, skb); hdev 783 net/nfc/hci/core.c struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); hdev 785 net/nfc/hci/core.c if (!hdev->ops->check_presence) hdev 788 net/nfc/hci/core.c return hdev->ops->check_presence(hdev, target); hdev 793 net/nfc/hci/core.c struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); hdev 795 net/nfc/hci/core.c if (hdev->ops->discover_se) hdev 796 net/nfc/hci/core.c return hdev->ops->discover_se(hdev); hdev 803 net/nfc/hci/core.c struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); hdev 805 net/nfc/hci/core.c if (hdev->ops->enable_se) hdev 806 net/nfc/hci/core.c return hdev->ops->enable_se(hdev, se_idx); hdev 813 net/nfc/hci/core.c struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); hdev 815 net/nfc/hci/core.c if (hdev->ops->disable_se) hdev 816 net/nfc/hci/core.c return hdev->ops->disable_se(hdev, se_idx); hdev 825 net/nfc/hci/core.c struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); hdev 827 net/nfc/hci/core.c if (hdev->ops->se_io) hdev 828 net/nfc/hci/core.c return hdev->ops->se_io(hdev, se_idx, apdu, hdev 834 net/nfc/hci/core.c static void nfc_hci_failure(struct nfc_hci_dev *hdev, int err) hdev 836 net/nfc/hci/core.c mutex_lock(&hdev->msg_tx_mutex); hdev 838 net/nfc/hci/core.c if (hdev->cmd_pending_msg == NULL) { hdev 839 net/nfc/hci/core.c nfc_driver_failure(hdev->ndev, err); hdev 843 net/nfc/hci/core.c __nfc_hci_cmd_completion(hdev, err, NULL); hdev 846 net/nfc/hci/core.c mutex_unlock(&hdev->msg_tx_mutex); hdev 849 net/nfc/hci/core.c static void nfc_hci_llc_failure(struct nfc_hci_dev *hdev, int err) hdev 851 net/nfc/hci/core.c nfc_hci_failure(hdev, err); hdev 854 net/nfc/hci/core.c static void nfc_hci_recv_from_llc(struct nfc_hci_dev *hdev, struct sk_buff *skb) hdev 866 net/nfc/hci/core.c skb_queue_tail(&hdev->rx_hcp_frags, skb); hdev 871 net/nfc/hci/core.c if (skb_queue_len(&hdev->rx_hcp_frags)) { hdev 873 net/nfc/hci/core.c skb_queue_tail(&hdev->rx_hcp_frags, skb); hdev 876 net/nfc/hci/core.c skb_queue_walk(&hdev->rx_hcp_frags, frag_skb) { hdev 884 net/nfc/hci/core.c nfc_hci_failure(hdev, -ENOMEM); hdev 890 net/nfc/hci/core.c skb_queue_walk(&hdev->rx_hcp_frags, frag_skb) { hdev 897 net/nfc/hci/core.c skb_queue_purge(&hdev->rx_hcp_frags); hdev 914 net/nfc/hci/core.c nfc_hci_hcp_message_rx(hdev, pipe, type, instruction, hcp_skb); hdev 916 net/nfc/hci/core.c skb_queue_tail(&hdev->msg_rx_queue, hcp_skb); hdev 917 net/nfc/hci/core.c schedule_work(&hdev->msg_rx_work); hdev 923 net/nfc/hci/core.c struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); hdev 925 net/nfc/hci/core.c if (!hdev->ops->fw_download) hdev 928 net/nfc/hci/core.c return hdev->ops->fw_download(hdev, firmware_name); hdev 959 net/nfc/hci/core.c struct nfc_hci_dev *hdev; hdev 967 net/nfc/hci/core.c hdev = kzalloc(sizeof(struct nfc_hci_dev), GFP_KERNEL); hdev 968 net/nfc/hci/core.c if (hdev == NULL) hdev 971 net/nfc/hci/core.c hdev->llc = nfc_llc_allocate(llc_name, hdev, ops->xmit, hdev 974 net/nfc/hci/core.c if (hdev->llc == NULL) { hdev 975 net/nfc/hci/core.c kfree(hdev); hdev 979 net/nfc/hci/core.c hdev->ndev = nfc_allocate_device(&hci_nfc_ops, protocols, hdev 982 net/nfc/hci/core.c if (!hdev->ndev) { hdev 983 net/nfc/hci/core.c nfc_llc_free(hdev->llc); hdev 984 net/nfc/hci/core.c kfree(hdev); hdev 988 net/nfc/hci/core.c hdev->ops = ops; hdev 989 net/nfc/hci/core.c hdev->max_data_link_payload = max_link_payload; hdev 990 net/nfc/hci/core.c hdev->init_data = *init_data; hdev 992 net/nfc/hci/core.c nfc_set_drvdata(hdev->ndev, hdev); hdev 994 net/nfc/hci/core.c nfc_hci_reset_pipes(hdev); hdev 996 net/nfc/hci/core.c hdev->quirks = quirks; hdev 998 net/nfc/hci/core.c return hdev; hdev 1002 net/nfc/hci/core.c void nfc_hci_free_device(struct nfc_hci_dev *hdev) hdev 1004 net/nfc/hci/core.c nfc_free_device(hdev->ndev); hdev 1005 net/nfc/hci/core.c nfc_llc_free(hdev->llc); hdev 1006 net/nfc/hci/core.c kfree(hdev); hdev 1010 net/nfc/hci/core.c int nfc_hci_register_device(struct nfc_hci_dev *hdev) hdev 1012 net/nfc/hci/core.c mutex_init(&hdev->msg_tx_mutex); hdev 1014 net/nfc/hci/core.c INIT_LIST_HEAD(&hdev->msg_tx_queue); hdev 1016 net/nfc/hci/core.c INIT_WORK(&hdev->msg_tx_work, nfc_hci_msg_tx_work); hdev 1018 net/nfc/hci/core.c timer_setup(&hdev->cmd_timer, nfc_hci_cmd_timeout, 0); hdev 1020 net/nfc/hci/core.c skb_queue_head_init(&hdev->rx_hcp_frags); hdev 1022 net/nfc/hci/core.c INIT_WORK(&hdev->msg_rx_work, nfc_hci_msg_rx_work); hdev 1024 net/nfc/hci/core.c skb_queue_head_init(&hdev->msg_rx_queue); hdev 1026 net/nfc/hci/core.c return nfc_register_device(hdev->ndev); hdev 1030 net/nfc/hci/core.c void nfc_hci_unregister_device(struct nfc_hci_dev *hdev) hdev 1034 net/nfc/hci/core.c mutex_lock(&hdev->msg_tx_mutex); hdev 1036 net/nfc/hci/core.c if (hdev->cmd_pending_msg) { hdev 1037 net/nfc/hci/core.c if (hdev->cmd_pending_msg->cb) hdev 1038 net/nfc/hci/core.c hdev->cmd_pending_msg->cb( hdev 1039 net/nfc/hci/core.c hdev->cmd_pending_msg->cb_context, hdev 1041 net/nfc/hci/core.c kfree(hdev->cmd_pending_msg); hdev 1042 net/nfc/hci/core.c hdev->cmd_pending_msg = NULL; hdev 1045 net/nfc/hci/core.c hdev->shutting_down = true; hdev 1047 net/nfc/hci/core.c mutex_unlock(&hdev->msg_tx_mutex); hdev 1049 net/nfc/hci/core.c del_timer_sync(&hdev->cmd_timer); hdev 1050 net/nfc/hci/core.c cancel_work_sync(&hdev->msg_tx_work); hdev 1052 net/nfc/hci/core.c cancel_work_sync(&hdev->msg_rx_work); hdev 1054 net/nfc/hci/core.c nfc_unregister_device(hdev->ndev); hdev 1056 net/nfc/hci/core.c skb_queue_purge(&hdev->rx_hcp_frags); hdev 1057 net/nfc/hci/core.c skb_queue_purge(&hdev->msg_rx_queue); hdev 1059 net/nfc/hci/core.c list_for_each_entry_safe(msg, n, &hdev->msg_tx_queue, msg_l) { hdev 1067 net/nfc/hci/core.c void nfc_hci_set_clientdata(struct nfc_hci_dev *hdev, void *clientdata) hdev 1069 net/nfc/hci/core.c hdev->clientdata = clientdata; hdev 1073 net/nfc/hci/core.c void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev) hdev 1075 net/nfc/hci/core.c return hdev->clientdata; hdev 1079 net/nfc/hci/core.c void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err) hdev 1081 net/nfc/hci/core.c nfc_hci_failure(hdev, err); hdev 1085 net/nfc/hci/core.c void nfc_hci_recv_frame(struct nfc_hci_dev *hdev, struct sk_buff *skb) hdev 1087 net/nfc/hci/core.c nfc_llc_rcv_from_drv(hdev->llc, skb); hdev 70 net/nfc/hci/hci.h int nfc_hci_hcp_message_tx(struct nfc_hci_dev *hdev, u8 pipe, hdev 76 net/nfc/hci/hci.h void nfc_hci_hcp_message_rx(struct nfc_hci_dev *hdev, u8 pipe, u8 type, hdev 21 net/nfc/hci/hcp.c int nfc_hci_hcp_message_tx(struct nfc_hci_dev *hdev, u8 pipe, hdev 27 net/nfc/hci/hcp.c struct nfc_dev *ndev = hdev->ndev; hdev 51 net/nfc/hci/hcp.c hdev->max_data_link_payload) hdev 54 net/nfc/hci/hcp.c data_link_len = hdev->max_data_link_payload - hdev 93 net/nfc/hci/hcp.c mutex_lock(&hdev->msg_tx_mutex); hdev 95 net/nfc/hci/hcp.c if (hdev->shutting_down) { hdev 97 net/nfc/hci/hcp.c mutex_unlock(&hdev->msg_tx_mutex); hdev 101 net/nfc/hci/hcp.c list_add_tail(&cmd->msg_l, &hdev->msg_tx_queue); hdev 102 net/nfc/hci/hcp.c mutex_unlock(&hdev->msg_tx_mutex); hdev 104 net/nfc/hci/hcp.c schedule_work(&hdev->msg_tx_work); hdev 119 net/nfc/hci/hcp.c void nfc_hci_hcp_message_rx(struct nfc_hci_dev *hdev, u8 pipe, u8 type, hdev 124 net/nfc/hci/hcp.c nfc_hci_resp_received(hdev, instruction, skb); hdev 127 net/nfc/hci/hcp.c nfc_hci_cmd_received(hdev, pipe, instruction, skb); hdev 130 net/nfc/hci/hcp.c nfc_hci_event_received(hdev, pipe, instruction, skb); hdev 90 net/nfc/hci/llc.c struct nfc_llc *nfc_llc_allocate(const char *name, struct nfc_hci_dev *hdev, hdev 106 net/nfc/hci/llc.c llc->data = llc_engine->ops->init(hdev, xmit_to_drv, rcv_to_hci, hdev 16 net/nfc/hci/llc.h void *(*init) (struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv, hdev 13 net/nfc/hci/llc_nop.c struct nfc_hci_dev *hdev; hdev 21 net/nfc/hci/llc_nop.c static void *llc_nop_init(struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv, hdev 35 net/nfc/hci/llc_nop.c llc_nop->hdev = hdev; hdev 64 net/nfc/hci/llc_nop.c llc_nop->rcv_to_hci(llc_nop->hdev, skb); hdev 71 net/nfc/hci/llc_nop.c return llc_nop->xmit_to_drv(llc_nop->hdev, skb); hdev 27 net/nfc/hci/llc_shdlc.c struct nfc_hci_dev *hdev; hdev 154 net/nfc/hci/llc_shdlc.c r = shdlc->xmit_to_drv(shdlc->hdev, skb); hdev 172 net/nfc/hci/llc_shdlc.c r = shdlc->xmit_to_drv(shdlc->hdev, skb); hdev 247 net/nfc/hci/llc_shdlc.c shdlc->rcv_to_hci(shdlc->hdev, skb); hdev 550 net/nfc/hci/llc_shdlc.c r = shdlc->xmit_to_drv(shdlc->hdev, skb); hdev 673 net/nfc/hci/llc_shdlc.c shdlc->llc_failure(shdlc->hdev, shdlc->hard_fault); hdev 738 net/nfc/hci/llc_shdlc.c static void *llc_shdlc_init(struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv, hdev 768 net/nfc/hci/llc_shdlc.c shdlc->hdev = hdev; hdev 110 net/nfc/nci/hci.c static void nci_hci_reset_pipes(struct nci_hci_dev *hdev) hdev 115 net/nfc/nci/hci.c hdev->pipes[i].gate = NCI_HCI_INVALID_GATE; hdev 116 net/nfc/nci/hci.c hdev->pipes[i].host = NCI_HCI_INVALID_HOST; hdev 118 net/nfc/nci/hci.c memset(hdev->gate2pipe, NCI_HCI_INVALID_PIPE, sizeof(hdev->gate2pipe)); hdev 411 net/nfc/nci/hci.c struct nci_hci_dev *hdev = hdev 417 net/nfc/nci/hci.c while ((skb = skb_dequeue(&hdev->msg_rx_queue)) != NULL) { hdev 425 net/nfc/nci/hci.c nci_hci_hcp_message_rx(hdev->ndev, pipe, hdev 785 net/nfc/nci/hci.c struct nci_hci_dev *hdev; hdev 787 net/nfc/nci/hci.c hdev = kzalloc(sizeof(*hdev), GFP_KERNEL); hdev 788 net/nfc/nci/hci.c if (!hdev) hdev 791 net/nfc/nci/hci.c skb_queue_head_init(&hdev->rx_hcp_frags); hdev 792 net/nfc/nci/hci.c INIT_WORK(&hdev->msg_rx_work, nci_hci_msg_rx_work); hdev 793 net/nfc/nci/hci.c skb_queue_head_init(&hdev->msg_rx_queue); hdev 794 net/nfc/nci/hci.c hdev->ndev = ndev; hdev 796 net/nfc/nci/hci.c return hdev; hdev 867 net/vmw_vsock/hyperv_transport.c static int hvs_probe(struct hv_device *hdev, hdev 870 net/vmw_vsock/hyperv_transport.c struct vmbus_channel *chan = hdev->channel; hdev 882 net/vmw_vsock/hyperv_transport.c static int hvs_remove(struct hv_device *hdev) hdev 884 net/vmw_vsock/hyperv_transport.c struct vmbus_channel *chan = hdev->channel; hdev 76 sound/hda/ext/hdac_ext_bus.c struct hdac_device *hdev) hdev 81 sound/hda/ext/hdac_ext_bus.c hdev->bus = bus; hdev 85 sound/hda/ext/hdac_ext_bus.c ret = snd_hdac_device_init(hdev, bus, name, addr); hdev 90 sound/hda/ext/hdac_ext_bus.c hdev->type = HDA_DEV_ASOC; hdev 91 sound/hda/ext/hdac_ext_bus.c hdev->dev.release = default_release; hdev 93 sound/hda/ext/hdac_ext_bus.c ret = snd_hdac_device_register(hdev); hdev 96 sound/hda/ext/hdac_ext_bus.c snd_hdac_ext_bus_device_exit(hdev); hdev 108 sound/hda/ext/hdac_ext_bus.c void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev) hdev 110 sound/hda/ext/hdac_ext_bus.c snd_hdac_device_exit(hdev); hdev 143 sound/hda/ext/hdac_ext_bus.c struct hdac_device *hdev = dev_to_hdac_dev(dev); hdev 144 sound/hda/ext/hdac_ext_bus.c return hdev; hdev 24 sound/hda/hda_bus_type.c hdac_get_device_id(struct hdac_device *hdev, struct hdac_driver *drv) hdev 30 sound/hda/hda_bus_type.c if (hdev->vendor_id == id->vendor_id && hdev 31 sound/hda/hda_bus_type.c (!id->rev_id || id->rev_id == hdev->revision_id)) hdev 51 sound/hda/hda_bus_type.c struct hdac_device *hdev = dev_to_hdac_dev(dev); hdev 54 sound/hda/hda_bus_type.c if (hdev->type != hdrv->type) hdev 62 sound/hda/hda_bus_type.c return hdrv->match(hdev, hdrv); hdev 64 sound/hda/hda_bus_type.c return hdac_codec_match(hdev, hdrv); hdev 204 sound/soc/codecs/hdac_hda.c struct hdac_device *hdev; hdev 211 sound/soc/codecs/hdac_hda.c hdev = &hda_pvt->codec.core; hdev 224 sound/soc/codecs/hdac_hda.c dev_err(&hdev->dev, "codec prepare failed %d\n", ret); hdev 311 sound/soc/codecs/hdac_hda.c struct hdac_device *hdev = &hda_pvt->codec.core; hdev 317 sound/soc/codecs/hdac_hda.c hlink = snd_hdac_ext_bus_get_link(hdev->bus, dev_name(&hdev->dev)); hdev 319 sound/soc/codecs/hdac_hda.c dev_err(&hdev->dev, "hdac link not found\n"); hdev 323 sound/soc/codecs/hdac_hda.c snd_hdac_ext_bus_link_get(hdev->bus, hlink); hdev 326 sound/soc/codecs/hdac_hda.c hdev->addr, hcodec); hdev 328 sound/soc/codecs/hdac_hda.c dev_err(&hdev->dev, "failed to create hda codec %d\n", ret); hdev 336 sound/soc/codecs/hdac_hda.c hdev->type = HDA_DEV_ASOC; hdev 342 sound/soc/codecs/hdac_hda.c pm_runtime_get_noresume(&hdev->dev); hdev 348 sound/soc/codecs/hdac_hda.c dev_err(&hdev->dev, "name failed %s\n", hcodec->preset->name); hdev 354 sound/soc/codecs/hdac_hda.c dev_err(&hdev->dev, "regmap init failed\n"); hdev 362 sound/soc/codecs/hdac_hda.c dev_err(&hdev->dev, "patch failed %d\n", ret); hdev 366 sound/soc/codecs/hdac_hda.c dev_dbg(&hdev->dev, "no patch file found\n"); hdev 371 sound/soc/codecs/hdac_hda.c dev_err(&hdev->dev, "unable to map pcms to dai %d\n", ret); hdev 377 sound/soc/codecs/hdac_hda.c dev_err(&hdev->dev, "unable to create controls %d\n", ret); hdev 388 sound/soc/codecs/hdac_hda.c pm_runtime_put(&hdev->dev); hdev 389 sound/soc/codecs/hdac_hda.c pm_runtime_suspend(&hdev->dev); hdev 394 sound/soc/codecs/hdac_hda.c pm_runtime_put(&hdev->dev); hdev 396 sound/soc/codecs/hdac_hda.c snd_hdac_ext_bus_link_put(hdev->bus, hlink); hdev 404 sound/soc/codecs/hdac_hda.c struct hdac_device *hdev = &hda_pvt->codec.core; hdev 407 sound/soc/codecs/hdac_hda.c hlink = snd_hdac_ext_bus_get_link(hdev->bus, dev_name(&hdev->dev)); hdev 409 sound/soc/codecs/hdac_hda.c dev_err(&hdev->dev, "hdac link not found\n"); hdev 413 sound/soc/codecs/hdac_hda.c pm_runtime_disable(&hdev->dev); hdev 414 sound/soc/codecs/hdac_hda.c snd_hdac_ext_bus_link_put(hdev->bus, hlink); hdev 463 sound/soc/codecs/hdac_hda.c static int hdac_hda_dev_probe(struct hdac_device *hdev) hdev 470 sound/soc/codecs/hdac_hda.c hlink = snd_hdac_ext_bus_get_link(hdev->bus, dev_name(&hdev->dev)); hdev 472 sound/soc/codecs/hdac_hda.c dev_err(&hdev->dev, "hdac link not found\n"); hdev 475 sound/soc/codecs/hdac_hda.c snd_hdac_ext_bus_link_get(hdev->bus, hlink); hdev 477 sound/soc/codecs/hdac_hda.c hda_pvt = hdac_to_hda_priv(hdev); hdev 482 sound/soc/codecs/hdac_hda.c ret = devm_snd_soc_register_component(&hdev->dev, hdev 486 sound/soc/codecs/hdac_hda.c dev_err(&hdev->dev, "failed to register HDA codec %d\n", ret); hdev 490 sound/soc/codecs/hdac_hda.c dev_set_drvdata(&hdev->dev, hda_pvt); hdev 491 sound/soc/codecs/hdac_hda.c snd_hdac_ext_bus_link_put(hdev->bus, hlink); hdev 496 sound/soc/codecs/hdac_hda.c static int hdac_hda_dev_remove(struct hdac_device *hdev) hdev 500 sound/soc/codecs/hdac_hda.c hda_pvt = dev_get_drvdata(&hdev->dev); hdev 80 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev; hdev 131 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev; hdev 166 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = port->pin->hdev; hdev 176 sound/soc/codecs/hdac_hdmi.c dev_dbg(&hdev->dev, hdev 224 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_get_port_len(struct hdac_device *hdev, hda_nid_t nid) hdev 229 sound/soc/codecs/hdac_hdmi.c caps = get_wcaps(hdev, nid); hdev 235 sound/soc/codecs/hdac_hdmi.c param = snd_hdac_read_parm_uncached(hdev, nid, AC_PAR_DEVLIST_LEN); hdev 247 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_port_select_get(struct hdac_device *hdev, hdev 250 sound/soc/codecs/hdac_hdmi.c return snd_hdac_codec_read(hdev, port->pin->nid, hdev 258 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_port_select_set(struct hdac_device *hdev, hdev 267 sound/soc/codecs/hdac_hdmi.c num_ports = hdac_hdmi_get_port_len(hdev, port->pin->nid); hdev 277 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, port->pin->nid, 0, hdev 280 sound/soc/codecs/hdac_hdmi.c if (port->id != hdac_hdmi_port_select_get(hdev, port)) hdev 283 sound/soc/codecs/hdac_hdmi.c dev_dbg(&hdev->dev, "Selected the port=%d\n", port->id); hdev 341 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_set_dip_index(struct hdac_device *hdev, hda_nid_t pin_nid, hdev 347 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, pin_nid, 0, AC_VERB_SET_HDMI_DIP_INDEX, val); hdev 362 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_setup_audio_infoframe(struct hdac_device *hdev, hdev 369 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 378 sound/soc/codecs/hdac_hdmi.c ca = snd_hdac_channel_allocation(hdev, port->eld.info.spk_alloc, hdev 382 sound/soc/codecs/hdac_hdmi.c hdmi->chmap.ops.set_channel_count(hdev, cvt->nid, channels); hdev 415 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, "Invalid connection type: %d\n", conn_type); hdev 420 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_set_dip_index(hdev, pin->nid, 0x0, 0x0); hdev 421 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, pin->nid, 0, hdev 426 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_set_dip_index(hdev, pin->nid, 0x0, 0x0); hdev 429 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, pin->nid, 0, hdev 433 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, pin->nid, 0, hdev 438 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_set_dip_index(hdev, pin->nid, 0x0, 0x0); hdev 439 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, pin->nid, 0, hdev 450 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = hdmi->hdev; hdev 454 sound/soc/codecs/hdac_hdmi.c dev_dbg(&hdev->dev, "%s: strm_tag: %d\n", __func__, tx_mask); hdev 490 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_query_port_connlist(struct hdac_device *hdev, hdev 494 sound/soc/codecs/hdac_hdmi.c if (!(get_wcaps(hdev, pin->nid) & AC_WCAP_CONN_LIST)) { hdev 495 sound/soc/codecs/hdac_hdmi.c dev_warn(&hdev->dev, hdev 497 sound/soc/codecs/hdac_hdmi.c pin->nid, get_wcaps(hdev, pin->nid)); hdev 501 sound/soc/codecs/hdac_hdmi.c if (hdac_hdmi_port_select_set(hdev, port) < 0) hdev 504 sound/soc/codecs/hdac_hdmi.c port->num_mux_nids = snd_hdac_get_connections(hdev, pin->nid, hdev 507 sound/soc/codecs/hdac_hdmi.c dev_warn(&hdev->dev, hdev 511 sound/soc/codecs/hdac_hdmi.c dev_dbg(&hdev->dev, "num_mux_nids %d for pin:port %d:%d\n", hdev 527 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev, hdev 542 sound/soc/codecs/hdac_hdmi.c ret = hdac_hdmi_query_port_connlist(hdev, hdev 565 sound/soc/codecs/hdac_hdmi.c static void hdac_hdmi_verify_connect_sel_all_pins(struct hdac_device *hdev) hdev 567 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 573 sound/soc/codecs/hdac_hdmi.c port = hdac_hdmi_get_port_from_cvt(hdev, hdmi, cvt); hdev 575 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, port->pin->nid, 0, hdev 577 sound/soc/codecs/hdac_hdmi.c dev_dbg(&hdev->dev, "%s: %s set connect %d -> %d\n", hdev 593 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = hdmi->hdev; hdev 602 sound/soc/codecs/hdac_hdmi.c port = hdac_hdmi_get_port_from_cvt(hdev, hdmi, cvt); hdev 613 sound/soc/codecs/hdac_hdmi.c dev_warn(&hdev->dev, hdev 656 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_query_cvt_params(struct hdac_device *hdev, struct hdac_hdmi_cvt *cvt) hdev 659 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 662 sound/soc/codecs/hdac_hdmi.c chans = get_wcaps(hdev, cvt->nid); hdev 671 sound/soc/codecs/hdac_hdmi.c err = snd_hdac_query_supported_pcm(hdev, cvt->nid, hdev 676 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, hdev 718 sound/soc/codecs/hdac_hdmi.c static struct hdac_hdmi_pcm *hdac_hdmi_get_pcm(struct hdac_device *hdev, hdev 721 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 738 sound/soc/codecs/hdac_hdmi.c static void hdac_hdmi_set_power_state(struct hdac_device *hdev, hdev 744 sound/soc/codecs/hdac_hdmi.c if (get_wcaps(hdev, nid) & AC_WCAP_POWER) { hdev 745 sound/soc/codecs/hdac_hdmi.c if (!snd_hdac_check_power_state(hdev, nid, pwr_state)) { hdev 747 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_read(hdev, nid, 0, hdev 750 sound/soc/codecs/hdac_hdmi.c state = snd_hdac_sync_power_state(hdev, hdev 759 sound/soc/codecs/hdac_hdmi.c static void hdac_hdmi_set_amp(struct hdac_device *hdev, hdev 762 sound/soc/codecs/hdac_hdmi.c if (get_wcaps(hdev, nid) & AC_WCAP_OUT_AMP) hdev 763 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, nid, 0, hdev 772 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = dev_to_hdac_dev(w->dapm->dev); hdev 775 sound/soc/codecs/hdac_hdmi.c dev_dbg(&hdev->dev, "%s: widget: %s event: %x\n", hdev 778 sound/soc/codecs/hdac_hdmi.c pcm = hdac_hdmi_get_pcm(hdev, port); hdev 783 sound/soc/codecs/hdac_hdmi.c if (hdac_hdmi_port_select_set(hdev, port) < 0) hdev 788 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_set_power_state(hdev, port->pin->nid, AC_PWRST_D0); hdev 791 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, port->pin->nid, 0, hdev 794 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_set_amp(hdev, port->pin->nid, AMP_OUT_UNMUTE); hdev 796 sound/soc/codecs/hdac_hdmi.c return hdac_hdmi_setup_audio_infoframe(hdev, pcm, port); hdev 799 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_set_amp(hdev, port->pin->nid, AMP_OUT_MUTE); hdev 802 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, port->pin->nid, 0, hdev 805 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_set_power_state(hdev, port->pin->nid, AC_PWRST_D3); hdev 817 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = dev_to_hdac_dev(w->dapm->dev); hdev 818 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 821 sound/soc/codecs/hdac_hdmi.c dev_dbg(&hdev->dev, "%s: widget: %s event: %x\n", hdev 830 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_set_power_state(hdev, cvt->nid, AC_PWRST_D0); hdev 833 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, cvt->nid, 0, hdev 837 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, cvt->nid, 0, hdev 840 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, cvt->nid, 0, hdev 842 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, cvt->nid, 0, hdev 850 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_verify_connect_sel_all_pins(hdev); hdev 855 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, cvt->nid, 0, hdev 857 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, cvt->nid, 0, hdev 860 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_set_power_state(hdev, cvt->nid, AC_PWRST_D3); hdev 872 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = dev_to_hdac_dev(w->dapm->dev); hdev 875 sound/soc/codecs/hdac_hdmi.c dev_dbg(&hdev->dev, "%s: widget: %s event: %x\n", hdev 884 sound/soc/codecs/hdac_hdmi.c if (hdac_hdmi_port_select_set(hdev, port) < 0) hdev 888 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_write(hdev, port->pin->nid, 0, hdev 907 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = dev_to_hdac_dev(dapm->dev); hdev 908 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 961 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_create_pin_port_muxs(struct hdac_device *hdev, hdev 966 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 978 sound/soc/codecs/hdac_hdmi.c kc = devm_kzalloc(&hdev->dev, sizeof(*kc), GFP_KERNEL); hdev 982 sound/soc/codecs/hdac_hdmi.c se = devm_kzalloc(&hdev->dev, sizeof(*se), GFP_KERNEL); hdev 988 sound/soc/codecs/hdac_hdmi.c kc->name = devm_kstrdup(&hdev->dev, kc_name, GFP_KERNEL); hdev 1006 sound/soc/codecs/hdac_hdmi.c items[i] = devm_kstrdup(&hdev->dev, mux_items, GFP_KERNEL); hdev 1013 sound/soc/codecs/hdac_hdmi.c items[i] = devm_kstrdup(&hdev->dev, mux_items, GFP_KERNEL); hdev 1018 sound/soc/codecs/hdac_hdmi.c se->texts = devm_kmemdup(&hdev->dev, items, hdev 1023 sound/soc/codecs/hdac_hdmi.c return hdac_hdmi_fill_widget_info(&hdev->dev, widget, hdev 1030 sound/soc/codecs/hdac_hdmi.c static void hdac_hdmi_add_pinmux_cvt_route(struct hdac_device *hdev, hdev 1034 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1076 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = dev_to_hdac_dev(dapm->dev); hdev 1077 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1129 sound/soc/codecs/hdac_hdmi.c ret = hdac_hdmi_create_pin_port_muxs(hdev, hdev 1164 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_add_pinmux_cvt_route(hdev, widgets, route, i); hdev 1176 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_init_dai_map(struct hdac_device *hdev) hdev 1178 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1194 sound/soc/codecs/hdac_hdmi.c dev_warn(&hdev->dev, hdev 1203 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_add_cvt(struct hdac_device *hdev, hda_nid_t nid) hdev 1205 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1209 sound/soc/codecs/hdac_hdmi.c cvt = devm_kzalloc(&hdev->dev, sizeof(*cvt), GFP_KERNEL); hdev 1215 sound/soc/codecs/hdac_hdmi.c cvt->name = devm_kstrdup(&hdev->dev, name, GFP_KERNEL); hdev 1222 sound/soc/codecs/hdac_hdmi.c return hdac_hdmi_query_cvt_params(hdev, cvt); hdev 1225 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_parse_eld(struct hdac_device *hdev, hdev 1234 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, "HDMI: Unknown ELD version %d\n", ver); hdev 1242 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, "HDMI: MNL Invalid %d\n", mnl); hdev 1254 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = pin->hdev; hdev 1255 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1273 sound/soc/codecs/hdac_hdmi.c size = snd_hdac_acomp_get_eld(hdev, pin->nid, port_id, hdev 1280 sound/soc/codecs/hdac_hdmi.c if (hdac_hdmi_parse_eld(hdev, port) < 0) hdev 1292 sound/soc/codecs/hdac_hdmi.c pcm = hdac_hdmi_get_pcm(hdev, port); hdev 1296 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, "%s: disconnect for pin:port %d:%d\n", hdev 1326 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_add_ports(struct hdac_device *hdev, hdev 1339 sound/soc/codecs/hdac_hdmi.c ports = devm_kcalloc(&hdev->dev, max_ports, sizeof(*ports), GFP_KERNEL); hdev 1353 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_add_pin(struct hdac_device *hdev, hda_nid_t nid) hdev 1355 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1359 sound/soc/codecs/hdac_hdmi.c pin = devm_kzalloc(&hdev->dev, sizeof(*pin), GFP_KERNEL); hdev 1365 sound/soc/codecs/hdac_hdmi.c pin->hdev = hdev; hdev 1366 sound/soc/codecs/hdac_hdmi.c ret = hdac_hdmi_add_ports(hdev, pin); hdev 1385 sound/soc/codecs/hdac_hdmi.c static void hdac_hdmi_skl_enable_all_pins(struct hdac_device *hdev) hdev 1388 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1391 sound/soc/codecs/hdac_hdmi.c vendor_param = snd_hdac_codec_read(hdev, vendor_nid, 0, hdev 1397 sound/soc/codecs/hdac_hdmi.c vendor_param = snd_hdac_codec_read(hdev, vendor_nid, 0, hdev 1403 sound/soc/codecs/hdac_hdmi.c static void hdac_hdmi_skl_enable_dp12(struct hdac_device *hdev) hdev 1406 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1409 sound/soc/codecs/hdac_hdmi.c vendor_param = snd_hdac_codec_read(hdev, vendor_nid, 0, hdev 1416 sound/soc/codecs/hdac_hdmi.c vendor_param = snd_hdac_codec_read(hdev, vendor_nid, 0, hdev 1434 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_create_dais(struct hdac_device *hdev, hdev 1447 sound/soc/codecs/hdac_hdmi.c hdmi_dais = devm_kzalloc(&hdev->dev, hdev 1454 sound/soc/codecs/hdac_hdmi.c ret = snd_hdac_query_supported_pcm(hdev, cvt->nid, hdev 1466 sound/soc/codecs/hdac_hdmi.c hdmi_dais[i].name = devm_kstrdup(&hdev->dev, hdev 1474 sound/soc/codecs/hdac_hdmi.c devm_kstrdup(&hdev->dev, name, GFP_KERNEL); hdev 1503 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_parse_and_map_nid(struct hdac_device *hdev, hdev 1508 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1511 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_skl_enable_all_pins(hdev); hdev 1512 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_skl_enable_dp12(hdev); hdev 1514 sound/soc/codecs/hdac_hdmi.c num_nodes = snd_hdac_get_sub_nodes(hdev, hdev->afg, &nid); hdev 1516 sound/soc/codecs/hdac_hdmi.c dev_warn(&hdev->dev, "HDMI: failed to get afg sub nodes\n"); hdev 1524 sound/soc/codecs/hdac_hdmi.c caps = get_wcaps(hdev, nid); hdev 1533 sound/soc/codecs/hdac_hdmi.c ret = hdac_hdmi_add_cvt(hdev, nid); hdev 1539 sound/soc/codecs/hdac_hdmi.c ret = hdac_hdmi_add_pin(hdev, nid); hdev 1548 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, "Bad pin/cvt setup in %s\n", __func__); hdev 1552 sound/soc/codecs/hdac_hdmi.c ret = hdac_hdmi_create_dais(hdev, dais, hdmi, hdmi->num_cvt); hdev 1554 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, "Failed to create dais with err: %d\n", hdev 1560 sound/soc/codecs/hdac_hdmi.c ret = hdac_hdmi_init_dai_map(hdev); hdev 1562 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, "Failed to init DAI map with err: %d\n", hdev 1569 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = aptr; hdev 1570 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1587 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, "Can't find the port for pin %d\n", pin); hdev 1593 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = aptr; hdev 1594 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1608 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, "Can't find the pin for port %d\n", port); hdev 1612 sound/soc/codecs/hdac_hdmi.c dev_dbg(&hdev->dev, "%s: for pin:%d port=%d\n", __func__, hdev 1625 sound/soc/codecs/hdac_hdmi.c if (atomic_read(&hdev->in_pm)) hdev 1673 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev) hdev 1680 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1719 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = hdmi->hdev; hdev 1774 sound/soc/codecs/hdac_hdmi.c ret = create_fill_jack_kcontrols(dapm->card, hdev); hdev 1795 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = hdmi->hdev; hdev 1804 sound/soc/codecs/hdac_hdmi.c pcm = devm_kzalloc(&hdev->dev, sizeof(*pcm), GFP_KERNEL); hdev 1817 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, hdev 1830 sound/soc/codecs/hdac_hdmi.c static void hdac_hdmi_present_sense_all_pins(struct hdac_device *hdev, hdev 1839 sound/soc/codecs/hdac_hdmi.c if (hdac_hdmi_get_port_len(hdev, pin->nid) == 0) hdev 1857 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = hdmi->hdev; hdev 1869 sound/soc/codecs/hdac_hdmi.c hlink = snd_hdac_ext_bus_get_link(hdev->bus, dev_name(&hdev->dev)); hdev 1871 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, "hdac link not found\n"); hdev 1875 sound/soc/codecs/hdac_hdmi.c snd_hdac_ext_bus_link_get(hdev->bus, hlink); hdev 1881 sound/soc/codecs/hdac_hdmi.c aops.audio_ptr = hdev; hdev 1882 sound/soc/codecs/hdac_hdmi.c ret = snd_hdac_acomp_register_notifier(hdev->bus, &aops); hdev 1884 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, "notifier register failed: err: %d\n", ret); hdev 1888 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_present_sense_all_pins(hdev, hdmi, true); hdev 1901 sound/soc/codecs/hdac_hdmi.c device_link_add(component->card->dev, &hdev->dev, DL_FLAG_RPM_ACTIVE | hdev 1907 sound/soc/codecs/hdac_hdmi.c pm_runtime_enable(&hdev->dev); hdev 1908 sound/soc/codecs/hdac_hdmi.c pm_runtime_put(&hdev->dev); hdev 1909 sound/soc/codecs/hdac_hdmi.c pm_runtime_suspend(&hdev->dev); hdev 1917 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = hdmi->hdev; hdev 1920 sound/soc/codecs/hdac_hdmi.c ret = snd_hdac_acomp_register_notifier(hdev->bus, NULL); hdev 1922 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, "notifier unregister failed: err: %d\n", hdev 1925 sound/soc/codecs/hdac_hdmi.c pm_runtime_disable(&hdev->dev); hdev 1931 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = dev_to_hdac_dev(dev); hdev 1932 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1948 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_present_sense_all_pins(hdev, hdmi, false); hdev 1963 sound/soc/codecs/hdac_hdmi.c static void hdac_hdmi_get_chmap(struct hdac_device *hdev, int pcm_idx, hdev 1966 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1972 sound/soc/codecs/hdac_hdmi.c static void hdac_hdmi_set_chmap(struct hdac_device *hdev, int pcm_idx, hdev 1975 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 1990 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_setup_audio_infoframe(hdev, pcm, port); hdev 1994 sound/soc/codecs/hdac_hdmi.c static bool is_hdac_hdmi_pcm_attached(struct hdac_device *hdev, int pcm_idx) hdev 1996 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 2008 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_get_spk_alloc(struct hdac_device *hdev, int pcm_idx) hdev 2010 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 2042 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_dev_probe(struct hdac_device *hdev) hdev 2049 sound/soc/codecs/hdac_hdmi.c struct hdac_driver *hdrv = drv_to_hdac_driver(hdev->dev.driver); hdev 2050 sound/soc/codecs/hdac_hdmi.c const struct hda_device_id *hdac_id = hdac_get_device_id(hdev, hdrv); hdev 2053 sound/soc/codecs/hdac_hdmi.c hlink = snd_hdac_ext_bus_get_link(hdev->bus, dev_name(&hdev->dev)); hdev 2055 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, "hdac link not found\n"); hdev 2059 sound/soc/codecs/hdac_hdmi.c snd_hdac_ext_bus_link_get(hdev->bus, hlink); hdev 2061 sound/soc/codecs/hdac_hdmi.c hdmi_priv = devm_kzalloc(&hdev->dev, sizeof(*hdmi_priv), GFP_KERNEL); hdev 2065 sound/soc/codecs/hdac_hdmi.c snd_hdac_register_chmap_ops(hdev, &hdmi_priv->chmap); hdev 2070 sound/soc/codecs/hdac_hdmi.c hdmi_priv->hdev = hdev; hdev 2081 sound/soc/codecs/hdac_hdmi.c dev_set_drvdata(&hdev->dev, hdmi_priv); hdev 2092 sound/soc/codecs/hdac_hdmi.c snd_hdac_display_power(hdev->bus, hdev->addr, true); hdev 2094 sound/soc/codecs/hdac_hdmi.c ret = hdac_hdmi_parse_and_map_nid(hdev, &hdmi_dais, &num_dais); hdev 2096 sound/soc/codecs/hdac_hdmi.c dev_err(&hdev->dev, hdev 2100 sound/soc/codecs/hdac_hdmi.c snd_hdac_refresh_widgets(hdev); hdev 2103 sound/soc/codecs/hdac_hdmi.c ret = devm_snd_soc_register_component(&hdev->dev, &hdmi_hda_codec, hdev 2106 sound/soc/codecs/hdac_hdmi.c snd_hdac_ext_bus_link_put(hdev->bus, hlink); hdev 2111 sound/soc/codecs/hdac_hdmi.c static void clear_dapm_works(struct hdac_device *hdev) hdev 2113 sound/soc/codecs/hdac_hdmi.c struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); hdev 2122 sound/soc/codecs/hdac_hdmi.c static int hdac_hdmi_dev_remove(struct hdac_device *hdev) hdev 2124 sound/soc/codecs/hdac_hdmi.c clear_dapm_works(hdev); hdev 2125 sound/soc/codecs/hdac_hdmi.c snd_hdac_display_power(hdev->bus, hdev->addr, false); hdev 2133 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = dev_to_hdac_dev(dev); hdev 2134 sound/soc/codecs/hdac_hdmi.c struct hdac_bus *bus = hdev->bus; hdev 2143 sound/soc/codecs/hdac_hdmi.c clear_dapm_works(hdev); hdev 2152 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_read(hdev, hdev->afg, 0, AC_VERB_SET_POWER_STATE, hdev 2161 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_link_down(hdev); hdev 2164 sound/soc/codecs/hdac_hdmi.c snd_hdac_display_power(bus, hdev->addr, false); hdev 2171 sound/soc/codecs/hdac_hdmi.c struct hdac_device *hdev = dev_to_hdac_dev(dev); hdev 2172 sound/soc/codecs/hdac_hdmi.c struct hdac_bus *bus = hdev->bus; hdev 2188 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_link_up(hdev); hdev 2190 sound/soc/codecs/hdac_hdmi.c snd_hdac_display_power(bus, hdev->addr, true); hdev 2192 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_skl_enable_all_pins(hdev); hdev 2193 sound/soc/codecs/hdac_hdmi.c hdac_hdmi_skl_enable_dp12(hdev); hdev 2196 sound/soc/codecs/hdac_hdmi.c snd_hdac_codec_read(hdev, hdev->afg, 0, AC_VERB_SET_POWER_STATE, hdev 704 sound/soc/intel/skylake/skl.c struct hdac_device *hdev; hdev 721 sound/soc/intel/skylake/skl.c hdev = &hda_codec->codec.core; hdev 723 sound/soc/intel/skylake/skl.c err = snd_hdac_ext_bus_device_init(bus, addr, hdev); hdev 729 sound/soc/intel/skylake/skl.c hdev->type = HDA_DEV_LEGACY; hdev 734 sound/soc/intel/skylake/skl.c hdev = devm_kzalloc(&skl->pci->dev, sizeof(*hdev), GFP_KERNEL); hdev 735 sound/soc/intel/skylake/skl.c if (!hdev) hdev 738 sound/soc/intel/skylake/skl.c return snd_hdac_ext_bus_device_init(bus, addr, hdev); hdev 88 sound/soc/sof/intel/hda-codec.c struct hdac_device *hdev; hdev 109 sound/soc/sof/intel/hda-codec.c hdev = &hda_priv->codec.core; hdev 111 sound/soc/sof/intel/hda-codec.c ret = snd_hdac_ext_bus_device_init(&hbus->core, address, hdev); hdev 117 sound/soc/sof/intel/hda-codec.c hdev->type = HDA_DEV_LEGACY; hdev 129 sound/soc/sof/intel/hda-codec.c hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL); hdev 130 sound/soc/sof/intel/hda-codec.c if (!hdev) hdev 133 sound/soc/sof/intel/hda-codec.c ret = snd_hdac_ext_bus_device_init(&hbus->core, address, hdev); hdev 499 sound/soc/sof/intel/hda.c struct sof_intel_hda_dev *hdev; hdev 528 sound/soc/sof/intel/hda.c hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL); hdev 529 sound/soc/sof/intel/hda.c if (!hdev) hdev 531 sound/soc/sof/intel/hda.c sdev->pdata->hw_pdata = hdev; hdev 532 sound/soc/sof/intel/hda.c hdev->desc = chip; hdev 534 sound/soc/sof/intel/hda.c hdev->dmic_dev = platform_device_register_data(sdev->dev, "dmic-codec", hdev 537 sound/soc/sof/intel/hda.c if (IS_ERR(hdev->dmic_dev)) { hdev 539 sound/soc/sof/intel/hda.c return PTR_ERR(hdev->dmic_dev); hdev 547 sound/soc/sof/intel/hda.c hdev->no_ipc_position = 0; hdev 549 sound/soc/sof/intel/hda.c hdev->no_ipc_position = sof_ops(sdev)->pcm_pointer ? 1 : 0; hdev 600 sound/soc/sof/intel/hda.c hdev->irq = pci_irq_vector(pci, 0); hdev 602 sound/soc/sof/intel/hda.c sdev->ipc_irq = hdev->irq; hdev 613 sound/soc/sof/intel/hda.c hdev->irq = pci->irq; hdev 617 sound/soc/sof/intel/hda.c dev_dbg(sdev->dev, "using HDA IRQ %d\n", hdev->irq); hdev 618 sound/soc/sof/intel/hda.c ret = request_threaded_irq(hdev->irq, hda_dsp_stream_interrupt, hdev 623 sound/soc/sof/intel/hda.c hdev->irq); hdev 666 sound/soc/sof/intel/hda.c free_irq(hdev->irq, bus);