Lines Matching defs:vif

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