Lines Matching refs:vif

46 	struct wilc_vif *vif;
55 wilc_alloc_work(struct wilc_vif *vif, void (*work_fun)(struct work_struct *),
67 msg->vif = vif;
79 if (!msg->vif || !msg->vif->wilc || !msg->vif->wilc->hif_workqueue)
82 if (!queue_work(msg->vif->wilc->hif_workqueue, &msg->work))
92 int wilc_get_vif_idx(struct wilc_vif *vif)
94 return vif->idx + 1;
98 * of wilc->vif[], because we add 1 when pass to wilc device in the function
105 struct wilc_vif *vif;
110 wilc_for_each_vif(wilc, vif) {
111 if (vif->idx == index)
112 return vif;
118 static int handle_scan_done(struct wilc_vif *vif, enum scan_event evt)
123 struct host_if_drv *hif_drv = vif->hif_drv;
133 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
135 netdev_err(vif->ndev, "Failed to set abort running\n");
141 netdev_err(vif->ndev, "%s: hif driver is NULL\n", __func__);
154 int wilc_scan(struct wilc_vif *vif, u8 scan_source,
169 struct host_if_drv *hif_drv = vif->hif_drv;
173 netdev_err(vif->ndev, "Already scan\n");
178 if (vif->connecting) {
179 netdev_err(vif->ndev, "Don't do obss scan\n");
254 hif_drv->usr_scan_req.priv = &vif->priv;
256 result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, index);
258 netdev_err(vif->ndev, "Failed to send scan parameters\n");
262 hif_drv->scan_timer_vif = vif;
273 static int wilc_send_connect_wid(struct wilc_vif *vif)
278 struct host_if_drv *hif_drv = vif->hif_drv;
313 result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, wid_cnt);
315 netdev_err(vif->ndev, "failed to send config packet\n");
337 struct wilc_vif *vif = msg->vif;
341 struct host_if_drv *hif_drv = vif->hif_drv;
344 netdev_err(vif->ndev, "%s: hif driver is NULL\n", __func__);
356 netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__);
364 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
366 netdev_err(vif->ndev, "Failed to send disconnect\n");
539 struct wilc_user_scan_req *scan_req = &msg->vif->hif_drv->usr_scan_req;
570 static void host_int_get_assoc_res_info(struct wilc_vif *vif,
583 result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1);
586 netdev_err(vif->ndev, "Failed to send association response\n");
615 static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif,
618 struct host_if_drv *hif_drv = vif->hif_drv;
626 host_int_get_assoc_res_info(vif, hif_drv->assoc_resp,
637 netdev_err(vif->ndev,
664 void wilc_handle_disconnect(struct wilc_vif *vif)
666 struct host_if_drv *hif_drv = vif->hif_drv;
670 handle_scan_done(vif, SCAN_EVENT_ABORTED);
688 struct wilc_vif *vif = msg->vif;
690 struct host_if_drv *hif_drv = vif->hif_drv;
693 netdev_err(vif->ndev, "%s: hif driver is NULL\n", __func__);
698 netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__);
704 cfg80211_external_auth_request(vif->ndev, &vif->auth,
708 host_int_parse_assoc_resp_info(vif, mac_info->status);
711 wilc_handle_disconnect(vif);
714 handle_scan_done(vif, SCAN_EVENT_ABORTED);
722 int wilc_disconnect(struct wilc_vif *vif)
725 struct host_if_drv *hif_drv = vif->hif_drv;
736 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
738 netdev_err(vif->ndev, "Failed to send disconnect\n");
759 netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__);
773 int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats)
808 result = wilc_send_config_pkt(vif, WILC_GET_CFG, wid_list, wid_cnt);
810 netdev_err(vif->ndev, "Failed to send scan parameters\n");
816 wilc_enable_tcp_ack_filter(vif, true);
818 wilc_enable_tcp_ack_filter(vif, false);
826 struct wilc_vif *vif = msg->vif;
829 wilc_get_statistics(vif, stats);
863 static int handle_remain_on_chan(struct wilc_vif *vif,
869 struct host_if_drv *hif_drv = vif->hif_drv;
877 if (vif->connecting)
891 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
896 hif_drv->remain_on_ch.vif = hif_remain_ch->vif;
900 hif_drv->remain_on_ch_timer_vif = vif;
905 static int wilc_handle_roc_expired(struct wilc_vif *vif, u64 cookie)
910 struct host_if_drv *hif_drv = vif->hif_drv;
912 if (vif->priv.p2p_listen_state) {
925 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
928 netdev_err(vif->ndev, "Failed to set remain channel\n");
933 hif_drv->remain_on_ch.expired(hif_drv->remain_on_ch.vif,
937 netdev_dbg(vif->ndev, "Not in listen state\n");
947 wilc_handle_roc_expired(msg->vif, msg->body.remain_on_ch.cookie);
955 struct wilc_vif *vif = hif_drv->remain_on_ch_timer_vif;
959 del_timer(&vif->hif_drv->remain_on_ch_timer);
961 msg = wilc_alloc_work(vif, wilc_handle_listen_state_expired, false);
965 msg->body.remain_on_ch.cookie = vif->hif_drv->remain_on_ch.cookie;
969 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__);
977 struct wilc_vif *vif = msg->vif;
1000 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1002 netdev_err(vif->ndev, "Failed to send setup multicast\n");
1010 void wilc_set_wowlan_trigger(struct wilc_vif *vif, bool enabled)
1024 ret = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1029 int wilc_set_external_auth_param(struct wilc_vif *vif,
1048 ret = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1058 handle_scan_done(msg->vif, SCAN_EVENT_ABORTED);
1066 del_timer(&msg->vif->hif_drv->scan_timer);
1068 handle_scan_done(msg->vif, SCAN_EVENT_DONE);
1076 struct wilc_vif *vif = hif_drv->scan_timer_vif;
1080 msg = wilc_alloc_work(vif, handle_scan_timer, false);
1093 struct wilc_vif *vif = hif_drv->connect_timer_vif;
1097 msg = wilc_alloc_work(vif, handle_connect_timeout, false);
1106 int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len,
1143 result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list,
1170 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1177 int wilc_add_igtk(struct wilc_vif *vif, const u8 *igtk, u8 igtk_key_len,
1201 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1207 int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len,
1222 vif->hif_drv->hif_state == HOST_IF_CONNECTED)
1223 memcpy(gtk_key->mac_addr, vif->hif_drv->assoc_bssid, ETH_ALEN);
1251 result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list,
1260 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1267 int wilc_set_pmkid_info(struct wilc_vif *vif, struct wilc_pmkid_attr *pmkid)
1276 return wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1279 int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr)
1289 result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1);
1291 netdev_err(vif->ndev, "Failed to get mac address\n");
1296 int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr)
1306 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1308 netdev_err(vif->ndev, "Failed to set mac address\n");
1313 int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ies,
1317 struct host_if_drv *hif_drv = vif->hif_drv;
1330 result = wilc_send_connect_wid(vif);
1334 hif_drv->connect_timer_vif = vif;
1346 int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel)
1356 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1358 netdev_err(vif->ndev, "Failed to set channel\n");
1363 int wilc_set_operation_mode(struct wilc_vif *vif, int index, u8 mode,
1378 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1380 netdev_err(vif->ndev, "Failed to set driver handler\n");
1385 s32 wilc_get_inactive_time(struct wilc_vif *vif, const u8 *mac, u32 *out_val)
1398 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1401 netdev_err(vif->ndev, "Failed to set inactive mac\n");
1409 result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1);
1411 netdev_err(vif->ndev, "Failed to get inactive time\n");
1416 int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level)
1422 netdev_err(vif->ndev, "%s: RSSI level is NULL\n", __func__);
1430 result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1);
1432 netdev_err(vif->ndev, "Failed to get RSSI value\n");
1437 static int wilc_get_stats_async(struct wilc_vif *vif, struct rf_info *stats)
1442 msg = wilc_alloc_work(vif, handle_get_statistics, false);
1450 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__);
1458 int wilc_hif_set_cfg(struct wilc_vif *vif, struct cfg_param_attr *param)
1492 return wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list, i);
1497 struct wilc_vif *vif = from_timer(vif, t, periodic_rssi);
1499 if (!vif->hif_drv) {
1500 netdev_err(vif->ndev, "%s: hif driver is NULL", __func__);
1504 if (vif->hif_drv->hif_state == HOST_IF_CONNECTED)
1505 wilc_get_stats_async(vif, &vif->periodic_stat);
1507 mod_timer(&vif->periodic_rssi, jiffies + msecs_to_jiffies(5000));
1513 struct wilc_vif *vif = netdev_priv(dev);
1521 vif->hif_drv = hif_drv;
1523 timer_setup(&vif->periodic_rssi, get_periodic_rssi, 0);
1524 mod_timer(&vif->periodic_rssi, jiffies + msecs_to_jiffies(5000));
1537 int wilc_deinit(struct wilc_vif *vif)
1540 struct host_if_drv *hif_drv = vif->hif_drv;
1543 netdev_err(vif->ndev, "%s: hif driver is NULL", __func__);
1547 mutex_lock(&vif->wilc->deinit_lock);
1551 del_timer_sync(&vif->periodic_rssi);
1563 vif->hif_drv = NULL;
1564 mutex_unlock(&vif->wilc->deinit_lock);
1572 struct wilc_vif *vif;
1579 vif = wilc_get_vif_from_idx(wilc, id);
1580 if (!vif)
1583 hif_drv = vif->hif_drv;
1585 netdev_err(vif->ndev, "driver not init[%p]\n", hif_drv);
1589 msg = wilc_alloc_work(vif, handle_rcvd_ntwrk_info, false);
1605 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__);
1617 struct wilc_vif *vif;
1626 vif = wilc_get_vif_from_idx(wilc, id);
1627 if (!vif)
1630 hif_drv = vif->hif_drv;
1637 netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__);
1641 msg = wilc_alloc_work(vif, handle_rcvd_gnrl_async_info, false);
1648 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__);
1659 struct wilc_vif *vif;
1666 vif = wilc_get_vif_from_idx(wilc, id);
1667 if (!vif)
1670 hif_drv = vif->hif_drv;
1678 msg = wilc_alloc_work(vif, handle_scan_complete, false);
1684 netdev_err(vif->ndev, "%s: enqueue work failed\n",
1693 int wilc_remain_on_channel(struct wilc_vif *vif, u64 cookie, u16 chan,
1701 roc.vif = vif;
1703 result = handle_remain_on_chan(vif, &roc);
1705 netdev_err(vif->ndev, "%s: failed to set remain on channel\n",
1711 int wilc_listen_state_expired(struct wilc_vif *vif, u64 cookie)
1713 if (!vif->hif_drv) {
1714 netdev_err(vif->ndev, "%s: hif driver is NULL", __func__);
1718 del_timer(&vif->hif_drv->remain_on_ch_timer);
1720 return wilc_handle_roc_expired(vif, cookie);
1723 void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg)
1756 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1758 netdev_err(vif->ndev, "Failed to frame register\n");
1761 int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period,
1793 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1795 netdev_err(vif->ndev, "Failed to send add beacon\n");
1802 int wilc_del_beacon(struct wilc_vif *vif)
1813 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1815 netdev_err(vif->ndev, "Failed to send delete beacon\n");
1820 int wilc_add_station(struct wilc_vif *vif, const u8 *mac,
1838 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1840 netdev_err(vif->ndev, "Failed to send add station\n");
1847 int wilc_del_station(struct wilc_vif *vif, const u8 *mac_addr)
1864 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1866 netdev_err(vif->ndev, "Failed to del station\n");
1873 int wilc_del_allstation(struct wilc_vif *vif, u8 mac_addr[][ETH_ALEN])
1899 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1901 netdev_err(vif->ndev, "Failed to send delete all station\n");
1906 int wilc_edit_station(struct wilc_vif *vif, const u8 *mac,
1924 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1926 netdev_err(vif->ndev, "Failed to send edit station\n");
1932 int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout)
1934 struct wilc *wilc = vif->wilc;
1947 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1949 netdev_err(vif->ndev, "Failed to send power management\n");
1956 int wilc_setup_multicast_filter(struct wilc_vif *vif, u32 enabled, u32 count,
1962 msg = wilc_alloc_work(vif, handle_set_mcast_filter, false);
1972 netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__);
1978 int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power)
1987 return wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
1990 int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power)
1999 return wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1);
2002 int wilc_set_default_mgmt_key_index(struct wilc_vif *vif, u8 index)
2011 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
2013 netdev_err(vif->ndev,