Lines Matching full:crq

158 	union ibmvnic_crq crq;  in send_crq_init_complete()  local
160 memset(&crq, 0, sizeof(crq)); in send_crq_init_complete()
161 crq.generic.first = IBMVNIC_CRQ_INIT_CMD; in send_crq_init_complete()
162 crq.generic.cmd = IBMVNIC_CRQ_INIT_COMPLETE; in send_crq_init_complete()
164 return ibmvnic_send_crq(adapter, &crq); in send_crq_init_complete()
169 union ibmvnic_crq crq; in send_version_xchg() local
171 memset(&crq, 0, sizeof(crq)); in send_version_xchg()
172 crq.version_exchange.first = IBMVNIC_CRQ_CMD; in send_version_xchg()
173 crq.version_exchange.cmd = VERSION_EXCHANGE; in send_version_xchg()
174 crq.version_exchange.version = cpu_to_be16(ibmvnic_version); in send_version_xchg()
176 return ibmvnic_send_crq(adapter, &crq); in send_version_xchg()
403 if (!adapter->crq.active) { in ibmvnic_wait_for_completion()
1603 * pass since we are re-initializing the CRQ in ibmvnic_login()
1610 * device freeing and registering a CRQ too in ibmvnic_login()
1624 netdev_err(netdev, "login recovery: init CRQ failed %d\n", in ibmvnic_login()
1684 union ibmvnic_crq crq; in set_link_state() local
1690 memset(&crq, 0, sizeof(crq)); in set_link_state()
1691 crq.logical_link_state.first = IBMVNIC_CRQ_CMD; in set_link_state()
1692 crq.logical_link_state.cmd = LOGICAL_LINK_STATE; in set_link_state()
1693 crq.logical_link_state.link_state = link_state; in set_link_state()
1699 rc = ibmvnic_send_crq(adapter, &crq); in set_link_state()
1749 union ibmvnic_crq crq; in ibmvnic_get_vpd() local
1760 crq.get_vpd_size.first = IBMVNIC_CRQ_CMD; in ibmvnic_get_vpd()
1761 crq.get_vpd_size.cmd = GET_VPD_SIZE; in ibmvnic_get_vpd()
1762 rc = ibmvnic_send_crq(adapter, &crq); in ibmvnic_get_vpd()
1805 crq.get_vpd.first = IBMVNIC_CRQ_CMD; in ibmvnic_get_vpd()
1806 crq.get_vpd.cmd = GET_VPD; in ibmvnic_get_vpd()
1807 crq.get_vpd.ioba = cpu_to_be32(adapter->vpd->dma_addr); in ibmvnic_get_vpd()
1808 crq.get_vpd.len = cpu_to_be32((u32)adapter->vpd->len); in ibmvnic_get_vpd()
1809 rc = ibmvnic_send_crq(adapter, &crq); in ibmvnic_get_vpd()
1874 /* We're ready to receive frames, enable the sub-crq interrupts and in __ibmvnic_open()
2661 union ibmvnic_crq crq; in ibmvnic_set_multi() local
2663 memset(&crq, 0, sizeof(crq)); in ibmvnic_set_multi()
2664 crq.request_capability.first = IBMVNIC_CRQ_CMD; in ibmvnic_set_multi()
2665 crq.request_capability.cmd = REQUEST_CAPABILITY; in ibmvnic_set_multi()
2673 memset(&crq, 0, sizeof(crq)); in ibmvnic_set_multi()
2674 crq.multicast_ctrl.first = IBMVNIC_CRQ_CMD; in ibmvnic_set_multi()
2675 crq.multicast_ctrl.cmd = MULTICAST_CTRL; in ibmvnic_set_multi()
2676 crq.multicast_ctrl.flags = IBMVNIC_ENABLE_ALL; in ibmvnic_set_multi()
2677 ibmvnic_send_crq(adapter, &crq); in ibmvnic_set_multi()
2680 memset(&crq, 0, sizeof(crq)); in ibmvnic_set_multi()
2681 crq.multicast_ctrl.first = IBMVNIC_CRQ_CMD; in ibmvnic_set_multi()
2682 crq.multicast_ctrl.cmd = MULTICAST_CTRL; in ibmvnic_set_multi()
2683 crq.multicast_ctrl.flags = IBMVNIC_DISABLE_ALL; in ibmvnic_set_multi()
2684 ibmvnic_send_crq(adapter, &crq); in ibmvnic_set_multi()
2688 memset(&crq, 0, sizeof(crq)); in ibmvnic_set_multi()
2689 crq.multicast_ctrl.first = IBMVNIC_CRQ_CMD; in ibmvnic_set_multi()
2690 crq.multicast_ctrl.cmd = MULTICAST_CTRL; in ibmvnic_set_multi()
2691 crq.multicast_ctrl.flags = IBMVNIC_ENABLE_MC; in ibmvnic_set_multi()
2692 ether_addr_copy(&crq.multicast_ctrl.mac_addr[0], in ibmvnic_set_multi()
2694 ibmvnic_send_crq(adapter, &crq); in ibmvnic_set_multi()
2703 union ibmvnic_crq crq; in __ibmvnic_set_mac() local
2711 memset(&crq, 0, sizeof(crq)); in __ibmvnic_set_mac()
2712 crq.change_mac_addr.first = IBMVNIC_CRQ_CMD; in __ibmvnic_set_mac()
2713 crq.change_mac_addr.cmd = CHANGE_MAC_ADDR; in __ibmvnic_set_mac()
2714 ether_addr_copy(&crq.change_mac_addr.mac_addr[0], dev_addr); in __ibmvnic_set_mac()
2720 rc = ibmvnic_send_crq(adapter, &crq); in __ibmvnic_set_mac()
2781 * can get a transport event just after registering the CRQ and the
2784 * regisering the CRQ.
2918 "Reset couldn't initialize crq. rc=%d\n", rc); in do_reset()
3048 "Couldn't initialize crq. rc=%d\n", rc); in do_hard_reset()
3138 adapter->crq.active = true; in do_passive_init()
3162 dev_err(dev, "Failed to initialize sub crq irqs\n, rc=%d", rc); in do_passive_init()
3846 union ibmvnic_crq crq; in ibmvnic_get_ethtool_stats() local
3850 memset(&crq, 0, sizeof(crq)); in ibmvnic_get_ethtool_stats()
3851 crq.request_statistics.first = IBMVNIC_CRQ_CMD; in ibmvnic_get_ethtool_stats()
3852 crq.request_statistics.cmd = REQUEST_STATISTICS; in ibmvnic_get_ethtool_stats()
3853 crq.request_statistics.ioba = cpu_to_be32(adapter->stats_token); in ibmvnic_get_ethtool_stats()
3854 crq.request_statistics.len = in ibmvnic_get_ethtool_stats()
3859 rc = ibmvnic_send_crq(adapter, &crq); in ibmvnic_get_ethtool_stats()
3972 netdev_dbg(adapter->netdev, "Releasing sub-CRQ\n"); in release_sub_crq_queue()
3984 "Failed to release sub-CRQ %16lx, rc = %ld\n", in release_sub_crq_queue()
4015 dev_warn(dev, "Couldn't allocate crq queue messages page\n"); in init_sub_crq_queue()
4024 dev_warn(dev, "Couldn't map crq queue messages page\n"); in init_sub_crq_queue()
4037 dev_warn(dev, "Error %d registering sub-crq\n", rc); in init_sub_crq_queue()
4057 "sub-crq initialized, num %lx, hw_irq=%lx, irq=%x\n", in init_sub_crq_queue()
4477 union ibmvnic_crq crq; in send_request_cap() local
4493 /* Sub-CRQ entries are 32 byte long */ in send_request_cap()
4500 dev_err(dev, "Fatal, invalid entries per sub-crq\n"); in send_request_cap()
4561 memset(&crq, 0, sizeof(crq)); in send_request_cap()
4562 crq.request_capability.first = IBMVNIC_CRQ_CMD; in send_request_cap()
4563 crq.request_capability.cmd = REQUEST_CAPABILITY; in send_request_cap()
4565 crq.request_capability.capability = cpu_to_be16(REQ_TX_QUEUES); in send_request_cap()
4566 crq.request_capability.number = cpu_to_be64(adapter->req_tx_queues); in send_request_cap()
4568 ibmvnic_send_crq(adapter, &crq); in send_request_cap()
4570 crq.request_capability.capability = cpu_to_be16(REQ_RX_QUEUES); in send_request_cap()
4571 crq.request_capability.number = cpu_to_be64(adapter->req_rx_queues); in send_request_cap()
4573 ibmvnic_send_crq(adapter, &crq); in send_request_cap()
4575 crq.request_capability.capability = cpu_to_be16(REQ_RX_ADD_QUEUES); in send_request_cap()
4576 crq.request_capability.number = cpu_to_be64(adapter->req_rx_add_queues); in send_request_cap()
4578 ibmvnic_send_crq(adapter, &crq); in send_request_cap()
4580 crq.request_capability.capability = in send_request_cap()
4582 crq.request_capability.number = in send_request_cap()
4585 ibmvnic_send_crq(adapter, &crq); in send_request_cap()
4587 crq.request_capability.capability = in send_request_cap()
4589 crq.request_capability.number = in send_request_cap()
4592 ibmvnic_send_crq(adapter, &crq); in send_request_cap()
4594 crq.request_capability.capability = cpu_to_be16(REQ_MTU); in send_request_cap()
4595 crq.request_capability.number = cpu_to_be64(adapter->req_mtu); in send_request_cap()
4597 ibmvnic_send_crq(adapter, &crq); in send_request_cap()
4601 crq.request_capability.capability = in send_request_cap()
4603 crq.request_capability.number = cpu_to_be64(1); in send_request_cap()
4605 ibmvnic_send_crq(adapter, &crq); in send_request_cap()
4608 crq.request_capability.capability = in send_request_cap()
4610 crq.request_capability.number = cpu_to_be64(0); in send_request_cap()
4612 ibmvnic_send_crq(adapter, &crq); in send_request_cap()
4663 struct ibmvnic_crq_queue *queue = &adapter->crq; in ibmvnic_next_crq()
4664 union ibmvnic_crq *crq; in ibmvnic_next_crq() local
4666 crq = &queue->msgs[queue->cur]; in ibmvnic_next_crq()
4667 if (crq->generic.first & IBMVNIC_CRQ_CMD_RSP) { in ibmvnic_next_crq()
4671 crq = NULL; in ibmvnic_next_crq()
4674 return crq; in ibmvnic_next_crq()
4716 union ibmvnic_crq *crq) in ibmvnic_send_crq() argument
4720 u64 *u64_crq = (u64 *)crq; in ibmvnic_send_crq()
4723 netdev_dbg(adapter->netdev, "Sending CRQ: %016lx %016lx\n", in ibmvnic_send_crq()
4727 if (!adapter->crq.active && in ibmvnic_send_crq()
4728 crq->generic.first != IBMVNIC_CRQ_INIT_CMD) { in ibmvnic_send_crq()
4729 …dev_warn(dev, "Invalid request detected while CRQ is inactive, possible device state change during… in ibmvnic_send_crq()
4742 dev_warn(dev, "CRQ Queue closed\n"); in ibmvnic_send_crq()
4755 union ibmvnic_crq crq; in ibmvnic_send_crq_init() local
4759 memset(&crq, 0, sizeof(crq)); in ibmvnic_send_crq_init()
4760 crq.generic.first = IBMVNIC_CRQ_INIT_CMD; in ibmvnic_send_crq_init()
4761 crq.generic.cmd = IBMVNIC_CRQ_INIT; in ibmvnic_send_crq_init()
4762 netdev_dbg(adapter->netdev, "Sending CRQ init\n"); in ibmvnic_send_crq_init()
4765 rc = ibmvnic_send_crq(adapter, &crq); in ibmvnic_send_crq_init()
4839 union ibmvnic_crq crq; in send_login() local
4945 memset(&crq, 0, sizeof(crq)); in send_login()
4946 crq.login.first = IBMVNIC_CRQ_CMD; in send_login()
4947 crq.login.cmd = LOGIN; in send_login()
4948 crq.login.ioba = cpu_to_be32(buffer_token); in send_login()
4949 crq.login.len = cpu_to_be32(buffer_size); in send_login()
4952 rc = ibmvnic_send_crq(adapter, &crq); in send_login()
4979 union ibmvnic_crq crq; in send_request_map() local
4981 memset(&crq, 0, sizeof(crq)); in send_request_map()
4982 crq.request_map.first = IBMVNIC_CRQ_CMD; in send_request_map()
4983 crq.request_map.cmd = REQUEST_MAP; in send_request_map()
4984 crq.request_map.map_id = map_id; in send_request_map()
4985 crq.request_map.ioba = cpu_to_be32(addr); in send_request_map()
4986 crq.request_map.len = cpu_to_be32(len); in send_request_map()
4987 return ibmvnic_send_crq(adapter, &crq); in send_request_map()
4992 union ibmvnic_crq crq; in send_request_unmap() local
4994 memset(&crq, 0, sizeof(crq)); in send_request_unmap()
4995 crq.request_unmap.first = IBMVNIC_CRQ_CMD; in send_request_unmap()
4996 crq.request_unmap.cmd = REQUEST_UNMAP; in send_request_unmap()
4997 crq.request_unmap.map_id = map_id; in send_request_unmap()
4998 return ibmvnic_send_crq(adapter, &crq); in send_request_unmap()
5003 union ibmvnic_crq crq; in send_query_map() local
5005 memset(&crq, 0, sizeof(crq)); in send_query_map()
5006 crq.query_map.first = IBMVNIC_CRQ_CMD; in send_query_map()
5007 crq.query_map.cmd = QUERY_MAP; in send_query_map()
5008 ibmvnic_send_crq(adapter, &crq); in send_query_map()
5014 union ibmvnic_crq crq; in send_query_cap() local
5025 memset(&crq, 0, sizeof(crq)); in send_query_cap()
5026 crq.query_capability.first = IBMVNIC_CRQ_CMD; in send_query_cap()
5027 crq.query_capability.cmd = QUERY_CAPABILITY; in send_query_cap()
5029 crq.query_capability.capability = cpu_to_be16(MIN_TX_QUEUES); in send_query_cap()
5030 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5033 crq.query_capability.capability = cpu_to_be16(MIN_RX_QUEUES); in send_query_cap()
5034 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5037 crq.query_capability.capability = cpu_to_be16(MIN_RX_ADD_QUEUES); in send_query_cap()
5038 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5041 crq.query_capability.capability = cpu_to_be16(MAX_TX_QUEUES); in send_query_cap()
5042 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5045 crq.query_capability.capability = cpu_to_be16(MAX_RX_QUEUES); in send_query_cap()
5046 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5049 crq.query_capability.capability = cpu_to_be16(MAX_RX_ADD_QUEUES); in send_query_cap()
5050 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5053 crq.query_capability.capability = in send_query_cap()
5055 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5058 crq.query_capability.capability = in send_query_cap()
5060 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5063 crq.query_capability.capability = in send_query_cap()
5065 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5068 crq.query_capability.capability = in send_query_cap()
5070 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5073 crq.query_capability.capability = cpu_to_be16(TCP_IP_OFFLOAD); in send_query_cap()
5074 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5077 crq.query_capability.capability = cpu_to_be16(PROMISC_SUPPORTED); in send_query_cap()
5078 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5081 crq.query_capability.capability = cpu_to_be16(MIN_MTU); in send_query_cap()
5082 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5085 crq.query_capability.capability = cpu_to_be16(MAX_MTU); in send_query_cap()
5086 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5089 crq.query_capability.capability = cpu_to_be16(MAX_MULTICAST_FILTERS); in send_query_cap()
5090 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5093 crq.query_capability.capability = cpu_to_be16(VLAN_HEADER_INSERTION); in send_query_cap()
5094 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5097 crq.query_capability.capability = cpu_to_be16(RX_VLAN_HEADER_INSERTION); in send_query_cap()
5098 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5101 crq.query_capability.capability = cpu_to_be16(MAX_TX_SG_ENTRIES); in send_query_cap()
5102 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5105 crq.query_capability.capability = cpu_to_be16(RX_SG_SUPPORTED); in send_query_cap()
5106 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5109 crq.query_capability.capability = cpu_to_be16(OPT_TX_COMP_SUB_QUEUES); in send_query_cap()
5110 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5113 crq.query_capability.capability = cpu_to_be16(OPT_RX_COMP_QUEUES); in send_query_cap()
5114 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5117 crq.query_capability.capability = in send_query_cap()
5119 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5122 crq.query_capability.capability = in send_query_cap()
5124 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5127 crq.query_capability.capability = in send_query_cap()
5129 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5132 crq.query_capability.capability = cpu_to_be16(TX_RX_DESC_REQ); in send_query_cap()
5134 ibmvnic_send_crq(adapter, &crq); in send_query_cap()
5147 union ibmvnic_crq crq; in send_query_ip_offload() local
5161 memset(&crq, 0, sizeof(crq)); in send_query_ip_offload()
5162 crq.query_ip_offload.first = IBMVNIC_CRQ_CMD; in send_query_ip_offload()
5163 crq.query_ip_offload.cmd = QUERY_IP_OFFLOAD; in send_query_ip_offload()
5164 crq.query_ip_offload.len = cpu_to_be32(buf_sz); in send_query_ip_offload()
5165 crq.query_ip_offload.ioba = in send_query_ip_offload()
5168 ibmvnic_send_crq(adapter, &crq); in send_query_ip_offload()
5177 union ibmvnic_crq crq; in send_control_ip_offload() local
5241 memset(&crq, 0, sizeof(crq)); in send_control_ip_offload()
5242 crq.control_ip_offload.first = IBMVNIC_CRQ_CMD; in send_control_ip_offload()
5243 crq.control_ip_offload.cmd = CONTROL_IP_OFFLOAD; in send_control_ip_offload()
5244 crq.control_ip_offload.len = in send_control_ip_offload()
5246 crq.control_ip_offload.ioba = cpu_to_be32(adapter->ip_offload_ctrl_tok); in send_control_ip_offload()
5247 ibmvnic_send_crq(adapter, &crq); in send_control_ip_offload()
5250 static void handle_vpd_size_rsp(union ibmvnic_crq *crq, in handle_vpd_size_rsp() argument
5255 if (crq->get_vpd_size_rsp.rc.code) { in handle_vpd_size_rsp()
5257 crq->get_vpd_size_rsp.rc.code); in handle_vpd_size_rsp()
5262 adapter->vpd->len = be64_to_cpu(crq->get_vpd_size_rsp.len); in handle_vpd_size_rsp()
5266 static void handle_vpd_rsp(union ibmvnic_crq *crq, in handle_vpd_rsp() argument
5278 if (crq->get_vpd_rsp.rc.code) { in handle_vpd_rsp()
5280 crq->get_vpd_rsp.rc.code); in handle_vpd_rsp()
5394 static void handle_error_indication(union ibmvnic_crq *crq, in handle_error_indication() argument
5400 cause = be16_to_cpu(crq->error_indication.error_cause); in handle_error_indication()
5404 crq->error_indication.flags in handle_error_indication()
5408 if (crq->error_indication.flags & IBMVNIC_FATAL_ERROR) in handle_error_indication()
5414 static int handle_change_mac_rsp(union ibmvnic_crq *crq, in handle_change_mac_rsp() argument
5421 rc = crq->change_mac_addr_rsp.rc.code; in handle_change_mac_rsp()
5426 /* crq->change_mac_addr.mac_addr is the requested one in handle_change_mac_rsp()
5427 * crq->change_mac_addr_rsp.mac_addr is the returned valid one. in handle_change_mac_rsp()
5429 eth_hw_addr_set(netdev, &crq->change_mac_addr_rsp.mac_addr[0]); in handle_change_mac_rsp()
5431 &crq->change_mac_addr_rsp.mac_addr[0]); in handle_change_mac_rsp()
5437 static void handle_request_cap_rsp(union ibmvnic_crq *crq, in handle_request_cap_rsp() argument
5447 switch (be16_to_cpu(crq->request_capability_rsp.capability)) { in handle_request_cap_rsp()
5478 crq->request_capability.capability); in handle_request_cap_rsp()
5482 switch (crq->request_capability_rsp.rc.code) { in handle_request_cap_rsp()
5488 (long)be64_to_cpu(crq->request_capability_rsp.number), in handle_request_cap_rsp()
5491 if (be16_to_cpu(crq->request_capability_rsp.capability) == in handle_request_cap_rsp()
5498 be64_to_cpu(crq->request_capability_rsp.number); in handle_request_cap_rsp()
5505 crq->request_capability_rsp.rc.code); in handle_request_cap_rsp()
5581 * 2 outstanding login requests sent, the LOGIN_RSP crq in handle_login_rsp()
5620 static void handle_request_unmap_rsp(union ibmvnic_crq *crq, in handle_request_unmap_rsp() argument
5626 rc = crq->request_unmap_rsp.rc.code; in handle_request_unmap_rsp()
5631 static void handle_query_map_rsp(union ibmvnic_crq *crq, in handle_query_map_rsp() argument
5638 rc = crq->query_map_rsp.rc.code; in handle_query_map_rsp()
5644 crq->query_map_rsp.page_size, in handle_query_map_rsp()
5645 __be32_to_cpu(crq->query_map_rsp.tot_pages), in handle_query_map_rsp()
5646 __be32_to_cpu(crq->query_map_rsp.free_pages)); in handle_query_map_rsp()
5649 static void handle_query_cap_rsp(union ibmvnic_crq *crq, in handle_query_cap_rsp() argument
5659 rc = crq->query_capability.rc.code; in handle_query_cap_rsp()
5665 switch (be16_to_cpu(crq->query_capability.capability)) { in handle_query_cap_rsp()
5668 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5674 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5680 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5686 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5692 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5698 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5704 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5710 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5716 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5722 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5728 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5734 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5739 adapter->min_mtu = be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5744 adapter->max_mtu = be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5750 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5756 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5764 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5770 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5776 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5782 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5788 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5794 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5800 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5806 be64_to_cpu(crq->query_capability.number); in handle_query_cap_rsp()
5811 adapter->tx_rx_desc_req = crq->query_capability.number; in handle_query_cap_rsp()
5818 crq->query_capability.capability); in handle_query_cap_rsp()
5828 union ibmvnic_crq crq; in send_query_phys_parms() local
5831 memset(&crq, 0, sizeof(crq)); in send_query_phys_parms()
5832 crq.query_phys_parms.first = IBMVNIC_CRQ_CMD; in send_query_phys_parms()
5833 crq.query_phys_parms.cmd = QUERY_PHYS_PARMS; in send_query_phys_parms()
5839 rc = ibmvnic_send_crq(adapter, &crq); in send_query_phys_parms()
5855 static int handle_query_phys_parms_rsp(union ibmvnic_crq *crq, in handle_query_phys_parms_rsp() argument
5860 __be32 rspeed = cpu_to_be32(crq->query_phys_parms_rsp.speed); in handle_query_phys_parms_rsp()
5862 rc = crq->query_phys_parms_rsp.rc.code; in handle_query_phys_parms_rsp()
5900 if (crq->query_phys_parms_rsp.flags1 & IBMVNIC_FULL_DUPLEX) in handle_query_phys_parms_rsp()
5902 else if (crq->query_phys_parms_rsp.flags1 & IBMVNIC_HALF_DUPLEX) in handle_query_phys_parms_rsp()
5910 static void ibmvnic_handle_crq(union ibmvnic_crq *crq, in ibmvnic_handle_crq() argument
5913 struct ibmvnic_generic_crq *gen_crq = &crq->generic; in ibmvnic_handle_crq()
5916 u64 *u64_crq = (u64 *)crq; in ibmvnic_handle_crq()
5919 netdev_dbg(netdev, "Handling CRQ: %016lx %016lx\n", in ibmvnic_handle_crq()
5963 adapter->crq.active = true; in ibmvnic_handle_crq()
5967 dev_err(dev, "Unknown crq cmd: %d\n", gen_crq->cmd); in ibmvnic_handle_crq()
5972 adapter->crq.active = false; in ibmvnic_handle_crq()
5981 /* if we got here during crq-init, retry crq-init */ in ibmvnic_handle_crq()
6014 rc = crq->version_exchange_rsp.rc.code; in ibmvnic_handle_crq()
6020 be16_to_cpu(crq->version_exchange_rsp.version); in ibmvnic_handle_crq()
6026 handle_query_cap_rsp(crq, adapter); in ibmvnic_handle_crq()
6029 handle_query_map_rsp(crq, adapter); in ibmvnic_handle_crq()
6032 adapter->fw_done_rc = crq->request_map_rsp.rc.code; in ibmvnic_handle_crq()
6036 handle_request_unmap_rsp(crq, adapter); in ibmvnic_handle_crq()
6039 handle_request_cap_rsp(crq, adapter); in ibmvnic_handle_crq()
6043 handle_login_rsp(crq, adapter); in ibmvnic_handle_crq()
6048 crq->logical_link_state_rsp.link_state, in ibmvnic_handle_crq()
6049 crq->logical_link_state_rsp.rc.code); in ibmvnic_handle_crq()
6051 crq->logical_link_state_rsp.link_state; in ibmvnic_handle_crq()
6052 adapter->init_done_rc = crq->logical_link_state_rsp.rc.code; in ibmvnic_handle_crq()
6058 crq->link_state_indication.phys_link_state; in ibmvnic_handle_crq()
6060 crq->link_state_indication.logical_link_state; in ibmvnic_handle_crq()
6068 adapter->fw_done_rc = handle_change_mac_rsp(crq, adapter); in ibmvnic_handle_crq()
6072 handle_error_indication(crq, adapter); in ibmvnic_handle_crq()
6097 handle_vpd_size_rsp(crq, adapter); in ibmvnic_handle_crq()
6100 handle_vpd_rsp(crq, adapter); in ibmvnic_handle_crq()
6103 adapter->fw_done_rc = handle_query_phys_parms_rsp(crq, adapter); in ibmvnic_handle_crq()
6123 struct ibmvnic_crq_queue *queue = &adapter->crq; in ibmvnic_tasklet()
6124 union ibmvnic_crq *crq; in ibmvnic_tasklet() local
6129 /* Pull all the valid messages off the CRQ */ in ibmvnic_tasklet()
6130 while ((crq = ibmvnic_next_crq(adapter)) != NULL) { in ibmvnic_tasklet()
6132 * crq->generic.first & IBMVNIC_CRQ_CMD_RSP is loaded in ibmvnic_tasklet()
6137 ibmvnic_handle_crq(crq, adapter); in ibmvnic_tasklet()
6138 crq->generic.first = 0; in ibmvnic_tasklet()
6161 struct ibmvnic_crq_queue *crq = &adapter->crq; in ibmvnic_reset_crq() local
6166 /* Close the CRQ */ in ibmvnic_reset_crq()
6172 if (!crq->msgs) in ibmvnic_reset_crq()
6175 memset(crq->msgs, 0, PAGE_SIZE); in ibmvnic_reset_crq()
6176 crq->cur = 0; in ibmvnic_reset_crq()
6177 crq->active = false; in ibmvnic_reset_crq()
6181 crq->msg_token, PAGE_SIZE); in ibmvnic_reset_crq()
6187 dev_warn(dev, "Couldn't register crq (rc=%d)\n", rc); in ibmvnic_reset_crq()
6194 struct ibmvnic_crq_queue *crq = &adapter->crq; in release_crq_queue() local
6198 if (!crq->msgs) in release_crq_queue()
6201 netdev_dbg(adapter->netdev, "Releasing CRQ\n"); in release_crq_queue()
6208 dma_unmap_single(&vdev->dev, crq->msg_token, PAGE_SIZE, in release_crq_queue()
6210 free_page((unsigned long)crq->msgs); in release_crq_queue()
6211 crq->msgs = NULL; in release_crq_queue()
6212 crq->active = false; in release_crq_queue()
6217 struct ibmvnic_crq_queue *crq = &adapter->crq; in init_crq_queue() local
6222 if (crq->msgs) in init_crq_queue()
6225 crq->msgs = (union ibmvnic_crq *)get_zeroed_page(GFP_KERNEL); in init_crq_queue()
6228 if (!crq->msgs) in init_crq_queue()
6231 crq->size = PAGE_SIZE / sizeof(*crq->msgs); in init_crq_queue()
6232 crq->msg_token = dma_map_single(dev, crq->msgs, PAGE_SIZE, in init_crq_queue()
6234 if (dma_mapping_error(dev, crq->msg_token)) in init_crq_queue()
6238 crq->msg_token, PAGE_SIZE); in init_crq_queue()
6257 snprintf(crq->name, sizeof(crq->name), "ibmvnic-%x", in init_crq_queue()
6259 rc = request_irq(vdev->irq, ibmvnic_interrupt, 0, crq->name, adapter); in init_crq_queue()
6272 crq->cur = 0; in init_crq_queue()
6273 spin_lock_init(&crq->lock); in init_crq_queue()
6286 dma_unmap_single(dev, crq->msg_token, PAGE_SIZE, DMA_BIDIRECTIONAL); in init_crq_queue()
6288 free_page((unsigned long)crq->msgs); in init_crq_queue()
6289 crq->msgs = NULL; in init_crq_queue()
6305 dev_err(dev, "Send crq init failed with error %d\n", rc); in ibmvnic_reset_init()
6316 dev_err(dev, "CRQ-init failed, %d\n", adapter->init_done_rc); in ibmvnic_reset_init()
6323 dev_err(dev, "CRQ-init failed, passive-init\n"); in ibmvnic_reset_init()
6358 dev_err(dev, "Failed to initialize sub crq irqs\n"); in ibmvnic_reset_init()
6431 * since we are reinitializing the CRQ in ibmvnic_probe()
6435 /* If we had already initialized CRQ, we may have one or in ibmvnic_probe()
6437 * the CRQ before initializing the CRQ again. in ibmvnic_probe()
6442 * will not access the ->rwi_list and since we released CRQ, in ibmvnic_probe()
6457 dev_err(&dev->dev, "Couldn't initialize crq. rc=%d\n", in ibmvnic_probe()
6466 * partner is not ready. CRQ is not active. When the partner becomes in ibmvnic_probe()
6532 /* cleanup worker thread after releasing CRQ so we don't get in ibmvnic_probe()
6653 ret += PAGE_SIZE; /* the crq message queue */ in ibmvnic_get_desired_dma()