1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries.
8 #include <linux/kthread.h>
9 #include <linux/firmware.h>
10 #include <linux/netdevice.h>
11 #include <linux/inetdevice.h>
13 #include "wilc_wfi_cfgoperations.h"
14 #include "wilc_wlan_cfg.h"
16 #define WILC_MULTICAST_TABLE_SIZE 8
18 static irqreturn_t isr_uh_routine(int irq, void *user_data)
20 struct net_device *dev = user_data;
21 struct wilc_vif *vif = netdev_priv(dev);
22 struct wilc *wilc = vif->wilc;
25 netdev_err(dev, "Can't handle UH interrupt\n");
28 return IRQ_WAKE_THREAD;
31 static irqreturn_t isr_bh_routine(int irq, void *userdata)
33 struct net_device *dev = userdata;
34 struct wilc_vif *vif = netdev_priv(userdata);
35 struct wilc *wilc = vif->wilc;
38 netdev_err(dev, "Can't handle BH interrupt\n");
42 wilc_handle_isr(wilc);
47 static int init_irq(struct net_device *dev)
50 struct wilc_vif *vif = netdev_priv(dev);
51 struct wilc *wl = vif->wilc;
53 ret = gpiod_direction_input(wl->gpio_irq);
55 netdev_err(dev, "could not obtain gpio for WILC_INTR\n");
59 wl->dev_irq_num = gpiod_to_irq(wl->gpio_irq);
61 ret = request_threaded_irq(wl->dev_irq_num, isr_uh_routine,
63 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
66 netdev_err(dev, "Failed to request IRQ\n");
68 netdev_dbg(dev, "IRQ request succeeded IRQ-NUM= %d\n",
74 static void deinit_irq(struct net_device *dev)
76 struct wilc_vif *vif = netdev_priv(dev);
77 struct wilc *wilc = vif->wilc;
79 /* Deinitialize IRQ */
80 if (wilc->dev_irq_num)
81 free_irq(wilc->dev_irq_num, wilc);
84 void wilc_mac_indicate(struct wilc *wilc)
88 wilc_wlan_cfg_get_val(wilc, WID_STATUS, &status, 1);
89 if (wilc->mac_status == WILC_MAC_STATUS_INIT) {
90 wilc->mac_status = status;
91 complete(&wilc->sync_event);
93 wilc->mac_status = status;
97 static struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header)
101 struct net_device *ndev = NULL;
103 bssid = mac_header + 10;
104 bssid1 = mac_header + 4;
106 mutex_lock(&wilc->vif_mutex);
107 for (i = 0; i < wilc->vif_num; i++) {
108 if (wilc->vif[i]->mode == WILC_STATION_MODE)
109 if (ether_addr_equal_unaligned(bssid,
110 wilc->vif[i]->bssid)) {
111 ndev = wilc->vif[i]->ndev;
114 if (wilc->vif[i]->mode == WILC_AP_MODE)
115 if (ether_addr_equal_unaligned(bssid1,
116 wilc->vif[i]->bssid)) {
117 ndev = wilc->vif[i]->ndev;
122 mutex_unlock(&wilc->vif_mutex);
126 void wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode)
128 struct wilc_vif *vif = netdev_priv(wilc_netdev);
131 ether_addr_copy(vif->bssid, bssid);
133 eth_zero_addr(vif->bssid);
138 int wilc_wlan_get_num_conn_ifcs(struct wilc *wilc)
143 for (i = 0; i < wilc->vif_num; i++)
144 if (!is_zero_ether_addr(wilc->vif[i]->bssid))
150 static int wilc_txq_task(void *vp)
154 struct wilc *wl = vp;
156 complete(&wl->txq_thread_started);
158 wait_for_completion(&wl->txq_event);
161 complete(&wl->txq_thread_started);
163 while (!kthread_should_stop())
168 ret = wilc_wlan_handle_txq(wl, &txq_count);
169 if (txq_count < FLOW_CONTROL_LOWER_THRESHOLD) {
171 struct wilc_vif *ifc;
173 mutex_lock(&wl->vif_mutex);
174 for (i = 0; i < wl->vif_num; i++) {
176 if (ifc->mac_opened && ifc->ndev)
177 netif_wake_queue(ifc->ndev);
179 mutex_unlock(&wl->vif_mutex);
181 } while (ret == -ENOBUFS && !wl->close);
186 static int wilc_wlan_get_firmware(struct net_device *dev)
188 struct wilc_vif *vif = netdev_priv(dev);
189 struct wilc *wilc = vif->wilc;
190 int chip_id, ret = 0;
191 const struct firmware *wilc_firmware;
194 chip_id = wilc_get_chipid(wilc, false);
196 if (chip_id < 0x1003a0)
197 firmware = FIRMWARE_1002;
199 firmware = FIRMWARE_1003;
201 netdev_info(dev, "loading firmware %s\n", firmware);
203 if (request_firmware(&wilc_firmware, firmware, wilc->dev) != 0) {
204 netdev_err(dev, "%s - firmware not available\n", firmware);
208 wilc->firmware = wilc_firmware;
215 static int wilc_start_firmware(struct net_device *dev)
217 struct wilc_vif *vif = netdev_priv(dev);
218 struct wilc *wilc = vif->wilc;
221 ret = wilc_wlan_start(wilc);
225 if (!wait_for_completion_timeout(&wilc->sync_event,
226 msecs_to_jiffies(5000)))
232 static int wilc1000_firmware_download(struct net_device *dev)
234 struct wilc_vif *vif = netdev_priv(dev);
235 struct wilc *wilc = vif->wilc;
238 if (!wilc->firmware) {
239 netdev_err(dev, "Firmware buffer is NULL\n");
243 ret = wilc_wlan_firmware_download(wilc, wilc->firmware->data,
244 wilc->firmware->size);
248 release_firmware(wilc->firmware);
249 wilc->firmware = NULL;
251 netdev_dbg(dev, "Download Succeeded\n");
256 static int wilc_init_fw_config(struct net_device *dev, struct wilc_vif *vif)
258 struct wilc_priv *priv = &vif->priv;
259 struct host_if_drv *hif_drv;
264 netdev_dbg(dev, "Start configuring Firmware\n");
265 hif_drv = (struct host_if_drv *)priv->hif_drv;
266 netdev_dbg(dev, "Host = %p\n", hif_drv);
270 if (!wilc_wlan_cfg_set(vif, 1, WID_SET_OPERATION_MODE, (u8 *)&w, 4,
274 b = WILC_FW_BSS_TYPE_INFRA;
275 if (!wilc_wlan_cfg_set(vif, 0, WID_BSS_TYPE, &b, 1, 0, 0))
278 b = WILC_FW_TX_RATE_AUTO;
279 if (!wilc_wlan_cfg_set(vif, 0, WID_CURRENT_TX_RATE, &b, 1, 0, 0))
282 b = WILC_FW_OPER_MODE_G_MIXED_11B_2;
283 if (!wilc_wlan_cfg_set(vif, 0, WID_11G_OPERATING_MODE, &b, 1, 0, 0))
286 b = WILC_FW_PREAMBLE_SHORT;
287 if (!wilc_wlan_cfg_set(vif, 0, WID_PREAMBLE, &b, 1, 0, 0))
290 b = WILC_FW_11N_PROT_AUTO;
291 if (!wilc_wlan_cfg_set(vif, 0, WID_11N_PROT_MECH, &b, 1, 0, 0))
294 b = WILC_FW_ACTIVE_SCAN;
295 if (!wilc_wlan_cfg_set(vif, 0, WID_SCAN_TYPE, &b, 1, 0, 0))
298 b = WILC_FW_SITE_SURVEY_OFF;
299 if (!wilc_wlan_cfg_set(vif, 0, WID_SITE_SURVEY, &b, 1, 0, 0))
304 if (!wilc_wlan_cfg_set(vif, 0, WID_RTS_THRESHOLD, (u8 *)&hw, 2, 0, 0))
309 if (!wilc_wlan_cfg_set(vif, 0, WID_FRAG_THRESHOLD, (u8 *)&hw, 2, 0, 0))
313 if (!wilc_wlan_cfg_set(vif, 0, WID_BCAST_SSID, &b, 1, 0, 0))
317 if (!wilc_wlan_cfg_set(vif, 0, WID_QOS_ENABLE, &b, 1, 0, 0))
320 b = WILC_FW_NO_POWERSAVE;
321 if (!wilc_wlan_cfg_set(vif, 0, WID_POWER_MANAGEMENT, &b, 1, 0, 0))
325 if (!wilc_wlan_cfg_set(vif, 0, WID_11I_MODE, &b, 1, 0, 0))
328 b = WILC_FW_AUTH_OPEN_SYSTEM;
329 if (!wilc_wlan_cfg_set(vif, 0, WID_AUTH_TYPE, &b, 1, 0, 0))
333 if (!wilc_wlan_cfg_set(vif, 0, WID_LISTEN_INTERVAL, &b, 1, 0, 0))
337 if (!wilc_wlan_cfg_set(vif, 0, WID_DTIM_PERIOD, &b, 1, 0, 0))
340 b = WILC_FW_ACK_POLICY_NORMAL;
341 if (!wilc_wlan_cfg_set(vif, 0, WID_ACK_POLICY, &b, 1, 0, 0))
345 if (!wilc_wlan_cfg_set(vif, 0, WID_USER_CONTROL_ON_TX_POWER, &b, 1,
350 if (!wilc_wlan_cfg_set(vif, 0, WID_TX_POWER_LEVEL_11A, &b, 1, 0, 0))
354 if (!wilc_wlan_cfg_set(vif, 0, WID_TX_POWER_LEVEL_11B, &b, 1, 0, 0))
359 if (!wilc_wlan_cfg_set(vif, 0, WID_BEACON_INTERVAL, (u8 *)&hw, 2, 0, 0))
362 b = WILC_FW_REKEY_POLICY_DISABLE;
363 if (!wilc_wlan_cfg_set(vif, 0, WID_REKEY_POLICY, &b, 1, 0, 0))
368 if (!wilc_wlan_cfg_set(vif, 0, WID_REKEY_PERIOD, (u8 *)&w, 4, 0, 0))
373 if (!wilc_wlan_cfg_set(vif, 0, WID_REKEY_PACKET_COUNT, (u8 *)&w, 4, 0,
378 if (!wilc_wlan_cfg_set(vif, 0, WID_SHORT_SLOT_ALLOWED, &b, 1, 0,
382 b = WILC_FW_ERP_PROT_SELF_CTS;
383 if (!wilc_wlan_cfg_set(vif, 0, WID_11N_ERP_PROT_TYPE, &b, 1, 0, 0))
387 if (!wilc_wlan_cfg_set(vif, 0, WID_11N_ENABLE, &b, 1, 0, 0))
390 b = WILC_FW_11N_OP_MODE_HT_MIXED;
391 if (!wilc_wlan_cfg_set(vif, 0, WID_11N_OPERATING_MODE, &b, 1, 0, 0))
395 if (!wilc_wlan_cfg_set(vif, 0, WID_11N_TXOP_PROT_DISABLE, &b, 1, 0, 0))
398 b = WILC_FW_OBBS_NONHT_DETECT_PROTECT_REPORT;
399 if (!wilc_wlan_cfg_set(vif, 0, WID_11N_OBSS_NONHT_DETECTION, &b, 1,
403 b = WILC_FW_HT_PROT_RTS_CTS_NONHT;
404 if (!wilc_wlan_cfg_set(vif, 0, WID_11N_HT_PROT_TYPE, &b, 1, 0, 0))
408 if (!wilc_wlan_cfg_set(vif, 0, WID_11N_RIFS_PROT_ENABLE, &b, 1, 0,
413 if (!wilc_wlan_cfg_set(vif, 0, WID_11N_CURRENT_TX_MCS, &b, 1, 0, 0))
417 if (!wilc_wlan_cfg_set(vif, 0, WID_11N_IMMEDIATE_BA_ENABLED, &b, 1,
427 static void wlan_deinit_locks(struct net_device *dev)
429 struct wilc_vif *vif = netdev_priv(dev);
430 struct wilc *wilc = vif->wilc;
432 mutex_destroy(&wilc->hif_cs);
433 mutex_destroy(&wilc->rxq_cs);
434 mutex_destroy(&wilc->cfg_cmd_lock);
435 mutex_destroy(&wilc->txq_add_to_head_cs);
436 mutex_destroy(&wilc->vif_mutex);
439 static void wlan_deinitialize_threads(struct net_device *dev)
441 struct wilc_vif *vif = netdev_priv(dev);
442 struct wilc *wl = vif->wilc;
446 complete(&wl->txq_event);
448 if (wl->txq_thread) {
449 kthread_stop(wl->txq_thread);
450 wl->txq_thread = NULL;
454 static void wilc_wlan_deinitialize(struct net_device *dev)
456 struct wilc_vif *vif = netdev_priv(dev);
457 struct wilc *wl = vif->wilc;
460 netdev_err(dev, "wl is NULL\n");
464 if (wl->initialized) {
465 netdev_info(dev, "Deinitializing wilc1000...\n");
467 if (!wl->dev_irq_num &&
468 wl->hif_func->disable_interrupt) {
469 mutex_lock(&wl->hif_cs);
470 wl->hif_func->disable_interrupt(wl);
471 mutex_unlock(&wl->hif_cs);
473 complete(&wl->txq_event);
475 wlan_deinitialize_threads(dev);
478 wilc_wlan_stop(wl, vif);
479 wilc_wlan_cleanup(dev);
480 wlan_deinit_locks(dev);
482 wl->initialized = false;
484 netdev_dbg(dev, "wilc1000 deinitialization Done\n");
486 netdev_dbg(dev, "wilc1000 is not initialized\n");
490 static int wlan_initialize_threads(struct net_device *dev)
492 struct wilc_vif *vif = netdev_priv(dev);
493 struct wilc *wilc = vif->wilc;
495 wilc->txq_thread = kthread_run(wilc_txq_task, (void *)wilc,
497 if (IS_ERR(wilc->txq_thread)) {
498 netdev_err(dev, "couldn't create TXQ thread\n");
500 return PTR_ERR(wilc->txq_thread);
502 wait_for_completion(&wilc->txq_thread_started);
507 static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif)
510 struct wilc *wl = vif->wilc;
512 if (!wl->initialized) {
513 wl->mac_status = WILC_MAC_STATUS_INIT;
516 ret = wilc_wlan_init(dev);
520 ret = wlan_initialize_threads(dev);
526 if (wl->gpio_irq && init_irq(dev)) {
531 if (!wl->dev_irq_num &&
532 wl->hif_func->enable_interrupt &&
533 wl->hif_func->enable_interrupt(wl)) {
538 if (wilc_wlan_get_firmware(dev)) {
540 goto fail_irq_enable;
543 ret = wilc1000_firmware_download(dev);
546 goto fail_irq_enable;
549 ret = wilc_start_firmware(dev);
552 goto fail_irq_enable;
555 if (wilc_wlan_cfg_get(vif, 1, WID_FIRMWARE_VERSION, 1, 0)) {
557 char firmware_ver[20];
559 size = wilc_wlan_cfg_get_val(wl, WID_FIRMWARE_VERSION,
561 sizeof(firmware_ver));
562 firmware_ver[size] = '\0';
563 netdev_dbg(dev, "Firmware Ver = %s\n", firmware_ver);
565 ret = wilc_init_fw_config(dev, vif);
568 netdev_err(dev, "Failed to configure firmware\n");
572 wl->initialized = true;
576 wilc_wlan_stop(wl, vif);
579 if (!wl->dev_irq_num &&
580 wl->hif_func->disable_interrupt)
581 wl->hif_func->disable_interrupt(wl);
586 wlan_deinitialize_threads(dev);
588 wilc_wlan_cleanup(dev);
589 netdev_err(dev, "WLAN initialization FAILED\n");
591 netdev_dbg(dev, "wilc1000 already initialized\n");
596 static int mac_init_fn(struct net_device *ndev)
598 netif_start_queue(ndev);
599 netif_stop_queue(ndev);
604 static int wilc_mac_open(struct net_device *ndev)
606 struct wilc_vif *vif = netdev_priv(ndev);
607 struct wilc *wl = vif->wilc;
608 struct wilc_priv *priv = wdev_priv(vif->ndev->ieee80211_ptr);
609 unsigned char mac_add[ETH_ALEN] = {0};
612 if (!wl || !wl->dev) {
613 netdev_err(ndev, "device not ready\n");
617 netdev_dbg(ndev, "MAC OPEN[%p]\n", ndev);
619 ret = wilc_init_host_int(ndev);
623 ret = wilc_wlan_initialize(ndev, vif);
625 wilc_deinit_host_int(ndev);
629 wilc_set_operation_mode(vif, wilc_get_vif_idx(vif), vif->iftype,
631 wilc_get_mac_address(vif, mac_add);
632 netdev_dbg(ndev, "Mac address: %pM\n", mac_add);
633 ether_addr_copy(ndev->dev_addr, mac_add);
635 if (!is_valid_ether_addr(ndev->dev_addr)) {
636 netdev_err(ndev, "Wrong MAC address\n");
637 wilc_deinit_host_int(ndev);
638 wilc_wlan_deinitialize(ndev);
642 wilc_mgmt_frame_register(vif->ndev->ieee80211_ptr->wiphy,
643 vif->ndev->ieee80211_ptr,
644 vif->frame_reg[0].type,
645 vif->frame_reg[0].reg);
646 wilc_mgmt_frame_register(vif->ndev->ieee80211_ptr->wiphy,
647 vif->ndev->ieee80211_ptr,
648 vif->frame_reg[1].type,
649 vif->frame_reg[1].reg);
650 netif_wake_queue(ndev);
652 priv->p2p.local_random = 0x01;
657 static struct net_device_stats *mac_stats(struct net_device *dev)
659 struct wilc_vif *vif = netdev_priv(dev);
661 return &vif->netstats;
664 static void wilc_set_multicast_list(struct net_device *dev)
666 struct netdev_hw_addr *ha;
667 struct wilc_vif *vif = netdev_priv(dev);
672 if (dev->flags & IFF_PROMISC)
675 if (dev->flags & IFF_ALLMULTI ||
676 dev->mc.count > WILC_MULTICAST_TABLE_SIZE) {
677 wilc_setup_multicast_filter(vif, 0, 0, NULL);
681 if (dev->mc.count == 0) {
682 wilc_setup_multicast_filter(vif, 1, 0, NULL);
686 mc_list = kmalloc_array(dev->mc.count, ETH_ALEN, GFP_ATOMIC);
692 netdev_for_each_mc_addr(ha, dev) {
693 memcpy(cur_mc, ha->addr, ETH_ALEN);
694 netdev_dbg(dev, "Entry[%d]: %pM\n", i, cur_mc);
699 if (wilc_setup_multicast_filter(vif, 1, dev->mc.count, mc_list))
703 static void wilc_tx_complete(void *priv, int status)
705 struct tx_complete_data *pv_data = priv;
707 dev_kfree_skb(pv_data->skb);
711 netdev_tx_t wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev)
713 struct wilc_vif *vif = netdev_priv(ndev);
714 struct wilc *wilc = vif->wilc;
715 struct tx_complete_data *tx_data = NULL;
718 if (skb->dev != ndev) {
719 netdev_err(ndev, "Packet not destined to this device\n");
723 tx_data = kmalloc(sizeof(*tx_data), GFP_ATOMIC);
726 netif_wake_queue(ndev);
730 tx_data->buff = skb->data;
731 tx_data->size = skb->len;
734 vif->netstats.tx_packets++;
735 vif->netstats.tx_bytes += tx_data->size;
736 queue_count = wilc_wlan_txq_add_net_pkt(ndev, (void *)tx_data,
737 tx_data->buff, tx_data->size,
740 if (queue_count > FLOW_CONTROL_UPPER_THRESHOLD) {
743 mutex_lock(&wilc->vif_mutex);
744 for (i = 0; i < wilc->vif_num; i++) {
745 if (wilc->vif[i]->mac_opened)
746 netif_stop_queue(wilc->vif[i]->ndev);
748 mutex_unlock(&wilc->vif_mutex);
754 static int wilc_mac_close(struct net_device *ndev)
756 struct wilc_vif *vif = netdev_priv(ndev);
757 struct wilc *wl = vif->wilc;
759 netdev_dbg(ndev, "Mac close\n");
761 if (wl->open_ifcs > 0)
767 netif_stop_queue(vif->ndev);
769 wilc_deinit_host_int(vif->ndev);
772 if (wl->open_ifcs == 0) {
773 netdev_dbg(ndev, "Deinitializing wilc1000\n");
775 wilc_wlan_deinitialize(ndev);
783 void wilc_frmw_to_host(struct wilc *wilc, u8 *buff, u32 size,
786 unsigned int frame_len = 0;
788 unsigned char *buff_to_send = NULL;
790 struct net_device *wilc_netdev;
791 struct wilc_vif *vif;
796 wilc_netdev = get_if_handler(wilc, buff);
801 vif = netdev_priv(wilc_netdev);
807 skb = dev_alloc_skb(frame_len);
811 skb->dev = wilc_netdev;
813 skb_put_data(skb, buff_to_send, frame_len);
815 skb->protocol = eth_type_trans(skb, wilc_netdev);
816 vif->netstats.rx_packets++;
817 vif->netstats.rx_bytes += frame_len;
818 skb->ip_summed = CHECKSUM_UNNECESSARY;
819 stats = netif_rx(skb);
820 netdev_dbg(wilc_netdev, "netif_rx ret value is: %d\n", stats);
824 void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size)
827 struct wilc_vif *vif;
829 mutex_lock(&wilc->vif_mutex);
830 for (i = 0; i < wilc->vif_num; i++) {
831 u16 type = le16_to_cpup((__le16 *)buff);
833 vif = netdev_priv(wilc->vif[i]->ndev);
834 if ((type == vif->frame_reg[0].type && vif->frame_reg[0].reg) ||
835 (type == vif->frame_reg[1].type && vif->frame_reg[1].reg)) {
836 wilc_wfi_p2p_rx(vif, buff, size);
840 if (vif->monitor_flag) {
841 wilc_wfi_monitor_rx(wilc->monitor_dev, buff, size);
845 mutex_unlock(&wilc->vif_mutex);
848 static const struct net_device_ops wilc_netdev_ops = {
849 .ndo_init = mac_init_fn,
850 .ndo_open = wilc_mac_open,
851 .ndo_stop = wilc_mac_close,
852 .ndo_start_xmit = wilc_mac_xmit,
853 .ndo_get_stats = mac_stats,
854 .ndo_set_rx_mode = wilc_set_multicast_list,
857 void wilc_netdev_cleanup(struct wilc *wilc)
864 if (wilc->firmware) {
865 release_firmware(wilc->firmware);
866 wilc->firmware = NULL;
869 for (i = 0; i < wilc->vif_num; i++) {
870 if (wilc->vif[i] && wilc->vif[i]->ndev)
871 unregister_netdev(wilc->vif[i]->ndev);
874 wilc_wfi_deinit_mon_interface(wilc, false);
875 flush_workqueue(wilc->hif_workqueue);
876 destroy_workqueue(wilc->hif_workqueue);
877 wilc_wlan_cfg_deinit(wilc);
878 kfree(wilc->bus_data);
879 wiphy_unregister(wilc->wiphy);
880 wiphy_free(wilc->wiphy);
882 EXPORT_SYMBOL_GPL(wilc_netdev_cleanup);
884 struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name,
885 int vif_type, enum nl80211_iftype type,
888 struct net_device *ndev;
889 struct wilc_vif *vif;
892 ndev = alloc_etherdev(sizeof(*vif));
894 return ERR_PTR(-ENOMEM);
896 vif = netdev_priv(ndev);
897 ndev->ieee80211_ptr = &vif->priv.wdev;
898 strcpy(ndev->name, name);
903 ndev->netdev_ops = &wilc_netdev_ops;
905 SET_NETDEV_DEV(ndev, wiphy_dev(wl->wiphy));
907 vif->priv.wdev.wiphy = wl->wiphy;
908 vif->priv.wdev.netdev = ndev;
909 vif->priv.wdev.iftype = type;
910 vif->priv.dev = ndev;
913 ret = register_netdevice(ndev);
915 ret = register_netdev(ndev);
919 return ERR_PTR(-EFAULT);
922 ndev->needs_free_netdev = true;
923 vif->iftype = vif_type;
924 vif->wilc->vif[wl->vif_num] = vif;
925 vif->idx = wl->vif_num;
931 MODULE_LICENSE("GPL");