qca               214 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca               217 drivers/bluetooth/hci_qca.c 	bool old_vote = (qca->tx_vote | qca->rx_vote);
qca               222 drivers/bluetooth/hci_qca.c 		diff = jiffies_to_msecs(jiffies - qca->vote_last_jif);
qca               225 drivers/bluetooth/hci_qca.c 			qca->vote_off_ms += diff;
qca               227 drivers/bluetooth/hci_qca.c 			qca->vote_on_ms += diff;
qca               231 drivers/bluetooth/hci_qca.c 		qca->tx_vote = true;
qca               232 drivers/bluetooth/hci_qca.c 		qca->tx_votes_on++;
qca               237 drivers/bluetooth/hci_qca.c 		qca->rx_vote = true;
qca               238 drivers/bluetooth/hci_qca.c 		qca->rx_votes_on++;
qca               243 drivers/bluetooth/hci_qca.c 		qca->tx_vote = false;
qca               244 drivers/bluetooth/hci_qca.c 		qca->tx_votes_off++;
qca               245 drivers/bluetooth/hci_qca.c 		new_vote = qca->rx_vote | qca->tx_vote;
qca               249 drivers/bluetooth/hci_qca.c 		qca->rx_vote = false;
qca               250 drivers/bluetooth/hci_qca.c 		qca->rx_votes_off++;
qca               251 drivers/bluetooth/hci_qca.c 		new_vote = qca->rx_vote | qca->tx_vote;
qca               268 drivers/bluetooth/hci_qca.c 		diff = jiffies_to_msecs(jiffies - qca->vote_last_jif);
qca               271 drivers/bluetooth/hci_qca.c 			qca->votes_on++;
qca               272 drivers/bluetooth/hci_qca.c 			qca->vote_off_ms += diff;
qca               274 drivers/bluetooth/hci_qca.c 			qca->votes_off++;
qca               275 drivers/bluetooth/hci_qca.c 			qca->vote_on_ms += diff;
qca               277 drivers/bluetooth/hci_qca.c 		qca->vote_last_jif = jiffies;
qca               288 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca               301 drivers/bluetooth/hci_qca.c 	skb_queue_tail(&qca->txq, skb);
qca               308 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = container_of(work, struct qca_data,
qca               310 drivers/bluetooth/hci_qca.c 	struct hci_uart *hu = qca->hu;
qca               319 drivers/bluetooth/hci_qca.c 	spin_lock_irqsave(&qca->hci_ibs_lock, flags);
qca               325 drivers/bluetooth/hci_qca.c 	qca->ibs_sent_wakes++;
qca               328 drivers/bluetooth/hci_qca.c 	retrans_delay = msecs_to_jiffies(qca->wake_retrans);
qca               329 drivers/bluetooth/hci_qca.c 	mod_timer(&qca->wake_retrans_timer, jiffies + retrans_delay);
qca               331 drivers/bluetooth/hci_qca.c 	spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
qca               339 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = container_of(work, struct qca_data,
qca               341 drivers/bluetooth/hci_qca.c 	struct hci_uart *hu = qca->hu;
qca               348 drivers/bluetooth/hci_qca.c 	spin_lock_irqsave(&qca->hci_ibs_lock, flags);
qca               349 drivers/bluetooth/hci_qca.c 	qca->rx_ibs_state = HCI_IBS_RX_AWAKE;
qca               357 drivers/bluetooth/hci_qca.c 	qca->ibs_sent_wacks++;
qca               359 drivers/bluetooth/hci_qca.c 	spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
qca               367 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = container_of(work, struct qca_data,
qca               369 drivers/bluetooth/hci_qca.c 	struct hci_uart *hu = qca->hu;
qca               378 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = container_of(work, struct qca_data,
qca               380 drivers/bluetooth/hci_qca.c 	struct hci_uart *hu = qca->hu;
qca               395 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = from_timer(qca, t, tx_idle_timer);
qca               396 drivers/bluetooth/hci_qca.c 	struct hci_uart *hu = qca->hu;
qca               399 drivers/bluetooth/hci_qca.c 	BT_DBG("hu %p idle timeout in %d state", hu, qca->tx_ibs_state);
qca               401 drivers/bluetooth/hci_qca.c 	spin_lock_irqsave_nested(&qca->hci_ibs_lock,
qca               404 drivers/bluetooth/hci_qca.c 	switch (qca->tx_ibs_state) {
qca               411 drivers/bluetooth/hci_qca.c 		qca->tx_ibs_state = HCI_IBS_TX_ASLEEP;
qca               412 drivers/bluetooth/hci_qca.c 		qca->ibs_sent_slps++;
qca               413 drivers/bluetooth/hci_qca.c 		queue_work(qca->workqueue, &qca->ws_tx_vote_off);
qca               421 drivers/bluetooth/hci_qca.c 		BT_ERR("Spurious timeout tx state %d", qca->tx_ibs_state);
qca               425 drivers/bluetooth/hci_qca.c 	spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
qca               430 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = from_timer(qca, t, wake_retrans_timer);
qca               431 drivers/bluetooth/hci_qca.c 	struct hci_uart *hu = qca->hu;
qca               436 drivers/bluetooth/hci_qca.c 		hu, qca->tx_ibs_state);
qca               438 drivers/bluetooth/hci_qca.c 	spin_lock_irqsave_nested(&qca->hci_ibs_lock,
qca               441 drivers/bluetooth/hci_qca.c 	switch (qca->tx_ibs_state) {
qca               449 drivers/bluetooth/hci_qca.c 		qca->ibs_sent_wakes++;
qca               450 drivers/bluetooth/hci_qca.c 		retrans_delay = msecs_to_jiffies(qca->wake_retrans);
qca               451 drivers/bluetooth/hci_qca.c 		mod_timer(&qca->wake_retrans_timer, jiffies + retrans_delay);
qca               459 drivers/bluetooth/hci_qca.c 		BT_ERR("Spurious timeout tx state %d", qca->tx_ibs_state);
qca               463 drivers/bluetooth/hci_qca.c 	spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
qca               473 drivers/bluetooth/hci_qca.c 	struct qca_data *qca;
qca               481 drivers/bluetooth/hci_qca.c 	qca = kzalloc(sizeof(struct qca_data), GFP_KERNEL);
qca               482 drivers/bluetooth/hci_qca.c 	if (!qca)
qca               485 drivers/bluetooth/hci_qca.c 	skb_queue_head_init(&qca->txq);
qca               486 drivers/bluetooth/hci_qca.c 	skb_queue_head_init(&qca->tx_wait_q);
qca               487 drivers/bluetooth/hci_qca.c 	spin_lock_init(&qca->hci_ibs_lock);
qca               488 drivers/bluetooth/hci_qca.c 	qca->workqueue = alloc_ordered_workqueue("qca_wq", 0);
qca               489 drivers/bluetooth/hci_qca.c 	if (!qca->workqueue) {
qca               491 drivers/bluetooth/hci_qca.c 		kfree(qca);
qca               495 drivers/bluetooth/hci_qca.c 	INIT_WORK(&qca->ws_awake_rx, qca_wq_awake_rx);
qca               496 drivers/bluetooth/hci_qca.c 	INIT_WORK(&qca->ws_awake_device, qca_wq_awake_device);
qca               497 drivers/bluetooth/hci_qca.c 	INIT_WORK(&qca->ws_rx_vote_off, qca_wq_serial_rx_clock_vote_off);
qca               498 drivers/bluetooth/hci_qca.c 	INIT_WORK(&qca->ws_tx_vote_off, qca_wq_serial_tx_clock_vote_off);
qca               500 drivers/bluetooth/hci_qca.c 	qca->hu = hu;
qca               501 drivers/bluetooth/hci_qca.c 	init_completion(&qca->drop_ev_comp);
qca               504 drivers/bluetooth/hci_qca.c 	qca->tx_ibs_state = HCI_IBS_TX_ASLEEP;
qca               505 drivers/bluetooth/hci_qca.c 	qca->rx_ibs_state = HCI_IBS_RX_ASLEEP;
qca               507 drivers/bluetooth/hci_qca.c 	qca->vote_last_jif = jiffies;
qca               509 drivers/bluetooth/hci_qca.c 	hu->priv = qca;
qca               523 drivers/bluetooth/hci_qca.c 				destroy_workqueue(qca->workqueue);
qca               524 drivers/bluetooth/hci_qca.c 				kfree_skb(qca->rx_skb);
qca               526 drivers/bluetooth/hci_qca.c 				kfree(qca);
qca               532 drivers/bluetooth/hci_qca.c 	timer_setup(&qca->wake_retrans_timer, hci_ibs_wake_retrans_timeout, 0);
qca               533 drivers/bluetooth/hci_qca.c 	qca->wake_retrans = IBS_WAKE_RETRANS_TIMEOUT_MS;
qca               535 drivers/bluetooth/hci_qca.c 	timer_setup(&qca->tx_idle_timer, hci_ibs_tx_idle_timeout, 0);
qca               536 drivers/bluetooth/hci_qca.c 	qca->tx_idle_delay = IBS_TX_IDLE_TIMEOUT_MS;
qca               539 drivers/bluetooth/hci_qca.c 	       qca->tx_idle_delay, qca->wake_retrans);
qca               547 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca               558 drivers/bluetooth/hci_qca.c 	debugfs_create_u8("tx_ibs_state", mode, ibs_dir, &qca->tx_ibs_state);
qca               559 drivers/bluetooth/hci_qca.c 	debugfs_create_u8("rx_ibs_state", mode, ibs_dir, &qca->rx_ibs_state);
qca               561 drivers/bluetooth/hci_qca.c 			   &qca->ibs_sent_slps);
qca               563 drivers/bluetooth/hci_qca.c 			   &qca->ibs_sent_wakes);
qca               565 drivers/bluetooth/hci_qca.c 			   &qca->ibs_sent_wacks);
qca               567 drivers/bluetooth/hci_qca.c 			   &qca->ibs_recv_slps);
qca               569 drivers/bluetooth/hci_qca.c 			   &qca->ibs_recv_wakes);
qca               571 drivers/bluetooth/hci_qca.c 			   &qca->ibs_recv_wacks);
qca               572 drivers/bluetooth/hci_qca.c 	debugfs_create_bool("tx_vote", mode, ibs_dir, &qca->tx_vote);
qca               573 drivers/bluetooth/hci_qca.c 	debugfs_create_u64("tx_votes_on", mode, ibs_dir, &qca->tx_votes_on);
qca               574 drivers/bluetooth/hci_qca.c 	debugfs_create_u64("tx_votes_off", mode, ibs_dir, &qca->tx_votes_off);
qca               575 drivers/bluetooth/hci_qca.c 	debugfs_create_bool("rx_vote", mode, ibs_dir, &qca->rx_vote);
qca               576 drivers/bluetooth/hci_qca.c 	debugfs_create_u64("rx_votes_on", mode, ibs_dir, &qca->rx_votes_on);
qca               577 drivers/bluetooth/hci_qca.c 	debugfs_create_u64("rx_votes_off", mode, ibs_dir, &qca->rx_votes_off);
qca               578 drivers/bluetooth/hci_qca.c 	debugfs_create_u64("votes_on", mode, ibs_dir, &qca->votes_on);
qca               579 drivers/bluetooth/hci_qca.c 	debugfs_create_u64("votes_off", mode, ibs_dir, &qca->votes_off);
qca               580 drivers/bluetooth/hci_qca.c 	debugfs_create_u32("vote_on_ms", mode, ibs_dir, &qca->vote_on_ms);
qca               581 drivers/bluetooth/hci_qca.c 	debugfs_create_u32("vote_off_ms", mode, ibs_dir, &qca->vote_off_ms);
qca               585 drivers/bluetooth/hci_qca.c 	debugfs_create_u32("wake_retrans", mode, ibs_dir, &qca->wake_retrans);
qca               587 drivers/bluetooth/hci_qca.c 			   &qca->tx_idle_delay);
qca               593 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca               597 drivers/bluetooth/hci_qca.c 	skb_queue_purge(&qca->tx_wait_q);
qca               598 drivers/bluetooth/hci_qca.c 	skb_queue_purge(&qca->txq);
qca               607 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca               613 drivers/bluetooth/hci_qca.c 	skb_queue_purge(&qca->tx_wait_q);
qca               614 drivers/bluetooth/hci_qca.c 	skb_queue_purge(&qca->txq);
qca               615 drivers/bluetooth/hci_qca.c 	del_timer(&qca->tx_idle_timer);
qca               616 drivers/bluetooth/hci_qca.c 	del_timer(&qca->wake_retrans_timer);
qca               617 drivers/bluetooth/hci_qca.c 	destroy_workqueue(qca->workqueue);
qca               618 drivers/bluetooth/hci_qca.c 	qca->hu = NULL;
qca               629 drivers/bluetooth/hci_qca.c 	kfree_skb(qca->rx_skb);
qca               633 drivers/bluetooth/hci_qca.c 	kfree(qca);
qca               643 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca               647 drivers/bluetooth/hci_qca.c 	spin_lock_irqsave(&qca->hci_ibs_lock, flags);
qca               649 drivers/bluetooth/hci_qca.c 	qca->ibs_recv_wakes++;
qca               651 drivers/bluetooth/hci_qca.c 	switch (qca->rx_ibs_state) {
qca               656 drivers/bluetooth/hci_qca.c 		queue_work(qca->workqueue, &qca->ws_awake_rx);
qca               657 drivers/bluetooth/hci_qca.c 		spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
qca               668 drivers/bluetooth/hci_qca.c 		qca->ibs_sent_wacks++;
qca               674 drivers/bluetooth/hci_qca.c 		       qca->rx_ibs_state);
qca               678 drivers/bluetooth/hci_qca.c 	spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
qca               689 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca               691 drivers/bluetooth/hci_qca.c 	BT_DBG("hu %p want to sleep in %d state", hu, qca->rx_ibs_state);
qca               693 drivers/bluetooth/hci_qca.c 	spin_lock_irqsave(&qca->hci_ibs_lock, flags);
qca               695 drivers/bluetooth/hci_qca.c 	qca->ibs_recv_slps++;
qca               697 drivers/bluetooth/hci_qca.c 	switch (qca->rx_ibs_state) {
qca               700 drivers/bluetooth/hci_qca.c 		qca->rx_ibs_state = HCI_IBS_RX_ASLEEP;
qca               702 drivers/bluetooth/hci_qca.c 		queue_work(qca->workqueue, &qca->ws_rx_vote_off);
qca               711 drivers/bluetooth/hci_qca.c 		       qca->rx_ibs_state);
qca               715 drivers/bluetooth/hci_qca.c 	spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
qca               723 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca               728 drivers/bluetooth/hci_qca.c 	spin_lock_irqsave(&qca->hci_ibs_lock, flags);
qca               730 drivers/bluetooth/hci_qca.c 	qca->ibs_recv_wacks++;
qca               732 drivers/bluetooth/hci_qca.c 	switch (qca->tx_ibs_state) {
qca               736 drivers/bluetooth/hci_qca.c 		       qca->tx_ibs_state);
qca               741 drivers/bluetooth/hci_qca.c 		while ((skb = skb_dequeue(&qca->tx_wait_q)))
qca               742 drivers/bluetooth/hci_qca.c 			skb_queue_tail(&qca->txq, skb);
qca               745 drivers/bluetooth/hci_qca.c 		del_timer(&qca->wake_retrans_timer);
qca               746 drivers/bluetooth/hci_qca.c 		idle_delay = msecs_to_jiffies(qca->tx_idle_delay);
qca               747 drivers/bluetooth/hci_qca.c 		mod_timer(&qca->tx_idle_timer, jiffies + idle_delay);
qca               748 drivers/bluetooth/hci_qca.c 		qca->tx_ibs_state = HCI_IBS_TX_AWAKE;
qca               756 drivers/bluetooth/hci_qca.c 		       qca->tx_ibs_state);
qca               760 drivers/bluetooth/hci_qca.c 	spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
qca               772 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca               775 drivers/bluetooth/hci_qca.c 	       qca->tx_ibs_state);
qca               780 drivers/bluetooth/hci_qca.c 	spin_lock_irqsave(&qca->hci_ibs_lock, flags);
qca               785 drivers/bluetooth/hci_qca.c 	if (!test_bit(QCA_IBS_ENABLED, &qca->flags)) {
qca               786 drivers/bluetooth/hci_qca.c 		skb_queue_tail(&qca->txq, skb);
qca               787 drivers/bluetooth/hci_qca.c 		spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
qca               792 drivers/bluetooth/hci_qca.c 	switch (qca->tx_ibs_state) {
qca               795 drivers/bluetooth/hci_qca.c 		skb_queue_tail(&qca->txq, skb);
qca               796 drivers/bluetooth/hci_qca.c 		idle_delay = msecs_to_jiffies(qca->tx_idle_delay);
qca               797 drivers/bluetooth/hci_qca.c 		mod_timer(&qca->tx_idle_timer, jiffies + idle_delay);
qca               803 drivers/bluetooth/hci_qca.c 		skb_queue_tail(&qca->tx_wait_q, skb);
qca               805 drivers/bluetooth/hci_qca.c 		qca->tx_ibs_state = HCI_IBS_TX_WAKING;
qca               807 drivers/bluetooth/hci_qca.c 		queue_work(qca->workqueue, &qca->ws_awake_device);
qca               813 drivers/bluetooth/hci_qca.c 		skb_queue_tail(&qca->tx_wait_q, skb);
qca               818 drivers/bluetooth/hci_qca.c 		       qca->tx_ibs_state);
qca               823 drivers/bluetooth/hci_qca.c 	spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
qca               880 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca               882 drivers/bluetooth/hci_qca.c 	if (test_bit(QCA_DROP_VENDOR_EVENT, &qca->flags)) {
qca               896 drivers/bluetooth/hci_qca.c 			complete(&qca->drop_ev_comp);
qca               938 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca               943 drivers/bluetooth/hci_qca.c 	qca->rx_skb = h4_recv_buf(hu->hdev, qca->rx_skb, data, count,
qca               945 drivers/bluetooth/hci_qca.c 	if (IS_ERR(qca->rx_skb)) {
qca               946 drivers/bluetooth/hci_qca.c 		int err = PTR_ERR(qca->rx_skb);
qca               948 drivers/bluetooth/hci_qca.c 		qca->rx_skb = NULL;
qca               957 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca               959 drivers/bluetooth/hci_qca.c 	return skb_dequeue(&qca->txq);
qca              1001 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca              1020 drivers/bluetooth/hci_qca.c 	skb_queue_tail(&qca->txq, skb);
qca              1025 drivers/bluetooth/hci_qca.c 	while (!skb_queue_empty(&qca->txq))
qca              1125 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca              1146 drivers/bluetooth/hci_qca.c 			reinit_completion(&qca->drop_ev_comp);
qca              1147 drivers/bluetooth/hci_qca.c 			set_bit(QCA_DROP_VENDOR_EVENT, &qca->flags);
qca              1166 drivers/bluetooth/hci_qca.c 			if (!wait_for_completion_timeout(&qca->drop_ev_comp,
qca              1173 drivers/bluetooth/hci_qca.c 			clear_bit(QCA_DROP_VENDOR_EVENT, &qca->flags);
qca              1233 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca              1245 drivers/bluetooth/hci_qca.c 	clear_bit(QCA_IBS_ENABLED, &qca->flags);
qca              1295 drivers/bluetooth/hci_qca.c 		set_bit(QCA_IBS_ENABLED, &qca->flags);
qca              1356 drivers/bluetooth/hci_qca.c 	struct qca_data *qca = hu->priv;
qca              1363 drivers/bluetooth/hci_qca.c 	spin_lock_irqsave(&qca->hci_ibs_lock, flags);
qca              1364 drivers/bluetooth/hci_qca.c 	clear_bit(QCA_IBS_ENABLED, &qca->flags);
qca              1366 drivers/bluetooth/hci_qca.c 	spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
qca              1462 drivers/bluetooth/hci_qca.c static int qca_init_regulators(struct qca_power *qca,
qca              1467 drivers/bluetooth/hci_qca.c 	qca->vreg_bulk = devm_kcalloc(qca->dev, num_vregs,
qca              1470 drivers/bluetooth/hci_qca.c 	if (!qca->vreg_bulk)
qca              1474 drivers/bluetooth/hci_qca.c 		qca->vreg_bulk[i].supply = vregs[i].name;
qca              1476 drivers/bluetooth/hci_qca.c 	return devm_regulator_bulk_get(qca->dev, num_vregs, qca->vreg_bulk);
qca                33 drivers/net/ethernet/qualcomm/qca_7k.c qcaspi_spi_error(struct qcaspi *qca)
qca                35 drivers/net/ethernet/qualcomm/qca_7k.c 	if (qca->sync != QCASPI_SYNC_READY)
qca                38 drivers/net/ethernet/qualcomm/qca_7k.c 	netdev_err(qca->net_dev, "spi error\n");
qca                39 drivers/net/ethernet/qualcomm/qca_7k.c 	qca->sync = QCASPI_SYNC_UNKNOWN;
qca                40 drivers/net/ethernet/qualcomm/qca_7k.c 	qca->stats.spi_err++;
qca                44 drivers/net/ethernet/qualcomm/qca_7k.c qcaspi_read_register(struct qcaspi *qca, u16 reg, u16 *result)
qca                66 drivers/net/ethernet/qualcomm/qca_7k.c 	if (qca->legacy_mode) {
qca                67 drivers/net/ethernet/qualcomm/qca_7k.c 		spi_sync(qca->spi_dev, &msg);
qca                71 drivers/net/ethernet/qualcomm/qca_7k.c 	ret = spi_sync(qca->spi_dev, &msg);
qca                77 drivers/net/ethernet/qualcomm/qca_7k.c 		qcaspi_spi_error(qca);
qca                85 drivers/net/ethernet/qualcomm/qca_7k.c __qcaspi_write_register(struct qcaspi *qca, u16 reg, u16 value)
qca               105 drivers/net/ethernet/qualcomm/qca_7k.c 	if (qca->legacy_mode) {
qca               106 drivers/net/ethernet/qualcomm/qca_7k.c 		spi_sync(qca->spi_dev, &msg);
qca               110 drivers/net/ethernet/qualcomm/qca_7k.c 	ret = spi_sync(qca->spi_dev, &msg);
qca               116 drivers/net/ethernet/qualcomm/qca_7k.c 		qcaspi_spi_error(qca);
qca               122 drivers/net/ethernet/qualcomm/qca_7k.c qcaspi_write_register(struct qcaspi *qca, u16 reg, u16 value, int retry)
qca               128 drivers/net/ethernet/qualcomm/qca_7k.c 		ret = __qcaspi_write_register(qca, reg, value);
qca               135 drivers/net/ethernet/qualcomm/qca_7k.c 		ret = qcaspi_read_register(qca, reg, &confirmed);
qca               144 drivers/net/ethernet/qualcomm/qca_7k.c 		qca->stats.write_verify_failed++;
qca                67 drivers/net/ethernet/qualcomm/qca_7k.h void qcaspi_spi_error(struct qcaspi *qca);
qca                68 drivers/net/ethernet/qualcomm/qca_7k.h int qcaspi_read_register(struct qcaspi *qca, u16 reg, u16 *result);
qca                69 drivers/net/ethernet/qualcomm/qca_7k.h int qcaspi_write_register(struct qcaspi *qca, u16 reg, u16 value, int retry);
qca                72 drivers/net/ethernet/qualcomm/qca_debug.c 	struct qcaspi *qca = s->private;
qca                75 drivers/net/ethernet/qualcomm/qca_debug.c 		   (unsigned long)qca->buffer_size);
qca                79 drivers/net/ethernet/qualcomm/qca_debug.c 	if (qca->txr.skb[qca->txr.head] == NULL)
qca                81 drivers/net/ethernet/qualcomm/qca_debug.c 	else if (qca->txr.skb[qca->txr.tail])
qca                89 drivers/net/ethernet/qualcomm/qca_debug.c 		   qca->txr.size);
qca                92 drivers/net/ethernet/qualcomm/qca_debug.c 		   (unsigned int)qca->sync);
qca                93 drivers/net/ethernet/qualcomm/qca_debug.c 	switch (qca->sync) {
qca               110 drivers/net/ethernet/qualcomm/qca_debug.c 		   qca->spi_dev->irq);
qca               112 drivers/net/ethernet/qualcomm/qca_debug.c 		   qca->intr_req);
qca               114 drivers/net/ethernet/qualcomm/qca_debug.c 		   qca->intr_svc);
qca               117 drivers/net/ethernet/qualcomm/qca_debug.c 		   (unsigned long)qca->spi_dev->max_speed_hz);
qca               119 drivers/net/ethernet/qualcomm/qca_debug.c 		   qca->spi_dev->mode);
qca               121 drivers/net/ethernet/qualcomm/qca_debug.c 		   (unsigned int)qca->spi_dev->chip_select);
qca               123 drivers/net/ethernet/qualcomm/qca_debug.c 		   (unsigned int)qca->legacy_mode);
qca               125 drivers/net/ethernet/qualcomm/qca_debug.c 		   (unsigned int)qca->burst_len);
qca               132 drivers/net/ethernet/qualcomm/qca_debug.c qcaspi_init_device_debugfs(struct qcaspi *qca)
qca               134 drivers/net/ethernet/qualcomm/qca_debug.c 	qca->device_root = debugfs_create_dir(dev_name(&qca->net_dev->dev),
qca               137 drivers/net/ethernet/qualcomm/qca_debug.c 	debugfs_create_file("info", S_IFREG | 0444, qca->device_root, qca,
qca               142 drivers/net/ethernet/qualcomm/qca_debug.c qcaspi_remove_device_debugfs(struct qcaspi *qca)
qca               144 drivers/net/ethernet/qualcomm/qca_debug.c 	debugfs_remove_recursive(qca->device_root);
qca               150 drivers/net/ethernet/qualcomm/qca_debug.c qcaspi_init_device_debugfs(struct qcaspi *qca)
qca               155 drivers/net/ethernet/qualcomm/qca_debug.c qcaspi_remove_device_debugfs(struct qcaspi *qca)
qca               164 drivers/net/ethernet/qualcomm/qca_debug.c 	struct qcaspi *qca = netdev_priv(dev);
qca               169 drivers/net/ethernet/qualcomm/qca_debug.c 	strlcpy(p->bus_info, dev_name(&qca->spi_dev->dev),
qca               191 drivers/net/ethernet/qualcomm/qca_debug.c 	struct qcaspi *qca = netdev_priv(dev);
qca               192 drivers/net/ethernet/qualcomm/qca_debug.c 	struct qcaspi_stats *st = &qca->stats;
qca               231 drivers/net/ethernet/qualcomm/qca_debug.c 	struct qcaspi *qca = netdev_priv(dev);
qca               241 drivers/net/ethernet/qualcomm/qca_debug.c 		qcaspi_read_register(qca, qcaspi_spi_regs[i], &value);
qca               250 drivers/net/ethernet/qualcomm/qca_debug.c 	struct qcaspi *qca = netdev_priv(dev);
qca               255 drivers/net/ethernet/qualcomm/qca_debug.c 	ring->tx_pending = qca->txr.count;
qca               262 drivers/net/ethernet/qualcomm/qca_debug.c 	struct qcaspi *qca = netdev_priv(dev);
qca               272 drivers/net/ethernet/qualcomm/qca_debug.c 	qca->txr.count = max_t(u32, ring->tx_pending, TX_RING_MIN_LEN);
qca               273 drivers/net/ethernet/qualcomm/qca_debug.c 	qca->txr.count = min_t(u16, qca->txr.count, TX_RING_MAX_LEN);
qca                28 drivers/net/ethernet/qualcomm/qca_debug.h void qcaspi_init_device_debugfs(struct qcaspi *qca);
qca                30 drivers/net/ethernet/qualcomm/qca_debug.h void qcaspi_remove_device_debugfs(struct qcaspi *qca);
qca                82 drivers/net/ethernet/qualcomm/qca_spi.c start_spi_intr_handling(struct qcaspi *qca, u16 *intr_cause)
qca                86 drivers/net/ethernet/qualcomm/qca_spi.c 	qcaspi_write_register(qca, SPI_REG_INTR_ENABLE, 0, wr_verify);
qca                87 drivers/net/ethernet/qualcomm/qca_spi.c 	qcaspi_read_register(qca, SPI_REG_INTR_CAUSE, intr_cause);
qca                88 drivers/net/ethernet/qualcomm/qca_spi.c 	netdev_dbg(qca->net_dev, "interrupts: 0x%04x\n", *intr_cause);
qca                92 drivers/net/ethernet/qualcomm/qca_spi.c end_spi_intr_handling(struct qcaspi *qca, u16 intr_cause)
qca                99 drivers/net/ethernet/qualcomm/qca_spi.c 	qcaspi_write_register(qca, SPI_REG_INTR_CAUSE, intr_cause, 0);
qca               100 drivers/net/ethernet/qualcomm/qca_spi.c 	qcaspi_write_register(qca, SPI_REG_INTR_ENABLE, intr_enable, wr_verify);
qca               101 drivers/net/ethernet/qualcomm/qca_spi.c 	netdev_dbg(qca->net_dev, "acking int: 0x%04x\n", intr_cause);
qca               105 drivers/net/ethernet/qualcomm/qca_spi.c qcaspi_write_burst(struct qcaspi *qca, u8 *src, u32 len)
qca               123 drivers/net/ethernet/qualcomm/qca_spi.c 	ret = spi_sync(qca->spi_dev, &msg);
qca               126 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_spi_error(qca);
qca               134 drivers/net/ethernet/qualcomm/qca_spi.c qcaspi_write_legacy(struct qcaspi *qca, u8 *src, u32 len)
qca               147 drivers/net/ethernet/qualcomm/qca_spi.c 	ret = spi_sync(qca->spi_dev, &msg);
qca               150 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_spi_error(qca);
qca               158 drivers/net/ethernet/qualcomm/qca_spi.c qcaspi_read_burst(struct qcaspi *qca, u8 *dst, u32 len)
qca               176 drivers/net/ethernet/qualcomm/qca_spi.c 	ret = spi_sync(qca->spi_dev, &msg);
qca               179 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_spi_error(qca);
qca               187 drivers/net/ethernet/qualcomm/qca_spi.c qcaspi_read_legacy(struct qcaspi *qca, u8 *dst, u32 len)
qca               200 drivers/net/ethernet/qualcomm/qca_spi.c 	ret = spi_sync(qca->spi_dev, &msg);
qca               203 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_spi_error(qca);
qca               211 drivers/net/ethernet/qualcomm/qca_spi.c qcaspi_tx_cmd(struct qcaspi *qca, u16 cmd)
qca               227 drivers/net/ethernet/qualcomm/qca_spi.c 	ret = spi_sync(qca->spi_dev, &msg);
qca               233 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_spi_error(qca);
qca               239 drivers/net/ethernet/qualcomm/qca_spi.c qcaspi_tx_frame(struct qcaspi *qca, struct sk_buff *skb)
qca               248 drivers/net/ethernet/qualcomm/qca_spi.c 	qcaspi_write_register(qca, SPI_REG_BFR_SIZE, len, wr_verify);
qca               249 drivers/net/ethernet/qualcomm/qca_spi.c 	if (qca->legacy_mode)
qca               250 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_tx_cmd(qca, QCA7K_SPI_WRITE | QCA7K_SPI_EXTERNAL);
qca               255 drivers/net/ethernet/qualcomm/qca_spi.c 		if (count > qca->burst_len)
qca               256 drivers/net/ethernet/qualcomm/qca_spi.c 			count = qca->burst_len;
qca               258 drivers/net/ethernet/qualcomm/qca_spi.c 		if (qca->legacy_mode) {
qca               259 drivers/net/ethernet/qualcomm/qca_spi.c 			written = qcaspi_write_legacy(qca,
qca               263 drivers/net/ethernet/qualcomm/qca_spi.c 			written = qcaspi_write_burst(qca,
qca               279 drivers/net/ethernet/qualcomm/qca_spi.c qcaspi_transmit(struct qcaspi *qca)
qca               281 drivers/net/ethernet/qualcomm/qca_spi.c 	struct net_device_stats *n_stats = &qca->net_dev->stats;
qca               287 drivers/net/ethernet/qualcomm/qca_spi.c 	if (qca->txr.skb[qca->txr.head] == NULL)
qca               290 drivers/net/ethernet/qualcomm/qca_spi.c 	qcaspi_read_register(qca, SPI_REG_WRBUF_SPC_AVA, &available);
qca               296 drivers/net/ethernet/qualcomm/qca_spi.c 		qca->stats.buf_avail_err++;
qca               300 drivers/net/ethernet/qualcomm/qca_spi.c 	while (qca->txr.skb[qca->txr.head]) {
qca               301 drivers/net/ethernet/qualcomm/qca_spi.c 		pkt_len = qca->txr.skb[qca->txr.head]->len + QCASPI_HW_PKT_LEN;
qca               305 drivers/net/ethernet/qualcomm/qca_spi.c 				qca->stats.write_buf_miss++;
qca               309 drivers/net/ethernet/qualcomm/qca_spi.c 		if (qcaspi_tx_frame(qca, qca->txr.skb[qca->txr.head]) == -1) {
qca               310 drivers/net/ethernet/qualcomm/qca_spi.c 			qca->stats.write_err++;
qca               316 drivers/net/ethernet/qualcomm/qca_spi.c 		n_stats->tx_bytes += qca->txr.skb[qca->txr.head]->len;
qca               323 drivers/net/ethernet/qualcomm/qca_spi.c 		netif_tx_lock_bh(qca->net_dev);
qca               324 drivers/net/ethernet/qualcomm/qca_spi.c 		dev_kfree_skb(qca->txr.skb[qca->txr.head]);
qca               325 drivers/net/ethernet/qualcomm/qca_spi.c 		qca->txr.skb[qca->txr.head] = NULL;
qca               326 drivers/net/ethernet/qualcomm/qca_spi.c 		qca->txr.size -= pkt_len;
qca               327 drivers/net/ethernet/qualcomm/qca_spi.c 		new_head = qca->txr.head + 1;
qca               328 drivers/net/ethernet/qualcomm/qca_spi.c 		if (new_head >= qca->txr.count)
qca               330 drivers/net/ethernet/qualcomm/qca_spi.c 		qca->txr.head = new_head;
qca               331 drivers/net/ethernet/qualcomm/qca_spi.c 		if (netif_queue_stopped(qca->net_dev))
qca               332 drivers/net/ethernet/qualcomm/qca_spi.c 			netif_wake_queue(qca->net_dev);
qca               333 drivers/net/ethernet/qualcomm/qca_spi.c 		netif_tx_unlock_bh(qca->net_dev);
qca               340 drivers/net/ethernet/qualcomm/qca_spi.c qcaspi_receive(struct qcaspi *qca)
qca               342 drivers/net/ethernet/qualcomm/qca_spi.c 	struct net_device *net_dev = qca->net_dev;
qca               349 drivers/net/ethernet/qualcomm/qca_spi.c 	if (!qca->rx_skb) {
qca               350 drivers/net/ethernet/qualcomm/qca_spi.c 		qca->rx_skb = netdev_alloc_skb_ip_align(net_dev,
qca               353 drivers/net/ethernet/qualcomm/qca_spi.c 		if (!qca->rx_skb) {
qca               355 drivers/net/ethernet/qualcomm/qca_spi.c 			qca->stats.out_of_mem++;
qca               361 drivers/net/ethernet/qualcomm/qca_spi.c 	qcaspi_read_register(qca, SPI_REG_RDBUF_BYTE_AVA, &available);
qca               370 drivers/net/ethernet/qualcomm/qca_spi.c 		qca->stats.buf_avail_err++;
qca               377 drivers/net/ethernet/qualcomm/qca_spi.c 	qcaspi_write_register(qca, SPI_REG_BFR_SIZE, available, wr_verify);
qca               379 drivers/net/ethernet/qualcomm/qca_spi.c 	if (qca->legacy_mode)
qca               380 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_tx_cmd(qca, QCA7K_SPI_READ | QCA7K_SPI_EXTERNAL);
qca               385 drivers/net/ethernet/qualcomm/qca_spi.c 		if (count > qca->burst_len)
qca               386 drivers/net/ethernet/qualcomm/qca_spi.c 			count = qca->burst_len;
qca               388 drivers/net/ethernet/qualcomm/qca_spi.c 		if (qca->legacy_mode) {
qca               389 drivers/net/ethernet/qualcomm/qca_spi.c 			bytes_read = qcaspi_read_legacy(qca, qca->rx_buffer,
qca               392 drivers/net/ethernet/qualcomm/qca_spi.c 			bytes_read = qcaspi_read_burst(qca, qca->rx_buffer,
qca               402 drivers/net/ethernet/qualcomm/qca_spi.c 			qca->stats.read_err++;
qca               406 drivers/net/ethernet/qualcomm/qca_spi.c 		cp = qca->rx_buffer;
qca               408 drivers/net/ethernet/qualcomm/qca_spi.c 		while ((bytes_read--) && (qca->rx_skb)) {
qca               411 drivers/net/ethernet/qualcomm/qca_spi.c 			retcode = qcafrm_fsm_decode(&qca->frm_handle,
qca               412 drivers/net/ethernet/qualcomm/qca_spi.c 						    qca->rx_skb->data,
qca               413 drivers/net/ethernet/qualcomm/qca_spi.c 						    skb_tailroom(qca->rx_skb),
qca               431 drivers/net/ethernet/qualcomm/qca_spi.c 				qca->rx_skb->dev = qca->net_dev;
qca               434 drivers/net/ethernet/qualcomm/qca_spi.c 				skb_put(qca->rx_skb, retcode);
qca               435 drivers/net/ethernet/qualcomm/qca_spi.c 				qca->rx_skb->protocol = eth_type_trans(
qca               436 drivers/net/ethernet/qualcomm/qca_spi.c 					qca->rx_skb, qca->rx_skb->dev);
qca               437 drivers/net/ethernet/qualcomm/qca_spi.c 				qca->rx_skb->ip_summed = CHECKSUM_UNNECESSARY;
qca               438 drivers/net/ethernet/qualcomm/qca_spi.c 				netif_rx_ni(qca->rx_skb);
qca               439 drivers/net/ethernet/qualcomm/qca_spi.c 				qca->rx_skb = netdev_alloc_skb_ip_align(net_dev,
qca               441 drivers/net/ethernet/qualcomm/qca_spi.c 				if (!qca->rx_skb) {
qca               444 drivers/net/ethernet/qualcomm/qca_spi.c 					qca->stats.out_of_mem++;
qca               472 drivers/net/ethernet/qualcomm/qca_spi.c qcaspi_flush_tx_ring(struct qcaspi *qca)
qca               479 drivers/net/ethernet/qualcomm/qca_spi.c 	netif_tx_lock_bh(qca->net_dev);
qca               481 drivers/net/ethernet/qualcomm/qca_spi.c 		if (qca->txr.skb[i]) {
qca               482 drivers/net/ethernet/qualcomm/qca_spi.c 			dev_kfree_skb(qca->txr.skb[i]);
qca               483 drivers/net/ethernet/qualcomm/qca_spi.c 			qca->txr.skb[i] = NULL;
qca               484 drivers/net/ethernet/qualcomm/qca_spi.c 			qca->net_dev->stats.tx_dropped++;
qca               487 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->txr.tail = 0;
qca               488 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->txr.head = 0;
qca               489 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->txr.size = 0;
qca               490 drivers/net/ethernet/qualcomm/qca_spi.c 	netif_tx_unlock_bh(qca->net_dev);
qca               494 drivers/net/ethernet/qualcomm/qca_spi.c qcaspi_qca7k_sync(struct qcaspi *qca, int event)
qca               504 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_read_register(qca, SPI_REG_SIGNATURE, &signature);
qca               505 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_read_register(qca, SPI_REG_SIGNATURE, &signature);
qca               507 drivers/net/ethernet/qualcomm/qca_spi.c 			qca->sync = QCASPI_SYNC_UNKNOWN;
qca               508 drivers/net/ethernet/qualcomm/qca_spi.c 			netdev_dbg(qca->net_dev, "sync: got CPU on, but signature was invalid, restart\n");
qca               511 drivers/net/ethernet/qualcomm/qca_spi.c 			qcaspi_read_register(qca, SPI_REG_WRBUF_SPC_AVA,
qca               514 drivers/net/ethernet/qualcomm/qca_spi.c 				netdev_dbg(qca->net_dev, "sync: got CPU on, but wrbuf not empty. reset!\n");
qca               515 drivers/net/ethernet/qualcomm/qca_spi.c 				qca->sync = QCASPI_SYNC_UNKNOWN;
qca               517 drivers/net/ethernet/qualcomm/qca_spi.c 				netdev_dbg(qca->net_dev, "sync: got CPU on, now in sync\n");
qca               518 drivers/net/ethernet/qualcomm/qca_spi.c 				qca->sync = QCASPI_SYNC_READY;
qca               524 drivers/net/ethernet/qualcomm/qca_spi.c 	switch (qca->sync) {
qca               527 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_read_register(qca, SPI_REG_SIGNATURE, &signature);
qca               529 drivers/net/ethernet/qualcomm/qca_spi.c 			qca->sync = QCASPI_SYNC_UNKNOWN;
qca               530 drivers/net/ethernet/qualcomm/qca_spi.c 			netdev_dbg(qca->net_dev, "sync: bad signature, restart\n");
qca               537 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_read_register(qca, SPI_REG_SIGNATURE, &signature);
qca               539 drivers/net/ethernet/qualcomm/qca_spi.c 			netdev_dbg(qca->net_dev, "sync: could not read signature to reset device, retry.\n");
qca               544 drivers/net/ethernet/qualcomm/qca_spi.c 		netdev_dbg(qca->net_dev, "sync: resetting device.\n");
qca               545 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_read_register(qca, SPI_REG_SPI_CONFIG, &spi_config);
qca               547 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_write_register(qca, SPI_REG_SPI_CONFIG, spi_config, 0);
qca               549 drivers/net/ethernet/qualcomm/qca_spi.c 		qca->sync = QCASPI_SYNC_RESET;
qca               550 drivers/net/ethernet/qualcomm/qca_spi.c 		qca->stats.trig_reset++;
qca               551 drivers/net/ethernet/qualcomm/qca_spi.c 		qca->reset_count = 0;
qca               554 drivers/net/ethernet/qualcomm/qca_spi.c 		qca->reset_count++;
qca               555 drivers/net/ethernet/qualcomm/qca_spi.c 		netdev_dbg(qca->net_dev, "sync: waiting for CPU on, count %u.\n",
qca               556 drivers/net/ethernet/qualcomm/qca_spi.c 			   qca->reset_count);
qca               557 drivers/net/ethernet/qualcomm/qca_spi.c 		if (qca->reset_count >= QCASPI_RESET_TIMEOUT) {
qca               559 drivers/net/ethernet/qualcomm/qca_spi.c 			qca->sync = QCASPI_SYNC_UNKNOWN;
qca               560 drivers/net/ethernet/qualcomm/qca_spi.c 			qca->stats.reset_timeout++;
qca               561 drivers/net/ethernet/qualcomm/qca_spi.c 			netdev_dbg(qca->net_dev, "sync: reset timeout, restarting process.\n");
qca               570 drivers/net/ethernet/qualcomm/qca_spi.c 	struct qcaspi *qca = data;
qca               573 drivers/net/ethernet/qualcomm/qca_spi.c 	netdev_info(qca->net_dev, "SPI thread created\n");
qca               576 drivers/net/ethernet/qualcomm/qca_spi.c 		if ((qca->intr_req == qca->intr_svc) &&
qca               577 drivers/net/ethernet/qualcomm/qca_spi.c 		    (qca->txr.skb[qca->txr.head] == NULL) &&
qca               578 drivers/net/ethernet/qualcomm/qca_spi.c 		    (qca->sync == QCASPI_SYNC_READY))
qca               583 drivers/net/ethernet/qualcomm/qca_spi.c 		netdev_dbg(qca->net_dev, "have work to do. int: %d, tx_skb: %p\n",
qca               584 drivers/net/ethernet/qualcomm/qca_spi.c 			   qca->intr_req - qca->intr_svc,
qca               585 drivers/net/ethernet/qualcomm/qca_spi.c 			   qca->txr.skb[qca->txr.head]);
qca               587 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_qca7k_sync(qca, QCASPI_EVENT_UPDATE);
qca               589 drivers/net/ethernet/qualcomm/qca_spi.c 		if (qca->sync != QCASPI_SYNC_READY) {
qca               590 drivers/net/ethernet/qualcomm/qca_spi.c 			netdev_dbg(qca->net_dev, "sync: not ready %u, turn off carrier and flush\n",
qca               591 drivers/net/ethernet/qualcomm/qca_spi.c 				   (unsigned int)qca->sync);
qca               592 drivers/net/ethernet/qualcomm/qca_spi.c 			netif_stop_queue(qca->net_dev);
qca               593 drivers/net/ethernet/qualcomm/qca_spi.c 			netif_carrier_off(qca->net_dev);
qca               594 drivers/net/ethernet/qualcomm/qca_spi.c 			qcaspi_flush_tx_ring(qca);
qca               598 drivers/net/ethernet/qualcomm/qca_spi.c 		if (qca->intr_svc != qca->intr_req) {
qca               599 drivers/net/ethernet/qualcomm/qca_spi.c 			qca->intr_svc = qca->intr_req;
qca               600 drivers/net/ethernet/qualcomm/qca_spi.c 			start_spi_intr_handling(qca, &intr_cause);
qca               603 drivers/net/ethernet/qualcomm/qca_spi.c 				qcaspi_qca7k_sync(qca, QCASPI_EVENT_CPUON);
qca               606 drivers/net/ethernet/qualcomm/qca_spi.c 				if (qca->sync != QCASPI_SYNC_READY)
qca               609 drivers/net/ethernet/qualcomm/qca_spi.c 				qca->stats.device_reset++;
qca               610 drivers/net/ethernet/qualcomm/qca_spi.c 				netif_wake_queue(qca->net_dev);
qca               611 drivers/net/ethernet/qualcomm/qca_spi.c 				netif_carrier_on(qca->net_dev);
qca               616 drivers/net/ethernet/qualcomm/qca_spi.c 				netdev_dbg(qca->net_dev, "===> rdbuf error!\n");
qca               617 drivers/net/ethernet/qualcomm/qca_spi.c 				qca->stats.read_buf_err++;
qca               618 drivers/net/ethernet/qualcomm/qca_spi.c 				qca->sync = QCASPI_SYNC_UNKNOWN;
qca               624 drivers/net/ethernet/qualcomm/qca_spi.c 				netdev_dbg(qca->net_dev, "===> wrbuf error!\n");
qca               625 drivers/net/ethernet/qualcomm/qca_spi.c 				qca->stats.write_buf_err++;
qca               626 drivers/net/ethernet/qualcomm/qca_spi.c 				qca->sync = QCASPI_SYNC_UNKNOWN;
qca               633 drivers/net/ethernet/qualcomm/qca_spi.c 			if (qca->sync == QCASPI_SYNC_READY) {
qca               635 drivers/net/ethernet/qualcomm/qca_spi.c 					qcaspi_receive(qca);
qca               638 drivers/net/ethernet/qualcomm/qca_spi.c 			end_spi_intr_handling(qca, intr_cause);
qca               641 drivers/net/ethernet/qualcomm/qca_spi.c 		if (qca->sync == QCASPI_SYNC_READY)
qca               642 drivers/net/ethernet/qualcomm/qca_spi.c 			qcaspi_transmit(qca);
qca               645 drivers/net/ethernet/qualcomm/qca_spi.c 	netdev_info(qca->net_dev, "SPI thread exit\n");
qca               653 drivers/net/ethernet/qualcomm/qca_spi.c 	struct qcaspi *qca = data;
qca               655 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->intr_req++;
qca               656 drivers/net/ethernet/qualcomm/qca_spi.c 	if (qca->spi_thread &&
qca               657 drivers/net/ethernet/qualcomm/qca_spi.c 	    qca->spi_thread->state != TASK_RUNNING)
qca               658 drivers/net/ethernet/qualcomm/qca_spi.c 		wake_up_process(qca->spi_thread);
qca               666 drivers/net/ethernet/qualcomm/qca_spi.c 	struct qcaspi *qca = netdev_priv(dev);
qca               669 drivers/net/ethernet/qualcomm/qca_spi.c 	if (!qca)
qca               672 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->intr_req = 1;
qca               673 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->intr_svc = 0;
qca               674 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->sync = QCASPI_SYNC_UNKNOWN;
qca               675 drivers/net/ethernet/qualcomm/qca_spi.c 	qcafrm_fsm_init_spi(&qca->frm_handle);
qca               677 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->spi_thread = kthread_run((void *)qcaspi_spi_thread,
qca               678 drivers/net/ethernet/qualcomm/qca_spi.c 				      qca, "%s", dev->name);
qca               680 drivers/net/ethernet/qualcomm/qca_spi.c 	if (IS_ERR(qca->spi_thread)) {
qca               683 drivers/net/ethernet/qualcomm/qca_spi.c 		return PTR_ERR(qca->spi_thread);
qca               686 drivers/net/ethernet/qualcomm/qca_spi.c 	ret = request_irq(qca->spi_dev->irq, qcaspi_intr_handler, 0,
qca               687 drivers/net/ethernet/qualcomm/qca_spi.c 			  dev->name, qca);
qca               690 drivers/net/ethernet/qualcomm/qca_spi.c 			   QCASPI_DRV_NAME, qca->spi_dev->irq, ret);
qca               691 drivers/net/ethernet/qualcomm/qca_spi.c 		kthread_stop(qca->spi_thread);
qca               703 drivers/net/ethernet/qualcomm/qca_spi.c 	struct qcaspi *qca = netdev_priv(dev);
qca               707 drivers/net/ethernet/qualcomm/qca_spi.c 	qcaspi_write_register(qca, SPI_REG_INTR_ENABLE, 0, wr_verify);
qca               708 drivers/net/ethernet/qualcomm/qca_spi.c 	free_irq(qca->spi_dev->irq, qca);
qca               710 drivers/net/ethernet/qualcomm/qca_spi.c 	kthread_stop(qca->spi_thread);
qca               711 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->spi_thread = NULL;
qca               712 drivers/net/ethernet/qualcomm/qca_spi.c 	qcaspi_flush_tx_ring(qca);
qca               722 drivers/net/ethernet/qualcomm/qca_spi.c 	struct qcaspi *qca = netdev_priv(dev);
qca               730 drivers/net/ethernet/qualcomm/qca_spi.c 	if (qca->txr.skb[qca->txr.tail]) {
qca               731 drivers/net/ethernet/qualcomm/qca_spi.c 		netdev_warn(qca->net_dev, "queue was unexpectedly full!\n");
qca               732 drivers/net/ethernet/qualcomm/qca_spi.c 		netif_stop_queue(qca->net_dev);
qca               733 drivers/net/ethernet/qualcomm/qca_spi.c 		qca->stats.ring_full++;
qca               742 drivers/net/ethernet/qualcomm/qca_spi.c 			qca->stats.out_of_mem++;
qca               761 drivers/net/ethernet/qualcomm/qca_spi.c 	netdev_dbg(qca->net_dev, "Tx-ing packet: Size: 0x%08x\n",
qca               764 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->txr.size += skb->len + QCASPI_HW_PKT_LEN;
qca               766 drivers/net/ethernet/qualcomm/qca_spi.c 	new_tail = qca->txr.tail + 1;
qca               767 drivers/net/ethernet/qualcomm/qca_spi.c 	if (new_tail >= qca->txr.count)
qca               770 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->txr.skb[qca->txr.tail] = skb;
qca               771 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->txr.tail = new_tail;
qca               773 drivers/net/ethernet/qualcomm/qca_spi.c 	if (!qcaspi_tx_ring_has_space(&qca->txr)) {
qca               774 drivers/net/ethernet/qualcomm/qca_spi.c 		netif_stop_queue(qca->net_dev);
qca               775 drivers/net/ethernet/qualcomm/qca_spi.c 		qca->stats.ring_full++;
qca               780 drivers/net/ethernet/qualcomm/qca_spi.c 	if (qca->spi_thread &&
qca               781 drivers/net/ethernet/qualcomm/qca_spi.c 	    qca->spi_thread->state != TASK_RUNNING)
qca               782 drivers/net/ethernet/qualcomm/qca_spi.c 		wake_up_process(qca->spi_thread);
qca               790 drivers/net/ethernet/qualcomm/qca_spi.c 	struct qcaspi *qca = netdev_priv(dev);
qca               792 drivers/net/ethernet/qualcomm/qca_spi.c 	netdev_info(qca->net_dev, "Transmit timeout at %ld, latency %ld\n",
qca               794 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->net_dev->stats.tx_errors++;
qca               796 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->sync = QCASPI_SYNC_UNKNOWN;
qca               798 drivers/net/ethernet/qualcomm/qca_spi.c 	if (qca->spi_thread)
qca               799 drivers/net/ethernet/qualcomm/qca_spi.c 		wake_up_process(qca->spi_thread);
qca               805 drivers/net/ethernet/qualcomm/qca_spi.c 	struct qcaspi *qca = netdev_priv(dev);
qca               809 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->clkspeed = qcaspi_clkspeed;
qca               810 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->burst_len = qcaspi_burst_len;
qca               811 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->spi_thread = NULL;
qca               812 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->buffer_size = (dev->mtu + VLAN_ETH_HLEN + QCAFRM_HEADER_LEN +
qca               815 drivers/net/ethernet/qualcomm/qca_spi.c 	memset(&qca->stats, 0, sizeof(struct qcaspi_stats));
qca               817 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->rx_buffer = kmalloc(qca->buffer_size, GFP_KERNEL);
qca               818 drivers/net/ethernet/qualcomm/qca_spi.c 	if (!qca->rx_buffer)
qca               821 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->rx_skb = netdev_alloc_skb_ip_align(dev, qca->net_dev->mtu +
qca               823 drivers/net/ethernet/qualcomm/qca_spi.c 	if (!qca->rx_skb) {
qca               824 drivers/net/ethernet/qualcomm/qca_spi.c 		kfree(qca->rx_buffer);
qca               825 drivers/net/ethernet/qualcomm/qca_spi.c 		netdev_info(qca->net_dev, "Failed to allocate RX sk_buff.\n");
qca               835 drivers/net/ethernet/qualcomm/qca_spi.c 	struct qcaspi *qca = netdev_priv(dev);
qca               837 drivers/net/ethernet/qualcomm/qca_spi.c 	kfree(qca->rx_buffer);
qca               838 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->buffer_size = 0;
qca               839 drivers/net/ethernet/qualcomm/qca_spi.c 	dev_kfree_skb(qca->rx_skb);
qca               856 drivers/net/ethernet/qualcomm/qca_spi.c 	struct qcaspi *qca = NULL;
qca               868 drivers/net/ethernet/qualcomm/qca_spi.c 	qca = netdev_priv(dev);
qca               869 drivers/net/ethernet/qualcomm/qca_spi.c 	memset(qca, 0, sizeof(struct qcaspi));
qca               871 drivers/net/ethernet/qualcomm/qca_spi.c 	memset(&qca->txr, 0, sizeof(qca->txr));
qca               872 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->txr.count = TX_RING_MAX_LEN;
qca               884 drivers/net/ethernet/qualcomm/qca_spi.c 	struct qcaspi *qca = NULL;
qca               953 drivers/net/ethernet/qualcomm/qca_spi.c 	qca = netdev_priv(qcaspi_devs);
qca               954 drivers/net/ethernet/qualcomm/qca_spi.c 	if (!qca) {
qca               959 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->net_dev = qcaspi_devs;
qca               960 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->spi_dev = spi;
qca               961 drivers/net/ethernet/qualcomm/qca_spi.c 	qca->legacy_mode = legacy_mode;
qca               968 drivers/net/ethernet/qualcomm/qca_spi.c 		ether_addr_copy(qca->net_dev->dev_addr, mac);
qca               970 drivers/net/ethernet/qualcomm/qca_spi.c 	if (!is_valid_ether_addr(qca->net_dev->dev_addr)) {
qca               971 drivers/net/ethernet/qualcomm/qca_spi.c 		eth_hw_addr_random(qca->net_dev);
qca               973 drivers/net/ethernet/qualcomm/qca_spi.c 			 qca->net_dev->dev_addr);
qca               976 drivers/net/ethernet/qualcomm/qca_spi.c 	netif_carrier_off(qca->net_dev);
qca               979 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_read_register(qca, SPI_REG_SIGNATURE, &signature);
qca               980 drivers/net/ethernet/qualcomm/qca_spi.c 		qcaspi_read_register(qca, SPI_REG_SIGNATURE, &signature);
qca               997 drivers/net/ethernet/qualcomm/qca_spi.c 	qcaspi_init_device_debugfs(qca);
qca              1006 drivers/net/ethernet/qualcomm/qca_spi.c 	struct qcaspi *qca = netdev_priv(qcaspi_devs);
qca              1008 drivers/net/ethernet/qualcomm/qca_spi.c 	qcaspi_remove_device_debugfs(qca);
qca                66 drivers/net/ethernet/qualcomm/qca_uart.c 	struct qcauart *qca = serdev_device_get_drvdata(serdev);
qca                67 drivers/net/ethernet/qualcomm/qca_uart.c 	struct net_device *netdev = qca->net_dev;
qca                71 drivers/net/ethernet/qualcomm/qca_uart.c 	if (!qca->rx_skb) {
qca                72 drivers/net/ethernet/qualcomm/qca_uart.c 		qca->rx_skb = netdev_alloc_skb_ip_align(netdev,
qca                75 drivers/net/ethernet/qualcomm/qca_uart.c 		if (!qca->rx_skb) {
qca                85 drivers/net/ethernet/qualcomm/qca_uart.c 		retcode = qcafrm_fsm_decode(&qca->frm_handle,
qca                86 drivers/net/ethernet/qualcomm/qca_uart.c 					    qca->rx_skb->data,
qca                87 drivers/net/ethernet/qualcomm/qca_uart.c 					    skb_tailroom(qca->rx_skb),
qca               107 drivers/net/ethernet/qualcomm/qca_uart.c 			skb_put(qca->rx_skb, retcode);
qca               108 drivers/net/ethernet/qualcomm/qca_uart.c 			qca->rx_skb->protocol = eth_type_trans(
qca               109 drivers/net/ethernet/qualcomm/qca_uart.c 						qca->rx_skb, qca->rx_skb->dev);
qca               110 drivers/net/ethernet/qualcomm/qca_uart.c 			qca->rx_skb->ip_summed = CHECKSUM_UNNECESSARY;
qca               111 drivers/net/ethernet/qualcomm/qca_uart.c 			netif_rx_ni(qca->rx_skb);
qca               112 drivers/net/ethernet/qualcomm/qca_uart.c 			qca->rx_skb = netdev_alloc_skb_ip_align(netdev,
qca               115 drivers/net/ethernet/qualcomm/qca_uart.c 			if (!qca->rx_skb) {
qca               129 drivers/net/ethernet/qualcomm/qca_uart.c 	struct qcauart *qca = container_of(work, struct qcauart, tx_work);
qca               130 drivers/net/ethernet/qualcomm/qca_uart.c 	struct net_device_stats *n_stats = &qca->net_dev->stats;
qca               133 drivers/net/ethernet/qualcomm/qca_uart.c 	spin_lock_bh(&qca->lock);
qca               136 drivers/net/ethernet/qualcomm/qca_uart.c 	if (!netif_running(qca->net_dev)) {
qca               137 drivers/net/ethernet/qualcomm/qca_uart.c 		spin_unlock_bh(&qca->lock);
qca               141 drivers/net/ethernet/qualcomm/qca_uart.c 	if (qca->tx_left <= 0)  {
qca               146 drivers/net/ethernet/qualcomm/qca_uart.c 		spin_unlock_bh(&qca->lock);
qca               147 drivers/net/ethernet/qualcomm/qca_uart.c 		netif_wake_queue(qca->net_dev);
qca               151 drivers/net/ethernet/qualcomm/qca_uart.c 	written = serdev_device_write_buf(qca->serdev, qca->tx_head,
qca               152 drivers/net/ethernet/qualcomm/qca_uart.c 					  qca->tx_left);
qca               154 drivers/net/ethernet/qualcomm/qca_uart.c 		qca->tx_left -= written;
qca               155 drivers/net/ethernet/qualcomm/qca_uart.c 		qca->tx_head += written;
qca               157 drivers/net/ethernet/qualcomm/qca_uart.c 	spin_unlock_bh(&qca->lock);
qca               165 drivers/net/ethernet/qualcomm/qca_uart.c 	struct qcauart *qca = serdev_device_get_drvdata(serdev);
qca               167 drivers/net/ethernet/qualcomm/qca_uart.c 	schedule_work(&qca->tx_work);
qca               177 drivers/net/ethernet/qualcomm/qca_uart.c 	struct qcauart *qca = netdev_priv(dev);
qca               179 drivers/net/ethernet/qualcomm/qca_uart.c 	netif_start_queue(qca->net_dev);
qca               186 drivers/net/ethernet/qualcomm/qca_uart.c 	struct qcauart *qca = netdev_priv(dev);
qca               189 drivers/net/ethernet/qualcomm/qca_uart.c 	flush_work(&qca->tx_work);
qca               191 drivers/net/ethernet/qualcomm/qca_uart.c 	spin_lock_bh(&qca->lock);
qca               192 drivers/net/ethernet/qualcomm/qca_uart.c 	qca->tx_left = 0;
qca               193 drivers/net/ethernet/qualcomm/qca_uart.c 	spin_unlock_bh(&qca->lock);
qca               202 drivers/net/ethernet/qualcomm/qca_uart.c 	struct qcauart *qca = netdev_priv(dev);
qca               207 drivers/net/ethernet/qualcomm/qca_uart.c 	spin_lock(&qca->lock);
qca               209 drivers/net/ethernet/qualcomm/qca_uart.c 	WARN_ON(qca->tx_left);
qca               212 drivers/net/ethernet/qualcomm/qca_uart.c 		spin_unlock(&qca->lock);
qca               213 drivers/net/ethernet/qualcomm/qca_uart.c 		netdev_warn(qca->net_dev, "xmit: iface is down\n");
qca               217 drivers/net/ethernet/qualcomm/qca_uart.c 	pos = qca->tx_buffer;
qca               234 drivers/net/ethernet/qualcomm/qca_uart.c 	netif_stop_queue(qca->net_dev);
qca               236 drivers/net/ethernet/qualcomm/qca_uart.c 	written = serdev_device_write_buf(qca->serdev, qca->tx_buffer,
qca               237 drivers/net/ethernet/qualcomm/qca_uart.c 					  pos - qca->tx_buffer);
qca               239 drivers/net/ethernet/qualcomm/qca_uart.c 		qca->tx_left = (pos - qca->tx_buffer) - written;
qca               240 drivers/net/ethernet/qualcomm/qca_uart.c 		qca->tx_head = qca->tx_buffer + written;
qca               243 drivers/net/ethernet/qualcomm/qca_uart.c 	spin_unlock(&qca->lock);
qca               253 drivers/net/ethernet/qualcomm/qca_uart.c 	struct qcauart *qca = netdev_priv(dev);
qca               255 drivers/net/ethernet/qualcomm/qca_uart.c 	netdev_info(qca->net_dev, "Transmit timeout at %ld, latency %ld\n",
qca               263 drivers/net/ethernet/qualcomm/qca_uart.c 	struct qcauart *qca = netdev_priv(dev);
qca               271 drivers/net/ethernet/qualcomm/qca_uart.c 	qca->tx_buffer = devm_kmalloc(&qca->serdev->dev, len, GFP_KERNEL);
qca               272 drivers/net/ethernet/qualcomm/qca_uart.c 	if (!qca->tx_buffer)
qca               275 drivers/net/ethernet/qualcomm/qca_uart.c 	qca->rx_skb = netdev_alloc_skb_ip_align(qca->net_dev,
qca               276 drivers/net/ethernet/qualcomm/qca_uart.c 						qca->net_dev->mtu +
qca               278 drivers/net/ethernet/qualcomm/qca_uart.c 	if (!qca->rx_skb)
qca               286 drivers/net/ethernet/qualcomm/qca_uart.c 	struct qcauart *qca = netdev_priv(dev);
qca               288 drivers/net/ethernet/qualcomm/qca_uart.c 	dev_kfree_skb(qca->rx_skb);
qca               325 drivers/net/ethernet/qualcomm/qca_uart.c 	struct qcauart *qca;
qca               336 drivers/net/ethernet/qualcomm/qca_uart.c 	qca = netdev_priv(qcauart_dev);
qca               337 drivers/net/ethernet/qualcomm/qca_uart.c 	if (!qca) {
qca               342 drivers/net/ethernet/qualcomm/qca_uart.c 	qca->net_dev = qcauart_dev;
qca               343 drivers/net/ethernet/qualcomm/qca_uart.c 	qca->serdev = serdev;
qca               344 drivers/net/ethernet/qualcomm/qca_uart.c 	qcafrm_fsm_init_uart(&qca->frm_handle);
qca               346 drivers/net/ethernet/qualcomm/qca_uart.c 	spin_lock_init(&qca->lock);
qca               347 drivers/net/ethernet/qualcomm/qca_uart.c 	INIT_WORK(&qca->tx_work, qcauart_transmit);
qca               354 drivers/net/ethernet/qualcomm/qca_uart.c 		ether_addr_copy(qca->net_dev->dev_addr, mac);
qca               356 drivers/net/ethernet/qualcomm/qca_uart.c 	if (!is_valid_ether_addr(qca->net_dev->dev_addr)) {
qca               357 drivers/net/ethernet/qualcomm/qca_uart.c 		eth_hw_addr_random(qca->net_dev);
qca               359 drivers/net/ethernet/qualcomm/qca_uart.c 			 qca->net_dev->dev_addr);
qca               362 drivers/net/ethernet/qualcomm/qca_uart.c 	netif_carrier_on(qca->net_dev);
qca               363 drivers/net/ethernet/qualcomm/qca_uart.c 	serdev_device_set_drvdata(serdev, qca);
qca               383 drivers/net/ethernet/qualcomm/qca_uart.c 		cancel_work_sync(&qca->tx_work);
qca               396 drivers/net/ethernet/qualcomm/qca_uart.c 	struct qcauart *qca = serdev_device_get_drvdata(serdev);
qca               398 drivers/net/ethernet/qualcomm/qca_uart.c 	unregister_netdev(qca->net_dev);
qca               402 drivers/net/ethernet/qualcomm/qca_uart.c 	cancel_work_sync(&qca->tx_work);
qca               404 drivers/net/ethernet/qualcomm/qca_uart.c 	free_netdev(qca->net_dev);