Lines Matching refs:cldev

177 	struct mei_cl_device *cldev;  member
234 static void iwl_mei_free_shared_mem(struct mei_cl_device *cldev) in iwl_mei_free_shared_mem() argument
236 struct iwl_mei *mei = mei_cldev_get_drvdata(cldev); in iwl_mei_free_shared_mem()
238 if (mei_cldev_dma_unmap(cldev)) in iwl_mei_free_shared_mem()
239 dev_err(&cldev->dev, "Couldn't unmap the shared mem properly\n"); in iwl_mei_free_shared_mem()
245 static int iwl_mei_alloc_mem_for_version(struct mei_cl_device *cldev, in iwl_mei_alloc_mem_for_version() argument
248 struct iwl_mei *mei = mei_cldev_get_drvdata(cldev); in iwl_mei_alloc_mem_for_version()
255 mem->ctrl = mei_cldev_dma_map(cldev, HBM_DMA_BUF_ID_WLAN, mem_size); in iwl_mei_alloc_mem_for_version()
269 static int iwl_mei_alloc_shared_mem(struct mei_cl_device *cldev) in iwl_mei_alloc_shared_mem() argument
280 ret = iwl_mei_alloc_mem_for_version(cldev, IWL_MEI_SAP_VERSION_4); in iwl_mei_alloc_shared_mem()
282 ret = iwl_mei_alloc_mem_for_version(cldev, in iwl_mei_alloc_shared_mem()
331 static ssize_t iwl_mei_write_cyclic_buf(struct mei_cl_device *cldev, in iwl_mei_write_cyclic_buf() argument
343 dev_err(&cldev->dev, in iwl_mei_write_cyclic_buf()
352 dev_err(&cldev->dev, in iwl_mei_write_cyclic_buf()
383 static int iwl_mei_send_check_shared_area(struct mei_cl_device *cldev) in iwl_mei_send_check_shared_area() argument
385 struct iwl_mei *mei = mei_cldev_get_drvdata(cldev); in iwl_mei_send_check_shared_area()
398 ret = mei_cldev_send(cldev, (void *)&msg, sizeof(msg)); in iwl_mei_send_check_shared_area()
400 dev_err(&cldev->dev, in iwl_mei_send_check_shared_area()
424 iwl_mei_send_check_shared_area(mei->cldev); in iwl_mei_csa_throttle_end_wk()
429 static int iwl_mei_send_sap_msg_payload(struct mei_cl_device *cldev, in iwl_mei_send_sap_msg_payload() argument
432 struct iwl_mei *mei = mei_cldev_get_drvdata(cldev); in iwl_mei_send_sap_msg_payload()
442 dev_err(&cldev->dev, in iwl_mei_send_sap_msg_payload()
448 dev_err(&cldev->dev, in iwl_mei_send_sap_msg_payload()
454 dev_dbg(&cldev->dev, "Sending %d\n", hdr->type); in iwl_mei_send_sap_msg_payload()
467 return iwl_mei_send_check_shared_area(cldev); in iwl_mei_send_sap_msg_payload()
519 dev_err(&mei->cldev->dev, in iwl_mei_add_data_to_ring()
528 dev_err(&mei->cldev->dev, in iwl_mei_add_data_to_ring()
534 dev_err(&mei->cldev->dev, in iwl_mei_add_data_to_ring()
572 iwl_mei_send_sap_msg(struct mei_cl_device *cldev, u16 type) in iwl_mei_send_sap_msg() argument
578 return iwl_mei_send_sap_msg_payload(cldev, &msg); in iwl_mei_send_sap_msg()
591 iwl_mei_send_check_shared_area(mei->cldev); in iwl_mei_send_csa_msg_wk()
611 dev_err(&mei->cldev->dev, in iwl_mei_rx_handler()
665 iwl_mei_handle_rx_start_ok(struct mei_cl_device *cldev, in iwl_mei_handle_rx_start_ok() argument
670 dev_err(&cldev->dev, in iwl_mei_handle_rx_start_ok()
672 dev_err(&cldev->dev, in iwl_mei_handle_rx_start_ok()
679 dev_err(&cldev->dev, in iwl_mei_handle_rx_start_ok()
694 static void iwl_mei_handle_csme_filters(struct mei_cl_device *cldev, in iwl_mei_handle_csme_filters() argument
719 iwl_mei_handle_conn_status(struct mei_cl_device *cldev, in iwl_mei_handle_conn_status() argument
722 struct iwl_mei *mei = mei_cldev_get_drvdata(cldev); in iwl_mei_handle_conn_status()
785 iwl_mei_send_sap_msg(mei->cldev, in iwl_mei_set_init_conf()
790 iwl_mei_send_sap_msg(mei->cldev, SAP_MSG_NOTIF_WHO_OWNS_NIC); in iwl_mei_set_init_conf()
794 iwl_mei_send_sap_msg_payload(mei->cldev, &link_msg.hdr); in iwl_mei_set_init_conf()
797 iwl_mei_send_sap_msg_payload(mei->cldev, &mcc_msg.hdr); in iwl_mei_set_init_conf()
802 iwl_mei_send_sap_msg_payload(mei->cldev, &sar_msg.hdr); in iwl_mei_set_init_conf()
810 iwl_mei_send_sap_msg_payload(mei->cldev, &nic_info_msg.hdr); in iwl_mei_set_init_conf()
813 iwl_mei_send_sap_msg_payload(mei->cldev, &rfkill_msg.hdr); in iwl_mei_set_init_conf()
816 static void iwl_mei_handle_amt_state(struct mei_cl_device *cldev, in iwl_mei_handle_amt_state() argument
819 struct iwl_mei *mei = mei_cldev_get_drvdata(cldev); in iwl_mei_handle_amt_state()
839 static void iwl_mei_handle_nic_owner(struct mei_cl_device *cldev, in iwl_mei_handle_nic_owner() argument
842 struct iwl_mei *mei = mei_cldev_get_drvdata(cldev); in iwl_mei_handle_nic_owner()
847 static void iwl_mei_handle_can_release_ownership(struct mei_cl_device *cldev, in iwl_mei_handle_can_release_ownership() argument
852 iwl_mei_send_sap_msg(cldev, in iwl_mei_handle_can_release_ownership()
856 static void iwl_mei_handle_csme_taking_ownership(struct mei_cl_device *cldev, in iwl_mei_handle_csme_taking_ownership() argument
859 struct iwl_mei *mei = mei_cldev_get_drvdata(cldev); in iwl_mei_handle_csme_taking_ownership()
861 dev_info(&cldev->dev, "CSME takes ownership\n"); in iwl_mei_handle_csme_taking_ownership()
874 iwl_mei_send_sap_msg(cldev, in iwl_mei_handle_csme_taking_ownership()
881 static void iwl_mei_handle_nvm(struct mei_cl_device *cldev, in iwl_mei_handle_nvm() argument
884 struct iwl_mei *mei = mei_cldev_get_drvdata(cldev); in iwl_mei_handle_nvm()
905 static void iwl_mei_handle_rx_host_own_req(struct mei_cl_device *cldev, in iwl_mei_handle_rx_host_own_req() argument
908 struct iwl_mei *mei = mei_cldev_get_drvdata(cldev); in iwl_mei_handle_rx_host_own_req()
915 dev_info(&cldev->dev, "Ownership req denied\n"); in iwl_mei_handle_rx_host_own_req()
922 iwl_mei_send_sap_msg(cldev, in iwl_mei_handle_rx_host_own_req()
930 static void iwl_mei_handle_pldr_ack(struct mei_cl_device *cldev, in iwl_mei_handle_pldr_ack() argument
933 struct iwl_mei *mei = mei_cldev_get_drvdata(cldev); in iwl_mei_handle_pldr_ack()
939 static void iwl_mei_handle_ping(struct mei_cl_device *cldev, in iwl_mei_handle_ping() argument
942 iwl_mei_send_sap_msg(cldev, SAP_MSG_NOTIF_PONG); in iwl_mei_handle_ping()
945 static void iwl_mei_handle_sap_msg(struct mei_cl_device *cldev, in iwl_mei_handle_sap_msg() argument
951 dev_dbg(&cldev->dev, in iwl_mei_handle_sap_msg()
959 dev_err(&cldev->dev, \ in iwl_mei_handle_sap_msg()
967 _handler(cldev, (const void *)hdr); \ in iwl_mei_handle_sap_msg()
974 dev_err(&cldev->dev, \ in iwl_mei_handle_sap_msg()
981 _handler(cldev, (const void *)hdr); \ in iwl_mei_handle_sap_msg()
987 dev_err(&cldev->dev, \ in iwl_mei_handle_sap_msg()
1027 dev_dbg(&cldev->dev, "Unsupported message: type %d, len %d\n", in iwl_mei_handle_sap_msg()
1058 static void iwl_mei_handle_sap_data(struct mei_cl_device *cldev, in iwl_mei_handle_sap_data() argument
1082 dev_err(&cldev->dev, in iwl_mei_handle_sap_data()
1089 dev_err(&cldev->dev, in iwl_mei_handle_sap_data()
1097 dev_err(&cldev->dev, "Unsupported Rx data: type %d, len %d\n", in iwl_mei_handle_sap_data()
1132 static void iwl_mei_handle_sap_rx_cmd(struct mei_cl_device *cldev, in iwl_mei_handle_sap_rx_cmd() argument
1157 iwl_mei_handle_sap_msg(cldev, hdr); in iwl_mei_handle_sap_rx_cmd()
1163 dev_err(&cldev->dev, in iwl_mei_handle_sap_rx_cmd()
1169 static void iwl_mei_handle_sap_rx(struct mei_cl_device *cldev, in iwl_mei_handle_sap_rx() argument
1180 dev_err(&cldev->dev, in iwl_mei_handle_sap_rx()
1191 iwl_mei_handle_sap_data(cldev, q_head, q_sz, rd, wr, in iwl_mei_handle_sap_rx()
1194 iwl_mei_handle_sap_rx_cmd(cldev, q_head, q_sz, rd, wr, in iwl_mei_handle_sap_rx()
1201 static void iwl_mei_handle_check_shared_area(struct mei_cl_device *cldev) in iwl_mei_handle_check_shared_area() argument
1203 struct iwl_mei *mei = mei_cldev_get_drvdata(cldev); in iwl_mei_handle_check_shared_area()
1223 iwl_mei_handle_sap_rx(cldev, notif_q, q_head, NULL, q_sz); in iwl_mei_handle_check_shared_area()
1233 iwl_mei_handle_sap_rx(cldev, notif_q, q_head, &tx_skbs, q_sz); in iwl_mei_handle_check_shared_area()
1252 dev_err(&cldev->dev, "Can't Tx without a netdev\n"); in iwl_mei_handle_check_shared_area()
1268 static void iwl_mei_rx(struct mei_cl_device *cldev) in iwl_mei_rx() argument
1274 ret = mei_cldev_recv(cldev, (u8 *)&msg, sizeof(msg)); in iwl_mei_rx()
1276 dev_err(&cldev->dev, "failed to receive data: %zd\n", ret); in iwl_mei_rx()
1281 dev_err(&cldev->dev, "got an empty response\n"); in iwl_mei_rx()
1293 iwl_mei_handle_rx_start_ok(cldev, (void *)msg, ret); in iwl_mei_rx()
1296 iwl_mei_handle_check_shared_area(cldev); in iwl_mei_rx()
1299 dev_err(&cldev->dev, "got a RX notification: %d\n", in iwl_mei_rx()
1305 static int iwl_mei_send_start(struct mei_cl_device *cldev) in iwl_mei_send_start() argument
1307 struct iwl_mei *mei = mei_cldev_get_drvdata(cldev); in iwl_mei_send_start()
1319 ret = mei_cldev_send(cldev, (void *)&msg, sizeof(msg)); in iwl_mei_send_start()
1321 dev_err(&cldev->dev, in iwl_mei_send_start()
1330 static int iwl_mei_enable(struct mei_cl_device *cldev) in iwl_mei_enable() argument
1334 ret = mei_cldev_enable(cldev); in iwl_mei_enable()
1336 dev_err(&cldev->dev, "failed to enable the device: %d\n", ret); in iwl_mei_enable()
1340 ret = mei_cldev_register_rx_cb(cldev, iwl_mei_rx); in iwl_mei_enable()
1342 dev_err(&cldev->dev, in iwl_mei_enable()
1344 mei_cldev_disable(cldev); in iwl_mei_enable()
1430 ret = iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr); in iwl_mei_pldr_req()
1483 ret = iwl_mei_send_sap_msg(mei->cldev, in iwl_mei_get_ownership()
1526 iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr); in iwl_mei_alive_notif()
1570 iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr); in iwl_mei_host_associated()
1599 iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr); in iwl_mei_host_disassociated()
1635 iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr); in iwl_mei_set_rfkill_state()
1664 iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr); in iwl_mei_set_nic_info()
1692 iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr); in iwl_mei_set_country_code()
1720 iwl_mei_send_sap_msg_payload(mei->cldev, &msg.hdr); in iwl_mei_set_power_limit()
1786 iwl_mei_send_sap_msg(mei->cldev, in iwl_mei_device_state()
1825 iwl_mei_send_sap_msg(mei->cldev, in iwl_mei_register()
1868 iwl_mei_send_sap_msg(mei->cldev, in iwl_mei_unregister_complete()
1964 static int iwl_mei_probe(struct mei_cl_device *cldev, in iwl_mei_probe() argument
1971 mei = devm_kzalloc(&cldev->dev, sizeof(*mei), GFP_KERNEL); in iwl_mei_probe()
1985 mei_cldev_set_drvdata(cldev, mei); in iwl_mei_probe()
1986 mei->cldev = cldev; in iwl_mei_probe()
1990 ret = iwl_mei_alloc_shared_mem(cldev); in iwl_mei_probe()
2002 dev_dbg(&cldev->dev, in iwl_mei_probe()
2010 dev_err(&cldev->dev, "Couldn't allocate the shared memory: %d\n", in iwl_mei_probe()
2017 ret = iwl_mei_enable(cldev); in iwl_mei_probe()
2028 ret = iwl_mei_send_start(cldev); in iwl_mei_probe()
2034 iwl_mei_global_cldev = cldev; in iwl_mei_probe()
2040 mei_cldev_disable(cldev); in iwl_mei_probe()
2042 iwl_mei_free_shared_mem(cldev); in iwl_mei_probe()
2044 mei_cldev_set_drvdata(cldev, NULL); in iwl_mei_probe()
2045 devm_kfree(&cldev->dev, mei); in iwl_mei_probe()
2053 static void iwl_mei_remove(struct mei_cl_device *cldev) in iwl_mei_remove() argument
2055 struct iwl_mei *mei = mei_cldev_get_drvdata(cldev); in iwl_mei_remove()
2062 if (mei_cldev_enabled(cldev) && iwl_mei_cache.ops) { in iwl_mei_remove()
2111 iwl_mei_send_sap_msg(mei->cldev, in iwl_mei_remove()
2127 dev_err(&mei->cldev->dev, in iwl_mei_remove()
2152 mei_cldev_disable(cldev); in iwl_mei_remove()
2178 iwl_mei_free_shared_mem(cldev); in iwl_mei_remove()
2182 mei_cldev_set_drvdata(cldev, NULL); in iwl_mei_remove()
2188 devm_kfree(&cldev->dev, mei); in iwl_mei_remove()