Lines Matching full:vif

46 	struct wilc_vif *vif;  member
55 wilc_alloc_work(struct wilc_vif *vif, void (*work_fun)(struct work_struct *), in wilc_alloc_work() argument
67 msg->vif = vif; in wilc_alloc_work()
79 if (!msg->vif || !msg->vif->wilc || !msg->vif->wilc->hif_workqueue) in wilc_enqueue_work()
82 if (!queue_work(msg->vif->wilc->hif_workqueue, &msg->work)) in wilc_enqueue_work()
92 int wilc_get_vif_idx(struct wilc_vif *vif) in wilc_get_vif_idx() argument
94 return vif->idx + 1; in wilc_get_vif_idx()
98 * of wilc->vif[], because we add 1 when pass to wilc device in the function
105 struct wilc_vif *vif; in wilc_get_vif_from_idx() local
110 list_for_each_entry_rcu(vif, &wilc->vif_list, list) { in wilc_get_vif_from_idx()
111 if (vif->idx == index) in wilc_get_vif_from_idx()
112 return vif; in wilc_get_vif_from_idx()
118 static int handle_scan_done(struct wilc_vif *vif, enum scan_event evt) in handle_scan_done() argument
123 struct host_if_drv *hif_drv = vif->hif_drv; in handle_scan_done()
133 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in handle_scan_done()
135 netdev_err(vif->ndev, "Failed to set abort running\n"); in handle_scan_done()
141 netdev_err(vif->ndev, "%s: hif driver is NULL\n", __func__); in handle_scan_done()
154 int wilc_scan(struct wilc_vif *vif, u8 scan_source, in wilc_scan() argument
169 struct host_if_drv *hif_drv = vif->hif_drv; in wilc_scan()
173 netdev_err(vif->ndev, "Already scan\n"); in wilc_scan()
178 if (vif->connecting) { in wilc_scan()
179 netdev_err(vif->ndev, "Don't do obss scan\n"); in wilc_scan()
254 hif_drv->usr_scan_req.priv = &vif->priv; in wilc_scan()
256 result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, index); in wilc_scan()
258 netdev_err(vif->ndev, "Failed to send scan parameters\n"); in wilc_scan()
262 hif_drv->scan_timer_vif = vif; in wilc_scan()
273 static int wilc_send_connect_wid(struct wilc_vif *vif) in wilc_send_connect_wid() argument
278 struct host_if_drv *hif_drv = vif->hif_drv; in wilc_send_connect_wid()
313 result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, wid_cnt); in wilc_send_connect_wid()
315 netdev_err(vif->ndev, "failed to send config packet\n"); in wilc_send_connect_wid()
337 struct wilc_vif *vif = msg->vif; in handle_connect_timeout() local
341 struct host_if_drv *hif_drv = vif->hif_drv; in handle_connect_timeout()
344 netdev_err(vif->ndev, "%s: hif driver is NULL\n", __func__); in handle_connect_timeout()
356 netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__); in handle_connect_timeout()
364 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in handle_connect_timeout()
366 netdev_err(vif->ndev, "Failed to send disconnect\n"); in handle_connect_timeout()
527 struct wilc_user_scan_req *scan_req = &msg->vif->hif_drv->usr_scan_req; in handle_rcvd_ntwrk_info()
558 static void host_int_get_assoc_res_info(struct wilc_vif *vif, in host_int_get_assoc_res_info() argument
571 result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1); in host_int_get_assoc_res_info()
574 netdev_err(vif->ndev, "Failed to send association response\n"); in host_int_get_assoc_res_info()
603 static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif, in host_int_parse_assoc_resp_info() argument
606 struct host_if_drv *hif_drv = vif->hif_drv; in host_int_parse_assoc_resp_info()
614 host_int_get_assoc_res_info(vif, hif_drv->assoc_resp, in host_int_parse_assoc_resp_info()
625 netdev_err(vif->ndev, in host_int_parse_assoc_resp_info()
652 void wilc_handle_disconnect(struct wilc_vif *vif) in wilc_handle_disconnect() argument
654 struct host_if_drv *hif_drv = vif->hif_drv; in wilc_handle_disconnect()
658 handle_scan_done(vif, SCAN_EVENT_ABORTED); in wilc_handle_disconnect()
676 struct wilc_vif *vif = msg->vif; in handle_rcvd_gnrl_async_info() local
678 struct host_if_drv *hif_drv = vif->hif_drv; in handle_rcvd_gnrl_async_info()
681 netdev_err(vif->ndev, "%s: hif driver is NULL\n", __func__); in handle_rcvd_gnrl_async_info()
686 netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__); in handle_rcvd_gnrl_async_info()
692 cfg80211_external_auth_request(vif->ndev, &vif->auth, in handle_rcvd_gnrl_async_info()
696 host_int_parse_assoc_resp_info(vif, mac_info->status); in handle_rcvd_gnrl_async_info()
699 wilc_handle_disconnect(vif); in handle_rcvd_gnrl_async_info()
702 handle_scan_done(vif, SCAN_EVENT_ABORTED); in handle_rcvd_gnrl_async_info()
710 int wilc_disconnect(struct wilc_vif *vif) in wilc_disconnect() argument
713 struct host_if_drv *hif_drv = vif->hif_drv; in wilc_disconnect()
724 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_disconnect()
726 netdev_err(vif->ndev, "Failed to send disconnect\n"); in wilc_disconnect()
747 netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__); in wilc_disconnect()
761 int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats) in wilc_get_statistics() argument
796 result = wilc_send_config_pkt(vif, WILC_GET_CFG, wid_list, wid_cnt); in wilc_get_statistics()
798 netdev_err(vif->ndev, "Failed to send scan parameters\n"); in wilc_get_statistics()
804 wilc_enable_tcp_ack_filter(vif, true); in wilc_get_statistics()
806 wilc_enable_tcp_ack_filter(vif, false); in wilc_get_statistics()
814 struct wilc_vif *vif = msg->vif; in handle_get_statistics() local
817 wilc_get_statistics(vif, stats); in handle_get_statistics()
851 static int handle_remain_on_chan(struct wilc_vif *vif, in handle_remain_on_chan() argument
857 struct host_if_drv *hif_drv = vif->hif_drv; in handle_remain_on_chan()
865 if (vif->connecting) in handle_remain_on_chan()
879 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in handle_remain_on_chan()
884 hif_drv->remain_on_ch.vif = hif_remain_ch->vif; in handle_remain_on_chan()
888 hif_drv->remain_on_ch_timer_vif = vif; in handle_remain_on_chan()
893 static int wilc_handle_roc_expired(struct wilc_vif *vif, u64 cookie) in wilc_handle_roc_expired() argument
898 struct host_if_drv *hif_drv = vif->hif_drv; in wilc_handle_roc_expired()
900 if (vif->priv.p2p_listen_state) { in wilc_handle_roc_expired()
913 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_handle_roc_expired()
916 netdev_err(vif->ndev, "Failed to set remain channel\n"); in wilc_handle_roc_expired()
921 hif_drv->remain_on_ch.expired(hif_drv->remain_on_ch.vif, in wilc_handle_roc_expired()
925 netdev_dbg(vif->ndev, "Not in listen state\n"); in wilc_handle_roc_expired()
935 wilc_handle_roc_expired(msg->vif, msg->body.remain_on_ch.cookie); in wilc_handle_listen_state_expired()
943 struct wilc_vif *vif = hif_drv->remain_on_ch_timer_vif; in listen_timer_cb() local
947 del_timer(&vif->hif_drv->remain_on_ch_timer); in listen_timer_cb()
949 msg = wilc_alloc_work(vif, wilc_handle_listen_state_expired, false); in listen_timer_cb()
953 msg->body.remain_on_ch.cookie = vif->hif_drv->remain_on_ch.cookie; in listen_timer_cb()
957 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__); in listen_timer_cb()
965 struct wilc_vif *vif = msg->vif; in handle_set_mcast_filter() local
988 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in handle_set_mcast_filter()
990 netdev_err(vif->ndev, "Failed to send setup multicast\n"); in handle_set_mcast_filter()
998 void wilc_set_wowlan_trigger(struct wilc_vif *vif, bool enabled) in wilc_set_wowlan_trigger() argument
1012 ret = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_wowlan_trigger()
1017 int wilc_set_external_auth_param(struct wilc_vif *vif, in wilc_set_external_auth_param() argument
1036 ret = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_external_auth_param()
1046 handle_scan_done(msg->vif, SCAN_EVENT_ABORTED); in handle_scan_timer()
1054 del_timer(&msg->vif->hif_drv->scan_timer); in handle_scan_complete()
1056 handle_scan_done(msg->vif, SCAN_EVENT_DONE); in handle_scan_complete()
1064 struct wilc_vif *vif = hif_drv->scan_timer_vif; in timer_scan_cb() local
1068 msg = wilc_alloc_work(vif, handle_scan_timer, false); in timer_scan_cb()
1081 struct wilc_vif *vif = hif_drv->connect_timer_vif; in timer_connect_cb() local
1085 msg = wilc_alloc_work(vif, handle_connect_timeout, false); in timer_connect_cb()
1094 int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len, in wilc_add_ptk() argument
1131 result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, in wilc_add_ptk()
1158 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_add_ptk()
1165 int wilc_add_igtk(struct wilc_vif *vif, const u8 *igtk, u8 igtk_key_len, in wilc_add_igtk() argument
1189 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_add_igtk()
1195 int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len, in wilc_add_rx_gtk() argument
1210 vif->hif_drv->hif_state == HOST_IF_CONNECTED) in wilc_add_rx_gtk()
1211 memcpy(gtk_key->mac_addr, vif->hif_drv->assoc_bssid, ETH_ALEN); in wilc_add_rx_gtk()
1239 result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, in wilc_add_rx_gtk()
1248 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_add_rx_gtk()
1255 int wilc_set_pmkid_info(struct wilc_vif *vif, struct wilc_pmkid_attr *pmkid) in wilc_set_pmkid_info() argument
1264 return wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_pmkid_info()
1267 int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr) in wilc_get_mac_address() argument
1277 result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1); in wilc_get_mac_address()
1279 netdev_err(vif->ndev, "Failed to get mac address\n"); in wilc_get_mac_address()
1284 int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr) in wilc_set_mac_address() argument
1294 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_mac_address()
1296 netdev_err(vif->ndev, "Failed to set mac address\n"); in wilc_set_mac_address()
1301 int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ies, in wilc_set_join_req() argument
1305 struct host_if_drv *hif_drv = vif->hif_drv; in wilc_set_join_req()
1318 result = wilc_send_connect_wid(vif); in wilc_set_join_req()
1322 hif_drv->connect_timer_vif = vif; in wilc_set_join_req()
1334 int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel) in wilc_set_mac_chnl_num() argument
1344 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_mac_chnl_num()
1346 netdev_err(vif->ndev, "Failed to set channel\n"); in wilc_set_mac_chnl_num()
1351 int wilc_set_operation_mode(struct wilc_vif *vif, int index, u8 mode, in wilc_set_operation_mode() argument
1366 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_operation_mode()
1368 netdev_err(vif->ndev, "Failed to set driver handler\n"); in wilc_set_operation_mode()
1373 s32 wilc_get_inactive_time(struct wilc_vif *vif, const u8 *mac, u32 *out_val) in wilc_get_inactive_time() argument
1386 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_get_inactive_time()
1389 netdev_err(vif->ndev, "Failed to set inactive mac\n"); in wilc_get_inactive_time()
1397 result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1); in wilc_get_inactive_time()
1399 netdev_err(vif->ndev, "Failed to get inactive time\n"); in wilc_get_inactive_time()
1404 int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level) in wilc_get_rssi() argument
1410 netdev_err(vif->ndev, "%s: RSSI level is NULL\n", __func__); in wilc_get_rssi()
1418 result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1); in wilc_get_rssi()
1420 netdev_err(vif->ndev, "Failed to get RSSI value\n"); in wilc_get_rssi()
1425 static int wilc_get_stats_async(struct wilc_vif *vif, struct rf_info *stats) in wilc_get_stats_async() argument
1430 msg = wilc_alloc_work(vif, handle_get_statistics, false); in wilc_get_stats_async()
1438 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__); in wilc_get_stats_async()
1446 int wilc_hif_set_cfg(struct wilc_vif *vif, struct cfg_param_attr *param) in wilc_hif_set_cfg() argument
1480 return wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, i); in wilc_hif_set_cfg()
1485 struct wilc_vif *vif = from_timer(vif, t, periodic_rssi); in get_periodic_rssi() local
1487 if (!vif->hif_drv) { in get_periodic_rssi()
1488 netdev_err(vif->ndev, "%s: hif driver is NULL", __func__); in get_periodic_rssi()
1492 if (vif->hif_drv->hif_state == HOST_IF_CONNECTED) in get_periodic_rssi()
1493 wilc_get_stats_async(vif, &vif->periodic_stat); in get_periodic_rssi()
1495 mod_timer(&vif->periodic_rssi, jiffies + msecs_to_jiffies(5000)); in get_periodic_rssi()
1501 struct wilc_vif *vif = netdev_priv(dev); in wilc_init() local
1509 vif->hif_drv = hif_drv; in wilc_init()
1511 timer_setup(&vif->periodic_rssi, get_periodic_rssi, 0); in wilc_init()
1512 mod_timer(&vif->periodic_rssi, jiffies + msecs_to_jiffies(5000)); in wilc_init()
1525 int wilc_deinit(struct wilc_vif *vif) in wilc_deinit() argument
1528 struct host_if_drv *hif_drv = vif->hif_drv; in wilc_deinit()
1531 netdev_err(vif->ndev, "%s: hif driver is NULL", __func__); in wilc_deinit()
1535 mutex_lock(&vif->wilc->deinit_lock); in wilc_deinit()
1539 del_timer_sync(&vif->periodic_rssi); in wilc_deinit()
1551 vif->hif_drv = NULL; in wilc_deinit()
1552 mutex_unlock(&vif->wilc->deinit_lock); in wilc_deinit()
1562 struct wilc_vif *vif; in wilc_network_info_received() local
1565 vif = wilc_get_vif_from_idx(wilc, id); in wilc_network_info_received()
1566 if (!vif) in wilc_network_info_received()
1568 hif_drv = vif->hif_drv; in wilc_network_info_received()
1571 netdev_err(vif->ndev, "driver not init[%p]\n", hif_drv); in wilc_network_info_received()
1575 msg = wilc_alloc_work(vif, handle_rcvd_ntwrk_info, false); in wilc_network_info_received()
1591 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__); in wilc_network_info_received()
1603 struct wilc_vif *vif; in wilc_gnrl_async_info_received() local
1608 vif = wilc_get_vif_from_idx(wilc, id); in wilc_gnrl_async_info_received()
1609 if (!vif) { in wilc_gnrl_async_info_received()
1614 hif_drv = vif->hif_drv; in wilc_gnrl_async_info_received()
1622 netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__); in wilc_gnrl_async_info_received()
1627 msg = wilc_alloc_work(vif, handle_rcvd_gnrl_async_info, false); in wilc_gnrl_async_info_received()
1636 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__); in wilc_gnrl_async_info_received()
1648 struct wilc_vif *vif; in wilc_scan_complete_received() local
1651 vif = wilc_get_vif_from_idx(wilc, id); in wilc_scan_complete_received()
1652 if (!vif) in wilc_scan_complete_received()
1654 hif_drv = vif->hif_drv; in wilc_scan_complete_received()
1662 msg = wilc_alloc_work(vif, handle_scan_complete, false); in wilc_scan_complete_received()
1668 netdev_err(vif->ndev, "%s: enqueue work failed\n", in wilc_scan_complete_received()
1675 int wilc_remain_on_channel(struct wilc_vif *vif, u64 cookie, u16 chan, in wilc_remain_on_channel() argument
1683 roc.vif = vif; in wilc_remain_on_channel()
1685 result = handle_remain_on_chan(vif, &roc); in wilc_remain_on_channel()
1687 netdev_err(vif->ndev, "%s: failed to set remain on channel\n", in wilc_remain_on_channel()
1693 int wilc_listen_state_expired(struct wilc_vif *vif, u64 cookie) in wilc_listen_state_expired() argument
1695 if (!vif->hif_drv) { in wilc_listen_state_expired()
1696 netdev_err(vif->ndev, "%s: hif driver is NULL", __func__); in wilc_listen_state_expired()
1700 del_timer(&vif->hif_drv->remain_on_ch_timer); in wilc_listen_state_expired()
1702 return wilc_handle_roc_expired(vif, cookie); in wilc_listen_state_expired()
1705 void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg) in wilc_frame_register() argument
1738 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_frame_register()
1740 netdev_err(vif->ndev, "Failed to frame register\n"); in wilc_frame_register()
1743 int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period, in wilc_add_beacon() argument
1775 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_add_beacon()
1777 netdev_err(vif->ndev, "Failed to send add beacon\n"); in wilc_add_beacon()
1784 int wilc_del_beacon(struct wilc_vif *vif) in wilc_del_beacon() argument
1795 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_del_beacon()
1797 netdev_err(vif->ndev, "Failed to send delete beacon\n"); in wilc_del_beacon()
1802 int wilc_add_station(struct wilc_vif *vif, const u8 *mac, in wilc_add_station() argument
1820 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_add_station()
1822 netdev_err(vif->ndev, "Failed to send add station\n"); in wilc_add_station()
1829 int wilc_del_station(struct wilc_vif *vif, const u8 *mac_addr) in wilc_del_station() argument
1846 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_del_station()
1848 netdev_err(vif->ndev, "Failed to del station\n"); in wilc_del_station()
1855 int wilc_del_allstation(struct wilc_vif *vif, u8 mac_addr[][ETH_ALEN]) in wilc_del_allstation() argument
1881 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_del_allstation()
1883 netdev_err(vif->ndev, "Failed to send delete all station\n"); in wilc_del_allstation()
1888 int wilc_edit_station(struct wilc_vif *vif, const u8 *mac, in wilc_edit_station() argument
1906 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_edit_station()
1908 netdev_err(vif->ndev, "Failed to send edit station\n"); in wilc_edit_station()
1914 int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout) in wilc_set_power_mgmt() argument
1916 struct wilc *wilc = vif->wilc; in wilc_set_power_mgmt()
1929 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_power_mgmt()
1931 netdev_err(vif->ndev, "Failed to send power management\n"); in wilc_set_power_mgmt()
1938 int wilc_setup_multicast_filter(struct wilc_vif *vif, u32 enabled, u32 count, in wilc_setup_multicast_filter() argument
1944 msg = wilc_alloc_work(vif, handle_set_mcast_filter, false); in wilc_setup_multicast_filter()
1954 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__); in wilc_setup_multicast_filter()
1960 int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power) in wilc_set_tx_power() argument
1969 return wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_tx_power()
1972 int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power) in wilc_get_tx_power() argument
1981 return wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1); in wilc_get_tx_power()
1984 int wilc_set_default_mgmt_key_index(struct wilc_vif *vif, u8 index) in wilc_set_default_mgmt_key_index() argument
1993 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_default_mgmt_key_index()
1995 netdev_err(vif->ndev, in wilc_set_default_mgmt_key_index()