Lines Matching refs:vif
41 struct wilc_vif *vif; member
50 wilc_alloc_work(struct wilc_vif *vif, void (*work_fun)(struct work_struct *), in wilc_alloc_work() argument
62 msg->vif = vif; in wilc_alloc_work()
74 if (!msg->vif || !msg->vif->wilc || !msg->vif->wilc->hif_workqueue) in wilc_enqueue_work()
77 if (!queue_work(msg->vif->wilc->hif_workqueue, &msg->work)) in wilc_enqueue_work()
87 int wilc_get_vif_idx(struct wilc_vif *vif) in wilc_get_vif_idx() argument
89 return vif->idx + 1; in wilc_get_vif_idx()
100 struct wilc_vif *vif; in wilc_get_vif_from_idx() local
105 list_for_each_entry_rcu(vif, &wilc->vif_list, list) { in wilc_get_vif_from_idx()
106 if (vif->idx == index) in wilc_get_vif_from_idx()
107 return vif; in wilc_get_vif_from_idx()
113 static int handle_scan_done(struct wilc_vif *vif, enum scan_event evt) in handle_scan_done() argument
118 struct host_if_drv *hif_drv = vif->hif_drv; in handle_scan_done()
128 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in handle_scan_done()
130 netdev_err(vif->ndev, "Failed to set abort running\n"); in handle_scan_done()
136 netdev_err(vif->ndev, "%s: hif driver is NULL\n", __func__); in handle_scan_done()
149 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type, in wilc_scan() argument
162 struct host_if_drv *hif_drv = vif->hif_drv; in wilc_scan()
166 netdev_err(vif->ndev, "Already scan\n"); in wilc_scan()
171 if (vif->connecting) { in wilc_scan()
172 netdev_err(vif->ndev, "Don't do obss scan\n"); in wilc_scan()
249 result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, index); in wilc_scan()
251 netdev_err(vif->ndev, "Failed to send scan parameters\n"); in wilc_scan()
255 hif_drv->scan_timer_vif = vif; in wilc_scan()
266 static int wilc_send_connect_wid(struct wilc_vif *vif) in wilc_send_connect_wid() argument
271 struct host_if_drv *hif_drv = vif->hif_drv; in wilc_send_connect_wid()
299 result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, wid_cnt); in wilc_send_connect_wid()
301 netdev_err(vif->ndev, "failed to send config packet\n"); in wilc_send_connect_wid()
320 struct wilc_vif *vif = msg->vif; in handle_connect_timeout() local
324 struct host_if_drv *hif_drv = vif->hif_drv; in handle_connect_timeout()
327 netdev_err(vif->ndev, "%s: hif driver is NULL\n", __func__); in handle_connect_timeout()
339 netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__); in handle_connect_timeout()
347 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in handle_connect_timeout()
349 netdev_err(vif->ndev, "Failed to send disconnect\n"); in handle_connect_timeout()
509 struct wilc_user_scan_req *scan_req = &msg->vif->hif_drv->usr_scan_req; in handle_rcvd_ntwrk_info()
540 static void host_int_get_assoc_res_info(struct wilc_vif *vif, in host_int_get_assoc_res_info() argument
553 result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1); in host_int_get_assoc_res_info()
556 netdev_err(vif->ndev, "Failed to send association response\n"); in host_int_get_assoc_res_info()
585 static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif, in host_int_parse_assoc_resp_info() argument
588 struct host_if_drv *hif_drv = vif->hif_drv; in host_int_parse_assoc_resp_info()
596 host_int_get_assoc_res_info(vif, hif_drv->assoc_resp, in host_int_parse_assoc_resp_info()
607 netdev_err(vif->ndev, in host_int_parse_assoc_resp_info()
634 static inline void host_int_handle_disconnect(struct wilc_vif *vif) in host_int_handle_disconnect() argument
636 struct host_if_drv *hif_drv = vif->hif_drv; in host_int_handle_disconnect()
640 handle_scan_done(vif, SCAN_EVENT_ABORTED); in host_int_handle_disconnect()
647 netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__); in host_int_handle_disconnect()
660 struct wilc_vif *vif = msg->vif; in handle_rcvd_gnrl_async_info() local
662 struct host_if_drv *hif_drv = vif->hif_drv; in handle_rcvd_gnrl_async_info()
665 netdev_err(vif->ndev, "%s: hif driver is NULL\n", __func__); in handle_rcvd_gnrl_async_info()
670 netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__); in handle_rcvd_gnrl_async_info()
675 host_int_parse_assoc_resp_info(vif, mac_info->status); in handle_rcvd_gnrl_async_info()
678 host_int_handle_disconnect(vif); in handle_rcvd_gnrl_async_info()
681 handle_scan_done(vif, SCAN_EVENT_ABORTED); in handle_rcvd_gnrl_async_info()
689 int wilc_disconnect(struct wilc_vif *vif) in wilc_disconnect() argument
692 struct host_if_drv *hif_drv = vif->hif_drv; in wilc_disconnect()
703 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_disconnect()
705 netdev_err(vif->ndev, "Failed to send disconnect\n"); in wilc_disconnect()
725 netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__); in wilc_disconnect()
739 int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats) in wilc_get_statistics() argument
774 result = wilc_send_config_pkt(vif, WILC_GET_CFG, wid_list, wid_cnt); in wilc_get_statistics()
776 netdev_err(vif->ndev, "Failed to send scan parameters\n"); in wilc_get_statistics()
782 wilc_enable_tcp_ack_filter(vif, true); in wilc_get_statistics()
784 wilc_enable_tcp_ack_filter(vif, false); in wilc_get_statistics()
792 struct wilc_vif *vif = msg->vif; in handle_get_statistics() local
795 wilc_get_statistics(vif, stats); in handle_get_statistics()
829 static int handle_remain_on_chan(struct wilc_vif *vif, in handle_remain_on_chan() argument
835 struct host_if_drv *hif_drv = vif->hif_drv; in handle_remain_on_chan()
843 if (vif->connecting) in handle_remain_on_chan()
857 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in handle_remain_on_chan()
866 hif_drv->remain_on_ch_timer_vif = vif; in handle_remain_on_chan()
871 static int wilc_handle_roc_expired(struct wilc_vif *vif, u64 cookie) in wilc_handle_roc_expired() argument
876 struct host_if_drv *hif_drv = vif->hif_drv; in wilc_handle_roc_expired()
878 if (vif->priv.p2p_listen_state) { in wilc_handle_roc_expired()
891 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_handle_roc_expired()
894 netdev_err(vif->ndev, "Failed to set remain channel\n"); in wilc_handle_roc_expired()
903 netdev_dbg(vif->ndev, "Not in listen state\n"); in wilc_handle_roc_expired()
913 wilc_handle_roc_expired(msg->vif, msg->body.remain_on_ch.cookie); in wilc_handle_listen_state_expired()
921 struct wilc_vif *vif = hif_drv->remain_on_ch_timer_vif; in listen_timer_cb() local
925 del_timer(&vif->hif_drv->remain_on_ch_timer); in listen_timer_cb()
927 msg = wilc_alloc_work(vif, wilc_handle_listen_state_expired, false); in listen_timer_cb()
931 msg->body.remain_on_ch.cookie = vif->hif_drv->remain_on_ch.cookie; in listen_timer_cb()
935 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__); in listen_timer_cb()
943 struct wilc_vif *vif = msg->vif; in handle_set_mcast_filter() local
966 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in handle_set_mcast_filter()
968 netdev_err(vif->ndev, "Failed to send setup multicast\n"); in handle_set_mcast_filter()
980 handle_scan_done(msg->vif, SCAN_EVENT_ABORTED); in handle_scan_timer()
988 del_timer(&msg->vif->hif_drv->scan_timer); in handle_scan_complete()
990 handle_scan_done(msg->vif, SCAN_EVENT_DONE); in handle_scan_complete()
998 struct wilc_vif *vif = hif_drv->scan_timer_vif; in timer_scan_cb() local
1002 msg = wilc_alloc_work(vif, handle_scan_timer, false); in timer_scan_cb()
1015 struct wilc_vif *vif = hif_drv->connect_timer_vif; in timer_connect_cb() local
1019 msg = wilc_alloc_work(vif, handle_connect_timeout, false); in timer_connect_cb()
1028 int wilc_remove_wep_key(struct wilc_vif *vif, u8 index) in wilc_remove_wep_key() argument
1038 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_remove_wep_key()
1040 netdev_err(vif->ndev, in wilc_remove_wep_key()
1045 int wilc_set_wep_default_keyid(struct wilc_vif *vif, u8 index) in wilc_set_wep_default_keyid() argument
1054 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_wep_default_keyid()
1056 netdev_err(vif->ndev, in wilc_set_wep_default_keyid()
1062 int wilc_add_wep_key_bss_sta(struct wilc_vif *vif, const u8 *key, u8 len, in wilc_add_wep_key_bss_sta() argument
1082 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_add_wep_key_bss_sta()
1084 netdev_err(vif->ndev, in wilc_add_wep_key_bss_sta()
1091 int wilc_add_wep_key_bss_ap(struct wilc_vif *vif, const u8 *key, u8 len, in wilc_add_wep_key_bss_ap() argument
1120 result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, in wilc_add_wep_key_bss_ap()
1123 netdev_err(vif->ndev, in wilc_add_wep_key_bss_ap()
1130 int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len, in wilc_add_ptk() argument
1167 result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, in wilc_add_ptk()
1194 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_add_ptk()
1201 int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len, in wilc_add_rx_gtk() argument
1216 vif->hif_drv->hif_state == HOST_IF_CONNECTED) in wilc_add_rx_gtk()
1217 memcpy(gtk_key->mac_addr, vif->hif_drv->assoc_bssid, ETH_ALEN); in wilc_add_rx_gtk()
1245 result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, in wilc_add_rx_gtk()
1254 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_add_rx_gtk()
1261 int wilc_set_pmkid_info(struct wilc_vif *vif, struct wilc_pmkid_attr *pmkid) in wilc_set_pmkid_info() argument
1270 return wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_pmkid_info()
1273 int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr) in wilc_get_mac_address() argument
1283 result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1); in wilc_get_mac_address()
1285 netdev_err(vif->ndev, "Failed to get mac address\n"); in wilc_get_mac_address()
1290 int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ies, in wilc_set_join_req() argument
1294 struct host_if_drv *hif_drv = vif->hif_drv; in wilc_set_join_req()
1307 result = wilc_send_connect_wid(vif); in wilc_set_join_req()
1311 hif_drv->connect_timer_vif = vif; in wilc_set_join_req()
1323 int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel) in wilc_set_mac_chnl_num() argument
1333 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_mac_chnl_num()
1335 netdev_err(vif->ndev, "Failed to set channel\n"); in wilc_set_mac_chnl_num()
1340 int wilc_set_operation_mode(struct wilc_vif *vif, int index, u8 mode, in wilc_set_operation_mode() argument
1355 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_operation_mode()
1357 netdev_err(vif->ndev, "Failed to set driver handler\n"); in wilc_set_operation_mode()
1362 s32 wilc_get_inactive_time(struct wilc_vif *vif, const u8 *mac, u32 *out_val) in wilc_get_inactive_time() argument
1375 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_get_inactive_time()
1378 netdev_err(vif->ndev, "Failed to set inactive mac\n"); in wilc_get_inactive_time()
1386 result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1); in wilc_get_inactive_time()
1388 netdev_err(vif->ndev, "Failed to get inactive time\n"); in wilc_get_inactive_time()
1393 int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level) in wilc_get_rssi() argument
1399 netdev_err(vif->ndev, "%s: RSSI level is NULL\n", __func__); in wilc_get_rssi()
1407 result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1); in wilc_get_rssi()
1409 netdev_err(vif->ndev, "Failed to get RSSI value\n"); in wilc_get_rssi()
1414 static int wilc_get_stats_async(struct wilc_vif *vif, struct rf_info *stats) in wilc_get_stats_async() argument
1419 msg = wilc_alloc_work(vif, handle_get_statistics, false); in wilc_get_stats_async()
1427 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__); in wilc_get_stats_async()
1435 int wilc_hif_set_cfg(struct wilc_vif *vif, struct cfg_param_attr *param) in wilc_hif_set_cfg() argument
1469 return wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, i); in wilc_hif_set_cfg()
1474 struct wilc_vif *vif = from_timer(vif, t, periodic_rssi); in get_periodic_rssi() local
1476 if (!vif->hif_drv) { in get_periodic_rssi()
1477 netdev_err(vif->ndev, "%s: hif driver is NULL", __func__); in get_periodic_rssi()
1481 if (vif->hif_drv->hif_state == HOST_IF_CONNECTED) in get_periodic_rssi()
1482 wilc_get_stats_async(vif, &vif->periodic_stat); in get_periodic_rssi()
1484 mod_timer(&vif->periodic_rssi, jiffies + msecs_to_jiffies(5000)); in get_periodic_rssi()
1490 struct wilc_vif *vif = netdev_priv(dev); in wilc_init() local
1491 struct wilc *wilc = vif->wilc; in wilc_init()
1499 vif->hif_drv = hif_drv; in wilc_init()
1504 timer_setup(&vif->periodic_rssi, get_periodic_rssi, 0); in wilc_init()
1505 mod_timer(&vif->periodic_rssi, jiffies + msecs_to_jiffies(5000)); in wilc_init()
1520 int wilc_deinit(struct wilc_vif *vif) in wilc_deinit() argument
1523 struct host_if_drv *hif_drv = vif->hif_drv; in wilc_deinit()
1526 netdev_err(vif->ndev, "%s: hif driver is NULL", __func__); in wilc_deinit()
1530 mutex_lock(&vif->wilc->deinit_lock); in wilc_deinit()
1534 del_timer_sync(&vif->periodic_rssi); in wilc_deinit()
1546 vif->hif_drv = NULL; in wilc_deinit()
1547 vif->wilc->clients_count--; in wilc_deinit()
1548 mutex_unlock(&vif->wilc->deinit_lock); in wilc_deinit()
1558 struct wilc_vif *vif; in wilc_network_info_received() local
1561 vif = wilc_get_vif_from_idx(wilc, id); in wilc_network_info_received()
1562 if (!vif) in wilc_network_info_received()
1564 hif_drv = vif->hif_drv; in wilc_network_info_received()
1567 netdev_err(vif->ndev, "driver not init[%p]\n", hif_drv); in wilc_network_info_received()
1571 msg = wilc_alloc_work(vif, handle_rcvd_ntwrk_info, false); in wilc_network_info_received()
1587 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__); in wilc_network_info_received()
1599 struct wilc_vif *vif; in wilc_gnrl_async_info_received() local
1604 vif = wilc_get_vif_from_idx(wilc, id); in wilc_gnrl_async_info_received()
1605 if (!vif) { in wilc_gnrl_async_info_received()
1610 hif_drv = vif->hif_drv; in wilc_gnrl_async_info_received()
1618 netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__); in wilc_gnrl_async_info_received()
1623 msg = wilc_alloc_work(vif, handle_rcvd_gnrl_async_info, false); in wilc_gnrl_async_info_received()
1632 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__); in wilc_gnrl_async_info_received()
1644 struct wilc_vif *vif; in wilc_scan_complete_received() local
1647 vif = wilc_get_vif_from_idx(wilc, id); in wilc_scan_complete_received()
1648 if (!vif) in wilc_scan_complete_received()
1650 hif_drv = vif->hif_drv; in wilc_scan_complete_received()
1658 msg = wilc_alloc_work(vif, handle_scan_complete, false); in wilc_scan_complete_received()
1664 netdev_err(vif->ndev, "%s: enqueue work failed\n", in wilc_scan_complete_received()
1671 int wilc_remain_on_channel(struct wilc_vif *vif, u64 cookie, in wilc_remain_on_channel() argument
1684 result = handle_remain_on_chan(vif, &roc); in wilc_remain_on_channel()
1686 netdev_err(vif->ndev, "%s: failed to set remain on channel\n", in wilc_remain_on_channel()
1692 int wilc_listen_state_expired(struct wilc_vif *vif, u64 cookie) in wilc_listen_state_expired() argument
1694 if (!vif->hif_drv) { in wilc_listen_state_expired()
1695 netdev_err(vif->ndev, "%s: hif driver is NULL", __func__); in wilc_listen_state_expired()
1699 del_timer(&vif->hif_drv->remain_on_ch_timer); in wilc_listen_state_expired()
1701 return wilc_handle_roc_expired(vif, cookie); in wilc_listen_state_expired()
1704 void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg) in wilc_frame_register() argument
1733 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_frame_register()
1735 netdev_err(vif->ndev, "Failed to frame register\n"); in wilc_frame_register()
1738 int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period, in wilc_add_beacon() argument
1770 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_add_beacon()
1772 netdev_err(vif->ndev, "Failed to send add beacon\n"); in wilc_add_beacon()
1779 int wilc_del_beacon(struct wilc_vif *vif) in wilc_del_beacon() argument
1790 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_del_beacon()
1792 netdev_err(vif->ndev, "Failed to send delete beacon\n"); in wilc_del_beacon()
1797 int wilc_add_station(struct wilc_vif *vif, const u8 *mac, in wilc_add_station() argument
1814 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_add_station()
1816 netdev_err(vif->ndev, "Failed to send add station\n"); in wilc_add_station()
1823 int wilc_del_station(struct wilc_vif *vif, const u8 *mac_addr) in wilc_del_station() argument
1840 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_del_station()
1842 netdev_err(vif->ndev, "Failed to del station\n"); in wilc_del_station()
1849 int wilc_del_allstation(struct wilc_vif *vif, u8 mac_addr[][ETH_ALEN]) in wilc_del_allstation() argument
1875 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_del_allstation()
1877 netdev_err(vif->ndev, "Failed to send delete all station\n"); in wilc_del_allstation()
1882 int wilc_edit_station(struct wilc_vif *vif, const u8 *mac, in wilc_edit_station() argument
1899 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_edit_station()
1901 netdev_err(vif->ndev, "Failed to send edit station\n"); in wilc_edit_station()
1907 int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout) in wilc_set_power_mgmt() argument
1921 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_power_mgmt()
1923 netdev_err(vif->ndev, "Failed to send power management\n"); in wilc_set_power_mgmt()
1928 int wilc_setup_multicast_filter(struct wilc_vif *vif, u32 enabled, u32 count, in wilc_setup_multicast_filter() argument
1934 msg = wilc_alloc_work(vif, handle_set_mcast_filter, false); in wilc_setup_multicast_filter()
1944 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__); in wilc_setup_multicast_filter()
1950 int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power) in wilc_set_tx_power() argument
1959 return wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); in wilc_set_tx_power()
1962 int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power) in wilc_get_tx_power() argument
1971 return wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1); in wilc_get_tx_power()