Lines Matching refs:bcm4377
527 int (*send_calibration)(struct bcm4377_data *bcm4377);
528 int (*send_ptb)(struct bcm4377_data *bcm4377,
613 static void bcm4377_ring_doorbell(struct bcm4377_data *bcm4377, u8 doorbell, in bcm4377_ring_doorbell() argument
622 dev_dbg(&bcm4377->pdev->dev, "write %d to doorbell #%d (0x%x)\n", val, in bcm4377_ring_doorbell()
624 iowrite32(db, bcm4377->bar0 + BCM4377_BAR0_DOORBELL); in bcm4377_ring_doorbell()
627 static int bcm4377_extract_msgid(struct bcm4377_data *bcm4377, in bcm4377_extract_msgid() argument
636 &bcm4377->pdev->dev, in bcm4377_extract_msgid()
643 dev_warn(&bcm4377->pdev->dev, in bcm4377_extract_msgid()
652 static void bcm4377_handle_event(struct bcm4377_data *bcm4377, in bcm4377_handle_event() argument
664 dev_warn(&bcm4377->pdev->dev, in bcm4377_handle_event()
672 if (bcm4377_extract_msgid(bcm4377, ring, raw_msgid, &msgid)) in bcm4377_handle_event()
677 &bcm4377->pdev->dev, in bcm4377_handle_event()
692 hci_recv_frame(bcm4377->hdev, skb); in bcm4377_handle_event()
695 head = le16_to_cpu(bcm4377->ring_state->xfer_ring_head[ring->ring_id]); in bcm4377_handle_event()
697 bcm4377->ring_state->xfer_ring_head[ring->ring_id] = cpu_to_le16(head); in bcm4377_handle_event()
699 bcm4377_ring_doorbell(bcm4377, ring->doorbell, head); in bcm4377_handle_event()
704 static void bcm4377_handle_ack(struct bcm4377_data *bcm4377, in bcm4377_handle_ack() argument
713 if (bcm4377_extract_msgid(bcm4377, ring, raw_msgid, &msgid)) in bcm4377_handle_ack()
718 &bcm4377->pdev->dev, in bcm4377_handle_ack()
735 static void bcm4377_handle_completion(struct bcm4377_data *bcm4377, in bcm4377_handle_completion() argument
745 dev_warn(&bcm4377->pdev->dev, in bcm4377_handle_completion()
760 &bcm4377->pdev->dev, in bcm4377_handle_completion()
766 dev_dbg(&bcm4377->pdev->dev, in bcm4377_handle_completion()
772 bcm4377_handle_ack(bcm4377, &bcm4377->control_h2d_ring, msg_id); in bcm4377_handle_completion()
775 bcm4377_handle_ack(bcm4377, &bcm4377->hci_h2d_ring, msg_id); in bcm4377_handle_completion()
778 bcm4377_handle_ack(bcm4377, &bcm4377->sco_h2d_ring, msg_id); in bcm4377_handle_completion()
781 bcm4377_handle_ack(bcm4377, &bcm4377->acl_h2d_ring, msg_id); in bcm4377_handle_completion()
785 bcm4377_handle_event(bcm4377, &bcm4377->hci_d2h_ring, msg_id, in bcm4377_handle_completion()
790 bcm4377_handle_event(bcm4377, &bcm4377->sco_d2h_ring, msg_id, in bcm4377_handle_completion()
795 bcm4377_handle_event(bcm4377, &bcm4377->acl_d2h_ring, msg_id, in bcm4377_handle_completion()
802 &bcm4377->pdev->dev, in bcm4377_handle_completion()
808 static void bcm4377_poll_completion_ring(struct bcm4377_data *bcm4377, in bcm4377_poll_completion_ring() argument
812 __le16 *heads = bcm4377->ring_state->completion_ring_head; in bcm4377_poll_completion_ring()
813 __le16 *tails = bcm4377->ring_state->completion_ring_tail; in bcm4377_poll_completion_ring()
819 dev_dbg(&bcm4377->pdev->dev, in bcm4377_poll_completion_ring()
831 bcm4377_handle_completion(bcm4377, ring, tail); in bcm4377_poll_completion_ring()
840 struct bcm4377_data *bcm4377 = data; in bcm4377_irq() local
843 bootstage = ioread32(bcm4377->bar2 + bcm4377->hw->bar2_offset + BCM4377_BAR2_BOOTSTAGE); in bcm4377_irq()
844 rti_status = ioread32(bcm4377->bar2 + bcm4377->hw->bar2_offset + BCM4377_BAR2_RTI_STATUS); in bcm4377_irq()
846 if (bootstage != bcm4377->bootstage || in bcm4377_irq()
847 rti_status != bcm4377->rti_status) { in bcm4377_irq()
848 dev_dbg(&bcm4377->pdev->dev, in bcm4377_irq()
850 bcm4377->bootstage, bootstage, bcm4377->rti_status, in bcm4377_irq()
852 complete(&bcm4377->event); in bcm4377_irq()
853 bcm4377->bootstage = bootstage; in bcm4377_irq()
854 bcm4377->rti_status = rti_status; in bcm4377_irq()
858 dev_err(&bcm4377->pdev->dev, "RTI status is %d\n", rti_status); in bcm4377_irq()
860 bcm4377_poll_completion_ring(bcm4377, &bcm4377->control_ack_ring); in bcm4377_irq()
861 bcm4377_poll_completion_ring(bcm4377, &bcm4377->hci_acl_event_ring); in bcm4377_irq()
862 bcm4377_poll_completion_ring(bcm4377, &bcm4377->hci_acl_ack_ring); in bcm4377_irq()
863 bcm4377_poll_completion_ring(bcm4377, &bcm4377->sco_ack_ring); in bcm4377_irq()
864 bcm4377_poll_completion_ring(bcm4377, &bcm4377->sco_event_ring); in bcm4377_irq()
869 static int bcm4377_enqueue(struct bcm4377_data *bcm4377, in bcm4377_enqueue() argument
884 &bcm4377->pdev->dev, in bcm4377_enqueue()
897 head = le16_to_cpu(bcm4377->ring_state->xfer_ring_head[ring->ring_id]); in bcm4377_enqueue()
898 tail = le16_to_cpu(bcm4377->ring_state->xfer_ring_tail[ring->ring_id]); in bcm4377_enqueue()
903 dev_warn(&bcm4377->pdev->dev, in bcm4377_enqueue()
912 dev_warn(&bcm4377->pdev->dev, in bcm4377_enqueue()
949 bcm4377->bar0 + BCM4377_BAR0_SLEEP_CONTROL); in bcm4377_enqueue()
951 dev_dbg(&bcm4377->pdev->dev, in bcm4377_enqueue()
954 bcm4377->ring_state->xfer_ring_head[ring->ring_id] = in bcm4377_enqueue()
958 bcm4377_ring_doorbell(bcm4377, ring->doorbell, new_head); in bcm4377_enqueue()
980 static int bcm4377_create_completion_ring(struct bcm4377_data *bcm4377, in bcm4377_create_completion_ring() argument
987 dev_warn(&bcm4377->pdev->dev, in bcm4377_create_completion_ring()
1006 ret = bcm4377_enqueue(bcm4377, &bcm4377->control_h2d_ring, &msg, in bcm4377_create_completion_ring()
1014 static int bcm4377_destroy_completion_ring(struct bcm4377_data *bcm4377, in bcm4377_destroy_completion_ring() argument
1024 ret = bcm4377_enqueue(bcm4377, &bcm4377->control_h2d_ring, &msg, in bcm4377_destroy_completion_ring()
1027 dev_warn(&bcm4377->pdev->dev, in bcm4377_destroy_completion_ring()
1035 static int bcm4377_create_transfer_ring(struct bcm4377_data *bcm4377, in bcm4377_create_transfer_ring() argument
1060 bcm4377->ring_state->xfer_ring_head[ring->ring_id] = 0; in bcm4377_create_transfer_ring()
1061 bcm4377->ring_state->xfer_ring_tail[ring->ring_id] = 0; in bcm4377_create_transfer_ring()
1065 ret = bcm4377_enqueue(bcm4377, &bcm4377->control_h2d_ring, &msg, in bcm4377_create_transfer_ring()
1093 bcm4377->ring_state->xfer_ring_head[ring->ring_id] = in bcm4377_create_transfer_ring()
1095 bcm4377_ring_doorbell(bcm4377, ring->doorbell, 0xf); in bcm4377_create_transfer_ring()
1104 static int bcm4377_destroy_transfer_ring(struct bcm4377_data *bcm4377, in bcm4377_destroy_transfer_ring() argument
1114 ret = bcm4377_enqueue(bcm4377, &bcm4377->control_h2d_ring, &msg, in bcm4377_destroy_transfer_ring()
1117 dev_warn(&bcm4377->pdev->dev, in bcm4377_destroy_transfer_ring()
1124 static int __bcm4378_send_calibration_chunk(struct bcm4377_data *bcm4377, in __bcm4378_send_calibration_chunk() argument
1139 skb = __hci_cmd_sync(bcm4377->hdev, 0xfd97, sizeof(cmd), &cmd, in __bcm4378_send_calibration_chunk()
1148 static int __bcm4378_send_calibration(struct bcm4377_data *bcm4377, in __bcm4378_send_calibration() argument
1157 dev_err(&bcm4377->pdev->dev, in __bcm4378_send_calibration()
1167 bcm4377, data + i * BCM4378_CALIBRATION_CHUNK_SIZE, in __bcm4378_send_calibration()
1170 dev_err(&bcm4377->pdev->dev, in __bcm4378_send_calibration()
1179 static int bcm4378_send_calibration(struct bcm4377_data *bcm4377) in bcm4378_send_calibration() argument
1181 if ((strcmp(bcm4377->stepping, "b1") == 0) || in bcm4378_send_calibration()
1182 strcmp(bcm4377->stepping, "b3") == 0) in bcm4378_send_calibration()
1184 bcm4377, bcm4377->taurus_beamforming_cal_blob, in bcm4378_send_calibration()
1185 bcm4377->taurus_beamforming_cal_size); in bcm4378_send_calibration()
1187 return __bcm4378_send_calibration(bcm4377, in bcm4378_send_calibration()
1188 bcm4377->taurus_cal_blob, in bcm4378_send_calibration()
1189 bcm4377->taurus_cal_size); in bcm4378_send_calibration()
1192 static int bcm4387_send_calibration(struct bcm4377_data *bcm4377) in bcm4387_send_calibration() argument
1194 if (strcmp(bcm4377->stepping, "c2") == 0) in bcm4387_send_calibration()
1196 bcm4377, bcm4377->taurus_beamforming_cal_blob, in bcm4387_send_calibration()
1197 bcm4377->taurus_beamforming_cal_size); in bcm4387_send_calibration()
1199 return __bcm4378_send_calibration(bcm4377, in bcm4387_send_calibration()
1200 bcm4377->taurus_cal_blob, in bcm4387_send_calibration()
1201 bcm4377->taurus_cal_size); in bcm4387_send_calibration()
1204 static int bcm4388_send_calibration(struct bcm4377_data *bcm4377) in bcm4388_send_calibration() argument
1208 bcm4377, bcm4377->taurus_beamforming_cal_blob, in bcm4388_send_calibration()
1209 bcm4377->taurus_beamforming_cal_size); in bcm4388_send_calibration()
1212 static const struct firmware *bcm4377_request_blob(struct bcm4377_data *bcm4377, in bcm4377_request_blob() argument
1220 bcm4377->hw->id, bcm4377->stepping, bcm4377->board_type, in bcm4377_request_blob()
1221 bcm4377->vendor, suffix); in bcm4377_request_blob()
1223 bcm4377->hw->id, bcm4377->stepping, bcm4377->board_type, in bcm4377_request_blob()
1225 dev_dbg(&bcm4377->pdev->dev, "Trying to load firmware: '%s' or '%s'\n", in bcm4377_request_blob()
1228 ret = firmware_request_nowarn(&fw, name0, &bcm4377->pdev->dev); in bcm4377_request_blob()
1231 ret = firmware_request_nowarn(&fw, name1, &bcm4377->pdev->dev); in bcm4377_request_blob()
1235 dev_err(&bcm4377->pdev->dev, in bcm4377_request_blob()
1240 static int bcm4377_send_ptb(struct bcm4377_data *bcm4377, in bcm4377_send_ptb() argument
1245 skb = __hci_cmd_sync(bcm4377->hdev, 0xfd98, fw->size, fw->data, in bcm4377_send_ptb()
1259 static int bcm4378_send_ptb_chunk(struct bcm4377_data *bcm4377, in bcm4378_send_ptb_chunk() argument
1273 skb = __hci_cmd_sync(bcm4377->hdev, 0xfe0d, sizeof(cmd), &cmd, in bcm4378_send_ptb_chunk()
1282 static int bcm4378_send_ptb(struct bcm4377_data *bcm4377, in bcm4378_send_ptb() argument
1292 dev_dbg(&bcm4377->pdev->dev, "sending ptb chunk %zu/%zu\n", in bcm4378_send_ptb()
1295 bcm4377, fw->data + i * BCM4378_PTB_CHUNK_SIZE, in bcm4378_send_ptb()
1298 dev_err(&bcm4377->pdev->dev, in bcm4378_send_ptb()
1309 struct bcm4377_data *bcm4377 = hci_get_drvdata(hdev); in bcm4377_hci_open() local
1312 dev_dbg(&bcm4377->pdev->dev, "creating rings\n"); in bcm4377_hci_open()
1314 ret = bcm4377_create_completion_ring(bcm4377, in bcm4377_hci_open()
1315 &bcm4377->hci_acl_ack_ring); in bcm4377_hci_open()
1318 ret = bcm4377_create_completion_ring(bcm4377, in bcm4377_hci_open()
1319 &bcm4377->hci_acl_event_ring); in bcm4377_hci_open()
1322 ret = bcm4377_create_completion_ring(bcm4377, &bcm4377->sco_ack_ring); in bcm4377_hci_open()
1325 ret = bcm4377_create_completion_ring(bcm4377, &bcm4377->sco_event_ring); in bcm4377_hci_open()
1328 dev_dbg(&bcm4377->pdev->dev, in bcm4377_hci_open()
1331 ret = bcm4377_create_transfer_ring(bcm4377, &bcm4377->hci_h2d_ring); in bcm4377_hci_open()
1334 ret = bcm4377_create_transfer_ring(bcm4377, &bcm4377->hci_d2h_ring); in bcm4377_hci_open()
1337 ret = bcm4377_create_transfer_ring(bcm4377, &bcm4377->sco_h2d_ring); in bcm4377_hci_open()
1340 ret = bcm4377_create_transfer_ring(bcm4377, &bcm4377->sco_d2h_ring); in bcm4377_hci_open()
1343 ret = bcm4377_create_transfer_ring(bcm4377, &bcm4377->acl_h2d_ring); in bcm4377_hci_open()
1346 ret = bcm4377_create_transfer_ring(bcm4377, &bcm4377->acl_d2h_ring); in bcm4377_hci_open()
1349 dev_dbg(&bcm4377->pdev->dev, in bcm4377_hci_open()
1355 bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->acl_h2d_ring); in bcm4377_hci_open()
1357 bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->sco_d2h_ring); in bcm4377_hci_open()
1359 bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->sco_h2d_ring); in bcm4377_hci_open()
1361 bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->hci_h2d_ring); in bcm4377_hci_open()
1363 bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->hci_d2h_ring); in bcm4377_hci_open()
1365 bcm4377_destroy_completion_ring(bcm4377, &bcm4377->sco_event_ring); in bcm4377_hci_open()
1367 bcm4377_destroy_completion_ring(bcm4377, &bcm4377->sco_ack_ring); in bcm4377_hci_open()
1369 bcm4377_destroy_completion_ring(bcm4377, &bcm4377->hci_acl_event_ring); in bcm4377_hci_open()
1371 bcm4377_destroy_completion_ring(bcm4377, &bcm4377->hci_acl_ack_ring); in bcm4377_hci_open()
1373 dev_err(&bcm4377->pdev->dev, "Creating rings failed with %d\n", ret); in bcm4377_hci_open()
1379 struct bcm4377_data *bcm4377 = hci_get_drvdata(hdev); in bcm4377_hci_close() local
1381 dev_dbg(&bcm4377->pdev->dev, "destroying rings in hci_close\n"); in bcm4377_hci_close()
1383 bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->acl_d2h_ring); in bcm4377_hci_close()
1384 bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->acl_h2d_ring); in bcm4377_hci_close()
1385 bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->sco_d2h_ring); in bcm4377_hci_close()
1386 bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->sco_h2d_ring); in bcm4377_hci_close()
1387 bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->hci_d2h_ring); in bcm4377_hci_close()
1388 bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->hci_h2d_ring); in bcm4377_hci_close()
1390 bcm4377_destroy_completion_ring(bcm4377, &bcm4377->sco_event_ring); in bcm4377_hci_close()
1391 bcm4377_destroy_completion_ring(bcm4377, &bcm4377->sco_ack_ring); in bcm4377_hci_close()
1392 bcm4377_destroy_completion_ring(bcm4377, &bcm4377->hci_acl_event_ring); in bcm4377_hci_close()
1393 bcm4377_destroy_completion_ring(bcm4377, &bcm4377->hci_acl_ack_ring); in bcm4377_hci_close()
1398 static bool bcm4377_is_valid_bdaddr(struct bcm4377_data *bcm4377, in bcm4377_is_valid_bdaddr() argument
1407 if (addr->b[4] != (bcm4377->hw->id & 0xff)) in bcm4377_is_valid_bdaddr()
1409 if (addr->b[5] != (bcm4377->hw->id >> 8)) in bcm4377_is_valid_bdaddr()
1414 static int bcm4377_check_bdaddr(struct bcm4377_data *bcm4377) in bcm4377_check_bdaddr() argument
1419 skb = __hci_cmd_sync(bcm4377->hdev, HCI_OP_READ_BD_ADDR, 0, NULL, in bcm4377_check_bdaddr()
1424 dev_err(&bcm4377->pdev->dev, "HCI_OP_READ_BD_ADDR failed (%d)", in bcm4377_check_bdaddr()
1430 dev_err(&bcm4377->pdev->dev, in bcm4377_check_bdaddr()
1437 if (!bcm4377_is_valid_bdaddr(bcm4377, &bda->bdaddr)) in bcm4377_check_bdaddr()
1438 set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &bcm4377->hdev->quirks); in bcm4377_check_bdaddr()
1446 struct bcm4377_data *bcm4377 = hci_get_drvdata(hdev); in bcm4377_hci_setup() local
1450 if (bcm4377->hw->send_calibration) { in bcm4377_hci_setup()
1451 ret = bcm4377->hw->send_calibration(bcm4377); in bcm4377_hci_setup()
1456 fw = bcm4377_request_blob(bcm4377, "ptb"); in bcm4377_hci_setup()
1458 dev_err(&bcm4377->pdev->dev, "failed to load PTB data"); in bcm4377_hci_setup()
1462 ret = bcm4377->hw->send_ptb(bcm4377, fw); in bcm4377_hci_setup()
1467 return bcm4377_check_bdaddr(bcm4377); in bcm4377_hci_setup()
1472 struct bcm4377_data *bcm4377 = hci_get_drvdata(hdev); in bcm4377_hci_send_frame() local
1479 ring = &bcm4377->hci_h2d_ring; in bcm4377_hci_send_frame()
1484 ring = &bcm4377->acl_h2d_ring; in bcm4377_hci_send_frame()
1489 ring = &bcm4377->sco_h2d_ring; in bcm4377_hci_send_frame()
1496 ret = bcm4377_enqueue(bcm4377, ring, skb->data, skb->len, false); in bcm4377_hci_send_frame()
1509 struct bcm4377_data *bcm4377 = hci_get_drvdata(hdev); in bcm4377_hci_set_bdaddr() local
1516 dev_err(&bcm4377->pdev->dev, in bcm4377_hci_set_bdaddr()
1525 static int bcm4377_alloc_transfer_ring(struct bcm4377_data *bcm4377, in bcm4377_alloc_transfer_ring() argument
1554 ring->ring = dmam_alloc_coherent(&bcm4377->pdev->dev, in bcm4377_alloc_transfer_ring()
1561 ring->events = devm_kcalloc(&bcm4377->pdev->dev, in bcm4377_alloc_transfer_ring()
1570 &bcm4377->pdev->dev, in bcm4377_alloc_transfer_ring()
1580 static int bcm4377_alloc_completion_ring(struct bcm4377_data *bcm4377, in bcm4377_alloc_completion_ring() argument
1594 ring->ring = dmam_alloc_coherent(&bcm4377->pdev->dev, in bcm4377_alloc_completion_ring()
1602 static int bcm4377_init_context(struct bcm4377_data *bcm4377) in bcm4377_init_context() argument
1604 struct device *dev = &bcm4377->pdev->dev; in bcm4377_init_context()
1607 bcm4377->ctx = dmam_alloc_coherent(dev, sizeof(*bcm4377->ctx), in bcm4377_init_context()
1608 &bcm4377->ctx_dma, GFP_KERNEL); in bcm4377_init_context()
1609 if (!bcm4377->ctx) in bcm4377_init_context()
1611 memset(bcm4377->ctx, 0, sizeof(*bcm4377->ctx)); in bcm4377_init_context()
1613 bcm4377->ring_state = in bcm4377_init_context()
1614 dmam_alloc_coherent(dev, sizeof(*bcm4377->ring_state), in bcm4377_init_context()
1615 &bcm4377->ring_state_dma, GFP_KERNEL); in bcm4377_init_context()
1616 if (!bcm4377->ring_state) in bcm4377_init_context()
1618 memset(bcm4377->ring_state, 0, sizeof(*bcm4377->ring_state)); in bcm4377_init_context()
1620 bcm4377->ctx->version = cpu_to_le16(1); in bcm4377_init_context()
1621 bcm4377->ctx->size = cpu_to_le16(sizeof(*bcm4377->ctx)); in bcm4377_init_context()
1622 bcm4377->ctx->enabled_caps = cpu_to_le32(2); in bcm4377_init_context()
1629 if (!dmam_alloc_coherent(&bcm4377->pdev->dev, 0x20, in bcm4377_init_context()
1632 bcm4377->ctx->peripheral_info_addr = cpu_to_le64(peripheral_info_dma); in bcm4377_init_context()
1634 bcm4377->ctx->xfer_ring_heads_addr = cpu_to_le64( in bcm4377_init_context()
1635 bcm4377->ring_state_dma + in bcm4377_init_context()
1637 bcm4377->ctx->xfer_ring_tails_addr = cpu_to_le64( in bcm4377_init_context()
1638 bcm4377->ring_state_dma + in bcm4377_init_context()
1640 bcm4377->ctx->completion_ring_heads_addr = cpu_to_le64( in bcm4377_init_context()
1641 bcm4377->ring_state_dma + in bcm4377_init_context()
1643 bcm4377->ctx->completion_ring_tails_addr = cpu_to_le64( in bcm4377_init_context()
1644 bcm4377->ring_state_dma + in bcm4377_init_context()
1647 bcm4377->ctx->n_completion_rings = in bcm4377_init_context()
1649 bcm4377->ctx->n_xfer_rings = cpu_to_le16(BCM4377_N_TRANSFER_RINGS); in bcm4377_init_context()
1651 bcm4377->ctx->control_completion_ring_addr = in bcm4377_init_context()
1652 cpu_to_le64(bcm4377->control_ack_ring.ring_dma); in bcm4377_init_context()
1653 bcm4377->ctx->control_completion_ring_n_entries = in bcm4377_init_context()
1654 cpu_to_le16(bcm4377->control_ack_ring.n_entries); in bcm4377_init_context()
1655 bcm4377->ctx->control_completion_ring_doorbell = cpu_to_le16(0xffff); in bcm4377_init_context()
1656 bcm4377->ctx->control_completion_ring_msi = 0; in bcm4377_init_context()
1657 bcm4377->ctx->control_completion_ring_header_size = 0; in bcm4377_init_context()
1658 bcm4377->ctx->control_completion_ring_footer_size = 0; in bcm4377_init_context()
1660 bcm4377->ctx->control_xfer_ring_addr = in bcm4377_init_context()
1661 cpu_to_le64(bcm4377->control_h2d_ring.ring_dma); in bcm4377_init_context()
1662 bcm4377->ctx->control_xfer_ring_n_entries = in bcm4377_init_context()
1663 cpu_to_le16(bcm4377->control_h2d_ring.n_entries); in bcm4377_init_context()
1664 bcm4377->ctx->control_xfer_ring_doorbell = in bcm4377_init_context()
1665 cpu_to_le16(bcm4377->control_h2d_ring.doorbell); in bcm4377_init_context()
1666 bcm4377->ctx->control_xfer_ring_msi = 0; in bcm4377_init_context()
1667 bcm4377->ctx->control_xfer_ring_header_size = 0; in bcm4377_init_context()
1668 bcm4377->ctx->control_xfer_ring_footer_size = in bcm4377_init_context()
1669 bcm4377->control_h2d_ring.payload_size / 4; in bcm4377_init_context()
1671 dev_dbg(&bcm4377->pdev->dev, "context initialized at IOVA %pad", in bcm4377_init_context()
1672 &bcm4377->ctx_dma); in bcm4377_init_context()
1677 static int bcm4377_prepare_rings(struct bcm4377_data *bcm4377) in bcm4377_prepare_rings() argument
1691 bcm4377->control_ack_ring.ring_id = BCM4377_ACK_RING_CONTROL; in bcm4377_prepare_rings()
1692 bcm4377->control_ack_ring.n_entries = 32; in bcm4377_prepare_rings()
1693 bcm4377->control_ack_ring.transfer_rings = in bcm4377_prepare_rings()
1696 bcm4377->hci_acl_ack_ring.ring_id = BCM4377_ACK_RING_HCI_ACL; in bcm4377_prepare_rings()
1697 bcm4377->hci_acl_ack_ring.n_entries = 2 * BCM4377_RING_N_ENTRIES; in bcm4377_prepare_rings()
1698 bcm4377->hci_acl_ack_ring.transfer_rings = in bcm4377_prepare_rings()
1700 bcm4377->hci_acl_ack_ring.delay = 1000; in bcm4377_prepare_rings()
1707 bcm4377->hci_acl_event_ring.ring_id = BCM4377_EVENT_RING_HCI_ACL; in bcm4377_prepare_rings()
1708 bcm4377->hci_acl_event_ring.payload_size = MAX_EVENT_PAYLOAD_SIZE; in bcm4377_prepare_rings()
1709 bcm4377->hci_acl_event_ring.n_entries = 2 * BCM4377_RING_N_ENTRIES; in bcm4377_prepare_rings()
1710 bcm4377->hci_acl_event_ring.transfer_rings = in bcm4377_prepare_rings()
1712 bcm4377->hci_acl_event_ring.delay = 1000; in bcm4377_prepare_rings()
1714 bcm4377->sco_ack_ring.ring_id = BCM4377_ACK_RING_SCO; in bcm4377_prepare_rings()
1715 bcm4377->sco_ack_ring.n_entries = BCM4377_RING_N_ENTRIES; in bcm4377_prepare_rings()
1716 bcm4377->sco_ack_ring.transfer_rings = BIT(BCM4377_XFER_RING_SCO_H2D); in bcm4377_prepare_rings()
1718 bcm4377->sco_event_ring.ring_id = BCM4377_EVENT_RING_SCO; in bcm4377_prepare_rings()
1719 bcm4377->sco_event_ring.payload_size = MAX_SCO_PAYLOAD_SIZE; in bcm4377_prepare_rings()
1720 bcm4377->sco_event_ring.n_entries = BCM4377_RING_N_ENTRIES; in bcm4377_prepare_rings()
1721 bcm4377->sco_event_ring.transfer_rings = BIT(BCM4377_XFER_RING_SCO_D2H); in bcm4377_prepare_rings()
1723 bcm4377->control_h2d_ring.ring_id = BCM4377_XFER_RING_CONTROL; in bcm4377_prepare_rings()
1724 bcm4377->control_h2d_ring.doorbell = BCM4377_DOORBELL_CONTROL; in bcm4377_prepare_rings()
1725 bcm4377->control_h2d_ring.payload_size = BCM4377_CONTROL_MSG_SIZE; in bcm4377_prepare_rings()
1726 bcm4377->control_h2d_ring.completion_ring = BCM4377_ACK_RING_CONTROL; in bcm4377_prepare_rings()
1727 bcm4377->control_h2d_ring.allow_wait = true; in bcm4377_prepare_rings()
1728 bcm4377->control_h2d_ring.n_entries = BCM4377_RING_N_ENTRIES; in bcm4377_prepare_rings()
1730 bcm4377->hci_h2d_ring.ring_id = BCM4377_XFER_RING_HCI_H2D; in bcm4377_prepare_rings()
1731 bcm4377->hci_h2d_ring.doorbell = BCM4377_DOORBELL_HCI_H2D; in bcm4377_prepare_rings()
1732 bcm4377->hci_h2d_ring.payload_size = MAX_EVENT_PAYLOAD_SIZE; in bcm4377_prepare_rings()
1733 bcm4377->hci_h2d_ring.completion_ring = BCM4377_ACK_RING_HCI_ACL; in bcm4377_prepare_rings()
1734 bcm4377->hci_h2d_ring.n_entries = BCM4377_RING_N_ENTRIES; in bcm4377_prepare_rings()
1736 bcm4377->hci_d2h_ring.ring_id = BCM4377_XFER_RING_HCI_D2H; in bcm4377_prepare_rings()
1737 bcm4377->hci_d2h_ring.doorbell = BCM4377_DOORBELL_HCI_D2H; in bcm4377_prepare_rings()
1738 bcm4377->hci_d2h_ring.completion_ring = BCM4377_EVENT_RING_HCI_ACL; in bcm4377_prepare_rings()
1739 bcm4377->hci_d2h_ring.virtual = true; in bcm4377_prepare_rings()
1740 bcm4377->hci_d2h_ring.n_entries = BCM4377_RING_N_ENTRIES; in bcm4377_prepare_rings()
1742 bcm4377->sco_h2d_ring.ring_id = BCM4377_XFER_RING_SCO_H2D; in bcm4377_prepare_rings()
1743 bcm4377->sco_h2d_ring.doorbell = BCM4377_DOORBELL_SCO; in bcm4377_prepare_rings()
1744 bcm4377->sco_h2d_ring.payload_size = MAX_SCO_PAYLOAD_SIZE; in bcm4377_prepare_rings()
1745 bcm4377->sco_h2d_ring.completion_ring = BCM4377_ACK_RING_SCO; in bcm4377_prepare_rings()
1746 bcm4377->sco_h2d_ring.sync = true; in bcm4377_prepare_rings()
1747 bcm4377->sco_h2d_ring.n_entries = BCM4377_RING_N_ENTRIES; in bcm4377_prepare_rings()
1749 bcm4377->sco_d2h_ring.ring_id = BCM4377_XFER_RING_SCO_D2H; in bcm4377_prepare_rings()
1750 bcm4377->sco_d2h_ring.doorbell = BCM4377_DOORBELL_SCO; in bcm4377_prepare_rings()
1751 bcm4377->sco_d2h_ring.completion_ring = BCM4377_EVENT_RING_SCO; in bcm4377_prepare_rings()
1752 bcm4377->sco_d2h_ring.virtual = true; in bcm4377_prepare_rings()
1753 bcm4377->sco_d2h_ring.sync = true; in bcm4377_prepare_rings()
1754 bcm4377->sco_d2h_ring.n_entries = BCM4377_RING_N_ENTRIES; in bcm4377_prepare_rings()
1760 bcm4377->acl_h2d_ring.ring_id = BCM4377_XFER_RING_ACL_H2D; in bcm4377_prepare_rings()
1761 bcm4377->acl_h2d_ring.doorbell = BCM4377_DOORBELL_ACL_H2D; in bcm4377_prepare_rings()
1762 bcm4377->acl_h2d_ring.mapped_payload_size = MAX_ACL_PAYLOAD_SIZE; in bcm4377_prepare_rings()
1763 bcm4377->acl_h2d_ring.completion_ring = BCM4377_ACK_RING_HCI_ACL; in bcm4377_prepare_rings()
1764 bcm4377->acl_h2d_ring.n_entries = BCM4377_RING_N_ENTRIES; in bcm4377_prepare_rings()
1770 bcm4377->acl_d2h_ring.ring_id = BCM4377_XFER_RING_ACL_D2H; in bcm4377_prepare_rings()
1771 bcm4377->acl_d2h_ring.doorbell = BCM4377_DOORBELL_ACL_D2H; in bcm4377_prepare_rings()
1772 bcm4377->acl_d2h_ring.completion_ring = BCM4377_EVENT_RING_HCI_ACL; in bcm4377_prepare_rings()
1773 bcm4377->acl_d2h_ring.d2h_buffers_only = true; in bcm4377_prepare_rings()
1774 bcm4377->acl_d2h_ring.mapped_payload_size = MAX_ACL_PAYLOAD_SIZE; in bcm4377_prepare_rings()
1775 bcm4377->acl_d2h_ring.n_entries = BCM4377_RING_N_ENTRIES; in bcm4377_prepare_rings()
1781 ret = bcm4377_alloc_transfer_ring(bcm4377, &bcm4377->control_h2d_ring); in bcm4377_prepare_rings()
1784 ret = bcm4377_alloc_transfer_ring(bcm4377, &bcm4377->hci_h2d_ring); in bcm4377_prepare_rings()
1787 ret = bcm4377_alloc_transfer_ring(bcm4377, &bcm4377->hci_d2h_ring); in bcm4377_prepare_rings()
1790 ret = bcm4377_alloc_transfer_ring(bcm4377, &bcm4377->sco_h2d_ring); in bcm4377_prepare_rings()
1793 ret = bcm4377_alloc_transfer_ring(bcm4377, &bcm4377->sco_d2h_ring); in bcm4377_prepare_rings()
1796 ret = bcm4377_alloc_transfer_ring(bcm4377, &bcm4377->acl_h2d_ring); in bcm4377_prepare_rings()
1799 ret = bcm4377_alloc_transfer_ring(bcm4377, &bcm4377->acl_d2h_ring); in bcm4377_prepare_rings()
1803 ret = bcm4377_alloc_completion_ring(bcm4377, in bcm4377_prepare_rings()
1804 &bcm4377->control_ack_ring); in bcm4377_prepare_rings()
1807 ret = bcm4377_alloc_completion_ring(bcm4377, in bcm4377_prepare_rings()
1808 &bcm4377->hci_acl_ack_ring); in bcm4377_prepare_rings()
1811 ret = bcm4377_alloc_completion_ring(bcm4377, in bcm4377_prepare_rings()
1812 &bcm4377->hci_acl_event_ring); in bcm4377_prepare_rings()
1815 ret = bcm4377_alloc_completion_ring(bcm4377, &bcm4377->sco_ack_ring); in bcm4377_prepare_rings()
1818 ret = bcm4377_alloc_completion_ring(bcm4377, &bcm4377->sco_event_ring); in bcm4377_prepare_rings()
1822 dev_dbg(&bcm4377->pdev->dev, "all rings allocated and prepared\n"); in bcm4377_prepare_rings()
1827 static int bcm4377_boot(struct bcm4377_data *bcm4377) in bcm4377_boot() argument
1835 bootstage = ioread32(bcm4377->bar2 + bcm4377->hw->bar2_offset + BCM4377_BAR2_BOOTSTAGE); in bcm4377_boot()
1836 rti_status = ioread32(bcm4377->bar2 + bcm4377->hw->bar2_offset + BCM4377_BAR2_RTI_STATUS); in bcm4377_boot()
1839 dev_err(&bcm4377->pdev->dev, "bootstage is %d and not 0\n", in bcm4377_boot()
1845 dev_err(&bcm4377->pdev->dev, "RTI status is %d and not 0\n", in bcm4377_boot()
1850 fw = bcm4377_request_blob(bcm4377, "bin"); in bcm4377_boot()
1852 dev_err(&bcm4377->pdev->dev, "Failed to load firmware\n"); in bcm4377_boot()
1856 bfr = dma_alloc_coherent(&bcm4377->pdev->dev, fw->size, &fw_dma, in bcm4377_boot()
1865 iowrite32(0, bcm4377->bar0 + BCM4377_BAR0_HOST_WINDOW_LO); in bcm4377_boot()
1866 iowrite32(0, bcm4377->bar0 + BCM4377_BAR0_HOST_WINDOW_HI); in bcm4377_boot()
1868 bcm4377->bar0 + BCM4377_BAR0_HOST_WINDOW_SIZE); in bcm4377_boot()
1871 bcm4377->bar2 + bcm4377->hw->bar2_offset + BCM4377_BAR2_FW_LO); in bcm4377_boot()
1873 bcm4377->bar2 + bcm4377->hw->bar2_offset + BCM4377_BAR2_FW_HI); in bcm4377_boot()
1875 bcm4377->bar2 + bcm4377->hw->bar2_offset + BCM4377_BAR2_FW_SIZE); in bcm4377_boot()
1876 iowrite32(0, bcm4377->bar0 + BCM4377_BAR0_FW_DOORBELL); in bcm4377_boot()
1878 dev_dbg(&bcm4377->pdev->dev, "waiting for firmware to boot\n"); in bcm4377_boot()
1880 ret = wait_for_completion_interruptible_timeout(&bcm4377->event, in bcm4377_boot()
1889 if (bcm4377->bootstage != 2) { in bcm4377_boot()
1890 dev_err(&bcm4377->pdev->dev, "boostage %d != 2\n", in bcm4377_boot()
1891 bcm4377->bootstage); in bcm4377_boot()
1896 dev_dbg(&bcm4377->pdev->dev, "firmware has booted (stage = %x)\n", in bcm4377_boot()
1897 bcm4377->bootstage); in bcm4377_boot()
1901 dma_free_coherent(&bcm4377->pdev->dev, fw->size, bfr, fw_dma); in bcm4377_boot()
1907 static int bcm4377_setup_rti(struct bcm4377_data *bcm4377) in bcm4377_setup_rti() argument
1911 dev_dbg(&bcm4377->pdev->dev, "starting RTI\n"); in bcm4377_setup_rti()
1912 iowrite32(1, bcm4377->bar0 + BCM4377_BAR0_RTI_CONTROL); in bcm4377_setup_rti()
1914 ret = wait_for_completion_interruptible_timeout(&bcm4377->event, in bcm4377_setup_rti()
1917 dev_err(&bcm4377->pdev->dev, in bcm4377_setup_rti()
1924 if (bcm4377->rti_status != 1) { in bcm4377_setup_rti()
1925 dev_err(&bcm4377->pdev->dev, "RTI did not ack state 1 (%d)\n", in bcm4377_setup_rti()
1926 bcm4377->rti_status); in bcm4377_setup_rti()
1929 dev_dbg(&bcm4377->pdev->dev, "RTI is in state 1\n"); in bcm4377_setup_rti()
1932 iowrite32(0, bcm4377->bar2 + bcm4377->hw->bar2_offset + BCM4377_BAR2_RTI_WINDOW_LO); in bcm4377_setup_rti()
1933 iowrite32(0, bcm4377->bar2 + bcm4377->hw->bar2_offset + BCM4377_BAR2_RTI_WINDOW_HI); in bcm4377_setup_rti()
1935 bcm4377->bar2 + bcm4377->hw->bar2_offset + BCM4377_BAR2_RTI_WINDOW_SIZE); in bcm4377_setup_rti()
1938 iowrite32(lower_32_bits(bcm4377->ctx_dma), in bcm4377_setup_rti()
1939 bcm4377->bar2 + bcm4377->hw->bar2_offset + BCM4377_BAR2_CONTEXT_ADDR_LO); in bcm4377_setup_rti()
1940 iowrite32(upper_32_bits(bcm4377->ctx_dma), in bcm4377_setup_rti()
1941 bcm4377->bar2 + bcm4377->hw->bar2_offset + BCM4377_BAR2_CONTEXT_ADDR_HI); in bcm4377_setup_rti()
1942 iowrite32(2, bcm4377->bar0 + BCM4377_BAR0_RTI_CONTROL); in bcm4377_setup_rti()
1944 ret = wait_for_completion_interruptible_timeout(&bcm4377->event, in bcm4377_setup_rti()
1947 dev_err(&bcm4377->pdev->dev, in bcm4377_setup_rti()
1954 if (bcm4377->rti_status != 2) { in bcm4377_setup_rti()
1955 dev_err(&bcm4377->pdev->dev, "RTI did not ack state 2 (%d)\n", in bcm4377_setup_rti()
1956 bcm4377->rti_status); in bcm4377_setup_rti()
1960 dev_dbg(&bcm4377->pdev->dev, in bcm4377_setup_rti()
1962 bcm4377->control_ack_ring.enabled = true; in bcm4377_setup_rti()
1967 static int bcm4377_parse_otp_board_params(struct bcm4377_data *bcm4377, in bcm4377_parse_otp_board_params() argument
1972 if (len >= sizeof(bcm4377->vendor)) in bcm4377_parse_otp_board_params()
1975 strscpy(bcm4377->vendor, val, len + 1); in bcm4377_parse_otp_board_params()
1979 static int bcm4377_parse_otp_chip_params(struct bcm4377_data *bcm4377, char tag, in bcm4377_parse_otp_chip_params() argument
1986 if (len >= sizeof(bcm4377->stepping)) in bcm4377_parse_otp_chip_params()
1990 bcm4377->stepping[idx] = tolower(val[idx]); in bcm4377_parse_otp_chip_params()
1998 bcm4377->stepping[idx] = '\0'; in bcm4377_parse_otp_chip_params()
2002 static int bcm4377_parse_otp_str(struct bcm4377_data *bcm4377, const u8 *str, in bcm4377_parse_otp_str() argument
2027 ret = bcm4377_parse_otp_board_params(bcm4377, tag, p, in bcm4377_parse_otp_str()
2031 ret = bcm4377_parse_otp_chip_params(bcm4377, tag, p, in bcm4377_parse_otp_str()
2049 static int bcm4377_parse_otp_sys_vendor(struct bcm4377_data *bcm4377, u8 *otp, in bcm4377_parse_otp_sys_vendor() argument
2079 dev_dbg(&bcm4377->pdev->dev, in bcm4377_parse_otp_sys_vendor()
2083 ret = bcm4377_parse_otp_str(bcm4377, chip_params, in bcm4377_parse_otp_sys_vendor()
2088 ret = bcm4377_parse_otp_str(bcm4377, board_params, in bcm4377_parse_otp_sys_vendor()
2093 if (!bcm4377->stepping[0] || !bcm4377->vendor[0]) in bcm4377_parse_otp_sys_vendor()
2096 dev_dbg(&bcm4377->pdev->dev, "OTP: stepping=%s, vendor=%s\n", in bcm4377_parse_otp_sys_vendor()
2097 bcm4377->stepping, bcm4377->vendor); in bcm4377_parse_otp_sys_vendor()
2101 static int bcm4377_parse_otp(struct bcm4377_data *bcm4377) in bcm4377_parse_otp() argument
2112 otp[i] = ioread8(bcm4377->bar0 + bcm4377->hw->otp_offset + i); in bcm4377_parse_otp()
2127 dev_dbg(&bcm4377->pdev->dev, in bcm4377_parse_otp()
2129 ret = bcm4377_parse_otp_sys_vendor(bcm4377, &otp[i + 2], in bcm4377_parse_otp()
2133 dev_dbg(&bcm4377->pdev->dev, "OTP @ 0x%x (%d): CIS", i, in bcm4377_parse_otp()
2137 dev_dbg(&bcm4377->pdev->dev, "OTP @ 0x%x (%d): unknown", in bcm4377_parse_otp()
2149 static int bcm4377_init_cfg(struct bcm4377_data *bcm4377) in bcm4377_init_cfg() argument
2154 ret = pci_write_config_dword(bcm4377->pdev, in bcm4377_init_cfg()
2156 bcm4377->hw->bar0_window1); in bcm4377_init_cfg()
2160 ret = pci_write_config_dword(bcm4377->pdev, in bcm4377_init_cfg()
2162 bcm4377->hw->bar0_window2); in bcm4377_init_cfg()
2167 bcm4377->pdev, BCM4377_PCIECFG_BAR0_CORE2_WINDOW1, in bcm4377_init_cfg()
2172 if (bcm4377->hw->has_bar0_core2_window2) { in bcm4377_init_cfg()
2173 ret = pci_write_config_dword(bcm4377->pdev, in bcm4377_init_cfg()
2175 bcm4377->hw->bar0_core2_window2); in bcm4377_init_cfg()
2180 ret = pci_write_config_dword(bcm4377->pdev, BCM4377_PCIECFG_BAR2_WINDOW, in bcm4377_init_cfg()
2185 ret = pci_read_config_dword(bcm4377->pdev, in bcm4377_init_cfg()
2190 if (bcm4377->hw->clear_pciecfg_subsystem_ctrl_bit19) in bcm4377_init_cfg()
2194 return pci_write_config_dword(bcm4377->pdev, in bcm4377_init_cfg()
2198 static int bcm4377_probe_dmi(struct bcm4377_data *bcm4377) in bcm4377_probe_dmi() argument
2204 bcm4377->board_type = board_type_dmi_id->driver_data; in bcm4377_probe_dmi()
2205 dev_dbg(&bcm4377->pdev->dev, in bcm4377_probe_dmi()
2207 bcm4377->board_type); in bcm4377_probe_dmi()
2213 static int bcm4377_probe_of(struct bcm4377_data *bcm4377) in bcm4377_probe_of() argument
2215 struct device_node *np = bcm4377->pdev->dev.of_node; in bcm4377_probe_of()
2222 &bcm4377->board_type); in bcm4377_probe_of()
2224 dev_err(&bcm4377->pdev->dev, "no brcm,board-type property\n"); in bcm4377_probe_of()
2228 bcm4377->taurus_beamforming_cal_blob = in bcm4377_probe_of()
2230 &bcm4377->taurus_beamforming_cal_size); in bcm4377_probe_of()
2231 if (!bcm4377->taurus_beamforming_cal_blob) { in bcm4377_probe_of()
2232 dev_err(&bcm4377->pdev->dev, in bcm4377_probe_of()
2236 bcm4377->taurus_cal_blob = of_get_property(np, "brcm,taurus-cal-blob", in bcm4377_probe_of()
2237 &bcm4377->taurus_cal_size); in bcm4377_probe_of()
2238 if (!bcm4377->taurus_cal_blob) { in bcm4377_probe_of()
2239 dev_err(&bcm4377->pdev->dev, in bcm4377_probe_of()
2247 static void bcm4377_disable_aspm(struct bcm4377_data *bcm4377) in bcm4377_disable_aspm() argument
2249 pci_disable_link_state(bcm4377->pdev, in bcm4377_disable_aspm()
2257 pcie_capability_clear_word(bcm4377->pdev, PCI_EXP_LNKCTL, in bcm4377_disable_aspm()
2278 struct bcm4377_data *bcm4377; in bcm4377_probe() local
2286 bcm4377 = devm_kzalloc(&pdev->dev, sizeof(*bcm4377), GFP_KERNEL); in bcm4377_probe()
2287 if (!bcm4377) in bcm4377_probe()
2290 bcm4377->pdev = pdev; in bcm4377_probe()
2291 bcm4377->hw = &bcm4377_hw_variants[id->driver_data]; in bcm4377_probe()
2292 init_completion(&bcm4377->event); in bcm4377_probe()
2294 ret = bcm4377_prepare_rings(bcm4377); in bcm4377_probe()
2298 ret = bcm4377_init_context(bcm4377); in bcm4377_probe()
2302 ret = bcm4377_probe_dmi(bcm4377); in bcm4377_probe()
2305 ret = bcm4377_probe_of(bcm4377); in bcm4377_probe()
2308 if (!bcm4377->board_type) { in bcm4377_probe()
2313 if (bcm4377->hw->disable_aspm) in bcm4377_probe()
2314 bcm4377_disable_aspm(bcm4377); in bcm4377_probe()
2336 ret = bcm4377_init_cfg(bcm4377); in bcm4377_probe()
2340 bcm4377->bar0 = pcim_iomap(pdev, 0, 0); in bcm4377_probe()
2341 if (!bcm4377->bar0) in bcm4377_probe()
2343 bcm4377->bar2 = pcim_iomap(pdev, 2, 0); in bcm4377_probe()
2344 if (!bcm4377->bar2) in bcm4377_probe()
2347 ret = bcm4377_parse_otp(bcm4377); in bcm4377_probe()
2371 bcm4377); in bcm4377_probe()
2382 bcm4377->hdev = hdev; in bcm4377_probe()
2391 if (bcm4377->hw->broken_mws_transport_config) in bcm4377_probe()
2393 if (bcm4377->hw->broken_ext_scan) in bcm4377_probe()
2395 if (bcm4377->hw->broken_le_coded) in bcm4377_probe()
2397 if (bcm4377->hw->broken_le_ext_adv_report_phy) in bcm4377_probe()
2400 pci_set_drvdata(pdev, bcm4377); in bcm4377_probe()
2401 hci_set_drvdata(hdev, bcm4377); in bcm4377_probe()
2404 ret = bcm4377_boot(bcm4377); in bcm4377_probe()
2408 ret = bcm4377_setup_rti(bcm4377); in bcm4377_probe()
2421 struct bcm4377_data *bcm4377 = pci_get_drvdata(pdev); in bcm4377_suspend() local
2424 ret = hci_suspend_dev(bcm4377->hdev); in bcm4377_suspend()
2429 bcm4377->bar0 + BCM4377_BAR0_SLEEP_CONTROL); in bcm4377_suspend()
2436 struct bcm4377_data *bcm4377 = pci_get_drvdata(pdev); in bcm4377_resume() local
2439 bcm4377->bar0 + BCM4377_BAR0_SLEEP_CONTROL); in bcm4377_resume()
2441 return hci_resume_dev(bcm4377->hdev); in bcm4377_resume()