return 0;
}
-static int ath6kl_init_if_data(struct ath6kl *ar, struct net_device *ndev)
+static int ath6kl_init_if_data(struct ath6kl_vif *vif)
{
- ar->aggr_cntxt = aggr_init(ndev);
+ struct ath6kl *ar = vif->ar;
+
+ ar->aggr_cntxt = aggr_init(vif->ndev);
if (!ar->aggr_cntxt) {
ath6kl_err("failed to initialize aggr\n");
return -ENOMEM;
}
setup_timer(&ar->disconnect_timer, disconnect_timer_handler,
- (unsigned long) ndev);
+ (unsigned long) vif->ndev);
return 0;
}
-void ath6kl_deinit_if_data(struct ath6kl *ar, struct net_device *ndev)
+void ath6kl_deinit_if_data(struct ath6kl_vif *vif)
{
+ struct ath6kl *ar = vif->ar;
+
aggr_module_destroy(ar->aggr_cntxt);
ar->aggr_cntxt = NULL;
if (test_bit(NETDEV_REGISTERED, &ar->flag)) {
- unregister_netdev(ndev);
+ unregister_netdev(vif->ndev);
clear_bit(NETDEV_REGISTERED, &ar->flag);
}
- free_netdev(ndev);
+ free_netdev(vif->ndev);
}
struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name,
enum nl80211_iftype type)
{
struct net_device *ndev;
- struct wireless_dev *wdev;
+ struct ath6kl_vif *vif;
- ndev = alloc_netdev(sizeof(*wdev), "wlan%d", ether_setup);
+ ndev = alloc_netdev(sizeof(*vif), "wlan%d", ether_setup);
if (!ndev)
return NULL;
- wdev = netdev_priv(ndev);
- ndev->ieee80211_ptr = wdev;
- wdev->wiphy = ar->wiphy;
- SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
- wdev->netdev = ndev;
- wdev->iftype = type;
- ar->wdev = wdev;
+ vif = netdev_priv(ndev);
+ ndev->ieee80211_ptr = &vif->wdev;
+ vif->wdev.wiphy = ar->wiphy;
+ vif->ar = ar;
+ ar->vif = vif;
+ vif->ndev = ndev;
+ SET_NETDEV_DEV(ndev, wiphy_dev(vif->wdev.wiphy));
+ vif->wdev.netdev = ndev;
+ vif->wdev.iftype = type;
+ ar->wdev = &vif->wdev;
ar->net_dev = ndev;
init_netdev(ndev);
ath6kl_init_control_info(ar);
/* TODO: Pass interface specific pointer instead of ar */
- if (ath6kl_init_if_data(ar, ndev))
+ if (ath6kl_init_if_data(vif))
goto err;
if (register_netdev(ndev))
return ndev;
err:
- ath6kl_deinit_if_data(ar, ndev);
+ ath6kl_deinit_if_data(vif);
return NULL;
}
u8 key_len;
};
+struct ath6kl_vif {
+ struct wireless_dev wdev;
+ struct net_device *ndev;
+ struct ath6kl *ar;
+};
+
/* Flag info */
#define WMI_ENABLED 0
#define WMI_READY 1
int total_tx_data_pend;
struct htc_target *htc_target;
void *hif_priv;
+ struct ath6kl_vif *vif;
spinlock_t lock;
struct semaphore sem;
int ssid_len;
static inline void *ath6kl_priv(struct net_device *dev)
{
- return wdev_priv(dev->ieee80211_ptr);
+ return ((struct ath6kl_vif *) netdev_priv(dev))->ar;
}
static inline void ath6kl_deposit_credit_to_ep(struct htc_credit_state_info
void ath6kl_target_failure(struct ath6kl *ar);
void ath6kl_init_control_info(struct ath6kl *ar);
-void ath6kl_deinit_if_data(struct ath6kl *ar, struct net_device *ndev);
+void ath6kl_deinit_if_data(struct ath6kl_vif *vif);
void ath6kl_core_free(struct ath6kl *ar);
#endif /* CORE_H */