Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278037
b: refs/heads/master
c: 108438b
h: refs/heads/master
i:
  278035: 7ae61a1
v: v3
  • Loading branch information
Vasanthakumar Thiagarajan authored and Kalle Valo committed Nov 11, 2011
1 parent c29cd65 commit 624337b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dd3751f7b1036c24e0d44167482bbf4d60935d24
refs/heads/master: 108438bc6ad16b3962aa5009123cd810d1c1f643
41 changes: 24 additions & 17 deletions trunk/drivers/net/wireless/ath/ath6kl/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -2015,59 +2015,66 @@ int ath6kl_register_ieee80211_hw(struct ath6kl *ar)
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))
Expand All @@ -2081,7 +2088,7 @@ struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name,
return ndev;

err:
ath6kl_deinit_if_data(ar, ndev);
ath6kl_deinit_if_data(vif);

return NULL;
}
Expand Down
11 changes: 9 additions & 2 deletions trunk/drivers/net/wireless/ath/ath6kl/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,12 @@ struct ath6kl_req_key {
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
Expand Down Expand Up @@ -410,6 +416,7 @@ struct ath6kl {
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;
Expand Down Expand Up @@ -543,7 +550,7 @@ struct ath6kl {

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
Expand Down Expand Up @@ -643,6 +650,6 @@ void ath6kl_wakeup_event(void *dev);
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 */
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/ath/ath6kl/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ static int ath6kl_init(struct ath6kl *ar)
err_cleanup_scatter:
ath6kl_hif_cleanup_scatter(ar);
err_if_deinit:
ath6kl_deinit_if_data(ar, ndev);
ath6kl_deinit_if_data(netdev_priv(ndev));
wiphy_unregister(ar->wiphy);
err_debug_init:
ath6kl_debug_cleanup(ar);
Expand Down Expand Up @@ -1632,7 +1632,7 @@ void ath6kl_destroy(struct net_device *dev, unsigned int unregister)

ath6kl_debug_cleanup(ar);

ath6kl_deinit_if_data(ar, dev);
ath6kl_deinit_if_data(netdev_priv(dev));

kfree(ar->fw_board);
kfree(ar->fw_otp);
Expand Down

0 comments on commit 624337b

Please sign in to comment.